1#ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_SPACE_HH
2#define DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_SPACE_HH
8#include <dune/grid/common/gridenums.hh>
10#include <dune/fem/common/hybrid.hh>
11#include <dune/fem/gridpart/common/capabilities.hh>
12#include <dune/fem/space/common/capabilities.hh>
13#include <dune/fem/space/common/commoperations.hh>
14#include <dune/fem/space/common/defaultcommhandler.hh>
15#include <dune/fem/space/common/functionspace.hh>
16#include <dune/fem/space/shapefunctionset/orthonormal.hh>
17#include <dune/fem/space/shapefunctionset/selectcaching.hh>
19#include "basisfunctionsets.hh"
20#include "declaration.hh"
22#include "localinterpolation.hh"
23#include "interpolation.hh"
24#include "shapefunctionsets.hh"
35 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage >
36 struct DiscontinuousGalerkinSpaceTraits
38 typedef DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > DiscreteFunctionSpaceType;
40 typedef GridPart GridPartType;
43 static const int codimension = 0;
47 GridPartType::dimension, 1
48 > ScalarShapeFunctionSpaceType;
50 struct ScalarShapeFunctionSet
51 :
public Dune::Fem::OrthonormalShapeFunctionSet< ScalarShapeFunctionSpaceType >
53 typedef Dune::Fem::OrthonormalShapeFunctionSet< ScalarShapeFunctionSpaceType > BaseType;
55 static constexpr int numberShapeFunctions =
56 OrthonormalShapeFunctions< ScalarShapeFunctionSpaceType::dimDomain >::size(polOrder);
59 : BaseType( type, polOrder )
61 assert(
size() == BaseType::size() );
65 static constexpr unsigned int size() {
return numberShapeFunctions; }
70 typedef SelectCachingShapeFunctionSets< GridPartType, ScalarShapeFunctionSet, Storage > ScalarShapeFunctionSetsType;
71 typedef VectorialShapeFunctionSets< ScalarShapeFunctionSetsType, typename FunctionSpaceType::RangeType > ShapeFunctionSetsType;
73 typedef DefaultBasisFunctionSets< GridPartType, ShapeFunctionSetsType > BasisFunctionSetsType;
76 typedef CodimensionMapper< GridPartType, codimension > BlockMapperType;
78 typedef Hybrid::IndexRange< int, FunctionSpaceType::dimRange * ScalarShapeFunctionSet::numberShapeFunctions > LocalBlockIndices;
80 template <
class DiscreteFunction,
class Operation = DFCommunicationOperation::Copy >
83 typedef Operation OperationType;
84 typedef DefaultCommunicationHandler< DiscreteFunction, Operation > Type;
93 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage = CachingStorage >
94 class DiscontinuousGalerkinSpace
95 :
public GenericDiscontinuousGalerkinSpace< DiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, polOrder, Storage > >
97 typedef GenericDiscontinuousGalerkinSpace< DiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, polOrder, Storage > > BaseType;
98 typedef DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > ThisType;
103 static const int polynomialOrder = polOrder;
111 typedef DiscontinuousGalerkinLocalInterpolation< ThisType > InterpolationType;
112 typedef InterpolationType InterpolationImplType;
115 explicit DiscontinuousGalerkinSpace ( GridPartType &gridPart,
118 : BaseType( gridPart, makeBasisFunctionSets( gridPart ), commInterface, commDirection )
121 InterpolationType interpolation ()
const
123 return InterpolationType( *
this );
127 InterpolationType interpolation (
const EntityType &entity )
const
129 return interpolation ();
132 InterpolationType localInterpolation (
const EntityType &entity )
const
134 return interpolation ();
138 static BasisFunctionSetsType makeBasisFunctionSets (
const GridPartType &gridPart )
140 typedef typename BasisFunctionSetsType::ShapeFunctionSetsType ShapeFunctionSetsType;
141 ShapeFunctionSetsType shapeFunctionSets( gridPart );
142 return BasisFunctionSetsType( std::move( shapeFunctionSets ) );
148 namespace Capabilities
151 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage >
152 struct hasFixedPolynomialOrder< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
154 static const bool v =
true;
157 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage >
158 struct hasStaticPolynomialOrder< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
160 static const bool v =
true;
161 static const int order = polOrder;
164 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage >
165 struct isContinuous< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
167 static const bool v =
false;
170 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage >
171 struct isLocalized< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
173 static const bool v =
true;
176 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage >
177 struct isAdaptive< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
179 static const bool v =
true;
182 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage >
183 struct threadSafe< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
185 static const bool v =
false;
188 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage >
189 struct viewThreadSafe< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
191 static const bool v =
true;
194 template<
class FunctionSpace,
class Gr
idPart,
int polOrder,
class Storage >
195 struct isHierarchic< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
197 static const bool v =
true;
Dune::Fem::DefaultBasisFunctionSet< EntityType, ShapeFunctionSetType > BasisFunctionSetType
entity type
Definition: basisfunctionsets.hh:105
FunctionSpaceTraits::DomainFieldType DomainFieldType
Intrinsic type used for values in the domain field (usually a double)
Definition: functionspaceinterface.hh:60
FunctionSpaceTraits::RangeFieldType RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspaceinterface.hh:63
A vector valued function space.
Definition: functionspace.hh:60
BaseType::GridPartType GridPartType
type of underlying grid part
Definition: generic.hh:40
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
BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition: generic.hh:106
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
A unique label for each type of element that can occur in a grid.