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) |
| Evaluate the equilibrium magnetic-field magnitude. | |
| static void | getGeometry (Real s, Real chi, Real &jac, Real &g11, Real &g12, Real &g21, Real &g22, Real &B0) |
| Evaluate the geometry coefficients consumed by matrix assembly. | |
| static void | getGeometry_cylinder (Real x, Real R, Real a, Real &jac, Real &g11, Real &g12, Real &g21, Real &g22, Real &B0, Real &Bz) |
| Evaluate cylindrical geometry with the configured \(q(r)\) profile. | |
| static void | getGeometry_straightcylinder (Real x, Real &jac, Real &g11, Real &g12, Real &g21, Real &g22, Real &B0, Real &Bz) |
| Evaluate the straight-cylinder test geometry. | |
| static Real | getJacobian (Real s, Real chi) |
| Evaluate the equilibrium-coordinate Jacobian. | |
| static Real | getJacobianDerivative (Real s, Real chi) |
| Evaluate the radial derivative of the coordinate Jacobian. | |
| 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) |
| Return the constant-profile test model. | |
| static Real | getSafetyFactor (Real s) |
| Evaluate the dimensionless magnetic safety factor. | |
| 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_) |
| Set the five coefficients of the cylindrical safety-factor polynomial. | |
| static Real | safetyFactor (Real x, Real a) |
| Evaluate the cylindrical safety-factor polynomial. | |
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).
Evaluate the equilibrium magnetic-field magnitude.
| [in] | s | Normalized radial coordinate. |
| [in] | chi | Straight-field-line poloidal angle, in radians. |
profilesWrapper.F90: getB0; equil.F90: equil_absb.
|
static |
Evaluate the geometry coefficients consumed by matrix assembly.
| [in] | s | Normalized radial coordinate. |
| [in] | chi | Straight-field-line poloidal angle, in radians. |
| [out] | jac | Equilibrium-coordinate Jacobian in solver normalization. |
| [out] | g11 | Contravariant radial-radial metric coefficient. |
| [out] | g12 | Contravariant radial-poloidal metric coefficient. |
| [out] | g21 | Contravariant poloidal-radial metric coefficient. |
| [out] | g22 | Contravariant poloidal-poloidal metric coefficient. |
| [out] | B0 | Magnetic-field magnitude in normalized units. |
profilesWrapper.F90: getGeometry and getGeometry_ORB5.
|
static |
Evaluate cylindrical geometry with the configured \(q(r)\) profile.
| [in] | x | Cylinder radial coordinate, in the same length units as R and a. |
| [in] | R | Major radius used by the cylindrical model. |
| [in] | a | Reference minor radius used to normalize x. |
| [out] | jac | Coordinate Jacobian. |
| [out] | g11 | Radial-radial contravariant metric coefficient. |
| [out] | g12 | Radial-poloidal contravariant metric coefficient. |
| [out] | g21 | Poloidal-radial contravariant metric coefficient. |
| [out] | g22 | Poloidal-poloidal contravariant metric coefficient. |
| [out] | B0 | Total magnetic-field magnitude in normalized units. |
| [out] | Bz | Axial magnetic-field component in normalized units. |
profilesWrapper.F90: getGeometry_cylinder.
|
static |
Evaluate the straight-cylinder test geometry.
| [in] | x | Cylinder radial coordinate in the model's normalized units. |
| [out] | jac | Coordinate Jacobian. |
| [out] | g11 | Radial-radial contravariant metric coefficient. |
| [out] | g12 | Radial-poloidal contravariant metric coefficient. |
| [out] | g21 | Poloidal-radial contravariant metric coefficient. |
| [out] | g22 | Poloidal-poloidal contravariant metric coefficient. |
| [out] | B0 | Total magnetic-field magnitude in normalized units. |
| [out] | Bz | Axial magnetic-field component in normalized units. |
profilesWrapper.F90: getGeometry_straightcylinder.Evaluate the equilibrium-coordinate Jacobian.
| [in] | s | Normalized radial coordinate. |
| [in] | chi | Straight-field-line poloidal angle, in radians. |
profilesWrapper.F90: getJacobian; equil.F90: jacob.Evaluate the radial derivative of the coordinate Jacobian.
| [in] | s | Normalized radial coordinate. |
| [in] | chi | Straight-field-line poloidal angle, in radians. |
profilesWrapper.F90: getJacobianDerivative;equil.F90: jacobDerivative.
|
static |
Get profile gradients dT/ds and dN/ds (Fortran: getProfileGradients)
| s | Normalized radial coordinate. | |
| isp | Species index (1-based, Fortran convention) | |
| [out] | dTj0ds | Radial temperature derivative. |
| [out] | dNj0ds | Radial density derivative. |
|
static |
Get temperature and density profiles (Fortran: getProfiles)
| s | Normalized radial coordinate. | |
| chi | Straight-field-line poloidal angle in radians. | |
| isp | Species index (1-based, Fortran convention) | |
| [out] | Tj0 | Equilibrium temperature in normalized units. |
| [out] | Nj0 | Equilibrium number density in normalized units. |
Return the constant-profile test model.
| [out] | Tj0 | Unit normalized temperature. |
| [out] | Nj0 | Unit normalized density. |
Evaluate the dimensionless magnetic safety factor.
| [in] | s | Normalized radial coordinate. |
profilesWrapper.F90: getSafetyFactor; equil.F90: qchi.Get species charge and mass (Fortran: getSpecies)
| isp | Species index (1-based, Fortran convention) | |
| [out] | qj | Species charge in ORB5X normalized units. |
| [out] | mj | Species mass in ORB5X normalized units. |
|
static |
Set the five coefficients of the cylindrical safety-factor polynomial.
| [in] | qsc_ | Coefficients in increasing polynomial order. |
profilesWrapper.F90: initSafetyFactor.Evaluate the cylindrical safety-factor polynomial.
| [in] | x | Minor-radius coordinate, in the same length units as a. |
| [in] | a | Reference minor radius. |
x/a. profilesWrapper.F90: safetyFactor.