Loading Universe from LAMMPS dump file

669 views
Skip to first unread message

Rui Apóstolo

unread,
Oct 24, 2018, 12:42:12 PM10/24/18
to MDnalysis discussion
Hi,

I'm a PhD student trying to use MDAnalysis on my LAMMPS simulations (inorganic systems, not proteins). I'm not an advanced python programmer, I'm still learning it, so sorry for any basic mistake (I've tried googling, but no dice).

I get the error:
ValueError: too many values to unpack
when running:
u = MDanalysis.Universe("8pol.water.data", "nvt.lammpsdump", atom_style='id type x y z vx vy vz')
(Entire console error output and 'head' of dumpfile at the end of this message)

I've also tried using 
atom_style='id type x y z'
with the same result.

I made sure I'm using MDAnalysis version 19.0, let me know if I missed any important information.

Thank you very much,
Rui


Dumpfile head:
ITEM: TIMESTEP
0
ITEM
: NUMBER OF ATOMS
31570
ITEM
: BOX BOUNDS pp pp pp
0.0000000000000000e+00 8.0000000000000000e+01
0.0000000000000000e+00 8.0000000000000000e+01
-8.0000000000000000e+01 2.4000000000000000e+02
ITEM
: ATOMS id type x y z vx vy vz
1 16 22.5317 44.9029 106.73 0 0 0
2 17 23.1111 44.9414 107.483 0 0 0
3 16 24.0051 44.8964 107.162 0 0 0
4 16 3.93061 36.1412 46.2014 0 0 0
5 17 4.49035 36.1376 46.97 0 0 0
6 16 5.33654 35.7907 46.7097 0 0 0
7 16 51.2333 1.75737 74.8064 0 0 0
8 17 51.6748 1.40987 74.0393 0 0 0
9 16 52.4817 1.00009 74.3311 0 0 0
10 16 30.6156 76.564 93.9465 0 0 0


Entire console log:
Traceback (most recent call last):
 
File "rdf_script.py", line 8, in <module>
    u
= mda.Universe("8pol.water.data", "nvt.lammpsdump", atom_style='id type x y z vx vy vz')
 
File "/usr/local/lib/python2.7/dist-packages/MDAnalysis/core/universe.py", line 335, in __init__
   
self.load_new(coordinatefile, **kwargs)
 
File "/usr/local/lib/python2.7/dist-packages/MDAnalysis/core/universe.py", line 602, in load_new
   
self.trajectory = reader(filename, **kwargs)
 
File "/usr/local/lib/python2.7/dist-packages/MDAnalysis/coordinates/LAMMPS.py", line 477, in __init__
   
self._read_next_timestep()
 
File "/usr/local/lib/python2.7/dist-packages/MDAnalysis/coordinates/LAMMPS.py", line 565, in _read_next_timestep
    idx
, _, xs, ys, zs = f.readline().split()
ValueError: too many values to unpack

Rui Apóstolo

unread,
Oct 30, 2018, 7:32:49 AM10/30/18
to MDnalysis discussion
I'd like to correct my previous message. Using:

u = mda.Universe("8pol.water.data", "nvt.lammpsdump", atom_style='id type x y z', topology_format="LAMMPS", format="LAMMPS")

results in the following error:

Traceback (most recent call last):

 
File "rdf_script.py", line 11, in <module>
    u
= mda.Universe("8pol.water.data", "nvt.lammpsdump", atom_style='id type x y z', topology_format="LAMMPS", format="LAMMPS")
 
File "/usr/local/lib/python2.7/dist-packages/MDAnalysis/core/universe.py", line 309, in __init__
   
"Error: {2}".format(self.filename, parser, err))
ValueError: Failed to construct topology from file 8pol.water.data with parser <class 'MDAnalysis.topology.MinimalParser.MinimalParser'>.
Error: DATAReader cannot deduce the number of atoms

Cheers,
Rui

Richard Gowers

unread,
Nov 5, 2018, 9:37:09 AM11/5/18
to MDnalysis discussion
Hi Rui

It looks like this is a bug in the parser, it can't read the dump file with the velocity columns currently.

I'll look into this...

Richard
Reply all
Reply to author
Forward
0 new messages