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 thehoomd.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 aLocalSnapshot
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 withghost_
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.
- property bonds¶
Local bond data.
- property constraints¶
Local constraint data.
- property dihedrals¶
Local dihedral data.
- property impropers¶
Local improper data.
- property pairs¶
Local special pair data.
- property particles¶
Local particle data.