]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Replace line based output in GridOut<3>::write_gnuplot by face based output. lines...
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 20 Sep 2004 09:43:59 +0000 (09:43 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 20 Sep 2004 09:43:59 +0000 (09:43 +0000)
git-svn-id: https://svn.dealii.org/trunk@9646 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/grid_out.cc

index 0ff5a2e586e39ffc010c3bbba01e659ab69393e2..6a131f88a67abd0cd8dc5df3504f190565560e7f 100644 (file)
@@ -768,72 +768,20 @@ void GridOut::write_gnuplot (const Triangulation<dim> &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<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(1)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(2)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(3)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(0)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << std::endl;
-                                            // back face
-           out << cell->vertex(4)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(5)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(6)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(7)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(4)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << std::endl;
-           
-                                            // now for the four connecting lines
-           out << cell->vertex(0)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(4)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << std::endl;
-           out << cell->vertex(1)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(5)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << std::endl;
-           out << cell->vertex(2)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(6)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << std::endl;
-           out << cell->vertex(3)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << cell->vertex(7)
-               << ' ' << cell->level()
-               << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl
-               << std::endl;
+           Assert (mapping == 0, ExcNotImplemented());     
+            
+            for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
+              {
+                const typename Triangulation<dim>::face_iterator
+                  face = cell->face(face_no);
+
+                for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+                  out << face->vertex(v)
+                      << ' ' << cell->level()
+                      << ' ' << static_cast<unsigned int>(cell->material_id()) << std::endl;
+                out << std::endl;
+                out << std::endl;
+              }
            break;
          };
        };

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.