pub trait Wrap<P> {
// Required method
fn wrap(&self, properties: P) -> Result<P, Error>;
}Expand description
Attempt to move any body/site properties back into the simulation boundary.
Wrap and GenerateGhosts together define the behavior of simulation
boundary conditions.
The boundary defines the subset of points where bodies and sites are
allowed. The wrap method takes a given body or site properties that
is anywhere in space and attempts to wrap it back into the boundary. This
process succeeds when the boundary is periodic and fails when it is not
(some boundaries may be periodic in some directions and not in others).
The generic type name is:
P: TheBody::propertiesorSite::propertiestype.
Required Methods§
Sourcefn wrap(&self, properties: P) -> Result<P, Error>
fn wrap(&self, properties: P) -> Result<P, Error>
Transform body/point properties into the boundary.
wrap takes a body or site properties with a position that may be outside
the boundary. It attempts to wrap that position back inside following the
boundary’s periodicity. wrap returns Ok(properties) when this
process is successful.
§Errors
wrap returns Error::CannotWrapProperties when it is not possible
to wrap the body into the boundary. For example, when the position is
outside the radius of a cylinder that is only periodic along its axis.