// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- // vi: set et ts=4 sw=2 sts=2: // SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception #ifndef DUNE_REFINED_P0_LOCALFINITEELEMENT_HH #define DUNE_REFINED_P0_LOCALFINITEELEMENT_HH #include #include #include #include "refinedp0/refinedp0localbasis.hh" #include "refinedp0/refinedp0localcoefficients.hh" #include "refinedp0/refinedp0localinterpolation.hh" /** \file \brief Piecewise P0 finite element */ namespace Dune { /** \brief Local finite element that is piecewise P0 on a once uniformly refined reference geometry * * \ingroup LocalFunctions */ template class RefinedP0LocalFiniteElement { RefinedP0LocalFiniteElement() {} public: // We steal the p0 traits since they exist for all dim. // This allows to instantiate the type and access the Traits. typedef typename P0LocalFiniteElement::Traits Traits; }; /** \brief Local finite element that is piecewise P0 on a once uniformly refined reference geometry * * \ingroup LocalFunctions */ template class RefinedP0LocalFiniteElement { public: /** \todo Please doc me ! */ typedef LocalFiniteElementTraits< RefinedP0LocalBasis, RefinedP0LocalCoefficients<1>, RefinedP0LocalInterpolation > > Traits; /** \todo Please doc me ! */ RefinedP0LocalFiniteElement () {} /** \todo Please doc me ! */ const typename Traits::LocalBasisType& localBasis () const { return basis_; } /** \todo Please doc me ! */ const typename Traits::LocalCoefficientsType& localCoefficients () const { return coefficients_; } /** \todo Please doc me ! */ const typename Traits::LocalInterpolationType& localInterpolation () const { return interpolation_; } /** \brief Number of shape functions in this finite element */ unsigned int size () const { return basis_.size(); } /** \todo Please doc me ! */ static constexpr GeometryType type () { return GeometryTypes::line; } private: RefinedP0LocalBasis basis_; RefinedP0LocalCoefficients<1> coefficients_; RefinedP0LocalInterpolation > interpolation_; }; /** \brief Local finite element that is piecewise P0 on a once uniformly refined reference geometry * * \ingroup LocalFunctions */ template class RefinedP0LocalFiniteElement { public: /** \todo Please doc me ! */ typedef LocalFiniteElementTraits< RefinedP0LocalBasis, RefinedP0LocalCoefficients<2>, RefinedP0LocalInterpolation > > Traits; /** \todo Please doc me ! */ RefinedP0LocalFiniteElement () {} /** \todo Please doc me ! */ const typename Traits::LocalBasisType& localBasis () const { return basis_; } /** \todo Please doc me ! */ const typename Traits::LocalCoefficientsType& localCoefficients () const { return coefficients_; } /** \todo Please doc me ! */ const typename Traits::LocalInterpolationType& localInterpolation () const { return interpolation_; } /** \brief Number of shape functions in this finite element */ unsigned int size () const { return basis_.size(); } /** \todo Please doc me ! */ static constexpr GeometryType type () { return GeometryTypes::triangle; } private: RefinedP0LocalBasis basis_; RefinedP0LocalCoefficients<2> coefficients_; RefinedP0LocalInterpolation > interpolation_; }; /** \brief Local finite element that is piecewise P0 on a once uniformly refined reference geometry * * \ingroup LocalFunctions */ template class RefinedP0LocalFiniteElement { public: /** \todo Please doc me ! */ typedef LocalFiniteElementTraits< RefinedP0LocalBasis, RefinedP0LocalCoefficients<3>, RefinedP0LocalInterpolation > > Traits; /** \todo Please doc me ! */ RefinedP0LocalFiniteElement () {} /** \todo Please doc me ! */ const typename Traits::LocalBasisType& localBasis () const { return basis_; } /** \todo Please doc me ! */ const typename Traits::LocalCoefficientsType& localCoefficients () const { return coefficients_; } /** \todo Please doc me ! */ const typename Traits::LocalInterpolationType& localInterpolation () const { return interpolation_; } /** \brief Number of shape functions in this finite element */ unsigned int size () const { return basis_.size(); } /** \todo Please doc me ! */ static constexpr GeometryType type () { return GeometryTypes::tetrahedron; } private: RefinedP0LocalBasis basis_; RefinedP0LocalCoefficients<3> coefficients_; RefinedP0LocalInterpolation > interpolation_; }; } #endif