pub struct Interface { /* private fields */ }Expand description
A boundary two domains share, cut into faces they both address.
Faces carry their own areas, because a real boundary is not evenly divided — a spherical cap cut into rings has a smaller innermost one, and a flux per unit area means nothing without them.
§What it is not
An ordered sequence of faces with areas, and nothing more. No coordinates, no normals,
no connectivity — so a domain cannot ask where face 12 is, only how big it is and what
comes before it. A beam profile is therefore handed over in the boundary’s own
coordinate (see Flux::profiled) rather than computed from geometry.
That order is what Flux::resample walks, which makes remapping an interval
intersection and keeps it conservative in a few lines. It also means a triangulated
surface does not fit: its faces have no sequence, and the overlaps between two
triangulations are not intervals. The conservation argument generalises to that case;
this implementation does not.
Implementations§
Source§impl Interface
impl Interface
Sourcepub fn uniform(
name: impl Into<String>,
faces: usize,
face_area: Area,
) -> Interface
pub fn uniform( name: impl Into<String>, faces: usize, face_area: Area, ) -> Interface
A boundary cut into equal faces.
Sourcepub fn from_areas(name: impl Into<String>, areas: Vec<Area>) -> Interface
pub fn from_areas(name: impl Into<String>, areas: Vec<Area>) -> Interface
A boundary whose faces have their own areas.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
What this boundary is called. Both sides of a coupling must agree on it, and a mismatch is how they discover they meant different surfaces.
Sourcepub fn faces(&self) -> usize
pub fn faces(&self) -> usize
How many faces it is cut into. This is the number both sides have to agree on.
Sourcepub fn area_of(&self, face: usize) -> Area
pub fn area_of(&self, face: usize) -> Area
Area of one face. Zero past the end, so a consumer walking the boundary need not bounds-check the kernel.
Sourcepub fn total_area(&self) -> Area
pub fn total_area(&self) -> Area
Total area of the boundary.