Wildmeshing Toolkit
BoundaryChecker.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <wmtk/PrimitiveType.hpp>
3 #include <wmtk/Mesh.hpp>
4 #include <vector>
5 
6 namespace wmtk {
7 class Mesh;
8 class Tuple;
9 namespace simplex {
10 class Simplex;
11 }
12 } // namespace wmtk
13 namespace wmtk::multimesh {
14  // checks whether a simplex is on the boundary using multimesh
15  // youo must manually add meshes as you want to check for boundaryness (and ignore others)
16  // the is_boundary is determined in two ways:
17  // when compared to a mesh of equal or higher dimension this checks if the chosen simplex is on the boundary of that mesh
18  // when compared to a mesh of lesser dimension then it checks if the simplex is mappable at all
20 {
21 public:
22  BoundaryChecker() = default;
23  BoundaryChecker(const BoundaryChecker&) = default;
27 
28  static BoundaryChecker for_all_meshes(const Mesh& m);
29 
30  template <typename... Args>
31  BoundaryChecker(const Mesh& m, Args&&... args);
32  void add_mesh(const Mesh& m);
33 
34  bool is_boundary(const Mesh& m, const wmtk::simplex::Simplex& simplex) const;
35  bool is_boundary(const Mesh& m, const wmtk::PrimitiveType pt, const wmtk::Tuple& simplex) const;
36 
37 private:
38  std::vector<const Mesh*> m_meshes;
39 };
40 
41 template <typename... Args>
42 BoundaryChecker::BoundaryChecker(const Mesh& m, Args&&... rem)
43  : BoundaryChecker(std::forward<Args>(rem)...)
44 {
45  m_meshes.emplace_back(&m);
46 }
47 } // namespace wmtk::multimesh
static BoundaryChecker for_all_meshes(const Mesh &m)
BoundaryChecker(const BoundaryChecker &)=default
BoundaryChecker(BoundaryChecker &&)=default
BoundaryChecker & operator=(const BoundaryChecker &)=default
bool is_boundary(const Mesh &m, const wmtk::simplex::Simplex &simplex) const
BoundaryChecker & operator=(BoundaryChecker &&)=default
std::vector< const Mesh * > m_meshes
Definition: autodiff.h:995
Definition: Accessor.hpp:6