External Forces / Interactions
Contents
External Forces / Interactions#
Description#
External force and environmental interaction are represented as force/torque boundary condition at different location.
Available Forcing
Numba implementation module for boundary condition implementations that apply external forces to the rod.
This is the base class for external forcing boundary conditions applied to rodlike objects. 

This class applies constant forces on the endpoint nodes. 

This class applies a constant gravitational force to the entire rod. 

This class applies a uniform force to the entire rod. 

This class applies a uniform torque to the entire rod. 

This class applies muscle torques along the body. 
Available Interaction
Numba implementation module containing interactions between a rod and its environment.
This anisotropic friction plane class is for computing anisotropic friction forces on rods. 

The interaction plane class computes the plane reaction force on a rodlike object. 

This slender body theory class is for flowstructure interaction problems. 
Compatibility#
Forcing 
Rod 
Rigid Body 

NoForces 
✅ 
✅ 
EndpointForces 
✅ 
✅ 
GravityForces 
✅ 
✅ 
UniformForces 
✅ 
✅ 
UniformTorques 
✅ 
✅ 
MuscleTorques 
✅ 
❌ 
Interaction 
Rod 
Rigid Body 

AnisotropicFrictionalPlane 
✅ 
❌ 
InteractionPlane 
✅ 
❌ 
SlenderBodyTheory 
✅ 
❌ 
Builtin External Forces#
Numba implementation module for boundary condition implementations that apply external forces to the rod.
 class elastica.external_forces.NoForces[source]#
This is the base class for external forcing boundary conditions applied to rodlike objects.
Notes
Every new external forcing class must be derived from NoForces class.
 class elastica.external_forces.EndpointForces(start_force, end_force, ramp_up_time=0.0)[source]#
This class applies constant forces on the endpoint nodes.
 Attributes
 start_force: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Force applied to first node of the rodlike object.
 end_force: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Force applied to last node of the rodlike object.
 ramp_up_time: float
Applied forces are ramped up until ramp up time.
 __init__(start_force, end_force, ramp_up_time=0.0)[source]#
 Parameters
 start_force: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Force applied to first node of the rodlike object.
 end_force: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Force applied to last node of the rodlike object.
 ramp_up_time: float
Applied forces are ramped up until ramp up time.
 class elastica.external_forces.GravityForces(acc_gravity=array([0.0,  9.80665, 0.0]))[source]#
This class applies a constant gravitational force to the entire rod.
 Attributes
 acc_gravity: numpy.ndarray
1D (dim) array containing data with ‘float’ type. Gravitational acceleration vector.
 class elastica.external_forces.UniformForces(force, direction=array([0.0, 0.0, 0.0]))[source]#
This class applies a uniform force to the entire rod.
 Attributes
 force: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Total force applied to a rodlike object.
 class elastica.external_forces.UniformTorques(torque, direction=array([0.0, 0.0, 0.0]))[source]#
This class applies a uniform torque to the entire rod.
 Attributes
 torque: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Total torque applied to a rodlike object.
 class elastica.external_forces.MuscleTorques(base_length, b_coeff, period, wave_number, phase_shift, direction, rest_lengths, ramp_up_time=0.0, with_spline=False)[source]#
This class applies muscle torques along the body. The applied muscle torques are treated as applied external forces. This class can apply muscle torques as a traveling wave with a beta spline or only as a traveling wave. For implementation details refer to Gazzola et. al. RSoS. (2018).
 Attributes
 direction: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Muscle torque direction.
 angular_frequency: float
Angular frequency of traveling wave.
 wave_number: float
Wave number of traveling wave.
 phase_shift: float
Phase shift of traveling wave.
 ramp_up_time: float
Applied muscle torques are ramped up until ramp up time.
 my_spline: numpy.ndarray
1D (blocksize) array containing data with ‘float’ type. Generated spline.
 __init__(base_length, b_coeff, period, wave_number, phase_shift, direction, rest_lengths, ramp_up_time=0.0, with_spline=False)[source]#
 Parameters
 base_length: float
Rest length of the rodlike object.
 b_coeff: nump.ndarray
1D array containing data with ‘float’ type. Beta coefficients for betaspline.
 period: float
Period of traveling wave.
 wave_number: float
Wave number of traveling wave.
 phase_shift: float
Phase shift of traveling wave.
 direction: numpy.ndarray
1D (dim) array containing data with ‘float’ type. Muscle torque direction.
 ramp_up_time: float
Applied muscle torques are ramped up until ramp up time.
 with_spline: boolean
Option to use betaspline.
Builtin Environment Interactions#
Numba implementation module containing interactions between a rod and its environment.
 class elastica.interaction.AnisotropicFrictionalPlane(k, nu, plane_origin, plane_normal, slip_velocity_tol, static_mu_array, kinetic_mu_array)[source]#
This anisotropic friction plane class is for computing anisotropic friction forces on rods. A detailed explanation of the implemented equations can be found in Gazzola et al. RSoS. (2018).
 Attributes
 k: float
Stiffness coefficient between the plane and the rodlike object.
 nu: float
Dissipation coefficient between the plane and the rodlike object.
 plane_origin: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Origin of the plane.
 plane_normal: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. The normal vector of the plane.
 slip_velocity_tol: float
Velocity tolerance to determine if the element is slipping or not.
 static_mu_array: numpy.ndarray
1D (3,) array containing data with ‘float’ type. [forward, backward, sideways] static friction coefficients.
 kinetic_mu_array: numpy.ndarray
1D (3,) array containing data with ‘float’ type. [forward, backward, sideways] kinetic friction coefficients.
 __init__(k, nu, plane_origin, plane_normal, slip_velocity_tol, static_mu_array, kinetic_mu_array)[source]#
 Parameters
 k: float
Stiffness coefficient between the plane and the rodlike object.
 nu: float
Dissipation coefficient between the plane and the rodlike object.
 plane_origin: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Origin of the plane.
 plane_normal: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. The normal vector of the plane.
 slip_velocity_tol: float
Velocity tolerance to determine if the element is slipping or not.
 static_mu_array: numpy.ndarray
1D (3,) array containing data with ‘float’ type. [forward, backward, sideways] static friction coefficients.
 kinetic_mu_array: numpy.ndarray
1D (3,) array containing data with ‘float’ type. [forward, backward, sideways] kinetic friction coefficients.
 class elastica.interaction.InteractionPlane(k, nu, plane_origin, plane_normal)[source]#
The interaction plane class computes the plane reaction force on a rodlike object. For more details regarding the contact module refer to Eqn 4.8 of Gazzola et al. RSoS (2018).
 Attributes
 k: float
Stiffness coefficient between the plane and the rodlike object.
 nu: float
Dissipation coefficient between the plane and the rodlike object.
 plane_origin: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Origin of the plane.
 plane_normal: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. The normal vector of the plane.
 surface_tol: float
Penetration tolerance between the plane and the rodlike object.
 __init__(k, nu, plane_origin, plane_normal)[source]#
 Parameters
 k: float
Stiffness coefficient between the plane and the rodlike object.
 nu: float
Dissipation coefficient between the plane and the rodlike object.
 plane_origin: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. Origin of the plane.
 plane_normal: numpy.ndarray
2D (dim, 1) array containing data with ‘float’ type. The normal vector of the plane.
 class elastica.interaction.SlenderBodyTheory(dynamic_viscosity)[source]#
This slender body theory class is for flowstructure interaction problems. This class applies hydrodynamic forces on the body using the slender body theory given in Eq. 4.13 of Gazzola et al. RSoS (2018).
 Attributes
 dynamic_viscosity: float
Dynamic viscosity of the fluid.