Owns diagnostic accumulation, MPI reduction, normalization, and HDF5 output. More...
#include "diagnostics.hpp"
Collaboration diagram for orb5x::Diagnostics:Classes | |
| struct | PlaceholderEntry |
Public Member Functions | |
| Diagnostics () | |
| Constructor - initializes all static member defaults. | |
Static Public Member Functions | |
| static void | accumulate_diagnostics (int isp, Real wt, Real w3t, Real pt, Real pvolgc, Real ze, Real zf0, Real sigmat, Real q_vgc_dot_genelec, Real q_dvpadt0_dot_gyroapar) |
| Accumulate weights, entropy, and energy-transfer scalars for one marker. | |
| static void | accumulate_displacements (int isp, bool in_ksieta, Real chit_cos, Real chit_sin, Real sigmat, const std::array< Real, 3 > &tempd, const std::array< Real, 3 > &vgc, const std::array< Real, 3 > &vexb, Real dvpadt1, Real dvpadt0, Real rhs, bool nl_directdf) |
Accumulate total and E x B marker-displacement statistics. | |
| static void | accumulate_flux1d_f0 (int isp, int irloc, Real zf0, Real dPsidt1, Real dPsidt0, Real ze, Real ut, Real rt2, const std::vector< Real > &vpar) |
| Accumulate equilibrium-distribution radial flux channels. | |
| static void | accumulate_flux1d_w (int isp, int irloc, Real wt, Real dPsidt1, Real dPsidt0, Real ze, Real ut, Real rt2, const std::vector< Real > &vpar) |
| Accumulate marker-weighted radial particle, heat, and momentum flux. | |
| static void | accumulate_moment1d_f (int isp, int irloc, Real zf0, Real wt, Real ut, Real ut2, Real vpt2) |
| Accumulate total-distribution one-dimensional velocity moments. | |
| static void | accumulate_moment1d_f0 (int isp, int irloc, Real zf0, Real ut, Real ut2, Real vpt2, Real rt2, const std::vector< Real > &vpar, const std::vector< Real > &vexb, Real b) |
| Accumulate equilibrium-distribution one-dimensional moments. | |
| static void | accumulate_moment1d_w (int isp, int irloc, Real zf0, Real wt, Real ut, Real ut2, Real vpt2, Real rt2, const std::vector< Real > &vpar, const std::vector< Real > &vexb, Real b, Real jdote_tot) |
| Accumulate perturbation-weighted one-dimensional moments. | |
| static void | add_efield (int isp, int component, Real value) |
| static void | add_efield_av (int isp, int component, Real value) |
| static void | add_to_0d_vexbnavg (int isp, Real to_add) |
Accumulate mean thermal-normalized E x B speed. | |
| static void | add_to_entropy_fluct (int isp, int idiag, Real value) |
| static void | add_to_jdote_bg (int isp, int idiag, Real value) |
| static void | add_to_jdote_fluct (int isp, int idiag, Real value) |
| static void | add_trap_frac (int isp, int type, Real value) |
| static void | append_placeholder_slices (int step, Real time) |
| Append zero-filled compatibility slices for one output sample. | |
| static void | append_scalar (const std::string &path, const Real *values, size_t count) |
| Append scalar values to an extensible HDF5 dataset. | |
| static void | append_stat_int (const std::string &path, const int *array, size_t count) |
| Matching Fortran append_stat (util.F90:473-511): Appends integer array data to an extensible HDF5 dataset. | |
| static void | clear_diagnostics (int isp) |
| Clear per-step accumulators for one species. | |
| static void | clear_entropy_diag (int isp) |
| static void | clear_jdote (int isp) |
| static void | clear_jdote_fluct (int isp) |
| static void | createg_1D (const std::string &name, const std::string &description, const std::vector< Real > &coord1, const std::string &coord1_name) |
| Create generic 1D dataset group (matching Fortran createg_1D, diagnostics.F90:2663-2674) Creates /data/var1d/generic/{name} with coord1, time, data datasets and attaches PlotOrder attribute. | |
| static void | createg_1Dms (const std::string &species_name, const std::string &name, const std::string &description, const std::vector< Real > &coord1, const std::string &coord1_name) |
| Create species 1D dataset group (matching Fortran createg_1Dms, diagnostics.F90:2746-2759) Creates /data/var1d/{species_name}/{name} with coord1, time, data datasets and attaches PlotOrder attribute. | |
| static void | createg_2D (const std::string &name, const std::string &description, const std::vector< Real > &coord1, const std::string &coord1_name, const std::vector< Real > &coord2, const std::string &coord2_name) |
| Create generic 2D dataset group (matching Fortran createg_2D, diagnostics.F90:2647-2659) Creates /data/var2d/generic/{name} with coord1, coord2, time, data datasets and attaches PlotOrder attribute. | |
| static void | createg_2Dms (const std::string &species_name, const std::string &name, const std::string &description, const std::vector< Real > &coord1, const std::string &coord1_name, const std::vector< Real > &coord2, const std::string &coord2_name) |
| Create species 2D dataset group (matching Fortran createg_2Dms, diagnostics.F90:2678-2701) Creates /data/var2d/{species_name}/{name} with coord1, coord2, time, data datasets and attaches PlotOrder attribute. | |
| static void | createg_3D (const std::string &name, const std::string &description, const std::vector< Real > &coord1, const std::string &coord1_name, const std::vector< Real > &coord2, const std::string &coord2_name, const std::vector< Real > &coord3, const std::string &coord3_name) |
| Create generic 3D dataset group (matching Fortran createg_3D, diagnostics.F90:2608-2622) Creates /data/var3d/generic/{name} with coord1, coord2, coord3, time, data datasets and attaches PlotOrder attribute. | |
| static void | createg_3Dms (const std::string &species_name, const std::string &name, const std::string &description, const std::vector< Real > &coord1, const std::string &coord1_name, const std::vector< Real > &coord2, const std::string &coord2_name, const std::vector< Real > &coord3, const std::string &coord3_name, const std::vector< std::vector< int > > *mmin_f=nullptr) |
| Create species 3D dataset group (matching Fortran createg_3Dms, diagnostics.F90:2705-2720) Creates /data/var3d/{species_name}/{name} with coord1, coord2, coord3, time, data datasets and attaches PlotOrder attribute. | |
| static void | createg_3Dz (const std::string &name, const std::string &description, const std::vector< Real > &coord1, const std::string &coord1_name, const std::vector< Real > &coord2, const std::string &coord2_name, const std::vector< Real > &coord3, const std::string &coord3_name, const std::vector< std::vector< int > > *mmin_f=nullptr) |
| Create generic 3D complex dataset group (matching Fortran createg_3Dz, diagnostics.F90:2626-2643) Creates /data/var3d/generic/{name} with coord1, coord2, coord3, time, data (complex) datasets Optionally creates mmin dataset if mmin_f is provided. | |
| static void | createg_3Dzms (const std::string &species_name, const std::string &name, const std::string &description, const std::vector< Real > &coord1, const std::string &coord1_name, const std::vector< Real > &coord2, const std::string &coord2_name, const std::vector< Real > &coord3, const std::string &coord3_name, const std::vector< std::vector< int > > *mmin_f=nullptr) |
| Create species 3D complex dataset group (matching Fortran createg_3Dzms, diagnostics.F90:2724-2742) Creates /data/var3d/{species_name}/{name} with coord1, coord2, coord3, time, data (complex) datasets Optionally creates mmin dataset if mmin_f is provided. | |
| static void | destroyStaticViews () |
| Release static Kokkos Views before Kokkos::finalize() | |
| static void | diag3d_on_fluid_moments (int isp) |
| Derive vorticity, potential, temperature, and spectra from fluid moments. | |
| static void | diag3d_spectrum (const std::vector< std::vector< std::vector< Real > > > &field, std::vector< std::vector< Real > > &spectrum_out, int nmax) |
| Compute a toroidal-mode spectrum from a real three-dimensional field. | |
| static void | diag_fields_torpol (int fieldnum, Real time) |
| Write toroidal and poloidal Fourier spectra. | |
| static void | diag_fields_torpol_init () |
| ============================================================================= | |
| static void | diag_fulltorus (int fieldnum, Real time) |
| Write selected full-torus plane cuts. | |
| static void | diag_fulltorus_init () |
| ============================================================================= | |
| static void | diagnose (int step, int step_tot, Real time) |
| Run diagnostics scheduled for the current integration step. | |
| static void | diagnose_phasespace (int isp, Real s, Real vpar, Real mu, Real B, Real pvol, Real w, Real zf0) |
Accumulate the (psi,v_parallel,v_perp) phase-space histogram. | |
| static void | diagnose_sampling (int isp, Real s, Real en, Real pvol, Real w, Real zf0) |
Accumulate the (s,v^2) marker-sampling histogram. | |
| static void | diagnostics_after_loop (int isp) |
| Reduce and normalize diagnostics after one species push loop. | |
| static std::vector< std::vector< Real > > & | displacement_avg_ref () |
| static std::vector< std::vector< Real > > & | displacement_exb_avg_ref () |
| static std::vector< std::vector< Real > > & | displacement_exb_max_ref () |
| static std::vector< std::vector< Real > > & | displacement_max_ref () |
| static void | electron_fluxes_moments (int isp, int irloc, Real zf0, Real dPsidt1, Real dPsidt0, Real ze, Real wt, Real ffinit_tmp1, Real ffinit_tmp2, Real ffinit_tmp3, Real ffinit_tmp4, bool is_trapped) |
| Accumulate passing/trapped electron fluxes and moments. | |
| static std::vector< std::vector< Real > > & | entropy_fluct_avg_ref () |
| static std::vector< std::vector< std::vector< std::vector< std::vector< Real > > > > > & | fluid_moments_ref () |
| static void | flush0d () |
| Flush 0D diagnostics buffer to file Writes accumulated 0D diagnostic data to HDF5. | |
| static std::vector< std::vector< std::vector< Real > > > & | flux1d_f0_ref () |
| static std::vector< std::vector< std::vector< Real > > > & | flux1d_w_ref () |
| static Real | get_adiab (int isp) |
| static Kokkos::View< Real ** > & | get_buf () |
| static Kokkos::View< Real *** > & | get_buf_pic () |
| static int | get_cum_non_cg_bins (int isp) |
| static int | get_cum_non_cg_markers (int isp) |
| static Real | get_dSdt_heat (int isp) |
| static Real | get_dSdt_nc (int isp) |
| static Real | get_dSdt_nc_corr (int isp) |
| static Real | get_efield (int isp, int component) |
| static Real | get_efield_av (int isp, int component) |
| static Real | get_efield_fft (int isp, int component) |
| static Real | get_entropy_fluct_avg (int isp, int idiag) |
| static Real | get_flux0d_f0 (int isp, int idiag) |
| static Real | get_flux0d_w (int isp, int idiag) |
| static Kokkos::View< Real * > | get_generic_signoise_avg () |
| static int | get_generic_signoise_size () |
| static Real | get_generic_spectrum2d_avg (int idiag, int i, int j) |
| static int | get_ibuf () |
| static Real | get_inner_edge_losses (int isp, int component) |
| static int | get_irloc_in () |
| static Real | get_jdote_bg (int isp, int idiag) |
| static Real | get_jdote_fluct (int isp, int idiag) |
| static Real | get_misc_avg (int isp, int idiag) |
| static Kokkos::View< Real ** > & | get_noise_2d_all () |
| static int | get_nsbound_in (int isp) |
| static int | get_nsbound_out (int isp) |
| static Real | get_outer_edge_losses (int isp, int component) |
| static Kokkos::View< Real ** > & | get_signal_2d_all () |
| static Real | get_spectrum2d_avg (int isp, int idiag, int i, int j) |
| static int | get_tot_cg_bins (int isp) |
| static int | get_tot_cg_markers (int isp) |
| static Real | get_trap_frac (int isp, int type) |
| static Real | get_variance (int isp, int index) |
| static Real | get_vexbnavg (int isp, int idiag) |
| static Real | get_vthmax2_cached (int isp) |
| static Real | get_vthmax_cached (int isp) |
| static Real | get_wsqreduced (int isp) |
| static Real | getpot_fieldnum (Real s, Real theta, Real phi, int fieldnum) |
| Interpolate a selected field in magnetic coordinates. | |
| static void | init_generic_signoise () |
| Allocate and clear generic signal-to-noise accumulators. | |
| static void | init_phase1_diagnostics () |
| Initialize Phase 1 diagnostic arrays and flags Called from initialize_diagnostics() | |
| static void | init_test_diagnostic_arrays (int nspecies) |
| Allocate deterministic in-memory diagnostic storage for tests. | |
| static void | init_variance (int nspecies) |
| Size and zero variance storage. | |
| static void | initialize_diagnostics () |
| Initialize diagnostics system Sets up all diagnostic structures, grids, and output files. | |
| static void | initialize_phasespace_diags () |
| Initialize phase space diagnostics. | |
| static void | initialize_source_3d_diags () |
| Initialize source 3D diagnostics. | |
| static Real | jdote (int isp, Real ut2, Real vpt2, const std::vector< Real > &vpar, const std::vector< Real > &genelec, const std::vector< Real > &elec_par, Real wt, Real bstar_inv, const std::vector< Real > &bgrb, const std::vector< Real > &vgb, const std::vector< Real > &vpressure, const std::vector< Real > &veb_f, const std::vector< Real > &vexb, Real expt_back, Real eypt_back, Real dvpadt0, Real gyroapar) |
Compute and accumulate one marker's j dot E power transfer. | |
| static std::vector< std::vector< Real > > & | jdote_bg_ref () |
| static std::vector< std::vector< Real > > & | jdote_fluct_ref () |
| static void | max_of_0d (int isp, int i, Real to_add) |
| Update a maximum-valued zero-dimensional channel. | |
| static void | max_of_0d_vexbnmax (int isp, Real to_add) |
Update maximum thermal-normalized E x B speed. | |
| static void | max_of_0d_vmax (int isp, Real to_add) |
| Update maximum normalized marker speed. | |
| static void | max_of_0d_wmax (int isp, Real to_add) |
| Update maximum absolute marker weight. | |
| static std::vector< std::vector< Real > > & | misc_avg_ref () |
| static void | mmin_f_serialize () |
| Serializes mmin_f array across MPI ranks for 3D output. | |
| static std::vector< std::vector< std::vector< Real > > > & | moment1d_f0_ref () |
| static std::vector< std::vector< std::vector< Real > > > & | moment1d_f_ref () |
| static std::vector< std::vector< std::vector< Real > > > & | moment1d_w_ref () |
| static std::vector< std::vector< std::vector< std::vector< Real > > > > & | moment2d_avg_ref () |
| static std::vector< std::vector< std::vector< std::vector< Real > > > > & | mpr_2d_ref () |
| static void | mpr_es_calc (int isp, int iuloc, int imuloc, Real sigmat, Real thetat, Real wt, Real ut2, Real vpt2, Real bstar_inv, const std::vector< Real > &vpar, const std::vector< Real > &genelec, const std::vector< Real > &bgrb, const std::vector< Real > &vgb, const std::vector< Real > &vpressure, const std::vector< Real > &veb_f) |
| Accumulate electrostatic mode-particle-resonance power transfer. | |
| static bool | nl_do_diag (int step_tot, int nfreq) |
| Test a diagnostic cadence. | |
| static void | normalize_flux1d (int isp) |
| Normalize radial fluxes and form zero-dimensional integrals. | |
| static void | normalize_moment1d_f (int isp) |
| Normalize total-distribution radial moments. | |
| static void | normalize_moment1d_f0 (int isp) |
| Normalize equilibrium-distribution radial moments. | |
| static void | normalize_moment1d_w (int isp) |
| Normalize perturbation-weighted radial moments. | |
| static void | normalize_moment2d (int isp) |
| Normalize two-dimensional averaged moments. | |
| static void | normalize_poloidal1d (int isp) |
| Normalize one-dimensional poloidal moments. | |
| template<typename T > | |
| static void | omp_reduce_diag (T &data, bool use_max=false) |
| Generic diagnostic reduction interface (matches Fortran omp_reduce_diag) | |
| static void | omp_reduce_diag0d (Real &data, bool use_max=false) |
| ============================================================================= | |
| static void | omp_reduce_diag1d (std::vector< Real > &data, bool use_max=false) |
| Reduce 1D diagnostic array. | |
| static void | omp_reduce_diag2d (std::vector< std::vector< Real > > &data, bool use_max=false) |
| Reduce 2D diagnostic array. | |
| static void | omp_reduce_diag3d (std::vector< std::vector< std::vector< Real > > > &data, bool use_max=false) |
| Reduce 3D diagnostic array. | |
| static std::vector< std::vector< std::vector< std::vector< std::vector< Real > > > > > & | phasespace_3d_ref () |
| static void | polarisation_fieldcalc (int isp) |
| Compute polarization-field diagnostic channels after reduction. | |
| static std::vector< std::vector< std::vector< Real > > > & | poloidal1d_f_ref () |
| static std::vector< std::vector< std::vector< Real > > > & | poloidal1d_w_ref () |
| static void | profsphi (Real theta, int fieldnum, std::vector< std::vector< Real > > &pot_sp) |
Sample a selected field on an (s,phi) plane. | |
| static void | profsth (Real phi, int fieldnum, int ns0, std::vector< std::vector< Real > > &pot_st, std::vector< std::vector< Real > > *xc=nullptr, std::vector< std::vector< Real > > *zc=nullptr) |
Sample a selected field on an (s,theta) plane. | |
| static void | put3d_dens (Real time, bool do_moments=false) |
| Write three-dimensional density and optional moment diagnostics. | |
| static void | put3d_h5s (Real time, int diag_select, int field_select, int isp=-1) |
| Write one three-dimensional field/density diagnostic. | |
| static void | putarr (const std::string &path, const Real *array, size_t length, const std::string &title="") |
| Write a one-dimensional real array and optional title. | |
| static void | putarr_attime_1d (const std::string &path, const Real *array, size_t length, Real time) |
| Append a one-dimensional real slice at a simulation time. | |
| static void | putarr_attime_2d (const std::string &path, const Real *array, size_t dim1, size_t dim2, Real time) |
| Append a two-dimensional real slice at a simulation time. | |
| static void | read_restart_state (int datn) |
| static void | rhs_f_serialize (const std::vector< std::vector< std::complex< Real > > > &rhs_f_ptr) |
| Gather distributed Fourier RHS coefficients for three-dimensional output. | |
| static std::vector< std::vector< std::vector< std::vector< Real > > > > & | sampling_2d_ref () |
| static void | set_buf (Kokkos::View< Real ** > v) |
| static void | set_buf_pic (Kokkos::View< Real *** > v) |
| static void | set_dSdt_heat (int isp, Real value) |
| static void | set_dSdt_nc (int isp, Real value) |
| static void | set_dSdt_nc_corr (int isp, Real value) |
| static void | set_efield (int isp, int component, Real value) |
| static void | set_efield_av (int isp, int component, Real value) |
| static void | set_efield_fft (int isp, int component, Real value) |
| static void | set_generic_spectrum2d_avg (int idiag, int i, int j, Real value) |
| static void | set_ibuf (int val) |
| static void | set_inner_edge_losses (int isp, int component, Real value) |
| static void | set_misc_avg (int isp, int idx, Real val) |
| static void | set_nsbound_in (int isp, int value) |
| static void | set_nsbound_out (int isp, int value) |
| static void | set_outer_edge_losses (int isp, int component, Real value) |
| static void | set_signal2noise (Real sn, Real sn_nozf) |
| static void | set_signal2noise_em (Real sn, Real sn_nozf) |
| static void | set_spectrum2d_avg (int isp, int idiag, int i, int j, Real value) |
| static void | set_variance (int isp, int index, Real value) |
| static void | snapshot_variance (int isp) |
| static std::vector< std::vector< std::vector< Real > > > & | source_diag1d_avg_ref () |
| static void | strong_diagnostic_output (int isp, int ip, Real psi0t, Real temp2, Real ze, Real vecrossb_f2, Real pot_equil, Real zf0, Real zvth2_inv, Real dpotdpsi, Real vdr, Real rhs) |
| Record one marker's strong-flow parity diagnostics. | |
| static void | sum_entropy_fluctuation (int isp, Real wt, Real zf0, Real q_vgc_dot_genelec, Real zvth2_inv, Real df0_dpsi_prof, Real df0_dchi_prof, Real dpsi_prof_dt) |
| Accumulate one marker's fluctuation-entropy balance. | |
| static void | sum_fluid_moments (int isp, Real sigmat, Real chit, Real phit, Real wt, Real ut, Real ut2, Real vpt2) |
| Deposit one marker into three-dimensional fluid moments. | |
| static void | sum_in_radial_bins_island (int isp, int irloc, int ipol, Real ut, const std::vector< Real > &gradpsi0, Real htildex, Real htildey, Real ze, Real zf0, Real wt, Real dPsidt1, Real ffinit_tmp1, Real ffinit_tmp2, Real ffinit_tmp3, Real ffinit_tmp4) |
| Accumulate magnetic-island radial/poloidal diagnostics. | |
| static void | sum_moment2d (int isp, int irloc, int ithetaloc, Real wt, Real ffinit_tmp1, Real ffinit_tmp2, Real ffinit_tmp3, Real ffinit_tmp4) |
Accumulate (s,theta) initial-distribution moments. | |
| static void | sum_particles_in_poloidal_bins (int isp, int ithetaloc, Real wt, Real ffinit_tmp1, Real ffinit_tmp2, Real ffinit_tmp3, Real ffinit_tmp4, Real wt_tmp1, Real wt_tmp2, Real wt_tmp3) |
| Accumulate poloidal moments at the configured radial surface. | |
| static void | sum_particles_in_radial_bins (int isp, int ip, int irloc, Real zf0, Real dPsidt1, Real dPsidt0, Real ze, Real wt, Real ut, Real ut2, Real vpt2, Real rt2, const std::vector< Real > &vpar, Real zf0_tmp1, Real zf0_tmp2, Real zf0_tmp3, Real sigmat, Real zf0_local, Real grsigma2, Real grsigmagrchi, Real b, const std::vector< Real > &exh, Real wt_tmp1, Real wt_tmp2, Real wt_tmp3, const std::vector< Real > &vexb, Real ffinit_tmp1, Real ffinit_tmp2, Real ffinit_tmp3, Real ffinit_tmp4, Real ffinit_tmp5, Real jdote_tot, const std::vector< Real > &eloc) |
| Accumulate all configured radial-bin diagnostics for one marker. | |
| static Real | sum_spectrum2d_avg (int isp, int idiag, int ndim, int mdim) |
| static void | sum_velocities (int isp, int iuloc, int imuloc, Real wt, Real zf0, Real pvol) |
| Accumulate one- and two-dimensional velocity-space diagnostics. | |
| static void | test_particle_output (int isp, int ip, Real psi0t, Real ze, Real pot_equil, Real wt, Real zvth2, Real nval, Real pvol_updated, Real zf0) |
| Store one selected test-particle record. | |
| static std::vector< std::vector< std::vector< Real > > > & | vel1d_avg_ref () |
| static std::vector< std::vector< std::vector< std::vector< Real > > > > & | vel2d_avg_ref () |
| static void | velocity_space_diag_init () |
| Initialize velocity space diagnostics Sets up velocity space grids and output structures. | |
| static std::vector< Real > & | vmax_ref () |
| static std::vector< Real > & | wmax_ref () |
| static void | write_output (int step, Real time) |
| Write the standard scalar, profile, and spectrum output set. | |
| static void | write_restart_state (int datn) |
| static void | zero_generic_spectrum2d_avg (int idiag, int ndim, int mdim) |
Zero one generic (m,n) spectrum slice. | |
| static void | zero_spectrum2d_avg (int isp, int idiag, int ndim, int mdim) |
Zero one per-species (m,n) spectrum slice. | |
Static Public Attributes | |
| static std::vector< Real > | apaloc |
| Local \(A_\parallel(s,0,0)\) radial cut. | |
| static constexpr int | FIELD_APAR = 2 |
| Select total parallel vector potential. | |
| static constexpr int | FIELD_APAR_HAM = 3 |
| Select Hamiltonian \(A_\parallel\). | |
| static constexpr int | FIELD_APAR_SYMPL = 4 |
| Select symplectic \(A_\parallel\). | |
| static constexpr int | FIELD_DENS = 5 |
| Select density field. | |
| static constexpr int | FIELD_PHI = 1 |
| ============================================================================= | |
| static constexpr int | FIELD_USER = 6 |
| Select user-defined external field. | |
| static std::vector< std::vector< std::vector< Real > > > | moment1d_w |
| moment1d_w: 1D moment diagnostics weighted by w (matching Fortran moment1d_w) [nspecies][nbin_flux+2][14 diagnostic types] - matching moment1d_w structure | |
| static std::vector< bool > | out |
| Species output flags (matching Fortran out(0:NSPECIES_MAX)) out[0] = true for pure fluid model, out[isp] = true if species isp has diagnostic output. | |
| static std::array< int, 3 > | pe_phi_cuts = {0, 0, 0} |
| MPI ranks responsible for phi cuts (matching Fortran pe_phi_cuts(0:2)) Stores the PE rank that owns each of the 3 phi cut positions for output. | |
| static std::vector< Real > | phi00 |
| Public diagnostic arrays (accessed by FieldsModule in solve_fem, matching Fortran pde_solver) Potential diagnostic arrays (matching Fortran diagnostics.F90) | |
| static std::vector< Real > | phi0_chi |
| Poloidal potential cut at the configured diagnostic radius. | |
| static std::vector< Real > | phibar |
| Flux-surface-averaged electrostatic potential. | |
| static std::vector< Real > | philoc |
| \(\phi(s,\theta=0,\varphi=0)\) radial cut. | |
| static std::vector< Real > | philoc_hfs |
| High-field-side cut \(\phi(s,\theta=\pi,\varphi=0)\). | |
| static std::vector< std::vector< Real > > | rho00 |
| Flux-surface-averaged charge density by radius and species. | |
Owns diagnostic accumulation, MPI reduction, normalization, and HDF5 output.
Particle pushers accumulate weighted fluxes, moments, entropy transfer, and phase-space statistics through this static service. After each species loop, Diagnostics reduces rank-local data, applies physical bin-volume and distribution normalizations, stages field and three-dimensional products, and appends them to the configured output datasets. Species arguments use zero-based C++ indexing unless a function explicitly states otherwise; physical values are in ORB5X normalization and angles are in radians.
|
inline |
|
static |
Accumulate weights, entropy, and energy-transfer scalars for one marker.
| [in] | isp | Zero-based species index. |
| [in] | wt | Perturbation weight. |
| [in] | w3t | Third weight/control-variate channel. |
| [in] | pt | Total marker weight used by the selected formulation. |
| [in] | pvolgc | Guiding-centre phase-space volume. |
| [in] | ze | Normalized kinetic energy. |
| [in] | zf0 | Equilibrium distribution value. |
| [in] | sigmat | Radial coordinate s=sqrt(psi). |
| [in] | q_vgc_dot_genelec | Charge-weighted electric energy transfer. |
| [in] | q_dvpadt0_dot_gyroapar | Equilibrium-acceleration/vector-potential transfer. |
sum_of_weights_and_energy_transfer in part.F90.
|
static |
Accumulate total and E x B marker-displacement statistics.
| [in] | isp | Zero-based species index. |
| [in] | in_ksieta | Whether coordinates use the (ksi,eta) representation. |
| [in] | chit_cos | Cosine of marker poloidal angle. |
| [in] | chit_sin | Sine of marker poloidal angle. |
| [in] | sigmat | Radial marker coordinate. |
| [in] | tempd | Three-component displacement increment. |
| [in] | vgc | Three-component guiding-centre velocity. |
| [in] | vexb | Three-component E x B velocity. |
| [in] | dvpadt1 | Perturbed parallel acceleration. |
| [in] | dvpadt0 | Equilibrium parallel acceleration. |
| [in] | rhs | Weight-equation right-hand side. |
| [in] | nl_directdf | Direct-delta-f formulation flag. |
|
static |
Accumulate equilibrium-distribution radial flux channels.
| [in] | isp | Zero-based species index. |
| [in] | irloc | Zero-based radial diagnostic bin. |
| [in] | zf0 | Equilibrium distribution value. |
| [in] | dPsidt1 | Perturbed radial/canonical-flux characteristic. |
| [in] | dPsidt0 | Equilibrium radial/canonical-flux characteristic. |
| [in] | ze | Normalized kinetic energy. |
| [in] | ut | Normalized parallel marker coordinate. |
| [in] | rt2 | Squared cylindrical major radius. |
| [in] | vpar | Three-component parallel velocity. |
|
static |
Accumulate marker-weighted radial particle, heat, and momentum flux.
| [in] | isp | Zero-based species index. |
| [in] | irloc | Zero-based radial diagnostic bin. |
| [in] | wt | Perturbation weight. |
| [in] | dPsidt1 | Perturbed flux characteristic. |
| [in] | dPsidt0 | Equilibrium flux characteristic. |
| [in] | ze | Normalized kinetic energy. |
| [in] | ut | Normalized parallel marker coordinate. |
| [in] | rt2 | Squared cylindrical major radius. |
| [in] | vpar | Three-component parallel velocity. |
|
static |
Accumulate total-distribution one-dimensional velocity moments.
| [in] | isp | Zero-based species index. |
| [in] | irloc | Zero-based radial bin. |
| [in] | zf0 | Equilibrium distribution value. |
| [in] | wt | Perturbation weight. |
| [in] | ut | Parallel velocity. |
| [in] | ut2 | Squared parallel velocity. |
| [in] | vpt2 | Squared perpendicular velocity. |
|
static |
Accumulate equilibrium-distribution one-dimensional moments.
| [in] | isp | Zero-based species index. |
| [in] | irloc | Zero-based radial bin. |
| [in] | zf0 | Equilibrium distribution value. |
| [in] | ut | Parallel velocity. |
| [in] | ut2 | Squared parallel velocity. |
| [in] | vpt2 | Squared perpendicular velocity. |
| [in] | rt2 | Squared cylindrical major radius. |
| [in] | vpar | Three-component parallel velocity. |
| [in] | vexb | Three-component E x B velocity. |
| [in] | b | Normalized magnetic-field magnitude. |
|
static |
Accumulate perturbation-weighted one-dimensional moments.
| [in] | isp | Zero-based species index. |
| [in] | irloc | Zero-based radial bin. |
| [in] | zf0 | Equilibrium distribution value. |
| [in] | wt | Perturbation weight. |
| [in] | ut | Parallel velocity. |
| [in] | ut2 | Squared parallel velocity. |
| [in] | vpt2 | Squared perpendicular velocity. |
| [in] | rt2 | Squared cylindrical major radius. |
| [in] | vpar | Three-component parallel velocity. |
| [in] | vexb | Three-component E x B velocity. |
| [in] | b | Normalized magnetic-field magnitude. |
| [in] | jdote_tot | Marker contribution to j dot E. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Zero-based total-energy component. |
| [in] | value | Normalized contribution to add. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Zero-based averaged component. |
| [in] | value | Normalized contribution to add. |
|
static |
Accumulate mean thermal-normalized E x B speed.
| [in] | isp | Zero-based species index. |
| [in] | to_add | Marker contribution. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | Entropy channel index. |
| [in] | value | Normalized contribution. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | Channel index. |
| [in] | value | Normalized contribution to add. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | Channel index. |
| [in] | value | Normalized contribution to add. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | type | Orbit-transition selector. |
| [in] | value | Fraction contribution to add. |
|
static |
Append zero-filled compatibility slices for one output sample.
| [in] | step | Current global timestep index. |
| [in] | time | Current normalized simulation time. |
|
static |
Append scalar values to an extensible HDF5 dataset.
| [in] | path | Absolute dataset path. |
| [in] | values | Contiguous scalar values. |
| [in] | count | Number of appended values. |
|
static |
Matching Fortran append_stat (util.F90:473-511): Appends integer array data to an extensible HDF5 dataset.
Called from rank 0 after data has been gathered.
| [in] | path | Absolute dataset path. |
| [in] | array | Contiguous integer values. |
| [in] | count | Number of appended values. |
|
static |
Clear per-step accumulators for one species.
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
Create generic 1D dataset group (matching Fortran createg_1D, diagnostics.F90:2663-2674) Creates /data/var1d/generic/{name} with coord1, time, data datasets and attaches PlotOrder attribute.
| [in] | name | Dataset-group name. |
| [in] | description | Human-readable physical quantity and units. |
| [in] | coord1 | Coordinate values. |
| [in] | coord1_name | Coordinate label. |
|
static |
Create species 1D dataset group (matching Fortran createg_1Dms, diagnostics.F90:2746-2759) Creates /data/var1d/{species_name}/{name} with coord1, time, data datasets and attaches PlotOrder attribute.
| [in] | species_name | Species output-group label. |
| [in] | name | Dataset-group name. |
| [in] | description | Human-readable physical quantity and units. |
| [in] | coord1 | Coordinate values. |
| [in] | coord1_name | Coordinate label. |
|
static |
Create generic 2D dataset group (matching Fortran createg_2D, diagnostics.F90:2647-2659) Creates /data/var2d/generic/{name} with coord1, coord2, time, data datasets and attaches PlotOrder attribute.
| [in] | name | Dataset-group name. |
| [in] | description | Human-readable physical quantity and units. |
| [in] | coord1 | First coordinate values. |
| [in] | coord1_name | First-coordinate label. |
| [in] | coord2 | Second coordinate values. |
| [in] | coord2_name | Second-coordinate label. |
|
static |
Create species 2D dataset group (matching Fortran createg_2Dms, diagnostics.F90:2678-2701) Creates /data/var2d/{species_name}/{name} with coord1, coord2, time, data datasets and attaches PlotOrder attribute.
| [in] | species_name | Species output-group label. |
| [in] | name | Dataset-group name. |
| [in] | description | Human-readable physical quantity and units. |
| [in] | coord1 | First coordinate values. |
| [in] | coord1_name | First-coordinate label. |
| [in] | coord2 | Second coordinate values. |
| [in] | coord2_name | Second-coordinate label. |
|
static |
Create generic 3D dataset group (matching Fortran createg_3D, diagnostics.F90:2608-2622) Creates /data/var3d/generic/{name} with coord1, coord2, coord3, time, data datasets and attaches PlotOrder attribute.
| [in] | name | Dataset-group name. |
| [in] | description | Human-readable physical quantity and units. |
| [in] | coord1 | First coordinate values. |
| [in] | coord1_name | First-coordinate label. |
| [in] | coord2 | Second coordinate values. |
| [in] | coord2_name | Second-coordinate label. |
| [in] | coord3 | Third coordinate values. |
| [in] | coord3_name | Third-coordinate label. |
|
static |
Create species 3D dataset group (matching Fortran createg_3Dms, diagnostics.F90:2705-2720) Creates /data/var3d/{species_name}/{name} with coord1, coord2, coord3, time, data datasets and attaches PlotOrder attribute.
| [in] | species_name | Species output-group label. |
| [in] | name | Dataset-group name. |
| [in] | description | Human-readable physical quantity and units. |
| [in] | coord1 | First coordinate values. |
| [in] | coord1_name | First-coordinate label. |
| [in] | coord2 | Second coordinate values. |
| [in] | coord2_name | Second-coordinate label. |
| [in] | coord3 | Third coordinate values. |
| [in] | coord3_name | Third-coordinate label. |
| [in] | mmin_f | Optional minimum-poloidal-mode metadata. |
|
static |
Create generic 3D complex dataset group (matching Fortran createg_3Dz, diagnostics.F90:2626-2643) Creates /data/var3d/generic/{name} with coord1, coord2, coord3, time, data (complex) datasets Optionally creates mmin dataset if mmin_f is provided.
| [in] | name | Dataset-group name. |
| [in] | description | Human-readable physical quantity and units. |
| [in] | coord1 | First coordinate values. |
| [in] | coord1_name | First-coordinate label. |
| [in] | coord2 | Second coordinate values. |
| [in] | coord2_name | Second-coordinate label. |
| [in] | coord3 | Third coordinate values. |
| [in] | coord3_name | Third-coordinate label. |
| [in] | mmin_f | Optional minimum-poloidal-mode metadata. |
|
static |
Create species 3D complex dataset group (matching Fortran createg_3Dzms, diagnostics.F90:2724-2742) Creates /data/var3d/{species_name}/{name} with coord1, coord2, coord3, time, data (complex) datasets Optionally creates mmin dataset if mmin_f is provided.
| [in] | species_name | Species output-group label. |
| [in] | name | Dataset-group name. |
| [in] | description | Human-readable physical quantity and units. |
| [in] | coord1 | First coordinate values. |
| [in] | coord1_name | First-coordinate label. |
| [in] | coord2 | Second coordinate values. |
| [in] | coord2_name | Second-coordinate label. |
| [in] | coord3 | Third coordinate values. |
| [in] | coord3_name | Third-coordinate label. |
| [in] | mmin_f | Optional minimum-poloidal-mode metadata. |
|
static |
Release static Kokkos Views before Kokkos::finalize()
|
static |
Derive vorticity, potential, temperature, and spectra from fluid moments.
| [in] | isp | Zero-based species index. |
|
static |
Compute a toroidal-mode spectrum from a real three-dimensional field.
| [in] | field | Real samples indexed by radial, poloidal, and toroidal bins. |
| [out] | spectrum_out | Mode power by radial/poloidal index. |
| [in] | nmax | Maximum retained toroidal mode. |
|
static |
Write toroidal and poloidal Fourier spectra.
| [in] | fieldnum | Field selector. |
| [in] | time | Normalized simulation time. |
|
static |
=============================================================================
Initialize torpol diagnostics - creates fields_torpol.hdf5 with proper structure Matches Fortran diag_fields_torpol_init() subroutine (diagnostics.F90:1987-2103) Creates HDF5 file and datasets for poloidal (m) and toroidal (n) mode spectra Called once during initialization if nfreq_torpol > 0
|
static |
Write selected full-torus plane cuts.
| [in] | fieldnum | Field selector. |
| [in] | time | Normalized simulation time. |
|
static |
=============================================================================
Initialize fulltorus diagnostics - creates fulltorus.hdf5 with proper structure Matches Fortran diag_fulltorus_init() subroutine (diagnostics.F90:1631-1762) Creates HDF5 file and datasets for (R,Z) plane cuts and (s,theta) plane cuts Called once during initialization if nfreq_fulltorus > 0
|
static |
Run diagnostics scheduled for the current integration step.
| [in] | step | Step index within the current run/restart segment. |
| [in] | step_tot | Global step index including previous segments. |
| [in] | time | Current normalized simulation time. |
|
static |
Accumulate the (psi,v_parallel,v_perp) phase-space histogram.
| [in] | isp | Zero-based species index. |
| [in] | s | Radial coordinate s=sqrt(psi). |
| [in] | vpar | Normalized parallel velocity. |
| [in] | mu | Normalized magnetic moment. |
| [in] | B | Normalized magnetic-field magnitude. |
| [in] | pvol | Marker phase-space volume. |
| [in] | w | Perturbation weight. |
| [in] | zf0 | Equilibrium distribution value. |
|
static |
Accumulate the (s,v^2) marker-sampling histogram.
| [in] | isp | Zero-based species index. |
| [in] | s | Radial coordinate s=sqrt(psi). |
| [in] | en | Normalized kinetic energy. |
| [in] | pvol | Marker phase-space volume. |
| [in] | w | Perturbation weight. |
| [in] | zf0 | Equilibrium distribution value. |
diagnose_sampling in part.F90.
|
static |
Reduce and normalize diagnostics after one species push loop.
| [in] | isp | Zero-based species index. |
diagnostics_after_loop in part.F90.
|
static |
|
static |
E x B displacement-average accumulator.
|
static |
E x B displacement accumulator.
|
static |
|
static |
Accumulate passing/trapped electron fluxes and moments.
| [in] | isp | Zero-based electron-species index. |
| [in] | irloc | Zero-based radial bin. |
| [in] | zf0 | Equilibrium distribution value. |
| [in] | dPsidt1 | Perturbed flux characteristic. |
| [in] | dPsidt0 | Equilibrium flux characteristic. |
| [in] | ze | Normalized kinetic energy. |
| [in] | wt | Perturbation weight. |
| [in] | ffinit_tmp1 | First initial-distribution moment. |
| [in] | ffinit_tmp2 | Second initial-distribution moment. |
| [in] | ffinit_tmp3 | Third initial-distribution moment. |
| [in] | ffinit_tmp4 | Fourth initial-distribution moment. |
| [in] | is_trapped | Trapped-orbit classification. |
|
static |
|
static |
|
static |
Flush 0D diagnostics buffer to file Writes accumulated 0D diagnostic data to HDF5.
|
static |
|
static |
|
static |
| [in] | isp | Zero-based species index. |
|
inlinestatic |
|
inlinestatic |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Field-energy component selector. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Flux-averaged component selector. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Spectral component selector. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | Entropy channel index. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | Flux-channel index. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | Flux-channel index. |
|
static |
|
static |
|
static |
| [in] | idiag | Generic spectrum selector. |
| [in] | i | Toroidal-mode storage index. |
| [in] | j | Poloidal-mode storage index. |
|
inlinestatic |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Density, energy, or parallel-momentum selector. |
|
static |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | j dot E channel index. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | j dot E channel index. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | Zero-based miscellaneous channel. |
|
static |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Density, energy, or parallel-momentum selector. |
|
static |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | Spectrum selector. |
| [in] | i | Toroidal-mode storage index. |
| [in] | j | Poloidal-mode storage index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | type | Orbit-transition selector (FR_PASS through FR_RETRAP). |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | index | Weight-moment/variance channel. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | Velocity-channel index. |
E x B statistic.
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
Interpolate a selected field in magnetic coordinates.
| [in] | s | Radial coordinate s=sqrt(psi). |
| [in] | theta | Poloidal angle [rad]. |
| [in] | phi | Toroidal angle [rad]. |
| [in] | fieldnum | One of FIELD_PHI through FIELD_USER. |
|
static |
Allocate and clear generic signal-to-noise accumulators.
Referenced by init_test_diagnostic_arrays().
|
static |
Initialize Phase 1 diagnostic arrays and flags Called from initialize_diagnostics()
|
inlinestatic |
Allocate deterministic in-memory diagnostic storage for tests.
| [in] | nspecies | Number of species to allocate. |
References init_generic_signoise(), and moment1d_w.
|
inlinestatic |
Size and zero variance storage.
| [in] | nspecies | Number of species. |
|
static |
Initialize diagnostics system Sets up all diagnostic structures, grids, and output files.
|
static |
Initialize phase space diagnostics.
|
static |
Initialize source 3D diagnostics.
|
static |
Compute and accumulate one marker's j dot E power transfer.
| [in] | isp | Zero-based species index. |
| [in] | ut2 | Squared parallel velocity. |
| [in] | vpt2 | Squared perpendicular velocity. |
| [in] | vpar | Parallel-velocity vector. |
| [in] | genelec | Electric-gradient vector. |
| [in] | elec_par | Parallel electric-field vector. |
| [in] | wt | Perturbation weight. |
| [in] | bstar_inv | Inverse guiding-centre B* denominator. |
| [in] | bgrb | Magnetic-gradient vector. |
| [in] | vgb | Magnetic-drift vector. |
| [in] | vpressure | Pressure-gradient drift vector. |
| [in] | veb_f | Fluctuating E x B vector. |
| [in] | vexb | Total E x B vector. |
| [in] | expt_back | Radial equilibrium electric field. |
| [in] | eypt_back | Poloidal equilibrium electric field. |
| [in] | dvpadt0 | Equilibrium parallel acceleration. |
| [in] | gyroapar | Gyroaveraged parallel vector potential. |
|
static |
j dot E accumulator.
|
static |
j dot E accumulator.
|
static |
Update a maximum-valued zero-dimensional channel.
| [in] | isp | Zero-based species index. |
| [in] | i | Zero-based channel index. |
| [in] | to_add | Candidate normalized value. |
|
static |
Update maximum thermal-normalized E x B speed.
| [in] | isp | Zero-based species index. |
| [in] | to_add | Candidate normalized speed. |
|
static |
Update maximum normalized marker speed.
| [in] | isp | Zero-based species index. |
| [in] | to_add | Candidate speed. |
|
static |
Update maximum absolute marker weight.
| [in] | isp | Zero-based species index. |
| [in] | to_add | Candidate absolute weight. |
|
static |
|
static |
Serializes mmin_f array across MPI ranks for 3D output.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Accumulate electrostatic mode-particle-resonance power transfer.
| [in] | isp | Zero-based species index. |
| [in] | iuloc | Parallel-velocity bin. |
| [in] | imuloc | Magnetic-moment bin. |
| [in] | sigmat | Radial coordinate. |
| [in] | thetat | Diagnostic poloidal angle [rad]. |
| [in] | wt | Perturbation weight. |
| [in] | ut2 | Squared parallel velocity. |
| [in] | vpt2 | Squared perpendicular velocity. |
| [in] | bstar_inv | Inverse guiding-centre B* denominator. |
| [in] | vpar | Parallel-velocity vector. |
| [in] | genelec | Electric-gradient vector. |
| [in] | bgrb | Magnetic-gradient vector. |
| [in] | vgb | Magnetic-drift vector. |
| [in] | vpressure | Pressure-gradient drift vector. |
| [in] | veb_f | Fluctuating E x B vector. |
|
static |
Test a diagnostic cadence.
| [in] | step_tot | Global timestep index. |
| [in] | nfreq | Requested frequency in timesteps; nonpositive disables output. |
true when this step is on the requested cadence.
|
static |
Normalize radial fluxes and form zero-dimensional integrals.
| [in] | isp | Zero-based species index. |
|
static |
Normalize total-distribution radial moments.
| [in] | isp | Zero-based species index. |
|
static |
Normalize equilibrium-distribution radial moments.
| [in] | isp | Zero-based species index. |
|
static |
Normalize perturbation-weighted radial moments.
| [in] | isp | Zero-based species index. |
|
static |
Normalize two-dimensional averaged moments.
| [in] | isp | Zero-based species index. |
|
static |
Normalize one-dimensional poloidal moments.
| [in] | isp | Zero-based species index. |
|
static |
Generic diagnostic reduction interface (matches Fortran omp_reduce_diag)
In C++ with Kokkos, this is primarily a documentation marker since reductions are handled differently than in Fortran OpenMP.
| T | Diagnostic array type (Real, vector<Real>, etc.) |
| data | Reference to diagnostic data |
| use_max | If true, compute max; otherwise sum |
|
static |
=============================================================================
In Fortran, omp_reduce_diag() reduces per-thread diagnostic arrays to thread 0. The Fortran code uses OpenMP with thread-local storage (diag0d, diag1d, etc.).
In C++ with Kokkos:
These functions are provided for API compatibility and documentation. They perform in-place reduction (sum or max) on the diagnostic array. For single-rank scenarios, these are essentially no-ops.
Matching Fortran part.F90 lines 5198-5282 (omp_reduce_diag interface)
Reduce 0D diagnostic array (single value per species)
| data | Reference to diagnostic value |
| use_max | If true, compute max; otherwise sum |
|
static |
Reduce 1D diagnostic array.
| data | Reference to 1D vector |
| use_max | If true, compute max; otherwise sum |
|
static |
Reduce 2D diagnostic array.
| data | Reference to 2D vector |
| use_max | If true, compute max; otherwise sum |
|
static |
Reduce 3D diagnostic array.
| data | Reference to 3D vector |
| use_max | If true, compute max; otherwise sum |
|
static |
(psi,v_parallel,v_perp) phase-space histogram.
|
static |
Compute polarization-field diagnostic channels after reduction.
| [in] | isp | Zero-based species index. |
|
static |
|
static |
|
static |
Sample a selected field on an (s,phi) plane.
| [in] | theta | Fixed poloidal angle [rad]. |
| [in] | fieldnum | Field selector. |
| [out] | pot_sp | Globally reduced samples shaped [ns][nphi]. |
|
static |
Sample a selected field on an (s,theta) plane.
| [in] | phi | Fixed toroidal angle [rad]. |
| [in] | fieldnum | Field selector. |
| [in] | ns0 | Number of radial samples. |
| [out] | pot_st | Samples shaped [ns0][ntheta]. |
| [out] | xc | Optional cylindrical R coordinates. |
| [out] | zc | Optional cylindrical Z coordinates. |
|
static |
Write three-dimensional density and optional moment diagnostics.
| [in] | time | Normalized simulation time. |
| [in] | do_moments | Also write fluid moments when true. |
|
static |
Write one three-dimensional field/density diagnostic.
| [in] | time | Normalized simulation time. |
| [in] | diag_select | Diagnostic dataset selector. |
| [in] | field_select | Field selector. |
| [in] | isp | Optional zero-based species index. |
|
static |
Write a one-dimensional real array and optional title.
| [in] | path | Absolute HDF5 dataset path. |
| [in] | array | Contiguous values. |
| [in] | length | Number of values. |
| [in] | title | Optional human-readable quantity/units title. |
|
static |
Append a one-dimensional real slice at a simulation time.
| [in] | path | Absolute HDF5 dataset path. |
| [in] | array | Contiguous values. |
| [in] | length | Number of values. |
| [in] | time | Normalized simulation time. |
|
static |
Append a two-dimensional real slice at a simulation time.
| [in] | path | Absolute HDF5 dataset path. |
| [in] | array | Contiguous row-major values. |
| [in] | dim1 | First dimension. |
| [in] | dim2 | Second dimension. |
| [in] | time | Normalized simulation time. |
|
static |
| [in] | datn | Alternating restart generation, normally 0 or 1. |
|
static |
Gather distributed Fourier RHS coefficients for three-dimensional output.
| [in] | rhs_f_ptr | Rank-local coefficients converted from the Kokkos field view. |
|
static |
(s,v^2) sampling histogram.
|
inlinestatic |
| [in] | v | Generic buffer view to bind and mirror. |
|
inlinestatic |
| [in] | v | Per-species buffer view to bind and mirror. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | value | Normalized heating entropy rate. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | value | Normalized entropy rate. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | value | Normalized corrected entropy rate. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Zero-based total-energy component. |
| [in] | value | Normalized field energy. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Zero-based averaged component. |
| [in] | value | Normalized averaged field energy. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Zero-based spectral component. |
| [in] | value | Normalized spectral field energy. |
|
static |
| [in] | idiag | Generic spectrum selector. |
| [in] | i | Toroidal-mode storage index. |
| [in] | j | Poloidal-mode storage index. |
| [in] | value | Spectral power/value to store. |
|
inlinestatic |
| [in] | val | Next sample slot in the output buffer. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Density, energy, or parallel-momentum selector. |
| [in] | value | Normalized inner-edge loss. |
|
inlinestatic |
| [in] | isp | Zero-based species index. |
| [in] | idx | Zero-based miscellaneous channel. |
| [in] | val | Normalized value; invalid indices are ignored. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | value | Inner-boundary marker-loss count. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | value | Outer-boundary marker-loss count. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | component | Density, energy, or parallel-momentum selector. |
| [in] | value | Normalized outer-edge loss. |
| [in] | sn | Total electrostatic signal-to-noise ratio. |
| [in] | sn_nozf | Non-zonal electrostatic signal-to-noise ratio. |
| [in] | sn | Total electromagnetic signal-to-noise ratio. |
| [in] | sn_nozf | Non-zonal electromagnetic signal-to-noise ratio. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | Spectrum selector. |
| [in] | i | Toroidal-mode storage index. |
| [in] | j | Poloidal-mode storage index. |
| [in] | value | Spectral power/value to store. |
|
static |
| [in] | isp | Zero-based species index. |
| [in] | index | Weight-moment channel. |
| [in] | value | Normalized moment value. |
|
static |
| [in] | isp | Zero-based species index. |
|
static |
|
static |
Record one marker's strong-flow parity diagnostics.
| [in] | isp | Zero-based species index. |
| [in] | ip | Zero-based local marker index. |
| [in] | psi0t | Canonical/profile flux coordinate. |
| [in] | temp2 | Squared thermal-speed scale. |
| [in] | ze | Normalized kinetic energy. |
| [in] | vecrossb_f2 | Squared equilibrium E x B contribution. |
| [in] | pot_equil | Equilibrium potential. |
| [in] | zf0 | Equilibrium distribution value. |
| [in] | zvth2_inv | Inverse squared thermal-speed scale. |
| [in] | dpotdpsi | Radial potential derivative. |
| [in] | vdr | Radial characteristic. |
| [in] | rhs | Weight-equation right-hand side. |
|
static |
Accumulate one marker's fluctuation-entropy balance.
| [in] | isp | Zero-based species index. |
| [in] | wt | Perturbation weight. |
| [in] | zf0 | Equilibrium distribution value. |
| [in] | q_vgc_dot_genelec | Electric energy-transfer term. |
| [in] | zvth2_inv | Inverse squared thermal speed. |
| [in] | df0_dpsi_prof | Radial profile derivative of f0. |
| [in] | df0_dchi_prof | Poloidal profile derivative of f0. |
| [in] | dpsi_prof_dt | Profile-flux characteristic. |
|
static |
Deposit one marker into three-dimensional fluid moments.
| [in] | isp | Zero-based species index. |
| [in] | sigmat | Radial coordinate s=sqrt(psi). |
| [in] | chit | Poloidal angle [rad]. |
| [in] | phit | Toroidal angle [rad]. |
| [in] | wt | Perturbation weight. |
| [in] | ut | Parallel velocity. |
| [in] | ut2 | Squared parallel velocity. |
| [in] | vpt2 | Squared perpendicular velocity. |
|
static |
Accumulate magnetic-island radial/poloidal diagnostics.
| [in] | isp | Zero-based species index. |
| [in] | irloc | Island radial bin. |
| [in] | ipol | Island poloidal bin. |
| [in] | ut | Parallel velocity. |
| [in] | gradpsi0 | Equilibrium-flux gradient vector. |
| [in] | htildex | Radial island perturbation component. |
| [in] | htildey | Poloidal island perturbation component. |
| [in] | ze | Normalized kinetic energy. |
| [in] | zf0 | Equilibrium distribution value. |
| [in] | wt | Perturbation weight. |
| [in] | dPsidt1 | Perturbed flux characteristic. |
| [in] | ffinit_tmp1 | First initial-distribution moment. |
| [in] | ffinit_tmp2 | Second initial-distribution moment. |
| [in] | ffinit_tmp3 | Third initial-distribution moment. |
| [in] | ffinit_tmp4 | Fourth initial-distribution moment. |
|
static |
Accumulate (s,theta) initial-distribution moments.
| [in] | isp | Zero-based species index. |
| [in] | irloc | Radial bin. |
| [in] | ithetaloc | Poloidal-angle bin. |
| [in] | wt | Perturbation weight. |
| [in] | ffinit_tmp1 | First initial-distribution moment. |
| [in] | ffinit_tmp2 | Second initial-distribution moment. |
| [in] | ffinit_tmp3 | Third initial-distribution moment. |
| [in] | ffinit_tmp4 | Fourth initial-distribution moment. |
|
static |
Accumulate poloidal moments at the configured radial surface.
| [in] | isp | Zero-based species index. |
| [in] | ithetaloc | Poloidal-angle bin. |
| [in] | wt | Perturbation weight. |
| [in] | ffinit_tmp1 | First initial-distribution moment. |
| [in] | ffinit_tmp2 | Second initial-distribution moment. |
| [in] | ffinit_tmp3 | Third initial-distribution moment. |
| [in] | ffinit_tmp4 | Fourth initial-distribution moment. |
| [in] | wt_tmp1 | First perturbation-weight moment. |
| [in] | wt_tmp2 | Second perturbation-weight moment. |
| [in] | wt_tmp3 | Third perturbation-weight moment. |
|
static |
Accumulate all configured radial-bin diagnostics for one marker.
| [in] | isp | Zero-based species index. |
| [in] | ip | Zero-based local marker index. |
| [in] | irloc | Zero-based radial bin. |
| [in] | zf0 | Equilibrium distribution value. |
| [in] | dPsidt1 | Perturbed flux characteristic. |
| [in] | dPsidt0 | Equilibrium flux characteristic. |
| [in] | ze | Normalized kinetic energy. |
| [in] | wt | Perturbation weight. |
| [in] | ut | Parallel velocity. |
| [in] | ut2 | Squared parallel velocity. |
| [in] | vpt2 | Squared perpendicular velocity. |
| [in] | rt2 | Squared cylindrical major radius. |
| [in] | vpar | Three-component parallel velocity. |
| [in] | zf0_tmp1 | First equilibrium-distribution moment weight. |
| [in] | zf0_tmp2 | Second equilibrium-distribution moment weight. |
| [in] | zf0_tmp3 | Third equilibrium-distribution moment weight. |
| [in] | sigmat | Radial coordinate s=sqrt(psi). |
| [in] | zf0_local | Local Maxwellian/equilibrium reference value. |
| [in] | grsigma2 | Squared radial metric coefficient. |
| [in] | grsigmagrchi | Radial-poloidal metric cross coefficient. |
| [in] | b | Normalized magnetic-field magnitude. |
| [in] | exh | Three-component electric-field cross product. |
| [in] | wt_tmp1 | First perturbation-weight moment. |
| [in] | wt_tmp2 | Second perturbation-weight moment. |
| [in] | wt_tmp3 | Third perturbation-weight moment. |
| [in] | vexb | Three-component E x B velocity. |
| [in] | ffinit_tmp1 | First initial-distribution moment weight. |
| [in] | ffinit_tmp2 | Second initial-distribution moment weight. |
| [in] | ffinit_tmp3 | Third initial-distribution moment weight. |
| [in] | ffinit_tmp4 | Fourth initial-distribution moment weight. |
| [in] | ffinit_tmp5 | Fifth initial-distribution moment weight. |
| [in] | jdote_tot | Marker contribution to j dot E. |
| [in] | eloc | Three-component local electric-field gradient. |
sum_particles_in_radial_bins in part.F90.
|
static |
| [in] | isp | Zero-based species index. |
| [in] | idiag | Spectrum selector. |
| [in] | ndim | Toroidal spectrum dimension. |
| [in] | mdim | Poloidal spectrum dimension. |
|
static |
Accumulate one- and two-dimensional velocity-space diagnostics.
| [in] | isp | Zero-based species index. |
| [in] | iuloc | Parallel-velocity bin. |
| [in] | imuloc | Magnetic-moment/perpendicular-velocity bin. |
| [in] | wt | Perturbation weight. |
| [in] | zf0 | Equilibrium distribution value. |
| [in] | pvol | Marker phase-space volume. |
|
static |
Store one selected test-particle record.
| [in] | isp | Zero-based species index. |
| [in] | ip | Zero-based local marker index. |
| [in] | psi0t | Canonical/profile flux coordinate. |
| [in] | ze | Normalized kinetic energy. |
| [in] | pot_equil | Equilibrium potential. |
| [in] | wt | Perturbation weight. |
| [in] | zvth2 | Squared thermal-speed scale. |
| [in] | nval | Normalized density. |
| [in] | pvol_updated | Updated phase-space volume. |
| [in] | zf0 | Equilibrium distribution value. |
|
static |
|
static |
|
static |
Initialize velocity space diagnostics Sets up velocity space grids and output structures.
|
static |
|
static |
|
static |
Write the standard scalar, profile, and spectrum output set.
| [in] | step | Current global timestep index. |
| [in] | time | Current normalized simulation time. |
write_output(step,time) in diagnostics.F90.
|
static |
| [in] | datn | Alternating restart generation, normally 0 or 1. |
|
static |
Zero one generic (m,n) spectrum slice.
| [in] | idiag | Potential/vector-potential spectrum selector. |
| [in] | ndim | Toroidal spectrum dimension. |
| [in] | mdim | Poloidal spectrum dimension. |
|
static |
Zero one per-species (m,n) spectrum slice.
| [in] | isp | Zero-based species index. |
| [in] | idiag | Field/density/current spectrum selector. |
| [in] | ndim | Toroidal spectrum dimension. |
| [in] | mdim | Poloidal spectrum dimension. |
|
inlinestatic |
Local \(A_\parallel(s,0,0)\) radial cut.
|
staticconstexpr |
Select total parallel vector potential.
|
staticconstexpr |
Select Hamiltonian \(A_\parallel\).
|
staticconstexpr |
Select symplectic \(A_\parallel\).
|
staticconstexpr |
Select density field.
|
staticconstexpr |
=============================================================================
Field type constants (matching Fortran names.F90 lines 162-167) Used to select which field to retrieve in getpot_fieldnum() Select electrostatic potential \(\phi\).
|
staticconstexpr |
Select user-defined external field.
|
inlinestatic |
moment1d_w: 1D moment diagnostics weighted by w (matching Fortran moment1d_w) [nspecies][nbin_flux+2][14 diagnostic types] - matching moment1d_w structure
Referenced by init_test_diagnostic_arrays().
|
inlinestatic |
Species output flags (matching Fortran out(0:NSPECIES_MAX)) out[0] = true for pure fluid model, out[isp] = true if species isp has diagnostic output.
|
inlinestatic |
MPI ranks responsible for phi cuts (matching Fortran pe_phi_cuts(0:2)) Stores the PE rank that owns each of the 3 phi cut positions for output.
Referenced by Diagnostics().
|
inlinestatic |
Public diagnostic arrays (accessed by FieldsModule in solve_fem, matching Fortran pde_solver) Potential diagnostic arrays (matching Fortran diagnostics.F90)
Flux-surface average of \(\phi\) on the radial spline grid.
|
inlinestatic |
Poloidal potential cut at the configured diagnostic radius.
|
inlinestatic |
Flux-surface-averaged electrostatic potential.
|
inlinestatic |
\(\phi(s,\theta=0,\varphi=0)\) radial cut.
|
inlinestatic |
High-field-side cut \(\phi(s,\theta=\pi,\varphi=0)\).
|
inlinestatic |
Flux-surface-averaged charge density by radius and species.