#define __deal2__dof_output_operator_h
#include <deal.II/base/config.h>
+#include <deal.II/base/parameter_handler.h>
#include <deal.II/base/named_data.h>
#include <deal.II/algorithms/any_data.h>
#include <deal.II/base/event.h>
class DoFOutputOperator : public OutputOperator<VECTOR>
{
public:
- /*
- * Constructor. The <tt>filename</tt> is the common base name of all
- * files and the argument <tt>digits</tt> should be the number of digits
- * of the highest number in the sequence. File names by default
- * have the form "outputNN" with NNN the number set by the last
- * step command. Numbers with less digits are filled with zeros
- * from the left.
- */
- DoFOutputOperator (const std::string filename_base = std::string("output"),
- const unsigned int digits = 3);
-
+ /*
+ * Constructor. The <tt>filename</tt> is the common base name of
+ * all files and the argument <tt>digits</tt> should be the number
+ * of digits of the highest number in the sequence. File names by
+ * default have the form "outputNN" with NNN the number set by the
+ * last step command. Numbers with less digits are filled with
+ * zeros from the left.
+ */
+ DoFOutputOperator (const std::string filename_base = std::string("output"),
+ const unsigned int digits = 3);
+
+ void parse_parameters(ParameterHandler ¶m);
void initialize (DoFHandler<dim, spacedim> &dof_handler);
virtual OutputOperator<VECTOR> &
private:
SmartPointer<DoFHandler<dim, spacedim>,
DoFOutputOperator<VECTOR, dim, spacedim> > dof;
-
- const std::string filename_base;
- const unsigned int digits;
-
- DataOut<dim> out;
+
+ const std::string filename_base;
+ const unsigned int digits;
+
+ DataOut<dim> out;
};
template <class VECTOR, int dim, int spacedim>
DoFOutputOperator<VECTOR, dim, spacedim>::DoFOutputOperator (
const std::string filename_base,
const unsigned int digits)
- :
- filename_base(filename_base),
- digits(digits)
+ :
+ filename_base(filename_base),
+ digits(digits)
{
out.set_default_format(DataOutBase::gnuplot);
}
-
+
+
+ template <class VECTOR, int dim, int spacedim>
+ void
+ DoFOutputOperator<VECTOR, dim, spacedim>::parse_parameters(ParameterHandler ¶m)
+ {
+ out.parse_parameters(param);
+ }
template <class VECTOR, int dim, int spacedim>
OutputOperator<VECTOR> &
{
Assert ((dof!=0), ExcNotInitialized());
out.attach_dof_handler (*dof);
- for (unsigned int i=0;i<data.size();++i)
+ for (unsigned int i=0; i<data.size(); ++i)
{
- const VECTOR* p = data.try_read_ptr<VECTOR>(i);
- if (p!=0)
- {
- out.add_data_vector (*p, data.name(i));
- }
+ const VECTOR *p = data.try_read_ptr<VECTOR>(i);
+ if (p!=0)
+ {
+ out.add_data_vector (*p, data.name(i));
+ }
}
std::ostringstream streamOut;
streamOut << filename_base
- << std::setw(digits) << std::setfill('0') << this->step
- << out.default_suffix();
+ << std::setw(digits) << std::setfill('0') << this->step
+ << out.default_suffix();
std::ofstream out_filename (streamOut.str().c_str());
- out.build_patches (2);
- out.write_gnuplot (out_filename);
+ out.build_patches ();
+ out.write (out_filename);
out.clear ();
return *this;
}