34 unsigned int basis_idx)
const 40 ASSERT(function_space.space_dim()+1 == coords.size());
47 arma::vec vec_value(function_space.n_components());
48 for (
unsigned int c=0; c<function_space.n_components(); c++)
49 vec_value[c] = function_space.basis_value(basis_idx, coords.subvec(0,coords.size()-2), c);
50 return dot(coefs, vec_value);
55 OLD_ASSERT(
false,
"Dof evaluation not implemented for this type.");
62 template<
unsigned int dim,
unsigned int spacedim>
64 : function_space_(nullptr)
69 template<
unsigned int dim,
unsigned int spacedim>
78 template<
unsigned int dim,
unsigned int spacedim>
86 template<
unsigned int dim,
unsigned int spacedim>
inline 91 for (
unsigned int i = 0; i <
dofs_.size(); i++)
92 for (
unsigned int j = 0; j <
dofs_.size(); j++) {
99 template<
unsigned int dim,
unsigned int spacedim>
108 for (
unsigned int i=0; i<q.
size(); i++)
117 for (
unsigned int j=0; j<
n_dofs(); j++)
125 for (
unsigned int i=0; i<q.
size(); i++)
128 for (
unsigned int j=0; j<
n_dofs(); j++)
142 template<
unsigned int dim,
unsigned int spacedim>
144 const arma::vec::fixed<dim> &p,
145 const unsigned int comp)
const 148 ASSERT_DBG( i <
dofs_.size()).error(
"Index of basis function is out of range.");
152 template<
unsigned int dim,
unsigned int spacedim>
154 const arma::vec::fixed<dim> &p,
155 const unsigned int comp)
const 158 ASSERT_DBG( i <
dofs_.size()).error(
"Index of basis function is out of range.");
163 template<
unsigned int dim,
unsigned int spacedim>
inline 177 if (flags & update_gradients)
181 if (flags & update_values)
183 if (flags & update_gradients)
192 template<
unsigned int dim,
unsigned int spacedim>
inline 201 for (
unsigned int i = 0; i < q.
size(); i++)
202 for (
unsigned int j = 0; j <
n_dofs(); j++)
211 for (
unsigned int c=0; c<spacedim; c++)
216 for (
unsigned int c=0; c<spacedim; c++)
228 ASSERT(
false).error(
"Not implemented.");
236 for (
unsigned int i = 0; i < q.
size(); i++)
238 for (
unsigned int j = 0; j <
n_dofs(); j++)
248 for (
unsigned int c=0; c<spacedim; c++)
254 for (
unsigned int c=0; c<spacedim; c++)
258 ASSERT(
false).error(
"Not implemented.");
267 template<
unsigned int dim,
unsigned int spacedim>
FEType type_
Type of FiniteElement.
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...
void init(bool primitive=true, FEType type=FEScalar)
Clears all internal structures.
std::vector< Dof > dofs_
Set of degrees of freedom (functionals) defining the FE.
Determinant of the Jacobian.
std::vector< arma::mat::fixed< dim, spacedim > > inverse_jacobians
Inverse Jacobians at the quadrature points.
virtual FEInternalData * initialize(const Quadrature< dim > &q)
Calculates the data on the reference cell.
UpdateFlags update_flags
Flags that indicate which finite element quantities are to be computed.
virtual const 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.
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...
Base class for quadrature rules on simplices in arbitrary dimensions.
static constexpr bool value
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.
virtual UpdateFlags update_each(UpdateFlags flags)
Decides which additional quantities have to be computed for each cell.
virtual const unsigned int dim() const =0
Dimension of function space (number of basis functions).
virtual ~FiniteElement()
Destructor.
std::vector< arma::mat::fixed< spacedim, dim > > jacobians
Jacobians of the mapping at the quadrature points.
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...
virtual void compute_node_matrix()
Initializes the node_matrix for computing the coefficients of the shape functions in the raw basis of...
void setup_components()
Initialize vectors with information about components of basis functions.
Basic definitions of numerical quadrature rules.
Shape function gradients.
std::vector< std::vector< arma::mat > > ref_shape_grads
Precomputed gradients of basis functions at the quadrature points.
Class FEValuesData holds the arrays of data computed by Mapping and FiniteElement.
const double evaluate(const FS &function_space, unsigned int basis_idx) const
Evaulate dof for basis function of given function space.
const unsigned int size() const
Returns number of quadrature points.
virtual arma::vec::fixed< dim > basis_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 raw basis function at the point p on the...
std::vector< std::vector< double > > shape_values
Shape functions evaluated at the quadrature points.
std::vector< double > determinants
Determinants of Jacobians at quadrature points.
const arma::vec::fixed< dim > & point(const unsigned int i) const
Returns the ith quadrature point.
FiniteElement()
Constructor.
virtual double basis_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 raw basis function at the point p on the re...
const unsigned int n_dofs() const
Returns the number of degrees of freedom needed by the finite element.
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.
Abstract class for description of finite elements.
virtual void fill_fe_values(const Quadrature< dim > &q, FEInternalData &data, FEValuesData< dim, spacedim > &fv_data)
Computes the shape function values and gradients on the actual cell and fills the FEValues structure...
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...
arma::mat node_matrix
Matrix that determines the coefficients of the raw basis functions from the values at the support poi...
std::vector< std::vector< arma::vec::fixed< spacedim > > > shape_gradients
Gradients of shape functions evaluated at the quadrature points.
virtual unsigned int n_components() const
Returns numer of components of the basis function.