ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
Loading...
Searching...
No Matches
prec_const.hpp File Reference

Scalar types, constants, dimensions, and model selectors. More...

#include <complex>
#include <cmath>
#include <cstdint>
Include dependency graph for prec_const.hpp:
This graph shows which files directly or indirectly include this file:

Namespaces

namespace  orb5x

Typedefs

using orb5x::Complex = std::complex<Real>
 Complex simulation scalar with Real components.
using orb5x::Int4 = int32_t
 Signed integer type with exactly 32 bits.
using orb5x::Int8 = int64_t
 Signed integer type with exactly 64 bits, used for marker counts.
using orb5x::Real = double
 Default floating-point type for normalized physics and numerics.
using orb5x::Real32 = float
 Explicit IEEE-like single-precision storage type.
using orb5x::Real64 = double
 Explicit IEEE-like double-precision storage type.

Enumerations

enum class  orb5x::CopyFields : int { orb5x::PH1 = 0 , orb5x::PH2 = 1 }
 Destination component for a split-potential field copy. More...
enum class  orb5x::CreateRhs : int { orb5x::PHI = 0 , orb5x::APA = 1 }
 Field equation for which a right-hand side is assembled. More...
enum class  orb5x::Diag3d : int { orb5x::POT = 0 , orb5x::DEN = 1 , orb5x::MOMENT = 2 }
 Top-level family of three-dimensional diagnostics. More...
enum class  orb5x::Diag3dDen : int { orb5x::RHO = 0 , orb5x::CURR = 1 }
 Deposited source written by the 3-D density diagnostic. More...
enum class  orb5x::GetPotDisp : int {
  orb5x::PHI = 0 , orb5x::PH1 = 1 , orb5x::PH2 = 2 , orb5x::APA = 3 ,
  orb5x::ASY = 4 , orb5x::RHO = 5 , orb5x::RHM = 6 , orb5x::CUR = 7 ,
  orb5x::EFN = 8 , orb5x::EFP = 9 , orb5x::EFU = 10 , orb5x::AHA = 11
}
 Field or source quantity reconstructed by get_pot_disp diagnostics. More...
enum class  orb5x::NSel3dDiag { orb5x::DIAG_REAL = 0 , orb5x::DIAG_RHS_F = 1 }
 Representation written by the single-field 3-D diagnostic. More...
enum class  orb5x::NSelAmpere { orb5x::ELECTROSTATIC = 0 , orb5x::EM_GYROAPAR = 1 , orb5x::EM_APAR = 2 }
 Electromagnetic content of the parallel Ampere solve. More...
enum class  orb5x::NSelAntenna {
  orb5x::ANT_OFF = 0 , orb5x::ANT_RHO = 1 , orb5x::ANT_JPAR = 2 , orb5x::ANT_PHI = 3 ,
  orb5x::ANT_APAR = 4
}
 Field source driven by the numerical antenna. More...
enum class  orb5x::NSelAntennaRadialProfile { orb5x::ANT_POLYNOMIAL = 0 , orb5x::ANT_SIN = 1 , orb5x::ANT_GAUSS = 2 , orb5x::ANT_INTERP = 3 }
 Radial envelope of the numerical antenna. More...
enum class  orb5x::NSelBacksolve { orb5x::PHI = 0 , orb5x::MASS = 1 , orb5x::APAR = 2 , orb5x::MOM = 3 }
 Quantity reconstructed by a field backsolve. More...
enum class  orb5x::NSelBeamType { orb5x::X_MODE = 0 , orb5x::O_MODE = 1 }
 Electromagnetic polarization of the ECRH beam. More...
enum class  orb5x::NSelBsplinesBasis { orb5x::BSPLINES_ORIGINAL = 0 , orb5x::BSPLINES_DEBOOR = 1 }
 Implementation used to evaluate the B-spline basis. More...
enum class  orb5x::NSelBufferType { orb5x::NO_BUFFER = 0 , orb5x::NAIVE_KROOK_BUFFER = 1 , orb5x::KROOK_CONS_BUFFER = 2 , orb5x::COLLISION_BUFFER = 3 }
 Outer radial buffer operator. More...
enum class  orb5x::NSelCollisions {
  orb5x::NO_COLL = 0 , orb5x::SELF_COLL_L = 1 , orb5x::MULTI_COLL_L = 2 , orb5x::SELF_COLL_NL = 3 ,
  orb5x::MULTI_COLL_NL = 4
}
 Monte-Carlo collision operator. More...
enum class  orb5x::NSelControlVariate { orb5x::NO_CV = 0 , orb5x::CORRECT_CURRENT = 1 }
 Current control-variate correction strategy. More...
enum class  orb5x::NSelDftMethod { orb5x::DFT_PPTRANSP = 0 , orb5x::DFT_LOCAL = 1 }
 Toroidal discrete-Fourier-transform implementation. More...
enum class  orb5x::NSelEfluid { orb5x::NO_EFLUID = 0 , orb5x::EFLUID_MHD = 1 , orb5x::EFLUID_DEBUG = 2 }
 Electron-fluid closure model. More...
enum class  orb5x::NSelElectronValues {
  orb5x::ELECTRON_VALUES_ORB5 = 0 , orb5x::ELECTRON_VALUES_LX_N = 1 , orb5x::ELECTRON_VALUES_LX_BETA = 2 , orb5x::ELECTRON_VALUES_T_N = 3 ,
  orb5x::ELECTRON_VALUES_T_BETA = 4
}
 Input quantities from which electron normalization is inferred. More...
enum class  orb5x::NSelF0 {
  orb5x::MAXWELLIAN = 0 , orb5x::BUMPONTAIL = 1 , orb5x::SLOWINGDOWN = 2 , orb5x::CDT = 3 ,
  orb5x::CDTN = 4 , orb5x::NUM_F0 = 5 , orb5x::SLOWINGDOWN_BUMP = 6 , orb5x::SLOWINGDOWN_PITCH = 7 ,
  orb5x::SLOWINGDOWN_PITCH_G_BREF = 8 , orb5x::SLOWINGDOWN_PITCH_O = 9 , orb5x::SLOWINGDOWN_PITCH_O_NOCHI = 10 , orb5x::BUMPONTAIL_O = 11 ,
  orb5x::BUMPONTAIL_O_NOCHI = 12 , orb5x::BUMPONTAIL_G_BREF = 13
}
 Equilibrium distribution function represented by a species. More...
