Updating examples, updating multi in info, fixing memory issues in comm/neighbor

This commit is contained in:
Joel Clemmer
2021-02-08 10:50:57 -07:00
parent de1205c5a9
commit 58e4938b0f
5 changed files with 60 additions and 8 deletions

View File

@ -298,18 +298,32 @@ void Comm::modify_params(int narg, char **arg)
// need to reset cutghostuser when switching comm mode
if (mode == Comm::MULTI) cutghostuser = 0.0;
if (mode == Comm::MULTIOLD) cutghostuser = 0.0;
memory->destroy(cutusermulti);
cutusermulti = nullptr;
if(cutusermulti){
memory->destroy(cutusermulti);
cutusermulti = nullptr;
}
if(cutusermultiold){
memory->destroy(cutusermultiold);
cutusermultiold = nullptr;
}
mode = Comm::SINGLE;
} else if (strcmp(arg[iarg+1],"multi") == 0) {
// need to reset cutghostuser when switching comm mode
if (mode == Comm::SINGLE) cutghostuser = 0.0;
if (mode == Comm::MULTIOLD) cutghostuser = 0.0;
if(cutusermultiold){
memory->destroy(cutusermultiold);
cutusermultiold = nullptr;
}
mode = Comm::MULTI;
} else if (strcmp(arg[iarg+1],"multi/old") == 0) {
// need to reset cutghostuser when switching comm mode
if (mode == Comm::SINGLE) cutghostuser = 0.0;
if (mode == Comm::MULTI) cutghostuser = 0.0;
if(cutusermulti){
memory->destroy(cutusermulti);
cutusermulti = nullptr;
}
mode = Comm::MULTIOLD;
} else error->all(FLERR,"Illegal comm_modify command");
iarg += 2;