38 :
gamma_psi(1.0/gradpsi.magnitude(i_simd)) {}
40 KOKKOS_INLINE_FUNCTION
void set(
int i_simd,
double basis,
const SimdVector2D &gradpsi){
41 r0 = basis + (1.0-basis) *
gamma_psi * gradpsi.
r[i_simd];
44 z1 = basis + (1.0-basis) *
gamma_psi * gradpsi.
r[i_simd];
49 template<VarType VT, PhiInterpType PIT>
57 static constexpr
int NDIM(){
return 3;}
58 static constexpr
int NPHI(){
return 2;}
59 static constexpr
int SIZE(){
return NDIM()*NPHI();}
69 vec.
r[i_simd] += wp*(wphi[0]*( corr.
r0*V[
PIR][0] + corr.
z0*V[
PIZ][0] )
70 + wphi[1]*( corr.
r0*V[
PIR][1] + corr.
z0*V[
PIZ][1] ) );
71 vec.
z[i_simd] += wp*(wphi[0]*( corr.
r1*V[
PIR][0] + corr.
z1*V[
PIZ][0] )
72 + wphi[1]*( corr.
r1*V[
PIR][1] + corr.
z1*V[PIZ][1] ) );
73 vec.
phi[i_simd] += wp*(wphi[0]* V[
PIP][0]
74 + wphi[1]* V[
PIP][1] );
118 static constexpr
int NDIM(){
return 2;}
119 static constexpr
int NPHI(){
return 2;}
120 static constexpr
int SIZE(){
return NDIM()*NPHI();}
130 vec.
r[i_simd] += wp*(wphi[0]*( corr.
r0*V[
PIR][0] + corr.
z0*V[
PIZ][0] )
131 + wphi[1]*( corr.
r0*V[
PIR][1] + corr.
z0*V[
PIZ][1] ) );
132 vec.
z[i_simd] += wp*(wphi[0]*( corr.
r1*V[
PIR][0] + corr.
z1*V[
PIZ][0] )
133 + wphi[1]*( corr.
r1*V[
PIR][1] + corr.
z1*V[PIZ][1] ) );
142 static constexpr
int NDIM(){
return 1;}
143 static constexpr
int NPHI(){
return 2;}
144 static constexpr
int SIZE(){
return NDIM()*NPHI();}
152 KOKKOS_INLINE_FUNCTION
void gather(
Simd<double>& sca,
int i_simd,
double wp,
const double (&wphi)[2])
const{
153 sca[i_simd] += wp* ( wphi[0]*S[0] + wphi[1]*S[1] );
164 # ifdef NEWGYROMATRIX
165 sca[i_simd] += wp* ( wts.
phi.
w[0]*wts.
rho[0].
w[0]*S[0]
167 + wts.
phi.
w[0]*wts.
rho[0].
w[1]*field2.
S[0]
168 + wts.
phi.
w[1]*wts.
rho[1].
w[1]*field2.
S[1]);
170 sca[i_simd] += wp* ( wts.
phi.
w[0]*wts.
rho.
w[0]*S[0]
173 + wts.
phi.
w[1]*wts.
rho.
w[1]*field2.
S[1]);
210 static constexpr
int NDIM(){
return 2;}
211 static constexpr
int NPHI(){
return 1;}
212 static constexpr
int SIZE(){
return NDIM()*NPHI();}
221 vec.
r[i_simd] += wp*( corr.
r0*E[
PIR] + corr.
z0*E[
PIZ] );
222 vec.
z[i_simd] += wp*( corr.
r1*E[
PIR] + corr.
z1*E[
PIZ] );
247 static constexpr
int NDIM(){
return 1;}
248 static constexpr
int NPHI(){
return 1;}
249 static constexpr
int SIZE(){
return NDIM()*NPHI();}
VarType
Definition: field.hpp:16
static constexpr int SIZE()
Definition: field.hpp:144
KOKKOS_INLINE_FUNCTION void set(int i_simd, double basis, const SimdVector2D &gradpsi)
Definition: field.hpp:40
Simd< double > r
Definition: simd.hpp:150
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const FieldWeights< GyroKin, PhiInterpType::None > &wts, const FieldCorrection &corr, const Field< VarType::Vector2D, PhiInterpType::None > &field2) const
Definition: field.hpp:233
static constexpr int NDIM()
Definition: field.hpp:210
constexpr VarType vec2d_if_axisym()
static constexpr int SIZE()
Definition: field.hpp:120
Definition: field.hpp:244
Definition: field.hpp:139
KOKKOS_INLINE_FUNCTION void scatter(const FieldWeights< DriftKin, PhiInterpType::Planes > &wts, double wp)
Definition: field.hpp:178
LinearWeights phi
Definition: field_weights.hpp:35
double r1
Definition: field.hpp:33
Field< VarType::Scalar, PhiInterpType::None > & operator+=(const Field< VarType::Scalar, PhiInterpType::None > &rhs)
Definition: field.hpp:271
static constexpr int NPHI()
Definition: field.hpp:143
KOKKOS_INLINE_FUNCTION void scatter(const FieldWeights< DriftKin, PhiInterpType::None > &wts, double wp)
Definition: field.hpp:261
KOKKOS_INLINE_FUNCTION void scatter(const FieldWeights< GyroKin, PhiInterpType::None > &wts, double wp, Field< VarType::Scalar, PhiInterpType::None > &field2)
Definition: field.hpp:266
double S[2]
Definition: field.hpp:140
double r0
Definition: field.hpp:32
Definition: field_weights.hpp:33
Definition: field_weights.hpp:49
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const double(&wphi)[2], const FieldCorrection &corr) const
Definition: field.hpp:68
LinearWeights rho
Definition: field_weights.hpp:36
r coordinate
Definition: globals.hpp:156
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const FieldCorrection &corr) const
Definition: field.hpp:220
static constexpr int SIZE()
Definition: field.hpp:249
static constexpr int NDIM()
Definition: field.hpp:118
KOKKOS_INLINE_FUNCTION void access_add(T *addr, T val)
Definition: access_add.hpp:30
static constexpr int NPHI()
Definition: field.hpp:248
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const double(&wphi)[2], const FieldCorrection &corr) const
Definition: field.hpp:129
Definition: field_weights.hpp:62
static constexpr int NPHI()
Definition: field.hpp:211
static constexpr int SIZE()
Definition: field.hpp:212
double z1
Definition: field.hpp:35
double S
Definition: field.hpp:245
Simd< double > z
Definition: simd.hpp:141
double w[2]
Definition: linear_weights.hpp:9
KOKKOS_INLINE_FUNCTION void gather(Simd< double > &sca, int i_simd, double wp, const FieldWeights< GyroKin, PhiInterpType::Planes > &wts, const Field< VarType::Scalar, PhiInterpType::Planes > &field2) const
Definition: field.hpp:163
KOKKOS_INLINE_FUNCTION void gather(Simd< double > &sca, int i_simd, double wp)
Definition: field.hpp:256
Simd< double > phi
Definition: simd.hpp:152
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const FieldWeights< GyroKin, PhiInterpType::Planes > &wts, const FieldCorrection &corr, const Field< VarType::Vector, PhiInterpType::Planes > &field2) const
Definition: field.hpp:85
static constexpr int NDIM()
Definition: field.hpp:57
Simd< double > z
Definition: simd.hpp:151
static constexpr int SIZE()
Definition: field.hpp:59
static constexpr int NPHI()
Definition: field.hpp:119
Simd< double > r
Definition: simd.hpp:140
static constexpr int NDIM()
Definition: field.hpp:247
LinearWeights phi
Definition: field_weights.hpp:51
KOKKOS_INLINE_FUNCTION void gather(Simd< double > &sca, int i_simd, double wp, const double(&wphi)[2]) const
Definition: field.hpp:152
KOKKOS_INLINE_FUNCTION void scatter(const FieldWeights< GyroKin, PhiInterpType::Planes > &wts, double wp, Field< VarType::Scalar, PhiInterpType::Planes > &field2)
Definition: field.hpp:184
static constexpr int NDIM()
Definition: field.hpp:142
phi coordinate
Definition: globals.hpp:158
KOKKOS_INLINE_FUNCTION FieldCorrection(const SimdVector2D &gradpsi, int i_simd)
Definition: field.hpp:37
LinearWeights rho
Definition: field_weights.hpp:64
const double gamma_psi
Definition: field.hpp:29
double z0
Definition: field.hpp:34
z coordinate
Definition: globals.hpp:157
double E[2]
Definition: field.hpp:208
double V[3][2]
Definition: field.hpp:55
static constexpr int NPHI()
Definition: field.hpp:58
Definition: field.hpp:207
Field< VarType::Scalar, PhiInterpType::Planes > & operator+=(const Field< VarType::Scalar, PhiInterpType::Planes > &rhs)
Definition: field.hpp:198
Definition: field_weights.hpp:74