Tatooine
helicity_field.h
Go to the documentation of this file.
1#ifndef TATOOINE_HELICITY_FIELD_H
2#define TATOOINE_HELICITY_FIELD_H
3
4#include "field.h"
5#include "vorticity_field.h"
6#include "diff.h"
7
8//==============================================================================
9namespace tatooine {
10//==============================================================================
11
12template <typename V>
14 : public field<helicity_field<V>, typename V::real_type, 3, 3> {
15 //============================================================================
16 // typedefs
17 //============================================================================
18 public:
19 using real_type = typename V::real_type;
22 field<this_type, real_type, V::num_dimensions(), V::tensor_type::dimension(0)>;
23 using typename parent_type::tensor_type;
24 using typename parent_type::pos_type;
25 //============================================================================
26 // fields
27 //============================================================================
28 private:
30
31 //============================================================================
32 // ctor
33 //============================================================================
34 public:
35 template <typename Real>
37
38 //============================================================================
39 // methods
40 //============================================================================
41 public:
42 constexpr tensor_type evaluate(const pos_type& x, real_type t) const {
43 const auto vort = vorticity(m_vf)(x, t);
44 return cross(vort, m_vf(x, t));
45 }
46 //----------------------------------------------------------------------------
47 constexpr bool in_domain(const pos_type& x, real_type t) const {
48 return m_vf.in_domain(x, t);
49 }
50};
51//==============================================================================
52template <typename V, typename Real>
54 return helicity_field<V>{vf.as_derived()};
55}
56//==============================================================================
57} // namespace tatooine
58//==============================================================================
59
60#endif
Definition: helicity_field.h:14
constexpr bool in_domain(const pos_type &x, real_type t) const
Definition: helicity_field.h:47
helicity_field< V > this_type
Definition: helicity_field.h:20
V m_vf
Definition: helicity_field.h:29
constexpr tensor_type evaluate(const pos_type &x, real_type t) const
Definition: helicity_field.h:42
helicity_field(const field< V, Real, 3, 3 > &v)
Definition: helicity_field.h:36
typename V::real_type real_type
Definition: helicity_field.h:19
Definition: algorithm.h:6
auto helicity(const field< V, Real, 3, 3 > &vf)
Definition: helicity_field.h:53
auto vorticity(const field< V, Real, 3, 3 > &vf)
Definition: vorticity_field.h:53
constexpr auto cross(base_tensor< Tensor0, T0, 3 > const &lhs, base_tensor< Tensor1, T1, 3 > const &rhs)
Definition: cross.h:9
Definition: field.h:134
vec< real_type, NumDimensions > pos_type
Definition: field.h:20
Tensor tensor_type
Definition: field.h:18
auto as_derived() -> auto &
Definition: field.h:161
constexpr auto in_domain(const pos_type &, double) const
Definition: symbolic_field.h:50
Definition: vec.h:12