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.

NoForces

This is the base class for external forcing boundary conditions applied to rod-like objects.

EndpointForces

This class applies constant forces on the endpoint nodes.

GravityForces

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

UniformForces

This class applies a uniform force to the entire rod.

UniformTorques

This class applies a uniform torque to the entire rod.

MuscleTorques

This class applies muscle torques along the body.

EndpointForcesSinusoidal

This class applies sinusoidally varying forces to the ends of a rod.

Available Interaction

Numba implementation module containing interactions between a rod and its environment.

AnisotropicFrictionalPlane

This anisotropic friction plane class is for computing anisotropic friction forces on rods.

InteractionPlane

The interaction plane class computes the plane reaction force on a rod-like object.

SlenderBodyTheory

This slender body theory class is for flow-structure interaction problems.

Compatibility#

Forcing

Rod

Rigid Body

NoForces

EndpointForces

GravityForces

UniformForces

UniformTorques

MuscleTorques

EndpointForcesSinusoidal

Interaction

Rod

Rigid Body

AnisotropicFrictionalPlane

InteractionPlane

SlenderBodyTheory

Built-in 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 rod-like objects.

Notes

Every new external forcing class must be derived from NoForces class.

__init__()[source]#

NoForces class does not need any input parameters.

class elastica.external_forces.EndpointForces(start_force, end_force, ramp_up_time)[source]#

This class applies constant forces on the endpoint nodes.

Attributes
start_force: numpy.ndarray

1D (dim) array containing data with ‘float’ type. Force applied to first node of the rod-like object.

end_force: numpy.ndarray

1D (dim) array containing data with ‘float’ type. Force applied to last node of the rod-like object.

ramp_up_time: float

Applied forces are ramped up until ramp up time.

__init__(start_force, end_force, ramp_up_time)[source]#
Parameters
start_force: numpy.ndarray

1D (dim) array containing data with ‘float’ type. Force applied to first node of the rod-like object.

end_force: numpy.ndarray

1D (dim) array containing data with ‘float’ type. Force applied to last node of the rod-like object.

ramp_up_time: float

Applied forces are ramped up until ramp up time.

class elastica.external_forces.GravityForces(acc_gravity=array([0., - 9.80665, 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.

__init__(acc_gravity=array([0., - 9.80665, 0.]))[source]#
Parameters
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.]))[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 rod-like object.

__init__(force, direction=array([0., 0., 0.]))[source]#
Parameters
force: float

Force magnitude applied to a rod-like object.

direction: numpy.ndarray

1D (dim) array containing data with ‘float’ type. Direction in which force applied.

class elastica.external_forces.UniformTorques(torque, direction=array([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 rod-like object.

__init__(torque, direction=array([0., 0., 0.]))[source]#
Parameters
torque: float

Torque magnitude applied to a rod-like object.

direction: numpy.ndarray

1D (dim) array containing data with ‘float’ type. Direction in which torque applied.

class elastica.external_forces.MuscleTorques(base_length, b_coeff, period, wave_number, phase_shift, direction, rest_lengths, ramp_up_time, 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, with_spline=False)[source]#
Parameters
base_length: float

Rest length of the rod-like object.

b_coeff: nump.ndarray

1D array containing data with ‘float’ type. Beta coefficients for beta-spline.

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 beta-spline.

class elastica.external_forces.EndpointForcesSinusoidal(start_force_mag, end_force_mag, ramp_up_time=0.0, tangent_direction=array([0, 0, 1]), normal_direction=array([0, 1, 0]))[source]#

This class applies sinusoidally varying forces to the ends of a rod. Forces are applied in a plane, which is defined by the tangent_direction and normal_direction.

Notes

In order to see example how to use this class, see joint examples.

Attributes
start_force_mag: float

Magnitude of the force that is applied to the start of the rod (node 0).

end_force_mag: float

Magnitude of the force that is applied to the end of the rod (node -1).

ramp_up_time: float

Applied forces are applied in the normal direction until time reaches ramp_up_time.

normal_direction: np.ndarray

An array (3,) contains type float. This is the normal direction of the rod.

roll_direction: np.ndarray

An array (3,) contains type float. This is the direction perpendicular to rod tangent, and rod normal.

__init__(start_force_mag, end_force_mag, ramp_up_time=0.0, tangent_direction=array([0, 0, 1]), normal_direction=array([0, 1, 0]))[source]#
Parameters
start_force_mag: float

Magnitude of the force that is applied to the start of the rod (node 0).

end_force_mag: float

Magnitude of the force that is applied to the end of the rod (node -1).

ramp_up_time: float

Applied muscle torques are ramped up until ramp up time.

tangent_direction: np.ndarray

An array (3,) contains type float. This is the tangent direction of the rod, or normal of the plane that forces applied.

normal_direction: np.ndarray

An array (3,) contains type float. This is the normal direction of the rod.

Built-in 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 rod-like object.

nu: float

Dissipation coefficient between the plane and the rod-like 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 rod-like object.

nu: float

Dissipation coefficient between the plane and the rod-like 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 rod-like 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 rod-like object.

nu: float

Dissipation coefficient between the plane and the rod-like 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 rod-like object.

__init__(k, nu, plane_origin, plane_normal)[source]#
Parameters
k: float

Stiffness coefficient between the plane and the rod-like object.

nu: float

Dissipation coefficient between the plane and the rod-like 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 flow-structure 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.

__init__(dynamic_viscosity)[source]#
Parameters
dynamic_viscosityfloat

Dynamic viscosity of the fluid.