From 4fa7941b20f39a8944b54cd54dd435c845de5b42 Mon Sep 17 00:00:00 2001 From: hartmann Date: Mon, 20 Sep 2004 09:43:59 +0000 Subject: [PATCH] Replace line based output in GridOut<3>::write_gnuplot by face based output. lines are given twice but no change in gnuplot view. git-svn-id: https://svn.dealii.org/trunk@9646 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/grid/grid_out.cc | 80 +++++-------------------- 1 file changed, 14 insertions(+), 66 deletions(-) diff --git a/deal.II/deal.II/source/grid/grid_out.cc b/deal.II/deal.II/source/grid/grid_out.cc index 0ff5a2e586..6a131f88a6 100644 --- a/deal.II/deal.II/source/grid/grid_out.cc +++ b/deal.II/deal.II/source/grid/grid_out.cc @@ -768,72 +768,20 @@ void GridOut::write_gnuplot (const Triangulation &tria, case 3: { //TODO:[RH] curved boundaries in 3d gnuplot not supported - Assert (mapping == 0, ExcNotImplemented()); - - // front face - out << cell->vertex(0) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(1) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(2) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(3) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(0) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << std::endl; - // back face - out << cell->vertex(4) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(5) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(6) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(7) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(4) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << std::endl; - - // now for the four connecting lines - out << cell->vertex(0) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(4) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << std::endl; - out << cell->vertex(1) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(5) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << std::endl; - out << cell->vertex(2) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(6) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << std::endl; - out << cell->vertex(3) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << cell->vertex(7) - << ' ' << cell->level() - << ' ' << static_cast(cell->material_id()) << std::endl - << std::endl; + Assert (mapping == 0, ExcNotImplemented()); + + for (unsigned int face_no=0; face_no::faces_per_cell; ++face_no) + { + const typename Triangulation::face_iterator + face = cell->face(face_no); + + for (unsigned int v=0; v::vertices_per_face; ++v) + out << face->vertex(v) + << ' ' << cell->level() + << ' ' << static_cast(cell->material_id()) << std::endl; + out << std::endl; + out << std::endl; + } break; }; }; -- 2.39.5