Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
quadraturehints.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3
4// SPDX-FileCopyrightText: Copyright © DUNE-FUFEM Project contributors, see file AUTHORS.md
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
6
7#ifndef DUNE_FUFEM_FORMS_QUADRATUREHINTS_HH
8#define DUNE_FUFEM_FORMS_QUADRATUREHINTS_HH
9
10#include <type_traits>
11#include <utility>
12
15
17
18
19
21
22
23
36 template<class T>
38
39
40
50 {
51 public:
52
60 : increment_(increment)
61 {}
62
65 {
66 key.setOrder(key.order() + increment_);
67 return key;
68 }
69
70 private:
71 int increment_;
72 };
73
74 template<>
76
77
78
88 {
89 public:
90
96 FixedOrder(int order)
97 : order_(order)
98 {}
99
102 {
103 key.setOrder(order_);
104 return key;
105 }
106
107 private:
108 int order_;
109 };
110
111 template<>
113
114
115
129 template<class T>
131 {
132 public:
133
141 QuadratureHint(T transformation)
142 : transformation_(std::move(transformation))
143 {}
144
146 requires std::is_default_constructible_v<T>
147 : transformation_()
148 {}
149
157 decltype(auto) operator()(QuadratureRuleKey&& key) const
158 {
159 return transformation_(std::move(key));
160 }
161
169 decltype(auto) operator()(const QuadratureRuleKey& key) const
170 {
171 return transformation_(key);
172 }
173
174 private:
175 T transformation_;
176 };
177
178 template<class T>
180
181
182
189
190
191
192} // namespace Dune::Fufem::Forms::QuadratureHints
193
194
195
196#endif // DUNE_FUFEM_FORMS_QUADRATUREHINTS_HH
void increment()
STL namespace.
Definition quadraturehints.hh:20
Traits class to identify QuadratureHints.
Definition quadraturehints.hh:37
A quadrature hint which increases the deduced order.
Definition quadraturehints.hh:50
LiftOrder(int increment)
Create a quadrature hint that lifts the order by the given value.
Definition quadraturehints.hh:59
QuadratureRuleKey operator()(QuadratureRuleKey key) const
Apply transformation to QuadratureRuleKey.
Definition quadraturehints.hh:64
A quadrature hint which fixes a quadrature order.
Definition quadraturehints.hh:88
QuadratureRuleKey operator()(QuadratureRuleKey key) const
Apply transformation to QuadratureRuleKey.
Definition quadraturehints.hh:101
FixedOrder(int order)
Create a quadrature hint which fixes the order to given value.
Definition quadraturehints.hh:96
Wrapper class for a custom quadrature hint.
Definition quadraturehints.hh:131
QuadratureHint()
Definition quadraturehints.hh:145
QuadratureHint(T transformation)
Create QuadratureHint from transformation.
Definition quadraturehints.hh:141
A token that specifies a quadrature rule.
Definition quadraturerulecache.hh:39
int order() const
Definition quadraturerulecache.hh:122
void setOrder(int order)
Definition quadraturerulecache.hh:127