Skip to main content

DynamicPoint

Struct DynamicPoint 

Source
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: V

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

§mass: f64

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

§momentum: V

The translational momentum of the extended body $[\mathrm{mass} \cdot \mathrm{length}] \cdot \mathrm{time}^{-1}]$.

§net_force: V

The net force applied to the body in a Microstate $[\mathrm{mass} \cdot \mathrm{length}] \cdot \mathrm{time}^{-2}]$.

§net_virial: V::Tensor

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

Trait Implementations§

Source§

impl<V> Clone for DynamicPoint<V>
where V: Outer + Clone, V::Tensor: Clone,

Source§

fn clone(&self) -> DynamicPoint<V>

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> Debug for DynamicPoint<V>
where V: Outer + Debug, V::Tensor: Debug,

Source§

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

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

impl<V> Default for DynamicPoint<V>
where V: Default + Outer, V::Tensor: Default,

Source§

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>
where V: Outer + Deserialize<'de>, V::Tensor: Deserialize<'de>,

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: Outer> Mass for DynamicPoint<V>

Source§

fn mass(&self) -> f64

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

impl<V> Momentum for DynamicPoint<V>
where V: Mul<f64, Output = V> + Div<f64, Output = V> + Copy + Outer,

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: Outer> NetForce for DynamicPoint<V>

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: Outer> NetVirial for DynamicPoint<V>

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> PartialEq for DynamicPoint<V>
where V: Outer + PartialEq, V::Tensor: PartialEq,

Source§

fn eq(&self, other: &DynamicPoint<V>) -> 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<P: Outer> Position for DynamicPoint<P>

Source§

type Position = P

Every position is located in this vector space.
Source§

fn position(&self) -> &P

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

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

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

impl<V> Serialize for DynamicPoint<V>
where V: Outer + Serialize, V::Tensor: Serialize,

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 DynamicPoint<V>
where V: Vector + Outer, R: Copy,

Source§

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>

Source§

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());
Source§

impl<V> Copy for DynamicPoint<V>
where V: Outer + Copy, V::Tensor: Copy,

Source§

impl<V> StructuralPartialEq for DynamicPoint<V>
where V: Outer,

Auto Trait Implementations§

§

impl<V> Freeze for DynamicPoint<V>
where V: Freeze, <V as Outer>::Tensor: Freeze,

§

impl<V> RefUnwindSafe for DynamicPoint<V>

§

impl<V> Send for DynamicPoint<V>
where V: Send, <V as Outer>::Tensor: Send,

§

impl<V> Sync for DynamicPoint<V>
where V: Sync, <V as Outer>::Tensor: Sync,

§

impl<V> Unpin for DynamicPoint<V>
where V: Unpin, <V as Outer>::Tensor: Unpin,

§

impl<V> UnsafeUnpin for DynamicPoint<V>
where V: UnsafeUnpin, <V as Outer>::Tensor: UnsafeUnpin,

§

impl<V> UnwindSafe for DynamicPoint<V>
where V: UnwindSafe, <V as Outer>::Tensor: UnwindSafe,

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,