dune-fem  2.8-git
finitevolume/space.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_FINITEVOLUME_SPACE_HH
2 #define DUNE_FEM_SPACE_FINITEVOLUME_SPACE_HH
3 
4 #include <dune/grid/common/gridenums.hh>
5 
16 
17 #include "basisfunctionsets.hh"
18 #include "declaration.hh"
19 #include "interpolation.hh"
20 
21 namespace Dune
22 {
23 
24  namespace Fem
25  {
26 
27  // FiniteVolumeSpaceTraits
28  // -----------------------
29 
30  template< class FunctionSpace, class GridPart, int codim, class Storage >
32  {
34 
35  typedef GridPart GridPartType;
37 
38  static const int codimension = codim;
39 
40  typedef typename GridPartType::template Codim< codimension >::EntityType EntityType;
43 
46 
47  template <class DiscreteFunction, class Operation = DFCommunicationOperation::Copy >
49  {
50  typedef Operation OperationType;
52  };
53  };
54 
55 
56 
57  // FiniteVolumeSpace
58  // -----------------
59 
60  template< class FunctionSpace, class GridPart, int codim = 0, class Storage = SimpleStorage >
62  : public GenericDiscontinuousGalerkinSpace< FiniteVolumeSpaceTraits< FunctionSpace, GridPart, codim, Storage > >
63  {
66 
67  public:
69  static const int polynomialOrder = 0;
70 
74  typedef typename BaseType::EntityType EntityType;
75 
80 
83 
85  const InterfaceType commInterface = InteriorBorder_All_Interface,
86  const CommunicationDirection commDirection = ForwardCommunication )
87  : BaseType( gridPart, BasisFunctionSetsType(), commInterface, commDirection )
88  {}
89 
92 
95  {
96  return InterpolationType();
97  }
98 
100  static InterpolationType interpolation ( const EntityType &entity )
101  {
102  return InterpolationType();
103  }
104 
106  void extendSize( const size_t extension ) { this->blockMapper().extendSize( extension ); }
107  };
108 
109 
111  template <class FunctionSpaceImp, class GridPartImp, int polOrd,
112  class BaseFunctionStorageImp,
113  class VolumeQuadratureImp>
115  FiniteVolumeSpace< FunctionSpaceImp, GridPartImp, polOrd, BaseFunctionStorageImp >,
116  VolumeQuadratureImp >
118  FiniteVolumeSpace< FunctionSpaceImp, GridPartImp, polOrd, BaseFunctionStorageImp >, VolumeQuadratureImp >
119  {
122  public:
123  using BaseType :: BaseType;
124  };
125 
126 
127 
128 
129 
130  // DefaultLocalRestrictProlong for FiniteVolumeSpace
131  // -------------------------------------------------
132 
133  template< class FunctionSpace, class GridPart, int codim, class Storage >
134  class DefaultLocalRestrictProlong< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
135  : public ConstantLocalRestrictProlong< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
136  {
137  public:
139  {}
140  };
141 
142 
143 
144  namespace Capabilities
145  {
146 
147  template< class FunctionSpace, class GridPart, int codim, class Storage >
148  struct hasFixedPolynomialOrder< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
149  {
150  static const bool v = true;
151  };
152 
153  template< class FunctionSpace, class GridPart, int codim, class Storage >
154  struct hasStaticPolynomialOrder< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
155  {
156  static const bool v = true;
157  static const int order = 0;
158  };
159 
160  template< class FunctionSpace, class GridPart, int codim, class Storage >
161  struct isContinuous< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
162  {
163  static const bool v = false;
164  };
165 
166  template< class FunctionSpace, class GridPart, int codim, class Storage >
167  struct isHierarchic< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
168  {
169  static const bool v = true;
170  };
171 
172  template< class FunctionSpace, class GridPart, int codim, class Storage >
173  struct isLocalized< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
174  {
175  static const bool v = false; // there is no method 'shapeFunctionSet( const EntityType & )'
176  };
177 
178  template< class FunctionSpace, class GridPart, int codim, class Storage >
179  struct isAdaptive< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
180  {
181  static const bool v = true;
182  };
183 
184  template< class FunctionSpace, class GridPart, int codim, class Storage >
185  struct threadSafe< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
186  {
187  static const bool v = false;
188  };
189 
190  template< class FunctionSpace, class GridPart, int codim, class Storage >
191  struct viewThreadSafe< FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > >
192  {
193  static const bool v = true;
194  };
195 
196  } // namespace Capabilities
197 
198  } // namespace Fem
199 
200 } // namespace Dune
201 
202 #endif // #ifndef DUNE_FEM_SPACE_FINITEVOLUME_SPACE_HH
DFSpaceIdentifier
enumerator for identification of spaces
Definition: discretefunctionspace.hh:94
@ FiniteVolumeSpace_id
id for Finite Volume Space
Definition: discretefunctionspace.hh:98
Definition: bindguard.hh:11
typename Impl::GridFunctionSpace< GridPart, T >::Type GridFunctionSpace
Definition: functionspace.hh:317
Definition: hybrid.hh:86
Local Mass Matrix for arbitrary spaces.
Definition: localmassmatrix.hh:909
DG Local Mass Matrix for arbitrary spaces.
Definition: localmassmatrix.hh:929
specialize with true if polynomial order does not depend on the grid (part) entity
Definition: space/common/capabilities.hh:24
static const bool v
Definition: space/common/capabilities.hh:25
specialize with true if polynomial order fixed and compile time static
Definition: space/common/capabilities.hh:37
static const bool v
Definition: space/common/capabilities.hh:38
static const int order
Definition: space/common/capabilities.hh:39
specialize with true if space is always continuous
Definition: space/common/capabilities.hh:50
static const bool v
Definition: space/common/capabilities.hh:51
specialize with true if the space is localized, * i.e., the basis function set is based on a shape fu...
Definition: space/common/capabilities.hh:68
static const bool v
Definition: space/common/capabilities.hh:69
specialize with true if space can be used with AdaptiveDiscreteFunction
Definition: space/common/capabilities.hh:81
static const bool v
Definition: space/common/capabilities.hh:82
specialize with true if the space implementation is thread safe
Definition: space/common/capabilities.hh:94
static const bool v
Definition: space/common/capabilities.hh:95
specialize with true if the space implementation is thread safe, while it is not modified
Definition: space/common/capabilities.hh:108
static const bool v
Definition: space/common/capabilities.hh:109
specialize with true if for a space the basis functions are sorted by the polynomial order,...
Definition: space/common/capabilities.hh:120
static const bool v
Definition: space/common/capabilities.hh:121
Default communication handler for discrete functions.
Definition: defaultcommhandler.hh:29
Traits ::GridPartType GridPartType
type of underlying grid part
Definition: discretefunctionspace.hh:210
GridPartType ::template Codim< Traits::codimension >::EntityType EntityType
type of entity of codimension 0
Definition: discretefunctionspace.hh:223
GridPartType & gridPart() const
Definition: discretefunctionspace.hh:745
A vector valued function space.
Definition: functionspace.hh:60
Definition: common/localrestrictprolong.hh:16
Definition: common/localrestrictprolong.hh:25
generic implementation of a Discontinuous Galerkin space based on a fixed family of basis function se...
Definition: discontinuousgalerkin/generic.hh:31
BaseType::GridPartType GridPartType
type of underlying grid part
Definition: discontinuousgalerkin/generic.hh:40
BaseType::EntityType EntityType
type of entity of codimension 0
Definition: discontinuousgalerkin/generic.hh:42
BaseType::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition: discontinuousgalerkin/generic.hh:49
Traits::BasisFunctionSetsType BasisFunctionSetsType
basis function sets
Definition: discontinuousgalerkin/generic.hh:47
BlockMapperType & blockMapper() const
get a reference to the block mapper
Definition: discontinuousgalerkin/generic.hh:124
Definition: finitevolume/basisfunctionset.hh:26
Definition: finitevolume/basisfunctionsets.hh:17
Definition: finitevolume/space.hh:63
BaseType::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition: finitevolume/space.hh:79
static InterpolationType interpolation(const EntityType &entity)
return local interpolation
Definition: finitevolume/space.hh:100
BaseType::EntityType EntityType
type of entity of codimension 0
Definition: finitevolume/space.hh:74
static DFSpaceIdentifier type()
return type identifier of discrete function space
Definition: finitevolume/space.hh:91
FiniteVolumeSpace(GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: finitevolume/space.hh:84
void extendSize(const size_t extension)
extend size of space beyond what the index set is delivering
Definition: finitevolume/space.hh:106
static const int polynomialOrder
maximum polynomial order of the space, here 0 since basis functions are constant
Definition: finitevolume/space.hh:69
BaseType::BasisFunctionSetsType BasisFunctionSetsType
basis function sets type
Definition: finitevolume/space.hh:77
InterpolationType interpolation() const
return local interpolation
Definition: finitevolume/space.hh:94
BaseType::GridPartType GridPartType
type of underlying grid part
Definition: finitevolume/space.hh:72
FiniteVolumeLocalInterpolation< GridPart, typename BasisFunctionSetType::RangeType > InterpolationType
local interpolation type
Definition: finitevolume/space.hh:82
Definition: finitevolume/interpolation.hh:21
Definition: finitevolume/space.hh:32
FiniteVolumeBasisFunctionSets< EntityType, typename FunctionSpaceType::RangeType > BasisFunctionSetsType
Definition: finitevolume/space.hh:41
GridFunctionSpace< GridPartType, FunctionSpace > FunctionSpaceType
Definition: finitevolume/space.hh:36
Hybrid::IndexRange< int, FunctionSpaceType::dimRange > LocalBlockIndices
Definition: finitevolume/space.hh:45
static const int codimension
Definition: finitevolume/space.hh:38
GridPart GridPartType
Definition: finitevolume/space.hh:35
FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > DiscreteFunctionSpaceType
Definition: finitevolume/space.hh:33
BasisFunctionSetsType::BasisFunctionSetType BasisFunctionSetType
Definition: finitevolume/space.hh:42
CodimensionMapper< GridPartType, codimension > BlockMapperType
Definition: finitevolume/space.hh:44
GridPartType::template Codim< codimension >::EntityType EntityType
Definition: finitevolume/space.hh:40
Definition: finitevolume/space.hh:49
Operation OperationType
Definition: finitevolume/space.hh:50
DefaultCommunicationHandler< DiscreteFunction, Operation > Type
Definition: finitevolume/space.hh:51
DefaultLocalRestrictProlong(const FiniteVolumeSpace< FunctionSpace, GridPart, codim, Storage > &)
Definition: finitevolume/space.hh:138
mapper allocating one DoF per subentity of a given codimension
Definition: codimensionmapper.hh:330