mpacts.commands.onparticles. create_remove

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

import mpacts.commands.onparticles.create_remove
#or assign it to a shorter name
import mpacts.commands.onparticles.create_remove as cre

CreateCopyParticlesCommand

class mpacts.commands.onparticles.create_remove.CreateCopyParticlesCommand

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

A command that will create a new particle in the target pc, when a particle in the pc satifies a given predicate. It will copy all data, but keep no reference index. NOTE: If the source particle is not removed, every execution will result in copies!!!
Has no default location.
  • Required keywords:
    • pc — Particle container on which the command is applied
    • target — The target particle container in which new particles will be created.
  • 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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, target, [gate, predicate]
CreateCopyParticlesCommand(name, parent, **kwargs)

CreateNewReferencedParticleCommand

class mpacts.commands.onparticles.create_remove.CreateNewReferencedParticleCommand

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

A command that will create a new particle in the target pc, when a particle in the pc satifies a given predicate. It will not copy any data, but it will store an index to particle that satisfied the predicate allowing copy operations
Has no default location.
  • Required keywords:
    • pc — Particle container on which the command is applied
    • target — The target particle container in which new particles will be created, and where the index to theoriginal particle is stored
  • 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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, target, [gate, predicate]
CreateNewReferencedParticleCommand(name, parent, **kwargs)

DecayCommand

class mpacts.commands.onparticles.create_remove.DecayCommand

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

Particles in ‘pc’ are randomly killed at a specified rate ‘k’
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • k (s^-1) — Decay rate of the particles (In fraction killed / second )
    • 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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, k, [gate, predicate]
DecayCommand(name, parent, **kwargs)

DepolymerizationCommand

class mpacts.commands.onparticles.create_remove.DepolymerizationCommand

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

Polymers in ‘pc’ undergo depolymerization. ‘pc’ is expected to contain segments.
Default location: ‘loop_cmds/remove_particles_cmds’
  • Required keywords:
    • N_mono — Grid containing the information about the number of monomers.
    • k (s^-1) — De-polymerization rate of the particles.
    • l_mono (m) — Monomer length.
    • 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)
    • l_min (m) (default value = 0) — Minimal segment length.
    • 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, k, l_mono, N_mono, [gate, predicate, l_min]
DepolymerizationCommand(name, parent, **kwargs)

GenerateConditionalCopies

class mpacts.commands.onparticles.create_remove.GenerateConditionalCopies

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

For each element in ‘pc_source’ the predicate is called and if the predicate is true, that element is copied in pc_target.
Default location: ‘loop_cmds/post_contact_cmds’
  • Required keywords:
    • predicate — Predicate that will decide whether or not this source particle is copied (predicate is applied to the source pc)
    • source_pc — The source from wich particles will be copied
    • target_pc — The target where particles will be copied to.
  • 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: source_pc, target_pc, predicate, [gate]
GenerateConditionalCopies(name, parent, **kwargs)

GenerateInQuadCommand

class mpacts.commands.onparticles.create_remove.GenerateInQuadCommand

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

For each quad in manager ‘pc’, spherical particles in manager ‘pc_sink’ are generated with generation rate ‘k’ and placed randomly at the surface of the Quad element (with an equal surface probability density)
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • initial_radius — Initial radius of the generated particles
    • k — Generation rate as number of particles per second
    • pc_sink — Pc in which the newly generated particles will appear
    • pc — Particle container on which the command is applied
    • x — Array with positions of the quad corners
  • 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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, initial_radius, pc_sink, k, x, [gate, predicate]
GenerateInQuadCommand(name, parent, **kwargs)

GenerateInSphereCommand

class mpacts.commands.onparticles.create_remove.GenerateInSphereCommand

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

For each sphere in manager ‘pc’, spherical particles in manager ‘pc_sink’ are generated with generation rate ‘k’ and placed at the center point of the source sphere.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • initial_radius — Initial radius of the generated particles
    • k — Generation rate in number of particles per second
    • pc_sink — Pc in which the newly generated particles will appear
    • 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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, initial_radius, pc_sink, k, [gate, predicate]
GenerateInSphereCommand(name, parent, **kwargs)

GenerateOnSphericalHullCommand

class mpacts.commands.onparticles.create_remove.GenerateOnSphericalHullCommand

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

For each sphere in manager ‘pc’, spherical particles in manager ‘pc_sink’ are generated with generation rate ‘k’ and placed at the hull of the source sphere. An outward-defined ‘offset’ can be defined to place them further away or closer to the center.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • initial_radius — Initial radius of the generated particles
    • k — Generation rate of particles per timestep
    • pc_sink — Pc in which the newly generated particles will appear
    • 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)
    • initial_state (default value = 0) — Optional initial state value given to ‘state’ array (if present)
    • offset (default value = 0) — distance the position will be off-set away from the spherical hull
    • 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, initial_radius, pc_sink, k, [gate, predicate, offset, initial_state]
GenerateOnSphericalHullCommand(name, parent, **kwargs)

PolymerizationCommand

class mpacts.commands.onparticles.create_remove.PolymerizationCommand

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

Polymers in ‘pc’ undergo polymerization. ‘pc’ is expected to contain segments.
Default location: ‘loop_cmds/create_particles_cmds’
  • Required keywords:
    • N_mono — Grid containing the information about the number of monomers.
    • k (s^-1) — Polymerization rate of the particles.
    • l_max (m) — Maximal segment length.
    • l_mono (m) — Monomer length.
    • 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)
    • l_min (m) (default value = 0) — Minimal segment length.
    • 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, k, l_mono, l_max, N_mono, [gate, predicate, l_min]
PolymerizationCommand(name, parent, **kwargs)

RemoveParentCommand

class mpacts.commands.onparticles.create_remove.RemoveParentCommand

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

A command that will remove the parent of a particle based on a given predicate. This will also destroy all sub particles associated with this parent (ie. thus also the subparticle for which the predicate was true)In practice: suppose the predicate acts on the nodes of a triangle, this command will destroy: a) The parent particle of this node, b) all nodes of that particle, c) all triangles, segments...associated with that particle.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • 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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, [gate, predicate]
RemoveParentCommand(name, parent, **kwargs)

RemoveParticlesCommand

class mpacts.commands.onparticles.create_remove.RemoveParticlesCommand

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

A command that will remove particles based on a given predicate.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • 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.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, [gate, predicate]
RemoveParticlesCommand(name, parent, **kwargs)