]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Simplification of code in GridOut<2>::write_gnuplot. No change of output.
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 20 Sep 2004 09:18:58 +0000 (09:18 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 20 Sep 2004 09:18:58 +0000 (09:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@9645 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 29edc5481472366ac060f9369703730d6c2c80e0..0ff5a2e586e39ffc010c3bbba01e659ab69393e2 100644 (file)
@@ -613,8 +613,9 @@ void GridOut::write_gnuplot (const Triangulation<dim> &tria,
 {
   AssertThrow (out, ExcIO());
 
-  const unsigned int n_points=
+  const unsigned int n_additional_points=
     gnuplot_flags.n_boundary_face_points;
+  const unsigned int n_points=GeometryInfo<dim>::vertices_per_face+n_additional_points;
 
   typename Triangulation<dim>::active_cell_iterator        cell=tria.begin_active();
   const typename Triangulation<dim>::active_cell_iterator  endc=tria.end();
@@ -628,8 +629,10 @@ void GridOut::write_gnuplot (const Triangulation<dim> &tria,
   if (mapping!=0)
     {
       std::vector<Point<dim-1> > boundary_points(n_points);
-      for (unsigned int i=0; i<n_points; ++i)
-       boundary_points[i](0)= 1.*(i+1)/(n_points+1);
+      boundary_points[0][0]=0;
+      boundary_points[n_points-1][0]=1;      
+      for (unsigned int i=1; i<n_points-1; ++i)
+        boundary_points[i](0)= 1.*i/(n_points-1);
 
       Quadrature<dim-1> quadrature(boundary_points);
       q_projector = new Quadrature<dim> (QProjector<dim>::project_to_all_faces(quadrature));
@@ -695,11 +698,6 @@ void GridOut::write_gnuplot (const Triangulation<dim> &tria,
                      face = cell->face(face_no);
                    if (face->at_boundary())
                      {
-                       out << face->vertex(0)
-                           << ' ' << cell->level()
-                           << ' ' << static_cast<unsigned int>(cell->material_id())
-                           << std::endl;
-
                                                          // compute
                                                          // offset of
                                                          // quadrature
@@ -735,12 +733,8 @@ void GridOut::write_gnuplot (const Triangulation<dim> &tria,
                              << ' ' << cell->level()
                              << ' ' << static_cast<unsigned int>(cell->material_id())
                              << std::endl;
-                       
-                       out << face->vertex(1)
-                           << ' ' << cell->level()
-                           << ' ' << static_cast<unsigned int>(cell->material_id())
-                           << std::endl
-                           << std::endl
+
+                       out << std::endl
                            << std::endl;
                      }
                    else

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.