enum class  orb5x::NSelFilter {
  orb5x::FILT_N = 0 , orb5x::FILT_MN = 1 , orb5x::FILT_MN_ONLY_FULL = 2 , orb5x::FILT_SAW = 3 ,
  orb5x::FILT_MN_N0M0 = 4
}
 Angular Fourier-mode filtering policy. More...
enum class  orb5x::NSelFixedSourceType { orb5x::SOURCE_BASIC = 0 , orb5x::SOURCE_ECRH = 1 }
 Fixed heating/source operator. More...
enum class  orb5x::NSelFixFields { orb5x::NO_FIX_FIELDS = 0 , orb5x::FIX_FIELDS_S2 = 1 , orb5x::FIX_FIELDS_SIN2_CHI = 2 , orb5x::FIX_FIELDS_SIN2_PHI = 3 }
 Analytic test pattern used to replace evolved fields. More...
enum class  orb5x::NSelGBref { orb5x::G_B0 = 0 , orb5x::G_BMIN = 1 , orb5x::G_BMAX = 2 }
 Magnetic-field value used to normalize energetic distributions. More...
enum class  orb5x::NSelGetField { orb5x::GET_FIELD_BY_PART = 0 , orb5x::GET_FIELD_BY_CELL = 1 }
 Grid-to-particle field-interpolation kernel organization. More...
enum class  orb5x::NSelGradp { orb5x::GRAD_POL = 0 , orb5x::GRAD_POL_CORR = 1 }
 Pressure-gradient discretization. More...
enum class  orb5x::NSelGyr { orb5x::ADAPT = 0 , orb5x::FIXED = 1 , orb5x::DK = 2 , orb5x::ADAPT_NAVG = 3 }
 Gyroaveraging-point selection strategy. More...
enum class  orb5x::NSelHeatsourceRadial { orb5x::RADIAL_CODE = 0 , orb5x::RADIAL_FILE = 1 }
 Source of the radial heat-deposition profile. More...
enum class  orb5x::NSelHybridModel { orb5x::NO_HYBRID_MODEL = 0 , orb5x::HYBRID_MODEL_UPGRADE = 1 , orb5x::STANDARD_HYBRID_MODEL = 2 }
 Kinetic trapped/passing hybrid model. More...
enum class  orb5x::NSelInitPert {
  orb5x::PERT_NOISE = 0 , orb5x::PERT_MODE_UNCORRECTED = 1 , orb5x::PERT_MODE = 2 , orb5x::PERT_MODE_TAE = 3 ,
  orb5x::PERT_MODE_SAW = 4 , orb5x::PERT_D_COS = 5 , orb5x::PERT_D_SIN = 6 , orb5x::PERT_RH_COS = 7 ,
  orb5x::PERT_RH_SIN = 8 , orb5x::PERT_RH_SIN_B = 9 , orb5x::PERT_TANH_SIN = 10 , orb5x::PERT_GENE = 11 ,
  orb5x::PERT_GENE_VPLL = 12 , orb5x::PERT_POTENTIAL = 13 , orb5x::PERT_RH_VPLL = 14 , orb5x::PERT_COLL_II_1 = 15 ,
  orb5x::PERT_COLL_II_2 = 16 , orb5x::PERT_COLL_II_3 = 17 , orb5x::PERT_COLL_II_4 = 18 , orb5x::PERT_SINGLEPART = 19 ,
  orb5x::PERT_LIGKA5 = 20 , orb5x::PERT_LIGKA5_AUTO = 21 , orb5x::PERT_GAUSS_LIST = 22
}
 Initial marker-weight or potential perturbation. More...
enum class  orb5x::NSelInnerBc { orb5x::NO_INNER_BC = 0 , orb5x::DIRICHLET_INNER_BC = 1 , orb5x::UNICITY_INNER_BC = 2 }
 Boundary condition at the magnetic axis. More...
enum class  orb5x::NSelIonValues {
  orb5x::ION_VALUES_ORB5 = 0 , orb5x::ION_VALUES_TAU_FPART = 1 , orb5x::ION_VALUES_TAU_N = 2 , orb5x::ION_VALUES_T_N = 3 ,
  orb5x::ION_VALUES_T_FPART = 4
}
 Input quantities from which main-ion normalization is inferred. More...
enum class  orb5x::NSelLoadphi { orb5x::UNIFORM = 0 , orb5x::HAMMERSLEY = 1 }
 Toroidal-angle marker-loading sequence. More...
enum class  orb5x::NSelLoadSpace { orb5x::SPACE_GAUSSIAN = 0 , orb5x::SPACE_ALPHAB = 1 }
 Electron configuration-space loading density. More...
enum class  orb5x::NSelLoadV { orb5x::LOAD_V2 = 0 , orb5x::LOAD_V3 = 1 , orb5x::LOAD_V2_NO_T = 2 }
 Velocity-space marker-loading density. More...
enum class  orb5x::NSelNoiseFilter { orb5x::SHIFTED = 0 , orb5x::ANTI_ALIGNED = 1 }
 Phase relation of the deposition noise-filter stencil. More...
enum class  orb5x::NSelNormalizeDensity { orb5x::ANNUAR = 0 , orb5x::FULL = 1 , orb5x::FREE = 2 , orb5x::TAE = 3 }
 Volume convention used to normalize species density. More...
enum class  orb5x::NSelPoisson { orb5x::LWA = 0 , orb5x::ARBITRARY = 1 , orb5x::PADE = 2 }
 Gyrokinetic polarization model in quasineutrality. More...
enum class  orb5x::NSelPotProfile {
  orb5x::NO_POT = 0 , orb5x::POT_BEN = 1 , orb5x::POT_SHEAR = 2 , orb5x::POT_PROF_FILE = 3 ,
  orb5x::POT_OGYROPSI = 4 , orb5x::POT_JAMIE = 5 , orb5x::POT_VPROF = 6
}
 Prescribed background-potential radial profile. More...
