Flow123d  master-9c1c1b8e5
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
FEValues< spacedim > Class Template Reference

Calculates finite element data on the actual cell. More...

#include <fe_values.hh>

Collaboration diagram for FEValues< spacedim >:
Collaboration graph
[legend]

Classes

class  FEInternalData
 Structure for storing the precomputed finite element data. More...
 
struct  ViewsCache
 

Public Member Functions

 FEValues ()
 Default constructor with postponed initialization. More...
 
template<unsigned int DIM>
 FEValues (Quadrature &_quadrature, FiniteElement< DIM > &_fe, UpdateFlags _flags)
 
 ~FEValues ()
 Correct deallocation of objects created by 'initialize' methods. More...
 
template<unsigned int DIM>
void allocate (unsigned int n_points, FiniteElement< DIM > &_fe, UpdateFlags flags)
 Allocates space for computed data. More...
 
template<unsigned int DIM>
void initialize (Quadrature &_quadrature, FiniteElement< DIM > &_fe, UpdateFlags _flags)
 Initialize structures and calculates cell-independent data. More...
 
void reinit (const ElementAccessor< spacedim > &cell)
 Update cell-dependent data (gradients, Jacobians etc.) More...
 
void reinit (const Side &cell_side)
 Update cell side-dependent FE data (values, gradients). More...
 
double shape_value (const unsigned int function_no, const unsigned int point_no) const
 Return the value of the function_no-th shape function at the point_no-th quadrature point. More...
 
arma::vec::fixed< spacedim > shape_grad (const unsigned int function_no, const unsigned int point_no) const
 Return the gradient of the function_no-th shape function at the point_no-th quadrature point. More...
 
double shape_value_component (const unsigned int function_no, const unsigned int point_no, const unsigned int comp) const
 Return the value of the function_no-th shape function at the point_no-th quadrature point. More...
 
arma::vec::fixed< spacedim > shape_grad_component (const unsigned int function_no, const unsigned int point_no, const unsigned int comp) const
 Return the gradient of the function_no-th shape function at the point_no-th quadrature point. More...
 
double determinant (const unsigned int point_no)
 Return the relative volume change of the cell (Jacobian determinant). More...
 
double JxW (const unsigned int point_no)
 Return the product of Jacobian determinant and the quadrature weight at given quadrature point. More...
 
arma::vec::fixed< spacedim > point (const unsigned int point_no)
 Return coordinates of the quadrature point in the actual cell system. More...
 
const Armor::arraypoint_list () const
 Return coordinates of all quadrature points in the actual cell system. More...
 
arma::vec::fixed< spacedim > normal_vector (unsigned int point_no)
 Returns the normal vector to a side at given quadrature point. More...
 
const FEValuesViews::Scalar< spacedim > & scalar_view (unsigned int i) const
 Accessor to scalar values of multicomponent FE. More...
 
const FEValuesViews::Vector< spacedim > & vector_view (unsigned int i) const
 Accessor to vector values of multicomponent FE. More...
 
const FEValuesViews::Tensor< spacedim > & tensor_view (unsigned int i) const
 Accessor to tensor values of multicomponent FE. More...
 
unsigned int n_points () const
 Returns the number of quadrature points. More...
 
unsigned int n_dofs () const
 Returns the number of shape functions. More...
 
unsigned int dim () const
 Return dimension of reference space. More...
 
template<unsigned int DIM>
std::shared_ptr< typename FEValues< spacedim >::FEInternalDatainit_fe_data (const FiniteElement< DIM > &fe, const Quadrature &q)
 
template<class MapType >
void fill_data_specialized (const ElementValues< spacedim > &elm_values, const typename FEValues< spacedim >::FEInternalData &fe_data)
 

Protected Member Functions

template<unsigned int DIM>
std::shared_ptr< FEInternalDatainit_fe_data (const FiniteElement< DIM > &fe, const Quadrature &q)
 Precompute finite element data on reference element. More...
 
void fill_data (const ElementValues< spacedim > &elm_values, const FEInternalData &fe_data)
 Computes the shape function values and gradients on the actual cell and fills the FEValues structure. More...
 
