mpacts.commands.onparticles. kinetic_energy

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

import mpacts.commands.onparticles.kinetic_energy
#or assign it to a shorter name
import mpacts.commands.onparticles.kinetic_energy as kin


class mpacts.commands.onparticles.kinetic_energy.ComputeKineticEnergyCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command which computes the rotational and translational kinetic energy of a body. If no rotational arrays are present only translational energy is calculated. Requires an ‘E’ array to be present.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • energy_array (default value = None) — Array to store the energy, if not given a default array ‘E’ will be assumed which must be present
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, [gate, predicate, energy_array]
ComputeKineticEnergyCommand(name, parent, **kwargs)