DUNE PDELab (2.7)

quadraturerules.hh
1#ifndef DUNE_PDELAB_COMMON_QUADRATURERULES_HH
2#define DUNE_PDELAB_COMMON_QUADRATURERULES_HH
3
5
6namespace Dune {
7 namespace PDELab {
8
10
25 template<typename QR>
27 {
28
29 public:
30
32 using CoordType = typename QR::CoordType;
33
35 using size_type = typename QR::size_type;
36
38 using const_iterator = typename QR::const_iterator;
39
42
44 int order() const
45 {
46 return _quadrature_rule->order();
47 }
48
51 {
52 return _quadrature_rule->type();
53 }
54
57 {
58 return _quadrature_rule->size();
59 }
60
63 {
64 return _quadrature_rule->begin();
65 }
66
69 {
70 return _quadrature_rule->end();
71 }
72
73#ifndef DOXYGEN
74
75 QuadratureRuleWrapper(const QR& quadrature_rule)
76 : _quadrature_rule(&quadrature_rule)
77 {}
78
79#endif
80
81 private:
82
83 const QR* _quadrature_rule;
84
85 };
86
88
110 template<typename Geometry>
111 QuadratureRuleWrapper<
112 QuadratureRule<
113 typename Geometry::ctype,
115 >
116 >
117 quadratureRule(const Geometry& geo, std::size_t order, QuadratureType::Enum quadrature_type = QuadratureType::GaussLegendre)
118 {
119 return { QuadratureRules<typename Geometry::ctype,Geometry::mydimension>::rule(geo.type(),order,quadrature_type) };
120 }
121
122 } // namespace PDELab
123
124 // inject the function into the Dune namespace to enable ADL.
125 // TODO: Remove this injection once the core modules gain their own version of this function!
126 using Dune::PDELab::quadratureRule;
127
128} // namespace Dune
129
130#endif // DUNE_PDELAB_COMMON_QUADRATURERULES_HH
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:280
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: geometry.hh:95
@ mydimension
Definition: geometry.hh:90
Wrapper for Dune::QuadratureRule with value semantics.
Definition: quadraturerules.hh:27
typename QR::const_iterator const_iterator
A const iterator over the quadrature points.
Definition: quadraturerules.hh:38
typename QR::CoordType CoordType
The coordinate type of the local coordinates of the rule.
Definition: quadraturerules.hh:32
GeometryType type() const
Returns the geometry type that this rule is valid for.
Definition: quadraturerules.hh:50
typename QR::size_type size_type
The size type used by the container.
Definition: quadraturerules.hh:35
size_type size() const
Returns the number of quadrature points.
Definition: quadraturerules.hh:56
const_iterator end() const
Returns an iterator pointing after the last quadrature point.
Definition: quadraturerules.hh:68
const_iterator begin() const
Returns an iterator pointing to the first quadrature point.
Definition: quadraturerules.hh:62
int order() const
Returns the maximum polynomial order up to which this rule is exact.
Definition: quadraturerules.hh:44
const_iterator iterator
An iterator over the quadrature points (always const, as the container is read-only).
Definition: quadraturerules.hh:41
static const QuadratureRule & rule(const GeometryType &t, int p, QuadratureType::Enum qt=QuadratureType::GaussLegendre)
select the appropriate QuadratureRule for GeometryType t and order p
Definition: quadraturerules.hh:254
Enum
Definition: quadraturerules.hh:80
@ GaussLegendre
Gauss-Legendre rules (default)
Definition: quadraturerules.hh:88
Dune namespace.
Definition: alignedallocator.hh:14
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)