Skip to main content

Orientation

Trait Orientation 

Source
pub trait Orientation {
    type Rotation;

    // Required methods
    fn orientation(&self) -> &Self::Rotation;
    fn orientation_mut(&mut self) -> &mut Self::Rotation;
}
Expand description

The orientation of a site or body: $\theta$ or $\mathbf{q}$.

When applied to site properties, Orientation has a context-dependent definition.

  • Elements in Microstate::sites describe the rotation from the site’s local frame to the system frame.
  • Elements in Body::sites describe the rotation from the site’s local frame to the body frame.

When applied to body properties, Orientation describes the rotation from the body frame to the system frame.

§Units

The units of Orientation depend on the representation chosen for Rotation. For example, hoomd_vector::Angle has units of radians while hoomd_vector::Versor is unitless.

§Derive macro

Use the Orientation derive macro to automatically implement the Orientation trait on a type. The type must have a field named orientation.

use hoomd_microstate::property::Orientation;
use hoomd_vector::Versor;

#[derive(Orientation)]
struct Custom {
    orientation: Versor,
}

Required Associated Types§

Source

type Rotation

Type that can express the orientation of a site or body.

Required Methods§

Source

fn orientation(&self) -> &Self::Rotation

The orientation of this site or body.

Source

fn orientation_mut(&mut self) -> &mut Self::Rotation

The orientation of this site or body (mutable).

Implementors§