ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
Loading...
Searching...
No Matches
orb5x::ParticleModule Class Reference

#include "part.hpp"

Collaboration diagram for orb5x::ParticleModule:

Public Member Functions

Real b_star (Real st, Real chit, Real b, Real ut, Real tprime, Real addpBst, int isp)
void bcpart (int isp, bool run_on_device)
void bcpart_disp (bool run_on_device)
void calc_dist (int isp, Real sigmat, Real chit, Real ut, Real mu, Real psi0_corr, Real &distribution, Real *bst=nullptr, Real *dist_coeff=nullptr, Real *diff_t_vpll=nullptr)
void charge_deposition_passing_electrons_disp (int isp, const int *lb, const int *ub, Kokkos::View< Real ** > &rho_passing)
void check_ffinit (int isp)
 Validation routine for FFINIT consistency Matching Fortran part.F90 lines 1497-1514.
void compute_all_larmor_positions (int isp)
void compute_all_larmor_positions_disp (bool comp_dk)
void compute_moments_3d (int isp)
void compute_psi0_corr_disp (bool flag)
void compute_reduced_weights (int isp, const Kokkos::View< Real ** > &pic1_loc, const Kokkos::View< Real ** > &pic2_loc, const Kokkos::View< bool ** > &pic3_loc, const Kokkos::View< int * > &npart_view, int nsel_att)
void compute_reduced_weights_disp (int isp, int nsel_att)
void deposit_bsplines (int isp, int npart_loc, const Kokkos::View< Real ** > &pic1_loc, const Kokkos::View< Real ** > &pic2_loc)
void diagnose_particles (int isp)
void gauss_list_init (int isp, Kokkos::View< Real ** > &pert_table, int &nperts)
 Gaussian perturbation list loading from file Matching Fortran part.F90 lines 8330-8355.
void get_field_disp (const FieldType &field, int istep, bool nl_main_substep, int i_att)
Real get_KE (int isp)
void get_larmor_indices_disp (bool initflag=false, bool adapt_only=false)
void get_pos (int isp, int ip, Real *pos)
void get_properties (int isp, int ip, Real *props)
void get_toroidal_momentum (int isp, Real st, Real chit, Real ut, Real mut, Real psi_correction, Real tsubB, Real &psit_prof, Real &psit_pot)
Real get_vpaob_ba (Real psi, Real mu, Real en, Real v_pll, int isp)
 Get bounce-averaged v_parallel/B from precomputed lookup table.
void grid_pic (int isp, bool run_on_device)
void grid_pic (int isp, int nsel_att, bool reduce_flag, const int *lb, const int *ub, Kokkos::View< Real ***, Kokkos::LayoutStride > assign1, int i_att)
 Charge/current deposition on grid (matching Fortran grid_pic, part.F90 lines 7771-7920).
void grid_pic_diagnostic (int isp, int nsel_att, const int *lb, const int *ub, Kokkos::View< Real *** > &assign1)
 Diagnostic charge/current deposition on grid (matching Fortran grid_pic_diagnostic, part.F90 lines 8190-8272).
void helical_flux_label (Real sigmat, Real xiang, int &irloc, Real &dr_flux_inv, int &ipol)
void init_particles ()
void init_push_diagnostics ()
void init_test_particles (int isp)
void l5_auto_init (int isp, Kokkos::View< Real ** > &l5_s_array)
 LIGKA mode automatic initialization Matching Fortran part.F90 lines 8284-8328.
void load_particles ()
void load_test_particles (int isp)
void parmove (int iter, bool run_on_device, bool work1flag, bool work2flag, bool work3flag=false, bool work5flag=false, bool work6flag=false, bool work7flag=false, bool work8flag=false, bool work9flag=false)
void part_grid (int isp, int nsel_att, bool reduce_flag, int i_att, const int *lb, const int *ub, Kokkos::View< Real ***, Kokkos::LayoutStride > assign1, Kokkos::View< Real ** > *assign1_passing=nullptr)
 Charge or current deposition wrapper routine Matching Fortran part.F90 lines 8698-8727 (external part_grid subroutine).
 ParticleModule ()=default
void postpush_disp ()
void postpush_fullf (int isp)
void print_test_particles (int step)
void pszs_calc ()
void pszs_setboundaries (int isp, Real *lb, Real *ub)
 PSZS boundary setup from particle distribution Matching Fortran part.F90 lines 8442-8549 Sets up boundaries for Phase Space Zone Sampling diagnostics.
void pullback ()
void push_disp (int iter)
Real q_of_s (Real s)
void quadtree_smoothing_disp ()
void quadtree_smoothing_interface (int isp, bool diagnose_)
void read_write_particle_data (int flag, int datn)
void set_weights_to_zero_at_t0 ()
void sort_gc_2D_disp ()
void sort_gc_3D_disp ()
void str_diagnostic_start ()
 Initialize strong flow diagnostic output files Matching Fortran part.F90 lines 4726-4750 Opens output files for psi, energy, kappa, rhs diagnostics.
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)
 Strong flow diagnostic output Matching Fortran part.F90 lines 5066-5102 Outputs diagnostics for strong flow validation.
void test_particle_output (int isp, int ip, Real psi0t, Real ze, Real pot_equil, Real wt, Real zvth2, Real nval, Real pvol, Real zf0)
 Test particle output routine Matching Fortran part.F90 lines 4490-4506 Stores test particle diagnostics.
