Merge branch 'master' into library_interface_update
This commit is contained in:
@ -34,6 +34,7 @@
|
||||
#include "comm.h"
|
||||
#include "force.h"
|
||||
#include "pair.h"
|
||||
#include "pair_hybrid.h"
|
||||
#include "domain.h"
|
||||
#include "group.h"
|
||||
#include "modify.h"
|
||||
@ -374,9 +375,32 @@ void Neighbor::init()
|
||||
special_flag[3] = 1;
|
||||
else special_flag[3] = 2;
|
||||
|
||||
if (force->kspace || force->pair_match("coul/wolf",0) ||
|
||||
force->pair_match("coul/dsf",0) || force->pair_match("thole",0))
|
||||
special_flag[1] = special_flag[2] = special_flag[3] = 2;
|
||||
// We cannot remove special neighbors with kspace or kspace-like pair styles
|
||||
// as the exclusion needs to remove the full coulomb and not the damped interaction.
|
||||
// Special treatment is required for hybrid pair styles since Force::pair_match()
|
||||
// will only return a non-NULL pointer if there is only one substyle of the kind.
|
||||
|
||||
if (force->kspace) {
|
||||
special_flag[1] = special_flag[2] = special_flag[3] = 2;
|
||||
} else {
|
||||
PairHybrid *ph = reinterpret_cast<PairHybrid *>(force->pair_match("^hybrid",0));
|
||||
if (ph) {
|
||||
int flag=0;
|
||||
for (int isub=0; isub < ph->nstyles; ++isub) {
|
||||
if (force->pair_match("coul/wolf",0,isub)
|
||||
|| force->pair_match("coul/dsf",0,isub)
|
||||
|| force->pair_match("thole",0,isub))
|
||||
++flag;
|
||||
}
|
||||
if (flag)
|
||||
special_flag[1] = special_flag[2] = special_flag[3] = 2;
|
||||
} else {
|
||||
if (force->pair_match("coul/wolf",0)
|
||||
|| force->pair_match("coul/dsf",0)
|
||||
|| force->pair_match("thole",0))
|
||||
special_flag[1] = special_flag[2] = special_flag[3] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
// maxwt = max multiplicative factor on atom indices stored in neigh list
|
||||
|
||||
@ -1950,6 +1974,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
|
||||
@ -1971,6 +1996,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();
|
||||
@ -1984,6 +2010,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;
|
||||
|
||||
Reference in New Issue
Block a user