ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
orb5x::Vis3d Class Reference

Builds and writes distributed curvilinear diagnostic meshes. More...

#include "vis3d.hpp"

Public Member Functions

 Vis3d ()
 Reset the process-wide visualization state to its default configuration.
 

Static Public Member Functions

static void checkout3dfile (const std::string &out_field)
 Close the temporal collection in an XDMF_one metadata file.
 
static void cleanup ()
 Close the open HDF5 file and release all static Kokkos Views.
 
static void get3dmeshgrid (Kokkos::View< Real * > *sgrid_ptr, Kokkos::View< Real * > *chigrid_ptr, Kokkos::View< Real * > *phigrid_ptr)
 Return shallow handles to the diagnostic coordinate arrays.
 
static void get3dmeshinfo (Real *zdsgrid=nullptr, Real *zdchigrid=nullptr, Real *zdphigrid=nullptr, Real *zsmin=nullptr, Real *zchimin=nullptr, Real *zphimin=nullptr, int *zsbin=nullptr, int *zchibin=nullptr, int *zphibin=nullptr, bool *zlocalgrid=nullptr)
 Query optional scalar mesh metadata without exposing internal state.
 
static void init3Ddiagnostics (const Diag3dParameters &parameters)
 Configure the grid, MPI decomposition, mesh coordinates, and writer.
 
static void write3D (const std::string &out_field, int ztime, const Kokkos::View< Real *** > *field_array_3d=nullptr, FieldFunc *field_function_ptr=nullptr, std::string *filename=nullptr, bool lclose_file=true, const std::string &filename_suffix="")
 Sample or accept a scalar field and write the configured 3-D format.
 

Detailed Description

Builds and writes distributed curvilinear diagnostic meshes.

Vis3d owns process-wide static grid, staging, file, and communicator state. Initialization constructs a cell-centred (s,chi,phi) mesh, optionally maps it to Cartesian coordinates, and chooses either PIXIE-compatible HDF5 or HDF5 plus XDMF metadata. Field callbacks are sampled on the host and results are copied into Kokkos Views before output.

Call cleanup() before Kokkos::finalize() so the static Views are released. The class is not re-entrant and separate instances do not own separate state.

Fortran reference
vis3d.F90, module vis3d. The C++ implementation retains its file-layout and MPI-distribution conventions, with explicit Kokkos host staging.

Constructor & Destructor Documentation

◆ Vis3d()

orb5x::Vis3d::Vis3d ( )
inline

Reset the process-wide visualization state to its default configuration.

Member Function Documentation

◆ checkout3dfile()

static void orb5x::Vis3d::checkout3dfile ( const std::string &  out_field)
static

Close the temporal collection in an XDMF_one metadata file.

Parameters
[in]out_fieldField name used to derive output_3d_<field>.xmf.
Note
Only active communicator rank zero writes the closing XML tags.
Fortran reference vis3d.F90: checkout3dfile.

◆ cleanup()

static void orb5x::Vis3d::cleanup ( )
static

Close the open HDF5 file and release all static Kokkos Views.

Note
Call before Kokkos::finalize(). Any derived MPI communicator is intentionally left to MPI_Finalize() because HDF5 may retain a duplicate.

◆ get3dmeshgrid()

static void orb5x::Vis3d::get3dmeshgrid ( Kokkos::View< Real * > *  sgrid_ptr,
Kokkos::View< Real * > *  chigrid_ptr,
Kokkos::View< Real * > *  phigrid_ptr 
)
static

Return shallow handles to the diagnostic coordinate arrays.

Parameters
[out]sgrid_ptrOptional radial grid handle of extent mesh_size[0].
[out]chigrid_ptrOptional poloidal grid handle of extent mesh_size[1].
[out]phigrid_ptrOptional global toroidal grid handle of extent mesh_size[2].
Fortran reference vis3d.F90: get3dmeshgrid.

◆ get3dmeshinfo()

static void orb5x::Vis3d::get3dmeshinfo ( Real *  zdsgrid = nullptr,
Real *  zdchigrid = nullptr,
Real *  zdphigrid = nullptr,
Real *  zsmin = nullptr,
Real *  zchimin = nullptr,
Real *  zphimin = nullptr,
int *  zsbin = nullptr,
int *  zchibin = nullptr,
int *  zphibin = nullptr,
bool *  zlocalgrid = nullptr 
)
static

Query optional scalar mesh metadata without exposing internal state.

Parameters
[out]zdsgridOptional normalized-radial cell width.
[out]zdchigridOptional poloidal angular width, in radians.
[out]zdphigridOptional toroidal angular width, in radians.
[out]zsminOptional configured lower radial bound (cell edge).
[out]zchiminOptional configured lower poloidal bound, in radians.
[out]zphiminOptional lower bound of this rank's toroidal slab, in radians.
[out]zsbinOptional global radial point count.
[out]zchibinOptional global poloidal point count.
[out]zphibinOptional local toroidal point count.
[out]zlocalgridOptional flag indicating a toroidally distributed mesh.
Fortran reference vis3d.F90: get3dmeshinfo.

◆ init3Ddiagnostics()

static void orb5x::Vis3d::init3Ddiagnostics ( const Diag3dParameters &  parameters)
static

Configure the grid, MPI decomposition, mesh coordinates, and writer.

Parameters
[in]parametersComplete diagnostic configuration; its communicator is borrowed.
Postcondition
Active ranks own allocated grid and format-specific staging Views.
Fortran reference vis3d.F90: init3Ddiagnostics.

◆ write3D()

static void orb5x::Vis3d::write3D ( const std::string &  out_field,
int  ztime,
const Kokkos::View< Real *** > *  field_array_3d = nullptr,
FieldFunc *  field_function_ptr = nullptr,
std::string *  filename = nullptr,
bool  lclose_file = true,
const std::string &  filename_suffix = "" 
)
static

Sample or accept a scalar field and write the configured 3-D format.

Parameters
[in]out_fieldDataset name used in HDF5/XDMF metadata and filenames.
[in]ztimeInteger diagnostic time index.
[in]field_array_3dOptional source [s][chi][local phi].
[in]field_function_ptrOptional callback sampled at each local (s,chi,phi) point.
[out]filenameOptional generated HDF5 filename, including .h5.
[in]lclose_fileClose the PIXIE HDF5 handle after this write.
[in]filename_suffixText appended to the generated basename.
Note
Supply one field source. Callback sampling is implemented; direct field_array_3d staging is currently a reported compatibility placeholder.
Fortran reference vis3d.F90: write3D.

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