20 namespace operations {
21 class EdgeOperationData;
23 class UpdateEdgeOperationMultiMeshMapFunctor;
27 template <
typename T,
typename MeshType,
int Dim>
31 template <
int64_t cell_dimension,
typename NodeFunctor>
33 template <
typename Visitor>
34 class MultiMeshSimplexVisitorExecutor;
36 template <
typename NodeFunctor>
38 template <
typename Visitor>
39 class MultiMeshVisitorExecutor;
49 class SimplexCollection;
63 const std::vector<int64_t>& parent_simplices);
66 template <
int64_t cell_dimension,
typename NodeFunctor>
69 template <
typename Visitor>
73 template <
typename NodeFunctor>
75 template <
typename Visitor>
91 std::map<std::string, const wmtk::utils::Hashable*>
child_hashables()
const override;
92 std::map<std::string, std::size_t>
child_hashes()
const override;
106 std::vector<TypedAttributeHandle<int64_t>>
map_handles()
const;
144 const std::shared_ptr<Mesh>& child_mesh,
145 const std::vector<std::array<Tuple, 2>>& child_tuple_my_tuple_map);
204 std::vector<simplex::Simplex>
220 const Mesh& other_mesh,
234 std::vector<simplex::Simplex>
256 const Mesh& other_mesh,
324 const Mesh& child_mesh,
328 const Mesh& child_mesh,
336 const Mesh& other_mesh,
415 const Mesh& source_mesh,
416 const Mesh& target_mesh,
418 const Tuple& source_tuple);
437 const ChildData& c)
const;
452 const std::vector<std::tuple<int64_t, std::vector<Tuple>>>& simplices_to_update,
453 const std::vector<std::tuple<int64_t, std::array<int64_t, 2>>>& split_cell_maps = {});
467 const int64_t old_gid,
468 const std::vector<Tuple>& tuple_alternatives,
469 const std::vector<std::tuple<int64_t, std::array<int64_t, 2>>>& split_cell_maps = {})
const;
475 const std::vector<Tuple>& tuple_alternatives)
const;
481 const simplex::Simplex& old_simplex,
482 const int64_t old_gid,
483 const std::vector<Tuple>& tuple_alternatives,
484 const std::vector<std::tuple<int64_t, std::array<int64_t, 2>>>& split_cell_maps)
const;
489 const int64_t old_gid,
490 const std::vector<Tuple>& tuple_alternatives,
491 const std::tuple<int64_t, std::array<int64_t, 2>>& split_cell_maps)
const;
497 const std::vector<Tuple>& tuples,
523 std::pair<const Mesh&, Tuple>
532 const std::vector<int64_t>& local_id_path)
const;
537 const std::vector<int64_t>& a,
538 const std::vector<int64_t>& b);
540 const std::vector<int64_t>& parent,
541 const std::vector<int64_t>& child);
546 static bool is_child(
const std::vector<int64_t>& child,
const std::vector<int64_t>& parent);
554 const std::vector<int64_t>& parent_simplices);
Handle that represents attributes for some mesh.
Implementation details for how the Mesh class implements multiple meshes.
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 tup...
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
const std::vector< ChildData > & children() const
int64_t child_id() const
Specifies the child id of this mesh if it a child mesh in a mult-mesh tree.
bool has_child_mesh_in_dimension(int64_t dimension) const
static int64_t child_global_cid(const wmtk::attribute::Accessor< int64_t > &parent_to_child, int64_t parent_gid)
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
static std::vector< std::array< Tuple, 2 > > same_simplex_dimension_surjection(const Mesh &parent, const Mesh &child, const std::vector< int64_t > &parent_simplices)
static int64_t parent_local_fid(const wmtk::attribute::Accessor< int64_t > &child_to_parent, int64_t child_gid)
bool can_map_child(const Mesh &my_mesh, const Mesh &other_mesh, const simplex::Simplex &my_simplex) const
MultiMeshManager(const MultiMeshManager &o)
std::map< std::string, const wmtk::utils::Hashable * > child_hashables() const override
const Mesh & get_root_mesh(const Mesh &my_mesh) const
std::vector< ChildData > m_children
MultiMeshManager(MultiMeshManager &&o)
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.
std::optional< Tuple > find_valid_tuple_from_alternatives(Mesh &my_mesh, PrimitiveType primitive_type, const std::vector< Tuple > &tuple_alternatives) const
Mesh & get_mesh(Mesh &m, const std::vector< int64_t > &absolute_id)
static bool is_child(const std::vector< int64_t > &child, const std::vector< int64_t > &parent)
void deregister_child_mesh(Mesh &my_mesh, const std::shared_ptr< Mesh > &child_mesh_ptr)
Deregister a child mesh.
static int64_t parent_global_cid(const wmtk::attribute::Accessor< int64_t > &child_to_parent, int64_t child_gid)
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)
bool is_root() const
Specifies whether this structure is the root of a multi-mesh tree.
std::vector< int64_t > absolute_id() const
static std::vector< int64_t > least_upper_bound_id(const std::vector< int64_t > &a, const std::vector< int64_t > &b)
static std::string parent_to_child_map_attribute_name(int64_t index)
static std::string child_to_parent_map_attribute_name()
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::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
void serialize(MeshWriter &writer, const Mesh *local_root=nullptr) const
bool has_child_mesh() const
std::vector< std::shared_ptr< Mesh > > get_child_meshes() 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
std::vector< bool > m_has_child_mesh_in_dimension
TypedAttributeHandle< int64_t > map_to_parent_handle
MultiMeshManager & operator=(const MultiMeshManager &o)
static std::vector< int64_t > relative_id(const std::vector< int64_t > &parent, const std::vector< int64_t > &child)
std::vector< TypedAttributeHandle< int64_t > > map_handles() const
std::map< std::string, std::size_t > child_hashes() const override
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
void update_child_handles(Mesh &my_mesh)
Clean up child data after deleting attributes.
std::vector< ChildData > & children()
std::array< wmtk::attribute::Accessor< int64_t >, 2 > get_map_accessors(Mesh &my_mesh, ChildData &c)
Tuple map_tuple_to_root_tuple(const Mesh &my_mesh, const Tuple &my_tuple) 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={})
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
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
MultiMeshManager & operator=(MultiMeshManager &&o)
std::array< const wmtk::attribute::Accessor< int64_t >, 2 > get_map_const_accessors(const Mesh &my_mesh, const ChildData &c) const
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
static std::optional< Tuple > find_tuple_from_gid(const Mesh &my_mesh, PrimitiveType primitive_type, const std::vector< Tuple > &tuples, int64_t gid)
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
void check_child_map_valid(const Mesh &my_mesh, const ChildData &child_data) const
bool can_map(const Mesh &my_mesh, const Mesh &other_mesh, const simplex::Simplex &my_simplex) const
std::vector< Tuple > map_to_child_tuples(const Mesh &my_mesh, const Mesh &child_mesh, const simplex::Simplex &my_simplex) const
MultiMeshManager(int64_t dimension)
Mesh & get_child_mesh(Mesh &m, const std::vector< int64_t > &relative_id)
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::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::pair< const Mesh &, Tuple > map_up_to_tuples(const Mesh &my_mesh, const simplex::Simplex &simplex, int64_t depth) const
Tuple map_tuple_to_parent_tuple(const Mesh &my_mesh, const Tuple &my_tuple) const
void update_maps_from_edge_operation(Mesh &my_mesh, PrimitiveType primitive_type, const operations::EdgeOperationData &operation_data)
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::pair< std::shared_ptr< Mesh >, std::shared_ptr< Mesh > > multimesh(const MultiMeshType &type, Mesh &parent, std::shared_ptr< Mesh > child, const attribute::MeshAttributeHandle parent_position_handle, const std::string &tag_name, const int64_t tag_value, const int64_t primitive)
MultiMeshVisitor(NodeFunctor &&) -> MultiMeshVisitor< NodeFunctor >
std::vector< std::array< Tuple, 2 > > same_simplex_dimension_surjection(const Mesh &parent, const Mesh &child, const std::vector< int64_t > &parent_simplices)
MultiMeshSimplexVisitor(std::integral_constant< int64_t, cell_dimension >, NodeFunctor &&) -> MultiMeshSimplexVisitor< cell_dimension, NodeFunctor >
std::shared_ptr< Mesh > mesh
TypedAttributeHandle< int64_t > map_handle