read_data in loop

Hello everybody,

I want to minimize the energy of multiple input geometries. Therefore I loop
over several data-files via

"read_data $a.data"

where the name of the data file is a variable. However, this results in the
error

"Cannot read_data after simulation box is defined"

and the LAMMPS help explains

"The read_data command cannot be used after a read_data, read_restart, or
create_box command."

While the explanation is clear to me, I wonder if and how I can loop over
different input geometries. Any help is greatly appreciated!

Best regards,

Manuel

If you want to run a series of simulations, e.g.:

read_data ...
minimize ...
read_data ...
minimize

Then just put a "clear" command between them. You
can do that in a loop with a list of input data files defined
by a variable.

Steve