Tatooine
counterexample_sadlo.h
Go to the documentation of this file.
1#ifndef TATOOINE_ANALYTICAL_NUMERICAL_COUNTEREXAMPLE_SADLO_H
2#define TATOOINE_ANALYTICAL_NUMERICAL_COUNTEREXAMPLE_SADLO_H
3//==============================================================================
4#include <tatooine/field.h>
5
6#include <boost/math/constants/constants.hpp>
7#include <cmath>
8//==============================================================================
10//==============================================================================
11template <typename Real>
12struct counterexample_sadlo : vectorfield<counterexample_sadlo<Real>, Real, 2> {
15 using typename parent_type::pos_type;
16 using typename parent_type::tensor_type;
17 //============================================================================
18 constexpr counterexample_sadlo() noexcept {}
19 //----------------------------------------------------------------------------
20 constexpr auto evaluate(const pos_type& p, Real t) const -> tensor_type {
21 const Real x = p(0);
22 const Real y = p(1);
23 const Real xx = x * x;
24 const Real yy = y * y;
25 const Real xxyy = xx + yy;
26 const Real r = (-(1.0 / 80.0) * xxyy * xxyy + 81.0 / 80.0);
27 return tensor_type{r * (-0.5 * x + 0.5 * std::cos(t) - std::sin(t)),
28 r * (0.5 * y - 0.5 * std::sin(t) + std::cos(t))};
29 }
30
32 vec<Real, 2> at(Real t) const { return {std::cos(t), std::sin(t)}; }
33 auto operator()(Real t) const { return at(t); }
34 };
35
37 vec<Real, 3> at(Real t) const { return {std::cos(t), std::sin(t), t}; }
38 auto operator()(Real t) const { return at(t); }
39 };
40
41 auto bifurcationline() const { return bifurcationline_t{}; }
44 }
45
46 constexpr auto in_domain(const pos_type& x, Real /*t*/) const -> bool {
47 return length(x) <= 3;
48 }
49};
50//==============================================================================
52//==============================================================================
53} // namespace tatooine::analytical::numerical
54//==============================================================================
55#endif
Definition: abcflow.h:7
vec< Real, 3 > at(Real t) const
Definition: counterexample_sadlo.h:37
auto operator()(Real t) const
Definition: counterexample_sadlo.h:38
vec< Real, 2 > at(Real t) const
Definition: counterexample_sadlo.h:32
auto operator()(Real t) const
Definition: counterexample_sadlo.h:33
Definition: counterexample_sadlo.h:12
auto bifurcationline() const
Definition: counterexample_sadlo.h:41
constexpr auto in_domain(const pos_type &x, Real) const -> bool
Definition: counterexample_sadlo.h:46
constexpr auto evaluate(const pos_type &p, Real t) const -> tensor_type
Definition: counterexample_sadlo.h:20
constexpr counterexample_sadlo() noexcept
Definition: counterexample_sadlo.h:18
auto bifurcationline_spacetime() const
Definition: counterexample_sadlo.h:42
Definition: field.h:134
vec< real_type, NumDimensions > pos_type
Definition: field.h:20
Tensor tensor_type
Definition: field.h:18
Definition: vec.h:12