Fix BondMaker.put_atom_in_box
Was only populating 8 out of 14 necessary boxes. Fixes https://github.com/jensengroup/propka/issues/97
This commit is contained in:
@@ -392,14 +392,27 @@ class BondMaker:
|
|||||||
z: box z-coordinates
|
z: box z-coordinates
|
||||||
atom: the atom to place in a box
|
atom: the atom to place in a box
|
||||||
"""
|
"""
|
||||||
for box_x in [x, x+1]:
|
for (dx, dy, dz) in [
|
||||||
for box_y in [y, y+1]:
|
(-1, -1, -1),
|
||||||
for box_z in [z, z+1]:
|
(-1, -1, 0),
|
||||||
key = (box_x, box_y, box_z)
|
(-1, -1, 1),
|
||||||
try:
|
(-1, 0, -1),
|
||||||
self.boxes[key].append(atom)
|
(-1, 0, 0),
|
||||||
except KeyError:
|
(-1, 0, 1),
|
||||||
pass
|
(-1, 1, -1),
|
||||||
|
(-1, 1, 0),
|
||||||
|
(-1, 1, 1),
|
||||||
|
(0, -1, -1),
|
||||||
|
(0, -1, 0),
|
||||||
|
(0, -1, 1),
|
||||||
|
(0, 0, -1),
|
||||||
|
(0, 0, 0),
|
||||||
|
]:
|
||||||
|
key = (x + dx, y + dy, z + dz)
|
||||||
|
try:
|
||||||
|
self.boxes[key].append(atom)
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def has_bond(atom1, atom2):
|
def has_bond(atom1, atom2):
|
||||||
|
|||||||
Reference in New Issue
Block a user