ASCOT5
Loading...
Searching...
No Matches
Functions
gctransform.h File Reference

Header file for gctransform.c. More...

#include "ascot5.h"

Go to the source code of this file.

Functions

void gctransform_setorder (int order)
 Set the order of the transformation.
 
DECLARE_TARGET_SIMD void gctransform_particle2guidingcenter (real mass, real charge, real *B_dB, real r, real phi, real z, real pr, real pphi, real pz, real *R, real *Phi, real *Z, real *ppar, real *mu, real *zeta)
 Transform particle to guiding center phase space.
 
DECLARE_TARGET_SIMD void gctransform_guidingcenter2particle (real mass, real charge, real *B_dB, real R, real Phi, real Z, real ppar, real mu, real zeta, real *r, real *phi, real *z, real *pparprt, real *muprt, real *zetaprt)
 Transform guiding center to particle phase space.
 
DECLARE_TARGET_SIMD void gctransform_pparmuzeta2prpphipz (real mass, real charge, real *B_dB, real phi, real ppar, real mu, real zeta, real *pr, real *pphi, real *pz)
 Transform particle ppar, mu, and zeta to momentum vector.
 

Detailed Description

Header file for gctransform.c.

Definition in file gctransform.h.

Function Documentation

◆ gctransform_setorder()

void gctransform_setorder ( int order)

Set the order of the transformation.

Parameters
orderorder which is either zero or one

Definition at line 62 of file gctransform.c.

◆ gctransform_particle2guidingcenter()

DECLARE_TARGET_SIMD void gctransform_particle2guidingcenter ( real mass,
real charge,
real * B_dB,
real r,
real phi,
real z,
real pr,
real pphi,
real pz,
real * R,
real * Phi,
real * Z,
real * ppar,
real * mu,
real * zeta )

Transform particle to guiding center phase space.

The transformation is done from coordinates [r, phi, z, pr, pphi, pz] to [R, Phi, Z, ppar, mu, zeta]. If particle is neutral, the transformation will be in zeroth order both in real and momentum space as that transformation is valid when q = 0.

Parameters
massmass [kg]
chargecharge [C]
B_dBgradient of magnetic field vector at particle position
rparticle R coordinate [m]
phiparticle phi coordinate [rad]
zparticle z coordinate [m]
prparticle momentum R component [kg m/s]
pphiparticle momentum phi component [kg m/s]
pzparticle momentum z component [kg m/s]
Rpointer to guiding center R coordinate [m]
Phipointer to guiding center phi coordinate [rad]
Zpointer to guiding center z coordinate [m]
pparpointer to guiding center parallel momentum [kg m/s]
mupointer to guiding center magnetic moment [J/T]
zetapointer to guiding center gyroangle [rad]

Definition at line 90 of file gctransform.c.

◆ gctransform_guidingcenter2particle()

DECLARE_TARGET_SIMD void gctransform_guidingcenter2particle ( real mass,
real charge,
real * B_dB,
real R,
real Phi,
real Z,
real ppar,
real mu,
real zeta,
real * r,
real * phi,
real * z,
real * pparprt,
real * muprt,
real * zetaprt )

Transform guiding center to particle phase space.

The transformation is done from coordinates [R, Phi, Z, ppar, mu] to [r, phi, z, ppar_prt, mu_prt, zeta_prt]. If particle is neutral, the transformation will be in zeroth order both in real and momentum space as that transformation is valid when q = 0.

Parameters
massmass [kg]
chargecharge [C]
B_dBgradient of magnetic field vector at guiding center position
Rguiding center R coordinate [m]
Phiguiding center phi coordinate [rad]
Zguiding center z coordinate [m]
pparguiding center parallel momentum [kg m/s]
muguiding center magnetic moment [J/T]
zetaguiding center gyroangle [rad]
rpointer to particle R coordinate [m]
phipointer to particle phi coordinate [rad]
zpointer to particle z coordinate [m]
pparprtpointer to particle parallel momentum [kg m/s]
muprtpointer to particle magnetic moment [J/T]
zetaprtpointer to particle gyroangle [rad]

Definition at line 329 of file gctransform.c.

◆ gctransform_pparmuzeta2prpphipz()

DECLARE_TARGET_SIMD void gctransform_pparmuzeta2prpphipz ( real mass,
real charge,
real * B_dB,
real phi,
real ppar,
real mu,
real zeta,
real * pr,
real * pphi,
real * pz )

Transform particle ppar, mu, and zeta to momentum vector.

The transformation is done from coordinates [R, Phi, Z, ppar, mu] to [r, phi, z, pr, pphi, pz]. The transformation is done to first order.

Parameters
massmass [kg]
chargecharge [C]
B_dBgradient of magnetic field vector at particle position
phiparticle phi coordinate [rad]
pparparticle parallel momentum [kg m/s]
muparticle magnetic moment [J/T]
zetaparticle gyroangle [rad]
prpointer to particle momentum R-component [kg m/s]
pphipointer to particle momentum phi-component [kg m/s]
pzpointer to particle momentum z-component [kg m/s]

Definition at line 554 of file gctransform.c.