10 #include <eigen3/Eigen/Dense>
42 inline double sq(
const double x) {
return x * x; }
77 d[CURRENT].
u.cwiseAbs().minCoeff(&minIdx);
78 #if EIGEN_VERSION_AT_LEAST(3,4,0)
81 if (minIdx == IDX_X) {
ep = Eigen::Vector3d::UnitX(); }
82 else if (minIdx == IDX_Y) {
ep = Eigen::Vector3d::UnitY(); }
83 else {
ep = Eigen::Vector3d::UnitZ(); }
86 ep -=
ep.dot(
d[CURRENT].
u) *
d[CURRENT].
u;
90 eq =
d[CURRENT].
u.cross(
ep);
93 Eigen::Vector3d new_ep = cos(r) *
ep - sin(r) *
eq;
94 eq = sin(r) *
ep + cos(r) *
eq;
99 if (PARANOID_ORTHONORMALIZATION)
102 ep -=
ep.dot(
d[CURRENT].
u) *
d[CURRENT].
u;
104 eq -=
eq.dot(
d[CURRENT].
u) *
d[CURRENT].
u;
122 inline void make_evol(
const double vp ,
const double vq ,
125 d[NEXT].
v = vp *
ep + vq *
eq;
126 d[NEXT].
u =
d[CURRENT].
u + dt *
d[NEXT].
v;
127 d[NEXT].
u.normalize();
164 {
return n.
d[NEXT].
u(idx); }
168 {
return n.
d[NEXT].
v(idx); }
constexpr double u[NPI]
Definition: facette.h:20
const int NB_DATANODE
Definition: node.h:23
index
Definition: node.h:34
const int DIM
Definition: node.h:20
void set_phiv(Node &n, double val)
Definition: node.h:174
void set_phi(Node &n, double val)
Definition: node.h:171
step
Definition: node.h:27
double get_u_comp(Node const &n, index idx)
Definition: node.h:163
double get_phiv(Node const &n)
Definition: node.h:160
double sq(const double x)
Definition: node.h:42
Eigen::Vector3d get_u(Node const &n)
Definition: node.h:148
Eigen::Vector3d get_v(Node const &n)
Definition: node.h:152
double get_phi(Node const &n)
Definition: node.h:156
double get_v_comp(Node const &n, index idx)
Definition: node.h:167
double proj_ep(void) const
Definition: node.h:131
Eigen::Vector3d eq
Definition: node.h:64
const Eigen::Vector3d get_u(step k) const
Definition: node.h:137
Eigen::Vector3d ep
Definition: node.h:63
Eigen::Vector3d p
Definition: node.h:62
void make_evol(const double vp, const double vq, const double dt)
Definition: node.h:122
const Eigen::Vector3d get_v(step k) const
Definition: node.h:141
void evolution(void)
Definition: node.h:113
void setBasis(const double r)
Definition: node.h:73
double proj_eq(void) const
Definition: node.h:134
dataNode d[NB_DATANODE]
Definition: node.h:70
double phi
Definition: node.h:52
Eigen::Vector3d v
Definition: node.h:51
double phiv
Definition: node.h:53
Eigen::Vector3d u
Definition: node.h:50