[lammps-users] A problem about elastic constant with using the "ELASTIC" example

Dear all

I used the example in LAMMPS to calculate the elastic constant of Si (I do not change anything in /example/ELASTIC), and the program fed me an error:

if \{dir\} == 1 then "variable len0 equal {lx0}"
if 1 == 1 then "variable len0 equal ${lx0}"
ERROR: Illegal if command

I have tried a lot of possible syntax of if command in "displace.mod" file, but it still sand me illegal error. Could someone tell me how to fix it? Thanks a lot!

My version is lammps-19Nov10

Best regards

Linesa Liu

The "1 == 1" just needs quotes around it. That's the new
syntax of the if command. An updated in.elastic will
be in the next patch.


Dear Steve

I use the newest version, and run the program without any error.

Thanks for your helpful advice!

Best regards

Linesa Liu

引述 Steve Plimpton <[email protected]>: