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

PSZS Module - Phase Space Zone Sampling diagnostics. More...

#include "pszs.hpp"

Static Public Member Functions

static void close ()
 Close PSZS HDF5 output file.
static void destroyStaticViews ()
static void initialize (int isp, int npart_loc)
 Initialize PSZS diagnostics for a species.
static void open (bool reopen=false)
 Open PSZS HDF5 output file.
static void set_variables (int isp, PszsVariables &pszs_, const std::array< Real, 3 > &lb, const std::array< Real, 3 > &ub)
 Set PSZS variables for a species.
static void solve (Real time)
 Solve for distribution function and output results.

Static Public Attributes

static constexpr int mass_matrix_id = 1
 Matrix identifier for mass matrix.
static constexpr int ngauss = 4
 Number of Gauss quadrature points.

Detailed Description

PSZS Module - Phase Space Zone Sampling diagnostics.

This class provides static methods for PSZS diagnostics, matching the Fortran pszs_mod module interface.

Usage:

  1. Call open() to initialize HDF5 file
  2. Call set_variables() to configure coordinate ordering for each species
  3. Call initialize() to set up grids, splines, and mass matrices
  4. Call deposit_bsplines() during time stepping to accumulate particle data
  5. Call solve() at diagnostic frequency to compute and output distribution
  6. Call close() at end of simulation

Member Function Documentation

◆ close()

void orb5x::PszsModule::close ( )
static

Close PSZS HDF5 output file.

Closes the matrix.h5 file. Only rank 0 performs the operation.

Fortran reference: pszs.F90 lines 65-69

◆ destroyStaticViews()

void orb5x::PszsModule::destroyStaticViews ( )
static

◆ initialize()

void orb5x::PszsModule::initialize ( int isp,
int npart_loc )
static

Initialize PSZS diagnostics for a species.

Sets up grids, splines, mass matrices, and HDF5 output structure. This is called once during simulation initialization.

Parameters
ispSpecies index (0-based)
npart_locNumber of local particles for this species

Fortran reference: pszs.F90 lines 161-456

◆ open()

void orb5x::PszsModule::open ( bool reopen = false)
static

Open PSZS HDF5 output file.

Opens or creates the matrix.h5 file for PSZS output. Only rank 0 performs file operations.

Parameters
reopenIf true, opens existing file; if false, creates new file

Fortran reference: pszs.F90 lines 47-63

◆ set_variables()

void orb5x::PszsModule::set_variables ( int isp,
PszsVariables & pszs_,
const std::array< Real, 3 > & lb,
const std::array< Real, 3 > & ub )
static

Set PSZS variables for a species.

Configures coordinate ordering and bounds for phase space sampling. Sets up labels, grid sizes, and coordinate mappings.

Parameters
ispSpecies index (0-based in C++, was 1-based in Fortran)
pszs_Reference to PszsVariables structure for this species
lbLower bounds for coordinates [3] (ke, tam, mu order in Fortran)
ubUpper bounds for coordinates [3] (ke, tam, mu order in Fortran)

Fortran reference: pszs.F90 lines 71-159

◆ solve()

void orb5x::PszsModule::solve ( Real time)
static

Solve for distribution function and output results.

Solves the linear system for B-spline coefficients and evaluates the distribution function on the grid. Writes results to HDF5 file.

Parameters
timeCurrent simulation time

Fortran reference: pszs.F90 lines 458-532

Member Data Documentation

◆ mass_matrix_id

int orb5x::PszsModule::mass_matrix_id = 1
staticconstexpr

Matrix identifier for mass matrix.

◆ ngauss

int orb5x::PszsModule::ngauss = 4
staticconstexpr

Number of Gauss quadrature points.


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