LifeV
FEFunction< MeshType, MapType, ReturnType > Class Template Referenceabstract

FEFunction - This class gives an abstract implementation of a finite element function on finite elements fields. More...

#include <FESpace.hpp>

+ Inheritance diagram for FEFunction< MeshType, MapType, ReturnType >:
+ Collaboration diagram for FEFunction< MeshType, MapType, ReturnType >:

Private Attributes

FEScalarFieldPtrContainer_Type M_scalarFields
 Vector of pointers of scalar fields. More...
 
FEVectorFieldPtrContainer_Type M_vectorFields
 Vector of pointers of vector fields. More...
 

Public Types

typedef MeshType mesh_Type
 
typedef MapType map_Type
 
typedef ReturnType return_Type
 
typedef FEField< mesh_Type, map_Type, return_TypeFEField_Type
 
typedef FEScalarField< mesh_Type, map_TypeFEScalarField_Type
 
typedef FEVectorField< mesh_Type, map_TypeFEVectorField_Type
 
typedef std::shared_ptr< FEField_TypeFEFieldPtr_Type
 
typedef std::shared_ptr< FEScalarField_TypeFEScalarFieldPtr_Type
 
typedef std::shared_ptr< FEVectorField_TypeFEVectorFieldPtr_Type
 
typedef std::vector< FEScalarFieldPtr_TypeFEScalarFieldPtrContainer_Type
 
typedef std::vector< FEVectorFieldPtr_TypeFEVectorFieldPtrContainer_Type
 
typedef FEField_Type::point_Type point_Type
 

Constructors and destructor

 FEFunction ()
 Empty constructor for the class. More...
 
virtual ~FEFunction ()
 Virtual destructor. More...
 

Methods

virtual return_Type eval (const UInt &iElem, const point_Type &P, const Real &time=0.) const =0
 Abstract virtual eval function. More...
 
void interpolate (FEField_Type &interpolatedFct, const Real &time=0.) const
 Interpolate to a field. More...
 
void addScalarField (const FEScalarFieldPtr_Type &fieldPtr)
 Add an external scalar field to the function. More...
 
void addVectorField (const FEVectorFieldPtr_Type &fieldPtr)
 Add an external vector field to the function. More...
 

Get Methods

const FEScalarFieldPtr_TypescalarFieldPtr (const UInt &i) const
 Return the i-th scalar field. More...
 
const FEScalarField_TypescalarField (const UInt &i) const
 Return the i-th scalar field. More...
 
const FEVectorFieldPtr_TypevectorFieldPtr (const UInt &i) const
 Return the i-th vector field. More...
 
const FEVectorField_TypevectorField (const UInt &i) const
 Return the i-th vector field. More...
 

Detailed Description

template<typename MeshType, typename MapType, typename ReturnType>
class LifeV::FEFunction< MeshType, MapType, ReturnType >

FEFunction - This class gives an abstract implementation of a finite element function on finite elements fields.

Author
A. Fumagalli aless.nosp@m.io.f.nosp@m.umaga.nosp@m.lli@.nosp@m.mail..nosp@m.poli.nosp@m.mi.it
M. Kern miche.nosp@m.l.ke.nosp@m.rn@in.nosp@m.ria..nosp@m.fr

This class represents the concept of a function associated to a set of finite element fields.
This class is implemented as a simple container which stores pointers to finite element fields, both scalar and vector.

The method eval, which is abstract and virtual, is the manipulator of the fields.
For example the scalar function $ f $ is a function of the scalar field $ S $ and the vector field $ u $, that is $ f = f(S, u)$. And, for example, the function $ f $ is

\[ f(S, u) = S^2 + \sin( u_0 ) \]

then create a new class MyFun which inherit from FEFunction<MeshType, MapType, Real> where the eval method, using the methods scalarField and vectorField, can be written as

const Real S = scalarField(0).eval( iElem, point, time );
const Vector u = vectorField(0).eval( iElem, point, time );
return std::pow(S, 2) + std::sin( u[0] );

Partial specialization of the type returned by the access operator is scalar, vector and matrix, implemented in the derived classes. The implementation of user defined classes can be derived from one of the specialized classes.
The evaluation of the field in a given point is given in the access operator (). The implementation of this method requires also the id of the geometrical element in the mesh, which is less general but more efficient compared to the case where the id of the geometrical element is not given.

Todo:
Add a method without the element id, less efficient but more flexible.

Definition at line 65 of file FESpace.hpp.

Member Typedef Documentation

◆ mesh_Type

Definition at line 87 of file FEFunction.hpp.

◆ map_Type

typedef MapType map_Type

Definition at line 88 of file FEFunction.hpp.

