Skip to content
Snippets Groups Projects
Commit d0cf344f authored by James Graham's avatar James Graham
Browse files

Give warning when no box size set - resolves #4

parent 26f83ed0
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ class CoordReader: ...@@ -9,7 +9,7 @@ class CoordReader:
def __init__(self): def __init__(self):
self.atoms = [] self.atoms = []
self.molecules = [] self.molecules = []
self.cell = [] self.cell = [0, 0, 0]
@property @property
def natoms(self): def natoms(self):
......
...@@ -167,6 +167,9 @@ class PDB2LMP: ...@@ -167,6 +167,9 @@ class PDB2LMP:
print("{0:8d} improper types".format(self.nimpropers.types), file=data) print("{0:8d} improper types".format(self.nimpropers.types), file=data)
print(file=data) print(file=data)
cell = [val / 2 for val in self.coords.cell] cell = [val / 2 for val in self.coords.cell]
if cell == [0, 0, 0]:
print("WARNING: The simulation box/unit cell size is zero.")
print(" If this is not intentional, please check your input files.")
print("{0:8.3f} {1:8.3f} xlo xhi".format(-cell[0], cell[0]), file=data) print("{0:8.3f} {1:8.3f} xlo xhi".format(-cell[0], cell[0]), file=data)
print("{0:8.3f} {1:8.3f} ylo yhi".format(-cell[1], cell[1]), file=data) print("{0:8.3f} {1:8.3f} ylo yhi".format(-cell[1], cell[1]), file=data)
print("{0:8.3f} {1:8.3f} zlo zhi".format(-cell[2], cell[2]), file=data) print("{0:8.3f} {1:8.3f} zlo zhi".format(-cell[2], cell[2]), file=data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment