pub struct RankDomain {
pub rank: usize,
pub n_ranks: usize,
pub owned_box: DomainBox,
pub ghost_layers: [usize; 6],
pub owned_cells: [usize; 3],
pub global_offset: [usize; 3],
}Expand description
Per-rank subdomain metadata for a domain-decomposed simulation.
Fields§
§rank: usizeMPI rank index (0-based).
n_ranks: usizeTotal number of ranks in the communicator.
owned_box: DomainBoxSpatial bounding box of the owned (non-ghost) region.
ghost_layers: [usize; 6]Number of ghost cell layers on each face [x-, x+, y-, y+, z-, z+].
owned_cells: [usize; 3]Number of owned cells in each direction [nx, ny, nz].
global_offset: [usize; 3]Global offset of this rank’s first cell [ox, oy, oz].
Implementations§
Source§impl RankDomain
impl RankDomain
Sourcepub fn new(
rank: usize,
n_ranks: usize,
owned_box: DomainBox,
ghost_layers: [usize; 6],
owned_cells: [usize; 3],
global_offset: [usize; 3],
) -> Self
pub fn new( rank: usize, n_ranks: usize, owned_box: DomainBox, ghost_layers: [usize; 6], owned_cells: [usize; 3], global_offset: [usize; 3], ) -> Self
Construct domain metadata for a single rank.
Sourcepub fn n_owned_cells(&self) -> usize
pub fn n_owned_cells(&self) -> usize
Total number of locally owned cells.
Sourcepub fn n_total_cells(&self) -> usize
pub fn n_total_cells(&self) -> usize
Total cells including ghost layers (all six faces).
Sourcepub fn load_fraction(&self) -> f64
pub fn load_fraction(&self) -> f64
Fraction of the global workload assigned to this rank.
Assumes uniform distribution; override if load varies.
Trait Implementations§
Source§impl Clone for RankDomain
impl Clone for RankDomain
Source§fn clone(&self) -> RankDomain
fn clone(&self) -> RankDomain
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RankDomain
impl RefUnwindSafe for RankDomain
impl Send for RankDomain
impl Sync for RankDomain
impl Unpin for RankDomain
impl UnsafeUnpin for RankDomain
impl UnwindSafe for RankDomain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.