33 const std::set<std::string> * system_names)
35 LOG_SCOPE(
"write_equation_systems()",
"MeshOutput");
39 MT & my_mesh =
const_cast<MT &
>(*_obj);
43 libmesh_assert_equal_to(&es.
get_mesh(), _obj);
47 if (my_mesh.max_elem_id() != my_mesh.n_elem() ||
48 my_mesh.max_node_id() != my_mesh.n_nodes())
52 libmesh_assert(!my_mesh.allow_renumbering());
55 "Warning: This MeshOutput subclass only supports meshes which are contiguously renumbered!" 58 my_mesh.allow_renumbering(
true);
60 my_mesh.renumber_nodes_and_elements();
64 my_mesh.allow_renumbering(
false);
67 MeshSerializer serialize(const_cast<MT &>(*_obj), !_is_parallel_format, _serial_only_needed_on_proc_0);
70 std::vector<std::string> names;
73 if (!_is_parallel_format)
77 std::vector<Number> soln;
80 this->write_nodal_data (fname, soln, names);
84 std::unique_ptr<NumericVector<Number>> parallel_soln =
87 this->write_nodal_data (fname, *parallel_soln, names);
94 const std::set<std::string> * system_names)
96 LOG_SCOPE(
"write_discontinuous_equation_systems()",
"MeshOutput");
100 MT & my_mesh =
const_cast<MT &
>(*_obj);
104 libmesh_assert_equal_to(&es.
get_mesh(), _obj);
108 if (my_mesh.max_elem_id() != my_mesh.n_elem() ||
109 my_mesh.max_node_id() != my_mesh.n_nodes())
113 libmesh_assert(!my_mesh.allow_renumbering());
116 "Warning: This MeshOutput subclass only supports meshes which are contiguously renumbered!" 119 my_mesh.allow_renumbering(
true);
121 my_mesh.renumber_nodes_and_elements();
125 my_mesh.allow_renumbering(
false);
128 MeshSerializer serialize(const_cast<MT &>(*_obj), !_is_parallel_format, _serial_only_needed_on_proc_0);
131 std::vector<std::string> names;
134 if (!_is_parallel_format)
138 std::vector<Number> soln;
141 this->write_nodal_data_discontinuous (fname, soln, names);
145 libmesh_not_implemented();
152 const std::vector<std::string> & names)
157 std::vector<Number> soln;
159 this->write_nodal_data(fname, soln, names);
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &)
Manages multiples systems of equations.
void build_variable_names(std::vector< std::string > &var_names, const FEType *type=nullptr, const std::set< std::string > *system_names=nullptr) const
virtual void write_equation_systems(const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr)
std::unique_ptr< NumericVector< Number > > build_parallel_solution_vector(const std::set< std::string > *system_names=nullptr) const
virtual void write_discontinuous_equation_systems(const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr)
Temporarily serializes a DistributedMesh for output.
void build_solution_vector(std::vector< Number > &soln, const std::string &system_name, const std::string &variable_name="all_vars") const
const MeshBase & get_mesh() const
OStreamProxy out(std::cout)
void build_discontinuous_solution_vector(std::vector< Number > &soln, const std::set< std::string > *system_names=nullptr) const
virtual void localize(std::vector< T > &v_local) const =0