how to output strain energy

Dear all,

I want to output the strain energy of global system when using fix nvt/npt/nph command. I define a variable SE as strain energy, and ouput the result to the strain_energy.txt file using fix print.

fix 1 all nvt temp 300 300 0.05

variable E equal f_1[13][1]
fix print all print 100 "${E}" file strain_energy.txt

run 10000

When I run the input file, why there is some error: "mismatch fix in variable formla"?

Best regards,


variable E equal f_1[13][1]

I think you want: variable E equal f_1[N]

The fix nvt command says it outputs a vector
of values, not an array. You will have to
figure out what N should be, based on the
doc page and the length of the preceeding quantities,
e.g. your tchain value.