Struct CartesianCuboidVoxel2
pub struct CartesianCuboidVoxel2<const N: usize> {
pub extracellular_concentrations: Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>,
pub extracellular_gradient: 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>>,
pub diffusion_constant: Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>,
pub production_rate: Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>,
pub degradation_rate: Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>,
/* private fields */
}
Expand description
Cuboid Voxel for
CartesianCuboid2
in
2D
Fields§
§extracellular_concentrations: Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>
Concentrations of the different diffusables
extracellular_gradient: 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>>
The gradient of diffusables at this voxel
diffusion_constant: Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>
Local diffusion constant
production_rate: Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>
Local production rate of diffusables
degradation_rate: Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>
Local degradation rate of diffusables
Implementations§
§impl<const N: usize> CartesianCuboidVoxel2<N>
impl<const N: usize> CartesianCuboidVoxel2<N>
pub fn get_min(&self) -> [f64; 2]
Available on crate feature cpu_os_threads
only.
pub fn get_min(&self) -> [f64; 2]
cpu_os_threads
only.Get lower boundary of voxel
pub fn get_max(&self) -> [f64; 2]
Available on crate feature cpu_os_threads
only.
pub fn get_max(&self) -> [f64; 2]
cpu_os_threads
only.Get upper boundary of voxel
pub fn get_middle(&self) -> [f64; 2]
Available on crate feature cpu_os_threads
only.
pub fn get_middle(&self) -> [f64; 2]
cpu_os_threads
only.Get middle of voxel
Trait Implementations§
§impl<const N: usize> Clone for CartesianCuboidVoxel2<N>
impl<const N: usize> Clone for CartesianCuboidVoxel2<N>
§fn clone(&self) -> CartesianCuboidVoxel2<N>
fn clone(&self) -> CartesianCuboidVoxel2<N>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<const N: usize> Debug for CartesianCuboidVoxel2<N>
impl<const N: usize> Debug for CartesianCuboidVoxel2<N>
§impl<'de, const N: usize> Deserialize<'de> for CartesianCuboidVoxel2<N>
impl<'de, const N: usize> Deserialize<'de> for CartesianCuboidVoxel2<N>
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CartesianCuboidVoxel2<N>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CartesianCuboidVoxel2<N>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<Cel, const N: usize> Domain<Cel, [i64; 2], CartesianCuboidVoxel2<N>> for CartesianCuboid2
impl<Cel, const N: usize> Domain<Cel, [i64; 2], CartesianCuboidVoxel2<N>> for CartesianCuboid2
§fn apply_boundary(&self, cell: &mut Cel) -> Result<(), BoundaryError>
fn apply_boundary(&self, cell: &mut Cel) -> Result<(), BoundaryError>
Applies boundary conditions to a cell in order to keep it inside the simulation.
For the future, we aim to apply boundary conditions to the position of the cell rather than itself.
In addition, we would like to be able to invoke events such as Remove to maximize flexibility.
§fn get_voxel_index(&self, cell: &Cel) -> [i64; 2]
fn get_voxel_index(&self, cell: &Cel) -> [i64; 2]
Provided a cell, gives the corresponding Index and thus which voxel to sort into.
§fn get_all_indices(&self) -> Vec<[i64; 2]>
fn get_all_indices(&self) -> Vec<[i64; 2]>
Get all indices that are present in the simulation. Required for initial configuration of the simulation domain.
§fn get_neighbor_voxel_indices(&self, index: &[i64; 2]) -> Vec<[i64; 2]>
fn get_neighbor_voxel_indices(&self, index: &[i64; 2]) -> Vec<[i64; 2]>
Retrieves the neighboring voxels of the one specified.
§fn generate_contiguous_multi_voxel_regions(
&self,
n_regions: usize,
) -> Result<Vec<Vec<([i64; 2], CartesianCuboidVoxel2<N>)>>, CalcError>
fn generate_contiguous_multi_voxel_regions( &self, n_regions: usize, ) -> Result<Vec<Vec<([i64; 2], CartesianCuboidVoxel2<N>)>>, CalcError>
Allows the backend to split the domain into continuous regions which contain voxels.
These regions can then be used for parallelization.
§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; 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>
§fn get_extracellular_at_point(
&self,
pos: &Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>,
) -> Result<Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>, RequestError>
fn get_extracellular_at_point( &self, pos: &Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, ) -> Result<Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>, RequestError>
Obtain the extracellular concentration at a specified point.
§fn get_total_extracellular(
&self,
) -> Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>
fn get_total_extracellular( &self, ) -> Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>
Obtain every concentration in the current voxel. This function is only relevant for the backend.
§fn update_extracellular_gradient(
&mut self,
boundaries: &[([i64; 2], BoundaryCondition<Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>>)],
) -> Result<(), CalcError>
fn update_extracellular_gradient( &mut self, boundaries: &[([i64; 2], BoundaryCondition<Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>>)], ) -> Result<(), CalcError>
Update function to calculate the gradient of concentrations in this voxel.
§fn get_extracellular_gradient_at_point(
&self,
_pos: &Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>,
) -> Result<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>>, RequestError>
fn get_extracellular_gradient_at_point( &self, _pos: &Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, ) -> Result<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>>, RequestError>
Obtain the gradient at a certain point.
§fn set_total_extracellular(
&mut self,
concentrations: &Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>,
) -> Result<(), CalcError>
fn set_total_extracellular( &mut self, concentrations: &Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>, ) -> Result<(), CalcError>
Simple setter function to specify concentrations after backend has updated values.
§fn calculate_increment(
&self,
total_extracellular: &Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>,
point_sources: &[(Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>)],
boundaries: &[([i64; 2], BoundaryCondition<Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>>)],
) -> Result<Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>, CalcError>
fn calculate_increment( &self, total_extracellular: &Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>, point_sources: &[(Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>)], boundaries: &[([i64; 2], BoundaryCondition<Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>>)], ) -> Result<Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>, CalcError>
Calculates the time-derivative of the function that increments the concentrations.
§fn boundary_condition_to_neighbor_voxel(
&self,
_neighbor_index: &[i64; 2],
) -> Result<BoundaryCondition<Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>>, IndexError>
fn boundary_condition_to_neighbor_voxel( &self, _neighbor_index: &[i64; 2], ) -> Result<BoundaryCondition<Matrix<f64, Const<N>, Const<1>, ArrayStorage<f64, N, 1>>>, IndexError>
Gets the boundary to the specified neighboring voxel.
§impl<const N: usize> Serialize for CartesianCuboidVoxel2<N>
impl<const N: usize> Serialize for CartesianCuboidVoxel2<N>
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl<const N: usize> Volume for CartesianCuboidVoxel2<N>
impl<const N: usize> Volume for CartesianCuboidVoxel2<N>
§fn get_volume(&self) -> f64
fn get_volume(&self) -> f64
Obtain the cells current volume.
Auto Trait Implementations§
impl<const N: usize> Freeze for CartesianCuboidVoxel2<N>
impl<const N: usize> RefUnwindSafe for CartesianCuboidVoxel2<N>
impl<const N: usize> Send for CartesianCuboidVoxel2<N>
impl<const N: usize> Sync for CartesianCuboidVoxel2<N>
impl<const N: usize> Unpin for CartesianCuboidVoxel2<N>
impl<const N: usize> UnwindSafe for CartesianCuboidVoxel2<N>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.