1#ifndef TATOOINE_ANALYTICAL_SYMBOLIC_MODIFIED_DOUBLEGYRE_H
2#define TATOOINE_ANALYTICAL_SYMBOLIC_MODIFIED_DOUBLEGYRE_H
4#include <tatooine/available_libraries.h>
5#if TATOOINE_GINAC_AVAILABLE
10template <
typename Real>
20 static GiNaC::numeric
c() {
return -0.2040811331; }
21 static GiNaC::numeric
d() {
return 9.964223388; }
26 GiNaC::numeric epsilon{1, 4};
27 GiNaC::numeric A{1, 10};
28 auto omega = 2 * Pi * GiNaC::numeric{1, 10};
31 auto f = a * x(0) * x(0) + b * x(0);
32 auto df = 2 * a * x(0) + b;
34 this->set_expr(
vec{-Pi * A *
sin(Pi * f) *
cos(Pi * x(1)),
35 Pi * A *
cos(Pi * f) *
sin(Pi * x(1)) * df});
41 auto r = Pi * GiNaC::numeric{1, 5} * t() +
d();
43 auto q = (4 * Pi *
c() *
sin(r) - 4 * asin(2 *
c() *
cos(r))) /
44 (Pi * (1 -
c() *
c() *
sin(r) *
sin(r)));
46 return 5 / Pi * asin(q) - t();
51 return evtod<Real>(ex, t() == time);
56 return x(0) >= 0 && x(0) <= 2 && x(1) >= 0 && x(1) <= 1;
62 return c() *
sin(Pi / 5 * t() +
d()) + 1;
68 return evtod<Real>(ex, t() == time);
74 parameterized_line<Real, 2> curve;
75 for (
auto time : domain) {
76 curve.push_back({evtod<Real>(bifu_ex, t() == time), 0}, time);
84 parameterized_line<Real, 3> curve;
85 for (
auto time : domain) {
86 curve.push_back({evtod<Real>(bifu_ex, t() == time), 0, time}, time);
static auto constexpr t
Definition: index.h:24
constexpr auto cos(arithmetic auto const x)
Definition: math.h:28
constexpr auto sin(arithmetic auto const x)
Definition: math.h:27
Definition: modified_doublegyre.h:11
static GiNaC::numeric d()
Definition: modified_doublegyre.h:21
static GiNaC::ex bifurcationline()
Definition: modified_doublegyre.h:60
static auto bifurcationline_spacetime(const linspace< Real > &domain)
Definition: modified_doublegyre.h:82
static GiNaC::numeric c()
Definition: modified_doublegyre.h:20
modified_doublegyre()
Definition: modified_doublegyre.h:24
static auto timeoffset(Real time)
Definition: modified_doublegyre.h:49
static auto bifurcationline(const linspace< Real > &domain)
Definition: modified_doublegyre.h:72
static auto timeoffset()
Definition: modified_doublegyre.h:39
constexpr bool in_domain(const pos_type &x, Real) const
Definition: modified_doublegyre.h:55
static auto bifurcationline(Real time)
Definition: modified_doublegyre.h:66
vec< real_type, NumDimensions > pos_type
Definition: field.h:20
Tensor tensor_type
Definition: field.h:18
Definition: linspace.h:26
tensor< GiNaC::ex, TensorDims... > symtensor_type
Definition: symbolic_field.h:22
auto constexpr x() const -> auto const &requires(N >=1)
Definition: vec.h:102