| 1 |
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
| 2 |
// vi: set et ts=4 sw=2 sts=2: |
| 3 |
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root |
| 4 |
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception |
| 5 |
#ifndef DUNE_RAVIARTTHOMAS02DLOCALFINITEELEMENT_HH |
| 6 |
#define DUNE_RAVIARTTHOMAS02DLOCALFINITEELEMENT_HH |
| 7 |
|
| 8 |
#include <dune/geometry/type.hh> |
| 9 |
|
| 10 |
#include <dune/localfunctions/common/localfiniteelementtraits.hh> |
| 11 |
#include "raviartthomas02d/raviartthomas02dlocalbasis.hh" |
| 12 |
#include "raviartthomas02d/raviartthomas02dlocalcoefficients.hh" |
| 13 |
#include "raviartthomas02d/raviartthomas02dlocalinterpolation.hh" |
| 14 |
|
| 15 |
namespace Dune |
| 16 |
{ |
| 17 |
|
| 18 |
/** |
| 19 |
* \brief Zero order Raviart-Thomas shape functions on triangles. |
| 20 |
* |
| 21 |
* \ingroup RaviartThomas |
| 22 |
* |
| 23 |
* \tparam D Type to represent the field in the domain. |
| 24 |
* \tparam R Type to represent the field in the range. |
| 25 |
*/ |
| 26 |
template<class D, class R> |
| 27 |
class |
| 28 |
RT02DLocalFiniteElement |
| 29 |
{ |
| 30 |
public: |
| 31 |
typedef LocalFiniteElementTraits<RT02DLocalBasis<D,R>,RT02DLocalCoefficients, |
| 32 |
RT02DLocalInterpolation<RT02DLocalBasis<D,R> > > Traits; |
| 33 |
|
| 34 |
//! \brief Standard constructor |
| 35 |
RT02DLocalFiniteElement () |
| 36 |
{} |
| 37 |
|
| 38 |
/** |
| 39 |
* \brief Constructor with explicitly given edge orientations |
| 40 |
* |
| 41 |
* \param s Edge orientation indicator |
| 42 |
*/ |
| 43 |
RT02DLocalFiniteElement (std::bitset<3> s) : |
| 44 |
basis(s), |
| 45 |
interpolation(s) |
| 46 |
{} |
| 47 |
|
| 48 |
const typename Traits::LocalBasisType& localBasis () const |
| 49 |
{ |
| 50 |
return basis; |
| 51 |
} |
| 52 |
|
| 53 |
const typename Traits::LocalCoefficientsType& localCoefficients () const |
| 54 |
{ |
| 55 |
return coefficients; |
| 56 |
} |
| 57 |
|
| 58 |
const typename Traits::LocalInterpolationType& localInterpolation () const |
| 59 |
{ |
| 60 |
return interpolation; |
| 61 |
} |
| 62 |
|
| 63 |
unsigned int size () const |
| 64 |
{ |
| 65 |
return 3; |
| 66 |
} |
| 67 |
|
| 68 |
static constexpr GeometryType type () |
| 69 |
{ |
| 70 |
return GeometryTypes::triangle; |
| 71 |
} |
| 72 |
|
| 73 |
private: |
| 74 |
RT02DLocalBasis<D,R> basis; |
| 75 |
RT02DLocalCoefficients coefficients; |
| 76 |
RT02DLocalInterpolation<RT02DLocalBasis<D,R> > interpolation; |
| 77 |
}; |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
#endif |