template<class MapType >
void fill_data_specialized (const ElementValues< spacedim > &elm_values, const FEInternalData &fe_data)
 Computes the shape function values and gradients on the actual cell and fills the FEValues structure. Specialized variant of previous method for different FETypes given by template parameter. More...
 

Protected Attributes

unsigned int dim_
 Dimension of reference space. More...
 
unsigned int n_points_
 Number of integration points. More...
 
unsigned int n_dofs_
 Number of finite element dofs. More...
 
FEType fe_type_
 Type of finite element (scalar, vector, tensor). More...
 
std::vector< std::vector< unsigned int > > fe_sys_dofs_
 Dof indices of FESystem sub-elements. More...
 
std::vector< unsigned int > fe_sys_n_components_
 Numbers of components of FESystem sub-elements in reference space. More...
 
std::vector< unsigned int > fe_sys_n_space_components_
 Numbers of components of FESystem sub-elements in real space. More...
 
std::vector< std::vector< double > > shape_values
 Shape functions evaluated at the quadrature points. More...
 
std::vector< std::vector< arma::vec::fixed< spacedim > > > shape_gradients
 
UpdateFlags update_flags
 Flags that indicate which finite element quantities are to be computed. More...
 
std::shared_ptr< ElementValues< spacedim > > elm_values
 Auxiliary object for calculation of element-dependent data. More...
 
std::vector< FEValues< spacedim > > fe_values_vec
 Vector of FEValues for sub-elements of FESystem. More...
 
unsigned int n_components_
 Number of components of the FE. More...
 
ViewsCache views_cache_
 Auxiliary storage of FEValuesViews accessors. More...
 
std::shared_ptr< FEInternalDatafe_data
 Precomputed finite element data. More...
 
std::vector< shared_ptr< FEInternalData > > side_fe_data
 Precomputed FE data (shape functions on reference element) for all side quadrature points. More...
 

Friends

class MapScalar< spacedim >
 
class MapPiola< spacedim >
 
class MapContravariant< spacedim >
 
class MapVector< spacedim >
 
class MapTensor< spacedim >
 
class MapSystem< spacedim >
 

Detailed Description

template<unsigned int spacedim = 3>
class FEValues< spacedim >

Calculates finite element data on the actual cell.

FEValues takes care of the calculation of finite element data on the actual cell or on its side, (values of shape functions at quadrature points, gradients of shape functions, Jacobians of the mapping from the reference cell etc.).

Parameters
spacedimDimension of the Euclidean space where the actual cell lives.

Definition at line 66 of file fe_values.hh.

Constructor & Destructor Documentation

◆ FEValues() [1/2]

template<unsigned int spacedim>
FEValues< spacedim >::FEValues

Default constructor with postponed initialization.

Definition at line 123 of file fe_values.cc.

◆ FEValues() [2/2]

template<unsigned int spacedim = 3>
template<unsigned int DIM>
FEValues< spacedim >::FEValues ( Quadrature _quadrature,
FiniteElement< DIM > &  _fe,
UpdateFlags  _flags 
)
inline

Constructor with initialization of data structures (see initialize() for description of parameters).

Definition at line 90 of file fe_values.hh.

◆ ~FEValues()

template<unsigned int spacedim>
FEValues< spacedim >::~FEValues

Correct deallocation of objects created by 'initialize' methods.

Definition at line 131 of file fe_values.cc.

Member Function Documentation

◆ allocate()

template<unsigned int spacedim>
template<unsigned int DIM>
void FEValues< spacedim >::allocate ( unsigned int  n_points,
FiniteElement< DIM > &  _fe,
UpdateFlags  flags 
)

Allocates space for computed data.

Parameters
n_pointsNumber of quadrature points.
_feThe finite element.
flagsThe update flags.

Definition at line 179 of file fe_values.cc.

◆ determinant()

template<unsigned int spacedim = 3>
double FEValues< spacedim >::determinant ( const unsigned int  point_no)
inline

Return the relative volume change of the cell (Jacobian determinant).

If dim_==spacedim then the sign may be negative, otherwise the result is a positive number.

Parameters
point_noNumber of the quadrature point.

Definition at line 211 of file fe_values.hh.

◆ dim()

template<unsigned int spacedim = 3>
unsigned int FEValues< spacedim >::dim ( ) const
inline

