forked from lijiext/lammps
Merge pull request #1701 from athomps/neigh_check_distance_box
Fixed error in neighbor distance check for box dimensions
This commit is contained in:
commit
043606d351
|
@ -1941,6 +1941,7 @@ int Neighbor::decide()
|
|||
conservative shrink procedure:
|
||||
compute distance each of 8 corners of box has moved since last reneighbor
|
||||
reduce skin distance by sum of 2 largest of the 8 values
|
||||
if reduced skin distance is negative, set to zero
|
||||
new trigger = 1/2 of reduced skin distance
|
||||
for orthogonal box, only need 2 lo/hi corners
|
||||
for triclinic, need all 8 corners since deformations can displace all 8
|
||||
|
@ -1962,6 +1963,7 @@ int Neighbor::check_distance()
|
|||
delz = bboxhi[2] - boxhi_hold[2];
|
||||
delta2 = sqrt(delx*delx + dely*dely + delz*delz);
|
||||
delta = 0.5 * (skin - (delta1+delta2));
|
||||
if (delta < 0.0) delta = 0.0;
|
||||
deltasq = delta*delta;
|
||||
} else {
|
||||
domain->box_corners();
|
||||
|
@ -1975,6 +1977,7 @@ int Neighbor::check_distance()
|
|||
else if (delta > delta2) delta2 = delta;
|
||||
}
|
||||
delta = 0.5 * (skin - (delta1+delta2));
|
||||
if (delta < 0.0) delta = 0.0;
|
||||
deltasq = delta*delta;
|
||||
}
|
||||
} else deltasq = triggersq;
|
||||
|
|
Loading…
Reference in New Issue