Flow123d  release_2.2.0-914-gf1a3a4f
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
FESystem< dim, spacedim > Class Template Reference

Compound finite element on dim dimensional simplex. More...

#include <fe_system.hh>

Inheritance diagram for FESystem< dim, spacedim >:
Inheritance graph
[legend]
Collaboration diagram for FESystem< dim, spacedim >:
Collaboration graph
[legend]

Classes

struct  DofComponentData
 

Public Member Functions

 FESystem (std::shared_ptr< FiniteElement< dim, spacedim > > fe, FEType t)
 Constructor. FESystem for vector or tensor created from a scalar FE. More...
 
 FESystem (const std::shared_ptr< FiniteElement< dim, spacedim > > &fe, unsigned int n)
 Constructor. FESystem with n components created from a scalar FE. More...
 
 FESystem (std::vector< std::shared_ptr< FiniteElement< dim, spacedim > > > fe)
 Constructor. FESystem for mixed elements. More...
 
std::vector< unsigned int > get_scalar_components () const
 
std::vector< unsigned int > get_vector_components () const
 
double basis_value (const unsigned int i, const arma::vec::fixed< dim > &p, const unsigned int comp) const override
 The vector variant of basis_value must be implemented but need not be used. More...
 
arma::vec::fixed< dim > basis_grad (const unsigned int i, const arma::vec::fixed< dim > &p, const unsigned int comp) const override
 The vector variant of basis_grad must be implemented but need not be used. More...
 
unsigned int n_components () const override
 Returns numer of components of the basis function. More...
 
UpdateFlags update_each (UpdateFlags flags) override
 Decides which additional quantities have to be computed for each cell. More...
 
- Public Member Functions inherited from FiniteElement< dim, spacedim >
 FiniteElement ()
 Constructor. More...
 
const unsigned int n_dofs () const
 Returns the number of degrees of freedom needed by the finite element. More...
 
Dof dof (unsigned int i) const
 Returns i -th degree of freedom. More...
 
virtual ~FiniteElement ()
 Destructor. More...
 

Private Member Functions

void initialize ()
 Initialization of the internal structures from the vector of base FE. More...
 
FEInternalDatainitialize (const Quadrature< dim > &q) override
 Calculates the data on the reference cell. More...
 
void fill_fe_values (const Quadrature< dim > &q, FEInternalData &data, FEValuesData< dim, spacedim > &fv_data) override
 Computes the shape function values and gradients on the actual cell and fills the FEValues structure. More...
 
void compute_node_matrix () override
 Initializes the node_matrix for computing the coefficients of the shape functions in the raw basis of functions_space_. This is done by evaluating the dofs_ for the basis function and by inverting the resulting matrix. More...
 

Private Attributes

std::vector< std::shared_ptr< FiniteElement< dim, spacedim > > > fe_
 Pointers to base FE objects. More...
 
std::vector< DofComponentDatafe_dof_indices_
 Information about dofs. More...
 
std::vector< unsigned int > scalar_components_
 
std::vector< unsigned int > vector_components_
 
unsigned int n_components_
 

Additional Inherited Members

- Protected Member Functions inherited from FiniteElement< dim, spacedim >
void init (bool primitive=true, FEType type=FEScalar)
 Clears all internal structures. More...
 
void setup_components ()
 Initialize vectors with information about components of basis functions. More...
 
const bool is_primitive () const
 Indicates whether the basis functions have one or more nonzero components (scalar FE spaces are always primitive). More...
 
unsigned int system_to_component_index (unsigned sys_idx) const
 Returns the component index for vector valued finite elements. More...
 
const std::vector< bool > & get_nonzero_components (unsigned int sys_idx) const
 Returns the mask of nonzero components for given basis function. More...
 
- Protected Attributes inherited from FiniteElement< dim, spacedim >
FEType type_
 Type of FiniteElement. More...
 
bool is_primitive_
 Primitive FE is using componentwise shape functions, i.e. only one component is nonzero for each shape function. More...
 
std::vector< unsigned int > component_indices_
 Indices of nonzero components of shape functions (for primitive FE). More...
 
std::vector< std::vector< bool > > nonzero_components_
 Footprints of nonzero components of shape functions. More...
 
arma::mat node_matrix
 Matrix that determines the coefficients of the raw basis functions from the values at the support points. More...
 
FunctionSpacefunction_space_
 Function space defining the FE. More...
 
std::vector< Dofdofs_
 Set of degrees of freedom (functionals) defining the FE. More...
 

Detailed Description

template<unsigned int dim, unsigned int spacedim>
class FESystem< dim, spacedim >

Compound finite element on dim dimensional simplex.

This type of FE is used for vector-valued functions and for systems of equations.

Definition at line 36 of file fe_system.hh.

Constructor & Destructor Documentation

template<unsigned int dim, unsigned int spacedim>
FESystem< dim, spacedim >::FESystem ( std::shared_ptr< FiniteElement< dim, spacedim > >  fe,
FEType  t 
)

Constructor. FESystem for vector or tensor created from a scalar FE.

Parameters
feBase finite element class.
tType (vector or tensor).

Definition at line 28 of file fe_system.cc.

