13 const std::string& name,
14 std::map<std::string, std::vector<int64_t>> multimesh_names,
15 std::shared_ptr<Mesh> root)
18 , m_multimesh_names(
std::move(multimesh_names))
39 auto dot_it = name.find(
'.');
41 assert(name.substr(0, dot_it) ==
m_name);
42 if (dot_it == std::string::npos) {
47 return get(name.substr(dot_it + 1));
54 wmtk::logger().warn(
"Cannot find {} in the cache", name);
64 const static std::vector<int64_t> root_id = {};
73 throw std::runtime_error(fmt::format(
74 "Could not find named multimesh {} in {}. Key {} was not among [{}]",
84 const auto idx = name.find(
'.');
86 assert(name.substr(0, idx) ==
m_name);
88 if (idx == std::string::npos) {
91 const std::string subname = name.substr(idx + 1);
const std::map< std::string, std::vector< int64_t > > & get_multimesh_names() const
std::map< std::string, std::vector< int64_t > > m_multimesh_names
std::shared_ptr< Mesh > get_from_path(const std::string &name)
std::shared_ptr< Mesh > get(const std::string &name)
void load(const std::filesystem::path &path)
CachedMultiMesh(const std::string &name, std::map< std::string, std::vector< int64_t >> multimesh_names, std::shared_ptr< Mesh > root=nullptr)
CachedMultiMesh & operator=(CachedMultiMesh &&)
const std::vector< int64_t > & get_id(const std::string &name) const
const std::vector< int64_t > & get_id_from_path(const std::string &name) const
std::shared_ptr< Mesh > get_root()
std::shared_ptr< Mesh > m_root
spdlog::logger & logger()
Retrieves the current logger.
std::shared_ptr< Mesh > read_mesh(const std::filesystem::path &filename, const bool ignore_z_if_zero, const std::vector< std::string > &tetrahedron_attributes)