mpacts.commands.onparticles. countperparent

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

import mpacts.commands.onparticles.countperparent
#or assign it to a shorter name
import mpacts.commands.onparticles.countperparent as cou

ComputeChildListPerParentCommand

class mpacts.commands.onparticles.countperparent.ComputeChildListPerParentCommand

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

Command that will create a std::vector array of indices of the children of a given ‘child’ particle container in the parent manager.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • childIndexList — std::vector array with Indices of the children per parent
    • 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.
    • sort_indices (default value = 1) — If True, the vector with child indices will be sorted from smaller to larger value.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, childIndexList, [gate, predicate, sort_indices]
ComputeChildListPerParentCommand(name, parent, **kwargs)

CountNumberOfSubParticlesCommand

class mpacts.commands.onparticles.countperparent.CountNumberOfSubParticlesCommand

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

Command to count the number of particles in a certain sub-particle container that correspond to the same parentParticle.
Has no default location.
  • Required keywords:
    • index — The index of the parent particle that needs to be counted.
    • 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.
  • Read only properties:
    • result — The resulting number of subparticles. Note: only valid after executing the command
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, index, [gate, predicate]
CountNumberOfSubParticlesCommand(name, parent, **kwargs)

CountPerParentCommand

class mpacts.commands.onparticles.countperparent.CountPerParentCommand

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

Command which counts how many elements (e.g. nodes) the given child-pc has.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • count (default value = None) — Array in parent where the count is stored, by default made and called “count_“+pc()->name().
    • 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, count]
CountPerParentCommand(name, parent, **kwargs)