Commit f965d27f authored by peastman's avatar peastman
Browse files

Fixed error adding triclinic solvent boxes

parent ebcd9740
...@@ -407,12 +407,17 @@ class Modeller(object): ...@@ -407,12 +407,17 @@ class Modeller(object):
if len(self.positions) == 0: if len(self.positions) == 0:
positions = [] positions = []
else: else:
positions = self.positions.value_in_unit(nanometer) positions = self.positions.value_in_unit(nanometer)[:]
cells = {} cells = {}
numCells = tuple((max(1, int(floor(box[i]/maxCutoff))) for i in range(3))) numCells = tuple((max(1, int(floor(box[i]/maxCutoff))) for i in range(3)))
cellSize = tuple((box[i]/numCells[i] for i in range(3))) cellSize = tuple((box[i]/numCells[i] for i in range(3)))
for i in range(len(positions)): for i in range(len(positions)):
cell = tuple((int(floor(positions[i][j]/cellSize[j]))%numCells[j] for j in range(3))) pos = positions[i]
pos = pos - floor(pos[2]*invBox[2])*vectors[2]
pos -= floor(pos[1]*invBox[1])*vectors[1]
pos -= floor(pos[0]*invBox[0])*vectors[0]
positions[i] = pos
cell = tuple((int(floor(pos[j]/cellSize[j]))%numCells[j] for j in range(3)))
if cell in cells: if cell in cells:
cells[cell].append(i) cells[cell].append(i)
else: else:
......
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