/usr/include/dune/pdelab/finiteelementmap/qkdg.hh is in libdune-pdelab-dev 2.5.0~rc1-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_PDELAB_FINITEELEMENTMAP_QKDG_HH
#define DUNE_PDELAB_FINITEELEMENTMAP_QKDG_HH
#include <dune/pdelab/finiteelement/qkdglagrange.hh>
#include <dune/pdelab/finiteelement/qkdglegendre.hh>
#include <dune/pdelab/finiteelement/qkdglobatto.hh>
#include <dune/pdelab/finiteelementmap/opbfem.hh>
#include <dune/pdelab/finiteelementmap/finiteelementmap.hh>
namespace Dune {
namespace PDELab {
//! Switch between different basis for QkDGLocalFiniteElementMap
enum class QkDGBasisPolynomial { lagrange, legendre, lobatto, l2orthonormal};
#ifndef DOXYGEN
// Class declaration. Use template specialization below.
template<class D, class R, int k, int d, QkDGBasisPolynomial p = QkDGBasisPolynomial::lagrange>
class QkDGLocalFiniteElementMap;
#endif
/** \brief Qk discontinuous Galerkin FiniteElementMap based on
* Lagrange polynomials
*
* \tparam D Type used for coordinates
* \tparam R Type used for shape function values
* \tparam k Order of polynomial basis
* \tparam d Grid dimension
*
* \ingroup FiniteElementMap
*/
template<class D, class R, int k, int d>
class QkDGLocalFiniteElementMap<D,R,k,d,QkDGBasisPolynomial::lagrange>
: public Dune::PDELab::SimpleLocalFiniteElementMap< Dune::QkDGLagrangeLocalFiniteElement<D,R,k,d> >
{
public:
bool fixedSize() const
{
return true;
}
bool hasDOFs(int codim) const
{
return codim == 0;
}
std::size_t size(GeometryType gt) const
{
if (gt == GeometryType(GeometryType::cube,d))
return Dune::QkStuff::QkSize<k,d>::value;
else
return 0;
}
std::size_t maxLocalSize() const
{
return Dune::QkStuff::QkSize<k,d>::value;
}
//! return type of polynomial basis
static constexpr QkDGBasisPolynomial polynomial()
{
return QkDGBasisPolynomial::lagrange;
}
//! return order of polynomial basis
static constexpr std::size_t order()
{
return k;
}
};
/** \brief Qk discontinuous Galerkin FiniteElementMap based on
* Legendre polynomials
*
* \tparam D Type used for coordinates
* \tparam R Type used for shape function values
* \tparam k Order of polynomial basis
* \tparam d Grid dimension
*
* \ingroup FiniteElementMap
*/
template<class D, class R, int k, int d>
class QkDGLocalFiniteElementMap<D,R,k,d,QkDGBasisPolynomial::legendre>
: public Dune::PDELab::SimpleLocalFiniteElementMap< Dune::QkDGLegendreLocalFiniteElement<D,R,k,d> >
{
public:
bool fixedSize() const
{
return true;
}
bool hasDOFs(int codim) const
{
return codim == 0;
}
std::size_t size(GeometryType gt) const
{
if (gt == GeometryType(GeometryType::cube,d))
return Dune::QkStuff::QkSize<k,d>::value;
else
return 0;
}
std::size_t maxLocalSize() const
{
return Dune::LegendreStuff::LegendreSize<k,d>::value;
}
//! return type of polynomial basis
static constexpr QkDGBasisPolynomial polynomial()
{
return QkDGBasisPolynomial::legendre;
}
//! return order of polynomial basis
static constexpr std::size_t order()
{
return k;
}
};
/** \brief Qk discontinuous Galerkin FiniteElementMap based on
* Legendre polynomials at Gauss-Lobatto points
*
* \tparam D Type used for coordinates
* \tparam R Type used for shape function values
* \tparam k Order of polynomial basis
* \tparam d Grid dimension
*
* \ingroup FiniteElementMap
*/
template<class D, class R, int k, int d>
class QkDGLocalFiniteElementMap<D,R,k,d,QkDGBasisPolynomial::lobatto>
: public Dune::PDELab::SimpleLocalFiniteElementMap< Dune::QkDGGLLocalFiniteElement<D,R,k,d> >
{
public:
bool fixedSize() const
{
return true;
}
bool hasDOFs(int codim) const
{
return codim == 0;
}
std::size_t size(GeometryType gt) const
{
if (gt == GeometryType(GeometryType::cube,d))
return Dune::QkStuff::QkSize<k,d>::value;
else
return 0;
}
std::size_t maxLocalSize() const
{
return Dune::QkStuff::QkSize<k,d>::value;
}
//! return type of polynomial basis
static constexpr QkDGBasisPolynomial polynomial()
{
return QkDGBasisPolynomial::lobatto;
}
//! return order of polynomial basis
static constexpr std::size_t order()
{
return k;
}
};
/** \brief Qk discontinuous Galerkin FiniteElementMap based on
* an L2 orthonormal polynomials
*
* If you have gmp the computation field for the l2 orthonormal
* basis polynomials is Dune::GMPField<512>.
*
* \tparam D Type used for coordinates
* \tparam R Type used for shape function values
* \tparam k Order of polynomial basis
* \tparam d Grid dimension
*
* \note Use OPBLocalFiniteElementMap directly if you need more
* customization.
*
* \ingroup FiniteElementMap
*/
template<class D, class R, int k, int d>
class QkDGLocalFiniteElementMap<D,R,k,d,QkDGBasisPolynomial::l2orthonormal>
: public OPBLocalFiniteElementMap<D,R,k,d,Dune::GeometryType::cube,
#if HAVE_GMP
Dune::GMPField<512>,
#else
R,
#endif
Dune::PB::BasisType::Qk>
{
public:
//! return type of polynomial basis
static constexpr QkDGBasisPolynomial polynomial()
{
return QkDGBasisPolynomial::l2orthonormal;
}
//! return order of polynomial basis
static constexpr std::size_t order()
{
return k;
}
};
}
}
#endif // DUNE_PDELAB_FINITEELEMENTMAP_QKDG_HH
|