1#ifndef TATOOINE_ANALYTICAL_SYMBOLIC_DOUBLEGYRE_H
2#define TATOOINE_ANALYTICAL_SYMBOLIC_DOUBLEGYRE_H
4#include <tatooine/available_libraries.h>
5#if TATOOINE_GINAC_AVAILABLE
10template <
typename Real>
20 explicit doublegyre(
const GiNaC::ex& eps = GiNaC::numeric{1, 4},
21 const GiNaC::ex& omega = 2 * GiNaC::Pi *
22 GiNaC::numeric{1, 10},
23 const GiNaC::ex& A = GiNaC::numeric{1, 10}) {
25 auto a = eps *
sin(omega * t());
27 auto f = a *
pow(x(0), 2) + b * x(0);
29 -Pi * A *
sin(Pi * f) *
cos(Pi * x(1)),
30 Pi * A *
cos(Pi * f) *
sin(Pi * x(1)) * f.diff(x(0))});
35 return x(0) >= 0 && x(0) <= 2 && x(1) >= 0 && x(1) <= 1;
44template <
typename Real>
45struct is_field<symbolic::doublegyre<Real>> : std::true_type {};
static auto constexpr t
Definition: index.h:24
Definition: algorithm.h:6
constexpr auto cos(arithmetic auto const x)
Definition: math.h:28
constexpr auto pow(arithmetic auto const x)
Definition: math.h:30
constexpr auto sin(arithmetic auto const x)
Definition: math.h:27
Definition: doublegyre.h:11
constexpr auto in_domain(const pos_type &x, Real) const -> bool
Definition: doublegyre.h:34
doublegyre(const GiNaC::ex &eps=GiNaC::numeric{1, 4}, const GiNaC::ex &omega=2 *GiNaC::Pi *GiNaC::numeric{1, 10}, const GiNaC::ex &A=GiNaC::numeric{1, 10})
Definition: doublegyre.h:20
vec< real_type, NumDimensions > pos_type
Definition: field.h:20
Tensor tensor_type
Definition: field.h:18
tensor< GiNaC::ex, TensorDims... > symtensor_type
Definition: symbolic_field.h:22
auto constexpr x() const -> auto const &requires(N >=1)
Definition: vec.h:102