34 unsigned int basis_idx)
const 40 ASSERT(function_space.space_dim()+1 == coords.size());
47 arma::vec vec_value(function_space.n_components());
51 arma::vec f_coords(function_space.space_dim());
52 if (function_space.space_dim() > 0)
53 f_coords = coords.subvec(1,coords.size()-1);
54 for (
unsigned int c=0; c<function_space.n_components(); c++)
55 vec_value[c] = function_space.basis_value(basis_idx, f_coords, c);
56 return dot(coefs, vec_value);
61 OLD_ASSERT(
false,
"Dof evaluation not implemented for this type.");
72 template<
unsigned int dim>
74 : function_space_(nullptr)
79 template<
unsigned int dim>
88 template<
unsigned int dim>
96 template<
unsigned int dim>
inline 101 for (
unsigned int i = 0; i <
dofs_.size(); i++)
102 for (
unsigned int j = 0; j <
dofs_.size(); j++) {
110 template<
unsigned int dim>
112 const arma::vec::fixed<dim> &p,
113 const unsigned int comp)
const 116 ASSERT_DBG( i <
dofs_.size()).error(
"Index of basis function is out of range.");
125 template<
unsigned int dim>
127 const arma::vec::fixed<dim> &p,
128 const unsigned int comp)
const 131 ASSERT_DBG( i <
dofs_.size()).error(
"Index of basis function is out of range.");
135 arma::vec grad((arma::uword)dim);
144 template<
unsigned int dim>
inline 160 if (flags & update_gradients)
164 if (flags & update_values)
166 if (flags & update_gradients)
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...
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...
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
static constexpr bool value
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< 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.
const double evaluate(const FS &function_space, unsigned int basis_idx) const
Evaulate dof for basis function of given function space.
std::shared_ptr< FunctionSpace > function_space_
Function space defining the FE.
void setup_components()
Initialize vectors with information about components of basis functions.
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.