void trap_detrap_disp ()
void unsort_gc_3D_disp ()
void update_ffinit_or_pvol ()
bool uses_modified_toroidal_momentum (int isp) const
void vpa_quants (Real psi, Real mu, Real en_star, Real v_pll, int isp, Real &fvpllb, Real &dfvpllb_den, Real &dfvpllb_dpsi)
 Compute v_parallel/B quantities from lookup table Matching Fortran part.F90 lines 6814-6895 Full interpolation from vpbi array with derivatives.
 ~ParticleModule ()

Static Public Member Functions

static void compute_deposition_attributes_dk (const Kokkos::View< Real * > &u, const Kokkos::View< Real * > &w, Kokkos::View< Real * > &uw, int n)
 Compute deposition attributes for drift-kinetic models Matching Fortran part.F90 lines 2717-2733.
static Real compute_psi0_corr_one_particle (int isp, Real st, Real chit, Real mut, Real ut)
static Real compute_vf0 (int isp, Real zvth2, Real nval, Real ze, Real zecor, Real b, Real pot_equil, Real pot_equil0, Real psit, Real ut, Real mut)
 Compute equilibrium distribution function f0.
static std::vector< Realcross_product (const std::vector< Real > &a, const std::vector< Real > &b)
 Cross product of two 3D vectors.
static void destroyStaticViews ()
static void distrib_2D_loadRZ (const std::vector< Real > &rev2, const std::vector< Real > &rev3, const std::vector< std::vector< Real > > &prob, const std::vector< Real > &xg, const std::vector< Real > &yg, const std::vector< Real > &fdistx, Real dx, Real dy, std::vector< Real > &xp, std::vector< Real > &yp)
static void get_dist_derivs (Real f0, Real ut, Real mut, Real b, Real epsilon_hat, Real ze, Real zvth2, Real nval, Real Epsi, Real psit, Real ngrad, Real tgrad, Real, Real, int isp, Real &df0_dek, Real &df0_du, Real &df0_dpsi_prof, Real &df0_dchi_prof, Real &df0_dpsi_pot, Real zecor, Real pot_equil, Real pot_equil0, Real chit)
static int get_i_cantormom (int isp)
static Real get_kinetic_energy (Real ut, Real mut, Real b)
static int get_n_larmor_pts (int isp, int nsel_gyr_local, Real rhog)
static Real get_properties_en (int isp, Real st, Real chit, Real ut, Real mut, Real vpval)
static void get_rhs (int ip, int isp, Real pvol, Real vdr, Real vdchi, const std::vector< Real > &vgc, const std::vector< Real > &vin, Real vpval, const std::vector< Real > &genelec, Real dvpadt0, Real dvpadt1, Real gyroapar, Real ze, Real zecor, Real dH0_dt_correction, Real pot_equil, Real pot_equil0, Real distribution, Real ut, Real mut, Real b, Real zvth2, Real nval, Real Epsi, Real psi0t, Real ngrad, Real tgrad, Real vpgrad, Real dfvpllb_dpsi, Real dfvpllb_den, Real &rhs, Real &dpotdpsi, Real &omegasq_corr, Real &df0_dpsi_prof, Real &df0_dchi_prof, Real &dpsi_prof_dt, Real &dchi_prof_dt, int rhs_type, const std::vector< Real > &mgradphi, const std::vector< Real > &vgb, const std::vector< Real > &vpressure, const std::vector< Real > &mgradapar, const std::vector< Real > &hh_sympl, Real chit, Real dchi_dt1, int iter, Real ffinit, Real dPsidt0)
 Computes RHS of delta-f equation Matching Fortran get_rhs subroutine (lines 4791-4968 in part.F90).
static void init_distrib_2D_loadRZ (FieldsVariables *fields, Real lenx, Real leny, int isp, std::vector< std::vector< Real > > &prob, std::vector< Real > &xg, std::vector< Real > &yg, std::vector< Real > &fdistx, Real &dx, Real &dy)
static void perp_curl_ue (Real s, Real chi, Real &smodstar, Real &chimodstar, Real &phimodstar)
 Returns components of h x h x curl(u_e) Matching Fortran part.F90 lines 7468-7483.
static Real reverse_hammersley (int nbase, int64_t i)
static void strong_flow_terms (int isp, Real sigmat, Real chit, Real bstar_inv, const std::vector< Real > &genelec, Real pztomobstar, const std::vector< Real > &bgrb, const std::vector< Real > &addp, Real expt_back, Real eypt_back, const std::vector< Real > &exh, Real ut, Real mut, const std::vector< Real > &hh, Real &dvpadt1_str, Real &dvpadt0_str, std::vector< Real > &vgc)
 Strong flow terms computation Matching Fortran part.F90 lines 5284-5315.
