I’m having trouble with the precision of variables in LAMMPS. The simplest way I can reproduce the problem is with the input file below. I’ve copied the potential energy into two variables and printed them after each run command.
…
variable pe1 equal pe
thermo_style custom pe v_pe1
thermo_modify format float %20.16f
run 0
variable pe2 equal v_pe1
thermo_style custom pe v_pe1 v_pe2
thermo_modify format float %20.16f
run 0
The output below shows the last variable (pe2) truncated to 6 decimals instead of the expected 16. Is there a reason for this?
I'm having trouble with the precision of variables in LAMMPS. The simplest
way I can reproduce the problem is with the input file below. I've copied
the potential energy into two variables and printed them after each run
command.
a) please always state which version of LAMMPS you are using
b) please always provide a *complete* input, not just a few lines.
in your case, it is also important to know, if you use any GPU acceleration.
I'm using the May 5th, 2012 version of LAMMPS without any GPU acceleration
please update to a current version. the internal precision has been
adjusted since. 16 digits is still beyond the "capacity" of double
precision floating point numbers. due to the way how variables in
LAMMPS work internally, you cannot expect the full double precision
detail let alone IEEE 754 compliance either. in the best case you get
a little less.
with setting pppm precision as low as 1e-4 this is a pointless exercise, anyway.
I'm using the May 5th, 2012 version of LAMMPS without any GPU acceleration
please update to a current version. the internal precision has been
adjusted since. 16 digits is still beyond the "capacity" of double
precision floating point numbers. due to the way how variables in
LAMMPS work internally, you cannot expect the full double precision
detail let alone IEEE 754 compliance either. in the best case you get
a little less.
with setting pppm precision as low as 1e-4 this is a pointless exercise, anyway.
not to mention a LJ cutoff of 1.0 angstrom. what is the reason for that?