From 37a6a105006012b98b805104f03fde5b71a10eef Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 19 May 2018 12:59:15 -0400 Subject: [PATCH] Fix some bugs with codim = 1 GNUPLOT output. --- include/deal.II/grid/grid_out.h | 5 ++--- source/grid/grid_out.cc | 9 ++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/deal.II/grid/grid_out.h b/include/deal.II/grid/grid_out.h index 3c976177e8..018abf2200 100644 --- a/include/deal.II/grid/grid_out.h +++ b/include/deal.II/grid/grid_out.h @@ -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 void write_gnuplot (const Triangulation &tria, diff --git a/source/grid/grid_out.cc b/source/grid/grid_out.cc index 3f09caab8d..116867e0e5 100644 --- a/source/grid/grid_out.cc +++ b/source/grid/grid_out.cc @@ -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::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 -- 2.39.5