19 #ifndef FINITE_ELEMENT_HH_
20 #define FINITE_ELEMENT_HH_
34 template<
unsigned int dim>
class FESystem;
35 template<
unsigned int spacedim>
class FEValues;
36 template<
unsigned int dim>
class FE_P_disc;
73 Dof(
unsigned int dim_,
74 unsigned int n_face_idx_,
88 double evaluate(
const FS &function_space,
89 unsigned int basis_idx)
const;
140 unsigned int comp_index = 0
151 unsigned int comp_index = 0
155 virtual unsigned int dim()
const = 0;
249 template<
unsigned int dim>
263 {
return dofs_.size(); }
275 const arma::vec::fixed<dim> &p,
276 const unsigned int comp = 0)
const;
287 arma::vec::fixed<dim>
shape_grad(
const unsigned int i,
288 const arma::vec::fixed<dim> &p,
289 const unsigned int comp = 0)
const;
296 inline const Dof &
dof(
unsigned int i)
const
316 void init(
bool primitive =
true,
double evaluate(const FS &function_space, unsigned int basis_idx) const
Evaulate dof for basis function of given function space.
arma::vec coefs
Coefficients of linear combination of function value components.
Dof(unsigned int dim_, unsigned int n_face_idx_, arma::vec coords_, arma::vec coefs_, DofType type_)
unsigned int n_face_idx
Index of n-face to which the dof is associated.
arma::vec coords
Barycentric coordinates.
unsigned int dim
Association to n-face of given dimension (point, line, triangle, tetrahedron.
Compound finite element on dim dimensional simplex.
Calculates finite element data on the actual cell.
Discontinuous Lagrangean finite element on dim dimensional simplex.
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
unsigned int n_space_components(unsigned int spacedim)
Number of components of FE in a mapped space with dimension spacedim.
virtual UpdateFlags update_each(UpdateFlags flags)
Decides which additional quantities have to be computed for each cell.
std::shared_ptr< FunctionSpace > function_space_
Function space defining the FE.
const Dof & dof(unsigned int i) const
Returns i -th degree of freedom.
unsigned int n_dofs() const
Returns the number of degrees of freedom needed by the finite element.
bool is_primitive_
Primitive FE is using componentwise shape functions, i.e. only one component is nonzero for each shap...
arma::mat node_matrix
Matrix that determines the coefficients of the raw basis functions from the values at the support poi...
FEType type_
Type of FiniteElement.
const std::vector< bool > & get_nonzero_components(unsigned int sys_idx) const
Returns the mask of nonzero components for given basis function.
virtual std::vector< arma::vec::fixed< dim+1 > > dof_points() const
void init(bool primitive=true, FEType type=FEScalar)
Clears all internal structures.
unsigned int system_to_component_index(unsigned sys_idx) const
Returns the component index for vector valued finite elements.
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 refere...
std::vector< std::vector< bool > > nonzero_components_
Footprints of nonzero components of shape functions.
virtual ~FiniteElement()
Destructor.
bool is_primitive() const
Indicates whether the basis functions have one or more nonzero components (scalar FE spaces are alway...
void setup_components()
Initialize vectors with information about components of basis functions.
virtual void compute_node_matrix()
Initializes the node_matrix for computing the coefficients of the shape functions in the raw basis of...
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 ref...
unsigned int n_components() const
Returns numer of components of the basis function.
std::vector< Dof > dofs_
Set of degrees of freedom (functionals) defining the FE.
std::vector< unsigned int > component_indices_
Indices of nonzero components of shape functions (for primitive FE).
FiniteElement()
Constructor.
unsigned int n_components() const
Getter for number of components.
unsigned int space_dim() const
Getter for space dimension.
virtual unsigned int dim() const =0
Dimension of function space (number of basis functions).
virtual double basis_value(unsigned int basis_index, const arma::vec &point, unsigned int comp_index=0) const =0
Value of the i th basis function at point point.
virtual const arma::vec basis_grad(unsigned int basis_index, const arma::vec &point, unsigned int comp_index=0) const =0
Gradient of the i th basis function at point point.
unsigned int n_components_
Number of components of function values.
unsigned int space_dim_
Space dimension of function arguments (i.e. 1, 2 or 3).
FunctionSpace(unsigned int space_dim, unsigned int n_components)
ArmaMat< double, N, M > mat
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell.
UpdateFlags
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell.