Commit db981228 authored by Remi Perenon's avatar Remi Perenon
Browse files

LAMMPS files can have '<x,y,z>' or '<x,y,z>u' as column index for real coordinates

parent 27cede41
......@@ -306,23 +306,25 @@ class LAMMPSConverter(Converter):
self._id = keywords.index("id")
self._type = keywords.index("type")
# Field name is <x,y,z>u if real coordinates and <x,y,z>s if fractional ones
try:
self._x = keywords.index("xu")
self._y = keywords.index("yu")
self._z = keywords.index("zu")
except ValueError:
try:
self._x = keywords.index("xs")
self._y = keywords.index("ys")
self._z = keywords.index("zs")
except ValueError:
raise LAMMPSTrajectoryFileError("No coordinates could be found in the trajectory")
else:
self._fractionalCoordinates = True
else:
self._fractionalCoordinates = False
# Field name is <x,y,z> or cd ..<x,y,z>u if real coordinates and <x,y,z>s if fractional ones
self._fractionalCoordinates = False
try:
self._x = keywords.index("x")
self._y = keywords.index("y")
self._z = keywords.index("z")
except ValueError:
try:
self._x = keywords.index("xu")
self._y = keywords.index("yu")
self._z = keywords.index("zu")
except ValueError:
try:
self._x = keywords.index("xs")
self._y = keywords.index("ys")
self._z = keywords.index("zs")
self._fractionalCoordinates = True
except ValueError:
raise LAMMPSTrajectoryFileError("No coordinates could be found in the trajectory")
self._rankToName = {}
......
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