Region and Species

A particle group represents a subset of particles, which is defined by an instance of particle together with a region_species in the simulation domain.

Example:

-- construct particle instance for given simulation domain
local system = halmd.mdsim.particle({particles = 10000, species = 2})
local geometry = halmd.mdsim.geometries.cuboid({lowest_corner = {0,0,0}, length = {1, 1, 1}})

-- select particles of species 0 and from within this sub-box (region)
local group_cuboid = halmd.mdsim.particle_groups.region_species({
    particle = system, label = "subbox"
  , geometry = geometry, selection = "included"
  , species = 0
})
class halmd.mdsim.particle_groups.region_species(args)

Construct particle group from region.

Parameters:
  • args (table) – keyword arguments
  • args.particle – instance of halmd.mdsim.particle
  • args.geometry (table) – geometry of the region, instance of halmd.mdsim.geometries
  • args.selection (string) – select particles within or outside the geometry. Allowed values are included and excluded.
  • args.species (string) – 0-based particle species
  • args.label (string) – group label
  • args.global (boolean) – particle group can comprise the whole simulation world (default: false)
  • args.fluctuating (boolean) – the number or identity of selected particles can vary as the simulation progresses (default: true)

The flags global and fluctuating are used, e.g., for the output of thermodynamic quantities via halmd.observables.thermodynamics.

particle

Instance of halmd.mdsim.particle

size

Number of particles in group.

label

Instance label.

global

True if the particle group comprises the whole simulation world. This requires that args.global was set to true upon construction and that size equals the number of particles in particle.

fluctuating

The value of args.fluctuating passed upon construction.

to_particle(args)
Parameters:
  • args (table) – keyword argruments
  • args.particle – instance of halmd.mdsim.particle (optional)
  • args.label – label of the new particle instance (optional)
Returns:

instance of halmd.mdsim.particle with data from the particle group

Copy the particle group to a new particle instance. If no parameters given, a suitable particle instance will be constructed.

Note

Only positions, mass, species and velocity are copied to the particle instance. Other data (e.g. id, force) will not be copied.

If args.particle is present, the particle group will be copied into the given particle instance. Otherwise a new suitable particle instance with the label args.label will be created. If args.label is not given, it defaults to the group label. species of the new particle instance will be initialized with particle.species.

Note

args.particle must reside in the same memory as the group and the number of particles must be equal to size.

disconnect()

Disconnect region_species module from profiler.