void write_xfig (const Triangulation<dim> &tria,
std::ostream &out,
const Mapping<dim> *mapping=0);
+
/**
- * Write data and grid to @p out according
- * to the given data format. This function
- * simply calls the appropriate
- * <tt>write_*</tt> function.
+ * Write grid to @p out according
+ * to the given data format. This
+ * function simply calls the
+ * appropriate <tt>write_*</tt>
+ * function.
*/
template <int dim>
void write (const Triangulation<dim> &tria,
std::ostream &out,
const OutputFormat output_format,
const Mapping<dim> *mapping=0);
-
+
+ /**
+ * Write mesh in default format
+ * set by ParameterHandler.
+ */
+ template <int dim>
+ void write (const Triangulation<dim> &tria,
+ std::ostream &out,
+ const Mapping<dim> *mapping=0);
+
/**
* Set flags for DX output
*/
*/
static std::string default_suffix (const OutputFormat output_format);
+ /**
+ * Default suffix for the default
+ * output format selected throuw
+ * ParameterHandler.
+ */
+ std::string default_suffix () const;
+
/**
* Return the @p OutputFormat value
* corresponding to the given string. If
DeclException0 (ExcInvalidState);
private:
+ /**
+ * The default output format, set
+ * by a ParameterHandler.
+ */
+ OutputFormat default_format;
+
/**
* Flags for OpenDX output.
*/
void DX::declare_parameters (ParameterHandler& param)
{
- param.declare_entry("Write cells", "true", Patterns::Bool());
- param.declare_entry("Write faces", "false", Patterns::Bool());
- param.declare_entry("Write diameter", "false", Patterns::Bool());
- param.declare_entry("Write measure", "false", Patterns::Bool());
- param.declare_entry("Write all faces", "true", Patterns::Bool());
+ param.declare_entry("Write cells", "true", Patterns::Bool(),
+ "Write the mesh connectivity as DX grid cells");
+ param.declare_entry("Write faces", "false", Patterns::Bool(),
+ "Write faces of cells. These may be boundary faces\n"
+ "or all faces between mesh cells, according to\n"
+ "\"Write all faces\"");
+ param.declare_entry("Write diameter", "false", Patterns::Bool(),
+ "If cells are written, additionally write their"
+ " diameter\nas data for visualization");
+ param.declare_entry("Write measure", "false", Patterns::Bool(),
+ "Write the volume of each cell as data");
+ param.declare_entry("Write all faces", "true", Patterns::Bool(),
+ "Write all faces, not only boundary");
}
void DX::parse_parameters (ParameterHandler& param)
void EpsFlagsBase::declare_parameters (ParameterHandler& param)
{
param.declare_entry("Size by", "width",
- Patterns::Selection("width|height"));
- param.declare_entry("Size", "300", Patterns::Integer());
- param.declare_entry("Line width", "0.5", Patterns::Double());
- param.declare_entry("Color by flag", "false", Patterns::Bool());
- param.declare_entry("Boundary points", "2", Patterns::Integer());
- param.declare_entry("Color by level", "false", Patterns::Bool());
+ Patterns::Selection("width|height"),
+ "Depending on this parameter, either the"
+ "width or height\n"
+ "of the eps is scaled to \"Size\"");
+ param.declare_entry("Size", "300", Patterns::Integer(),
+ "Size of the output in points");
+ param.declare_entry("Line width", "0.5", Patterns::Double(),
+ "Width of the lines drawn in points");
+ param.declare_entry("Color by flag", "false", Patterns::Bool(),
+ "Draw lines with user flag set in different color");
+ param.declare_entry("Boundary points", "2", Patterns::Integer(),
+ "Number of points on boundary edges.\n"
+ "Increase this beyond 2 to see curved boundaries.");
+ param.declare_entry("Color by level", "false", Patterns::Bool(),
+ "Draw different colors according to grid level.");
}
void Eps<2>::declare_parameters (ParameterHandler& param)
{
- param.declare_entry("Cell number", "false", Patterns::Bool());
- param.declare_entry("Level number", "false", Patterns::Bool());
- param.declare_entry("Vertex number", "false", Patterns::Bool());
+ param.declare_entry("Cell number", "false", Patterns::Bool(),
+ "(2D only) Write cell numbers"
+ " into the centers of cells");
+ param.declare_entry("Level number", "false", Patterns::Bool(),
+ "(2D only) if \"Cell number\" is true, write"
+ "numbers in the form level.number");
+ param.declare_entry("Vertex number", "false", Patterns::Bool(),
+ "Write numbers for each vertex");
}
void Eps<3>::declare_parameters (ParameterHandler& param)
{
- param.declare_entry("Azimut angle", "60", Patterns::Double());
- param.declare_entry("Turn angle", "30", Patterns::Double());
+ param.declare_entry("Azimuth", "30", Patterns::Double(),
+ "Azimuth of the viw point, that is, the angle\n"
+ "in the plane from the x-axis.");
+ param.declare_entry("Elevation", "30", Patterns::Double(),
+ "Elevation of the view point above the xy-plane.");
}
void Eps<3>::parse_parameters (ParameterHandler& param)
{
EpsFlagsBase::parse_parameters(param);
- azimut_angle = param.get_double("Azimut angle");
+ azimut_angle = 90- param.get_double("Elevation");
turn_angle = param.get_double("Turn angle");
}
+std::string
+GridOut::default_suffix () const
+{
+ return default_suffix(default_format);
+}
+
+
+
GridOut::OutputFormat
GridOut::parse_output_format (const std::string &format_name)
{
}
+
+void
+GridOut::parse_parameters(ParameterHandler& param)
+{
+ default_format = parse_output_format(param.get("Format"));
+
+ param.enter_subsection("DX");
+ dx_flags.parse_parameters(param);
+ param.leave_subsection();
+
+ param.enter_subsection("Msh");
+ msh_flags.parse_parameters(param);
+ param.leave_subsection();
+
+ param.enter_subsection("Ucd");
+ ucd_flags.parse_parameters(param);
+ param.leave_subsection();
+
+ param.enter_subsection("Gnuplot");
+ gnuplot_flags.parse_parameters(param);
+ param.leave_subsection();
+
+ param.enter_subsection("Eps");
+ eps_flags_1.parse_parameters(param);
+ eps_flags_2.parse_parameters(param);
+ eps_flags_3.parse_parameters(param);
+ param.leave_subsection();
+
+ param.enter_subsection("XFig");
+ xfig_flags.parse_parameters(param);
+ param.leave_subsection();
+}
+
+
+
unsigned int
GridOut::memory_consumption () const
{
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#endif
- template <int dim>
-void GridOut::write (const Triangulation<dim> &tria,
- std::ostream &out,
- const OutputFormat output_format,
- const Mapping<dim> *mapping)
+template <int dim>
+void GridOut::write (
+ const Triangulation<dim> &tria,
+ std::ostream &out,
+ const OutputFormat output_format,
+ const Mapping<dim> *mapping)
{
- switch (output_format)
+ switch (output_format)
{
- case none:
- return;
-
- case dx:
- write_dx (tria, out);
- return;
-
- case ucd:
- write_ucd (tria, out);
- return;
-
- case gnuplot:
- write_gnuplot (tria, out, mapping);
- return;
-
- case eps:
- write_eps (tria, out, mapping);
- return;
-
- case xfig:
- write_xfig (tria, out, mapping);
- return;
-
- case msh:
- write_msh (tria, out);
- return;
+ case none:
+ return;
+
+ case dx:
+ write_dx (tria, out);
+ return;
+
+ case ucd:
+ write_ucd (tria, out);
+ return;
+
+ case gnuplot:
+ write_gnuplot (tria, out, mapping);
+ return;
+
+ case eps:
+ write_eps (tria, out, mapping);
+ return;
+
+ case xfig:
+ write_xfig (tria, out, mapping);
+ return;
+
+ case msh:
+ write_msh (tria, out);
+ return;
}
-
- Assert (false, ExcInternalError());
+
+ Assert (false, ExcInternalError());
}
+template <int dim>
+void GridOut::write (
+ const Triangulation<dim> &tria,
+ std::ostream &out,
+ const Mapping<dim> *mapping)
+{
+ write(tria, out, default_format, mapping);
+}
// explicit instantiations
template void GridOut::write_ucd<deal_II_dimension>
#endif
template void GridOut::write<deal_II_dimension>
(const Triangulation<deal_II_dimension> &,
- std::ostream &,
- const OutputFormat,
+ std::ostream &, const OutputFormat,
const Mapping<deal_II_dimension> *);
+template void GridOut::write<deal_II_dimension>
+(const Triangulation<deal_II_dimension> &,
+ std::ostream &, const Mapping<deal_II_dimension> *);