enum class  orb5x::NSelProfile {
  orb5x::TYPE_1 = 0 , orb5x::TYPE_2 = 1 , orb5x::TYPE_22 = 2 , orb5x::TYPE_3 = 3 ,
  orb5x::TYPE_4 = 4 , orb5x::INTERP_ITM = 5 , orb5x::INTERP_TRANSP = 6 , orb5x::TYPE_7 = 7 ,
  orb5x::TYPE_8 = 8 , orb5x::TYPE_9 = 9 , orb5x::TYPE_10 = 10
}
 Family of radial equilibrium density/temperature/flow profiles. More...
enum class  orb5x::NSelPszs { orb5x::PSZS_OFF = 0 , orb5x::PSZS_ONLINE = 1 , orb5x::PSZS_OFFLINE = 2 }
 Phase-space zonal-structure execution mode. More...
enum class  orb5x::NSelPszsType { orb5x::PSZS_W = 0 , orb5x::PSZS_F0 = 1 }
 Distribution quantity projected by PSZS. More...
enum class  orb5x::NSelPtransp { orb5x::PTRANSP_SERIAL = 0 , orb5x::PTRANSP_PARALLEL = 1 }
 Particle transport between toroidal spatial domains. More...
enum class  orb5x::NSelPullback { orb5x::NO_PULLBACK = 0 , orb5x::PULLBACK_DA_DT_0 = 1 , orb5x::PULLBACK_OHM = 2 }
 Electromagnetic pullback formulation. More...
enum class  orb5x::NSelPush {
  orb5x::PUSH_FULL = 0 , orb5x::NO_PUSH = 1 , orb5x::PUSH_UNPERT = 2 , orb5x::PUSH_FULL_TEST = 3 ,
  orb5x::PUSH_UNPERT_TEST = 4
}
 Marker trajectory, weight, and deposition evolution mode. More...
enum class  orb5x::NSelQProfile { orb5x::INTERP = 0 , orb5x::QUADRATIC = 1 , orb5x::QCOEF = 2 }
 Source of the equilibrium safety-factor profile. More...
enum class  orb5x::NSelQuasineutral { orb5x::QN_FREE = 0 , orb5x::QN_SET_NE = 1 , orb5x::QN_SET_N1 = 2 , orb5x::QN_SET_NL = 3 }
 Quasineutral-density closure imposed during normalization. More...
enum class  orb5x::NSelSetrho { orb5x::SETRHO_BY_PART = 0 , orb5x::SETRHO_BY_CELL = 1 , orb5x::SETRHO_BY_COLOR = 2 , orb5x::SETRHO_BY_COLOR_BUF = 3 }
 Particle-to-grid charge-deposition kernel organization. More...
enum class  orb5x::NSelSolve { orb5x::POISSON = 0 , orb5x::AMPERE = 1 , orb5x::DENS1 = 2 , orb5x::MOM = 3 }
 Field-system right-hand side/solve operation. More...
enum class  orb5x::NSelSolverMatrixType { orb5x::GBMAT = 0 , orb5x::PBMAT = 1 }
 Storage format of the radial solver matrix. More...
enum class  orb5x::NSelSortCache { orb5x::SORT_CACHE_OFF = 0 , orb5x::SORT_CACHE_ON = 1 }
 Guiding-centre sorting for memory locality. More...
enum class  orb5x::NSelSourceDiagnostics { orb5x::NC = 0 , orb5x::HEATING = 1 , orb5x::BUFFER = 2 }
 Source family represented by source-control diagnostics. More...
enum class  orb5x::NSelStrong {
  orb5x::STRONG_EXPECTED = 0 , orb5x::STRONG_UE2_S2 = 1 , orb5x::STRONG_UE2_SIN2_CHI = 2 , orb5x::STRONG_UE2_S2_SIN2_CHI = 3 ,
  orb5x::STRONG_UEPHI_SIN2_CHI = 4
}
 Analytic strong-form test field. More...
enum class  orb5x::NSelTestpart { orb5x::NO_TESTPART = 0 , orb5x::READ_TESTPART = 1 , orb5x::FIRSTS_TESTPART = 2 }
 Test-particle initialization and selection policy. More...
enum class  orb5x::NSelTilt { orb5x::NO_TILT = 0 , orb5x::RANDOM_TILT = 1 }
 Gyroangle rotation applied to gyroaveraging points. More...
enum class  orb5x::NSelTimeIntegrator { orb5x::RK4 = 0 , orb5x::GL4 = 1 }
 Global time-integration scheme. More...
enum class  orb5x::NSelVparallelI { orb5x::MHD = 0 , orb5x::ADHOC = 1 }
 Model used for the equilibrium ion parallel velocity. More...
enum class  orb5x::NSelVparConstantInF0 {
  orb5x::DH0 = 0 , orb5x::DVPAR1 = 1 , orb5x::NO_F0_CONSTANT = 2 , orb5x::DH0_CORR = 3 ,
  orb5x::DVPAR1_CORR = 4
}
 Prescription for the parallel invariant used in df0/dt. More...
enum class  orb5x::NSelWhichAttribute { orb5x::CHARGE = 0 , orb5x::CURRENT = 1 }
 Particle attribute deposited into a field right-hand side. More...
enum class  orb5x::NSelWhichMat { orb5x::T = 0 , orb5x::T_TRANSP = 1 , orb5x::T_INV = 2 }
 Algebraic transform requested from a solver matrix. More...
enum class  orb5x::ParallelMomentum { orb5x::P_PARALLEL = 0 , orb5x::V_PARALLEL = 1 , orb5x::MIXED = 2 }
 Parallel phase-space momentum coordinate. More...

Functions

constexpr Complex orb5x::IMA (0.0, 1.0)
 Imaginary unit used by Fourier-space operations.

Variables

constexpr int orb5x::ABSDF_DIA = 2
 Phase-space integral of absolute delta f.
constexpr int orb5x::ABSDF_IN_DIA = 10
 Absolute delta f inside the diagnostic volume.
constexpr int orb5x::ABSDF_OUT_DIA = 13
 Absolute delta f outside the diagnostic volume.
constexpr int orb5x::ABSG_DIA = 22
 Sum of absolute marker sampling distribution g.
constexpr int orb5x::ABSPWEIGHT_DIA = 17
 Sum of absolute second/background weights.
constexpr int orb5x::ALP_PIC = 2
 Marker loading/Jacobian factor alpha slot.
constexpr int orb5x::APA_2D_DIA = 2
 Global parallel-vector-potential spectrum.
