Trait Mechanics
pub trait Mechanics<Pos, Vel, For, Float = f64> {
// Required methods
fn get_random_contribution(
&self,
rng: &mut ChaCha8Rng,
dt: Float,
) -> Result<(Pos, Vel), RngError>;
fn calculate_increment(&self, force: For) -> Result<(Pos, Vel), CalcError>;
}
Expand description
Describes the position of a cell-agent and allows to calculate increments and set/get information of the agent.
Required Methods§
fn get_random_contribution(
&self,
rng: &mut ChaCha8Rng,
dt: Float,
) -> Result<(Pos, Vel), RngError>
fn get_random_contribution( &self, rng: &mut ChaCha8Rng, dt: Float, ) -> Result<(Pos, Vel), RngError>
Define a new random variable in case that the mechanics type contains a random aspect to its motion. By default this function does nothing.
fn calculate_increment(&self, force: For) -> Result<(Pos, Vel), CalcError>
fn calculate_increment(&self, force: For) -> Result<(Pos, Vel), CalcError>
Calculate the time-derivative of force and velocity given all the forces that act on the cell. Simple damping effects should be included in this trait if not explicitly given by the SubDomainForce trait.