Type Alias splashsurf_lib::uniform_grid::UniformGrid
source · pub type UniformGrid<I, R> = UniformCartesianCubeGrid3d<I, R>;
Expand description
Abbreviated type alias for a uniform cartesian cube grid in 3D
Aliased Type§
struct UniformGrid<I, R> { /* private fields */ }
Implementations§
source§impl<I: Index, R: Real> UniformCartesianCubeGrid3d<I, R>
impl<I: Index, R: Real> UniformCartesianCubeGrid3d<I, R>
sourcepub fn from_aabb(
aabb: &Aabb3d<R>,
cell_size: R
) -> Result<Self, GridConstructionError<I, R>>
pub fn from_aabb( aabb: &Aabb3d<R>, cell_size: R ) -> Result<Self, GridConstructionError<I, R>>
Construct a new grid enclosing the given AABB
The grid will at least contain the AABB but may be larger depending on the cell size.
sourcepub fn new(
min: &Vector3<R>,
n_cells_per_dim: &[I; 3],
cell_size: R
) -> Result<Self, GridConstructionError<I, R>>
pub fn new( min: &Vector3<R>, n_cells_per_dim: &[I; 3], cell_size: R ) -> Result<Self, GridConstructionError<I, R>>
Constructs a new grid extending in positive cartesian axes direction from the min coordinate by the specified number of cubes of the given size
sourcepub fn points_per_dim(&self) -> &[I; 3]
pub fn points_per_dim(&self) -> &[I; 3]
Returns the number of grid points per dimension of the grid
sourcepub fn cells_per_dim(&self) -> &[I; 3]
pub fn cells_per_dim(&self) -> &[I; 3]
Returns the number of grid cells per dimension of the grid
sourcepub fn get_point(&self, ijk: [I; 3]) -> Option<PointIndex<I>>
pub fn get_point(&self, ijk: [I; 3]) -> Option<PointIndex<I>>
Converts a point index triplet into a strongly typed index, returns None
if the corresponding point is not part of the grid
sourcepub fn get_cell(&self, ijk: [I; 3]) -> Option<CellIndex<I>>
pub fn get_cell(&self, ijk: [I; 3]) -> Option<CellIndex<I>>
Converts a cell index triplet into a strongly typed index, returns None
if the corresponding cell is not part of the grid
pub fn get_edge(&self, origin_ijk: [I; 3], axis: Axis) -> Option<EdgeIndex<I>>
sourcepub fn point_exists(&self, point_ijk: &[I; 3]) -> bool
pub fn point_exists(&self, point_ijk: &[I; 3]) -> bool
Returns whether a point exists in the grid
sourcepub fn cell_exists(&self, cell_min_point_ijk: &[I; 3]) -> bool
pub fn cell_exists(&self, cell_min_point_ijk: &[I; 3]) -> bool
Returns whether a cell exists that has the given point index as its origin point (i.e. lower corner)
sourcepub fn is_boundary_cell(&self, cell_index: &CellIndex<I>) -> bool
pub fn is_boundary_cell(&self, cell_index: &CellIndex<I>) -> bool
Returns whether the cell with the given index is a cell on the boundary of the grid
sourcepub fn is_boundary_edge(&self, edge_index: &EdgeIndex<I>) -> bool
pub fn is_boundary_edge(&self, edge_index: &EdgeIndex<I>) -> bool
Returns whether the edge is between two points on the boundary of the grid
sourcepub fn flatten_point_indices(&self, i: I, j: I, k: I) -> I
pub fn flatten_point_indices(&self, i: I, j: I, k: I) -> I
Flattens the grid point index triplet to a single index
sourcepub fn flatten_point_index_array(&self, ijk: &[I; 3]) -> I
pub fn flatten_point_index_array(&self, ijk: &[I; 3]) -> I
Flattens the grid point index triplet array to a single index
sourcepub fn flatten_point_index(&self, point: &PointIndex<I>) -> I
pub fn flatten_point_index(&self, point: &PointIndex<I>) -> I
Flattens the grid point to a single index
sourcepub fn flatten_cell_indices(&self, i: I, j: I, k: I) -> I
pub fn flatten_cell_indices(&self, i: I, j: I, k: I) -> I
Flattens the grid cell index triplet to a single index
sourcepub fn flatten_cell_index_array(&self, ijk: &[I; 3]) -> I
pub fn flatten_cell_index_array(&self, ijk: &[I; 3]) -> I
Flattens the grid cell index triplet array to a single index
sourcepub fn flatten_cell_index(&self, cell: &CellIndex<I>) -> I
pub fn flatten_cell_index(&self, cell: &CellIndex<I>) -> I
Flattens the grid point to a single index
sourcepub fn try_unflatten_point_index(&self, point_index: I) -> Option<PointIndex<I>>
pub fn try_unflatten_point_index(&self, point_index: I) -> Option<PointIndex<I>>
Converts a flat point index value back to a strongly typed point index, returns None
if the point index is not part of the grid
sourcepub fn try_unflatten_cell_index(&self, cell_index: I) -> Option<CellIndex<I>>
pub fn try_unflatten_cell_index(&self, cell_index: I) -> Option<CellIndex<I>>
Converts a flat cell index value back to a strongly typed cell index, returns None
if the cell index is not part of the grid
sourcepub fn point_coordinates_indices(&self, i: I, j: I, k: I) -> Vector3<R>
pub fn point_coordinates_indices(&self, i: I, j: I, k: I) -> Vector3<R>
Returns the real-valued coordinates of a grid point in space
sourcepub fn point_coordinates_array(&self, ijk: &[I; 3]) -> Vector3<R>
pub fn point_coordinates_array(&self, ijk: &[I; 3]) -> Vector3<R>
Returns the real-valued coordinates of a grid point in space
sourcepub fn point_coordinates(&self, point: &PointIndex<I>) -> Vector3<R>
pub fn point_coordinates(&self, point: &PointIndex<I>) -> Vector3<R>
Returns the real-valued coordinates of a grid point in space
sourcepub fn enclosing_cell(&self, coord: &Vector3<R>) -> [I; 3]
pub fn enclosing_cell(&self, coord: &Vector3<R>) -> [I; 3]
Returns the grid cell index triplet of the cell enclosing a point with the given coordinates in space
sourcepub fn get_point_neighbor(
&self,
point: &PointIndex<I>,
direction: DirectedAxis
) -> Option<PointIndex<I>>
pub fn get_point_neighbor( &self, point: &PointIndex<I>, direction: DirectedAxis ) -> Option<PointIndex<I>>
If part of the grid, returns the neighbor of a point following the given directed axis along the grid
pub fn get_point_neighbor_unchecked( &self, point_ijk: &[I; 3], direction: DirectedAxis ) -> [I; 3]
sourcepub fn get_point_neighborhood<'a>(
&self,
point: &'a PointIndex<I>
) -> Neighborhood<'a, I>
pub fn get_point_neighborhood<'a>( &self, point: &'a PointIndex<I> ) -> Neighborhood<'a, I>
Returns full neighborhood information of a point on the grid
sourcepub fn cells_adjacent_to_edge<'a, 'b>(
&self,
edge: &NeighborEdge<'a, 'b, I>
) -> [Option<CellIndex<I>>; 4]
pub fn cells_adjacent_to_edge<'a, 'b>( &self, edge: &NeighborEdge<'a, 'b, I> ) -> [Option<CellIndex<I>>; 4]
Returns an array of all cells that may be adjacent to the specified edge
sourcepub fn cells_adjacent_to_point<'a>(
&self,
neighborhood: &Neighborhood<'a, I>
) -> [Option<CellIndex<I>>; 8]
pub fn cells_adjacent_to_point<'a>( &self, neighborhood: &Neighborhood<'a, I> ) -> [Option<CellIndex<I>>; 8]
Returns an array of all cells that contain the point which is the origin point of the given neighborhood
sourcepub fn cells_adjacent_to_cell<'a>(
&'a self,
cell: &'a CellIndex<I>
) -> impl Iterator<Item = CellIndex<I>> + 'a
pub fn cells_adjacent_to_cell<'a>( &'a self, cell: &'a CellIndex<I> ) -> impl Iterator<Item = CellIndex<I>> + 'a
Iterator over all valid (i.e. being part of the grid) cells of the 26 (27-1) cells that are adjacent to the given cell
Trait Implementations§
source§impl<I: Clone + Index, R: Clone + Real> Clone for UniformCartesianCubeGrid3d<I, R>
impl<I: Clone + Index, R: Clone + Real> Clone for UniformCartesianCubeGrid3d<I, R>
source§fn clone(&self) -> UniformCartesianCubeGrid3d<I, R>
fn clone(&self) -> UniformCartesianCubeGrid3d<I, R>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<I: PartialEq + Index, R: PartialEq + Real> PartialEq<UniformCartesianCubeGrid3d<I, R>> for UniformCartesianCubeGrid3d<I, R>
impl<I: PartialEq + Index, R: PartialEq + Real> PartialEq<UniformCartesianCubeGrid3d<I, R>> for UniformCartesianCubeGrid3d<I, R>
source§fn eq(&self, other: &UniformCartesianCubeGrid3d<I, R>) -> bool
fn eq(&self, other: &UniformCartesianCubeGrid3d<I, R>) -> bool
self
and other
values to be equal, and is used
by ==
.