Feel++  0.91.4
Classes | Public Types
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

List of all members.

Classes

struct  pt_to_edge
struct  pt_to_element
struct  pt_to_entity
struct  pt_to_face

Public Types

typedef Simplex< Dim, Order, RDim > super

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

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

template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T>
class Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >


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 >
uint16_type Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::dimension ( ) const [inline]
Returns:
the dimension of the space where the simplex resides

Reimplemented from Feel::Simplex< Dim, Order, RDim >.

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
template<uint16_type Dim, uint16_type Order, uint16_type RDim, typename T >
uint16_type Feel::Reference< Simplex< Dim, Order, RDim >, Dim, Order, RDim, T >::topologicalDimension ( ) const [inline]
Returns:
the topological dimension of the simplex

Reimplemented from Feel::Simplex< Dim, Order, RDim >.