Return dimension of reference space.

Definition at line 308 of file fe_values.hh.

Here is the caller graph for this function:

◆ fill_data()

template<unsigned int spacedim>
void FEValues< spacedim >::fill_data ( const ElementValues< spacedim > &  elm_values,
const FEInternalData fe_data 
)
protected

Computes the shape function values and gradients on the actual cell and fills the FEValues structure.

Parameters
fe_dataPrecomputed finite element data.

Definition at line 493 of file fe_values.cc.

◆ fill_data_specialized() [1/2]

template<unsigned int spacedim = 3>
template<class MapType >
void FEValues< spacedim >::fill_data_specialized ( const ElementValues< spacedim > &  elm_values,
const FEInternalData fe_data 
)
protected

Computes the shape function values and gradients on the actual cell and fills the FEValues structure. Specialized variant of previous method for different FETypes given by template parameter.

◆ fill_data_specialized() [2/2]

template<unsigned int spacedim = 3>
template<class MapType >
void FEValues< spacedim >::fill_data_specialized ( const ElementValues< spacedim > &  elm_values,
const typename FEValues< spacedim >::FEInternalData fe_data 
)
inline

Definition at line 523 of file fe_values.cc.

◆ init_fe_data() [1/2]

template<unsigned int spacedim = 3>
template<unsigned int DIM>
std::shared_ptr<typename FEValues<spacedim>::FEInternalData> FEValues< spacedim >::init_fe_data ( const FiniteElement< DIM > &  fe,
const Quadrature q 
)

Definition at line 228 of file fe_values.cc.

◆ init_fe_data() [2/2]

template<unsigned int spacedim = 3>
template<unsigned int DIM>
std::shared_ptr<FEInternalData> FEValues< spacedim >::init_fe_data ( const FiniteElement< DIM > &  fe,
const Quadrature q 
)
protected

Precompute finite element data on reference element.

◆ initialize()

template<unsigned int spacedim>
template<unsigned int DIM>
void FEValues< spacedim >::initialize ( Quadrature _quadrature,
FiniteElement< DIM > &  _fe,
UpdateFlags  _flags 
)

Initialize structures and calculates cell-independent data.

Parameters
_quadratureThe quadrature rule for the cell associated to given finite element or for the cell side.
_feThe finite element.
_flagsThe update flags.

Definition at line 137 of file fe_values.cc.

Here is the caller graph for this function:

◆ JxW()

template<unsigned int spacedim = 3>
double FEValues< spacedim >::JxW ( const unsigned int  point_no)
inline

Return the product of Jacobian determinant and the quadrature weight at given quadrature point.

Parameters
point_noNumber of the quadrature point.

Definition at line 223 of file fe_values.hh.

Here is the caller graph for this function:

◆ n_dofs()

template<unsigned int spacedim = 3>
unsigned int FEValues< spacedim >::n_dofs ( ) const
inline

Returns the number of shape functions.

Definition at line 302 of file fe_values.hh.

Here is the caller graph for this function:

◆ n_points()

template<unsigned int spacedim = 3>
unsigned int FEValues< spacedim >::n_points ( ) const
inline

Returns the number of quadrature points.

Definition at line 296 of file fe_values.hh.

Here is the caller graph for this function:

◆ normal_vector()

template<unsigned int spacedim = 3>
arma::vec::fixed<spacedim> FEValues< spacedim >::normal_vector ( unsigned int  point_no)
inline

Returns the normal vector to a side at given quadrature point.

Parameters
point_noNumber of the quadrature point.

Definition at line 257 of file fe_values.hh.

Here is the caller graph for this function:

◆ point()

template<unsigned int spacedim = 3>
arma::vec::fixed<spacedim> FEValues< spacedim >::point ( const unsigned int  point_no)
inline

Return coordinates of the quadrature point in the actual cell system.

Parameters
point_noNumber of the quadrature point.

Definition at line 236 of file fe_values.hh.

Here is the caller graph for this function:

◆ point_list()

template<unsigned int spacedim = 3>
const Armor::array& FEValues< spacedim >::point_list ( ) const
inline

Return coordinates of all quadrature points in the actual cell system.

Definition at line 246 of file fe_values.hh.

