diff --git a/doc/src/fix_bond_react.txt b/doc/src/fix_bond_react.txt index 5da0f33e3a..af443ede92 100644 --- a/doc/src/fix_bond_react.txt +++ b/doc/src/fix_bond_react.txt @@ -385,6 +385,10 @@ No parameter of this fix can be used with the {start/stop} keywords of the "run"_run.html command. This fix is not invoked during "energy minimization"_minimize.html. +When fix bond/react is 'unfixed,' all internally-created groups are +deleted. Therefore, fix bond/react can only be unfixed after unfixing +all other fixes that use any group created by fix bond/react. + [Restrictions:] This fix is part of the USER-MISC package. It is only enabled if diff --git a/src/USER-MISC/fix_bond_react.cpp b/src/USER-MISC/fix_bond_react.cpp index c5df3ed438..5d624ad7f4 100644 --- a/src/USER-MISC/fix_bond_react.cpp +++ b/src/USER-MISC/fix_bond_react.cpp @@ -457,8 +457,6 @@ FixBondReact::~FixBondReact() memory->destroy(global_mega_glove); if (stabilization_flag == 1) { - delete [] exclude_group; - // check nfix in case all fixes have already been deleted if (id_fix1 && modify->nfix) modify->delete_fix(id_fix1); delete [] id_fix1; @@ -473,6 +471,18 @@ FixBondReact::~FixBondReact() delete [] statted_id; delete [] guess_branch; delete [] pioneer_count; + + char **newarg; + newarg = new char*[2]; + newarg[0] = master_group; + newarg[1] = (char *) "delete"; + group->assign(2,newarg); + if (stabilization_flag == 1) { + newarg[0] = exclude_group; + group->assign(2,newarg); + delete [] exclude_group; + } + delete [] newarg; } /* ---------------------------------------------------------------------- */