Class CMFDCoarseMesh

Class Documentation

class CMFDCoarseMesh

Public Functions

inline const std::vector<CMFDCoarseCell> &LocalCells() const
inline const std::vector<CMFDLocalFineCellMembership> &LocalFineCellMemberships() const
inline const std::map<uint64_t, uint64_t> &FineToCoarseCellMap() const
inline const CMFDCoarseCell &LocalCell(uint32_t local_id) const
const CMFDCoarseCell &LocalCellFromGlobalID(uint64_t coarse_cell_global_id) const
bool HasCoarseCell(uint64_t fine_cell_global_id) const
bool HasLocalCoarseCell(uint64_t coarse_cell_global_id) const
uint64_t MapFineCell(uint64_t fine_cell_global_id) const
inline size_t NumLocalCells() const
inline size_t NumGlobalCells() const
size_t CountFacesWithBothCentroidsOnFace() const

Number of sides of interior coarse faces on which both coarse-cell centroids lie, summed over all ranks.

Such a face, between two nonconvex coarse cells, has no diffusion distance. A face counts once from each side. Collective.

inline const std::optional<CMFDOverlayDiagnostics> &OverlayDiagnostics() const

Geometry diagnostics of a Cartesian or reactor-lattice overlay. Empty for other coarse meshes.

Public Static Functions

static CMFDCoarseMesh BuildIdentity(const Mesh &grid)
static CMFDCoarseMesh BuildLocalAggregation(const Mesh &grid, std::size_t target_fine_cells_per_coarse_cell, bool allow_mixed_materials = false)

Build connected aggregates of local fine cells that do not cross MPI rank boundaries.

Collective.

Parameters:
  • grid – Transport mesh.

  • target_fine_cells_per_coarse_cell – Maximum number of fine cells per aggregate.

  • allow_mixed_materials – Whether an aggregate may cross material-block boundaries.

Throws:

std::invalid_argument – If target_fine_cells_per_coarse_cell is zero.

Returns:

The coarse mesh.

static CMFDCoarseMesh BuildGlobalAggregation(const Mesh &grid, std::size_t target_fine_cells_per_coarse_cell, bool allow_mixed_materials = false)

Build connected aggregates of fine cells that may span MPI ranks.

Collective.

Parameters:
  • grid – Transport mesh.

  • target_fine_cells_per_coarse_cell – Target number of fine cells per aggregate. Rank-local aggregates hold at most this many. An undersized aggregate is then merged with one same-block neighbor, so a merged aggregate holds fewer than twice the target.

  • allow_mixed_materials – Whether an aggregate may cross material-block boundaries.

Throws:

std::invalid_argument – If target_fine_cells_per_coarse_cell is zero.

Returns:

The coarse mesh.

static CMFDCoarseMesh BuildLogicalVolumeOverlay(const Mesh &grid, const std::vector<std::shared_ptr<LogicalVolume>> &logical_volumes)

Builds decomposition-independent coarse regions from logical volumes.

Fine cells are classified by centroid and must match exactly one volume. Each logical-volume region is split only by face-connected component. A region may contain several material block IDs, whose coefficients CMFDAcceleration homogenizes. Collective.

Throws:
  • std::invalid_argument – If no logical volume is given or one is null.

  • std::logic_error – On every rank, if a fine-cell centroid lies in no volume or in more than one.

static CMFDCoarseMesh BuildCartesianOverlay(const Mesh &grid, const std::vector<double> &x_edges, const std::vector<double> &y_edges, const std::vector<double> &z_edges)

Build decomposition-independent coarse regions from Cartesian intervals.

A fine cell belongs to the interval that contains its centroid. Intervals are half open, except that the last interval of an axis includes its upper edge. An empty edge array leaves that axis unbounded. Each region is split only by face-connected component. The result carries OverlayDiagnostics(). Collective.

Throws:
  • std::invalid_argument – If no edge array is given or an edge array is invalid.

  • std::logic_error – On every rank, if a fine-cell centroid lies outside the given edges.

Public Static Attributes

static double overlay_sliver_fraction = 0.1

Occupied overlay intervals narrower than this fraction of their axis median are reported.