[ase-users] Problem reading lammps dump files
Sebastian Echeverri
sebastianecheverrir at gmail.com
Fri Mar 12 16:22:34 CET 2021
My file dump.prd uses unwrapped atom coordinates (xu,yu,zu) and this type
of coordinates are not defined in ASE's file "lammpsrun.py".
Adding this after line 114 of "lammpsrun.py" seems to fix the problem, but
i am not sure if it breaks something else.
positions = get_quantity(["xu", "yu", "zu"], "distance")
On Fri, 12 Mar 2021 at 12:51, Sebastian Echeverri <
sebastianecheverrir at gmail.com> wrote:
> Dear Ase Users,
>
> I am trying to read a dump file from Lammps, you will find it attached
> (dump.prd).
>
> The commands that I am using are the following:
>
> from ase.io import read
> AtomsInTime = read(filename="dump.prd", format="lammps-dump-text")
>
> And i am getting the error that you will find below.
>
> Any ideas of what might be the problem?
> Python 3.7.6
> ase 3.21.1
>
> Regards,
> Sebastián
> dump.prd
> <https://drive.google.com/file/d/1EjlZmF59lD_jrTP0GtTUGyNMq8qcJuqL/view?usp=drive_web>
>
> Traceback (most recent call last):
> File "writeLammpsFilesASE.py", line 30, in <module>
> AtomsInTime = read(filename="dump.prd", format="lammps-dump-text")
> File
> "/home/sebastian/.local/lib/python3.7/site-packages/ase/io/formats.py",
> line 683, in read
> parallel=parallel, **kwargs))
> File
> "/home/sebastian/.local/lib/python3.7/site-packages/ase/parallel.py", line
> 273, in new_generator
> for result in generator(*args, **kwargs):
> File
> "/home/sebastian/.local/lib/python3.7/site-packages/ase/io/formats.py",
> line 749, in _iread
> for dct in io.read(fd, *args, **kwargs):
> File
> "/home/sebastian/.local/lib/python3.7/site-packages/ase/io/formats.py",
> line 505, in wrap_read_function
> for atoms in read(filename, index, **kwargs):
> File
> "/home/sebastian/.local/lib/python3.7/site-packages/ase/io/lammpsrun.py",
> line 289, in read_lammps_dump_text
> **kwargs
> File
> "/home/sebastian/.local/lib/python3.7/site-packages/ase/io/lammpsrun.py",
> line 183, in lammps_data_to_ase_atoms
> return out_atoms
> UnboundLocalError: local variable 'out_atoms' referenced before assignment
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20210312/6b67ad7d/attachment.htm>
More information about the ase-users
mailing list