Skip to main content

DynamicOrientedPoint

Struct DynamicOrientedPoint 

Source
pub struct DynamicOrientedPoint<V, R>{
    pub position: V,
    pub orientation: R,
    pub mass: f64,
    pub momentum: V,
    pub net_force: V,
    pub net_virial: V::Tensor,
    pub moment_of_inertia: R::MomentOfInertia,
    pub angular_momentum: R::AngularMomentum,
    pub net_torque: V::Bivector,
}
Expand description

A position in space with the properties necessary for translational and rotational motion in MD.

Use DynamicOrientedPoint as a Body property type.

A default DynamicOrientedPoint has a mass of 1.0 and position, momentum, and net force of $\vec{0}$, and a zero-tensor for net virial. Orientation defaults to the identity. DynamicOrientedPoint<_, Angle> has a default moment of inertia of 1.0. DynamicOrientedPoint<_, Versor> has a default moment of inertia of [1.0, 1.0, 1.0].

§Example

use hoomd_microstate::property::DynamicOrientedPoint;
use hoomd_vector::{Angle, Cartesian};
use std::f64::consts::PI;

let oriented_dynamic_point = DynamicOrientedPoint {
    position: Cartesian::from([1.0, -3.0]),
    orientation: Angle::from(PI / 4.0),
    ..Default::default()
};

Fields§

§position: V

The location of the extended body in space $[\mathrm{length}]$.

§orientation: R

Rotate from the body’s reference frame to the system frame.

§mass: f64

The mass of the extended body $[\mathrm{mass}]$.

§momentum: V

The translational momentum of the extended body $[ \mathrm{energy}^{1/2} \cdot \mathrm{mass}^{1/2}]$.

§net_force: V

The net force applied to the body in a Microstate $[ \mathrm{energy}^{1/2} \cdot \mathrm{mass}^{1/2}]$.

§net_virial: V::Tensor

The net virial applied to the body in a Microstate $[\mathrm{energy}]$.

§moment_of_inertia: R::MomentOfInertia

The moment of inertia of the extended body $[\mathrm{mass} \cdot \mathrm{length}^2]$.

§angular_momentum: R::AngularMomentum

The angular momentum of the extended body $[\mathrm{mass} \cdot \mathrm{length}^2]$.

§net_torque: V::Bivector

The net torque applied to the body by others in a Microstate $[\mathrm{energy}]$.

Trait Implementations§

Source§

impl<V, R> AngularMomentum for DynamicOrientedPoint<V, R>

Source§

type AngularMomentum = <R as RotationalMotionTypes>::AngularMomentum

Type that can express the angular momentum of a site or body.
Source§

fn angular_momentum(&self) -> &R::AngularMomentum

The angular momentum of this site or body $[\mathrm{mass}^{1/2} \cdot \mathrm{length} \cdot \mathrm{energy}^{1/2}]$.
Source§

fn angular_momentum_mut(&mut self) -> &mut R::AngularMomentum

The mutable angular momentum of this site or body $[\mathrm{mass}^{1/2} \cdot \mathrm{length} \cdot \mathrm{energy}^{1/2}]$.
Source§

impl<V, R> Clone for DynamicOrientedPoint<V, R>

Source§

fn clone(&self) -> DynamicOrientedPoint<V, R>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<V, R> Debug for DynamicOrientedPoint<V, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<V> Default for DynamicOrientedPoint<V, Angle>
where V: Default + Wedge + Outer, V::Tensor: Default, V::Bivector: Default,

Source§

fn default() -> Self

Construct a DynamicOrientedPoint with mass 1.0 and moment of inertia 1.0. Position, orientation, momentum, angular momentum, net force, net virial, and net torque are set to 0.

§Example
use hoomd_linear_algebra::{GeneralMatrix, matrix::Matrix};
use hoomd_microstate::property::DynamicOrientedPoint;
use hoomd_vector::{Angle, Cartesian};

