LifeV
ReferenceElement Class Reference

ReferenceElement - The basis class for the geometric mapping and the reference finite elements. More...

#include <ReferenceElement.hpp>

+ Inheritance diagram for ReferenceElement:
+ Collaboration diagram for ReferenceElement:

Private Attributes

const function_TypeM_phi
 pointer on the basis functions More...
 
const function_TypeM_dPhi
 pointer on the derivatives of the basis functions More...
 
const function_TypeM_d2Phi
 pointer on the second derivatives of the basis functions More...
 
const function_TypeM_divPhi
 pointer on the divergence of the basis functions More...
 
const RealM_refCoor
 reference coordinates. Order: xistd::placeholders::_1,etA_1,zetA_1,xistd::placeholders::_2,etA_2,zetA_2,... More...
 
const std::string M_name
 name of the reference element More...
 
const ReferenceShapes M_shape
 geometrical shape of the element More...
 
const UInt M_nbDof
 Total number of degrees of freedom. More...
 
const UInt M_nbLocalCoor
 Number of local coordinates. More...
 
const UInt M_feDim
 Number of dimension of the FE (1 for scalar FE, more for vectorial FE) More...
 

Public Types

typedef Real(* function_Type) (const GeoVector &)
 

Constructor & Destructor

 ReferenceElement (std::string name, ReferenceShapes shape, UInt nbDof, UInt nbLocalCoor, UInt feDim, const function_Type *phi, const function_Type *dPhi, const function_Type *d2Phi, const function_Type *divPhi, const Real *refCoor)
 Full constructor. More...
 
virtual ~ReferenceElement ()
 Destructor. More...
 

Methods

Real xi (UInt i) const
 return the first local coordinate of the i-th node of the reference element More...
 
Real eta (UInt i) const
 return the second local coordinate of the i-th node of the reference element More...
 
Real zeta (UInt i) const
 return the third local coordinate of the i-th node of the reference element More...
 
Real refCoor (UInt i, UInt icoor) const
 return the icoor-th local coordinate of the i-th node of the reference element More...
 
std::vector< GeoVectorrefCoor () const
 return the coordinates of the reference element More...
 
Real phi (UInt i, const GeoVector &v) const
 Return the value of the i-th basis function in the point v. More...
 
Real phi (UInt i, UInt icoor, const GeoVector &v) const
 return the value of the component icoor-th of the i-th basis function on point v. More...
 
Real dPhi (UInt i, UInt icoor, const GeoVector &v) const
 return the value of the icoor-th derivative of the i-th basis function on point v More...
 
Real d2Phi (UInt i, UInt icoor, UInt jcoor, const GeoVector &v) const
 return the value of the (icoor,jcoor)-th second derivative of the i-th basis function on point v More...
 
Real divPhi (UInt i, const GeoVector &v) const
 return the value of the divergence of the i-th basis function on point v. More...
 
bool hasPhi () const
 Check if the refEle has phi functions. More...
 
bool hasDPhi () const
 Check if the refEle has dPhi functions. More...
 
bool hasD2Phi () const
 Check if the refEle has d2Phi functions. More...
 
bool hasDivPhi () const
 Check if the refEle has divPhi functions. More...
 
virtual std::vector< RealnodalToFEValues (const std::vector< Real > &) const
 Method for transforming nodal values into FE values. More...
 

Get Methods

const std::string & name () const
 Return the name of the reference element. More...
 
const UIntnbDof () const
 Return the number of degrees of freedom for this reference element. More...
 
const LIFEV_DEPRECATED (UInt &) nbCoor() const
 OLD: Return the number of local coordinates. More...
 
const UIntnbLocalCoor () const
 Return the number of local coordinates. More...
 
const UIntfeDim () const
 Return the dimension of the FE (scalar vs vectorial FE) More...
 
const ReferenceShapesshape () const
 Return the shape of the element. More...
 

Old Methods - Avoid using them!

Real phi (UInt i, const Real &x, const Real &y, const Real &z) const
 return the value of the i-th basis function on point (x,y,z) More...
 
Real phi (UInt i, UInt icoor, const Real &x, const Real &y, const Real &z) const
 return the value of the component icoor-th of the i-th basis function on point (x,y,z). More...
 
Real dPhi (UInt i, UInt icoor, const Real &x, const Real &y, const Real &z) const
 return the value of the icoor-th derivative of the i-th basis function on point (x,y,z) More...
 
Real d2Phi (UInt i, UInt icoor, UInt jcoor, const Real &x, const Real &y, const Real &z) const
 return the value of the (icoor,jcoor)-th second derivative of the i-th basis function on point (x,y,z) More...
 
Real divPhi (UInt i, const Real &x, const Real &y, const Real &z) const
 return the value of the divergence of the i-th basis function on point (x,y,z). More...
 

Private Methods

 ReferenceElement ()
 No way to use the empty constructor. More...
 
 ReferenceElement (const ReferenceElement &)
 No way to use the copy constuctor. More...
 

Detailed Description

ReferenceElement - The basis class for the geometric mapping and the reference finite elements.

