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>
impl<R: Runtime<DType = DType>> CulvertBarrelBatch<R>
Sourcepub fn new(
client: R::Client,
barrels: Vec<CulvertBarrel>,
) -> Result<Self, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R>,
pub fn new(
client: R::Client,
barrels: Vec<CulvertBarrel>,
) -> Result<Self, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R>,
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.
Sourcepub fn barrels(&self) -> &[CulvertBarrel]
pub fn barrels(&self) -> &[CulvertBarrel]
Barrels in row order.
Sourcepub fn geometry(
&self,
depth_m: &Tensor<R>,
) -> Result<CulvertBarrelGeometry<R>, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R>,
pub fn geometry(
&self,
depth_m: &Tensor<R>,
) -> Result<CulvertBarrelGeometry<R>, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R>,
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.
Sourcepub fn geometry_over(
&self,
lower_m: &Tensor<R>,
upper_m: &Tensor<R>,
) -> Result<CulvertBarrelGeometry<R>, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R>,
pub fn geometry_over(
&self,
lower_m: &Tensor<R>,
upper_m: &Tensor<R>,
) -> Result<CulvertBarrelGeometry<R>, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R>,
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.
Sourcepub fn full_geometry(&self) -> Result<CulvertBarrelGeometry<R>, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R>,
pub fn full_geometry(&self) -> Result<CulvertBarrelGeometry<R>, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R>,
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.
Sourcepub fn critical_depth(
&self,
discharge_m3_per_s: &Tensor<R>,
gravity_m_per_s2: f64,
) -> Result<CulvertBarrelDepth<R, CriticalDepthStatus>, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R> + CertifiedBisectionAlgorithms<R>,
pub fn critical_depth(
&self,
discharge_m3_per_s: &Tensor<R>,
gravity_m_per_s2: f64,
) -> Result<CulvertBarrelDepth<R, CriticalDepthStatus>, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R> + CertifiedBisectionAlgorithms<R>,
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.
Sourcepub fn normal_depth(
&self,
discharge_m3_per_s: &Tensor<R>,
manning_n: &Tensor<R>,
slope: &Tensor<R>,
) -> Result<CulvertBarrelDepth<R, NormalDepthStatus>, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R> + CertifiedBisectionAlgorithms<R>,
pub fn normal_depth(
&self,
discharge_m3_per_s: &Tensor<R>,
manning_n: &Tensor<R>,
slope: &Tensor<R>,
) -> Result<CulvertBarrelDepth<R, NormalDepthStatus>, StructureError>where
R::Client: TensorOps<R> + CompareOps<R> + NextRepresentableOps<R> + ScalarOps<R> + TwoSumOps<R> + CorrectlyRoundedOps<R> + RuntimeClient<R> + CertifiedBisectionAlgorithms<R>,
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§
Auto Trait Implementations§
impl<R> Forget for CulvertBarrelBatch<R>
impl<R> Freeze for CulvertBarrelBatch<R>
impl<R> Move for CulvertBarrelBatch<R>
impl<R> RefUnwindSafe for CulvertBarrelBatch<R>where
Arc<TensorBarrelContext<R>>: RefUnwindSafe,
impl<R> Send for CulvertBarrelBatch<R>
impl<R> Sync for CulvertBarrelBatch<R>
impl<R> Unpin for CulvertBarrelBatch<R>
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.