hoomd.data¶
Overview
Provides context manager access to HOOMD-blue CPU data buffers. |
|
Provides context manager access to HOOMD-blue GPU data buffers. |
|
Class for directly accessing HOOMD-blue angle data. |
|
Class for directly accessing HOOMD-blue bond data. |
|
Class for directly accessing HOOMD-blue constraint data. |
|
Class for directly accessing HOOMD-blue dihedral data. |
|
Class for directly accessing HOOMD-blue improper data. |
|
Class for directly accessing HOOMD-blue special pair data. |
|
Class for directly accessing HOOMD-blue particle data. |
|
Details
-
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.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.-
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.
-
property
-
class
hoomd.data.
LocalSnapshotGPU
(*args, **kwargs)¶ Provides context manager access to HOOMD-blue GPU 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.array.HOOMDGPUArray
object which prevents invalid memory accesses.-
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.
-
property
-
class
hoomd.data.
AngleLocalAccessBase
(state)¶ Class for directly accessing HOOMD-blue angle data.
-
typeid
¶ The integer type of a angle.
- Type
(N_angles)
hoomd.data.array
object ofint
-
members
¶ The tags of particles in a angle.
- Type
(N_angles, 3)
hoomd.data.array
object ofint
-
tag
¶ The tag of the angle. HOOMD-blue uses spacial sorting to improve cache efficiency in angle look-ups. This means the ordering of the array changes. However, angle tags remain constant. This means that if
angle.tag[0]
is 1, then later whatever angle has a tag of 1 later in the simulation is the same angle.- Type
(N_angles)
hoomd.data.array
object ofint
-
rtag
¶ The reverse tag of a angle. This means that the value
angle.rtag[0]
represents the current index for accessing data for the angle with tag 0.- Type
(N_angles_global)
hoomd.data.array
object ofint
-
-
class
hoomd.data.
BondLocalAccessBase
(state)¶ Class for directly accessing HOOMD-blue bond data.
-
typeid
¶ The integer type of a bond.
- Type
(N_bonds)
hoomd.data.array
object ofint
-
members
¶ The tags of particles in a bond.
- Type
(N_bonds, 2)
hoomd.data.array
object ofint
-
tag
¶ The tag of the bond. HOOMD-blue uses spacial sorting to improve cache efficiency in bond look-ups. This means the ordering of the array changes. However, bond tags remain constant. This means that if
bond.tag[0]
is 1, then later whatever bond has a tag of 1 later in the simulation is the same bond.- Type
(N_bonds)
hoomd.data.array
object ofint
-
rtag
¶ the reverse tag of a bond. This means that the value
bond.rtag[0]
represents the current index to access data for the bond with tag 0.- Type
(N_bonds_global)
hoomd.data.array
object ofint
-
-
class
hoomd.data.
ConstraintLocalAccessBase
(state)¶ Class for directly accessing HOOMD-blue constraint data.
-
value
¶ The constaint value.
- Type
(N_constraints)
hoomd.data.array
object offloat
-
members
¶ the tags of particles in a constraint.
- Type
(N_constraints, 3)
hoomd.data.array
object ofint
-
tag
¶ The tag of the constraint. HOOMD-blue uses spacial sorting to improve cache efficiency in constraint look-ups. This means the ordering of the array changes. However, constraint tags remain constant. This means that if
constraint.tag[0]
is 1, then later whatever constraint has a tag of 1 later in the simulation is the same constraint.- Type
(N_constraints)
hoomd.data.array
object ofint
-
rtag
¶ The reverse tag of a constraint. This means that the value
constraint.rtag[0]
represents the current index for accessing data for the constraint with tag 0.- Type
(N_constraints_global)
hoomd.data.array
object ofint
-
-
class
hoomd.data.
DihedralLocalAccessBase
(state)¶ Class for directly accessing HOOMD-blue dihedral data.
-
typeid
¶ The integer type of a dihedral.
- Type
(N_dihedrals)
hoomd.data.array
object ofint
-
members
¶ the tags of particles in a dihedral.
- Type
(N_dihedrals, 3)
hoomd.data.array
object ofint
-
tag
¶ The tag of the dihedral. HOOMD-blue uses spacial sorting to improve cache efficiency in dihedral look-ups. This means the ordering of the array changes. However, dihedral tags remain constant. This means that if
dihedral.tag[0]
is 1, then later whatever dihedral has a tag of 1 later in the simulation is the same dihedral.- Type
(N_dihedrals)
hoomd.data.array
object ofint
-
rtag
¶ The reverse tag of a dihedral. This means that the value
dihedral.rtag[0]
represents the current index for accessing data for the dihedral with tag 0.- Type
(N_dihedrals_global)
hoomd.data.array
object ofint
-
-
class
hoomd.data.
ImproperLocalAccessBase
(state)¶ Class for directly accessing HOOMD-blue improper data.
-
typeid
¶ The integer type of a improper.
- Type
(N_impropers)
hoomd.data.array
object ofint
-
members
¶ The tags of particles in a improper.
- Type
(N_impropers, 3)
hoomd.data.array
object ofint
-
tag
¶ The tag of the improper. HOOMD-blue uses spacial sorting to improve cache efficiency in improper look-ups. This means the ordering of the array changes. However, improper tags remain constant. This means that if
improper.tag[0]
is 1, then later whatever improper has a tag of 1 later in the simulation is the same improper.- Type
(N_impropers)
hoomd.data.array
object ofint
-
rtag
¶ The reverse tag of a improper. This means that the value
improper.rtag[0]
represents the current index for accessing data for the improper with tag 0.- Type
(N_impropers_global)
hoomd.data.array
object ofint
-
-
class
hoomd.data.
PairLocalAccessBase
(state)¶ Class for directly accessing HOOMD-blue special pair data.
-
typeid
¶ The type of special pair.
- Type
(N_pairs)
hoomd.data.array
object offloat
-
members
¶ the tags of particles in a special pair.
- Type
(N_pairs, 3)
hoomd.data.array
object ofint
-
tag
¶ The tag of the special pair. HOOMD-blue uses spacial sorting to improve cache efficiency in special pair look-ups. This means the ordering of the array changes. However, special pair tags remain constant. This means that if
special pair.tag[0]
is 1, then later whatever special pair has a tag of 1 later in the simulation is the same special pair.- Type
(N_special_pairs)
hoomd.data.array
object ofint
-
rtag
¶ The reverse tag of a special pair. This means that the value
special pair.rtag[0]
represents the current index for accessing data for the special pair with tag 0.- Type
(N_special_pairs_global)
hoomd.data.array
object ofint
-
-
class
hoomd.data.
ParticleLocalAccessBase
(state)¶ Class for directly accessing HOOMD-blue particle data.
-
type
¶ The integer type of a particle
- Type
(N_particles)
hoomd.data.array
object offloat
-
tag
¶ The tag of a particle. HOOMD-blue uses spacial sorting to improve cache efficiency in particle look-ups. This means the ordering of the array changes. However, particle tags remain constant. This means that if
particles.tag[0]
is 1, then later whatever particle has a tag of 1 later in the simulation is the same particle.- Type
(N_particles)
hoomd.data.array
object ofint
-
rtag
¶ The reverse tag of a particle. This means that the value
particles.rtag[0]
represents the current index accessing data for the particle with tag 0.- Type
(N_particles_global)
hoomd.data.array
object ofint
-
position
¶ particle positions
- Type
(N_particles, 3)
hoomd.data.array
object offloat
-
image
¶ The periodic image a particle occupies
- Type
(N_particles, 3)
hoomd.data.array
object ofint
-
velocity
¶ particle velocities
- Type
(N_particles, 3)
hoomd.data.array
object offloat
-
acceleration
¶ particle accelerations
- Type
(N_particles, 3)
hoomd.data.array
object offloat
-
mass
¶ particles’ masses
- Type
(N_particles)
hoomd.data.array
object offloat
-
orientation
¶ particle orientations expressed as quaternions
- Type
(N_particles, 4)
hoomd.data.array
object offloat
-
angular_momentum
¶ particle angular momenta expressed as quaternions
- Type
(N_particles, 4)
hoomd.data.array
object offloat
-
moment_of_inertia
¶ particle principal moments of inertia
- Type
(N_particles, 3)
hoomd.data.array
object offloat
-
charge
¶ particle electrical charges
- Type
(N_particles)
hoomd.data.array
object offloat
-
diameter
¶ particle diameters
- Type
(N_particles)
hoomd.data.array
object offloat
-
rigid_body_id
¶ The id of the rigid body the particle is in.
- Type
(N_particles)
hoomd.data.array
object ofint
-
net_force
¶ net force on particle
- Type
(N_particles, 3)
hoomd.data.array
object offloat
-
net_torque
¶ net torque on particle
- Type
(N_particles, 3)
hoomd.data.array
object offloat
-
net_virial
¶ net virial on particle
- Type
(N_particles, 3)
hoomd.data.array
object offloat
Note
That changing some attributes like (
velocity
oracceleration
) may not change the trajectory of the system. Integration of the equations of motion do not necessarily use velocity or accleration directly. This is also true in HOOMD-blue’s MD integration methods (seehoomd.md.methods
)-
Modules