2#ifndef model_Polyhedron_H_
3#define model_Polyhedron_H_
15 template <
short int dim,
short int order>
class Simplex;
16 template <
int dim>
struct Plane;
19 template <
int dim,
int order>
struct Polyhedron;
21 template <
int dim,
int order>
33 template <
int dim,
int order,
bool enabled = (order < dim)> struct PolyhedralParents
35 using Parent = Polyhedron<dim, order + 1>;
36 std::map<PolyhedronKey<dim, order + 1>, std::weak_ptr<Parent>> parents;
45 std::weak_ptr<Polyhedron<dim, 2>>
face;
46 std::shared_ptr<Polyhedron<dim, 1>>
edge;
49 std::shared_ptr<Polyhedron<dim, 0>>
source()
const;
50 std::shared_ptr<Polyhedron<dim, 0>>
sink()
const;
51 Eigen::Matrix<double, dim, 1>
tangent()
const;
52 Eigen::Matrix<double, dim, 1>
outNormal(
size_t regionID)
const
64 Eigen::Matrix<double, dim, 1>
position = Eigen::Matrix<double, dim, 1>::Zero();
72 std::vector<PolyhedralFaceIncidence<dim>>
perimeter;
90 std::vector<const Simplex<dim, 0> *>
hull;
91 std::pair<VectorDim, const Polyhedron<dim, order> *>
periodicFacePair{VectorDim::Zero(),
nullptr};
107 template <
int dim,
int order>
113 std::set<const Simplex<dim, order> *>
137 requires(
order == dim)
142 requires(
order == dim)
147 requires(
order == dim - 1)
149 return this->
parents.size() == 1;
152 requires(
order == dim - 1);
154 requires(
order == dim - 1)
158 const std::vector<const Simplex<dim, 0> *> &
convexHull() const
159 requires(
order == dim - 1);
161 requires(
order == dim - 1);
163 requires(
order == dim - 1);
165 requires(
order == dim - 1);
167 requires(
order == dim - 1);
169 requires(
order == dim - 1);
171 requires(
order == dim);
173 requires(
order == dim);
177 requires(
order == dim);
178 void buildSingleFace(const
Simplex<dim, dim - 1> *start, std::shared_ptr<
Polyhedron<dim, dim - 1>> face,
179 std::map<std::
vector<
size_t>, const
Simplex<dim, dim - 1> *> &remaining)
180 requires(
order == dim);
182 template <
int dim,
int order>
the R vector(source to field) R
std::conditional_t<(order >=dim - 1), size_t, std::vector< size_t > > PolyhedronKey
Polyhedron< dim, order - 1 > Child
std::map< PolyhedronKey< dim, order - 1 >, std::shared_ptr< Child > > Children
PolyhedralFaceData(size_t id)
std::pair< VectorDim, const Polyhedron< dim, order > * > periodicFacePair
Eigen::Matrix< double, dim, 1 > VectorDim
std::vector< const Simplex< dim, 0 > * > hull
std::pair< int, int > regionIDs
PolyhedralFaceData(const Key &)
std::weak_ptr< Polyhedron< dim, 2 > > face
PolyhedralFaceIncidence prev() const
Eigen::Matrix< double, dim, 1 > outNormal(size_t regionID) const
PolyhedralFaceIncidence next() const
PolyhedralFaceIncidence otherFace(size_t regionID) const
std::shared_ptr< Polyhedron< dim, 0 > > sink() const
std::shared_ptr< Polyhedron< dim, 0 > > source() const
Eigen::Matrix< double, dim, 1 > tangent() const
std::shared_ptr< Polyhedron< dim, 1 > > edge
Eigen::Matrix< double, dim, 1 > position
std::map< PolyhedronKey< dim, 2 >, size_t > faceIncidences
std::vector< PolyhedralFaceIncidence< dim > > perimeter
std::map< PolyhedronKey< dim, order+1 >, std::weak_ptr< Parent > > parents
PolyhedralRegionData(size_t id)
PolyhedralRegionData(const Key &)
PolyhedralMesh< dim > * owner
std::set< const SimplexType * > SimplexContainerType
MeshFacesContainerType & faces()
PolyhedronKey< dim, order > KeyType
Polyhedron(PolyhedronFactory< dim, order > &factory, const KeyType &id)
Plane< dim > asPlane() const
SimplexContainerType & simplices()
PolyhedronFactory< dim, order > & cellFactory
std::less< KeyType > CompareType
std::map< size_t, std::shared_ptr< Polyhedron< dim, dim - 1 > > > MeshFacesContainerType
const MeshFacesContainerType & faces() const
const SimplexContainerType & simplices() const
const VectorDim & center() const
VectorDim outNormal() const
const SimplexContainerType & internalSimplices() const
Simplex< dim, order > SimplexType
Eigen::Matrix< double, dim, 1 > VectorDim
void initialize(const SimplexType *simplex)
const std::vector< const Simplex< dim, 0 > * > & convexHull() const