dune-fem 2.12-git
Loading...
Searching...
No Matches
elementpointlistbase.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_ELEMENTPOINTLISTBASE_HH
2#define DUNE_FEM_ELEMENTPOINTLISTBASE_HH
3
5
7
9
10namespace Dune
11{
12
13 namespace Fem
14 {
15
17 template< class GridPartImp, int codim, class IntegrationTraits >
18 class ElementPointListBase;
19
20
21 template< class GridPartImp, class IntegrationTraits >
22 class ElementPointListBase< GridPartImp, 0, IntegrationTraits >
23 {
25
26 public:
28 typedef GridPartImp GridPartType;
29
31 enum Side { INSIDE, OUTSIDE };
32
34 static const int codimension = 0;
35
37 typedef typename GridPartType::ctype RealType;
38
40 static const int dimension = GridPartType::dimension;
41
43 typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
44
46 typedef typename IntegrationTraits::IntegrationPointListType IntegrationPointListType;
47
48 typedef typename IntegrationTraits::CoordinateType CoordinateType;
49 typedef typename IntegrationPointListType::CoordinateType LocalCoordinateType;
50
51 //typedef typename IntegrationPointListType :: QuadratureKeyType QuadratureKeyType;
52
58 template <class QuadratureKey>
60 : quad_( geometry, quadKey )
61 {}
62
69 : quad_( ipList )
70 {}
71
73 size_t nop () const
74 {
75 return quadImp().nop();
76 }
77
88 const LocalCoordinateType &localPoint( size_t i ) const
89 {
90 return quadImp().point( i );
91 }
92
95 size_t id () const
96 {
97 return quadImp().id();
98 }
99
102 int order () const
103 {
104 return quadImp().order();
105 }
106
110 {
111 return quadImp().geometryType();
112 }
113
117 {
118 return quadImp().geometryType();
119 }
120
124 {
125 return quadImp().geometryType();
126 }
127
142 {
143 return quadImp().geometry();
144 }
145
147 size_t cachingPoint( const size_t quadraturePoint ) const
148 {
149 return quadraturePoint;
150 }
151
153 size_t localCachingPoint( const size_t quadraturePoint ) const
154 {
155 return quadraturePoint;
156 }
157
159 static constexpr bool twisted () { return false; }
160
162 inline int twistId () const { return 0; }
163
164 int localFaceIndex () const
165 {
166 return 0;
167 }
168
169 inline int nCachingPoints () const { return nop(); }
170 inline int cachingPointStart () const { return 0; }
171
172 protected:
180 {
181 return quad_;
182 }
183
184 protected:
186 };
187
188
189
191 template< class GridPartImp, int codim, class IntegrationTraits >
193 {
195
196 public:
198 typedef GridPartImp GridPartType;
199
201 enum Side { INSIDE, OUTSIDE };
202
204 static const int codimension = codim;
205
207 typedef typename GridPartType::ctype RealType;
208
210 static const int dimension = GridPartType::dimension;
211
213 typedef typename IntegrationTraits::IntegrationPointListType IntegrationPointListType;
214
215 typedef typename IntegrationTraits::CoordinateType CoordinateType;
216 typedef typename IntegrationPointListType::CoordinateType LocalCoordinateType;
217
225 template <class QuadratureKeyType>
227 const GeometryType &faceGeo,
228 const int localFaceIndex,
229 const QuadratureKeyType& quadKey )
230 : quad_( faceGeo, quadKey ),
231 elementGeometry_( elementGeo ),
232 localFaceIndex_( localFaceIndex )
233 {}
234
241 template <class QuadratureKeyType>
243 const int localFaceIndex,
244 const QuadratureKeyType& quadKey )
245 : quad_( getFaceGeometry( elementGeo, localFaceIndex ), quadKey ),
246 elementGeometry_( elementGeo ),
247 localFaceIndex_( localFaceIndex )
248 {}
249
252 size_t nop () const
253 {
254 return quadImp().nop();
255 }
256
267 const LocalCoordinateType &localPoint ( size_t i ) const
268 {
269 return quad_.point( i );
270 }
271
274 size_t id () const
275 {
276 return quadImp().id();
277 }
278
281 int order () const
282 {
283 return quadImp().order();
284 }
285
289 {
290 return quadImp().geo();
291 }
292
307 {
308 return elementGeometry_;
309 }
310
311 size_t cachingPoint( const size_t quadraturePoint ) const
312 {
313 return quadraturePoint;
314 }
315
316 size_t localCachingPoint( const size_t quadraturePoint ) const
317 {
318 return quadraturePoint;
319 }
320
322 static constexpr bool twisted () { return false; }
323
325 inline int twistId () const { return 0; }
326
327 inline int nCachingPoints () const { return nop(); }
328 inline int cachingPointStart () const { return 0; }
329
330 int localFaceIndex () const
331 {
332 return localFaceIndex_;
333 }
334
335 protected:
343 {
344 return quad_;
345 }
346
347 static GeometryType
348 getFaceGeometry ( const GeometryType &elementGeo, const int face )
349 {
350 // for cube and simplex geom types the dim-1 geom type
351 // is also cube or simplex
352
353 static const bool isCube =
356
357 static const bool isSimplex =
360
361 if( isCube || isSimplex )
362 {
363 assert( elementGeo.dim() == dimension );
364 if( isCube )
365 {
366 return Dune::GeometryTypes::cube( dimension-1 );
367 }
368 else
369 {
370 assert( isSimplex );
371 return Dune::GeometryTypes::simplex( dimension-1 );
372 }
373 }
374 else if( elementGeo.isNone() )
375 {
376 // if cell geometry is none and dim is 2 then the
377 // face is a normal edge which is of type cube
378 if( elementGeo.dim() == 2 )
379 {
380 return Dune::GeometryTypes::cube( 1 );
381 }
382 else
383 {
384 return Dune::GeometryTypes::none( elementGeo.dim()-1 );
385 }
386 }
387 else // use reference element to determine type
388 {
389 assert( ! elementGeo.isNone() );
390 typedef Dune::ReferenceElements< RealType, dimension > RefElements;
391 return RefElements::general( elementGeo ).type( face, codimension );
392 }
393 }
394
395 private:
397 GeometryType elementGeometry_;
398 int localFaceIndex_;
399 };
400
401 } // namespace Fem
402
403} // namespace Dune
404
405#endif // #ifndef DUNE_FEM_ELEMENTPOINTLISTBASE_HH
constexpr unsigned int dim() const
constexpr bool isNone() const
specialize with 'true' for if the codimension 0 entity of the grid part has only one possible geometr...
Definition gridpart/common/capabilities.hh:29
Definition pointmapper.hh:19
ElementPointListBase.
Definition elementpointlistbase.hh:193
IntegrationPointListType::CoordinateType LocalCoordinateType
Definition elementpointlistbase.hh:216
Side
inside and outside flags
Definition elementpointlistbase.hh:201
@ OUTSIDE
Definition elementpointlistbase.hh:201
@ INSIDE
Definition elementpointlistbase.hh:201
static constexpr bool twisted()
convenience implementation for Dune::Fem::CachingInterface
Definition elementpointlistbase.hh:322
IntegrationTraits::CoordinateType CoordinateType
Definition elementpointlistbase.hh:215
size_t localCachingPoint(const size_t quadraturePoint) const
Definition elementpointlistbase.hh:316
GridPartImp GridPartType
type of the grid partition
Definition elementpointlistbase.hh:198
int twistId() const
convenience implementation for Dune::Fem::CachingInterface
Definition elementpointlistbase.hh:325
ElementPointListBase(const GeometryType &elementGeo, const int localFaceIndex, const QuadratureKeyType &quadKey)
constructor
Definition elementpointlistbase.hh:242
const LocalCoordinateType & localPoint(size_t i) const
obtain local coordinates of i-th integration point
Definition elementpointlistbase.hh:267
const IntegrationPointListType & quadImp() const
obtain the actual implementation of the quadrature
Definition elementpointlistbase.hh:342
ElementPointListBase(const GeometryType &elementGeo, const GeometryType &faceGeo, const int localFaceIndex, const QuadratureKeyType &quadKey)
constructor
Definition elementpointlistbase.hh:226
static const int dimension
dimension of the grid
Definition elementpointlistbase.hh:210
size_t cachingPoint(const size_t quadraturePoint) const
Definition elementpointlistbase.hh:311
static GeometryType getFaceGeometry(const GeometryType &elementGeo, const int face)
Definition elementpointlistbase.hh:348
size_t nop() const
obtain the number of integration points
Definition elementpointlistbase.hh:252
int localFaceIndex() const
Definition elementpointlistbase.hh:330
IntegrationTraits::IntegrationPointListType IntegrationPointListType
type of the integration point list
Definition elementpointlistbase.hh:213
GeometryType geometry() const
obtain GeometryType for this integration point list
Definition elementpointlistbase.hh:288
int cachingPointStart() const
Definition elementpointlistbase.hh:328
int nCachingPoints() const
Definition elementpointlistbase.hh:327
static const int codimension
codimension of the element integration point list
Definition elementpointlistbase.hh:204
size_t id() const
obtain the identifier of the integration point list
Definition elementpointlistbase.hh:274
GridPartType::ctype RealType
coordinate type
Definition elementpointlistbase.hh:207
int order() const
obtain order of the integration point list
Definition elementpointlistbase.hh:281
GeometryType elementGeometry() const
obtain GeometryType of the corresponding codim-0 the integration point list belongs to
Definition elementpointlistbase.hh:306
Side
inside and outside flags
Definition elementpointlistbase.hh:31
ElementPointListBase(const IntegrationPointListType &ipList)
constructor
Definition elementpointlistbase.hh:68
GridPartType::ctype RealType
coordinate type
Definition elementpointlistbase.hh:37
int nCachingPoints() const
Definition elementpointlistbase.hh:169
size_t cachingPoint(const size_t quadraturePoint) const
convenience implementation for Dune::Fem::CachingInterface
Definition elementpointlistbase.hh:147
int twistId() const
convenience implementation for Dune::Fem::CachingInterface
Definition elementpointlistbase.hh:162
GeometryType elementGeometry() const
obtain GeometryType of the corresponding codim-0 the integration point list belongs to
Definition elementpointlistbase.hh:141
GeometryType type() const
Definition elementpointlistbase.hh:116
GeometryType geometry() const
Definition elementpointlistbase.hh:109
IntegrationPointListType quad_
Definition elementpointlistbase.hh:185
int order() const
obtain order of the integration point list
Definition elementpointlistbase.hh:102
GridPartType::template Codim< 0 >::EntityType EntityType
type of entity
Definition elementpointlistbase.hh:43
const LocalCoordinateType & localPoint(size_t i) const
obtain local coordinates of i-th integration point
Definition elementpointlistbase.hh:88
ElementPointListBase(const GeometryType &geometry, const QuadratureKey &quadKey)
constructor
Definition elementpointlistbase.hh:59
IntegrationTraits::IntegrationPointListType IntegrationPointListType
type of the integration point list
Definition elementpointlistbase.hh:46
IntegrationPointListType::CoordinateType LocalCoordinateType
Definition elementpointlistbase.hh:49
int localFaceIndex() const
Definition elementpointlistbase.hh:164
size_t id() const
obtain the identifier of the integration point list
Definition elementpointlistbase.hh:95
const IntegrationPointListType & quadImp() const
obtain the actual implementation of the quadrature
Definition elementpointlistbase.hh:179
size_t localCachingPoint(const size_t quadraturePoint) const
convenience implementation for Dune::Fem::CachingInterface
Definition elementpointlistbase.hh:153
GeometryType geometryType() const
Definition elementpointlistbase.hh:123
GridPartImp GridPartType
type of the grid partition
Definition elementpointlistbase.hh:28
int cachingPointStart() const
Definition elementpointlistbase.hh:170
static constexpr bool twisted()
convenience implementation for Dune::Fem::CachingInterface
Definition elementpointlistbase.hh:159
IntegrationTraits::CoordinateType CoordinateType
Definition elementpointlistbase.hh:48
size_t nop() const
obtain the number of integration points
Definition elementpointlistbase.hh:73