◆ return_Type

typedef ReturnType return_Type

Definition at line 89 of file FEFunction.hpp.

◆ FEField_Type

Definition at line 91 of file FEFunction.hpp.

◆ FEScalarField_Type

Definition at line 92 of file FEFunction.hpp.

◆ FEVectorField_Type

Definition at line 93 of file FEFunction.hpp.

◆ FEFieldPtr_Type

typedef std::shared_ptr< FEField_Type > FEFieldPtr_Type

Definition at line 95 of file FEFunction.hpp.

◆ FEScalarFieldPtr_Type

typedef std::shared_ptr< FEScalarField_Type > FEScalarFieldPtr_Type

Definition at line 96 of file FEFunction.hpp.

◆ FEVectorFieldPtr_Type

typedef std::shared_ptr< FEVectorField_Type > FEVectorFieldPtr_Type

Definition at line 97 of file FEFunction.hpp.

◆ FEScalarFieldPtrContainer_Type

Definition at line 99 of file FEFunction.hpp.

◆ FEVectorFieldPtrContainer_Type

Definition at line 100 of file FEFunction.hpp.

◆ point_Type

Definition at line 102 of file FEFunction.hpp.

Constructor & Destructor Documentation

◆ FEFunction()

FEFunction ( )
inline

Empty constructor for the class.

Definition at line 110 of file FEFunction.hpp.

◆ ~FEFunction()

virtual ~FEFunction ( )
inlinevirtual

Virtual destructor.

Definition at line 114 of file FEFunction.hpp.

Member Function Documentation

◆ eval()

virtual return_Type eval ( const UInt iElem,
const point_Type P,
const Real time = 0. 
) const
pure virtual

Abstract virtual eval function.

In the case of derived and specialized classes it evaluates the function on a given point in a given element

Parameters
iElemElement id in the mesh.
pointPoint where the field is evaluated, vector format.
timeTime in the evaluation.
Returns
The type template of value of the function.

Implemented in massFunction, initialCondition, vectorSource, vectorSource, scalarSource, scalarSource, reactionTerm, reactionTerm, inversePermeability, inversePermeability, and MyFun.

◆ interpolate()

void interpolate ( FEField_Type interpolatedFct,
const Real time = 0. 
) const
inline

Interpolate to a field.

Fill the input field with the value of the function. Useful for exporting pourpose.

Parameters
interpolatedFctField where the function is interpolated.
timeTime in the evaluation.
Note
The method does not work for matrix value functions.

Definition at line 140 of file FEFunction.hpp.

◆ addScalarField()

void addScalarField ( const FEScalarFieldPtr_Type fieldPtr)
inline

Add an external scalar field to the function.

Parameters
fieldPtrPointer of a scalar field which as to be added.

Definition at line 150 of file FEFunction.hpp.

◆ addVectorField()

void addVectorField ( const FEVectorFieldPtr_Type fieldPtr)
inline

Add an external vector field to the function.

Parameters
fieldPtrPointer of a vector field which as to be added.

Definition at line 159 of file FEFunction.hpp.

◆ scalarFieldPtr()

const FEScalarFieldPtr_Type& scalarFieldPtr ( const UInt i) const
inline

Return the i-th scalar field.

Parameters
iIndex of the scalar field.
Returns
Constant FEScalarFieldPtr_Type reference stored of index i.

Definition at line 174 of file FEFunction.hpp.

◆ scalarField()

const FEScalarField_Type& scalarField ( const UInt i) const
inline

Return the i-th scalar field.

Parameters
iIndex of the scalar field.
Returns
Constant FEScalarField_Type reference stored of index i.

Definition at line 185 of file FEFunction.hpp.

◆ vectorFieldPtr()

const FEVectorFieldPtr_Type& vectorFieldPtr ( const UInt i) const
inline

Return the i-th vector field.

Parameters
iIndex of the vector field.
Returns
Constant FEVectorFieldPtr_Type reference stored of index i.

Definition at line 196 of file FEFunction.hpp.

◆ vectorField()

const FEVectorField_Type& vectorField ( const UInt i) const
inline

Return the i-th vector field.

Parameters
iIndex of the vector field.
Returns
Constant FEVectorField_Type reference stored of index i.

Definition at line 207 of file FEFunction.hpp.

Field Documentation

◆ M_scalarFields

FEScalarFieldPtrContainer_Type M_scalarFields
private

Vector of pointers of scalar fields.

Definition at line 218 of file FEFunction.hpp.

◆ M_vectorFields

FEVectorFieldPtrContainer_Type M_vectorFields
private

Vector of pointers of vector fields.

Definition at line 221 of file FEFunction.hpp.


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