LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] error when running python script to call lammps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] error when running python script to call lammps


From: Steve Plimpton <sjplimp@...24...>
Date: Tue, 19 Sep 2017 08:45:32 -0600

I have no idea why piping the output to script.output would
fail with that kind of error.  Maybe Richard (CCd) has an idea.

Steve

On Mon, Sep 18, 2017 at 11:38 PM, Shenli Zhang <shlzhang@...584...> wrote:
Dear Lammps users,

I've wrote a python script (attached) to call Lammps and do some analysis. However, I found the script runs fine if I directly use:
python script.py 

but will generate the following error if I use:
python script.py>script.output

Error message:

File "regional_diffusion_lammps_Pyversion.py", line 55, in <module>
    extract_y(12, 40.129, 64.129, 92.258, 2)
  File "regional_diffusion_lammps_Pyversion.py", line 21, in extract_y
    y=L.atoms[i].position[1]
  File "/share/apps/lammps-11Aug17/python/lammps.py", line 643, in atoms
    return AtomList(self)
  File "/share/apps/lammps-11Aug17/python/lammps.py", line 465, in __init__
    self.natoms = self.lmp.system.natoms
  File "/share/apps/lammps-11Aug17/python/lammps.py", line 648, in system
    d = self._parse_info_system(output)
  File "/share/apps/lammps-11Aug17/python/lammps.py", line 699, in _parse_info_system
    lines = output[6:-2]
TypeError: 'NoneType' object has no attribute '__getitem__'

Could you please help with this problem? Thank you!
--
Shenli Zhang

Graduate Student of Materials Science
University of California, Davis

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
lammps-users mailing list
lammps-users@...6297....sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lammps-users