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>
60 static constexpr
int NDIM(){
return 3;}
61 static constexpr
int NPHI(){
return 2;}
62 static constexpr
int SIZE(){
return NDIM()*NPHI();}
72 vec.
r[i_simd] += wp*(wphi[0]*( corr.
r0*V[
PIR][0] + corr.
z0*V[
PIZ][0] )
73 + wphi[1]*( corr.
r0*V[
PIR][1] + corr.
z0*V[
PIZ][1] ) );
74 vec.
z[i_simd] += wp*(wphi[0]*( corr.
r1*V[
PIR][0] + corr.
z1*V[
PIZ][0] )
75 + wphi[1]*( corr.
r1*V[
PIR][1] + corr.
z1*V[PIZ][1] ) );
76 vec.
phi[i_simd] += wp*(wphi[0]* V[
PIP][0]
77 + wphi[1]* V[
PIP][1] );
124 static constexpr
int NDIM(){
return 2;}
125 static constexpr
int NPHI(){
return 2;}
126 static constexpr
int SIZE(){
return NDIM()*NPHI();}
136 vec.
r[i_simd] += wp*(wphi[0]*( corr.
r0*V[
PIR][0] + corr.
z0*V[
PIZ][0] )
137 + wphi[1]*( corr.
r0*V[
PIR][1] + corr.
z0*V[
PIZ][1] ) );
138 vec.
z[i_simd] += wp*(wphi[0]*( corr.
r1*V[
PIR][0] + corr.
z1*V[
PIZ][0] )
139 + wphi[1]*( 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();}
161 KOKKOS_INLINE_FUNCTION
void gather(
Simd<double>& sca,
int i_simd,
double wp,
const double (&wphi)[2])
const{
162 sca[i_simd] += wp* ( wphi[0]*S[0] + wphi[1]*S[1] );
173 # ifdef NEWGYROMATRIX
174 sca[i_simd] += wp* ( wts.
phi.
w[0]*wts.
rho[0].
w[0]*S[0]
176 + wts.
phi.
w[0]*wts.
rho[0].
w[1]*field2.
S[0]
177 + wts.
phi.
w[1]*wts.
rho[1].
w[1]*field2.
S[1]);
179 sca[i_simd] += wp* ( wts.
phi.
w[0]*wts.
rho.
w[0]*S[0]
182 + wts.
phi.
w[1]*wts.
rho.
w[1]*field2.
S[1]);
222 static constexpr
int NDIM(){
return 2;}
223 static constexpr
int NPHI(){
return 1;}
224 static constexpr
int SIZE(){
return NDIM()*NPHI();}
233 vec.
r[i_simd] += wp*( corr.
r0*E[
PIR] + corr.
z0*E[
PIZ] );
234 vec.
z[i_simd] += wp*( corr.
r1*E[
PIR] + corr.
z1*E[
PIZ] );
262 static constexpr
int NDIM(){
return 3;}
263 static constexpr
int NPHI(){
return 1;}
264 static constexpr
int SIZE(){
return NDIM()*NPHI();}
273 vec.
r[i_simd] += wp*V[
PIR];
274 vec.
z[i_simd] += wp*V[
PIZ];
275 vec.
phi[i_simd] += wp*V[
PIP];
287 static constexpr
int NDIM(){
return 1;}
288 static constexpr
int NPHI(){
return 1;}
289 static constexpr
int SIZE(){
return NDIM()*NPHI();}
320 KOKKOS_INLINE_FUNCTION
explicit operator double()
const {
325 KOKKOS_INLINE_FUNCTION
void operator = (
const double val) {
330 KOKKOS_INLINE_FUNCTION
void operator += (
const double val){
VarType
Definition: field.hpp:16
static constexpr int SIZE()
Definition: field.hpp:153
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:245
static constexpr int SIZE()
Definition: field.hpp:264
static constexpr int NDIM()
Definition: field.hpp:222
constexpr VarType vec2d_if_axisym()
static constexpr int SIZE()
Definition: field.hpp:126
Definition: field.hpp:281
Definition: field.hpp:145
KOKKOS_INLINE_FUNCTION void scatter(const FieldWeights< DriftKin, PhiInterpType::Planes > &wts, double wp)
Definition: field.hpp:187
LinearWeights phi
Definition: field_weights.hpp:35
double r1
Definition: field.hpp:33
static constexpr int NPHI()
Definition: field.hpp:152
KOKKOS_INLINE_FUNCTION void scatter(const FieldWeights< DriftKin, PhiInterpType::None > &wts, double wp)
Definition: field.hpp:301
KOKKOS_INLINE_FUNCTION void scatter(const FieldWeights< GyroKin, PhiInterpType::None > &wts, double wp, Field< VarType::Scalar, PhiInterpType::None > &field2)
Definition: field.hpp:306
double S[2]
Definition: field.hpp:146
double r0
Definition: field.hpp:32
PhiInterpType
Definition: globals.hpp:95
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:71
LinearWeights rho
Definition: field_weights.hpp:36
r coordinate
Definition: globals.hpp:162
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const FieldCorrection &corr) const
Definition: field.hpp:232
static constexpr int SIZE()
Definition: field.hpp:289
static constexpr int NDIM()
Definition: field.hpp:124
KOKKOS_INLINE_FUNCTION void access_add(T *addr, T val)
Definition: access_add.hpp:30
static constexpr int NPHI()
Definition: field.hpp:288
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp, const double(&wphi)[2], const FieldCorrection &corr) const
Definition: field.hpp:135
Definition: field_weights.hpp:62
static constexpr int NPHI()
Definition: field.hpp:223
static constexpr int NPHI()
Definition: field.hpp:263
static constexpr int SIZE()
Definition: field.hpp:224
double z1
Definition: field.hpp:35
double S
Definition: field.hpp:282
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:172
KOKKOS_INLINE_FUNCTION void gather(Simd< double > &sca, int i_simd, double wp)
Definition: field.hpp:296
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:88
static constexpr int NDIM()
Definition: field.hpp:60
Simd< double > z
Definition: simd.hpp:151
static constexpr int SIZE()
Definition: field.hpp:62
static constexpr int NPHI()
Definition: field.hpp:125
Simd< double > r
Definition: simd.hpp:140
static constexpr int NDIM()
Definition: field.hpp:287
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:161
KOKKOS_INLINE_FUNCTION void scatter(const FieldWeights< GyroKin, PhiInterpType::Planes > &wts, double wp, Field< VarType::Scalar, PhiInterpType::Planes > &field2)
Definition: field.hpp:193
static constexpr int NDIM()
Definition: field.hpp:151
phi coordinate
Definition: globals.hpp:164
KOKKOS_INLINE_FUNCTION FieldCorrection(const SimdVector2D &gradpsi, int i_simd)
Definition: field.hpp:37
KOKKOS_INLINE_FUNCTION void gather(SimdVector &vec, int i_simd, double wp) const
Definition: field.hpp:272
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:163
double E[2]
Definition: field.hpp:217
double V[3][2]
Definition: field.hpp:55
static constexpr int NPHI()
Definition: field.hpp:61
Definition: field.hpp:216
Field< VarType::Scalar, PhiInterpType::Planes > & operator+=(const Field< VarType::Scalar, PhiInterpType::Planes > &rhs)
Definition: field.hpp:207
Definition: field_weights.hpp:74
static constexpr int NDIM()
Definition: field.hpp:262