46 template<
unsigned int degree,
unsigned int dim>
63 const double basis_value(
unsigned int i,
const arma::vec::fixed<dim> &p)
const;
70 const arma::vec::fixed<dim>
basis_grad(
unsigned int i,
const arma::vec::fixed<dim> &p)
const;
100 template<
unsigned int degree,
unsigned int dim>
155 template <
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
175 double basis_value(
const unsigned int i,
const arma::vec::fixed<dim> &p)
const;
182 arma::vec::fixed<dim>
basis_grad(
const unsigned int i,
const arma::vec::fixed<dim> &p)
const;
187 arma::vec::fixed<dim>
basis_vector(
const unsigned int i,
const arma::vec::fixed<dim> &p)
const;
192 arma::mat::fixed<dim,dim>
basis_grad_vector(
const unsigned int i,
const arma::vec::fixed<dim> &p)
const;
210 template <
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
231 double basis_value(
const unsigned int i,
const arma::vec::fixed<dim> &p)
const;
238 arma::vec::fixed<dim>
basis_grad(
const unsigned int i,
const arma::vec::fixed<dim> &p)
const;
243 arma::vec::fixed<dim>
basis_vector(
const unsigned int i,
const arma::vec::fixed<dim> &p)
const;
248 arma::mat::fixed<dim,dim>
basis_grad_vector(
const unsigned int i,
const arma::vec::fixed<dim> &p)
const;
261 template<
unsigned int degree,
unsigned int dim>
272 arma::uvec::fixed<dim> pows;
275 unsigned int degree_sum=0;
280 powers.push_back(pows);
283 for(i_dim=0; i_dim < dim; i_dim++) {
284 if (degree_sum < degree) {
289 degree_sum-=pows[i_dim];
293 if (i_dim == dim)
break;
297 template<
unsigned int degree,
unsigned int dim>
300 ASSERT(i<=powers.size(),
"Index of basis function is out of range.");
304 for (
unsigned int j=0; j<dim; j++)
305 v *= pow(p[j], (
int) powers[i][j]);
311 template<
unsigned int degree,
unsigned int dim>
314 ASSERT(i<=powers.size(),
"Index of basis function is out of range.");
316 arma::vec::fixed<dim> grad;
318 for (
unsigned int j=0; j<dim; j++)
320 grad[j] = powers[i][j];
321 if (powers[i][j] == 0)
continue;
323 for (
unsigned int k=0; k<dim; k++)
325 grad[j] *= pow(p[k], (
int) (k==j?powers[i][k]-1:powers[i][k]));
341 template<
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
346 for (
int i=0; i<=dim; i++)
348 number_of_dofs += dof_distribution.number_of_single_dofs[i]
349 +2*dof_distribution.number_of_pairs[i]
350 +3*dof_distribution.number_of_triples[i]
351 +6*dof_distribution.number_of_sextuples[i];
353 number_of_single_dofs[i] = dof_distribution.number_of_single_dofs[i];
354 number_of_pairs[i] = dof_distribution.number_of_pairs[i];
355 number_of_triples[i] = dof_distribution.number_of_triples[i];
356 number_of_sextuples[i] = dof_distribution.number_of_sextuples[i];
359 for (
int i=0; i<dof_distribution.unit_support_points.size(); i++)
360 unit_support_points.push_back(dof_distribution.unit_support_points[i]);
364 this->compute_node_matrix();
367 template<
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
370 ASSERT(i <= number_of_dofs,
"Index of basis function is out of range.");
371 return poly_space.basis_value(i, p);
374 template<
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
377 ASSERT(i <= number_of_dofs,
"Index of basis function is out of range.");
378 return poly_space.basis_grad(i, p);
381 template<
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
384 ASSERT(
false,
"basis_vector() may not be called for scalar finite element.");
387 template<
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
390 ASSERT(
false,
"basis_grad_vector() may not be called for scalar finite element.");
407 template<
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
412 number_of_dofs += dof_distribution.number_of_dofs;
414 number_of_single_dofs[dim] = number_of_dofs;
416 for (
unsigned int i=0; i<dof_distribution.unit_support_points.size(); i++)
417 unit_support_points.push_back(dof_distribution.unit_support_points[i]);
421 this->compute_node_matrix();
424 template<
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
427 ASSERT(i <= number_of_dofs,
"Index of basis function is out of range.");
428 return poly_space.basis_value(i, p);
431 template<
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
434 ASSERT(i <= number_of_dofs,
"Index of basis function is out of range.");
435 return poly_space.basis_grad(i, p);
438 template<
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
441 ASSERT(
false,
"basis_vector() may not be called for scalar finite element.");
444 template<
unsigned int degree,
unsigned int dim,
unsigned int spacedim>
447 ASSERT(
false,
"basis_grad_vector() may not be called for scalar finite element.");
461 #ifndef DOXYGEN_SHOULD_SKIP_THIS