19 #ifndef FINITE_ELEMENT_HH_ 20 #define FINITE_ELEMENT_HH_ 26 #include <boost/assign/list_of.hpp> 27 #include <boost/exception/info.hpp> 35 template<
unsigned int dim>
class FESystem;
36 template<
unsigned int spacedim>
class FEValues;
37 template<
unsigned int dim>
class FE_P_disc;
74 Dof(
unsigned int dim_,
75 unsigned int n_face_idx_,
89 double evaluate(
const FS &function_space,
90 unsigned int basis_idx)
const;
126 unsigned int n_components)
128 : space_dim_(space_dim),
129 n_components_(n_components)
139 virtual double basis_value(
unsigned int basis_index,
141 unsigned int comp_index = 0
150 virtual const arma::vec basis_grad(
unsigned int basis_index,
152 unsigned int comp_index = 0
156 virtual unsigned int dim()
const = 0;
250 template<
unsigned int dim>
264 {
return dofs_.size(); }
275 double shape_value(
const unsigned int i,
276 const arma::vec::fixed<dim> &p,
277 const unsigned int comp = 0)
const;
288 arma::vec::fixed<dim> shape_grad(
const unsigned int i,
289 const arma::vec::fixed<dim> &p,
290 const unsigned int comp = 0)
const;
294 {
return function_space_->n_components(); }
297 inline const Dof &
dof(
unsigned int i)
const 301 unsigned int n_space_components(
unsigned int spacedim);
317 void init(
bool primitive =
true,
323 void setup_components();
339 virtual void compute_node_matrix();
346 {
return is_primitive_; }
353 {
return component_indices_[sys_idx]; }
360 {
return nonzero_components_[sys_idx]; }
UpdateFlags
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell...
unsigned int n_dofs() const
Returns the number of degrees of freedom needed by the finite element.
arma::vec coords
Barycentric coordinates.
FunctionSpace(unsigned int space_dim, unsigned int n_components)
arma::mat node_matrix
Matrix that determines the coefficients of the raw basis functions from the values at the support poi...
unsigned int n_components_
Number of components of function values.
bool is_primitive_
Primitive FE is using componentwise shape functions, i.e. only one component is nonzero for each shap...
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.
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell...
virtual ~FiniteElement()
Destructor.
unsigned int n_face_idx
Index of n-face to which the dof is associated.
unsigned int space_dim() const
Getter for space dimension.
Discontinuous Lagrangean finite element on dim dimensional simplex.
ArmaMat< double, N, M > mat
Compound finite element on dim dimensional simplex.
std::vector< Dof > dofs_
Set of degrees of freedom (functionals) defining the FE.
unsigned int n_components() const
Getter for number of components.
unsigned int n_components() const
Returns numer of components of the basis function.
bool is_primitive() const
Indicates whether the basis functions have one or more nonzero components (scalar FE spaces are alway...
unsigned int system_to_component_index(unsigned sys_idx) const
Returns the component index for vector valued finite elements.
std::shared_ptr< FunctionSpace > function_space_
Function space defining the FE.
const Dof & dof(unsigned int i) const
Returns i -th degree of freedom.
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.
Dof(unsigned int dim_, unsigned int n_face_idx_, arma::vec coords_, arma::vec coefs_, DofType type_)
unsigned int space_dim_
Space dimension of function arguments (i.e. 1, 2 or 3).
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
arma::vec coefs
Coefficients of linear combination of function value components.
std::vector< unsigned int > component_indices_
Indices of nonzero components of shape functions (for primitive FE).
const std::vector< bool > & get_nonzero_components(unsigned int sys_idx) const
Returns the mask of nonzero components for given basis function.
FEType type_
Type of FiniteElement.