Wildmeshing Toolkit
MultiMeshFromTag.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <wmtk/Mesh.hpp>
4 
6 
12 {
13 public:
15  Mesh& mesh,
16  const attribute::MeshAttributeHandle& tag_handle,
17  const int64_t tag_value);
18 
19 
20  Eigen::MatrixX<int64_t> get_new_id_matrix(const PrimitiveType ptype) const;
22 
23  Eigen::MatrixX<int64_t> adjacency_matrix() const;
24 
31  std::shared_ptr<Mesh> substructure_soup() const;
32 
40  std::shared_ptr<Mesh> substructure() const;
41 
46 
48 
49  bool is_root_simplex_manifold(const simplex::Simplex& s) const;
50 
58  void remove_soup();
59 
60 private:
67 
74 
83  std::vector<Tuple> get_connected_region(const Tuple& t, const PrimitiveType ptype);
84 
89 
90 private:
92 
94  const int64_t m_tag_value;
96 
97  std::map<PrimitiveType, attribute::MeshAttributeHandle> m_new_id_handles;
98 
100  Eigen::MatrixX<int64_t> m_adjacency_matrix;
101  std::map<PrimitiveType, Eigen::MatrixX<int64_t>> m_new_id_matrices;
102  std::map<PrimitiveType, VectorXl> m_new_top_coface_vectors;
103  std::shared_ptr<Mesh> m_soup_ptr;
104  std::shared_ptr<Mesh> m_substructure_ptr;
105 };
106 
107 } // namespace wmtk::components::internal
This class generates a multi-mesh from a mesh where the substructure is represented by a tag.
void build_adjacency_matrix()
Create the adjacency (stored as attribute) of the substructure.
void remove_soup()
Remove the substructure soup from the multimesh.
std::shared_ptr< Mesh > substructure_soup() const
Returns a pointer to the substructure soup.
std::shared_ptr< Mesh > substructure() const
Returns a pointer to the manifold substructure mesh.
Eigen::MatrixX< int64_t > get_new_id_matrix(const PrimitiveType ptype) const
const attribute::Accessor< int64_t > m_tag_acc
std::vector< Tuple > get_connected_region(const Tuple &t, const PrimitiveType ptype)
Get tuples with different global_cid that all represent simplex(t_in, ptype) and are in the same tag-...
bool is_root_simplex_manifold(const simplex::Simplex &s) const
std::map< PrimitiveType, VectorXl > m_new_top_coface_vectors
void compute_substructure_mesh()
Create a manifold mesh from the substructure.
std::map< PrimitiveType, attribute::MeshAttributeHandle > m_new_id_handles
Eigen::MatrixX< int64_t > adjacency_matrix() const
MultiMeshFromTag(Mesh &mesh, const attribute::MeshAttributeHandle &tag_handle, const int64_t tag_value)
void create_substructure_soup()
Create a multimesh where the child-mesh is just a soup (no connectivity) of m_mesh.
bool is_substructure_simplex_manifold(const simplex::Simplex &s) const
VectorXl get_new_top_coface_vector(const PrimitiveType ptype) const
std::map< PrimitiveType, Eigen::MatrixX< int64_t > > m_new_id_matrices
attribute::MeshAttributeHandle m_adjacency_handle
void compute_substructure_ids()
Compute the ids of the manifold substructure.
VectorX< int64_t > VectorXl
Definition: Types.hpp:33