pub struct DynamicPoint<V>where
V: Outer,{
pub position: V,
pub mass: f64,
pub momentum: V,
pub net_force: V,
pub net_virial: V::Tensor,
}Expand description
A position in space with the properties necessary for translational motion in MD.
Use DynamicPoint as a Body property type.
A default DynamicPoint has a mass of 1.0. Position, momentum, and net force
of $\vec{0}$, and a zero-tensor for net virial.
§Example
use hoomd_microstate::property::DynamicPoint;
use hoomd_vector::Cartesian;
let dynamic_point = DynamicPoint {
position: Cartesian::from([1.0, -3.0]),
mass: 1.0,
..Default::default()
};Fields§
§position: VThe location of the extended body in space $[\mathrm{length}]$.
mass: f64The mass of the extended body $[\mathrm{mass}]$.
momentum: VThe translational momentum of the extended body $[\mathrm{mass} \cdot \mathrm{length}] \cdot \mathrm{time}^{-1}]$.
net_force: VThe net force applied to the body in a Microstate $[\mathrm{mass} \cdot \mathrm{length}] \cdot \mathrm{time}^{-2}]$.
net_virial: V::TensorThe net virial applied to the body in a Microstate $[\mathrm{energy}]$.
Trait Implementations§
Source§impl<V> Clone for DynamicPoint<V>
impl<V> Clone for DynamicPoint<V>
Source§fn clone(&self) -> DynamicPoint<V>
fn clone(&self) -> DynamicPoint<V>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<V> Debug for DynamicPoint<V>
impl<V> Debug for DynamicPoint<V>
Source§impl<V> Default for DynamicPoint<V>
impl<V> Default for DynamicPoint<V>
Source§fn default() -> Self
fn default() -> Self
Construct a DynamicPoint with mass 1.0. Position, momentum, and net force are set
to the 0 vector.
§Example
use hoomd_linear_algebra::{GeneralMatrix, matrix::Matrix};
use hoomd_microstate::property::DynamicPoint;
use hoomd_vector::Cartesian;
let dynamic_point = DynamicPoint::<Cartesian<3>>::default();
assert_eq!(dynamic_point.mass, 1.0);
assert_eq!(dynamic_point.position, [0.0, 0.0, 0.0].into());
assert_eq!(dynamic_point.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_virial, Matrix::zeros());Source§impl<'de, V> Deserialize<'de> for DynamicPoint<V>
impl<'de, V> Deserialize<'de> for DynamicPoint<V>
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: Outer> Mass for DynamicPoint<V>
impl<V: Outer> Mass for DynamicPoint<V>
Source§impl<V> Momentum for DynamicPoint<V>
impl<V> Momentum for DynamicPoint<V>
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: Outer> NetForce for DynamicPoint<V>
impl<V: Outer> NetForce for DynamicPoint<V>
Source§impl<V: Outer> NetVirial for DynamicPoint<V>
impl<V: Outer> NetVirial for DynamicPoint<V>
Source§impl<V> PartialEq for DynamicPoint<V>
impl<V> PartialEq for DynamicPoint<V>
Source§impl<P: Outer> Position for DynamicPoint<P>
impl<P: Outer> Position for DynamicPoint<P>
Source§impl<V> Serialize for DynamicPoint<V>
impl<V> Serialize for DynamicPoint<V>
Source§impl<V, R> Transform<OrientedPoint<V, R>> for DynamicPoint<V>
impl<V, R> Transform<OrientedPoint<V, R>> for DynamicPoint<V>
Source§fn transform(
&self,
site_properties: &OrientedPoint<V, R>,
) -> OrientedPoint<V, R>
fn transform( &self, site_properties: &OrientedPoint<V, R>, ) -> OrientedPoint<V, R>
DynamicPoint transforms OrientedPoint by vector addition.
\vec{r} = \vec{r}_\mathrm{body} + \vec{r}_\mathrm{site}use approxim::assert_relative_eq;
use hoomd_microstate::{
Transform,
property::{DynamicPoint, OrientedPoint},
};
use hoomd_vector::{Cartesian, Versor};
let body_properties = DynamicPoint {
position: Cartesian::from([1.0, -2.0, 3.0]),
..Default::default()
};
let site_properties = OrientedPoint {
position: Cartesian::from([-3.0, 2.0, 1.0]),
orientation: Versor::default(),
};
let system_site = body_properties.transform(&site_properties);
assert_relative_eq!(system_site.position, [-2.0, 0.0, 4.0].into());Source§impl<V: Vector + Outer> Transform<Point<V>> for DynamicPoint<V>
impl<V: Vector + Outer> Transform<Point<V>> for DynamicPoint<V>
Source§fn transform(&self, site_properties: &Point<V>) -> Point<V>
fn transform(&self, site_properties: &Point<V>) -> Point<V>
DynamicPoint transforms Point by vector addition.
\vec{r} = \vec{r}_\mathrm{body} + \vec{r}_\mathrm{site}use approxim::assert_relative_eq;
use hoomd_microstate::{
Transform,
property::{DynamicPoint, Point},
};
use hoomd_vector::Cartesian;
let body_properties = DynamicPoint {
position: Cartesian::from([1.0, -2.0, 3.0]),
..Default::default()
};
let site_properties = Point::new(Cartesian::from([-3.0, 2.0, 1.0]));
let system_site = body_properties.transform(&site_properties);
assert_relative_eq!(system_site.position, [-2.0, 0.0, 4.0].into());impl<V> Copy for DynamicPoint<V>
impl<V> StructuralPartialEq for DynamicPoint<V>where
V: Outer,
Auto Trait Implementations§
impl<V> Freeze for DynamicPoint<V>
impl<V> RefUnwindSafe for DynamicPoint<V>
impl<V> Send for DynamicPoint<V>
impl<V> Sync for DynamicPoint<V>
impl<V> Unpin for DynamicPoint<V>
impl<V> UnsafeUnpin for DynamicPoint<V>
impl<V> UnwindSafe for DynamicPoint<V>
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