DUNE-FEM (unstable)

geometry.hh
1#ifndef DUNE_FEM_QUADRATURE_GEOMETRIC_GEOMETRY_HH
2#define DUNE_FEM_QUADRATURE_GEOMETRIC_GEOMETRY_HH
3
4#include <cstddef>
5
6#include <functional>
7
9
10#include "quadrature.hh"
11
12namespace Dune
13{
14
15 namespace Fem
16 {
17
18 // GeometryQuadrature
19 // ------------------
20
21 template< class QuadratureRule >
22 class GeometryQuadrature
23 : public GeometricQuadrature< typename QuadratureRule::CoordType, QuadratureRule::d, QuadratureRule::d, GeometryQuadrature< QuadratureRule > >
24 {
25 using ThisType = GeometryQuadrature< QuadratureRule >;
26 using BaseType = GeometricQuadrature< typename QuadratureRule::CoordType, QuadratureRule::d, QuadratureRule::d, GeometryQuadrature< QuadratureRule > >;
27
28 public:
30 using QuadratureRuleType = QuadratureRule;
31
33 using FieldType = typename BaseType::FieldType;
34
36 using CoordinateType = typename BaseType::CoordinateType;
38 using LocalCoordinateType = typename BaseType::LocalCoordinateType;
39
44 explicit GeometryQuadrature ( const QuadratureRuleType &quadratureRule )
45 : quadratureRule_( quadratureRule )
46 {}
47
55 GeometryQuadrature ( const ThisType & ) = default;
56
58 GeometryQuadrature ( ThisType && ) = default;
59
61 GeometryQuadrature &operator= ( const ThisType & ) = default;
62
64 GeometryQuadrature &operator= ( ThisType && ) = default;
65
73 Dune::GeometryType type () const { return quadratureRule().type(); }
74
76 int order () const { return quadratureRule().order(); }
77
79 std::size_t nop () const { return quadratureRule().size(); }
80
82 const CoordinateType &point ( std::size_t i ) const
83 {
84 return quadratureRule()[ i ].position();
85 }
86
88 const LocalCoordinateType &localPoint ( std::size_t i ) const
89 {
90 return point( i );
91 }
92
94 FieldType weight ( std::size_t i ) const
95 {
96 return quadratureRule()[ i ].weight();
97 }
98
101 private:
102 const QuadratureRuleType &quadratureRule () const { return quadratureRule_.get(); }
103
104 std::reference_wrapper< const QuadratureRuleType > quadratureRule_;
105 };
106
107 } // namespace Fem
108
109} // namespace Dune
110
111#endif // #ifndef DUNE_FEM_QUADRATURE_GEOMETRIC_GEOMETRY_HH
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
Dune namespace.
Definition: alignedallocator.hh:13
A unique label for each type of element that can occur in a grid.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)