1#ifndef DUNE_FEM_SPACE_FINITEVOLUME_SPACE_HH
2#define DUNE_FEM_SPACE_FINITEVOLUME_SPACE_HH
4#include <dune/grid/common/gridenums.hh>
6#include <dune/fem/common/hybrid.hh>
7#include <dune/fem/function/localfunction/average.hh>
8#include <dune/fem/gridpart/common/capabilities.hh>
9#include <dune/fem/space/common/capabilities.hh>
10#include <dune/fem/space/common/commoperations.hh>
11#include <dune/fem/space/common/defaultcommhandler.hh>
12#include <dune/fem/space/common/localrestrictprolong.hh>
13#include <dune/fem/space/discontinuousgalerkin/generic.hh>
14#include <dune/fem/space/mapper/codimensionmapper.hh>
15#include <dune/fem/space/shapefunctionset/selectcaching.hh>
17#include "basisfunctionsets.hh"
18#include "declaration.hh"
19#include "interpolation.hh"
30 template<
class FunctionSpace,
class Gr
idPart,
int codim,
class Storage >
31 struct FiniteVolumeSpaceTraits
33 typedef FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > DiscreteFunctionSpaceType;
35 typedef GridPart GridPartType;
38 static const int codimension = codim;
40 typedef typename GridPartType::template Codim< codimension >::EntityType EntityType;
41 typedef FiniteVolumeBasisFunctionSets< EntityType, typename FunctionSpaceType::RangeType > BasisFunctionSetsType;
42 typedef typename BasisFunctionSetsType::BasisFunctionSetType BasisFunctionSetType;
44 typedef CodimensionMapper< GridPartType, codimension > BlockMapperType;
45 typedef Hybrid::IndexRange< int, FunctionSpaceType::dimRange > LocalBlockIndices;
47 template <
class DiscreteFunction,
class Operation = DFCommunicationOperation::Copy >
50 typedef Operation OperationType;
51 typedef DefaultCommunicationHandler< DiscreteFunction, Operation > Type;
60 template<
class FunctionSpace,
class Gr
idPart,
int codim = 0,
class Storage = SimpleStorage >
61 class FiniteVolumeSpace
62 :
public GenericDiscontinuousGalerkinSpace< FiniteVolumeSpaceTraits< FunctionSpace, GridPart, codim, Storage > >
64 typedef FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > ThisType;
65 typedef GenericDiscontinuousGalerkinSpace< FiniteVolumeSpaceTraits< FunctionSpace, GridPart, codim, Storage > > BaseType;
69 static const int polynomialOrder = 0;
82 typedef FiniteVolumeLocalInterpolation< GridPart, typename BasisFunctionSetType::RangeType > InterpolationType;
83 typedef InterpolationType LocalInterpolationType;
84 typedef LocalInterpolationType InterpolationImplType;
86 explicit FiniteVolumeSpace ( GridPartType &gridPart,
89 : BaseType( gridPart, BasisFunctionSetsType(), commInterface, commDirection )
96 InterpolationType interpolation ()
const
98 return InterpolationType();
102 static InterpolationType interpolation (
const EntityType &entity )
104 return InterpolationType();
107 LocalInterpolationType localInterpolation (
const EntityType &entity )
const
109 return LocalInterpolationType(entity);
113 void extendSize(
const size_t extension ) { this->
blockMapper().extendSize( extension ); }
118 template <
class FunctionSpaceImp,
class GridPartImp,
int polOrd,
119 class BaseFunctionStorageImp,
120 class VolumeQuadratureImp>
122 FiniteVolumeSpace< FunctionSpaceImp, GridPartImp, polOrd, BaseFunctionStorageImp >,
123 VolumeQuadratureImp >
125 FiniteVolumeSpace< FunctionSpaceImp, GridPartImp, polOrd, BaseFunctionStorageImp >, VolumeQuadratureImp, false >
127 typedef FiniteVolumeSpace< FunctionSpaceImp, GridPartImp, polOrd, BaseFunctionStorageImp > DiscreteFunctionSpaceImp;
140 template<
class FunctionSpace,
class Gr
idPart,
int codim,
class Storage >
141 class DefaultLocalRestrictProlong< FiniteVolumeSpace<
FunctionSpace, GridPart, codim, Storage > >
142 :
public ConstantLocalRestrictProlong< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
145 DefaultLocalRestrictProlong (
const FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > & )
151 namespace Capabilities
154 template<
class FunctionSpace,
class Gr
idPart,
int codim,
class Storage >
155 struct hasFixedPolynomialOrder< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
157 static const bool v =
true;
160 template<
class FunctionSpace,
class Gr
idPart,
int codim,
class Storage >
161 struct hasStaticPolynomialOrder< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
163 static const bool v =
true;
164 static const int order = 0;
167 template<
class FunctionSpace,
class Gr
idPart,
int codim,
class Storage >
168 struct isContinuous< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
170 static const bool v =
false;
173 template<
class FunctionSpace,
class Gr
idPart,
int codim,
class Storage >
174 struct isHierarchic< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
176 static const bool v =
true;
179 template<
class FunctionSpace,
class Gr
idPart,
int codim,
class Storage >
180 struct isLocalized< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
182 static const bool v =
false;
185 template<
class FunctionSpace,
class Gr
idPart,
int codim,
class Storage >
186 struct isAdaptive< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
188 static const bool v =
true;
191 template<
class FunctionSpace,
class Gr
idPart,
int codim,
class Storage >
192 struct threadSafe< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
194 static const bool v =
false;
197 template<
class FunctionSpace,
class Gr
idPart,
int codim,
class Storage >
198 struct viewThreadSafe< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
200 static const bool v =
true;
DFSpaceIdentifier type() const
return type identifier of discrete function space
Definition: discretefunctionspace.hh:294
A vector valued function space.
Definition: functionspace.hh:60
BaseType::GridPartType GridPartType
type of underlying grid part
Definition: generic.hh:40
BlockMapperType & blockMapper() const
get a reference to the block mapper
Definition: generic.hh:124
BaseType::EntityType EntityType
type of entity of codimension 0
Definition: generic.hh:42
BaseType::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition: generic.hh:49
Traits::BasisFunctionSetsType BasisFunctionSetsType
basis function sets
Definition: generic.hh:47
DG Local Mass Matrix for arbitrary spaces.
Definition: localmassmatrix.hh:987
Local Mass Matrix for arbitrary spaces.
Definition: localmassmatrix.hh:967
DFSpaceIdentifier
enumerator for identification of spaces
Definition: discretefunctionspace.hh:95
@ FiniteVolumeSpace_id
id for Finite Volume Space
Definition: discretefunctionspace.hh:99
Dune namespace.
Definition: alignedallocator.hh:13