Trait cellular_raza_concepts::Domain
source · pub trait Domain<C, S, Ci = Vec<C>> {
type SubDomainIndex;
type VoxelIndex;
// Required method
fn decompose(
self,
n_subdomains: NonZeroUsize,
cells: Ci
) -> Result<DecomposedDomain<Self::SubDomainIndex, S, C>, DecomposeError>;
}
Expand description
Provides an abstraction of the physical total simulation domain.
cellular_raza uses domain-decomposition algorithms to split up the computational workload over multiple physical regions. That’s why the domain itself is mostly responsible for being deconstructed into smaller SubDomains which can then be used to numerically solve our system.
This trait can be automatically implemented when the SortCells, DomainRngSeed, and DomainCreateSubDomains are satisfied together with a small number of trait bounds to hash and compare indices.
Required Associated Types§
sourcetype SubDomainIndex
type SubDomainIndex
Subdomains can be identified by their unique SubDomainIndex. The backend uses this property to construct a mapping (graph) between subdomains.
sourcetype VoxelIndex
type VoxelIndex
Similarly to the SubDomainIndex, voxels can be accessed by their unique index. The backend will use this information to construct a mapping (graph) between voxels inside their respective subdomains.
Required Methods§
sourcefn decompose(
self,
n_subdomains: NonZeroUsize,
cells: Ci
) -> Result<DecomposedDomain<Self::SubDomainIndex, S, C>, DecomposeError>
fn decompose( self, n_subdomains: NonZeroUsize, cells: Ci ) -> Result<DecomposedDomain<Self::SubDomainIndex, S, C>, DecomposeError>
Deconstructs the Domain into its respective subdomains.
When using the blanket implementation of this function, the following steps are carried out: Its functionality consists of the following steps:
- Decompose the Domain into Subdomains
- Build a neighbor map between SubDomains
- Sort cells to their respective SubDomain However, to increase performance or avoid trait bounds, one can also opt to implement this trait directly.