let dynamic_point = DynamicOrientedPoint::<Cartesian<2>, Angle>::default();
assert_eq!(dynamic_point.mass, 1.0);
assert_eq!(dynamic_point.moment_of_inertia, 1.0);
assert_eq!(dynamic_point.position, [0.0, 0.0].into());
assert_eq!(dynamic_point.orientation, 0.0.into());
assert_eq!(dynamic_point.momentum, [0.0, 0.0].into());
assert_eq!(dynamic_point.angular_momentum, 0.0.into());
assert_eq!(dynamic_point.net_force, [0.0, 0.0].into());
assert_eq!(dynamic_point.net_virial, Matrix::zeros());
assert_eq!(dynamic_point.net_torque, 0.0);
Source§

impl<V> Default for DynamicOrientedPoint<V, Versor>
where V: Default + Wedge + Outer, V::Bivector: Default,

Source§

fn default() -> Self

Construct a DynamicOrientedPoint with mass 1.0 and moment of inertia 1.0 on all axes. Position, momentum, angular momentum, net force, and net torque are set to 0. Orientation is set to the identity versor.

§Example
use hoomd_microstate::property::DynamicOrientedPoint;
use hoomd_vector::{Cartesian, Versor};

let dynamic_point = DynamicOrientedPoint::<Cartesian<3>, Versor>::default();
assert_eq!(dynamic_point.mass, 1.0);
assert_eq!(dynamic_point.moment_of_inertia, [1.0, 1.0, 1.0]);
assert_eq!(dynamic_point.position, [0.0, 0.0, 0.0].into());
assert_eq!(dynamic_point.orientation, Versor::default());
assert_eq!(dynamic_point.momentum, [0.0, 0.0, 0.0].into());
assert_eq!(dynamic_point.angular_momentum, [0.0, 0.0, 0.0].into());
assert_eq!(dynamic_point.net_force, [0.0, 0.0, 0.0].into());
assert_eq!(dynamic_point.net_torque, [0.0, 0.0, 0.0].into());
Source§

impl<'de, V, R> Deserialize<'de> for DynamicOrientedPoint<V, R>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<V, R> Mass for DynamicOrientedPoint<V, R>

Source§

fn mass(&self) -> f64

The mass of this body $[\mathrm{mass}]$.
Source§

impl<V, R> MomentOfInertia for DynamicOrientedPoint<V, R>

Source§

type MomentOfInertia = <R as RotationalMotionTypes>::MomentOfInertia

Type that expresses the moment of inertia.
Source§

fn moment_of_inertia(&self) -> &R::MomentOfInertia

The moment of inertia of this body $[\mathrm{mass} \cdot \mathrm{length}^2]$.
Source§

fn moment_of_inertia_mut(&mut self) -> &mut R::MomentOfInertia

The mutable moment of inertia of this body $[\mathrm{mass} \cdot \mathrm{length}^2]$.
Source§

impl<V, R> Momentum for DynamicOrientedPoint<V, R>
where V: Mul<f64, Output = V> + Div<f64, Output = V> + Copy + Wedge + Outer, R: RotationalMotionTypes,

Source§

type Momentum = V

Type that can express momentum and velocity.
Source§

fn momentum(&self) -> &V

The momentum of this body $[ \mathrm{energy}^{1/2} \cdot \mathrm{mass}^{1/2}]$.
Source§

fn momentum_mut(&mut self) -> &mut V

The mutable momentum of this body $[ \mathrm{energy}^{1/2} \cdot \mathrm{mass}^{1/2}]$.
Source§

fn velocity(&self) -> Self::Momentum

The velocity of this body $[ \mathrm{energy}^{1/2} \cdot \mathrm{mass}^{-1/2}]$.
Source§

fn set_velocity(&mut self, velocity: Self::Momentum)

Change the velocity of this body.
Source§

impl<V, R> NetForce for DynamicOrientedPoint<V, R>

Source§

type NetForce = V

Force vector type.
Source§

fn net_force(&self) -> &Self::NetForce

The net force on this body $[\mathrm{energy} \cdot \mathrm{length}^{-1}]$.
Source§

fn net_force_mut(&mut self) -> &mut Self::NetForce

The mutable net force on this body $[\mathrm{energy} \cdot \mathrm{length}^{-1}]$.
Source§

impl<V, R> NetTorque for DynamicOrientedPoint<V, R>

Source§

type NetTorque = <V as Wedge>::Bivector

Type that can express the net torque on a site or body.
Source§

fn net_torque(&self) -> &V::Bivector

The net torque on this site or body $[\mathrm{energy}]$.
Source§

