Defines a spherical domain and a predicate whether a given position is inside or outside of the domain.

class halmd.mdsim.geometries.sphere(args)

Construct sphere geometry instance.

  • args (table) – keyword arguments
  • args.centre (table) – sphere centre
  • args.radius (number) – sphere radius
  • args.precision (string) –

    floating point precision (optional)

    The supported values for precision are single and double. If precision is not specified, the precision is selected according to the compute device: single for GPU computing and double otherwise.


This module does not perform a validation of the meaningfulness of the domain, i.e. it does not test whether the geometry is placed outside the simulation domain.


Coordinates of sphere centre.


Sphere radius.