static Real vf0 (int isp, Real zvth2, Real nval, Real ze, Real zecor, Real b, Real pot_equil, Real pot_equil0, Real psit, Real ut, Real mut, int nsel_f0_override=-1)
static Real vf0_chi_prof (Real zf0, Real, Real, Real ze, Real, Real, Real, Real, Real ut, Real, Real psit, int isp, Real zvth2, Real nval, Real zecor, Real pot_equil, Real pot_equil0, Real mut, Real chit)
static Real vf0_local_maxwellian_simple (Real zvth2, Real nval, Real ze)
static Real vf0_psi_prof (Real zf0, Real ngrad, Real epsilon_hat, Real ze, Real b, Real kappa_str, Real zvth2_inv, Real tgrad, Real ut, Real psi0_inv, Real psit, int isp, Real zvth2, Real nval, Real zecor, Real pot_equil, Real pot_equil0, Real mut, Real chit)
static Real vf0dek (Real zf0, Real zvth2, Real ze, Real psit, int isp, Real nval, Real zecor, Real b, Real pot_equil, Real pot_equil0, Real ut, Real mut, Real chit)
static Real vf0du (Real zf0, Real ut, Real, Real zvth2, Real nval, Real psit, int isp, Real ze, Real zecor, Real pot_equil, Real pot_equil0, Real mut, Real chit)
static Real ze_correction (Real ut, Real vpval)

Public Attributes

Kokkos::View< Real * > bin_surf_inv
Kokkos::View< Real * > bin_vol_inv
Kokkos::View< Complex *** > cfield_out_3D
Kokkos::View< Complex *** > cfield_out_3D_fft
Kokkos::View< Real * > dens0
Real dmu_bin = 0.0
Real dmu_bin_2 = 0.0
Real dpsi_bin = 0.0
Real dr_flux_inv = 0.0
Real dth_inv = 0.0
Real ftrap = 0.0
std::vector< Realintegral_f0_global
int irloc_in = 0
int lb_wx = 0
int MAX_PIC2 = 0
int MAX_PIC5 = 0
int MAX_WORK = 0
int MAX_WORK_FIELDS = 0
int MAX_WORK_REV = 0
std::vector< Moments3DClassmoments_3d_array
Real mu_max = 0.0
Real mu_min = 0.0
std::vector< Realmumax_global
Kokkos::View< Real ** > n_vel_1D
Kokkos::View< Real ** > n_vel_trap_1D
int NBIN_MU_F0 = 0
int NLARM_PIC2 = 0
Kokkos::View< int * > npart
Kokkos::View< int * > npmx
Kokkos::View< Real * > nptot_inv
Kokkos::View< int * > ntest
int ntrap = 0
int num_mesh = 0
std::vector< PointerMarkerspic1
std::vector< PointerMarkerspic2
std::vector< PointerMarkersLogicpic3
std::vector< PointerMarkersI8pic4
std::vector< PointerMarkersR4pic5
std::vector< PointerMarkerspion_1
Kokkos::View< Real * > ppsum_buff_real
Real psi0_inv = 0.0
Real psi_max = 1.0
Real psi_min = 0.0
int qt_num_chi = 0
int qt_num_s = 0
Kokkos::View< bool * > qt_toggle_flag
std::vector< PointerQuadtreeqtree
Kokkos::View< Real *** > rho_passing_omp
std::vector< std::unique_ptr< SortingClass > > sortings
std::vector< Realsum_ekin_markers_global
std::vector< Realsum_pekin_markers_global
Kokkos::View< Real * > Total_weight
int ub_wx = 0
std::vector< Realumax_global
std::vector< Realumin_global
Kokkos::View< Real ** > vpbi
Kokkos::View< Real **, Kokkos::LayoutLeft, Kokkos::HostSpace > vpbi_host_cache
Kokkos::View< Real ** > vpll_momentum_bins
Kokkos::View< Real **, Kokkos::LayoutLeft, Kokkos::HostSpace > vpll_momentum_bins_host_cache
std::vector< PointerMarkerswork1
std::vector< PointerMarkerswork2
std::vector< PointerMarkerswork3
std::vector< PointerMarkerswork5
std::vector< PointerMarkerswork6
std::vector< PointerMarkerswork7
std::vector< PointerMarkerswork8
std::vector< PointerMarkerswork9
std::vector< PointerMarkerswork_rev
std::vector< PointerMarkerswork_temp
std::vector< Realzsmax_global
std::vector< Realzsum_global

Static Public Attributes

static constexpr int qt_num_s_per_ns = 2

Constructor & Destructor Documentation

◆ ParticleModule()

orb5x::ParticleModule::ParticleModule ( )
default

◆ ~ParticleModule()

orb5x::ParticleModule::~ParticleModule ( )

Member Function Documentation

◆ b_star()

Real orb5x::ParticleModule::b_star ( Real st,
Real chit,
Real b,
Real ut,
Real tprime,
Real addpBst,
int isp )

◆ bcpart()

void orb5x::ParticleModule::bcpart ( int isp,
bool run_on_device )

◆ bcpart_disp()

void orb5x::ParticleModule::bcpart_disp ( bool run_on_device)

◆ calc_dist()

void orb5x::ParticleModule::calc_dist ( int isp,
Real sigmat,
Real chit,
Real ut,
Real mu,
Real psi0_corr,
Real & distribution,
Real * bst = nullptr,
Real * dist_coeff = nullptr,
Real * diff_t_vpll = nullptr )

◆ charge_deposition_passing_electrons_disp()

void orb5x::ParticleModule::charge_deposition_passing_electrons_disp ( int isp,
const int * lb,
const int * ub,
Kokkos::View< Real ** > & rho_passing )

◆ check_ffinit()

void orb5x::ParticleModule::check_ffinit ( int isp)

Validation routine for FFINIT consistency Matching Fortran part.F90 lines 1497-1514.

Parameters
ispSpecies index (0-based in C++)

