pub trait TranslationalMotion<B, S, X, C, M> {
// Required methods
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_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,
);
// Provided methods
fn integrate_translation_half_step_one(
&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,
) { ... }
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,
)
where F: Fn(&Tagged<Body<B, S>>) -> bool,
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> { ... }
}Expand description
Integrate translational degrees of freedom.
TranslationalMotion integrates the Position and Momentum degrees of
freedom for selected bodies.
To integrate the whole system forward one step, call integrate_translation:
integration_method.integrate_translation(&mut microstate, ¯ostate, &interaction_model);
microstate.increment_step();To integrate only some bodies, call integrate_translation_with_filter:
integration_method.integrate_translation_with_filter(&mut microstate, ¯ostate, &interaction_model, |b| b.tag < 2);
microstate.increment_step();To integrate some bodies with one integration method and other bodies with another,
call integrate_translation_half_step_one_with_filter for all methods, then call
update_net_force, and finish with integrate_translation_half_step_one_with_filter.
The filters must select distinct subsets of bodies. The filters must also select
the same bodies in half step one and half step two.
integration_method_1.integrate_translation_half_step_one_with_filter(&mut microstate, ¯ostate, |b| b.tag < 2);
integration_method_2.integrate_translation_half_step_one_with_filter(&mut microstate, ¯ostate, |b| b.tag >= 2);
microstate.update_net_force_and_virial(&interaction_model);
integration_method_1.integrate_translation_half_step_two_with_filter(&mut microstate, ¯ostate, |b| b.tag < 2);
integration_method_2.integrate_translation_half_step_two_with_filter(&mut microstate, ¯ostate, |b| b.tag >= 2);
microstate.increment_step();The generic type names are:
B: TheBody::propertiestype.S: TheSite::propertiestype.X: The spatial data structure type.C: Theboundarycondition type.M: Themacrostatetype.
Required Methods§
Sourcefn 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 the momenta forward a half step.
Sourcefn 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.
Provided Methods§
Sourcefn 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, )
Integrate all body positions forward a full step and the momenta forward a half step.
Sourcefn 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, )
Integrate all body momenta forward a half step.
Sourcefn 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, )
Integrate selected body translational degrees of freedom forward one step.
Sourcefn 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>,
Integrate all body translational degrees of freedom forward one step.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.