constexpr int orb5x::APA_2D_LOC_DIA = 3
 Radially local parallel-vector-potential spectrum.
constexpr int orb5x::BUFFER_DENS_DIA = 8
 Buffer density contribution.
constexpr int orb5x::BUFFER_ENERGY_DIA = 9
 Buffer energy contribution.
constexpr int orb5x::BUFFER_VPLL_DIA = 11
 Buffer parallel-momentum contribution.
constexpr int orb5x::BUFFER_ZF_DIA = 10
 Buffer zonal-flow contribution.
constexpr int orb5x::CGRAINED_PIC = 6
 Coarse-grained marker-state flag slot.
constexpr int orb5x::CHI_DIA = 1
 Poloidal-angle displacement component.
constexpr int orb5x::CHI_PIC = 1
 Poloidal-angle slot in primary marker storage, radians.
constexpr int orb5x::cke = 0
 PSZS kinetic-energy coordinate slot.
constexpr Real orb5x::CLIGHT = 2.9979E8
 Speed of light in metres per second.
constexpr int orb5x::cmu = 2
 PSZS magnetic-moment coordinate slot.
constexpr int orb5x::ctam = 1
 PSZS toroidal-angular-momentum coordinate slot.
constexpr int orb5x::CUR_2D_DIA = 6
 Global parallel-current spectrum.
constexpr int orb5x::CUR_2D_LOC_DIA = 7
 Local parallel-current spectrum.
constexpr int orb5x::CURV_DIA = 3
 Magnetic-curvature drift contribution.
constexpr int orb5x::DENS_WT_PIC = 2
 Density-weight slot in deposition workspace.
constexpr int orb5x::DENSITY_LOSSES = 0
 Lost represented particle number.
constexpr int orb5x::DF_AV_2D_DIA = 0
 Two-dimensional average of delta f.
constexpr int orb5x::DF_VEL_2D_DIA = 1
 delta f on the two-dimensional velocity grid.
constexpr int orb5x::DFSUM_3_DIA = 5
 Cubic signed delta f sum.
constexpr int orb5x::DFSUM_4_DIA = 6
 Quartic delta f sum.
constexpr int orb5x::DN_PIC = 2
 Density increment slot.
constexpr int orb5x::DOTPZAPA_DIA = 7
 Time-derivative p_z A_parallel contribution.
constexpr int orb5x::DV2_PIC = 1
 Squared-speed/energy increment slot.
constexpr int orb5x::DVPAR_PIC = 0
 Parallel-momentum increment slot.
constexpr int orb5x::EBG_DIA = 5
 Background-electric-field contribution.
constexpr Real orb5x::ECHARGE = 1.6021765E-19
 Elementary charge magnitude in coulombs.
constexpr int orb5x::EF1_2D_DIA = 0
 Global first electric-field spectrum.
constexpr int orb5x::EF1_2D_LOC_DIA = 1
 Local first electric-field spectrum.
constexpr int orb5x::EF2_2D_DIA = 4
 Global second electric-field spectrum.
constexpr int orb5x::EF2_2D_LOC_DIA = 5
 Local second electric-field spectrum.
constexpr int orb5x::EFLUXF0H_DIA = 0
 f0 radial heat flux in helical cells.
constexpr int orb5x::EFLUXF0ISL_DIA = 0
 f0-weighted energy flux along perturbed magnetic field.
constexpr int orb5x::EFLUXF0ISLH_DIA = 2
 f0 heat flux along perturbed field in helical cells.
constexpr int orb5x::EFLUXWH_DIA = 1
 delta f radial heat flux in helical cells.
constexpr int orb5x::EFLUXWISL_DIA = 1
 delta f-weighted energy flux along perturbed magnetic field.
constexpr int orb5x::EFLUXWISLH_DIA = 3
 delta f heat flux along perturbed field in helical cells.
constexpr int orb5x::EKINF0_DIA = 9
 Equilibrium-distribution kinetic energy.
constexpr int orb5x::EKINF0_TR_DIA = 16
 Trapped-particle equilibrium kinetic energy.
constexpr int orb5x::ENERGY_LOSSES = 1
 Lost kinetic energy.
constexpr int orb5x::ENTROPY_DIA = 4
 Perturbed entropy measure.
constexpr int orb5x::ENTROPY_IN_DIA = 12
 Entropy inside the diagnostic volume.
constexpr int orb5x::ENTROPY_OUT_DIA = 15
 Entropy outside the diagnostic volume.
constexpr Real orb5x::EPSILONO = 8.8541878E-12
 Vacuum permittivity in farads per metre.
constexpr int orb5x::ETA_DIA = 4
 Second nonsingular axis-coordinate displacement.
constexpr int orb5x::ETRANSF0_DIA = 1
 Field-to-particle energy transfer weighted by f0.
constexpr int orb5x::ETRANSW_DIA = 0
 Field-to-particle energy transfer weighted by delta f.
constexpr Real orb5x::EULER = 0.5772156649015328606065120900824024310422
 Euler-Mascheroni constant.
constexpr int orb5x::EXB_DIA = 6
 ExB drift contribution.
constexpr int orb5x::EXBTOR_DIA = 5
 Toroidal ExB flow.
constexpr int orb5x::F_AV_2D_DIA = 2
 Distribution zeroth moment.
constexpr int orb5x::F_AVH_DIA = 7
 Helically binned distribution zeroth moment.
constexpr int orb5x::F_DIA = 3
 Distribution/density zeroth moment.
constexpr int orb5x::F_MS_DIA = 8
 Square of the mean distribution/density.
constexpr int orb5x::F_P_DIA = 9
 Passing-particle distribution zeroth moment.
constexpr int orb5x::F_TH_DIA = 3
 Poloidally binned distribution zeroth moment.
constexpr int orb5x::F_TR_DIA = 13
 Trapped-particle distribution zeroth moment.
constexpr int orb5x::F_VEL_2D_DIA = 2
 Total distribution on the velocity grid.
constexpr int orb5x::FFINIT_PIC = 3
 Initial equilibrium-distribution value slot.
constexpr int orb5x::FFINIT_PVOL_PIC = 0
 Initial f0 times marker phase volume.
constexpr int orb5x::FIELD_CORR_DIA = 3
 Corrected field contribution.
