| 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_P0LOCALFINITEELEMENT_HH |
| 6 |
#define DUNE_P0LOCALFINITEELEMENT_HH |
| 7 |
|
| 8 |
#include <dune/geometry/type.hh> |
| 9 |
|
| 10 |
#include <dune/localfunctions/common/localfiniteelementtraits.hh> |
| 11 |
#include "p0/p0localbasis.hh" |
| 12 |
#include "p0/p0localcoefficients.hh" |
| 13 |
#include "p0/p0localinterpolation.hh" |
| 14 |
|
| 15 |
namespace Dune |
| 16 |
{ |
| 17 |
|
| 18 |
/** \brief The local p0 finite element on all types of reference elements |
| 19 |
\tparam D Domain data type |
| 20 |
\tparam R Range data type |
| 21 |
\tparam d Dimension of the reference element |
| 22 |
*/ |
| 23 |
template<class D, class R, int d> |
| 24 |
class P0LocalFiniteElement |
| 25 |
{ |
| 26 |
public: |
| 27 |
/** \todo Please doc me ! |
| 28 |
*/ |
| 29 |
typedef LocalFiniteElementTraits<P0LocalBasis<D,R,d>, P0LocalCoefficients, |
| 30 |
P0LocalInterpolation<P0LocalBasis<D,R,d> > > Traits; |
| 31 |
|
| 32 |
/** \todo Please doc me ! |
| 33 |
*/ |
| 34 |
P0LocalFiniteElement (const GeometryType& type) |
| 35 |
: interpolation(type), gt(type) |
| 36 |
{} |
| 37 |
|
| 38 |
/** \todo Please doc me ! |
| 39 |
*/ |
| 40 |
const typename Traits::LocalBasisType& localBasis () const |
| 41 |
{ |
| 42 |
return basis; |
| 43 |
} |
| 44 |
|
| 45 |
/** \todo Please doc me ! |
| 46 |
*/ |
| 47 |
const typename Traits::LocalCoefficientsType& localCoefficients () const |
| 48 |
{ |
| 49 |
return coefficients; |
| 50 |
} |
| 51 |
|
| 52 |
/** \todo Please doc me ! |
| 53 |
*/ |
| 54 |
const typename Traits::LocalInterpolationType& localInterpolation () const |
| 55 |
{ |
| 56 |
return interpolation; |
| 57 |
} |
| 58 |
|
| 59 |
/** \brief The number of shape functions -- here: 1 */ |
| 60 |
unsigned int size () const |
| 61 |
{ |
| 62 |
return 1; |
| 63 |
} |
| 64 |
|
| 65 |
/** \todo Please doc me ! |
| 66 |
*/ |
| 67 |
GeometryType type () const |
| 68 |
{ |
| 69 |
return gt; |
| 70 |
} |
| 71 |
|
| 72 |
private: |
| 73 |
P0LocalBasis<D,R,d> basis; |
| 74 |
P0LocalCoefficients coefficients; |
| 75 |
P0LocalInterpolation<P0LocalBasis<D,R,d> > interpolation; |
| 76 |
GeometryType gt; |
| 77 |
}; |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
#endif |