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

Read, validate, report, and persist ORB5-compatible input namelists. More...

#include "readinput.hpp"

Static Public Member Functions

static void clear_warnings ()
 Remove all retained input-warning messages.
 
static void close_input_file ()
 Close the root input and normalized-output streams.
 
static const std::vector< std::string > & get_warnings ()
 Access retained input-warning messages.
 
static void open_input_file (bool nl_input_path, const std::string &path_to_input)
 Stage and open the simulation input on every MPI rank.
 
static void read_antenna (int &nwarnings, int &nerrors)
 Read and validate the externally imposed antenna configuration.
 
static void read_basic (int phase, int &nwarnings, int &nerrors)
 Process the BASIC namelist in one of two initialization phases.
 
static void read_collisions (int &nwarnings, int &nerrors)
 Read and validate the collision-model configuration.
 
static void read_diag (int &nwarnings, int &nerrors)
 Read general output cadence and diagnostic controls from DIAG.
 
static void read_diagnostics (int &nwarnings, int &nerrors)
 Read diagnostic-product selections and binning parameters.
 
static void read_equil (int &nwarnings, int &nerrors)
 Read, validate, report, and persist the EQUIL namelist.
 
static void read_fields (int &nwarnings, int &nerrors)
 Read, validate, report, and persist the FIELDS namelist.
 
static void read_islands (int &nwarnings, int &nerrors)
 Read and validate the magnetic-island namelist.
 
static void read_parallel (int &nwarnings, int &nerrors)
 Read and validate the PARALLEL MPI-decomposition namelist.
 
static void read_solver (int &nwarnings, int &nerrors)
 Read, validate, report, and persist the SOLVER namelist.
 
static void read_sorting (int &nwarnings, int &nerrors)
 Read and validate the particle SORTING namelist.
 
static void read_species (int &nwarnings, int &nerrors)
 Read all sequential TYPE_SPECIES/ATTRIBUTES namelist pairs.
 

Detailed Description

Read, validate, report, and persist ORB5-compatible input namelists.

ReadInput is the boundary between textual run configuration and the typed global state consumed by numerical modules. It stages an explicitly named input as input.in, parses case-insensitive Fortran-style namelist keys, applies defaults and cross-parameter validation, prints a reproducible input summary, and stores validated values in the main HDF5 result file.

Warning and error counts accumulate across calls. Warnings are retained for later summary reporting; fatal input errors are counted so ControlAll can reject the run after all relevant blocks have been checked. The reader is stateful and is intended for the single input sequence orchestrated by ControlAll, not for concurrent use.

Member Function Documentation

◆ clear_warnings()

static void orb5x::ReadInput::clear_warnings ( )
static

Remove all retained input-warning messages.

◆ close_input_file()

static void orb5x::ReadInput::close_input_file ( )
static

Close the root input and normalized-output streams.

Note
The current compatibility implementation performs explicit closure only on world rank zero and only outside dry-run mode.

◆ get_warnings()

static const std::vector< std::string > & orb5x::ReadInput::get_warnings ( )
static

Access retained input-warning messages.

Returns
Read-only reference valid until clear_warnings() or a later warning.

◆ open_input_file()

static void orb5x::ReadInput::open_input_file ( bool  nl_input_path,
const std::string &  path_to_input 
)
static

Stage and open the simulation input on every MPI rank.

Parameters
[in]nl_input_pathTrue when path_to_input was supplied explicitly.
[in]path_to_inputSource file to copy to input.in when explicit.

Rank zero stages an explicit file and, outside dry-run mode, opens out.inp.0000 for the normalized namelist echo. All ranks scan past the free-form header. Missing or unreadable input aborts MPI_COMM_WORLD.

◆ read_antenna()

static void orb5x::ReadInput::read_antenna ( int &  nwarnings,
int &  nerrors 
)
static

Read and validate the externally imposed antenna configuration.

Parameters
[in,out]nwarningsAccumulated warning count.
[in,out]nerrorsAccumulated error count.

Initializes antenna mode/profile views before assigning values.

◆ read_basic()

static void orb5x::ReadInput::read_basic ( int  phase,
int &  nwarnings,
int &  nerrors 
)
static

Process the BASIC namelist in one of two initialization phases.

Parameters
[in]phasePhase 1 parses and validates; phase 2 reports and persists the already validated values.
[in,out]nwarningsAccumulated non-fatal warning count.
[in,out]nerrorsAccumulated fatal validation-error count.

◆ read_collisions()

static void orb5x::ReadInput::read_collisions ( int &  nwarnings,
int &  nerrors 
)
static

Read and validate the collision-model configuration.

Parameters
[in,out]nwarningsAccumulated warning count.
[in,out]nerrorsAccumulated error count.

◆ read_diag()

static void orb5x::ReadInput::read_diag ( int &  nwarnings,
int &  nerrors 
)
static

Read general output cadence and diagnostic controls from DIAG.

Parameters
[in,out]nwarningsAccumulated warning count.
[in,out]nerrorsAccumulated error count.

◆ read_diagnostics()

static void orb5x::ReadInput::read_diagnostics ( int &  nwarnings,
int &  nerrors 
)
static

Read diagnostic-product selections and binning parameters.

Parameters
[in,out]nwarningsAccumulated warning count.
[in,out]nerrorsAccumulated error count.

Allocates per-species diagnostic arrays when needed and stores the resulting configuration under /parameters/diagnostics.

◆ read_equil()

static void orb5x::ReadInput::read_equil ( int &  nwarnings,
int &  nerrors 
)
static

Read, validate, report, and persist the EQUIL namelist.

Parameters
[in,out]nwarningsAccumulated warning count.
[in,out]nerrorsAccumulated error count.

◆ read_fields()

static void orb5x::ReadInput::read_fields ( int &  nwarnings,
int &  nerrors 
)
static

Read, validate, report, and persist the FIELDS namelist.

Parameters
[in,out]nwarningsAccumulated warning count.
[in,out]nerrorsAccumulated error count.

◆ read_islands()

static void orb5x::ReadInput::read_islands ( int &  nwarnings,
int &  nerrors 
)
static

Read and validate the magnetic-island namelist.

Parameters
[in,out]nwarningsAccumulated warning count.
[in,out]nerrorsAccumulated error count.

◆ read_parallel()

static void orb5x::ReadInput::read_parallel ( int &  nwarnings,
int &  nerrors 
)
static

Read and validate the PARALLEL MPI-decomposition namelist.

Parameters
[in,out]nwarningsAccumulated warning count.
[in,out]nerrorsAccumulated error count.
Note
In dry-run mode validation uses the requested virtual task count.

◆ read_solver()

static void orb5x::ReadInput::read_solver ( int &  nwarnings,
int &  nerrors 
)
static

Read, validate, report, and persist the SOLVER namelist.

Parameters
[in,out]nwarningsAccumulated warning count.
[in,out]nerrorsAccumulated error count.

◆ read_sorting()

static void orb5x::ReadInput::read_sorting ( int &  nwarnings,
int &  nerrors 
)
static

Read and validate the particle SORTING namelist.

Parameters
[in,out]nwarningsAccumulated warning count.
[in,out]nerrorsAccumulated error count.

◆ read_species()

static void orb5x::ReadInput::read_species ( int &  nwarnings,
int &  nerrors 
)
static

Read all sequential TYPE_SPECIES/ATTRIBUTES namelist pairs.

Parameters
[in,out]nwarningsAccumulated warning count.
[in,out]nerrorsAccumulated error count.

Pairs are consumed in species order without rewinding between species, matching the original Fortran namelist stream semantics.


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