LocalSnapshot

class hoomd.data.LocalSnapshot(state)

Provides context manager access to HOOMD-blue CPU data buffers.

The interface of a LocalSnapshot is similar to that of the hoomd.Snapshot. Data is MPI rank local so for MPI parallel simulations only the data possessed by a rank is exposed. This means that users must handle the domain decomposition directly. One consequence of this is that access to ghost particle data is provided. A ghost particle is a particle that is not owned by a rank, but nevertheless is required for operations that use particle neighbors. Also, changing the global or local box within a LocalSnapshot context manager is not allowed.

For every property (e.g. data.particles.position), only grabs the data for the regular (non-ghost) particles. The property can be prefixed with ghost_ to grab the ghost particles in a read only manner. Likewise, suffixing with _with_ghost will grab all data on the rank (regular and ghost particles) in a read only array.

All array-like properties return a hoomd.data.array.HOOMDArray object which prevents invalid memory accesses.

Note

For the LocalAccess classes the affixed attributes mentioned above are not shown. Also of interest, ghost data always come immediately after the regular data.

See also

Access the local snapshot of a state via hoomd.State.cpu_local_snapshot.

property angles

Local angle data.

Type:

hoomd.data.AngleLocalAccessBase

property bonds

Local bond data.

Type:

hoomd.data.BondLocalAccessBase

property constraints

Local constraint data.

Type:

hoomd.data.ConstraintLocalAccessBase

property dihedrals

Local dihedral data.

Type:

hoomd.data.DihedralLocalAccessBase

property global_box

The global simulation box.

Type:

hoomd.Box

property impropers

Local improper data.

Type:

hoomd.data.ImproperLocalAccessBase

property local_box

The local box according to the domain decomposition.

Type:

hoomd.Box

property pairs

Local special pair data.

Type:

hoomd.data.PairLocalAccessBase

property particles

Local particle data.

Type:

hoomd.data.ParticleLocalAccessBase