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: VThe location of the extended body in space $[\mathrm{length}]$.
orientation: RRotate from the body’s reference frame to the system frame.
mass: f64The mass of the extended body $[\mathrm{mass}]$.
momentum: VThe translational momentum of the extended body $[ \mathrm{energy}^{1/2} \cdot \mathrm{mass}^{1/2}]$.
net_force: VThe net force applied to the body in a Microstate $[ \mathrm{energy}^{1/2} \cdot \mathrm{mass}^{1/2}]$.
net_virial: V::TensorThe net virial applied to the body in a Microstate $[\mathrm{energy}]$.
moment_of_inertia: R::MomentOfInertiaThe moment of inertia of the extended body $[\mathrm{mass} \cdot \mathrm{length}^2]$.
angular_momentum: R::AngularMomentumThe angular momentum of the extended body $[\mathrm{mass} \cdot \mathrm{length}^2]$.
net_torque: V::BivectorThe net torque applied to the body by others in a Microstate $[\mathrm{energy}]$.
Trait Implementations§
Source§impl<V, R> AngularMomentum for DynamicOrientedPoint<V, R>
impl<V, R> AngularMomentum for DynamicOrientedPoint<V, R>
Source§type AngularMomentum = <R as RotationalMotionTypes>::AngularMomentum
type AngularMomentum = <R as RotationalMotionTypes>::AngularMomentum
Source§fn angular_momentum(&self) -> &R::AngularMomentum
fn angular_momentum(&self) -> &R::AngularMomentum
[\mathrm{mass}^{1/2} \cdot \mathrm{length} \cdot \mathrm{energy}^{1/2}]$.Source§fn angular_momentum_mut(&mut self) -> &mut R::AngularMomentum
fn angular_momentum_mut(&mut self) -> &mut R::AngularMomentum
[\mathrm{mass}^{1/2} \cdot \mathrm{length} \cdot \mathrm{energy}^{1/2}]$.Source§impl<V, R> Clone for DynamicOrientedPoint<V, R>where
V: Wedge + Outer + Clone,
R: RotationalMotionTypes + Clone,
V::Tensor: Clone,
R::MomentOfInertia: Clone,
R::AngularMomentum: Clone,
V::Bivector: Clone,
impl<V, R> Clone for DynamicOrientedPoint<V, R>where
V: Wedge + Outer + Clone,
R: RotationalMotionTypes + Clone,
V::Tensor: Clone,
R::MomentOfInertia: Clone,
R::AngularMomentum: Clone,
V::Bivector: Clone,
Source§fn clone(&self) -> DynamicOrientedPoint<V, R>
fn clone(&self) -> DynamicOrientedPoint<V, R>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<V, R> Debug for DynamicOrientedPoint<V, R>where
V: Wedge + Outer + Debug,
R: RotationalMotionTypes + Debug,
V::Tensor: Debug,
R::MomentOfInertia: Debug,
R::AngularMomentum: Debug,
V::Bivector: Debug,
impl<V, R> Debug for DynamicOrientedPoint<V, R>where
V: Wedge + Outer + Debug,
R: RotationalMotionTypes + Debug,
V::Tensor: Debug,
R::MomentOfInertia: Debug,
R::AngularMomentum: Debug,
V::Bivector: Debug,
Source§impl<V> Default for DynamicOrientedPoint<V, Angle>
impl<V> Default for DynamicOrientedPoint<V, Angle>
Source§fn default() -> Self
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>
impl<V> Default for DynamicOrientedPoint<V, Versor>
Source§fn default() -> Self
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>where
V: Wedge + Outer + Deserialize<'de>,
R: RotationalMotionTypes + Deserialize<'de>,
V::Tensor: Deserialize<'de>,
R::MomentOfInertia: Deserialize<'de>,
R::AngularMomentum: Deserialize<'de>,
V::Bivector: Deserialize<'de>,
impl<'de, V, R> Deserialize<'de> for DynamicOrientedPoint<V, R>where
V: Wedge + Outer + Deserialize<'de>,
R: RotationalMotionTypes + Deserialize<'de>,
V::Tensor: Deserialize<'de>,
R::MomentOfInertia: Deserialize<'de>,
R::AngularMomentum: Deserialize<'de>,
V::Bivector: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<V, R> Mass for DynamicOrientedPoint<V, R>
impl<V, R> Mass for DynamicOrientedPoint<V, R>
Source§impl<V, R> MomentOfInertia for DynamicOrientedPoint<V, R>
impl<V, R> MomentOfInertia for DynamicOrientedPoint<V, R>
Source§type MomentOfInertia = <R as RotationalMotionTypes>::MomentOfInertia
type MomentOfInertia = <R as RotationalMotionTypes>::MomentOfInertia
Source§fn moment_of_inertia(&self) -> &R::MomentOfInertia
fn moment_of_inertia(&self) -> &R::MomentOfInertia
[\mathrm{mass} \cdot \mathrm{length}^2]$.Source§fn moment_of_inertia_mut(&mut self) -> &mut R::MomentOfInertia
fn moment_of_inertia_mut(&mut self) -> &mut R::MomentOfInertia
[\mathrm{mass} \cdot \mathrm{length}^2]$.Source§impl<V, R> Momentum for DynamicOrientedPoint<V, R>
impl<V, R> Momentum for DynamicOrientedPoint<V, R>
Source§fn momentum(&self) -> &V
fn momentum(&self) -> &V
[ \mathrm{energy}^{1/2} \cdot \mathrm{mass}^{1/2}]$.Source§fn momentum_mut(&mut self) -> &mut V
fn momentum_mut(&mut self) -> &mut V
[ \mathrm{energy}^{1/2} \cdot \mathrm{mass}^{1/2}]$.Source§fn velocity(&self) -> Self::Momentum
fn velocity(&self) -> Self::Momentum
[ \mathrm{energy}^{1/2} \cdot \mathrm{mass}^{-1/2}]$.Source§fn set_velocity(&mut self, velocity: Self::Momentum)
fn set_velocity(&mut self, velocity: Self::Momentum)
Source§impl<V, R> NetForce for DynamicOrientedPoint<V, R>
impl<V, R> NetForce for DynamicOrientedPoint<V, R>
Source§impl<V, R> NetTorque for DynamicOrientedPoint<V, R>
impl<V, R> NetTorque for DynamicOrientedPoint<V, R>
Source§type NetTorque = <V as Wedge>::Bivector
type NetTorque = <V as Wedge>::Bivector
Source§fn net_torque(&self) -> &V::Bivector
fn net_torque(&self) -> &V::Bivector
[\mathrm{energy}]$.Source§fn net_torque_mut(&mut self) -> &mut V::Bivector
fn net_torque_mut(&mut self) -> &mut V::Bivector
[\mathrm{energy}]$.Source§impl<V, R> NetVirial for DynamicOrientedPoint<V, R>
impl<V, R> NetVirial for DynamicOrientedPoint<V, R>
Source§impl<V, R> Orientation for DynamicOrientedPoint<V, R>
impl<V, R> Orientation for DynamicOrientedPoint<V, R>
Source§impl<V, R> PartialEq for DynamicOrientedPoint<V, R>where
V: Wedge + Outer + PartialEq,
R: RotationalMotionTypes + PartialEq,
V::Tensor: PartialEq,
R::MomentOfInertia: PartialEq,
R::AngularMomentum: PartialEq,
V::Bivector: PartialEq,
impl<V, R> PartialEq for DynamicOrientedPoint<V, R>where
V: Wedge + Outer + PartialEq,
R: RotationalMotionTypes + PartialEq,
V::Tensor: PartialEq,
R::MomentOfInertia: PartialEq,
R::AngularMomentum: PartialEq,
V::Bivector: PartialEq,
Source§impl<V, R> Position for DynamicOrientedPoint<V, R>
impl<V, R> Position for DynamicOrientedPoint<V, R>
Source§impl<V, R> Serialize for DynamicOrientedPoint<V, R>where
V: Wedge + Outer + Serialize,
R: RotationalMotionTypes + Serialize,
V::Tensor: Serialize,
R::MomentOfInertia: Serialize,
R::AngularMomentum: Serialize,
V::Bivector: Serialize,
impl<V, R> Serialize for DynamicOrientedPoint<V, R>where
V: Wedge + Outer + Serialize,
R: RotationalMotionTypes + Serialize,
V::Tensor: Serialize,
R::MomentOfInertia: Serialize,
R::AngularMomentum: Serialize,
V::Bivector: Serialize,
Source§impl<V, R> Transform<OrientedPoint<V, R>> for DynamicOrientedPoint<V, R>
impl<V, R> Transform<OrientedPoint<V, R>> for DynamicOrientedPoint<V, R>
Source§fn transform(
&self,
site_properties: &OrientedPoint<V, R>,
) -> OrientedPoint<V, R>
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>
impl<V, R> Transform<Point<V>> for DynamicOrientedPoint<V, R>
Source§fn transform(&self, site_properties: &Point<V>) -> Point<V>
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());impl<V, R> Copy for DynamicOrientedPoint<V, R>where
V: Wedge + Outer + Copy,
R: RotationalMotionTypes + Copy,
V::Tensor: Copy,
R::MomentOfInertia: Copy,
R::AngularMomentum: Copy,
V::Bivector: Copy,
impl<V, R> StructuralPartialEq for DynamicOrientedPoint<V, R>
Auto Trait Implementations§
impl<V, R> Freeze for DynamicOrientedPoint<V, R>where
V: Freeze,
R: Freeze,
<V as Outer>::Tensor: Freeze,
<R as RotationalMotionTypes>::MomentOfInertia: Freeze,
<R as RotationalMotionTypes>::AngularMomentum: Freeze,
<V as Wedge>::Bivector: Freeze,
impl<V, R> RefUnwindSafe for DynamicOrientedPoint<V, R>where
V: RefUnwindSafe,
R: RefUnwindSafe,
<V as Outer>::Tensor: RefUnwindSafe,
<R as RotationalMotionTypes>::MomentOfInertia: RefUnwindSafe,
<R as RotationalMotionTypes>::AngularMomentum: RefUnwindSafe,
<V as Wedge>::Bivector: RefUnwindSafe,
impl<V, R> Send for DynamicOrientedPoint<V, R>where
V: Send,
R: Send,
<V as Outer>::Tensor: Send,
<R as RotationalMotionTypes>::MomentOfInertia: Send,
<R as RotationalMotionTypes>::AngularMomentum: Send,
<V as Wedge>::Bivector: Send,
impl<V, R> Sync for DynamicOrientedPoint<V, R>where
V: Sync,
R: Sync,
<V as Outer>::Tensor: Sync,
<R as RotationalMotionTypes>::MomentOfInertia: Sync,
<R as RotationalMotionTypes>::AngularMomentum: Sync,
<V as Wedge>::Bivector: Sync,
impl<V, R> Unpin for DynamicOrientedPoint<V, R>where
V: Unpin,
R: Unpin,
<V as Outer>::Tensor: Unpin,
<R as RotationalMotionTypes>::MomentOfInertia: Unpin,
<R as RotationalMotionTypes>::AngularMomentum: Unpin,
<V as Wedge>::Bivector: Unpin,
impl<V, R> UnsafeUnpin for DynamicOrientedPoint<V, R>where
V: UnsafeUnpin,
R: UnsafeUnpin,
<V as Outer>::Tensor: UnsafeUnpin,
<R as RotationalMotionTypes>::MomentOfInertia: UnsafeUnpin,
<R as RotationalMotionTypes>::AngularMomentum: UnsafeUnpin,
<V as Wedge>::Bivector: UnsafeUnpin,
impl<V, R> UnwindSafe for DynamicOrientedPoint<V, R>where
V: UnwindSafe,
R: UnwindSafe,
<V as Outer>::Tensor: UnwindSafe,
<R as RotationalMotionTypes>::MomentOfInertia: UnwindSafe,
<R as RotationalMotionTypes>::AngularMomentum: UnwindSafe,
<V as Wedge>::Bivector: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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