Skip to main content

RotationalMotion

Trait RotationalMotion 

Source
pub trait RotationalMotion<B, S, X, C, M> {
    // Required methods
    fn integrate_rotation_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_rotation_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_rotation_half_step_one(
        &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,
    ) { ... }
    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<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> { ... }
}
Expand description

Integrate rotational degrees of freedom.

RotationalMotion integrates the Orientation and AngularMomentum degrees of freedom for selected bodies.

The generic type names are:

To integrate the whole system forward one step, call integrate_translation_and_rotation:

integration_method.integrate_translation_and_rotation(&mut microstate, &macrostate, &interaction_model);
microstate.increment_step();

To integrate only some bodies, call integrate_translation_and_rotation_with_filter:

integration_method.integrate_translation_with_filter(&mut microstate, &macrostate, &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 integrate_rotation_half_step_one_with_filter for all methods, then call update_net_force_and_torque, and finish with integrate_translation_half_step_one_with_filter integrate_rotation_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, &macrostate, |b| b.tag < 2);
integration_method_1.integrate_rotation_half_step_one_with_filter(&mut microstate, &macrostate, |b| b.tag < 2);
integration_method_2.integrate_translation_half_step_one_with_filter(&mut microstate, &macrostate, |b| b.tag >= 2);
integration_method_2.integrate_rotation_half_step_one_with_filter(&mut microstate, &macrostate, |b| b.tag >= 2);
microstate.update_net_force_virial_and_torque(&interaction_model);
integration_method_1.integrate_translation_half_step_two_with_filter(&mut microstate, &macrostate, |b| b.tag < 2);
integration_method_1.integrate_rotation_half_step_two_with_filter(&mut microstate, &macrostate, |b| b.tag < 2);
integration_method_2.integrate_translation_half_step_two_with_filter(&mut microstate, &macrostate, |b| b.tag >= 2);
integration_method_2.integrate_rotation_half_step_two_with_filter(&mut microstate, &macrostate, |b| b.tag >= 2);
microstate.increment_step();

Required Methods§

Source

fn integrate_rotation_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 orientations forward a full step and their angular momenta forward a half step.

Source

fn integrate_rotation_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 angular momenta forward a half step.

Provided Methods§

Source

fn integrate_rotation_half_step_one( &mut self, microstate: &mut Microstate<B, S, X, C>, macrostate: &M, )

Integrate all body orientations forward a full step and their angular momenta forward a half step.

Source

fn integrate_rotation_half_step_two( &mut self, microstate: &mut Microstate<B, S, X, C>, macrostate: &M, )

Integrate all body angular momenta forward a half step.

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>,

Integrate selected body translational and rotational degrees of freedom forward one step.

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>,

Integrate all body translational and rotational 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.

Implementors§

Source§

impl<S, X, C, TT, TR, M> RotationalMotion<DynamicOrientedPoint<Cartesian<2>, Angle>, S, X, C, M> for ConstantVolume<TT, TR>

Rotational motion in 2-dimensional cartesian space.

Source§

impl<S, X, C, TT, TR, M> RotationalMotion<DynamicOrientedPoint<Cartesian<3>, Versor>, S, X, C, M> for ConstantVolume<TT, TR>

Rotational motion in 3-dimensional cartesian space.