Feel++  0.91.4
Classes | Public Types | List of all members
Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T > Class Template Reference
Inheritance diagram for Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >:
Feel::Simplex< Dim, Order, RDim > Feel::Convex< Dim, Order, RDim > Feel::ConvexBase

Public Types

typedef Simplex< Dim, Order, RDim > super
 
- Public Types inherited from Feel::Simplex< Dim, Order, RDim >
typedef mpl::at< elements_t,
mpl::int_< nDim > >::type 
element_type
 
typedef mpl::at< typename
faces_t< real_dimension >
::type, mpl::int_< nDim >
>::type 
topological_face_type
 
typedef topological_face_type GeoBShape
 
typedef mpl::at
< map_entity_to_point_t,
mpl::int_< nDim > >::type 
edge_to_point_t
 
typedef mpl::at
< map_entity_to_point_t,
mpl::int_< nDim > >::type 
face_to_point_t
 
typedef mpl::at
< map_entity_to_point_t,
mpl::int_< nDim > >::type 
face_to_edge_t
 
typedef no_permutation vertex_permutation_type
 
typedef mpl::if_
< mpl::greater_equal
< mpl::int_< nDim >, mpl::int_
< 2 > >, mpl::identity
< line_permutations >
, mpl::identity
< no_permutation >
>::type::type 
edge_permutation_type
 
typedef mpl::if_
< mpl::equal_to< mpl::int_
< nDim >, mpl::int_
< 3 > >, mpl::identity
< triangular_faces_type >
, mpl::identity
< no_permutation >
>::type::type 
face_permutation_type
 
typedef mpl::if_
< mpl::equal_to< mpl::int_
< nDim >, mpl::int_
< 2 > >, mpl::identity
< edge_permutation_type >
, typename mpl::if_
< mpl::equal_to< mpl::int_
< nDim >, mpl::int_
< 3 > >, mpl::identity
< face_permutation_type >
, mpl::identity
< no_permutation > >::type >
::type::type 
permutation_type
 

Public Member Functions

Constructors, destructor
 Reference ()
 
 Reference (element_type const &e, uint16_type __f)
 
 Reference (Reference const &r)
 
 ~Reference ()
 
Operator overloads
Referenceoperator= (Reference const &r)
 
Accessors
uint16_type topologicalDimension () const
 
uint16_type dimension () const
 
uint16_type nVertices () const
 
uint16_type nPoints () const
 
uint16_type nEdges () const
 
uint16_type nFaces () const
 
points_type const & vertices () const
 
ublas::matrix_column
< points_type const > 
vertex (uint16_type __i) const
 
ublas::matrix_column
< points_type const > 
edgeVertex (uint16_type __e, uint16_type __p) const
 
ublas::matrix_column
< points_type const > 
faceVertex (uint16_type f, uint16_type p) const
 
matrix_node_type faceVertices (uint16_type f) const
 
points_type const & points () const
 
ublas::matrix_column
< points_type const > 
point (uint16_type __i) const
 
node_type barycenter () const
 
points_type barycenterFaces () const
 
ublas::matrix_column
< matrix_node_type const > 
faceBarycenter (uint16_type f) const
 
normals_type const & normals () const
 
node_type const & normal (uint16_type __n) const
 
node_type const & tangent (uint16_type __n) const
 
normal_const_iterator beginNormal () const
 
normal_const_iterator endNormal () const
 
topological_face_type topologicalFace (uint16_type __f) const
 
points_type const & G () const
 
double measure () const
 
size_type id () const
 
flag_type marker () const
 
flag_type marker2 () const
 
flag_type marker3 () const
 
uint16_type ad_first () const
 
uint16_type ad_second () const
 
uint16_type pos_first () const
 
uint16_type pos_second () const
 
permutation_type permutation (uint16_type) const
 
double h () const
 
double h (int e) const
 
double hFace (int) const
 
EntityRange< self_typeentityRange (uint16_type d) const
 
Methods
points_type makePoints (uint16_type topo_dim, uint16_type __id, int interior=1) const
 
template<size_type shape>
points_type makeLattice (uint16_type interior=0) const
 
boost::tuple< bool, value_type > isIn (typename node< value_type >::type const &pt) const
 
- Public Member Functions inherited from Feel::Simplex< Dim, Order, RDim >
uint16_type topologicalDimension () const
 
