19class EdgeOperationData;
21class UpdateEdgeOperationMultiMeshMapFunctor;
27template <
int64_t cell_dimension,
typename NodeFunctor>
29template <
typename Visitor>
30class MultiMeshSimplexVisitorExecutor;
32template <
typename NodeFunctor>
34template <
typename Visitor>
35class MultiMeshVisitorExecutor;
45class SimplexCollection;
57 template <
int64_t cell_dimension,
typename NodeFunctor>
60 template <
typename Visitor>
64 template <
typename NodeFunctor>
66 template <
typename Visitor>
82 std::map<std::string, const wmtk::utils::Hashable*>
child_hashables()
const override;
83 std::map<std::string, std::size_t>
child_hashes()
const override;
97 std::vector<TypedAttributeHandle<int64_t>>
map_handles()
const;
135 const std::shared_ptr<Mesh>& child_mesh,
136 const std::vector<std::array<Tuple, 2>>& child_tuple_my_tuple_map);
195 std::vector<simplex::Simplex>
211 const Mesh& other_mesh,
225 std::vector<simplex::Simplex>
247 const Mesh& other_mesh,
315 const Mesh& child_mesh,
319 const Mesh& child_mesh,
327 const Mesh& other_mesh,
406 const Mesh& source_mesh,
407 const Mesh& target_mesh,
409 const Tuple& source_tuple);
428 const ChildData& c)
const;
443 const std::vector<std::tuple<int64_t, std::vector<Tuple>>>& simplices_to_update,
444 const std::vector<std::tuple<int64_t, std::array<int64_t, 2>>>& split_cell_maps = {});
458 const int64_t old_gid,
459 const std::vector<Tuple>& tuple_alternatives,
460 const std::vector<std::tuple<int64_t, std::array<int64_t, 2>>>& split_cell_maps = {})
const;
466 const std::vector<Tuple>& tuple_alternatives)
const;
472 const simplex::Simplex& old_simplex,
473 const int64_t old_gid,
474 const std::vector<Tuple>& tuple_alternatives,
475 const std::vector<std::tuple<int64_t, std::array<int64_t, 2>>>& split_cell_maps)
const;
480 const int64_t old_gid,
481 const std::vector<Tuple>& tuple_alternatives,
482 const std::tuple<int64_t, std::array<int64_t, 2>>& split_cell_maps)
const;
488 const std::vector<Tuple>& tuples,
514 std::pair<const Mesh&, Tuple>
523 const std::vector<int64_t>& local_id_path)
const;
528 const std::vector<int64_t>& a,
529 const std::vector<int64_t>& b);
531 const std::vector<int64_t>& parent,
532 const std::vector<int64_t>& child);
537 static bool is_child(
const std::vector<int64_t>& child,
const std::vector<int64_t>& parent);
544 const std::vector<int64_t>& parent_simplices);
The Tuple is the basic navigation tool in our mesh data structure.
An Accessor that uses tuples for accessing attributes instead of indices.
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
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)
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)
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)
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::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
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)
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
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)
std::vector< ChildData > & children()
static std::string child_to_parent_map_attribute_name()
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={})
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::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
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
const std::vector< ChildData > & children() const
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
Mesh & get_child_mesh(Mesh &m, const std::vector< int64_t > &relative_id)
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
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.
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 >
MultiMeshSimplexVisitor(std::integral_constant< int64_t, cell_dimension >, NodeFunctor &&) -> MultiMeshSimplexVisitor< cell_dimension, NodeFunctor >
std::shared_ptr< Mesh > mesh
TypedAttributeHandle< int64_t > map_handle