◆ compute_all_larmor_positions()

void orb5x::ParticleModule::compute_all_larmor_positions ( int isp)

◆ compute_all_larmor_positions_disp()

void orb5x::ParticleModule::compute_all_larmor_positions_disp ( bool comp_dk)

◆ compute_deposition_attributes_dk()

void orb5x::ParticleModule::compute_deposition_attributes_dk ( const Kokkos::View< Real * > & u,
const Kokkos::View< Real * > & w,
Kokkos::View< Real * > & uw,
int n )
static

Compute deposition attributes for drift-kinetic models Matching Fortran part.F90 lines 2717-2733.

Parameters
uMarker parallel momenta
wMarker weights
uwOutput: Product of u and w
nNumber of markers

◆ compute_moments_3d()

void orb5x::ParticleModule::compute_moments_3d ( int isp)

◆ compute_psi0_corr_disp()

void orb5x::ParticleModule::compute_psi0_corr_disp ( bool flag)

◆ compute_psi0_corr_one_particle()

Real orb5x::ParticleModule::compute_psi0_corr_one_particle ( int isp,
Real st,
Real chit,
Real mut,
Real ut )
static

◆ compute_reduced_weights()

void orb5x::ParticleModule::compute_reduced_weights ( int isp,
const Kokkos::View< Real ** > & pic1_loc,
const Kokkos::View< Real ** > & pic2_loc,
const Kokkos::View< bool ** > & pic3_loc,
const Kokkos::View< int * > & npart_view,
int nsel_att )

◆ compute_reduced_weights_disp()

void orb5x::ParticleModule::compute_reduced_weights_disp ( int isp,
int nsel_att )

◆ compute_vf0()

Real orb5x::ParticleModule::compute_vf0 ( int isp,
Real zvth2,
Real nval,
Real ze,
Real zecor,
Real b,
Real pot_equil,
Real pot_equil0,
Real psit,
Real ut,
Real mut )
static

Compute equilibrium distribution function f0.

Public wrapper for the internal vf0 function, used by PSZS diagnostics.

Parameters
ispSpecies index (0-based)
zvth2Thermal velocity squared
nvalDensity profile value
zeKinetic energy
zecorEnergy correction
bMagnetic field magnitude
pot_equilEquilibrium potential
pot_equil0Reference equilibrium potential
psitToroidal flux coordinate
utParallel velocity
mutMagnetic moment
Returns
f0 value

◆ cross_product()

std::vector< Real > orb5x::ParticleModule::cross_product ( const std::vector< Real > & a,
const std::vector< Real > & b )
static

Cross product of two 3D vectors.

◆ deposit_bsplines()

void orb5x::ParticleModule::deposit_bsplines ( int isp,
int npart_loc,
const Kokkos::View< Real ** > & pic1_loc,
const Kokkos::View< Real ** > & pic2_loc )

◆ destroyStaticViews()

void orb5x::ParticleModule::destroyStaticViews ( )
static

◆ diagnose_particles()

void orb5x::ParticleModule::diagnose_particles ( int isp)

◆ distrib_2D_loadRZ()

void orb5x::ParticleModule::distrib_2D_loadRZ ( const std::vector< Real > & rev2,
const std::vector< Real > & rev3,
const std::vector< std::vector< Real > > & prob,
const std::vector< Real > & xg,
const std::vector< Real > & yg,
const std::vector< Real > & fdistx,
Real dx,
Real dy,
std::vector< Real > & xp,
std::vector< Real > & yp )
static

◆ gauss_list_init()

void orb5x::ParticleModule::gauss_list_init ( int isp,
Kokkos::View< Real ** > & pert_table,
int & nperts )

Gaussian perturbation list loading from file Matching Fortran part.F90 lines 8330-8355.

Parameters
ispSpecies index (0-based)
pert_tableOutput: Table of perturbation parameters
npertsOutput: Number of perturbations loaded

◆ get_dist_derivs()

void orb5x::ParticleModule::get_dist_derivs ( Real f0,
Real ut,
Real mut,
Real b,
Real epsilon_hat,
Real ze,
Real zvth2,
Real nval,
Real Epsi,
Real psit,
Real ngrad,
Real tgrad,
Real ,
Real ,
int isp,
Real & df0_dek,
Real & df0_du,
Real & df0_dpsi_prof,
Real & df0_dchi_prof,
Real & df0_dpsi_pot,
Real zecor,
Real pot_equil,
Real pot_equil0,
Real chit )
static

◆ get_field_disp()

void orb5x::ParticleModule::get_field_disp ( const FieldType & field,
int istep,
bool nl_main_substep,
int i_att )

◆ get_i_cantormom()

int orb5x::ParticleModule::get_i_cantormom ( int isp)
static

◆ get_KE()

Real orb5x::ParticleModule::get_KE ( int isp)

◆ get_kinetic_energy()

Real orb5x::ParticleModule::get_kinetic_energy ( Real ut,
Real mut,
Real b )
static

◆ get_larmor_indices_disp()

void orb5x::ParticleModule::get_larmor_indices_disp ( bool initflag = false,
bool adapt_only = false )

◆ get_n_larmor_pts()

int orb5x::ParticleModule::get_n_larmor_pts ( int isp,
int nsel_gyr_local,
Real rhog )
static

◆ get_pos()