uint16_type dimension () const
 
- Public Member Functions inherited from Feel::Convex< Dim, Order, RDim >
 Convex ()
 default constructor
 
 Convex (Convex const &)
 copy constructor
 
virtual ~Convex ()
 destructor
 
Convexoperator= (Convex const &o)
 copy operator
 

Typedefs

typedef T value_type
 
typedef Reference< Simplex
< Dim, Order, RDim >, Dim,
Order, RDim, T > 
self_type
 
typedef mpl::if_
< boost::is_same< typename
super::element_type,
boost::none_t >, mpl::identity
< boost::none_t >
, mpl::identity< Reference
< typename super::element_type,
nDim+1, nOrder, nRealDim, T >
> >::type::type 
element_type
 
typedef Reference< typename
super::topological_face_type,
super::topological_face_type::nDim,
nOrder, nRealDim, T > 
topological_face_type
 
typedef super::edge_to_point_t edge_to_point_t
 
typedef super::face_to_point_t face_to_point_t
 
typedef super::face_to_edge_t face_to_edge_t
 
typedef node< value_type >::type node_type
 
typedef matrix_node
< value_type >::type 
points_type
 
typedef points_type matrix_node_type
 
typedef node_type normal_type
 
typedef ublas::vector
< normal_type > 
normals_type
 
typedef
normals_type::const_iterator 
normal_const_iterator
 
typedef super::permutation_type permutation_type
 
static const uint16_type nDim = super::nDim
 
static const uint16_type nOrder = super::nOrder
 
static const uint16_type nRealDim = super::nRealDim
 
static const uint16_type topological_dimension = super::topological_dimension
 
static const uint16_type real_dimension = super::real_dimension
 
static const size_type Shape = super::Shape
 
static const size_type Geometry = super::Geometry
 
static const uint16_type numVertices = super::numVertices
 
static const uint16_type numFaces = super::numFaces
 
static const uint16_type numGeometricFaces = super::numGeometricFaces
 
static const uint16_type numTopologicalFaces = super::numTopologicalFaces
 
static const uint16_type numEdges = super::numEdges
 
static const uint16_type numNormals = super::numNormals
 
static const uint16_type numPoints = super::numPoints
 
static const uint16_type nbPtsPerVertex = super::nbPtsPerVertex
 
static const uint16_type nbPtsPerEdge = super::nbPtsPerEdge
 
static const uint16_type nbPtsPerFace = super::nbPtsPerFace
 
static const uint16_type nbPtsPerVolume = super::nbPtsPerVolume
 

Additional Inherited Members

- Static Public Member Functions inherited from Feel::Simplex< Dim, Order, RDim >
static uint16_type nPointsOnVertex ()
 
static uint16_type nPointsOnEdge ()
 
static uint16_type nPointsOnFace ()
 
static uint16_type nPointsOnVolume ()
 
static uint32_type polyDims (int n)
 
static uint16_type e2p (uint16_type e, uint16_type p)
 
static uint16_type f2e (uint16_type f, uint16_type e)
 
static uint16_type f2eLoc (uint16_type f, uint16_type e)
 
static uint16_type f2p (uint16_type f, uint16_type p)
 
static std::string name ()
 
static std::string type ()
 
- Static Public Attributes inherited from Feel::Simplex< Dim, Order, RDim >
static const bool is_simplex = true
 
static const bool is_hypercube = false
 
static const uint16_type nDim = Dim
 
static const uint16_type nOrder = Order
 
static const uint16_type nRealDim = RDim
 
static const uint16_type topological_dimension = nDim
 
static const uint16_type real_dimension = nRealDim
 
static const size_type Shape = mpl::at<shapes_t, mpl::int_<nDim> >::type::value
 
static const size_type Geometry = mpl::at<geometries_t, mpl::int_<nDim> >::type::value
 
static const uint16_type numVertices = nDim+1
 
static const uint16_type numFaces = mpl::at<geo_faces_index_t, mpl::int_<nDim> >::type::value
 
static const uint16_type numGeometricFaces = mpl::at<geo_faces_index_t, mpl::int_<nDim> >::type::value
 
static const uint16_type numTopologicalFaces = mpl::at<faces_index_t, mpl::int_<nDim> >::type::value
 
