add error checks to verlet/split

This commit is contained in:
Steve Plimpton
2024-08-21 15:23:27 -06:00
parent c299c94ebc
commit 9b46cd9a3a
3 changed files with 19 additions and 10 deletions

View File

@ -221,14 +221,22 @@ void VerletSplit::init()
if (!force->kspace && comm->me == 0) if (!force->kspace && comm->me == 0)
error->warning(FLERR,"A KSpace style must be defined with verlet/split"); error->warning(FLERR,"A KSpace style must be defined with verlet/split");
if (force->kspace_match("/tip4p",0)) tip4p_flag = 1; // error for as-yet unsupported verlet/split KSpace options
else tip4p_flag = 0;
// currently TIP4P does not work with verlet/split, so generate error int errflag = 0;
// see Axel email on this, also other TIP4P notes below if (!atom->q_flag) errflag = 1;
if (force->kspace->tip4pflag) errflag = 1;
if (force->kspace->dipoleflag) errflag = 1;
if (force->kspace->spinflag) errflag = 1;
if (tip4p_flag) error->all(FLERR,"Verlet/split does not yet support TIP4P"); if (errflag) error->all(FLERR,"Verlet/split cannot (yet) be used with this KSpace method");
// partial support for TIP4P, see where this flag is used below
tip4pflag = force->kspace->tip4pflag;
// invoke parent Verlet init
Verlet::init(); Verlet::init();
} }
@ -402,7 +410,7 @@ void VerletSplit::run(int n)
// TIP4P PPPM puts forces on ghost atoms, so must reverse_comm() // TIP4P PPPM puts forces on ghost atoms, so must reverse_comm()
if (tip4p_flag && force->newton) { if (tip4pflag && force->newton) {
comm->reverse_comm(); comm->reverse_comm();
timer->stamp(Timer::COMM); timer->stamp(Timer::COMM);
} }
@ -485,7 +493,7 @@ void VerletSplit::rk_setup()
// could do this by calling r2k_comm() here and not again from run() // could do this by calling r2k_comm() here and not again from run()
// except that forward_comm() in r2k_comm() is wrong // except that forward_comm() in r2k_comm() is wrong
if (tip4p_flag) { if (tip4pflag) {
//r2k_comm(); //r2k_comm();
MPI_Gatherv(atom->type,n,MPI_INT,atom->type,qsize,qdisp,MPI_INT,0,block); MPI_Gatherv(atom->type,n,MPI_INT,atom->type,qsize,qdisp,MPI_INT,0,block);
MPI_Gatherv(atom->tag,n,MPI_LMP_TAGINT, MPI_Gatherv(atom->tag,n,MPI_LMP_TAGINT,
@ -543,7 +551,7 @@ void VerletSplit::r2k_comm()
// for TIP4P, Kspace partition needs to update its ghost atoms // for TIP4P, Kspace partition needs to update its ghost atoms
if (tip4p_flag && !master) { if (tip4pflag && !master) {
timer->stamp(); timer->stamp();
comm->forward_comm(); comm->forward_comm();
timer->stamp(Timer::COMM); timer->stamp(Timer::COMM);

View File

@ -40,7 +40,8 @@ class VerletSplit : public Verlet {
int ratio; // ratio of Rspace procs to Kspace procs int ratio; // ratio of Rspace procs to Kspace procs
int *qsize, *qdisp, *xsize, *xdisp; // MPI gather/scatter params for block comm int *qsize, *qdisp, *xsize, *xdisp; // MPI gather/scatter params for block comm
MPI_Comm block; // communicator within one block MPI_Comm block; // communicator within one block
int tip4p_flag; // 1 if PPPM/tip4p so do extra comm
int tip4pflag; // 1 if Kspace method sets tip4pflag
double **f_kspace; // copy of Kspace forces on Rspace procs double **f_kspace; // copy of Kspace forces on Rspace procs
int maxatom; int maxatom;

View File

@ -3090,7 +3090,7 @@ void *Atom::extract(const char *name)
return (void *) eff_plastic_strain_rate; return (void *) eff_plastic_strain_rate;
if (strcmp(name, "damage") == 0) return (void *) damage; if (strcmp(name, "damage") == 0) return (void *) damage;
// DPD-REACT pakage // DPD-REACT package
if (strcmp(name,"dpdTheta") == 0) return (void *) dpdTheta; if (strcmp(name,"dpdTheta") == 0) return (void *) dpdTheta;