dune-fem  2.4.1-rc
l2projection.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_L2PROJECTION_HH
2 #define DUNE_FEM_L2PROJECTION_HH
3 
9 
10 #include "dgl2projection.hh"
11 
12 namespace Dune
13 {
14 
15  namespace Fem
16  {
17 
24  template < class DType, class RType>
25  class L2Projection : public Operator<DType , RType>
26  {
27  public:
29  typedef DType DomainType;
31  typedef RType RangeType;
32 
37  explicit L2Projection( const int quadOrder = -1,
38  const bool doCommunicate = true )
39  : quadOrder_( quadOrder ), doCommunicate_( doCommunicate )
40  {}
41 
46  virtual void operator() ( const DomainType& function, RangeType& discreteFunction ) const
47  {
48  if( discreteFunction.space().continuous() )
49  DUNE_THROW(NotImplemented,"L2-Projection not implemented for contiuous spaces!");
50  else
51  DGL2ProjectionImpl::project( function, discreteFunction, quadOrder_, doCommunicate_ );
52  }
53 
54  protected:
55  const int quadOrder_; // order of quadrature
56  const bool doCommunicate_ ; // true if communication is applied for the result
57  };
58 
59  } // namespace Fem
60 
61 } // namespace Dune
62 
63 #endif // #ifndef DUNE_FEM_L2PROJECTION_HH
virtual void operator()(const DomainType &function, RangeType &discreteFunction) const
calculates the L2 projection of a function onto the discrete space discreteFunction belongs to...
Definition: l2projection.hh:46
The L2Projection class provides methods for projecting a function unto a given discrete function spac...
Definition: l2projection.hh:25
abstract operator
Definition: operator.hh:25
static void project(const FunctionImp &f, DiscreteFunctionImp &discFunc, const int quadOrd=-1, const bool communicate=true)
Definition: dgl2projection.hh:81
RType RangeType
range function type
Definition: l2projection.hh:31
Definition: coordinate.hh:4
L2Projection(const int quadOrder=-1, const bool doCommunicate=true)
Constructor.
Definition: l2projection.hh:37
DType DomainType
domain function type
Definition: l2projection.hh:29
const int quadOrder_
Definition: l2projection.hh:55
const bool doCommunicate_
Definition: l2projection.hh:56