25 std::filesystem::path
const& file_path,
26 [[maybe_unused]] std::set<std::string>
27 variable_output_names)
29 if (file_path.extension().string() ==
".msh")
36 if (file_path.extension().string() ==
".vtu")
42 ERR(
"writeMeshToFile(): Could not write mesh to '{:s}'.",
48 if (file_path.extension().string() ==
".xdmf")
50 std::vector<std::reference_wrapper<const MeshLib::Mesh>> meshes;
51 const std::reference_wrapper<const MeshLib::Mesh> mr = mesh;
54 variable_output_names,
true, 1, 1048576);
57 ERR(
"writeMeshToFile(): Unknown file extension '{:s}'. Can not write file "
59 file_path.extension().string(), file_path.string());
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the MeshIO class.
Definition of the Mesh class.
Implementation of the VtuInterface class.
XdmfWriter which create contiguous data for geometry and topology and writes this and all attributes ...
std::string writeToString()
Writes the object to a string.
Interface for handling mesh files from OGS-5 and below. (*.msh files)
void setMesh(const MeshLib::Mesh *mesh)
Set mesh for writing.
Reads and writes VtkXMLUnstructuredGrid-files (vtu) to and from OGS data structures....
bool writeToFile(std::filesystem::path const &file_path)
int writeStringToFile(std::string_view content, std::filesystem::path const &file_path)
int writeMeshToFile(const MeshLib::Mesh &mesh, std::filesystem::path const &file_path, std::set< std::string > variable_output_names)