Simulator#
Base System#
Basic coordinating for multiple, smaller systems that have an independently integrable interface (i.e. works with symplectic or explicit routines timestepper.py.)
- class elastica.modules.base_system.BaseSystemCollection[source]#
Base System for simulator classes. Every simulation class written by the user must be derived from the BaseSystemCollection class; otherwise the simulation will proceed.
- Attributes:
- allowed_sys_types: tuple
Tuple of allowed type rod-like objects. Here use a base class for objects, i.e. RodBase.
- _systems: list
List of rod-like objects.
- finalize()[source]#
This method finalizes the simulator class. When it is called, it is assumed that the user has appended all rod-like objects to the simulator as well as all boundary conditions, callbacks, etc., acting on these rod-like objects. After the finalize method called, the user cannot add new features to the simulator class.
CallBacks#
Provides the callBack interface to collect data over time (see callback_functions.py).
- class elastica.modules.callbacks.CallBacks[source]#
CallBacks class is a module for calling callback functions, set by the user. If the user wants to collect data from the simulation, the simulator class has to be derived from the CallBacks class.
- Attributes:
- _callback_list: list
List of call back classes defined for rod-like objects.
Connect#
Provides the connections interface to connect entities (rods, rigid bodies) using joints (see joints.py).
- class elastica.modules.connections.Connections[source]#
The Connections class is a module for connecting rod-like objects using joints selected by the user. To connect two rod-like objects, the simulator class must be derived from the Connections class.
- Attributes:
- _connections: list
List of joint classes defined for rod-like objects.
- connect(first_rod, second_rod, first_connect_idx=None, second_connect_idx=None)[source]#
This method connects two rod-like objects using the selected joint class. You need to input the two rod-like objects that are to be connected as well as set the element indexes of these rods where the connection occurs.
- Parameters:
- first_rodobject
Rod-like object
- second_rodobject
Rod-like object
- first_connect_idxint
Index of first rod for joint.
- second_connect_idxint
Index of second rod for joint.
- Returns:
Constraints#
Provides the constraints interface to enforce displacement boundary conditions (see boundary_conditions.py).
- class elastica.modules.constraints.Constraints[source]#
The Constraints class is a module for enforcing displacement boundary conditions. To enforce boundary conditions on rod-like objects, the simulator class must be derived from Constraints class.
- Attributes:
- _constraints: list
List of boundary condition classes defined for rod-like objects.
Forcing#
Provides the forcing interface to apply forces and torques to rod-like objects (external point force, muscle torques, etc).
- class elastica.modules.forcing.Forcing[source]#
The Forcing class is a module for applying boundary conditions that consist of applied external forces. To apply forcing on rod-like objects, the simulator class must be derived from the Forcing class.
- Attributes:
- _ext_forces_torques: list
List of forcing class defined for rod-like objects.
Damping#
(added in version 0.3.0)
Provides the damper interface to apply damping on the rods. (see dissipation.py).