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, 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]

§

impl<F, __cr_private_Cell> SortCells<__cr_private_Cell> for CartesianDiffusion2D<F>
where CartesianCuboid<F, 2>: SortCells<__cr_private_Cell>,

§

type VoxelIndex = <CartesianCuboid<F, 2> as SortCells<__cr_private_Cell>>::VoxelIndex

§

impl<F, __cr_private_Cell> SortCells<__cr_private_Cell> for CartesianDiffusion2DSubDomain<F>
where CartesianSubDomain<F, 2>: SortCells<__cr_private_Cell>,

§

type VoxelIndex = <CartesianSubDomain<F, 2> as SortCells<__cr_private_Cell>>::VoxelIndex