Tatooine
orbit.h
Go to the documentation of this file.
1#ifndef TATOOINE_ORBIT_H
2#define TATOOINE_ORBIT_H
3
4#include "field.h"
5
6//==============================================================================
7namespace tatooine::numerical {
8//==============================================================================
9template <typename Real>
10struct orbit : field<orbit<Real>, Real, 3, 3> {
13 using typename parent_type::pos_type;
14 using typename parent_type::tensor_type;
16
17 //============================================================================
18 constexpr tensor_type evaluate(const pos_type& x, Real /*t*/) const {
19 Real r = 1;
20 return vec_t{-x(1), x(0), -x(2)} +
21 (vec_t{x(0), x(1), 0} * (length(vec{x(0), x(1)}) - r));
22 }
23};
24
25orbit()->orbit<double>;
26
27//==============================================================================
28} // namespace tatooine::numerical
29//==============================================================================
30#endif
Definition: cylinder_flow.h:6
Definition: field.h:134
vec< real_type, NumDimensions > pos_type
Definition: field.h:20
Tensor tensor_type
Definition: field.h:18
Definition: orbit.h:10
constexpr tensor_type evaluate(const pos_type &x, Real) const
Definition: orbit.h:18
Tensor tensor_type
Definition: field.h:18
Definition: vec.h:12