add check and document that "scale yes" is not supported for scaling atomic parameters with fix adapt/fep

This commit is contained in:
Axel Kohlmeyer
2023-11-23 12:37:49 -05:00
parent 9c19495392
commit 4cf8045f81
3 changed files with 15 additions and 11 deletions

View File

@ -307,7 +307,9 @@ the :doc:`run <run>` command. This fix is not invoked during
Restrictions Restrictions
"""""""""""" """"""""""""
none
The keyword "scale yes" is not supported for scaling per-atom parameters
diameter and change. You can use :doc:`fix adapt <fix_adapt>` for those.
Related commands Related commands
"""""""""""""""" """"""""""""""""

View File

@ -40,8 +40,8 @@ using namespace LAMMPS_NS;
using namespace FixConst; using namespace FixConst;
using namespace MathConst; using namespace MathConst;
enum{PAIR,KSPACE,ATOM}; enum{PAIR, KSPACE, ATOM};
enum{DIAMETER,CHARGE}; enum{DIAMETER, CHARGE};
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -165,21 +165,21 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) :
FixAdaptFEP::~FixAdaptFEP() FixAdaptFEP::~FixAdaptFEP()
{ {
for (int m = 0; m < nadapt; m++) { for (int m = 0; m < nadapt; m++) {
delete [] adapt[m].var; delete[] adapt[m].var;
if (adapt[m].which == PAIR) { if (adapt[m].which == PAIR) {
delete [] adapt[m].pstyle; delete[] adapt[m].pstyle;
delete [] adapt[m].pparam; delete[] adapt[m].pparam;
memory->destroy(adapt[m].array_orig); memory->destroy(adapt[m].array_orig);
} }
} }
delete [] adapt; delete[] adapt;
// check nfix in case all fixes have already been deleted // check nfix in case all fixes have already been deleted
if (id_fix_diam && modify->nfix) modify->delete_fix(id_fix_diam); if (id_fix_diam && modify->nfix) modify->delete_fix(id_fix_diam);
if (id_fix_chg && modify->nfix) modify->delete_fix(id_fix_chg); if (id_fix_chg && modify->nfix) modify->delete_fix(id_fix_chg);
delete [] id_fix_diam; delete[] id_fix_diam;
delete [] id_fix_chg; delete[] id_fix_chg;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -434,6 +434,8 @@ void FixAdaptFEP::change_settings()
} else if (ad->which == ATOM) { } else if (ad->which == ATOM) {
if (scaleflag)
error->all(FLERR, "Keyword 'scale yes' is not supported with fix adapt/fep for 'atom'");
// reset radius from diameter // reset radius from diameter
// also scale rmass to new value // also scale rmass to new value

View File

@ -39,8 +39,8 @@ using namespace LAMMPS_NS;
using namespace FixConst; using namespace FixConst;
using namespace MathConst; using namespace MathConst;
enum{PAIR,KSPACE,ATOM,BOND,ANGLE}; enum{PAIR, KSPACE, ATOM, BOND, ANGLE};
enum{DIAMETER,CHARGE}; enum{DIAMETER, CHARGE};
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */