Skip to main content

Interface

Struct Interface 

Source
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

Source

pub fn uniform( name: impl Into<String>, faces: usize, face_area: Area, ) -> Interface

A boundary cut into equal faces.

Source

pub fn from_areas(name: impl Into<String>, areas: Vec<Area>) -> Interface

A boundary whose faces have their own areas.

Source

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.

Source

pub fn faces(&self) -> usize

How many faces it is cut into. This is the number both sides have to agree on.

Source

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.

Source

pub fn total_area(&self) -> Area

Total area of the boundary.

Trait Implementations§

Source§

impl Clone for Interface

Source§

fn clone(&self) -> Interface

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Interface

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Interface

Source§

fn eq(&self, other: &Interface) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Interface

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.