Wildmeshing Toolkit
Loading...
Searching...
No Matches
get_all_meshes.cpp
Go to the documentation of this file.
1
#include "
get_all_meshes.hpp
"
2
3
4
#include "
GetAllMeshesOptions.hpp
"
5
6
#include <
wmtk/utils/Logger.hpp
>
7
8
#include <
wmtk/EdgeMesh.hpp
>
9
#include <
wmtk/Mesh.hpp
>
10
#include <
wmtk/PointMesh.hpp
>
11
#include <
wmtk/TetMesh.hpp
>
12
#include <
wmtk/TriMesh.hpp
>
13
#include <
wmtk/multimesh/MultiMeshVisitor.hpp
>
14
15
namespace
wmtk::components
{
16
17
void
get_all_meshes
(
const
utils::Paths& paths,
const
nlohmann::json& j,
io::Cache
& cache)
18
{
19
using namespace
internal
;
20
21
GetAllMeshesOptions
options = j.get<
GetAllMeshesOptions
>();
22
23
std::shared_ptr<Mesh> mesh_in = cache.
read_mesh
(options.
input
);
24
25
auto
get_all = [&](
auto
&& m) {
26
const
std::string name =
27
fmt::format(
"{}_{}"
, options.
name
, fmt::join(m.absolute_multi_mesh_id(),
""
));
28
logger
().info(
"Exporting {}"
, name);
29
cache.
write_mesh
(*m.shared_from_this(), name);
30
};
31
multimesh::MultiMeshVisitor
visitor(get_all);
32
visitor.
execute_from_root
(*mesh_in);
33
}
34
35
}
// namespace wmtk::components
EdgeMesh.hpp
GetAllMeshesOptions.hpp
Logger.hpp
Mesh.hpp
MultiMeshVisitor.hpp
PointMesh.hpp
TetMesh.hpp
TriMesh.hpp
wmtk::io::Cache
Definition
Cache.hpp:13
wmtk::io::Cache::write_mesh
void write_mesh(const Mesh &m, const std::string &name, const std::map< std::string, std::vector< int64_t > > &multimesh_names={})
Write a mesh to cache.
Definition
Cache.cpp:194
wmtk::io::Cache::read_mesh
std::shared_ptr< Mesh > read_mesh(const std::string &name) const
Load a mesh from cache.
Definition
Cache.cpp:171
wmtk::multimesh::MultiMeshVisitor
Definition
MultiMeshVisitor.hpp:29
wmtk::multimesh::MultiMeshVisitor::execute_from_root
void execute_from_root(Mesh &mesh)
Definition
MultiMeshVisitor.hpp:79
get_all_meshes.hpp
internal
Definition
local_switch_tuple.hpp:11
wmtk::components
Definition
bicubic_interpolation.cpp:5
wmtk::components::get_all_meshes
void get_all_meshes(const utils::Paths &paths, const nlohmann::json &j, io::Cache &cache)
Definition
get_all_meshes.cpp:17
wmtk::logger
spdlog::logger & logger()
Retrieves the current logger.
Definition
Logger.cpp:58
wmtk::components::internal::GetAllMeshesOptions
Definition
GetAllMeshesOptions.hpp:10
wmtk::components::internal::GetAllMeshesOptions::input
std::string input
Definition
GetAllMeshesOptions.hpp:11
wmtk::components::internal::GetAllMeshesOptions::name
std::string name
Definition
GetAllMeshesOptions.hpp:12
components
get_all_meshes
wmtk
components
get_all_meshes
get_all_meshes.cpp
Generated by
1.9.8