Generate and manage gyroaveraging points around particle guiding centers. More...
#include "larmor.hpp"
Static Public Member Functions | |
| static void | advance_atts_offset (int isp) |
Advance one offset by atts_npart. | |
| static void | advance_atts_offset_disp () |
| Advance every offset by its last represented-particle count. | |
| static void | assign_larmor_atts (int isp, int lnaveg, Real alp, Real rhog, Real sigma, Real chi, Real phi, Real wgc, Real pzomgc, int larmor_start, Kokkos::View< Real **, Kokkos::LayoutLeft, Kokkos::HostSpace > *atts_host_override=nullptr) |
| Fill one guiding center's ring of gyropoint attributes. | |
| static void | destroyStaticViews () |
Release all static Kokkos storage before Kokkos::finalize(). | |
| static MarkerType & | get_marker_type (int isp) |
| Access mutable per-species gyropoint storage. | |
| static SortingClass * | get_sorting (int isp) |
| Access a species' optional spatial sorter. | |
| static const Kokkos::View< Real ** > & | get_zcos2_view () |
| Access cosine ring-phase table. | |
| static const Kokkos::View< Real ** > & | get_zsin2_view () |
| Access sine ring-phase table. | |
| static void | init_larmor (int step) |
| Perform staged Larmor-module initialization. | |
| static void | initlarmor (int step) |
| Fortran-compatible alias of init_larmor(). | |
| static void | reallocate_larmor (int isp) |
| Replace a species' arrays and sorter with larger empty storage. | |
| static void | reset_atts_offset (int isp) |
| Reset one species' particle-batch offset. | |
| static void | reset_atts_offset_disp () |
| Reset particle-batch offsets for every species to zero. | |
| static void | set_larmor_max (int isp, int larmor_index, int np) |
| Set initial capacity from a predicted gyropoint count. | |
| static void | set_n_larmor_tot (int isp, int larmor_index, int np) |
| Store active gyropoint and represented-particle counts. | |
| static bool | should_enlarge_larmor (int isp) |
| Test whether a species is approaching gyropoint capacity. | |
| static void | sort_larmor_points () |
| Build and apply spatial sorting for every eligible kinetic species. | |
Static Public Attributes | |
| static int | CdC_ATT |
| One-based d(chi_point)/d(chi_GC) column. | |
| static int | CdS_ATT |
| One-based d(chi_point)/d(sigma_GC) column. | |
| static int | CHI_ATT |
| One-based gyropoint chi column [rad]. | |
| static int | FIELD_ATT |
| One-based base field column, followed by three gradients. | |
| static int | N_ATTS |
| Runtime attribute-column count (12 electrostatic, 13 EM). | |
| static int | PHI_ATT |
| One-based gyropoint phi column [rad]. | |
| static int | SdC_ATT |
| One-based d(sigma_point)/d(chi_GC) column. | |
| static int | SdS_ATT |
| One-based d(sigma_point)/d(sigma_GC) column. | |
| static int | SIG_ATT |
| One-based gyropoint sigma column. | |
| static int | WCF_ATT |
| One-based current weight, or zero in electrostatic runs. | |
| static int | WGT_ATT |
| One-based per-gyropoint weight column. | |
Generate and manage gyroaveraging points around particle guiding centers.
LarmorModule converts guiding-center (sigma,chi,phi) coordinates and a normalized gyroradius into uniformly phased ring points. It stores the coordinate-map derivatives needed by field gather/deposition and divides guiding-center weights across the ring. Drift-kinetic species bypass this storage; gyrokinetic species may optionally sort points in (sigma,chi,phi) for locality.
|
static |
Advance one offset by atts_npart.
| [in] | isp | Zero-based species index. |
|
static |
Advance every offset by its last represented-particle count.
|
static |
Fill one guiding center's ring of gyropoint attributes.
| [in] | isp | Zero-based species index. |
| [in] | lnaveg | Number of uniformly spaced ring points. |
| [in] | alp | Gyrophase offset [rad]. |
| [in] | rhog | Normalized gyroradius used with equilibrium mapping coefficients. |
| [in] | sigma | Guiding-center radial coordinate. |
| [in] | chi | Guiding-center poloidal angle [rad]. |
| [in] | phi | Guiding-center toroidal angle [rad]. |
| [in] | wgc | Guiding-center deposition/gather weight, divided by lnaveg. |
| [in] | pzomgc | Parallel canonical momentum factor multiplying current weight. |
| [in] | larmor_start | Zero-based first output row. |
| [in,out] | atts_host_override | Optional host matrix to fill instead of the species' device-backed storage. |
Invalid species, non-positive ring size, out-of-table sizes, and empty clipped row ranges return without modification.
|
static |
Release all static Kokkos storage before Kokkos::finalize().
|
static |
Access mutable per-species gyropoint storage.
| [in] | isp | Zero-based species index. |
| std::runtime_error | For an invalid index. |
|
static |
Access a species' optional spatial sorter.
| [in] | isp | Zero-based species index. |
| std::runtime_error | For an invalid index. |
|
static |
Access cosine ring-phase table.
[point][ring size-1] sharing module storage.
|
static |
Access sine ring-phase table.
[point][ring size-1] sharing module storage.
|
static |
Perform staged Larmor-module initialization.
| [in] | step | 1 creates per-species containers; 2 builds angle tables, runtime attribute indices, storage, and optional sorters. |
| std::runtime_error | If navg_max or a required species capacity is non-positive during step 2. |
Referenced by initlarmor().
|
inlinestatic |
Fortran-compatible alias of init_larmor().
| [in] | step | Initialization stage. |
References init_larmor().
|
static |
Replace a species' arrays and sorter with larger empty storage.
| [in] | isp | Zero-based species index; invalid indices are ignored. |
|
static |
Reset one species' particle-batch offset.
| [in] | isp | Zero-based species index. |
|
static |
Reset particle-batch offsets for every species to zero.
|
static |
Set initial capacity from a predicted gyropoint count.
| [in] | isp | Zero-based species index. |
| [in] | larmor_index | Predicted active gyropoints. |
| [in] | np | Represented guiding-center count. |
floor(larmor_index*larmor_size_margin).
|
static |
Store active gyropoint and represented-particle counts.
| [in] | isp | Zero-based species index. |
| [in] | larmor_index | Active gyropoint count. |
| [in] | np | Guiding-center particle count represented by this batch. |
|
static |
Test whether a species is approaching gyropoint capacity.
| [in] | isp | Zero-based species index. |
|
static |
Build and apply spatial sorting for every eligible kinetic species.
| std::runtime_error | For missing sorters or negative active counts. |
|
static |
One-based d(chi_point)/d(chi_GC) column.
|
static |
One-based d(chi_point)/d(sigma_GC) column.
|
static |
One-based gyropoint chi column [rad].
|
static |
One-based base field column, followed by three gradients.
|
static |
Runtime attribute-column count (12 electrostatic, 13 EM).
|
static |
One-based gyropoint phi column [rad].
|
static |
One-based d(sigma_point)/d(chi_GC) column.
|
static |
One-based d(sigma_point)/d(sigma_GC) column.
|
static |
One-based gyropoint sigma column.
|
static |
One-based current weight, or zero in electrostatic runs.
|
static |
One-based per-gyropoint weight column.