]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix some bugs with codim = 1 GNUPLOT output.
authorDavid Wells <drwells@vt.edu>
Sat, 19 May 2018 16:59:15 +0000 (12:59 -0400)
committerDavid Wells <drwells@vt.edu>
Sun, 20 May 2018 21:01:58 +0000 (17:01 -0400)
include/deal.II/grid/grid_out.h
source/grid/grid_out.cc

index 3c976177e8fad9dd8113454a037065c7f2a9e92b..018abf22009d2d2dd1d9db24f4120a900cd33a6e 100644 (file)
@@ -964,9 +964,8 @@ public:
    * at the boundary. If zero, then use standard Q1 mapping.
    *
    * Names and values of additional flags controlling the output can be found
-   * in the documentation of the GridOutFlags::Gnuplot() class.
-   *
-   * Not implemented for the codimension one case.
+   * in the documentation of the GridOutFlags::Gnuplot class, which also
+   * describes some caveats for the codimension one case.
    */
   template <int dim, int spacedim>
   void write_gnuplot (const Triangulation<dim,spacedim> &tria,
index 3f09caab8d07643b3ff2edf307e28372e7343a84..116867e0e5bcd03c5f7e3bdd56976f4e0e999379 100644 (file)
@@ -3264,8 +3264,11 @@ namespace internal
           if (gnuplot_flags.write_cell_numbers)
             out << "# cell " << cell << '\n';
 
-          if (mapping==nullptr ||
-              (!cell->at_boundary() && !gnuplot_flags.curved_inner_cells))
+          if (mapping == nullptr ||
+              (dim == spacedim ? (!cell->at_boundary() && !gnuplot_flags.curved_inner_cells) :
+               // ignore checking for boundary or interior cells in the codim
+               // 1 case: 'or false' is a no-op
+               false))
             {
               // write out the four sides of this cell by putting the four
               // points (+ the initial point again) in a row and lifting the
@@ -3289,7 +3292,7 @@ namespace internal
                 {
                   const typename dealii::Triangulation<dim,spacedim>::face_iterator
                   face = cell->face(face_no);
-                  if (face->at_boundary() || gnuplot_flags.curved_inner_cells)
+                  if (dim != spacedim || face->at_boundary() || gnuplot_flags.curved_inner_cells)
                     {
                       // Save the points on each face to a vector and then try
                       // to remove colinear points that won't show up in the

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.