16 #ifndef dealii_dof_print_solver_step_h 17 #define dealii_dof_print_solver_step_h 19 #include <deal.II/base/config.h> 21 #include <deal.II/base/logstream.h> 23 #include <deal.II/lac/solver_control.h> 24 #include <deal.II/lac/vector_memory.h> 26 #include <deal.II/numerics/data_out.h> 32 DEAL_II_NAMESPACE_OPEN
55 template <
int dim,
typename SolverType,
class VectorType = Vector<
double>>
78 const VectorType & d)
const;
95 template <
int dim,
typename SolverType,
class VectorType>
100 const std::string & basename)
101 : SolverType(control, mem)
107 template <
int dim,
typename SolverType,
class VectorType>
110 const unsigned int step,
111 const VectorType & x,
112 const VectorType & r,
113 const VectorType & d)
const 115 out.clear_data_vectors();
116 out.add_data_vector(x,
"solution");
117 out.add_data_vector(r,
"residual");
118 out.add_data_vector(d,
"update");
120 std::ostringstream filename;
121 filename << basename << std::setw(3) << std::setfill(
'0') << step
122 << out.default_suffix();
124 const std::string fname = filename.str();
126 deallog <<
"Writing file:" << fname << std::endl;
129 std::ofstream of(fname.c_str());
133 DEAL_II_NAMESPACE_CLOSE
virtual void print_vectors(const unsigned int step, const VectorType &x, const VectorType &r, const VectorType &d) const
const std::string basename
DoFPrintSolverStep(SolverControl &control, VectorMemory< VectorType > &mem, DataOut< dim > &data_out, const std::string &basename)