Trait ExtracellularMechanics

pub trait ExtracellularMechanics<Ind, Pos, ConcVec, ConcGradient, ConcTotal = ConcVec, ConcBoundary = ConcVec>:
    Send
    + Sync
    + Clone
    + Serialize
    + for<'a> Deserialize<'a> {
    // Required methods
    fn get_extracellular_at_point(
        &self,
        pos: &Pos,
    ) -> Result<ConcVec, RequestError>;
    fn get_total_extracellular(&self) -> ConcTotal;
    fn update_extracellular_gradient(
        &mut self,
        boundaries: &[(Ind, BoundaryCondition<ConcBoundary>)],
    ) -> Result<(), CalcError>;
    fn get_extracellular_gradient_at_point(
        &self,
        pos: &Pos,
    ) -> Result<ConcGradient, RequestError>;
    fn set_total_extracellular(
        &mut self,
        concentration_total: &ConcTotal,
    ) -> Result<(), CalcError>;
    fn calculate_increment(
        &self,
        total_extracellular: &ConcTotal,
        point_sources: &[(Pos, ConcVec)],
        boundaries: &[(Ind, BoundaryCondition<ConcBoundary>)],
    ) -> Result<ConcTotal, CalcError>;
    fn boundary_condition_to_neighbor_voxel(
        &self,
        neighbor_index: &Ind,
    ) -> Result<BoundaryCondition<ConcBoundary>, IndexError>;
}
Expand description

First approach on how to generalize over extracellular mechanics. Future versions will not depend on the Voxel Index but be more general.

Required Methods§

fn get_extracellular_at_point(&self, pos: &Pos) -> Result<ConcVec, RequestError>

Obtain the extracellular concentration at a specified point.

fn get_total_extracellular(&self) -> ConcTotal

Obtain every concentration in the current voxel. This function is only relevant for the backend.

fn update_extracellular_gradient( &mut self, boundaries: &[(Ind, BoundaryCondition<ConcBoundary>)], ) -> Result<(), CalcError>

Update function to calculate the gradient of concentrations in this voxel.

fn get_extracellular_gradient_at_point( &self, pos: &Pos, ) -> Result<ConcGradient, RequestError>

Obtain the gradient at a certain point.

fn set_total_extracellular( &mut self, concentration_total: &ConcTotal, ) -> Result<(), CalcError>

Simple setter function to specify concentrations after backend has updated values.

fn calculate_increment( &self, total_extracellular: &ConcTotal, point_sources: &[(Pos, ConcVec)], boundaries: &[(Ind, BoundaryCondition<ConcBoundary>)], ) -> Result<ConcTotal, CalcError>

Calculates the time-derivative of the function that increments the concentrations.

fn boundary_condition_to_neighbor_voxel( &self, neighbor_index: &Ind, ) -> Result<BoundaryCondition<ConcBoundary>, IndexError>

Gets the boundary to the specified neighboring voxel.

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> ExtracellularMechanics<[i64; 2], Matrix<f64, Const<D>, Const<2>, ArrayStorage<f64, D, 2>>, Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>, Matrix<Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, Const<N>, Const<1>, ArrayStorage<Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, N, 1>>> for CartesianCuboidVoxel2Vertex<D, N>

§

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

§

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

§

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