32 #include <boost/detail/identifier.hpp>
33 #include <feel/feelmesh/entities.hpp>
35 #include <feel/feelmesh/simplexordering.hpp>
45 typedef mpl::vector_c<
size_type, 1, Order+1, ( Order+1 )*( Order+2 )/2, ( Order+1 )*( Order+2 )*( Order+3 )/6 > type;
46 typedef mpl::vector_c<
size_type, 0, Order+1-2, ( Order+1-2 )*( Order+2-2 )/2, ( Order+1-2 )*( Order+2-2 )*( Order+3-2 )/6 > interior_type;
47 typedef mpl::vector_c<
size_type, 0, Order+1-2, Order+1-2, Order+1-2 > edge_type;
48 typedef mpl::vector_c<
size_type, 0, 0, ( Order-1 )*( Order-2 )/2, ( Order-1 )*( Order-2 )/2 > face_type;
49 typedef mpl::vector_c<
size_type, 0, 0, 0, ( Order-1 )*( Order-2 )*( Order-3 )/6 > volume_type;
54 typedef mpl::vector_c<size_type, 1, 1, 1, 1> type;
55 typedef mpl::vector_c<size_type, 0, 1, 1, 1> interior_type;
56 typedef mpl::vector_c<size_type, 0, 1, 0, 0> edge_type;
57 typedef mpl::vector_c<size_type, 0, 0, 1, 0> face_type;
58 typedef mpl::vector_c<size_type, 0, 0, 0, 1> volume_type;
70 template<uint16_type Dim,
71 uint16_type Order = 1,
72 uint16_type RDim = Dim>
80 typedef mpl::vector_c<uint16_type, 0, 1, 3, ( 4 ) + ( 4 ) - 2> edges_t;
81 typedef mpl::vector_c<uint16_type, 0, 0, 1, 4> geo_faces_index_t;
82 typedef mpl::vector_c<uint16_type, 0, 2, 3, 4> faces_index_t;
83 typedef mpl::vector_c<uint16_type, 0, 0, 0, 1> volumes_t;
84 typedef mpl::vector_c<uint16_type, 0, 2, 3, 4> normals_t;
86 typedef typename details::points<Order>::type points_t;
87 typedef typename details::points<Order>::interior_type points_interior_t;
88 typedef typename details::points<Order>::edge_type points_edge_t;
89 typedef typename details::points<Order>::face_type points_face_t;
90 typedef typename details::points<Order>::volume_type points_volume_t;
92 typedef mpl::vector_c<size_type, SHAPE_POINT, SHAPE_LINE, SHAPE_TRIANGLE, SHAPE_TETRA> shapes_t;
93 typedef mpl::vector_c<size_type, GEOMETRY_POINT, GEOMETRY_LINE, GEOMETRY_SURFACE, GEOMETRY_VOLUME> geometries_t;
95 static const uint16_type orderTriangle = boost::mpl::if_<boost::mpl::greater< boost::mpl::int_<Order>,
96 boost::mpl::int_<5> >,
98 typename boost::mpl::if_<boost::mpl::less< boost::mpl::int_<Order>,
99 boost::mpl::int_<1> >,
101 boost::mpl::int_<Order>
105 typedef mpl::vector<boost::none_t, details::line<orderTriangle>, details::triangle<orderTriangle>, details::tetra<orderTriangle> > map_entity_to_point_t;
107 typedef mpl::vector_c<uint16_type, 0, 1, 2, 6> permutations_t;
109 template<u
int16_type rdim>
112 typedef mpl::vector<boost::none_t,
121 static const bool is_simplex =
true;
122 static const bool is_hypercube =
false;
124 static const uint16_type nDim = Dim;
125 static const uint16_type nOrder = Order;
126 static const uint16_type nRealDim = RDim;
128 static const uint16_type topological_dimension = nDim;
129 static const uint16_type real_dimension = nRealDim;
131 static const size_type Shape = mpl::at<shapes_t, mpl::int_<nDim> >::type::value;
132 static const size_type Geometry = mpl::at<geometries_t, mpl::int_<nDim> >::type::value;
134 typedef typename mpl::at<elements_t, mpl::int_<nDim> >::type element_type;
135 typedef typename mpl::at<typename faces_t<real_dimension>::type, mpl::int_<nDim> >::type topological_face_type;
136 typedef topological_face_type GeoBShape;
138 static const uint16_type numVertices = nDim+1;
139 static const uint16_type numFaces = mpl::at<geo_faces_index_t, mpl::int_<nDim> >::type::value;
140 static const uint16_type numGeometricFaces = mpl::at<geo_faces_index_t, mpl::int_<nDim> >::type::value;
141 static const uint16_type numTopologicalFaces = mpl::at<faces_index_t, mpl::int_<nDim> >::type::value;
142 static const uint16_type numEdges = mpl::at<edges_t, mpl::int_<nDim> >::type::value;
143 static const uint16_type numVolumes = mpl::at<volumes_t, mpl::int_<nDim> >::type::value;
145 static const uint16_type numNormals = mpl::at<normals_t, mpl::int_<nDim> >::type::value;
147 static const uint16_type nbPtsPerVertex = ( nOrder==0 )?0:1;
148 static const uint16_type nbPtsPerEdge = mpl::at<points_edge_t, mpl::int_<nDim> >::type::value;
149 static const uint16_type nbPtsPerFace = mpl::at<points_face_t, mpl::int_<nDim> >::type::value;
150 static const uint16_type nbPtsPerVolume = mpl::at<points_volume_t, mpl::int_<nDim> >::type::value;
151 static const uint16_type numPoints = ( numVertices * nbPtsPerVertex +
152 numEdges * nbPtsPerEdge +
153 numFaces * nbPtsPerFace +
154 numVolumes * nbPtsPerVolume );
156 typedef typename mpl::at<map_entity_to_point_t, mpl::int_<nDim> >::type edge_to_point_t;
157 typedef typename mpl::at<map_entity_to_point_t, mpl::int_<nDim> >::type face_to_point_t;
158 typedef typename mpl::at<map_entity_to_point_t, mpl::int_<nDim> >::type face_to_edge_t;
161 typedef no_permutation vertex_permutation_type;
163 typedef typename mpl::if_<mpl::greater_equal<mpl::int_<nDim>, mpl::int_<2> >,
164 mpl::identity<line_permutations>,
165 mpl::identity<no_permutation> >::type::type edge_permutation_type;
168 typedef typename mpl::if_<mpl::equal_to<mpl::int_<nDim>, mpl::int_<3> >,
169 mpl::identity<triangular_faces_type>,
170 mpl::identity<no_permutation> >::type::type face_permutation_type;
172 typedef typename mpl::if_<mpl::equal_to<mpl::int_<nDim>, mpl::int_<2> >,
173 mpl::identity<edge_permutation_type>,
174 typename mpl::if_<mpl::equal_to<mpl::int_<nDim>, mpl::int_<3> >,
175 mpl::identity<face_permutation_type>,
176 mpl::identity<no_permutation> >::type>::type::type permutation_type;
178 template<u
int16_type shape_dim, u
int16_type O = Order, u
int16_type R=nDim>
193 return topological_dimension;
201 return real_dimension;
209 return nbPtsPerVertex;
233 return nbPtsPerVolume;
247 return std::max( 0, n + 1 );
250 return std::max( 0, ( n+1 )*( n+2 )/2 );
253 return std::max( 0, ( n+1 )*( n+2 )*( n+3 )/6 );
255 BOOST_STATIC_ASSERT( nDim == 1 || nDim == 2 || nDim == 3 );
256 return uint32_type( -1 );
264 static uint16_type
e2p( uint16_type e, uint16_type p )
266 return edge_to_point_t::e2p( e, p );
274 static uint16_type
f2e( uint16_type f, uint16_type e )
276 return face_to_edge_t::f2e( f, e );
284 static uint16_type
f2eLoc( uint16_type f, uint16_type e )
286 return face_to_edge_t::f2eLoc( f, e );
294 static uint16_type
f2p( uint16_type f, uint16_type p )
296 return face_to_point_t::f2p( f, p );
304 std::ostringstream ostr;
314 static std::string type()
320 template<u
int16_type Dim, u
int16_type Order, u
int16_type RDim >
321 const uint16_type Simplex<Dim, Order, RDim>::topological_dimension;
323 template<
int Dim>
struct Line :
public Simplex<1, Dim> {};
324 template<
int Dim>
struct Triangle :
public Simplex<2, Dim> {};
325 template<
int Dim>
struct Tetrahedron :
public Simplex<3, Dim> {};
static uint16_type f2p(uint16_type f, uint16_type p)
Definition: simplex.hpp:294
simplex of dimension Dim
Definition: simplex.hpp:73
static uint16_type nPointsOnVolume()
Definition: simplex.hpp:231
boost::tuple< mpl::size_t< MESH_POINTS >, typename MeshTraits< MeshType >::point_const_iterator, typename MeshTraits< MeshType >::point_const_iterator > points(MeshType const &mesh)
Definition: filters.hpp:1296
Convex base class.
Definition: convex.hpp:43
static uint32_type polyDims(int n)
Definition: simplex.hpp:244
static uint16_type nPointsOnVertex()
Definition: simplex.hpp:207
static uint16_type f2eLoc(uint16_type f, uint16_type e)
Definition: simplex.hpp:284
static std::string name()
Definition: simplex.hpp:302
static uint16_type e2p(uint16_type e, uint16_type p)
Definition: simplex.hpp:264
size_t size_type
Indices (starting from 0)
Definition: feelcore/feel.hpp:319
uint16_type dimension() const
Definition: simplex.hpp:199
static uint16_type nPointsOnEdge()
Definition: simplex.hpp:215
static uint16_type nPointsOnFace()
Definition: simplex.hpp:223
uint16_type topologicalDimension() const
Definition: simplex.hpp:191
static uint16_type f2e(uint16_type f, uint16_type e)
Definition: simplex.hpp:274