GenerateGhosts

Trait GenerateGhosts 

Source
pub trait GenerateGhosts<S> {
    // Required methods
    fn maximum_interaction_range(&self) -> f64;
    fn generate_ghosts(&self, _site_properties: &S) -> ArrayVec<S, MAX_GHOSTS>;
}
Expand description

Place periodic images of sites within the interaction range.

Wrap and GenerateGhosts together define the behavior of simulation boundary conditions.

The boundary defines the subset of points where bodies and sites are allowed. generate_ghosts places 0 or more sites that are periodic images of the given site and within the maximum interaction range of the boundary. Closed boundary conditions place no ghosts. Periodic boundary conditions may place 0, 1, 2, or more ghosts depending on the location of the site. For example sites in the center of a cubic box will have 0 ghosts, those near the center of a face will have 1, those near an edge will have 2, and those near a vertex will have 3.

To avoid costly dynamic memory allocations, generate_ghosts returns an array-backed storage with a hard-coded maximum size of MAX_GHOSTS.

Required Methods§

Source

fn maximum_interaction_range(&self) -> f64

The largest interaction distance between sites.

The maximum interaction range is the largest distance between two interacting sites. Microstate will place ghosts within this range outside periodic boundaries.

Source

fn generate_ghosts(&self, _site_properties: &S) -> ArrayVec<S, MAX_GHOSTS>

Place periodic images of sites within the interaction range.

Given site_properties inside the boundary, generate_ghosts places periodic images of that site. It must place all ghosts needed to compute interactions with other sites in the given maximum_interaction_range.

Implementors§