how to calculate the elastic constants for a series of data files?

Dear lammps users,

I want to calculate the elastic constants for a series of atomic structure files, in data format. I tried insert loop command in example/in.elastic like this:

label loop

variable LoopVar loop 3

include init.mod

read_data diamond${LoopVar}.dat

include potential.mod

But I got error messages: Units command after simulation box is defined

Then I displaced the units part beyond the loop body, And got another error: Cannot read_data without add keyword after simulation box is defined

Could anyone tell me how to revise the command?

If you want to run essentially the same script over and over,
perhaps with a different data file and log file, then you need to put a “clear”
command at the end, so that commands like units and read_data
can be repeated. The names of the data and log file can be variables
that vary from run to run. Or you could make each run in a different
directory (still need the clear command). See the Howto multiple
section of the manual for example scripts.

Steve

Dear lammps users,

I want to calculate the elastic constants for a series of atomic structure files, in data format. I tried insert loop command in example/in.elastic like this:

label loop

variable LoopVar loop 3

include init.mod

read_data diamond${LoopVar}.dat

include potential.mod

But I got error messages: Units command after simulation box is defined

Then I displaced the units part beyond the loop body, And got another error: Cannot read_data without add keyword after simulation box is defined

Could anyone tell me how to revise the command?

you have to insert a “clear” command at the beginning of your loop to remove the whole previous system definition.

axel.