constexpr int orb5x::FIELD_DIA = 1
 Field contribution to fluctuation entropy.
constexpr Real orb5x::FIXED_POINT_RTOL = 1.0E-15
 Relative tolerance for fixed-point iteration.
constexpr int orb5x::FLUID_1 = 0
 First electron-fluid moment slot.
constexpr int orb5x::FLUID_2 = 1
 Second electron-fluid moment slot.
constexpr int orb5x::FLUID_3 = 2
 Third electron-fluid moment slot.
constexpr int orb5x::FLUID_4 = 3
 Fourth electron-fluid moment slot.
constexpr int orb5x::FLUID_5 = 4
 Fifth electron-fluid moment slot.
constexpr int orb5x::FLUID_6 = 5
 Sixth electron-fluid moment slot.
constexpr int orb5x::FLUID_7 = 6
 Seventh electron-fluid moment slot.
constexpr int orb5x::FLUX_CORR_DIA = 4
 Corrected flux contribution.
constexpr int orb5x::FLUX_DIA = 2
 Flux contribution to fluctuation entropy.
constexpr int orb5x::FLUX_WT_PIC = 1
 Flux-weight slot in deposition workspace.
constexpr int orb5x::FR_DETRAP = 3
 Transition identifier for trapped-to-passing motion.
constexpr int orb5x::FR_PASS = 1
 Passing-orbit classification identifier.
constexpr int orb5x::FR_RETRAP = 4
 Transition identifier for passing-to-trapped motion.
constexpr int orb5x::FR_TRAP = 2
 Trapped-orbit classification identifier.
constexpr int orb5x::FSELECT_APA = 3
 Select parallel vector potential A_parallel.
constexpr int orb5x::FSELECT_PHI = 1
 Select fluctuating electrostatic potential phi.
constexpr int orb5x::FSELECT_PHI0 = 2
 Select axisymmetric/background potential phi0.
constexpr int orb5x::FSIG_AV_DIA = 5
 Time-averaged distribution-function signal.
constexpr int orb5x::FSIG_DIA = 4
 Instantaneous distribution-function signal.
constexpr int orb5x::FU2_AV_2D_DIA = 4
 Parallel-velocity second moment.
constexpr int orb5x::FU_AV_2D_DIA = 3
 Parallel-velocity first moment.
constexpr int orb5x::FVP2_AV_2D_DIA = 5
 Perpendicular-speed second moment.
constexpr Real orb5x::GL4_A11 = 0.25
 Gauss-Legendre Butcher coefficient a11.
constexpr Real orb5x::GL4_A12 = -0.038675134594812866
 Gauss-Legendre Butcher coefficient a12.
constexpr Real orb5x::GL4_A21 = 0.53867513459481287
 Gauss-Legendre Butcher coefficient a21.
constexpr Real orb5x::GL4_A22 = 0.25
 Gauss-Legendre Butcher coefficient a22.
constexpr Real orb5x::GL4_C1 = 0.21132486540518713
 First node of two-stage fourth-order Gauss-Legendre integration.
constexpr Real orb5x::GL4_C2 = 0.78867513459481287
 Second Gauss-Legendre time node.
constexpr int orb5x::GRB_DIA = 2
 Grad-B drift contribution.
constexpr int orb5x::GRP_DIA = 4
 Pressure-gradient contribution.
constexpr int orb5x::GSUM_2_DIA = 24
 Second raw moment of g.
constexpr int orb5x::GSUM_3_DIA = 25
 Third raw moment of g.
constexpr int orb5x::GSUM_4_DIA = 26
 Fourth raw moment of g.
constexpr int orb5x::GSUM_DIA = 23
 First raw moment of marker sampling distribution g.
constexpr int orb5x::HEAT_DIA = 0
 Total radial heat flux.
constexpr int orb5x::HEAT_DIA_NEO = 3
 Neoclassical heat-flux component.
constexpr int orb5x::HEAT_P_DIA = 9
 Passing-particle heat flux.
constexpr int orb5x::HEAT_P_DIA_NEO = 13
 Neoclassical passing heat flux.
constexpr int orb5x::HEAT_TR_DIA = 10
 Trapped-particle heat flux.
constexpr int orb5x::HEAT_TR_DIA_NEO = 14
 Neoclassical trapped heat flux.
constexpr int orb5x::HEATING_DENS_DIA = 4
 Heating-source density contribution.
constexpr int orb5x::HEATING_ENERGY_DIA = 5
 Heating-source energy contribution.
constexpr int orb5x::HEATING_VPLL_DIA = 7
 Heating-source parallel-momentum contribution.
constexpr int orb5x::HEATING_ZF_DIA = 6
 Heating-source zonal-flow contribution.
constexpr int orb5x::ID_PIC = 0
 Globally persistent marker identifier slot.
constexpr int orb5x::ILARM_PIC = 1
 Offset of the first gyroaveraging point.
constexpr int orb5x::INNER_EDGE = 0
 Inner-radial-boundary loss slot.
constexpr int orb5x::JBOOT_DIA = 6
 Bootstrap-current moment.
constexpr int orb5x::JDOTE_DIA = 13
 Species energy transfer j dot E.
constexpr Real orb5x::KBOLTZ = 1.3806E-23
 Boltzmann constant in joules per kelvin.
constexpr int orb5x::KSI_DIA = 3
 First nonsingular axis-coordinate displacement.
constexpr int orb5x::KSIETA_PIC = 0
 Low-discrepancy loading-state slot.
constexpr Real orb5x::LNLAM = 15.0
 Reference Coulomb logarithm, dimensionless.
constexpr int orb5x::LOSSES_MOMENTS = 3
 Number of tracked loss moments.
constexpr int orb5x::lu_dat = 99
 Legacy generic-data unit.
constexpr int orb5x::lu_datn = 32
 Legacy density-data unit.
constexpr int orb5x::lu_datv = 100
 Legacy velocity-data unit.
constexpr int orb5x::lu_debug = 13
 Legacy debug-log unit.
constexpr int orb5x::lu_denprofs = 89
 Legacy density-profile unit.
constexpr int orb5x::lu_f0 = 90
 Legacy numerical-f0 unit.
constexpr int orb5x::lu_fields = 96
 Legacy saved-field unit.
