Class OutflowBank

Class Documentation

class OutflowBank

Contiguous storage manager for local face outflow tallies.

The bank owns the outflow values and builds one CellOutflowView per local cell. Each view stores offsets into the bank’s contiguous storage for every cell face.

Public Functions

OutflowBank() = default
OutflowBank(const MeshContinuum &grid, unsigned int num_groups, bool include_internal_faces)

Construct outflow storage and cell-local views for a mesh.

Parameters:
  • grid – Local mesh used to discover cell faces.

  • num_groups – Number of energy groups stored per face.

  • include_internal_faces – If true, allocate storage for internal faces in addition to physical boundary faces.

inline std::vector<CellOutflowView> GetCellOutflowViews()

Transfer cell-local outflow views to the caller.

Note

After this operation, the bank no longer owns the view collection, but the returned views still refer to this bank’s outflow storage.

Returns:

Views indexed by local cell id.

inline std::vector<double> &GetOutflowData()

Return read/write access to the contiguous outflow values.

std::uint64_t GetOffset(std::uint32_t cell_local_idx, std::uint32_t face_idx) const

Return the first group offset for a face.

Parameters:
  • cell_local_idxCell index local to the current process.

  • face_idxFace index local to the cell.

Throws:

std::out_of_range – If the cell-face pair is not present.

Returns:

Offset of the face’s first group value in the contiguous outflow storage.

bool HasOffset(std::uint32_t cell_local_idx, std::uint32_t face_idx) const

Return whether a face has contiguous outflow storage.

inline std::size_t GetSize() const

Return the number of contiguous outflow values.