19 #ifndef FINITE_ELEMENT_HH_ 20 #define FINITE_ELEMENT_HH_ 25 #include <boost/assign/list_of.hpp> 30 template<
unsigned int dim,
unsigned int spacedim>
class FESystem;
31 template<
unsigned int dim,
unsigned int spacedim>
class FESideValues;
32 template<
unsigned int dim,
unsigned int spacedim>
class FEValues;
33 template<
unsigned int dim,
unsigned int spacedim>
class FEValuesBase;
34 template<
unsigned int dim,
unsigned int spacedim>
class FEValuesData;
35 template<
unsigned int dim,
unsigned int spacedim>
class FE_P_disc;
73 Dof(
unsigned int dim_,
74 unsigned int n_face_idx_,
88 const double evaluate(
const FS &function_space,
89 unsigned int basis_idx)
const;
125 unsigned int n_components)
127 : space_dim_(space_dim),
128 n_components_(n_components)
138 virtual const double basis_value(
unsigned int basis_index,
139 const arma::vec &
point,
140 unsigned int comp_index = 0
149 virtual const arma::vec basis_grad(
unsigned int basis_index,
150 const arma::vec &point,
151 unsigned int comp_index = 0
155 virtual const unsigned int dim()
const = 0;
158 const unsigned int space_dim()
const {
return space_dim_; }
273 template<
unsigned int dim,
unsigned int spacedim>
286 const unsigned int n_dofs()
const {
return dofs_.size(); }
297 virtual double basis_value(
const unsigned int i,
298 const arma::vec::fixed<dim> &p,
const unsigned int comp = 0)
const;
309 virtual arma::vec::fixed<dim> basis_grad(
const unsigned int i,
310 const arma::vec::fixed<dim> &p,
const unsigned int comp = 0)
const;
313 virtual unsigned int n_components()
const {
return function_space_->n_components(); }
316 Dof dof(
unsigned int i)
const {
return dofs_[i]; }
333 void setup_components();
369 virtual void compute_node_matrix();
382 {
return component_indices_[sys_idx]; }
389 {
return nonzero_components_[sys_idx]; }
const unsigned int space_dim() const
Getter for space dimension.
FEType type_
Type of FiniteElement.
UpdateFlags
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell...
arma::vec coords
Barycentric coordinates.
std::vector< Dof > dofs_
Set of degrees of freedom (functionals) defining the FE.
FunctionSpace(unsigned int space_dim, unsigned int n_components)
const bool is_primitive() const
Indicates whether the basis functions have one or more nonzero components (scalar FE spaces are alway...
unsigned int n_components_
Number of components of function values.
unsigned int dim
Association to n-face of given dimension (point, line, triangle, tetrahedron.
std::vector< std::vector< bool > > nonzero_components_
Footprints of nonzero components of shape functions.
Dof dof(unsigned int i) const
Returns i -th degree of freedom.
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell...
unsigned int n_face_idx
Index of n-face to which the dof is associated.
Base class for quadrature rules on simplices in arbitrary dimensions.
Discontinuous Lagrangean finite element on dim dimensional simplex.
unsigned int system_to_component_index(unsigned sys_idx) const
Returns the component index for vector valued finite elements.
std::vector< unsigned int > component_indices_
Indices of nonzero components of shape functions (for primitive FE).
bool is_primitive_
Primitive FE is using componentwise shape functions, i.e. only one component is nonzero for each shap...
Compound finite element on dim dimensional simplex.
std::vector< std::vector< arma::mat > > ref_shape_grads
Precomputed gradients of basis functions at the quadrature points.
const unsigned int n_components() const
Getter for number of components.
Class FEValuesData holds the arrays of data computed by Mapping and FiniteElement.
const std::vector< bool > & get_nonzero_components(unsigned int sys_idx) const
Returns the mask of nonzero components for given basis function.
const double evaluate(const FS &function_space, unsigned int basis_idx) const
Evaulate dof for basis function of given function space.
Calculates finite element data on the actual cell.
const unsigned int n_dofs() const
Returns the number of degrees of freedom needed by the finite element.
Dof(unsigned int dim_, unsigned int n_face_idx_, arma::vec coords_, arma::vec coefs_, DofType type_)
Structure for storing the precomputed finite element data.
std::vector< std::vector< arma::vec > > ref_shape_values
Precomputed values of basis functions at the quadrature points.
unsigned int space_dim_
Space dimension of function arguments (i.e. 1, 2 or 3).
FunctionSpace * function_space_
Function space defining the FE.
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
Base class for FEValues and FESideValues.
arma::mat node_matrix
Matrix that determines the coefficients of the raw basis functions from the values at the support poi...
arma::vec coefs
Coefficients of linear combination of function value components.
virtual unsigned int n_components() const
Returns numer of components of the basis function.
Calculates finite element data on a side.