error out when many bonds creation cutoff is larger than periodic domain

This commit is contained in:
Axel Kohlmeyer
2023-06-28 09:50:27 -04:00
parent 89c4d43a87
commit 5d027fc92c

View File

@ -197,6 +197,10 @@ void CreateBonds::many()
if (rmax > neighbor->cutneighmin && comm->me == 0) if (rmax > neighbor->cutneighmin && comm->me == 0)
error->warning(FLERR, "Create_bonds max distance > minimum neighbor cutoff"); error->warning(FLERR, "Create_bonds max distance > minimum neighbor cutoff");
if ((domain->xperiodic && (rmax > domain->xprd)) ||
(domain->yperiodic && (rmax > domain->yprd)) || (domain->zperiodic && (rmax > domain->zprd)))
error->all(FLERR, "Bond creation cutoff is larger than periodic domain");
// require special_bonds 1-2 weights = 0.0 and KSpace = nullptr // require special_bonds 1-2 weights = 0.0 and KSpace = nullptr
// so that already bonded atom pairs do not appear in neighbor list // so that already bonded atom pairs do not appear in neighbor list
// otherwise with newton_bond = 1, // otherwise with newton_bond = 1,
@ -205,7 +209,7 @@ void CreateBonds::many()
if (force->special_lj[1] != 0.0 || force->special_coul[1] != 0.0) if (force->special_lj[1] != 0.0 || force->special_coul[1] != 0.0)
error->all(FLERR, "Create_bonds command requires special_bonds 1-2 weights be 0.0"); error->all(FLERR, "Create_bonds command requires special_bonds 1-2 weights be 0.0");
if (force->kspace) error->all(FLERR, "Create_bonds command requires no kspace_style be defined"); if (force->kspace) error->all(FLERR, "Create_bonds command is incompatible with Kspace styles");
// setup domain, communication and neighboring // setup domain, communication and neighboring
// acquire ghosts and build standard neighbor lists // acquire ghosts and build standard neighbor lists