OGS
GenerateFaceSetMeshes.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
8
9namespace FileIO
10{
11namespace Gocad
12{
13void generateFaceSets(GocadSGridReader const& reader, std::string const& path)
14{
15 for (std::size_t l(0); l < 128; l++)
16 {
17 std::unique_ptr<MeshLib::Mesh> face_set(reader.getFaceSetMesh(l));
18
19 if (!face_set)
20 {
21 continue;
22 }
23 INFO("Face set mesh created. #nodes: {:d}, #elements: {:d}",
24 face_set->getNumberOfNodes(),
25 face_set->getNumberOfElements());
26
27 std::string const mesh_out_fname(path + face_set->getName() + ".vtu");
28 INFO("Writing face set mesh to '{:s}'.", mesh_out_fname);
29 MeshLib::IO::writeMeshToFile(*face_set, mesh_out_fname);
30 }
31}
32
33} // namespace Gocad
34} // namespace FileIO
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:28
std::unique_ptr< MeshLib::Mesh > getFaceSetMesh(std::size_t const face_set_number) const
void generateFaceSets(GocadSGridReader const &reader, std::string const &path)
int writeMeshToFile(const MeshLib::Mesh &mesh, std::filesystem::path const &file_path, std::set< std::string > variable_output_names)