Evaluate weak-form coefficients for ORB5X field matrices. More...
#include "matrix_coeff.hpp"
Static Public Member Functions | |
| static void | calc_coefs (Real x, Real y, int matnum, bool nl_boundary, int nterms, std::vector< Complex > &c_j, std::vector< std::array< int, 2 > > &kdert, std::vector< std::array< int, 2 > > &kderw) |
Dispatch coefficient evaluation from a MATS matrix identifier. | |
| static void | coefeq1d (int kmat, int krterms, Real ps, std::vector< Real > &pcoef, std::vector< int > &kderw, std::vector< int > &kdert) |
| Evaluate radial coefficients for auxiliary one-dimensional matrices. | |
| static void | coefeq_adi_charge (int krterms, Real ps, Real pchi, std::vector< Real > &pcoef, std::vector< std::array< int, 2 > > &kderw, std::vector< std::array< int, 2 > > &kdert) |
| Evaluate the adiabatic-electron charge-response mass term. | |
| static void | coefeq_adi_curr (int krterms, Real ps, Real pchi, std::vector< Real > &pcoef, std::vector< std::array< int, 2 > > &kderw, std::vector< std::array< int, 2 > > &kdert) |
| Evaluate the adiabatic-electron parallel-current mass term. | |
| static void | coefeq_amp (int krterms, Real ps, Real pchi, std::vector< Real > &pcoef, std::vector< std::array< int, 2 > > &kderw, std::vector< std::array< int, 2 > > &kdert) |
| Evaluate skin/mass and perpendicular-Laplacian Ampere terms. | |
| static void | coefeq_lapl (bool nl_boundary, int krterms, Real ps, Real pchi, std::vector< Real > &pcoef, std::vector< std::array< int, 2 > > &kderw, std::vector< std::array< int, 2 > > &kdert) |
| Evaluate metric coefficients of the perpendicular Laplacian. | |
| static void | coefeq_mass (int krterms, Real ps, Real pchi, std::vector< Real > &pcoef, std::vector< std::array< int, 2 > > &kderw, std::vector< std::array< int, 2 > > &kdert) |
| Evaluate the Jacobian-weighted scalar mass term. | |
| static void | coefeq_ohm (int kmat, int krterms, Real ps, Real pchi, std::vector< Real > &pcoef, std::vector< std::array< int, 2 > > &kderw, std::vector< std::array< int, 2 > > &kdert) |
| Evaluate Ohm, continuity, pressure, or Ampere-mass coupling terms. | |
| static void | coefeq_qn (int kmat, int krterms, Real ps, Real pchi, std::vector< Real > &pcoef, std::vector< std::array< int, 2 > > &kderw, std::vector< std::array< int, 2 > > &kdert) |
| Evaluate adiabatic-response and polarization-density terms. | |
| static void | coefeq_test (int kmat, int krterms, std::vector< Real > &pcoef, std::vector< std::array< int, 2 > > &kderw, std::vector< std::array< int, 2 > > &kdert) |
| Construct unit-coefficient derivative operators for solver tests. | |
Evaluate weak-form coefficients for ORB5X field matrices.
At one flux-coordinate quadrature point (s,chi), this class returns scalar coefficients together with derivative orders for the trial and test basis. Each 2-D derivative pair is {d/ds order, d/dchi order}. Coefficients include the equilibrium Jacobian and the normalized metric/profile factors required by quasineutrality, Ampere, Laplacian, and electron-fluid equations. Matrix assembly and Fourier d/dphi factors are handled by the solver.
The implementation caches process-local species scratch arrays and therefore relies on initialized global basic, species, equilibrium, field, and solver state. It is not designed for concurrent calls that share those caches.
|
static |
Dispatch coefficient evaluation from a MATS matrix identifier.
| [in] | x | Normalized radial coordinate s. |
| [in] | y | Straight-field-line poloidal angle chi [rad]. |
| [in] | matnum | Matrix identifier stored in the global MATS registry. |
| [in] | nl_boundary | Select the integrated boundary form where supported. |
| [in] | nterms | Number of weak-form terms allocated by the matrix definition. |
| [out] | c_j | Complex coefficients of length nterms; current physical coefficient routines return zero imaginary parts. |
| [out] | kdert | Trial-basis derivative orders [term]{ds,dchi}. |
| [out] | kderw | Test/weight-basis derivative orders [term]{ds,dchi}. |
|
static |
Evaluate radial coefficients for auxiliary one-dimensional matrices.
| [in] | kmat | 1 for the sigma-weighted mass form or 3 for mass plus a weak regularizing derivative term. |
| [in] | krterms | Output term count. |
| [in] | ps | Non-negative normalized squared-radial coordinate used by func_sigma(sqrt(ps)). |
| [out] | pcoef | Radial coefficients. |
| [out] | kderw | Test-function radial derivative orders. |
| [out] | kdert | Trial-function radial derivative orders. |
|
static |
Evaluate the adiabatic-electron charge-response mass term.
| [in] | krterms | Output term count. |
| [in] | ps | Normalized radial coordinate s. |
| [in] | pchi | Poloidal angle chi [rad]. |
| [out] | pcoef | Coefficient, zero when no qualifying electron exists. |
| [out] | kderw | Test-basis derivative orders. |
| [out] | kdert | Trial-basis derivative orders. |
|
static |
Evaluate the adiabatic-electron parallel-current mass term.
| [in] | krterms | Output term count. |
| [in] | ps | Normalized radial coordinate s. |
| [in] | pchi | Poloidal angle chi [rad]. |
| [out] | pcoef | Skin-normalized q^2 n/m coefficient times Jacobian. |
| [out] | kderw | Test-basis derivative orders. |
| [out] | kdert | Trial-basis derivative orders. |
|
static |
Evaluate skin/mass and perpendicular-Laplacian Ampere terms.
| [in] | krterms | Output term count (mass followed by four metric terms). |
| [in] | ps | Normalized radial coordinate s. |
| [in] | pchi | Poloidal angle chi [rad]. |
| [out] | pcoef | Species-profile and metric coefficients. |
| [out] | kderw | Test-basis derivative orders. |
| [out] | kdert | Trial-basis derivative orders. |
|
static |
Evaluate metric coefficients of the perpendicular Laplacian.
| [in] | nl_boundary | False for the four gradient-gradient volume terms; true for the two boundary-flux terms. |
| [in] | krterms | Output term count required by the selected form. |
| [in] | ps | Normalized radial coordinate s. |
| [in] | pchi | Poloidal angle chi [rad]. |
| [out] | pcoef | Jacobian- and beta-scaled coefficients. |
| [out] | kderw | Test-basis derivative orders. |
| [out] | kdert | Trial-basis derivative orders. |
|
static |
Evaluate the Jacobian-weighted scalar mass term.
| [in] | krterms | Output term count (normally one). |
| [in] | ps | Normalized radial coordinate s. |
| [in] | pchi | Poloidal angle chi [rad]. |
| [out] | pcoef | Real coefficients. |
| [out] | kderw | Test-basis derivative orders. |
| [out] | kdert | Trial-basis derivative orders. |
|
static |
Evaluate Ohm, continuity, pressure, or Ampere-mass coupling terms.
| [in] | kmat | Sub-operator: 1–2 Ohm, 3–10 continuity, 11–12 pressure, and 13 Ampere mass. |
| [in] | krterms | Output term count for that sub-operator. |
| [in] | ps | Normalized radial coordinate s. |
| [in] | pchi | Poloidal angle chi [rad]. |
| [out] | pcoef | Jacobian-weighted coefficients. |
| [out] | kderw | Test-basis derivative orders. |
| [out] | kdert | Trial-basis derivative orders. |
|
static |
Evaluate adiabatic-response and polarization-density terms.
| [in] | kmat | 2 includes the Boltzmann/adiabatic mass response; 3 retains only polarization terms. |
| [in] | krterms | Output term count (mass plus four metric terms). |
| [in] | ps | Normalized radial coordinate s. |
| [in] | pchi | Poloidal angle chi [rad]. |
| [out] | pcoef | Jacobian-weighted normalized coefficients. |
| [out] | kderw | Test-basis derivative orders. |
| [out] | kdert | Trial-basis derivative orders. |
|
static |
Construct unit-coefficient derivative operators for solver tests.
| [in] | kmat | 1 ds, 2 dchi, 3 dphi placeholder, 4 ds-ds, or 5 dchi-dchi. |
| [in] | krterms | Output term count. |
| [out] | pcoef | Unit/zero coefficients. |
| [out] | kderw | Test-basis derivative orders. |
| [out] | kdert | Trial-basis derivative orders. |