Skip to content

Commit b449a4e

Browse files
author
Han Wang
committed
fix bug of parsing fix/dplr
1 parent 7a0b41b commit b449a4e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/lmp/fix_dplr.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ is_key (const string& input)
2424
keys.push_back("model");
2525
keys.push_back("type_associate");
2626
keys.push_back("bond_type");
27+
keys.push_back("efield");
2728
for (int ii = 0; ii < keys.size(); ++ii){
2829
if (input == keys[ii]) {
2930
return true;
@@ -58,22 +59,22 @@ FixDPLR::FixDPLR(LAMMPS *lmp, int narg, char **arg)
5859
model = string(arg[iarg+1]);
5960
iarg += 2;
6061
}
61-
if (string(arg[iarg]) == string("efield")) {
62+
else if (string(arg[iarg]) == string("efield")) {
6263
if (iarg+3 > narg) error->all(FLERR,"Illegal fix adapt command, efield should be provided 3 float numbers");
6364
efield[0] = atof(arg[iarg+1]);
6465
efield[1] = atof(arg[iarg+2]);
6566
efield[2] = atof(arg[iarg+3]);
6667
iarg += 4;
6768
}
68-
if (string(arg[iarg]) == string("type_associate")) {
69+
else if (string(arg[iarg]) == string("type_associate")) {
6970
int iend = iarg+1;
7071
while (iend < narg && (! is_key(arg[iend]) )) {
7172
map_vec.push_back(atoi(arg[iend])-1);
7273
iend ++;
7374
}
7475
iarg = iend;
7576
}
76-
if (string(arg[iarg]) == string("bond_type")) {
77+
else if (string(arg[iarg]) == string("bond_type")) {
7778
int iend = iarg+1;
7879
while (iend < narg && (! is_key(arg[iend]) )) {
7980
bond_type.push_back(atoi(arg[iend])-1);

0 commit comments

Comments
 (0)