Dune-Fufem 2.12-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(std::max(key.order() + increment_, 0));
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
158 {
159 return transformation_(std::move(key));
160 }
161
170 {
171 return transformation_(std::move(key));
172 }
173
181 decltype(auto) operator()(const QuadratureRuleKey& key) const
182 {
183 return transformation_(key);
184 }
185
186 private:
187 T transformation_;
188 };
189
190 template<class T>
192
193
194
201
202
203
204} // namespace Dune::Fufem::Forms::QuadratureHints
205
206
207
208#endif // DUNE_FUFEM_FORMS_QUADRATUREHINTS_HH
void increment()
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
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
Wrapper class for a custom quadrature hint.
Definition quadraturehints.hh:131
QuadratureRuleKey operator()(QuadratureRuleKey &&key) const
Apply transformation to QuadratureRuleKey.
Definition quadraturehints.hh:157
QuadratureHint()
Definition quadraturehints.hh:145
QuadratureHint(T transformation)
Create QuadratureHint from transformation.
Definition quadraturehints.hh:141
QuadratureRuleKey operator()(const QuadratureRuleKey &&key) const
Apply transformation to QuadratureRuleKey.
Definition quadraturehints.hh:169
A token that specifies a quadrature rule.
Definition quadraturerulecache.hh:40
int order() const
Definition quadraturerulecache.hh:132
void setOrder(int order)
Definition quadraturerulecache.hh:137
T max(T... args)
Definition quadraturehints.hh:20
STL namespace.
Traits class to identify QuadratureHints.
Definition quadraturehints.hh:37