pub struct VoxelTallyGrid { /* private fields */ }Expand description
The regular grid a VoxelTally bins on: dims voxels of edge
spacing_m starting at origin_m. Voxel (i, j, k) has the flat index
i + nx (j + ny k) (x fastest, as in VoxelGrid).
Implementations§
Source§impl VoxelTallyGrid
impl VoxelTallyGrid
Sourcepub fn new(
origin_m: [f64; 3],
spacing_m: [f64; 3],
dims: [usize; 3],
) -> Result<Self, VoxelTallyError>
pub fn new( origin_m: [f64; 3], spacing_m: [f64; 3], dims: [usize; 3], ) -> Result<Self, VoxelTallyError>
A grid of dims voxels of edge lengths spacing_m whose lowest corner
is origin_m. Every dimension must be nonzero, every spacing finite
and positive, the origin finite, and the voxel count must fit in u64.
Sourcepub fn from_voxel_grid(grid: &VoxelGrid) -> Self
pub fn from_voxel_grid(grid: &VoxelGrid) -> Self
The grid of the voxels of grid (origin at the corner of the front
face), so a tally voxel is a target voxel.
Sourcepub fn locate(&self, pos: [f64; 3]) -> Option<[usize; 3]>
pub fn locate(&self, pos: [f64; 3]) -> Option<[usize; 3]>
The voxel [i, j, k] containing pos, or None outside the grid
(or for a non-finite position). Voxels are half-open, so a point on an
interior face belongs to the voxel with the higher index and a point
on the far end of the grid is outside.
Sourcepub fn flat_index(&self, ijk: [usize; 3]) -> u64
pub fn flat_index(&self, ijk: [usize; 3]) -> u64
Flat index i + nx (j + ny k) of voxel ijk.
Trait Implementations§
Source§impl Clone for VoxelTallyGrid
impl Clone for VoxelTallyGrid
Source§fn clone(&self) -> VoxelTallyGrid
fn clone(&self) -> VoxelTallyGrid
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for VoxelTallyGrid
Source§impl Debug for VoxelTallyGrid
impl Debug for VoxelTallyGrid
Source§impl<'de> Deserialize<'de> for VoxelTallyGrid
impl<'de> Deserialize<'de> for VoxelTallyGrid
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for VoxelTallyGrid
impl PartialEq for VoxelTallyGrid
Source§impl Serialize for VoxelTallyGrid
impl Serialize for VoxelTallyGrid
impl StructuralPartialEq for VoxelTallyGrid
Auto Trait Implementations§
impl Freeze for VoxelTallyGrid
impl RefUnwindSafe for VoxelTallyGrid
impl Send for VoxelTallyGrid
impl Sync for VoxelTallyGrid
impl Unpin for VoxelTallyGrid
impl UnsafeUnpin for VoxelTallyGrid
impl UnwindSafe for VoxelTallyGrid
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more