*/
bool write_cell_numbers;
+ /**
+ * Number of points, <em>excluding</em> the vertices, to plot on curved
+ * lines. Since GNUPLOT can only plot straight lines, setting this number
+ * to a value greater than zero (4 or 5 is usually enough for refined
+ * grids) makes the plot look curved even though it is not.
+ */
+ unsigned int n_extra_curved_line_points;
+
/**
* Based on the vertices of the face and #n_boundary_face_points
* additional points a tensor product mesh (transformed to the real space)
* of (#n_boundary_face_points+2)<sup>dim-1</sup> points is plotted on
* each boundary face.
+ *
+ * @deprecated Use n_extra_curved_line_points instead, which has
+ * a more precise name. For compatibility this is implemented as a
+ * reference to n_extra_curved_line_points.
*/
- unsigned int n_boundary_face_points;
+ DEAL_II_DEPRECATED unsigned int &n_boundary_face_points;
/**
- * Flag. If true also inner cells are plotted with curved boundaries. This
- * is useful when for e.g. MappingQEulerian with
- * #n_boundary_face_points>.
+ * Boolean indicating whether or not interior lines should be plotted with
+ * <tt>n_extra_curved_line_points</tt> line segments.
*/
bool curved_inner_cells;
+ /**
+ * Flag. If true then, when writing <tt>spacedim = 3</tt> output, write
+ * <tt>2*n_extra_curved_line_points</tt> extra lines on boundary faces.
+ *
+ * Setting this option has no effect when <tt>spacedim = 2</tt> since, in
+ * that case, boundary faces are lines and outputting additional lines
+ * does not make sense.
+ *
+ * @note This is not yet implemented for the <tt>dim = 2</tt> case. For
+ * backwards compatibility, however, this will not raise a runtime error.
+ */
+ bool write_additional_boundary_lines;
+
/**
* Constructor.
*/
Gnuplot (const bool write_cell_number = false,
- const unsigned int n_boundary_face_points = 2,
- const bool curved_inner_cells = false);
+ const unsigned int n_extra_curved_line_points = 2,
+ const bool curved_inner_cells = false,
+ const bool write_additional_boundary_lines = true);
+
+ /**
+ * Copy constructor. Needed since this class (for backwards compatibility)
+ * has a reference member variable.
+ */
+ Gnuplot (const Gnuplot &flags);
+
+ /**
+ * Move constructor. Needed since this class (for backwards compatibility)
+ * has a reference member variable.
+ */
+ Gnuplot (Gnuplot &&flags);
+
+ /**
+ * Copy operator. Needed since this class (for backwards compatibility)
+ * has a reference member variable.
+ */
+ Gnuplot &
+ operator= (const Gnuplot &flags);
+
+ /**
+ * Move assignment operator. Needed since this class (for backwards
+ * compatibility) has a reference member variable.
+ */
+ Gnuplot &
+ operator= (Gnuplot &&flags);
+
/**
* Declare parameters in ParameterHandler.
*/
}
- Gnuplot::Gnuplot (const bool write_cell_numbers,
- const unsigned int n_boundary_face_points,
- const bool curved_inner_cells) :
+
+ Gnuplot::Gnuplot (const bool write_cell_numbers,
+ const unsigned int n_extra_curved_line_points,
+ const bool curved_inner_cells,
+ const bool write_additional_boundary_lines) :
write_cell_numbers (write_cell_numbers),
- n_boundary_face_points(n_boundary_face_points),
- curved_inner_cells(curved_inner_cells)
+ n_extra_curved_line_points(n_extra_curved_line_points),
+ n_boundary_face_points(this->n_extra_curved_line_points),
+ curved_inner_cells(curved_inner_cells),
+ write_additional_boundary_lines(write_additional_boundary_lines)
+ {}
+
+
+ // TODO we can get rid of these extra constructors and assignment operators
+ // once we remove the reference member variable.
+ Gnuplot::Gnuplot(const Gnuplot &flags) :
+ Gnuplot(flags.write_cell_numbers,
+ flags.n_extra_curved_line_points,
+ flags.curved_inner_cells,
+ flags.write_additional_boundary_lines)
{}
+ Gnuplot::Gnuplot(Gnuplot &&flags) :
+ Gnuplot(static_cast<const Gnuplot &>(flags))
+ {}
+
+
+
+ Gnuplot &
+ Gnuplot::operator=(const Gnuplot &flags)
+ {
+ write_cell_numbers = flags.write_cell_numbers;
+ n_extra_curved_line_points = flags.n_extra_curved_line_points;
+ curved_inner_cells = flags.curved_inner_cells;
+ write_additional_boundary_lines = flags.write_additional_boundary_lines;
+
+ return *this;
+ }
+
+
+
+ Gnuplot &
+ Gnuplot::operator=(Gnuplot &&flags)
+ {
+ return operator=(static_cast<const Gnuplot &>(flags));
+ }
+
+
+
void Gnuplot::declare_parameters (ParameterHandler ¶m)
{
param.declare_entry("Cell number", "false", Patterns::Bool());
}
else
{
- // if, however, the face is not at the boundary, then
- // draw it as usual
+ // if, however, the face is not at the boundary and we
+ // don't want to curve anything, then draw it as usual
out << face->vertex(0)
<< ' ' << cell->level()
<< ' ' << static_cast<unsigned int>(cell->material_id())
const typename dealii::Triangulation<dim,spacedim>::face_iterator
face = cell->face(face_no);
- if (face->at_boundary())
+ if (face->at_boundary() && gnuplot_flags.write_additional_boundary_lines)
{
const unsigned int offset=face_no*n_points*n_points;
for (unsigned int i=0; i<n_points-1; ++i)