constexpr int orb5x::lu_input = 16
 Legacy Fortran unit reserved for namelist input.
constexpr int orb5x::lu_io = 14
 Legacy general I/O unit.
constexpr int orb5x::lu_kprofs = 88
 Legacy gradient-profile unit.
constexpr int orb5x::lu_noh5 = 63
 Legacy non-HDF5 output unit.
constexpr int orb5x::lu_optidat = 75
 Legacy optimized-loading data unit.
constexpr int orb5x::lu_p1 = 81
 Legacy first potential-component unit.
constexpr int orb5x::lu_p2 = 83
 Legacy second potential-component unit.
constexpr int orb5x::lu_profiles = 78
 Legacy equilibrium-profile unit.
constexpr int orb5x::lu_profs = 87
 Legacy species-profile unit.
constexpr int orb5x::lu_pszs = 36
 Legacy PSZS-output unit.
constexpr int orb5x::lu_res = 34
 Legacy results unit.
constexpr int orb5x::lu_restime = 35
 Legacy restart-timing unit.
constexpr int orb5x::lu_stop = 31
 Legacy stop/status-file unit.
constexpr int orb5x::lu_test = 33
 Legacy test-output unit.
constexpr int orb5x::lu_testpart = 77
 Legacy test-particle input unit.
constexpr int orb5x::lu_tkdat = 97
 Legacy toolkit-data unit.
constexpr int orb5x::lu_tklog = 98
 Legacy toolkit-log unit.
constexpr int orb5x::lu_traj = 95
 Legacy trajectory-output unit.
constexpr int orb5x::lu_version = 15
 Legacy version-file unit.
constexpr int orb5x::MAX_PIC2_C = 7
 Auxiliary marker reals with coarse-graining extras.
constexpr int orb5x::MAX_PIC2_NC = 5
 Auxiliary marker reals without coarse-graining extras.
constexpr int orb5x::MAX_PIC3 = 2
 Integer/flag values in tertiary marker storage.
constexpr int orb5x::MAX_PIC4 = 1
 64-bit integer values stored per marker.
constexpr int orb5x::MAX_WORK_C = 6
 Primary marker reals with the second weight.
constexpr int orb5x::MAX_WORK_NC = 5
 Primary marker reals without the second weight.
constexpr Real orb5x::MEMKSA = 9.1094E-31
 Electron mass in kilograms.
constexpr Real orb5x::MIMKSA = 1.6726231E-27
 Reference proton/ion mass in kilograms.
constexpr int orb5x::moments_3d_size = 8
 Number of standard 3-D moments.
constexpr int orb5x::MOMENTUM_DIA = 2
 Total radial parallel-momentum flux.
constexpr int orb5x::MOMENTUM_DIA_NEO = 5
 Neoclassical momentum-flux component.
constexpr int orb5x::MPR_2D_ID_JDOTE_ES = 0
 Electrostatic j dot E transfer.
constexpr int orb5x::MPR_2D_ID_JDOTE_ES_S1 = 1
 Electrostatic j dot E in the selected radial interval.
constexpr int orb5x::MPR_2D_SIZE = 2
 Number of mode-particle-resonance 2-D quantities.
constexpr Real orb5x::MU0 = 4.0 * PI * 1e-7
 Vacuum permeability in henries per metre.
constexpr int orb5x::MU_PIC = 0
 Normalized magnetic-moment slot in auxiliary storage.
constexpr int orb5x::N_DF_AV_2D_DIA = 1
 Marker-count-weighted average of delta f.
constexpr int orb5x::N_VEL_2D_DIA = 0
 Marker count on the two-dimensional velocity grid.
constexpr int orb5x::NBIN_EN = 32
 Default heating energy bins.
constexpr int orb5x::NBIN_LAM = 64
 Default electron pitch lambda bins.
constexpr int orb5x::NBIN_MU = 128
 Magnetic-moment bins for bounce-averaged v_parallel/B.
constexpr int orb5x::NBIN_PSI0 = 64
 Flux bins for bounce-averaged v_parallel/B.
constexpr int orb5x::NBIN_R = 64
 Default heating radial bins.
constexpr int orb5x::NBIN_S = 32
 Default electron radial bins.
constexpr int orb5x::NBIN_THETA = 64
 Default electron poloidal-angle bins.
constexpr int orb5x::NBIN_XI = 64
 Default electron pitch-cosine xi bins.
constexpr int orb5x::NCONTROL_DENS_DIA = 0
 Noise-control density correction.
constexpr int orb5x::NCONTROL_ENERGY_DIA = 1
 Noise-control energy correction.
constexpr int orb5x::NCONTROL_VPLL_DIA = 3
 Noise-control parallel-momentum correction.
constexpr int orb5x::NCONTROL_ZF_DIA = 2
 Noise-control zonal-flow correction.
constexpr int orb5x::ndump = 12
 Legacy unit for formatted restart dumps.
constexpr int orb5x::ndump_bin_a = 11
 Legacy unit for binary array dumps.
constexpr int orb5x::ndump_bin_p = 10
 Legacy unit for binary particle dumps.
constexpr int orb5x::NLARM_PIC = 0
 Number of gyroaveraging points in Larmor metadata.
constexpr int orb5x::NOISE_AV_DIA = 7
 Time-averaged particle-noise estimator.
constexpr int orb5x::NOISE_DIA = 6
 Instantaneous particle-noise estimator.
constexpr int orb5x::NUMBER_SOURCE_DIAG = 12
 Number of one-dimensional source diagnostics.
constexpr int orb5x::NXI = 8
 Helical-angle bins in magnetic-island diagnostics.
constexpr int orb5x::OMP_ZERO = 0
 Zero offset used by OpenMP-compatible indexing paths.
constexpr int orb5x::OUTER_EDGE = 1
 Outer-radial-boundary loss slot.
constexpr int orb5x::P_PIC = 5
 Background/second-weight slot when two weights are enabled.
constexpr int orb5x::PAR_DIA = 1
 Parallel-electric-field contribution.
constexpr int orb5x::PARTICLE_DIA = 1
 Total radial particle flux.
constexpr int orb5x::PARTICLE_DIA_NEO = 4
 Neoclassical particle-flux component.
constexpr int orb5x::PARTICLE_P_DIA = 11
 Passing-particle particle flux.