static const uint16_type numEdges = mpl::at<edges_t, mpl::int_<nDim> >::type::value
 
static const uint16_type numVolumes = mpl::at<volumes_t, mpl::int_<nDim> >::type::value
 
static const uint16_type numNormals = mpl::at<normals_t, mpl::int_<nDim> >::type::value
 
static const uint16_type nbPtsPerVertex = (nOrder==0)?0:1
 
static const uint16_type nbPtsPerEdge = (nOrder==0)?((nDim==1)?1:0):mpl::at<points_edge_t, mpl::int_<nDim> >::type::value
 
static const uint16_type nbPtsPerFace = (nOrder==0)?((nDim==2)?1:0):mpl::at<points_face_t, mpl::int_<nDim> >::type::value
 
static const uint16_type nbPtsPerVolume = (nOrder==0)?((nDim==3)?1:0):mpl::at<points_volume_t, mpl::int_<nDim> >::type::value
 
static const uint16_type numPoints
 

Member Function Documentation

template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
node_type Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::barycenter ( ) const
inline
Returns
the barycenter of the reference simplex
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
points_type Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::barycenterFaces ( ) const
inline
Returns
the barycenter of the faces of the reference simplex
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
normal_const_iterator Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::beginNormal ( ) const
inline

the first iterator of the normal vector

Returns
the begin() iterator of the normal vector
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
normal_const_iterator Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::endNormal ( ) const
inline

the end() iterator

Returns
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
ublas::matrix_column<matrix_node_type const> Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::faceBarycenter ( uint16_type  f) const
inline
Returns
the barycenter of the face f of the reference simplex
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
ublas::matrix_column<points_type const> Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::faceVertex ( uint16_type  f,
uint16_type  p 
) const
inline
Returns
the vertex p of the face
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
matrix_node_type Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::faceVertices ( uint16_type  f) const
inline
Returns
the vertices of the face f
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
boost::tuple<bool, value_type> Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::isIn ( typename node< value_type >::type const &  pt) const
inline

*Let the tetrahedron have vertices V1 = (x1, y1, z1) V2 = (x2, y2, z2) V3 = (x3, y3, z3) V4 = (x4, y4, z4)

and your test point be P = (x, y, z).

Then the point P is in the tetrahedron if following five determinants all have the same sign. |x1 y1 z1 1| D0 = |x2 y2 z2 1| |x3 y3 z3 1| |x4 y4 z4 1|

|x y z 1| D1 = |x2 y2 z2 1| |x3 y3 z3 1| |x4 y4 z4 1|

|x1 y1 z1 1| D2 = |x y z 1| |x3 y3 z3 1| |x4 y4 z4 1|

|x1 y1 z1 1| D3 = |x2 y2 z2 1| |x y z 1| |x4 y4 z4 1|

|x1 y1 z1 1| D4 = |x2 y2 z2 1| |x3 y3 z3 1| |x y z 1|

Some additional notes:

  1. If by chance the D0=0, then your tetrahedron is degenerate (the points are coplanar).
  2. If any other Di=0, then P lies on boundary i (boundary i being that boundary formed by the three points other than Vi).
  3. If the sign of any Di differs from that of D0 then P is outside boundary i.
  4. If the sign of any Di equals that of D0 then P is inside boundary i.
  5. If P is inside all 4 boundaries, then it is inside the tetrahedron.
  6. As a check, it must be that D0 = D1+D2+D3+D4.
  7. The pattern here should be clear; the computations can be extended to simplicies of any dimension. (The 2D and 3D case are the triangle and the tetrahedron).
  8. the quantities bi = Di/D0 are the usual barycentric coordinates. Comparing signs of Di and D0 is only a check that P and Vi are on the same side of boundary i.
Returns
a positive or null number if pt is in the convex
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
double Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::measure ( ) const
inline
Returns
the measure of the reference element
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
node_type const& Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::normal ( uint16_type  __n) const
inline

get the n-th normal

Parameters
__nthe index of the normal
Returns
the n-th normal of the triangle
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
normals_type const& Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::normals ( ) const
inline

get the normals array

Returns
the normals
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
node_type const& Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::tangent ( uint16_type  __n) const
inline

get the n-th unit tangent

Parameters
__nthe index of the normal
Returns
the n-th normal of the triangle