need to update exclusions with the new atom IDs in case of molecular systems
This commit is contained in:
@ -16,6 +16,7 @@
|
|||||||
#include "atom_vec.h"
|
#include "atom_vec.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
|
#include "special.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ void ResetIDs::command(int narg, char **arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create an atom map if one doesn't exist already
|
// create an atom map if one doesn't exist already
|
||||||
|
|
||||||
int mapflag = 0;
|
int mapflag = 0;
|
||||||
if (atom->map_style == 0) {
|
if (atom->map_style == 0) {
|
||||||
mapflag = 1;
|
mapflag = 1;
|
||||||
@ -93,7 +94,7 @@ void ResetIDs::command(int narg, char **arg)
|
|||||||
// forward_comm_array acquires new IDs for ghost atoms
|
// forward_comm_array acquires new IDs for ghost atoms
|
||||||
|
|
||||||
double **newIDs;
|
double **newIDs;
|
||||||
memory->create(newIDs,nall,1,"reset_ids:newIDs");
|
memory->create(newIDs,nall,1,"reset_ids:newIDs");
|
||||||
|
|
||||||
for (int i = 0; i < nlocal; i++) {
|
for (int i = 0; i < nlocal; i++) {
|
||||||
newIDs[i][0] = tag[i];
|
newIDs[i][0] = tag[i];
|
||||||
@ -105,7 +106,7 @@ void ResetIDs::command(int narg, char **arg)
|
|||||||
// loop over bonds, angles, etc and reset IDs in stored topology arrays
|
// loop over bonds, angles, etc and reset IDs in stored topology arrays
|
||||||
// only necessary for molecular = 1, not molecular = 2
|
// only necessary for molecular = 1, not molecular = 2
|
||||||
// badcount = atom IDs that could not be found
|
// badcount = atom IDs that could not be found
|
||||||
|
|
||||||
int badcount = 0;
|
int badcount = 0;
|
||||||
|
|
||||||
if (atom->molecular == 1) {
|
if (atom->molecular == 1) {
|
||||||
@ -232,8 +233,15 @@ void ResetIDs::command(int narg, char **arg)
|
|||||||
atom->map_init();
|
atom->map_init();
|
||||||
atom->map_set();
|
atom->map_set();
|
||||||
|
|
||||||
|
// need to update exclusions with new atom IDs
|
||||||
|
|
||||||
|
if (atom->molecular == 1) {
|
||||||
|
Special special(lmp);
|
||||||
|
special.build();
|
||||||
|
}
|
||||||
|
|
||||||
// delete temporary atom map
|
// delete temporary atom map
|
||||||
|
|
||||||
if (mapflag) {
|
if (mapflag) {
|
||||||
atom->map_delete();
|
atom->map_delete();
|
||||||
atom->map_style = 0;
|
atom->map_style = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user