Dear Lammps developers,
I am simulating a 2D system of particles with granular hooke contact force:
pair_style gran/hooke {knAbs} 0 {gammanAbs} 0 0 0
pair_coeff * *
fix integr all nve/sphere
fix stick_id all enforce2d
To apply shearing, I deform the box with a shear rate shearRate:
fix boxDeform all deform 1 xy erate ${shearRate} remap v
Then I dump particles that have overlap:
compute 1 all property/local patom1 patom2 cutoff radius
and I dump distance and force between them:
compute 2 all pair/local dist force fx fy fz cutoff radius
I also dump position of all particles
dump dmp3 all custom ${dumpSteps} dump.all.* id radius mass x y z vx vy vz omegax omegay omegaz
After all, I get positions of contacting particles from the dump
files (x1, y1) and (x2, y2), then I calculate the distance between them. I consider
periodic distance between them if they have an over-boundary
contacts (this is simply done by adding/subtracting the box
length):
dx = x1 - x2
dy = y1 - y2
for over-boundary contacts
dx = periodic(dx)
dy = periodic(dy)
and the calculate the distance
dist = sqrt( dx * dx + dy * dy )
Then I compare this distance with the one which is provided by
Lammps in the dump file.
I am surprised that they are very different!
The difference starts from 10% up to 100%. The latter for
contacts that are over boundaries.
I have cross-checked my calculations more than a week!
Apparently for the deformed box the distance is calculated via a
different formula, maybe something like
dx = x1 - x2 -/+ shearRate * (some time scale) * (box length)
Would you mind please let me know how the distance in deformed
box is calculated.
Can you refer me to to that line in the code so I can see it exactly.
In advance, I appreciate your kind help.