1#ifndef TATOOINE_ANALYTICAL_NUMERICAL_H
2#define TATOOINE_ANALYTICAL_NUMERICAL_H
11template <
typename Real>
25 auto const c =
vec{0.5 + 0.1 *
sin(0.04 * t + 10 * pos.z()),
26 0.5 + 0.1 *
cos(0.03 * t + 3 * pos.z())};
29 auto r = 0.1 + 0.4 * pos.z() * pos.z() + 0.1 * pos.z() *
sin(8 * pos.z());
31 auto const r2 = 0.2 + 0.1 * pos.z();
33 auto scale =
abs(r - temp);
42 auto z0 = 0.1 * (0.1 - temp * pos.z());
46 temp =
sqrt(temp * temp + z0 * z0);
47 scale = (r + r2 - temp) * scale / (temp +
eps);
48 scale = scale / (1 + pos.z());
49 return tensor_type{(pos.y() - c.y()) + 0.1 * (pos.x() - c.x()),
50 -(pos.x() - c.x()) + 0.1 * (pos.y() - c.y()), z0} *
constexpr auto abs(arithmetic auto const x)
Definition: math.h:26
constexpr auto cos(arithmetic auto const x)
Definition: math.h:28
constexpr auto sin(arithmetic auto const x)
Definition: math.h:27
constexpr auto sqrt(arithmetic auto const x)
Definition: math.h:29
constexpr auto euclidean_distance(base_tensor< Tensor0, T0, N > const &lhs, base_tensor< Tensor1, T1, N > const &rhs)
Definition: distance.h:19
constexpr auto evaluate(pos_type const &pos, real_type const t) const -> tensor_type
Definition: tornado.h:21
static constexpr real_type eps
Definition: tornado.h:19
Real real_type
Definition: field.h:17
vec< real_type, NumDimensions > pos_type
Definition: field.h:20
Tensor tensor_type
Definition: field.h:18