◆ reinit() [1/2]

template<unsigned int spacedim>
void FEValues< spacedim >::reinit ( const ElementAccessor< spacedim > &  cell)

Update cell-dependent data (gradients, Jacobians etc.)

Parameters
cellThe actual cell.

Definition at line 536 of file fe_values.cc.

◆ reinit() [2/2]

template<unsigned int spacedim>
void FEValues< spacedim >::reinit ( const Side cell_side)

Update cell side-dependent FE data (values, gradients).

Parameters
cell_sideAccessor to cell side.

Definition at line 551 of file fe_values.cc.

◆ scalar_view()

template<unsigned int spacedim = 3>
const FEValuesViews::Scalar<spacedim>& FEValues< spacedim >::scalar_view ( unsigned int  i) const
inline

Accessor to scalar values of multicomponent FE.

Parameters
iIndex of scalar component.

Definition at line 267 of file fe_values.hh.

Here is the caller graph for this function:

◆ shape_grad()

template<unsigned int spacedim = 3>
arma::vec::fixed<spacedim> FEValues< spacedim >::shape_grad ( const unsigned int  function_no,
const unsigned int  point_no 
) const
inline

Return the gradient of the function_no-th shape function at the point_no-th quadrature point.

Parameters
function_noNumber of the shape function.
point_noNumber of the quadrature point.

Definition at line 164 of file fe_values.hh.

Here is the caller graph for this function:

◆ shape_grad_component()

template<unsigned int spacedim>
arma::vec::fixed< spacedim > FEValues< spacedim >::shape_grad_component ( const unsigned int  function_no,
const unsigned int  point_no,
const unsigned int  comp 
) const

Return the gradient of the function_no-th shape function at the point_no-th quadrature point.

For vectorial finite elements.

Parameters
function_noNumber of the shape function.
point_noNumber of the quadrature point.

Definition at line 276 of file fe_values.cc.

◆ shape_value()

template<unsigned int spacedim = 3>
double FEValues< spacedim >::shape_value ( const unsigned int  function_no,
const unsigned int  point_no 
) const
inline

Return the value of the function_no-th shape function at the point_no-th quadrature point.

Parameters
function_noNumber of the shape function.
point_noNumber of the quadrature point.

Definition at line 149 of file fe_values.hh.

Here is the caller graph for this function:

◆ shape_value_component()

template<unsigned int spacedim = 3>
double FEValues< spacedim >::shape_value_component ( const unsigned int  function_no,
const unsigned int  point_no,
const unsigned int  comp 
) const
inline

Return the value of the function_no-th shape function at the point_no-th quadrature point.

For vectorial finite elements.

Parameters
function_noNumber of the shape function.
point_noNumber of the quadrature point.

Definition at line 180 of file fe_values.hh.

◆ tensor_view()

template<unsigned int spacedim = 3>
const FEValuesViews::Tensor<spacedim>& FEValues< spacedim >::tensor_view ( unsigned int  i) const
inline

Accessor to tensor values of multicomponent FE.

Parameters
iIndex of first tensor component.

Definition at line 287 of file fe_values.hh.

Here is the caller graph for this function:

◆ vector_view()

template<unsigned int spacedim = 3>
const FEValuesViews::Vector<spacedim>& FEValues< spacedim >::vector_view ( unsigned int  i) const
inline

Accessor to vector values of multicomponent FE.

Parameters
iIndex of first vector component.

Definition at line 277 of file fe_values.hh.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ MapContravariant< spacedim >

template<unsigned int spacedim = 3>
friend class MapContravariant< spacedim >
friend

Definition at line 428 of file fe_values.hh.

◆ MapPiola< spacedim >

template<unsigned int spacedim = 3>
friend class MapPiola< spacedim >
friend

Definition at line 427 of file fe_values.hh.

◆ MapScalar< spacedim >

template<unsigned int spacedim = 3>
friend class MapScalar< spacedim >
friend

Definition at line 426 of file fe_values.hh.

◆ MapSystem< spacedim >

template<unsigned int spacedim = 3>
friend class MapSystem< spacedim >
friend

Definition at line 431 of file fe_values.hh.

◆ MapTensor< spacedim >

