// void parse_parameters (ParameterHandler ¶m);
};
+ /**
+ * Flags for grid output in MathGL format.
+ *
+ * @ingroup output
+ */
+ struct MathGL
+ {
+ /**
+ * Constructor.
+ */
+ MathGL ();
+
+ /**
+ * Declare parameters in ParameterHandler.
+ */
+ static void declare_parameters (ParameterHandler ¶m);
+
+ /**
+ * Parse parameters of ParameterHandler.
+ */
+ void parse_parameters (ParameterHandler ¶m);
+ };
+
}
/// write() calls write_msh()
msh,
/// write() calls write_svg()
- svg
- /// write() calls write_svg()
+ svg,
+ /// write() calls write_mathgl()
+ mathgl
};
/**
void write_svg (const Triangulation<2,2> &tria,
std::ostream &out) const;
+ /**
+ * Write triangulation in MathGL format.
+ *
+ * Not implemented for the codimension one case.
+ */
+ template <int dim>
+ void write_mathgl (const Triangulation<dim> &tria,
+ std::ostream &out) const;
+
/**
* Write grid to @p out according to the given data format. This
* function simply calls the appropriate <tt>write_*</tt> function.
*/
void set_flags (const GridOutFlags::Svg &flags);
+ /**
+ * Set flags for MathGL output
+ */
+ void set_flags (const GridOutFlags::MathGL &flags);
+
/**
* Provide a function which tells us which
* suffix with a given output format
*/
GridOutFlags::Svg svg_flags;
+ /**
+ * Flags for OpenDX output.
+ */
+ GridOutFlags::MathGL mathgl_flags;
+
/**
* Write the grid information about faces to @p out. Only those
* faces are printed which are on the boundary and which have a
draw_legend(draw_legend)
{}
+ MathGL::MathGL ()
+ {}
+
+ void MathGL::declare_parameters (ParameterHandler ¶m)
+ {}
+
+ void MathGL::parse_parameters (ParameterHandler ¶m)
+ {}
} // end namespace GridOutFlags
}
-
void GridOut::set_flags (const GridOutFlags::Svg &flags)
{
svg_flags = flags;
}
+void GridOut::set_flags (const GridOutFlags::MathGL &flags)
+{
+ mathgl_flags = flags;
+}
+
std::string
GridOut::default_suffix (const OutputFormat output_format)
{
return ".msh";
case svg:
return ".svg";
+ case mathgl:
+ return ".mathgl";
default:
Assert (false, ExcNotImplemented());
return "";
if (format_name == "svg")
return svg;
+ if (format_name == "mathgl")
+ return mathgl;
+
AssertThrow (false, ExcInvalidState ());
// return something weird
return OutputFormat(-1);
std::string GridOut::get_output_format_names ()
{
- return "none|dx|gnuplot|eps|ucd|xfig|msh|svg";
+ return "none|dx|gnuplot|eps|ucd|xfig|msh|svg|mathgl";
}
param.enter_subsection("XFig");
GridOutFlags::XFig::declare_parameters(param);
param.leave_subsection();
+
+ param.enter_subsection("MathGl");
+ GridOutFlags::MathGL::declare_parameters(param);
+ param.leave_subsection();
}
param.enter_subsection("XFig");
xfig_flags.parse_parameters(param);
param.leave_subsection();
+
+ param.enter_subsection("MathGL");
+ mathgl_flags.parse_parameters(param);
+ param.leave_subsection();
}
std::size_t
GridOut::memory_consumption () const
{
- return (sizeof(dx_flags) +
- sizeof(msh_flags) +
- sizeof(ucd_flags) +
+ return (sizeof(dx_flags) +
+ sizeof(msh_flags) +
+ sizeof(ucd_flags) +
sizeof(gnuplot_flags) +
- sizeof(eps_flags_1) +
- sizeof(eps_flags_2) +
- sizeof(eps_flags_3) +
- sizeof(xfig_flags));
+ sizeof(eps_flags_1) +
+ sizeof(eps_flags_2) +
+ sizeof(eps_flags_3) +
+ sizeof(xfig_flags) +
+ sizeof(mathgl_flags));
}
}
+template <>
+void GridOut::write_mathgl (const Triangulation<1> &,
+ std::ostream &) const
+{
+ Assert (false, ExcNotImplemented());
+}
+
+
+template <int dim>
+void GridOut::write_mathgl (const Triangulation<dim> &tria,
+ std::ostream &out) const
+{
+ Assert (false, ExcNotImplemented());
+}
+
unsigned int GridOut::n_boundary_faces (const Triangulation<1> &) const
{
case svg:
write_svg (tria, out);
return;
+
+ case mathgl:
+ write_mathgl (tria, out);
+ return;
}
Assert (false, ExcInternalError());