Wildmeshing Toolkit
|
Implementation details for how the Mesh class implements multiple meshes. More...
#include <MultiMeshManager.hpp>
Classes | |
struct | ChildData |
Public Member Functions | |
MultiMeshManager (int64_t dimension) | |
~MultiMeshManager () | |
MultiMeshManager (const MultiMeshManager &o) | |
MultiMeshManager (MultiMeshManager &&o) | |
MultiMeshManager & | operator= (const MultiMeshManager &o) |
MultiMeshManager & | operator= (MultiMeshManager &&o) |
std::map< std::string, const wmtk::utils::Hashable * > | child_hashables () const override |
std::map< std::string, std::size_t > | child_hashes () const override |
void | detach_children () |
std::vector< TypedAttributeHandle< int64_t > > | map_handles () const |
bool | is_root () const |
Specifies whether this structure is the root of a multi-mesh tree. | |
int64_t | child_id () const |
Specifies the child id of this mesh if it a child mesh in a mult-mesh tree. | |
std::vector< int64_t > | absolute_id () const |
Mesh & | get_mesh (Mesh &m, const std::vector< int64_t > &absolute_id) |
const Mesh & | get_mesh (const Mesh &m, const std::vector< int64_t > &absolute_id) const |
Mesh & | get_child_mesh (Mesh &m, const std::vector< int64_t > &relative_id) |
const Mesh & | get_child_mesh (const Mesh &m, const std::vector< int64_t > &relative_id) const |
void | register_child_mesh (Mesh &my_mesh, const std::shared_ptr< Mesh > &child_mesh, const std::vector< std::array< Tuple, 2 > > &child_tuple_my_tuple_map) |
register a another mesh as a child of this mesh. | |
void | deregister_child_mesh (Mesh &my_mesh, const std::shared_ptr< Mesh > &child_mesh_ptr) |
Deregister a child mesh. | |
void | update_child_handles (Mesh &my_mesh) |
Clean up child data after deleting attributes. | |
std::vector< simplex::Simplex > | map (const Mesh &my_mesh, const Mesh &other_mesh, const simplex::Simplex &my_simplex) const |
maps a simplex from this mesh to any other mesh | |
std::vector< Tuple > | lub_map_tuples (const Mesh &my_mesh, const Mesh &other_mesh, const simplex::Simplex &my_simplex) const |
maps a simplex from this mesh to any other mesh using the LUB as the root | |
std::vector< simplex::Simplex > | lub_map (const Mesh &my_mesh, const Mesh &other_mesh, const simplex::Simplex &my_simplex) const |
maps a simplex from this mesh to any other mesh using the LUB as the root | |
std::vector< Tuple > | map_tuples (const Mesh &my_mesh, const Mesh &other_mesh, const simplex::Simplex &my_simplex) const |
maps a simplex from this mesh to any other mesh | |
simplex::Simplex | map_to_parent (const Mesh &my_mesh, const simplex::Simplex &my_simplex) const |
optimized map from a simplex from this mesh to its direct parent | |
Tuple | map_to_parent_tuple (const Mesh &my_mesh, const simplex::Simplex &my_simplex) const |
optimized map from a simplex from this mesh to its direct parent | |
simplex::Simplex | map_to_root (const Mesh &my_mesh, const simplex::Simplex &my_simplex) const |
maps a simplex from this mesh to the root mesh | |
Tuple | map_to_root_tuple (const Mesh &my_mesh, const simplex::Simplex &my_simplex) const |
maps a simplex from this mesh to the root mesh | |
std::vector< simplex::Simplex > | map_to_child (const Mesh &my_mesh, const Mesh &child_mesh, const simplex::Simplex &my_simplex) const |
optimized map fromsimplex from this mesh to one of its direct children | |
std::vector< Tuple > | map_to_child_tuples (const Mesh &my_mesh, const Mesh &child_mesh, const simplex::Simplex &my_simplex) const |
bool | can_map (const Mesh &my_mesh, const Mesh &other_mesh, const simplex::Simplex &my_simplex) const |
bool | can_map_child (const Mesh &my_mesh, const Mesh &other_mesh, const simplex::Simplex &my_simplex) const |
const Mesh & | get_root_mesh (const Mesh &my_mesh) const |
Mesh & | get_root_mesh (Mesh &my_mesh) |
std::vector< std::shared_ptr< Mesh > > | get_child_meshes () const |
void | serialize (MeshWriter &writer, const Mesh *local_root=nullptr) const |
bool | has_child_mesh_in_dimension (int64_t dimension) const |
bool | has_child_mesh () const |
std::vector< int64_t > | relative_id (const Mesh &my_mesh, const Mesh &parent_mesh) const |
bool | is_child (const Mesh &my_mesh, const Mesh &parent_mesh) const |
void | check_map_valid (const Mesh &my_mesh) const |
update all the hashes of the top-simplces of the parent mesh around a vertex hashes of the parent tuples in the maps for all child meshes | |
void | check_child_map_valid (const Mesh &my_mesh, const ChildData &child_data) const |
![]() | |
Hashable () | |
Hashable (const Hashable &) | |
Hashable (Hashable &&) | |
Hashable & | operator= (const Hashable &) |
Hashable & | operator= (Hashable &&) |
virtual | ~Hashable () |
virtual std::size_t | hash () const |
Static Public Member Functions | |
static std::vector< int64_t > | least_upper_bound_id (const std::vector< int64_t > &a, const std::vector< int64_t > &b) |
static std::vector< int64_t > | relative_id (const std::vector< int64_t > &parent, const std::vector< int64_t > &child) |
static bool | is_child (const std::vector< int64_t > &child, const std::vector< int64_t > &parent) |
Protected Member Functions | |
Tuple | map_tuple_to_parent_tuple (const Mesh &my_mesh, const Tuple &my_tuple) const |
Tuple | map_tuple_to_root_tuple (const Mesh &my_mesh, const Tuple &my_tuple) const |
std::vector< Tuple > | map_to_child_tuples (const Mesh &my_mesh, const ChildData &child_data, const simplex::Simplex &simplex) const |
std::vector< Tuple > | map_to_child_tuples (const Mesh &my_mesh, int64_t child_id, const simplex::Simplex &simplex) const |
const std::vector< ChildData > & | children () const |
std::vector< ChildData > & | children () |
std::array< wmtk::attribute::Accessor< int64_t >, 2 > | get_map_accessors (Mesh &my_mesh, ChildData &c) |
std::array< const wmtk::attribute::Accessor< int64_t >, 2 > | get_map_const_accessors (const Mesh &my_mesh, const ChildData &c) const |
void | update_map_tuple_hashes (Mesh &my_mesh, PrimitiveType primitive_type, const std::vector< std::tuple< int64_t, std::vector< Tuple > > > &simplices_to_update, const std::vector< std::tuple< int64_t, std::array< int64_t, 2 > > > &split_cell_maps={}) |
void | update_maps_from_edge_operation (Mesh &my_mesh, PrimitiveType primitive_type, const operations::EdgeOperationData &operation_data) |
std::optional< Tuple > | find_valid_tuple (Mesh &my_mesh, const simplex::Simplex &old_simplex, const int64_t old_gid, const std::vector< Tuple > &tuple_alternatives, const std::vector< std::tuple< int64_t, std::array< int64_t, 2 > > > &split_cell_maps={}) const |
std::optional< Tuple > | find_valid_tuple_from_alternatives (Mesh &my_mesh, PrimitiveType primitive_type, const std::vector< Tuple > &tuple_alternatives) const |
std::optional< Tuple > | find_valid_tuple_from_split (Mesh &my_mesh, const simplex::Simplex &old_simplex, const int64_t old_gid, const std::vector< Tuple > &tuple_alternatives, const std::vector< std::tuple< int64_t, std::array< int64_t, 2 > > > &split_cell_maps) const |
std::optional< Tuple > | try_updating_map_tuple_from_split (Mesh &my_mesh, const simplex::Simplex &old_simplex, const int64_t old_gid, const std::vector< Tuple > &tuple_alternatives, const std::tuple< int64_t, std::array< int64_t, 2 > > &split_cell_maps) const |
std::pair< const Mesh &, Tuple > | map_up_to_tuples (const Mesh &my_mesh, const simplex::Simplex &simplex, int64_t depth) const |
std::vector< Tuple > | map_down_relative_tuples (const Mesh &my_mesh, const simplex::Simplex &my_simplex, const std::vector< int64_t > &local_id_path) const |
Static Protected Member Functions | |
static Tuple | map_tuple_between_meshes (const Mesh &source_mesh, const Mesh &target_mesh, const wmtk::attribute::Accessor< int64_t > &source_to_target_map_accessor, const Tuple &source_tuple) |
static std::string | parent_to_child_map_attribute_name (int64_t index) |
static std::string | child_to_parent_map_attribute_name () |
static std::optional< Tuple > | find_tuple_from_gid (const Mesh &my_mesh, PrimitiveType primitive_type, const std::vector< Tuple > &tuples, int64_t gid) |
static int64_t | child_global_cid (const wmtk::attribute::Accessor< int64_t > &parent_to_child, int64_t parent_gid) |
static int64_t | parent_global_cid (const wmtk::attribute::Accessor< int64_t > &child_to_parent, int64_t child_gid) |
static int64_t | parent_local_fid (const wmtk::attribute::Accessor< int64_t > &child_to_parent, int64_t child_gid) |
Protected Attributes | |
Mesh * | m_parent = nullptr |
TypedAttributeHandle< int64_t > | map_to_parent_handle |
int64_t | m_child_id = -1 |
std::vector< ChildData > | m_children |
std::vector< bool > | m_has_child_mesh_in_dimension |
Static Private Member Functions | |
static std::vector< std::array< Tuple, 2 > > | same_simplex_dimension_surjection (const Mesh &parent, const Mesh &child, const std::vector< int64_t > &parent_simplices) |
Friends | |
template<int64_t cell_dimension, typename NodeFunctor > | |
class | multimesh::MultiMeshSimplexVisitor |
class | wmtk::Mesh |
template<typename Visitor > | |
class | multimesh::MultiMeshSimplexVisitorExecutor |
class | operations::utils::UpdateEdgeOperationMultiMeshMapFunctor |
template<typename NodeFunctor > | |
class | multimesh::MultiMeshVisitor |
template<typename Visitor > | |
class | multimesh::MultiMeshVisitorExecutor |
class | wmtk::HDF5Reader |
class | utils::MapValidator |
std::vector< std::array< Tuple, 2 > > | multimesh::same_simplex_dimension_surjection (const Mesh &parent, const Mesh &child, const std::vector< int64_t > &parent_simplices) |
Implementation details for how the Mesh class implements multiple meshes.
Definition at line 56 of file MultiMeshManager.hpp.
wmtk::multimesh::MultiMeshManager::MultiMeshManager | ( | int64_t | dimension | ) |
Definition at line 112 of file MultiMeshManager.cpp.
|
default |
|
default |
|
default |
std::vector< int64_t > wmtk::multimesh::MultiMeshManager::absolute_id | ( | ) | const |
Definition at line 172 of file MultiMeshManager.cpp.
References absolute_id(), is_root(), m_child_id, wmtk::Mesh::m_multi_mesh_manager, and m_parent.
Referenced by absolute_id(), wmtk::Mesh::absolute_multi_mesh_id(), can_map_child(), check_child_map_valid(), get_mesh(), get_mesh(), lub_map_tuples(), map_tuples(), and wmtk::Mesh::serialize().
bool wmtk::multimesh::MultiMeshManager::can_map | ( | const Mesh & | my_mesh, |
const Mesh & | other_mesh, | ||
const simplex::Simplex & | my_simplex | ||
) | const |
Definition at line 925 of file MultiMeshManager.cpp.
References wmtk::Mesh::get_multi_mesh_root(), map_to_root_tuple(), and wmtk::simplex::Simplex::primitive_type().
Referenced by wmtk::Mesh::can_map().
bool wmtk::multimesh::MultiMeshManager::can_map_child | ( | const Mesh & | my_mesh, |
const Mesh & | other_mesh, | ||
const simplex::Simplex & | my_simplex | ||
) | const |
Definition at line 937 of file MultiMeshManager.cpp.
References absolute_id(), wmtk::Mesh::absolute_multi_mesh_id(), map_up_to_tuples(), wmtk::simplex::Simplex::primitive_type(), and wmtk::Mesh::top_simplex_type().
void wmtk::multimesh::MultiMeshManager::check_child_map_valid | ( | const Mesh & | my_mesh, |
const ChildData & | child_data | ||
) | const |
Definition at line 750 of file MultiMeshManager.cpp.
References absolute_id(), wmtk::Mesh::absolute_multi_mesh_id(), child_to_parent_map_attribute_name(), wmtk::Mesh::create_const_accessor(), wmtk::Edge, wmtk::Mesh::get_all(), wmtk::Mesh::get_attribute_handle(), wmtk::Mesh::get_flag_accessor(), wmtk::Mesh::has_attribute(), wmtk::Mesh::is_boundary(), wmtk::Mesh::is_valid(), wmtk::logger(), wmtk::multimesh::MultiMeshManager::ChildData::map_handle, map_tuple_between_meshes(), wmtk::multimesh::MultiMeshManager::ChildData::mesh, wmtk::multimesh::utils::read_tuple_map_attribute_slow(), wmtk::Mesh::switch_tuple(), wmtk::Mesh::switch_tuples(), wmtk::Mesh::top_simplex_type(), wmtk::Triangle, and wmtk::Vertex.
Referenced by check_map_valid().
void wmtk::multimesh::MultiMeshManager::check_map_valid | ( | const Mesh & | my_mesh | ) | const |
update all the hashes of the top-simplces of the parent mesh around a vertex hashes of the parent tuples in the maps for all child meshes
m | mesh the tuple belongs to |
vertex | operating vertex tuple |
hash_accessor | hash accessor of m |
Definition at line 740 of file MultiMeshManager.cpp.
References check_child_map_valid(), and children().
|
staticprotected |
Definition at line 377 of file MultiMeshManager_map_updates.cpp.
References wmtk::Mesh::get_index_access().
Referenced by wmtk::operations::utils::UpdateEdgeOperationMultiMeshMapFunctor::child_global_cid().
|
overridevirtual |
Implements wmtk::utils::MerkleTreeInteriorNode.
Definition at line 123 of file MultiMeshManager.cpp.
References m_children.
|
overridevirtual |
Reimplemented from wmtk::utils::MerkleTreeInteriorNode.
Definition at line 134 of file MultiMeshManager.cpp.
References wmtk::Mesh::absolute_multi_mesh_id(), wmtk::utils::MerkleTreeInteriorNode::child_hashes(), m_child_id, m_children, m_parent, map_to_parent_handle, and wmtk::utils::vector_hash().
int64_t wmtk::multimesh::MultiMeshManager::child_id | ( | ) | const |
Specifies the child id of this mesh if it a child mesh in a mult-mesh tree.
throws if it not a child
Definition at line 164 of file MultiMeshManager.cpp.
References is_root(), and m_child_id.
Referenced by deregister_child_mesh(), map_to_child_tuples(), map_to_child_tuples(), and wmtk::operations::utils::UpdateEdgeOperationMultiMeshMapFunctor::update_ear_replacement().
|
staticprotected |
Definition at line 733 of file MultiMeshManager.cpp.
Referenced by check_child_map_valid(), wmtk::HDF5Reader::read(), and register_child_mesh().
|
inlineprotected |
Definition at line 421 of file MultiMeshManager.hpp.
References m_children.
|
inlineprotected |
Definition at line 420 of file MultiMeshManager.hpp.
References m_children.
Referenced by check_map_valid(), deregister_child_mesh(), update_child_handles(), update_map_tuple_hashes(), and update_maps_from_edge_operation().
void wmtk::multimesh::MultiMeshManager::deregister_child_mesh | ( | Mesh & | my_mesh, |
const std::shared_ptr< Mesh > & | child_mesh_ptr | ||
) |
Deregister a child mesh.
The child mesh is not deleted. It is only detached from the multi-mesh structure. The child mesh becomes the new root for its own children. Attribute handles for the child and parent mesh will be invalidated by deregistration.
Definition at line 266 of file MultiMeshManager.cpp.
References child_id(), children(), wmtk::attribute::AttributeManager::get(), wmtk::Mesh::m_attribute_manager, m_child_id, m_children, wmtk::Mesh::m_multi_mesh_manager, m_parent, wmtk::multimesh::MultiMeshManager::ChildData::map_handle, map_to_parent_handle, wmtk::multimesh::MultiMeshManager::ChildData::mesh, wmtk::Mesh::top_simplex_type(), and update_child_handles().
Referenced by wmtk::Mesh::deregister_child_mesh().
void wmtk::multimesh::MultiMeshManager::detach_children | ( | ) |
Definition at line 24 of file MultiMeshManager.cpp.
References m_children.
Referenced by wmtk::Mesh::~Mesh().
|
staticprotected |
Definition at line 358 of file MultiMeshManager_map_updates.cpp.
Referenced by find_valid_tuple_from_split(), and update_map_tuple_hashes().
|
protected |
Definition at line 273 of file MultiMeshManager_map_updates.cpp.
References find_valid_tuple_from_alternatives(), find_valid_tuple_from_split(), and wmtk::Mesh::top_simplex_type().
Referenced by update_map_tuple_hashes().
|
protected |
Definition at line 300 of file MultiMeshManager_map_updates.cpp.
References wmtk::Mesh::get_const_flag_accessor().
Referenced by find_valid_tuple().
|
protected |
Definition at line 318 of file MultiMeshManager_map_updates.cpp.
References find_tuple_from_gid(), wmtk::Tuple::global_cid(), wmtk::Mesh::id(), wmtk::Mesh::is_removed(), wmtk::Mesh::is_valid(), wmtk::Tuple::local_eid(), wmtk::Tuple::local_fid(), wmtk::Tuple::local_vid(), wmtk::simplex::Simplex::primitive_type(), wmtk::Mesh::top_simplex_type(), and wmtk::simplex::Simplex::tuple().
Referenced by find_valid_tuple().
const Mesh & wmtk::multimesh::MultiMeshManager::get_child_mesh | ( | const Mesh & | m, |
const std::vector< int64_t > & | relative_id | ||
) | const |
Definition at line 358 of file MultiMeshManager.cpp.
References m_child_id, m_children, wmtk::Mesh::m_multi_mesh_manager, wmtk::multimesh::MultiMeshManager::ChildData::mesh, and relative_id().
Mesh & wmtk::multimesh::MultiMeshManager::get_child_mesh | ( | Mesh & | m, |
const std::vector< int64_t > & | relative_id | ||
) |
Definition at line 379 of file MultiMeshManager.cpp.
References get_child_mesh(), and relative_id().
Referenced by get_child_mesh(), get_mesh(), get_mesh(), wmtk::Mesh::get_multi_mesh_child_mesh(), and wmtk::Mesh::get_multi_mesh_child_mesh().
std::vector< std::shared_ptr< Mesh > > wmtk::multimesh::MultiMeshManager::get_child_meshes | ( | ) | const |
Definition at line 395 of file MultiMeshManager.cpp.
References m_children.
Referenced by wmtk::Mesh::get_child_meshes().
|
protected |
Definition at line 707 of file MultiMeshManager.cpp.
References wmtk::Mesh::create_accessor(), wmtk::Mesh::m_multi_mesh_manager, wmtk::multimesh::MultiMeshManager::ChildData::map_handle, map_to_parent_handle, and wmtk::multimesh::MultiMeshManager::ChildData::mesh.
Referenced by update_map_tuple_hashes(), and update_maps_from_edge_operation().
|
protected |
Definition at line 720 of file MultiMeshManager.cpp.
References wmtk::Mesh::create_const_accessor(), wmtk::Mesh::m_multi_mesh_manager, wmtk::multimesh::MultiMeshManager::ChildData::map_handle, map_to_parent_handle, and wmtk::multimesh::MultiMeshManager::ChildData::mesh.
const Mesh & wmtk::multimesh::MultiMeshManager::get_mesh | ( | const Mesh & | m, |
const std::vector< int64_t > & | absolute_id | ||
) | const |
Definition at line 383 of file MultiMeshManager.cpp.
References absolute_id(), get_child_mesh(), get_root_mesh(), and wmtk::Mesh::m_multi_mesh_manager.
Mesh & wmtk::multimesh::MultiMeshManager::get_mesh | ( | Mesh & | m, |
const std::vector< int64_t > & | absolute_id | ||
) |
Definition at line 390 of file MultiMeshManager.cpp.
References absolute_id(), get_child_mesh(), get_root_mesh(), and wmtk::Mesh::m_multi_mesh_manager.
Referenced by wmtk::Mesh::get_multi_mesh_mesh(), and wmtk::Mesh::get_multi_mesh_mesh().
Definition at line 341 of file MultiMeshManager.cpp.
References get_root_mesh(), is_root(), wmtk::Mesh::m_multi_mesh_manager, and m_parent.
Referenced by get_mesh(), get_mesh(), wmtk::Mesh::get_multi_mesh_root(), wmtk::Mesh::get_multi_mesh_root(), get_root_mesh(), get_root_mesh(), and map_to_root_tuple().
Definition at line 349 of file MultiMeshManager.cpp.
References get_root_mesh(), is_root(), wmtk::Mesh::m_multi_mesh_manager, and m_parent.
bool wmtk::multimesh::MultiMeshManager::has_child_mesh | ( | ) | const |
Definition at line 915 of file MultiMeshManager.cpp.
References m_has_child_mesh_in_dimension.
Referenced by wmtk::Mesh::has_child_mesh().
|
inline |
Definition at line 353 of file MultiMeshManager.hpp.
References m_has_child_mesh_in_dimension.
Referenced by wmtk::Mesh::has_child_mesh_in_dimension().
bool wmtk::multimesh::MultiMeshManager::is_child | ( | const Mesh & | my_mesh, |
const Mesh & | parent_mesh | ||
) | const |
Definition at line 195 of file MultiMeshManager.cpp.
References is_child(), is_root(), wmtk::Mesh::m_multi_mesh_manager, and m_parent.
|
static |
Definition at line 893 of file MultiMeshManager.cpp.
Referenced by is_child(), lub_map_tuples(), relative_id(), and relative_id().
bool wmtk::multimesh::MultiMeshManager::is_root | ( | ) | const |
Specifies whether this structure is the root of a multi-mesh tree.
Definition at line 159 of file MultiMeshManager.cpp.
References m_parent.
Referenced by absolute_id(), child_id(), get_root_mesh(), get_root_mesh(), is_child(), wmtk::Mesh::is_multi_mesh_root(), map_tuple_to_parent_tuple(), map_tuple_to_root_tuple(), and relative_id().
|
static |
Definition at line 869 of file MultiMeshManager.cpp.
Referenced by lub_map_tuples().
std::vector< simplex::Simplex > wmtk::multimesh::MultiMeshManager::lub_map | ( | const Mesh & | my_mesh, |
const Mesh & | other_mesh, | ||
const simplex::Simplex & | my_simplex | ||
) | const |
maps a simplex from this mesh to any other mesh using the LUB as the root
Satisfies the same properties of standard map, but uses a the LUB as the root
my_mesh | the mesh that this structure is owned by |
the | mesh a simplex should be mapped to |
the | simplex being mapped to the child mesh |
Definition at line 416 of file MultiMeshManager.cpp.
References lub_map_tuples(), wmtk::simplex::Simplex::primitive_type(), and wmtk::simplex::utils::tuple_vector_to_homogeneous_simplex_vector().
Referenced by wmtk::Mesh::lub_map().
std::vector< Tuple > wmtk::multimesh::MultiMeshManager::lub_map_tuples | ( | const Mesh & | my_mesh, |
const Mesh & | other_mesh, | ||
const simplex::Simplex & | my_simplex | ||
) | const |
maps a simplex from this mesh to any other mesh using the LUB as the root
Satisfies the same properties of standard map, but uses a the LUB as the root
my_mesh | the mesh that this structure is owned by |
the | mesh a simplex should be mapped to |
the | simplex being mapped to the child mesh |
Definition at line 512 of file MultiMeshManager.cpp.
References absolute_id(), wmtk::Mesh::absolute_multi_mesh_id(), is_child(), least_upper_bound_id(), wmtk::Mesh::m_multi_mesh_manager, map_up_to_tuples(), wmtk::simplex::Simplex::primitive_type(), relative_id(), and wmtk::simplex::Simplex::tuple().
Referenced by lub_map(), and wmtk::Mesh::lub_map_tuples().
std::vector< simplex::Simplex > wmtk::multimesh::MultiMeshManager::map | ( | const Mesh & | my_mesh, |
const Mesh & | other_mesh, | ||
const simplex::Simplex & | my_simplex | ||
) | const |
maps a simplex from this mesh to any other mesh
Generic interface for mapping between two arbitrary meshes in a multi-mesh structure Note that this finds ALL versions of a simplex, potentially crossing over topological features above the pairs of simplices being mapped. For instance, if we map a trimesh seam edge to itself using this interface it will find the edge on the other side of the seam. If more granular mappings are required consider manually navigating the tree with map_to_parent and map_to_child, which of course require a more particular understanding on how a simplex is mapped. throws if two meshes are not part of the same multi-mesh structure
my_mesh | the mesh that this structure is owned by |
the | mesh a simplex should be mapped to |
the | simplex being mapped to the child mesh |
Definition at line 405 of file MultiMeshManager.cpp.
References map_tuples(), wmtk::simplex::Simplex::primitive_type(), and wmtk::simplex::utils::tuple_vector_to_homogeneous_simplex_vector().
Referenced by wmtk::Mesh::map().
|
protected |
Definition at line 454 of file MultiMeshManager.cpp.
References m_child_id, m_children, wmtk::Mesh::m_multi_mesh_manager, map_to_child_tuples(), wmtk::multimesh::MultiMeshManager::ChildData::mesh, wmtk::simplex::Simplex::primitive_type(), relative_id(), and wmtk::simplex::Simplex::tuple().
std::vector< wmtk::attribute::TypedAttributeHandle< int64_t > > wmtk::multimesh::MultiMeshManager::map_handles | ( | ) | const |
Definition at line 308 of file MultiMeshManager.cpp.
References wmtk::attribute::TypedAttributeHandle< T >::is_valid(), m_children, and map_to_parent_handle.
Referenced by wmtk::Mesh::builtin_attributes().
std::vector< simplex::Simplex > wmtk::multimesh::MultiMeshManager::map_to_child | ( | const Mesh & | my_mesh, |
const Mesh & | child_mesh, | ||
const simplex::Simplex & | my_simplex | ||
) | const |
optimized map fromsimplex from this mesh to one of its direct children
Cannot be used outside of applications with guaranteed multi-mesh structures
my_mesh | the mesh that this structure is owned by |
child | mesh the simplex shoudl be mapped to |
the | simplex being mapped to the child mesh |
the | set of child mesh's simplices that are equivalent to the input simplex |
Definition at line 653 of file MultiMeshManager.cpp.
References map_to_child_tuples(), wmtk::simplex::Simplex::primitive_type(), and wmtk::simplex::utils::tuple_vector_to_homogeneous_simplex_vector().
Referenced by wmtk::Mesh::map_to_child().
|
protected |
Definition at line 595 of file MultiMeshManager.cpp.
References wmtk::simplex::cofaces_single_dimension_tuples(), wmtk::Mesh::create_const_accessor(), wmtk::Mesh::m_multi_mesh_manager, wmtk::simplex::utils::make_unique_tuples(), wmtk::multimesh::MultiMeshManager::ChildData::map_handle, map_tuple_between_meshes(), wmtk::multimesh::MultiMeshManager::ChildData::mesh, wmtk::simplex::Simplex::primitive_type(), and wmtk::Mesh::top_simplex_type().
std::vector< Tuple > wmtk::multimesh::MultiMeshManager::map_to_child_tuples | ( | const Mesh & | my_mesh, |
const Mesh & | child_mesh, | ||
const simplex::Simplex & | my_simplex | ||
) | const |
Definition at line 635 of file MultiMeshManager.cpp.
References child_id(), wmtk::Mesh::m_multi_mesh_manager, and map_to_child_tuples().
Referenced by map_down_relative_tuples(), map_to_child(), wmtk::Mesh::map_to_child_tuples(), map_to_child_tuples(), and map_to_child_tuples().
|
protected |
Definition at line 643 of file MultiMeshManager.cpp.
References child_id(), m_children, and map_to_child_tuples().
simplex::Simplex wmtk::multimesh::MultiMeshManager::map_to_parent | ( | const Mesh & | my_mesh, |
const simplex::Simplex & | my_simplex | ||
) | const |
optimized map from a simplex from this mesh to its direct parent
Maps a simplex to its direct parent in the multi-mesh structure. Cannot be used outside of applications with guaranteed multi-mesh structures
throws if this is the root
my_mesh | the mesh that this structure is owned by |
the | simplex being mapped to the parent mesh |
Definition at line 566 of file MultiMeshManager.cpp.
References map_tuple_to_parent_tuple(), wmtk::simplex::Simplex::primitive_type(), and wmtk::simplex::Simplex::tuple().
Referenced by wmtk::Mesh::map_to_parent().
Tuple wmtk::multimesh::MultiMeshManager::map_to_parent_tuple | ( | const Mesh & | my_mesh, |
const simplex::Simplex & | my_simplex | ||
) | const |
optimized map from a simplex from this mesh to its direct parent
Maps a simplex to its direct parent in the multi-mesh structure. Cannot be used outside of applications with guaranteed multi-mesh structures
throws if this is the root
my_mesh | the mesh that this structure is owned by |
the | simplex being mapped to the parent mesh |
Definition at line 574 of file MultiMeshManager.cpp.
References map_tuple_to_parent_tuple(), and wmtk::simplex::Simplex::tuple().
Referenced by wmtk::Mesh::map_to_parent_tuple().
simplex::Simplex wmtk::multimesh::MultiMeshManager::map_to_root | ( | const Mesh & | my_mesh, |
const simplex::Simplex & | my_simplex | ||
) | const |
maps a simplex from this mesh to the root mesh
Cannot be used outside of applications with guaranteed multi-mesh structures
my_mesh | the mesh that this structure is owned by |
the | simplex being mapped to the parent mesh |
Definition at line 538 of file MultiMeshManager.cpp.
References map_to_root_tuple(), and wmtk::simplex::Simplex::primitive_type().
Referenced by wmtk::Mesh::map_to_root().
Tuple wmtk::multimesh::MultiMeshManager::map_to_root_tuple | ( | const Mesh & | my_mesh, |
const simplex::Simplex & | my_simplex | ||
) | const |
maps a simplex from this mesh to the root mesh
Cannot be used outside of applications with guaranteed multi-mesh structures
my_mesh | the mesh that this structure is owned by |
the | simplex being mapped to the parent mesh |
Definition at line 545 of file MultiMeshManager.cpp.
References get_root_mesh(), map_tuple_to_root_tuple(), and wmtk::simplex::Simplex::tuple().
Referenced by can_map(), map_to_root(), and wmtk::Mesh::map_to_root_tuple().
|
staticprotected |
Definition at line 36 of file MultiMeshManager.cpp.
References wmtk::Edge, wmtk::Tuple::global_cid(), wmtk::Mesh::is_valid(), wmtk::Tuple::local_fid(), wmtk::multimesh::utils::read_tuple_map_attribute(), wmtk::Mesh::switch_tuple(), wmtk::Tetrahedron, wmtk::simplex::top_dimension_cofaces_tuples(), wmtk::Mesh::top_simplex_type(), wmtk::multimesh::utils::transport_tuple(), and wmtk::Triangle.
Referenced by check_child_map_valid(), map_to_child_tuples(), and map_tuple_to_parent_tuple().
|
protected |
Definition at line 580 of file MultiMeshManager.cpp.
References wmtk::Mesh::create_const_accessor(), is_root(), wmtk::Mesh::m_multi_mesh_manager, m_parent, map_to_parent_handle, and map_tuple_between_meshes().
Referenced by map_to_parent(), map_to_parent_tuple(), map_tuple_to_root_tuple(), and map_up_to_tuples().
|
protected |
Definition at line 552 of file MultiMeshManager.cpp.
References is_root(), wmtk::Mesh::is_valid(), wmtk::Mesh::m_multi_mesh_manager, m_parent, map_tuple_to_parent_tuple(), and map_tuple_to_root_tuple().
Referenced by map_to_root_tuple(), and map_tuple_to_root_tuple().
std::vector< Tuple > wmtk::multimesh::MultiMeshManager::map_tuples | ( | const Mesh & | my_mesh, |
const Mesh & | other_mesh, | ||
const simplex::Simplex & | my_simplex | ||
) | const |
maps a simplex from this mesh to any other mesh
Generic interface for mapping between two arbitrary meshes in a multi-mesh structure Note that this finds ALL versions of a simplex, potentially crossing over topological features above the pairs of simplices being mapped. For instance, if we map a trimesh seam edge to itself using this interface it will find the edge on the other side of the seam. If more granular mappings are required consider manually navigating the tree with map_to_parent and map_to_child, which of course require a more particular understanding on how a simplex is mapped. throws if two meshes are not part of the same multi-mesh structure
my_mesh | the mesh that this structure is owned by |
the | mesh a simplex should be mapped to |
the | simplex being mapped to the child mesh |
Definition at line 496 of file MultiMeshManager.cpp.
References absolute_id(), wmtk::Mesh::absolute_multi_mesh_id(), map_up_to_tuples(), and wmtk::simplex::Simplex::primitive_type().
Referenced by map(), and wmtk::Mesh::map_tuples().
|
protected |
Definition at line 431 of file MultiMeshManager.cpp.
References wmtk::Mesh::m_multi_mesh_manager, m_parent, map_tuple_to_parent_tuple(), wmtk::simplex::Simplex::primitive_type(), and wmtk::simplex::Simplex::tuple().
Referenced by can_map_child(), lub_map_tuples(), and map_tuples().
|
default |
|
default |
|
staticprotected |
Definition at line 388 of file MultiMeshManager_map_updates.cpp.
References wmtk::Mesh::get_index_access().
Referenced by wmtk::operations::utils::UpdateEdgeOperationMultiMeshMapFunctor::parent_global_cid().
|
staticprotected |
Definition at line 400 of file MultiMeshManager_map_updates.cpp.
References wmtk::Mesh::get_index_access().
Referenced by wmtk::operations::utils::UpdateEdgeOperationMultiMeshMapFunctor::parent_local_fid().
|
staticprotected |
Definition at line 703 of file MultiMeshManager.cpp.
Referenced by wmtk::HDF5Reader::read(), register_child_mesh(), and update_child_handles().
void wmtk::multimesh::MultiMeshManager::register_child_mesh | ( | Mesh & | my_mesh, |
const std::shared_ptr< Mesh > & | child_mesh, | ||
const std::vector< std::array< Tuple, 2 > > & | child_tuple_my_tuple_map | ||
) |
register a another mesh as a child of this mesh.
my_mesh | the mesh that this structure is owned by |
child_mesh | the mesh that will be added a child of this mesh |
the | set of tuples {A,B} where A is from "this mesh" and B represents a top-dimension simplex in the child_mesh. Every top dimension tuple of the child mesh must be represented here |
Definition at line 209 of file MultiMeshManager.cpp.
References child_to_parent_map_attribute_name(), wmtk::Mesh::create_accessor(), wmtk::Mesh::is_valid(), m_child_id, m_children, m_has_child_mesh_in_dimension, wmtk::Mesh::m_multi_mesh_manager, m_parent, map_to_parent_handle, parent_to_child_map_attribute_name(), wmtk::Mesh::register_attribute_typed(), wmtk::multimesh::utils::symmetric_write_tuple_map_attributes(), wmtk::Mesh::top_cell_dimension(), and wmtk::Mesh::top_simplex_type().
Referenced by wmtk::Mesh::register_child_mesh().
std::vector< int64_t > wmtk::multimesh::MultiMeshManager::relative_id | ( | const Mesh & | my_mesh, |
const Mesh & | parent_mesh | ||
) | const |
Definition at line 182 of file MultiMeshManager.cpp.
References is_child(), is_root(), m_child_id, wmtk::Mesh::m_multi_mesh_manager, m_parent, and relative_id().
|
static |
Definition at line 884 of file MultiMeshManager.cpp.
References is_child().
Referenced by wmtk::components::multimesh::NamedMultiMesh::append_child_mesh_names(), get_child_mesh(), get_child_mesh(), wmtk::components::multimesh::NamedMultiMesh::get_id(), lub_map_tuples(), map_down_relative_tuples(), relative_id(), and wmtk::Mesh::serialize().
|
staticprivate |
Definition at line 667 of file MultiMeshManager.cpp.
References wmtk::Mesh::capacity(), wmtk::Mesh::get_const_flag_accessor(), wmtk::Mesh::top_simplex_type(), and wmtk::Mesh::tuple_from_id().
void wmtk::multimesh::MultiMeshManager::serialize | ( | MeshWriter & | writer, |
const Mesh * | local_root = nullptr |
||
) | const |
Definition at line 908 of file MultiMeshManager.cpp.
References m_children.
Referenced by wmtk::Mesh::serialize().
|
protected |
void wmtk::multimesh::MultiMeshManager::update_child_handles | ( | Mesh & | my_mesh | ) |
Clean up child data after deleting attributes.
When attributes are deleted, all attribute handles are invalidated. This method goes through all child data and updates the handles.
Definition at line 38 of file MultiMeshManager_map_updates.cpp.
References children(), wmtk::Mesh::get_attribute_handle_typed(), wmtk::Mesh::m_attribute_manager, m_children, wmtk::Mesh::m_multi_mesh_manager, wmtk::multimesh::MultiMeshManager::ChildData::mesh, parent_to_child_map_attribute_name(), and wmtk::attribute::AttributeManager::set_name().
Referenced by deregister_child_mesh(), and wmtk::Mesh::update_child_handles().
|
protected |
Definition at line 148 of file MultiMeshManager_map_updates.cpp.
References children(), find_tuple_from_gid(), find_valid_tuple(), wmtk::Mesh::get_const_flag_accessor(), wmtk::Mesh::get_index_access(), get_map_accessors(), wmtk::Tuple::global_cid(), wmtk::Tuple::is_null(), wmtk::Mesh::is_valid(), wmtk::Mesh::parent_scope(), wmtk::multimesh::utils::symmetric_write_tuple_map_attributes(), wmtk::Mesh::top_simplex_type(), wmtk::multimesh::utils::transport_tuple(), wmtk::simplex::Simplex::tuple(), and wmtk::multimesh::utils::vectors_to_tuples().
Referenced by wmtk::operations::utils::UpdateEdgeOperationMultiMeshMapFunctor::update_all_hashes().
|
protected |
Definition at line 59 of file MultiMeshManager_map_updates.cpp.
References children(), wmtk::Mesh::get_const_flag_accessor(), wmtk::Mesh::get_index_access(), get_map_accessors(), wmtk::Tuple::is_null(), wmtk::Mesh::is_removed(), wmtk::logger(), wmtk::multimesh::utils::symmetric_write_tuple_map_attributes(), and wmtk::multimesh::utils::vectors_to_tuples().
|
friend |
Definition at line 67 of file MultiMeshManager.hpp.
|
friend |
Definition at line 70 of file MultiMeshManager.hpp.
|
friend |
Definition at line 74 of file MultiMeshManager.hpp.
|
friend |
Definition at line 76 of file MultiMeshManager.hpp.
|
friend |
Referenced by wmtk::multimesh::same_simplex_dimension_surjection().
|
friend |
Definition at line 71 of file MultiMeshManager.hpp.
|
friend |
Definition at line 79 of file MultiMeshManager.hpp.
|
friend |
Definition at line 77 of file MultiMeshManager.hpp.
|
friend |
Definition at line 68 of file MultiMeshManager.hpp.
|
protected |
Definition at line 379 of file MultiMeshManager.hpp.
Referenced by absolute_id(), child_hashes(), child_id(), wmtk::Mesh::consolidate(), deregister_child_mesh(), get_child_mesh(), map_down_relative_tuples(), register_child_mesh(), and relative_id().
|
protected |
Definition at line 383 of file MultiMeshManager.hpp.
Referenced by wmtk::multimesh::utils::MapValidator::check_child_map_attributes_valid(), child_hashables(), child_hashes(), children(), children(), wmtk::Mesh::consolidate(), deregister_child_mesh(), detach_children(), get_child_mesh(), get_child_meshes(), map_down_relative_tuples(), map_handles(), map_to_child_tuples(), register_child_mesh(), serialize(), and update_child_handles().
|
protected |
Definition at line 386 of file MultiMeshManager.hpp.
Referenced by has_child_mesh(), has_child_mesh_in_dimension(), and register_child_mesh().
|
protected |
Definition at line 373 of file MultiMeshManager.hpp.
Referenced by absolute_id(), wmtk::multimesh::utils::MapValidator::check_child_switch_homomorphism(), wmtk::multimesh::utils::MapValidator::check_parent_map_attribute_valid(), child_hashes(), wmtk::Mesh::consolidate(), deregister_child_mesh(), get_root_mesh(), get_root_mesh(), is_child(), is_root(), map_tuple_to_parent_tuple(), map_tuple_to_root_tuple(), map_up_to_tuples(), register_child_mesh(), and relative_id().
|
protected |
Definition at line 376 of file MultiMeshManager.hpp.
Referenced by wmtk::multimesh::utils::MapValidator::check_parent_map_attribute_valid(), child_hashes(), wmtk::Mesh::consolidate(), deregister_child_mesh(), get_map_accessors(), get_map_const_accessors(), map_handles(), map_tuple_to_parent_tuple(), wmtk::operations::utils::UpdateEdgeOperationMultiMeshMapFunctor::operator()(), wmtk::operations::utils::UpdateEdgeOperationMultiMeshMapFunctor::operator()(), wmtk::operations::utils::UpdateEdgeOperationMultiMeshMapFunctor::operator()(), wmtk::operations::utils::UpdateEdgeOperationMultiMeshMapFunctor::operator()(), wmtk::operations::utils::UpdateEdgeOperationMultiMeshMapFunctor::operator()(), and register_child_mesh().