Merge pull request #1913 from jrgissing/molecule_template_moleculeIDs

Molecule template: molecule-IDs and fragments
This commit is contained in:
Axel Kohlmeyer
2020-03-18 20:31:29 -04:00
committed by GitHub
7 changed files with 190 additions and 15 deletions

View File

@ -539,7 +539,13 @@ void FixDeposit::pre_exchange()
n = atom->nlocal - 1;
atom->tag[n] = maxtag_all + m+1;
if (mode == MOLECULE) {
if (atom->molecule_flag) atom->molecule[n] = maxmol_all+1;
if (atom->molecule_flag) {
if (onemols[imol]->moleculeflag) {
atom->molecule[n] = maxmol_all + onemols[imol]->molecule[m];
} else {
atom->molecule[n] = maxmol_all+1;
}
}
if (atom->molecular == 2) {
atom->molindex[n] = 0;
atom->molatom[n] = m;
@ -603,7 +609,13 @@ void FixDeposit::pre_exchange()
maxtag_all += natom;
if (maxtag_all >= MAXTAGINT)
error->all(FLERR,"New atom IDs exceed maximum allowed ID");
if (mode == MOLECULE && atom->molecule_flag) maxmol_all++;
if (mode == MOLECULE && atom->molecule_flag) {
if (onemols[imol]->moleculeflag) {
maxmol_all += onemols[imol]->nmolecules;
} else {
maxmol_all++;
}
}
if (atom->map_style) {
atom->map_init();
atom->map_set();