mpacts.commands.onarrays. average

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

import mpacts.commands.onarrays.average
#or assign it to a shorter name
import mpacts.commands.onarrays.average as ave

ComputeIndexSumCommand

class mpacts.commands.onarrays.average.ComputeIndexSumCommand

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

Compute sum of array of ‘Index’ values.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • array — Array for which the sum is to be computed.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • 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.
    • sum (default value = 0) — Value of the sum of the given array, computed by executing this command. For optimal safety, set to ‘zero’ when initializing this command!
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, array, [gate, predicate, sum]
ComputeIndexSumCommand(name, parent, **kwargs)

ComputeIntSumCommand

class mpacts.commands.onarrays.average.ComputeIntSumCommand

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

Compute sum of array of ‘int’ values.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • array — Array for which the sum is to be computed.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • 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.
    • sum (default value = 0) — Value of the sum of the given array, computed by executing this command. For optimal safety, set to ‘zero’ when initializing this command!
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, array, [gate, predicate, sum]
ComputeIntSumCommand(name, parent, **kwargs)

ComputeMatrixSumCommand

class mpacts.commands.onarrays.average.ComputeMatrixSumCommand

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

Compute sum of array of ‘Matrix’ (3x3) values. | Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • array — Array for which the sum is to be computed.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • 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.
    • sum (default value = 0 0 0

0 0 0 0 0 0) — Value of the sum of the given array, computed by executing this command. For optimal safety, set to ‘zero’ when initializing this command!

object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, array, [gate, predicate, sum]
ComputeMatrixSumCommand(name, parent, **kwargs)

ComputePointSumCommand

class mpacts.commands.onarrays.average.ComputePointSumCommand

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

Compute sum of array of ‘Point’ values.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • array — Array for which the sum is to be computed.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • 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.
    • sum (default value = 0 0 0) — Value of the sum of the given array, computed by executing this command. For optimal safety, set to ‘zero’ when initializing this command!
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, array, [gate, predicate, sum]
ComputePointSumCommand(name, parent, **kwargs)

ComputeScalarSumCommand

class mpacts.commands.onarrays.average.ComputeScalarSumCommand

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

Compute sum of array of ‘Scalar’ values.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • array — Array for which the sum is to be computed.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • 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.
    • sum (default value = 0) — Value of the sum of the given array, computed by executing this command. For optimal safety, set to ‘zero’ when initializing this command!
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, array, [gate, predicate, sum]
ComputeScalarSumCommand(name, parent, **kwargs)

ComputeSymmetricMatrixSumCommand

class mpacts.commands.onarrays.average.ComputeSymmetricMatrixSumCommand

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

Compute sum of array of ‘SymmetricMatrix’ values. | Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • array — Array for which the sum is to be computed.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • 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.
    • sum (default value = 0 0 0

0 0 0 0 0 0) — Value of the sum of the given array, computed by executing this command. For optimal safety, set to ‘zero’ when initializing this command!

object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, array, [gate, predicate, sum]
ComputeSymmetricMatrixSumCommand(name, parent, **kwargs)

ComputeVectorSumCommand

class mpacts.commands.onarrays.average.ComputeVectorSumCommand

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

Compute sum of array of ‘Vector’ values.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • array — Array for which the sum is to be computed.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • 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.
    • sum (default value = 0 0 0) — Value of the sum of the given array, computed by executing this command. For optimal safety, set to ‘zero’ when initializing this command!
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, array, [gate, predicate, sum]
ComputeVectorSumCommand(name, parent, **kwargs)

ExponentialMovingAverageCommand

class mpacts.commands.onarrays.average.ExponentialMovingAverageCommand

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

Command for computing the Exponential Moving Average (EMA) which will be stored in a ‘result’ array, and is calculated from a given ‘array’. Formula: result(t+1) = alpha * array(t+1) + (1-alpha) * result(t), with alpha typically chosen to be 2/(N+1) where N is a window size of a simple Moving Average (which requires more memory) - of course, this choice of alpha yields only an approximately equivalent solution.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • alpha — fraction of new value which will be used. The old value will then account for (1-alpha)!
    • array — Array from which the exponential moving average will be calculated
    • result — Array into which result is stored.
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
object __init__(tuple args, dict kwds) :
args: name, parent kwds: result, array, alpha, [gate]
ExponentialMovingAverageCommand(name, parent, **kwargs)

MovingAverageCommand

class mpacts.commands.onarrays.average.MovingAverageCommand

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

Command for computing the Moving Average (MA) which will be stored in a ‘result’ array, and is calculated from a given ‘array’ over a certain ‘window’ size.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • array — Array of which the moving average will be calculated
    • result — Array into which result is stored.
    • window — window size in ‘times called’.
  • Optional keywords:
    • 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 deciding whether the command should be executed for a given particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: result, array, window, [gate, predicate]
MovingAverageCommand(name, parent, **kwargs)