ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
Loading...
Searching...
No Matches
orb5x::ProfilesWrapper Class Reference

Wrapper for profile and geometry functions used by solver. More...

#include "profiles_wrapper.hpp"

Static Public Member Functions

static Real getB0 (Real s, Real chi)
 Get magnetic field magnitude |B| at (s, chi) (Fortran: getB0 -> equil_absb).
static void getGeometry (Real s, Real chi, Real &jac, Real &g11, Real &g12, Real &g21, Real &g22, Real &B0)
 Get geometry: Jacobian, metric tensor components, and |B| (Fortran: getGeometry).
static void getGeometry_cylinder (Real x, Real R, Real a, Real &jac, Real &g11, Real &g12, Real &g21, Real &g22, Real &B0, Real &Bz)
 Cylinder geometry with q profile (Fortran: getGeometry_cylinder).
static void getGeometry_straightcylinder (Real x, Real &jac, Real &g11, Real &g12, Real &g21, Real &g22, Real &B0, Real &Bz)
 Straight cylinder geometry (Fortran: getGeometry_straightcylinder).
static Real getJacobian (Real s, Real chi)
 Get Jacobian J at (s, chi) (Fortran: getJacobian -> jacob).
static Real getJacobianDerivative (Real s, Real chi)
 Get Jacobian derivative dJ/ds at (s, chi) (Fortran: getJacobianDerivative -> jacobDerivative).
static void getProfileGradients (Real s, int isp, Real &dTj0ds, Real &dNj0ds)
 Get profile gradients dT/ds and dN/ds (Fortran: getProfileGradients).
static void getProfiles (Real s, Real chi, int isp, Real &Tj0, Real &Nj0)
 Get temperature and density profiles (Fortran: getProfiles).
static void getProfiles_constant (Real &Tj0, Real &Nj0)
 Get constant profiles: Tj0 = 1, Nj0 = 1 (Fortran: getProfiles_constant).
static Real getSafetyFactor (Real s)
 Get safety factor q at radial position s (Fortran: getSafetyFactor -> qchi).
static void getSpecies (int isp, Real &qj, Real &mj)
 Get species charge and mass (Fortran: getSpecies).
static void initSafetyFactor (const std::array< Real, 5 > &qsc_)
 Initialize safety factor polynomial coefficients (Fortran: initSafetyFactor).
static Real safetyFactor (Real x, Real a)
 Evaluate safety factor polynomial q(x/a) (Fortran: safetyFactor).

Detailed Description

Wrapper for profile and geometry functions used by solver.

Provides interface to equilibrium and species data. C++ port of Fortran module profilesWrapper (profilesWrapper.F90).

Species indexing convention: All public functions take isp as a 1-based species index, matching the Fortran calling convention (isp = 1 for first species). Internally, isp is passed unchanged to Equil functions (which also expect 1-based), and converted to 0-based isp0 = isp - 1 once at function entry for C++ container access (std::vector, Kokkos::View).

Member Function Documentation

◆ getB0()

Real orb5x::ProfilesWrapper::getB0 ( Real s,
Real chi )
static

Get magnetic field magnitude |B| at (s, chi) (Fortran: getB0 -> equil_absb).

◆ getGeometry()

void orb5x::ProfilesWrapper::getGeometry ( Real s,
Real chi,
Real & jac,
Real & g11,
Real & g12,
Real & g21,
Real & g22,
Real & B0 )
static

Get geometry: Jacobian, metric tensor components, and |B| (Fortran: getGeometry).

◆ getGeometry_cylinder()

void orb5x::ProfilesWrapper::getGeometry_cylinder ( Real x,
Real R,
Real a,
Real & jac,
Real & g11,
Real & g12,
Real & g21,
Real & g22,
Real & B0,
Real & Bz )
static

Cylinder geometry with q profile (Fortran: getGeometry_cylinder).

◆ getGeometry_straightcylinder()

void orb5x::ProfilesWrapper::getGeometry_straightcylinder ( Real x,
Real & jac,
Real & g11,
Real & g12,
Real & g21,
Real & g22,
Real & B0,
Real & Bz )
static

Straight cylinder geometry (Fortran: getGeometry_straightcylinder).

◆ getJacobian()

Real orb5x::ProfilesWrapper::getJacobian ( Real s,
Real chi )
static

Get Jacobian J at (s, chi) (Fortran: getJacobian -> jacob).

◆ getJacobianDerivative()

Real orb5x::ProfilesWrapper::getJacobianDerivative ( Real s,
Real chi )
static

Get Jacobian derivative dJ/ds at (s, chi) (Fortran: getJacobianDerivative -> jacobDerivative).

◆ getProfileGradients()

void orb5x::ProfilesWrapper::getProfileGradients ( Real s,
int isp,
Real & dTj0ds,
Real & dNj0ds )
static

Get profile gradients dT/ds and dN/ds (Fortran: getProfileGradients).

Parameters
sNormalized radial coordinate.
ispSpecies index (1-based, Fortran convention)
[out]dTj0dsRadial temperature derivative.
[out]dNj0dsRadial density derivative.

◆ getProfiles()

void orb5x::ProfilesWrapper::getProfiles ( Real s,
Real chi,
int isp,
Real & Tj0,
Real & Nj0 )
static

Get temperature and density profiles (Fortran: getProfiles).

Parameters
sNormalized radial coordinate.
chiStraight-field-line poloidal angle in radians.
ispSpecies index (1-based, Fortran convention)
[out]Tj0Equilibrium temperature in normalized units.
[out]Nj0Equilibrium number density in normalized units.

◆ getProfiles_constant()

void orb5x::ProfilesWrapper::getProfiles_constant ( Real & Tj0,
Real & Nj0 )
static

Get constant profiles: Tj0 = 1, Nj0 = 1 (Fortran: getProfiles_constant).

◆ getSafetyFactor()

Real orb5x::ProfilesWrapper::getSafetyFactor ( Real s)
static

Get safety factor q at radial position s (Fortran: getSafetyFactor -> qchi).

◆ getSpecies()

void orb5x::ProfilesWrapper::getSpecies ( int isp,
Real & qj,
Real & mj )
static

Get species charge and mass (Fortran: getSpecies).

Parameters
ispSpecies index (1-based, Fortran convention)
[out]qjSpecies charge in ORB5X normalized units.
[out]mjSpecies mass in ORB5X normalized units.

◆ initSafetyFactor()

void orb5x::ProfilesWrapper::initSafetyFactor ( const std::array< Real, 5 > & qsc_)
static

Initialize safety factor polynomial coefficients (Fortran: initSafetyFactor).

◆ safetyFactor()

Real orb5x::ProfilesWrapper::safetyFactor ( Real x,
Real a )
static

Evaluate safety factor polynomial q(x/a) (Fortran: safetyFactor).


The documentation for this class was generated from the following file: