pub struct ConstantVolume<TT, TR = TT> {
pub delta_t: f64,
pub translational_thermostat: TT,
pub rotational_thermostat: TR,
}Expand description
Integrate bodies’ translational and rotational degrees of freedom in the microstate.
The ConstantVolume implementation follows the symplectic integration
scheme by Tuckerman et al. 2006 for translational motion and Miller et
al. 2002 for rotational motion.
Use NoThermostat to integrate trajectories that sample the microcanonical ensemble:
use hoomd_md::method::ConstantVolume;
let delta_t = 0.001;
let constant_volume = ConstantVolume::builder(delta_t).build();Use Bussi (or one of the other thermostats) to integrate trajectories that sample
the canonical ensemble:
use hoomd_md::{method::ConstantVolume, thermostat::Bussi};
let delta_t = 0.001;
let constant_volume = ConstantVolume::builder(delta_t)
.thermostat(Bussi::default())
.build();§Reference
Fields§
§delta_t: f64The time step size.
translational_thermostat: TTTranslational thermostat.
rotational_thermostat: TRRotational thermostat.
Implementations§
Source§impl ConstantVolume<NoThermostat, NoThermostat>
impl ConstantVolume<NoThermostat, NoThermostat>
Sourcepub fn builder(
delta_t: f64,
) -> ConstantVolumeBuilder<NoThermostat, NoThermostat>
pub fn builder( delta_t: f64, ) -> ConstantVolumeBuilder<NoThermostat, NoThermostat>
Start building a new ConstantVolume.
The default builder uses the given value for delta_t and NoThermostat
for both the translational and rotational thermostats. Call zero or more
of the ConstantVolumeBuilder methods to set the thermostats.
§Example
use hoomd_md::method::ConstantVolume;
let delta_t = 0.001;
let constant_volume = ConstantVolume::builder(delta_t).build();Source§impl<TT, TR> ConstantVolume<TT, TR>
impl<TT, TR> ConstantVolume<TT, TR>
Sourcepub fn translational_thermostat(&self) -> &TT
pub fn translational_thermostat(&self) -> &TT
Access the translational thermostat.
Sourcepub fn translational_thermostat_mut(&mut self) -> &mut TT
pub fn translational_thermostat_mut(&mut self) -> &mut TT
Access the translational thermostat (mutable).
Sourcepub fn rotational_thermostat(&self) -> &TR
pub fn rotational_thermostat(&self) -> &TR
Access the rotational thermostat.
Sourcepub fn rotational_thermostat_mut(&mut self) -> &mut TR
pub fn rotational_thermostat_mut(&mut self) -> &mut TR
Access the rotational thermostat (mutable).
Trait Implementations§
Source§impl<TT: Clone, TR: Clone> Clone for ConstantVolume<TT, TR>
impl<TT: Clone, TR: Clone> Clone for ConstantVolume<TT, TR>
Source§fn clone(&self) -> ConstantVolume<TT, TR>
fn clone(&self) -> ConstantVolume<TT, TR>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, TT, TR> Deserialize<'de> for ConstantVolume<TT, TR>where
TT: Deserialize<'de>,
TR: Deserialize<'de>,
impl<'de, TT, TR> Deserialize<'de> for ConstantVolume<TT, TR>where
TT: Deserialize<'de>,
TR: 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<S, X, C, TT, TR, M> RotationalMotion<DynamicOrientedPoint<Cartesian<2>, Angle>, S, X, C, M> for ConstantVolume<TT, TR>where
DynamicOrientedPoint<Cartesian<2>, Angle>: Transform<S>,
S: Position<Position = Cartesian<2>> + Default,
X: PointUpdate<Cartesian<2>, SiteKey>,
C: Wrap<DynamicOrientedPoint<Cartesian<2>, Angle>> + Wrap<S> + GenerateGhosts<S>,
TR: Thermostat<M>,
Rotational motion in 2-dimensional cartesian space.
impl<S, X, C, TT, TR, M> RotationalMotion<DynamicOrientedPoint<Cartesian<2>, Angle>, S, X, C, M> for ConstantVolume<TT, TR>where
DynamicOrientedPoint<Cartesian<2>, Angle>: Transform<S>,
S: Position<Position = Cartesian<2>> + Default,
X: PointUpdate<Cartesian<2>, SiteKey>,
C: Wrap<DynamicOrientedPoint<Cartesian<2>, Angle>> + Wrap<S> + GenerateGhosts<S>,
TR: Thermostat<M>,
Rotational motion in 2-dimensional cartesian space.
Source§fn integrate_rotation_half_step_one_with_filter<F: Fn(&Tagged<Body<DynamicOrientedPoint<Cartesian<2>, Angle>, S>>) -> bool>(
&mut self,
microstate: &mut Microstate<DynamicOrientedPoint<Cartesian<2>, Angle>, S, X, C>,
macrostate: &M,
should_integrate_body: F,
)
fn integrate_rotation_half_step_one_with_filter<F: Fn(&Tagged<Body<DynamicOrientedPoint<Cartesian<2>, Angle>, S>>) -> bool>( &mut self, microstate: &mut Microstate<DynamicOrientedPoint<Cartesian<2>, Angle>, S, X, C>, macrostate: &M, should_integrate_body: F, )
Integrate selected body orientations forward a full step and their angular momenta forward a half step.
The first half step of the symplectic integration procedure is given by the equations below, which are
applied to each selected body i. In each step, the marker $'$ is used when a variable’s value changes
during a step to distinguish the value before ( $'$ is present) from the value after ( $'$ is absent).
Selected bodies which have moment_of_inertia = 0.0 are skipped.
-
The rotational thermostat is integrated forward a half-step and then angular momentum is rescaled accordingly:
L_i(t) = L'_i(t) \cdot \mathrm{rotational\_thermostat.integrate\_half\_step\_one}\left(\sum_{j \in \mathrm{selection}} K'_{rot,j}(t) \right)where the summation represents the total rotational kinetic energy of the selected bodies at the start of the step, and
rotational_thermostat.integrate_half_step_one()is the first half step method implemented byTR. -
Angular momentum is integrated forward a half step.
L_i\left(t + \frac{\Delta t}{2} \right) = L_i(t) + \tau_i(t) \frac{\Delta t}{2} -
Orientation is integrated forward a full step using the new angular momentum.
\theta_i(t + \Delta t) = \theta_i(t) + \frac{L_i\left( t + \frac{\Delta t}{2} \right)}{I_i} \Delta t
Source§fn integrate_rotation_half_step_two_with_filter<F: Fn(&Tagged<Body<DynamicOrientedPoint<Cartesian<2>, Angle>, S>>) -> bool>(
&mut self,
microstate: &mut Microstate<DynamicOrientedPoint<Cartesian<2>, Angle>, S, X, C>,
macrostate: &M,
should_integrate_body: F,
)
fn integrate_rotation_half_step_two_with_filter<F: Fn(&Tagged<Body<DynamicOrientedPoint<Cartesian<2>, Angle>, S>>) -> bool>( &mut self, microstate: &mut Microstate<DynamicOrientedPoint<Cartesian<2>, Angle>, S, X, C>, macrostate: &M, should_integrate_body: F, )
Integrate selected body angular momenta forward a half step.
The second half step of the symplectic integration procedure is given by the equations below, which are
applied to each selected body i. In each step, the marker $'$ is used when a variable’s value changes
during a step to distinguish the value before ( $'$ is present) from the value after ( $'$ is absent).
Selected bodies which have moment_of_inertia = 0.0 are skipped.
-
Angular momentum is integrated forward a half step.
L_i(t + \Delta t) = L_i\left( t + \frac{\Delta t}{2} \right) + \tau_i \left(t + \frac{\Delta t}{2} \right) \frac{\Delta t}{2} -
The rotational thermostat is integrated forward a half step and then angular momentum is rescaled accordingly.
L_i(t + \Delta t) = L'_i(t + \Delta t) \cdot \mathrm{rotational\_thermostat.integrate\_half\_step\_two}\left(\sum_{j \in \mathrm{selection}}K'_{rot,j}(t + \Delta t) \right)where the summation represents the total rotational kinetic energy of the selected bodies at the start of the step, and
rotational_thermostat.integrate_half_step_two()is the second half step method implemented byTR.
Source§fn integrate_rotation_half_step_one(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
)
fn integrate_rotation_half_step_one( &mut self, microstate: &mut Microstate<B, S, X, C>, macrostate: &M, )
Source§fn integrate_rotation_half_step_two(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
)
fn integrate_rotation_half_step_two( &mut self, microstate: &mut Microstate<B, S, X, C>, macrostate: &M, )
Source§fn integrate_translation_and_rotation_with_filter<E, F>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
interaction_model: &E,
should_integrate_body: F,
)where
F: Fn(&Tagged<Body<B, S>>) -> bool,
Microstate<B, S, X, C>: UpdateNetForceVirialAndTorque<E>,
Self: TranslationalMotion<B, S, X, C, M>,
fn integrate_translation_and_rotation_with_filter<E, F>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
interaction_model: &E,
should_integrate_body: F,
)where
F: Fn(&Tagged<Body<B, S>>) -> bool,
Microstate<B, S, X, C>: UpdateNetForceVirialAndTorque<E>,
Self: TranslationalMotion<B, S, X, C, M>,
Source§fn integrate_translation_and_rotation<E>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
interaction_model: &E,
)where
Microstate<B, S, X, C>: UpdateNetForceVirialAndTorque<E>,
Self: TranslationalMotion<B, S, X, C, M>,
fn integrate_translation_and_rotation<E>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
interaction_model: &E,
)where
Microstate<B, S, X, C>: UpdateNetForceVirialAndTorque<E>,
Self: TranslationalMotion<B, S, X, C, M>,
Source§impl<S, X, C, TT, TR, M> RotationalMotion<DynamicOrientedPoint<Cartesian<3>, Versor>, S, X, C, M> for ConstantVolume<TT, TR>where
DynamicOrientedPoint<Cartesian<3>, Versor>: Transform<S>,
S: Position<Position = Cartesian<3>> + Default,
X: PointUpdate<Cartesian<3>, SiteKey>,
C: Wrap<DynamicOrientedPoint<Cartesian<3>, Versor>> + Wrap<S> + GenerateGhosts<S>,
TR: Thermostat<M>,
Rotational motion in 3-dimensional cartesian space.
impl<S, X, C, TT, TR, M> RotationalMotion<DynamicOrientedPoint<Cartesian<3>, Versor>, S, X, C, M> for ConstantVolume<TT, TR>where
DynamicOrientedPoint<Cartesian<3>, Versor>: Transform<S>,
S: Position<Position = Cartesian<3>> + Default,
X: PointUpdate<Cartesian<3>, SiteKey>,
C: Wrap<DynamicOrientedPoint<Cartesian<3>, Versor>> + Wrap<S> + GenerateGhosts<S>,
TR: Thermostat<M>,
Rotational motion in 3-dimensional cartesian space.
Source§fn integrate_rotation_half_step_one_with_filter<F: Fn(&Tagged<Body<DynamicOrientedPoint<Cartesian<3>, Versor>, S>>) -> bool>(
&mut self,
microstate: &mut Microstate<DynamicOrientedPoint<Cartesian<3>, Versor>, S, X, C>,
macrostate: &M,
should_integrate_body: F,
)
fn integrate_rotation_half_step_one_with_filter<F: Fn(&Tagged<Body<DynamicOrientedPoint<Cartesian<3>, Versor>, S>>) -> bool>( &mut self, microstate: &mut Microstate<DynamicOrientedPoint<Cartesian<3>, Versor>, S, X, C>, macrostate: &M, should_integrate_body: F, )
Integrate selected body orientations forward a full step and their angular momenta forward a half step.
The first half step of the symplectic integration procedure is given by the equations below, which are
applied to each selected body i. In each step, the marker $'$ is used when a variable’s value changes
during a step to distinguish the value before ( $'$ is present) from the value after ( $'$ is absent).
Rotational degrees of freedom with a moment of inertia component of zero are skipped.
-
The rotational thermostat is integrated forward a half-step and then angular momentum is rescaled accordingly:
\vec{L}_i(t) = \vec{L}'_i(t) \cdot \mathrm{rotational\_thermostat.integrate\_half\_step\_one}\left(\sum_{j \in \mathrm{selection}} K'_{rot,j}(t) \right)where the summation represents the total rotational kinetic energy of the selected bodies at the start of the step, and
rotational_thermostat.integrate_half_step_one()is the first half step method implemented byTR. -
Angular momentum $
\vec{L}$ and orientation $\mathbf{q}$ are integrated forward. These integrations follow a complex, multi-step process, so a fuller explanation is provided below. In each step, the body index i and time t are implicit on every variable unless otherwise specified.-
Angular momentum and net torque are converted to quaternions $
\mathbf{p}$ and $\mathbf{f}$, respectively:\begin{align*} \mathbf{p} &= 2\mathbf{S}(\mathbf{q}) \mathbf{L} \\ \mathbf{f} &= 2\mathbf{S}(\mathbf{q}) \boldsymbol{\tau} \\ \end{align*}where
\begin{align*} \mathbf{L} &= (0, L_x, L_y, L_z) \\ \boldsymbol{\tau} &= (0, \tau_x, \tau_y, \tau_z) \\ \mathbf{S}(\mathbf{q}) &= \begin{pmatrix} q_0 & -q_1 & -q_2 & -q_3\\ q_1 & q_0 & -q_3 & q_2\\ q_2 & q_3 & q_0 & -q_1\\ q_3 & -q_2 & q_1 & q_0 \end{pmatrix} \end{align*} -
$
\mathbf{p}$ and $\mathbf{q}$ are integrated forward using the novel symplectic quaternion scheme (NO_SQUISH) algorithm, which ensures the integration is both symplectic and preserves orientation quaternion unity. There are several steps to this algorithm, whose equations are given below.-
$
\mathbf{p}$ is partially integrated forward a half step.\mathbf{p} = \mathbf{p}' + \frac{\Delta t}{2} \mathbf{f} -
$
\mathbf{p}$ is integrated forward the remainder of the half step and $\mathbf{q}$ is integrated forward a full step. Properties of quaternion algebra are used to decompose the Liouvillian into a sum over permutation matrices applied to $\mathbf{q}$ and $\mathbf{p}$. There are five steps to this decomposition:\begin{align*} \phi_3 &= \frac{1}{4 I_{33}} \mathrm{dot} \left( \mathbf{p}, P_3 \mathbf{q} \right) \\ \mathbf{q} &= \cos{(\phi_3 \frac{\Delta t}{2})} \mathbf{q}^{'} + \sin{(\phi_3 \frac{\Delta t}{2})} P_3 \mathbf{q}^{'} \nonumber \\ \mathbf{p} &= \cos{(\phi_3 \frac{\Delta t}{2})} \mathbf{p}' + \sin{(\phi_3 \frac{\Delta t}{2})} P_3 \mathbf{p}' \nonumber \\ \nonumber \\ \phi_2 &= \frac{1}{4 I_{22}} \mathrm{dot} \left( \mathbf{p}, P_2 \mathbf{q} \right) \\ \mathbf{q} &= \cos{(\phi_2 \frac{\Delta t}{2})} \mathbf{q}^{'} + \sin{(\phi_2 \frac{\Delta t}{2})} P_2 \mathbf{q}^{'} \nonumber \\ \mathbf{p} &= \cos{(\phi_2 \frac{\Delta t}{2})} \mathbf{p}' + \sin{(\phi_2 \frac{\Delta t}{2})} P_2 \mathbf{p}' \nonumber \\ \nonumber \\ \phi_1 &= \frac{1}{4 I_{11}} \mathrm{dot} \left( \mathbf{p}, P_1 \mathbf{q} \right) \\ \mathbf{q} &= \cos{(\phi_1 \Delta t)} \mathbf{q}^{'} + \sin{(\phi_1 \Delta t)} P_1 \mathbf{q}^{'} \nonumber \\ \mathbf{p} &= \cos{(\phi_1 \Delta t)} \mathbf{p}' + \sin{(\phi_1 \Delta t)} P_1 \mathbf{p}' \nonumber \nonumber \\ \nonumber \\ \phi_2 &= \frac{1}{4 I_{22}} \mathrm{dot} \left( \mathbf{p}, P_2 \mathbf{q} \right) \\ \mathbf{q} &= \cos{(\phi_2 \frac{\Delta t}{2})} \mathbf{q}^{'} + \sin{(\phi_2 \frac{\Delta t}{2})} P_2 \mathbf{q}^{'} \nonumber \\ \mathbf{p} &= \cos{(\phi_2 \frac{\Delta t}{2})} \mathbf{p}' + \sin{(\phi_2 \frac{\Delta t}{2})} P_2 \mathbf{p}' \nonumber \nonumber \\ \nonumber \\ \phi_3 &= \frac{1}{4 I_{33}} \mathrm{dot} \left( \mathbf{p}, P_3 \mathbf{q} \right) \\ \mathbf{q} \left( t + \Delta t \right) &= \cos{(\phi_3 \frac{\Delta t}{2})} \mathbf{q}^{'} + \sin{(\phi_3 \frac{\Delta t}{2})} P_3 \mathbf{q}^{'} \nonumber \\ \mathbf{p} \left( t + \frac{\Delta t}{2} \right) &= \cos{(\phi_3 \frac{\Delta t}{2})} \mathbf{p}' + \sin{(\phi_3 \frac{\Delta t}{2})} P_3 \mathbf{p}' \nonumber \nonumber \\ \nonumber \\ \end{align*}where $
I_{kk}$ is the component of the moment of inertia for $k = 1, 2, 3$ and $P_k$ is the corresponding permutation matrix such that\begin{align*} P_0\mathbf{q} &= (q_0, q_1, q_2, q_3) \\ P_1\mathbf{q} &= (-q_1, q_0, q_3, -q_2) \\ P_2\mathbf{q} &= (-q_2, -q_3, q_0, q_1) \\ P_3\mathbf{q} &= (-q_3, q_2, -q_1, q_0) \\ (PP^T)_{\alpha \beta} &= \delta_{\alpha \beta} \\ \end{align*}
-
-
$
\mathbf{p}$ is converted back into vector-form angular momentum:\mathbf{L} \left( t + \frac{\Delta t}{2} \right) = \frac{1}{2} \mathbf{S}(\mathbf{q})^T \mathbf{p} \left( t + \frac{\Delta t}{2} \right)where
\begin{align*} \mathbf{L} &= (0, L_x, L_y, L_z) \\ \vec{L} &= (L_x, L_y, L_z) \end{align*}
-
Source§fn integrate_rotation_half_step_two_with_filter<F: Fn(&Tagged<Body<DynamicOrientedPoint<Cartesian<3>, Versor>, S>>) -> bool>(
&mut self,
microstate: &mut Microstate<DynamicOrientedPoint<Cartesian<3>, Versor>, S, X, C>,
macrostate: &M,
should_integrate_body: F,
)
fn integrate_rotation_half_step_two_with_filter<F: Fn(&Tagged<Body<DynamicOrientedPoint<Cartesian<3>, Versor>, S>>) -> bool>( &mut self, microstate: &mut Microstate<DynamicOrientedPoint<Cartesian<3>, Versor>, S, X, C>, macrostate: &M, should_integrate_body: F, )
Integrate selected body angular momenta forward a half step.
The second half step of the symplectic integration procedure is given by the equations below, which are
applied to each selected body i. In each step, the marker $'$ is used when a variable’s value changes
during a step to distinguish the value before ( $'$ is present) from the value after ( $'$ is absent).
The time $t + \frac{\Delta t}{2}$ is implicit on every variable unless otherwise specified.
Rotational degrees of freedom with a moment of inertia component of zero are skipped.
-
Angular momentum and net torque are converted to quaternions $
\mathbf{p}$ and $\mathbf{f}$, respectively:\begin{align*} \mathbf{p} &= 2\mathbf{S}(\mathbf{q}) \mathbf{L} \\ \mathbf{f} &= 2\mathbf{S}(\mathbf{q}) \boldsymbol{\tau} \\ \end{align*}where
\begin{align*} \mathbf{L} &= (0, L_x, L_y, L_z) \\ \boldsymbol{\tau} &= (0, \tau_x, \tau_y, \tau_z) \\ \mathbf{S}(\mathbf{q}) &= \begin{pmatrix} q_0 & -q_1 & -q_2 & -q_3\\ q_1 & q_0 & -q_3 & q_2\\ q_2 & q_3 & q_0 & -q_1\\ q_3 & -q_2 & q_1 & q_0 \end{pmatrix} \end{align*} -
$
\mathbf{p}$ is integrated forward a half step.\mathbf{p}\left( t + \Delta t \right) = \mathbf{p}\left( t + \frac{\Delta t}{2} \right) + \frac{\Delta t}{2} \mathbf{f} -
$
\mathbf{p}$ is converted back into vector-form angular momentum:\mathbf{L} \left( t + \Delta t \right) = \frac{1}{2} \mathbf{S}(\mathbf{q})^T \mathbf{p} \left( t + \Delta t \right)where
\begin{align*} \mathbf{L} &= (0, L_x, L_y, L_z) \\ \vec{L} &= (L_x, L_y, L_z) \end{align*} -
The rotational thermostat is integrated forward a half-step and then angular momentum is rescaled accordingly. (Note:
rotational_thermostat.integrate_half_step_two()is the first half step method implemented byTR.)\vec{L}_i(t + \Delta t) = \vec{L}'_i(t + \Delta t) \cdot \mathrm{rotational\_thermostat.integrate\_half\_step\_two}\left(\sum_{i \in \mathrm{selection}} K'_{rot,j}(t + \Delta t) \right)where the summation represents the total rotational kinetic energy of the selected bodies at the start of the step, and
rotational_thermostat.integrate_half_step_two()is the second half step method implemented byTR.
Source§fn integrate_rotation_half_step_one(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
)
fn integrate_rotation_half_step_one( &mut self, microstate: &mut Microstate<B, S, X, C>, macrostate: &M, )
Source§fn integrate_rotation_half_step_two(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
)
fn integrate_rotation_half_step_two( &mut self, microstate: &mut Microstate<B, S, X, C>, macrostate: &M, )
Source§fn integrate_translation_and_rotation_with_filter<E, F>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
interaction_model: &E,
should_integrate_body: F,
)where
F: Fn(&Tagged<Body<B, S>>) -> bool,
Microstate<B, S, X, C>: UpdateNetForceVirialAndTorque<E>,
Self: TranslationalMotion<B, S, X, C, M>,
fn integrate_translation_and_rotation_with_filter<E, F>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
interaction_model: &E,
should_integrate_body: F,
)where
F: Fn(&Tagged<Body<B, S>>) -> bool,
Microstate<B, S, X, C>: UpdateNetForceVirialAndTorque<E>,
Self: TranslationalMotion<B, S, X, C, M>,
Source§fn integrate_translation_and_rotation<E>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
interaction_model: &E,
)where
Microstate<B, S, X, C>: UpdateNetForceVirialAndTorque<E>,
Self: TranslationalMotion<B, S, X, C, M>,
fn integrate_translation_and_rotation<E>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
interaction_model: &E,
)where
Microstate<B, S, X, C>: UpdateNetForceVirialAndTorque<E>,
Self: TranslationalMotion<B, S, X, C, M>,
Source§impl<TT, TR> Serialize for ConstantVolume<TT, TR>
impl<TT, TR> Serialize for ConstantVolume<TT, TR>
Source§impl<V, B, S, X, C, TT, TR, M> TranslationalMotion<B, S, X, C, M> for ConstantVolume<TT, TR>where
V: Default + InnerProduct,
B: Position<Position = V> + Momentum<Momentum = V> + NetForce<NetForce = V> + Mass + Transform<S> + Clone,
S: Position<Position = V> + Default,
X: PointUpdate<V, SiteKey>,
C: Wrap<B> + Wrap<S> + GenerateGhosts<S>,
TT: Thermostat<M>,
impl<V, B, S, X, C, TT, TR, M> TranslationalMotion<B, S, X, C, M> for ConstantVolume<TT, TR>where
V: Default + InnerProduct,
B: Position<Position = V> + Momentum<Momentum = V> + NetForce<NetForce = V> + Mass + Transform<S> + Clone,
S: Position<Position = V> + Default,
X: PointUpdate<V, SiteKey>,
C: Wrap<B> + Wrap<S> + GenerateGhosts<S>,
TT: Thermostat<M>,
Source§fn integrate_translation_half_step_one_with_filter<F: Fn(&Tagged<Body<B, S>>) -> bool>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
should_integrate_body: F,
)
fn integrate_translation_half_step_one_with_filter<F: Fn(&Tagged<Body<B, S>>) -> bool>( &mut self, microstate: &mut Microstate<B, S, X, C>, macrostate: &M, should_integrate_body: F, )
Integrate selected body positions forward a full step and their momenta forward a half step.
The first half step of the symplectic integration procedure is given by the equations below, which are
applied to each selected body i. In each step, the marker $'$ is used when a variable’s value changes
during a step to distinguish the value before ( $'$ is present) from the value after ( $'$ is absent).
-
The translational thermostat is integrated forward a half-step and then momentum is rescaled accordingly:
\vec{p}_i\left( t \right) = \vec{p'}_i\left( t \right) \cdot \mathrm{translational\_thermostat.integrate\_half\_step\_one}\left( \sum_{j \in \mathrm{selection}} K'_{trans,j} \left( t \right) \right)where the summation represents the total translational kinetic energy of the selected bodies at the start of the step, and
translational_thermostat.integrate_half_step_one()is the first half step method implemented byTT. -
Momentum is integrated forward a half step.
\vec{p}_i\left( t + \frac{\Delta t}{2} \right) = \vec{p}_i\left( t \right) + \vec{F}_i(t) \frac{\Delta t}{2} -
Position is integrated forward a full step using the new momentum.
\vec{r}_i\left( t + \Delta t \right) = \vec{r}_i\left( t \right) + \frac{\vec{p}_i\left( t + \frac{\Delta t}{2} \right)}{m_i} \Delta t
Source§fn integrate_translation_half_step_two_with_filter<F: Fn(&Tagged<Body<B, S>>) -> bool>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
should_integrate_body: F,
)
fn integrate_translation_half_step_two_with_filter<F: Fn(&Tagged<Body<B, S>>) -> bool>( &mut self, microstate: &mut Microstate<B, S, X, C>, macrostate: &M, should_integrate_body: F, )
Integrate selected body momenta forward a half step.
The second half step of the symplectic integration procedure is given by the equations below, which are
applied to each selected body i. In each step, the marker $'$ is used when a variable’s value changes
during a step to distinguish the value before ( $'$ is present) from the value after ( $'$ is absent).
-
Momentum is integrated forward a half step.
\vec{p}_i\left( t + \Delta t \right) = \vec{p}_i\left( t + \frac{\Delta t}{2} \right) + \vec{F}_i\left( t + \frac{\Delta t}{2} \right) \frac{\Delta t}{2} -
The translational thermostat is integrated forward a half step and then momentum is rescaled accordingly.
\vec{p}_i\left( t + \Delta t \right) = \vec{p'}_i\left( t + \Delta t \right) \cdot \mathrm{translational\_thermostat.integrate\_half\_step\_two}\left( \sum_{j \in \mathrm{selection}} K'_{trans,j} \left( t + \Delta t \right) \right)where the summation represents the total translational kinetic energy of the selected bodies at the start of the step, and
translational_thermostat.integrate_half_step_two()is the second half step method implemented byTT.
Source§fn integrate_translation_half_step_one(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
)
fn integrate_translation_half_step_one( &mut self, microstate: &mut Microstate<B, S, X, C>, macrostate: &M, )
Source§fn integrate_translation_half_step_two(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
)
fn integrate_translation_half_step_two( &mut self, microstate: &mut Microstate<B, S, X, C>, macrostate: &M, )
Source§fn integrate_translation_with_filter<E, F>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
interaction_model: &E,
should_integrate_body: F,
)
fn integrate_translation_with_filter<E, F>( &mut self, microstate: &mut Microstate<B, S, X, C>, macrostate: &M, interaction_model: &E, should_integrate_body: F, )
Source§fn integrate_translation<E>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
interaction_model: &E,
)where
Microstate<B, S, X, C>: UpdateNetForceAndVirial<E>,
fn integrate_translation<E>(
&mut self,
microstate: &mut Microstate<B, S, X, C>,
macrostate: &M,
interaction_model: &E,
)where
Microstate<B, S, X, C>: UpdateNetForceAndVirial<E>,
impl<TT, TR> StructuralPartialEq for ConstantVolume<TT, TR>
Auto Trait Implementations§
impl<TT, TR> Freeze for ConstantVolume<TT, TR>
impl<TT, TR> RefUnwindSafe for ConstantVolume<TT, TR>where
TT: RefUnwindSafe,
TR: RefUnwindSafe,
impl<TT, TR> Send for ConstantVolume<TT, TR>
impl<TT, TR> Sync for ConstantVolume<TT, TR>
impl<TT, TR> Unpin for ConstantVolume<TT, TR>
impl<TT, TR> UnsafeUnpin for ConstantVolume<TT, TR>where
TT: UnsafeUnpin,
TR: UnsafeUnpin,
impl<TT, TR> UnwindSafe for ConstantVolume<TT, TR>where
TT: UnwindSafe,
TR: 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