Commit 3c79fb84 authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #1752 from peastman/solvent

Fixed error adding triclinic solvent boxes
parents ebcd9740 f965d27f
......@@ -407,12 +407,17 @@ class Modeller(object):
if len(self.positions) == 0:
positions = []
else:
positions = self.positions.value_in_unit(nanometer)
positions = self.positions.value_in_unit(nanometer)[:]
cells = {}
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)))
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:
cells[cell].append(i)
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