Author
J.-F. Gerbeau
Date
04/2002

Implemented orginially by J.-F. Gerbeau (04/2002) but totally modified by S.Quinodoz (samue.nosp@m.l.qu.nosp@m.inodo.nosp@m.z@ep.nosp@m.fl.ch , 04/2010)

This class contains all the basis functions, their derivatives and the reference coordinates. It is the basis class for the geometric map (LifeV::GeometricMap) and the reference finite element (LifeV::ReferenceFE).

Todo:

Add Volume

Add the minimal dimension and checks

Incorporate vectorial FEs

Think dimensionless

change M_refCoor

Definition at line 66 of file ReferenceElement.hpp.

Member Typedef Documentation

◆ function_Type

typedef Real( * function_Type) (const GeoVector &)

Definition at line 75 of file ReferenceElement.hpp.

Constructor & Destructor Documentation

◆ ReferenceElement() [1/3]

ReferenceElement ( std::string  name,
ReferenceShapes  shape,
UInt  nbDof,
UInt  nbLocalCoor,
UInt  feDim,
const function_Type phi,
const function_Type dPhi,
const function_Type d2Phi,
const function_Type divPhi,
const Real refCoor 
)

Full constructor.

Parameters
nameName of the reference element
shapeShape related to this reference element
nbDofNumber of degrees of freedom
nbLocalCoorNumber of local coordinates
phiArray of the basis functions
dPhiArray of the derivatives of the basis functions
d2PhiArray of the second derivatives of the basis functions
refCoorArray of the reference coordinates for this reference element

Definition at line 47 of file ReferenceElement.cpp.

+ Here is the caller graph for this function:

◆ ~ReferenceElement()

~ReferenceElement ( )
virtual

Destructor.

Definition at line 64 of file ReferenceElement.cpp.

◆ ReferenceElement() [2/3]

ReferenceElement ( )
private

No way to use the empty constructor.

◆ ReferenceElement() [3/3]

ReferenceElement ( const ReferenceElement )
private

No way to use the copy constuctor.

Member Function Documentation

◆ xi()

Real xi ( UInt  i) const
inline

return the first local coordinate of the i-th node of the reference element

Definition at line 108 of file ReferenceElement.hpp.

◆ eta()

Real eta ( UInt  i) const
inline

return the second local coordinate of the i-th node of the reference element

Definition at line 114 of file ReferenceElement.hpp.

◆ zeta()

Real zeta ( UInt  i) const
inline

return the third local coordinate of the i-th node of the reference element

Definition at line 120 of file ReferenceElement.hpp.

◆ refCoor() [1/2]

Real refCoor ( UInt  i,
UInt  icoor 
) const
inline

return the icoor-th local coordinate of the i-th node of the reference element

Definition at line 126 of file ReferenceElement.hpp.

◆ refCoor() [2/2]

std::vector< GeoVector > refCoor ( ) const

return the coordinates of the reference element

Definition at line 73 of file ReferenceElement.cpp.

◆ phi() [1/4]

Real phi ( UInt  i,
const GeoVector v 
) const
inline

Return the value of the i-th basis function in the point v.

Definition at line 135 of file ReferenceElement.hpp.

+ Here is the caller graph for this function:

◆ phi() [2/4]

Real phi ( UInt  i,
UInt  icoor,
const GeoVector v 
) const
inline

return the value of the component icoor-th of the i-th basis function on point v.

Definition at line 142 of file ReferenceElement.hpp.

◆ dPhi() [1/2]

Real dPhi ( UInt  i,
UInt  icoor,
const GeoVector v 
) const
inline

return the value of the icoor-th derivative of the i-th basis function on point v

Definition at line 149 of file ReferenceElement.hpp.

+ Here is the caller graph for this function:

◆ d2Phi() [1/2]

Real d2Phi ( UInt  i,
UInt  icoor,
UInt  jcoor,
const GeoVector v 
) const
inline

return the value of the (icoor,jcoor)-th second derivative of the i-th basis function on point v

Definition at line 156 of file ReferenceElement.hpp.

◆ divPhi() [1/2]

Real divPhi ( UInt  i,
const GeoVector v 
) const
inline

return the value of the divergence of the i-th basis function on point v.

Definition at line 162 of file ReferenceElement.hpp.

◆ hasPhi()

bool hasPhi ( ) const
inline

Check if the refEle has phi functions.

Definition at line 170 of file ReferenceElement.hpp.

◆ hasDPhi()

bool hasDPhi ( ) const
inline

Check if the refEle has dPhi functions.

Definition at line 175 of file ReferenceElement.hpp.

◆ hasD2Phi()

bool hasD2Phi ( ) const
inline

Check if the refEle has d2Phi functions.

Definition at line 180 of file ReferenceElement.hpp.

◆ hasDivPhi()

bool hasDivPhi ( ) const
inline

Check if the refEle has divPhi functions.

Definition at line 185 of file ReferenceElement.hpp.

◆ nodalToFEValues()

virtual std::vector<Real> nodalToFEValues ( const std::vector< Real > &  ) const
inlinevirtual

