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>
83 is_primitive_ = primitive;
88 template<
unsigned int dim>
91 component_indices_.resize(dofs_.size(), 0);
92 nonzero_components_.resize(dofs_.size(), { true });
96 template<
unsigned int dim>
inline
99 arma::mat M(dofs_.size(), dofs_.size());
101 for (
unsigned int i = 0; i < dofs_.size(); i++)
102 for (
unsigned int j = 0; j < dofs_.size(); j++) {
103 M(j, i) = dofs_[i].evaluate(*function_space_, j);
106 node_matrix = arma::inv(M);
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.");
119 for (
unsigned int j=0; j<function_space_->dim(); j++)
120 value += function_space_->basis_value(j, p, comp) * node_matrix(i,j);
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);
137 for (
unsigned int j=0; j<function_space_->dim(); j++)
138 grad += function_space_->basis_grad(j, p, comp) * node_matrix(i,j);
144 template<
unsigned int dim>
inline