Merge pull request #1759 from akohlmey/hybrid-exclusion-bugfix
Consistent exclusion settings with multiple kspace-like sub-styles in pair hybrid
This commit is contained in:
@ -34,6 +34,7 @@
|
|||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "pair.h"
|
#include "pair.h"
|
||||||
|
#include "pair_hybrid.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "group.h"
|
#include "group.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -374,9 +375,32 @@ void Neighbor::init()
|
|||||||
special_flag[3] = 1;
|
special_flag[3] = 1;
|
||||||
else special_flag[3] = 2;
|
else special_flag[3] = 2;
|
||||||
|
|
||||||
if (force->kspace || force->pair_match("coul/wolf",0) ||
|
// We cannot remove special neighbors with kspace or kspace-like pair styles
|
||||||
force->pair_match("coul/dsf",0) || force->pair_match("thole",0))
|
// 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;
|
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
|
// maxwt = max multiplicative factor on atom indices stored in neigh list
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ class PairHybrid : public Pair {
|
|||||||
friend class FixIntel;
|
friend class FixIntel;
|
||||||
friend class FixOMP;
|
friend class FixOMP;
|
||||||
friend class Force;
|
friend class Force;
|
||||||
|
friend class Neighbor;
|
||||||
friend class Respa;
|
friend class Respa;
|
||||||
friend class Info;
|
friend class Info;
|
||||||
friend class PairDeprecated;
|
friend class PairDeprecated;
|
||||||
|
|||||||
Reference in New Issue
Block a user