Method for transforming nodal values into FE values.

This method can be used to retrieve the FE coefficients corresponding to the values given in the nodes (important for the interpolation procedures). For lagrangian elements (like P1 or P2), this method is just giving back the same values. However, for nodal but non-lagrangian finite elements (like P1Bubble), the values returned are different from the output.

For example, using P1Bubble finite element, if one gives as input values that are all 1 (the finite element function is constant), this function will return 1 for the P1 nodes but 0 for the bubble. Indeed, by suming the P1 function, we already get the constant function over the whole element and there is no need for the bubble.

Of course, this method is accessible only for nodal finite elements. If one tries to use this method with a non nodal finite element, an error will be displayed and the program will stop running.

Reimplemented in ReferenceFEScalar.

Definition at line 209 of file ReferenceElement.hpp.

◆ name()

const std::string& name ( ) const
inline

Return the name of the reference element.

Definition at line 227 of file ReferenceElement.hpp.

◆ nbDof()

const UInt& nbDof ( ) const
inline

Return the number of degrees of freedom for this reference element.

Definition at line 233 of file ReferenceElement.hpp.

+ Here is the caller graph for this function:

◆ LIFEV_DEPRECATED()

const LIFEV_DEPRECATED ( UInt ) const
inline

OLD: Return the number of local coordinates.

Definition at line 239 of file ReferenceElement.hpp.

◆ nbLocalCoor()

const UInt& nbLocalCoor ( ) const
inline

Return the number of local coordinates.

Definition at line 245 of file ReferenceElement.hpp.

◆ feDim()

const UInt& feDim ( ) const
inline

Return the dimension of the FE (scalar vs vectorial FE)

Definition at line 251 of file ReferenceElement.hpp.

◆ shape()

const ReferenceShapes& shape ( ) const
inline

Return the shape of the element.

Definition at line 257 of file ReferenceElement.hpp.

◆ phi() [3/4]

Real phi ( UInt  i,
const Real x,
const Real y,
const Real z 
) const
inline

return the value of the i-th basis function on point (x,y,z)

Definition at line 268 of file ReferenceElement.hpp.

+ Here is the caller graph for this function:

◆ phi() [4/4]

Real phi ( UInt  i,
UInt  icoor,
const Real x,
const Real y,
const Real z 
) const
inline

return the value of the component icoor-th of the i-th basis function on point (x,y,z).

Definition at line 279 of file ReferenceElement.hpp.

◆ dPhi() [2/2]

Real dPhi ( UInt  i,
UInt  icoor,
const Real x,
const Real y,
const Real z 
) const
inline

return the value of the icoor-th derivative of the i-th basis function on point (x,y,z)

Definition at line 290 of file ReferenceElement.hpp.

◆ d2Phi() [2/2]

Real d2Phi ( UInt  i,
UInt  icoor,
UInt  jcoor,
const Real x,
const Real y,
const Real z 
) const
inline

return the value of the (icoor,jcoor)-th second derivative of the i-th basis function on point (x,y,z)

Definition at line 300 of file ReferenceElement.hpp.

◆ divPhi() [2/2]

Real divPhi ( UInt  i,
const Real x,
const Real y,
const Real z 
) const
inline

return the value of the divergence of the i-th basis function on point (x,y,z).

Definition at line 310 of file ReferenceElement.hpp.

Field Documentation

◆ M_phi

const function_Type* M_phi
private

pointer on the basis functions

Definition at line 337 of file ReferenceElement.hpp.

◆ M_dPhi

const function_Type* M_dPhi
private

pointer on the derivatives of the basis functions

Definition at line 340 of file ReferenceElement.hpp.

◆ M_d2Phi

const function_Type* M_d2Phi
private

pointer on the second derivatives of the basis functions

Definition at line 343 of file ReferenceElement.hpp.

◆ M_divPhi

const function_Type* M_divPhi
private

pointer on the divergence of the basis functions

Definition at line 346 of file ReferenceElement.hpp.

◆ M_refCoor

const Real* M_refCoor
private

reference coordinates. Order: xistd::placeholders::_1,etA_1,zetA_1,xistd::placeholders::_2,etA_2,zetA_2,...

Definition at line 349 of file ReferenceElement.hpp.

◆ M_name

const std::string M_name
private

name of the reference element

Definition at line 354 of file ReferenceElement.hpp.

◆ M_shape

const ReferenceShapes M_shape
private

geometrical shape of the element

Definition at line 357 of file ReferenceElement.hpp.

◆ M_nbDof

const UInt M_nbDof
private

Total number of degrees of freedom.

Definition at line 360 of file ReferenceElement.hpp.

◆ M_nbLocalCoor

const UInt M_nbLocalCoor
private

Number of local coordinates.

Definition at line 363 of file ReferenceElement.hpp.

◆ M_feDim

const UInt M_feDim
private

Number of dimension of the FE (1 for scalar FE, more for vectorial FE)

Definition at line 366 of file ReferenceElement.hpp.


The documentation for this class was generated from the following files: