|
XGCa
|
#include "sml.hpp"#include "plasma.hpp"#include "perturbed_B_field.hpp"#include "sources.hpp"#include "pseudo_inverse.hpp"#include "charge.hpp"#include "diagnostics.hpp"

Go to the source code of this file.
Functions | |
| void | f_source (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, ElectricField< DeviceType > &electric_field, DomainDecomposition< DeviceType > &pol_decomp, const VelocityGrid &vgrid, const Charges &charges, Plasma &plasma, Smoothing &smoothing, PerturbedBField< DeviceType > &perturbed_B_field, Sources &sources, DMWrapper &pseudo_inv_dm, Diagnostics &diagnostics) |
| Applies multiple non-Hamiltonian source terms (collisions, neutrals, heat/torque, diffusion, radiative cooling, etc.) that modify the distribution function. More... | |
| void f_source | ( | const Simulation< DeviceType > & | sml, |
| const Grid< DeviceType > & | grid, | ||
| const MagneticField< DeviceType > & | magnetic_field, | ||
| ElectricField< DeviceType > & | electric_field, | ||
| DomainDecomposition< DeviceType > & | pol_decomp, | ||
| const VelocityGrid & | vgrid, | ||
| const Charges & | charges, | ||
| Plasma & | plasma, | ||
| Smoothing & | smoothing, | ||
| PerturbedBField< DeviceType > & | perturbed_B_field, | ||
| Sources & | sources, | ||
| DMWrapper & | pseudo_inv_dm, | ||
| Diagnostics & | diagnostics | ||
| ) |
Applies multiple non-Hamiltonian source terms (collisions, neutrals, heat/torque, diffusion, radiative cooling, etc.) that modify the distribution function.
The function orchestrates the entire "source" step in the kinetic equation, including:
f0_df0g and accumulating them in f0_df0g_cumul If sources are not triggered, the function simply updates particle weights.
Key steps and notes:
f0_df0g). These changes are then accumulated (in f0_df0g_cumul) and zeroed out (in f0_df0g) via accumulate_df0g_and_reset_to_zero.| DeviceType | The device (execution space) on which the simulation primarily runs. |
| [in] | sml | Top-level simulation parameters and flags (time step, step count, upsampling flags, etc.). |
| [in] | grid | The spatial grid object containing geometry, number of planes, and mapping information. |
| [in] | magnetic_field | Access to magnetic-field geometry, used by certain sources and moment calculations. |
| [in,out] | electric_field | Electric field object, which can be modified by routines such as current-drive sources. |
| [in,out] | pol_decomp | Domain decomposition information for poloidal planes (may be used in parallel loops or moment calculations). |
| [in] | vgrid | Velocity-space grid (including resolution, bounds, and pseudo-inverse setup flags). |
| [in] | charges | Contains charge/mass information for different species. |
| [in,out] | plasma | Main plasma container for all species; holds distribution functions, particle data, and moments. |
| [in,out] | perturbed_B_field | Optional container for perturbed magnetic fields used in certain advanced calculations (e.g., 3D modes). |
| [in] | neutrals | Data structure holding neutral densities and reaction rates for neutral-particle recycling or atomic physics processes. |
| [in,out] | sources | Controls which source terms (collisions, diffusion, neutral recycling, pellet injection, etc.) are active, along with their parameters. |
| [in,out] | pseudo_inv_dm | Data manager for pseudo-inverse velocity mapping, needed for distributing f0 changes to particles correctly. |
| [in,out] | diagnostics | Manages diagnostic output for f0, df, distribution function moments, and other user-defined checks. |
f0_df0g are always accumulated into f0_df0g_cumul before being distributed to the particle representation.
