8#ifndef model_SimplexTraits_H_
9#define model_SimplexTraits_H_
21 template<
short int dim,
short int order>
24 template<
short int dim,
short int order>
27 template<
short int nVertices>
28 struct SimplexID :
public std::array<size_t,nVertices>
31 typedef typename std::array<size_t,nVertices>::size_type
size_type;
35 if(set.size()==nVertices)
38 for (
const size_t&
m : set)
40 this->operator[](
k)=
m;
47 for (
const size_t&
m : set)
52 throw std::runtime_error(
"Cannot create SimplexID from this set.");
58 return this->operator[](
k);
63 return this->operator[](
k);
70 for(
const auto& val : xID)
78 template<
short int dim,
short int order>
81 static_assert(dim>0,
"dim must be > 0");
82 static_assert(
order>0,
"order must be >= 0");
83 static_assert(
order<=dim,
"order must be <= dim");
114 assert(
j<
nVertices &&
"REQUESTING NON-EXISTING FACE");
115 std::set<size_t> set;
144 if(*faceIDS[
k]==childID)
150 assert(
temp>=0 &&
"FACE NOT FOUND");
156 template<
short int dim>
const ScalarIDType & operator()(const size_type &k) const
ScalarIDType & operator()(const size_type &k)
std::array< size_t, nVertices >::size_type size_type
friend T & operator<<(T &os, const SimplexID &xID)
SimplexID(const std::set< size_t > &set)
Simplex< dim, order > SimplexType
Simplex< dim, order+1 > ParentSimplexType
SimplexID< nVertices >::ScalarIDType ScalarIDType
SimplexID< nVertices > SimplexIDType
static SimplexIDType sortID(const SimplexIDType &vIN)
static SimplexTraits< dim, order-1 >::SimplexIDType faceID(const SimplexIDType &xID, const size_t &j)
static SimplexIDType sortID(const SimplexIDType &vIN)
std::array< std::shared_ptr< Simplex< dim, order-1 > >, nFaces > BaseArrayType
Simplex< dim, order > SimplexType
static constexpr int nEdges
static constexpr int nFaces
static constexpr int nVertices
SimplexID< nVertices >::ScalarIDType ScalarIDType
static size_t faceOrder(const SimplexIDType &parentID, const typename SimplexTraits< dim, order-1 >::SimplexIDType &childID)
SimplexID< nVertices > SimplexIDType
static std::array< std::shared_ptr< typename SimplexTraits< dim, order-1 >::SimplexIDType >, nFaces > faceIDs(const SimplexIDType &xID)
Simplex< dim, order+1 > ParentSimplexType