Flow123d
JS_before_hm-2198-g122e1f2e2
|
Go to the documentation of this file.
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>
84 is_primitive_ = primitive;
89 template<
unsigned int dim>
92 component_indices_.resize(dofs_.size(), 0);
93 nonzero_components_.resize(dofs_.size(), { true });
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++) {
104 M(j, i) = dofs_[i].evaluate(*function_space_, j);
107 node_matrix = arma::inv(M);
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.");
120 for (
unsigned int j=0; j<function_space_->dim(); j++)
121 value += function_space_->basis_value(j, p, comp) * node_matrix(i,j);
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.");
138 for (
unsigned int j=0; j<function_space_->dim(); j++)
139 grad += function_space_->basis_grad(j, p, comp) * node_matrix(i,j);
145 template<
unsigned int dim>
inline
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>
211 for(
auto dof : this->dofs_)
212 points.push_back(dof.coords);
@ update_volume_elements
Determinant of the Jacobian.
@ update_gradients
Shape function gradients.
FiniteElement()
Constructor.
void init(bool primitive=true, FEType type=FEScalar)
Clears all internal structures.
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...
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
double evaluate(const FS &function_space, unsigned int basis_idx) const
Evaulate dof for basis function of given function space.
Class FEValues calculates finite element data on the actual cells such as shape function values,...
static constexpr bool value
@ update_values
Shape function values.
virtual std::vector< arma::vec::fixed< dim+1 > > dof_points() const
std::vector< unsigned int > get_tensor_components() const
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
@ update_inverse_jacobians
Volume element.
Class FESystem for compound finite elements.
virtual UpdateFlags update_each(UpdateFlags flags)
Decides which additional quantities have to be computed for each cell.
ArmaMat< double, N, M > mat
virtual void compute_node_matrix()
Initializes the node_matrix for computing the coefficients of the shape functions in the raw basis of...
Abstract class for description of finite elements.
std::vector< unsigned int > get_scalar_components() const
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
Basic definitions of numerical quadrature rules.
std::vector< unsigned int > get_vector_components() const
UpdateFlags
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell.
@ update_jacobians
Volume element.
void setup_components()
Initialize vectors with information about components of basis functions.
Compound finite element on dim dimensional simplex.
unsigned int n_space_components(unsigned int spacedim)
Number of components of FE in a mapped space with dimension spacedim.
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...