constexpr int orb5x::PARTICLE_P_DIA_NEO = 15
 Neoclassical passing particle flux.
constexpr int orb5x::PARTICLE_TR_DIA = 12
 Trapped-particle particle flux.
constexpr int orb5x::PARTICLE_TR_DIA_NEO = 16
 Neoclassical trapped particle flux.
constexpr int orb5x::PARTQUANTS_NUMELS = 20
 Marker quantities written per test-particle record.
constexpr int orb5x::PEKIN_DIA = 7
 Marker-weighted kinetic energy.
constexpr int orb5x::PHASE_DF_DIA = 3
 Binned delta f.
constexpr int orb5x::PHASE_F0_DIA = 5
 Binned equilibrium distribution.
constexpr int orb5x::PHASE_NUMPART_DIA = 0
 Marker count in each phase-space bin.
constexpr int orb5x::PHASE_P_DIA = 4
 Background/second-weight sum.
constexpr int orb5x::PHASE_PVOL_DIA = 1
 Phase-space-volume sum.
constexpr int orb5x::PHASE_W2_DIA = 6
 Squared perturbation-weight sum.
constexpr int orb5x::PHASE_W_DIA = 2
 Perturbation-weight sum.
constexpr int orb5x::PHI_2D_DIA = 0
 Global electrostatic-potential spectrum.
constexpr int orb5x::PHI_2D_LOC_DIA = 1
 Radially local electrostatic-potential spectrum.
constexpr int orb5x::PHI_DIA = 2
 Toroidal-angle displacement component.
constexpr int orb5x::PHI_PIC = 2
 Toroidal-angle slot in primary marker storage, radians.
constexpr Real orb5x::PI = 3.141592653589793238462643383279502884197
 Circle constant pi.
constexpr Real orb5x::PIO2 = 1.57079632679489661923132169163975144209858
 Half pi, radians.
constexpr int orb5x::PNUMB_DIA = 3
 Total represented particle number.
constexpr int orb5x::PNUMB_IN_DIA = 11
 Particle number inside the diagnostic volume.
constexpr int orb5x::PNUMB_OUT_DIA = 14
 Particle number outside the diagnostic volume.
constexpr int orb5x::POLARISATION_TERM_DIVP0 = 9
 Divergence of equilibrium polarization P0.
constexpr int orb5x::POLARISATION_TERM_DIVQ0 = 10
 Divergence of equilibrium polarization flux Q0.
constexpr int orb5x::POLARISATION_TERM_P0 = 11
 Equilibrium polarization P0 term.
constexpr int orb5x::POLARISATION_TERM_Q0 = 12
 Equilibrium polarization flux Q0 term.
constexpr int orb5x::POLPROD_DIA = 5
 Polarization-product moment.
constexpr int orb5x::PSI0CORR_PIC = 4
 Corrected invariant-flux coordinate slot.
constexpr int orb5x::PULLBACK_DIA = 8
 Pullback-transformation contribution.
constexpr int orb5x::PVOL_PIC = 1
 Marker phase-space-volume slot.
constexpr int orb5x::PWEIGHTSUM_2_DIA = 19
 Second raw moment of the second weight.
constexpr int orb5x::PWEIGHTSUM_3_DIA = 20
 Third raw moment of the second weight.
constexpr int orb5x::PWEIGHTSUM_4_DIA = 21
 Fourth raw moment of the second weight.
constexpr int orb5x::PWEIGHTSUM_DIA = 18
 First raw moment of the second weight.
constexpr int orb5x::QP_DIA = 4
 Parallel heat-flux moment.
constexpr int orb5x::REV_ALP = 6
 Bit-reversed sequence for loading factor alpha.
constexpr int orb5x::REV_ETA = 1
 Bit-reversed sequence for the second spatial coordinate.
constexpr int orb5x::REV_KSI = 0
 Bit-reversed sequence for the first spatial coordinate.
constexpr int orb5x::REV_V1 = 2
 Bit-reversed sequence for the first velocity coordinate.
constexpr int orb5x::REV_V2 = 3
 Bit-reversed sequence for the second velocity coordinate.
constexpr int orb5x::REV_V3 = 5
 Bit-reversed sequence for the third velocity coordinate.
constexpr int orb5x::REV_W = 4
 Bit-reversed sequence for marker weights.
constexpr int orb5x::RHO_2D_DIA = 2
 Global charge-density spectrum.
constexpr int orb5x::RHO_2D_LOC_DIA = 3
 Local charge-density spectrum.
constexpr int orb5x::RHOG_PIC = 2
 Normalized gyroradius in Larmor metadata.
constexpr int orb5x::S_DIA = 0
 Radial displacement component.
constexpr int orb5x::S_PIC = 0
 Radial-coordinate slot in primary marker storage.
constexpr int orb5x::S_PROD_DIA = 0
 Entropy-production term.
constexpr int orb5x::SAMP_DF_DIA = 3
 Sampled delta f.
constexpr int orb5x::SAMP_F0_DIA = 5
 Sampled equilibrium distribution.
constexpr int orb5x::SAMP_NUMPART_DIA = 0
 Marker count in each sampling bin.
constexpr int orb5x::SAMP_P_DIA = 4
 Summed background/second weight.
constexpr int orb5x::SAMP_PVOL_DIA = 1
 Summed marker phase-space volume.
constexpr int orb5x::SAMP_W2_DIA = 6
 Summed squared perturbation weight.
constexpr int orb5x::SAMP_W_DIA = 2
 Summed perturbation weight.
constexpr int orb5x::SIGNAL_AV_DIA = 1
 Time-averaged total signal estimator.
constexpr int orb5x::SIGNAL_DIA = 0
 Instantaneous total signal estimator.
constexpr int orb5x::SIGNAL_NONZONAL_AV_DIA = 3
 Time-averaged nonzonal signal estimator.
constexpr int orb5x::SIGNAL_NONZONAL_DIA = 2
 Instantaneous nonzonal signal estimator.
constexpr Real orb5x::slope_line = 0.0
 Slope of the optimized-loading weight-limit line.
constexpr int orb5x::SOURCE_3D_DN_DIA = 1
 Three-dimensional source density rate.
constexpr int orb5x::SOURCE_3D_POWER_DIA = 0
 Three-dimensional deposited source power.