template<unsigned int dim, unsigned int spacedim>
FESystem< dim, spacedim >::FESystem ( const std::shared_ptr< FiniteElement< dim, spacedim > > &  fe,
unsigned int  n 
)

Constructor. FESystem with n components created from a scalar FE.

Parameters
feBase finite element class.
nMultiplicity (number of components).

Definition at line 47 of file fe_system.cc.

template<unsigned int dim, unsigned int spacedim>
FESystem< dim, spacedim >::FESystem ( std::vector< std::shared_ptr< FiniteElement< dim, spacedim > > >  fe)

Constructor. FESystem for mixed elements.

Parameters
feBase finite element classes.

Definition at line 56 of file fe_system.cc.

Member Function Documentation

template<unsigned int dim, unsigned int spacedim>
arma::vec::fixed< dim > FESystem< dim, spacedim >::basis_grad ( const unsigned int  i,
const arma::vec::fixed< dim > &  p,
const unsigned int  comp 
) const
overridevirtual

The vector variant of basis_grad must be implemented but need not be used.

Reimplemented from FiniteElement< dim, spacedim >.

Definition at line 161 of file fe_system.cc.

Here is the caller graph for this function:

template<unsigned int dim, unsigned int spacedim>
double FESystem< dim, spacedim >::basis_value ( const unsigned int  i,
const arma::vec::fixed< dim > &  p,
const unsigned int  comp 
) const
overridevirtual

The vector variant of basis_value must be implemented but need not be used.

Reimplemented from FiniteElement< dim, spacedim >.

Definition at line 146 of file fe_system.cc.

Here is the caller graph for this function:

template<unsigned int dim, unsigned int spacedim>
void FESystem< dim, spacedim >::compute_node_matrix ( )
overrideprivatevirtual

Initializes the node_matrix for computing the coefficients of the shape functions in the raw basis of functions_space_. This is done by evaluating the dofs_ for the basis function and by inverting the resulting matrix.

Reimplemented from FiniteElement< dim, spacedim >.

Definition at line 189 of file fe_system.cc.

template<unsigned int dim, unsigned int spacedim>
void FESystem< dim, spacedim >::fill_fe_values ( const Quadrature< dim > &  q,
FEInternalData data,
FEValuesData< dim, spacedim > &  fv_data 
)
inlineoverrideprivatevirtual

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

Parameters
qQuadrature rule.
dataPrecomputed finite element data.
fv_dataData to be computed.

Reimplemented from FiniteElement< dim, spacedim >.

Definition at line 253 of file fe_system.cc.

template<unsigned int dim, unsigned int spacedim>
std::vector<unsigned int> FESystem< dim, spacedim >::get_scalar_components ( ) const
inline

Definition at line 60 of file fe_system.hh.

Here is the caller graph for this function:

template<unsigned int dim, unsigned int spacedim>
std::vector<unsigned int> FESystem< dim, spacedim >::get_vector_components ( ) const
inline

Definition at line 63 of file fe_system.hh.

Here is the caller graph for this function:

template<unsigned int dim, unsigned int spacedim>
void FESystem< dim, spacedim >::initialize ( )
private

Initialization of the internal structures from the vector of base FE.

Definition at line 67 of file fe_system.cc.

template<unsigned int dim, unsigned int spacedim>
FEInternalData * FESystem< dim, spacedim >::initialize ( const Quadrature< dim > &  q)
overrideprivatevirtual

Calculates the data on the reference cell.

Parameters
qQuadrature rule.
flagsUpdate flags.

Reimplemented from FiniteElement< dim, spacedim >.

Definition at line 208 of file fe_system.cc.

template<unsigned int dim, unsigned int spacedim>
unsigned int FESystem< dim, spacedim >::n_components ( ) const
inlineoverridevirtual

Returns numer of components of the basis function.

Reimplemented from FiniteElement< dim, spacedim >.

Definition at line 80 of file fe_system.hh.

template<unsigned int dim, unsigned int spacedim>
UpdateFlags FESystem< dim, spacedim >::update_each ( UpdateFlags  flags)
inlineoverridevirtual

Decides which additional quantities have to be computed for each cell.

Parameters
flagsComputed update flags.

Reimplemented from FiniteElement< dim, spacedim >.

Definition at line 177 of file fe_system.cc.

Here is the caller graph for this function:

Member Data Documentation

template<unsigned int dim, unsigned int spacedim>
std::vector<std::shared_ptr<FiniteElement<dim,spacedim> > > FESystem< dim, spacedim >::fe_
private

Pointers to base FE objects.

Definition at line 123 of file fe_system.hh.

template<unsigned int dim, unsigned int spacedim>
std::vector<DofComponentData> FESystem< dim, spacedim >::fe_dof_indices_
private

Information about dofs.

Definition at line 126 of file fe_system.hh.

template<unsigned int dim, unsigned int spacedim>
unsigned int FESystem< dim, spacedim >::n_components_
private

Definition at line 131 of file fe_system.hh.

template<unsigned int dim, unsigned int spacedim>
std::vector<unsigned int> FESystem< dim, spacedim >::scalar_components_
private

Definition at line 128 of file fe_system.hh.

template<unsigned int dim, unsigned int spacedim>
std::vector<unsigned int> FESystem< dim, spacedim >::vector_components_
private

Definition at line 129 of file fe_system.hh.


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