Wildmeshing Toolkit
Loading...
Searching...
No Matches
Mesh_hash.cpp
Go to the documentation of this file.
1#include <fmt/format.h>
3#include "Mesh.hpp"
4namespace wmtk {
5std::map<std::string, const wmtk::utils::Hashable*> Mesh::child_hashables() const
6{
7 std::map<std::string, const wmtk::utils::Hashable*> ret;
8 ret["attribute_manager"] = &m_attribute_manager;
9 ret["multimesh_manager"] = &m_multi_mesh_manager;
10 return ret;
11}
12std::map<std::string, std::size_t> Mesh::child_hashes() const
13{
14 // default implementation pulls the child attributes (ie the attributes)
15 std::map<std::string, std::size_t> ret = wmtk::utils::MerkleTreeInteriorNode::child_hashes();
16
17
18 const std::hash<TypedAttributeHandle<char>> cattr_hasher;
19 const std::hash<TypedAttributeHandle<int64_t>> attr_hasher;
20 for (size_t j = 0; j < m_flag_handles.size(); ++j) {
21 ret[fmt::format("flag_handle_{}", j)] = cattr_hasher(m_flag_handles[j]);
22 }
23 ret["cell_hash_handle"] = attr_hasher(m_cell_hash_handle);
24
25 return ret;
26}
27} // namespace wmtk
std::vector< TypedAttributeHandle< char > > m_flag_handles
0x1 == true = simplex is active (simplex exists) all flag default to 0
Definition Mesh.hpp:850
std::map< std::string, std::size_t > child_hashes() const override
Definition Mesh_hash.cpp:12
multimesh::MultiMeshManager m_multi_mesh_manager
Definition Mesh.hpp:827
std::map< std::string, const wmtk::utils::Hashable * > child_hashables() const override
Definition Mesh_hash.cpp:5
TypedAttributeHandle< int64_t > m_cell_hash_handle
Definition Mesh.hpp:854
attribute::AttributeManager m_attribute_manager
Definition Mesh.hpp:825
std::map< std::string, std::size_t > child_hashes() const override