diff --git a/src/min.cpp b/src/min.cpp index cce07e1b8b..6e568aee0b 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -241,12 +241,21 @@ void Min::setup() // remove these restriction eventually - if (nextra_global && searchflag == 0) - error->all(FLERR, - "Cannot use a damped dynamics min style with fix box/relax"); - if (nextra_atom && searchflag == 0) - error->all(FLERR, - "Cannot use a damped dynamics min style with per-atom DOF"); + if (searchflag == 0) { + if (nextra_global) + error->all(FLERR, + "Cannot use a damped dynamics min style with fix box/relax"); + if (nextra_atom) + error->all(FLERR, + "Cannot use a damped dynamics min style with per-atom DOF"); + } + + if (strcmp(update->minimize_style,"hftn") == 0) { + if (nextra_global) + error->all(FLERR, "Cannot use hftn min style with fix box/relax"); + if (nextra_atom) + error->all(FLERR, "Cannot use hftn min style with per-atom DOF"); + } // atoms may have migrated in comm->exchange() diff --git a/src/min_hftn.h b/src/min_hftn.h index c96834a50f..891639e2ac 100644 --- a/src/min_hftn.h +++ b/src/min_hftn.h @@ -24,17 +24,6 @@ MinimizeStyle(hftn,MinHFTN) namespace LAMMPS_NS { - //---- THE ALGORITHM NEEDS TO STORE THIS MANY ATOM-BASED VECTORS, - //---- IN ADDITION TO ATOM POSITIONS AND THE FORCE VECTOR. - - static const int NUM_HFTN_ATOM_BASED_VECTORS = 7; - static const int VEC_XK = 0; //-- ATOM POSITIONS AT SUBITER START - static const int VEC_CG_P = 1; //-- STEP p IN CG SUBITER - static const int VEC_CG_D = 2; //-- DIRECTION d IN CG SUBITER - static const int VEC_CG_HD = 3; //-- HESSIAN-VECTOR PRODUCT Hd - static const int VEC_CG_R = 4; //-- RESIDUAL r IN CG SUBITER - static const int VEC_DIF1 = 5; //-- FOR FINITE DIFFERENCING - static const int VEC_DIF2 = 6; //-- FOR FINITE DIFFERENCING class MinHFTN : public Min { @@ -49,6 +38,19 @@ class MinHFTN : public Min private: + //---- THE ALGORITHM NEEDS TO STORE THIS MANY ATOM-BASED VECTORS, + //---- IN ADDITION TO ATOM POSITIONS AND THE FORCE VECTOR. + enum { + VEC_XK=0, //-- ATOM POSITIONS AT SUBITER START + VEC_CG_P, //-- STEP p IN CG SUBITER + VEC_CG_D, //-- DIRECTION d IN CG SUBITER + VEC_CG_HD, //-- HESSIAN-VECTOR PRODUCT Hd + VEC_CG_R, //-- RESIDUAL r IN CG SUBITER + VEC_DIF1, //-- FOR FINITE DIFFERENCING + VEC_DIF2, //-- FOR FINITE DIFFERENCING + NUM_HFTN_ATOM_BASED_VECTORS + }; + //---- ATOM-BASED STORAGE VECTORS. double * _daAVectors[NUM_HFTN_ATOM_BASED_VECTORS]; double ** _daExtraAtom[NUM_HFTN_ATOM_BASED_VECTORS];