3#include <amdis/Operations.hpp>
4#include <amdis/common/FieldMatVec.hpp>
5#include <amdis/gridfunctions/ComposerGridFunction.hpp>
6#include <amdis/operations/Arithmetic.hpp>
7#include <amdis/operations/FieldMatVec.hpp>
21 REQUIRES(Concepts::AnyGridFunction<Lhs>)>
28 template <
class Lhs,
class Rhs,
29 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
36 template <
class Lhs,
class Rhs,
37 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
44 template <
class Lhs,
class Rhs,
45 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
48 if constexpr(Dune::IsNumber<TYPEOF(lhs)>::value)
50 else if constexpr(Dune::IsNumber<TYPEOF(rhs)>::value)
57 template <
class Lhs,
class Rhs,
58 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
61 if constexpr(Dune::IsNumber<TYPEOF(rhs)>::value)
69 template <
class Lhs,
class Rhs,
70 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
71 auto max(Lhs&& lhs, Rhs&& rhs)
77 template <
class Lhs,
class Rhs,
78 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
79 auto min(Lhs&& lhs, Rhs&& rhs)
85 template <
class Lhs,
class Rhs,
86 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
93 template <
class Lhs,
class Rhs,
94 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
101 template <
class V,
class T,
102 REQUIRES(Concepts::AnyGridFunction<V>)>
103 auto clamp(V&& v, T
const& lo, T
const& hi)
109 REQUIRES(Concepts::AnyGridFunction<T>)>
112 return invokeAtQP([](
auto const& v) {
using std::abs;
return abs(v); }, FWD(value));
117 REQUIRES(Concepts::AnyGridFunction<T>)>
120 return invokeAtQP(Operation::Tanh{}, FWD(value));
125 REQUIRES(Concepts::AnyGridFunction<T>)>
133 REQUIRES(Concepts::AnyGridFunction<T>)>
136 return invokeAtQP(Operation::Sqr{}, FWD(value));
140 template <
int p,
class T,
141 REQUIRES(Concepts::AnyGridFunction<T>)>
144 return invokeAtQP(Operation::Pow<p>{}, FWD(value));
149 REQUIRES(Concepts::AnyGridFunction<T>)>
150 auto pow(T&& value,
double p)
156 template <std::size_t I,
class T,
157 REQUIRES(Concepts::AnyGridFunction<T>)>
165 REQUIRES(Concepts::AnyGridFunction<T>)>
166 auto get(T&& value, std::size_t i)
192 REQUIRES(Concepts::AnyGridFunction<Vec>)>
195 return invokeAtQP([](
auto const& v) {
return sum(v); }, FWD(vec));
200 REQUIRES(Concepts::AnyGridFunction<Vec>)>
208 REQUIRES(Concepts::AnyGridFunction<Vec>)>
211 return invokeAtQP([](
auto const& v) {
return one_norm(v); }, FWD(vec));
216 REQUIRES(Concepts::AnyGridFunction<Vec>)>
223 template <
int p,
class Vec,
224 REQUIRES(Concepts::AnyGridFunction<Vec>)>
227 return invokeAtQP([](
auto const& v) {
return p_norm<p>(v); }, FWD(vec));
232 REQUIRES(Concepts::AnyGridFunction<Vec>)>
235 return invokeAtQP([](
auto const& v) {
return infty_norm(v); }, FWD(vec));
240 REQUIRES(Concepts::AnyGridFunction<Mat>)>
253 template <
class Lhs,
class Rhs,
254 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
255 auto dot(Lhs&& lhs, Rhs&& rhs)
262 template <
class Lhs,
class Rhs,
263 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
266 using namespace Operation;
267 return invokeAtQP(compose(TwoNorm{}, Minus{}),
272 template <
class Lhs,
class Rhs,
273 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
276 return invokeAtQP([](
auto const& v,
auto const& w) {
return outer(v,w); },
281 template <
class Lhs,
class Rhs,
282 REQUIRES(Concepts::AnyGridFunction<Lhs,Rhs>)>
285 return invokeAtQP([](
auto const& v,
auto const& w) {
return Dune::cross(v,w); },
auto pow(T &&value, double p)
Applies Operation::Power to GridFunction.
Definition: Operations.hpp:150
auto one_norm(Vec &&vec)
Applies a one_norm() functor to a vector-valued GridFunction.
Definition: Operations.hpp:209
auto trans(Mat &&mat)
Applies Operation::Trans to a matrix-valued GridFunction.
Definition: Operations.hpp:241
auto sum(Vec &&vec)
Applies a sum() functor to a vector-valued GridFunction.
Definition: Operations.hpp:193
auto cross(Lhs &&lhs, Rhs &&rhs)
Applies a cross() functor to two vector-valued GridFunctions.
Definition: Operations.hpp:283
auto signum(T &&value)
Applies Operation::Signum to GridFunctions.
Definition: Operations.hpp:126
auto abs_max(Lhs &&lhs, Rhs &&rhs)
Applies Operation::AbsMax to GridFunctions.
Definition: Operations.hpp:87
auto two_norm(Vec &&vec)
Applies Operation::TwoNorm to a vector-valued GridFunction.
Definition: Operations.hpp:217
auto dot(Lhs &&lhs, Rhs &&rhs)
Applies Operation::Dot to two vector-valued GridFunctions.
Definition: Operations.hpp:255
auto get(T &&value, std::size_t i)
Applies Operation::Get_ to GridFunction.
Definition: Operations.hpp:166
auto abs_min(Lhs &&lhs, Rhs &&rhs)
Applies Operation::AbsMin to GridFunctions.
Definition: Operations.hpp:95
auto distance(Lhs &&lhs, Rhs &&rhs)
Applies a distance-functor to two vector-valued GridFunctions.
Definition: Operations.hpp:264
auto tanh(T &&value)
Applies Operation::Tanh to GridFunctions.
Definition: Operations.hpp:118
auto pow(T &&value)
Applies Operation::Pow.
Definition: Operations.hpp:142
auto operator-(Lhs &&lhs, Rhs &&rhs)
Applies Operation::Minus to GridFunctions.
Definition: Operations.hpp:38
auto reference(T &value)
Return a reference-wrapper as GridFunction.
Definition: Operations.hpp:180
auto clamp(V &&v, T const &lo, T const &hi)
Applies Operation::Clamp to GridFunction.
Definition: Operations.hpp:103
auto operator+(Lhs &&lhs, Rhs &&rhs)
Applies Operation::Plus to GridFunctions.
Definition: Operations.hpp:30
auto min(Lhs &&lhs, Rhs &&rhs)
Applies Operation::Min to GridFunctions.
Definition: Operations.hpp:79
auto unary_dot(Vec &&vec)
Applies Operation::UnaryDot to a vector-valued GridFunction.
Definition: Operations.hpp:201
auto get(T &&value)
Applies Operation::Get<I> to GridFunction.
Definition: Operations.hpp:158
auto outer(Lhs &&lhs, Rhs &&rhs)
Applies an outer() functor to two vector-valued GridFunctions.
Definition: Operations.hpp:274
auto infty_norm(Vec &&vec)
Applies a infty_norm() functor to a vector-valued GridFunction.
Definition: Operations.hpp:233
auto max(Lhs &&lhs, Rhs &&rhs)
Applies Operation::Max to GridFunctions.
Definition: Operations.hpp:71
auto operator-(Lhs &&lhs)
Applies Operation::Negate to GridFunctions.
Definition: Operations.hpp:22
auto operator/(Lhs &&lhs, Rhs &&rhs)
Applies Operation::Divides to GridFunctions.
Definition: Operations.hpp:59
auto constant(T const &value)
Return a reference-wrapper as GridFunction.
Definition: Operations.hpp:173
auto p_norm(Vec &&vec)
Applies a p_norm() functor to a vector-valued GridFunction.
Definition: Operations.hpp:225
auto sqr(T &&value)
Applies Operation::Sqr to GridFunction.
Definition: Operations.hpp:134
auto operator*(Lhs &&lhs, Rhs &&rhs)
Applies Operation::Multiplies to GridFunctions.
Definition: Operations.hpp:46
Operation that represents max(|A|,|B|)
Definition: MaxMin.hpp:33
Operation that represents min(|A|,|B|)
Definition: MaxMin.hpp:46
Definition: CMath.hpp:111
Functor representing a constant value.
Definition: Basic.hpp:88
Functor that represents A/B.
Definition: Arithmetic.hpp:188
(Binary-)Functor representing the euclidean dot-product
Definition: FieldMatVec.hpp:19
Definition: Basic.hpp:203
Definition: Basic.hpp:189
Operation that represents max(A,B)
Definition: MaxMin.hpp:9
Operation that represents min(A,B)
Definition: MaxMin.hpp:21
Functor that represents A-B.
Definition: Arithmetic.hpp:62
Functor that represents A*B.
Definition: Arithmetic.hpp:101
Functor that represents A-B.
Definition: Arithmetic.hpp:209
Functor that represents A+B.
Definition: Arithmetic.hpp:20
Functor that represents x^p,.
Definition: Arithmetic.hpp:322
Functor representing a constant value.
Definition: Basic.hpp:120
Functor that represents f*A.
Definition: Arithmetic.hpp:148
Functor that represents the signum function.
Definition: CMath.hpp:48
Definition: FieldMatVec.hpp:86
(Unary-)Functor representing the euclidean 2-norm
Definition: FieldMatVec.hpp:70
(Unary-)Functor representing the euclidean dot-product
Definition: FieldMatVec.hpp:46