1 #include <deal.II/dofs/dof_handler.h>
2 #include <deal.II/lac/vector.h>
3 #include <deal.II/grid/grid_out.h>
4 #include <deal.II/numerics/data_out.h>
5 #include <deal.II/lac/sparse_matrix.h>
13 using namespace dealii;
17 const std::string filename,
18 DoFHandler<dim> &dof_handler,
19 Vector<double> &solution
23 std::vector<std::string> solution_names(dim,
"velocity");
25 solution_names.push_back(
"pressure");
27 solution_names.push_back(
"temperature");
29 std::vector<DataComponentInterpretation::DataComponentInterpretation>
30 data_component_interpretation(dim, DataComponentInterpretation::component_is_part_of_vector);
32 data_component_interpretation.push_back(DataComponentInterpretation::component_is_scalar);
34 data_component_interpretation.push_back(DataComponentInterpretation::component_is_scalar);
36 DataOut<dim> data_out;
38 data_out.attach_dof_handler(dof_handler);
40 data_out.add_data_vector(
43 DataOut<dim>::type_dof_data,
44 data_component_interpretation);
46 data_out.build_patches ();
49 std::ofstream output(filename.c_str());
50 data_out.write_vtk(output);
57 std::ofstream output(
"A.txt");
63 std::ofstream output(
"b.txt");
void write_solution_to_vtk(const std::string filename, DoFHandler< dim > &dof_handler, Vector< double > &solution)
Definition: output.h:16
void write_linear_system(SparseMatrix< double > &A, Vector< double > &b)
Definition: output.h:53