Dear LAMMPS user,

I work on a simulation box which is divided into different regions and I am going to fill each of them with specific orientation.

Now, the question is: when I choose my box’s & ever region’s dimension based on lattice parameter, the result is:

Step Press Temp TotEng PotEng Lx Ly Lz

0 nan 0 inf inf 7.04 14.08 3.52

1 nan 0 inf inf 7.04 14.08 3.52

but, when the size of the box is something optional (I mean: differ from lattice multiples), the result is OK.

I am really interested in knowing the reason.

Sincerely,

Lili

When you have regions where the boundaries are exactly on the lattice points, then it becomes ambiguous whether to include atoms or not. with floating point math it may not always be possible to represent numbers exactly, so it may happen that atoms are included or excluded in unpredicted ways.

When you have regions sharing the boundary and use them to create atoms, then you run a very high risk that you will create atoms at the same lattice point from multiple regions. Those would then lead to the NaN values since in many potential functions the energy (or force) term contains a division by the distance and dividing by zero results in infinity and thus you get either NaN or Inf as output.

An alternative way to avoid this is to move the lattice a little bit off-center by using the origin keyword with an option like 0.5 0.5 0.5.

while you may still define the regions using the lattice spacing as units, those will always be based on a 0.0 0.0 0.0 origin.

axel.