Struct DomainBox
pub struct DomainBox<Dom> {
pub domain_raw: Dom,
}
Available on crate feature
cpu_os_threads
only.Expand description
Wrapper around the user-defined simulation Domain
Fields§
§domain_raw: Dom
Raw simulation Domain
Trait Implementations§
§impl<'de, Dom> Deserialize<'de> for DomainBox<Dom>where
Dom: Deserialize<'de>,
impl<'de, Dom> Deserialize<'de> for DomainBox<Dom>where
Dom: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DomainBox<Dom>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DomainBox<Dom>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<Cel, Ind, Vox, Dom> Domain<CellAgentBox<Cel>, Ind, Vox> for DomainBox<Dom>
impl<Cel, Ind, Vox, Dom> Domain<CellAgentBox<Cel>, Ind, Vox> for DomainBox<Dom>
§fn apply_boundary(
&self,
cbox: &mut CellAgentBox<Cel>,
) -> Result<(), BoundaryError>
fn apply_boundary( &self, cbox: &mut CellAgentBox<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_neighbor_voxel_indices(&self, index: &Ind) -> Vec<Ind>
fn get_neighbor_voxel_indices(&self, index: &Ind) -> Vec<Ind>
Retrieves the neighboring voxels of the one specified.
§fn get_voxel_index(&self, cbox: &CellAgentBox<Cel>) -> Ind
fn get_voxel_index(&self, cbox: &CellAgentBox<Cel>) -> Ind
Provided a cell, gives the corresponding Index and thus which voxel to sort into.
§fn get_all_indices(&self) -> Vec<Ind>
fn get_all_indices(&self) -> Vec<Ind>
Get all indices that are present in the simulation. Required for initial configuration of the simulation domain.
§fn generate_contiguous_multi_voxel_regions(
&self,
n_regions: usize,
) -> Result<Vec<Vec<(Ind, Vox)>>, CalcError>
fn generate_contiguous_multi_voxel_regions( &self, n_regions: usize, ) -> Result<Vec<Vec<(Ind, Vox)>>, CalcError>
Allows the backend to split the domain into continuous regions which contain voxels.
These regions can then be used for parallelization.
§impl<Dom> Serialize for DomainBox<Dom>where
Dom: Serialize,
impl<Dom> Serialize for DomainBox<Dom>where
Dom: Serialize,
§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
Auto Trait Implementations§
impl<Dom> Freeze for DomainBox<Dom>where
Dom: Freeze,
impl<Dom> RefUnwindSafe for DomainBox<Dom>where
Dom: RefUnwindSafe,
impl<Dom> Send for DomainBox<Dom>where
Dom: Send,
impl<Dom> Sync for DomainBox<Dom>where
Dom: Sync,
impl<Dom> Unpin for DomainBox<Dom>where
Dom: Unpin,
impl<Dom> UnwindSafe for DomainBox<Dom>where
Dom: UnwindSafe,
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.