Trait SortCells

pub trait SortCells<C> {
    type VoxelIndex;

    // Required method
    fn get_voxel_index_of(
        &self,
        cell: &C,
    ) -> Result<Self::VoxelIndex, BoundaryError>;
}
Expand description

Assign an VoxelIndex to a given cell.

This trait is used by the Domain and SubDomain trait to assign a Domain::SubDomainIndex and SubDomain::VoxelIndex respectively.

§SubDomain

This trait is supposed to return the correct voxel index of the cell even if this index is inside another SubDomain. This restriction might be lifted in the future but is still required now.

Required Associated Types§

type VoxelIndex

An index which determines to which next smaller unit the cell should be assigned.

Required Methods§

fn get_voxel_index_of( &self, cell: &C, ) -> Result<Self::VoxelIndex, BoundaryError>

If given a cell, we can sort this cell into the corresponding sub unit.

Implementors§

§

impl<C> SortCells<C> for CartesianSubDomain1
where C: Position<Matrix<f64, Const<1>, Const<1>, ArrayStorage<f64, 1, 1>>>,

§

type VoxelIndex = [i64; 1]

§

impl<C> SortCells<C> for CartesianSubDomain1F32
where C: Position<Matrix<f32, Const<1>, Const<1>, ArrayStorage<f32, 1, 1>>>,

§

type VoxelIndex = [i64; 1]

§

impl<C> SortCells<C> for CartesianSubDomain2
where C: Position<Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>>,

§

type VoxelIndex = [i64; 2]

§

impl<C> SortCells<C> for CartesianSubDomain2F32
where C: Position<Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>>,

§

type VoxelIndex = [i64; 2]

§

impl<C> SortCells<C> for CartesianSubDomain3
where C: Position<Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>>,

§

type VoxelIndex = [i64; 3]

§

impl<C> SortCells<C> for CartesianSubDomain3F32
where C: Position<Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>>,

§

type VoxelIndex = [i64; 3]

§

impl<C, F, const D: usize> SortCells<C> for CartesianCuboid<F, D>
where F: 'static + Float<Output = F> + Copy + Debug + FromPrimitive + ToPrimitive + SubAssign + Div + DivAssign, C: Position<Matrix<F, Const<D>, Const<1>, ArrayStorage<F, D, 1>>>,

§

type VoxelIndex = [usize; D]

§

impl<C, F, const D: usize> SortCells<C> for CartesianCuboidRods<F, D>
where C: Position<Matrix<F, Dyn, Const<D>, VecStorage<F, Dyn, Const<D>>>>, F: 'static + Field + Clone + Debug + FromPrimitive + ToPrimitive + Float + Copy,

§

type VoxelIndex = [usize; D]

§

impl<C, F, const D: usize> SortCells<C> for CartesianSubDomain<F, D>
where C: Position<Matrix<F, Const<D>, Const<1>, ArrayStorage<F, D, 1>>>, F: 'static + Float + Debug + SubAssign + DivAssign,

§

type VoxelIndex = [usize; D]

§

impl<C, F, const D: usize> SortCells<C> for CartesianSubDomainRods<F, D>
where C: Position<Matrix<F, Dyn, Const<D>, VecStorage<F, Dyn, Const<D>>>>, F: 'static + Field + Clone + Debug + FromPrimitive + ToPrimitive + Float + Copy,

§

type VoxelIndex = [usize; D]