Flow123d  JS_before_hm-946-gd238683
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | 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)
 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)
 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)
 

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...
 
void fill_scalar_data (const ElementValues< spacedim > &elm_values, const FEInternalData &fe_data)
 Compute shape functions and gradients on the actual cell for scalar FE. More...
 
void fill_vec_data (const ElementValues< spacedim > &elm_values, const FEInternalData &fe_data)
 Compute shape functions and gradients on the actual cell for vectorial FE. More...
 
void fill_vec_contravariant_data (const ElementValues< spacedim > &elm_values, const FEInternalData &fe_data)
 Compute shape functions and gradients on the actual cell for vectorial FE. More...
 
void fill_vec_piola_data (const ElementValues< spacedim > &elm_values, const FEInternalData &fe_data)
 Compute shape functions and gradients on the actual cell for Raviart-Thomas FE. More...
 
void fill_tensor_data (const ElementValues< spacedim > &elm_values, const FEInternalData &fe_data)
 Compute shape functions and gradients on the actual cell for tensorial FE. More...
 
void fill_system_data (const ElementValues< spacedim > &elm_values, const FEInternalData &fe_data)
 Compute shape functions and gradients on the actual cell for mixed system of FE. 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< std::vector< shared_ptr< FEInternalData > > > side_fe_data
 Precomputed FE data (shape functions on reference element) for all sides and permuted quadrature points. More...
 

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 59 of file fe_values.hh.

Constructor & Destructor Documentation

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

Default constructor with postponed initialization.

Definition at line 122 of file fe_values.cc.

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 83 of file fe_values.hh.

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

Correct deallocation of objects created by 'initialize' methods.

Definition at line 130 of file fe_values.cc.

Here is the caller graph for this function:

Member Function Documentation

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 183 of file fe_values.cc.

Here is the caller graph for this function:

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 188 of file fe_values.hh.

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

Return dimension of reference space.

Definition at line 285 of file fe_values.hh.

Here is the caller graph for this function:

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 515 of file fe_values.cc.

Here is the caller graph for this function:

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

Compute shape functions and gradients on the actual cell for scalar FE.

Definition at line 310 of file fe_values.cc.

Here is the caller graph for this function:

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

Compute shape functions and gradients on the actual cell for mixed system of FE.

Definition at line 458 of file fe_values.cc.

Here is the caller graph for this function:

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

Compute shape functions and gradients on the actual cell for tensorial FE.

Definition at line 426 of file fe_values.cc.

Here is the caller graph for this function:

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

Compute shape functions and gradients on the actual cell for vectorial FE.

Definition at line 361 of file fe_values.cc.

Here is the caller graph for this function:

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

Compute shape functions and gradients on the actual cell for vectorial FE.

Definition at line 329 of file fe_values.cc.

Here is the caller graph for this function:

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

Compute shape functions and gradients on the actual cell for Raviart-Thomas FE.

Definition at line 393 of file fe_values.cc.

Here is the caller graph for this function:

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 232 of file fe_values.cc.

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.

Here is the caller graph for this function:

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 136 of file fe_values.cc.

Here is the caller graph for this function:

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 200 of file fe_values.hh.

Here is the caller graph for this function:

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

Returns the number of shape functions.

Definition at line 279 of file fe_values.hh.

Here is the caller graph for this function:

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

Returns the number of quadrature points.

Definition at line 273 of file fe_values.hh.

Here is the caller graph for this function:

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 234 of file fe_values.hh.

Here is the caller graph for this function:

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 213 of file fe_values.hh.

Here is the caller graph for this function:

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 223 of file fe_values.hh.

Here is the caller graph for this function:

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 548 of file fe_values.cc.

Here is the caller graph for this function:

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 563 of file fe_values.cc.

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 244 of file fe_values.hh.

Here is the caller graph for this function:

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

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 277 of file fe_values.cc.

Here is the caller graph for this function:

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 298 of file fe_values.cc.

Here is the caller graph for this function:

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

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 268 of file fe_values.cc.

Here is the caller graph for this function:

template<unsigned int spacedim>
double FEValues< spacedim >::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.

For vectorial finite elements.

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

Definition at line 286 of file fe_values.cc.

Here is the caller graph for this function:

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 264 of file fe_values.hh.

Here is the caller graph for this function:

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 254 of file fe_values.hh.

Here is the caller graph for this function:

Member Data Documentation

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

Dimension of reference space.

Definition at line 365 of file fe_values.hh.

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 396 of file fe_values.hh.

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

Precomputed finite element data.

Definition at line 408 of file fe_values.hh.

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 377 of file fe_values.hh.

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 380 of file fe_values.hh.

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 383 of file fe_values.hh.

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

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

Definition at line 374 of file fe_values.hh.

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 399 of file fe_values.hh.

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

Number of components of the FE.

Definition at line 402 of file fe_values.hh.

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

Number of finite element dofs.

Definition at line 371 of file fe_values.hh.

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

Number of integration points.

Definition at line 368 of file fe_values.hh.

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 390 of file fe_values.hh.

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 386 of file fe_values.hh.

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

Precomputed FE data (shape functions on reference element) for all sides and permuted quadrature points.

Definition at line 411 of file fe_values.hh.

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 393 of file fe_values.hh.

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

Auxiliary storage of FEValuesViews accessors.

Definition at line 405 of file fe_values.hh.


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