std::vector<Tensor<4, dim>> &third_derivatives,
std::vector<Tensor<5, dim>> &fourth_derivatives) const override;
- /**
- * Return the degree of the BDM space, which is one less than the highest
- * polynomial degree.
- */
- unsigned int
- degree() const;
-
/**
* Return the name of the space, which is <tt>BDM</tt>.
*/
};
-template <int dim>
-inline unsigned int
-PolynomialsBDM<dim>::degree() const
-{
- return polynomial_space.degree() - 1;
-}
-
-
template <int dim>
inline std::string
PolynomialsBDM<dim>::name() const
template <int dim>
PolynomialsBDM<dim>::PolynomialsBDM(const unsigned int k)
- : TensorPolynomialsBase<dim>(k, n_polynomials(k))
+ : TensorPolynomialsBase<dim>(k + 1, n_polynomials(k))
, polynomial_space(Polynomials::Legendre::generate_complete_basis(k))
, monomials((dim == 2) ? (1) : (k + 2))
, p_values(polynomial_space.n())
// p(t) = t^(i+1)
monomials[i + 1].value(unit_point(d), monovali[d]);
// q(t) = t^(k-i)
- monomials[degree() - i].value(unit_point(d), monovalk[d]);
+ monomials[this->degree() - 1 - i].value(unit_point(d),
+ monovalk[d]);
}
if (values.size() != 0)
{
plot(const PolynomialsBDM<dim> &poly)
{
QTrapez<1> base_quadrature;
- QIterated<dim> quadrature(base_quadrature, poly.degree() + 4);
+ QIterated<dim> quadrature(base_quadrature, poly.degree() + 3);
std::vector<Tensor<1, dim>> values(poly.n());
std::vector<Tensor<2, dim>> grads;
std::vector<Tensor<3, dim>> grads2;
for (unsigned int k = 0; k < quadrature.size(); ++k)
{
- if (k % (poly.degree() + 5) == 0)
- deallog << "BDM" << poly.degree() << '<' << dim << '>' << std::endl;
+ if (k % (poly.degree() + 4) == 0)
+ deallog << "BDM" << poly.degree() - 1 << '<' << dim << '>' << std::endl;
- deallog << "BDM" << poly.degree() << '<' << dim << '>' << '\t'
+ deallog << "BDM" << poly.degree() - 1 << '<' << dim << '>' << '\t'
<< quadrature.point(k);
poly.evaluate(
quadrature.point(k), values, grads, grads2, thirds, fourths);
plot(const PolynomialsBDM<dim> &poly)
{
const PolynomialSpace<dim> legendre_poly_space =
- Polynomials::Legendre::generate_complete_basis(poly.degree());
+ Polynomials::Legendre::generate_complete_basis(poly.degree() - 1);
const Point<3> p0(0, 0, 0);
const Point<3> p1(0.25, 0.5, 0.75);
for (unsigned int k = 0; k < points.size(); ++k)
{
- if (k % (poly.degree() + 4) == 0)
- deallog << "BDM" << poly.degree() << '<' << dim << '>' << std::endl;
+ if (k % (poly.degree() + 3) == 0)
+ deallog << "BDM" << poly.degree() - 1 << '<' << dim << '>' << std::endl;
unsigned int start = dim * n_sub;
- deallog << "BDM" << poly.degree() << '<' << dim << '>' << points[k]
+ deallog << "BDM" << poly.degree() - 1 << '<' << dim << '>' << points[k]
<< std::endl;
poly.evaluate(points[k], values, grads, grads2, thirds, fourths);
- for (unsigned int i = 0; i < poly.degree() + 1; ++i, start += dim)
+ for (unsigned int i = 0; i < poly.degree(); ++i, start += dim)
for (unsigned int j = 0; j < dim; ++j)
{
for (unsigned int d1 = 0; d1 < dim; ++d1)