void orb5x::ParticleModule::get_pos ( int isp,
int ip,
Real * pos )

◆ get_properties()

void orb5x::ParticleModule::get_properties ( int isp,
int ip,
Real * props )

◆ get_properties_en()

Real orb5x::ParticleModule::get_properties_en ( int isp,
Real st,
Real chit,
Real ut,
Real mut,
Real vpval )
static

◆ get_rhs()

void orb5x::ParticleModule::get_rhs ( int ip,
int isp,
Real pvol,
Real vdr,
Real vdchi,
const std::vector< Real > & vgc,
const std::vector< Real > & vin,
Real vpval,
const std::vector< Real > & genelec,
Real dvpadt0,
Real dvpadt1,
Real gyroapar,
Real ze,
Real zecor,
Real dH0_dt_correction,
Real pot_equil,
Real pot_equil0,
Real distribution,
Real ut,
Real mut,
Real b,
Real zvth2,
Real nval,
Real Epsi,
Real psi0t,
Real ngrad,
Real tgrad,
Real vpgrad,
Real dfvpllb_dpsi,
Real dfvpllb_den,
Real & rhs,
Real & dpotdpsi,
Real & omegasq_corr,
Real & df0_dpsi_prof,
Real & df0_dchi_prof,
Real & dpsi_prof_dt,
Real & dchi_prof_dt,
int rhs_type,
const std::vector< Real > & mgradphi,
const std::vector< Real > & vgb,
const std::vector< Real > & vpressure,
const std::vector< Real > & mgradapar,
const std::vector< Real > & hh_sympl,
Real chit,
Real dchi_dt1,
int iter,
Real ffinit,
Real dPsidt0 )
static

Computes RHS of delta-f equation Matching Fortran get_rhs subroutine (lines 4791-4968 in part.F90).

◆ get_toroidal_momentum()

void orb5x::ParticleModule::get_toroidal_momentum ( int isp,
Real st,
Real chit,
Real ut,
Real mut,
Real psi_correction,
Real tsubB,
Real & psit_prof,
Real & psit_pot )

◆ get_vpaob_ba()

Real orb5x::ParticleModule::get_vpaob_ba ( Real psi,
Real mu,
Real en,
Real v_pll,
int isp )

Get bounce-averaged v_parallel/B from precomputed lookup table.

Matching Fortran part.F90 lines 6674-6710.

Parameters
psiFlux coordinate (psi = sigma^2)
muMagnetic moment
enEnergy (0.5*u^2 + mu*B)
v_pllParallel velocity (for sign determination)
ispSpecies index (0-based in C++)
Returns
Bounce-averaged v_parallel/B scaled by sqrt(energy)

◆ grid_pic() [1/2]

void orb5x::ParticleModule::grid_pic ( int isp,
bool run_on_device )

◆ grid_pic() [2/2]

void orb5x::ParticleModule::grid_pic ( int isp,
int nsel_att,
bool reduce_flag,
const int * lb,
const int * ub,
Kokkos::View< Real ***, Kokkos::LayoutStride > assign1,
int i_att )

Charge/current deposition on grid (matching Fortran grid_pic, part.F90 lines 7771-7920).

Handles both drift-kinetic (DK) and gyrokinetic species:

  • DK species: deposits from guiding center positions (pic1) using W_PIC or UW_PIC weights
  • Gyrokinetic species: deposits from Larmor ring points using WGT_ATT or WCF_ATT weights
  • Applies chi-periodicity folding, normalization, guard cell exchange, and clone MPI reduction

Uses part_fields::deposition (matching Fortran interface deposition, part_fields.F90 lines 25-27)

Parameters
ispSpecies index (0-based in C++)
nsel_attWhich attribute to be deposited (NSEL_CHARGE=0 or NSEL_CURRENT=1)
reduce_flagReduce the weights by the adiabatic density/current
lbLower indices of the deposition arrays (size 4)
ubUpper indices of the deposition arrays (size 4)
assign1Output: deposited quantity array
i_attIteration over atts arrays (1-based, matching Fortran)

◆ grid_pic_diagnostic()

void orb5x::ParticleModule::grid_pic_diagnostic ( int isp,
int nsel_att,
const int * lb,
const int * ub,
Kokkos::View< Real *** > & assign1 )

Diagnostic charge/current deposition on grid (matching Fortran grid_pic_diagnostic, part.F90 lines 8190-8272).

Uses pic5 (Real32) marker attributes for diagnostic moment deposition. Normalization: 1/dens0 * nphi/TWOPI (differs from grid_pic which uses charge/dens0). Also uses part_fields::deposition.

Parameters
ispSpecies index (0-based in C++)
nsel_attWhich pic5 attribute to deposit
lbLower indices of the deposition arrays (size 3 or 4)
ubUpper indices of the deposition arrays (size 3 or 4)
assign1Output: deposited quantity array

◆ helical_flux_label()

void orb5x::ParticleModule::helical_flux_label ( Real sigmat,
Real xiang,
int & irloc,
Real & dr_flux_inv,
int & ipol )

References dr_flux_inv.

◆ init_distrib_2D_loadRZ()

void orb5x::ParticleModule::init_distrib_2D_loadRZ ( FieldsVariables * fields,
Real lenx,
Real leny,
int isp,
std::vector< std::vector< Real > > & prob,
std::vector< Real > & xg,
std::vector< Real > & yg,
std::vector< Real > & fdistx,
Real & dx,
Real & dy )
static

