Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 156 by
White.D....@gmail.com: Periodic Boundary Treatment in
AtomGroup
http://code.google.com/p/mdanalysis/issues/detail?id=156
I've noticed there's no accounting for periodic boundary conditions for the
AtomGroup methods. Many of the methods that rely on atom distances don't
use the minimum image convention. I'd like to put this as an issue, because
these implementations are not correct in cases when AtomGroups extend
across boundaries. I know it's very time consuming to fix these
implementations, but perhaps there is a way of warning the user or noting
in the documentation that they do not account for periodic boundaries.
Here's an example:
def centerOfMass(self):
"""Center of mass of the selection."""
return
numpy.sum(self.coordinates()*self.masses()[:,numpy.newaxis],axis=0)/self.totalMass()
This will not give the correct center of mass.
This code here, will not give the correct atom-atom distance if the atoms
are not in the same image:
def bond(self):
"""Returns the distance between atoms in a 2-atom group.
Distance between atoms 0 and 1::
0---1
.. Note::
Only makes sense for a :class:`AtomGroup` with exactly 2
:class:`Atom`; anything else will raise a
:exc:`ValueError`.
.. versionadded:: 0.7.3
"""
if len(self) != 2:
raise ValueError("distance computation only makes sense for
a group with exactly 2 atoms")
return numpy.linalg.norm(self[0].pos - self[1].pos)
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings