Trait Voxel

pub trait Voxel<Ind, Pos, Vel, Force>:
    Send
    + Sync
    + Clone
    + Serialize
    + for<'a> Deserialize<'a> {
    // Required method
    fn get_index(&self) -> Ind;

    // Provided method
    fn custom_force_on_cell(
        &self,
        _pos: &Pos,
        _vel: &Vel,
    ) -> Option<Result<Force, CalcError>> { ... }
}
Expand description

The Domain trait generalizes over the Voxel generic parameter which

Required Methods§

fn get_index(&self) -> Ind

Gets the Index of the voxel.

Provided Methods§

fn custom_force_on_cell( &self, _pos: &Pos, _vel: &Vel, ) -> Option<Result<Force, CalcError>>

Voxels can exert custom forces on cells. In the future this function will probably be part of a different Trait.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl<const D: usize, const N: usize> Voxel<[i64; 2], Matrix<f64, Const<D>, Const<2>, ArrayStorage<f64, D, 2>>, Matrix<f64, Const<D>, Const<2>, ArrayStorage<f64, D, 2>>, Matrix<f64, Const<D>, Const<2>, ArrayStorage<f64, D, 2>>> for CartesianCuboidVoxel2Vertex<D, N>

§

impl<const N: usize> Voxel<[i64; 1], Matrix<f64, Const<1>, Const<1>, ArrayStorage<f64, 1, 1>>, Matrix<f64, Const<1>, Const<1>, ArrayStorage<f64, 1, 1>>, Matrix<f64, Const<1>, Const<1>, ArrayStorage<f64, 1, 1>>> for CartesianCuboidVoxel1<N>

§

impl<const N: usize> Voxel<[i64; 2], Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>> for CartesianCuboidVoxel2<N>

§

impl<const N: usize> Voxel<[i64; 3], Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>> for CartesianCuboidVoxel3<N>