change hyper command to use get_dump_by_id() instead of find_dump()
This commit is contained in:
@ -39,7 +39,7 @@ enum{NOHYPER,GLOBAL,LOCAL};
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
Hyper::Hyper(LAMMPS *lmp) : Command(lmp), dumplist(nullptr) {}
|
Hyper::Hyper(LAMMPS *_lmp) : Command(_lmp) {}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
perform hyperdynamics simulation
|
perform hyperdynamics simulation
|
||||||
@ -177,9 +177,7 @@ void Hyper::command(int narg, char **arg)
|
|||||||
|
|
||||||
fix_event->store_state_quench();
|
fix_event->store_state_quench();
|
||||||
quench(1);
|
quench(1);
|
||||||
if (dumpflag)
|
if (dumpflag) for (auto idump : dumplist) idump->write();
|
||||||
for (int idump = 0; idump < ndump; idump++)
|
|
||||||
output->dump[dumplist[idump]]->write();
|
|
||||||
fix_event->store_event();
|
fix_event->store_event();
|
||||||
if (hyperenable) fix_hyper->build_bond_list(0);
|
if (hyperenable) fix_hyper->build_bond_list(0);
|
||||||
fix_event->restore_state_quench();
|
fix_event->restore_state_quench();
|
||||||
@ -208,9 +206,7 @@ void Hyper::command(int narg, char **arg)
|
|||||||
nevent++;
|
nevent++;
|
||||||
nevent_atoms += ecount;
|
nevent_atoms += ecount;
|
||||||
|
|
||||||
if (dumpflag)
|
if (dumpflag) for (auto idump : dumplist) idump->write();
|
||||||
for (int idump = 0; idump < ndump; idump++)
|
|
||||||
output->dump[dumplist[idump]]->write();
|
|
||||||
fix_event->store_event();
|
fix_event->store_event();
|
||||||
if (hyperenable) fix_hyper->build_bond_list(ecount);
|
if (hyperenable) fix_hyper->build_bond_list(ecount);
|
||||||
|
|
||||||
@ -345,7 +341,6 @@ void Hyper::command(int narg, char **arg)
|
|||||||
|
|
||||||
delete [] id_fix;
|
delete [] id_fix;
|
||||||
delete [] id_compute;
|
delete [] id_compute;
|
||||||
memory->destroy(dumplist);
|
|
||||||
delete finish;
|
delete finish;
|
||||||
modify->delete_fix("hyper_event");
|
modify->delete_fix("hyper_event");
|
||||||
|
|
||||||
@ -444,8 +439,6 @@ void Hyper::options(int narg, char **arg)
|
|||||||
maxiter = 40;
|
maxiter = 40;
|
||||||
maxeval = 50;
|
maxeval = 50;
|
||||||
dumpflag = 0;
|
dumpflag = 0;
|
||||||
ndump = 0;
|
|
||||||
dumplist = nullptr;
|
|
||||||
rebond = 0;
|
rebond = 0;
|
||||||
|
|
||||||
int iarg = 0;
|
int iarg = 0;
|
||||||
@ -462,11 +455,9 @@ void Hyper::options(int narg, char **arg)
|
|||||||
} else if (strcmp(arg[iarg],"dump") == 0) {
|
} else if (strcmp(arg[iarg],"dump") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal hyper command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal hyper command");
|
||||||
dumpflag = 1;
|
dumpflag = 1;
|
||||||
int idump = output->find_dump(arg[iarg+1]);
|
auto idump = output->get_dump_by_id(arg[iarg+1]);
|
||||||
if (idump < 0)
|
if (!idump) error->all(FLERR,"Dump ID {} in hyper command does not exist", arg[iarg+1]);
|
||||||
error->all(FLERR,"Dump ID in hyper command does not exist");
|
dumplist.emplace_back(idump);
|
||||||
memory->grow(dumplist,ndump+1,"hyper:dumplist");
|
|
||||||
dumplist[ndump++] = idump;
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
|
|
||||||
} else if (strcmp(arg[iarg],"rebond") == 0) {
|
} else if (strcmp(arg[iarg],"rebond") == 0) {
|
||||||
|
|||||||
@ -35,8 +35,8 @@ class Hyper : public Command {
|
|||||||
int t_event;
|
int t_event;
|
||||||
double etol, ftol;
|
double etol, ftol;
|
||||||
int maxiter, maxeval;
|
int maxiter, maxeval;
|
||||||
int stepmode, dumpflag, ndump, rebond;
|
int stepmode, dumpflag, rebond;
|
||||||
int *dumplist;
|
std::vector<class Dump *> dumplist;
|
||||||
|
|
||||||
int neigh_every, neigh_delay, neigh_dist_check;
|
int neigh_every, neigh_delay, neigh_dist_check;
|
||||||
int quench_reneighbor;
|
int quench_reneighbor;
|
||||||
|
|||||||
Reference in New Issue
Block a user