Class LBSSolverIO

Nested Relationships

Nested Types

Class Documentation

class LBSSolverIO

Public Static Functions

static bool ReadRestartData(LBSProblem &lbs_problem, const std::function<bool(hid_t)> &extra_reader = {}, const std::filesystem::path &read_path = {}, bool allow_transient_initialization_from_steady = false)
static bool WriteRestartData(LBSProblem &lbs_problem, const std::function<bool(hid_t)> &extra_writer = {})
static void WriteFluxMoments(LBSProblem &lbs_problem, const std::string &file_base, std::optional<const std::reference_wrapper<std::vector<double>>> opt_src = std::nullopt, FluxSolutionRole role = FluxSolutionRole::UNSPECIFIED, AdjointFluxOrientation orientation = AdjointFluxOrientation::UNSPECIFIED)

Write a flux moments vector to a file.

Parameters:
  • lbs_problem – LBS problem

  • file_base – File name base

  • opt_src – Optional source vector to write instead of the problem-owned flux moments.

  • role – Solution role. For problem-owned data, unspecified is inferred from the problem.

  • orientation – Adjoint orientation. For problem-owned data, unspecified is inferred.

static void ReadFluxMoments(LBSProblem &lbs_problem, const std::string &file_base, bool single_file, std::optional<std::reference_wrapper<std::vector<double>>> opt_dest = std::nullopt, FluxSolutionRole expected_role = FluxSolutionRole::UNSPECIFIED, AdjointFluxOrientation expected_orientation = AdjointFluxOrientation::UNSPECIFIED)

Read a flux moments vector from a file.

The file must have been written with the same rank count and partition. Collective: a file that cannot be read or does not match the problem raises an error on every rank, and the destination is left unchanged.

Parameters:
  • lbs_problem – LBS problem

  • file_base – File name base

  • single_file – Read the single file <file_base>.h5 instead of the per-rank file <file_base><rank>.h5. Serial runs only: throws std::invalid_argument on every rank of a multi-rank run, before any file is opened.

  • opt_dest – Optional destination vector to populate instead of the problem-owned flux moments.

  • expected_role – Required solution role, or unspecified to accept any role.

  • expected_orientation – Required adjoint orientation, or unspecified to accept any.

static FileMeshNodes ReadFileMeshNodes(hid_t file, const std::string &file_name, const Mesh &grid, const SpatialDiscretization &discretization)

Reads and validates the “mesh” group of a flux-moment or angular-flux file.

Every file cell must be a distinct local cell whose nodes match the file node locations one to one, and the dataset sizes must match the metadata. Throws on the calling rank only.

struct FileMeshNodes

The cells of a flux-moment or angular-flux file and the local node of each file node.

Public Members

std::vector<std::uint64_t> cell_ids
std::vector<std::vector<std::size_t>> node_maps

For each file cell, the local cell node matching each file node, in file order.