mpacts.particles. particlecontainer

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

import mpacts.particles
#or assign it to a shorter name
import mpacts.particles as prt

ParticleContainer

class mpacts.particles.particlecontainer.ParticleContainer(name, ParticleClass, parent=None, call_init=True)

Bases: mpacts.core.arrays.ArrayManager

Generic Particle Container class which needs to be composed out of specific (sub) particle containers.

ParticleContainer(name, parent, **kwargs)
add_and_set_particles(**kwargs)

allows adding and setting a whole set of particles checks that kwargs all have the same length or are single values

add_initialisers()
add_particle(**kwargs)

Adds and returns a single particle, whose non-default arrays still all need to be set

check_kwargs_(kwargs)
delete_particle(index)

deletes a particle and all of its siblings

delete_subparticles(parentIndex)

deletes all sub-particles

foreach_array(f)
get_particle(index)

returns the particle (returns the same object as add_particle), hence one can add another components later

initialize()

create all my arrays and potential sub pc’s

manager_size()

return the size of the underlying manager

set_particles(**kwargs)

sets the values of a whole set of particles

translate_global_to_local(array, index)

addCommandFtor

class mpacts.particles.particlecontainer.addCommandFtor(pc, command)

Bases: object

addCommandFtor(name, parent, **kwargs)