1#ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_INTERPOLATION_HH
2#define DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_INTERPOLATION_HH
9#include <dune/fem/quadrature/cachingquadrature.hh>
10#include <dune/fem/quadrature/agglomerationquadrature.hh>
12#include <dune/fem/operator/projection/local/l2projection.hh>
13#include <dune/fem/operator/projection/local/riesz.hh>
24 template<
class GridPart,
class BasisFunctionSet,
25 class Quadrature = CachingQuadrature< GridPart, BasisFunctionSet::EntityType::codimension > >
26 class DiscontinuousGalerkinLocalL2Projection;
28 template<
class GridPart,
class BasisFunctionSet,
29 class Quadrature = CachingQuadrature< GridPart, BasisFunctionSet::EntityType::codimension > >
30 class LocalOrthonormalL2Projection;
37 template<
class Gr
idPart,
class BasisFunctionSet,
class Quadrature >
39 :
public LocalL2Projection< BasisFunctionSet, LocalOrthonormalL2Projection< GridPart, BasisFunctionSet, Quadrature > >
51 typedef GridPart GridPartType;
52 typedef typename GridPartType::GridType GridType;
74 LocalOrthonormalL2Projection (
const ThisType & ) =
default;
76 LocalOrthonormalL2Projection ( ThisType &&other ) =
default;
78 ThisType &operator= (
const ThisType & ) =
default;
80 ThisType &operator= ( ThisType &&other ) =
default;
91 return basisFunctionSet_;
95 template<
class LocalFunction,
class LocalDofVector >
103 typedef ElementQuadrature< GridPartType, EntityType::codimension > ElementQuadratureType;
105 computeL2Projection( entity, quadrature, localFunction, localDofVector );
111 computeL2Projection( entity, quadrature, localFunction, localDofVector );
118 template <
class QuadImpl,
class LocalFunction,
class LocalDofVector >
119 void computeL2Projection(
const EntityType& entity,
120 const QuadImpl& quadrature,
121 const LocalFunction &localFunction, LocalDofVector &localDofVector )
const
124 localDofVector.clear();
126 const int nop = quadrature.nop();
128 values_.resize( nop );
135 for(
auto qp : quadrature )
136 values_[ qp.index() ] *= qp.weight();
143 mutable std::vector< RangeType > values_;
150 template<
class Gr
idPart,
class BasisFunctionSet,
class Quadrature >
151 class DiscontinuousGalerkinLocalL2Projection
152 :
public LocalL2Projection< BasisFunctionSet, DiscontinuousGalerkinLocalL2Projection< GridPart, BasisFunctionSet, Quadrature > >
154 typedef DiscontinuousGalerkinLocalL2Projection< GridPart, BasisFunctionSet, Quadrature > ThisType;
155 typedef LocalL2Projection< BasisFunctionSet, DiscontinuousGalerkinLocalL2Projection< GridPart, BasisFunctionSet, Quadrature > > BaseType;
162 typedef GridPart GridPartType;
163 typedef typename GridPartType::GridType GridType;
166 typedef typename std::conditional< cartesian,
167 OrthonormalLocalRieszProjection< BasisFunctionSetType >,
168 DenseLocalRieszProjection< BasisFunctionSetType, Quadrature >
169 >::type LocalRieszProjectionType;
171 typedef DefaultLocalL2Projection< LocalRieszProjectionType, Quadrature > Implementation;
178 explicit DiscontinuousGalerkinLocalL2Projection (
const BasisFunctionSetType &basisFunctionSet )
179 : impl_( LocalRieszProjectionType( basisFunctionSet ) )
182 explicit DiscontinuousGalerkinLocalL2Projection ( BasisFunctionSetType &&basisFunctionSet )
183 : impl_( LocalRieszProjectionType(
std::forward< BasisFunctionSetType >( basisFunctionSet ) ) )
192 DiscontinuousGalerkinLocalL2Projection (
const ThisType & ) =
default;
194 DiscontinuousGalerkinLocalL2Projection ( ThisType &&other )
195 : impl_(
std::move( other.impl_ ) )
198 ThisType &operator= (
const ThisType & ) =
default;
200 ThisType &operator= ( ThisType &&other )
202 impl_ = std::move( other.impl_ );
213 BasisFunctionSet basisFunctionSet ()
const
215 return impl_.basisFunctionSet();
219 template<
class LocalFunction,
class LocalDofVector >
220 void apply (
const LocalFunction &localFunction, LocalDofVector &localDofVector )
const
222 impl_( localFunction, localDofVector );
230 Implementation impl_;
Wrapper class for entities.
Definition: entity.hh:66
GeometryType type() const
Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.
Definition: entity.hh:146
Interface class for basis function sets.
Definition: basisfunctionset.hh:32
void axpy(const Quadrature &quad, const Vector &values, DofVector &dofs) const
evaluate all basis function and multiply with given values and add to dofs
Entity EntityType
entity type
Definition: basisfunctionset.hh:35
FunctionSpaceType::RangeType RangeType
range type
Definition: basisfunctionset.hh:45
actual interface class for integration point lists
Definition: quadrature.hh:158
interface for local functions
Definition: localfunction.hh:77
void evaluateQuadrature(const QuadratureType &quad, Vectors &... vec) const
evaluate all basisfunctions for all quadrature points and store the results in the result vector
Definition: localfunction.hh:393
const EntityType & entity() const
obtain the entity, this local function lives on
Definition: localfunction.hh:305
int order() const
obtain the order of this local function
Definition: localfunction.hh:293
please doc me
Definition: l2projection.hh:29
BasisFunctionSet BasisFunctionSetType
basis function set type
Definition: l2projection.hh:32
specialization of local L2 projection for orthonormal DG spaces
Definition: interpolation.hh:40
void apply(const LocalFunction &localFunction, LocalDofVector &localDofVector) const
please doc me
Definition: interpolation.hh:96
BasisFunctionSetType::EntityType EntityType
Definition: interpolation.hh:48
BaseType::BasisFunctionSetType BasisFunctionSetType
basis function set type
Definition: interpolation.hh:46
const BasisFunctionSet & basisFunctionSet() const
return basis function set
Definition: interpolation.hh:89
constexpr bool isNone() const
Return true if entity is a singular of any dimension.
Definition: type.hh:355
actual interface class for quadratures
A set of traits classes to store static information about grid implementation.
Dune namespace.
Definition: alignedallocator.hh:13
Specialize with 'true' if the grid is a Cartesian grid. Cartesian grids satisfy the following propert...
Definition: capabilities.hh:48