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>

source

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.

source

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

source

pub fn aabb(&self) -> &Aabb3d<R>

Returns the bounding box of the grid

source

pub fn cell_size(&self) -> R

Returns the cell size used by the grid

source

pub fn points_per_dim(&self) -> &[I; 3]

Returns the number of grid points per dimension of the grid

source

pub fn cells_per_dim(&self) -> &[I; 3]

Returns the number of grid cells per dimension of the grid

source

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

source

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

source

pub fn get_edge(&self, origin_ijk: [I; 3], axis: Axis) -> Option<EdgeIndex<I>>

source

pub fn point_exists(&self, point_ijk: &[I; 3]) -> bool

Returns whether a point exists in the grid

source

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)

source

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

source

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

source

pub fn flatten_point_indices(&self, i: I, j: I, k: I) -> I

Flattens the grid point index triplet to a single index

source

pub fn flatten_point_index_array(&self, ijk: &[I; 3]) -> I

Flattens the grid point index triplet array to a single index

source

pub fn flatten_point_index(&self, point: &PointIndex<I>) -> I

Flattens the grid point to a single index

source

pub fn flatten_cell_indices(&self, i: I, j: I, k: I) -> I

Flattens the grid cell index triplet to a single index

source

pub fn flatten_cell_index_array(&self, ijk: &[I; 3]) -> I

Flattens the grid cell index triplet array to a single index

source

pub fn flatten_cell_index(&self, cell: &CellIndex<I>) -> I

Flattens the grid point to a single index

source

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

source

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

source

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

source

pub fn point_coordinates_array(&self, ijk: &[I; 3]) -> Vector3<R>

Returns the real-valued coordinates of a grid point in space

source

pub fn point_coordinates(&self, point: &PointIndex<I>) -> Vector3<R>

Returns the real-valued coordinates of a grid point in space

source

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

source

pub fn cell_aabb(&self, cell: &CellIndex<I>) -> Aabb3d<R>

Returns an AABB of the given cell

source

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

source

pub fn get_point_neighbor_unchecked( &self, point_ijk: &[I; 3], direction: DirectedAxis ) -> [I; 3]

source

pub fn get_point_neighborhood<'a>( &self, point: &'a PointIndex<I> ) -> Neighborhood<'a, I>

Returns full neighborhood information of a point on the grid

source

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

source

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

source

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>

source§

fn clone(&self) -> UniformCartesianCubeGrid3d<I, R>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<I: Debug + Index, R: Debug + Real> Debug for UniformCartesianCubeGrid3d<I, R>

source§

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

Formats the value using the given formatter. Read more
source§

impl<I: PartialEq + Index, R: PartialEq + Real> PartialEq<UniformCartesianCubeGrid3d<I, R>> for UniformCartesianCubeGrid3d<I, R>

source§

fn eq(&self, other: &UniformCartesianCubeGrid3d<I, R>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<I: Index, R: Real> StructuralPartialEq for UniformCartesianCubeGrid3d<I, R>