35 unsigned int basis_idx)
const 41 ASSERT(function_space.space_dim()+1 == coords.size());
48 arma::vec vec_value(function_space.n_components());
52 arma::vec f_coords(function_space.space_dim());
53 if (function_space.space_dim() > 0)
54 f_coords = coords.subvec(1,coords.size()-1);
55 for (
unsigned int c=0; c<function_space.n_components(); c++)
56 vec_value[c] = function_space.basis_value(basis_idx, f_coords, c);
57 return dot(coefs, vec_value);
62 OLD_ASSERT(
false,
"Dof evaluation not implemented for this type.");
73 template<
unsigned int dim>
75 : function_space_(nullptr)
80 template<
unsigned int dim>
89 template<
unsigned int dim>
97 template<
unsigned int dim>
inline 102 for (
unsigned int i = 0; i <
dofs_.size(); i++)
103 for (
unsigned int j = 0; j <
dofs_.size(); j++) {
111 template<
unsigned int dim>
113 const arma::vec::fixed<dim> &p,
114 const unsigned int comp)
const 117 ASSERT_DBG( i <
dofs_.size()).error(
"Index of basis function is out of range.");
126 template<
unsigned int dim>
128 const arma::vec::fixed<dim> &p,
129 const unsigned int comp)
const 132 ASSERT_DBG( i <
dofs_.size()).error(
"Index of basis function is out of range.");
145 template<
unsigned int dim>
inline 161 if (flags & update_gradients)
165 if (flags & update_values)
167 if (flags & update_gradients)
177 template<
unsigned int dim>
190 return spacedim*spacedim;
194 ASSERT_DBG(fe_sys !=
nullptr).error(
"Mixed system must be represented by FESystem.");
202 ASSERT(0).error(
"Unknown type of FiniteElement.");
207 template<
unsigned int dim>
FiniteElement()
Constructor.
UpdateFlags
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell...
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
std::vector< unsigned int > get_tensor_components() const
arma::vec coords
Barycentric coordinates.
arma::mat node_matrix
Matrix that determines the coefficients of the raw basis functions from the values at the support poi...
Determinant of the Jacobian.
bool is_primitive_
Primitive FE is using componentwise shape functions, i.e. only one component is nonzero for each shap...
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...
std::vector< std::vector< bool > > nonzero_components_
Footprints of nonzero components of shape functions.
Class FEValues calculates finite element data on the actual cells such as shape function values...
Class FESystem for compound finite elements.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
std::vector< unsigned int > get_scalar_components() const
static constexpr bool value
ArmaMat< double, N, M > mat
std::vector< unsigned int > get_vector_components() const
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...
Compound finite element on dim dimensional simplex.
std::vector< Dof > dofs_
Set of degrees of freedom (functionals) defining the FE.
virtual UpdateFlags update_each(UpdateFlags flags)
Decides which additional quantities have to be computed for each cell.
unsigned int n_components() const
Returns numer of components of the basis function.
virtual void compute_node_matrix()
Initializes the node_matrix for computing the coefficients of the shape functions in the raw basis of...
Basic definitions of numerical quadrature rules.
Shape function gradients.
void init(bool primitive=true, FEType type=FEScalar)
Clears all internal structures.
unsigned int n_space_components(unsigned int spacedim)
Number of components of FE in a mapped space with dimension spacedim.
std::shared_ptr< FunctionSpace > function_space_
Function space defining the FE.
const Dof & dof(unsigned int i) const
Returns i -th degree of freedom.
void setup_components()
Initialize vectors with information about components of basis functions.
double evaluate(const FS &function_space, unsigned int basis_idx) const
Evaulate dof for basis function of given function space.
virtual std::vector< arma::vec::fixed< dim+1 > > dof_points() const
Abstract class for description of finite elements.
std::vector< unsigned int > component_indices_
Indices of nonzero components of shape functions (for primitive FE).
FEType type_
Type of FiniteElement.