Wildmeshing Toolkit
wildmeshing_utils.cpp
Go to the documentation of this file.
1 #include <wmtk/Mesh.hpp>
3 
5 
6 void write(
7  const std::shared_ptr<Mesh>& mesh,
8  const std::string& out_dir,
9  const std::string& name,
10  const std::string& vname,
11  const int64_t index,
12  const bool intermediate_output)
13 {
14  if (intermediate_output) {
15  if (mesh->top_simplex_type() == PrimitiveType::Triangle) {
16  // write trimesh
17  const std::filesystem::path data_dir = "";
19  data_dir / (name + "_" + std::to_string(index)),
20  vname,
21  *mesh,
22  true,
23  true,
24  true,
25  false);
26  mesh->serialize(writer);
27  } else if (mesh->top_simplex_type() == PrimitiveType::Tetrahedron) {
28  // write tetmesh
29  const std::filesystem::path data_dir = "";
31  data_dir / (name + "_" + std::to_string(index)),
32  vname,
33  *mesh,
34  true,
35  true,
36  true,
37  true);
38  mesh->serialize(writer);
39  } else if (mesh->top_simplex_type() == PrimitiveType::Edge) {
40  // write edgemesh
41  const std::filesystem::path data_dir = "";
43  data_dir / (name + "_" + std::to_string(index)),
44  vname,
45  *mesh,
46  true,
47  true,
48  false,
49  false);
50  mesh->serialize(writer);
51  }
52  }
53 }
54 } // namespace wmtk::components::internal
void write(const Mesh &mesh, const std::string &out_dir, const std::string &name, const std::string &vname, const int64_t index, const bool intermediate_output)
const std::filesystem::path data_dir