Commit d39325d3 authored by Jason Swails's avatar Jason Swails
Browse files

Remove the hard-coded orthogonal box vector code in the PrmtopLoader class.

Again, this will need to be done in the future anyway for general triclinic
support.
parent 3f090c77
...@@ -550,10 +550,7 @@ class PrmtopLoader(object): ...@@ -550,10 +550,7 @@ class PrmtopLoader(object):
x=float(self._raw_data["BOX_DIMENSIONS"][1]) x=float(self._raw_data["BOX_DIMENSIONS"][1])
y=float(self._raw_data["BOX_DIMENSIONS"][2]) y=float(self._raw_data["BOX_DIMENSIONS"][2])
z=float(self._raw_data["BOX_DIMENSIONS"][3]) z=float(self._raw_data["BOX_DIMENSIONS"][3])
return (units.Quantity(beta, units.degree), return (beta, x, y, z)
units.Quantity(x, units.angstrom),
units.Quantity(y, units.angstrom),
units.Quantity(z, units.angstrom))
@property @property
def has_scee_scnb(self): def has_scee_scnb(self):
...@@ -741,10 +738,14 @@ def readAmberSystem(prmtop_filename=None, prmtop_loader=None, shake=None, gbmode ...@@ -741,10 +738,14 @@ def readAmberSystem(prmtop_filename=None, prmtop_loader=None, shake=None, gbmode
# System is periodic. # System is periodic.
# Set periodic box vectors for periodic system # Set periodic box vectors for periodic system
(boxBeta, boxX, boxY, boxZ) = prmtop.getBoxBetaAndDimensions() (boxBeta, boxX, boxY, boxZ) = prmtop.getBoxBetaAndDimensions()
tmp = [[0.0, 0.0, 0.0],[0.0, 0.0, 0.0],[0.0, 0.0, 0.0]]
_box_vectors_from_lengths_angles([boxX, boxY, boxZ],
[boxBeta, boxBeta, boxBeta],
tmp)
d0 = units.Quantity(0.0, units.angstroms) d0 = units.Quantity(0.0, units.angstroms)
xVec = units.Quantity((boxX, d0, d0)) xVec = units.Quantity(tmp[0], u.angstroms)
yVec = units.Quantity((d0, boxY, d0)) yVec = units.Quantity(tmp[1], u.angstroms)
zVec = units.Quantity((d0, d0, boxZ)) zVec = units.Quantity(tmp[2], u.angstroms)
system.setDefaultPeriodicBoxVectors(xVec, yVec, zVec) system.setDefaultPeriodicBoxVectors(xVec, yVec, zVec)
# Set cutoff. # Set cutoff.
...@@ -1264,7 +1265,7 @@ def readAmberCoordinates(filename, asNumpy=False): ...@@ -1264,7 +1265,7 @@ def readAmberCoordinates(filename, asNumpy=False):
>>> directory = os.path.join(os.getenv('YANK_INSTALL_DIR'), 'test', 'systems', 'alanine-dipeptide-explicit') >>> directory = os.path.join(os.getenv('YANK_INSTALL_DIR'), 'test', 'systems', 'alanine-dipeptide-explicit')
>>> crd_filename = os.path.join(directory, 'alanine-dipeptide.inpcrd') >>> crd_filename = os.path.join(directory, 'alanine-dipeptide.inpcrd')
>>> [coordinates, box_vectors] = readAmberCoordinates(crd_filename, read_box=True) >>> [coordinates, box_vectors] = readAmberCoordinates(crd_filename)
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment