Adding bondstyle restart and fixing a few labels
This commit is contained in:
@ -157,7 +157,7 @@ void BondBPM::init_style()
|
||||
|
||||
void BondBPM::settings(int narg, char **arg)
|
||||
{
|
||||
leftover_args.clear();
|
||||
leftover_iarg.clear();
|
||||
|
||||
int iarg = 0;
|
||||
while (iarg < narg) {
|
||||
@ -198,7 +198,7 @@ void BondBPM::settings(int narg, char **arg)
|
||||
overlay_flag = 1;
|
||||
iarg ++;
|
||||
} else {
|
||||
leftover_args.push_back(iarg);
|
||||
leftover_iarg.push_back(iarg);
|
||||
iarg ++;
|
||||
}
|
||||
}
|
||||
@ -206,7 +206,7 @@ void BondBPM::settings(int narg, char **arg)
|
||||
if (id_fix_store_local) {
|
||||
|
||||
if (nvalues == 0) error->all(FLERR,
|
||||
"Bond style bpm/rotational must include at least one value to output");
|
||||
"Storing local data must include at least one value to output");
|
||||
memory->create(output_data, nvalues, "bond/bpm:output_data");
|
||||
|
||||
int ifix = modify->find_fix(id_fix_store_local);
|
||||
|
||||
@ -39,7 +39,7 @@ class BondBPM : public Bond {
|
||||
double max_stretch;
|
||||
int store_local_freq;
|
||||
|
||||
std::vector<int> leftover_args;
|
||||
std::vector<int> leftover_iarg;
|
||||
|
||||
char *id_fix_dummy, *id_fix_dummy2;
|
||||
char *id_fix_update, *id_fix_bond_history;
|
||||
|
||||
@ -654,7 +654,7 @@ void BondBPMRotational::settings(int narg, char **arg)
|
||||
{
|
||||
BondBPM::settings(narg, arg);
|
||||
|
||||
for (int iarg : leftover_args) {
|
||||
for (int iarg : leftover_iarg) {
|
||||
error->all(FLERR, "Illegal bond_style command");
|
||||
}
|
||||
}
|
||||
|
||||
@ -290,7 +290,7 @@ void BondBPMSpring::settings(int narg, char **arg)
|
||||
{
|
||||
BondBPM::settings(narg, arg);
|
||||
|
||||
for (int iarg : leftover_args) {
|
||||
for (int iarg : leftover_iarg) {
|
||||
error->all(FLERR, "Illegal bond_style command");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1318,6 +1318,27 @@ void Input::bond_style()
|
||||
if (narg < 1) error->all(FLERR,"Illegal bond_style command");
|
||||
if (atom->avec->bonds_allow == 0)
|
||||
error->all(FLERR,"Bond_style command when no bonds allowed");
|
||||
|
||||
if (force->bond) {
|
||||
std::string style = arg[0];
|
||||
int match = 0;
|
||||
if (style == force->bond_style) match = 1;
|
||||
if (!match && lmp->suffix_enable) {
|
||||
if (lmp->suffixp)
|
||||
if (style + "/" + lmp->suffixp == force->bond_style) match = 1;
|
||||
|
||||
if (lmp->suffix && !lmp->suffixp)
|
||||
if (style + "/" + lmp->suffix == force->bond_style) match = 1;
|
||||
|
||||
if (lmp->suffix2)
|
||||
if (style + "/" + lmp->suffix2 == force->bond_style) match = 1;
|
||||
}
|
||||
if (match) {
|
||||
force->bond->settings(narg-1,&arg[1]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
force->create_bond(arg[0],1);
|
||||
if (force->bond) force->bond->settings(narg-1,&arg[1]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user