Wildmeshing Toolkit
Loading...
Searching...
No Matches
mesh_info.cpp
Go to the documentation of this file.
1
#include "
mesh_info.hpp
"
2
3
4
#include "
internal/MeshInfoOptions.hpp
"
5
6
#include <
wmtk/Mesh.hpp
>
7
#include <
wmtk/utils/Logger.hpp
>
8
9
namespace
wmtk::components
{
10
11
void
mesh_info
(
const
utils::Paths& paths,
const
nlohmann::json& j,
io::Cache
& cache)
12
{
13
using namespace
internal
;
14
15
MeshInfoOptions
options = j.get<
MeshInfoOptions
>();
16
17
std::shared_ptr<Mesh> mesh_in = cache.
read_mesh
(options.
input
);
18
19
Mesh
& mesh = *mesh_in;
20
21
wmtk::logger
().info(
"The information given in this component is very limited for now. Sorry."
);
22
23
const
auto
v_tuples = mesh.
get_all
(
PrimitiveType::Vertex
);
24
const
auto
f_tuples = mesh.
get_all
(
PrimitiveType::Triangle
);
25
26
wmtk::logger
().info(
"Mesh: {}"
, options.
input
);
27
wmtk::logger
().info(
"Vertices: {}"
, v_tuples.size());
28
wmtk::logger
().info(
"Faces: {}"
, f_tuples.size());
29
}
30
31
}
// namespace wmtk::components
Logger.hpp
Mesh.hpp
MeshInfoOptions.hpp
wmtk::Mesh
Definition
Mesh.hpp:95
wmtk::Mesh::get_all
std::vector< Tuple > get_all(PrimitiveType type) const
Generate a vector of Tuples from global vertex/edge/triangle/tetrahedron index.
Definition
Mesh.cpp:18
wmtk::io::Cache
Definition
Cache.hpp:13
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
mesh_info.hpp
internal
Definition
local_switch_tuple.hpp:11
wmtk::components
Definition
bicubic_interpolation.cpp:5
wmtk::components::mesh_info
void mesh_info(const utils::Paths &paths, const nlohmann::json &j, io::Cache &cache)
Definition
mesh_info.cpp:11
wmtk::logger
spdlog::logger & logger()
Retrieves the current logger.
Definition
Logger.cpp:58
wmtk::PrimitiveType::Triangle
@ Triangle
wmtk::PrimitiveType::Vertex
@ Vertex
wmtk::components::internal::MeshInfoOptions
Definition
MeshInfoOptions.hpp:10
wmtk::components::internal::MeshInfoOptions::input
std::string input
Definition
MeshInfoOptions.hpp:11
components
mesh_info
wmtk
components
mesh_info
mesh_info.cpp
Generated by
1.9.8