Particle

class halmd.mdsim.particle(args)

Construct particle instance.

Parameters:
  • args (table) – keyword arguments
  • args.box (number) – instance of halmd.mdsim.box
  • args.particles (number) – number of particles
  • args.species (number) – number of species
  • args.memory (string) –

    device where the particle information is stored (optional)

    The supported values for memory are “host” and “gpu”. If memory is not specified, the memory location is selected according to the compute device.

  • args.label (string) – instance label (defaults to all)
nparticle

Number of particles.

nspecies

Number of particle species.

label

Instance label.

memory

Device where the particle memory resides.

Warning

During simulation, particle arrays are reordered in memory according to a space-filling curve. To access particles in initial order, use get_reverse_tag() to retrieve the current particle indices.

get_position()

Returns sequence with particle positions.

set_position(position)

Set particle positions to given sequence.

get_image()

Returns sequence with particle images.

set_image(image)

Set particle images to given sequence.

get_velocity()

Returns sequence with particle velocities.

set_velocity(velocity)

Set particle velocities to given sequence.

get_tag()

Returns sequence with particle tags.

set_tag(tag)

Set particle tags to given sequence.

get_reverse_tag()

Returns sequence with particle reverse tags.

set_reverse_tag(reverse_tag)

Set particle reverse tags to given sequence.

get_species()

Returns sequence with particle species.

set_species(species)

Set particle species to given sequence.

get_mass()

Returns sequence with particle masses.

set_mass(mass)

Set particle masses to given sequence.

shift_velocity(vector)

Shift all velocities by vector.

shift_velocity_group(group, vector)

Shift velocities of group by vector.

rescale_velocity(scalar)

Rescale magnitude of all velocities by scalar.

rescale_velocity_group(group, scalar)

Rescale magnitude of velocities of group by scalar.

shift_rescale_velocity(vector, scalar)

First shift, then rescale all velocities.

shift_rescale_velocity_group(group, vector, scalar)

First shift, then rescale velocities of group.