template<unsigned int spacedim = 3>
friend class MapTensor< spacedim >
friend

Definition at line 430 of file fe_values.hh.

◆ MapVector< spacedim >

template<unsigned int spacedim = 3>
friend class MapVector< spacedim >
friend

Definition at line 429 of file fe_values.hh.

Member Data Documentation

◆ dim_

template<unsigned int spacedim = 3>
unsigned int FEValues< spacedim >::dim_
protected

Dimension of reference space.

Definition at line 378 of file fe_values.hh.

◆ elm_values

template<unsigned int spacedim = 3>
std::shared_ptr<ElementValues<spacedim> > FEValues< spacedim >::elm_values
protected

Auxiliary object for calculation of element-dependent data.

Definition at line 409 of file fe_values.hh.

◆ fe_data

template<unsigned int spacedim = 3>
std::shared_ptr<FEInternalData> FEValues< spacedim >::fe_data
protected

Precomputed finite element data.

Definition at line 421 of file fe_values.hh.

◆ fe_sys_dofs_

template<unsigned int spacedim = 3>
std::vector<std::vector<unsigned int> > FEValues< spacedim >::fe_sys_dofs_
protected

Dof indices of FESystem sub-elements.

Definition at line 390 of file fe_values.hh.

◆ fe_sys_n_components_

template<unsigned int spacedim = 3>
std::vector<unsigned int> FEValues< spacedim >::fe_sys_n_components_
protected

Numbers of components of FESystem sub-elements in reference space.

Definition at line 393 of file fe_values.hh.

◆ fe_sys_n_space_components_

template<unsigned int spacedim = 3>
std::vector<unsigned int> FEValues< spacedim >::fe_sys_n_space_components_
protected

Numbers of components of FESystem sub-elements in real space.

Definition at line 396 of file fe_values.hh.

◆ fe_type_

template<unsigned int spacedim = 3>
FEType FEValues< spacedim >::fe_type_
protected

Type of finite element (scalar, vector, tensor).

Definition at line 387 of file fe_values.hh.

◆ fe_values_vec

template<unsigned int spacedim = 3>
std::vector<FEValues<spacedim> > FEValues< spacedim >::fe_values_vec
protected

Vector of FEValues for sub-elements of FESystem.

Definition at line 412 of file fe_values.hh.

◆ n_components_

template<unsigned int spacedim = 3>
unsigned int FEValues< spacedim >::n_components_
protected

Number of components of the FE.

Definition at line 415 of file fe_values.hh.

◆ n_dofs_

template<unsigned int spacedim = 3>
unsigned int FEValues< spacedim >::n_dofs_
protected

Number of finite element dofs.

Definition at line 384 of file fe_values.hh.

◆ n_points_

template<unsigned int spacedim = 3>
unsigned int FEValues< spacedim >::n_points_
protected

Number of integration points.

Definition at line 381 of file fe_values.hh.

◆ shape_gradients

template<unsigned int spacedim = 3>
std::vector<std::vector<arma::vec::fixed<spacedim> > > FEValues< spacedim >::shape_gradients
protected

Gradients of shape functions evaluated at the quadrature points. Each row of the matrix contains the gradient of one shape function.

Definition at line 403 of file fe_values.hh.

◆ shape_values

template<unsigned int spacedim = 3>
std::vector<std::vector<double> > FEValues< spacedim >::shape_values
protected

Shape functions evaluated at the quadrature points.

Definition at line 399 of file fe_values.hh.

◆ side_fe_data

template<unsigned int spacedim = 3>
std::vector<shared_ptr<FEInternalData> > FEValues< spacedim >::side_fe_data
protected

Precomputed FE data (shape functions on reference element) for all side quadrature points.

Definition at line 424 of file fe_values.hh.

◆ update_flags

template<unsigned int spacedim = 3>
UpdateFlags FEValues< spacedim >::update_flags
protected

Flags that indicate which finite element quantities are to be computed.

Definition at line 406 of file fe_values.hh.

◆ views_cache_

template<unsigned int spacedim = 3>
ViewsCache FEValues< spacedim >::views_cache_
protected

Auxiliary storage of FEValuesViews accessors.

Definition at line 418 of file fe_values.hh.


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