dune-fem  2.4.1-rc
discontinuousgalerkin/space.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_SPACE_HH
2 #define DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_SPACE_HH
3 
4 #include <utility>
5 
6 #include <dune/geometry/type.hh>
7 
8 #include <dune/grid/common/gridenums.hh>
9 
17 
18 #include "basisfunctionsets.hh"
19 #include "declaration.hh"
20 #include "generic.hh"
21 #include "interpolation.hh"
22 #include "shapefunctionsets.hh"
23 
24 namespace Dune
25 {
26 
27  namespace Fem
28  {
29 
30  // DiscontinuousGalerkinSpaceTraits
31  // --------------------------------
32 
33  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
35  {
37 
39  typedef GridPart GridPartType;
40 
41  static const int codimension = 0;
42 
45  GridPartType::dimension, 1
47 
50 
53 
55  static const int localBlockSize
57 
58  template <class DiscreteFunction, class Operation = DFCommunicationOperation::Copy >
60  {
61  typedef Operation OperationType;
63  };
64  };
65 
66 
67 
68  // DiscontinuousGalerkinSpace
69  // --------------------------
70 
71  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage = CachingStorage >
73  : public GenericDiscontinuousGalerkinSpace< DiscontinuousGalerkinSpaceTraits< FunctionSpace, GridPart, polOrder, Storage > >
74  {
76 
77  public:
78  using BaseType::basisFunctionSet;
79 
80  static const int polynomialOrder = polOrder;
81 
82  typedef typename BaseType::GridPartType GridPartType;
83  typedef typename BaseType::EntityType EntityType;
84 
85  typedef typename BaseType::BasisFunctionSetsType BasisFunctionSetsType;
86  typedef typename BaseType::BasisFunctionSetType BasisFunctionSetType;
87 
89 
90  explicit DiscontinuousGalerkinSpace ( GridPartType &gridPart,
91  const InterfaceType commInterface = InteriorBorder_All_Interface,
92  const CommunicationDirection commDirection = ForwardCommunication )
93  : BaseType( gridPart, basisFunctionSets( gridPart ), commInterface, commDirection )
94  {}
95 
96  InterpolationType interpolation ( const EntityType &entity ) const
97  {
98  return InterpolationType( basisFunctionSet( entity ) );
99  }
100 
101  private:
102  static BasisFunctionSetsType basisFunctionSets ( const GridPartType &gridPart )
103  {
105  ShapeFunctionSetsType shapeFunctionSets( gridPart );
106  return BasisFunctionSetsType( std::move( shapeFunctionSets ) );
107  }
108  };
109 
110 
111 
112  namespace Capabilities
113  {
114 
115  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
116  struct hasFixedPolynomialOrder< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
117  {
118  static const bool v = true;
119  };
120 
121  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
122  struct hasStaticPolynomialOrder< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
123  {
124  static const bool v = true;
125  static const int order = polOrder;
126  };
127 
128  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
129  struct isContinuous< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
130  {
131  static const bool v = false;
132  };
133 
134  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
135  struct isLocalized< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
136  {
137  static const bool v = true;
138  };
139 
140  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
141  struct isParallel< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
142  {
144  };
145 
146  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
147  struct isAdaptive< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
148  {
149  static const bool v = true;
150  };
151 
152  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
153  struct threadSafe< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
154  {
155  static const bool v = false;
156  };
157 
158  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
159  struct viewThreadSafe< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
160  {
161  static const bool v = true;
162  };
163 
164  template< class FunctionSpace, class GridPart, int polOrder, template< class > class Storage >
165  struct isHierarchic< DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > >
166  {
167  static const bool v = true;
168  };
169 
170  } // namespace Capabilities
171 
172  } // namespace Fem
173 
174 } // namespace Dune
175 
176 #endif // #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_SPACE_HH
Definition: shapefunctionsets.hh:268
Definition: selectcaching.hh:17
BaseType::EntityType EntityType
Definition: discontinuousgalerkin/space.hh:83
VectorSpaceTraits< DomainField, RangeField, dimD, dimR >::RangeFieldType RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspaceinterface.hh:62
Definition: space/discontinuousgalerkin/declaration.hh:15
DefaultCommunicationHandler< DiscreteFunction, Operation > Type
Definition: discontinuousgalerkin/space.hh:62
static const int codimension
Definition: discontinuousgalerkin/space.hh:41
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:64
BaseType::BasisFunctionSetsType BasisFunctionSetsType
Definition: discontinuousgalerkin/space.hh:85
VectorialShapeFunctionSets< ScalarShapeFunctionSetsType, typename FunctionSpaceType::RangeType > ShapeFunctionSetsType
Definition: discontinuousgalerkin/space.hh:49
A vector valued function space.
Definition: functionspace.hh:16
Definition: space/shapefunctionset/orthonormal.hh:42
Default communication handler for discrete functions.
Definition: defaultcommhandler.hh:23
specialize with &#39;true&#39; if implementation supports parallelism (default=false)
Definition: gridpart/common/capabilities.hh:59
Provides orthonormal shape function set.
specialize with true if for a space the basis functions are sorted by the polynomial order...
Definition: space/common/capabilities.hh:128
GridPart GridPartType
Definition: discontinuousgalerkin/space.hh:39
FunctionSpace FunctionSpaceType
Definition: discontinuousgalerkin/space.hh:38
DefaultBasisFunctionSets< GridPartType, ShapeFunctionSetsType > BasisFunctionSetsType
Definition: discontinuousgalerkin/space.hh:51
ShapeFunctionSets ShapeFunctionSetsType
shape function sets type
Definition: discontinuousgalerkin/basisfunctionsets.hh:91
BasisFunctionSetsType::BasisFunctionSetType BasisFunctionSetType
Definition: discontinuousgalerkin/space.hh:52
dimension of range vector space
Definition: functionspaceinterface.hh:47
DiscontinuousGalerkinLocalL2Projection< GridPartType, BasisFunctionSetType > InterpolationType
Definition: discontinuousgalerkin/space.hh:88
mapper allocating one DoF per subentity of a given codimension
Definition: codimensionmapper.hh:28
InterpolationType interpolation(const EntityType &entity) const
Definition: discontinuousgalerkin/space.hh:96
VectorSpaceTraits< DomainField, RangeField, dimD, dimR >::DomainFieldType DomainFieldType
Intrinsic type used for values in the domain field (usually a double)
Definition: functionspaceinterface.hh:59
specialize with true if space is always continuous
Definition: space/common/capabilities.hh:46
specialize with true if space can be used with AdaptiveDiscreteFunction
Definition: space/common/capabilities.hh:89
BaseType::GridPartType GridPartType
Definition: discontinuousgalerkin/space.hh:82
Definition: coordinate.hh:4
specialize with true if space can be used in parallel
Definition: space/common/capabilities.hh:76
Operation OperationType
Definition: discontinuousgalerkin/space.hh:61
generic implementation of a Discontinuous Galerkin space based on a fixed family of basis function se...
Definition: discontinuousgalerkin/generic.hh:33
Definition: discontinuousgalerkin/interpolation.hh:24
static const int localBlockSize
Definition: discontinuousgalerkin/space.hh:56
Definition: discontinuousgalerkin/space.hh:34
void move(ArrayInterface< T > &array, const unsigned int oldOffset, const unsigned int newOffset, const unsigned int length)
Definition: array_inline.hh:38
generate a set of default basis function sets from given set of shape function sets ...
Definition: discontinuousgalerkin/basisfunctionsets.hh:82
DiscontinuousGalerkinSpace(GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: discontinuousgalerkin/space.hh:90
specialize with true if polynomial order does not depend on the grid (part) entity ...
Definition: space/common/capabilities.hh:20
specialize with true if the space implementation is thread safe
Definition: space/common/capabilities.hh:102
specialize with true if polynomial order fixed and compile time static
Definition: space/common/capabilities.hh:33
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition: discontinuousgalerkin/space.hh:86
CodimensionMapper< GridPartType, codimension > BlockMapperType
Definition: discontinuousgalerkin/space.hh:54
Definition: discontinuousgalerkin/space.hh:59
specialize with true if the space implementation is thread safe, while it is not modified ...
Definition: space/common/capabilities.hh:116
Definition: shapefunctionsets.hh:196
Dune::Fem::FunctionSpace< typename FunctionSpace::DomainFieldType, typename FunctionSpace::RangeFieldType, GridPartType::dimension, 1 > ScalarShapeFunctionSpaceType
Definition: discontinuousgalerkin/space.hh:46
DiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > DiscreteFunctionSpaceType
Definition: discontinuousgalerkin/space.hh:36
implementation of a basis function set for given entity
Definition: default.hh:46
SelectCachingShapeFunctionSets< GridPartType, OrthonormalShapeFunctionSet< ScalarShapeFunctionSpaceType, polOrder >, Storage > ScalarShapeFunctionSetsType
Definition: discontinuousgalerkin/space.hh:48