From Range

A particle group represents a subset of particles, which is defined by an instance of particle together with a sequence of indices.

Example:

-- construct particle instance for given simulation domain
local system = halmd.mdsim.particle({box = box, particles = 10000, species = 2})

-- select each species, assuming particles of a species have contiguous tags
local group_A = halmd.mdsim.particle_groups.from_range({particle = system, range = {1, 5000}, label = "A"})
local group_B = halmd.mdsim.particle_groups.from_range({particle = system, range = {5001, 10000}, label = "B"})
class halmd.mdsim.particle_groups.from_range(args)

Construct particle group from tag range.

Parameters:
  • args (table) – keyword arguments
  • args.particle – instance of halmd.mdsim.particle
  • args.range (table) – particle tag range {first, last}
  • args.label (string) – group label

Note

Particle tags are 1-based, i.e. the first particle has tag 1.

particle

Instance of halmd.mdsim.particle

size

Number of particles in group.