Skip to main content

CulvertBarrelBatch

Struct CulvertBarrelBatch 

Source
pub struct CulvertBarrelBatch<R: Runtime<DType = DType>> { /* private fields */ }
Expand description

Culvert barrels, one row each, with certified geometry queries.

Every quantity is an enclosure: the exact value at each represented depth lies inside its [lower, upper] pair. CPU and CUDA give bit-identical bounds. The free-surface domain is [0, D). The crown y = D and every depth above it are full. Geometry, critical depth and normal depth cover every shape.

Implementations§

Source§

impl<R: Runtime<DType = DType>> CulvertBarrelBatch<R>

Source

pub fn new( client: R::Client, barrels: Vec<CulvertBarrel>, ) -> Result<Self, StructureError>

Uploads the barrels, encloses their full-state constants and certifies the depth slope floors and conveyance peak of each elliptical, pipe-arch and flat-floor arch barrel once, and of the open section of each floored barrel other than a box.

Rejects an empty barrel list and a runtime without F64 IEEE basic arithmetic, fused multiply-add, correctly rounded elementary functions, or square roots rounded to nearest. Rejects, naming its row, an arc or floored barrel whose certificate cannot be established: its dimensions scaled to a unit rise fail admission, or its conveyance has no certified single peak below the crown.

Source

pub fn barrels(&self) -> &[CulvertBarrel]

Barrels in row order.

Source

pub fn geometry( &self, depth_m: &Tensor<R>, ) -> Result<CulvertBarrelGeometry<R>, StructureError>

Encloses the geometry at one depth per barrel, in metres above the invert, or above the bed of a barrel with a floor.

depth_m is an F64 [m] tensor on the batch device. A depth at or above the open rise is full. A barrel with a floor reports the open section above its bed. Rejects a negative or nonfinite depth, naming its row. Returns Numerical when a bound overflows F64, as the full-state moment can for huge depths.

Source

pub fn geometry_over( &self, lower_m: &Tensor<R>, upper_m: &Tensor<R>, ) -> Result<CulvertBarrelGeometry<R>, StructureError>

Encloses the geometry over every depth in [lower_m, upper_m] per barrel.

Each range lies inside the free-surface domain: 0 <= lower_m <= upper_m < D, with D the open rise and depths from the bed above a floor. Rejects a range that reaches the crown. Split such a range at the crown. The hydraulic radius bound divides the area range by the perimeter range, so it widens with the range.

Source

pub fn full_geometry(&self) -> Result<CulvertBarrelGeometry<R>, StructureError>

Encloses the full-state geometry at the crown y = D of every barrel, with D the open rise above a floor.

Area, perimeter and radius hold for every full depth. The moment is A_full D / 2 for a circle and a box, and the crown moment M(D) for an arc barrel or a barrel with a floor.

Source

pub fn critical_depth( &self, discharge_m3_per_s: &Tensor<R>, gravity_m_per_s2: f64, ) -> Result<CulvertBarrelDepth<R, CriticalDepthStatus>, StructureError>

Encloses the critical depth Q^2 T = g A^3 of every barrel, in metres above the invert, or above the bed of a barrel with a floor.

discharge_m3_per_s is an F64 [m] tensor of per-barrel discharge magnitudes on the batch device. CriticalDepthStatus states what each row’s enclosure holds. A barrel with a floor solves on its open section of rise D' = D - h. Rejects a negative or nonfinite discharge, naming its row, and a nonfinite or nonpositive gravity.

Source

pub fn normal_depth( &self, discharge_m3_per_s: &Tensor<R>, manning_n: &Tensor<R>, slope: &Tensor<R>, ) -> Result<CulvertBarrelDepth<R, NormalDepthStatus>, StructureError>

Encloses the Manning normal depth Q = (1/n) A R^(2/3) sqrt(S) of every barrel, in metres above the invert, or above the bed of a barrel with a floor.

discharge_m3_per_s holds per-barrel discharge magnitudes, manning_n the roughness in s/m^(1/3) and slope the barrel slope, positive downstream. All are F64 [m] tensors on the batch device. The normal depth is the root on the rising limb of the conveyance. NormalDepthStatus states what each row’s enclosure holds. A zero or adverse slope reports NonPositiveSlope whatever the discharge. A barrel with a floor solves on its open section with manning_n the wall n and the weighted perimeter P_n = P_w + rho^(3/2) b in place of P: Q = (1/n) A^(5/3) P_n^(-2/3) sqrt(S). Rejects a negative or nonfinite discharge, a nonpositive or nonfinite n and a nonfinite slope, naming the row.

Trait Implementations§

Source§

impl<R: Clone + Runtime<DType = DType>> Clone for CulvertBarrelBatch<R>

Source§

fn clone(&self) -> Self

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<R: Runtime<DType = DType>> Debug for CulvertBarrelBatch<R>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<R> Forget for CulvertBarrelBatch<R>

§

impl<R> Freeze for CulvertBarrelBatch<R>
where Arc<TensorBarrelContext<R>>: Freeze,

§

impl<R> Move for CulvertBarrelBatch<R>

§

impl<R> RefUnwindSafe for CulvertBarrelBatch<R>
where Arc<TensorBarrelContext<R>>: RefUnwindSafe,

§

impl<R> Send for CulvertBarrelBatch<R>
where Arc<TensorBarrelContext<R>>: Send,

§

impl<R> Sync for CulvertBarrelBatch<R>
where Arc<TensorBarrelContext<R>>: Sync,

§

impl<R> Unpin for CulvertBarrelBatch<R>
where Arc<TensorBarrelContext<R>>: Unpin,

§

impl<R> UnsafeUnpin for CulvertBarrelBatch<R>
where Arc<TensorBarrelContext<R>>: UnsafeUnpin,

§

impl<R> UnwindSafe for CulvertBarrelBatch<R>
where Arc<TensorBarrelContext<R>>: UnwindSafe,

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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.