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]) );
122 static constexpr
int NDIM(){
return 2;}
123 static constexpr
int NPHI(){
return 2;}
124 static constexpr
int SIZE(){
return NDIM()*NPHI();}
134 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
135 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
136 vec.
r[i_simd] += wp*(phi_w0*( corr.
r0*V[
PIR][0] + corr.
z0*V[
PIZ][0] )
137 + phi_w1*( corr.
r0*V[
PIR][1] + corr.
z0*V[
PIZ][1] ) );
138 vec.
z[i_simd] += wp*(phi_w0*( corr.
r1*V[
PIR][0] + corr.
z1*V[
PIZ][0] )
139 + phi_w1*( corr.
r1*V[
PIR][1] + corr.
z1*V[PIZ][1] ) );
151 static constexpr
int NDIM(){
return 1;}
152 static constexpr
int NPHI(){
return 2;}
153 static constexpr
int SIZE(){
return NDIM()*NPHI();}
162 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
163 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
164 sca[i_simd] += wp* ( phi_w0*S[0] + phi_w1*S[1] );
175 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
176 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
178 const double& rho_w00 = rho_wts.
rho_wts[0].
w[0][i_simd];
179 const double& rho_w01 = rho_wts.
rho_wts[0].
w[1][i_simd];
180 const double& rho_w10 = rho_wts.
rho_wts[1].
w[0][i_simd];
181 const double& rho_w11 = rho_wts.
rho_wts[1].
w[1][i_simd];
183 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
184 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
185 const double& rho_w10 = rho_wts.
rho_wts.
w[0][i_simd];
186 const double& rho_w11 = rho_wts.
rho_wts.
w[1][i_simd];
189 sca[i_simd] += wp* ( phi_w0*rho_w00*S[0]
190 + phi_w1*rho_w10*S[1]
191 + phi_w0*rho_w01*field2.
S[0]
192 + phi_w1*rho_w11*field2.
S[1]);
197 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
198 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
205 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
206 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
208 const double& rho_w00 = rho_wts.
rho_wts[0].
w[0][i_simd];
209 const double& rho_w01 = rho_wts.
rho_wts[0].
w[1][i_simd];
210 const double& rho_w10 = rho_wts.
rho_wts[1].
w[0][i_simd];
211 const double& rho_w11 = rho_wts.
rho_wts[1].
w[1][i_simd];
213 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
214 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
215 const double& rho_w10 = rho_wts.
rho_wts.
w[0][i_simd];
216 const double& rho_w11 = rho_wts.
rho_wts.
w[1][i_simd];
240 static constexpr
int NDIM(){
return 2;}
241 static constexpr
int NPHI(){
return 1;}
242 static constexpr
int SIZE(){
return NDIM()*NPHI();}
264 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
265 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
266 vec.
r[i_simd] += wp*( corr.
r0*(rho_w00*
E[
PIR] + rho_w01*field2.
E[
PIR])
267 +corr.
z0*(rho_w00*
E[
PIZ] + rho_w01*field2.
E[
PIZ]) );
268 vec.
z[i_simd] += wp*( corr.
r1*(rho_w00*
E[
PIR] + rho_w01*field2.
E[
PIR])
269 +corr.
z1*(rho_w00*
E[PIZ] + rho_w01*field2.
E[PIZ]) );
282 static constexpr
int NDIM(){
return 3;}
283 static constexpr
int NPHI(){
return 1;}
284 static constexpr
int SIZE(){
return NDIM()*NPHI();}
293 vec.
r[i_simd] += wp*V[
PIR];
294 vec.
z[i_simd] += wp*V[
PIZ];
295 vec.
phi[i_simd] += wp*V[
PIP];
307 static constexpr
int NDIM(){
return 1;}
308 static constexpr
int NPHI(){
return 1;}
309 static constexpr
int SIZE(){
return NDIM()*NPHI();}
327 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
328 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
342 KOKKOS_INLINE_FUNCTION
explicit operator double()
const {
347 KOKKOS_INLINE_FUNCTION
void operator = (
const double val) {
352 KOKKOS_INLINE_FUNCTION
void operator += (
const double val){
KOKKOS_INLINE_FUNCTION void scatter(const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, int i_simd, double wp)
Definition: field.hpp:196
VarType
Definition: field.hpp:11
static constexpr int SIZE()
Definition: field.hpp:153
KOKKOS_INLINE_FUNCTION void set(int i_simd, double basis, const SimdVector2D &gradpsi)
Definition: field.hpp:35
Simd< double > r
Definition: simd.hpp:150
static constexpr int SIZE()
Definition: field.hpp:284
static constexpr int NDIM()
Definition: field.hpp:240
constexpr VarType vec2d_if_axisym()
static constexpr int SIZE()
Definition: field.hpp:124
Definition: field.hpp:301
Definition: field.hpp:145
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
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:204
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:133
KOKKOS_INLINE_FUNCTION void scatter(const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, int i_simd, double wp)
Definition: field.hpp:321
double r1
Definition: field.hpp:28
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:161
static constexpr int NPHI()
Definition: field.hpp:152
constexpr KOKKOS_INLINE_FUNCTION PhiWtUsage get_phi_wt_usage(PhiInterpType PIT)
Definition: grid_weights.hpp:15
double S[2]
Definition: field.hpp:146
SimdLinearWeights rho_wts
Definition: gyro_radius.hpp:87
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:263
Definition: grid_weights.hpp:18
double r0
Definition: field.hpp:27
Simd< double > w[2]
Definition: linear_weights.hpp:48
PhiInterpType
Definition: globals.hpp:95
Definition: gyro_radius.hpp:84
r coordinate
Definition: globals.hpp:186
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const FieldCorrection &corr) const
Definition: field.hpp:250
static constexpr int SIZE()
Definition: field.hpp:309
static constexpr int NDIM()
Definition: field.hpp:122
KOKKOS_INLINE_FUNCTION void access_add(T *addr, T val)
Definition: access_add.hpp:40
static constexpr int NPHI()
Definition: field.hpp:308
static constexpr int NPHI()
Definition: field.hpp:241
static constexpr int NPHI()
Definition: field.hpp:283
static constexpr int SIZE()
Definition: field.hpp:242
double z1
Definition: field.hpp:30
double S
Definition: field.hpp:302
Simd< double > z
Definition: simd.hpp:141
KOKKOS_INLINE_FUNCTION void gather(Simd< double > &sca, int i_simd, double wp)
Definition: field.hpp:316
Simd< double > phi
Definition: simd.hpp:152
static constexpr int NDIM()
Definition: field.hpp:55
Simd< double > z
Definition: simd.hpp:151
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:326
static constexpr int SIZE()
Definition: field.hpp:57
static constexpr int NPHI()
Definition: field.hpp:123
Simd< double > r
Definition: simd.hpp:140
static constexpr int NDIM()
Definition: field.hpp:307
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:174
static constexpr int NDIM()
Definition: field.hpp:151
phi coordinate
Definition: globals.hpp:188
KOKKOS_INLINE_FUNCTION FieldCorrection(const SimdVector2D &gradpsi, int i_simd)
Definition: field.hpp:32
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp) const
Definition: field.hpp:292
const double gamma_psi
Definition: field.hpp:24
double z0
Definition: field.hpp:29
z coordinate
Definition: globals.hpp:187
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 E[2]
Definition: field.hpp:235
double V[3][2]
Definition: field.hpp:50
static constexpr int NPHI()
Definition: field.hpp:56
Definition: field.hpp:234
Field< VarType::Scalar, PhiInterpType::Planes > & operator+=(const Field< VarType::Scalar, PhiInterpType::Planes > &rhs)
Definition: field.hpp:225
static constexpr int NDIM()
Definition: field.hpp:282