Accessing etotal compute

Hi Ankur,

I think you can use two different computes for “ke” and “pe” and then if you sum them, you should get the total energy. You can match it with “etotal” output in the output logfile.

compute ake all ke

compute ape all pe

variable equal c_ake+c_ape

Thanks,
Sanat

Hi

Thanks for the reply. But as I mentioned in my mail, I had tried the exact same thing. Storing of the sum of 2 energies in a variable. But lammps discards it as illegal variable command.

Hi
Thanks for the reply. But as I mentioned in my mail, I had tried the exact
same thing. Storing of the sum of 2 energies in a variable. But lammps
discards it as illegal variable command.

you have to study the documentation more carefully. if LAMMPS issues
an "illegal variable command" error, then you command is incorrect.
also, you don't have to do such a complex computation, because all
properties available for thermo_style custom are also available to
equal style variables.

axel.

I have gone through the documentation quite rigorously. But it is such an elementary operation that I am performing. Can you please tell me the errror I am making cause its just 3 commands?

See I have gone through the manual. But, there are some things that you learn only with discussion. That is the purpose of this page isn’t it?

See I have gone through the manual. But, there are some things that you
learn only with discussion. That is the purpose of this page isn't it?

yes, there are certain thing, that one learns from a discussion, but
such basic mistakes that very obviously are not following the
documentation (and where LAMMPS even tells you that your input is not
correct) does not fall into that category.

you may have gone through the documentation, but most certainly you
were not very careful and thorough. it is *not* the purpose of the
mailing list, that you just post something that you guess might work
and seem to expect that people just figure out what you want and then
give you the correct answer. this mailing list is *not* such a
service.
you violated several syntax requirements, you are mixing up variable
expansion rules, refer to items that don't exist, while sanat's
example is correct. have you actually tried it??

if you are given advice, the least that people can expect, that you
make an effort to follow it and not just dismiss it right away.

the LAMMPS developers put a significant effort to have an accurate
documentation, and thus if you follow the documentation carefully,
there should be no errors. lots of people have read the manual and
were able use LAMMPS correctly, you need to ask yourself why you are
not able to do that, too. there are plenty of examples. so at the very
least, you should produce syntactically correct LAMMPS input, i.e.
something that does not produce any errors. if such a command does not
output the information that it should - according to the documentation
- or you are trying to do something rather complex, then we can
discuss.

axel.