constexpr Real orb5x::SQRT2 = 1.41421356237309504880168872420969807856967
 Square root of two.
constexpr int orb5x::SUMF0_DIA = 8
 Marker sum of equilibrium distribution.
constexpr Real orb5x::T2GAUSS = 1.e4
 Number of gauss per tesla.
constexpr Real orb5x::thresh = 23.0
 Threshold parameter of optimized marker loading.
constexpr int orb5x::TMP_PHI_PIC = 5
 Temporary toroidal coordinate used by coarse graining.
constexpr int orb5x::TOR_MOMENTUM_DIA = 6
 Toroidal-momentum flux.
constexpr int orb5x::TOR_MOMENTUM_DIA_NEO = 7
 Neoclassical toroidal-momentum flux.
constexpr int orb5x::TOR_REYNOLDS_DIA = 8
 Toroidal Reynolds-stress contribution.
constexpr int orb5x::TOT_DIA = 0
 Total j dot E energy transfer.
constexpr int orb5x::TRAP_PIC = 1
 Trapped/passing classification slot.
constexpr Real orb5x::TWOPI = 6.283185307179586476925286766559005768394
 Full angular period, radians.
constexpr int orb5x::U_DIA = 5
 Parallel-velocity displacement component.
constexpr int orb5x::U_PIC = 3
 Normalized parallel-velocity slot.
constexpr int orb5x::UT2_DIA = 1
 Parallel-velocity second moment.
constexpr int orb5x::UT2_P_DIA = 7
 Passing-particle parallel-velocity second moment.
constexpr int orb5x::UT2_TR_DIA = 11
 Trapped-particle parallel-velocity second moment.
constexpr int orb5x::UT_DIA = 0
 Parallel-velocity first moment.
constexpr int orb5x::UT_MS_DIA = 7
 Square of the mean parallel velocity.
constexpr int orb5x::UT_P_DIA = 6
 Passing-particle parallel-velocity first moment.
constexpr int orb5x::UT_TR_DIA = 10
 Trapped-particle parallel-velocity first moment.
constexpr int orb5x::UW_PIC = 3
 Parallel-velocity-times-weight workspace slot.
constexpr int orb5x::V_PAR2_AVH_DIA = 5
 Helically binned parallel-velocity second moment.
constexpr int orb5x::V_PAR2_TH_DIA = 1
 Poloidally binned parallel-speed squared.
constexpr int orb5x::V_PAR_AVH_DIA = 4
 Helically binned parallel-velocity first moment.
constexpr int orb5x::V_PAR_TH_DIA = 0
 Poloidally binned parallel-velocity moment.
constexpr int orb5x::V_PERP2_AVH_DIA = 6
 Helically binned perpendicular-speed second moment.
constexpr int orb5x::V_PERP2_TH_DIA = 2
 Poloidally binned perpendicular-speed squared.
constexpr Real orb5x::vernum = 1.0
 Legacy numeric ORB5X file/version identifier.
constexpr int orb5x::VPLL_LOSSES = 2
 Lost parallel momentum.
constexpr int orb5x::VPLTOR_DIA = 4
 Toroidal projection of parallel flow.
constexpr int orb5x::VPT2_DIA = 2
 Perpendicular-speed second moment.
constexpr int orb5x::VPT2_P_DIA = 8
 Passing-particle perpendicular-speed second moment.
constexpr int orb5x::VPT2_TR_DIA = 12
 Trapped-particle perpendicular-speed second moment.
constexpr int orb5x::VPT_PIC = 1
 Normalized perpendicular-speed quantity.
constexpr int orb5x::W_AVERAGE = 0
 Mean marker weight.
constexpr int orb5x::W_DIA = 6
 Marker-weight displacement component.
constexpr int orb5x::W_PIC = 4
 Perturbed-distribution weight slot.
constexpr int orb5x::W_VARIANCE = 4
 Marker-weight variance.
constexpr int orb5x::WADI_AVERAGE = 2
 Mean adiabatic marker weight.
constexpr int orb5x::WADI_VARIANCE = 6
 Adiabatic-weight variance.
constexpr Real orb5x::wLimitFrac = 10.0
 Initial fractional marker-weight limit.
constexpr Real orb5x::wLimitFracLimit = 200.0
 Maximum fractional marker-weight limit.
constexpr int orb5x::WV_AVERAGE = 1
 Mean velocity-weighted marker weight.
constexpr int orb5x::WV_VARIANCE = 5
 Velocity-weighted marker-weight variance.
constexpr int orb5x::WVADI_AVERAGE = 3
 Mean velocity-weighted adiabatic weight.
constexpr int orb5x::WVADI_VARIANCE = 7
 Velocity-weighted adiabatic-weight variance.

Detailed Description

Scalar types, constants, dimensions, and model selectors.

Precision constants and type definitions for ORB5X C++ port.

Strongly typed NSel* enums name inherited choices; Real and Complex define the common simulation arithmetic types.

This file is a C++ translation of the Fortran module prec_const.F90.

VERIFICATION SUMMARY (verified against prec_const.F90):

  • Mathematical constants (PI, TWOPI, SQRT2, EULER, GL4_*, IMA): IDENTICAL
  • Physical constants (LNLAM, EPSILONO, MU0, MIMKSA, etc.): IDENTICAL
  • Logical unit numbers (lu_input, ndump, lu_io, etc.): IDENTICAL
  • Field selection constants (FSELECT_PHI, FSELECT_PHI0, FSELECT_APA): IDENTICAL
  • PIC parameters (S_PIC, CHI_PIC, etc.): Converted from 1-based to 0-based
  • Diagnostic indices (DIA constants): Converted from 1-based to 0-based
  • Size/count constants (MAX_WORK, NBIN_*, NUMBER_SOURCE_DIAG): IDENTICAL
  • Trap fraction identifiers (FR_PASS, FR_TRAP, etc.): IDENTICAL (type IDs, not indices)
  • All enumerations (NSelSolve, NSelAmpere, etc.): IDENTICAL (Fortran enum,bind(C) starts at 0)

INDEXING CONVENTION: All array index constants are 0-based in C++ (vs 1-based in Fortran). Each constant is annotated with "was N in Fortran" for traceability. Size/count constants and type identifiers remain unchanged.

Last verified: 2026-02-06