Merge pull request #1701 from athomps/neigh_check_distance_box

Fixed error in neighbor distance check for box dimensions
This commit is contained in:
Axel Kohlmeyer 2019-10-05 14:10:03 +02:00 committed by GitHub
commit 043606d351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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;