IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
IpplOperations.h
Go to the documentation of this file.
1//
2// File IpplOperations.h
3// Expression Templates operations.
4//
5#ifndef IPPL_OPERATIONS_H
6#define IPPL_OPERATIONS_H
7
8#include <Kokkos_MathematicalFunctions.hpp>
9#include <tuple>
10
11namespace ippl {
15
21 template <typename View, typename Coords, size_t... Idx>
22 KOKKOS_INLINE_FUNCTION constexpr decltype(auto) apply_impl(const View& view,
23 const Coords& coords,
24 const std::index_sequence<Idx...>&) {
25 return view(coords[Idx]...);
26 }
27
38 template <typename Coords, std::enable_if_t<std::is_array_v<Coords>, int> = 0>
39 KOKKOS_INLINE_FUNCTION constexpr static unsigned getRank() {
40 return std::extent_v<Coords>;
41 }
42
48 template <typename Coords, std::enable_if_t<std::is_class_v<Coords>, int> = 0>
49 KOKKOS_INLINE_FUNCTION constexpr static unsigned getRank() {
50 return Coords::dim;
51 }
52 };
53
63 template <typename View, typename Coords>
64 KOKKOS_INLINE_FUNCTION constexpr decltype(auto) apply(const View& view, const Coords& coords) {
65 using Indices = std::make_index_sequence<ExtractExpressionRank::getRank<Coords>()>;
66 return apply_impl(view, coords, Indices{});
67 }
68
69#define DefineUnaryOperation(fun, name, op1, op2) \
70 template <typename E> \
71 struct fun : public detail::Expression<fun<E>, sizeof(E)> { \
72 constexpr static unsigned dim = E::dim; \
73 using value_type = typename E::value_type; \
74 \
75 KOKKOS_FUNCTION \
76 fun(const E& u) \
77 : u_m(u) {} \
78 \
79 KOKKOS_INLINE_FUNCTION auto operator[](size_t i) const { return op1; } \
80 \
81 template <typename... Args> \
82 KOKKOS_INLINE_FUNCTION auto operator()(Args... args) const { \
83 return op2; \
84 } \
85 \
86 private: \
87 const E u_m; \
88 }; \
89 \
90 template <typename E, size_t N> \
91 KOKKOS_INLINE_FUNCTION fun<E> name(const detail::Expression<E, N>& u) { \
92 return fun<E>(*static_cast<const E*>(&u)); \
93 }
94
96
97 // clang-format off
98 DefineUnaryOperation(UnaryMinus, operator-, -u_m[i], -u_m(args...))
99 DefineUnaryOperation(UnaryPlus, operator+, +u_m[i], +u_m(args...))
100 DefineUnaryOperation(BitwiseNot, operator~, ~u_m[i], ~u_m(args...))
101 DefineUnaryOperation(Not, operator!, !u_m[i], !u_m(args...))
102
103 DefineUnaryOperation(ArcCos, acos, Kokkos::acos(u_m[i]), Kokkos::acos(u_m(args...)))
104 DefineUnaryOperation(ArcSin, asin, Kokkos::asin(u_m[i]), Kokkos::asin(u_m(args...)))
105 DefineUnaryOperation(ArcTan, atan, Kokkos::atan(u_m[i]), Kokkos::atan(u_m(args...)))
106 DefineUnaryOperation(Ceil, ceil, Kokkos::ceil(u_m[i]), Kokkos::ceil(u_m(args...)))
107 DefineUnaryOperation(Cos, cos, Kokkos::cos(u_m[i]), Kokkos::cos(u_m(args...)))
108 DefineUnaryOperation(HypCos, cosh, Kokkos::cosh(u_m[i]), Kokkos::cosh(u_m(args...)))
109 DefineUnaryOperation(Exp, exp, Kokkos::exp(u_m[i]), Kokkos::exp(u_m(args...)))
110 DefineUnaryOperation(Fabs, fabs, Kokkos::fabs(u_m[i]), Kokkos::fabs(u_m(args...)))
111 DefineUnaryOperation(Floor, floor, Kokkos::floor(u_m[i]), Kokkos::floor(u_m(args...)))
112 DefineUnaryOperation(Log, log, Kokkos::log(u_m[i]), Kokkos::log(u_m(args...)))
113 DefineUnaryOperation(Log10, log10, Kokkos::log10(u_m[i]), Kokkos::log10(u_m(args...)))
114 DefineUnaryOperation(Sin, sin, Kokkos::sin(u_m[i]), Kokkos::sin(u_m(args...)))
115 DefineUnaryOperation(HypSin, sinh, Kokkos::sinh(u_m[i]), Kokkos::sinh(u_m(args...)))
116 DefineUnaryOperation(Sqrt, sqrt, Kokkos::sqrt(u_m[i]), Kokkos::sqrt(u_m(args...)))
117 DefineUnaryOperation(Tan, tan, Kokkos::tan(u_m[i]), Kokkos::tan(u_m(args...)))
118 DefineUnaryOperation(HypTan, tanh, Kokkos::tanh(u_m[i]), Kokkos::tanh(u_m(args...)))
119 DefineUnaryOperation(Erf, erf, Kokkos::erf(u_m[i]), Kokkos::erf(u_m(args...)))
120// clang-format on
122
130#define DefineBinaryOperation(fun, name, op1, op2) \
131 template <typename E1, typename E2> \
132 struct fun : public detail::Expression<fun<E1, E2>, sizeof(E1) + sizeof(E2)> { \
133 constexpr static unsigned dim = std::max(E1::dim, E2::dim); \
134 using value_type = typename E1::value_type; \
135 \
136 KOKKOS_FUNCTION \
137 fun(const E1& u, const E2& v) \
138 : u_m(u) \
139 , v_m(v) {} \
140 \
141 KOKKOS_INLINE_FUNCTION auto operator[](size_t i) const { return op1; } \
142 \
143 template <typename... Args> \
144 KOKKOS_INLINE_FUNCTION auto operator()(Args... args) const { \
145 static_assert(sizeof...(Args) == dim || dim == 0); \
146 return op2; \
147 } \
148 \
149 private: \
150 const E1 u_m; \
151 const E2 v_m; \
152 }; \
153 \
154 template <typename E1, size_t N1, typename E2, size_t N2> \
155 KOKKOS_INLINE_FUNCTION fun<E1, E2> name(const detail::Expression<E1, N1>& u, \
156 const detail::Expression<E2, N2>& v) { \
157 return fun<E1, E2>(*static_cast<const E1*>(&u), *static_cast<const E2*>(&v)); \
158 } \
159 \
160 template <typename E, size_t N, typename T, \
161 typename = std::enable_if_t<std::is_scalar<T>::value>> \
162 KOKKOS_INLINE_FUNCTION fun<E, detail::Scalar<T>> name(const detail::Expression<E, N>& u, \
163 const T& v) { \
164 return fun<E, detail::Scalar<T>>(*static_cast<const E*>(&u), v); \
165 } \
166 \
167 template <typename E, size_t N, typename T, \
168 typename = std::enable_if_t<std::is_scalar<T>::value>> \
169 KOKKOS_INLINE_FUNCTION fun<detail::Scalar<T>, E> name(const T& u, \
170 const detail::Expression<E, N>& v) { \
171 return fun<detail::Scalar<T>, E>(u, *static_cast<const E*>(&v)); \
172 }
173
175 // clang-format off
176 DefineBinaryOperation(Add, operator+, u_m[i] + v_m[i], u_m(args...) + v_m(args...))
177 DefineBinaryOperation(Subtract, operator-, u_m[i] - v_m[i], u_m(args...) - v_m(args...))
178 DefineBinaryOperation(Multiply, operator*, u_m[i] * v_m[i], u_m(args...) * v_m(args...))
179 DefineBinaryOperation(Divide, operator/, u_m[i] / v_m[i], u_m(args...) / v_m(args...))
180 DefineBinaryOperation(Mod, operator%, u_m[i] % v_m[i], u_m(args...) % v_m(args...))
181 DefineBinaryOperation(LT, operator<, u_m[i] < v_m[i], u_m(args...) < v_m(args...))
182 DefineBinaryOperation(LE, operator<=, u_m[i] <= v_m[i], u_m(args...) <= v_m(args...))
183 DefineBinaryOperation(GT, operator>, u_m[i] > v_m[i], u_m(args...) > v_m(args...))
184 DefineBinaryOperation(GE, operator>=, u_m[i] >= v_m[i], u_m(args...) >= v_m(args...))
185 DefineBinaryOperation(EQ, operator==, u_m[i] == v_m[i], u_m(args...) == v_m(args...))
186 DefineBinaryOperation(NEQ, operator!=, u_m[i] != v_m[i], u_m(args...) != v_m(args...))
187 DefineBinaryOperation(And, operator&&, u_m[i] && v_m[i], u_m(args...) && v_m(args...))
188 DefineBinaryOperation(Or, operator||, u_m[i] || v_m[i], u_m(args...) || v_m(args...))
189
190 DefineBinaryOperation(BitwiseAnd, operator&, u_m[i] & v_m[i], u_m(args...) & v_m(args...))
191 DefineBinaryOperation(BitwiseOr, operator|, u_m[i] | v_m[i], u_m(args...) | v_m(args...))
192 DefineBinaryOperation(BitwiseXor, operator^, u_m[i] ^ v_m[i], u_m(args...) ^ v_m(args...))
193 // clang-format on
194
195 DefineBinaryOperation(Copysign, copysign, Kokkos::copysign(u_m[i], v_m[i]),
196 Kokkos::copysign(u_m(args...), v_m(args...)))
197 // ldexp not provided by Kokkos
198 DefineBinaryOperation(Ldexp, ldexp, ldexp(u_m[i], v_m[i]), ldexp(u_m(args...), v_m(args...)))
199 DefineBinaryOperation(Fmod, fmod, Kokkos::fmod(u_m[i], v_m[i]),
200 Kokkos::fmod(u_m(args...), v_m(args...)))
201 DefineBinaryOperation(Pow, pow, Kokkos::pow(u_m[i], v_m[i]),
202 Kokkos::pow(u_m(args...), v_m(args...)))
203 DefineBinaryOperation(ArcTan2, atan2, Kokkos::atan2(u_m[i], v_m[i]),
204 Kokkos::atan2(u_m(args...), v_m(args...)))
206
207 namespace detail {
212 template <typename E1, typename E2>
213 struct meta_cross : public detail::Expression<meta_cross<E1, E2>, sizeof(E1) + sizeof(E2)> {
214 constexpr static unsigned dim = E1::dim;
215 static_assert(E1::dim == E2::dim);
216
217 KOKKOS_FUNCTION
218 meta_cross(const E1& u, const E2& v)
219 : u_m(u)
220 , v_m(v) {}
221
222 /*
223 * Vector::cross
224 */
225 KOKKOS_INLINE_FUNCTION auto operator[](size_t i) const {
226 const size_t j = (i + 1) % 3;
227 const size_t k = (i + 2) % 3;
228 return u_m[j] * v_m[k] - u_m[k] * v_m[j];
229 }
230
231 /*
232 * This is required for BareField::cross
233 */
234 template <typename... Args>
235 KOKKOS_INLINE_FUNCTION auto operator()(Args... args) const {
236 return cross(u_m(args...), v_m(args...));
237 }
238
239 private:
240 const E1 u_m;
241 const E2 v_m;
242 };
243 } // namespace detail
244
245 template <typename E1, size_t N1, typename E2, size_t N2>
248 return detail::meta_cross<E1, E2>(*static_cast<const E1*>(&u), *static_cast<const E2*>(&v));
249 }
250
251 namespace detail {
255 template <typename E1, typename E2>
256 struct meta_dot : public Expression<meta_dot<E1, E2>, sizeof(E1) + sizeof(E2)> {
257 constexpr static unsigned dim = E1::dim;
258 static_assert(E1::dim == E2::dim);
259
260 KOKKOS_FUNCTION
261 meta_dot(const E1& u, const E2& v)
262 : u_m(u)
263 , v_m(v) {}
264
265 /*
266 * Vector::dot
267 */
268 KOKKOS_INLINE_FUNCTION auto apply() const {
269 typename E1::value_type res = 0.0;
270 // Equivalent computation in 3D:
271 // u_m[0] * v_m[0] + u_m[1] * v_m[1] + u_m[2] * v_m[2]
272 for (size_t i = 0; i < E1::dim; ++i) {
273 res += u_m[i] * v_m[i];
274 }
275 return res;
276 }
277
278 /*
279 * This is required for BareField::dot
280 */
281 template <typename... Args>
282 KOKKOS_INLINE_FUNCTION auto operator()(Args... args) const {
283 return dot(u_m(args...), v_m(args...)).apply();
284 }
285
286 private:
287 const E1 u_m;
288 const E2 v_m;
289 };
290 } // namespace detail
291
292 template <typename E1, size_t N1, typename E2, size_t N2>
295 return detail::meta_dot<E1, E2>(*static_cast<const E1*>(&u), *static_cast<const E2*>(&v));
296 }
297
298 namespace detail {
302
303 template <typename E>
305 : public Expression<
306 meta_grad<E>,
307 sizeof(E) + sizeof(typename E::Mesh_t::vector_type[E::Mesh_t::Dimension])> {
308 constexpr static unsigned dim = E::dim;
309 using value_type = typename E::value_type;
310
311 KOKKOS_FUNCTION
312 meta_grad(const E& u, const typename E::Mesh_t::vector_type vectors[])
313 : u_m(u) {
314 for (unsigned d = 0; d < E::Mesh_t::Dimension; d++) {
315 vectors_m[d] = vectors[d];
316 }
317 }
318
319 /*
320 * n-dimensional grad
321 */
322 template <typename... Idx>
323 KOKKOS_INLINE_FUNCTION auto operator()(const Idx... args) const {
324 using index_type = std::tuple_element_t<0, std::tuple<Idx...>>;
325
326 /*
327 * Equivalent computation in 3D:
328 * xvector_m * (u_m(i + 1, j, k) - u_m(i - 1, j, k))
329 * + yvector_m * (u_m(i, j + 1, k) - u_m(i, j - 1, k))
330 * + zvector_m * (u_m(i, j, k + 1) - u_m(i, j, k - 1))
331 */
332
333 vector_type res(0);
334 for (unsigned d = 0; d < dim; d++) {
335 index_type coords[dim] = {args...};
336
337 coords[d] += 1;
338 auto&& right = apply(u_m, coords);
339
340 coords[d] -= 2;
341 auto&& left = apply(u_m, coords);
342
343 res += vectors_m[d] * (right - left);
344 }
345 return res;
346 }
347
348 private:
349 using Mesh_t = typename E::Mesh_t;
351 const E u_m;
353 };
354 } // namespace detail
355
356 namespace detail {
357
361 template <typename E>
362 struct meta_div
363 : public Expression<
364 meta_div<E>,
365 sizeof(E) + sizeof(typename E::Mesh_t::vector_type[E::Mesh_t::Dimension])> {
366 constexpr static unsigned dim = E::dim;
367
368 KOKKOS_FUNCTION
369 meta_div(const E& u, const typename E::Mesh_t::vector_type vectors[])
370 : u_m(u) {
371 for (unsigned d = 0; d < E::Mesh_t::Dimension; d++) {
372 vectors_m[d] = vectors[d];
373 }
374 }
375
376 /*
377 * n-dimensional div
378 */
379 template <typename... Idx>
380 KOKKOS_INLINE_FUNCTION auto operator()(const Idx... args) const {
381 using index_type = std::tuple_element_t<0, std::tuple<Idx...>>;
382
383 /*
384 * Equivalent computation in 3D:
385 * dot(xvector_m, (u_m(i + 1, j, k) - u_m(i - 1, j, k))).apply()
386 * + dot(yvector_m, (u_m(i, j + 1, k) - u_m(i, j - 1, k))).apply()
387 * + dot(zvector_m, (u_m(i, j, k + 1) - u_m(i, j, k - 1))).apply()
388 */
389 typename E::Mesh_t::value_type res = 0;
390 for (unsigned d = 0; d < dim; d++) {
391 index_type coords[dim] = {args...};
392
393 coords[d] += 1;
394 auto&& right = apply(u_m, coords);
395
396 coords[d] -= 2;
397 auto&& left = apply(u_m, coords);
398
399 res += dot(vectors_m[d], right - left).apply();
400 }
401 return res;
402 }
403
404 private:
405 using Mesh_t = typename E::Mesh_t;
407 const E u_m;
409 };
410
414 template <typename E>
416 : public Expression<meta_laplace<E>,
417 sizeof(E) + sizeof(typename E::Mesh_t::vector_type)> {
418 constexpr static unsigned dim = E::dim;
419 using value_type = typename E::value_type;
420
421 KOKKOS_FUNCTION
422 meta_laplace(const E& u, const typename E::Mesh_t::vector_type& hvector)
423 : u_m(u)
424 , hvector_m(hvector) {}
425
426 /*
427 * n-dimensional Laplacian
428 */
429 template <typename... Idx>
430 KOKKOS_INLINE_FUNCTION auto operator()(const Idx... args) const {
431 using index_type = std::tuple_element_t<0, std::tuple<Idx...>>;
432 using T = typename E::Mesh_t::value_type;
433
434 /*
435 * Equivalent computation in 3D:
436 * hvector_m[0] * (u_m(i+1, j, k) - 2 * u_m(i, j, k) + u_m(i-1, j, k ))
437 * + hvector_m[1] * (u_m(i , j+1, k) - 2 * u_m(i, j, k) + u_m(i , j-1, k ))
438 * + hvector_m[2] * (u_m(i , j , k+1) - 2 * u_m(i, j, k) + u_m(i , j , k-1))
439 */
440 T res = 0;
441 for (unsigned d = 0; d < dim; d++) {
442 index_type coords[dim] = {args...};
443 auto&& center = apply(u_m, coords);
444
445 coords[d] -= 1;
446 auto&& left = apply(u_m, coords);
447
448 coords[d] += 2;
449 auto&& right = apply(u_m, coords);
450
451 res += hvector_m[d] * (left - 2 * center + right);
452 }
453 return res;
454 }
455
456 private:
457 using Mesh_t = typename E::Mesh_t;
459 const E u_m;
461 };
462 } // namespace detail
463
464 namespace detail {
468
469 template <typename E>
471 : public Expression<meta_curl<E>,
472 sizeof(E) + 4 * sizeof(typename E::Mesh_t::vector_type)> {
473 constexpr static unsigned dim = E::dim;
474
475 KOKKOS_FUNCTION
476 meta_curl(const E& u, const typename E::Mesh_t::vector_type& xvector,
477 const typename E::Mesh_t::vector_type& yvector,
478 const typename E::Mesh_t::vector_type& zvector,
479 const typename E::Mesh_t::vector_type& hvector)
480 : u_m(u)
481 , xvector_m(xvector)
482 , yvector_m(yvector)
483 , zvector_m(zvector)
484 , hvector_m(hvector) {}
485
486 /*
487 * 3-dimensional curl
488 */
489 KOKKOS_INLINE_FUNCTION auto operator()(size_t i, size_t j, size_t k) const {
490 return xvector_m
491 * ((u_m(i, j + 1, k)[2] - u_m(i, j - 1, k)[2]) / (2 * hvector_m[1])
492 - (u_m(i, j, k + 1)[1] - u_m(i, j, k - 1)[1]) / (2 * hvector_m[2]))
493 + yvector_m
494 * ((u_m(i, j, k + 1)[0] - u_m(i, j, k - 1)[0]) / (2 * hvector_m[2])
495 - (u_m(i + 1, j, k)[2] - u_m(i - 1, j, k)[2]) / (2 * hvector_m[0]))
496 + zvector_m
497 * ((u_m(i + 1, j, k)[1] - u_m(i - 1, j, k)[1]) / (2 * hvector_m[0])
498 - (u_m(i, j + 1, k)[0] - u_m(i, j - 1, k)[0]) / (2 * hvector_m[1]));
499 }
500
501 private:
502 using Mesh_t = typename E::Mesh_t;
504 const E u_m;
509 };
510 } // namespace detail
511
512 namespace detail {
513
517 template <typename E>
519 : public Expression<meta_hess<E>,
520 sizeof(E)
521 + sizeof(typename E::Mesh_t::vector_type[E::Mesh_t::Dimension])
522 + sizeof(typename E::Mesh_t::vector_type)> {
523 constexpr static unsigned dim = E::dim;
524
525 KOKKOS_FUNCTION
526 meta_hess(const E& u, const typename E::Mesh_t::vector_type vectors[],
527 const typename E::Mesh_t::vector_type& hvector)
528 : u_m(u)
529 , hvector_m(hvector) {
530 for (unsigned d = 0; d < E::Mesh_t::Dimension; d++) {
531 vectors_m[d] = vectors[d];
532 }
533 }
534
535 /*
536 * n-dimensional hessian (return Vector<Vector<T,n>,n>)
537 */
538 template <typename... Idx>
539 KOKKOS_INLINE_FUNCTION auto operator()(const Idx... args) const {
540 matrix_type hessian;
541 computeHessian(std::make_index_sequence<dim>{}, hessian, args...);
542 return hessian;
543 }
544
545 private:
546 using Mesh_t = typename E::Mesh_t;
549
550 const E u_m;
553
563 template <size_t... row, typename... Idx>
564 KOKKOS_INLINE_FUNCTION constexpr void computeHessian(
565 const std::index_sequence<row...>& is, matrix_type& hessian,
566 const Idx... args) const {
567 // The comma operator forces left-to-right evaluation order, which reduces
568 // performance; therefore we apply a dummy operation to dummy values and discard the
569 // result
570 [[maybe_unused]] auto _ = (hessianRow<row>(is, hessian, args...) + ...);
571 }
572
584 template <size_t row, size_t... col, typename... Idx>
585 KOKKOS_INLINE_FUNCTION constexpr int hessianRow(const std::index_sequence<col...>&,
586 matrix_type& hessian,
587 const Idx... args) const {
588 hessian[row] = (hessianEntry<row, col>(args...) + ...);
589 return 0;
590 }
591
601 template <size_t row, size_t col, typename... Idx>
602 KOKKOS_INLINE_FUNCTION constexpr vector_type hessianEntry(const Idx... args) const {
603 using index_type = std::tuple_element_t<0, std::tuple<Idx...>>;
604 index_type coords[dim] = {args...};
605 if constexpr (row == col) {
606 auto&& center = apply(u_m, coords);
607
608 coords[row] += 1;
609 auto&& right = apply(u_m, coords);
610
611 coords[row] -= 2;
612 auto&& left = apply(u_m, coords);
613
614 // The diagonal elements correspond to second derivatives w.r.t. a single
615 // variable
616 return vectors_m[row] * (right - 2. * center + left)
617 / (hvector_m[row] * hvector_m[row]);
618 } else {
619 coords[row] += 1;
620 coords[col] += 1;
621 auto&& uu = apply(u_m, coords);
622
623 coords[col] -= 2;
624 auto&& ud = apply(u_m, coords);
625
626 coords[row] -= 2;
627 auto&& dd = apply(u_m, coords);
628
629 coords[col] += 2;
630 auto&& du = apply(u_m, coords);
631
632 // The non-diagonal elements are mixed derivatives, whose finite difference form
633 // is slightly different from above
634 return vectors_m[col] * (uu - du - ud + dd)
635 / (4. * hvector_m[row] * hvector_m[col]);
636 }
637 // Silences incorrect nvcc warning: missing return statement at end of non-void
638 // function
639 return vector_type{};
640 }
641 };
642 } // namespace detail
643} // namespace ippl
644
645#endif
#define DefineUnaryOperation(fun, name, op1, op2)
#define DefineBinaryOperation(fun, name, op1, op2)
Definition Archive.h:20
KOKKOS_INLINE_FUNCTION constexpr decltype(auto) apply(const View &view, const Coords &coords)
KOKKOS_INLINE_FUNCTION detail::meta_cross< E1, E2 > cross(const detail::Expression< E1, N1 > &u, const detail::Expression< E2, N2 > &v)
KOKKOS_INLINE_FUNCTION constexpr decltype(auto) apply_impl(const View &view, const Coords &coords, const std::index_sequence< Idx... > &)
KOKKOS_INLINE_FUNCTION detail::meta_dot< E1, E2 > dot(const detail::Expression< E1, N1 > &u, const detail::Expression< E2, N2 > &v)
KOKKOS_INLINE_FUNCTION static constexpr unsigned getRank()
KOKKOS_INLINE_FUNCTION auto operator()(Args... args) const
KOKKOS_INLINE_FUNCTION auto operator[](size_t i) const
KOKKOS_FUNCTION meta_cross(const E1 &u, const E2 &v)
static constexpr unsigned dim
KOKKOS_INLINE_FUNCTION auto apply() const
KOKKOS_INLINE_FUNCTION auto operator()(Args... args) const
KOKKOS_FUNCTION meta_dot(const E1 &u, const E2 &v)
static constexpr unsigned dim
typename E::value_type value_type
static constexpr unsigned dim
typename Mesh_t::vector_type vector_type
vector_type vectors_m[dim]
KOKKOS_INLINE_FUNCTION auto operator()(const Idx... args) const
typename E::Mesh_t Mesh_t
KOKKOS_FUNCTION meta_grad(const E &u, const typename E::Mesh_t::vector_type vectors[])
static constexpr unsigned dim
KOKKOS_FUNCTION meta_div(const E &u, const typename E::Mesh_t::vector_type vectors[])
vector_type vectors_m[dim]
typename Mesh_t::vector_type vector_type
typename E::Mesh_t Mesh_t
KOKKOS_INLINE_FUNCTION auto operator()(const Idx... args) const
typename E::value_type value_type
static constexpr unsigned dim
KOKKOS_FUNCTION meta_laplace(const E &u, const typename E::Mesh_t::vector_type &hvector)
const vector_type hvector_m
typename E::Mesh_t Mesh_t
KOKKOS_INLINE_FUNCTION auto operator()(const Idx... args) const
typename Mesh_t::vector_type vector_type
const vector_type zvector_m
const vector_type xvector_m
const vector_type hvector_m
typename E::Mesh_t Mesh_t
KOKKOS_FUNCTION meta_curl(const E &u, const typename E::Mesh_t::vector_type &xvector, const typename E::Mesh_t::vector_type &yvector, const typename E::Mesh_t::vector_type &zvector, const typename E::Mesh_t::vector_type &hvector)
KOKKOS_INLINE_FUNCTION auto operator()(size_t i, size_t j, size_t k) const
static constexpr unsigned dim
typename Mesh_t::vector_type vector_type
const vector_type yvector_m
KOKKOS_INLINE_FUNCTION constexpr void computeHessian(const std::index_sequence< row... > &is, matrix_type &hessian, const Idx... args) const
typename E::Mesh_t Mesh_t
vector_type vectors_m[dim]
typename Mesh_t::matrix_type matrix_type
static constexpr unsigned dim
typename Mesh_t::vector_type vector_type
KOKKOS_FUNCTION meta_hess(const E &u, const typename E::Mesh_t::vector_type vectors[], const typename E::Mesh_t::vector_type &hvector)
KOKKOS_INLINE_FUNCTION constexpr int hessianRow(const std::index_sequence< col... > &, matrix_type &hessian, const Idx... args) const
KOKKOS_INLINE_FUNCTION auto operator()(const Idx... args) const
KOKKOS_INLINE_FUNCTION constexpr vector_type hessianEntry(const Idx... args) const
const vector_type hvector_m
Vector< vector_type, Dim > matrix_type
Definition Mesh.h:23
Mesh< double, Dim >::vector_type vector_type