pub trait Position {
type Position;
// Required methods
fn position(&self) -> &Self::Position;
fn position_mut(&mut self) -> &mut Self::Position;
}Expand description
Locate a site or body in space: $\vec{r}$
When applied to body properties, Position describes the location of the body
relative to the origin of the system coordinate system.
When applied to site properties, Position has a context-dependent definition.
- Elements in
Microstate::siteshave a position located in the system frame. - Elements in
Body::siteshave a position located in the body frame.
§Units
Position vectors have units of $[\mathrm{length}]$.
§Derive macro
Use the Position derive macro to automatically implement
the Position trait on a type. The type must have a field named position.
use hoomd_microstate::property::Position;
use hoomd_vector::Cartesian;
#[derive(Position)]
struct Custom {
position: Cartesian<3>,
}Required Associated Types§
Required Methods§
Sourcefn position_mut(&mut self) -> &mut Self::Position
fn position_mut(&mut self) -> &mut Self::Position
The mutable position of this body or site $[\mathrm{length}]$.