33 :
gamma_psi(1.0/gradpsi.magnitude(i_simd)) {}
35 KOKKOS_INLINE_FUNCTION
void set(
int i_simd,
double basis,
const SimdVector2D &gradpsi){
36 r0 = basis + (1.0-basis) *
gamma_psi * gradpsi.
r[i_simd];
39 z1 = basis + (1.0-basis) *
gamma_psi * gradpsi.
r[i_simd];
44 template<VarType VT, PhiInterpType PIT>
55 static constexpr
int NDIM(){
return 3;}
56 static constexpr
int NPHI(){
return 2;}
57 static constexpr
int SIZE(){
return NDIM()*NPHI();}
67 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
68 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
69 vec.
r[i_simd] += wp*(phi_w0*( corr.
r0*V[
PIR][0] + corr.
z0*V[
PIZ][0] )
70 + phi_w1*( corr.
r0*V[
PIR][1] + corr.
z0*V[
PIZ][1] ) );
71 vec.
z[i_simd] += wp*(phi_w0*( corr.
r1*V[
PIR][0] + corr.
z1*V[
PIZ][0] )
72 + phi_w1*( corr.
r1*V[
PIR][1] + corr.
z1*V[
PIZ][1] ) );
73 vec.
phi[i_simd] += wp*(phi_w0* V[
PIP][0]
74 + phi_w1* V[
PIP][1] );
86 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
87 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
89 const double& rho_w00 = rho_wts.
rho_wts[0].
w[0][i_simd];
90 const double& rho_w01 = rho_wts.
rho_wts[0].
w[1][i_simd];
91 const double& rho_w10 = rho_wts.
rho_wts[1].
w[0][i_simd];
92 const double& rho_w11 = rho_wts.
rho_wts[1].
w[1][i_simd];
94 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
95 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
96 const double& rho_w10 = rho_wts.
rho_wts.
w[0][i_simd];
97 const double& rho_w11 = rho_wts.
rho_wts.
w[1][i_simd];
100 vec.
r[i_simd] += wp*(phi_w0*( corr.
r0*(rho_w00*V[
PIR][0] + rho_w01*field2.
V[
PIR][0])
101 + corr.
z0*(rho_w00*V[
PIZ][0] + rho_w01*field2.
V[
PIZ][0]) )
102 + phi_w1*( corr.
r0*(rho_w10*V[
PIR][1] + rho_w11*field2.
V[
PIR][1])
103 + corr.
z0*(rho_w10*V[
PIZ][1] + rho_w11*field2.
V[
PIZ][1]) ) );
104 vec.
z[i_simd] += wp*(phi_w0*( corr.
r1*(rho_w00*V[
PIR][0] + rho_w01*field2.
V[
PIR][0])
105 + corr.
z1*(rho_w00*V[
PIZ][0] + rho_w01*field2.
V[
PIZ][0]) )
106 + phi_w1*( corr.
r1*(rho_w10*V[
PIR][1] + rho_w11*field2.
V[
PIR][1])
107 + corr.
z1*(rho_w10*V[
PIZ][1] + rho_w11*field2.
V[
PIZ][1]) ) );
108 vec.
phi[i_simd] += wp*(phi_w0* (rho_w00*V[
PIP][0] + rho_w01*field2.
V[
PIP][0])
109 + phi_w1* (rho_w10*V[
PIP][1] + rho_w11*field2.
V[
PIP][1]) );
127 static constexpr
int NDIM(){
return 2;}
128 static constexpr
int NPHI(){
return 2;}
129 static constexpr
int SIZE(){
return NDIM()*NPHI();}
139 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
140 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
141 vec.
r[i_simd] += wp*(phi_w0*( corr.
r0*V[
PIR][0] + corr.
z0*V[
PIZ][0] )
142 + phi_w1*( corr.
r0*V[
PIR][1] + corr.
z0*V[
PIZ][1] ) );
143 vec.
z[i_simd] += wp*(phi_w0*( corr.
r1*V[
PIR][0] + corr.
z1*V[
PIZ][0] )
144 + phi_w1*( corr.
r1*V[
PIR][1] + corr.
z1*V[
PIZ][1] ) );
156 static constexpr
int NDIM(){
return 1;}
157 static constexpr
int NPHI(){
return 2;}
158 static constexpr
int SIZE(){
return NDIM()*NPHI();}
167 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
168 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
169 sca[i_simd] += wp* ( phi_w0*S[0] + phi_w1*S[1] );
180 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
181 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
183 const double& rho_w00 = rho_wts.
rho_wts[0].
w[0][i_simd];
184 const double& rho_w01 = rho_wts.
rho_wts[0].
w[1][i_simd];
185 const double& rho_w10 = rho_wts.
rho_wts[1].
w[0][i_simd];
186 const double& rho_w11 = rho_wts.
rho_wts[1].
w[1][i_simd];
188 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
189 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
190 const double& rho_w10 = rho_wts.
rho_wts.
w[0][i_simd];
191 const double& rho_w11 = rho_wts.
rho_wts.
w[1][i_simd];
194 sca[i_simd] += wp* ( phi_w0*rho_w00*S[0]
195 + phi_w1*rho_w10*S[1]
196 + phi_w0*rho_w01*field2.
S[0]
197 + phi_w1*rho_w11*field2.
S[1]);
202 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
203 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
210 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
211 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
213 const double& rho_w00 = rho_wts.
rho_wts[0].
w[0][i_simd];
214 const double& rho_w01 = rho_wts.
rho_wts[0].
w[1][i_simd];
215 const double& rho_w10 = rho_wts.
rho_wts[1].
w[0][i_simd];
216 const double& rho_w11 = rho_wts.
rho_wts[1].
w[1][i_simd];
218 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
219 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
220 const double& rho_w10 = rho_wts.
rho_wts.
w[0][i_simd];
221 const double& rho_w11 = rho_wts.
rho_wts.
w[1][i_simd];
260 static constexpr
int NDIM(){
return 2;}
261 static constexpr
int NPHI(){
return 1;}
262 static constexpr
int SIZE(){
return NDIM()*NPHI();}
284 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
285 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
286 vec.
r[i_simd] += wp*( corr.
r0*(rho_w00*
E[
PIR] + rho_w01*field2.
E[
PIR])
287 +corr.
z0*(rho_w00*
E[
PIZ] + rho_w01*field2.
E[
PIZ]) );
288 vec.
z[i_simd] += wp*( corr.
r1*(rho_w00*
E[
PIR] + rho_w01*field2.
E[
PIR])
289 +corr.
z1*(rho_w00*
E[
PIZ] + rho_w01*field2.
E[
PIZ]) );
302 static constexpr
int NDIM(){
return 3;}
303 static constexpr
int NPHI(){
return 1;}
304 static constexpr
int SIZE(){
return NDIM()*NPHI();}
313 vec.
r[i_simd] += wp*V[
PIR];
314 vec.
z[i_simd] += wp*V[
PIZ];
315 vec.
phi[i_simd] += wp*V[
PIP];
327 static constexpr
int NDIM(){
return 1;}
328 static constexpr
int NPHI(){
return 1;}
329 static constexpr
int SIZE(){
return NDIM()*NPHI();}
341 gather(sca, i_simd, wp);
345 const double& rho_w0 = rho_wts.
rho_wts.
w[0][i_simd];
346 const double& rho_w1 = rho_wts.
rho_wts.
w[1][i_simd];
348 sca[i_simd] += wp*(rho_w0*S + rho_w1*field2.S);
358 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
359 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
373 KOKKOS_INLINE_FUNCTION
explicit operator double()
const {
378 KOKKOS_INLINE_FUNCTION
void operator = (
const double val) {
383 KOKKOS_INLINE_FUNCTION
void operator += (
const double val){
KOKKOS_INLINE_FUNCTION void access_add(T *addr, T val)
Definition: access_add.hpp:40
const double gamma_psi
Definition: field.hpp:24
double z0
Definition: field.hpp:29
double r1
Definition: field.hpp:28
double r0
Definition: field.hpp:27
double z1
Definition: field.hpp:30
KOKKOS_INLINE_FUNCTION void set(int i_simd, double basis, const SimdVector2D &gradpsi)
Definition: field.hpp:35
KOKKOS_INLINE_FUNCTION FieldCorrection(const SimdVector2D &gradpsi, int i_simd)
Definition: field.hpp:32
constexpr VarType vec2d_if_axisym()
VarType
Definition: field.hpp:11
KOKKOS_INLINE_FUNCTION bool isfinite(const Field< VarType::Vector, PhiInterpType::Planes > &f)
Definition: field.hpp:114
Field< VarType::Scalar, PhiInterpType::None > ScalarField
Definition: field.hpp:401
@ PIP
phi coordinate
Definition: globals.hpp:208
@ PIR
r coordinate
Definition: globals.hpp:206
@ PIZ
z coordinate
Definition: globals.hpp:207
PhiInterpType
Definition: globals.hpp:95
constexpr KOKKOS_INLINE_FUNCTION PhiWtUsage get_phi_wt_usage(PhiInterpType PIT)
Definition: grid_weights.hpp:15
Definition: field.hpp:321
static constexpr int NDIM()
Definition: field.hpp:327
double S
Definition: field.hpp:322
static constexpr int SIZE()
Definition: field.hpp:329
static constexpr int NPHI()
Definition: field.hpp:328
KOKKOS_INLINE_FUNCTION void gather(Simd< double > &sca, int i_simd, double wp) const
Definition: field.hpp:336
KOKKOS_INLINE_FUNCTION void scatter(const SimdGyroWeights< GyroKin > &rho_wts, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, int i_simd, double wp, Field< VarType::Scalar, PhiInterpType::None > &field2)
Definition: field.hpp:357
KOKKOS_INLINE_FUNCTION void gather(Simd< double > &sca, int i_simd, double wp, const SimdGyroWeights< GyroKin > &rho_wts, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, const Field< VarType::Scalar, PIT > &field2) const
Definition: field.hpp:344
KOKKOS_INLINE_FUNCTION void gather(Simd< double > &sca, int i_simd, double wp, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts) const
Definition: field.hpp:340
KOKKOS_INLINE_FUNCTION void scatter(const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, int i_simd, double wp)
Definition: field.hpp:352
Definition: field.hpp:150
KOKKOS_INLINE_FUNCTION void gather(Simd< double > &sca, int i_simd, double wp, const SimdGyroWeights< GyroKin > &rho_wts, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, const Field< VarType::Scalar, PhiInterpType::Planes > &field2) const
Definition: field.hpp:179
static constexpr int SIZE()
Definition: field.hpp:158
static constexpr int NDIM()
Definition: field.hpp:156
KOKKOS_INLINE_FUNCTION void gather(Simd< double > &sca, int i_simd, double wp, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts) const
Definition: field.hpp:166
KOKKOS_INLINE_FUNCTION void scatter(const SimdGyroWeights< GyroKin > &rho_wts, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, int i_simd, double wp, Field< VarType::Scalar, PhiInterpType::Planes > &field2)
Definition: field.hpp:209
KOKKOS_INLINE_FUNCTION void scatter(const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, int i_simd, double wp)
Definition: field.hpp:201
double S[2]
Definition: field.hpp:151
Field< VarType::Scalar, PhiInterpType::Planes > & operator+=(const Field< VarType::Scalar, PhiInterpType::Planes > &rhs)
Definition: field.hpp:230
static constexpr int NPHI()
Definition: field.hpp:157
Definition: field.hpp:254
static constexpr int NDIM()
Definition: field.hpp:260
double E[2]
Definition: field.hpp:255
static constexpr int NPHI()
Definition: field.hpp:261
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const FieldCorrection &corr) const
Definition: field.hpp:270
static constexpr int SIZE()
Definition: field.hpp:262
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const SimdGyroWeights< GyroKin > &rho_wts, const FieldCorrection &corr, const Field< VarType::Vector2D, PhiInterpType::None > &field2) const
Definition: field.hpp:283
static constexpr int NPHI()
Definition: field.hpp:128
static constexpr int SIZE()
Definition: field.hpp:129
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, const FieldCorrection &corr) const
Definition: field.hpp:138
static constexpr int NDIM()
Definition: field.hpp:127
static constexpr int NDIM()
Definition: field.hpp:302
static constexpr int NPHI()
Definition: field.hpp:303
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp) const
Definition: field.hpp:312
static constexpr int SIZE()
Definition: field.hpp:304
static constexpr int SIZE()
Definition: field.hpp:57
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const SimdGyroWeights< GyroKin > &rho_wts, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, const FieldCorrection &corr, const Field< VarType::Vector, PhiInterpType::Planes > &field2) const
Definition: field.hpp:85
static constexpr int NPHI()
Definition: field.hpp:56
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, const FieldCorrection &corr) const
Definition: field.hpp:66
double V[3][2]
Definition: field.hpp:50
static constexpr int NDIM()
Definition: field.hpp:55
Definition: gyro_radius.hpp:84
SimdLinearWeights rho_wts
Definition: gyro_radius.hpp:87
Simd< double > w[2]
Definition: linear_weights.hpp:48
Definition: grid_weights.hpp:18
Simd< double > z
Definition: simd.hpp:141
Simd< double > r
Definition: simd.hpp:140
Simd< double > z
Definition: simd.hpp:151
Simd< double > r
Definition: simd.hpp:150
Simd< double > phi
Definition: simd.hpp:152