fn net_torque_mut(&mut self) -> &mut V::Bivector

The mutable net torque on this site or body $[\mathrm{energy}]$.
Source§

impl<V, R> NetVirial for DynamicOrientedPoint<V, R>

Source§

type NetVirial = <V as Outer>::Tensor

Virial vector type.
Source§

fn net_virial(&self) -> &Self::NetVirial

The net virial on this body $[\mathrm{energy}]$.
Source§

fn net_virial_mut(&mut self) -> &mut Self::NetVirial

The mutable net virial on this body $[\mathrm{energy}]$.
Source§

impl<V, R> Orientation for DynamicOrientedPoint<V, R>

Source§

type Rotation = R

Type that can express the orientation of a site or body.
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).
Source§

impl<V, R> PartialEq for DynamicOrientedPoint<V, R>

Source§

fn eq(&self, other: &DynamicOrientedPoint<V, R>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<V, R> Position for DynamicOrientedPoint<V, R>

Source§

type Position = V

Every position is located in this vector space.
Source§

fn position(&self) -> &V

The position of this body or site $[\mathrm{length}]$.
Source§

fn position_mut(&mut self) -> &mut V

The mutable position of this body or site $[\mathrm{length}]$.
Source§

impl<V, R> Serialize for DynamicOrientedPoint<V, R>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<V, R> Transform<OrientedPoint<V, R>> for DynamicOrientedPoint<V, R>

Source§

fn transform( &self, site_properties: &OrientedPoint<V, R>, ) -> OrientedPoint<V, R>

Move OrientedPoint site properties from the local body frame to the system frame.

\vec{r} = \vec{r}_\mathrm{body} + R_\mathrm{body}(\vec{r}_\mathrm{site})
R = R_\mathrm{body}(R_\mathrm{site})
use approxim::assert_relative_eq;
use hoomd_microstate::{
    Transform,
    property::{DynamicOrientedPoint, OrientedPoint},
};
use hoomd_vector::{Angle, Cartesian};
use std::f64::consts::PI;

let body_properties = DynamicOrientedPoint {
    position: Cartesian::from([1.0, -2.0]),
    orientation: Angle::from(PI / 2.0),
    ..Default::default()
};
let site_properties = OrientedPoint {
    position: Cartesian::from([-1.0, 0.0]),
    orientation: Angle::from(PI / 4.0),
};

let system_site = body_properties.transform(&site_properties);
assert_relative_eq!(system_site.position, [1.0, -3.0].into());
assert_relative_eq!(system_site.orientation.theta, 3.0 * PI / 4.0);
Source§

impl<V, R> Transform<Point<V>> for DynamicOrientedPoint<V, R>

Source§

fn transform(&self, site_properties: &Point<V>) -> Point<V>

Move Point properties from the local body frame to the system frame.

\vec{r} = \vec{r}_\mathrm{body} + R_\mathrm{body}(\vec{r}_\mathrm{site})
use approxim::assert_relative_eq;
use hoomd_microstate::{
    Transform,
    property::{DynamicOrientedPoint, Point},
};
use hoomd_vector::{Angle, Cartesian};
use std::f64::consts::PI;

let body_properties = DynamicOrientedPoint {
    position: Cartesian::from([1.0, -2.0]),
    orientation: Angle::from(PI / 2.0),
    ..Default::default()
};
let site_properties = Point::new(Cartesian::from([-1.0, 0.0]));

let system_site = body_properties.transform(&site_properties);
assert_relative_eq!(system_site.position, [1.0, -3.0].into());
Source§

impl<V, R> Copy for DynamicOrientedPoint<V, R>

Source§

impl<V, R> StructuralPartialEq for DynamicOrientedPoint<V, R>

Auto Trait Implementations§

§

impl<V, R> Freeze for DynamicOrientedPoint<V, R>

§

impl<V, R> RefUnwindSafe for DynamicOrientedPoint<V, R>

§

impl<V, R> Send for DynamicOrientedPoint<V, R>

§

impl<V, R> Sync for DynamicOrientedPoint<V, R>

§

impl<V, R> Unpin for DynamicOrientedPoint<V, R>

§

impl<V, R> UnsafeUnpin for DynamicOrientedPoint<V, R>

§

impl<V, R> UnwindSafe for DynamicOrientedPoint<V, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,