37 :
gamma_psi(1.0/gradpsi.magnitude(i_simd)) {}
39 KOKKOS_INLINE_FUNCTION
void set(
int i_simd,
double basis,
const SimdVector2D &gradpsi){
40 r0 = basis + (1.0-basis) *
gamma_psi * gradpsi.
r[i_simd];
43 z1 = basis + (1.0-basis) *
gamma_psi * gradpsi.
r[i_simd];
48 template<VarType VT, PhiInterpType PIT>
59 static constexpr
int NDIM(){
return 3;}
60 static constexpr
int NPHI(){
return 2;}
61 static constexpr
int SIZE(){
return NDIM()*NPHI();}
71 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
72 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
73 vec.
r[i_simd] += wp*(phi_w0*( corr.
r0*V[
PIR][0] + corr.
z0*V[
PIZ][0] )
74 + phi_w1*( corr.
r0*V[
PIR][1] + corr.
z0*V[
PIZ][1] ) );
75 vec.
z[i_simd] += wp*(phi_w0*( corr.
r1*V[
PIR][0] + corr.
z1*V[
PIZ][0] )
76 + phi_w1*( corr.
r1*V[
PIR][1] + corr.
z1*V[PIZ][1] ) );
77 vec.
phi[i_simd] += wp*(phi_w0* V[
PIP][0]
78 + phi_w1* V[
PIP][1] );
90 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
91 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
93 const double& rho_w00 = rho_wts.
rho_wts[0].
w[0][i_simd];
94 const double& rho_w01 = rho_wts.
rho_wts[0].
w[1][i_simd];
95 const double& rho_w10 = rho_wts.
rho_wts[1].
w[0][i_simd];
96 const double& rho_w11 = rho_wts.
rho_wts[1].
w[1][i_simd];
98 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
99 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
100 const double& rho_w10 = rho_wts.
rho_wts.
w[0][i_simd];
101 const double& rho_w11 = rho_wts.
rho_wts.
w[1][i_simd];
104 vec.
r[i_simd] += wp*(phi_w0*( corr.
r0*(rho_w00*V[
PIR][0] + rho_w01*field2.
V[
PIR][0])
105 + corr.
z0*(rho_w00*V[
PIZ][0] + rho_w01*field2.
V[
PIZ][0]) )
106 + phi_w1*( corr.
r0*(rho_w10*V[
PIR][1] + rho_w11*field2.
V[
PIR][1])
107 + corr.
z0*(rho_w10*V[
PIZ][1] + rho_w11*field2.
V[
PIZ][1]) ) );
108 vec.
z[i_simd] += wp*(phi_w0*( corr.
r1*(rho_w00*V[
PIR][0] + rho_w01*field2.
V[
PIR][0])
109 + corr.
z1*(rho_w00*V[PIZ][0] + rho_w01*field2.
V[PIZ][0]) )
110 + phi_w1*( corr.
r1*(rho_w10*V[PIR][1] + rho_w11*field2.
V[PIR][1])
111 + corr.
z1*(rho_w10*V[
PIZ][1] + rho_w11*field2.
V[
PIZ][1]) ) );
112 vec.
phi[i_simd] += wp*(phi_w0* (rho_w00*V[
PIP][0] + rho_w01*field2.
V[
PIP][0])
113 + phi_w1* (rho_w10*V[
PIP][1] + rho_w11*field2.
V[
PIP][1]) );
126 static constexpr
int NDIM(){
return 2;}
127 static constexpr
int NPHI(){
return 2;}
128 static constexpr
int SIZE(){
return NDIM()*NPHI();}
138 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
139 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
140 vec.
r[i_simd] += wp*(phi_w0*( corr.
r0*V[
PIR][0] + corr.
z0*V[
PIZ][0] )
141 + phi_w1*( corr.
r0*V[
PIR][1] + corr.
z0*V[
PIZ][1] ) );
142 vec.
z[i_simd] += wp*(phi_w0*( corr.
r1*V[
PIR][0] + corr.
z1*V[
PIZ][0] )
143 + phi_w1*( corr.
r1*V[
PIR][1] + corr.
z1*V[PIZ][1] ) );
155 static constexpr
int NDIM(){
return 1;}
156 static constexpr
int NPHI(){
return 2;}
157 static constexpr
int SIZE(){
return NDIM()*NPHI();}
166 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
167 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
168 sca[i_simd] += wp* ( phi_w0*S[0] + phi_w1*S[1] );
179 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
180 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
182 const double& rho_w00 = rho_wts.
rho_wts[0].
w[0][i_simd];
183 const double& rho_w01 = rho_wts.
rho_wts[0].
w[1][i_simd];
184 const double& rho_w10 = rho_wts.
rho_wts[1].
w[0][i_simd];
185 const double& rho_w11 = rho_wts.
rho_wts[1].
w[1][i_simd];
187 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
188 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
189 const double& rho_w10 = rho_wts.
rho_wts.
w[0][i_simd];
190 const double& rho_w11 = rho_wts.
rho_wts.
w[1][i_simd];
193 sca[i_simd] += wp* ( phi_w0*rho_w00*S[0]
194 + phi_w1*rho_w10*S[1]
195 + phi_w0*rho_w01*field2.
S[0]
196 + phi_w1*rho_w11*field2.
S[1]);
201 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
202 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
209 const double& phi_w0 = phi_wts.phi.w[0][i_simd];
210 const double& phi_w1 = phi_wts.phi.w[1][i_simd];
212 const double& rho_w00 = rho_wts.
rho_wts[0].
w[0][i_simd];
213 const double& rho_w01 = rho_wts.
rho_wts[0].
w[1][i_simd];
214 const double& rho_w10 = rho_wts.
rho_wts[1].
w[0][i_simd];
215 const double& rho_w11 = rho_wts.
rho_wts[1].
w[1][i_simd];
217 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
218 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
219 const double& rho_w10 = rho_wts.
rho_wts.
w[0][i_simd];
220 const double& rho_w11 = rho_wts.
rho_wts.
w[1][i_simd];
244 static constexpr
int NDIM(){
return 2;}
245 static constexpr
int NPHI(){
return 1;}
246 static constexpr
int SIZE(){
return NDIM()*NPHI();}
268 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
269 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
270 vec.
r[i_simd] += wp*( corr.
r0*(rho_w00*
E[
PIR] + rho_w01*field2.
E[
PIR])
271 +corr.
z0*(rho_w00*
E[
PIZ] + rho_w01*field2.
E[
PIZ]) );
272 vec.
z[i_simd] += wp*( corr.
r1*(rho_w00*
E[
PIR] + rho_w01*field2.
E[
PIR])
273 +corr.
z1*(rho_w00*
E[PIZ] + rho_w01*field2.
E[PIZ]) );
286 static constexpr
int NDIM(){
return 3;}
287 static constexpr
int NPHI(){
return 1;}
288 static constexpr
int SIZE(){
return NDIM()*NPHI();}
297 vec.
r[i_simd] += wp*V[
PIR];
298 vec.
z[i_simd] += wp*V[
PIZ];
299 vec.
phi[i_simd] += wp*V[
PIP];
311 static constexpr
int NDIM(){
return 1;}
312 static constexpr
int NPHI(){
return 1;}
313 static constexpr
int SIZE(){
return NDIM()*NPHI();}
331 const double& rho_w00 = rho_wts.
rho_wts.
w[0][i_simd];
332 const double& rho_w01 = rho_wts.
rho_wts.
w[1][i_simd];
346 KOKKOS_INLINE_FUNCTION
explicit operator double()
const {
351 KOKKOS_INLINE_FUNCTION
void operator = (
const double val) {
356 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:200
VarType
Definition: field.hpp:15
static constexpr int SIZE()
Definition: field.hpp:157
KOKKOS_INLINE_FUNCTION void set(int i_simd, double basis, const SimdVector2D &gradpsi)
Definition: field.hpp:39
Simd< double > r
Definition: simd.hpp:150
static constexpr int SIZE()
Definition: field.hpp:288
static constexpr int NDIM()
Definition: field.hpp:244
constexpr VarType vec2d_if_axisym()
static constexpr int SIZE()
Definition: field.hpp:128
Definition: field.hpp:305
Definition: field.hpp:149
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:89
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:208
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:137
KOKKOS_INLINE_FUNCTION void scatter(const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, int i_simd, double wp)
Definition: field.hpp:325
double r1
Definition: field.hpp:32
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:165
static constexpr int NPHI()
Definition: field.hpp:156
constexpr KOKKOS_INLINE_FUNCTION PhiWtUsage get_phi_wt_usage(PhiInterpType PIT)
Definition: grid_weights.hpp:15
double S[2]
Definition: field.hpp:150
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:267
Definition: grid_weights.hpp:18
double r0
Definition: field.hpp:31
Simd< double > w[2]
Definition: linear_weights.hpp:48
PhiInterpType
Definition: globals.hpp:95
Definition: gyro_radius.hpp:84
r coordinate
Definition: globals.hpp:176
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const FieldCorrection &corr) const
Definition: field.hpp:254
static constexpr int SIZE()
Definition: field.hpp:313
static constexpr int NDIM()
Definition: field.hpp:126
KOKKOS_INLINE_FUNCTION void access_add(T *addr, T val)
Definition: access_add.hpp:30
static constexpr int NPHI()
Definition: field.hpp:312
static constexpr int NPHI()
Definition: field.hpp:245
static constexpr int NPHI()
Definition: field.hpp:287
static constexpr int SIZE()
Definition: field.hpp:246
double z1
Definition: field.hpp:34
double S
Definition: field.hpp:306
Simd< double > z
Definition: simd.hpp:141
KOKKOS_INLINE_FUNCTION void gather(Simd< double > &sca, int i_simd, double wp)
Definition: field.hpp:320
Simd< double > phi
Definition: simd.hpp:152
static constexpr int NDIM()
Definition: field.hpp:59
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:330
static constexpr int SIZE()
Definition: field.hpp:61
static constexpr int NPHI()
Definition: field.hpp:127
Simd< double > r
Definition: simd.hpp:140
static constexpr int NDIM()
Definition: field.hpp:311
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:178
static constexpr int NDIM()
Definition: field.hpp:155
phi coordinate
Definition: globals.hpp:178
KOKKOS_INLINE_FUNCTION FieldCorrection(const SimdVector2D &gradpsi, int i_simd)
Definition: field.hpp:36
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp) const
Definition: field.hpp:296
const double gamma_psi
Definition: field.hpp:28
double z0
Definition: field.hpp:33
z coordinate
Definition: globals.hpp:177
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:70
double E[2]
Definition: field.hpp:239
double V[3][2]
Definition: field.hpp:54
static constexpr int NPHI()
Definition: field.hpp:60
Definition: field.hpp:238
Field< VarType::Scalar, PhiInterpType::Planes > & operator+=(const Field< VarType::Scalar, PhiInterpType::Planes > &rhs)
Definition: field.hpp:229
static constexpr int NDIM()
Definition: field.hpp:286