1#ifndef TATOOINE_AUTONOMOUS_PARTICLES_FIELD_H
2#define TATOOINE_AUTONOMOUS_PARTICLES_FIELD_H
6#include <tatooine/flowmap_gradient_central_differences.h>
11template <std::
floating_po
int Real>
13 :
vectorfield<autonomous_particles_test<Real>, Real, 2> {
35 return {x(0) * x(0) * x(0) - x(0), (1 - 3 * x(0) * x(0)) * x(1)};
47template <std::
floating_po
int Real>
56 auto const a = std::exp(2 * tau);
57 auto const b = std::exp(-2 * tau);
58 auto const c = std::sqrt((1 - a) * x(0) * x(0) + a);
59 return {x(0) / c, -b * c * ((a - 1) * x(0) * x(0) - a) * x(1)
70template <
template <
typename,
size_t>
74 std::floating_point Real>
79 InterpolationKernel>{v};
82template <std::
floating_po
int Real>
89template <std::
floating_po
int Real>
95template <std::
floating_po
int Real>
106 auto const a = std::exp(2 * tau);
107 auto const b = std::exp(-2 * tau);
108 auto const c = std::sqrt(-a * x(0) * x(0) + x(0) * x(0) + a);
109 auto const d = std::pow((-a * x(0) * x(0) + x(0) * x(0) + a),
112 {1 / c - (x(0) * (2 * x(0) - 2 * a * x(0))) / (2 * d),
real_type(0)},
113 {(3 * b * (2 * x(0) - 2 * a * x(0)) * c * x(1)) / 2, b * d}};
122template <std::
floating_po
int Real>
128template <std::
floating_po
int VReal, std::
floating_po
int EpsReal = VReal>
130 tag::central_t , EpsReal epsilon = 1e-7) {
131 return flowmap_gradient_central_differences<
135template <std::
floating_po
int VReal, std::
floating_po
int EpsReal>
138 return flowmap_gradient_central_differences<
142template <std::
floating_po
int Real>
151template <std::
floating_po
int Real>
153 analytical::numerical::autonomous_particles_test<Real>, 2, 2>
154 :
field<analytical::numerical::autonomous_particles_test<Real>, Real, 2, 2,
167 return {{3 * x(0) * x(0) - 1, 0}, {-6 * x(0) * x(1), 1 - 3 * x(0) * x(0)}};
176template <std::
floating_po
int Real>
182template <std::
floating_po
int Real>
constexpr auto flowmap(vectorfield< autonomous_particles_test< Real >, Real, 2 > const &v, tag::numerical_t)
Definition: autonomous_particles_test.h:75
auto diff(autonomous_particles_test_flowmap< Real > const &, tag::analytical_t)
Definition: autonomous_particles_test.h:123
static constexpr analytical_t analytical
Definition: tags.h:91
Definition: algorithm.h:6
constexpr auto diff(polynomial< Real, Degree > const &f)
Definition: polynomial.h:179
Definition: autonomous_particles_test.h:96
vec< real_type, 2 > vec_t
Definition: autonomous_particles_test.h:98
mat< real_type, 2, 2 > mat_t
Definition: autonomous_particles_test.h:100
static constexpr auto num_dimensions() -> std::size_t
Definition: autonomous_particles_test.h:102
constexpr auto evaluate(pos_type const &x, real_type const, real_type const tau) const -> gradient_t
Definition: autonomous_particles_test.h:104
Real real_type
Definition: autonomous_particles_test.h:97
constexpr auto operator()(pos_type const &x, Real const t, real_type const tau) const
Definition: autonomous_particles_test.h:116
Definition: autonomous_particles_test.h:48
constexpr auto operator()(pos_type const &x, real_type const t, real_type const tau) const -> pos_type
Definition: autonomous_particles_test.h:64
constexpr auto evaluate(pos_type const &x, real_type const, real_type const tau) const -> pos_type
Definition: autonomous_particles_test.h:54
static constexpr auto num_dimensions() -> std::size_t
Definition: autonomous_particles_test.h:52
Real real_type
Definition: autonomous_particles_test.h:49
vec< real_type, 2 > vec_t
Definition: autonomous_particles_test.h:50
Definition: autonomous_particles_test.h:13
constexpr autonomous_particles_test(autonomous_particles_test const &)=default
constexpr auto in_domain(pos_type const &, real_type const) const -> bool final
Definition: autonomous_particles_test.h:38
constexpr autonomous_particles_test() noexcept
Definition: autonomous_particles_test.h:20
constexpr autonomous_particles_test(autonomous_particles_test &&) noexcept=default
constexpr auto evaluate(pos_type const &x, real_type const) const -> tensor_type final
Definition: autonomous_particles_test.h:32
vec_type pos_type
Definition: axis_aligned_bounding_box.h:109
constexpr auto evaluate(pos_type const &x, real_type const) const -> tensor_type final
Definition: autonomous_particles_test.h:165
constexpr auto in_domain(pos_type const &, real_type const) const -> bool final
Definition: autonomous_particles_test.h:170
Definition: differentiated_field.h:173
Real real_type
Definition: field.h:17
vec< real_type, NumDimensions > pos_type
Definition: field.h:20
Tensor tensor_type
Definition: field.h:18
Definition: interpolation.h:216
Real real_type
Definition: interpolation.h:25
interpolation_tensor_type< tensor< Real, Dims... > > tensor_type
Definition: interpolation.h:135
Definition: numerical_flowmap.h:17
Definition: rungekuttafehlberg78.h:28