1#ifndef DUNE_FEM_OPERATOR_PROJECTION_LOCAL_L2PROJECTION_HH
2#define DUNE_FEM_OPERATOR_PROJECTION_LOCAL_L2PROJECTION_HH
27 template<
class BasisFunctionSet,
class Implementation >
68 return impl().basisFunctionSet();
79 template<
class LocalFunction,
class LocalDofVector >
82 apply( localFunction, localDofVector );
93 template<
class LocalFunction,
class LocalDofVector >
96 CHECK_INTERFACE_IMPLEMENTATION( impl().
apply( localFunction, localDofVector ) );
97 impl().apply( localFunction, localDofVector );
103 const Implementation &impl ()
const
105 return static_cast< const Implementation &
>( *this );
114 template<
class LocalRieszProjection,
class Quadrature >
115 class DefaultLocalL2Projection
116 :
public LocalL2Projection< typename LocalRieszProjection::BasisFunctionSetType, DefaultLocalL2Projection< LocalRieszProjection, Quadrature > >
118 typedef DefaultLocalL2Projection< LocalRieszProjection, Quadrature > ThisType;
119 typedef LocalL2Projection< typename LocalRieszProjection::BasisFunctionSetType, DefaultLocalL2Projection< LocalRieszProjection, Quadrature > > BaseType;
123 typedef LocalRieszProjection LocalRieszProjectionType;
129 typedef typename RangeType::value_type RangeFieldType;
136 template<
class... Args >
137 explicit DefaultLocalL2Projection ( Args &&... args )
138 : rieszProjection_(
std::forward< Args >( args )... )
147 DefaultLocalL2Projection (
const ThisType & ) =
default;
151 DefaultLocalL2Projection ( ThisType &other )
152 : DefaultLocalL2Projection( static_cast< const ThisType & >( other ) )
157 DefaultLocalL2Projection ( ThisType &&other )
158 : rieszProjection_(
std::move( other.rieszProjection_ ) )
161 DefaultLocalL2Projection &operator= (
const ThisType & ) =
default;
163 DefaultLocalL2Projection &operator= ( ThisType &&other )
165 rieszProjection_ = std::move( other.rieszProjection_ );
179 BasisFunctionSetType basisFunctionSet ()
const
181 return rieszProjection_.basisFunctionSet();
185 template<
class LocalFunction,
class LocalDofVector >
186 void apply (
const LocalFunction &localFunction, LocalDofVector &dofs )
const
188 static_assert( std::is_same< RangeType, typename LocalFunction::RangeType >::value,
189 "RangeType and LocalFunction::RangeType have to be the same type" );
191 const BasisFunctionSetType basisFunctionSet = this->basisFunctionSet();
192 const auto geometry = basisFunctionSet.geometry();
194 f_.resize( basisFunctionSet.size() );
195 f_ =
static_cast< RangeFieldType
>( 0 );
197 Quadrature quadrature( geometry.type(), localFunction.order() + basisFunctionSet.order() );
198 const std::size_t nop = quadrature.nop();
199 for( std::size_t qp = 0; qp < nop; ++qp )
202 localFunction.evaluate( quadrature[ qp ], value );
203 value *= quadrature.weight( qp )*geometry.integrationElement( quadrature.point( qp ) );
204 basisFunctionSet.axpy( quadrature[ qp ], value, f_ );
207 rieszProjection_.apply( f_, dofs );
211 LocalRieszProjectionType rieszProjection_;
Provides check for implementation of interface methods when using static polymorphism,...
Interface class for basis function sets.
Definition: basisfunctionset.hh:32
FunctionSpaceType::RangeType RangeType
range type
Definition: basisfunctionset.hh:45
interface for local functions
Definition: localfunction.hh:77
please doc me
Definition: l2projection.hh:29
void operator()(const LocalFunction &localFunction, LocalDofVector &localDofVector) const
please doc me
Definition: l2projection.hh:80
LocalL2Projection(LocalL2Projection &&)
move constructor
Definition: l2projection.hh:49
void apply(const LocalFunction &localFunction, LocalDofVector &localDofVector) const
please doc me
Definition: l2projection.hh:94
BasisFunctionSet basisFunctionSet() const
return basis function set
Definition: l2projection.hh:65
LocalL2Projection(const LocalL2Projection &)=default
copy constructor
BasisFunctionSet BasisFunctionSetType
basis function set type
Definition: l2projection.hh:32
LocalL2Projection & operator=(const LocalL2Projection &)=default
assignment operator
actual interface class for quadratures
This file implements a dense vector with a dynamic size.
Dune namespace.
Definition: alignedallocator.hh:13