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);