pele.utils.rbtools.CoordsAdapter#
- class pele.utils.rbtools.CoordsAdapter(nrigid=0, natoms=0, nlattice=0, coords=None)[source]#
Wrapper to access coordinate array for rigid body systems
The CoordsAdapter is a wrapper for a coords array. It creates views to directly access rigid body position & rotations, atom positions and lattice coordinates. This offers a convenient way to access coorinates without the hazzle of indexing
- Example:
>>> import numpy as np >>> from pele.utils.rbtools import CoordsAdapter >>> >>> nrigid = 10 >>> coords = np.zeros(6*nrigid) >>> ca = CoordsAdapter(nrigid=nrigid, coords=coords) >>> >>> ca.posRigid[0] = np.random.random(3) >>> ca.rotRigid[0] = np.random.random(3)
Methods
|
|
|
update the coordinate array |
Attributes
coordinate array |
|
array view for lattice coordinates of dimension [nlattice] |
|
number of single atoms |
|
number of lattice degrees of freedom |
|
number of rigid bodies |
|
array view for atom positions of dimension [3,nrigid] |
|
array view for rigid body positions of dimension [3,nrigid] |
|
array view for rigid body rotations of dimension [3,nrigid] |