diff --git a/src/input.cpp b/src/input.cpp index 191fe39c02..80da0361ac 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -450,6 +450,7 @@ int Input::execute_command() else if (!strcmp(command,"thermo_modify")) thermo_modify(); else if (!strcmp(command,"thermo_style")) thermo_style(); else if (!strcmp(command,"timestep")) timestep(); + else if (!strcmp(command,"uncompute")) uncompute(); else if (!strcmp(command,"undump")) undump(); else if (!strcmp(command,"unfix")) unfix(); else if (!strcmp(command,"units")) units(); @@ -1122,6 +1123,14 @@ void Input::timestep() /* ---------------------------------------------------------------------- */ +void Input::uncompute() +{ + if (narg != 1) error->all("Illegal uncompute command"); + modify->delete_compute(arg[0]); +} + +/* ---------------------------------------------------------------------- */ + void Input::undump() { if (narg != 1) error->all("Illegal undump command"); diff --git a/src/input.h b/src/input.h index 93147217da..161241efa9 100644 --- a/src/input.h +++ b/src/input.h @@ -107,6 +107,7 @@ class Input : protected Pointers { void thermo_modify(); void thermo_style(); void timestep(); + void uncompute(); void undump(); void unfix(); void units(); diff --git a/src/modify.cpp b/src/modify.cpp index f0fc74069b..2c2dea521e 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -95,6 +95,11 @@ Modify::~Modify() memory->sfree(fix); memory->sfree(fmask); + // delete all computes + + for (int i = 0; i < ncompute; i++) delete compute[i]; + memory->sfree(compute); + delete [] list_initial_integrate; delete [] list_pre_exchange; delete [] list_pre_neighbor; @@ -109,15 +114,9 @@ Modify::~Modify() delete [] list_min_energy; delete [] end_of_step_every; - delete [] list_timeflag; restart_deallocate(); - - // delete all computes - - for (int i = 0; i < ncompute; i++) delete compute[i]; - memory->sfree(compute); } /* ----------------------------------------------------------------------