Flow123d
release_3.0.0-955-g4db4b48
|
Abstract class for the description of a general finite element on a reference simplex in dim
dimensions.
More...
#include <discrete_space.hh>
Public Member Functions | |
FiniteElement () | |
Constructor. More... | |
const unsigned int | n_dofs () const |
Returns the number of degrees of freedom needed by the finite element. More... | |
double | shape_value (const unsigned int i, const arma::vec::fixed< dim > &p, const unsigned int comp=0) const |
Calculates the value of the comp-th component of the i-th shape function at the point p on the reference element. More... | |
arma::vec::fixed< dim > | shape_grad (const unsigned int i, const arma::vec::fixed< dim > &p, const unsigned int comp=0) const |
Calculates the comp-th component of the gradient of the i-th shape function at the point p on the reference element. More... | |
unsigned int | n_components () const |
Returns numer of components of the basis function. More... | |
const Dof & | dof (unsigned int i) const |
Returns i -th degree of freedom. More... | |
virtual | ~FiniteElement () |
Destructor. More... | |
Protected Member Functions | |
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... | |
virtual UpdateFlags | update_each (UpdateFlags flags) |
Decides which additional quantities have to be computed for each cell. More... | |
virtual void | compute_node_matrix () |
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... | |
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 | |
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... | |
std::shared_ptr< FunctionSpace > | function_space_ |
Function space defining the FE. More... | |
std::vector< Dof > | dofs_ |
Set of degrees of freedom (functionals) defining the FE. More... | |
Friends | |
class | FESystem< dim > |
class | FEValuesBase< dim, 3 > |
class | FEValues< dim, 3 > |
class | FESideValues< dim, 3 > |
class | FE_P_disc< dim > |
Abstract class for the description of a general finite element on a reference simplex in dim
dimensions.
The finite element is determined by a function_space_
and a set of dofs_
. Further it must be set whether the finite element is_primitive_
, which means that even if the functions in function_space_
are vector-valued, the basis functions have only one nonzero component (this is typical for tensor-product FE, e.g. vector-valued polynomial FE, but not for Raviart-Thomas FE).
Description of dofs:
The reference cell consists of lower dimensional entities (points, lines, triangles). Each dof is associated to one of these entities. If the entity is shared by 2 or more neighbouring cells in the mesh then this dof is shared by the finite elements on all of these cells. If a dof is associated to the cell itself then it is not shared with neighbouring cells.
Shape functions:
Sometimes it is convenient to describe the function space using a basis (called the raw basis) that is different from the set of shape functions for the finite element (the actual basis). For this reason we define the support points which play the role of nodal functionals associated to the particular dofs. To convert between the two bases one can use the node_matrix
, which is constructed by the method compute_node_matrix(). In the case of non-Lagrangean finite elements the dofs are not associated to nodal functionals but e.g. to derivatives or averages. For that reason we distinguish between the unit support points which are uniquely associated to the dofs and the generalized support points that are auxiliary for the calculation of the dof functionals.
Definition at line 25 of file discrete_space.hh.
FiniteElement< dim >::FiniteElement | ( | ) |
Constructor.
Definition at line 73 of file finite_element.cc.
|
inlinevirtual |
Destructor.
Definition at line 307 of file finite_element.hh.
|
inlineprotectedvirtual |
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 in FESystem< dim >.
Definition at line 97 of file finite_element.cc.
|
inline |
Returns i
-th degree of freedom.
Definition at line 301 of file finite_element.hh.
|
inlineprotected |
Returns the mask of nonzero components for given basis function.
sys_idx | Index of basis function. |
Definition at line 356 of file finite_element.hh.
|
protected |
Clears all internal structures.
Definition at line 80 of file finite_element.cc.
|
inlineprotected |
Indicates whether the basis functions have one or more nonzero components (scalar FE spaces are always primitive).
Definition at line 342 of file finite_element.hh.
|
inline |
Returns numer of components of the basis function.
Definition at line 297 of file finite_element.hh.
|
inline |
Returns the number of degrees of freedom needed by the finite element.
Definition at line 267 of file finite_element.hh.
|
protected |
Initialize vectors with information about components of basis functions.
Definition at line 89 of file finite_element.cc.
arma::vec::fixed< dim > FiniteElement< dim >::shape_grad | ( | const unsigned int | i, |
const arma::vec::fixed< dim > & | p, | ||
const unsigned int | comp = 0 |
||
) | const |
Calculates the comp-th
component of the gradient of the i-th
shape function at the point p
on the reference element.
i | Number of the shape function. |
p | Point of evaluation. |
comp | Number of vector component. |
Definition at line 126 of file finite_element.cc.
double FiniteElement< dim >::shape_value | ( | const unsigned int | i, |
const arma::vec::fixed< dim > & | p, | ||
const unsigned int | comp = 0 |
||
) | const |
Calculates the value of the comp-th
component of the i-th
shape function at the point p
on the reference element.
i | Number of the shape function. |
p | Point of evaluation. |
comp | Number of vector component. |
Definition at line 111 of file finite_element.cc.
|
inlineprotected |
Returns the component index for vector valued finite elements.
sys_idx | Index of shape function. |
Definition at line 349 of file finite_element.hh.
|
inlineprotectedvirtual |
Decides which additional quantities have to be computed for each cell.
flags | Computed update flags. |
Reimplemented in FESystem< dim >.
Definition at line 145 of file finite_element.cc.
|
friend |
Definition at line 393 of file finite_element.hh.
|
friend |
Definition at line 392 of file finite_element.hh.
|
friend |
Definition at line 389 of file finite_element.hh.
|
friend |
Definition at line 391 of file finite_element.hh.
|
friend |
Definition at line 390 of file finite_element.hh.
|
protected |
Indices of nonzero components of shape functions (for primitive FE).
Definition at line 371 of file finite_element.hh.
|
protected |
Set of degrees of freedom (functionals) defining the FE.
Definition at line 386 of file finite_element.hh.
|
protected |
Function space defining the FE.
Definition at line 383 of file finite_element.hh.
|
protected |
Primitive FE is using componentwise shape functions, i.e. only one component is nonzero for each shape function.
Definition at line 368 of file finite_element.hh.
|
protected |
Matrix that determines the coefficients of the raw basis functions from the values at the support points.
Definition at line 380 of file finite_element.hh.
|
protected |
Footprints of nonzero components of shape functions.
Definition at line 374 of file finite_element.hh.
|
protected |
Type of FiniteElement.
Definition at line 362 of file finite_element.hh.