// -*- 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_DUAL_P1_LOCALBASIS_HH #define DUNE_DUAL_P1_LOCALBASIS_HH #include #include #include #include namespace Dune { /** * \ingroup DualMortarImpl \brief Dual Lagrange shape functions on the simplex. Defines the linear dual shape functions on the simplex. Note that if the dual functions are chosen to be dual on the faces, the integrated product of a Lagrange \f$\lambda_p\f$ and dual function \f$\theta_q\f$ over faces not containing \f$q\f$ does in general not vanish. \tparam D Type to represent the field in the domain. \tparam R Type to represent the field in the range. \tparam dim The dimension of the simplex \tparam faceDual If set, the basis functions are bi-orthogonal only on faces containing the corresponding vertex. \nosubgrouping */ template class DualP1LocalBasis { public: //! Determines if the basis is only biorthogonal on adjacent faces static const bool faceDual = faceDualT; //! \brief export type traits for function signature typedef LocalBasisTraits,R,1,Dune::FieldVector, Dune::FieldMatrix > Traits; //! \brief number of shape functions unsigned int size () const { return dim+1; } //! \brief Evaluate all shape functions inline void evaluateFunction (const typename Traits::DomainType& in, std::vector& out) const { // evaluate P1 basis functions std::vector p1Values(size()); p1Values[0] = 1.0; for (int i=0; i& out) const { // evaluate P1 jacobians std::vector p1Jacs(size()); for (int i=0; i& order, const typename Traits::DomainType& in, // position std::vector& out) const // return value { auto totalOrder = std::accumulate(order.begin(), order.end(), 0); if (totalOrder == 0) { evaluateFunction(in, out); } else { DUNE_THROW(NotImplemented, "Desired derivative order is not implemented"); } } //! \brief Polynomial order of the shape functions unsigned int order () const { return 1; } }; } #endif