Skip to main content

NetBodyForceAndVirial

Trait NetBodyForceAndVirial 

Source
pub trait NetBodyForceAndVirial<B, S, X, C> {
    type Force: Outer;

    // Required method
    fn net_body_force_and_virial(
        &self,
        microstate: &Microstate<B, S, X, C>,
        body_index: usize,
    ) -> (Self::Force, <Self::Force as Outer>::Tensor);
}
Expand description

Sum all the forces and virials that act on a given body in a microstate.

See Rigid for an example.

The generic type names are:

Required Associated Types§

Source

type Force: Outer

The type of the result force.

Required Methods§

Source

fn net_body_force_and_virial( &self, microstate: &Microstate<B, S, X, C>, body_index: usize, ) -> (Self::Force, <Self::Force as Outer>::Tensor)

Compute the net force and virial on a body in the microstate.

microstate describes the configuration and body_index is the index of the body to compute.

Returns: TODO

Implementors§

Source§

impl<V, B, S, X, C, F> NetBodyForceAndVirial<B, S, X, C> for Rigid<F>
where V: Vector + Default + Outer, B: Transform<S> + Position<Position = V>, S: Position<Position = V>, F: NetSiteForceAndVirial<B, S, X, C, Force = V>, V::Tensor: Default + AddAssign + Sub<Output = V::Tensor>,

Source§

type Force = V