// ------------------------------------------------------------------------ // // SPDX-License-Identifier: LGPL-2.1-or-later // Copyright (C) 2021 - 2025 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_pyramid_h #define dealii_polynomials_pyramid_h #include #include #include #include DEAL_II_NAMESPACE_OPEN /** * Polynomials defined on pyramid entities. This class is basis of * FE_PyramidP. */ template class ScalarLagrangePolynomialPyramid : public ScalarPolynomialsBase { public: /** * Make the dimension available to the outside. */ static constexpr unsigned int dimension = dim; /* * Constructor taking the polynomial @p degree as input. * * @note Currently, only linear polynomials (degree=1) are implemented. */ ScalarLagrangePolynomialPyramid(const unsigned int degree); /** * @copydoc ScalarPolynomialsBase::evaluate() * * @note Currently, only the vectors @p values and @p grads are filled. */ 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; double compute_value(const unsigned int i, const Point &p) const override; /** * @copydoc ScalarPolynomialsBase::compute_derivative() * * @note Currently, only implemented for first derivative. */ template Tensor compute_derivative(const unsigned int i, const Point &p) const; Tensor<1, dim> compute_1st_derivative(const unsigned int i, const Point &p) const override; Tensor<2, dim> compute_2nd_derivative(const unsigned int i, const Point &p) const override; /** * @copydoc ScalarPolynomialsBase::compute_3rd_derivative() * * @note Not implemented yet. */ Tensor<3, dim> compute_3rd_derivative(const unsigned int i, const Point &p) const override; /** * @copydoc ScalarPolynomialsBase::compute_4th_derivative() * * @note Not implemented yet. */ Tensor<4, dim> compute_4th_derivative(const unsigned int i, const Point &p) const override; /** * @copydoc ScalarPolynomialsBase::compute_grad() * * @note Not implemented yet. */ Tensor<1, dim> compute_grad(const unsigned int i, const Point &p) const override; /** * @copydoc ScalarPolynomialsBase::compute_grad_grad() * * @note Not implemented yet. */ Tensor<2, dim> compute_grad_grad(const unsigned int i, const Point &p) const override; std::string name() const override; virtual std::unique_ptr> clone() const override; }; template template Tensor ScalarLagrangePolynomialPyramid::compute_derivative( const unsigned int i, const Point &p) const { Tensor der; Assert(order == 1, ExcNotImplemented()); const auto grad = compute_grad(i, p); for (unsigned int i = 0; i < dim; ++i) der[i] = grad[i]; return der; } DEAL_II_NAMESPACE_CLOSE #endif