References orb5x::fields.

◆ init_particles()

void orb5x::ParticleModule::init_particles ( )

◆ init_push_diagnostics()

void orb5x::ParticleModule::init_push_diagnostics ( )

◆ init_test_particles()

void orb5x::ParticleModule::init_test_particles ( int isp)

◆ l5_auto_init()

void orb5x::ParticleModule::l5_auto_init ( int isp,
Kokkos::View< Real ** > & l5_s_array )

LIGKA mode automatic initialization Matching Fortran part.F90 lines 8284-8328.

Parameters
ispSpecies index (0-based)
l5_s_arrayOutput: Array of radial positions for LIGKA modes

◆ load_particles()

void orb5x::ParticleModule::load_particles ( )

◆ load_test_particles()

void orb5x::ParticleModule::load_test_particles ( int isp)

◆ parmove()

void orb5x::ParticleModule::parmove ( int iter,
bool run_on_device,
bool work1flag,
bool work2flag,
bool work3flag = false,
bool work5flag = false,
bool work6flag = false,
bool work7flag = false,
bool work8flag = false,
bool work9flag = false )

◆ part_grid()

void orb5x::ParticleModule::part_grid ( int isp,
int nsel_att,
bool reduce_flag,
int i_att,
const int * lb,
const int * ub,
Kokkos::View< Real ***, Kokkos::LayoutStride > assign1,
Kokkos::View< Real ** > * assign1_passing = nullptr )

Charge or current deposition wrapper routine Matching Fortran part.F90 lines 8698-8727 (external part_grid subroutine).

This is the main entry point for particle deposition, wrapping:

Parameters
ispSpecies index (0-based in C++)
nsel_attAttribute selector for deposition (NSEL_CHARGE, NSEL_CURRENT, etc.)
reduce_flagIf true, compute reduced weights before deposition
i_attIteration counter over atts arrays (1-based in Fortran, 0-based here)
lbLower bounds of charge arrays (size 4)
ubUpper bounds of charge arrays (size 4)
assign1Output: Deposited quantity array [lb(1):ub(1), lb(2):ub(2), lb(3):ub(3)]
assign1_passingOptional output: Passing electron charge array [lb(1):ub(1), lb(2):ub(2)]

◆ perp_curl_ue()

void orb5x::ParticleModule::perp_curl_ue ( Real s,
Real chi,
Real & smodstar,
Real & chimodstar,
Real & phimodstar )
static

Returns components of h x h x curl(u_e) Matching Fortran part.F90 lines 7468-7483.

◆ postpush_disp()

void orb5x::ParticleModule::postpush_disp ( )

◆ postpush_fullf()

void orb5x::ParticleModule::postpush_fullf ( int isp)

◆ print_test_particles()

void orb5x::ParticleModule::print_test_particles ( int step)

◆ pszs_calc()

void orb5x::ParticleModule::pszs_calc ( )

◆ pszs_setboundaries()

void orb5x::ParticleModule::pszs_setboundaries ( int isp,
Real * lb,
Real * ub )

PSZS boundary setup from particle distribution Matching Fortran part.F90 lines 8442-8549 Sets up boundaries for Phase Space Zone Sampling diagnostics.

Parameters
ispSpecies index (0-based)
lbLower bounds array (size 3)
ubUpper bounds array (size 3)

◆ pullback()

void orb5x::ParticleModule::pullback ( )

◆ push_disp()

void orb5x::ParticleModule::push_disp ( int iter)

◆ q_of_s()

Real orb5x::ParticleModule::q_of_s ( Real s)

◆ quadtree_smoothing_disp()

void orb5x::ParticleModule::quadtree_smoothing_disp ( )

◆ quadtree_smoothing_interface()

void orb5x::ParticleModule::quadtree_smoothing_interface ( int isp,
bool diagnose_ )

◆ read_write_particle_data()

void orb5x::ParticleModule::read_write_particle_data ( int flag,
int datn )

◆ reverse_hammersley()

Real orb5x::ParticleModule::reverse_hammersley ( int nbase,
int64_t i )
static

◆ set_weights_to_zero_at_t0()

void orb5x::ParticleModule::set_weights_to_zero_at_t0 ( )

◆ sort_gc_2D_disp()

void orb5x::ParticleModule::sort_gc_2D_disp ( )

◆ sort_gc_3D_disp()

void orb5x::ParticleModule::sort_gc_3D_disp ( )

◆ str_diagnostic_start()

void orb5x::ParticleModule::str_diagnostic_start ( )

Initialize strong flow diagnostic output files Matching Fortran part.F90 lines 4726-4750 Opens output files for psi, energy, kappa, rhs diagnostics.

◆ strong_diagnostic_output()

void orb5x::ParticleModule::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 )

Strong flow diagnostic output Matching Fortran part.F90 lines 5066-5102 Outputs diagnostics for strong flow validation.

◆ strong_flow_terms()

void orb5x::ParticleModule::strong_flow_terms ( int isp,
Real sigmat,
Real chit,
Real bstar_inv,
const std::vector< Real > & genelec,
Real pztomobstar,
const std::vector< Real > & bgrb,
const std::vector< Real > & addp,
Real expt_back,
Real eypt_back,
const std::vector< Real > & exh,
Real ut,
Real mut,
const std::vector< Real > & hh,
Real & dvpadt1_str,
Real & dvpadt0_str,
std::vector< Real > & vgc )
static

