Skip to content
Snippets Groups Projects
Commit 54a30962 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

do not allow single bond/angle/dihedral definitions with illegal atom ID combinations

parent 5e9d257e
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,8 @@ void CreateBonds::command(int narg, char **arg)
btype = force->inumeric(FLERR,arg[1]);
batom1 = force->tnumeric(FLERR,arg[2]);
batom2 = force->tnumeric(FLERR,arg[3]);
if (batom1 == batom2)
error->all(FLERR,"Illegal create_bonds command");
iarg = 4;
} else if (strcmp(arg[0],"single/angle") == 0) {
style = SANGLE;
......@@ -83,6 +85,8 @@ void CreateBonds::command(int narg, char **arg)
aatom1 = force->tnumeric(FLERR,arg[2]);
aatom2 = force->tnumeric(FLERR,arg[3]);
aatom3 = force->tnumeric(FLERR,arg[4]);
if ((aatom1 == aatom2) || (aatom1 == aatom3) || (aatom2 == aatom3))
error->all(FLERR,"Illegal create_bonds command");
iarg = 5;
} else if (strcmp(arg[0],"single/dihedral") == 0) {
style = SDIHEDRAL;
......@@ -92,6 +96,9 @@ void CreateBonds::command(int narg, char **arg)
datom2 = force->tnumeric(FLERR,arg[3]);
datom3 = force->tnumeric(FLERR,arg[4]);
datom4 = force->tnumeric(FLERR,arg[5]);
if ((datom1 == datom2) || (datom1 == datom3) || (datom1 == datom4) ||
(datom2 == datom3) || (datom2 == datom4) || (datom3 == datom4))
error->all(FLERR,"Illegal create_bonds command");
iarg = 6;
} else error->all(FLERR,"Illegal create_bonds command");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment