git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15393 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2016-07-29 14:28:58 +00:00
parent f486709150
commit b936d69f12
2 changed files with 28 additions and 17 deletions

View File

@ -241,12 +241,21 @@ void Min::setup()
// remove these restriction eventually // remove these restriction eventually
if (nextra_global && searchflag == 0) if (searchflag == 0) {
if (nextra_global)
error->all(FLERR, error->all(FLERR,
"Cannot use a damped dynamics min style with fix box/relax"); "Cannot use a damped dynamics min style with fix box/relax");
if (nextra_atom && searchflag == 0) if (nextra_atom)
error->all(FLERR, error->all(FLERR,
"Cannot use a damped dynamics min style with per-atom DOF"); "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() // atoms may have migrated in comm->exchange()

View File

@ -24,17 +24,6 @@ MinimizeStyle(hftn,MinHFTN)
namespace LAMMPS_NS 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 class MinHFTN : public Min
{ {
@ -49,6 +38,19 @@ class MinHFTN : public Min
private: 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. //---- ATOM-BASED STORAGE VECTORS.
double * _daAVectors[NUM_HFTN_ATOM_BASED_VECTORS]; double * _daAVectors[NUM_HFTN_ATOM_BASED_VECTORS];
double ** _daExtraAtom[NUM_HFTN_ATOM_BASED_VECTORS]; double ** _daExtraAtom[NUM_HFTN_ATOM_BASED_VECTORS];