pub struct Grid1D<S>where
S: Scalar,{ /* private fields */ }Expand description
1D uniform or non-uniform grid.
Implementations§
Source§impl<S> Grid1D<S>where
S: Scalar,
impl<S> Grid1D<S>where
S: Scalar,
Sourcepub fn uniform(x_min: S, x_max: S, n: usize) -> Grid1D<S>
pub fn uniform(x_min: S, x_max: S, n: usize) -> Grid1D<S>
Create a uniform grid with n points from x_min to x_max.
Sourcepub fn from_points(points: Vec<S>) -> Grid1D<S>
pub fn from_points(points: Vec<S>) -> Grid1D<S>
Create a grid from explicit points.
Sourcepub fn clustered(x_min: S, x_max: S, n: usize, cluster_factor: S) -> Grid1D<S>
pub fn clustered(x_min: S, x_max: S, n: usize, cluster_factor: S) -> Grid1D<S>
Create a grid with refinement near boundaries.
Uses a tanh-based clustering.
Sourcepub fn n_interior(&self) -> usize
pub fn n_interior(&self) -> usize
Number of interior points (excluding boundaries).
Sourcepub fn interior_points(&self) -> &[S]
pub fn interior_points(&self) -> &[S]
Get interior points (excluding boundaries).
Sourcepub fn dx_uniform(&self) -> S
pub fn dx_uniform(&self) -> S
Get uniform spacing (panics if non-uniform).
Sourcepub fn is_uniform(&self) -> bool
pub fn is_uniform(&self) -> bool
Check if grid is uniform.
Sourcepub fn find_index(&self, x: S) -> usize
pub fn find_index(&self, x: S) -> usize
Find index of point closest to x.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Grid1D<S>
impl<S> RefUnwindSafe for Grid1D<S>where
S: RefUnwindSafe,
impl<S> Send for Grid1D<S>
impl<S> Sync for Grid1D<S>
impl<S> Unpin for Grid1D<S>where
S: Unpin,
impl<S> UnsafeUnpin for Grid1D<S>
impl<S> UnwindSafe for Grid1D<S>where
S: UnwindSafe,
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<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>
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 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>
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