pub struct Grid2D<S: Scalar> {
pub x_grid: Grid1D<S>,
pub y_grid: Grid1D<S>,
}Expand description
2D grid (tensor product of 1D grids).
Fields§
§x_grid: Grid1D<S>Grid in x direction
y_grid: Grid1D<S>Grid in y direction
Implementations§
Source§impl<S: Scalar> Grid2D<S>
impl<S: Scalar> Grid2D<S>
Sourcepub fn uniform(
x_min: S,
x_max: S,
nx: usize,
y_min: S,
y_max: S,
ny: usize,
) -> Self
pub fn uniform( x_min: S, x_max: S, nx: usize, y_min: S, y_max: S, ny: usize, ) -> Self
Create a uniform 2D grid.
Sourcepub fn n_interior(&self) -> usize
pub fn n_interior(&self) -> usize
Number of interior points.
Sourcepub fn linear_index(&self, i: usize, j: usize) -> usize
pub fn linear_index(&self, i: usize, j: usize) -> usize
Convert (i, j) grid index to linear index.
Sourcepub fn grid_index(&self, idx: usize) -> (usize, usize)
pub fn grid_index(&self, idx: usize) -> (usize, usize)
Convert linear index to (i, j) grid index.
Sourcepub fn nx_interior(&self) -> usize
pub fn nx_interior(&self) -> usize
Number of interior points in x direction.
Sourcepub fn ny_interior(&self) -> usize
pub fn ny_interior(&self) -> usize
Number of interior points in y direction.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Grid2D<S>
impl<S> RefUnwindSafe for Grid2D<S>where
S: RefUnwindSafe,
impl<S> Send for Grid2D<S>
impl<S> Sync for Grid2D<S>
impl<S> Unpin for Grid2D<S>where
S: Unpin,
impl<S> UnsafeUnpin for Grid2D<S>
impl<S> UnwindSafe for Grid2D<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