Strong flow terms computation Matching Fortran part.F90 lines 5284-5315.

◆ test_particle_output()

void orb5x::ParticleModule::test_particle_output ( int isp,
int ip,
Real psi0t,
Real ze,
Real pot_equil,
Real wt,
Real zvth2,
Real nval,
Real pvol,
Real zf0 )

Test particle output routine Matching Fortran part.F90 lines 4490-4506 Stores test particle diagnostics.

◆ trap_detrap_disp()

void orb5x::ParticleModule::trap_detrap_disp ( )

◆ unsort_gc_3D_disp()

void orb5x::ParticleModule::unsort_gc_3D_disp ( )

◆ update_ffinit_or_pvol()

void orb5x::ParticleModule::update_ffinit_or_pvol ( )

◆ uses_modified_toroidal_momentum()

bool orb5x::ParticleModule::uses_modified_toroidal_momentum ( int isp) const

◆ vf0()

Real orb5x::ParticleModule::vf0 ( int isp,
Real zvth2,
Real nval,
Real ze,
Real zecor,
Real b,
Real pot_equil,
Real pot_equil0,
Real psit,
Real ut,
Real mut,
int nsel_f0_override = -1 )
static

◆ vf0_chi_prof()

Real orb5x::ParticleModule::vf0_chi_prof ( Real zf0,
Real ,
Real ,
Real ze,
Real ,
Real ,
Real ,
Real ,
Real ut,
Real ,
Real psit,
int isp,
Real zvth2,
Real nval,
Real zecor,
Real pot_equil,
Real pot_equil0,
Real mut,
Real chit )
static

◆ vf0_local_maxwellian_simple()

Real orb5x::ParticleModule::vf0_local_maxwellian_simple ( Real zvth2,
Real nval,
Real ze )
static

◆ vf0_psi_prof()

Real orb5x::ParticleModule::vf0_psi_prof ( Real zf0,
Real ngrad,
Real epsilon_hat,
Real ze,
Real b,
Real kappa_str,
Real zvth2_inv,
Real tgrad,
Real ut,
Real psi0_inv,
Real psit,
int isp,
Real zvth2,
Real nval,
Real zecor,
Real pot_equil,
Real pot_equil0,
Real mut,
Real chit )
static

References psi0_inv.

◆ vf0dek()

Real orb5x::ParticleModule::vf0dek ( Real zf0,
Real zvth2,
Real ze,
Real psit,
int isp,
Real nval,
Real zecor,
Real b,
Real pot_equil,
Real pot_equil0,
Real ut,
Real mut,
Real chit )
static

◆ vf0du()

Real orb5x::ParticleModule::vf0du ( Real zf0,
Real ut,
Real ,
Real zvth2,
Real nval,
Real psit,
int isp,
Real ze,
Real zecor,
Real pot_equil,
Real pot_equil0,
Real mut,
Real chit )
static

◆ vpa_quants()

void orb5x::ParticleModule::vpa_quants ( Real psi,
Real mu,
Real en_star,
Real v_pll,
int isp,
Real & fvpllb,
Real & dfvpllb_den,
Real & dfvpllb_dpsi )

Compute v_parallel/B quantities from lookup table Matching Fortran part.F90 lines 6814-6895 Full interpolation from vpbi array with derivatives.

◆ ze_correction()

Real orb5x::ParticleModule::ze_correction ( Real ut,
Real vpval )
static

Member Data Documentation

◆ bin_surf_inv

Kokkos::View<Real*> orb5x::ParticleModule::bin_surf_inv

◆ bin_vol_inv

Kokkos::View<Real*> orb5x::ParticleModule::bin_vol_inv

◆ cfield_out_3D

Kokkos::View<Complex***> orb5x::ParticleModule::cfield_out_3D

◆ cfield_out_3D_fft

Kokkos::View<Complex***> orb5x::ParticleModule::cfield_out_3D_fft

◆ dens0

Kokkos::View<Real*> orb5x::ParticleModule::dens0

◆ dmu_bin

Real orb5x::ParticleModule::dmu_bin = 0.0

◆ dmu_bin_2

Real orb5x::ParticleModule::dmu_bin_2 = 0.0

◆ dpsi_bin

Real orb5x::ParticleModule::dpsi_bin = 0.0

◆ dr_flux_inv

Real orb5x::ParticleModule::dr_flux_inv = 0.0

Referenced by helical_flux_label().

◆ dth_inv

Real orb5x::ParticleModule::dth_inv = 0.0

◆ ftrap

Real orb5x::ParticleModule::ftrap = 0.0

◆ integral_f0_global

std::vector<Real> orb5x::ParticleModule::integral_f0_global

◆ irloc_in

int orb5x::ParticleModule::irloc_in = 0

◆ lb_wx

int orb5x::ParticleModule::lb_wx = 0

◆ MAX_PIC2

int orb5x::ParticleModule::MAX_PIC2 = 0

◆ MAX_PIC5

int orb5x::ParticleModule::MAX_PIC5 = 0

◆ MAX_WORK

int orb5x::ParticleModule::MAX_WORK = 0

◆ MAX_WORK_FIELDS

int orb5x::ParticleModule::MAX_WORK_FIELDS = 0

◆ MAX_WORK_REV

