// ------------------------------------------------------------------------ // // SPDX-License-Identifier: LGPL-2.1-or-later // Copyright (C) 2009 - 2024 by the deal.II authors // // This file is part of the deal.II library. // // Part of the source code is dual licensed under Apache-2.0 WITH // LLVM-exception OR LGPL-2.1-or-later. Detailed license information // governing the source code and code contributions can be found in // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. // // ------------------------------------------------------------------------ #ifndef dealii_polynomials_adini_h #define dealii_polynomials_adini_h #include #include #include #include #include DEAL_II_NAMESPACE_OPEN /** * The cubic polynomial space for the Adini element * * This space consists of the cubic space P3 augmented by * the functions xy3 and x3y. * * The basis of the space is chosen to match the node functionals of the Adini * element. * * @todo This polynomial space is implemented in 2d only and does not compute * derivatives of order 3 or higher. * * @ingroup Polynomials */ template class PolynomialsAdini : public ScalarPolynomialsBase { public: /** * Constructor for the polynomials of the described space */ PolynomialsAdini(); /** * Compute the value and the first and second derivatives of each * polynomial at unit_point. * * The size of the vectors must either be equal 0 or equal n(). In the first * case, the function will not compute these values, i.e. you indicate what * you want to have computed by resizing those vectors which you want * filled. * * If you need values or derivatives of all polynomials then use this * function, rather than using any of the compute_value(), compute_grad() or * compute_grad_grad() functions, see below, in a loop over all polynomials. */ void evaluate(const Point &unit_point, std::vector &values, std::vector> &grads, std::vector> &grad_grads, std::vector> &third_derivatives, std::vector> &fourth_derivatives) const override; /** * Compute the value of the ith polynomial at unit_point. * * Consider using evaluate() instead. */ double compute_value(const unsigned int i, const Point &p) const override; /** * @copydoc ScalarPolynomialsBase::compute_1st_derivative() */ virtual Tensor<1, dim> compute_1st_derivative(const unsigned int i, const Point &p) const override; /** * @copydoc ScalarPolynomialsBase::compute_2nd_derivative() */ virtual Tensor<2, dim> compute_2nd_derivative(const unsigned int i, const Point &p) const override; /** * @copydoc ScalarPolynomialsBase::compute_3rd_derivative() */ virtual Tensor<3, dim> compute_3rd_derivative(const unsigned int i, const Point &p) const override; /** * @copydoc ScalarPolynomialsBase::compute_4th_derivative() */ virtual Tensor<4, dim> compute_4th_derivative(const unsigned int i, const Point &p) const override; /** * Compute the gradient of the ith polynomial at * unit_point. * * Consider using evaluate() instead. */ Tensor<1, dim> compute_grad(const unsigned int i, const Point &p) const override; /** * Compute the second derivative (grad_grad) of the ith polynomial * at unit_point. * * Consider using evaluate() instead. */ Tensor<2, dim> compute_grad_grad(const unsigned int i, const Point &p) const override; /** * Return the name of the space, which is PolynomialsAdini. */ std::string name() const override; /** * @copydoc ScalarPolynomialsBase::clone() */ virtual std::unique_ptr> clone() const override; private: /** * Store the coefficients of the polynomials in the order * $1,x,y,x^2,y^2,xy,x^3,y^3,xy^2,x^2y,x^3y,xy^3$ */ Table<2, double> coef; /** * Store the coefficients of the x-derivative of the polynomials in the * order $1,x,y,x^2,y^2,xy,x^3,y^3,xy^2,x^2y,x^3y,xy^3$ */ Table<2, double> dx; /** * Store the coefficients of the y-derivative of the polynomials in the * order $1,x,y,x^2,y^2,xy,x^3,y^3,xy^2,x^2y,x^3y,xy^3$ */ Table<2, double> dy; /** * Store the coefficients of the second x-derivative of the polynomials in * the order $1,x,y,x^2,y^2,xy,x^3,y^3,xy^2,x^2y,x^3y,xy^3$ */ Table<2, double> dxx; /** * Store the coefficients of the second y-derivative of the polynomials in * the order $1,x,y,x^2,y^2,xy,x^3,y^3,xy^2,x^2y,x^3y,xy^3$ */ Table<2, double> dyy; /** * Store the coefficients of the second mixed derivative of the polynomials * in the order $1,x,y,x^2,y^2,xy,x^3,y^3,xy^2,x^2y,x^3y,xy^3$ */ Table<2, double> dxy; }; template inline Tensor<1, dim> PolynomialsAdini::compute_1st_derivative(const unsigned int /*i*/, const Point & /*p*/) const { DEAL_II_NOT_IMPLEMENTED(); return {}; } template inline Tensor<2, dim> PolynomialsAdini::compute_2nd_derivative(const unsigned int /*i*/, const Point & /*p*/) const { DEAL_II_NOT_IMPLEMENTED(); return {}; } template inline Tensor<3, dim> PolynomialsAdini::compute_3rd_derivative(const unsigned int /*i*/, const Point & /*p*/) const { DEAL_II_NOT_IMPLEMENTED(); return {}; } template inline Tensor<4, dim> PolynomialsAdini::compute_4th_derivative(const unsigned int /*i*/, const Point & /*p*/) const { DEAL_II_NOT_IMPLEMENTED(); return {}; } template inline std::string PolynomialsAdini::name() const { return "PolynomialsAdini"; } DEAL_II_NAMESPACE_CLOSE #endif