mpacts.core. simulation

In order to be able to use this module import it like this:

import mpacts.core.simulation
#or assign it to a shorter name
import mpacts.core.simulation as sim

Simulation

class mpacts.core.simulation.Simulation

Bases: mpacts.core.baseobject.BaseObject

Default Simulation object. Has following default commandlists:
  • init_cmds

  • loop_cmds

    • pre_body_force_cmds
    • body_force_cmds
    • pre_contact_cmds
    • contact_cmds
    • post_contact_cmds
    • output_cmds
    • integration_cmds
    • advance_time_cmds
    • stop_loop_cmds
  • done_cmds

The init cmds are called only once during a simulation, the done cmds are run upon completion of a run_n, run_until_done, run_until command.

Has no default location.
  • Optional keywords:
    • done (default value = 0) — Boolean that decides whether or not the simulation is completed.
    • endTime (default value = 0) — Time used to determine when run_until stops.Can be changed during the simulation to increase or decrease runtime of simulation.
    • time (default value = 0) — Current time.
    • timestep (default value = Uninitialized) — Sets the timestep, which can be used by integrators, or other commands that need it. If this timestep is updated, these commands can be notified if they connect to the copyTimeStepSignal()
object __init__(tuple args, dict kwds) :
args: name, parent kwds: [time, endTime, done, timestep]
Simulation(name, parent, **kwargs)
get_time((Simulation)arg1) → float
get_timestep((Simulation)arg1) → float
print_command_tree((Simulation)arg1) → str
run_n((Simulation)arg1, (int)arg2) → None
run_until((Simulation)arg1, (float)arg2) → None

run_until( (Simulation)arg1, (QuantityBase)arg2) -> None

run_until_done((Simulation)arg1) → None :

Runs simulation until the done() member is set to false

set_timestep((Simulation)arg1, (float)arg2) → None

set_timestep( (Simulation)arg1, (QuantityBase)arg2) -> None