int orb5x::ParticleModule::MAX_WORK_REV = 0

◆ moments_3d_array

std::vector<Moments3DClass> orb5x::ParticleModule::moments_3d_array

◆ mu_max

Real orb5x::ParticleModule::mu_max = 0.0

◆ mu_min

Real orb5x::ParticleModule::mu_min = 0.0

◆ mumax_global

std::vector<Real> orb5x::ParticleModule::mumax_global

◆ n_vel_1D

Kokkos::View<Real**> orb5x::ParticleModule::n_vel_1D

◆ n_vel_trap_1D

Kokkos::View<Real**> orb5x::ParticleModule::n_vel_trap_1D

◆ NBIN_MU_F0

int orb5x::ParticleModule::NBIN_MU_F0 = 0

◆ NLARM_PIC2

int orb5x::ParticleModule::NLARM_PIC2 = 0

◆ npart

Kokkos::View<int*> orb5x::ParticleModule::npart

◆ npmx

Kokkos::View<int*> orb5x::ParticleModule::npmx

◆ nptot_inv

Kokkos::View<Real*> orb5x::ParticleModule::nptot_inv

◆ ntest

Kokkos::View<int*> orb5x::ParticleModule::ntest

◆ ntrap

int orb5x::ParticleModule::ntrap = 0

◆ num_mesh

int orb5x::ParticleModule::num_mesh = 0

◆ pic1

std::vector<PointerMarkers> orb5x::ParticleModule::pic1

◆ pic2

std::vector<PointerMarkers> orb5x::ParticleModule::pic2

◆ pic3

std::vector<PointerMarkersLogic> orb5x::ParticleModule::pic3

◆ pic4

std::vector<PointerMarkersI8> orb5x::ParticleModule::pic4

◆ pic5

std::vector<PointerMarkersR4> orb5x::ParticleModule::pic5

◆ pion_1

std::vector<PointerMarkers> orb5x::ParticleModule::pion_1

◆ ppsum_buff_real

Kokkos::View<Real*> orb5x::ParticleModule::ppsum_buff_real

◆ psi0_inv

Real orb5x::ParticleModule::psi0_inv = 0.0

Referenced by vf0_psi_prof().

◆ psi_max

Real orb5x::ParticleModule::psi_max = 1.0

◆ psi_min

Real orb5x::ParticleModule::psi_min = 0.0

◆ qt_num_chi

int orb5x::ParticleModule::qt_num_chi = 0

◆ qt_num_s

int orb5x::ParticleModule::qt_num_s = 0

◆ qt_num_s_per_ns

int orb5x::ParticleModule::qt_num_s_per_ns = 2
staticconstexpr

◆ qt_toggle_flag

Kokkos::View<bool*> orb5x::ParticleModule::qt_toggle_flag

◆ qtree

std::vector<PointerQuadtree> orb5x::ParticleModule::qtree

◆ rho_passing_omp

Kokkos::View<Real***> orb5x::ParticleModule::rho_passing_omp

◆ sortings

std::vector<std::unique_ptr<SortingClass> > orb5x::ParticleModule::sortings

◆ sum_ekin_markers_global

std::vector<Real> orb5x::ParticleModule::sum_ekin_markers_global

◆ sum_pekin_markers_global

std::vector<Real> orb5x::ParticleModule::sum_pekin_markers_global

◆ Total_weight

Kokkos::View<Real*> orb5x::ParticleModule::Total_weight

◆ ub_wx

int orb5x::ParticleModule::ub_wx = 0

◆ umax_global

std::vector<Real> orb5x::ParticleModule::umax_global

◆ umin_global

std::vector<Real> orb5x::ParticleModule::umin_global

◆ vpbi

Kokkos::View<Real**> orb5x::ParticleModule::vpbi

◆ vpbi_host_cache

Kokkos::View<Real**, Kokkos::LayoutLeft, Kokkos::HostSpace> orb5x::ParticleModule::vpbi_host_cache

◆ vpll_momentum_bins

Kokkos::View<Real**> orb5x::ParticleModule::vpll_momentum_bins

◆ vpll_momentum_bins_host_cache

Kokkos::View<Real**, Kokkos::LayoutLeft, Kokkos::HostSpace> orb5x::ParticleModule::vpll_momentum_bins_host_cache

◆ work1

std::vector<PointerMarkers> orb5x::ParticleModule::work1

◆ work2

std::vector<PointerMarkers> orb5x::ParticleModule::work2

◆ work3

std::vector<PointerMarkers> orb5x::ParticleModule::work3

◆ work5

std::vector<PointerMarkers> orb5x::ParticleModule::work5

◆ work6

std::vector<PointerMarkers> orb5x::ParticleModule::work6

◆ work7

std::vector<PointerMarkers> orb5x::ParticleModule::work7

◆ work8

std::vector<PointerMarkers> orb5x::ParticleModule::work8

◆ work9

std::vector<PointerMarkers> orb5x::ParticleModule::work9

◆ work_rev

std::vector<PointerMarkers> orb5x::ParticleModule::work_rev

◆ work_temp

std::vector<PointerMarkers> orb5x::ParticleModule::work_temp

◆ zsmax_global

std::vector<Real> orb5x::ParticleModule::zsmax_global

◆ zsum_global

std::vector<Real> orb5x::ParticleModule::zsum_global

The documentation for this class was generated from the following file: