// -*- 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_LOCALFUNCTIONS_RAVIARTTHOMAS0_PRISM_LOCALBASIS_HH #define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_PRISM_LOCALBASIS_HH #include #include #include #include "../../common/localbasis.hh" namespace Dune { /** * \brief First order Raviart-Thomas shape functions on the reference prism. * * \tparam D Type to represent the field in the domain. * \tparam R Type to represent the field in the range. * * \ingroup RaviartThomasImpl * \nosubgrouping */ template class RT0PrismLocalBasis { public: typedef LocalBasisTraits,R,3,Dune::FieldVector, Dune::FieldMatrix > Traits; /** * \brief Make set number s, where 0 <= s < 32 * * \param s Edge orientation indicator */ RT0PrismLocalBasis (std::bitset<5> s = 0) { for (size_t i=0; i& out) const { out.resize(5); out[0] = { in[0], -1.0 + in[1], 0.0}; out[1] = { -1.0 + in[0], in[1], 0.0}; out[2] = { in[0], in[1], 0.0}; out[3] = { 0.0, 0.0, -2.0 + 2.0*in[2]}; out[4] = { 0.0, 0.0, 2.0*in[2]}; for (std::size_t i=0; i& out) const { out.resize(5); for (std::size_t 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; } private: std::array sign; }; } #endif // DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_PRISM_LOCALBASIS_HH