pele.utils.rbtools.CoordsAdapter

class pele.utils.rbtools.CoordsAdapter(nrigid=None, natoms=None, 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)

Attributes

coords  
lattice  
posAtoms  
posRigid  
rotRigid  

Methods

copy()
updateCoords(coords) update the coordinate array

Next topic

pele.utils.rbtools.CoordsAdapter.copy