template <int dim>
class DataOut {
public:
+ /**
+ * Provide a data type specifying the
+ * presently supported output formats.
+ */
+ enum OutputFormat { ucd, gnuplot };
+
/**
* Constructor
*/
* Write data and grid in GNUPLOT format.
*/
void write_gnuplot (ostream &out) const;
+
+ /**
+ * Write data and grid to #out# according
+ * to the given data format. This function
+ * simply calles the appropriate
+ * #write_*# function.
+ */
+ void write (ostream &out, const OutputFormat output_format) const;
+
+ /**
+ * Provide a function which tells us which
+ * suffix with a given output format
+ * usually has. At present the following
+ * formats are defined:
+ * \begin{itemize}
+ * \item UCD: #.inp#
+ * \item GNUPLOT: #.gnuplot#
+ * \end{itemize}
+ *
+ * Since this function does not need data
+ * from this object, it is static and can
+ * thus be called without creating an
+ * object of this class.
+ */
+ static string default_suffix (const OutputFormat output_format);
/**
* Exception
+
+
/*---------------------------- io.h ---------------------------*/
/* end of #ifndef __data_io_H */
+template <int dim>
+void DataOut<dim>::write (ostream &out,
+ const OutputFormat output_format) const {
+ switch (output_format)
+ {
+ case ucd:
+ write_ucd (out);
+ break;
+ case gnuplot:
+ write_gnuplot (out);
+ break;
+ };
+};
+
+
+
+template <int dim>
+string DataOut<dim>::default_suffix (const OutputFormat output_format) {
+ switch (output_format)
+ {
+ case ucd:
+ return ".inp";
+ case gnuplot:
+ return ".gnuplot";
+ };
+};
+
+
+
//explicite instantiations
template class DataIn<1>;