Tatooine
fields
include
tatooine
trace_flow.h
Go to the documentation of this file.
1
#ifndef TATOOINE_TRACE_FLOW_H
2
#define TATOOINE_TRACE_FLOW_H
3
//==============================================================================
4
#include <
tatooine/line.h
>
5
//==============================================================================
6
namespace
tatooine
{
7
//==============================================================================
8
template
<
typename
V,
typename
Real, std::size_t N,
typename
T0Real,
9
typename
TauReal>
10
auto
trace_flow
(
vectorfield<V, Real, N>
const
& v,
vec<Real, N>
const
& x0,
11
T0Real
const
t0, TauReal
const
tau) {
12
auto
solver =
ode::boost::rungekuttafehlberg78<Real, N>
{};
13
auto
l =
line<Real, N>
{};
14
auto
& param = l.
parameterization
();
15
auto
& tangents = l.tangents();
16
17
solver.solve(v, x0, t0, tau, [&](
auto
const
& x,
auto
const
t,
auto
const
dx) {
18
if
(tau > 0) {
19
l.push_back(x);
20
param.back() = t;
21
tangents.back() = dx;
22
}
else
{
23
l.push_front(x);
24
param.front() = t;
25
tangents.front() = dx;
26
}
27
});
28
return
l;
29
}
30
//==============================================================================
31
}
32
//==============================================================================
33
#endif
line.h
tatooine
Definition:
algorithm.h:6
tatooine::trace_flow
auto trace_flow(vectorfield< V, Real, N > const &v, vec< Real, N > const &x0, T0Real const t0, TauReal const tau)
Definition:
trace_flow.h:10
tatooine::field
Definition:
field.h:134
tatooine::line
Definition:
line.h:35
tatooine::line::parameterization
auto parameterization() -> auto &
Definition:
line.h:502
tatooine::ode::boost::rungekuttafehlberg78
Definition:
rungekuttafehlberg78.h:28
tatooine::vec
Definition:
vec.h:12
Generated by
1.9.5