I need to read multiple restart files in order to get the value of some variables at given time steps. I need it because I have overwritten my output files when restarting the calculation. I know, I should have included a time-step variable in the filename.
I have performed GCMC calculation and I want to plot the number of molecules absorbed in a pore with respect to the time-step. So I have written a small Python script that is supposed to read all the restart files and get the number of molecules. Here is the first test :
from lammps import IPyLammps
L = IPyLammps()
files = os.listdir(".")
L.variable(“nO equal count(oxygen)”)
It worked. Then I tried to add a loop :
for filename in files:
It crashed systematically. I tried with one iteration “for i in range(1)” and by replacing filename by one of the filename. It crashed too. I tried with “from lammps import lammps”. It crashed too. I tried with a time.sleep(10) before and after the read. It crashed. Is it a bug or did I do something wrong ?
Thanks for your help,