Cylinder

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

The cylinder is parametrised by an axis vector \hat n, an offset point \vec a on that axis, and a radius \rho. A point \vec r is inside of the cylinder if

|\Delta \vec r|^2 - (\Delta \vec r \cdot \hat n)^2 \leq \rho^2 \,,
\quad \Delta \vec r = \vec r - \vec a \,.

class halmd.mdsim.geometries.cylinder(args)

Construct cylinder geometry instance.

Parameters:
  • args (table) – keyword arguments
  • args.centre (table) – cylinder centre
  • args.radius (number) – cylinder 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.

Note

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.

axis

Coordinates of cylinder axis vector, which may have any non-zero length.

offset

Coordinates of axis offset. The offset is an arbitrary point along the cylinder axis.

radius

Cylinder radius.