Class DiscreteOrdinatesProblemIO
Defined in File discrete_ordinates_problem_io.h
Nested Relationships
Nested Types
Class Documentation
-
class DiscreteOrdinatesProblemIO
Public Types
-
using FaceCentroidKey = std::tuple<int64_t, int64_t, int64_t>
Surface Angular flux.
Public Static Functions
-
static UncollidedFluxData ReadUncollidedFlux(const DiscreteOrdinatesProblem &do_problem, const std::string &file_name)
-
static bool ReadRestartData(DiscreteOrdinatesProblem &do_problem, hid_t file_id, bool allow_transient_initialization_from_steady)
-
static bool WriteRestartData(const DiscreteOrdinatesProblem &do_problem, hid_t file_id)
-
static void WriteAngularFluxes(DiscreteOrdinatesProblem &do_problem, const std::string &file_base, std::optional<const std::reference_wrapper<std::vector<std::vector<double>>>> opt_src = std::nullopt)
Write an angular flux vector to a file.
- Parameters:
do_problem – Discrete ordinates problem
file_base – File name base
opt_src – Optional angular flux source vector
-
static void ReadAngularFluxes(DiscreteOrdinatesProblem &do_problem, const std::string &file_base, std::optional<std::reference_wrapper<std::vector<std::vector<double>>>> opt_dest = std::nullopt)
Read an angular flux vector from a file.
- Parameters:
do_problem – Discrete ordinates problem
file_base – File name base
opt_dest – Optional angular flux destination vector
-
static void WriteSurfaceAngularFluxes(DiscreteOrdinatesProblem &do_problem, const std::string &file_base, const std::vector<std::string> &boundary_surfs, const std::map<std::string, std::pair<std::string, double>> &interior_surfs)
Write surface angular flux vector(s) to a file.
Collective over all ranks. Surface selections may differ by rank. Plane-matching tolerances are relative to the global mesh extent. Each rank writes
<file_base><rank>.h5, which records whether the problem is in adjoint mode.- Parameters:
do_problem – Discrete ordinates problem
file_base – File name base
boundary_surfs – Boundary surface names
interior_surfs – Interior surface definitions, keyed by name, as an axis (“x”, “y”, or “z”) and a coordinate. Each surface must match at least one cell face, must lie on cell faces inside the mesh, must not coincide with an exterior boundary, and must not share a plane with another requested surface. Each surface is written with an
_utag for face normals aligned with the positive specified axis and a_dtag for the opposite orientation; these tags must not equal a requested boundary name.
-
static std::vector<SurfaceAngularFlux> ReadSurfaceAngularFluxes(DiscreteOrdinatesProblem &do_problem, const std::string &file_base, const std::vector<std::string> &surfaces)
Read a surface angular flux vector from a file.
Reads
<file_base><rank>.h5on each rank; the files must have been written with the same mesh partitioning. Not collective.- Parameters:
do_problem – Discrete ordinates problem
file_base – File name base
surfaces – Stored surface tags to read. Boundary tags are their boundary names. Interior surface tags use
_ufor face normals aligned with the positive specified axis and_dfor the opposite orientation.
-
struct SurfaceAngularFlux
Public Members
-
int groupset_id = 0
-
bool adjoint = false
True when the data were written from an adjoint problem.
-
std::string surface_name
-
SurfaceMap mapping
-
SurfaceData data
-
int groupset_id = 0
-
struct SurfaceData
Flattened angular-flux data for a surface and groupset.
The angular flux
psiis ordered by cell, face node, direction, and group. Theomegaarray follows cell, face node, direction, and Cartesian component, with three components per node-direction pair. Themu,wt_d, andfe_shapearrays follow cell, face node, and direction, with one value per node-direction pair. Themass_matrixarray is ordered by cell, row face node, and column face node.The
node_indexanddir_indexarrays contain start offsets intopsifor each face node and node-direction pair, respectively. All arrays, including the index arrays, are empty when the requested surface has no local faces.psiholds the face-node values of the problem’s stored angular flux on the cell that owns the face; the two sides of an interior surface are stored under separate tags. After an adjoint steady-state solve the stored angular flux is the adjoint flux for the listed direction, so forward and adjoint data with the same indices refer to the same direction.
-
struct SurfaceMap
Public Members
-
std::vector<uint64_t> cell_ids
-
std::vector<uint64_t> num_face_nodes
-
std::array<double, 3> centroid_origin = {0.0, 0.0, 0.0}
Origin subtracted from face centroids.
-
double centroid_spacing = 1.0e-6
Spacing used to key faces by centroid: 1e-9 times the global mesh extent.
-
std::map<FaceCentroidKey, uint64_t> cell_map
Surface face index keyed by the face centroid, with centroid_origin subtracted from each coordinate before division by centroid_spacing and rounding to the nearest integer.
The same face yields the same key from either side of an interior surface and in every file written for the same mesh.
-
std::vector<uint64_t> cell_stride
Start offset into the corresponding SurfaceData::psi array for each surface cell.
-
std::vector<double> nodes_x
-
std::vector<double> nodes_y
-
std::vector<double> nodes_z
-
std::vector<uint64_t> cell_ids
-
using FaceCentroidKey = std::tuple<int64_t, int64_t, int64_t>