From 85c8877aeb11c67cd0e5071d23a72e8042a6e431 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 26 Oct 2018 17:31:42 -0600 Subject: [PATCH 01/94] make 2 copy of old read_dump and rerun for comparison to new --- src/read_dump2.cpp | 1011 ++++++++++++++++++++++++++++++++++++++++++++ src/read_dump2.h | 172 ++++++++ src/read_restart.h | 8 +- src/reader.cpp | 2 + src/rerun2.cpp | 193 +++++++++ src/rerun2.h | 59 +++ 6 files changed, 1442 insertions(+), 3 deletions(-) create mode 100644 src/read_dump2.cpp create mode 100644 src/read_dump2.h create mode 100644 src/rerun2.cpp create mode 100644 src/rerun2.h diff --git a/src/read_dump2.cpp b/src/read_dump2.cpp new file mode 100644 index 0000000000..37bc3e3589 --- /dev/null +++ b/src/read_dump2.cpp @@ -0,0 +1,1011 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Timothy Sirk (ARL) +------------------------------------------------------------------------- */ + +// lmptype.h must be first b/c this file uses MAXBIGINT and includes mpi.h +// due to OpenMPI bug which sets INT64_MAX via its mpi.h +// before lmptype.h can set flags to insure it is done correctly + +#include "lmptype.h" +#include +#include +#include +#include "read_dump2.h" +#include "reader.h" +#include "style_reader.h" +#include "atom.h" +#include "atom_vec.h" +#include "update.h" +#include "modify.h" +#include "fix.h" +#include "compute.h" +#include "domain.h" +#include "comm.h" +#include "force.h" +#include "irregular.h" +#include "input.h" +#include "variable.h" +#include "error.h" +#include "memory.h" + +using namespace LAMMPS_NS; + +#define CHUNK 16384 + +// also in reader_native.cpp + +enum{ID,TYPE,X,Y,Z,VX,VY,VZ,Q,IX,IY,IZ,FX,FY,FZ}; +enum{UNSET,NOSCALE_NOWRAP,NOSCALE_WRAP,SCALE_NOWRAP,SCALE_WRAP}; +enum{NOADD,YESADD,KEEPADD}; + +/* ---------------------------------------------------------------------- */ + +ReadDump2::ReadDump2(LAMMPS *lmp) : Pointers(lmp) +{ + MPI_Comm_rank(world,&me); + MPI_Comm_size(world,&nprocs); + + dimension = domain->dimension; + triclinic = domain->triclinic; + + nfile = 0; + files = NULL; + + nfield = 0; + fieldtype = NULL; + fieldlabel = NULL; + fields = NULL; + + int n = strlen("native") + 1; + readerstyle = new char[n]; + strcpy(readerstyle,"native"); + + reader = NULL; + fp = NULL; +} + +/* ---------------------------------------------------------------------- */ + +ReadDump2::~ReadDump2() +{ + for (int i = 0; i < nfile; i++) delete [] files[i]; + delete [] files; + for (int i = 0; i < nfield; i++) delete [] fieldlabel[i]; + delete [] fieldlabel; + delete [] fieldtype; + delete [] readerstyle; + + memory->destroy(fields); + delete reader; +} + +/* ---------------------------------------------------------------------- */ + +void ReadDump2::command(int narg, char **arg) +{ + if (domain->box_exist == 0) + error->all(FLERR,"Read_dump command before simulation box is defined"); + + if (narg < 2) error->all(FLERR,"Illegal read_dump command"); + + store_files(1,&arg[0]); + bigint nstep = force->bnumeric(FLERR,arg[1]); + + int nremain = narg - 2; + if (nremain) nremain = fields_and_keywords(nremain,&arg[narg-nremain]); + else nremain = fields_and_keywords(0,NULL); + if (nremain) setup_reader(nremain,&arg[narg-nremain]); + else setup_reader(0,NULL); + + // find the snapshot and read/bcast/process header info + + if (me == 0 && screen) fprintf(screen,"Scanning dump file ...\n"); + + bigint ntimestep = seek(nstep,1); + if (ntimestep < 0) + error->all(FLERR,"Dump file does not contain requested snapshot"); + header(1); + + // reset timestep to nstep + + update->reset_timestep(nstep); + + // counters + + // read in the snapshot and reset system + + if (me == 0 && screen) + fprintf(screen,"Reading snapshot from dump file ...\n"); + + bigint natoms_prev = atom->natoms; + atoms(); + + if (me == 0) reader->close_file(); + + // print out stats + + bigint npurge_all,nreplace_all,ntrim_all,nadd_all; + + bigint tmp; + tmp = npurge; + MPI_Allreduce(&tmp,&npurge_all,1,MPI_LMP_BIGINT,MPI_SUM,world); + tmp = nreplace; + MPI_Allreduce(&tmp,&nreplace_all,1,MPI_LMP_BIGINT,MPI_SUM,world); + tmp = ntrim; + MPI_Allreduce(&tmp,&ntrim_all,1,MPI_LMP_BIGINT,MPI_SUM,world); + tmp = nadd; + MPI_Allreduce(&tmp,&nadd_all,1,MPI_LMP_BIGINT,MPI_SUM,world); + + domain->print_box(" "); + + if (me == 0) { + if (screen) { + fprintf(screen," " BIGINT_FORMAT " atoms before read\n",natoms_prev); + fprintf(screen," " BIGINT_FORMAT " atoms in snapshot\n",nsnapatoms); + fprintf(screen," " BIGINT_FORMAT " atoms purged\n",npurge_all); + fprintf(screen," " BIGINT_FORMAT " atoms replaced\n",nreplace_all); + fprintf(screen," " BIGINT_FORMAT " atoms trimmed\n",ntrim_all); + fprintf(screen," " BIGINT_FORMAT " atoms added\n",nadd_all); + fprintf(screen," " BIGINT_FORMAT " atoms after read\n",atom->natoms); + } + if (logfile) { + fprintf(logfile," " BIGINT_FORMAT " atoms before read\n",natoms_prev); + fprintf(logfile," " BIGINT_FORMAT " atoms in snapshot\n",nsnapatoms); + fprintf(logfile," " BIGINT_FORMAT " atoms purged\n",npurge_all); + fprintf(logfile," " BIGINT_FORMAT " atoms replaced\n",nreplace_all); + fprintf(logfile," " BIGINT_FORMAT " atoms trimmed\n",ntrim_all); + fprintf(logfile," " BIGINT_FORMAT " atoms added\n",nadd_all); + fprintf(logfile," " BIGINT_FORMAT " atoms after read\n",atom->natoms); + } + } +} + +/* ---------------------------------------------------------------------- */ + +void ReadDump2::store_files(int nstr, char **str) +{ + nfile = nstr; + files = new char*[nfile]; + + for (int i = 0; i < nfile; i++) { + int n = strlen(str[i]) + 1; + files[i] = new char[n]; + strcpy(files[i],str[i]); + } +} + +/* ---------------------------------------------------------------------- */ + +void ReadDump2::setup_reader(int narg, char **arg) +{ + // allocate snapshot field buffer + + memory->create(fields,CHUNK,nfield,"read_dump:fields"); + + // create reader class + // match readerstyle to options in style_reader.h + + if (0) return; // dummy line to enable else-if macro expansion + +#define READER_CLASS +#define ReaderStyle(key,Class) \ + else if (strcmp(readerstyle,#key) == 0) reader = new Class(lmp); +#include "style_reader.h" +#undef READER_CLASS + + // unrecognized style + + else error->all(FLERR,"Unknown dump reader style"); + + // pass any arguments to reader + + if (narg > 0) reader->settings(narg,arg); +} + +/* ---------------------------------------------------------------------- + seek Nrequest timestep in one or more dump files + if exact = 1, must find exactly Nrequest + if exact = 0, find first step >= Nrequest + return matching ntimestep or -1 if did not find a match +------------------------------------------------------------------------- */ + +bigint ReadDump2::seek(bigint nrequest, int exact) +{ + int ifile,eofflag; + bigint ntimestep; + + if (me == 0) { + + // exit file loop when dump timestep >= nrequest + // or files exhausted + + for (ifile = 0; ifile < nfile; ifile++) { + ntimestep = -1; + reader->open_file(files[ifile]); + while (1) { + eofflag = reader->read_time(ntimestep); + if (eofflag) break; + if (ntimestep >= nrequest) break; + reader->skip(); + } + if (ntimestep >= nrequest) break; + reader->close_file(); + } + + currentfile = ifile; + if (ntimestep < nrequest) ntimestep = -1; + if (exact && ntimestep != nrequest) ntimestep = -1; + if (ntimestep < 0) reader->close_file(); + } + + MPI_Bcast(&ntimestep,1,MPI_LMP_BIGINT,0,world); + return ntimestep; +} + +/* ---------------------------------------------------------------------- + find next matching snapshot in one or more dump files + Ncurrent = current timestep from last snapshot + Nlast = match no timestep bigger than Nlast + Nevery = only match timesteps that are a multiple of Nevery + Nskip = skip every this many timesteps + return matching ntimestep or -1 if did not find a match +------------------------------------------------------------------------- */ + +bigint ReadDump2::next(bigint ncurrent, bigint nlast, int nevery, int nskip) +{ + int ifile,eofflag; + bigint ntimestep; + + if (me == 0) { + + // exit file loop when dump timestep matches all criteria + // or files exhausted + + int iskip = 0; + + for (ifile = currentfile; ifile < nfile; ifile++) { + ntimestep = -1; + if (ifile != currentfile) reader->open_file(files[ifile]); + while (1) { + eofflag = reader->read_time(ntimestep); + + // new code logic to match new parallel read_dump + if (eofflag) break; + if (ntimestep > nlast) break; + if (ntimestep <= ncurrent) { + reader->skip(); + continue; + } + if (iskip == nskip) iskip = 0; + iskip++; + if (nevery && ntimestep % nevery) reader->skip(); + else if (iskip < nskip) reader->skip(); + else break; + + // old code logic + //if (iskip == nskip) iskip = 0; + //iskip++; + //if (eofflag) break; + //if (ntimestep <= ncurrent) break; + //if (ntimestep > nlast) break; + //if (nevery && ntimestep % nevery) reader->skip(); + //else if (iskip < nskip) reader->skip(); + //else break; + } + if (eofflag) reader->close_file(); + else break; + } + + currentfile = ifile; + if (eofflag) ntimestep = -1; + if (ntimestep <= ncurrent) ntimestep = -1; + if (ntimestep > nlast) ntimestep = -1; + if (ntimestep < 0) reader->close_file(); + } + + MPI_Bcast(&ntimestep,1,MPI_LMP_BIGINT,0,world); + return ntimestep; +} + +/* ---------------------------------------------------------------------- + read and broadcast and store snapshot header info + set nsnapatoms = # of atoms in snapshot +------------------------------------------------------------------------- */ + +void ReadDump2::header(int fieldinfo) +{ + int triclinic_snap; + int fieldflag,xflag,yflag,zflag; + + if (me == 0) + nsnapatoms = reader->read_header(box,triclinic_snap, + fieldinfo,nfield,fieldtype,fieldlabel, + scaleflag,wrapflag,fieldflag, + xflag,yflag,zflag); + + MPI_Bcast(&nsnapatoms,1,MPI_LMP_BIGINT,0,world); + MPI_Bcast(&triclinic_snap,1,MPI_INT,0,world); + MPI_Bcast(&box[0][0],9,MPI_DOUBLE,0,world); + + // local copy of snapshot box parameters + // used in xfield,yfield,zfield when converting dump atom to absolute coords + + xlo = box[0][0]; + xhi = box[0][1]; + ylo = box[1][0]; + yhi = box[1][1]; + zlo = box[2][0]; + zhi = box[2][1]; + if (triclinic_snap) { + xy = box[0][2]; + xz = box[1][2]; + yz = box[2][2]; + double xdelta = MIN(0.0,xy); + xdelta = MIN(xdelta,xz); + xdelta = MIN(xdelta,xy+xz); + xlo = xlo - xdelta; + xdelta = MAX(0.0,xy); + xdelta = MAX(xdelta,xz); + xdelta = MAX(xdelta,xy+xz); + xhi = xhi - xdelta; + ylo = ylo - MIN(0.0,yz); + yhi = yhi - MAX(0.0,yz); + } + xprd = xhi - xlo; + yprd = yhi - ylo; + zprd = zhi - zlo; + + // done if not checking fields + + if (!fieldinfo) return; + + MPI_Bcast(&fieldflag,1,MPI_INT,0,world); + MPI_Bcast(&xflag,1,MPI_INT,0,world); + MPI_Bcast(&yflag,1,MPI_INT,0,world); + MPI_Bcast(&zflag,1,MPI_INT,0,world); + + // error check on current vs new box and fields + // triclinic_snap < 0 means no box info in file + + if (triclinic_snap < 0 && boxflag > 0) + error->all(FLERR,"No box information in dump, must use 'box no'"); + if (triclinic_snap >= 0) { + if ((triclinic_snap && !triclinic) || + (!triclinic_snap && triclinic)) + error->one(FLERR,"Read_dump triclinic status does not match simulation"); + } + + // error check on requested fields exisiting in dump file + + if (fieldflag < 0) + error->one(FLERR,"Read_dump field not found in dump file"); + + // all explicitly requested x,y,z must have consistent scaling & wrapping + + int value = MAX(xflag,yflag); + value = MAX(zflag,value); + if ((xflag != UNSET && xflag != value) || + (yflag != UNSET && yflag != value) || + (zflag != UNSET && zflag != value)) + error->one(FLERR, + "Read_dump xyz fields do not have consistent scaling/wrapping"); + + // set scaled/wrapped based on xyz flags + + value = UNSET; + if (xflag != UNSET) value = xflag; + if (yflag != UNSET) value = yflag; + if (zflag != UNSET) value = zflag; + + if (value == UNSET) { + scaled = wrapped = 0; + } else if (value == NOSCALE_NOWRAP) { + scaled = wrapped = 0; + } else if (value == NOSCALE_WRAP) { + scaled = 0; + wrapped = 1; + } else if (value == SCALE_NOWRAP) { + scaled = 1; + wrapped = 0; + } else if (value == SCALE_WRAP) { + scaled = wrapped = 1; + } + + // scaled, triclinic coords require all 3 x,y,z fields, to perform unscaling + // set yindex,zindex = column index of Y and Z fields in fields array + // needed for unscaling to absolute coords in xfield(), yfield(), zfield() + + if (scaled && triclinic == 1) { + int flag = 0; + if (xflag == UNSET) flag = 1; + if (yflag == UNSET) flag = 1; + if (dimension == 3 && zflag == UNSET) flag = 1; + if (flag) + error->one(FLERR,"All read_dump x,y,z fields must be specified for " + "scaled, triclinic coords"); + + for (int i = 0; i < nfield; i++) { + if (fieldtype[i] == Y) yindex = i; + if (fieldtype[i] == Z) zindex = i; + } + } +} + +/* ---------------------------------------------------------------------- */ + +void ReadDump2::atoms() +{ + // initialize counters + + npurge = nreplace = ntrim = nadd = 0; + + // if purgeflag set, delete all current atoms + + if (purgeflag) { + if (atom->map_style) atom->map_clear(); + npurge = atom->nlocal; + atom->nlocal = atom->nghost = 0; + atom->natoms = 0; + } + + // to match existing atoms to dump atoms: + // must build map if not a molecular system + + int mapflag = 0; + if (atom->map_style == 0) { + mapflag = 1; + atom->map_init(); + atom->map_set(); + } + + // uflag[i] = 1 for each owned atom appearing in dump + // ucflag = similar flag for each chunk atom, used in process_atoms() + + int nlocal = atom->nlocal; + memory->create(uflag,nlocal,"read_dump:uflag"); + for (int i = 0; i < nlocal; i++) uflag[i] = 0; + memory->create(ucflag,CHUNK,"read_dump:ucflag"); + memory->create(ucflag_all,CHUNK,"read_dump:ucflag"); + + // read, broadcast, and process atoms from snapshot in chunks + + addproc = -1; + + int nchunk; + bigint nread = 0; + while (nread < nsnapatoms) { + nchunk = MIN(nsnapatoms-nread,CHUNK); + if (me == 0) reader->read_atoms(nchunk,nfield,fields); + MPI_Bcast(&fields[0][0],nchunk*nfield,MPI_DOUBLE,0,world); + process_atoms(nchunk); + nread += nchunk; + } + + // if addflag = YESADD, assign IDs to new snapshot atoms + + if (addflag == YESADD) { + bigint nblocal = atom->nlocal; + MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); + if (atom->natoms < 0 || atom->natoms >= MAXBIGINT) + error->all(FLERR,"Too many total atoms"); + if (atom->tag_enable) atom->tag_extend(); + } + + // if trimflag set, delete atoms not replaced by snapshot atoms + + if (trimflag) { + delete_atoms(); + bigint nblocal = atom->nlocal; + MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); + } + + // can now delete uflag arrays + + memory->destroy(uflag); + memory->destroy(ucflag); + memory->destroy(ucflag_all); + + // delete atom map if created it above + // else reinitialize map for current atoms + // do this before migrating atoms to new procs via Irregular + + if (mapflag) { + atom->map_delete(); + atom->map_style = 0; + } else { + atom->nghost = 0; + atom->map_init(); + atom->map_set(); + } + + // overwrite simulation box with dump snapshot box if requested + // reallocate processors to box + + if (boxflag) { + domain->boxlo[0] = xlo; + domain->boxhi[0] = xhi; + domain->boxlo[1] = ylo; + domain->boxhi[1] = yhi; + if (dimension == 3) { + domain->boxlo[2] = zlo; + domain->boxhi[2] = zhi; + } + if (triclinic) { + domain->xy = xy; + if (dimension == 3) { + domain->xz = xz; + domain->yz = yz; + } + } + + domain->set_initial_box(); + domain->set_global_box(); + comm->set_proc_grid(0); + domain->set_local_box(); + } + + // move atoms back inside simulation box and to new processors + // use remap() instead of pbc() in case atoms moved a long distance + // adjust image flags of all atoms (old and new) based on current box + // use irregular() in case atoms moved a long distance + + double **x = atom->x; + imageint *image = atom->image; + nlocal = atom->nlocal; + for (int i = 0; i < nlocal; i++) domain->remap(x[i],image[i]); + + if (triclinic) domain->x2lamda(atom->nlocal); + domain->reset_box(); + Irregular *irregular = new Irregular(lmp); + irregular->migrate_atoms(1); + delete irregular; + if (triclinic) domain->lamda2x(atom->nlocal); + + // check that atom IDs are valid + + atom->tag_check(); +} + +/* ---------------------------------------------------------------------- + process arg list for dump file fields and optional keywords +------------------------------------------------------------------------- */ + +int ReadDump2::fields_and_keywords(int narg, char **arg) +{ + // per-field vectors, leave space for ID and TYPE + + fieldtype = new int[narg+2]; + fieldlabel = new char*[narg+2]; + + // add id and type fields as needed + // scan ahead to see if "add yes/keep" keyword/value is used + // requires extra "type" field from from dump file + + int iarg; + for (iarg = 0; iarg < narg; iarg++) + if (strcmp(arg[iarg],"add") == 0) + if (iarg < narg-1 && (strcmp(arg[iarg+1],"yes") == 0 || + strcmp(arg[iarg+1],"keep") == 0)) break; + + nfield = 0; + fieldtype[nfield++] = ID; + if (iarg < narg) fieldtype[nfield++] = TYPE; + + // parse fields + + iarg = 0; + while (iarg < narg) { + int type = whichtype(arg[iarg]); + if (type < 0) break; + if (type == Q && !atom->q_flag) + error->all(FLERR,"Read dump of atom property that isn't allocated"); + fieldtype[nfield++] = type; + iarg++; + } + + // check for no fields + + if (fieldtype[nfield-1] == ID || fieldtype[nfield-1] == TYPE) + error->all(FLERR,"Illegal read_dump command"); + + if (dimension == 2) { + for (int i = 0; i < nfield; i++) + if (fieldtype[i] == Z || fieldtype[i] == VZ || + fieldtype[i] == IZ || fieldtype[i] == FZ) + error->all(FLERR,"Illegal read_dump command"); + } + + for (int i = 0; i < nfield; i++) + for (int j = i+1; j < nfield; j++) + if (fieldtype[i] == fieldtype[j]) + error->all(FLERR,"Duplicate fields in read_dump command"); + + // parse optional args + + boxflag = 1; + replaceflag = 1; + purgeflag = 0; + trimflag = 0; + addflag = NOADD; + for (int i = 0; i < nfield; i++) fieldlabel[i] = NULL; + scaleflag = 0; + wrapflag = 1; + + while (iarg < narg) { + if (strcmp(arg[iarg],"box") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) boxflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) boxflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"replace") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) replaceflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) replaceflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"purge") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) purgeflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) purgeflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"trim") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) trimflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) trimflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"add") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) addflag = YESADD; + else if (strcmp(arg[iarg+1],"no") == 0) addflag = NOADD; + else if (strcmp(arg[iarg+1],"keep") == 0) addflag = KEEPADD; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"label") == 0) { + if (iarg+3 > narg) error->all(FLERR,"Illegal read_dump command"); + int type = whichtype(arg[iarg+1]); + int i; + for (i = 0; i < nfield; i++) + if (type == fieldtype[i]) break; + if (i == nfield) error->all(FLERR,"Illegal read_dump command"); + int n = strlen(arg[iarg+2]) + 1; + fieldlabel[i] = new char[n]; + strcpy(fieldlabel[i],arg[iarg+2]); + iarg += 3; + } else if (strcmp(arg[iarg],"scaled") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) scaleflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) scaleflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"wrapped") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) wrapflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) wrapflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"format") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + delete [] readerstyle; + int n = strlen(arg[iarg+1]) + 1; + readerstyle = new char[n]; + strcpy(readerstyle,arg[iarg+1]); + iarg += 2; + break; + } else error->all(FLERR,"Illegal read_dump command"); + } + + if (purgeflag && (replaceflag || trimflag)) + error->all(FLERR,"If read_dump purges it cannot replace or trim"); + if (addflag == KEEPADD && atom->tag_enable == 0) + error->all(FLERR,"Read_dump cannot use 'add keep' without atom IDs"); + + return narg-iarg; +} + +/* ---------------------------------------------------------------------- + check if str is a field argument + if yes, return index of which + if not, return -1 +------------------------------------------------------------------------- */ + +int ReadDump2::whichtype(char *str) +{ + int type = -1; + if (strcmp(str,"id") == 0) type = ID; + else if (strcmp(str,"type") == 0) type = TYPE; + else if (strcmp(str,"x") == 0) type = X; + else if (strcmp(str,"y") == 0) type = Y; + else if (strcmp(str,"z") == 0) type = Z; + else if (strcmp(str,"vx") == 0) type = VX; + else if (strcmp(str,"vy") == 0) type = VY; + else if (strcmp(str,"vz") == 0) type = VZ; + else if (strcmp(str,"q") == 0) type = Q; + else if (strcmp(str,"ix") == 0) type = IX; + else if (strcmp(str,"iy") == 0) type = IY; + else if (strcmp(str,"iz") == 0) type = IZ; + else if (strcmp(str,"fx") == 0) type = FX; + else if (strcmp(str,"fy") == 0) type = FY; + else if (strcmp(str,"fz") == 0) type = FZ; + return type; +} + +/* ---------------------------------------------------------------------- + process each of N atoms in chunk read from dump file + if in replace mode and atom ID matches current atom, + overwrite atom info with fields from dump file + if in add mode and atom ID does not match any current atom, + create new atom with dump file field values, + and assign to a proc in round-robin manner + use round-robin method, b/c atom coords may not be inside simulation box +------------------------------------------------------------------------- */ + +void ReadDump2::process_atoms(int n) +{ + int i,m,ifield,itype; + int xbox,ybox,zbox; + tagint mtag; + + double **x = atom->x; + double **v = atom->v; + double *q = atom->q; + double **f = atom->f; + tagint *tag = atom->tag; + imageint *image = atom->image; + int nlocal = atom->nlocal; + tagint map_tag_max = atom->map_tag_max; + + for (i = 0; i < n; i++) { + ucflag[i] = 0; + + // check if new atom matches one I own + // setting m = -1 forces new atom not to match + // NOTE: atom ID in fields is stored as double, not as ubuf + // so can only cast it to tagint, thus cannot be full 64-bit ID + + mtag = static_cast (fields[i][0]); + if (mtag <= map_tag_max) m = atom->map(mtag); + else m = -1; + if (m < 0 || m >= nlocal) continue; + + ucflag[i] = 1; + uflag[m] = 1; + + if (replaceflag) { + nreplace++; + + // current image flags + + xbox = (image[m] & IMGMASK) - IMGMAX; + ybox = (image[m] >> IMGBITS & IMGMASK) - IMGMAX; + zbox = (image[m] >> IMG2BITS) - IMGMAX; + + // overwrite atom attributes with field info + // start from field 1 since 0 = id, 1 will be skipped if type + + for (ifield = 1; ifield < nfield; ifield++) { + switch (fieldtype[ifield]) { + case X: + x[m][0] = xfield(i,ifield); + break; + case Y: + x[m][1] = yfield(i,ifield); + break; + case Z: + x[m][2] = zfield(i,ifield); + break; + case VX: + v[m][0] = fields[i][ifield]; + break; + case Q: + q[m] = fields[i][ifield]; + break; + case VY: + v[m][1] = fields[i][ifield]; + break; + case VZ: + v[m][2] = fields[i][ifield]; + break; + case IX: + xbox = static_cast (fields[i][ifield]); + break; + case IY: + ybox = static_cast (fields[i][ifield]); + break; + case IZ: + zbox = static_cast (fields[i][ifield]); + break; + case FX: + f[m][0] = fields[i][ifield]; + break; + case FY: + f[m][1] = fields[i][ifield]; + break; + case FZ: + f[m][2] = fields[i][ifield]; + break; + } + } + + // replace image flag in case changed by ix,iy,iz fields or unwrapping + + if (!wrapped) xbox = ybox = zbox = 0; + + image[m] = ((imageint) (xbox + IMGMAX) & IMGMASK) | + (((imageint) (ybox + IMGMAX) & IMGMASK) << IMGBITS) | + (((imageint) (zbox + IMGMAX) & IMGMASK) << IMG2BITS); + } + } + + // create any atoms in chunk that no processor owned + // add atoms in round-robin sequence on processors + // cannot do it geometrically b/c dump coords may not be in simulation box + // check that dump file snapshot has atom type field + + if (addflag == NOADD) return; + + int tflag = 0; + for (ifield = 0; ifield < nfield; ifield++) + if (fieldtype[ifield] == TYPE) tflag = 1; + if (!tflag) + error->all(FLERR,"Cannot add atoms if dump file does not store atom type"); + + MPI_Allreduce(ucflag,ucflag_all,n,MPI_INT,MPI_SUM,world); + + int nlocal_previous = atom->nlocal; + double one[3]; + + for (i = 0; i < n; i++) { + if (ucflag_all[i]) continue; + + // each processor adds every Pth atom + + addproc++; + if (addproc == nprocs) addproc = 0; + if (addproc != me) continue; + + // create type and coord fields from dump file + // coord = 0.0 unless corresponding dump file field was specified + + itype = 0; + one[0] = one[1] = one[2] = 0.0; + for (ifield = 1; ifield < nfield; ifield++) { + switch (fieldtype[ifield]) { + case TYPE: + itype = static_cast (fields[i][ifield]); + break; + case X: + one[0] = xfield(i,ifield); + break; + case Y: + one[1] = yfield(i,ifield); + break; + case Z: + one[2] = zfield(i,ifield); + break; + } + } + + // create the atom on proc that owns it + // reset v,image ptrs in case they are reallocated + + m = atom->nlocal; + atom->avec->create_atom(itype,one); + nadd++; + + tag = atom->tag; + v = atom->v; + q = atom->q; + image = atom->image; + + // set atom attributes from other dump file fields + + xbox = ybox = zbox = 0; + + for (ifield = 0; ifield < nfield; ifield++) { + switch (fieldtype[ifield]) { + case ID: + if (addflag == KEEPADD) + tag[m] = static_cast (fields[i][ifield]); + break; + case VX: + v[m][0] = fields[i][ifield]; + break; + case VY: + v[m][1] = fields[i][ifield]; + break; + case VZ: + v[m][2] = fields[i][ifield]; + break; + case Q: + q[m] = fields[i][ifield]; + break; + case IX: + xbox = static_cast (fields[i][ifield]); + break; + case IY: + ybox = static_cast (fields[i][ifield]); + break; + case IZ: + zbox = static_cast (fields[i][ifield]); + break; + } + + // replace image flag in case changed by ix,iy,iz fields + + image[m] = ((imageint) (xbox + IMGMAX) & IMGMASK) | + (((imageint) (ybox + IMGMAX) & IMGMASK) << IMGBITS) | + (((imageint) (zbox + IMGMAX) & IMGMASK) << IMG2BITS); + } + } + + // init per-atom fix/compute/variable values for created atoms + + atom->data_fix_compute_variable(nlocal_previous,atom->nlocal); +} + +/* ---------------------------------------------------------------------- + delete atoms not flagged as replaced by dump atoms +------------------------------------------------------------------------- */ + +void ReadDump2::delete_atoms() +{ + AtomVec *avec = atom->avec; + int nlocal = atom->nlocal; + + int i = 0; + while (i < nlocal) { + if (uflag[i] == 0) { + avec->copy(nlocal-1,i,1); + uflag[i] = uflag[nlocal-1]; + nlocal--; + ntrim++; + } else i++; + } + + atom->nlocal = nlocal; +} + +/* ---------------------------------------------------------------------- + convert XYZ fields in dump file into absolute, unscaled coordinates + depends on scaled vs unscaled and triclinic vs orthogonal + does not depend on wrapped vs unwrapped +------------------------------------------------------------------------- */ + +double ReadDump2::xfield(int i, int j) +{ + if (!scaled) return fields[i][j]; + else if (!triclinic) return fields[i][j]*xprd + xlo; + else if (dimension == 2) + return xprd*fields[i][j] + xy*fields[i][yindex] + xlo; + return xprd*fields[i][j] + xy*fields[i][yindex] + xz*fields[i][zindex] + xlo; +} + +double ReadDump2::yfield(int i, int j) +{ + if (!scaled) return fields[i][j]; + else if (!triclinic) return fields[i][j]*yprd + ylo; + else if (dimension == 2) return yprd*fields[i][j] + ylo; + return yprd*fields[i][j] + yz*fields[i][zindex] + ylo; +} + +double ReadDump2::zfield(int i, int j) +{ + if (!scaled) return fields[i][j]; + return fields[i][j]*zprd + zlo; +} diff --git a/src/read_dump2.h b/src/read_dump2.h new file mode 100644 index 0000000000..27105860f5 --- /dev/null +++ b/src/read_dump2.h @@ -0,0 +1,172 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. + + Contributed by Timothy Sirk +------------------------------------------------------------------------- */ + +#ifdef COMMAND_CLASS + +CommandStyle(read_dump2,ReadDump2) + +#else + +#ifndef LMP_READ_DUMP2_H +#define LMP_READ_DUMP2_H + +#include +#include "pointers.h" + +namespace LAMMPS_NS { + +class ReadDump2 : protected Pointers { + public: + ReadDump2(class LAMMPS *); + ~ReadDump2(); + void command(int, char **); + + void store_files(int, char **); + void setup_reader(int, char **); + bigint seek(bigint, int); + void header(int); + bigint next(bigint, bigint, int, int); + void atoms(); + int fields_and_keywords(int, char **); + +private: + int me,nprocs; + FILE *fp; + + int dimension; + int triclinic; + + int nfile; // # of dump files to process + char **files; // list of file names + int currentfile; // currently open file + + int boxflag; // overwrite simulation with dump file box params + int replaceflag,addflag; // flags for processing dump snapshot atoms + int trimflag,purgeflag; + int scaleflag; // user 0/1 if dump file coords are unscaled/scaled + int wrapflag; // user 0/1 if dump file coords are unwrapped/wrapped + char *readerstyle; // style of dump files to read + + int nfield; // # of fields to extract from dump file + int *fieldtype; // type of each field = X,VY,IZ,etc + char **fieldlabel; // user specified label for field + double **fields; // per-atom field values + + int scaled; // 0/1 if dump file coords are unscaled/scaled + int wrapped; // 0/1 if dump file coords are unwrapped/wrapped + + double box[3][3]; // dump file box parameters + double xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz; // dump snapshot box params + double xprd,yprd,zprd; + + bigint nsnapatoms; // # of atoms in dump file shapshot + + int npurge,nreplace,ntrim,nadd; // stats on processed atoms + int addproc; // proc that should add next atom + int yindex,zindex; // field index for Y,Z coords + + int *uflag; // set to 1 if snapshot atom matches owned atom + int *ucflag,*ucflag_all; // set to 1 if snapshot chunk atom was processed + + class Reader *reader; // class that reads dump file + + int whichtype(char *); + void process_atoms(int); + void delete_atoms(); + + double xfield(int, int); + double yfield(int, int); + double zfield(int, int); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Read_dump command before simulation box is defined + +The read_dump command cannot be used before a read_data, read_restart, +or create_box command. + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Dump file does not contain requested snapshot + +Self-explanatory. + +E: Unknown dump reader style + +The choice of dump reader style via the format keyword is unknown. + +E: No box information in dump, must use 'box no' + +UNDOCUMENTED + +E: Read_dump triclinic status does not match simulation + +Both the dump snapshot and the current LAMMPS simulation must +be using either an orthogonal or triclinic box. + +E: Read_dump field not found in dump file + +Self-explanatory. + +E: Read_dump xyz fields do not have consistent scaling/wrapping + +Self-explanatory. + +E: All read_dump x,y,z fields must be specified for scaled, triclinic coords + +For triclinic boxes and scaled coordinates you must specify all 3 of +the x,y,z fields, else LAMMPS cannot reconstruct the unscaled +coordinates. + +E: Too many total atoms + +See the setting for bigint in the src/lmptype.h file. + +E: Read dump of atom property that isn't allocated + +Self-explanatory. + +E: Duplicate fields in read_dump command + +Self-explanatory. + +E: If read_dump purges it cannot replace or trim + +These operations are not compatible. See the read_dump doc +page for details. + +E: Read_dump cannot use 'add keep' without atom IDs + +UNDOCUMENTED + +E: Cannot add atoms if dump file does not store atom type + +UNDOCUMENTED + +U: No box information in dump. You have to use 'box no' + +Self-explanatory. + +*/ diff --git a/src/read_restart.h b/src/read_restart.h index 8d2547fb10..350d2787f7 100644 --- a/src/read_restart.h +++ b/src/read_restart.h @@ -31,11 +31,13 @@ class ReadRestart : protected Pointers { void command(int, char **); private: - int me,nprocs,nprocs_file,multiproc_file; + int me,nprocs; FILE *fp; - int multiproc; // 0 = proc 0 writes for all - // else # of procs writing files + int multiproc; // 0 = restart file is a single file + // 1 = restart file is parallel (multiple files) + int multiproc_file; // # of parallel files in restart + int nprocs_file; // total # of procs that wrote restart file // MPI-IO values diff --git a/src/reader.cpp b/src/reader.cpp index 22a21812e6..cf344b37b3 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -18,6 +18,8 @@ using namespace LAMMPS_NS; +// only proc 0 calls methods of this class, except for constructor/destructor + /* ---------------------------------------------------------------------- */ Reader::Reader(LAMMPS *lmp) : Pointers(lmp) diff --git a/src/rerun2.cpp b/src/rerun2.cpp new file mode 100644 index 0000000000..1747f63b97 --- /dev/null +++ b/src/rerun2.cpp @@ -0,0 +1,193 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include +#include +#include "rerun2.h" +#include "read_dump2.h" +#include "domain.h" +#include "update.h" +#include "integrate.h" +#include "modify.h" +#include "output.h" +#include "finish.h" +#include "timer.h" +#include "error.h" +#include "force.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +Rerun2::Rerun2(LAMMPS *lmp) : Pointers(lmp) {} + +/* ---------------------------------------------------------------------- */ + +void Rerun2::command(int narg, char **arg) +{ + if (domain->box_exist == 0) + error->all(FLERR,"Rerun command before simulation box is defined"); + + if (narg < 2) error->all(FLERR,"Illegal rerun command"); + + // list of dump files = args until a keyword + + int iarg = 0; + while (iarg < narg) { + if (strcmp(arg[iarg],"first") == 0) break; + if (strcmp(arg[iarg],"last") == 0) break; + if (strcmp(arg[iarg],"every") == 0) break; + if (strcmp(arg[iarg],"skip") == 0) break; + if (strcmp(arg[iarg],"start") == 0) break; + if (strcmp(arg[iarg],"stop") == 0) break; + if (strcmp(arg[iarg],"dump") == 0) break; + iarg++; + } + int nfile = iarg; + if (nfile == 0 || nfile == narg) error->all(FLERR,"Illegal rerun command"); + + // parse optional args up until "dump" + // use MAXBIGINT -1 so Output can add 1 to it and still be a big int + + bigint first = 0; + bigint last = MAXBIGINT - 1; + int nevery = 0; + int nskip = 1; + int startflag = 0; + int stopflag = 0; + bigint start = -1; + bigint stop = -1; + + while (iarg < narg) { + if (strcmp(arg[iarg],"first") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); + first = force->bnumeric(FLERR,arg[iarg+1]); + if (first < 0) error->all(FLERR,"Illegal rerun command"); + iarg += 2; + } else if (strcmp(arg[iarg],"last") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); + last = force->bnumeric(FLERR,arg[iarg+1]); + if (last < 0) error->all(FLERR,"Illegal rerun command"); + iarg += 2; + } else if (strcmp(arg[iarg],"every") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); + nevery = force->inumeric(FLERR,arg[iarg+1]); + if (nevery < 0) error->all(FLERR,"Illegal rerun command"); + iarg += 2; + } else if (strcmp(arg[iarg],"skip") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); + nskip = force->inumeric(FLERR,arg[iarg+1]); + if (nskip <= 0) error->all(FLERR,"Illegal rerun command"); + iarg += 2; + } else if (strcmp(arg[iarg],"start") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); + startflag = 1; + start = force->bnumeric(FLERR,arg[iarg+1]); + if (start < 0) error->all(FLERR,"Illegal rerun command"); + iarg += 2; + } else if (strcmp(arg[iarg],"stop") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); + stopflag = 1; + stop = force->bnumeric(FLERR,arg[iarg+1]); + if (stop < 0) error->all(FLERR,"Illegal rerun command"); + iarg += 2; + } else if (strcmp(arg[iarg],"dump") == 0) { + break; + } else error->all(FLERR,"Illegal rerun command"); + } + + int nremain = narg - iarg - 1; + if (nremain <= 0) error->all(FLERR,"Illegal rerun command"); + if (first > last) error->all(FLERR,"Illegal rerun command"); + if (startflag && stopflag && start > stop) + error->all(FLERR,"Illegal rerun command"); + + // pass list of filenames to ReadDump + // along with post-"dump" args and post-"format" args + + ReadDump2 *rd = new ReadDump2(lmp); + + rd->store_files(nfile,arg); + if (nremain) + nremain = rd->fields_and_keywords(nremain,&arg[narg-nremain]); + else nremain = rd->fields_and_keywords(0,NULL); + if (nremain) rd->setup_reader(nremain,&arg[narg-nremain]); + else rd->setup_reader(0,NULL); + + // perform the pseudo run + // invoke lmp->init() only once + // read all relevant snapshots + // use setup_minimal() since atoms are already owned by correct procs + // addstep_compute_all() insures energy/virial computed on every snapshot + + update->whichflag = 1; + + if (startflag) update->beginstep = update->firststep = start; + else update->beginstep = update->firststep = first; + if (stopflag) update->endstep = update->laststep = stop; + else update->endstep = update->laststep = last; + + int firstflag = 1; + int ndump = 0; + + lmp->init(); + + timer->init(); + timer->barrier_start(); + + bigint ntimestep = rd->seek(first,0); + if (ntimestep < 0) + error->all(FLERR,"Rerun dump file does not contain requested snapshot"); + + while (1) { + ndump++; + rd->header(firstflag); + update->reset_timestep(ntimestep); + rd->atoms(); + modify->init(); + update->integrate->setup_minimal(1); + modify->end_of_step(); + if (firstflag) output->setup(); + else if (output->next) output->write(ntimestep); + + firstflag = 0; + ntimestep = rd->next(ntimestep,last,nevery,nskip); + if (stopflag && ntimestep > stop) + error->all(FLERR,"Read rerun dump file timestep > specified stop"); + if (ntimestep < 0) break; + } + + // insure thermo output on last dump timestep + + output->next_thermo = update->ntimestep; + output->write(update->ntimestep); + + timer->barrier_stop(); + + update->integrate->cleanup(); + + // set update->nsteps to ndump for Finish stats to print + + update->nsteps = ndump; + + Finish finish(lmp); + finish.end(1); + + update->whichflag = 0; + update->firststep = update->laststep = 0; + update->beginstep = update->endstep = 0; + + // clean-up + + delete rd; +} diff --git a/src/rerun2.h b/src/rerun2.h new file mode 100644 index 0000000000..fa4e2c49a6 --- /dev/null +++ b/src/rerun2.h @@ -0,0 +1,59 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef COMMAND_CLASS + +CommandStyle(rerun2,Rerun2) + +#else + +#ifndef LMP_RERUN2_H +#define LMP_RERUN2_H + +#include "pointers.h" + +namespace LAMMPS_NS { + +class Rerun2 : protected Pointers { + public: + Rerun2(class LAMMPS *); + void command(int, char **); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Rerun command before simulation box is defined + +The rerun command cannot be used before a read_data, read_restart, or +create_box command. + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Rerun dump file does not contain requested snapshot + +Self-explanatory. + +E: Read rerun dump file timestep > specified stop + +Self-explanatory. + +*/ From 0a4007c55b556d6fd3525bd0666e7e3df401a70b Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 26 Oct 2018 17:37:50 -0600 Subject: [PATCH 02/94] add parallel file read capability to ReadDump --- src/read_dump.cpp | 946 ++++++++++++++++++++++++++++++++-------------- src/read_dump.h | 47 ++- src/rerun.cpp | 2 +- 3 files changed, 689 insertions(+), 306 deletions(-) diff --git a/src/read_dump.cpp b/src/read_dump.cpp index 30934f123b..620e84e910 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -43,8 +43,7 @@ using namespace LAMMPS_NS; -#define CHUNK 1024 -#define EPSILON 1.0e-6 +#define CHUNK 16384 // also in reader_native.cpp @@ -65,17 +64,21 @@ ReadDump::ReadDump(LAMMPS *lmp) : Pointers(lmp) nfile = 0; files = NULL; + nnew = maxnew = 0; nfield = 0; fieldtype = NULL; fieldlabel = NULL; fields = NULL; + buf = NULL; int n = strlen("native") + 1; readerstyle = new char[n]; strcpy(readerstyle,"native"); - reader = NULL; - fp = NULL; + nreader = 0; + readers = NULL; + nsnapatoms = NULL; + clustercomm = MPI_COMM_NULL; } /* ---------------------------------------------------------------------- */ @@ -90,7 +93,13 @@ ReadDump::~ReadDump() delete [] readerstyle; memory->destroy(fields); - delete reader; + memory->destroy(buf); + + for (int i = 0; i < nreader; i++) delete readers[i]; + delete [] readers; + delete [] nsnapatoms; + + MPI_Comm_free(&clustercomm); } /* ---------------------------------------------------------------------- */ @@ -134,13 +143,20 @@ void ReadDump::command(int narg, char **arg) bigint natoms_prev = atom->natoms; atoms(); - if (me == 0) reader->close_file(); + if (filereader) + for (int i = 0; i < nreader; i++) + readers[i]->close_file(); // print out stats - bigint npurge_all,nreplace_all,ntrim_all,nadd_all; + bigint nsnap_all,npurge_all,nreplace_all,ntrim_all,nadd_all; + + bigint tmp = 0; + if (filereader) + for (int i = 0; i < nreader; i++) + tmp += nsnapatoms[i]; + MPI_Allreduce(&tmp,&nsnap_all,1,MPI_LMP_BIGINT,MPI_SUM,world); - bigint tmp; tmp = npurge; MPI_Allreduce(&tmp,&npurge_all,1,MPI_LMP_BIGINT,MPI_SUM,world); tmp = nreplace; @@ -155,7 +171,7 @@ void ReadDump::command(int narg, char **arg) if (me == 0) { if (screen) { fprintf(screen," " BIGINT_FORMAT " atoms before read\n",natoms_prev); - fprintf(screen," " BIGINT_FORMAT " atoms in snapshot\n",nsnapatoms); + fprintf(screen," " BIGINT_FORMAT " atoms in snapshot\n",nsnap_all); fprintf(screen," " BIGINT_FORMAT " atoms purged\n",npurge_all); fprintf(screen," " BIGINT_FORMAT " atoms replaced\n",nreplace_all); fprintf(screen," " BIGINT_FORMAT " atoms trimmed\n",ntrim_all); @@ -164,7 +180,7 @@ void ReadDump::command(int narg, char **arg) } if (logfile) { fprintf(logfile," " BIGINT_FORMAT " atoms before read\n",natoms_prev); - fprintf(logfile," " BIGINT_FORMAT " atoms in snapshot\n",nsnapatoms); + fprintf(logfile," " BIGINT_FORMAT " atoms in snapshot\n",nsnap_all); fprintf(logfile," " BIGINT_FORMAT " atoms purged\n",npurge_all); fprintf(logfile," " BIGINT_FORMAT " atoms replaced\n",nreplace_all); fprintf(logfile," " BIGINT_FORMAT " atoms trimmed\n",ntrim_all); @@ -181,10 +197,22 @@ void ReadDump::store_files(int nstr, char **str) nfile = nstr; files = new char*[nfile]; + // either all or none of files must have '%' wild-card + for (int i = 0; i < nfile; i++) { int n = strlen(str[i]) + 1; files[i] = new char[n]; strcpy(files[i],str[i]); + + if (i == 0) { + if (strchr(files[i],'%')) multiproc = 1; + else multiproc = 0; + } else { + if (multiproc && !strchr(files[i],'%')) + error->all(FLERR,"All read_dump files must be serial or parallel"); + if (!multiproc && strchr(files[i],'%')) + error->all(FLERR,"All read_dump files must be serial or parallel"); + } } } @@ -192,18 +220,47 @@ void ReadDump::store_files(int nstr, char **str) void ReadDump::setup_reader(int narg, char **arg) { - // allocate snapshot field buffer + // setup serial or parallel file reading + // multiproc = 0: only one file to read from, only proc 0 is a reader + // multiproc_nfile >= nprocs: every proc reads one or more files + // multiproc_nfile < nprocs: multiproc_nfile readers, create clusters + // see read_dump.h for explanation of these variables - memory->create(fields,CHUNK,nfield,"read_dump:fields"); + if (multiproc == 0) { + nreader = 1; + firstfile = -1; + MPI_Comm_dup(world,&clustercomm); + } else if (multiproc_nfile >= nprocs) { + firstfile = static_cast ((bigint) me * multiproc_nfile/nprocs); + int lastfile = static_cast ((bigint) (me+1) * multiproc_nfile/nprocs); + nreader = lastfile - firstfile; + MPI_Comm_split(world,me,0,&clustercomm); + } else if (multiproc_nfile < nprocs) { + nreader = 1; + int icluster = static_cast ((bigint) me * multiproc_nfile/nprocs); + firstfile = icluster; + MPI_Comm_split(world,icluster,0,&clustercomm); + } - // create reader class + MPI_Comm_rank(clustercomm,&me_cluster); + MPI_Comm_size(clustercomm,&nprocs_cluster); + if (me_cluster == 0) filereader = 1; + else filereader = 0; + + readers = new Reader*[nreader]; + nsnapatoms = new bigint[nreader]; + + // create Nreader reader classes per reader // match readerstyle to options in style_reader.h if (0) return; // dummy line to enable else-if macro expansion #define READER_CLASS #define ReaderStyle(key,Class) \ - else if (strcmp(readerstyle,#key) == 0) reader = new Class(lmp); + else if (strcmp(readerstyle,#key) == 0) { \ + for (int i = 0; i < nreader; i++) \ + readers[i] = new Class(lmp); \ + } #include "style_reader.h" #undef READER_CLASS @@ -211,9 +268,11 @@ void ReadDump::setup_reader(int narg, char **arg) else error->all(FLERR,"Unknown dump reader style"); - // pass any arguments to reader + // pass any arguments to readers - if (narg > 0) reader->settings(narg,arg); + if (narg > 0 && filereader) + for (int i = 0; i < nreader; i++) + readers[i]->settings(narg,arg); } /* ---------------------------------------------------------------------- @@ -228,6 +287,8 @@ bigint ReadDump::seek(bigint nrequest, int exact) int ifile,eofflag; bigint ntimestep; + // proc 0 finds the timestep in its first reader + if (me == 0) { // exit file loop when dump timestep >= nrequest @@ -235,24 +296,75 @@ bigint ReadDump::seek(bigint nrequest, int exact) for (ifile = 0; ifile < nfile; ifile++) { ntimestep = -1; - reader->open_file(files[ifile]); + if (multiproc) { + char *ptr = strchr(files[ifile],'%'); + char *multiname = new char[strlen(files[ifile]) + 16]; + *ptr = '\0'; + sprintf(multiname,"%s%d%s",files[ifile],0,ptr+1); + *ptr = '%'; + readers[0]->open_file(multiname); + delete [] multiname; + } else readers[0]->open_file(files[ifile]); + while (1) { - eofflag = reader->read_time(ntimestep); + eofflag = readers[0]->read_time(ntimestep); if (eofflag) break; if (ntimestep >= nrequest) break; - reader->skip(); + readers[0]->skip(); } + if (ntimestep >= nrequest) break; - reader->close_file(); + readers[0]->close_file(); } currentfile = ifile; if (ntimestep < nrequest) ntimestep = -1; if (exact && ntimestep != nrequest) ntimestep = -1; - if (ntimestep < 0) reader->close_file(); } + // proc 0 broadcasts timestep and currentfile to all procs + MPI_Bcast(&ntimestep,1,MPI_LMP_BIGINT,0,world); + MPI_Bcast(¤tfile,1,MPI_INT,0,world); + + // if ntimestep < 0: + // all filereader procs close all their files and return + + if (ntimestep < 0) { + if (filereader) + for (int i = 0; i < nreader; i++) + readers[i]->close_file(); + return ntimestep; + } + + // for multiproc mode: + // all filereader procs search for same ntimestep in currentfile + + if (multiproc && filereader) { + for (int i = 0; i < nreader; i++) { + if (me == 0 && i == 0) continue; // proc 0, reader 0 already found it + char *ptr = strchr(files[currentfile],'%'); + char *multiname = new char[strlen(files[currentfile]) + 16]; + *ptr = '\0'; + sprintf(multiname,"%s%d%s",files[currentfile],firstfile+i,ptr+1); + *ptr = '%'; + readers[i]->open_file(multiname); + delete [] multiname; + + bigint step; + while (1) { + eofflag = readers[i]->read_time(step); + if (eofflag) break; + if (step == ntimestep) break; + readers[i]->skip(); + } + + if (eofflag) + error->one(FLERR,"Read dump parallel files " + "do not all have same timestep"); + } + } + return ntimestep; } @@ -270,6 +382,8 @@ bigint ReadDump::next(bigint ncurrent, bigint nlast, int nevery, int nskip) int ifile,eofflag; bigint ntimestep; + // proc 0 finds the timestep in its first reader + if (me == 0) { // exit file loop when dump timestep matches all criteria @@ -279,19 +393,34 @@ bigint ReadDump::next(bigint ncurrent, bigint nlast, int nevery, int nskip) for (ifile = currentfile; ifile < nfile; ifile++) { ntimestep = -1; - if (ifile != currentfile) reader->open_file(files[ifile]); + if (ifile != currentfile) { + if (multiproc) { + char *ptr = strchr(files[ifile],'%'); + char *multiname = new char[strlen(files[ifile]) + 16]; + *ptr = '\0'; + sprintf(multiname,"%s%d%s",files[ifile],0,ptr+1); + *ptr = '%'; + readers[0]->open_file(multiname); + delete [] multiname; + } else readers[0]->open_file(files[ifile]); + } + while (1) { - eofflag = reader->read_time(ntimestep); + eofflag = readers[0]->read_time(ntimestep); + if (eofflag) break; + if (ntimestep > nlast) break; + if (ntimestep <= ncurrent) { + readers[0]->skip(); + continue; + } if (iskip == nskip) iskip = 0; iskip++; - if (eofflag) break; - if (ntimestep <= ncurrent) break; - if (ntimestep > nlast) break; - if (nevery && ntimestep % nevery) reader->skip(); - else if (iskip < nskip) reader->skip(); + if (nevery && ntimestep % nevery) readers[0]->skip(); + else if (iskip < nskip) readers[0]->skip(); else break; } - if (eofflag) reader->close_file(); + + if (eofflag) readers[0]->close_file(); else break; } @@ -299,10 +428,50 @@ bigint ReadDump::next(bigint ncurrent, bigint nlast, int nevery, int nskip) if (eofflag) ntimestep = -1; if (ntimestep <= ncurrent) ntimestep = -1; if (ntimestep > nlast) ntimestep = -1; - if (ntimestep < 0) reader->close_file(); } + // proc 0 broadcasts timestep and currentfile to all procs + MPI_Bcast(&ntimestep,1,MPI_LMP_BIGINT,0,world); + MPI_Bcast(¤tfile,1,MPI_INT,0,world); + + // if ntimestep < 0: + // all filereader procs close all their files and return + + if (ntimestep < 0) { + for (int i = 0; i < nreader; i++) + readers[i]->close_file(); + return ntimestep; + } + + // for multiproc mode: + // all filereader procs search for same ntimestep in currentfile + + if (multiproc && filereader) { + for (int i = 0; i < nreader; i++) { + if (me == 0 && i == 0) continue; + char *ptr = strchr(files[currentfile],'%'); + char *multiname = new char[strlen(files[currentfile]) + 16]; + *ptr = '\0'; + sprintf(multiname,"%s%d%s",files[currentfile],firstfile+i,ptr+1); + *ptr = '%'; + readers[i]->open_file(multiname); + delete [] multiname; + + bigint step; + while (1) { + eofflag = readers[i]->read_time(step); + if (eofflag) break; + if (step == ntimestep) break; + readers[i]->skip(); + } + + if (eofflag) + error->one(FLERR,"Read dump parallel files " + "do not all have same timestep"); + } + } + return ntimestep; } @@ -316,15 +485,17 @@ void ReadDump::header(int fieldinfo) int triclinic_snap; int fieldflag,xflag,yflag,zflag; - if (me == 0) - nsnapatoms = reader->read_header(box,triclinic_snap, - fieldinfo,nfield,fieldtype,fieldlabel, - scaleflag,wrapflag,fieldflag, - xflag,yflag,zflag); + if (filereader) { + for (int i = 0; i < nreader; i++) + nsnapatoms[i] = readers[i]->read_header(box,triclinic_snap,fieldinfo, + nfield,fieldtype,fieldlabel, + scaleflag,wrapflag,fieldflag, + xflag,yflag,zflag); + } - MPI_Bcast(&nsnapatoms,1,MPI_LMP_BIGINT,0,world); - MPI_Bcast(&triclinic_snap,1,MPI_INT,0,world); - MPI_Bcast(&box[0][0],9,MPI_DOUBLE,0,world); + MPI_Bcast(nsnapatoms,nreader,MPI_LMP_BIGINT,0,clustercomm); + MPI_Bcast(&triclinic_snap,1,MPI_INT,0,clustercomm); + MPI_Bcast(&box[0][0],9,MPI_DOUBLE,0,clustercomm); // local copy of snapshot box parameters // used in xfield,yfield,zfield when converting dump atom to absolute coords @@ -358,10 +529,10 @@ void ReadDump::header(int fieldinfo) if (!fieldinfo) return; - MPI_Bcast(&fieldflag,1,MPI_INT,0,world); - MPI_Bcast(&xflag,1,MPI_INT,0,world); - MPI_Bcast(&yflag,1,MPI_INT,0,world); - MPI_Bcast(&zflag,1,MPI_INT,0,world); + MPI_Bcast(&fieldflag,1,MPI_INT,0,clustercomm); + MPI_Bcast(&xflag,1,MPI_INT,0,clustercomm); + MPI_Bcast(&yflag,1,MPI_INT,0,clustercomm); + MPI_Bcast(&zflag,1,MPI_INT,0,clustercomm); // error check on current vs new box and fields // triclinic_snap < 0 means no box info in file @@ -430,7 +601,9 @@ void ReadDump::header(int fieldinfo) } } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + read and process one snapshot of atoms +------------------------------------------------------------------------- */ void ReadDump::atoms() { @@ -447,8 +620,23 @@ void ReadDump::atoms() atom->natoms = 0; } - // to match existing atoms to dump atoms: + // read all the snapshot atoms into fields + // each proc will own an arbitrary subset of atoms + + read_atoms(); + + // migrate old owned atoms to new procs based on atom IDs + // not necessary if purged all old atoms or if only 1 proc + + if (!purgeflag && nprocs > 1) migrate_old_atoms(); + + // migrate new snapshot atoms to same new procs based on atom IDs + // not necessary if purged all old atoms or if only 1 proc + + if (!purgeflag && nprocs > 1) migrate_new_atoms(); + // must build map if not a molecular system + // this will be needed to match new atoms to old atoms int mapflag = 0; if (atom->map_style == 0) { @@ -457,52 +645,14 @@ void ReadDump::atoms() atom->map_set(); } - // uflag[i] = 1 for each owned atom appearing in dump - // ucflag = similar flag for each chunk atom, used in process_atoms() + // each proc now owns both old and new info for same subset of atoms + // update each local atom with new info - int nlocal = atom->nlocal; - memory->create(uflag,nlocal,"read_dump:uflag"); - for (int i = 0; i < nlocal; i++) uflag[i] = 0; - memory->create(ucflag,CHUNK,"read_dump:ucflag"); - memory->create(ucflag_all,CHUNK,"read_dump:ucflag"); + process_atoms(); - // read, broadcast, and process atoms from snapshot in chunks + // check that atom IDs are valid - addproc = -1; - - int nchunk; - bigint nread = 0; - while (nread < nsnapatoms) { - nchunk = MIN(nsnapatoms-nread,CHUNK); - if (me == 0) reader->read_atoms(nchunk,nfield,fields); - MPI_Bcast(&fields[0][0],nchunk*nfield,MPI_DOUBLE,0,world); - process_atoms(nchunk); - nread += nchunk; - } - - // if addflag = YESADD, assign IDs to new snapshot atoms - - if (addflag == YESADD) { - bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); - if (atom->natoms < 0 || atom->natoms >= MAXBIGINT) - error->all(FLERR,"Too many total atoms"); - if (atom->tag_enable) atom->tag_extend(); - } - - // if trimflag set, delete atoms not replaced by snapshot atoms - - if (trimflag) { - delete_atoms(); - bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); - } - - // can now delete uflag arrays - - memory->destroy(uflag); - memory->destroy(ucflag); - memory->destroy(ucflag_all); + atom->tag_check(); // delete atom map if created it above // else reinitialize map for current atoms @@ -543,209 +693,152 @@ void ReadDump::atoms() domain->set_local_box(); } - // move atoms back inside simulation box and to new processors - // use remap() instead of pbc() in case atoms moved a long distance - // adjust image flags of all atoms (old and new) based on current box - // use irregular() in case atoms moved a long distance + // migrate atoms to their new owing proc, based on atom coords - double **x = atom->x; - imageint *image = atom->image; - nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) domain->remap(x[i],image[i]); - - if (triclinic) domain->x2lamda(atom->nlocal); - domain->reset_box(); - Irregular *irregular = new Irregular(lmp); - irregular->migrate_atoms(1); - delete irregular; - if (triclinic) domain->lamda2x(atom->nlocal); - - // check that atom IDs are valid - - atom->tag_check(); + migrate_atoms_by_coords(); } /* ---------------------------------------------------------------------- - process arg list for dump file fields and optional keywords + read all the snapshot atoms into fields + done in different ways for multiproc no/yes and # of procs < or >= nprocs + nnew = # of snapshot atoms this proc stores ------------------------------------------------------------------------- */ -int ReadDump::fields_and_keywords(int narg, char **arg) +void ReadDump::read_atoms() { - // per-field vectors, leave space for ID and TYPE + int count,nread,nsend,nrecv,otherproc; + bigint nsnap,ntotal,ofirst,olast,rfirst,rlast,lo,hi; + MPI_Request request; + MPI_Status status; - fieldtype = new int[narg+2]; - fieldlabel = new char*[narg+2]; + // one reader per cluster of procs + // each reading proc reads one file and splits data across cluster + // cluster can be all procs or a subset - // add id and type fields as needed - // scan ahead to see if "add yes/keep" keyword/value is used - // requires extra "type" field from from dump file + if (!multiproc || multiproc_nfile < nprocs) { + nsnap = nsnapatoms[0]; - int iarg; - for (iarg = 0; iarg < narg; iarg++) - if (strcmp(arg[iarg],"add") == 0) - if (iarg < narg-1 && (strcmp(arg[iarg+1],"yes") == 0 || - strcmp(arg[iarg+1],"keep") == 0)) break; + if (filereader) { + if (!buf) memory->create(buf,CHUNK,nfield,"read_dump:buf"); - nfield = 0; - fieldtype[nfield++] = ID; - if (iarg < narg) fieldtype[nfield++] = TYPE; + otherproc = 0; + ofirst = (bigint) otherproc * nsnap/nprocs_cluster; + olast = (bigint) (otherproc+1) * nsnap/nprocs_cluster; + if (olast-ofirst > MAXSMALLINT) + error->one(FLERR,"Read dump snapshot is too large for a proc"); + nnew = static_cast (olast - ofirst); - // parse fields + if (nnew > maxnew || maxnew == 0) { + memory->destroy(fields); + maxnew = MAX(nnew,1); // avoid NULL ptr + memory->create(fields,maxnew,nfield,"read_dump:fields"); + } - iarg = 0; - while (iarg < narg) { - int type = whichtype(arg[iarg]); - if (type < 0) break; - if (type == Q && !atom->q_flag) - error->all(FLERR,"Read dump of atom property that isn't allocated"); - fieldtype[nfield++] = type; - iarg++; - } + ntotal = 0; + while (ntotal < nsnap) { + nread = MIN(CHUNK,nsnap-ntotal); + readers[0]->read_atoms(nread,nfield,buf); + rfirst = ntotal; + rlast = ntotal + nread; - // check for no fields + nsend = 0; + while (nsend < nread) { + lo = MAX(ofirst,rfirst); + hi = MIN(olast,rlast); + if (otherproc) // send to otherproc or copy to self + MPI_Send(&buf[nsend][0],(hi-lo)*nfield,MPI_DOUBLE, + otherproc,0,clustercomm); + else + memcpy(&fields[rfirst][0],&buf[nsend][0], + (hi-lo)*nfield*sizeof(double)); + nsend += hi-lo; + if (hi == olast) { + otherproc++; + ofirst = (bigint) otherproc * nsnap/nprocs_cluster; + olast = (bigint) (otherproc+1) * nsnap/nprocs_cluster; + } + } - if (fieldtype[nfield-1] == ID || fieldtype[nfield-1] == TYPE) - error->all(FLERR,"Illegal read_dump command"); + ntotal += nread; + } - if (dimension == 2) { - for (int i = 0; i < nfield; i++) - if (fieldtype[i] == Z || fieldtype[i] == VZ || - fieldtype[i] == IZ || fieldtype[i] == FZ) - error->all(FLERR,"Illegal read_dump command"); - } + } else { + ofirst = (bigint) me_cluster * nsnap/nprocs_cluster; + olast = (bigint) (me_cluster+1) * nsnap/nprocs_cluster; + if (olast-ofirst > MAXSMALLINT) + error->one(FLERR,"Read dump snapshot is too large for a proc"); + nnew = static_cast (olast - ofirst); + if (nnew > maxnew || maxnew == 0) { + memory->destroy(fields); + maxnew = MAX(nnew,1); // avoid NULL ptr + memory->create(fields,maxnew,nfield,"read_dump:fields"); + } - for (int i = 0; i < nfield; i++) - for (int j = i+1; j < nfield; j++) - if (fieldtype[i] == fieldtype[j]) - error->all(FLERR,"Duplicate fields in read_dump command"); + nrecv = 0; + while (nrecv < nnew) { + MPI_Irecv(&fields[nrecv][0],(nnew-nrecv)*nfield,MPI_DOUBLE,0,0, + clustercomm,&request); + MPI_Wait(&request,&status); + MPI_Get_count(&status,MPI_DOUBLE,&count); + nrecv += count/nfield; + } + } - // parse optional args + // every proc is a filereader, reads one or more files + // each proc keeps all data it reads, no communication required - boxflag = 1; - replaceflag = 1; - purgeflag = 0; - trimflag = 0; - addflag = NOADD; - for (int i = 0; i < nfield; i++) fieldlabel[i] = NULL; - scaleflag = 0; - wrapflag = 1; + } else if (multiproc_nfile >= nprocs) { + bigint sum = 0; + for (int i = 0; i < nreader; i++) + sum += nsnapatoms[i]; + if (sum > MAXSMALLINT) + error->one(FLERR,"Read dump snapshot is too large for a proc"); + nnew = static_cast (sum); + if (nnew > maxnew || maxnew == 0) { + memory->destroy(fields); + maxnew = MAX(nnew,1); // avoid NULL ptr + memory->create(fields,maxnew,nfield,"read_dump:fields"); + } - while (iarg < narg) { - if (strcmp(arg[iarg],"box") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) boxflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) boxflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"replace") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) replaceflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) replaceflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"purge") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) purgeflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) purgeflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"trim") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) trimflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) trimflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"add") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) addflag = YESADD; - else if (strcmp(arg[iarg+1],"no") == 0) addflag = NOADD; - else if (strcmp(arg[iarg+1],"keep") == 0) addflag = KEEPADD; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"label") == 0) { - if (iarg+3 > narg) error->all(FLERR,"Illegal read_dump command"); - int type = whichtype(arg[iarg+1]); - int i; - for (i = 0; i < nfield; i++) - if (type == fieldtype[i]) break; - if (i == nfield) error->all(FLERR,"Illegal read_dump command"); - int n = strlen(arg[iarg+2]) + 1; - fieldlabel[i] = new char[n]; - strcpy(fieldlabel[i],arg[iarg+2]); - iarg += 3; - } else if (strcmp(arg[iarg],"scaled") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) scaleflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) scaleflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"wrapped") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) wrapflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) wrapflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"format") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - delete [] readerstyle; - int n = strlen(arg[iarg+1]) + 1; - readerstyle = new char[n]; - strcpy(readerstyle,arg[iarg+1]); - iarg += 2; - break; - } else error->all(FLERR,"Illegal read_dump command"); - } - - if (purgeflag && (replaceflag || trimflag)) - error->all(FLERR,"If read_dump purges it cannot replace or trim"); - if (addflag == KEEPADD && atom->tag_enable == 0) - error->all(FLERR,"Read_dump cannot use 'add keep' without atom IDs"); - - return narg-iarg; + nnew = 0; + for (int i = 0; i < nreader; i++) { + nsnap = nsnapatoms[i]; + ntotal = 0; + while (ntotal < nsnap) { + nread = MIN(CHUNK,nsnap-ntotal); + readers[i]->read_atoms(nread,nfield,&fields[nnew+ntotal]); + ntotal += nread; + } + nnew += nsnap; + } + } } /* ---------------------------------------------------------------------- - check if str is a field argument - if yes, return index of which - if not, return -1 -------------------------------------------------------------------------- */ - -int ReadDump::whichtype(char *str) -{ - int type = -1; - if (strcmp(str,"id") == 0) type = ID; - else if (strcmp(str,"type") == 0) type = TYPE; - else if (strcmp(str,"x") == 0) type = X; - else if (strcmp(str,"y") == 0) type = Y; - else if (strcmp(str,"z") == 0) type = Z; - else if (strcmp(str,"vx") == 0) type = VX; - else if (strcmp(str,"vy") == 0) type = VY; - else if (strcmp(str,"vz") == 0) type = VZ; - else if (strcmp(str,"q") == 0) type = Q; - else if (strcmp(str,"ix") == 0) type = IX; - else if (strcmp(str,"iy") == 0) type = IY; - else if (strcmp(str,"iz") == 0) type = IZ; - else if (strcmp(str,"fx") == 0) type = FX; - else if (strcmp(str,"fy") == 0) type = FY; - else if (strcmp(str,"fz") == 0) type = FZ; - return type; -} - -/* ---------------------------------------------------------------------- - process each of N atoms in chunk read from dump file + update info for each old atom I own based on snapshot info if in replace mode and atom ID matches current atom, overwrite atom info with fields from dump file - if in add mode and atom ID does not match any current atom, - create new atom with dump file field values, - and assign to a proc in round-robin manner - use round-robin method, b/c atom coords may not be inside simulation box + if in add mode and atom ID does not match any old atom, + create new atom with dump file field values ------------------------------------------------------------------------- */ -void ReadDump::process_atoms(int n) +void ReadDump::process_atoms() { int i,m,ifield,itype; int xbox,ybox,zbox; tagint mtag; + int *updateflag,*newflag; + + // updateflag[i] = flag for old atoms, 1 if updated, else 0 + // newflag[i] = flag for new atoms, 0 if used to update old atom, else 1 + + int nlocal = atom->nlocal; + memory->create(updateflag,nlocal,"read_dump:updateflag"); + for (int i = 0; i < nlocal; i++) updateflag[i] = 0; + memory->create(newflag,nnew,"read_dump:newflag"); + for (int i = 0; i < nnew; i++) newflag[i] = 1; + + // loop over new atoms double **x = atom->x; double **v = atom->v; @@ -753,11 +846,9 @@ void ReadDump::process_atoms(int n) double **f = atom->f; tagint *tag = atom->tag; imageint *image = atom->image; - int nlocal = atom->nlocal; tagint map_tag_max = atom->map_tag_max; - for (i = 0; i < n; i++) { - ucflag[i] = 0; + for (i = 0; i < nnew; i++) { // check if new atom matches one I own // setting m = -1 forces new atom not to match @@ -769,8 +860,8 @@ void ReadDump::process_atoms(int n) else m = -1; if (m < 0 || m >= nlocal) continue; - ucflag[i] = 1; - uflag[m] = 1; + updateflag[m] = 1; + newflag[i] = 0; if (replaceflag) { nreplace++; @@ -838,12 +929,39 @@ void ReadDump::process_atoms(int n) } } - // create any atoms in chunk that no processor owned - // add atoms in round-robin sequence on processors - // cannot do it geometrically b/c dump coords may not be in simulation box - // check that dump file snapshot has atom type field + // if trimflag set, delete atoms not updated by snapshot atoms - if (addflag == NOADD) return; + if (trimflag) { + AtomVec *avec = atom->avec; + + int i = 0; + while (i < nlocal) { + if (!updateflag[i]) { + avec->copy(nlocal-1,i,1); + updateflag[i] = updateflag[nlocal-1]; + nlocal--; + ntrim++; + } else i++; + } + + atom->nlocal = nlocal; + bigint nblocal = atom->nlocal; + MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); + } + + // done if cannot add new atoms + + if (addflag == NOADD) { + memory->destroy(updateflag); + memory->destroy(newflag); + return; + } + + // ---------------------------------------------------- + // create new atoms for dump file atoms with ID that matches no old atom + // ---------------------------------------------------- + + // first check that dump file snapshot has atom type field int tflag = 0; for (ifield = 0; ifield < nfield; ifield++) @@ -851,19 +969,11 @@ void ReadDump::process_atoms(int n) if (!tflag) error->all(FLERR,"Cannot add atoms if dump file does not store atom type"); - MPI_Allreduce(ucflag,ucflag_all,n,MPI_INT,MPI_SUM,world); - int nlocal_previous = atom->nlocal; double one[3]; - for (i = 0; i < n; i++) { - if (ucflag_all[i]) continue; - - // each processor adds every Pth atom - - addproc++; - if (addproc == nprocs) addproc = 0; - if (addproc != me) continue; + for (i = 0; i < nnew; i++) { + if (!newflag[i]) continue; // create type and coord fields from dump file // coord = 0.0 unless corresponding dump file field was specified @@ -932,7 +1042,7 @@ void ReadDump::process_atoms(int n) break; } - // replace image flag in case changed by ix,iy,iz fields + // reset image flag in case changed by ix,iy,iz fields image[m] = ((imageint) (xbox + IMGMAX) & IMGMASK) | (((imageint) (ybox + IMGMAX) & IMGMASK) << IMGBITS) | @@ -940,31 +1050,283 @@ void ReadDump::process_atoms(int n) } } + // if addflag = YESADD + // assign consistent IDs to new snapshot atoms across all procs + + if (addflag == YESADD) { + bigint nblocal = atom->nlocal; + MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); + if (atom->natoms < 0 || atom->natoms >= MAXBIGINT) + error->all(FLERR,"Too many total atoms"); + if (atom->tag_enable) atom->tag_extend(); + } + // init per-atom fix/compute/variable values for created atoms atom->data_fix_compute_variable(nlocal_previous,atom->nlocal); + + // free allocated vectors + + memory->destroy(updateflag); + memory->destroy(newflag); + } /* ---------------------------------------------------------------------- - delete atoms not flagged as replaced by dump atoms + migrate old atoms to new procs based on atom IDs + use migrate_atoms() with explicit processor assignments ------------------------------------------------------------------------- */ -void ReadDump::delete_atoms() +void ReadDump::migrate_old_atoms() { - AtomVec *avec = atom->avec; + tagint *tag = atom->tag; int nlocal = atom->nlocal; - int i = 0; - while (i < nlocal) { - if (uflag[i] == 0) { - avec->copy(nlocal-1,i,1); - uflag[i] = uflag[nlocal-1]; - nlocal--; - ntrim++; - } else i++; + int *procassign; + memory->create(procassign,nlocal,"read_dump:procassign"); + for (int i = 0; i < nlocal; i++) + procassign[i] = tag[i] % nprocs; + + Irregular *irregular = new Irregular(lmp); + irregular->migrate_atoms(1,1,procassign); + delete irregular; + + memory->destroy(procassign); +} + +/* ---------------------------------------------------------------------- + migrate new atoms to same new procs based on atom IDs +------------------------------------------------------------------------- */ + +void ReadDump::migrate_new_atoms() +{ + tagint mtag; + int *procassign; + double **newfields; + + memory->create(procassign,nnew,"read_dump:procassign"); + for (int i = 0; i < nnew; i++) { + mtag = static_cast (fields[i][0]); + procassign[i] = mtag % nprocs; } - atom->nlocal = nlocal; + Irregular *irregular = new Irregular(lmp); + int nrecv = irregular->create_data(nnew,procassign,1); + int newmaxnew = MAX(nrecv,maxnew); + newmaxnew = MAX(newmaxnew,1); // avoid NULL ptr + memory->create(newfields,newmaxnew,nfield,"read_dump:newfields"); + irregular->exchange_data((char *) &fields[0][0],nfield*sizeof(double), + (char *) &newfields[0][0]); + irregular->destroy_data(); + delete irregular; + + memory->destroy(fields); + memory->destroy(procassign); + + // point fields at newfields + + fields = newfields; + maxnew = newmaxnew; + nnew = nrecv; +} + +/* ---------------------------------------------------------------------- + migrate final atoms to new procs based on atom coords + use migrate_atoms() with implicit processor assignments based on atom coords + move atoms back inside simulation box and to new processors + use remap() instead of pbc() in case atoms moved a long distance + adjust image flags of all atoms (old and new) based on current box +------------------------------------------------------------------------- */ + +void ReadDump::migrate_atoms_by_coords() +{ + double **x = atom->x; + imageint *image = atom->image; + int nlocal = atom->nlocal; + for (int i = 0; i < nlocal; i++) domain->remap(x[i],image[i]); + + if (triclinic) domain->x2lamda(atom->nlocal); + domain->reset_box(); + Irregular *irregular = new Irregular(lmp); + irregular->migrate_atoms(1); + delete irregular; + if (triclinic) domain->lamda2x(atom->nlocal); +} + +/* ---------------------------------------------------------------------- + process arg list for dump file fields and optional keywords +------------------------------------------------------------------------- */ + +int ReadDump::fields_and_keywords(int narg, char **arg) +{ + // per-field vectors, leave space for ID and TYPE + + fieldtype = new int[narg+2]; + fieldlabel = new char*[narg+2]; + + // add id and type fields as needed + // scan ahead to see if "add yes/keep" keyword/value is used + // requires extra "type" field from from dump file + + int iarg; + for (iarg = 0; iarg < narg; iarg++) + if (strcmp(arg[iarg],"add") == 0) + if (iarg < narg-1 && (strcmp(arg[iarg+1],"yes") == 0 || + strcmp(arg[iarg+1],"keep") == 0)) break; + + nfield = 0; + fieldtype[nfield++] = ID; + if (iarg < narg) fieldtype[nfield++] = TYPE; + + // parse fields + + iarg = 0; + while (iarg < narg) { + int type = whichtype(arg[iarg]); + if (type < 0) break; + if (type == Q && !atom->q_flag) + error->all(FLERR,"Read dump of atom property that isn't allocated"); + fieldtype[nfield++] = type; + iarg++; + } + + // check for no fields + + if (fieldtype[nfield-1] == ID || fieldtype[nfield-1] == TYPE) + error->all(FLERR,"Illegal read_dump command"); + + if (dimension == 2) { + for (int i = 0; i < nfield; i++) + if (fieldtype[i] == Z || fieldtype[i] == VZ || + fieldtype[i] == IZ || fieldtype[i] == FZ) + error->all(FLERR,"Illegal read_dump command"); + } + + for (int i = 0; i < nfield; i++) + for (int j = i+1; j < nfield; j++) + if (fieldtype[i] == fieldtype[j]) + error->all(FLERR,"Duplicate fields in read_dump command"); + + // parse optional args + + multiproc_nfile = 0; + boxflag = 1; + replaceflag = 1; + purgeflag = 0; + trimflag = 0; + addflag = NOADD; + for (int i = 0; i < nfield; i++) fieldlabel[i] = NULL; + scaleflag = 0; + wrapflag = 1; + + while (iarg < narg) { + if (strcmp(arg[iarg],"nfile") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + multiproc_nfile = force->inumeric(FLERR,arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"box") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) boxflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) boxflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"replace") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) replaceflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) replaceflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"purge") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) purgeflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) purgeflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"trim") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) trimflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) trimflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"add") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) addflag = YESADD; + else if (strcmp(arg[iarg+1],"no") == 0) addflag = NOADD; + else if (strcmp(arg[iarg+1],"keep") == 0) addflag = KEEPADD; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"label") == 0) { + if (iarg+3 > narg) error->all(FLERR,"Illegal read_dump command"); + int type = whichtype(arg[iarg+1]); + int i; + for (i = 0; i < nfield; i++) + if (type == fieldtype[i]) break; + if (i == nfield) error->all(FLERR,"Illegal read_dump command"); + int n = strlen(arg[iarg+2]) + 1; + fieldlabel[i] = new char[n]; + strcpy(fieldlabel[i],arg[iarg+2]); + iarg += 3; + } else if (strcmp(arg[iarg],"scaled") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) scaleflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) scaleflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"wrapped") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + if (strcmp(arg[iarg+1],"yes") == 0) wrapflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) wrapflag = 0; + else error->all(FLERR,"Illegal read_dump command"); + iarg += 2; + } else if (strcmp(arg[iarg],"format") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); + delete [] readerstyle; + int n = strlen(arg[iarg+1]) + 1; + readerstyle = new char[n]; + strcpy(readerstyle,arg[iarg+1]); + iarg += 2; + break; + } else error->all(FLERR,"Illegal read_dump command"); + } + + if (multiproc == 0 && multiproc_nfile) + error->all(FLERR,"Dump file is not a multi-proc file"); + if (multiproc && multiproc_nfile == 0) + error->all(FLERR,"Dump file is a multi-proc file"); + + if (purgeflag && (replaceflag || trimflag)) + error->all(FLERR,"If read_dump purges it cannot replace or trim"); + if (addflag == KEEPADD && atom->tag_enable == 0) + error->all(FLERR,"Read_dump cannot use 'add keep' without atom IDs"); + + return narg-iarg; +} + +/* ---------------------------------------------------------------------- + check if str is a field argument + if yes, return index of which + if not, return -1 +------------------------------------------------------------------------- */ + +int ReadDump::whichtype(char *str) +{ + int type = -1; + if (strcmp(str,"id") == 0) type = ID; + else if (strcmp(str,"type") == 0) type = TYPE; + else if (strcmp(str,"x") == 0) type = X; + else if (strcmp(str,"y") == 0) type = Y; + else if (strcmp(str,"z") == 0) type = Z; + else if (strcmp(str,"vx") == 0) type = VX; + else if (strcmp(str,"vy") == 0) type = VY; + else if (strcmp(str,"vz") == 0) type = VZ; + else if (strcmp(str,"q") == 0) type = Q; + else if (strcmp(str,"ix") == 0) type = IX; + else if (strcmp(str,"iy") == 0) type = IY; + else if (strcmp(str,"iz") == 0) type = IZ; + else if (strcmp(str,"fx") == 0) type = FX; + else if (strcmp(str,"fy") == 0) type = FY; + else if (strcmp(str,"fz") == 0) type = FZ; + return type; } /* ---------------------------------------------------------------------- diff --git a/src/read_dump.h b/src/read_dump.h index eb70b99808..73cb0a8995 100644 --- a/src/read_dump.h +++ b/src/read_dump.h @@ -22,6 +22,7 @@ CommandStyle(read_dump,ReadDump) #ifndef LMP_READ_DUMP_H #define LMP_READ_DUMP_H +#include #include #include "pointers.h" @@ -43,15 +44,26 @@ class ReadDump : protected Pointers { private: int me,nprocs; - FILE *fp; - int dimension; + char **files; // list of input dump files to process + int nfile; // # of dump files to process (each may be parallel) + int currentfile; // current open file (0 to nfile-1) + + MPI_Comm clustercomm; // comm for proc cluster that reads/shares a file + int me_cluster,nprocs_cluster; // proc ID and count for my read cluster + + int multiproc; // 0 = each dump file is a single file + // 1 = each dump file is parallel (multiple files) + int multiproc_nfile; // number of parallel files in one dump file + + int nreader; // # of parallel dump files read by my cluster + int firstfile; // index of 1st dump file my cluster reads + // (0 to multiproc_nfile-1) + int filereader; // 1 if this proc reads from a dump file(s) + + int dimension; // same as in Domain int triclinic; - int nfile; // # of dump files to process - char **files; // list of file names - int currentfile; // currently open file - int boxflag; // overwrite simulation with dump file box params int replaceflag,addflag; // flags for processing dump snapshot atoms int trimflag,purgeflag; @@ -59,10 +71,13 @@ private: int wrapflag; // user 0/1 if dump file coords are unwrapped/wrapped char *readerstyle; // style of dump files to read + int nnew; // # of dump file atoms this proc owns int nfield; // # of fields to extract from dump file int *fieldtype; // type of each field = X,VY,IZ,etc char **fieldlabel; // user specified label for field double **fields; // per-atom field values + int maxnew; // allocation size of fields array + double **buf; // read buffer int scaled; // 0/1 if dump file coords are unscaled/scaled int wrapped; // 0/1 if dump file coords are unwrapped/wrapped @@ -71,20 +86,26 @@ private: double xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz; // dump snapshot box params double xprd,yprd,zprd; - bigint nsnapatoms; // # of atoms in dump file shapshot + bigint *nsnapatoms; // # of atoms in one snapshot from + // one (parallel) dump file + // nreader-length vector b/c a reader proc + // may read from multiple parallel dump files int npurge,nreplace,ntrim,nadd; // stats on processed atoms - int addproc; // proc that should add next atom int yindex,zindex; // field index for Y,Z coords - int *uflag; // set to 1 if snapshot atom matches owned atom - int *ucflag,*ucflag_all; // set to 1 if snapshot chunk atom was processed + class Reader **readers; // class that reads a dump file + // nreader-length list of readers if proc reads + // from multiple parallel dump files - class Reader *reader; // class that reads dump file + void read_atoms(); + void process_atoms(); + void migrate_old_atoms(); + void migrate_new_atoms(); + void migrate_atoms_by_coords(); + void setup_multiproc(); int whichtype(char *); - void process_atoms(int); - void delete_atoms(); double xfield(int, int); double yfield(int, int); diff --git a/src/rerun.cpp b/src/rerun.cpp index f8a37b5946..063ea882c2 100644 --- a/src/rerun.cpp +++ b/src/rerun.cpp @@ -57,7 +57,7 @@ void Rerun::command(int narg, char **arg) if (nfile == 0 || nfile == narg) error->all(FLERR,"Illegal rerun command"); // parse optional args up until "dump" - // user MAXBIGINT -1 so Output can add 1 to it and still be a big int + // use MAXBIGINT -1 so Output can add 1 to it and still be a big int bigint first = 0; bigint last = MAXBIGINT - 1; From a2671f8943cf15f96555cf4e840ef45f5a5f5d37 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 26 Oct 2018 18:06:34 -0600 Subject: [PATCH 03/94] doc files for new parallel dump file read capability --- doc/src/read_dump.txt | 18 ++++++++++++++---- doc/src/rerun.txt | 25 ++++++++++++++++++------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/doc/src/read_dump.txt b/doc/src/read_dump.txt index db9cfca825..9d2f0a39dc 100644 --- a/doc/src/read_dump.txt +++ b/doc/src/read_dump.txt @@ -22,7 +22,8 @@ field = {x} or {y} or {z} or {vx} or {vy} or {vz} or {q} or {ix} or {iy} or {iz} {ix},{iy},{iz} = image flags in each dimension {fx},{fy},{fz} = force components :pre zero or more keyword/value pairs may be appended :l -keyword = {box} or {replace} or {purge} or {trim} or {add} or {label} or {scaled} or {wrapped} or {format} :l +keyword = {nfile} or {box} or {replace} or {purge} or {trim} or {add} or {label} or {scaled} or {wrapped} or {format} :l + {nfile} value = Nfiles = how many parallel dump files exist {box} value = {yes} or {no} = replace simulation box with dump box {replace} value = {yes} or {no} = overwrite atoms with dump atoms {purge} value = {yes} or {no} = delete all atoms before adding dump atoms @@ -85,9 +86,18 @@ command, after the dump snapshot is read. If the dump filename specified as {file} ends with ".gz", the dump file is read in gzipped format. You cannot (yet) read a dump file -that was written in binary format with a ".bin" suffix, or to multiple -files via the "%" option in the dump file name. See the -"dump"_dump.html command for details. +that was written in binary format with a ".bin" suffix. + +You can read dump files that were written (in parallel) to multiple +files via the "%" wild-card character in the dump file name. If any +specified dump file name contains a "%", they must all contain it. +See the "dump"_dump.html command for details. +The "%" wild-card character is only supported by the {native} format +for dump files, described next. + +If reading parallel dump files, you must also use the {nfile} keyword +to tell LAMMPS how many parallel files exist, via its specified +{Nfiles} value. The format of the dump file is selected through the {format} keyword. If specified, it must be the last keyword used, since all remaining diff --git a/doc/src/rerun.txt b/doc/src/rerun.txt index 71ad464bb0..fa9626dbb2 100644 --- a/doc/src/rerun.txt +++ b/doc/src/rerun.txt @@ -89,12 +89,23 @@ this auxiliary information should be defined in the usual way, e.g. in a data file read in by a "read_data"_read_data.html command, before using the rerun command. +Also note that the frequency of thermodynamic or dump output from the +rerun simulation will depend on settings made in the rerun script, the +same as for output from any LAMMPS simulation. See further info below +as to what that means if the timesteps for snapshots read from dump +files do not match the specified output frequency. + :line If more than one dump file is specified, the dump files are read one after the other. It is assumed that snapshot timesteps will be in ascending order. If a snapshot is encountered that is not in -ascending order, it will cause the rerun command to complete. +ascending order, it will skip the snapshot until it reads one that is. +This allows skipping of a duplicate snapshot (same timestep), +e.g. that appeared at the end of one file and beginning of the next. +However if you specify a series of dump files in an incorrect order +(with respect to the timesteps they contain), you may skip large +numbers of snapshots The {first}, {last}, {every}, {skip} keywords determine which snapshots are read from the dump file(s). Snapshots are skipped until @@ -177,12 +188,12 @@ a timestep it expects to be, LAMMPS will flag an error. The various forms of LAMMPS output, as defined by the "thermo_style"_thermo_style.html, "thermo"_thermo.html, -"dump"_dump.html, and "restart"_restart.html commands occur on -specific timesteps. If successive dump snapshots skip those -timesteps, then no output will be produced. E.g. if you request -thermodynamic output every 100 steps, but the dump file snapshots are -every 1000 steps, then you will only see thermodynamic output every -1000 steps. +"dump"_dump.html, and "restart"_restart.html commands occur with +specified frequency, e.g. every N steps. If the timestep for a dump +snapshot is not a multiple of N, then it will be read and processed, +but no output will be produced. If you want output for every dump +snapshot, you can simply use N=1 for an output frequency, e.g. for +thermodyanmic output or new dump file output. :line From 2d0d08093b94da4dbc43c33243bd30871c6d6694 Mon Sep 17 00:00:00 2001 From: Zbigniew Koziol Date: Wed, 28 Nov 2018 09:33:44 +0100 Subject: [PATCH 04/94] Another attempt to add Lebedeva potential --- doc/src/Eqs/pair_lebedeva.png | Bin 0 -> 31049 bytes doc/src/pair_lebedeva.txt | 63 +++ examples/USER/misc/lebedeva/2particles.dat | 14 + examples/USER/misc/lebedeva/2particles.in | 63 +++ examples/USER/misc/lebedeva/CC.Lebedeva | 14 + examples/USER/misc/lebedeva/LammpsResult.dat | 400 +++++++++++++++++ examples/USER/misc/lebedeva/LebDer.pl | 90 ++++ examples/USER/misc/lebedeva/lebedeva00.plot | 34 ++ potentials/CC.Lebedeva | 14 + src/USER-MISC/pair_lebedeva.cpp | 436 +++++++++++++++++++ src/USER-MISC/pair_lebedeva.h | 83 ++++ 11 files changed, 1211 insertions(+) create mode 100644 doc/src/Eqs/pair_lebedeva.png create mode 100644 doc/src/pair_lebedeva.txt create mode 100644 examples/USER/misc/lebedeva/2particles.dat create mode 100644 examples/USER/misc/lebedeva/2particles.in create mode 100644 examples/USER/misc/lebedeva/CC.Lebedeva create mode 100644 examples/USER/misc/lebedeva/LammpsResult.dat create mode 100755 examples/USER/misc/lebedeva/LebDer.pl create mode 100644 examples/USER/misc/lebedeva/lebedeva00.plot create mode 100644 potentials/CC.Lebedeva create mode 100644 src/USER-MISC/pair_lebedeva.cpp create mode 100644 src/USER-MISC/pair_lebedeva.h diff --git a/doc/src/Eqs/pair_lebedeva.png b/doc/src/Eqs/pair_lebedeva.png new file mode 100644 index 0000000000000000000000000000000000000000..af2ac876538ddca8a27b6dc0bf2944adf208b0b5 GIT binary patch literal 31049 zcmb5W1zeTe*DksMkxuCrk?t-*X#wf(ZX~2Tq)U|UkZ$R2P(VPsQ%brU?p*HuKi|FQ z-0z-y_Wo_RzZce8^PTUQV?5(|p0UCd2-;gIF(n8Db{qnMp+bBLuIxv& zqJjTCHIk7OgFHh2&1x<90+BzS5BgcoWgk+vC0TV{7eD_P@ZViPgdc~#{qv8s$nT;GOdhnF zP}NCD25cUQ>uvhB*^KFBh5p_kZBn_I$Jrk`+^^A@yfEIk=U+UvMY1t>EO(@2TM3& zxU@xYalFOC*Q%?-i3ydVOaYA9*;(Xygph9k?Cj^%?~)@CV#tk`JK!Y z?l>3f>hAi_9!Q7(X>#73Qe?x4QK0SFn$fsB9U;BCzIh`q4*$yYJRms#>BQt@M9n*I zIJk*YO_WPr-QGbx56|4PB08T{N15NeoSdAa6~4Z1p6)OB`HAp!o7Iy3Sywgk--!*=47~IHr)BKsjwd%OVZ8cS@Y1EHHN*ZM-8r*fhDw=#!HgsJh zY!&jV*(F;#o?by+JtUOP#QPpOTOm}}^RnZcoqmz?a5`V$J7R7TW#wmo{`~nqFc1(N z{FF@4N9U^t6*OAl$Hf!U)1xNhaArupbvk%@78VzE?fg-lDACs!dCi7z+!FmAuS~G5jo6ZNz9~1bTXU_ovAqdWwsS#WS2K`S=I}Z!unriG6fS7N0KX zbvY5sxK+Vnk!LxIbSqRXQEMDA_s}A8IhgTRrjdh%M5hb-qmv4Vh>E^gWg@oY+R~y&oftJ3ukL<%Wn*gYB71sDh^zY8s=cSHh{;Z^nX$zdL9+c|^P&%M}#;6BlXg@p$S zBL7U4&^-9MxrzB(R##V7*$(3E%{AkDa9Jt9L7#)v?9=hiH*cgutgLq-4goK1^jURv1hbt*|MlUvJS5&ZI;XJfD z;!3;Ccm{nh&_jE5+#R?I|73jC(6GV&K`?hYyy zrQ$TE>V1V}lQ_eywh)Bx&z`yLC8TxFZuFrQO?xN{br>cj$X_jNDOvX4M;;e?EZl$bbTe`bYIiz2Cno>~4naxu1=zY!S!pk;mX$1uv;9RHnxrCi46v(y zY{6ik#3UqMCo%PO)5It~ChCXR+-o!QI9!j3hl+^{M@~^wYqU7MZ7ixOEoF=(;YNjd zfLSwrm%{14URwe`tfV-5+URiak;dv7S@|ty>u!QLna_$wO9JH zGmwB)>Y5y)-ER3pNm+SAtAGl&--2kL~Tkb?=v{Pld=DmO`qlpJ}j>y|$Sx#(hZR6D@bX@@i93$x5ihyC4?~T@FDN zcX8qFizJPB6Ntc|E2UjtmVeF!960cpH3$1z)|YyzKC4ycjQbE)hKRP{;F!fzjZ#6C&ca z`UuAzl2x29ea-kgLfPOoMCWj^yQ0-IHzv=tZQr%`q`lI3n)&LgrRN^?wV2TAd*aLPD?|( zOd8bB7dI&E#yckj?P_vdB4Hf}gR+vR=_3F!uJmc^?<1C9c;xPAu3RloTX zS`m9remtX=8j9;65LHu45F-MmO*T!;_3Za`7rXZW4%N$-t9N-3(gHQFXHSv^a{Jd_ z%Aj~r#0{=@dGx#V^!2TQ6S{3Xi*R#ugKc@Sw@mZU-keIzOM?EB?cG0sC^D+3X!Tch zL3}wTp|RWP4VRaCT{gO}O9*-$L1Yq`#M@!+H5@!6u6nCrPbit0w}zejDThxeaFDAkIz^s5ePS@3@#>`z^>p_l zX|?&Vh!QBv4;P+6g9Vf-6?&v0F=U-giKz{ndy%BguDKr)hc{ewc%fSZilp?`a0Wbt z(`EuuEmsoXl6bzXesyWFIjP=2DEN-Mrsw45;og&E&KEM>_U_i~S8a)o>-eCI5N@7p zrqK3c0S1>NG*m$Mfqm!Y?Qrw^?e?EPMu-0Q*z2~Y&Z~FsB-Pd3S)GAwt`A;88%zQM z#K#T}Zud7_uyC-e9*4}ZcW_i=sN{S(T^nDZ_xhE}ekNvI;giwZXI~9R{T{CFt~rL& z1k}IQKfLn1!BM7p7py@0(f#&9$!_5bt}&{mrKOadoP@MA^5-vKVlxudR`|g`_NOOt zmYEwbGoe}M`OBaKS%yziR9%1K8Dit&B0083azV4>X!imn@DFCg0SdHFAZ{LRaevrQ ziP**RA+;^P|1RcZz>cHQ*2TWt&VJNjw0gLpuC|7TTWr4uLzh%ZEH3@OZyy%yPW%1G zI*mQJ-84Q|JYnxteIm%(`nto!6rOLH&f6d{Xdo(ej;33}H-N+#jgHRiyF-bJib^Hq zxwFrdVfRnV4VvAy^@Gje{i&&$Hfx%-ww|!%@b3ho5@t`!^_zpuex@kCfuhBaDz7<* zatW4N+yfQ6B`LVLYCD{`C2fB7k9|gt{JV<*irJL3P3P8AI7Cu#kaj~+dPeB$J|Tx5 z$f_%33j0c^n3%+FHZr4xg@qOBweqW|surF6UFG}H^c`d?fNGNX-I2v86^ou8`Lwk; zRwQC(`YpZkTw8v;*S47Z{oBON-9rif8F*VUx>2}L+=)`Y4+aJX5Zw5&+cr*z1>T-M zpWrPSyT*%V*AcQBt4ShoC>c5T@Ay6(uU&t*y1IR%t({8$PxBBS?2Z}a(C7dMpd}O{ z4ehpg-lB^lpmjxQ^OzE8KY%>rb$=62w*7CHCU!hFK7KqlPy92r{x#Y?k#xFx9|5&| z62zxF_{wu%t5^_vzi|SbW=*h2pw*r{!m@90BJ}pz51L6zQbJkDeB~Yf@#;zAl&9Mx z3C*=w__3>yJfs~x%>OuOGG5};SaAs--)(6l`T11Uh8+Qv!7_xViC0GK9qK z28Bkar&-1!54TxYp2x?>+mmGi(R1^iIo8v#m!J=)p0Ztlpoau@_`Qa_ZoP3*|N9tm zWWQjq{N6?cHy*2|2Eg_|{dKSs{E?^Yez0b?O#z__~aY_TcbFG&IHS3v2{CEK8;q7_Z7gwYVC6O90*-m4G9hN6? zS?;|Q0b^Ed0ew~=MbOJbe20e7)k(@bHl~;WKQU12ZCHo7nV-KxNZ5H?%z^tix5qt2 zJEiD-l;~T9HtW|uWT1(HyS-RnF(gigvz)gxE;b)Zfv4$b09Ze#G4C%G*2!7qb#X9< zc6zZ1u*Y-d8_+cFEwsVqo0(b67IV2AE(9qWOXNQK!KfrbQ>!99=TKlAEnxoMuG1KF z=f7JaJT}og1oZ=&<^aJ$Am~KP@4ADE9wG`a4NWiqAr*@d|IY}=zkv#BIVbeNLSgiO zcj5n&7yK$FF5da$SL})0iSuQq@6p9i?Vvnp(+pmP8<3evP8~^#!ok5YAn-%|7M--x zqSFf+CC_)j(m#FcF^sGVzy`!-H(=Bh096Ulh-eSNw>F<3K$?}edK%2uS4{A44X1VH zqY-Bp6(Ko0Ly68eqM~pZWWvE9Sc2#~Kyv3bv%|Pk2nS@*iajp`5-art&}v6+f~aKd zPr4hwt<g&~|_(4R7Sq54{3biXTt{zuc zvEcK64iER$F=dYE_Q4$z|k<|a=dM`uUip3>vvgZAg^439oN zFU-~tJdrcW&(8Ko`a-=n>K_Q81+&ZFcP|RuxjEmBcqGRn(=(VecDb-v?0aIiPv76I zs&UYHoj{ZApB7Nc1rB)8oN7?{M*0v(?9fh8|UL=y#_ojENu_~`zP zD9k*x{Bx`AFmf_f7K$Wv43zGm)2%9}>l10^(2N5z2m}rej&tSo^xfsvuNPmxetiwd z*uY@aBFz2+r(P_;>SVb`;KjL8)~9e;=e!AgYVX*P^T`Rsgp}nMcWES$p23pW_fzYy zmy*pQR}WQ7s!V2;06tSo5pjCt?&)q3^$e>TTaExAINX#^pH;0~FAC6pCyPr3+wyKV zXGpMjcd@at{^g6!h8-RLO7p`516?48x-~TB>fPTE2$~>*uzCSVPMR2UNec^FfMAbq zD-E$R1eO||i7yY9#05TlK)t``0eil-9um{wwkjyp?-Oh(z@ecT6;PaF<=@YQgS-kb zPhEcgHJR(%h?tm=!E<6juRtJ4HMW6RFC;}k)A8KBebWmUgIv(>Z7Mft%LFGTCNNjX zA?7raR6R6VF?la<(6;pr=Py7b=djZy4#mWypE{vQ>|tp2#MG&((l0yPu>I3ai0NhqP*F<9gmH(OPVBGEzT- z`sngE79dhM?EOZPO=0I7**7sa?>_jhh)T$d34$Pr%@YrgNi!goN5|e^StzV#XJ<#F z#sG%ESfh5+?oQ{@9F>$45pYLW#(z{eE$47@C1U!}cWpJQt!mv~vB=9Wv^k@oBr^7G zzDuoiyw-2{aLb**q8qN)e$h9!G3c;9$0eJ=izSj>*|Cm}j4WbhMGtru)jy`g1l?il z{lBWMdBnuT4DNcuG#X6U^gP^+kNo^Yug~66mL(PxEV%muz8ZjoXmJ@lf^ngapc)@kOSE)@1B(EH{(UCmm3W9ylvQ7gN3*q-|?06 z^X1B=^Y<>rgoPoAQDW&`U(r(iXB+n#mg++=Pn$T>lafLg1zgtlf==^15>FBa-|4hD zVNqf+oN$AbVsJe6Qe5lu_IL~^GAkY? z+Tb_~vp@86W8gNnJERIwITJ<72q{DM$xFVt?ipRUhlQ^IlDeJ7ZaDrsSSJEHZLzH*Ei2&M-`CK1?}n5`Ca`( z!@_kCd))~?PSFn&Zm@7@bvJ=+Vr=oco2J&`j%plS>Cnwh^V7wt6QVa|hs*_#6 zEtPv=JckP80Uz}J`}d9l`OK`cvZ%88(w6~u3l7VGm%<~E?eF!5@l$&IvH0T`7Bv1E zke+=F)_^hw=>o3)gHgnYNJuc5BO$qga31Fms^u+`5)vY`I9;Qon1 z{~Q0$$0vX-1B5iYR*ek|=oQ%aCFSMS^I2Yg%m25UCM5lOK?xfb83hCRZ+Kn>#UGwd zKmMza`60+s3nUr>9&YAp*dbDu#WwF-!DXxO9BYPsL&-qH=wK5N7`plJl$noLDpJyC zXCEz*mZPLiHnkKC)lwTJ zdg8i9cc&nm&(!#c%B7|V(jB_o46;D{vRn@p>fh_Sxw{*k&v7|!yrN^n0&*oBA@>304nzNf|?P~s5C zJG6I!_*U7%W4%NII*pO*Z&$W;3FN+Pv{G+tUBwgf1febYOB6h# z+w$}^#~=JTA*eDexdqVEwNi z^@V&Bt{7P<6iEE;`94U*o~&JTG0~8d3Ve@ST4bW}*28%Bz`{x+9P~;f$x~8*iK(o^ z37?b%M{N`1Ko|nKyXme(3zH}-rWT3@X-CJUMd^3T;Av11C-m7XsR^;@8!e{P^15BI zx=9EYjl|5)=St(EIqfd#w#Wi}3-H_8z{a3PjfsQ5e#4U@K7AXjZQQ#x63uZaVz8aoX0e1Ek%IErW^mDv^X=c4a}|9GwS=;$b| z~_3}DI1Ll@eDzE7+N zL2N&V2tT{{{NYRl2o!@Au?;xyPKuhCnD}>U>FAIE@i99;|7jlqphD@#oE#vXt>nYo@^VZw6t>^>+3-Swm);6rl0IqB zN2vl>%4Ie2T1Q96-|o{;E5~BJZ@brF`Cy8xd`#MNGSG}La{A`|T9O%uo4%cCwY!`0BUVga^KU!en?S1z*Z@9DSVgOCV9`G3L z7YFHESAaV({67&tPSQj8Sjx2O>A$!~`v>%sZb{2Zb#z^$e2R%cE)KSewn`I+IuaYUJNB&0Xt(>hk3orBjhNXBi+T5zM`tCCmXLG7a9Y75AFi5 zQSd1lIZ+{5#q{3vijNnly@@QDC=2SN&1q~mEh0XPv0VS)FqPlB&s`-j0Oek~SShsZ z^j{K<&f!uZkY*>~bn1298!h&sfwpYTpuj~dMuJ412Q0OA z_nzX9*1M7evd?I*!GYK3k4c6odcIsHy0^EtpnWS#ZF(v*Gl03zFZSkR=A8d@%nzcp zRp`NdCrl&)N9NOtfrX{@bGqa9=2E-mmR_J!fx>ClrVpDTD|eTr^5g}~N@9>3tu-85JeH+zpl9;AZlY!g zd+L2{8T2r3qO83P4MiMEeMPLMmWzph37A9sqQzVzV6S+4k(S zXVmZFl4x!uK|*Ty?FN5pHquExo}aB+GKGkNA}S{Kgt5uFH;(~*ZRY^MdC-4t7HZYf zN6(N2*C+DW*u<=?_hV?ZI=*z-p9%Z@m8z$w2biVGCIa;V6g)aTht_Ge`&J@lYB`aR zXwoAwETDac3y)QDJtLjX4vfBmvpY^v>XTMb`Y zny%1{n6#b_?dLls=I#k-JUv?NMgYgS<6>LUX@3e0l2wq(u_+)RAY&x}GG8~l6AB?d z*$TN|bUOdWwRkn{Ush!d9diSl6!#}OIe*W$>S|MI-=+b;v^KnuX^hBo@Cq}?J0)B0y zacP`Jo-lLJ*jFxfn827(h&jXE!>tlvQ_79m?!|QQF)oi8)ZLySbe(+1#Djh^9 zhfrewf?msaSN+F_TbA_??t6e0h=nIuWt&7Z_(oiM>WaCh*VU#ICK(9v@u zg5Uwev34_AqO`Nr>KW4W@kuh-N%41}WTK*>8Csc9pMP45fdY3Xt-82|+~Tq_G-VEs zBVz8MOMj_jPP_dN2cc6SErHO1I(#DHw!q(5-`hk+;14HyXikEL2M~DJAMAY(@tN^| zYS(;sEjQOZS;~3?w~fQT>>_S`*vQg)odM7fXyCt^1+Uuk0uufOB_$=O2-02&n3)hX zv?y3|6ClBGf;Ig*o!0xW8&jtH5ry&u_M;D~IB=;v$3(R6?Sz4QDm~JkdizP;@B`PE zwOf{?_Z6S^fdi&guli{WnUDx*u^Vqsa=y2yPhAM@#|Ts4AUWJ#Fdcsb!ootkFZq{z zSv(BI8$~50>~cQ+Ui}g^>6YQP!oMNI9!5i8TuS9y>2z!a8hsJ*pg=%JZ4ka5x?7iD zaCPpL5ndM2fA=n&nVb44UOGQilzw=8kk8l0H>q{&6zKsZ|ICkP@NMVvgmmnO@wKhX zZSE+kJhmT$#MLKmc4+QE=Pf%|(`mL_cHKtk3@QyK7Fje<@bGwRzn1=812Q47@nGWO z2F=x4Z@DYtnxPoJw?fW{#UiQTSB{GNBwQfh531ewviBehpB)NA0K3j$atrJ&8ffIv z{(%Vi*G$o-;<4@(L;J6|xNrgD0j-V2LW4s_x45J3hqiEC0hf;JzH`{EsDyvgy4r-a z2LcJY=;~Lj34ei(gY=uUeZ?PfSeW)_H?Z zpULEn*5okjDorN@k9XkREG@X_##SgEBNcF_=hOvuqP_h+`?aARSU8h^fQe~Q&!Oxi z?aP<&wpw)oMahJlOd5VKQSfur5A~~j)+K__1t?5`>;cEps-FV{#W+{1L-&)56Nwk= z64ye!^mb6v?5h&|IK=+&KzG5h5lV%klJVoDH#_B5efrv!b0G&h0>Ea2KLMe8?T?HL z^S`5Z|3m)%_m1mn$uyWCb2GGFvVhR4{a7Gk3!}M9~6qtyt-hVjLggxapoe7MSc+Am3 zg2;mXdK%Gn%UjE0rT^0TF8-Q`YPV`|{t;(RpHR^Qw8SQh{H}%|6{!%InmjIf+w|A% zgKQR-_^QD-6QnF|mkA4y8H+wi&wdtwebf4rU_Z0nqq2%`o`Ken>+74U{HVxT89O`rNcM?5QOT+DciIVQX^d4Z?RhVu znQL*rUPUTzdv3DC=3*$h6qvCb5ym6gTmWgVaoYE825`1JcOqN(L6;6z`V(z9-hXf7 z@b7K>(zi?s!5#zz04OnR4kuJKTwHmubfR2m=g+ajItadKlvmh6AVA~F6`_9#oOQg8 zSFBKr0D6e>S6kq>LP)s3F}hFTQgW8w!vC}0yZ`q_=x(kUPPwF(j1%i0>Atp)y((XO z7ACg0?E7enp2$+|?RmkP8i+94+UyFg8N5*nv?l85=^JwgfMOd;8Zpnz$u0UcsG+8Y z_v|Y&Rf0EA6O(H#yCaE@G@WoJ6)h*bzZ-TZCl=rvN3wmvV~TJxPhsl|2n^H|&A@7Q z@6J<7Fx5=gUt3$7X@9&W9~>SiAN5X~Q=ipskIRnwXK{tJ&|PMD@0%wu-unqSU4Zc- zSD#!a@@n5z(B}*>k_`l&PO}Ft&|v}#LJ$ayXTDiJW7cn>I;~SyQnJ4}qdVK3Ca>L{ zh_y`r$6(#O5Vw3&YyGRiP?U31=D~XIJHgLL;@o5hW6n*UkD94`TlnH(w+_{KTVB<6HzqnujIVXz+mrs|Jo zx>xuM8g8Ob(TxD(XXwQob1!6K(MZ>?1B`rq;B~3I@4ftYqUXq&By?k=u6K9JMThI zzYHFeQWLw93P@L~b#L@EYpTY0AHFp_jqh)x1JNkwTQ=HxW=Kp7-5-&9_k%snzO56D zEp$>1P=vF0s;j>xzl}&JecLU;`0ABzzW0+>&wl7KIekR@cR+Q~Ff*ezj;xZwXHL)n zHjj;~)&o3U=yM9eAf<0$tghBvUh;-61n~V#)pk8*z+)Tf>)PlL2vAg9bDd7cpOxRo z&!C$^&7>uL2llNrRuRr@EXOo<(ENAhD)c9S&WK+#qT0RA`+9wQ4TVx#+}3?#V`Fjo zUO0>WMc%6A+-hU}`fAfzCv!X-`@Z7)6}TQlXVXKnCT3>zHlDz4hcDmK);mWO92^`} zo(tHuoAx`{FWl5XyNa_E&dA7s_;K6L<0Z)fZ?tN$3Y{ys6A)$}LpB7%=G#O=0tS^- zar4diQiZ>gzb_4T|;dA;s&TH)0h)*<{EU-ZT;6u)hs@v@R#eEU<$=TwAc zscmKHAHt>=;ULgXrp9Knc=Qa7h!X+<4^6%J+R5`6cDz6~sJNJ3?V%PHLV=A8w2Ls% z(sEjK6!6mq3L!x(Vc%5gAz3dput8SNcc%%$m+8GSl@m@;Lb^LwvPG-xM#yy9J2#r=({#yO3*q`u;9Pvd_>Gdx%=T~flY)xZ!;Vqz2^Gr>pT|7dL!SDy_$R0pje zGqpxFlaWZ-2}&%#|Pz z@F6)nJL}10(QbJHjM?r_V}&2@swckmsUU<`1nMLwCtKKA1p{v~)Y4>VXlOB6%E#~W z=SlN=|L-L`fIA?5^>%vre21Ai!mFUOMm#zN%<BBDf!D4F!fYAguw{{?adipWQ9ge%) zy`t|?$6d@SzY)Q!a!ooq`w#*R>|%d55C~u|0C5Gph%cMk1HgWrgTfeJ67|FLPQTr! zHxC6LivZK_jp)2sTum2kc3;GNvS1BN0(wd+;cz85j z6|HoUjSd|8KXI?I7>fhNztK#V_6OT|IDP+Gd6J`RP-BCOw2q?7admE1Tg`%{?FxF>-S!qziZ^aM_v+2`(%q zPaduAWeT_^fpW%S`Rg;2Zp~G*Ljal0(jFh9pkP|9#atv)8c*h8n{z}I33nRkzrJl3 zT5wzSAaeT*X(a#2r3I&i(`MTanyx{+7C$32@GTP@5fa-{+J3;_c1pz5V9P6welLXi z0CEaj-^{7`$P7V=BJK%H_n6>&_gj6%TL$=X_6G0Mgod&7a^3`sjPddD-rLXT{=Fwe zvXbKBVKJ&xMG?X1M9{pwJ6H6f>Jn(#GXOqmNS_I#ho$ncfK8z2yfY9dCmnJ&u z-HPu;!Dk1r?TaR2lH&m;j$V#N4X3>xqLav($Q|EMav@NkBDPpq!S68ZHfT_S4RE^o zU4$**N+(L3d!c$fub~*@yPVN#17@c7+IGENmd}Oe-`oBKJ7Lt0LDuErvfC%*`=Im2 zxOz}81AMi_6GYIHaLfW{s8{6aCC$IP-AguNcIUr2m}JoOx!XH zliSG^+t7SHi_=x-?6~>L-u6dh8u^uiOdo8P>4}MtfK?!SV z+Km9Lg@)5Uy&fJpJ_2NPbmH~$!#xD@qO3GaRTbq+!8>@!SEMma(8gbR39+-YAA!RQ zEDFZE+}2?sF~mn7`cRvenj>O!O9v*e^J>Gw8X`r6g98TF@h+^3hrD$N=Ll*mPR9Fw zzw*VsyeipM2`O7tw6NZ)iOp#Bpxhj%VN7d>TzJYuNhREqCgqfVCQufwe3_;dMZoOM zQoAokEbSo;pRtkAr-X!H$fKWEJs4au%*Mqh#YKVuhp#xu7cyr_0FAV(T5uH|+i$dz z`2J?z(pZEZ`&Ue85QEu@3bBX9g#|Dk76=G2dyt6nne{~kKAd{h0}oQA@hvweJ9mOd z5-0d|hh=85)zwv2cJ>^8+OOy!-26+6Fy;mgx|gG>>?PbWD2Uvy-8KZy@OETcyVUQE5P6R(BlwxqupQ<*2BHj=8Xc` z9_tk$!ASuR1dF$~r_W&FBNCr6o3|GQcGzgGCr{ByBq9a^1T^ldGuPr!%_!G`<9ngH zVn|byNA^yah$x%yfexr%tKA_O4KC;On@mZW=8vE1V;E$haq6-!GsUeIcbZ69zWhIH zL-7O71&n`kYhtvQ9@OI=v5TUGAMKX8cL}Cq z89GcOSCi6T<=?aEZaO(wLRVZUfyo^FkVhDYKo?|(o1dUNqJ zRfOdNHxC`)RWR5_%`BjYmAD108m!&}D!@&!a@JU_RBcNuLuz7TCbbw(8~G*IczE%@ z(VURLnAO@D(3($Cll%e-UU0IrW9#cU?$TGBb#}g4KDgSZ-MeFVnVzF1+1?*L`jc%p5<_x5u^6z;}d-uCV# zbS%cCQ^aPu_8C-t;?aGp<11Yv6z;JQhJ>d>N+XSk;-36nWF15AXSJ2*b@vP*s zjR##B&vAk}F*Eum@VC~;$aKuln-9S{yIv1>nu43s8TB;r^=#uO(UYJl;<7fG@cV~< z%Y{9qADpL_yc3FqUTE)lT{Pm@kKkfso?%XUwmTk@oKizq=|dfr*#YgMfK4&4Fp!y) z|C@{L9F)fi+qh?9f&#_Er8d<$eyA1U&Imyhjg0jZct11i4-MZpGCl7q^xG5YT0tFw zRsb-!R5U^zO$j<6Q*?H352BdW`BLn20$9vS| z3_Zg^m5i#UNH!a-b{N2l0N6ZTLA3Lg<{(8Kyas-E!|W>;XuN>MqR>*_DB%*&SCtLA)@;*|PMKID)=pMZcMw7(+!^m7uePx<<7A|dVW z^#-t@5*V8XfrPhOp~}$fTE}>+6@Ey~AmZ>hSI)PEk3rKV-N{v^kb8i$_0(EnYpa+y zXk>t0O?75BhOz(tU+t2Z+pcS1vV`@+g$*w+-`e%K`ON#)clr0<0S+9~hw%%rBs?Q$ zh0Z&I`4I`gkjm~Z0Phcp{fW0ic~)i^aM>V0q^?{<%0hn=mRP&~rUkQ3qqW*RceReD zRhRcCc^DsOMVz)r-~9QA18M;HsREb}9ZKfm897HlCsMI!bvgX?VkA?K!HSeuw>g|< zBvW*&In%%T+qa|5pVq)ekppZ{VB_eP`}n3ltR}{dKzDYVKgQnha_y-x7-$Z?gwN~WY2kd>2 zkdQhxN)&-D49*i{FQoX7?5=B^{azJN54Ee3MhL<>=znRnh7jk8H89=r~Z~vOkAC2p*38#04VMF}uN_ z76-};RzP3?>y#A^fpMjPkItWR&3?Ib0}G2#;K3I3ys44B;R8h+1m@p5PPcY-e}7kH z@E{mT#vwtug5c+Su+S;&`VgCxo|mKJYx3%SAHjltga7Ryi_(7lU!C=v>=qIf3*G=M z=%`U;h0ECF(hJ6Pp_7Eikx!Q+A|rbMes$Ox6Q7wOqdOrEOX0KymZrvGMV7w`3kECD4w$0od$yy?XbPs(=Uw@yV6G0mWW4iFi!;qCIdygQ=sC z^k&z=^O{OV{8{`Fec;7cZCL;#pE`oRFu)+(>*o)bCpV_nE!nX;W_osAi*ICX^tEkh zhLkT{{1kts?|gTAyc!=c?ew;!Kx6Cl*i{1)q*!1$Ncj)H+bMs+VNz;+Vk2t7zlvMO zh#B>NyZ}Ibna^>U6kOGGA09S#DO@ay-U@C9dU!J#{ zOz)c-Rz{LJPMIpez)kpJA8TLbe`#;n<85?*?s90MGeLl11Qv*u&{k5Phimg9PH?&j z47rpj2^fF+$nBTh)v<`zS9J~R_r7}g|D(F~R9C9R?Zyc9-}7+d6bUGXe2xv7bNFNVB7I}pLp&J~Awx+1qe@1>g{GoV6_!AbW*bdPyCn3xS_ z->UL!cNcnLLHpRz>}rQ1Tkp0ive4i{N`i}Ctn$k*IvO2dwO`9)*r2O{>W4D=`gv|Y z3#F(;dJ_RTiyesO z&i)wkN{WGaM0bs_ggXH{IWYOpxURhR7ljXwAwg<>A$dHqF95bmq+23NIuA5t^vnA)v9_g^ z0PaQm-lx=Rw7Q`A>@N~SI_zdJQ8tGGMkLS5&4ruKmFykKgFf$;{&azel;UEiq~eEt zkMoT|bHV`Q>l<)Ht>26PvLSPnmXkB9w_7p-vvFpr+%_hXwlS=(JUl@yTFGpE02Nnn z&xASGZ)>eEZ~>O;)H_EVXn&wq2eo{zrqVan#dg*k{qg`t)=fbh`!kb6T_+K=EsVUh zw9DUau2x@Yx0%oZ<_gTiRrTEkGcq&FQT_xvWsjZhfcHGe#IEseObjUnAv7G;5V z_jJc~+iTp2zs+yEYH-`!S?#2J@j~Y8E=LNGT0_et`uR0jSXg^IUudp}#V7`C$WH3m ztn@dUz3GahemFiT^&E!;1#c$%f}=|%ga8d8N=+YjkR=uM(>p z%u#+A-0fGFR*yT4$hmd@ugN()T^~ z|H1c`04~s}#n#elGz$g{zd}M}5=~Mb^4JrN0slEyV-uwIGi4o6!A?$2P~ox0YKr7p zU-TCuNlhU1+q>(yhlu`9(<{>zdhybi2a5t!)KoZh3XCJpl{UxNz<=|a0+V8UQ2=mu zA)h{BLXS6~p9J6QC;y=U6Q0u*y8XZydg3*h!yXzH<_{e3&@b1h(X2*x_fa$$EfLCB((`K(%}@27$cq+q++ZBg@cetzN-CK1D6=L-6sA=J|7f z+u53AcmxD|%lnrRcvWq!x0MeG3D?onX>9ixQ{M~yC#)^Q949*g=b{+_z7wS&BxEc> z6_9;EbTXif4K+14ujcgkgGxNZEH7ukVia$crq(M;r!&Df9%usUdq!U-u?i@x--KRy zR+&a5;#~1N0DX`0h9RWN@gyNeI-D&Se6hld4q*sr>XtXB+8XM(SCd2)3tN`aZ> zu-;erILLCH9}iTl;`T8a?SamQ>`CjXEbkC>Fa#=qD@8ah4yGht%9#L_7tGtkKzRA| z-Y6-39{aif*7>NrcmHvJ(fqZtI{DKhnms1k;o>aXHCP?m!mO!DeyfnV;E@{=4d9D}2)uKO%D}tq`M_0KZ`~16&+^;1M#)Jy<^VTKOX933%Z^Xy6G|z*z z-mAS+AKD);Tn^mlOI+SpTm-EHoN3e5N2C4>;fu46>E$ z>MdYtrX%9C`7ZH%Gcz=FAnqbZ9K;%7VNN6Xq7Ml)a(|FQlaf`tG8UV$fX+WxTolTVw9%O-wX+ZTcW#=RSse|+~d9TUWF}Ryg~r#pT8KT ze_b6nad46^0EYN`$!c&$RRnW$bM&(eFA-tCefySGP*Ct`{ch{V8T5ZE8vs;*VNG!T z|7z>2!>Zb%Zx50ZB9elDfC|z`2vX9Bgn)r`2&i;-OGt{OfTT21BArswCEXyQbT_=Y z@4fGR@Atm+ez>yUSD$VPeJJnv&c-^9cXm;H6bY^YFg^0?pk z*~*1*Rz!v(Q0r)@`l$vQh@VD_y7Rz*B_e!3%K!1}3Xz7q|J{4FYSX)w_A43v1%svG zZ1(G;A>h@cJKz^`dn(irxQ^jre-NoaOBu6N@xboyL;C2M&=~T@lsgs5*n#aLJ4#3_ zkT5ZE;sEv5(mUI@`RwAHbdI;|_2@O&mMsM)!*i#jHn;I|qsjjM`WkewF)hJLw&cdX zM4uNK`3g%i#5(N?Nw^yl5zRbzWkF7qAs>fP)e^$x))I`nH|BqZHWY-p1^|XT5-ArK zq`{Eo6|t*Vj~?9XnYXekD*oa7i{<{`heV^s=kEj5+k=O^W8-E)vI^!=NWHubAKBdr{Fc>>Fny-I!TvR)FO9IPWcu!ONvwjrP(j+c9j7)s4X zy;p|wVa5=}5>w!rn@dH;p@9pkJuE2#o3tx(@yJ`s@@{3YkxHt+rF>wwip;TU?pCK3 zR+x17+{9VFXpX@lxZEJs!-6;!6_stlBsdJ+-{iYPrV!63wnxcJagDbp9i}RrsOz!$g+U zhVP}~o>OAjv>Ez=K|zh(Yvan${=1$pkmHUng3O@EV?(6VI>`$n}6U>Lwi* zntv#bZ+d#V>CwAGM?i%b1nyo2%+5!_2Mbq#FZ*dAd%iie)=dk!iCHFw&BXaXD(>Rt zd{i(r*nc1J3)>~*S%SYmHdwRtfo|NFR5HUTW2DkRu+nt`Q%hvs8>Bz8!*+FI)AcC9 zgVi?GJjVn9pV}JddDso~3_1pXf8UK2bSa%sV2~pbVPmu17$sK8CULRfSZsT~H4%yV ztSzH|+VPVcJ^dct2f35t=_T)wsPC481FCOM9M4xPdaITgy{BtjoM=1_H&b*?3?huD zfs^yjee9w)`Y|1Mv@EPFOxM7Wt;E`t4j`kgcQ2ABB7L_zGm5!j!Tx#)4=}H`&9~xg z9{87r@{L97DvqT>-f4bUWKd+?^|pda1Y8b?ot=*@SAIR(kA+SBpt53adA1Qkg=z0x zqx9|Npms9ZfUwpzjWWl67FqLlaVKNd(OBe>>-E)rwQ60jgH(UylAp9R?sP3YYplQ| zH8{J8MPw*koP=PmPwaa?o2-N(WT(V$rTP9K;;Z;XCMT|;L8Vn?kB&+ZaEoKCxdc&@ zCH{Y+MsC07`wGg_zI%ANCUX=$%;@$hD?oN*uW=37HXJ=PT8}$DD^PekLZ#FKOQJcXppkw8U zWYm$eQ6+oI7T?~oifo!Yw=3osFyE_P5*8M&*h)<&BB6M9H-d3CUd#tZZ$2+o)NyFm zPm`ZZ%e;7j!{pe~6dWv%8ofXK1OsLZ)ij3DQI69UjS&UjNchG68-8l?sv?(8&$w)V zUX3)u-Kh6m6-*Q0e}If<(iNGb6n7PxssYX>>uY`L@^rIY zetQ&4+Ow4*r@$ypIMNB;KlKI{qmAaVoZOEnmKU6+O_mgtl+3H&d0+QF+24t14eQtw zy2HrG0HkZhT?u4yRns9xh=TrDf44re4yNRm-gkNWv@I|-fSlu%=y1MP)kJ6})T4)H zlg@dEN5-9>1n}zeUIv{fd3c41o>Qo1D!o{){X1B|Shbv2jTb0-afmM3{ke4_tFRb0 zdbSFrs;oo)P6;uDEB}B^SfszeY&uze9Vq_W?19!UT2)oGV*GY4w}AmM>S2i=2}vix zo3}^`zU-3m_%6)bjhC4>_C+wh3VW8TEqp?2a5*UT@SP(n>&XrVi+8y4zOPYHQBfy> zO(QI|vTuFj9~Jc){o8&a6rsTBoYgV49|lXIEq?`chM_)W04#E7<>^G~&-#ZtX+L5G zlM0LR0%25K$nBU!<;^+fN|nO~!g$Uk&s-`~{`Oo!OK;!+;;6MlarRJ9}<=jF}_SYNZp5=;+oSZmK*J9FU##7mE zoN29DGepVF{>tHWIoe37ku)=sb|c32ah zBDE*82KCCr5HuEN`sW6N=qQ-!j5_4C|2uIVbnMJKrEN6<`M2)bv;;AqT&m=nZ_)28 zFTxb5J1?8IJR7sSaWdTO759+}91KA3zxlc79mIQPKLiaV2WGvlzk`S7BfYM8^r)=k zg4W0Px?Y+qM@FlIa5+N^eS`=6&&GHU=2&3gFJ>fIGhBPW`DR1=l))I;8Uc=I`dpaU znDbMUF4p8>XYszim?b5}@ujy05*E%S6doxIW|b-^DfNiB^R9k2Fqc*R_psPLZL~?^ zBY^G4vim~{MjS_}m*x5!U+c#SKj%|u3``9UUiGGT=+;{FtI&fF3TQ5&bi6nhHlM8a zO_8XTI*echW|?_&ju-kaU~#HFE@)7jn+=Wn9%~R^`=2*KRwc(HrQXcOR9yF${WS%K zP2&V7B&IKK`HhazRa8`ZM+Zs4=n|Q~PYEZIzCsn+XV9vDjDH~1;pgi&o7*Gm4=oDJ z-F0?$&TMRikzLuhw6|~AI5{AFlN2o=6)s6HW@MDnq8SP!GHt(>#TsKohtW|)FcpFcQ6p*MGlk>B$0Y8S9OEN#u4yQQy7T*c^&6``(luA~q) zV&yX%@q~Wp@Z>0_?Kmd^jtYIQuVi^&^9;#zgq?R~8A6W+J7S8H%&2&ohllSSj?;}4 zzG1LYZ2==0PODQ#)9Ffu?31l32SPC~F-z;Wc;V4FA*-u1{k3l4nHa2V|Nc&9kt;h- z#Ksc>~th}Bg3xG(+? zUkV+jMm@~s`izPFIMJ1$ zGenKmZ(3LsfdTTZ4AR$Ru3{jv`&-xAL>wa*jypw&!jES;2}uV_wFFTQA^ieiuWN3u zJ!keA%pzY13(thw}Yws~&?x8;B>;x$*P*;hGeW=Gv8SdPngho2DCe#D(@?|gn z$H9yHqukonV6FxDnU5s1nC(*%(6uTLx8wR>p}|1$m<{1WpN?5e6EqZY>OROfNkDrPoH;vNZheG{N>=BxTYOlqM^Rv0d{;JIrJ?qbYQs>AG;o3mHz9KZ)!&dWCehH+ zuFmgtDp^6j6x|h%NyTC^8`N{W^(9x<97F8t7nN*)O|PYR*$K}=3trrsmX?NDwoi=# z{|_o#c{R=pnc1PPc<-AyKPq)RNKNzde1W}N7>!=SCb4O-+Nryu)B9K>)nY zloIXWp+!f&eTt04(4kFIp zL&2P-l8%d1JB7Vh%S$W>QJa-(n5aUB!k%wz8-f=}X!CV&c%GgXw>~E4Gd~2tb)?3I z5jG69^Bzn)3c&QK8gR)unT-1S`nVGkL+F9v%=Wtdimz&kVVB{ z|9M|R52|s8fmmtx3t`kvCMFzIZ0Z zjo739g9R2Hn29yD9zv%NM?WZtCd)XKDsg{fp`bVoY7QbZG}dd{6zZ|FwQGiKKimII zsi~=DW;{j0khUHv17QL%xi&~mVf4&^$VuIyipzX^%W5y7Z6xb?fh*F#uiAH zEh)hb{RtsmsJC;60$f}VDJ&+d-@_zfiIuf?mj^Bo>$Y!Sl;~H2U7n@A)m__903US(mVSKT3^uDXD;Bl0ZO>CC9JRMFP_F91 zFSQ|*(NMcbN*pU%Iy&%#{8i<@?-pO2o%#p z{om*Y*kd6X=64YwHW3`lp{~1T#sCK&Xw9;;s`x~Xm(#>!pyFtSy#e-=Iy3ixp(=M@ zqr7Ha`iCfhV?T`$8lq%*%_jtkBaet-3ic z%wfNbzMH)pOb_$OIEm{T4K$}POv>XG~g*VdAGCF zJ!_{(sAct=jN6xV!270dcit#4q-G7r3EWwm2!5w`7!u#gjcC;!A4?LFQxz;)Pc{&5{c6H$F}kw>lf&t zo;lQOe>JMLD{E)XZ7?Jc>ZO@Hf0@MA+t)64J3H!*MP?t`O*%gx1w)YS2b^98Im@fBI zd<3!pHo&rdUOwEV72^Fy9IwAwqaVNh-{06VVS$0-GREY#D}B^d_bu2hD=r(f&dyDH z%$s|PLhJc7Z$2O_NT!Tk>q&F}HDith|IjNNZwua5prK&OtXwG`OQw}9%fi5ioQMeg zD@Xz4(qAsrv-V9MUK-_S5>*+d+NhR`cRv zw{P9Ta1%KqLC``_F_2afJpS)wcbtw3WVm-vrO=}P>0#vsN{l|7#HnU;(-M&dsX4r= za$k!>PIbtr6^1Z&*4tj>+gtWx;~I5q=bv?PhIp(WJ|_oGD$n@uS2$3+9&M*v4iCS8 zWjLAH28>Yr;X}`>6jx&z1;NL}yDll|X7{zFsxaU=>6kc~rk5_NOq+I=yu-@Mz52?g|caPJ>kH@h`uBGua&V)km0c&j7J#fhL*`E$!+^Y0b}-!2%tfeY<095w+Q$ zDH4avX<@x71~O1T6G&V_g{!RE8yTh(jRE_j zwXonREA!9JeiL4LH%gAnc!(7!Io*pSkDrV9clO#sa*noh3lK>k7%$PT4`k^5*-qN2 zA*d)GLb_xgY~!7*df@oEe#eUe6z)q9&*x@Y{pOKb*QY_m=bhhr`RZb4T!_waK}40A ztviNT{kEa#{KQMb8$#9?K*uh=ANVj4Sq8WUtU+qZS2pBkh{b<0bR6K&q_GvgnEMxd zHv^eZX&EG7_#!5bp> zB#@?22-KV=9W3dpDYSofgk4g?WBlcPMj7@FxN=MWmA-}JotziqU~3O8{GEKwIxGOm zM(1ms_a)U{Q*`T`QW2P$@n#h9)(FR9!{eyjms`Us$KPl zK%ST>5vGrBh}s7egd^MJ{eeff!<6M|MeVL#OjKfmmRmgMZ+%CqiRJpWp}I;Kc=K z(;wI*@^Vu!GAw-CMG5IU6w;O-e1nmS*#;RG9mB2U5?F3N4HAC3=iZo<9z~y!RlBLg z9Hl?=;;e6?R)CCE{ma(ctkV&$dx9t}2mrl&(ijj>z`Rq9Rl5=c;m|E>YFyk~;rV7) zr^$iHZFO*lRgAlrt9`mY*_cJdz-d3he_C#t(n7Ad&_@H?9EXr_cx1i+M=?pr7yDpi z-v3bqZ!H`23|DA`JkkBH{AlPSLe0!92f&|aH&Y}&1l-2VKiNyR_>hngJSpgK?^|fv&}=8A`VOoz= ze3{s+;BC{egHNBppy}7h{0lpP0f_e2sSy}p`V)z6{jd%LRMW9#%lfifhIaRLX>c7*m$@LsvrIQ!L5w=5Z=f94 zBV=S`WKEvJ9F(4Z`|of;*t|@rJ{UT>mI018$dZvHX?#;jQg`p!W1SJ5t3K@Vy;_LDJ&lC56Y48WBArMi6B82I;!(}ZY8H4%p z$4Tn#y2YN)LCDkyFE7ELKX2d%sH53*LSbx955~MfZzrj#DFmgUZ*7vBUjf#xKimKz z!eIdm@3A_qlcPU2HAPc(aDLvfpqTW)7pk4Z8EbHfVzZT%&*d|-T>VLOi;;1uLis8Y zk#Ysu0Kn%Od=@Qj#I0Og{*RUqoJ7GVl(@#(-CIKDN}B!W2PjV}?Xtn*K7dM)FR`1Q zJ+^E{29aZ&9q%H5-apEPxs#3A)j97zhB_I~B+=(zwbGuiA??qnfk`f_e!|VFC4WF3 zn~xroD}$5q=sl$N`@6%@+dD*-+2fpLM?*5ZHQy@x=#f{AkDFIVz)j>z5V+(94P|d1 zVztvk(3!9vDhAsMJn(Tmwh_qxU0B(Dq=~86S-QK*tC;wJG$K=xEn?r1gc1wR97xQ1 z_4R03I&~tQ(62~4KX6wsm)%e4{FS$PX|%782s#L;K4>*T;=}_YiVJ;pK==}QiObBV zezb9CDt}eyMb+~h{28e-CX8m+_WmkZ8Z(NPu)`nJ=zm3=na#=J6Kvg#9!rkxZPD&{ zf0!XmP0M9LC4>2`8mEOwEj14X+yfyFNq0uXj1t;JqU+bQ?NeUD^)ZMyDU|TD06km{ zYKB3?9##1hM;8XzP*6K>73AU2>(pR*iZ4ZJZ|~d#rEPr?Tp3mmes4vat+ZCFzaAmA z4{8RM+^ue-c_341>tua0_JJ8Qeh9O6n1{IjrIPR8tyY^ZkMI>o)f_;ky2J7%cR0&y zf#n5R<>wrM4JDYWF!~t)1b^Tk(fzen#QbpOK)6_(5(R+^=v*iyO>tH-mfe+wA3U!| zuClKQK4g}CTpiL9LPhR03e)GeZr^Fg1*^ZH5KPoE)pFWWW)j?YhJOQxL4pDQ!u^Xn z<{dU(f)qMBwUR^dF*=~$SS7s0c4LPXsXb8J)aPQ`Af-ml_(%|e)s&$qHWayQ7Ip2o ze>4Y8e$~TU(M8E^ogUfnnDmU>I;Bwn;y8I&Wh%{o0-4Chd{V8gW?0gSi0F(4a|ji= z4iMHwWa;nX^JPqZdwcuBZ{L6p7j?M;2YAx{dK4q!mem%xGe~?@|GufbHug3iQ%dfU zA{uJ6IY&xQSJ(3`7^gZpb>uwL8~;fLgl&plJYTbW$co1a0ayoc3|b)?We`9d%~)5t zPcxhdaB&e4w}!|-x<(}f4svL}>>xFkq}+Wq21GZtR%mAnz z3T|`Ll;++&lVQZB)%S+O`e_Xm-Q7FoVPR!?!rSqm#6N#~q5|z8;1(q%^aTvei&_ld zOG+%;8_`qfQlPj#9N36jzznE>UeKtr3c>GCsCX=b&7DBfVhic+1d$Mnx|95RJ;Us~ zqqHiloot8ZK$tCP$Y*Az({Xa5;CB~x7zY=%e&R-XPPv^dYTOJ-;wM5z&UZ`uB>V{* z@559`uH$yKD<-4j4gV*Bcvs`c$H~>-k=+3&7?4XLDAiZ9so6UKona~-WaRBLvA{_P zY6=+;-MmtrUTCMDQ+}f4CM9Zb`11@E_fhrqZXHg8IVQMm$YX0f8!+%0NTXf4>E?frIrUG5Y9akVsfd z^;VTxSixQf@lSKpBhlYg?i(U*BIRL#V3D7oSaYBIMn&wnQudjP?&hIwFFg^9s@Vm^*wwn5`p`qvNhax=Mm8rBd7wa|Nx$+tH1V7y0i%K2tosF-_=~o^I&1V~u`6 z%bhq~W(Z}gp}PDMnJnX6Q7PWJc!wa-7 z7(`iG+IHFu#H0ca%VBG-E!7U*#`n>&=ug{-9kuJOfc%8t`IgJ+l84KR(hb4T{K?Ap zv$PlXE|H{G(G(B&F@rAlPe*qywLZ@6C}Qz}l|aq(rE#XO8Jy&6#d6z_h29X!+g>Ar z3+f&b-w~$=)DT$VL}Pwsaq&x6&h1dVZ-ud22d(cffe-`(BYBch=R1=dXWmFc^tcNYgt2#uHLk8Qs?m0r5m_cNae zk)QDhY3{3m7R*RK>B>X*>XJ%BvA)0RgCJzOO*2ska3OdJ#&jKrpLyNE0~MwC;M-?# zMHV>*HYUUGS&3?=9qH1}XG%(v0IAh+i1-7?AFLoJVrtZtGdNP@M)f3cR0zDoebN01 zNh^bI;>5zmS1|E__G+4XXF$8=DonD)X1x}2*~hPPSeFDGJ8t|whpmQ~m={7s*7%@L zuK~k#3OMLie{^)T+IM>bX?$udV{&7__~t>wHFDBQ3mvcYI_(^sCPmI`>W4>@jZou) z0xM;SG3n?34Z#8CG7nHYV(klGO#a6Z!;KkFIC(gEc$xq`wj4fS2U8lqrJf|c^N9+z zDrbU^*NC^^{4kv=fzfmi!u; zE$T_lEl~48Mcz9Uo+M)4SZU|Dzk5A6Bm{1?^kKCkBRfB2Ko+H2t8xbXaz<+HSZw!p zb&ZU$KqYqOa)4ZgC@gx00iTub95OJGiDWt21hx!LX{mBAdAM%~+KX3pV0EBh9|Kbb zrlcJ?zUFW>6$R9C#d{QYH!Mv-TTe)8h^}*}H6Q;B z8^0c^5v#K?UfVy%MH4&59GZu^MS@*!mHpaD(b3O~mKxYE+t}D(_zSV_*~8q;=5{k) zXPj{S#x7{_YMV<|y^9m5BxB>^+%3;_SWH;*)M{`+gHY}?k5#$1%o+f^L7fjdWEj-5%AIpIG9Fw+@{9>qw3-{xJs``gZk-lc&;rQNR(gw`KApK=^7{o_M$r6WkpbK> zgIH<9!2wd1h3Ig(^v(T!Y3Ku#vsG??H{XPgsA2j_gP#J`2mpYe<%Ixh&H(LTT9^pp3s~f~@;pJrNyWTE1_l7>L~13Q zouyQ!)__08Y@`o!NDv`FirmAy{ky+b_;`0M z$m!eCL*^)E+wqPVwr1$)AyoaKS_J!S6|-@x=AI6yULL!S<&sY?z;1O7`jecToUqlu zhWojPR}^Zr07n|MGR4n8v<0TggeJeRI1=!ysllyl^RIjovyV6yp=Od+hKtsRb+%q^ zOu?F#TOM7b9Ocy~lY7%vY#8u9v;`1e(#pyCOvPFE*Epx%m$q)Ql7K|ydB?t>-P|qn z$#So0zC4b77c!^}t=ud-Z5adwkscqtmPTzgBtABFW{0EB69(>U*QaSaqB(jFLOlU8 zOol{vpCO=9IcER$Ym*@AD*L%9Vd#=K!xmN11pIV%q;+O<_{>~&gYzf_2VfiiE%&5`%{UaN)HPyc7SR9%|0301t-&$#V(X* z(R?e!S{htY^DFD<9q)JHSl>A=PEK7qE%~qGB}NR;O*@kgT)@CbFqoku60+Ck8=g8t zdCkKuxmF7gndJ74yN7DdTS+ILTaDLMvVKs{1OV literal 0 HcmV?d00001 diff --git a/doc/src/pair_lebedeva.txt b/doc/src/pair_lebedeva.txt new file mode 100644 index 0000000000..6b9eabc611 --- /dev/null +++ b/doc/src/pair_lebedeva.txt @@ -0,0 +1,63 @@ +"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c + +:link(lws,http://lammps.sandia.gov) +:link(ld,Manual.html) +:link(lc,Commands_all.html) + +:line + +pair_style lebedeva command :h3 + +[Syntax:] + +pair_style hybrid/overlay lebedeva cutoff :pre + +[Examples:] + +pair_style hybrid/overlay lebedeva 20.0 +pair_coeff * * none +pair_coeff 1 2 lebedeva CC.Lebedeva C C :pre + +pair_style hybrid/overlay rebo lebedeva 14.0 +pair_coeff * * rebo CH.airebo C C +pair_coeff 1 2 lebedeva CC.Lebedeva C C :pre + +[Description:] + +The {lebedeva} style computes the Lebedeva interaction +potential as described in "(Lebedeva et al.)"_#Leb01. An important simplification is made, +which is to take all normals along the z-axis. + +:c,image(Eqs/pair_lebedeva.png) + +It is important to have a sufficiently large cutoff to ensure smooth forces. +Energies are shifted so that they go continuously to zero at the cutoff assuming +that the exponential part of {Vij} (first term) decays sufficiently fast. +This shift is achieved by the last term in the equation for {Vij} above. + +The parameter file (e.g. CC.Lebedeva), is intended for use with metal +"units"_units.html, with energies in meV. An additional parameter, {S}, +is available to facilitate scaling of energies. + +This potential must be used in combination with hybrid/overlay. +Other interactions can be set to zero using pair_style {none}. + +[Restrictions:] + +This fix is part of the USER-MISC package. It is only enabled if +LAMMPS was built with that package. See the "Build +package"_Build_package.html doc page for more info. + +[Related commands:] + +"pair_coeff"_pair_coeff.html +"pair_none"_pair_none.html +"pair_style hybrid/overlay"_pair_hybrid.html + +[Default:] none + +:line + +:link(Leb01) +[(Lebedeva et al.)] I. V. Lebedeva, A. A. Knizhnik, A. M. Popov, Y. E. Lozovik, B. V. Potapkin, Phys. Rev. B, 84, 245437 (2011) + diff --git a/examples/USER/misc/lebedeva/2particles.dat b/examples/USER/misc/lebedeva/2particles.dat new file mode 100644 index 0000000000..43eabd7d24 --- /dev/null +++ b/examples/USER/misc/lebedeva/2particles.dat @@ -0,0 +1,14 @@ +Ideal graphene structure in YZ plane created with create_graphen.pl + +2 atoms + +2 atom types + + 0.0 20 xlo xhi + 0.0 20 ylo yhi + 0.0 5 zlo zhi + +Atoms + + 1 1 10 10 0.0 + 2 2 0 0 3.35 diff --git a/examples/USER/misc/lebedeva/2particles.in b/examples/USER/misc/lebedeva/2particles.in new file mode 100644 index 0000000000..2a9851f383 --- /dev/null +++ b/examples/USER/misc/lebedeva/2particles.in @@ -0,0 +1,63 @@ +# After running LAMMPS with this input script a number of dump files is created. +# To extract the data from there I used grep script: +# grep '^2 ' *cfg > LammpsResult.dat +# After that after removing some text from LammpsResult.dat, +# the data can be viewed by lebedeva00.plot +# +# Author: Zbigniew Koziol, National Center for Nuclear Research, Poland +# Email: softquake@gmail.com + + +# ---------- Start simulation --------------------- +clear +units metal +dimension 3 +boundary f f f +atom_style atomic + +# ========================== Create Atomistic Structure =========================== + +region whole block 0 20 0 20 0 10 +create_box 2 whole + +read_data 2particles.dat add append + +region graphite block INF INF INF INF 0 10 units box +group graphite type 1 2 +group graphene1 type 1 +group graphene2 type 2 + +pair_style hybrid/overlay lebedeva 20 +pair_coeff * * none +pair_coeff 1 2 lebedeva CC.Lebedeva C C + +mass 1 12.01 # Carbon +mass 2 12.01 # Carbon + +neighbor 0.3 bin +neigh_modify delay 1 check yes + +compute peratom all pe/atom + +dump 1 all custom 1 dump_lebedeva_*.cfg id x y z c_peratom fx fy fz +dump_modify 1 pad 3 + +thermo 10 +thermo_style custom step pe press temp +thermo_modify lost ignore + +label STEP_LOOP + +variable MYSTEP loop 0 400 pad # in degrees +variable DELTA_STEP equal 0.05 + +displace_atoms graphene2 move ${DELTA_STEP} ${DELTA_STEP} 0 + +run 1 + +next MYSTEP +jump SELF STEP_LOOP + +print "all done" + + diff --git a/examples/USER/misc/lebedeva/CC.Lebedeva b/examples/USER/misc/lebedeva/CC.Lebedeva new file mode 100644 index 0000000000..930f7b4328 --- /dev/null +++ b/examples/USER/misc/lebedeva/CC.Lebedeva @@ -0,0 +1,14 @@ +# Lebedeva Potential. Original values from Lebedeva. May be played with ;) +# +# Cite as: Irina V. Lebedeva, Andrey A. Knizhnik, Andrey M. Popov, Yurii E. Lozovik, Boris V. Potapkin, +# Modeling of graphene-based NEMS +# Physica E 44 (6), 949 (2012) +# https://doi.org/10.1016/j.physe.2011.07.018 +# +# Parameters must be in this order as here, otherwise their values may be changed. +# The last one, S, is convenient for scaling the potential amplitude. S is a multiplication factor for A, B, C +# A B C z0 alpha D1 D2 lambda1 lambda2 S +# These are values according to Levedeva et al +#C C 10.510 11.6523.34 35.883 3.34 4.16 -0.86232 0.10049 0.48703 0.46445 1.0 +# These are values by Z. Koziol et al.: https://arxiv.org/abs/1803.05162 +C C 14.558 21.204 1.8 3.198 4.16 -0.862 0.10049 0.6 0.4 1.0 diff --git a/examples/USER/misc/lebedeva/LammpsResult.dat b/examples/USER/misc/lebedeva/LammpsResult.dat new file mode 100644 index 0000000000..ff9dfe1949 --- /dev/null +++ b/examples/USER/misc/lebedeva/LammpsResult.dat @@ -0,0 +1,400 @@ +dump_lebedeva_000.cfg:2 0.05 0.05 3.35 -7.28468e-07 4.85145e-07 4.85145e-07 -1.6334e-07 +dump_lebedeva_001.cfg:2 0.05 0.05 3.35 -7.28468e-07 4.85145e-07 4.85145e-07 -1.6334e-07 +dump_lebedeva_002.cfg:2 0.1 0.1 3.35 -7.5313e-07 5.01468e-07 5.01468e-07 -1.69689e-07 +dump_lebedeva_003.cfg:2 0.15 0.15 3.35 -7.78625e-07 5.18417e-07 5.18417e-07 -1.76314e-07 +dump_lebedeva_004.cfg:2 0.2 0.2 3.35 -8.04983e-07 5.36017e-07 5.36017e-07 -1.8323e-07 +dump_lebedeva_005.cfg:2 0.25 0.25 3.35 -8.32238e-07 5.54298e-07 5.54298e-07 -1.90451e-07 +dump_lebedeva_006.cfg:2 0.3 0.3 3.35 -8.60425e-07 5.73288e-07 5.73288e-07 -1.97991e-07 +dump_lebedeva_007.cfg:2 0.35 0.35 3.35 -8.89579e-07 5.93019e-07 5.93019e-07 -2.05867e-07 +dump_lebedeva_008.cfg:2 0.4 0.4 3.35 -9.19739e-07 6.13522e-07 6.13522e-07 -2.14094e-07 +dump_lebedeva_009.cfg:2 0.45 0.45 3.35 -9.50945e-07 6.34832e-07 6.34832e-07 -2.2269e-07 +dump_lebedeva_010.cfg:2 0.5 0.5 3.35 -9.83237e-07 6.56984e-07 6.56984e-07 -2.31673e-07 +dump_lebedeva_011.cfg:2 0.55 0.55 3.35 -1.01666e-06 6.80016e-07 6.80016e-07 -2.41064e-07 +dump_lebedeva_012.cfg:2 0.6 0.6 3.35 -1.05125e-06 7.03966e-07 7.03966e-07 -2.50881e-07 +dump_lebedeva_013.cfg:2 0.65 0.65 3.35 -1.08707e-06 7.28875e-07 7.28875e-07 -2.61148e-07 +dump_lebedeva_014.cfg:2 0.7 0.7 3.35 -1.12416e-06 7.54787e-07 7.54787e-07 -2.71886e-07 +dump_lebedeva_015.cfg:2 0.75 0.75 3.35 -1.16257e-06 7.81747e-07 7.81747e-07 -2.83119e-07 +dump_lebedeva_016.cfg:2 0.8 0.8 3.35 -1.20235e-06 8.09802e-07 8.09802e-07 -2.94873e-07 +dump_lebedeva_017.cfg:2 0.85 0.85 3.35 -1.24357e-06 8.39001e-07 8.39001e-07 -3.07175e-07 +dump_lebedeva_018.cfg:2 0.9 0.9 3.35 -1.28627e-06 8.69398e-07 8.69398e-07 -3.20053e-07 +dump_lebedeva_019.cfg:2 0.95 0.95 3.35 -1.33053e-06 9.01046e-07 9.01046e-07 -3.33537e-07 +dump_lebedeva_020.cfg:2 1 1 3.35 -1.3764e-06 9.34005e-07 9.34005e-07 -3.47657e-07 +dump_lebedeva_021.cfg:2 1.05 1.05 3.35 -1.42395e-06 9.68333e-07 9.68333e-07 -3.62449e-07 +dump_lebedeva_022.cfg:2 1.1 1.1 3.35 -1.47325e-06 1.0041e-06 1.0041e-06 -3.77946e-07 +dump_lebedeva_023.cfg:2 1.15 1.15 3.35 -1.52438e-06 1.04136e-06 1.04136e-06 -3.94187e-07 +dump_lebedeva_024.cfg:2 1.2 1.2 3.35 -1.57742e-06 1.08019e-06 1.08019e-06 -4.1121e-07 +dump_lebedeva_025.cfg:2 1.25 1.25 3.35 -1.63243e-06 1.12067e-06 1.12067e-06 -4.29058e-07 +dump_lebedeva_026.cfg:2 1.3 1.3 3.35 -1.68951e-06 1.16288e-06 1.16288e-06 -4.47775e-07 +dump_lebedeva_027.cfg:2 1.35 1.35 3.35 -1.74875e-06 1.20689e-06 1.20689e-06 -4.67407e-07 +dump_lebedeva_028.cfg:2 1.4 1.4 3.35 -1.81023e-06 1.25279e-06 1.25279e-06 -4.88004e-07 +dump_lebedeva_029.cfg:2 1.45 1.45 3.35 -1.87406e-06 1.30067e-06 1.30067e-06 -5.0962e-07 +dump_lebedeva_030.cfg:2 1.5 1.5 3.35 -1.94033e-06 1.35063e-06 1.35063e-06 -5.32308e-07 +dump_lebedeva_031.cfg:2 1.55 1.55 3.35 -2.00916e-06 1.40277e-06 1.40277e-06 -5.56129e-07 +dump_lebedeva_032.cfg:2 1.6 1.6 3.35 -2.08065e-06 1.4572e-06 1.4572e-06 -5.81145e-07 +dump_lebedeva_033.cfg:2 1.65 1.65 3.35 -2.15492e-06 1.51402e-06 1.51402e-06 -6.07422e-07 +dump_lebedeva_034.cfg:2 1.7 1.7 3.35 -2.23209e-06 1.57336e-06 1.57336e-06 -6.3503e-07 +dump_lebedeva_035.cfg:2 1.75 1.75 3.35 -2.3123e-06 1.63533e-06 1.63533e-06 -6.64045e-07 +dump_lebedeva_036.cfg:2 1.8 1.8 3.35 -2.39567e-06 1.70008e-06 1.70008e-06 -6.94545e-07 +dump_lebedeva_037.cfg:2 1.85 1.85 3.35 -2.48236e-06 1.76774e-06 1.76774e-06 -7.26615e-07 +dump_lebedeva_038.cfg:2 1.9 1.9 3.35 -2.5725e-06 1.83844e-06 1.83844e-06 -7.60344e-07 +dump_lebedeva_039.cfg:2 1.95 1.95 3.35 -2.66625e-06 1.91236e-06 1.91236e-06 -7.95827e-07 +dump_lebedeva_040.cfg:2 2 2 3.35 -2.76379e-06 1.98965e-06 1.98965e-06 -8.33165e-07 +dump_lebedeva_041.cfg:2 2.05 2.05 3.35 -2.86528e-06 2.07047e-06 2.07047e-06 -8.72464e-07 +dump_lebedeva_042.cfg:2 2.1 2.1 3.35 -2.9709e-06 2.15503e-06 2.15503e-06 -9.1384e-07 +dump_lebedeva_043.cfg:2 2.15 2.15 3.35 -3.08085e-06 2.24349e-06 2.24349e-06 -9.57413e-07 +dump_lebedeva_044.cfg:2 2.2 2.2 3.35 -3.19532e-06 2.33607e-06 2.33607e-06 -1.00331e-06 +dump_lebedeva_045.cfg:2 2.25 2.25 3.35 -3.31452e-06 2.43298e-06 2.43298e-06 -1.05167e-06 +dump_lebedeva_046.cfg:2 2.3 2.3 3.35 -3.43869e-06 2.53444e-06 2.53444e-06 -1.10265e-06 +dump_lebedeva_047.cfg:2 2.35 2.35 3.35 -3.56805e-06 2.6407e-06 2.6407e-06 -1.15638e-06 +dump_lebedeva_048.cfg:2 2.4 2.4 3.35 -3.70284e-06 2.752e-06 2.752e-06 -1.21305e-06 +dump_lebedeva_049.cfg:2 2.45 2.45 3.35 -3.84334e-06 2.86861e-06 2.86861e-06 -1.27283e-06 +dump_lebedeva_050.cfg:2 2.5 2.5 3.35 -3.9898e-06 2.99082e-06 2.99082e-06 -1.3359e-06 +dump_lebedeva_051.cfg:2 2.55 2.55 3.35 -4.14252e-06 3.11892e-06 3.11892e-06 -1.40247e-06 +dump_lebedeva_052.cfg:2 2.6 2.6 3.35 -4.30179e-06 3.25323e-06 3.25323e-06 -1.47275e-06 +dump_lebedeva_053.cfg:2 2.65 2.65 3.35 -4.46795e-06 3.39408e-06 3.39408e-06 -1.54696e-06 +dump_lebedeva_054.cfg:2 2.7 2.7 3.35 -4.64132e-06 3.54184e-06 3.54184e-06 -1.62536e-06 +dump_lebedeva_055.cfg:2 2.75 2.75 3.35 -4.82225e-06 3.69686e-06 3.69686e-06 -1.70821e-06 +dump_lebedeva_056.cfg:2 2.8 2.8 3.35 -5.01113e-06 3.85956e-06 3.85956e-06 -1.79577e-06 +dump_lebedeva_057.cfg:2 2.85 2.85 3.35 -5.20835e-06 4.03036e-06 4.03036e-06 -1.88835e-06 +dump_lebedeva_058.cfg:2 2.9 2.9 3.35 -5.41431e-06 4.2097e-06 4.2097e-06 -1.98627e-06 +dump_lebedeva_059.cfg:2 2.95 2.95 3.35 -5.62947e-06 4.39805e-06 4.39805e-06 -2.08985e-06 +dump_lebedeva_060.cfg:2 3 3 3.35 -5.85427e-06 4.59593e-06 4.59593e-06 -2.19948e-06 +dump_lebedeva_061.cfg:2 3.05 3.05 3.35 -6.08923e-06 4.80386e-06 4.80386e-06 -2.31553e-06 +dump_lebedeva_062.cfg:2 3.1 3.1 3.35 -6.33484e-06 5.02241e-06 5.02241e-06 -2.43842e-06 +dump_lebedeva_063.cfg:2 3.15 3.15 3.35 -6.59165e-06 5.25219e-06 5.25219e-06 -2.56859e-06 +dump_lebedeva_064.cfg:2 3.2 3.2 3.35 -6.86025e-06 5.49384e-06 5.49384e-06 -2.70652e-06 +dump_lebedeva_065.cfg:2 3.25 3.25 3.35 -7.14125e-06 5.74802e-06 5.74802e-06 -2.85272e-06 +dump_lebedeva_066.cfg:2 3.3 3.3 3.35 -7.43528e-06 6.01548e-06 6.01548e-06 -3.00774e-06 +dump_lebedeva_067.cfg:2 3.35 3.35 3.35 -7.74303e-06 6.29696e-06 6.29696e-06 -3.17215e-06 +dump_lebedeva_068.cfg:2 3.4 3.4 3.35 -8.06522e-06 6.5933e-06 6.5933e-06 -3.3466e-06 +dump_lebedeva_069.cfg:2 3.45 3.45 3.35 -8.40262e-06 6.90535e-06 6.90535e-06 -3.53174e-06 +dump_lebedeva_070.cfg:2 3.5 3.5 3.35 -8.75603e-06 7.23404e-06 7.23404e-06 -3.72831e-06 +dump_lebedeva_071.cfg:2 3.55 3.55 3.35 -9.12632e-06 7.58035e-06 7.58035e-06 -3.93708e-06 +dump_lebedeva_072.cfg:2 3.6 3.6 3.35 -9.51438e-06 7.94533e-06 7.94533e-06 -4.15889e-06 +dump_lebedeva_073.cfg:2 3.65 3.65 3.35 -9.92118e-06 8.33009e-06 8.33009e-06 -4.39462e-06 +dump_lebedeva_074.cfg:2 3.7 3.7 3.35 -1.03477e-05 8.73582e-06 8.73582e-06 -4.64524e-06 +dump_lebedeva_075.cfg:2 3.75 3.75 3.35 -1.07951e-05 9.16377e-06 9.16377e-06 -4.91178e-06 +dump_lebedeva_076.cfg:2 3.8 3.8 3.35 -1.12645e-05 9.61529e-06 9.61529e-06 -5.19536e-06 +dump_lebedeva_077.cfg:2 3.85 3.85 3.35 -1.17571e-05 1.00918e-05 1.00918e-05 -5.49717e-06 +dump_lebedeva_078.cfg:2 3.9 3.9 3.35 -1.22741e-05 1.05949e-05 1.05949e-05 -5.8185e-06 +dump_lebedeva_079.cfg:2 3.95 3.95 3.35 -1.2817e-05 1.11261e-05 1.11261e-05 -6.16074e-06 +dump_lebedeva_080.cfg:2 4 4 3.35 -1.33872e-05 1.16872e-05 1.16872e-05 -6.52537e-06 +dump_lebedeva_081.cfg:2 4.05 4.05 3.35 -1.39863e-05 1.22801e-05 1.22801e-05 -6.91402e-06 +dump_lebedeva_082.cfg:2 4.1 4.1 3.35 -1.46158e-05 1.29067e-05 1.29067e-05 -7.32841e-06 +dump_lebedeva_083.cfg:2 4.15 4.15 3.35 -1.52776e-05 1.35692e-05 1.35692e-05 -7.77041e-06 +dump_lebedeva_084.cfg:2 4.2 4.2 3.35 -1.59734e-05 1.42698e-05 1.42698e-05 -8.24204e-06 +dump_lebedeva_085.cfg:2 4.25 4.25 3.35 -1.67052e-05 1.50109e-05 1.50109e-05 -8.74547e-06 +dump_lebedeva_086.cfg:2 4.3 4.3 3.35 -1.74752e-05 1.57951e-05 1.57951e-05 -9.28307e-06 +dump_lebedeva_087.cfg:2 4.35 4.35 3.35 -1.82855e-05 1.66251e-05 1.66251e-05 -9.85736e-06 +dump_lebedeva_088.cfg:2 4.4 4.4 3.35 -1.91385e-05 1.75039e-05 1.75039e-05 -1.04711e-05 +dump_lebedeva_089.cfg:2 4.45 4.45 3.35 -2.00367e-05 1.84346e-05 1.84346e-05 -1.11272e-05 +dump_lebedeva_090.cfg:2 4.5 4.5 3.35 -2.09829e-05 1.94207e-05 1.94207e-05 -1.1829e-05 +dump_lebedeva_091.cfg:2 4.55 4.55 3.35 -2.19798e-05 2.04656e-05 2.04656e-05 -1.25798e-05 +dump_lebedeva_092.cfg:2 4.6 4.6 3.35 -2.30305e-05 2.15733e-05 2.15733e-05 -1.33834e-05 +dump_lebedeva_093.cfg:2 4.65 4.65 3.35 -2.41382e-05 2.27478e-05 2.27478e-05 -1.42439e-05 +dump_lebedeva_094.cfg:2 4.7 4.7 3.35 -2.53065e-05 2.39936e-05 2.39936e-05 -1.51657e-05 +dump_lebedeva_095.cfg:2 4.75 4.75 3.35 -2.65389e-05 2.53153e-05 2.53153e-05 -1.61536e-05 +dump_lebedeva_096.cfg:2 4.8 4.8 3.35 -2.78393e-05 2.67182e-05 2.67182e-05 -1.72127e-05 +dump_lebedeva_097.cfg:2 4.85 4.85 3.35 -2.92121e-05 2.82074e-05 2.82074e-05 -1.83485e-05 +dump_lebedeva_098.cfg:2 4.9 4.9 3.35 -3.06616e-05 2.9789e-05 2.9789e-05 -1.95673e-05 +dump_lebedeva_099.cfg:2 4.95 4.95 3.35 -3.21926e-05 3.1469e-05 3.1469e-05 -2.08755e-05 +dump_lebedeva_100.cfg:2 5 5 3.35 -3.38103e-05 3.32542e-05 3.32542e-05 -2.22803e-05 +dump_lebedeva_101.cfg:2 5.05 5.05 3.35 -3.55199e-05 3.51516e-05 3.51516e-05 -2.37895e-05 +dump_lebedeva_102.cfg:2 5.1 5.1 3.35 -3.73274e-05 3.7169e-05 3.7169e-05 -2.54115e-05 +dump_lebedeva_103.cfg:2 5.15 5.15 3.35 -3.9239e-05 3.93146e-05 3.93146e-05 -2.71554e-05 +dump_lebedeva_104.cfg:2 5.2 5.2 3.35 -4.12612e-05 4.15971e-05 4.15971e-05 -2.90313e-05 +dump_lebedeva_105.cfg:2 5.25 5.25 3.35 -4.34011e-05 4.4026e-05 4.4026e-05 -3.10499e-05 +dump_lebedeva_106.cfg:2 5.3 5.3 3.35 -4.56664e-05 4.66115e-05 4.66115e-05 -3.32231e-05 +dump_lebedeva_107.cfg:2 5.35 5.35 3.35 -4.80651e-05 4.93643e-05 4.93643e-05 -3.55636e-05 +dump_lebedeva_108.cfg:2 5.4 5.4 3.35 -5.06058e-05 5.22962e-05 5.22962e-05 -3.80853e-05 +dump_lebedeva_109.cfg:2 5.45 5.45 3.35 -5.32979e-05 5.54196e-05 5.54196e-05 -4.08035e-05 +dump_lebedeva_110.cfg:2 5.5 5.5 3.35 -5.61512e-05 5.8748e-05 5.8748e-05 -4.37346e-05 +dump_lebedeva_111.cfg:2 5.55 5.55 3.35 -5.91763e-05 6.22957e-05 6.22957e-05 -4.68968e-05 +dump_lebedeva_112.cfg:2 5.6 5.6 3.35 -6.23847e-05 6.60782e-05 6.60782e-05 -5.03095e-05 +dump_lebedeva_113.cfg:2 5.65 5.65 3.35 -6.57883e-05 7.01119e-05 7.01119e-05 -5.39942e-05 +dump_lebedeva_114.cfg:2 5.7 5.7 3.35 -6.94003e-05 7.44146e-05 7.44146e-05 -5.79742e-05 +dump_lebedeva_115.cfg:2 5.75 5.75 3.35 -7.32346e-05 7.90054e-05 7.90054e-05 -6.22749e-05 +dump_lebedeva_116.cfg:2 5.8 5.8 3.35 -7.7306e-05 8.39045e-05 8.39045e-05 -6.69239e-05 +dump_lebedeva_117.cfg:2 5.85 5.85 3.35 -8.16306e-05 8.91338e-05 8.91338e-05 -7.19515e-05 +dump_lebedeva_118.cfg:2 5.9 5.9 3.35 -8.62253e-05 9.47167e-05 9.47167e-05 -7.73906e-05 +dump_lebedeva_119.cfg:2 5.95 5.95 3.35 -9.11085e-05 0.000100678 0.000100678 -8.32771e-05 +dump_lebedeva_120.cfg:2 6 6 3.35 -9.62998e-05 0.000107044 0.000107044 -8.96501e-05 +dump_lebedeva_121.cfg:2 6.05 6.05 3.35 -0.00010182 0.000113845 0.000113845 -9.65522e-05 +dump_lebedeva_122.cfg:2 6.1 6.1 3.35 -0.000107692 0.000121109 0.000121109 -0.00010403 +dump_lebedeva_123.cfg:2 6.15 6.15 3.35 -0.000113939 0.000128869 0.000128869 -0.000112134 +dump_lebedeva_124.cfg:2 6.2 6.2 3.35 -0.000120588 0.000137161 0.000137161 -0.00012092 +dump_lebedeva_125.cfg:2 6.25 6.25 3.35 -0.000127665 0.00014602 0.00014602 -0.000130447 +dump_lebedeva_126.cfg:2 6.3 6.3 3.35 -0.0001352 0.000155486 0.000155486 -0.000140781 +dump_lebedeva_127.cfg:2 6.35 6.35 3.35 -0.000143224 0.000165599 0.000165599 -0.000151993 +dump_lebedeva_128.cfg:2 6.4 6.4 3.35 -0.000151771 0.000176402 0.000176402 -0.000164159 +dump_lebedeva_129.cfg:2 6.45 6.45 3.35 -0.000160877 0.000187942 0.000187942 -0.000177363 +dump_lebedeva_130.cfg:2 6.5 6.5 3.35 -0.000170579 0.000200265 0.000200265 -0.000191696 +dump_lebedeva_131.cfg:2 6.55 6.55 3.35 -0.000180917 0.000213422 0.000213422 -0.000207254 +dump_lebedeva_132.cfg:2 6.6 6.6 3.35 -0.000191936 0.000227463 0.000227463 -0.000224142 +dump_lebedeva_133.cfg:2 6.65 6.65 3.35 -0.000203679 0.000242442 0.000242442 -0.000242475 +dump_lebedeva_134.cfg:2 6.7 6.7 3.35 -0.000216196 0.000258414 0.000258414 -0.000262372 +dump_lebedeva_135.cfg:2 6.75 6.75 3.35 -0.000229538 0.000275433 0.000275433 -0.000283962 +dump_lebedeva_136.cfg:2 6.8 6.8 3.35 -0.000243758 0.000293556 0.000293556 -0.000307385 +dump_lebedeva_137.cfg:2 6.85 6.85 3.35 -0.000258913 0.000312838 0.000312838 -0.000332786 +dump_lebedeva_138.cfg:2 6.9 6.9 3.35 -0.000275062 0.000333333 0.000333333 -0.000360319 +dump_lebedeva_139.cfg:2 6.95 6.95 3.35 -0.000292267 0.000355095 0.000355095 -0.000390146 +dump_lebedeva_140.cfg:2 7 7 3.35 -0.000310593 0.000378175 0.000378175 -0.000422436 +dump_lebedeva_141.cfg:2 7.05 7.05 3.35 -0.000330108 0.000402619 0.000402619 -0.000457365 +dump_lebedeva_142.cfg:2 7.1 7.1 3.35 -0.000350879 0.000428469 0.000428469 -0.000495113 +dump_lebedeva_143.cfg:2 7.15 7.15 3.35 -0.000372979 0.000455762 0.000455762 -0.000535863 +dump_lebedeva_144.cfg:2 7.2 7.2 3.35 -0.00039648 0.000484526 0.000484526 -0.000579799 +dump_lebedeva_145.cfg:2 7.25 7.25 3.35 -0.000421456 0.000514779 0.000514779 -0.000627106 +dump_lebedeva_146.cfg:2 7.3 7.3 3.35 -0.000447982 0.000546532 0.000546532 -0.000677963 +dump_lebedeva_147.cfg:2 7.35 7.35 3.35 -0.000476134 0.000579777 0.000579777 -0.00073254 +dump_lebedeva_148.cfg:2 7.4 7.4 3.35 -0.000505985 0.000614495 0.000614495 -0.000790995 +dump_lebedeva_149.cfg:2 7.45 7.45 3.35 -0.000537607 0.000650647 0.000650647 -0.000853465 +dump_lebedeva_150.cfg:2 7.5 7.5 3.35 -0.000571072 0.00068817 0.00068817 -0.000920065 +dump_lebedeva_151.cfg:2 7.55 7.55 3.35 -0.000606446 0.000726976 0.000726976 -0.000990869 +dump_lebedeva_152.cfg:2 7.6 7.6 3.35 -0.000643789 0.000766944 0.000766944 -0.00106591 +dump_lebedeva_153.cfg:2 7.65 7.65 3.35 -0.000683157 0.000807914 0.000807914 -0.00114516 +dump_lebedeva_154.cfg:2 7.7 7.7 3.35 -0.000724594 0.000849679 0.000849679 -0.00122852 +dump_lebedeva_155.cfg:2 7.75 7.75 3.35 -0.000768134 0.000891973 0.000891973 -0.00131579 +dump_lebedeva_156.cfg:2 7.8 7.8 3.35 -0.000813794 0.000934461 0.000934461 -0.00140665 +dump_lebedeva_157.cfg:2 7.85 7.85 3.35 -0.000861576 0.000976723 0.000976723 -0.00150065 +dump_lebedeva_158.cfg:2 7.9 7.9 3.35 -0.000911454 0.00101824 0.00101824 -0.00159712 +dump_lebedeva_159.cfg:2 7.95 7.95 3.35 -0.000963377 0.00105837 0.00105837 -0.00169522 +dump_lebedeva_160.cfg:2 8 8 3.35 -0.00101726 0.00109635 0.00109635 -0.0017938 +dump_lebedeva_161.cfg:2 8.05 8.05 3.35 -0.00107296 0.00113122 0.00113122 -0.00189141 +dump_lebedeva_162.cfg:2 8.1 8.1 3.35 -0.00113031 0.00116189 0.00116189 -0.0019862 +dump_lebedeva_163.cfg:2 8.15 8.15 3.35 -0.00118906 0.00118703 0.00118703 -0.0020759 +dump_lebedeva_164.cfg:2 8.2 8.2 3.35 -0.00124889 0.00120514 0.00120514 -0.00215768 +dump_lebedeva_165.cfg:2 8.25 8.25 3.35 -0.00130942 0.00121448 0.00121448 -0.00222816 +dump_lebedeva_166.cfg:2 8.3 8.3 3.35 -0.00137016 0.0012131 0.0012131 -0.00228327 +dump_lebedeva_167.cfg:2 8.35 8.35 3.35 -0.00143052 0.00119887 0.00119887 -0.00231823 +dump_lebedeva_168.cfg:2 8.4 8.4 3.35 -0.0014898 0.00116948 0.00116948 -0.00232745 +dump_lebedeva_169.cfg:2 8.45 8.45 3.35 -0.00154717 0.0011225 0.0011225 -0.00230454 +dump_lebedeva_170.cfg:2 8.5 8.5 3.35 -0.00160171 0.00105547 0.00105547 -0.00224225 +dump_lebedeva_171.cfg:2 8.55 8.55 3.35 -0.00165235 0.000965967 0.000965967 -0.00213251 +dump_lebedeva_172.cfg:2 8.6 8.6 3.35 -0.0016979 0.000851713 0.000851713 -0.00196648 +dump_lebedeva_173.cfg:2 8.65 8.65 3.35 -0.00173707 0.000710734 0.000710734 -0.00173463 +dump_lebedeva_174.cfg:2 8.7 8.7 3.35 -0.0017685 0.000541499 0.000541499 -0.00142693 +dump_lebedeva_175.cfg:2 8.75 8.75 3.35 -0.00179074 0.000343087 0.000343087 -0.00103307 +dump_lebedeva_176.cfg:2 8.8 8.8 3.35 -0.00180232 0.000115357 0.000115357 -0.000542695 +dump_lebedeva_177.cfg:2 8.85 8.85 3.35 -0.0018018 -0.000140879 -0.000140879 5.41894e-05 +dump_lebedeva_178.cfg:2 8.9 8.9 3.35 -0.00178779 -0.000423708 -0.000423708 0.000766841 +dump_lebedeva_179.cfg:2 8.95 8.95 3.35 -0.00175903 -0.000729982 -0.000729982 0.0016033 +dump_lebedeva_180.cfg:2 9 9 3.35 -0.00171447 -0.00105523 -0.00105523 0.0025699 +dump_lebedeva_181.cfg:2 9.05 9.05 3.35 -0.00165329 -0.00139363 -0.00139363 0.0036707 +dump_lebedeva_182.cfg:2 9.1 9.1 3.35 -0.00157501 -0.00173803 -0.00173803 0.004907 +dump_lebedeva_183.cfg:2 9.15 9.15 3.35 -0.00147953 -0.00208003 -0.00208003 0.00627678 +dump_lebedeva_184.cfg:2 9.2 9.2 3.35 -0.0013672 -0.0024102 -0.0024102 0.00777429 +dump_lebedeva_185.cfg:2 9.25 9.25 3.35 -0.00123887 -0.00271832 -0.00271832 0.00938966 +dump_lebedeva_186.cfg:2 9.3 9.3 3.35 -0.00109592 -0.00299369 -0.00299369 0.0111087 +dump_lebedeva_187.cfg:2 9.35 9.35 3.35 -0.00094023 -0.00322559 -0.00322559 0.0129126 +dump_lebedeva_188.cfg:2 9.4 9.4 3.35 -0.000774254 -0.00340369 -0.00340369 0.0147786 +dump_lebedeva_189.cfg:2 9.45 9.45 3.35 -0.000600916 -0.00351856 -0.00351856 0.0166793 +dump_lebedeva_190.cfg:2 9.5 9.5 3.35 -0.000423587 -0.00356214 -0.00356214 0.0185843 +dump_lebedeva_191.cfg:2 9.55 9.55 3.35 -0.000245994 -0.00352827 -0.00352827 0.0204597 +dump_lebedeva_192.cfg:2 9.6 9.6 3.35 -7.21178e-05 -0.00341303 -0.00341303 0.0222702 +dump_lebedeva_193.cfg:2 9.65 9.65 3.35 9.39296e-05 -0.00321513 -0.00321513 0.023979 +dump_lebedeva_194.cfg:2 9.7 9.7 3.35 0.000248042 -0.00293614 -0.00293614 0.0255499 +dump_lebedeva_195.cfg:2 9.75 9.75 3.35 0.000386266 -0.00258056 -0.00258056 0.0269479 +dump_lebedeva_196.cfg:2 9.8 9.8 3.35 0.000504944 -0.0021558 -0.0021558 0.0281408 +dump_lebedeva_197.cfg:2 9.85 9.85 3.35 0.00060086 -0.00167196 -0.00167196 0.0291004 +dump_lebedeva_198.cfg:2 9.9 9.9 3.35 0.000671363 -0.00114156 -0.00114156 0.0298033 +dump_lebedeva_199.cfg:2 9.95 9.95 3.35 0.000714479 -0.000578996 -0.000578996 0.0302321 +dump_lebedeva_200.cfg:2 10 10 3.35 0.000728988 8.26726e-17 8.26726e-17 0.0303763 +dump_lebedeva_201.cfg:2 10.05 10.05 3.35 0.000714479 0.000578996 0.000578996 0.0302321 +dump_lebedeva_202.cfg:2 10.1 10.1 3.35 0.000671363 0.00114156 0.00114156 0.0298033 +dump_lebedeva_203.cfg:2 10.15 10.15 3.35 0.00060086 0.00167196 0.00167196 0.0291004 +dump_lebedeva_204.cfg:2 10.2 10.2 3.35 0.000504944 0.0021558 0.0021558 0.0281408 +dump_lebedeva_205.cfg:2 10.25 10.25 3.35 0.000386266 0.00258056 0.00258056 0.0269479 +dump_lebedeva_206.cfg:2 10.3 10.3 3.35 0.000248042 0.00293614 0.00293614 0.0255499 +dump_lebedeva_207.cfg:2 10.35 10.35 3.35 9.39296e-05 0.00321513 0.00321513 0.023979 +dump_lebedeva_208.cfg:2 10.4 10.4 3.35 -7.21178e-05 0.00341303 0.00341303 0.0222702 +dump_lebedeva_209.cfg:2 10.45 10.45 3.35 -0.000245994 0.00352827 0.00352827 0.0204597 +dump_lebedeva_210.cfg:2 10.5 10.5 3.35 -0.000423587 0.00356214 0.00356214 0.0185843 +dump_lebedeva_211.cfg:2 10.55 10.55 3.35 -0.000600916 0.00351856 0.00351856 0.0166793 +dump_lebedeva_212.cfg:2 10.6 10.6 3.35 -0.000774254 0.00340369 0.00340369 0.0147786 +dump_lebedeva_213.cfg:2 10.65 10.65 3.35 -0.00094023 0.00322559 0.00322559 0.0129126 +dump_lebedeva_214.cfg:2 10.7 10.7 3.35 -0.00109592 0.00299369 0.00299369 0.0111087 +dump_lebedeva_215.cfg:2 10.75 10.75 3.35 -0.00123887 0.00271832 0.00271832 0.00938966 +dump_lebedeva_216.cfg:2 10.8 10.8 3.35 -0.0013672 0.0024102 0.0024102 0.00777429 +dump_lebedeva_217.cfg:2 10.85 10.85 3.35 -0.00147953 0.00208003 0.00208003 0.00627678 +dump_lebedeva_218.cfg:2 10.9 10.9 3.35 -0.00157501 0.00173803 0.00173803 0.004907 +dump_lebedeva_219.cfg:2 10.95 10.95 3.35 -0.00165329 0.00139363 0.00139363 0.0036707 +dump_lebedeva_220.cfg:2 11 11 3.35 -0.00171447 0.00105523 0.00105523 0.0025699 +dump_lebedeva_221.cfg:2 11.05 11.05 3.35 -0.00175903 0.000729982 0.000729982 0.0016033 +dump_lebedeva_222.cfg:2 11.1 11.1 3.35 -0.00178779 0.000423708 0.000423708 0.000766841 +dump_lebedeva_223.cfg:2 11.15 11.15 3.35 -0.0018018 0.000140879 0.000140879 5.41894e-05 +dump_lebedeva_224.cfg:2 11.2 11.2 3.35 -0.00180232 -0.000115357 -0.000115357 -0.000542695 +dump_lebedeva_225.cfg:2 11.25 11.25 3.35 -0.00179074 -0.000343087 -0.000343087 -0.00103307 +dump_lebedeva_226.cfg:2 11.3 11.3 3.35 -0.0017685 -0.000541499 -0.000541499 -0.00142693 +dump_lebedeva_227.cfg:2 11.35 11.35 3.35 -0.00173707 -0.000710734 -0.000710734 -0.00173463 +dump_lebedeva_228.cfg:2 11.4 11.4 3.35 -0.0016979 -0.000851713 -0.000851713 -0.00196648 +dump_lebedeva_229.cfg:2 11.45 11.45 3.35 -0.00165235 -0.000965967 -0.000965967 -0.00213251 +dump_lebedeva_230.cfg:2 11.5 11.5 3.35 -0.00160171 -0.00105547 -0.00105547 -0.00224225 +dump_lebedeva_231.cfg:2 11.55 11.55 3.35 -0.00154717 -0.0011225 -0.0011225 -0.00230454 +dump_lebedeva_232.cfg:2 11.6 11.6 3.35 -0.0014898 -0.00116948 -0.00116948 -0.00232745 +dump_lebedeva_233.cfg:2 11.65 11.65 3.35 -0.00143052 -0.00119887 -0.00119887 -0.00231823 +dump_lebedeva_234.cfg:2 11.7 11.7 3.35 -0.00137016 -0.0012131 -0.0012131 -0.00228327 +dump_lebedeva_235.cfg:2 11.75 11.75 3.35 -0.00130942 -0.00121448 -0.00121448 -0.00222816 +dump_lebedeva_236.cfg:2 11.8 11.8 3.35 -0.00124889 -0.00120514 -0.00120514 -0.00215768 +dump_lebedeva_237.cfg:2 11.85 11.85 3.35 -0.00118906 -0.00118703 -0.00118703 -0.0020759 +dump_lebedeva_238.cfg:2 11.9 11.9 3.35 -0.00113031 -0.00116189 -0.00116189 -0.0019862 +dump_lebedeva_239.cfg:2 11.95 11.95 3.35 -0.00107296 -0.00113122 -0.00113122 -0.00189141 +dump_lebedeva_240.cfg:2 12 12 3.35 -0.00101726 -0.00109635 -0.00109635 -0.0017938 +dump_lebedeva_241.cfg:2 12.05 12.05 3.35 -0.000963377 -0.00105837 -0.00105837 -0.00169522 +dump_lebedeva_242.cfg:2 12.1 12.1 3.35 -0.000911454 -0.00101824 -0.00101824 -0.00159712 +dump_lebedeva_243.cfg:2 12.15 12.15 3.35 -0.000861576 -0.000976723 -0.000976723 -0.00150065 +dump_lebedeva_244.cfg:2 12.2 12.2 3.35 -0.000813794 -0.000934461 -0.000934461 -0.00140665 +dump_lebedeva_245.cfg:2 12.25 12.25 3.35 -0.000768134 -0.000891973 -0.000891973 -0.00131579 +dump_lebedeva_246.cfg:2 12.3 12.3 3.35 -0.000724594 -0.000849679 -0.000849679 -0.00122852 +dump_lebedeva_247.cfg:2 12.35 12.35 3.35 -0.000683157 -0.000807914 -0.000807914 -0.00114516 +dump_lebedeva_248.cfg:2 12.4 12.4 3.35 -0.000643789 -0.000766944 -0.000766944 -0.00106591 +dump_lebedeva_249.cfg:2 12.45 12.45 3.35 -0.000606446 -0.000726976 -0.000726976 -0.000990869 +dump_lebedeva_250.cfg:2 12.5 12.5 3.35 -0.000571072 -0.00068817 -0.00068817 -0.000920065 +dump_lebedeva_251.cfg:2 12.55 12.55 3.35 -0.000537607 -0.000650647 -0.000650647 -0.000853465 +dump_lebedeva_252.cfg:2 12.6 12.6 3.35 -0.000505985 -0.000614495 -0.000614495 -0.000790995 +dump_lebedeva_253.cfg:2 12.65 12.65 3.35 -0.000476134 -0.000579777 -0.000579777 -0.00073254 +dump_lebedeva_254.cfg:2 12.7 12.7 3.35 -0.000447982 -0.000546532 -0.000546532 -0.000677963 +dump_lebedeva_255.cfg:2 12.75 12.75 3.35 -0.000421456 -0.000514779 -0.000514779 -0.000627106 +dump_lebedeva_256.cfg:2 12.8 12.8 3.35 -0.00039648 -0.000484526 -0.000484526 -0.000579799 +dump_lebedeva_257.cfg:2 12.85 12.85 3.35 -0.000372979 -0.000455762 -0.000455762 -0.000535863 +dump_lebedeva_258.cfg:2 12.9 12.9 3.35 -0.000350879 -0.000428469 -0.000428469 -0.000495113 +dump_lebedeva_259.cfg:2 12.95 12.95 3.35 -0.000330108 -0.000402619 -0.000402619 -0.000457365 +dump_lebedeva_260.cfg:2 13 13 3.35 -0.000310593 -0.000378175 -0.000378175 -0.000422436 +dump_lebedeva_261.cfg:2 13.05 13.05 3.35 -0.000292267 -0.000355095 -0.000355095 -0.000390146 +dump_lebedeva_262.cfg:2 13.1 13.1 3.35 -0.000275062 -0.000333333 -0.000333333 -0.000360319 +dump_lebedeva_263.cfg:2 13.15 13.15 3.35 -0.000258913 -0.000312838 -0.000312838 -0.000332786 +dump_lebedeva_264.cfg:2 13.2 13.2 3.35 -0.000243758 -0.000293556 -0.000293556 -0.000307385 +dump_lebedeva_265.cfg:2 13.25 13.25 3.35 -0.000229538 -0.000275433 -0.000275433 -0.000283962 +dump_lebedeva_266.cfg:2 13.3 13.3 3.35 -0.000216196 -0.000258414 -0.000258414 -0.000262372 +dump_lebedeva_267.cfg:2 13.35 13.35 3.35 -0.000203679 -0.000242442 -0.000242442 -0.000242475 +dump_lebedeva_268.cfg:2 13.4 13.4 3.35 -0.000191936 -0.000227463 -0.000227463 -0.000224142 +dump_lebedeva_269.cfg:2 13.45 13.45 3.35 -0.000180917 -0.000213422 -0.000213422 -0.000207254 +dump_lebedeva_270.cfg:2 13.5 13.5 3.35 -0.000170579 -0.000200265 -0.000200265 -0.000191696 +dump_lebedeva_271.cfg:2 13.55 13.55 3.35 -0.000160877 -0.000187942 -0.000187942 -0.000177363 +dump_lebedeva_272.cfg:2 13.6 13.6 3.35 -0.000151771 -0.000176402 -0.000176402 -0.000164159 +dump_lebedeva_273.cfg:2 13.65 13.65 3.35 -0.000143224 -0.000165599 -0.000165599 -0.000151993 +dump_lebedeva_274.cfg:2 13.7 13.7 3.35 -0.0001352 -0.000155486 -0.000155486 -0.000140781 +dump_lebedeva_275.cfg:2 13.75 13.75 3.35 -0.000127665 -0.00014602 -0.00014602 -0.000130447 +dump_lebedeva_276.cfg:2 13.8 13.8 3.35 -0.000120588 -0.000137161 -0.000137161 -0.00012092 +dump_lebedeva_277.cfg:2 13.85 13.85 3.35 -0.000113939 -0.000128869 -0.000128869 -0.000112134 +dump_lebedeva_278.cfg:2 13.9 13.9 3.35 -0.000107692 -0.000121109 -0.000121109 -0.00010403 +dump_lebedeva_279.cfg:2 13.95 13.95 3.35 -0.00010182 -0.000113845 -0.000113845 -9.65522e-05 +dump_lebedeva_280.cfg:2 14 14 3.35 -9.62998e-05 -0.000107044 -0.000107044 -8.96501e-05 +dump_lebedeva_281.cfg:2 14.05 14.05 3.35 -9.11085e-05 -0.000100678 -0.000100678 -8.32771e-05 +dump_lebedeva_282.cfg:2 14.1 14.1 3.35 -8.62253e-05 -9.47167e-05 -9.47167e-05 -7.73906e-05 +dump_lebedeva_283.cfg:2 14.15 14.15 3.35 -8.16306e-05 -8.91338e-05 -8.91338e-05 -7.19515e-05 +dump_lebedeva_284.cfg:2 14.2 14.2 3.35 -7.7306e-05 -8.39045e-05 -8.39045e-05 -6.69239e-05 +dump_lebedeva_285.cfg:2 14.25 14.25 3.35 -7.32346e-05 -7.90054e-05 -7.90054e-05 -6.22749e-05 +dump_lebedeva_286.cfg:2 14.3 14.3 3.35 -6.94003e-05 -7.44146e-05 -7.44146e-05 -5.79742e-05 +dump_lebedeva_287.cfg:2 14.35 14.35 3.35 -6.57883e-05 -7.01119e-05 -7.01119e-05 -5.39942e-05 +dump_lebedeva_288.cfg:2 14.4 14.4 3.35 -6.23847e-05 -6.60782e-05 -6.60782e-05 -5.03095e-05 +dump_lebedeva_289.cfg:2 14.45 14.45 3.35 -5.91763e-05 -6.22957e-05 -6.22957e-05 -4.68968e-05 +dump_lebedeva_290.cfg:2 14.5 14.5 3.35 -5.61512e-05 -5.8748e-05 -5.8748e-05 -4.37346e-05 +dump_lebedeva_291.cfg:2 14.55 14.55 3.35 -5.32979e-05 -5.54196e-05 -5.54196e-05 -4.08035e-05 +dump_lebedeva_292.cfg:2 14.6 14.6 3.35 -5.06058e-05 -5.22962e-05 -5.22962e-05 -3.80853e-05 +dump_lebedeva_293.cfg:2 14.65 14.65 3.35 -4.80651e-05 -4.93643e-05 -4.93643e-05 -3.55636e-05 +dump_lebedeva_294.cfg:2 14.7 14.7 3.35 -4.56664e-05 -4.66115e-05 -4.66115e-05 -3.32231e-05 +dump_lebedeva_295.cfg:2 14.75 14.75 3.35 -4.34011e-05 -4.4026e-05 -4.4026e-05 -3.10499e-05 +dump_lebedeva_296.cfg:2 14.8 14.8 3.35 -4.12612e-05 -4.15971e-05 -4.15971e-05 -2.90313e-05 +dump_lebedeva_297.cfg:2 14.85 14.85 3.35 -3.9239e-05 -3.93146e-05 -3.93146e-05 -2.71554e-05 +dump_lebedeva_298.cfg:2 14.9 14.9 3.35 -3.73274e-05 -3.7169e-05 -3.7169e-05 -2.54115e-05 +dump_lebedeva_299.cfg:2 14.95 14.95 3.35 -3.55199e-05 -3.51516e-05 -3.51516e-05 -2.37895e-05 +dump_lebedeva_300.cfg:2 15 15 3.35 -3.38103e-05 -3.32542e-05 -3.32542e-05 -2.22803e-05 +dump_lebedeva_301.cfg:2 15.05 15.05 3.35 -3.21926e-05 -3.1469e-05 -3.1469e-05 -2.08755e-05 +dump_lebedeva_302.cfg:2 15.1 15.1 3.35 -3.06616e-05 -2.9789e-05 -2.9789e-05 -1.95673e-05 +dump_lebedeva_303.cfg:2 15.15 15.15 3.35 -2.92121e-05 -2.82074e-05 -2.82074e-05 -1.83485e-05 +dump_lebedeva_304.cfg:2 15.2 15.2 3.35 -2.78393e-05 -2.67182e-05 -2.67182e-05 -1.72127e-05 +dump_lebedeva_305.cfg:2 15.25 15.25 3.35 -2.65389e-05 -2.53153e-05 -2.53153e-05 -1.61536e-05 +dump_lebedeva_306.cfg:2 15.3 15.3 3.35 -2.53065e-05 -2.39936e-05 -2.39936e-05 -1.51657e-05 +dump_lebedeva_307.cfg:2 15.35 15.35 3.35 -2.41382e-05 -2.27478e-05 -2.27478e-05 -1.42439e-05 +dump_lebedeva_308.cfg:2 15.4 15.4 3.35 -2.30305e-05 -2.15733e-05 -2.15733e-05 -1.33834e-05 +dump_lebedeva_309.cfg:2 15.45 15.45 3.35 -2.19798e-05 -2.04656e-05 -2.04656e-05 -1.25798e-05 +dump_lebedeva_310.cfg:2 15.5 15.5 3.35 -2.09829e-05 -1.94207e-05 -1.94207e-05 -1.1829e-05 +dump_lebedeva_311.cfg:2 15.55 15.55 3.35 -2.00367e-05 -1.84346e-05 -1.84346e-05 -1.11272e-05 +dump_lebedeva_312.cfg:2 15.6 15.6 3.35 -1.91385e-05 -1.75039e-05 -1.75039e-05 -1.04711e-05 +dump_lebedeva_313.cfg:2 15.65 15.65 3.35 -1.82855e-05 -1.66251e-05 -1.66251e-05 -9.85736e-06 +dump_lebedeva_314.cfg:2 15.7 15.7 3.35 -1.74752e-05 -1.57951e-05 -1.57951e-05 -9.28307e-06 +dump_lebedeva_315.cfg:2 15.75 15.75 3.35 -1.67052e-05 -1.50109e-05 -1.50109e-05 -8.74547e-06 +dump_lebedeva_316.cfg:2 15.8 15.8 3.35 -1.59734e-05 -1.42698e-05 -1.42698e-05 -8.24204e-06 +dump_lebedeva_317.cfg:2 15.85 15.85 3.35 -1.52776e-05 -1.35692e-05 -1.35692e-05 -7.77041e-06 +dump_lebedeva_318.cfg:2 15.9 15.9 3.35 -1.46158e-05 -1.29067e-05 -1.29067e-05 -7.32841e-06 +dump_lebedeva_319.cfg:2 15.95 15.95 3.35 -1.39863e-05 -1.22801e-05 -1.22801e-05 -6.91402e-06 +dump_lebedeva_320.cfg:2 16 16 3.35 -1.33872e-05 -1.16872e-05 -1.16872e-05 -6.52537e-06 +dump_lebedeva_321.cfg:2 16.05 16.05 3.35 -1.2817e-05 -1.11261e-05 -1.11261e-05 -6.16074e-06 +dump_lebedeva_322.cfg:2 16.1 16.1 3.35 -1.22741e-05 -1.05949e-05 -1.05949e-05 -5.8185e-06 +dump_lebedeva_323.cfg:2 16.15 16.15 3.35 -1.17571e-05 -1.00918e-05 -1.00918e-05 -5.49717e-06 +dump_lebedeva_324.cfg:2 16.2 16.2 3.35 -1.12645e-05 -9.61529e-06 -9.61529e-06 -5.19536e-06 +dump_lebedeva_325.cfg:2 16.25 16.25 3.35 -1.07951e-05 -9.16377e-06 -9.16377e-06 -4.91178e-06 +dump_lebedeva_326.cfg:2 16.3 16.3 3.35 -1.03477e-05 -8.73582e-06 -8.73582e-06 -4.64524e-06 +dump_lebedeva_327.cfg:2 16.35 16.35 3.35 -9.92118e-06 -8.33009e-06 -8.33009e-06 -4.39462e-06 +dump_lebedeva_328.cfg:2 16.4 16.4 3.35 -9.51438e-06 -7.94533e-06 -7.94533e-06 -4.15889e-06 +dump_lebedeva_329.cfg:2 16.45 16.45 3.35 -9.12632e-06 -7.58035e-06 -7.58035e-06 -3.93708e-06 +dump_lebedeva_330.cfg:2 16.5 16.5 3.35 -8.75603e-06 -7.23404e-06 -7.23404e-06 -3.72831e-06 +dump_lebedeva_331.cfg:2 16.55 16.55 3.35 -8.40262e-06 -6.90535e-06 -6.90535e-06 -3.53174e-06 +dump_lebedeva_332.cfg:2 16.6 16.6 3.35 -8.06522e-06 -6.5933e-06 -6.5933e-06 -3.3466e-06 +dump_lebedeva_333.cfg:2 16.65 16.65 3.35 -7.74303e-06 -6.29696e-06 -6.29696e-06 -3.17215e-06 +dump_lebedeva_334.cfg:2 16.7 16.7 3.35 -7.43528e-06 -6.01548e-06 -6.01548e-06 -3.00774e-06 +dump_lebedeva_335.cfg:2 16.75 16.75 3.35 -7.14125e-06 -5.74802e-06 -5.74802e-06 -2.85272e-06 +dump_lebedeva_336.cfg:2 16.8 16.8 3.35 -6.86025e-06 -5.49384e-06 -5.49384e-06 -2.70652e-06 +dump_lebedeva_337.cfg:2 16.85 16.85 3.35 -6.59165e-06 -5.25219e-06 -5.25219e-06 -2.56859e-06 +dump_lebedeva_338.cfg:2 16.9 16.9 3.35 -6.33484e-06 -5.02241e-06 -5.02241e-06 -2.43842e-06 +dump_lebedeva_339.cfg:2 16.95 16.95 3.35 -6.08923e-06 -4.80386e-06 -4.80386e-06 -2.31553e-06 +dump_lebedeva_340.cfg:2 17 17 3.35 -5.85427e-06 -4.59593e-06 -4.59593e-06 -2.19948e-06 +dump_lebedeva_341.cfg:2 17.05 17.05 3.35 -5.62947e-06 -4.39805e-06 -4.39805e-06 -2.08985e-06 +dump_lebedeva_342.cfg:2 17.1 17.1 3.35 -5.41431e-06 -4.2097e-06 -4.2097e-06 -1.98627e-06 +dump_lebedeva_343.cfg:2 17.15 17.15 3.35 -5.20835e-06 -4.03036e-06 -4.03036e-06 -1.88835e-06 +dump_lebedeva_344.cfg:2 17.2 17.2 3.35 -5.01113e-06 -3.85956e-06 -3.85956e-06 -1.79577e-06 +dump_lebedeva_345.cfg:2 17.25 17.25 3.35 -4.82225e-06 -3.69686e-06 -3.69686e-06 -1.70821e-06 +dump_lebedeva_346.cfg:2 17.3 17.3 3.35 -4.64132e-06 -3.54184e-06 -3.54184e-06 -1.62536e-06 +dump_lebedeva_347.cfg:2 17.35 17.35 3.35 -4.46795e-06 -3.39408e-06 -3.39408e-06 -1.54696e-06 +dump_lebedeva_348.cfg:2 17.4 17.4 3.35 -4.30179e-06 -3.25323e-06 -3.25323e-06 -1.47275e-06 +dump_lebedeva_349.cfg:2 17.45 17.45 3.35 -4.14252e-06 -3.11892e-06 -3.11892e-06 -1.40247e-06 +dump_lebedeva_350.cfg:2 17.5 17.5 3.35 -3.9898e-06 -2.99082e-06 -2.99082e-06 -1.3359e-06 +dump_lebedeva_351.cfg:2 17.55 17.55 3.35 -3.84334e-06 -2.86861e-06 -2.86861e-06 -1.27283e-06 +dump_lebedeva_352.cfg:2 17.6 17.6 3.35 -3.70284e-06 -2.752e-06 -2.752e-06 -1.21305e-06 +dump_lebedeva_353.cfg:2 17.65 17.65 3.35 -3.56805e-06 -2.6407e-06 -2.6407e-06 -1.15638e-06 +dump_lebedeva_354.cfg:2 17.7 17.7 3.35 -3.43869e-06 -2.53444e-06 -2.53444e-06 -1.10265e-06 +dump_lebedeva_355.cfg:2 17.75 17.75 3.35 -3.31452e-06 -2.43298e-06 -2.43298e-06 -1.05167e-06 +dump_lebedeva_356.cfg:2 17.8 17.8 3.35 -3.19532e-06 -2.33607e-06 -2.33607e-06 -1.00331e-06 +dump_lebedeva_357.cfg:2 17.85 17.85 3.35 -3.08085e-06 -2.24349e-06 -2.24349e-06 -9.57413e-07 +dump_lebedeva_358.cfg:2 17.9 17.9 3.35 -2.9709e-06 -2.15503e-06 -2.15503e-06 -9.1384e-07 +dump_lebedeva_359.cfg:2 17.95 17.95 3.35 -2.86528e-06 -2.07047e-06 -2.07047e-06 -8.72464e-07 +dump_lebedeva_360.cfg:2 18 18 3.35 -2.76379e-06 -1.98965e-06 -1.98965e-06 -8.33165e-07 +dump_lebedeva_361.cfg:2 18.05 18.05 3.35 -2.66625e-06 -1.91236e-06 -1.91236e-06 -7.95827e-07 +dump_lebedeva_362.cfg:2 18.1 18.1 3.35 -2.5725e-06 -1.83844e-06 -1.83844e-06 -7.60344e-07 +dump_lebedeva_363.cfg:2 18.15 18.15 3.35 -2.48236e-06 -1.76774e-06 -1.76774e-06 -7.26615e-07 +dump_lebedeva_364.cfg:2 18.2 18.2 3.35 -2.39567e-06 -1.70008e-06 -1.70008e-06 -6.94545e-07 +dump_lebedeva_365.cfg:2 18.25 18.25 3.35 -2.3123e-06 -1.63533e-06 -1.63533e-06 -6.64045e-07 +dump_lebedeva_366.cfg:2 18.3 18.3 3.35 -2.23209e-06 -1.57336e-06 -1.57336e-06 -6.3503e-07 +dump_lebedeva_367.cfg:2 18.35 18.35 3.35 -2.15492e-06 -1.51402e-06 -1.51402e-06 -6.07422e-07 +dump_lebedeva_368.cfg:2 18.4 18.4 3.35 -2.08065e-06 -1.4572e-06 -1.4572e-06 -5.81145e-07 +dump_lebedeva_369.cfg:2 18.45 18.45 3.35 -2.00916e-06 -1.40277e-06 -1.40277e-06 -5.56129e-07 +dump_lebedeva_370.cfg:2 18.5 18.5 3.35 -1.94033e-06 -1.35063e-06 -1.35063e-06 -5.32308e-07 +dump_lebedeva_371.cfg:2 18.55 18.55 3.35 -1.87406e-06 -1.30067e-06 -1.30067e-06 -5.0962e-07 +dump_lebedeva_372.cfg:2 18.6 18.6 3.35 -1.81023e-06 -1.25279e-06 -1.25279e-06 -4.88004e-07 +dump_lebedeva_373.cfg:2 18.65 18.65 3.35 -1.74875e-06 -1.20689e-06 -1.20689e-06 -4.67407e-07 +dump_lebedeva_374.cfg:2 18.7 18.7 3.35 -1.68951e-06 -1.16288e-06 -1.16288e-06 -4.47775e-07 +dump_lebedeva_375.cfg:2 18.75 18.75 3.35 -1.63243e-06 -1.12067e-06 -1.12067e-06 -4.29058e-07 +dump_lebedeva_376.cfg:2 18.8 18.8 3.35 -1.57742e-06 -1.08019e-06 -1.08019e-06 -4.1121e-07 +dump_lebedeva_377.cfg:2 18.85 18.85 3.35 -1.52438e-06 -1.04136e-06 -1.04136e-06 -3.94187e-07 +dump_lebedeva_378.cfg:2 18.9 18.9 3.35 -1.47325e-06 -1.0041e-06 -1.0041e-06 -3.77946e-07 +dump_lebedeva_379.cfg:2 18.95 18.95 3.35 -1.42395e-06 -9.68333e-07 -9.68333e-07 -3.62449e-07 +dump_lebedeva_380.cfg:2 19 19 3.35 -1.3764e-06 -9.34005e-07 -9.34005e-07 -3.47657e-07 +dump_lebedeva_381.cfg:2 19.05 19.05 3.35 -1.33053e-06 -9.01046e-07 -9.01046e-07 -3.33537e-07 +dump_lebedeva_382.cfg:2 19.1 19.1 3.35 -1.28627e-06 -8.69398e-07 -8.69398e-07 -3.20053e-07 +dump_lebedeva_383.cfg:2 19.15 19.15 3.35 -1.24357e-06 -8.39001e-07 -8.39001e-07 -3.07175e-07 +dump_lebedeva_384.cfg:2 19.2 19.2 3.35 -1.20235e-06 -8.09802e-07 -8.09802e-07 -2.94873e-07 +dump_lebedeva_385.cfg:2 19.25 19.25 3.35 -1.16257e-06 -7.81747e-07 -7.81747e-07 -2.83119e-07 +dump_lebedeva_386.cfg:2 19.3 19.3 3.35 -1.12416e-06 -7.54787e-07 -7.54787e-07 -2.71886e-07 +dump_lebedeva_387.cfg:2 19.35 19.35 3.35 -1.08707e-06 -7.28875e-07 -7.28875e-07 -2.61148e-07 +dump_lebedeva_388.cfg:2 19.4 19.4 3.35 -1.05125e-06 -7.03966e-07 -7.03966e-07 -2.50881e-07 +dump_lebedeva_389.cfg:2 19.45 19.45 3.35 -1.01666e-06 -6.80016e-07 -6.80016e-07 -2.41064e-07 +dump_lebedeva_390.cfg:2 19.5 19.5 3.35 -9.83237e-07 -6.56984e-07 -6.56984e-07 -2.31673e-07 +dump_lebedeva_391.cfg:2 19.55 19.55 3.35 -9.50945e-07 -6.34832e-07 -6.34832e-07 -2.2269e-07 +dump_lebedeva_392.cfg:2 19.6 19.6 3.35 -9.19739e-07 -6.13522e-07 -6.13522e-07 -2.14094e-07 +dump_lebedeva_393.cfg:2 19.65 19.65 3.35 -8.89579e-07 -5.93019e-07 -5.93019e-07 -2.05867e-07 +dump_lebedeva_394.cfg:2 19.7 19.7 3.35 -8.60425e-07 -5.73288e-07 -5.73288e-07 -1.97991e-07 +dump_lebedeva_395.cfg:2 19.75 19.75 3.35 -8.32238e-07 -5.54298e-07 -5.54298e-07 -1.90451e-07 +dump_lebedeva_396.cfg:2 19.8 19.8 3.35 -8.04983e-07 -5.36017e-07 -5.36017e-07 -1.8323e-07 +dump_lebedeva_397.cfg:2 19.85 19.85 3.35 -7.78625e-07 -5.18417e-07 -5.18417e-07 -1.76314e-07 +dump_lebedeva_398.cfg:2 19.9 19.9 3.35 -7.5313e-07 -5.01468e-07 -5.01468e-07 -1.69689e-07 +dump_lebedeva_399.cfg:2 19.95 19.95 3.35 -7.28468e-07 -4.85145e-07 -4.85145e-07 -1.6334e-07 diff --git a/examples/USER/misc/lebedeva/LebDer.pl b/examples/USER/misc/lebedeva/LebDer.pl new file mode 100755 index 0000000000..5b449358d3 --- /dev/null +++ b/examples/USER/misc/lebedeva/LebDer.pl @@ -0,0 +1,90 @@ +#!/usr/bin/perl +# Computes potential energy of atom as a function of distance from another atom +# and computes numerical derivates of potential. +# The script was used to check if results from LAMMPS (using 2particles.in) +# are the same as these computed b this script. +# Prints results to STDOUT. +# Hence, use it like this: +# ./LebDer.pl > PerlResult.dat +# After that use lebedeva00.plot +# +# Author: Zbigniew Koziol, National Center for Nuclear Research, Poland +# Email: softquake@gmail.com + +# Parameters used by ZJK for Lebedeva +my $LEB_A = -14.558; +my $LEB_B = 21.204; +my $LEB_alpha = 4.16; +my $LEB_C = 1.8; +my $LEB_D1 = -0.862; +my $LEB_D2 = 0.10049; # has very strong influence on position of minimum +my $LEB_lambda1 = 0.6; # has influance on splitting of AB-AA. +my $LEB_lambda2 = 0.4; # has strong influence on position of minimum +my $LEB_z0 = 3.198; +my $LEBSCALE =1.0; + +$Z0=3.35; + +$CX0 = 10; +$CY0 = 10; + +for (my $t=0; $t<400; $t++) { + my $X0 = 0.001 + 0.05*$t; + my $Y0 = 0.001 + 0.05*$t; + my $Z = $Z0; + print $X0, "\t", $Y0, "\t", $Z, "\t",&LEB($X0, $Y0, $Z), "\t", &DLEBX($X0, $Y0, $Z),"\t",&DLEBY($X0, $Y0, $Z), "\t", &DLEBZ($X0, $Y0, $Z),"\n"; +} + +############################################################################################### + +sub LEB { + my $x = shift; + my $y = shift; + my $z = shift; + + my $rho2 = ($x-$CX0)*($x-$CX0) + ($y-$CY0)*($y-$CY0); + my $r = sqrt($rho2 + ($Z0)*($Z0)); + my $zr = ($LEB_z0/$r)*($LEB_z0/$r); + my $zr6 = $zr*$zr*$zr; + + my $ONE = $LEB_C*(1+$LEB_D1*$rho2+$LEB_D2*$rho2*$rho2); + my $TWO = exp(-$LEB_lambda1*$rho2)*exp(-$LEB_lambda2*($z*$z-$LEB_z0*$LEB_z0)); + my $U = $LEB_A*$zr6 +$LEB_B*exp(-$LEB_alpha*($r-$LEB_z0)) + $ONE*$TWO; + return $U; +} + +sub DLEBX { # finding derivative at $x + my $x = shift; + my $y = shift; + my $z = shift; + + my $h = 0.0001; + + my $D = (&LEB($x+$h, $y, $z)-&LEB($x-$h, $y, $z))/(2*$h); + + return $D; +} + +sub DLEBY { # finding derivative at $y + my $x = shift; + my $y = shift; + my $z = shift; + + my $h = 0.0001; + + my $D = (&LEB($x, $y+$h, $z)-&LEB($x, $y-$h, $z))/(2*$h); + + return $D; +} + +sub DLEBZ { # finding derivative at $z + my $x = shift; + my $y = shift; + my $z = shift; + + my $h = 0.0001; + + my $D = (&LEB($x, $y, $z+$h)-&LEB($x, $y, $z-$h))/(2*$h); + + return $D; +} diff --git a/examples/USER/misc/lebedeva/lebedeva00.plot b/examples/USER/misc/lebedeva/lebedeva00.plot new file mode 100644 index 0000000000..a598c3e6b1 --- /dev/null +++ b/examples/USER/misc/lebedeva/lebedeva00.plot @@ -0,0 +1,34 @@ +# Author: Zbigniew Koziol, National Center for Nuclear Research, Poland +# Email: softquake@gmail.com + +set term x11; +unset log +unset title +set size 1.0,1.0 + +set encoding iso_8859_1 +#set term postscript eps enhanced color "Helvetica" 18; +#set output "lebedeva00.eps" + +set zero 1e-018; + +set xlabel "x,y [{\305}]" font "Helvetica,18"; +set ylabel "U [eV/atom]" font "Helvetica,18"; + +set key font ",18" + +set key right +set key top + +set pointsize 1.2 + +set xrange [0:20] +set yrange [-0.002:0.001] +#set yrange [-0.01:0.01] +#set yrange [*:*] + +plot \ + "LamppsResult.dat" u 2:5 t "Leb LAMMPS",\ + "PerlResult.dat" u 1:($4*0.001/2.) w l t "Leb Perl" + +exit diff --git a/potentials/CC.Lebedeva b/potentials/CC.Lebedeva new file mode 100644 index 0000000000..930f7b4328 --- /dev/null +++ b/potentials/CC.Lebedeva @@ -0,0 +1,14 @@ +# Lebedeva Potential. Original values from Lebedeva. May be played with ;) +# +# Cite as: Irina V. Lebedeva, Andrey A. Knizhnik, Andrey M. Popov, Yurii E. Lozovik, Boris V. Potapkin, +# Modeling of graphene-based NEMS +# Physica E 44 (6), 949 (2012) +# https://doi.org/10.1016/j.physe.2011.07.018 +# +# Parameters must be in this order as here, otherwise their values may be changed. +# The last one, S, is convenient for scaling the potential amplitude. S is a multiplication factor for A, B, C +# A B C z0 alpha D1 D2 lambda1 lambda2 S +# These are values according to Levedeva et al +#C C 10.510 11.6523.34 35.883 3.34 4.16 -0.86232 0.10049 0.48703 0.46445 1.0 +# These are values by Z. Koziol et al.: https://arxiv.org/abs/1803.05162 +C C 14.558 21.204 1.8 3.198 4.16 -0.862 0.10049 0.6 0.4 1.0 diff --git a/src/USER-MISC/pair_lebedeva.cpp b/src/USER-MISC/pair_lebedeva.cpp new file mode 100644 index 0000000000..ed43550610 --- /dev/null +++ b/src/USER-MISC/pair_lebedeva.cpp @@ -0,0 +1,436 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Zbigniew Koziol + (National Center for Nuclear Research, Poland) + e-mail: softquake at gmail dot com + Writing this was based on C code of Kolmogorov-Crespi potential + of Jaap Kroes and others. + + This is potential described in + [Lebedeva et al., Physica E, 44(6), 949-954, 2012.] +------------------------------------------------------------------------- */ + +#include +#include +#include +#include +#include "pair_lebedeva.h" +#include "atom.h" +#include "comm.h" +#include "force.h" +#include "neigh_list.h" +#include "memory.h" +#include "error.h" + +using namespace LAMMPS_NS; + +#define MAXLINE 1024 +#define DELTA 4 + +/* ---------------------------------------------------------------------- */ + +PairLebedeva::PairLebedeva(LAMMPS *lmp) : Pair(lmp) +{ + single_enable = 0; + + // initialize element to parameter maps + nelements = 0; + elements = NULL; + nparams = maxparam = 0; + params = NULL; + elem2param = NULL; + map = NULL; + + // always compute energy offset + offset_flag = 1; +} + +/* ---------------------------------------------------------------------- */ + +PairLebedeva::~PairLebedeva() +{ + if (allocated) { + memory->destroy(setflag); + memory->destroy(cutsq); + memory->destroy(cut); + memory->destroy(offset); + } + + if (elements) + for (int i = 0; i < nelements; i++) delete [] elements[i]; + delete [] elements; + memory->destroy(params); + memory->destroy(elem2param); + if (allocated) delete [] map; +} + +/* ---------------------------------------------------------------------- */ + +void PairLebedeva::compute(int eflag, int vflag) +{ + int i,j,ii,jj,inum,jnum,itype,jtype; + double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair,der; + double rsq,r,rhosq,rho,exp1,exp2,exp3,r6,r8; + double frho,sumD,Ulm,fxy,fz,rdsq; + int *ilist,*jlist,*numneigh,**firstneigh; + + evdwl = 0.0; + if (eflag || vflag) ev_setup(eflag,vflag); + else evflag = vflag_fdotr = 0; + + double **x = atom->x; + double **f = atom->f; + int *type = atom->type; + int nlocal = atom->nlocal; + int newton_pair = force->newton_pair; + + inum = list->inum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + + // loop over neighbors of my atoms + for (ii = 0; ii < inum; ii++) { + i = ilist[ii]; + xtmp = x[i][0]; + ytmp = x[i][1]; + ztmp = x[i][2]; + itype = type[i]; + jlist = firstneigh[i]; + jnum = numneigh[i]; + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + j &= NEIGHMASK; + jtype = type[j]; + + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + // rho^2 = r^2 - z^2 + rhosq = delx*delx + dely*dely; + rho = sqrt(rhosq); + rsq = rhosq + delz*delz; + + if (rsq < cutsq[itype][jtype]) { + + int iparam_ij = elem2param[map[itype]][map[jtype]]; + Param& p = params[iparam_ij]; + + r = sqrt(rsq); + r6 = rsq*rsq*rsq; + r8 = r6*rsq; + + // store exponents + exp1 = exp(-p.alpha*(r-p.z0)); + exp2 = exp(-p.lambda1*rhosq); + exp3 = exp(-p.lambda2*(delz*delz-p.z02)); + sumD = 1+p.D1*rhosq+p.D2*rhosq*rhosq; + Ulm = -p.A*p.z06/r6+ p.B*exp1+p.C*sumD*exp2*exp3; + + // derivatives + fpair = -6.0*p.A*p.z06/r8+p.B*p.alpha*exp1/r; // used for x,y,z + der = p.D1+2*p.D2*rhosq-p.lambda1*sumD; // used for x,y + fxy = fpair - 2*p.C*exp2*exp3*der; + fz = fpair + 2*p.C*p.lambda2*sumD*exp2*exp3; + + f[i][0] += delx*fxy; + f[i][1] += dely*fxy; + f[i][2] += delz*fz; + if (newton_pair || j < nlocal) { + f[j][0] -= delx*fxy; + f[j][1] -= dely*fxy; + f[j][2] -= delz*fz; + } + + if (eflag) { + evdwl = Ulm - offset[itype][jtype]; + } + + if (evflag){ + ev_tally_xyz(i,j,nlocal,newton_pair,evdwl,0, + -fxy,-fxy,-fz,delx,dely,delz); + } + } + } + } + + if (vflag_fdotr) virial_fdotr_compute(); +} + +/* ---------------------------------------------------------------------- + allocate all arrays +------------------------------------------------------------------------- */ + +void PairLebedeva::allocate() +{ + allocated = 1; + int n = atom->ntypes; + + memory->create(setflag,n+1,n+1,"pair:setflag"); + for (int i = 1; i <= n; i++) + for (int j = i; j <= n; j++) + setflag[i][j] = 0; + + memory->create(cutsq,n+1,n+1,"pair:cutsq"); + memory->create(cut,n+1,n+1,"pair:cut"); + memory->create(offset,n+1,n+1,"pair:offset"); + map = new int[atom->ntypes+1]; +} + +/* ---------------------------------------------------------------------- + global settings +------------------------------------------------------------------------- */ + +void PairLebedeva::settings(int narg, char **arg) +{ + if (narg != 1) error->all(FLERR,"Illegal pair_style command"); + if (strcmp(force->pair_style,"hybrid/overlay")!=0) + error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); + + cut_global = force->numeric(FLERR,arg[0]); + + // reset cutoffs that have been explicitly set + + if (allocated) { + int i,j; + for (i = 1; i <= atom->ntypes; i++) + for (j = i; j <= atom->ntypes; j++) + if (setflag[i][j]) cut[i][j] = cut_global; + } +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more type pairs +------------------------------------------------------------------------- */ + +void PairLebedeva::coeff(int narg, char **arg) +{ + int i,j,n; + + if (narg != 3 + atom->ntypes) + error->all(FLERR,"Incorrect args for pair coefficients"); + if (!allocated) allocate(); + + int ilo,ihi,jlo,jhi; + force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); + force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + + // read args that map atom types to elements in potential file + // map[i] = which element the Ith atom type is, -1 if NULL + // nelements = # of unique elements + // elements = list of element names + + if (elements) { + for (i = 0; i < nelements; i++) delete [] elements[i]; + delete [] elements; + } + elements = new char*[atom->ntypes]; + for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + + nelements = 0; + for (i = 3; i < narg; i++) { + if (strcmp(arg[i],"NULL") == 0) { + map[i-2] = -1; + continue; + } + for (j = 0; j < nelements; j++) + if (strcmp(arg[i],elements[j]) == 0) break; + map[i-2] = j; + if (j == nelements) { + n = strlen(arg[i]) + 1; + elements[j] = new char[n]; + strcpy(elements[j],arg[i]); + nelements++; + } + } + + + read_file(arg[2]); + + double cut_one = cut_global; + + int count = 0; + for (int i = ilo; i <= ihi; i++) { + for (int j = MAX(jlo,i); j <= jhi; j++) { + cut[i][j] = cut_one; + setflag[i][j] = 1; + count++; + } + } + + if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); +} + + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +double PairLebedeva::init_one(int i, int j) +{ + if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); + + if (offset_flag && (cut[i][j] > 0.0)) { + int iparam_ij = elem2param[map[i]][map[j]]; + Param& p = params[iparam_ij]; + offset[i][j] = -p.A*pow(p.z0/cut[i][j],6); + } else offset[i][j] = 0.0; + offset[j][i] = offset[i][j]; + + return cut[i][j]; +} + +/* ---------------------------------------------------------------------- + read Lebedeva potential file +------------------------------------------------------------------------- */ + +void PairLebedeva::read_file(char *filename) +{ + int params_per_line = 12; + char **words = new char*[params_per_line+1]; + memory->sfree(params); + params = NULL; + nparams = maxparam = 0; + + // open file on proc 0 + + FILE *fp; + if (comm->me == 0) { + fp = force->open_potential(filename); + if (fp == NULL) { + char str[128]; + sprintf(str,"Cannot open Lebedeva potential file %s",filename); + error->one(FLERR,str); + } + } + + // read each line out of file, skipping blank lines or leading '#' + // store line of params if all 3 element tags are in element list + + int i,j,n,m,nwords,ielement,jelement; + char line[MAXLINE],*ptr; + int eof = 0; + + while (1) { + if (comm->me == 0) { + ptr = fgets(line,MAXLINE,fp); + if (ptr == NULL) { + eof = 1; + fclose(fp); + } else n = strlen(line) + 1; + } + MPI_Bcast(&eof,1,MPI_INT,0,world); + if (eof) break; + MPI_Bcast(&n,1,MPI_INT,0,world); + MPI_Bcast(line,n,MPI_CHAR,0,world); + + // strip comment, skip line if blank + + if ((ptr = strchr(line,'#'))) *ptr = '\0'; + nwords = atom->count_words(line); + if (nwords == 0) continue; + + // concatenate additional lines until have params_per_line words + + while (nwords < params_per_line) { + n = strlen(line); + if (comm->me == 0) { + ptr = fgets(&line[n],MAXLINE-n,fp); + if (ptr == NULL) { + eof = 1; + fclose(fp); + } else n = strlen(line) + 1; + } + MPI_Bcast(&eof,1,MPI_INT,0,world); + if (eof) break; + MPI_Bcast(&n,1,MPI_INT,0,world); + MPI_Bcast(line,n,MPI_CHAR,0,world); + if ((ptr = strchr(line,'#'))) *ptr = '\0'; + nwords = atom->count_words(line); + } + + if (nwords != params_per_line) + error->all(FLERR,"Insufficient format in Lebedeva potential file"); + + // words = ptrs to all words in line + + nwords = 0; + words[nwords++] = strtok(line," \t\n\r\f"); + while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + + // ielement,jelement = 1st args + // if these 2 args are in element list, then parse this line + // else skip to next line (continue) + + for (ielement = 0; ielement < nelements; ielement++) + if (strcmp(words[0],elements[ielement]) == 0) break; + if (ielement == nelements) continue; + for (jelement = 0; jelement < nelements; jelement++) + if (strcmp(words[1],elements[jelement]) == 0) break; + if (jelement == nelements) continue; + + // load up parameter settings and error check their values + + if (nparams == maxparam) { + maxparam += DELTA; + params = (Param *) memory->srealloc(params,maxparam*sizeof(Param), + "pair:params"); + } + params[nparams].ielement = ielement; + params[nparams].jelement = jelement; + params[nparams].A = atof(words[2]); + params[nparams].B = atof(words[3]); + params[nparams].C = atof(words[4]); + params[nparams].z0 = atof(words[5]); + params[nparams].alpha = atof(words[6]); + params[nparams].D1 = atof(words[7]); + params[nparams].D2 = atof(words[8]); + params[nparams].lambda1 = atof(words[9]); + params[nparams].lambda2 = atof(words[10]); + // S provides a convenient scaling of all energies + params[nparams].S = atof(words[11]); + + // energies in meV further scaled by S + double meV = 1.0e-3*params[nparams].S; + params[nparams].A *= meV; + params[nparams].B *= meV; + params[nparams].C *= meV; + + // precompute some quantities. That speeds up later process + params[nparams].z02 = pow(params[nparams].z0,2); + params[nparams].z06 = pow(params[nparams].z0,6); + + nparams++; + if(nparams >= pow(atom->ntypes,3)) break; + } + memory->destroy(elem2param); + memory->create(elem2param,nelements,nelements,"pair:elem2param"); + for (i = 0; i < nelements; i++) { + for (j = 0; j < nelements; j++) { + n = -1; + for (m = 0; m < nparams; m++) { + if (i == params[m].ielement && j == params[m].jelement) { + if (n >= 0) error->all(FLERR,"Potential file has duplicate entry"); + n = m; + } + } + if (n < 0) error->all(FLERR,"Potential file is missing an entry"); + elem2param[i][j] = n; + } + } + delete [] words; +} + +/* ---------------------------------------------------------------------- */ diff --git a/src/USER-MISC/pair_lebedeva.h b/src/USER-MISC/pair_lebedeva.h new file mode 100644 index 0000000000..6db8f66d6a --- /dev/null +++ b/src/USER-MISC/pair_lebedeva.h @@ -0,0 +1,83 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS + +PairStyle(lebedeva,PairLebedeva) + +#else + +#ifndef LMP_PAIR_Lebedeva_H +#define LMP_PAIR_Lebedeva_H + +#include "pair.h" + +namespace LAMMPS_NS { + +class PairLebedeva : public Pair { + public: + PairLebedeva(class LAMMPS *); + virtual ~PairLebedeva(); + + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + double init_one(int, int); + + protected: + int me; + + struct Param { + double z0,A,B,C,alpha,D1,D2,lambda1,lambda2,S; + double z02,z06; + int ielement,jelement; + }; + Param *params; // parameter set for I-J interactions + char **elements; // names of unique elements + int **elem2param; // mapping from element pairs to parameters + int *map; // mapping from atom types to elements + int nelements; // # of unique elements + int nparams; // # of stored parameter sets + int maxparam; // max # of parameter sets + + double cut_global; + double **cut; + double **offset; + void read_file( char * ); + void allocate(); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Incorrect args for pair coefficients + +Self-explanatory. Check the input script or data file. + +E: All pair coeffs are not set + +All pair coefficients must be set in the data file or by the +pair_coeff command before running a simulation. + +*/ + From 1616886c976de761da054fe9fb114034865f1bf9 Mon Sep 17 00:00:00 2001 From: Zbigniew Koziol Date: Wed, 28 Nov 2018 11:56:39 +0100 Subject: [PATCH 05/94] Corrected Another attempt to add Lebedeva potential --- src/USER-MISC/pair_lebedeva.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/USER-MISC/pair_lebedeva.cpp b/src/USER-MISC/pair_lebedeva.cpp index ed43550610..16305e84cd 100644 --- a/src/USER-MISC/pair_lebedeva.cpp +++ b/src/USER-MISC/pair_lebedeva.cpp @@ -22,10 +22,10 @@ [Lebedeva et al., Physica E, 44(6), 949-954, 2012.] ------------------------------------------------------------------------- */ -#include -#include -#include -#include +#include +#include +#include +#include #include "pair_lebedeva.h" #include "atom.h" #include "comm.h" From 0d9e3779b809e2a9ddbd9b3a62ae9c858f952505 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 28 Nov 2018 08:45:15 -0500 Subject: [PATCH 06/94] capitalization of pre-processor inclusion guard --- src/USER-MISC/pair_lebedeva.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/USER-MISC/pair_lebedeva.h b/src/USER-MISC/pair_lebedeva.h index 6db8f66d6a..66e759d202 100644 --- a/src/USER-MISC/pair_lebedeva.h +++ b/src/USER-MISC/pair_lebedeva.h @@ -17,8 +17,8 @@ PairStyle(lebedeva,PairLebedeva) #else -#ifndef LMP_PAIR_Lebedeva_H -#define LMP_PAIR_Lebedeva_H +#ifndef LMP_PAIR_LEBEDEVA_H +#define LMP_PAIR_LEBEDEVA_H #include "pair.h" From eda79bd1c2363f4e43f42a4600e79f85aa3f1f92 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 28 Nov 2018 20:46:50 -0500 Subject: [PATCH 07/94] use shutil.rmtree() instead of calling 'rm -rf' for increased portability --- lib/gpu/Install.py | 4 ++-- lib/kim/Install.py | 5 ++--- lib/latte/Install.py | 5 ++--- lib/mscg/Install.py | 8 +++----- lib/plumed/Install.py | 8 +++----- lib/scafacos/Install.py | 8 +++----- lib/smd/Install.py | 4 ++-- lib/voronoi/Install.py | 8 +++----- 8 files changed, 20 insertions(+), 30 deletions(-) diff --git a/lib/gpu/Install.py b/lib/gpu/Install.py index d1024c0085..14549f53b8 100644 --- a/lib/gpu/Install.py +++ b/lib/gpu/Install.py @@ -143,8 +143,8 @@ fp.close() if makeflag: print("Building libgpu.a ...") - cmd = "rm -f libgpu.a" - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + if os.path.exists("libgpu.a"): + os.remove("libgpu.a") cmd = "make -f Makefile.auto clean; make -f Makefile.auto" txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) print(txt.decode('UTF-8')) diff --git a/lib/kim/Install.py b/lib/kim/Install.py index d098250906..6cc1a1abc2 100644 --- a/lib/kim/Install.py +++ b/lib/kim/Install.py @@ -4,7 +4,7 @@ # used to automate the steps described in the README file in this dir from __future__ import print_function -import sys,os,re,subprocess +import sys,os,re,subprocess,shutil # help message @@ -177,8 +177,7 @@ if buildflag: if os.path.isdir(kimdir): print("kim-api is already installed at %s.\nRemoving it for re-install" % kimdir) - cmd = 'rm -rf "%s"' % kimdir - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + shutil.rmtree(kimdir) # configure LAMMPS to use kim-api to be installed diff --git a/lib/latte/Install.py b/lib/latte/Install.py index 1e1f3040c2..07f89e9150 100644 --- a/lib/latte/Install.py +++ b/lib/latte/Install.py @@ -4,7 +4,7 @@ # used to automate the steps described in the README file in this dir from __future__ import print_function -import sys,os,re,subprocess,hashlib +import sys,os,re,subprocess,hashlib,shutil # help message @@ -167,8 +167,7 @@ if buildflag: print("Unpacking LATTE ...") if os.path.exists(lattedir): - cmd = 'rm -rf "%s"' % lattedir - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + shutil.rmtree(lattedir) cmd = 'cd "%s"; tar zxvf LATTE.tar.gz' % lattepath subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) os.remove("%s/LATTE.tar.gz" % lattepath) diff --git a/lib/mscg/Install.py b/lib/mscg/Install.py index ec70f13f6e..d613532d39 100644 --- a/lib/mscg/Install.py +++ b/lib/mscg/Install.py @@ -4,7 +4,7 @@ # used to automate the steps described in the README file in this dir from __future__ import print_function -import sys,os,re,subprocess +import sys,os,re,subprocess,shutil # help message @@ -139,15 +139,13 @@ if buildflag: print("Unpacking MS-CG tarfile ...") if os.path.exists("%s/%s" % (homepath,tardir)): - cmd = 'rm -rf "%s/%s"' % (homepath,tardir) - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + shutil.rmtree("%s/%s" % (homepath,tardir)) cmd = 'cd "%s"; tar -xzvf %s' % (homepath,tarfile) subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) os.remove("%s/%s" % (homepath,tarfile)) if os.path.basename(homedir) != tardir: if os.path.exists(homedir): - cmd = 'rm -rf "%s"' % homedir - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + shutil.rmtree(homedir) os.rename("%s/%s" % (homepath,tardir),homedir) # build MS-CG diff --git a/lib/plumed/Install.py b/lib/plumed/Install.py index cbe3a55937..8d844678cd 100644 --- a/lib/plumed/Install.py +++ b/lib/plumed/Install.py @@ -4,7 +4,7 @@ # used to automate the steps described in the README file in this dir from __future__ import print_function -import sys,os,re,subprocess,hashlib +import sys,os,re,subprocess,hashlib,shutil # help message @@ -169,11 +169,9 @@ if buildflag: print("Unpacking plumed2 source tarball ...") if os.path.exists("%s/plumed-%s" % (homepath,version)): - cmd = 'rm -rf "%s/plumed-%s"' % (homepath,version) - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + shutil.rmtree("%s/plumed-%s" % (homepath,version)) if os.path.exists(homedir): - cmd = 'rm -rf "%s"' % (homedir) - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + shutil.rmtree(homedir) cmd = 'cd "%s"; tar -xzvf %s' % (homepath,filename) subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) os.remove("%s/%s" % (homepath,filename)) diff --git a/lib/scafacos/Install.py b/lib/scafacos/Install.py index d23e8a3686..8e342ad1ba 100644 --- a/lib/scafacos/Install.py +++ b/lib/scafacos/Install.py @@ -4,7 +4,7 @@ # used to automate the steps described in the README file in this dir from __future__ import print_function -import sys,os,re,subprocess +import sys,os,re,subprocess,shutil # help message @@ -132,15 +132,13 @@ if buildflag: print("Unpacking Scafacos tarball ...") if os.path.exists("%s/%s" % (homepath,version)): - cmd = 'rm -rf "%s/%s"' % (homepath,version) - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + shutil.rmtree("%s/%s" % (homepath,version)) cmd = 'cd "%s"; tar -xzvf %s.tar.gz' % (homepath,version) subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) os.remove("%s/%s.tar.gz" % (homepath,version)) if os.path.basename(homedir) != version: if os.path.exists(homedir): - cmd = 'rm -rf "%s"' % homedir - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + shutil.rmtree(homedir) os.rename("%s/%s" % (homepath,version),homedir) # build Scafacos diff --git a/lib/smd/Install.py b/lib/smd/Install.py index 9247cb449b..8d83b0f78a 100644 --- a/lib/smd/Install.py +++ b/lib/smd/Install.py @@ -4,7 +4,7 @@ # used to automate the steps described in the README file in this dir from __future__ import print_function -import sys,os,re,glob,subprocess +import sys,os,re,glob,subprocess,shutil # help message @@ -139,7 +139,7 @@ if buildflag: edir = glob.glob("%s/eigen-eigen-*" % homepath) for one in edir: if os.path.isdir(one): - subprocess.check_output('rm -rf "%s"' % one,stderr=subprocess.STDOUT,shell=True) + shutil.rmtree(one) cmd = 'cd "%s"; tar -xzvf %s' % (homepath,tarball) subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) edir = glob.glob("%s/eigen-eigen-*" % homepath) diff --git a/lib/voronoi/Install.py b/lib/voronoi/Install.py index f40eb53bc6..4e8b457905 100644 --- a/lib/voronoi/Install.py +++ b/lib/voronoi/Install.py @@ -4,7 +4,7 @@ # used to automate the steps described in the README file in this dir from __future__ import print_function -import sys,os,re,subprocess +import sys,os,re,subprocess,shutil # help message @@ -136,15 +136,13 @@ if buildflag: print("Unpacking Voro++ tarball ...") if os.path.exists("%s/%s" % (homepath,version)): - cmd = 'rm -rf "%s/%s"' % (homepath,version) - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + shutil.rmtree("%s/%s" % (homepath,version)) cmd = 'cd "%s"; tar -xzvf %s.tar.gz' % (homepath,version) subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) os.remove("%s/%s.tar.gz" % (homepath,version)) if os.path.basename(homedir) != version: if os.path.exists(homedir): - cmd = 'rm -rf "%s"' % homedir - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + shutil.rmtree(homedir) os.rename("%s/%s" % (homepath,version),homedir) # build Voro++ From 4e9b987fec6a04bfdf916f4b0e348a34f567d70c Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 29 Nov 2018 15:54:14 -0700 Subject: [PATCH 08/94] bug fix in original read_dump for add keep atom count --- src/read_dump.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/read_dump.cpp b/src/read_dump.cpp index 620e84e910..551cc63c9e 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -1050,12 +1050,17 @@ void ReadDump::process_atoms() } } - // if addflag = YESADD + // if addflag = YESADD or KEEPADD, update total atom count + + if (addflag == YESADD || addflag == KEEPADD) { + bigint nblocal = atom->nlocal; + MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); + } + + // if addflag = YESADD, // assign consistent IDs to new snapshot atoms across all procs if (addflag == YESADD) { - bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (atom->natoms < 0 || atom->natoms >= MAXBIGINT) error->all(FLERR,"Too many total atoms"); if (atom->tag_enable) atom->tag_extend(); @@ -1069,7 +1074,6 @@ void ReadDump::process_atoms() memory->destroy(updateflag); memory->destroy(newflag); - } /* ---------------------------------------------------------------------- From 53e66dcd154d17c3887ba224ae1f0f6abfa97356 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Fri, 30 Nov 2018 22:35:10 -0700 Subject: [PATCH 09/94] bond/react: delete atoms allows deleting of a user-specified set of atoms, based on topology --- doc/src/fix_bond_react.txt | 33 ++++++++---- src/USER-MISC/fix_bond_react.cpp | 88 ++++++++++++++++++++++++++++++++ src/USER-MISC/fix_bond_react.h | 4 +- 3 files changed, 114 insertions(+), 11 deletions(-) diff --git a/doc/src/fix_bond_react.txt b/doc/src/fix_bond_react.txt index b62bf68a75..e55e06b7d2 100644 --- a/doc/src/fix_bond_react.txt +++ b/doc/src/fix_bond_react.txt @@ -70,7 +70,8 @@ changes will be referred to as 'reactions' throughout this documentation. Topology changes are defined in pre- and post-reaction molecule templates and can include creation and deletion of bonds, angles, dihedrals, impropers, bond-types, angle-types, dihedral-types, -atom-types, or atomic charges. +atom-types, or atomic charges. In addition, reaction by-products or +other molecules can be identified and deleted. Fix bond/react does not use quantum mechanical (eg. fix qmmm) or pairwise bond-order potential (eg. Tersoff or AIREBO) methods to @@ -79,7 +80,7 @@ probabilistic criteria to effect predetermined topology changes in simulations using standard force fields. This fix was created to facilitate the dynamic creation of polymeric, -amorphous or highly cross-linked systems. A suggested workflow for +amorphous or highly-crosslinked systems. A suggested workflow for using this fix is: 1) identify a reaction to be simulated 2) build a molecule template of the reaction site before the reaction has occurred 3) build a molecule template of the reaction site after the @@ -203,15 +204,16 @@ A discussion of correctly handling this is also provided on the The map file is a text document with the following format: A map file has a header and a body. The header of map file the -contains one mandatory keyword and two optional keywords. The +contains one mandatory keyword and three optional keywords. The mandatory keyword is 'equivalences' and the optional keywords are -'edgeIDs' and 'customIDs': +'edgeIDs' and 'deleteIDs' and 'customIDs': N {equivalences} = # of atoms N in the reaction molecule templates N {edgeIDs} = # of edge atoms N in the pre-reacted molecule template +N {deleteIDs} = # of atoms N that are specified for deletion N {customIDs} = # of atoms N that are specified for a custom update :pre -The body of the map file contains two mandatory sections and two +The body of the map file contains two mandatory sections and three optional sections. The first mandatory section begins with the keyword 'BondingIDs' and lists the atom IDs of the bonding atom pair in the pre-reacted molecule template. The second mandatory section begins @@ -222,10 +224,12 @@ second column is the corresponding atom ID of the post-reacted molecule template. The first optional section begins with the keyword 'EdgeIDs' and lists the atom IDs of edge atoms in the pre-reacted molecule template. The second optional section begins with the keyword -'Custom Edges' and allows for forcing the update of a specific atom's -atomic charge. The first column is the ID of an atom near the edge of -the pre-reacted molecule template, and the value of the second column -is either 'none' or 'charges.' Further details are provided in the +'DeleteIDs' and lists the atom IDs of pre-reaction template atoms to +delete. The third optional section begins with the keyword 'Custom +Edges' and allows for forcing the update of a specific atom's atomic +charge. The first column is the ID of an atom near the edge of the +pre-reacted molecule template, and the value of the second column is +either 'none' or 'charges.' Further details are provided in the discussion of the 'update_edges' keyword. A sample map file is given below: @@ -309,7 +313,16 @@ edge are unaffected by this setting. A few other considerations: -It may be beneficial to ensure reacting atoms are at a certain +Many reactions result in one or more atoms that are considered +unwanted by-products. Therefore, bond/react provides the option to +delete a user-specified set of atoms. These pre-reaction atoms are +identified in the map file. A deleted atom must still be included in +the post-reaction molecule template, in which it cannot be bonded to +an undeleted atom. In addition to deleting unwanted reaction +by-products, this feature can be used to remove specific topologies, +such as small rings, that may be otherwise indistinguishable. + +Also, it may be beneficial to ensure reacting atoms are at a certain temperature before being released to the overall thermostat. For this, you can use the internally-created dynamic group named "bond_react_MASTER_group." For example, adding the following command diff --git a/src/USER-MISC/fix_bond_react.cpp b/src/USER-MISC/fix_bond_react.cpp index 394be64460..b06f40c3f3 100644 --- a/src/USER-MISC/fix_bond_react.cpp +++ b/src/USER-MISC/fix_bond_react.cpp @@ -275,12 +275,14 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(edge,max_natoms,nreacts,"bond/react:edge"); memory->create(landlocked_atoms,max_natoms,nreacts,"bond/react:landlocked_atoms"); memory->create(custom_edges,max_natoms,nreacts,"bond/react:custom_edges"); + memory->create(delete_atoms,max_natoms,nreacts,"bond/react:delete_atoms"); for (int j = 0; j < nreacts; j++) for (int i = 0; i < max_natoms; i++) { edge[i][j] = 0; if (update_edges_flag[j] == 1) custom_edges[i][j] = 1; else custom_edges[i][j] = 0; + delete_atoms[i][j] = 0; } // read all map files afterward @@ -393,6 +395,7 @@ FixBondReact::~FixBondReact() memory->destroy(equivalences); memory->destroy(reverse_equiv); memory->destroy(custom_edges); + memory->destroy(delete_atoms); memory->destroy(nevery); memory->destroy(cutsq); @@ -2053,6 +2056,13 @@ void FixBondReact::update_everything() tagint **bond_atom = atom->bond_atom; int *num_bond = atom->num_bond; + // used when deleting atoms + int ndel,ndelone; + int *mark = new int[nlocal]; + for (int i = 0; i < nlocal; i++) mark[i] = 0; + tagint *tag = atom->tag; + AtomVec *avec = atom->avec; + // update atom->nbonds, etc. // TODO: correctly tally with 'newton off' int delta_bonds = 0; @@ -2086,6 +2096,18 @@ void FixBondReact::update_everything() } } + // mark to-delete atoms + for (int i = 0; i < update_num_mega; i++) { + rxnID = update_mega_glove[0][i]; + onemol = atom->molecules[unreacted_mol[rxnID]]; + for (int j = 0; j < onemol->natoms; j++) { + int iatom = atom->map(update_mega_glove[j+1][i]); + if (delete_atoms[j][rxnID] == 1 && iatom >= 0 && iatom < nlocal) { + mark[iatom] = 1; + } + } + } + // update charges and types of landlocked atoms for (int i = 0; i < update_num_mega; i++) { rxnID = update_mega_glove[0][i]; @@ -2486,6 +2508,59 @@ void FixBondReact::update_everything() memory->destroy(update_mega_glove); + // delete atoms. taken from fix_evaporate. but don't think it needs to be in pre_exchange + // loop in reverse order to avoid copying marked atoms + ndel = ndelone = 0; + for (int i = atom->nlocal-1; i >= 0; i--) { + if (mark[i] == 1) { + avec->copy(atom->nlocal-1,i,1); + atom->nlocal--; + ndelone++; + + if (atom->avec->bonds_allow) { + if (force->newton_bond) delta_bonds += atom->num_bond[i]; + else { + for (int j = 0; j < atom->num_bond[i]; j++) { + if (tag[i] < atom->bond_atom[i][j]) delta_bonds++; + } + } + } + if (atom->avec->angles_allow) { + if (force->newton_bond) delta_angle += atom->num_angle[i]; + else { + for (int j = 0; j < atom->num_angle[i]; j++) { + int m = atom->map(atom->angle_atom2[i][j]); + if (m >= 0 && m < nlocal) delta_angle++; + } + } + } + if (atom->avec->dihedrals_allow) { + if (force->newton_bond) delta_dihed += atom->num_dihedral[i]; + else { + for (int j = 0; j < atom->num_dihedral[i]; j++) { + int m = atom->map(atom->dihedral_atom2[i][j]); + if (m >= 0 && m < nlocal) delta_dihed++; + } + } + } + if (atom->avec->impropers_allow) { + if (force->newton_bond) delta_imprp += atom->num_improper[i]; + else { + for (int j = 0; j < atom->num_improper[i]; j++) { + int m = atom->map(atom->improper_atom2[i][j]); + if (m >= 0 && m < nlocal) delta_imprp; + } + } + } + } + } + delete [] mark; + + MPI_Allreduce(&ndelone,&ndel,1,MPI_INT,MPI_SUM,world); + + atom->natoms -= ndel; + // done deleting atoms + // something to think about: this could done much more concisely if // all atom-level info (bond,angles, etc...) were kinda inherited from a common data struct --JG @@ -2536,6 +2611,7 @@ void FixBondReact::read(int myrxn) if (strstr(line,"edgeIDs")) sscanf(line,"%d",&nedge); else if (strstr(line,"equivalences")) sscanf(line,"%d",&nequivalent); else if (strstr(line,"customIDs")) sscanf(line,"%d",&ncustom); + else if (strstr(line,"deleteIDs")) sscanf(line,"%d",&ndelete); else break; } @@ -2565,6 +2641,8 @@ void FixBondReact::read(int myrxn) } else if (strcmp(keyword,"Custom Edges") == 0) { customedgesflag = 1; CustomEdges(line, myrxn); + } else if (strcmp(keyword,"DeleteIDs") == 0) { + DeleteAtoms(line, myrxn); } else error->one(FLERR,"Unknown section in superimpose file"); parse_keyword(1,line,keyword); @@ -2630,6 +2708,16 @@ void FixBondReact::CustomEdges(char *line, int myrxn) delete [] edgemode; } +void FixBondReact::DeleteAtoms(char *line, int myrxn) +{ + int tmp; + for (int i = 0; i < ndelete; i++) { + readline(line); + sscanf(line,"%d",&tmp); + delete_atoms[tmp-1][myrxn] = 1; + } +} + void FixBondReact::open(char *file) { fp = fopen(file,"r"); diff --git a/src/USER-MISC/fix_bond_react.h b/src/USER-MISC/fix_bond_react.h index d54ab7c385..d6e7b785e7 100644 --- a/src/USER-MISC/fix_bond_react.h +++ b/src/USER-MISC/fix_bond_react.h @@ -101,7 +101,7 @@ class FixBondReact : public Fix { int *ibonding,*jbonding; int *closeneigh; // indicates if bonding atoms of a rxn are 1-2, 1-3, or 1-4 neighbors - int nedge,nequivalent,ncustom; // number of edge, equivalent, custom atoms in mapping file + int nedge,nequivalent,ncustom,ndelete; // number of edge, equivalent, custom atoms in mapping file int attempted_rxn; // there was an attempt! int *local_rxn_count; int *ghostly_rxn_count; @@ -116,6 +116,7 @@ class FixBondReact : public Fix { int ***reverse_equiv; // re-ordered equivalences int **landlocked_atoms; // all atoms at least three bonds away from edge atoms int **custom_edges; // atoms in molecule templates with incorrect valences + int **delete_atoms; // atoms in pre-reacted templates to delete int **nxspecial,**onemol_nxspecial,**twomol_nxspecial; // full number of 1-4 neighbors tagint **xspecial,**onemol_xspecial,**twomol_xspecial; // full 1-4 neighbor list @@ -138,6 +139,7 @@ class FixBondReact : public Fix { void EdgeIDs(char *,int); void Equivalences(char *,int); void CustomEdges(char *,int); + void DeleteAtoms(char *,int); void make_a_guess (); void neighbor_loop(); From d14404254e8dcd1ef1f2884463c073cd0412a870 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sat, 1 Dec 2018 15:18:11 -0700 Subject: [PATCH 10/94] check for illegally deleted atoms --- src/USER-MISC/fix_bond_react.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/USER-MISC/fix_bond_react.cpp b/src/USER-MISC/fix_bond_react.cpp index b06f40c3f3..50efca8d09 100644 --- a/src/USER-MISC/fix_bond_react.cpp +++ b/src/USER-MISC/fix_bond_react.cpp @@ -1653,6 +1653,18 @@ void FixBondReact::find_landlocked_atoms(int myrxn) } } + // additionally, if a deleted atom is bonded to a undeleted atom, bad + for (int i = 0; i < onemol->natoms; i++) { + if (delete_atoms[i][myrxn] == 1) { + int ii = reverse_equiv[i][1][myrxn] - 1; + for (int j = 0; j < twomol_nxspecial[ii][0]; j++) { + if (delete_atoms[equivalences[twomol_xspecial[ii][j]-1][1][myrxn]-1][myrxn] == 0) { + error->one(FLERR,"A deleted atom cannot be bonded to an undeleted atom"); + } + } + } + } + // also, if atoms change number of bonds, but aren't landlocked, that could be bad if (me == 0) for (int i = 0; i < twomol->natoms; i++) { From ac51d0fb89fce09519c5a2ccda394ab3b2a66455 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 3 Dec 2018 15:32:43 -0500 Subject: [PATCH 11/94] remove old versions of read_dump and rerun w/o parallel reading support --- src/read_dump2.cpp | 1011 -------------------------------------------- src/read_dump2.h | 172 -------- src/rerun2.cpp | 193 --------- src/rerun2.h | 59 --- 4 files changed, 1435 deletions(-) delete mode 100644 src/read_dump2.cpp delete mode 100644 src/read_dump2.h delete mode 100644 src/rerun2.cpp delete mode 100644 src/rerun2.h diff --git a/src/read_dump2.cpp b/src/read_dump2.cpp deleted file mode 100644 index 37bc3e3589..0000000000 --- a/src/read_dump2.cpp +++ /dev/null @@ -1,1011 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -/* ---------------------------------------------------------------------- - Contributing author: Timothy Sirk (ARL) -------------------------------------------------------------------------- */ - -// lmptype.h must be first b/c this file uses MAXBIGINT and includes mpi.h -// due to OpenMPI bug which sets INT64_MAX via its mpi.h -// before lmptype.h can set flags to insure it is done correctly - -#include "lmptype.h" -#include -#include -#include -#include "read_dump2.h" -#include "reader.h" -#include "style_reader.h" -#include "atom.h" -#include "atom_vec.h" -#include "update.h" -#include "modify.h" -#include "fix.h" -#include "compute.h" -#include "domain.h" -#include "comm.h" -#include "force.h" -#include "irregular.h" -#include "input.h" -#include "variable.h" -#include "error.h" -#include "memory.h" - -using namespace LAMMPS_NS; - -#define CHUNK 16384 - -// also in reader_native.cpp - -enum{ID,TYPE,X,Y,Z,VX,VY,VZ,Q,IX,IY,IZ,FX,FY,FZ}; -enum{UNSET,NOSCALE_NOWRAP,NOSCALE_WRAP,SCALE_NOWRAP,SCALE_WRAP}; -enum{NOADD,YESADD,KEEPADD}; - -/* ---------------------------------------------------------------------- */ - -ReadDump2::ReadDump2(LAMMPS *lmp) : Pointers(lmp) -{ - MPI_Comm_rank(world,&me); - MPI_Comm_size(world,&nprocs); - - dimension = domain->dimension; - triclinic = domain->triclinic; - - nfile = 0; - files = NULL; - - nfield = 0; - fieldtype = NULL; - fieldlabel = NULL; - fields = NULL; - - int n = strlen("native") + 1; - readerstyle = new char[n]; - strcpy(readerstyle,"native"); - - reader = NULL; - fp = NULL; -} - -/* ---------------------------------------------------------------------- */ - -ReadDump2::~ReadDump2() -{ - for (int i = 0; i < nfile; i++) delete [] files[i]; - delete [] files; - for (int i = 0; i < nfield; i++) delete [] fieldlabel[i]; - delete [] fieldlabel; - delete [] fieldtype; - delete [] readerstyle; - - memory->destroy(fields); - delete reader; -} - -/* ---------------------------------------------------------------------- */ - -void ReadDump2::command(int narg, char **arg) -{ - if (domain->box_exist == 0) - error->all(FLERR,"Read_dump command before simulation box is defined"); - - if (narg < 2) error->all(FLERR,"Illegal read_dump command"); - - store_files(1,&arg[0]); - bigint nstep = force->bnumeric(FLERR,arg[1]); - - int nremain = narg - 2; - if (nremain) nremain = fields_and_keywords(nremain,&arg[narg-nremain]); - else nremain = fields_and_keywords(0,NULL); - if (nremain) setup_reader(nremain,&arg[narg-nremain]); - else setup_reader(0,NULL); - - // find the snapshot and read/bcast/process header info - - if (me == 0 && screen) fprintf(screen,"Scanning dump file ...\n"); - - bigint ntimestep = seek(nstep,1); - if (ntimestep < 0) - error->all(FLERR,"Dump file does not contain requested snapshot"); - header(1); - - // reset timestep to nstep - - update->reset_timestep(nstep); - - // counters - - // read in the snapshot and reset system - - if (me == 0 && screen) - fprintf(screen,"Reading snapshot from dump file ...\n"); - - bigint natoms_prev = atom->natoms; - atoms(); - - if (me == 0) reader->close_file(); - - // print out stats - - bigint npurge_all,nreplace_all,ntrim_all,nadd_all; - - bigint tmp; - tmp = npurge; - MPI_Allreduce(&tmp,&npurge_all,1,MPI_LMP_BIGINT,MPI_SUM,world); - tmp = nreplace; - MPI_Allreduce(&tmp,&nreplace_all,1,MPI_LMP_BIGINT,MPI_SUM,world); - tmp = ntrim; - MPI_Allreduce(&tmp,&ntrim_all,1,MPI_LMP_BIGINT,MPI_SUM,world); - tmp = nadd; - MPI_Allreduce(&tmp,&nadd_all,1,MPI_LMP_BIGINT,MPI_SUM,world); - - domain->print_box(" "); - - if (me == 0) { - if (screen) { - fprintf(screen," " BIGINT_FORMAT " atoms before read\n",natoms_prev); - fprintf(screen," " BIGINT_FORMAT " atoms in snapshot\n",nsnapatoms); - fprintf(screen," " BIGINT_FORMAT " atoms purged\n",npurge_all); - fprintf(screen," " BIGINT_FORMAT " atoms replaced\n",nreplace_all); - fprintf(screen," " BIGINT_FORMAT " atoms trimmed\n",ntrim_all); - fprintf(screen," " BIGINT_FORMAT " atoms added\n",nadd_all); - fprintf(screen," " BIGINT_FORMAT " atoms after read\n",atom->natoms); - } - if (logfile) { - fprintf(logfile," " BIGINT_FORMAT " atoms before read\n",natoms_prev); - fprintf(logfile," " BIGINT_FORMAT " atoms in snapshot\n",nsnapatoms); - fprintf(logfile," " BIGINT_FORMAT " atoms purged\n",npurge_all); - fprintf(logfile," " BIGINT_FORMAT " atoms replaced\n",nreplace_all); - fprintf(logfile," " BIGINT_FORMAT " atoms trimmed\n",ntrim_all); - fprintf(logfile," " BIGINT_FORMAT " atoms added\n",nadd_all); - fprintf(logfile," " BIGINT_FORMAT " atoms after read\n",atom->natoms); - } - } -} - -/* ---------------------------------------------------------------------- */ - -void ReadDump2::store_files(int nstr, char **str) -{ - nfile = nstr; - files = new char*[nfile]; - - for (int i = 0; i < nfile; i++) { - int n = strlen(str[i]) + 1; - files[i] = new char[n]; - strcpy(files[i],str[i]); - } -} - -/* ---------------------------------------------------------------------- */ - -void ReadDump2::setup_reader(int narg, char **arg) -{ - // allocate snapshot field buffer - - memory->create(fields,CHUNK,nfield,"read_dump:fields"); - - // create reader class - // match readerstyle to options in style_reader.h - - if (0) return; // dummy line to enable else-if macro expansion - -#define READER_CLASS -#define ReaderStyle(key,Class) \ - else if (strcmp(readerstyle,#key) == 0) reader = new Class(lmp); -#include "style_reader.h" -#undef READER_CLASS - - // unrecognized style - - else error->all(FLERR,"Unknown dump reader style"); - - // pass any arguments to reader - - if (narg > 0) reader->settings(narg,arg); -} - -/* ---------------------------------------------------------------------- - seek Nrequest timestep in one or more dump files - if exact = 1, must find exactly Nrequest - if exact = 0, find first step >= Nrequest - return matching ntimestep or -1 if did not find a match -------------------------------------------------------------------------- */ - -bigint ReadDump2::seek(bigint nrequest, int exact) -{ - int ifile,eofflag; - bigint ntimestep; - - if (me == 0) { - - // exit file loop when dump timestep >= nrequest - // or files exhausted - - for (ifile = 0; ifile < nfile; ifile++) { - ntimestep = -1; - reader->open_file(files[ifile]); - while (1) { - eofflag = reader->read_time(ntimestep); - if (eofflag) break; - if (ntimestep >= nrequest) break; - reader->skip(); - } - if (ntimestep >= nrequest) break; - reader->close_file(); - } - - currentfile = ifile; - if (ntimestep < nrequest) ntimestep = -1; - if (exact && ntimestep != nrequest) ntimestep = -1; - if (ntimestep < 0) reader->close_file(); - } - - MPI_Bcast(&ntimestep,1,MPI_LMP_BIGINT,0,world); - return ntimestep; -} - -/* ---------------------------------------------------------------------- - find next matching snapshot in one or more dump files - Ncurrent = current timestep from last snapshot - Nlast = match no timestep bigger than Nlast - Nevery = only match timesteps that are a multiple of Nevery - Nskip = skip every this many timesteps - return matching ntimestep or -1 if did not find a match -------------------------------------------------------------------------- */ - -bigint ReadDump2::next(bigint ncurrent, bigint nlast, int nevery, int nskip) -{ - int ifile,eofflag; - bigint ntimestep; - - if (me == 0) { - - // exit file loop when dump timestep matches all criteria - // or files exhausted - - int iskip = 0; - - for (ifile = currentfile; ifile < nfile; ifile++) { - ntimestep = -1; - if (ifile != currentfile) reader->open_file(files[ifile]); - while (1) { - eofflag = reader->read_time(ntimestep); - - // new code logic to match new parallel read_dump - if (eofflag) break; - if (ntimestep > nlast) break; - if (ntimestep <= ncurrent) { - reader->skip(); - continue; - } - if (iskip == nskip) iskip = 0; - iskip++; - if (nevery && ntimestep % nevery) reader->skip(); - else if (iskip < nskip) reader->skip(); - else break; - - // old code logic - //if (iskip == nskip) iskip = 0; - //iskip++; - //if (eofflag) break; - //if (ntimestep <= ncurrent) break; - //if (ntimestep > nlast) break; - //if (nevery && ntimestep % nevery) reader->skip(); - //else if (iskip < nskip) reader->skip(); - //else break; - } - if (eofflag) reader->close_file(); - else break; - } - - currentfile = ifile; - if (eofflag) ntimestep = -1; - if (ntimestep <= ncurrent) ntimestep = -1; - if (ntimestep > nlast) ntimestep = -1; - if (ntimestep < 0) reader->close_file(); - } - - MPI_Bcast(&ntimestep,1,MPI_LMP_BIGINT,0,world); - return ntimestep; -} - -/* ---------------------------------------------------------------------- - read and broadcast and store snapshot header info - set nsnapatoms = # of atoms in snapshot -------------------------------------------------------------------------- */ - -void ReadDump2::header(int fieldinfo) -{ - int triclinic_snap; - int fieldflag,xflag,yflag,zflag; - - if (me == 0) - nsnapatoms = reader->read_header(box,triclinic_snap, - fieldinfo,nfield,fieldtype,fieldlabel, - scaleflag,wrapflag,fieldflag, - xflag,yflag,zflag); - - MPI_Bcast(&nsnapatoms,1,MPI_LMP_BIGINT,0,world); - MPI_Bcast(&triclinic_snap,1,MPI_INT,0,world); - MPI_Bcast(&box[0][0],9,MPI_DOUBLE,0,world); - - // local copy of snapshot box parameters - // used in xfield,yfield,zfield when converting dump atom to absolute coords - - xlo = box[0][0]; - xhi = box[0][1]; - ylo = box[1][0]; - yhi = box[1][1]; - zlo = box[2][0]; - zhi = box[2][1]; - if (triclinic_snap) { - xy = box[0][2]; - xz = box[1][2]; - yz = box[2][2]; - double xdelta = MIN(0.0,xy); - xdelta = MIN(xdelta,xz); - xdelta = MIN(xdelta,xy+xz); - xlo = xlo - xdelta; - xdelta = MAX(0.0,xy); - xdelta = MAX(xdelta,xz); - xdelta = MAX(xdelta,xy+xz); - xhi = xhi - xdelta; - ylo = ylo - MIN(0.0,yz); - yhi = yhi - MAX(0.0,yz); - } - xprd = xhi - xlo; - yprd = yhi - ylo; - zprd = zhi - zlo; - - // done if not checking fields - - if (!fieldinfo) return; - - MPI_Bcast(&fieldflag,1,MPI_INT,0,world); - MPI_Bcast(&xflag,1,MPI_INT,0,world); - MPI_Bcast(&yflag,1,MPI_INT,0,world); - MPI_Bcast(&zflag,1,MPI_INT,0,world); - - // error check on current vs new box and fields - // triclinic_snap < 0 means no box info in file - - if (triclinic_snap < 0 && boxflag > 0) - error->all(FLERR,"No box information in dump, must use 'box no'"); - if (triclinic_snap >= 0) { - if ((triclinic_snap && !triclinic) || - (!triclinic_snap && triclinic)) - error->one(FLERR,"Read_dump triclinic status does not match simulation"); - } - - // error check on requested fields exisiting in dump file - - if (fieldflag < 0) - error->one(FLERR,"Read_dump field not found in dump file"); - - // all explicitly requested x,y,z must have consistent scaling & wrapping - - int value = MAX(xflag,yflag); - value = MAX(zflag,value); - if ((xflag != UNSET && xflag != value) || - (yflag != UNSET && yflag != value) || - (zflag != UNSET && zflag != value)) - error->one(FLERR, - "Read_dump xyz fields do not have consistent scaling/wrapping"); - - // set scaled/wrapped based on xyz flags - - value = UNSET; - if (xflag != UNSET) value = xflag; - if (yflag != UNSET) value = yflag; - if (zflag != UNSET) value = zflag; - - if (value == UNSET) { - scaled = wrapped = 0; - } else if (value == NOSCALE_NOWRAP) { - scaled = wrapped = 0; - } else if (value == NOSCALE_WRAP) { - scaled = 0; - wrapped = 1; - } else if (value == SCALE_NOWRAP) { - scaled = 1; - wrapped = 0; - } else if (value == SCALE_WRAP) { - scaled = wrapped = 1; - } - - // scaled, triclinic coords require all 3 x,y,z fields, to perform unscaling - // set yindex,zindex = column index of Y and Z fields in fields array - // needed for unscaling to absolute coords in xfield(), yfield(), zfield() - - if (scaled && triclinic == 1) { - int flag = 0; - if (xflag == UNSET) flag = 1; - if (yflag == UNSET) flag = 1; - if (dimension == 3 && zflag == UNSET) flag = 1; - if (flag) - error->one(FLERR,"All read_dump x,y,z fields must be specified for " - "scaled, triclinic coords"); - - for (int i = 0; i < nfield; i++) { - if (fieldtype[i] == Y) yindex = i; - if (fieldtype[i] == Z) zindex = i; - } - } -} - -/* ---------------------------------------------------------------------- */ - -void ReadDump2::atoms() -{ - // initialize counters - - npurge = nreplace = ntrim = nadd = 0; - - // if purgeflag set, delete all current atoms - - if (purgeflag) { - if (atom->map_style) atom->map_clear(); - npurge = atom->nlocal; - atom->nlocal = atom->nghost = 0; - atom->natoms = 0; - } - - // to match existing atoms to dump atoms: - // must build map if not a molecular system - - int mapflag = 0; - if (atom->map_style == 0) { - mapflag = 1; - atom->map_init(); - atom->map_set(); - } - - // uflag[i] = 1 for each owned atom appearing in dump - // ucflag = similar flag for each chunk atom, used in process_atoms() - - int nlocal = atom->nlocal; - memory->create(uflag,nlocal,"read_dump:uflag"); - for (int i = 0; i < nlocal; i++) uflag[i] = 0; - memory->create(ucflag,CHUNK,"read_dump:ucflag"); - memory->create(ucflag_all,CHUNK,"read_dump:ucflag"); - - // read, broadcast, and process atoms from snapshot in chunks - - addproc = -1; - - int nchunk; - bigint nread = 0; - while (nread < nsnapatoms) { - nchunk = MIN(nsnapatoms-nread,CHUNK); - if (me == 0) reader->read_atoms(nchunk,nfield,fields); - MPI_Bcast(&fields[0][0],nchunk*nfield,MPI_DOUBLE,0,world); - process_atoms(nchunk); - nread += nchunk; - } - - // if addflag = YESADD, assign IDs to new snapshot atoms - - if (addflag == YESADD) { - bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); - if (atom->natoms < 0 || atom->natoms >= MAXBIGINT) - error->all(FLERR,"Too many total atoms"); - if (atom->tag_enable) atom->tag_extend(); - } - - // if trimflag set, delete atoms not replaced by snapshot atoms - - if (trimflag) { - delete_atoms(); - bigint nblocal = atom->nlocal; - MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); - } - - // can now delete uflag arrays - - memory->destroy(uflag); - memory->destroy(ucflag); - memory->destroy(ucflag_all); - - // delete atom map if created it above - // else reinitialize map for current atoms - // do this before migrating atoms to new procs via Irregular - - if (mapflag) { - atom->map_delete(); - atom->map_style = 0; - } else { - atom->nghost = 0; - atom->map_init(); - atom->map_set(); - } - - // overwrite simulation box with dump snapshot box if requested - // reallocate processors to box - - if (boxflag) { - domain->boxlo[0] = xlo; - domain->boxhi[0] = xhi; - domain->boxlo[1] = ylo; - domain->boxhi[1] = yhi; - if (dimension == 3) { - domain->boxlo[2] = zlo; - domain->boxhi[2] = zhi; - } - if (triclinic) { - domain->xy = xy; - if (dimension == 3) { - domain->xz = xz; - domain->yz = yz; - } - } - - domain->set_initial_box(); - domain->set_global_box(); - comm->set_proc_grid(0); - domain->set_local_box(); - } - - // move atoms back inside simulation box and to new processors - // use remap() instead of pbc() in case atoms moved a long distance - // adjust image flags of all atoms (old and new) based on current box - // use irregular() in case atoms moved a long distance - - double **x = atom->x; - imageint *image = atom->image; - nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) domain->remap(x[i],image[i]); - - if (triclinic) domain->x2lamda(atom->nlocal); - domain->reset_box(); - Irregular *irregular = new Irregular(lmp); - irregular->migrate_atoms(1); - delete irregular; - if (triclinic) domain->lamda2x(atom->nlocal); - - // check that atom IDs are valid - - atom->tag_check(); -} - -/* ---------------------------------------------------------------------- - process arg list for dump file fields and optional keywords -------------------------------------------------------------------------- */ - -int ReadDump2::fields_and_keywords(int narg, char **arg) -{ - // per-field vectors, leave space for ID and TYPE - - fieldtype = new int[narg+2]; - fieldlabel = new char*[narg+2]; - - // add id and type fields as needed - // scan ahead to see if "add yes/keep" keyword/value is used - // requires extra "type" field from from dump file - - int iarg; - for (iarg = 0; iarg < narg; iarg++) - if (strcmp(arg[iarg],"add") == 0) - if (iarg < narg-1 && (strcmp(arg[iarg+1],"yes") == 0 || - strcmp(arg[iarg+1],"keep") == 0)) break; - - nfield = 0; - fieldtype[nfield++] = ID; - if (iarg < narg) fieldtype[nfield++] = TYPE; - - // parse fields - - iarg = 0; - while (iarg < narg) { - int type = whichtype(arg[iarg]); - if (type < 0) break; - if (type == Q && !atom->q_flag) - error->all(FLERR,"Read dump of atom property that isn't allocated"); - fieldtype[nfield++] = type; - iarg++; - } - - // check for no fields - - if (fieldtype[nfield-1] == ID || fieldtype[nfield-1] == TYPE) - error->all(FLERR,"Illegal read_dump command"); - - if (dimension == 2) { - for (int i = 0; i < nfield; i++) - if (fieldtype[i] == Z || fieldtype[i] == VZ || - fieldtype[i] == IZ || fieldtype[i] == FZ) - error->all(FLERR,"Illegal read_dump command"); - } - - for (int i = 0; i < nfield; i++) - for (int j = i+1; j < nfield; j++) - if (fieldtype[i] == fieldtype[j]) - error->all(FLERR,"Duplicate fields in read_dump command"); - - // parse optional args - - boxflag = 1; - replaceflag = 1; - purgeflag = 0; - trimflag = 0; - addflag = NOADD; - for (int i = 0; i < nfield; i++) fieldlabel[i] = NULL; - scaleflag = 0; - wrapflag = 1; - - while (iarg < narg) { - if (strcmp(arg[iarg],"box") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) boxflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) boxflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"replace") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) replaceflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) replaceflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"purge") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) purgeflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) purgeflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"trim") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) trimflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) trimflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"add") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) addflag = YESADD; - else if (strcmp(arg[iarg+1],"no") == 0) addflag = NOADD; - else if (strcmp(arg[iarg+1],"keep") == 0) addflag = KEEPADD; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"label") == 0) { - if (iarg+3 > narg) error->all(FLERR,"Illegal read_dump command"); - int type = whichtype(arg[iarg+1]); - int i; - for (i = 0; i < nfield; i++) - if (type == fieldtype[i]) break; - if (i == nfield) error->all(FLERR,"Illegal read_dump command"); - int n = strlen(arg[iarg+2]) + 1; - fieldlabel[i] = new char[n]; - strcpy(fieldlabel[i],arg[iarg+2]); - iarg += 3; - } else if (strcmp(arg[iarg],"scaled") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) scaleflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) scaleflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"wrapped") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - if (strcmp(arg[iarg+1],"yes") == 0) wrapflag = 1; - else if (strcmp(arg[iarg+1],"no") == 0) wrapflag = 0; - else error->all(FLERR,"Illegal read_dump command"); - iarg += 2; - } else if (strcmp(arg[iarg],"format") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - delete [] readerstyle; - int n = strlen(arg[iarg+1]) + 1; - readerstyle = new char[n]; - strcpy(readerstyle,arg[iarg+1]); - iarg += 2; - break; - } else error->all(FLERR,"Illegal read_dump command"); - } - - if (purgeflag && (replaceflag || trimflag)) - error->all(FLERR,"If read_dump purges it cannot replace or trim"); - if (addflag == KEEPADD && atom->tag_enable == 0) - error->all(FLERR,"Read_dump cannot use 'add keep' without atom IDs"); - - return narg-iarg; -} - -/* ---------------------------------------------------------------------- - check if str is a field argument - if yes, return index of which - if not, return -1 -------------------------------------------------------------------------- */ - -int ReadDump2::whichtype(char *str) -{ - int type = -1; - if (strcmp(str,"id") == 0) type = ID; - else if (strcmp(str,"type") == 0) type = TYPE; - else if (strcmp(str,"x") == 0) type = X; - else if (strcmp(str,"y") == 0) type = Y; - else if (strcmp(str,"z") == 0) type = Z; - else if (strcmp(str,"vx") == 0) type = VX; - else if (strcmp(str,"vy") == 0) type = VY; - else if (strcmp(str,"vz") == 0) type = VZ; - else if (strcmp(str,"q") == 0) type = Q; - else if (strcmp(str,"ix") == 0) type = IX; - else if (strcmp(str,"iy") == 0) type = IY; - else if (strcmp(str,"iz") == 0) type = IZ; - else if (strcmp(str,"fx") == 0) type = FX; - else if (strcmp(str,"fy") == 0) type = FY; - else if (strcmp(str,"fz") == 0) type = FZ; - return type; -} - -/* ---------------------------------------------------------------------- - process each of N atoms in chunk read from dump file - if in replace mode and atom ID matches current atom, - overwrite atom info with fields from dump file - if in add mode and atom ID does not match any current atom, - create new atom with dump file field values, - and assign to a proc in round-robin manner - use round-robin method, b/c atom coords may not be inside simulation box -------------------------------------------------------------------------- */ - -void ReadDump2::process_atoms(int n) -{ - int i,m,ifield,itype; - int xbox,ybox,zbox; - tagint mtag; - - double **x = atom->x; - double **v = atom->v; - double *q = atom->q; - double **f = atom->f; - tagint *tag = atom->tag; - imageint *image = atom->image; - int nlocal = atom->nlocal; - tagint map_tag_max = atom->map_tag_max; - - for (i = 0; i < n; i++) { - ucflag[i] = 0; - - // check if new atom matches one I own - // setting m = -1 forces new atom not to match - // NOTE: atom ID in fields is stored as double, not as ubuf - // so can only cast it to tagint, thus cannot be full 64-bit ID - - mtag = static_cast (fields[i][0]); - if (mtag <= map_tag_max) m = atom->map(mtag); - else m = -1; - if (m < 0 || m >= nlocal) continue; - - ucflag[i] = 1; - uflag[m] = 1; - - if (replaceflag) { - nreplace++; - - // current image flags - - xbox = (image[m] & IMGMASK) - IMGMAX; - ybox = (image[m] >> IMGBITS & IMGMASK) - IMGMAX; - zbox = (image[m] >> IMG2BITS) - IMGMAX; - - // overwrite atom attributes with field info - // start from field 1 since 0 = id, 1 will be skipped if type - - for (ifield = 1; ifield < nfield; ifield++) { - switch (fieldtype[ifield]) { - case X: - x[m][0] = xfield(i,ifield); - break; - case Y: - x[m][1] = yfield(i,ifield); - break; - case Z: - x[m][2] = zfield(i,ifield); - break; - case VX: - v[m][0] = fields[i][ifield]; - break; - case Q: - q[m] = fields[i][ifield]; - break; - case VY: - v[m][1] = fields[i][ifield]; - break; - case VZ: - v[m][2] = fields[i][ifield]; - break; - case IX: - xbox = static_cast (fields[i][ifield]); - break; - case IY: - ybox = static_cast (fields[i][ifield]); - break; - case IZ: - zbox = static_cast (fields[i][ifield]); - break; - case FX: - f[m][0] = fields[i][ifield]; - break; - case FY: - f[m][1] = fields[i][ifield]; - break; - case FZ: - f[m][2] = fields[i][ifield]; - break; - } - } - - // replace image flag in case changed by ix,iy,iz fields or unwrapping - - if (!wrapped) xbox = ybox = zbox = 0; - - image[m] = ((imageint) (xbox + IMGMAX) & IMGMASK) | - (((imageint) (ybox + IMGMAX) & IMGMASK) << IMGBITS) | - (((imageint) (zbox + IMGMAX) & IMGMASK) << IMG2BITS); - } - } - - // create any atoms in chunk that no processor owned - // add atoms in round-robin sequence on processors - // cannot do it geometrically b/c dump coords may not be in simulation box - // check that dump file snapshot has atom type field - - if (addflag == NOADD) return; - - int tflag = 0; - for (ifield = 0; ifield < nfield; ifield++) - if (fieldtype[ifield] == TYPE) tflag = 1; - if (!tflag) - error->all(FLERR,"Cannot add atoms if dump file does not store atom type"); - - MPI_Allreduce(ucflag,ucflag_all,n,MPI_INT,MPI_SUM,world); - - int nlocal_previous = atom->nlocal; - double one[3]; - - for (i = 0; i < n; i++) { - if (ucflag_all[i]) continue; - - // each processor adds every Pth atom - - addproc++; - if (addproc == nprocs) addproc = 0; - if (addproc != me) continue; - - // create type and coord fields from dump file - // coord = 0.0 unless corresponding dump file field was specified - - itype = 0; - one[0] = one[1] = one[2] = 0.0; - for (ifield = 1; ifield < nfield; ifield++) { - switch (fieldtype[ifield]) { - case TYPE: - itype = static_cast (fields[i][ifield]); - break; - case X: - one[0] = xfield(i,ifield); - break; - case Y: - one[1] = yfield(i,ifield); - break; - case Z: - one[2] = zfield(i,ifield); - break; - } - } - - // create the atom on proc that owns it - // reset v,image ptrs in case they are reallocated - - m = atom->nlocal; - atom->avec->create_atom(itype,one); - nadd++; - - tag = atom->tag; - v = atom->v; - q = atom->q; - image = atom->image; - - // set atom attributes from other dump file fields - - xbox = ybox = zbox = 0; - - for (ifield = 0; ifield < nfield; ifield++) { - switch (fieldtype[ifield]) { - case ID: - if (addflag == KEEPADD) - tag[m] = static_cast (fields[i][ifield]); - break; - case VX: - v[m][0] = fields[i][ifield]; - break; - case VY: - v[m][1] = fields[i][ifield]; - break; - case VZ: - v[m][2] = fields[i][ifield]; - break; - case Q: - q[m] = fields[i][ifield]; - break; - case IX: - xbox = static_cast (fields[i][ifield]); - break; - case IY: - ybox = static_cast (fields[i][ifield]); - break; - case IZ: - zbox = static_cast (fields[i][ifield]); - break; - } - - // replace image flag in case changed by ix,iy,iz fields - - image[m] = ((imageint) (xbox + IMGMAX) & IMGMASK) | - (((imageint) (ybox + IMGMAX) & IMGMASK) << IMGBITS) | - (((imageint) (zbox + IMGMAX) & IMGMASK) << IMG2BITS); - } - } - - // init per-atom fix/compute/variable values for created atoms - - atom->data_fix_compute_variable(nlocal_previous,atom->nlocal); -} - -/* ---------------------------------------------------------------------- - delete atoms not flagged as replaced by dump atoms -------------------------------------------------------------------------- */ - -void ReadDump2::delete_atoms() -{ - AtomVec *avec = atom->avec; - int nlocal = atom->nlocal; - - int i = 0; - while (i < nlocal) { - if (uflag[i] == 0) { - avec->copy(nlocal-1,i,1); - uflag[i] = uflag[nlocal-1]; - nlocal--; - ntrim++; - } else i++; - } - - atom->nlocal = nlocal; -} - -/* ---------------------------------------------------------------------- - convert XYZ fields in dump file into absolute, unscaled coordinates - depends on scaled vs unscaled and triclinic vs orthogonal - does not depend on wrapped vs unwrapped -------------------------------------------------------------------------- */ - -double ReadDump2::xfield(int i, int j) -{ - if (!scaled) return fields[i][j]; - else if (!triclinic) return fields[i][j]*xprd + xlo; - else if (dimension == 2) - return xprd*fields[i][j] + xy*fields[i][yindex] + xlo; - return xprd*fields[i][j] + xy*fields[i][yindex] + xz*fields[i][zindex] + xlo; -} - -double ReadDump2::yfield(int i, int j) -{ - if (!scaled) return fields[i][j]; - else if (!triclinic) return fields[i][j]*yprd + ylo; - else if (dimension == 2) return yprd*fields[i][j] + ylo; - return yprd*fields[i][j] + yz*fields[i][zindex] + ylo; -} - -double ReadDump2::zfield(int i, int j) -{ - if (!scaled) return fields[i][j]; - return fields[i][j]*zprd + zlo; -} diff --git a/src/read_dump2.h b/src/read_dump2.h deleted file mode 100644 index 27105860f5..0000000000 --- a/src/read_dump2.h +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. - - Contributed by Timothy Sirk -------------------------------------------------------------------------- */ - -#ifdef COMMAND_CLASS - -CommandStyle(read_dump2,ReadDump2) - -#else - -#ifndef LMP_READ_DUMP2_H -#define LMP_READ_DUMP2_H - -#include -#include "pointers.h" - -namespace LAMMPS_NS { - -class ReadDump2 : protected Pointers { - public: - ReadDump2(class LAMMPS *); - ~ReadDump2(); - void command(int, char **); - - void store_files(int, char **); - void setup_reader(int, char **); - bigint seek(bigint, int); - void header(int); - bigint next(bigint, bigint, int, int); - void atoms(); - int fields_and_keywords(int, char **); - -private: - int me,nprocs; - FILE *fp; - - int dimension; - int triclinic; - - int nfile; // # of dump files to process - char **files; // list of file names - int currentfile; // currently open file - - int boxflag; // overwrite simulation with dump file box params - int replaceflag,addflag; // flags for processing dump snapshot atoms - int trimflag,purgeflag; - int scaleflag; // user 0/1 if dump file coords are unscaled/scaled - int wrapflag; // user 0/1 if dump file coords are unwrapped/wrapped - char *readerstyle; // style of dump files to read - - int nfield; // # of fields to extract from dump file - int *fieldtype; // type of each field = X,VY,IZ,etc - char **fieldlabel; // user specified label for field - double **fields; // per-atom field values - - int scaled; // 0/1 if dump file coords are unscaled/scaled - int wrapped; // 0/1 if dump file coords are unwrapped/wrapped - - double box[3][3]; // dump file box parameters - double xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz; // dump snapshot box params - double xprd,yprd,zprd; - - bigint nsnapatoms; // # of atoms in dump file shapshot - - int npurge,nreplace,ntrim,nadd; // stats on processed atoms - int addproc; // proc that should add next atom - int yindex,zindex; // field index for Y,Z coords - - int *uflag; // set to 1 if snapshot atom matches owned atom - int *ucflag,*ucflag_all; // set to 1 if snapshot chunk atom was processed - - class Reader *reader; // class that reads dump file - - int whichtype(char *); - void process_atoms(int); - void delete_atoms(); - - double xfield(int, int); - double yfield(int, int); - double zfield(int, int); -}; - -} - -#endif -#endif - -/* ERROR/WARNING messages: - -E: Read_dump command before simulation box is defined - -The read_dump command cannot be used before a read_data, read_restart, -or create_box command. - -E: Illegal ... command - -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. - -E: Dump file does not contain requested snapshot - -Self-explanatory. - -E: Unknown dump reader style - -The choice of dump reader style via the format keyword is unknown. - -E: No box information in dump, must use 'box no' - -UNDOCUMENTED - -E: Read_dump triclinic status does not match simulation - -Both the dump snapshot and the current LAMMPS simulation must -be using either an orthogonal or triclinic box. - -E: Read_dump field not found in dump file - -Self-explanatory. - -E: Read_dump xyz fields do not have consistent scaling/wrapping - -Self-explanatory. - -E: All read_dump x,y,z fields must be specified for scaled, triclinic coords - -For triclinic boxes and scaled coordinates you must specify all 3 of -the x,y,z fields, else LAMMPS cannot reconstruct the unscaled -coordinates. - -E: Too many total atoms - -See the setting for bigint in the src/lmptype.h file. - -E: Read dump of atom property that isn't allocated - -Self-explanatory. - -E: Duplicate fields in read_dump command - -Self-explanatory. - -E: If read_dump purges it cannot replace or trim - -These operations are not compatible. See the read_dump doc -page for details. - -E: Read_dump cannot use 'add keep' without atom IDs - -UNDOCUMENTED - -E: Cannot add atoms if dump file does not store atom type - -UNDOCUMENTED - -U: No box information in dump. You have to use 'box no' - -Self-explanatory. - -*/ diff --git a/src/rerun2.cpp b/src/rerun2.cpp deleted file mode 100644 index 1747f63b97..0000000000 --- a/src/rerun2.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#include -#include -#include "rerun2.h" -#include "read_dump2.h" -#include "domain.h" -#include "update.h" -#include "integrate.h" -#include "modify.h" -#include "output.h" -#include "finish.h" -#include "timer.h" -#include "error.h" -#include "force.h" - -using namespace LAMMPS_NS; - -/* ---------------------------------------------------------------------- */ - -Rerun2::Rerun2(LAMMPS *lmp) : Pointers(lmp) {} - -/* ---------------------------------------------------------------------- */ - -void Rerun2::command(int narg, char **arg) -{ - if (domain->box_exist == 0) - error->all(FLERR,"Rerun command before simulation box is defined"); - - if (narg < 2) error->all(FLERR,"Illegal rerun command"); - - // list of dump files = args until a keyword - - int iarg = 0; - while (iarg < narg) { - if (strcmp(arg[iarg],"first") == 0) break; - if (strcmp(arg[iarg],"last") == 0) break; - if (strcmp(arg[iarg],"every") == 0) break; - if (strcmp(arg[iarg],"skip") == 0) break; - if (strcmp(arg[iarg],"start") == 0) break; - if (strcmp(arg[iarg],"stop") == 0) break; - if (strcmp(arg[iarg],"dump") == 0) break; - iarg++; - } - int nfile = iarg; - if (nfile == 0 || nfile == narg) error->all(FLERR,"Illegal rerun command"); - - // parse optional args up until "dump" - // use MAXBIGINT -1 so Output can add 1 to it and still be a big int - - bigint first = 0; - bigint last = MAXBIGINT - 1; - int nevery = 0; - int nskip = 1; - int startflag = 0; - int stopflag = 0; - bigint start = -1; - bigint stop = -1; - - while (iarg < narg) { - if (strcmp(arg[iarg],"first") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - first = force->bnumeric(FLERR,arg[iarg+1]); - if (first < 0) error->all(FLERR,"Illegal rerun command"); - iarg += 2; - } else if (strcmp(arg[iarg],"last") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - last = force->bnumeric(FLERR,arg[iarg+1]); - if (last < 0) error->all(FLERR,"Illegal rerun command"); - iarg += 2; - } else if (strcmp(arg[iarg],"every") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - nevery = force->inumeric(FLERR,arg[iarg+1]); - if (nevery < 0) error->all(FLERR,"Illegal rerun command"); - iarg += 2; - } else if (strcmp(arg[iarg],"skip") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - nskip = force->inumeric(FLERR,arg[iarg+1]); - if (nskip <= 0) error->all(FLERR,"Illegal rerun command"); - iarg += 2; - } else if (strcmp(arg[iarg],"start") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - startflag = 1; - start = force->bnumeric(FLERR,arg[iarg+1]); - if (start < 0) error->all(FLERR,"Illegal rerun command"); - iarg += 2; - } else if (strcmp(arg[iarg],"stop") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - stopflag = 1; - stop = force->bnumeric(FLERR,arg[iarg+1]); - if (stop < 0) error->all(FLERR,"Illegal rerun command"); - iarg += 2; - } else if (strcmp(arg[iarg],"dump") == 0) { - break; - } else error->all(FLERR,"Illegal rerun command"); - } - - int nremain = narg - iarg - 1; - if (nremain <= 0) error->all(FLERR,"Illegal rerun command"); - if (first > last) error->all(FLERR,"Illegal rerun command"); - if (startflag && stopflag && start > stop) - error->all(FLERR,"Illegal rerun command"); - - // pass list of filenames to ReadDump - // along with post-"dump" args and post-"format" args - - ReadDump2 *rd = new ReadDump2(lmp); - - rd->store_files(nfile,arg); - if (nremain) - nremain = rd->fields_and_keywords(nremain,&arg[narg-nremain]); - else nremain = rd->fields_and_keywords(0,NULL); - if (nremain) rd->setup_reader(nremain,&arg[narg-nremain]); - else rd->setup_reader(0,NULL); - - // perform the pseudo run - // invoke lmp->init() only once - // read all relevant snapshots - // use setup_minimal() since atoms are already owned by correct procs - // addstep_compute_all() insures energy/virial computed on every snapshot - - update->whichflag = 1; - - if (startflag) update->beginstep = update->firststep = start; - else update->beginstep = update->firststep = first; - if (stopflag) update->endstep = update->laststep = stop; - else update->endstep = update->laststep = last; - - int firstflag = 1; - int ndump = 0; - - lmp->init(); - - timer->init(); - timer->barrier_start(); - - bigint ntimestep = rd->seek(first,0); - if (ntimestep < 0) - error->all(FLERR,"Rerun dump file does not contain requested snapshot"); - - while (1) { - ndump++; - rd->header(firstflag); - update->reset_timestep(ntimestep); - rd->atoms(); - modify->init(); - update->integrate->setup_minimal(1); - modify->end_of_step(); - if (firstflag) output->setup(); - else if (output->next) output->write(ntimestep); - - firstflag = 0; - ntimestep = rd->next(ntimestep,last,nevery,nskip); - if (stopflag && ntimestep > stop) - error->all(FLERR,"Read rerun dump file timestep > specified stop"); - if (ntimestep < 0) break; - } - - // insure thermo output on last dump timestep - - output->next_thermo = update->ntimestep; - output->write(update->ntimestep); - - timer->barrier_stop(); - - update->integrate->cleanup(); - - // set update->nsteps to ndump for Finish stats to print - - update->nsteps = ndump; - - Finish finish(lmp); - finish.end(1); - - update->whichflag = 0; - update->firststep = update->laststep = 0; - update->beginstep = update->endstep = 0; - - // clean-up - - delete rd; -} diff --git a/src/rerun2.h b/src/rerun2.h deleted file mode 100644 index fa4e2c49a6..0000000000 --- a/src/rerun2.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifdef COMMAND_CLASS - -CommandStyle(rerun2,Rerun2) - -#else - -#ifndef LMP_RERUN2_H -#define LMP_RERUN2_H - -#include "pointers.h" - -namespace LAMMPS_NS { - -class Rerun2 : protected Pointers { - public: - Rerun2(class LAMMPS *); - void command(int, char **); -}; - -} - -#endif -#endif - -/* ERROR/WARNING messages: - -E: Rerun command before simulation box is defined - -The rerun command cannot be used before a read_data, read_restart, or -create_box command. - -E: Illegal ... command - -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. - -E: Rerun dump file does not contain requested snapshot - -Self-explanatory. - -E: Read rerun dump file timestep > specified stop - -Self-explanatory. - -*/ From aeb7854aca2d1adcdf491eab74102a1f157dad62 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 3 Dec 2018 16:11:39 -0500 Subject: [PATCH 12/94] update false positives list for newly added documentation --- doc/utils/sphinx-config/false_positives.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index de60206304..790261eb66 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1271,6 +1271,7 @@ Klapp Kloss kmax Kmax +Knizhnik knl Kohlmeyer Kohn @@ -1343,6 +1344,7 @@ lcbop ld ldfftw ldg +Lebedeva Lebold Lechman Lehoucq @@ -1438,6 +1440,7 @@ Lorant lorenz lossless lossy +Lozovik lps lpsapi lrt @@ -2087,6 +2090,7 @@ pos Poschel posix Postma +Potapkin potin Pourtois powderblue From a0bd1bd755cc36938bf02ad64d8552dc6d800ddf Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 3 Dec 2018 16:12:32 -0500 Subject: [PATCH 13/94] fix typo --- doc/src/rerun.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/rerun.txt b/doc/src/rerun.txt index 08a5698615..2b893eff1f 100644 --- a/doc/src/rerun.txt +++ b/doc/src/rerun.txt @@ -193,7 +193,7 @@ specified frequency, e.g. every N steps. If the timestep for a dump snapshot is not a multiple of N, then it will be read and processed, but no output will be produced. If you want output for every dump snapshot, you can simply use N=1 for an output frequency, e.g. for -thermodyanmic output or new dump file output. +thermodynamic output or new dump file output. :line From ee82143a29f3dae74621b584075cf28c414afeb6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 3 Dec 2018 16:21:18 -0500 Subject: [PATCH 14/94] more false positives to handle --- doc/utils/sphinx-config/false_positives.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 790261eb66..6d9a76d40c 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1345,6 +1345,7 @@ ld ldfftw ldg Lebedeva +lebedeva Lebold Lechman Lehoucq @@ -2084,6 +2085,7 @@ polydisperse polydispersity polyhedra popen +Popov popstore Poresag pos From e5c555fa7d2eead153d43845cf4d9a4d2e3fa692 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 3 Dec 2018 17:50:20 -0500 Subject: [PATCH 15/94] consolidate shared code from various Install.py files into install_helpers.py --- lib/Install.py | 45 ++----- lib/colvars/Install.py | 34 +++-- lib/colvars/Makefile.deps | 234 ----------------------------------- lib/gpu/Install.py | 37 +++--- lib/gpu/Makefile.linux | 2 +- lib/gpu/Makefile.linux_multi | 9 +- lib/install_helpers.py | 99 +++++++++++++++ lib/latte/Install.py | 86 +++---------- lib/message/Install.py | 44 ++----- lib/mscg/Install.py | 72 ++--------- lib/smd/Install.py | 62 +--------- lib/voronoi/Install.py | 70 ++--------- 12 files changed, 204 insertions(+), 590 deletions(-) create mode 100644 lib/install_helpers.py diff --git a/lib/Install.py b/lib/Install.py index d30cbffcf1..e1e6fc9a0a 100644 --- a/lib/Install.py +++ b/lib/Install.py @@ -6,34 +6,8 @@ from __future__ import print_function import sys,os,subprocess - -# help message - -help = """ -Syntax from src dir: make lib-libname args="-m machine -e suffix" -Syntax from lib dir: python Install.py -m machine -e suffix - -libname = name of lib dir (e.g. atc, h5md, meam, poems, etc) -specify -m and optionally -e, order does not matter - - -m = peform a clean followed by "make -f Makefile.machine" - machine = suffix of a lib/Makefile.* file - -e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix - does not alter existing Makefile.machine - -Examples: - -make lib-poems args="-m serial" # build POEMS lib with same settings as in the serial Makefile in src -make lib-colvars args="-m mpi" # build USER-COLVARS lib with same settings as in the mpi Makefile in src -make lib-meam args="-m ifort" # build MEAM lib with custom Makefile.ifort (using Intel Fortran) -""" - -# print error message or help - -def error(str=None): - if not str: print(help) - else: print("ERROR",str) - sys.exit() +sys.path.append('..') +from install_helpers import error,get_cpus # parse args @@ -83,17 +57,16 @@ for line in lines: fp.close() # make the library via Makefile.auto optionally with parallel make - -try: - import multiprocessing - n_cpus = multiprocessing.cpu_count() -except: - n_cpus = 1 +n_cpus = get_cpus() print("Building lib%s.a ..." % lib) cmd = "make -f Makefile.auto clean; make -f Makefile.auto -j%d" % n_cpus -txt = subprocess.check_output(cmd,shell=True,stderr=subprocess.STDOUT) -print(txt.decode('UTF-8')) +try: + txt = subprocess.check_output(cmd,shell=True,stderr=subprocess.STDOUT) + print(txt.decode('UTF-8')) +except subprocess.CalledProcessError as e: + print("Make failed with:\n %s" % e.output.decode('UTF-8')) + sys.exit(1) if os.path.exists("lib%s.a" % lib): print("Build was successful") else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib)) diff --git a/lib/colvars/Install.py b/lib/colvars/Install.py index 030644ceb5..a17c5bab5e 100644 --- a/lib/colvars/Install.py +++ b/lib/colvars/Install.py @@ -4,6 +4,8 @@ from __future__ import print_function import sys,os,subprocess +sys.path.append('..') +from install_helpers import error,get_cpus # help message @@ -24,18 +26,11 @@ Examples: make lib-colvars args="-m mpi" # build COLVARS lib with default mpi compiler wrapper """ -# print error message or help - -def error(str=None): - if not str: print(help) - else: print("ERROR",str) - sys.exit() - # parse args args = sys.argv[1:] nargs = len(args) -if nargs == 0: error() +if nargs == 0: error(help=help) machine = None extraflag = False @@ -43,15 +38,15 @@ extraflag = False iarg = 0 while iarg < nargs: if args[iarg] == "-m": - if iarg+2 > len(args): error() + if iarg+2 > len(args): error(help=help) machine = args[iarg+1] iarg += 2 elif args[iarg] == "-e": - if iarg+2 > len(args): error() + if iarg+2 > len(args): error(help=help) extraflag = True suffix = args[iarg+1] iarg += 2 - else: error() + else: error(help=help) # set lib from working dir @@ -124,17 +119,16 @@ fp.close() # make the library via Makefile.auto optionally with parallel make -try: - import multiprocessing - n_cpus = multiprocessing.cpu_count() -except: - n_cpus = 1 +n_cpus = get_cpus() print("Building lib%s.a ..." % lib) -cmd = ["make -f Makefile.auto clean"] -print(subprocess.check_output(cmd, shell=True).decode('UTF-8')) -cmd = ["make -f Makefile.auto -j%d" % n_cpus] -print(subprocess.check_output(cmd, shell=True).decode('UTF-8')) +cmd = ["make -f Makefile.auto clearn; make -f Makefile.auto -j%d" % n_cpus] +try: + txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True); + print(txt.decode('UTF-8')) +except subprocess.CalledProcessError as e: + print("Make failed with:\n %s" % e.output.decode('UTF-8')) + sys.exit(1) if os.path.exists("lib%s.a" % lib): print("Build was successful") else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib)) diff --git a/lib/colvars/Makefile.deps b/lib/colvars/Makefile.deps index a0d8515bc1..8b13789179 100644 --- a/lib/colvars/Makefile.deps +++ b/lib/colvars/Makefile.deps @@ -1,235 +1 @@ -$(COLVARS_OBJ_DIR)colvaratoms.o: colvaratoms.cpp colvarmodule.h \ - colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \ - colvarparse.h colvaratoms.h colvardeps.h -$(COLVARS_OBJ_DIR)colvarbias_abf.o: colvarbias_abf.cpp colvarmodule.h \ - colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvar.h \ - colvarparse.h colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarbias_abf.h colvarbias.h colvargrid.h colvar_UIestimator.h -$(COLVARS_OBJ_DIR)colvarbias_alb.o: colvarbias_alb.cpp colvarmodule.h \ - colvars_version.h colvarbias.h colvar.h colvarvalue.h colvartypes.h \ - colvarparse.h colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarbias_alb.h -$(COLVARS_OBJ_DIR)colvarbias.o: colvarbias.cpp colvarmodule.h \ - colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvarbias.h \ - colvar.h colvarparse.h colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvargrid.h -$(COLVARS_OBJ_DIR)colvarbias_histogram.o: colvarbias_histogram.cpp \ - colvarmodule.h colvars_version.h colvarproxy.h colvartypes.h \ - colvarvalue.h colvar.h colvarparse.h colvardeps.h \ - lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarbias_histogram.h colvarbias.h colvargrid.h -$(COLVARS_OBJ_DIR)colvarbias_meta.o: colvarbias_meta.cpp colvarmodule.h \ - colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvar.h \ - colvarparse.h colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarbias_meta.h colvarbias.h colvargrid.h -$(COLVARS_OBJ_DIR)colvarbias_restraint.o: colvarbias_restraint.cpp \ - colvarmodule.h colvars_version.h colvarproxy.h colvartypes.h \ - colvarvalue.h colvarbias_restraint.h colvarbias.h colvar.h colvarparse.h \ - colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h -$(COLVARS_OBJ_DIR)colvarcomp_angles.o: colvarcomp_angles.cpp \ - colvarmodule.h colvars_version.h colvar.h colvarvalue.h colvartypes.h \ - colvarparse.h colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarcomp.h colvaratoms.h colvarproxy.h -$(COLVARS_OBJ_DIR)colvarcomp_coordnums.o: colvarcomp_coordnums.cpp \ - colvarmodule.h colvars_version.h colvarparse.h colvarvalue.h \ - colvartypes.h colvaratoms.h colvarproxy.h colvardeps.h colvar.h \ - lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarcomp.h -$(COLVARS_OBJ_DIR)colvarcomp.o: colvarcomp.cpp colvarmodule.h \ - colvars_version.h colvarvalue.h colvartypes.h colvar.h colvarparse.h \ - colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarcomp.h colvaratoms.h colvarproxy.h -$(COLVARS_OBJ_DIR)colvarcomp_distances.o: colvarcomp_distances.cpp \ - colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ - colvarparse.h colvar.h colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarcomp.h colvaratoms.h colvarproxy.h -$(COLVARS_OBJ_DIR)colvarcomp_protein.o: colvarcomp_protein.cpp \ - colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ - colvarparse.h colvar.h colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarcomp.h colvaratoms.h colvarproxy.h -$(COLVARS_OBJ_DIR)colvarcomp_rotations.o: colvarcomp_rotations.cpp \ - colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ - colvarparse.h colvar.h colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarcomp.h colvaratoms.h colvarproxy.h -$(COLVARS_OBJ_DIR)colvar.o: colvar.cpp colvarmodule.h colvars_version.h \ - colvarvalue.h colvartypes.h colvarparse.h colvar.h colvardeps.h \ - lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarcomp.h colvaratoms.h colvarproxy.h colvarscript.h colvarbias.h -$(COLVARS_OBJ_DIR)colvardeps.o: colvardeps.cpp colvarmodule.h \ - colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvardeps.h \ - colvarparse.h -$(COLVARS_OBJ_DIR)colvargrid.o: colvargrid.cpp colvarmodule.h \ - colvars_version.h colvarvalue.h colvartypes.h colvarparse.h colvar.h \ - colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarcomp.h colvaratoms.h colvarproxy.h colvargrid.h -$(COLVARS_OBJ_DIR)colvarmodule.o: colvarmodule.cpp colvarmodule.h \ - colvars_version.h colvarparse.h colvarvalue.h colvartypes.h \ - colvarproxy.h colvar.h colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarbias.h colvarbias_abf.h colvargrid.h colvar_UIestimator.h \ - colvarbias_alb.h colvarbias_histogram.h colvarbias_meta.h \ - colvarbias_restraint.h colvarscript.h colvaratoms.h colvarcomp.h -$(COLVARS_OBJ_DIR)colvarparse.o: colvarparse.cpp colvarmodule.h \ - colvars_version.h colvarvalue.h colvartypes.h colvarparse.h -$(COLVARS_OBJ_DIR)colvarproxy.o: colvarproxy.cpp colvarmodule.h \ - colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \ - colvarscript.h colvarbias.h colvar.h colvarparse.h colvardeps.h \ - lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvaratoms.h -$(COLVARS_OBJ_DIR)colvarscript.o: colvarscript.cpp colvarscript.h \ - colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ - colvarbias.h colvar.h colvarparse.h colvardeps.h lepton/include/Lepton.h \ - lepton/include/lepton/CompiledExpression.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/windowsIncludes.h \ - lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/ExpressionProgram.h \ - lepton/include/lepton/ExpressionTreeNode.h \ - lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ - lepton/include/lepton/Exception.h \ - lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ - colvarproxy.h -$(COLVARS_OBJ_DIR)colvartypes.o: colvartypes.cpp colvarmodule.h \ - colvars_version.h colvartypes.h colvarparse.h colvarvalue.h -$(COLVARS_OBJ_DIR)colvarvalue.o: colvarvalue.cpp colvarmodule.h \ - colvars_version.h colvarvalue.h colvartypes.h diff --git a/lib/gpu/Install.py b/lib/gpu/Install.py index 14549f53b8..612990c9c5 100644 --- a/lib/gpu/Install.py +++ b/lib/gpu/Install.py @@ -5,6 +5,8 @@ from __future__ import print_function import sys,os,subprocess +sys.path.append('..') +from install_helpers import error,get_cpus # help message @@ -51,18 +53,11 @@ make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk make lib-gpu args="-m mpi -a sm_35 -p single -o mpi.mixed -b" # create new Makefile.mpi.mixed, also build GPU lib with these settings """ -# print error message or help - -def error(str=None): - if not str: print(help) - else: print("ERROR",str) - sys.exit() - # parse args args = sys.argv[1:] nargs = len(args) -if nargs == 0: error() +if nargs == 0: error(help=help) isuffix = "linux" hflag = aflag = pflag = eflag = 0 @@ -72,26 +67,26 @@ outflag = 0 iarg = 0 while iarg < nargs: if args[iarg] == "-m": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) isuffix = args[iarg+1] iarg += 2 elif args[iarg] == "-h": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) hflag = 1 hdir = args[iarg+1] iarg += 2 elif args[iarg] == "-a": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) aflag = 1 arch = args[iarg+1] iarg += 2 elif args[iarg] == "-p": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) pflag = 1 precision = args[iarg+1] iarg += 2 elif args[iarg] == "-e": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) eflag = 1 lmpsuffix = args[iarg+1] iarg += 2 @@ -99,11 +94,11 @@ while iarg < nargs: makeflag = 1 iarg += 1 elif args[iarg] == "-o": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) outflag = 1 osuffix = args[iarg+1] iarg += 2 - else: error() + else: error(help=help) if pflag: if precision == "double": precstr = "-D_DOUBLE_DOUBLE" @@ -145,9 +140,15 @@ if makeflag: print("Building libgpu.a ...") if os.path.exists("libgpu.a"): os.remove("libgpu.a") - cmd = "make -f Makefile.auto clean; make -f Makefile.auto" - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - print(txt.decode('UTF-8')) + n_cpus = get_cpus() + cmd = "make -f Makefile.auto clean; make -f Makefile.auto -j%d" % n_cpus + try: + txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + print(txt.decode('UTF-8')) + except subprocess.CalledProcessError as e: + print("Make failed with:\n %s" % e.output.decode('UTF-8')) + sys.exit(1) + if not os.path.exists("libgpu.a"): error("Build of lib/gpu/libgpu.a was NOT successful") if not os.path.exists("Makefile.lammps"): diff --git a/lib/gpu/Makefile.linux b/lib/gpu/Makefile.linux index 6b63b26398..7001c6d8b9 100644 --- a/lib/gpu/Makefile.linux +++ b/lib/gpu/Makefile.linux @@ -55,7 +55,7 @@ CUDA_PRECISION = -D_SINGLE_DOUBLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math $(LMP_INC) -Xcompiler -fPIC +CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias diff --git a/lib/gpu/Makefile.linux_multi b/lib/gpu/Makefile.linux_multi index 02b405ac35..2f75ca0e2b 100644 --- a/lib/gpu/Makefile.linux_multi +++ b/lib/gpu/Makefile.linux_multi @@ -19,8 +19,13 @@ NVCC = nvcc #CUDA_ARCH = -arch=sm_13 # older CUDA #CUDA_ARCH = -arch=sm_10 -DCUDA_PRE_THREE +CUDA_ARCH = -arch=sm_30 -CUDA_ARCH = -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 +CUDA_CODE = -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61] \ + -gencode arch=compute_30,code=[sm_30,compute_30] -gencode arch=compute_35,code=[sm_35,compute_35] \ + -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] + +CUDA_ARCH += $(CUDA_CODE) # this setting should match LAMMPS Makefile # one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL @@ -36,7 +41,7 @@ CUDA_PRECISION = -D_SINGLE_DOUBLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math $(LMP_INC) -Xcompiler "-fPIC -std=c++98" +CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler "-fPIC -std=c++98" CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias diff --git a/lib/install_helpers.py b/lib/install_helpers.py new file mode 100644 index 0000000000..428b801502 --- /dev/null +++ b/lib/install_helpers.py @@ -0,0 +1,99 @@ +import hashlib,os,subprocess,sys + +# default help message + +defhelp = """ +Syntax from src dir: make lib-libname args="-m machine -e suffix" +Syntax from lib dir: python Install.py -m machine -e suffix + +libname = name of lib dir (e.g. atc, h5md, meam, poems, etc) +specify -m and optionally -e, order does not matter + + -m = peform a clean followed by "make -f Makefile.machine" + machine = suffix of a lib/Makefile.* file + -e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix + does not alter existing Makefile.machine + +Examples: + +make lib-poems args="-m serial" # build POEMS lib with same settings as in the serial Makefile in src +make lib-colvars args="-m mpi" # build USER-COLVARS lib with same settings as in the mpi Makefile in src +make lib-meam args="-m ifort" # build MEAM lib with custom Makefile.ifort (using Intel Fortran) +""" + +# print error message or help +def error(str=None,help=None): + if not str: + if not help: + print(defhelp) + else: + print(help) + else: print("ERROR",str) + sys.exit() + +# try to auto-detect the maximum number of available CPUs +def get_cpus(): + try: + import multiprocessing + n_cpus = multiprocessing.cpu_count() + except: + n_cpus = 1 + return n_cpus + +# expand to full path name +# process leading '~' or relative path + +def fullpath(path): + return os.path.abspath(os.path.expanduser(path)) + +def which(program): + def is_exe(fpath): + return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + + fpath, fname = os.path.split(program) + if fpath: + if is_exe(program): + return program + else: + for path in os.environ["PATH"].split(os.pathsep): + path = path.strip('"') + exe_file = os.path.join(path, program) + if is_exe(exe_file): + return exe_file + + return None + +def geturl(url,fname): + success = False + + if which('curl') != None: + cmd = 'curl -L -o "%s" %s' % (fname,url) + try: + subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + success = True + except subprocess.CalledProcessError as e: + print("Calling curl failed with: %s" % e.output.decode('UTF-8')) + + if not success and which('wget') != None: + cmd = 'wget -O "%s" %s' % (fname,url) + try: + subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + success = True + except subprocess.CalledProcessError as e: + print("Calling wget failed with: %s" % e.output.decode('UTF-8')) + + if not success: + error("Failed to download source code with 'curl' or 'wget'") + return + +def checkmd5sum(md5sum,fname): + with open(fname,'rb') as fh: + m = hashlib.md5() + while True: + data = fh.read(81920) + if not data: + break + m.update(data) + fh.close() + return m.hexdigest() == md5sum + diff --git a/lib/latte/Install.py b/lib/latte/Install.py index 07f89e9150..d9cc2a851a 100644 --- a/lib/latte/Install.py +++ b/lib/latte/Install.py @@ -4,7 +4,9 @@ # used to automate the steps described in the README file in this dir from __future__ import print_function -import sys,os,re,subprocess,hashlib,shutil +import sys,os,re,subprocess,shutil +sys.path.append('..') +from install_helpers import error,get_cpus,fullpath,which,geturl,checkmd5sum # help message @@ -43,75 +45,11 @@ checksums = { \ '1.2.1' : '85ac414fdada2d04619c8f936344df14', \ } -# print error message or help - -def error(str=None): - if not str: print(help) - else: print("ERROR",str) - sys.exit() - -# expand to full path name -# process leading '~' or relative path - -def fullpath(path): - return os.path.abspath(os.path.expanduser(path)) - -def which(program): - def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - - fpath, fname = os.path.split(program) - if fpath: - if is_exe(program): - return program - else: - for path in os.environ["PATH"].split(os.pathsep): - path = path.strip('"') - exe_file = os.path.join(path, program) - if is_exe(exe_file): - return exe_file - - return None - -def geturl(url,fname): - success = False - - if which('curl') != None: - cmd = 'curl -L -o "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling curl failed with: %s" % e.output.decode('UTF-8')) - - if not success and which('wget') != None: - cmd = 'wget -O "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling wget failed with: %s" % e.output.decode('UTF-8')) - - if not success: - error("Failed to download source code with 'curl' or 'wget'") - return - -def checkmd5sum(md5sum,fname): - with open(fname,'rb') as fh: - m = hashlib.md5() - while True: - data = fh.read(81920) - if not data: - break - m.update(data) - fh.close() - return m.hexdigest() == md5sum - # parse args args = sys.argv[1:] nargs = len(args) -if nargs == 0: error() +if nargs == 0: error(help=help) homepath = "." @@ -123,7 +61,7 @@ linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-p": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) lattedir = fullpath(args[iarg+1]) pathflag = True iarg += 2 @@ -131,15 +69,15 @@ while iarg < nargs: buildflag = True iarg += 1 elif args[iarg] == "-m": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) suffix = args[iarg+1] suffixflag = True iarg += 2 elif args[iarg] == "-v": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) version = args[iarg+1] iarg += 2 - else: error() + else: error(help=help) homedir = "LATTE-%s" % version @@ -177,8 +115,12 @@ if buildflag: if buildflag: print("Building LATTE ...") cmd = 'cd "%s"; make' % lattedir - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - print(txt.decode('UTF-8')) + try: + txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + print(txt.decode('UTF-8')) + except subprocess.CalledProcessError as e: + print("Make failed with:\n %s" % e.output.decode('UTF-8')) + sys.exit(1) # create 3 links in lib/latte to LATTE dirs # do this -b or -p is set diff --git a/lib/message/Install.py b/lib/message/Install.py index d3f31c986f..293ff74d68 100644 --- a/lib/message/Install.py +++ b/lib/message/Install.py @@ -5,6 +5,8 @@ from __future__ import print_function import sys,os,re,subprocess +sys.path.append('..') +from install_helpers import error,get_cpus,fullpath,which # help message @@ -26,41 +28,11 @@ make lib-message args="-m -z" # build parallel CSlib with ZMQ support make lib-message args="-s" # build serial CSlib with no ZMQ support """ -# print error message or help - -def error(str=None): - if not str: print(help) - else: print("ERROR",str) - sys.exit() - -# expand to full path name -# process leading '~' or relative path - -def fullpath(path): - return os.path.abspath(os.path.expanduser(path)) - -def which(program): - def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - - fpath, fname = os.path.split(program) - if fpath: - if is_exe(program): - return program - else: - for path in os.environ["PATH"].split(os.pathsep): - path = path.strip('"') - exe_file = os.path.join(path, program) - if is_exe(exe_file): - return exe_file - - return None - # parse args args = sys.argv[1:] nargs = len(args) -if nargs == 0: error() +if nargs == 0: error(help=help) mpiflag = False serialflag = False @@ -77,7 +49,7 @@ while iarg < nargs: elif args[iarg] == "-z": zmqflag = True iarg += 1 - else: error() + else: error(help=help) if (not mpiflag and not serialflag): error("Must use either -m or -s flag") @@ -102,8 +74,12 @@ elif not mpiflag and not zmqflag: cmd = "cd %s; make lib_serial zmq=no" % srcdir print(cmd) -txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) -print(txt.decode('UTF-8')) +try: + txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + print(txt.decode('UTF-8')) +except subprocess.CalledProcessError as e: + print("Make failed with:\n %s" % e.output.decode('UTF-8')) + sys.exit(1) if mpiflag: cmd = "cd %s; cp libcsmpi.a libmessage.a" % srcdir else: cmd = "cd %s; cp libcsnompi.a libmessage.a" % srcdir diff --git a/lib/mscg/Install.py b/lib/mscg/Install.py index d613532d39..5c0164f4a5 100644 --- a/lib/mscg/Install.py +++ b/lib/mscg/Install.py @@ -5,6 +5,8 @@ from __future__ import print_function import sys,os,re,subprocess,shutil +sys.path.append('..') +from install_helpers import error,get_cpus,fullpath,which,get_cpus,geturl # help message @@ -35,64 +37,11 @@ url = "https://github.com/uchicago-voth/MSCG-release/archive/%s.tar.gz" % mscgve tarfile = "MS-CG-%s.tar.gz" % mscgver tardir = "MSCG-release-%s" % mscgver -# print error message or help - -def error(str=None): - if not str: print(help) - else: print("ERROR",str) - sys.exit() - -# expand to full path name -# process leading '~' or relative path - -def fullpath(path): - return os.path.abspath(os.path.expanduser(path)) - -def which(program): - def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - - fpath, fname = os.path.split(program) - if fpath: - if is_exe(program): - return program - else: - for path in os.environ["PATH"].split(os.pathsep): - path = path.strip('"') - exe_file = os.path.join(path, program) - if is_exe(exe_file): - return exe_file - - return None - -def geturl(url,fname): - success = False - - if which('curl') != None: - cmd = 'curl -L -o "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling curl failed with: %s" % e.output.decode('UTF-8')) - - if not success and which('wget') != None: - cmd = 'wget -O "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling wget failed with: %s" % e.output.decode('UTF-8')) - - if not success: - error("Failed to download source code with 'curl' or 'wget'") - return - # parse args args = sys.argv[1:] nargs = len(args) -if nargs == 0: error() +if nargs == 0: error(help=help) homepath = "." homedir = tardir @@ -105,18 +54,18 @@ msuffix = "g++_simple" iarg = 0 while iarg < nargs: if args[iarg] == "-p": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) mscgpath = fullpath(args[iarg+1]) pathflag = True iarg += 2 elif args[iarg] == "-m": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) msuffix = args[iarg+1] iarg += 2 elif args[iarg] == "-b": buildflag = True iarg += 1 - else: error() + else: error(help=help) homepath = fullpath(homepath) homedir = "%s/%s" % (homepath,homedir) @@ -160,8 +109,13 @@ if buildflag: (homedir,msuffix,msuffix) else: error("Cannot find Makefile.%s" % msuffix) - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - print(txt.decode('UTF-8')) + try: + txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + print(txt.decode('UTF-8')) + except subprocess.CalledProcessError as e: + print("Make failed with:\n %s" % e.output.decode('UTF-8')) + sys.exit(1) + if not os.path.exists("Makefile.lammps"): print("Creating Makefile.lammps") if os.path.exists("Makefile.lammps.%s" % msuffix): diff --git a/lib/smd/Install.py b/lib/smd/Install.py index 8d83b0f78a..e7038611ea 100644 --- a/lib/smd/Install.py +++ b/lib/smd/Install.py @@ -5,6 +5,8 @@ from __future__ import print_function import sys,os,re,glob,subprocess,shutil +sys.path.append('..') +from install_helpers import error,get_cpus,fullpath,which,geturl # help message @@ -34,64 +36,12 @@ make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in version = '3.3.4' tarball = "eigen.tar.gz" -# print error message or help - -def error(str=None): - if not str: print(help) - else: print("ERROR",str) - sys.exit() - -# expand to full path name -# process leading '~' or relative path - -def fullpath(path): - return os.path.abspath(os.path.expanduser(path)) - -def which(program): - def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - - fpath, fname = os.path.split(program) - if fpath: - if is_exe(program): - return program - else: - for path in os.environ["PATH"].split(os.pathsep): - path = path.strip('"') - exe_file = os.path.join(path, program) - if is_exe(exe_file): - return exe_file - - return None - -def geturl(url,fname): - success = False - - if which('curl') != None: - cmd = 'curl -L -o "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling curl failed with: %s" % e.output.decode('UTF-8')) - - if not success and which('wget') != None: - cmd = 'wget -O "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling wget failed with: %s" % e.output.decode('UTF-8')) - - if not success: - error("Failed to download source code with 'curl' or 'wget'") - return # parse args args = sys.argv[1:] nargs = len(args) -if nargs == 0: error() +if nargs == 0: error(help=help) homepath = "." homedir = "eigen3" @@ -103,18 +53,18 @@ linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-v": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) version = args[iarg+1] iarg += 2 elif args[iarg] == "-p": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) eigenpath = fullpath(args[iarg+1]) pathflag = True iarg += 2 elif args[iarg] == "-b": buildflag = True iarg += 1 - else: error() + else: error(help=help) homepath = fullpath(homepath) diff --git a/lib/voronoi/Install.py b/lib/voronoi/Install.py index 4e8b457905..6df3d89679 100644 --- a/lib/voronoi/Install.py +++ b/lib/voronoi/Install.py @@ -5,6 +5,8 @@ from __future__ import print_function import sys,os,re,subprocess,shutil +sys.path.append('..') +from install_helpers import error,get_cpus,fullpath,which,geturl # help message @@ -33,64 +35,12 @@ make lib-voronoi args="-p $HOME/voro++-0.4.6" # use existing Voro++ installation version = "voro++-0.4.6" url = "http://math.lbl.gov/voro++/download/dir/%s.tar.gz" % version -# print error message or help - -def error(str=None): - if not str: print(help) - else: print("ERROR",str) - sys.exit() - -# expand to full path name -# process leading '~' or relative path - -def fullpath(path): - return os.path.abspath(os.path.expanduser(path)) - -def which(program): - def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - - fpath, fname = os.path.split(program) - if fpath: - if is_exe(program): - return program - else: - for path in os.environ["PATH"].split(os.pathsep): - path = path.strip('"') - exe_file = os.path.join(path, program) - if is_exe(exe_file): - return exe_file - - return None - -def geturl(url,fname): - success = False - - if which('curl') != None: - cmd = 'curl -L -o "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling curl failed with: %s" % e.output.decode('UTF-8')) - - if not success and which('wget') != None: - cmd = 'wget -O "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling wget failed with: %s" % e.output.decode('UTF-8')) - - if not success: - error("Failed to download source code with 'curl' or 'wget'") - return # parse args args = sys.argv[1:] nargs = len(args) -if nargs == 0: error() +if nargs == 0: error(help=help) homepath = "." homedir = version @@ -102,18 +52,18 @@ linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-v": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) version = args[iarg+1] iarg += 2 elif args[iarg] == "-p": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) voropath = fullpath(args[iarg+1]) pathflag = True iarg += 2 elif args[iarg] == "-b": buildflag = True iarg += 1 - else: error() + else: error(help=help) homepath = fullpath(homepath) homedir = "%s/%s" % (homepath,version) @@ -150,8 +100,12 @@ if buildflag: if buildflag: print("Building Voro++ ...") cmd = 'cd "%s"; make CXX=g++ CFLAGS="-fPIC -O3"' % homedir - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - print(txt.decode('UTF-8')) + try: + txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + print(txt.decode('UTF-8')) + except subprocess.CalledProcessError as e: + print("Make failed with:\n %s" % e.output.decode('UTF-8')) + sys.exit(1) # create 2 links in lib/voronoi to Voro++ src dir From 46c0be57de330b6c9fdb1a5c77c38780a2a457c9 Mon Sep 17 00:00:00 2001 From: Giacomo Fiorin Date: Mon, 3 Dec 2018 18:08:27 -0500 Subject: [PATCH 16/94] Restore deleted deps file (if deletion is intentional, please delete again) --- lib/colvars/Makefile.deps | 234 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) diff --git a/lib/colvars/Makefile.deps b/lib/colvars/Makefile.deps index 8b13789179..a0d8515bc1 100644 --- a/lib/colvars/Makefile.deps +++ b/lib/colvars/Makefile.deps @@ -1 +1,235 @@ +$(COLVARS_OBJ_DIR)colvaratoms.o: colvaratoms.cpp colvarmodule.h \ + colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \ + colvarparse.h colvaratoms.h colvardeps.h +$(COLVARS_OBJ_DIR)colvarbias_abf.o: colvarbias_abf.cpp colvarmodule.h \ + colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvar.h \ + colvarparse.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarbias_abf.h colvarbias.h colvargrid.h colvar_UIestimator.h +$(COLVARS_OBJ_DIR)colvarbias_alb.o: colvarbias_alb.cpp colvarmodule.h \ + colvars_version.h colvarbias.h colvar.h colvarvalue.h colvartypes.h \ + colvarparse.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarbias_alb.h +$(COLVARS_OBJ_DIR)colvarbias.o: colvarbias.cpp colvarmodule.h \ + colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvarbias.h \ + colvar.h colvarparse.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvargrid.h +$(COLVARS_OBJ_DIR)colvarbias_histogram.o: colvarbias_histogram.cpp \ + colvarmodule.h colvars_version.h colvarproxy.h colvartypes.h \ + colvarvalue.h colvar.h colvarparse.h colvardeps.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarbias_histogram.h colvarbias.h colvargrid.h +$(COLVARS_OBJ_DIR)colvarbias_meta.o: colvarbias_meta.cpp colvarmodule.h \ + colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvar.h \ + colvarparse.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarbias_meta.h colvarbias.h colvargrid.h +$(COLVARS_OBJ_DIR)colvarbias_restraint.o: colvarbias_restraint.cpp \ + colvarmodule.h colvars_version.h colvarproxy.h colvartypes.h \ + colvarvalue.h colvarbias_restraint.h colvarbias.h colvar.h colvarparse.h \ + colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h +$(COLVARS_OBJ_DIR)colvarcomp_angles.o: colvarcomp_angles.cpp \ + colvarmodule.h colvars_version.h colvar.h colvarvalue.h colvartypes.h \ + colvarparse.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h +$(COLVARS_OBJ_DIR)colvarcomp_coordnums.o: colvarcomp_coordnums.cpp \ + colvarmodule.h colvars_version.h colvarparse.h colvarvalue.h \ + colvartypes.h colvaratoms.h colvarproxy.h colvardeps.h colvar.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h +$(COLVARS_OBJ_DIR)colvarcomp.o: colvarcomp.cpp colvarmodule.h \ + colvars_version.h colvarvalue.h colvartypes.h colvar.h colvarparse.h \ + colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h +$(COLVARS_OBJ_DIR)colvarcomp_distances.o: colvarcomp_distances.cpp \ + colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ + colvarparse.h colvar.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h +$(COLVARS_OBJ_DIR)colvarcomp_protein.o: colvarcomp_protein.cpp \ + colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ + colvarparse.h colvar.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h +$(COLVARS_OBJ_DIR)colvarcomp_rotations.o: colvarcomp_rotations.cpp \ + colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ + colvarparse.h colvar.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h +$(COLVARS_OBJ_DIR)colvar.o: colvar.cpp colvarmodule.h colvars_version.h \ + colvarvalue.h colvartypes.h colvarparse.h colvar.h colvardeps.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvarscript.h colvarbias.h +$(COLVARS_OBJ_DIR)colvardeps.o: colvardeps.cpp colvarmodule.h \ + colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvardeps.h \ + colvarparse.h +$(COLVARS_OBJ_DIR)colvargrid.o: colvargrid.cpp colvarmodule.h \ + colvars_version.h colvarvalue.h colvartypes.h colvarparse.h colvar.h \ + colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvargrid.h +$(COLVARS_OBJ_DIR)colvarmodule.o: colvarmodule.cpp colvarmodule.h \ + colvars_version.h colvarparse.h colvarvalue.h colvartypes.h \ + colvarproxy.h colvar.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarbias.h colvarbias_abf.h colvargrid.h colvar_UIestimator.h \ + colvarbias_alb.h colvarbias_histogram.h colvarbias_meta.h \ + colvarbias_restraint.h colvarscript.h colvaratoms.h colvarcomp.h +$(COLVARS_OBJ_DIR)colvarparse.o: colvarparse.cpp colvarmodule.h \ + colvars_version.h colvarvalue.h colvartypes.h colvarparse.h +$(COLVARS_OBJ_DIR)colvarproxy.o: colvarproxy.cpp colvarmodule.h \ + colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \ + colvarscript.h colvarbias.h colvar.h colvarparse.h colvardeps.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvaratoms.h +$(COLVARS_OBJ_DIR)colvarscript.o: colvarscript.cpp colvarscript.h \ + colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ + colvarbias.h colvar.h colvarparse.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarproxy.h +$(COLVARS_OBJ_DIR)colvartypes.o: colvartypes.cpp colvarmodule.h \ + colvars_version.h colvartypes.h colvarparse.h colvarvalue.h +$(COLVARS_OBJ_DIR)colvarvalue.o: colvarvalue.cpp colvarmodule.h \ + colvars_version.h colvarvalue.h colvartypes.h From d603d084c4bca38316ff0e287e430288cd4c9a25 Mon Sep 17 00:00:00 2001 From: Giacomo Fiorin Date: Mon, 3 Dec 2018 18:12:10 -0500 Subject: [PATCH 17/94] Fix typo, whitespace cleanup --- lib/colvars/Install.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/colvars/Install.py b/lib/colvars/Install.py index a17c5bab5e..60cee31393 100644 --- a/lib/colvars/Install.py +++ b/lib/colvars/Install.py @@ -122,13 +122,13 @@ fp.close() n_cpus = get_cpus() print("Building lib%s.a ..." % lib) -cmd = ["make -f Makefile.auto clearn; make -f Makefile.auto -j%d" % n_cpus] +cmd = ["make -f Makefile.auto clean; make -f Makefile.auto -j%d" % n_cpus] try: - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True); + txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True); print(txt.decode('UTF-8')) except subprocess.CalledProcessError as e: print("Make failed with:\n %s" % e.output.decode('UTF-8')) - sys.exit(1) + sys.exit(1) if os.path.exists("lib%s.a" % lib): print("Build was successful") else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib)) From 4168855ba36e55f14d8124e5c67e45b12b07452b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 3 Dec 2018 19:27:03 -0500 Subject: [PATCH 18/94] reduce distracting nvcc (or rather ptxas) verbosity --- lib/gpu/Makefile.fermi | 6 +++--- lib/gpu/Makefile.linux.double | 2 +- lib/gpu/Makefile.linux.mixed | 2 +- lib/gpu/Makefile.linux.single | 2 +- lib/gpu/Makefile.mac | 2 +- lib/gpu/Makefile.serial | 2 +- lib/gpu/Makefile.shannon | 2 +- lib/gpu/Makefile.xk7 | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/gpu/Makefile.fermi b/lib/gpu/Makefile.fermi index 4cd9dd20a3..ce5ccaaf78 100644 --- a/lib/gpu/Makefile.fermi +++ b/lib/gpu/Makefile.fermi @@ -3,11 +3,11 @@ EXTRAMAKE = Makefile.lammps.standard CUDA_ARCH = -arch=sm_35 CUDA_PRECISION = -D_SINGLE_DOUBLE -CUDA_INCLUDE = -I$(CUDA_HOME)/include +CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -Xlinker -rpath -Xlinker $(CUDA_HOME)/lib64 -lcudart -CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math --ftz=true +CUDA_OPTS = -DUNIX -O3 --use_fast_math --ftz=true -CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -I$(CUDA_HOME)/include +CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -I$(CUDA_HOME)/include CUDR_OPTS = -O3 -ffast-math -funroll-loops -DMPI_GERYON -DLAMMPS_SMALLBIG BIN_DIR = . diff --git a/lib/gpu/Makefile.linux.double b/lib/gpu/Makefile.linux.double index defbe2bc9c..e65647f160 100644 --- a/lib/gpu/Makefile.linux.double +++ b/lib/gpu/Makefile.linux.double @@ -33,7 +33,7 @@ CUDA_PRECISION = -D_DOUBLE_DOUBLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math +CUDA_OPTS = -DUNIX -O3 --use_fast_math CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias diff --git a/lib/gpu/Makefile.linux.mixed b/lib/gpu/Makefile.linux.mixed index 6289163ac8..a036b84ee3 100644 --- a/lib/gpu/Makefile.linux.mixed +++ b/lib/gpu/Makefile.linux.mixed @@ -33,7 +33,7 @@ CUDA_PRECISION = -D_SINGLE_DOUBLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math +CUDA_OPTS = -DUNIX -O3 --use_fast_math CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias diff --git a/lib/gpu/Makefile.linux.single b/lib/gpu/Makefile.linux.single index 4048bc8788..808647cea7 100644 --- a/lib/gpu/Makefile.linux.single +++ b/lib/gpu/Makefile.linux.single @@ -33,7 +33,7 @@ CUDA_PRECISION = -D_SINGLE_SINGLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math +CUDA_OPTS = -DUNIX -O3 --use_fast_math CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias diff --git a/lib/gpu/Makefile.mac b/lib/gpu/Makefile.mac index 96f739633e..f9f8d5179a 100644 --- a/lib/gpu/Makefile.mac +++ b/lib/gpu/Makefile.mac @@ -15,7 +15,7 @@ CUDA_ARCH = -arch=sm_11 CUDA_PRECISION = -D_SINGLE_SINGLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib -CUDA_OPTS = -DUNIX -DUCL_NO_EXIT -O3 -Xptxas -v --use_fast_math +CUDA_OPTS = -DUNIX -DUCL_NO_EXIT -O3 --use_fast_math CUDR_CPP = mpic++ -m64 CUDR_OPTS = -O2 -g diff --git a/lib/gpu/Makefile.serial b/lib/gpu/Makefile.serial index 9348dc565a..99153fc471 100644 --- a/lib/gpu/Makefile.serial +++ b/lib/gpu/Makefile.serial @@ -35,7 +35,7 @@ CUDA_PRECISION = -D_SINGLE_DOUBLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -L../../src/STUBS -lmpi_stubs -CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math $(LMP_INC) +CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) CUDR_CPP = g++ -DMPI_GERYON -DUCL_NO_EXIT -fPIC -I../../src/STUBS CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias diff --git a/lib/gpu/Makefile.shannon b/lib/gpu/Makefile.shannon index 2ddb0d1f04..22c2dc89d7 100644 --- a/lib/gpu/Makefile.shannon +++ b/lib/gpu/Makefile.shannon @@ -33,7 +33,7 @@ CUDA_PRECISION = -D_DOUBLE_DOUBLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math +CUDA_OPTS = -DUNIX -O3 --use_fast_math CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias diff --git a/lib/gpu/Makefile.xk7 b/lib/gpu/Makefile.xk7 index 1ee8e3225f..0b9f029399 100644 --- a/lib/gpu/Makefile.xk7 +++ b/lib/gpu/Makefile.xk7 @@ -15,7 +15,7 @@ CUDA_ARCH = -arch=sm_35 CUDA_PRECISION = -D_SINGLE_DOUBLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math +CUDA_OPTS = -DUNIX -O3 --use_fast_math CUDR_CPP = CC -DCUDA_PROXY -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK CUDR_OPTS = -O2 -march=bdver1 -ftree-vectorize From be721fe75aaf4cbb0541c390c7e0d84421bd338e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 3 Dec 2018 19:47:10 -0500 Subject: [PATCH 19/94] more Install.py refactoring --- lib/kim/Install.py | 70 +++++--------------------------- lib/plumed/Install.py | 89 +++++++---------------------------------- lib/scafacos/Install.py | 73 ++++++--------------------------- 3 files changed, 37 insertions(+), 195 deletions(-) diff --git a/lib/kim/Install.py b/lib/kim/Install.py index 6cc1a1abc2..46849873cb 100644 --- a/lib/kim/Install.py +++ b/lib/kim/Install.py @@ -5,6 +5,8 @@ from __future__ import print_function import sys,os,re,subprocess,shutil +sys.path.append('..') +from install_helpers import error,fullpath,which,geturl # help message @@ -51,64 +53,13 @@ https://openkim.org/kim-api in the "What is in the KIM API source package?" section """ -def error(str=None): - if not str: print(help) - else: print("ERROR",str) - sys.exit() - -# expand to full path name -# process leading '~' or relative path - -def fullpath(path): - return os.path.abspath(os.path.expanduser(path)) - -def which(program): - def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - - fpath, fname = os.path.split(program) - if fpath: - if is_exe(program): - return program - else: - for path in os.environ["PATH"].split(os.pathsep): - path = path.strip('"') - exe_file = os.path.join(path, program) - if is_exe(exe_file): - return exe_file - - return None - -def geturl(url,fname): - success = False - - if which('curl') != None: - cmd = 'curl -L -o "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling curl failed with: %s" % e.output.decode('UTF-8')) - - if not success and which('wget') != None: - cmd = 'wget -O "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling wget failed with: %s" % e.output.decode('UTF-8')) - - if not success: - error("Failed to download source code with 'curl' or 'wget'") - return - # parse args args = sys.argv[1:] nargs = len(args) -if nargs == 0: error() +if nargs == 0: error(help=help) -thisdir = os.environ['PWD'] +thisdir = fullpath('.') version = "kim-api-v1.9.5" buildflag = False @@ -120,7 +71,7 @@ pathflag = False iarg = 0 while iarg < len(args): if args[iarg] == "-v": - if iarg+2 > len(args): error() + if iarg+2 > len(args): error(help=help) version = args[iarg+1] iarg += 2 elif args[iarg] == "-b": @@ -130,14 +81,14 @@ while iarg < len(args): buildflag = False iarg += 1 elif args[iarg] == "-p": - if iarg+2 > len(args): error() + if iarg+2 > len(args): error(help=help) kimdir = fullpath(args[iarg+1]) pathflag = True buildflag = False iarg += 2 elif args[iarg] == "-a": addflag = True - if iarg+2 > len(args): error() + if iarg+2 > len(args): error(help=help) addmodelname = args[iarg+1] if addmodelname == "everything": buildflag = True @@ -147,9 +98,8 @@ while iarg < len(args): elif args[iarg] == "-vv": verboseflag = True iarg += 1 - else: error() + else: error(help=help) -thisdir = os.path.abspath(thisdir) url = "https://s3.openkim.org/kim-api/%s.txz" % version # set KIM API directory @@ -157,7 +107,7 @@ url = "https://s3.openkim.org/kim-api/%s.txz" % version if pathflag: if not os.path.isdir(kimdir): print("\nkim-api is not installed at %s" % kimdir) - error() + error(help=help) # configure LAMMPS to use existing kim-api installation with open("%s/Makefile.KIM_DIR" % thisdir, 'w') as mkfile: @@ -247,7 +197,7 @@ if addflag: if not os.path.isdir(kimdir): print("\nkim-api is not installed") - error() + error(help=help) # download single model cmd = '%s/bin/kim-api-v1-collections-management install system %s' % (kimdir.decode("UTF-8"), addmodelname) diff --git a/lib/plumed/Install.py b/lib/plumed/Install.py index 8d844678cd..fecd565d35 100644 --- a/lib/plumed/Install.py +++ b/lib/plumed/Install.py @@ -5,6 +5,8 @@ from __future__ import print_function import sys,os,re,subprocess,hashlib,shutil +sys.path.append('..') +from install_helpers import error,get_cpus,fullpath,which,geturl,checkmd5sum # help message @@ -42,74 +44,11 @@ checksums = { \ '2.5b' : 'e341bdef469be1da058b8a0b97a3db22', \ } -# print error message or help -def error(str=None): - if not str: print(help) - else: print("ERROR",str) - sys.exit() - -# expand to full path name -# process leading '~' or relative path - -def fullpath(path): - return os.path.abspath(os.path.expanduser(path)) - -def which(program): - def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - - fpath, fname = os.path.split(program) - if fpath: - if is_exe(program): - return program - else: - for path in os.environ["PATH"].split(os.pathsep): - path = path.strip('"') - exe_file = os.path.join(path, program) - if is_exe(exe_file): - return exe_file - - return None - -def geturl(url,fname): - success = False - - if which('curl') != None: - cmd = 'curl -L -o "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling curl failed with: %s" % e.output.decode('UTF-8')) - - if not success and which('wget') != None: - cmd = 'wget -O "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling wget failed with: %s" % e.output.decode('UTF-8')) - - if not success: - error("Failed to download source code with 'curl' or 'wget'") - return - -def checkmd5sum(md5sum,fname): - with open(fname,'rb') as fh: - m = hashlib.md5() - while True: - data = fh.read(81920) - if not data: - break - m.update(data) - fh.close() - return m.hexdigest() == md5sum - # parse args args = sys.argv[1:] nargs = len(args) -if nargs == 0: error() +if nargs == 0: error(help=help) homepath = "." @@ -121,22 +60,22 @@ linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-v": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) version = args[iarg+1] iarg += 2 elif args[iarg] == "-p": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) plumedpath = fullpath(args[iarg+1]) pathflag = True iarg += 2 elif args[iarg] == "-m": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) mode = args[iarg+1] iarg += 2 elif args[iarg] == "-b": buildflag = True iarg += 1 - else: error() + else: error(help=help) homepath = fullpath(homepath) homedir = "%s/plumed2" % (homepath) @@ -178,14 +117,14 @@ if buildflag: # build plumed print("Building plumed ...") - try: - import multiprocessing - n_cpus = multiprocessing.cpu_count() - except: - n_cpus = 1 + n_cpus = get_cpus() cmd = 'cd %s/plumed-%s; ./configure --prefix=%s --enable-static-patch ; make -j%d ; make install' % (homepath,version,homedir,n_cpus) - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - print(txt.decode('UTF-8')) + try: + txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + print(txt.decode('UTF-8')) + except subprocess.CalledProcessError as e: + print("Make failed with:\n %s" % e.output.decode('UTF-8')) + sys.exit(1) # create 2 links in lib/plumed to plumed2 installation dir diff --git a/lib/scafacos/Install.py b/lib/scafacos/Install.py index 8e342ad1ba..34247839cd 100644 --- a/lib/scafacos/Install.py +++ b/lib/scafacos/Install.py @@ -5,6 +5,8 @@ from __future__ import print_function import sys,os,re,subprocess,shutil +sys.path.append('..') +from install_helpers import error,fullpath,which,geturl # help message @@ -33,60 +35,6 @@ version = "scafacos-1.0.1" url = "https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz" #url = "https://gigamove.rz.rwth-aachen.de/d/id/CTzyApN76MXMJ6/dd/100" % version -# print error message or help - -def error(str=None): - if not str: print(help) - else: print("ERROR",str) - sys.exit() - -# expand to full path name -# process leading '~' or relative path - -def fullpath(path): - return os.path.abspath(os.path.expanduser(path)) - -def which(program): - def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - - fpath, fname = os.path.split(program) - if fpath: - if is_exe(program): - return program - else: - for path in os.environ["PATH"].split(os.pathsep): - path = path.strip('"') - exe_file = os.path.join(path, program) - if is_exe(exe_file): - return exe_file - - return None - -def geturl(url,fname): - success = False - - if which('curl') != None: - cmd = 'curl -L -o "%s" %s' % (fname,url) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling curl failed with: %s" % e.output.decode('UTF-8')) - - if not success and which('wget') != None: - cmd = 'wget -O "%s" %s' % (fname,url) - print("Wget command: %s" % cmd) - try: - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - success = True - except subprocess.CalledProcessError as e: - print("Calling wget failed with: %s" % e.output.decode('UTF-8')) - - if not success: - error("Failed to download source code with 'curl' or 'wget'") - return - # parse args args = sys.argv[1:] @@ -101,18 +49,18 @@ linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-v": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) version = args[iarg+1] iarg += 2 elif args[iarg] == "-p": - if iarg+2 > nargs: error() + if iarg+2 > nargs: error(help=help) scafacospath = fullpath(args[iarg+1]) pathflag = True iarg += 2 elif args[iarg] == "-b": buildflag = True iarg += 1 - else: error() + else: error(help=help) homepath = fullpath(homepath) homedir = "%s/%s" % (homepath,version) @@ -145,9 +93,14 @@ if buildflag: if buildflag: print("Building Scafacos ...") - cmd = 'cd "%s"; ./configure --prefix="`pwd`/build" --disable-doc --enable-fcs-solvers=fmm,p2nfft,direct,ewald,p3m --with-internal-fftw --with-internal-pfft --with-internal-pnfft CC=mpicc FC=mpif90 CXX=mpicxx F77= > log.txt; make -j; make install' % homedir - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - print(txt.decode('UTF-8')) + n_cpu = get_gpus() + cmd = 'cd "%s"; ./configure --prefix="%s/build" --disable-doc --enable-fcs-solvers=fmm,p2nfft,direct,ewald,p3m --with-internal-fftw --with-internal-pfft --with-internal-pnfft CC=mpicc FC=mpif90 CXX=mpicxx F77=; make -j%d; make install' % (homedir,homedir,n_cpu) + try: + txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + print(txt.decode('UTF-8')) + except subprocess.CalledProcessError as e: + print("Make failed with:\n %s" % e.output.decode('UTF-8')) + sys.exit(1) # create 2 links in lib/scafacos to Scafacos include/lib dirs From cf3aee908349692d84fb2e2ba59677aed8cece7f Mon Sep 17 00:00:00 2001 From: jrgissing Date: Mon, 3 Dec 2018 20:12:38 -0700 Subject: [PATCH 20/94] bond/react doc tweaks --- doc/src/fix_bond_react.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/fix_bond_react.txt b/doc/src/fix_bond_react.txt index e55e06b7d2..5d6349a426 100644 --- a/doc/src/fix_bond_react.txt +++ b/doc/src/fix_bond_react.txt @@ -69,8 +69,8 @@ Initiate complex covalent bonding (topology) changes. These topology changes will be referred to as 'reactions' throughout this documentation. Topology changes are defined in pre- and post-reaction molecule templates and can include creation and deletion of bonds, -angles, dihedrals, impropers, bond-types, angle-types, dihedral-types, -atom-types, or atomic charges. In addition, reaction by-products or +angles, dihedrals, impropers, bond types, angle types, dihedral types, +atom types, or atomic charges. In addition, reaction by-products or other molecules can be identified and deleted. Fix bond/react does not use quantum mechanical (eg. fix qmmm) or @@ -80,7 +80,7 @@ probabilistic criteria to effect predetermined topology changes in simulations using standard force fields. This fix was created to facilitate the dynamic creation of polymeric, -amorphous or highly-crosslinked systems. A suggested workflow for +amorphous or highly cross-linked systems. A suggested workflow for using this fix is: 1) identify a reaction to be simulated 2) build a molecule template of the reaction site before the reaction has occurred 3) build a molecule template of the reaction site after the From fa7e02ea71a5a6e9080df131e0ecc7a38cd5a1ce Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Mon, 3 Dec 2018 20:28:01 -0700 Subject: [PATCH 21/94] Removed redundant element list from pair_coeff snap syntax --- doc/src/pair_snap.txt | 32 +++++----- examples/snap/Mo_Chen_PRM2017.snap | 8 +-- examples/snap/Mo_Chen_PRM2017.snapcoeff | 36 +----------- examples/snap/Mo_Chen_PRM2017.snapparam | 5 +- examples/snap/Ta06A.snap | 18 +----- examples/snap/Ta06A.snapcoeff | 38 +----------- examples/snap/Ta06A.snapparam | 16 +---- examples/snap/W_2940_2017_2.snap | 17 +----- examples/snap/W_2940_2017_2.snapcoeff | 63 +------------------- examples/snap/W_2940_2017_2.snapparam | 14 +---- examples/snap/W_2940_2017_2_He_JW2013.snap | 18 +----- potentials/Mo_Chen_PRM2017.snap | 3 +- potentials/Ta06A.snap | 4 +- potentials/Ta06A.snapparam | 3 +- potentials/W_2940_2017_2.snap | 4 +- potentials/W_2940_2017_2.snapparam | 3 +- potentials/W_2940_2017_2_He_JW2013.snap | 6 +- src/SNAP/pair_snap.cpp | 68 +++++----------------- src/SNAP/pair_snap.h | 4 ++ 19 files changed, 54 insertions(+), 306 deletions(-) mode change 100644 => 120000 examples/snap/Mo_Chen_PRM2017.snap mode change 100644 => 120000 examples/snap/Mo_Chen_PRM2017.snapcoeff mode change 100644 => 120000 examples/snap/Mo_Chen_PRM2017.snapparam mode change 100644 => 120000 examples/snap/Ta06A.snap mode change 100644 => 120000 examples/snap/Ta06A.snapcoeff mode change 100644 => 120000 examples/snap/Ta06A.snapparam mode change 100644 => 120000 examples/snap/W_2940_2017_2.snap mode change 100644 => 120000 examples/snap/W_2940_2017_2.snapcoeff mode change 100644 => 120000 examples/snap/W_2940_2017_2.snapparam mode change 100644 => 120000 examples/snap/W_2940_2017_2_He_JW2013.snap diff --git a/doc/src/pair_snap.txt b/doc/src/pair_snap.txt index 6f8cc3d8a8..16cf0313c5 100644 --- a/doc/src/pair_snap.txt +++ b/doc/src/pair_snap.txt @@ -16,7 +16,7 @@ pair_style snap :pre [Examples:] pair_style snap -pair_coeff * * InP.snapcoeff In P InP.snapparam In In P P :pre +pair_coeff * * InP.snapcoeff InP.snapparam In In P P :pre [Description:] @@ -48,14 +48,12 @@ not set in the pair_style or pair_coeff command; they are specified in the SNAP potential files themselves. Only a single pair_coeff command is used with the {snap} style which -specifies two SNAP files and the list SNAP element(s) to be -extracted. -The SNAP elements are mapped to LAMMPS atom types by specifying -N additional arguments after the 2nd filename in the pair_coeff -command, where N is the number of LAMMPS atom types: +specifies a SNAP coefficient file followed by a SNAP parameter file +and then N additional arguments specifying the mapping of SNAP +elements to LAMMPS atom types, where N is the number of +LAMMPS atom types: -SNAP element file -Elem1, Elem2, ... +SNAP coefficient file SNAP parameter file N element names = mapping of SNAP elements to atom types :ul @@ -63,13 +61,11 @@ As an example, if a LAMMPS indium phosphide simulation has 4 atoms types, with the first two being indium and the 3rd and 4th being phophorous, the pair_coeff command would look like this: -pair_coeff * * snap InP.snapcoeff In P InP.snapparam In In P P :pre +pair_coeff * * snap InP.snapcoeff InP.snapparam In In P P :pre The 1st 2 arguments must be * * so as to span all LAMMPS atom types. -The two filenames are for the element and parameter files, respectively. -The 'In' and 'P' arguments (between the file names) are the two elements -which will be extracted from the element file. The -two trailing 'In' arguments map LAMMPS atom types 1 and 2 to the +The two filenames are for the coefficient and parameter files, respectively. +The two trailing 'In' arguments map LAMMPS atom types 1 and 2 to the SNAP 'In' element. The two trailing 'P' arguments map LAMMPS atom types 3 and 4 to the SNAP 'P' element. @@ -79,10 +75,11 @@ This can be used when a {snap} potential is used as part of the {hybrid} pair style. The NULL values are placeholders for atom types that will be used with other potentials. -The name of the SNAP element file usually ends in the +The name of the SNAP coefficient file usually ends in the ".snapcoeff" extension. It may contain coefficients -for many SNAP elements. -Only those elements listed in the pair_coeff command are extracted. +for many SNAP elements. The only requirement is that it +contain at least those element names appearing in the +LAMMPS mapping list. The name of the SNAP parameter file usually ends in the ".snapparam" extension. It contains a small number of parameters that define the overall form of the SNAP potential. @@ -110,8 +107,7 @@ It is convenient to keep these commands in a separate file that can be inserted in any LAMMPS input script using the "include"_include.html command. -The top of the SNAP element file can contain any number of blank and comment -lines (start with #), but follows a strict +The top of the SNAP coefficient file can contain any number of blank and comment lines (start with #), but follows a strict format after that. The first non-blank non-comment line must contain two integers: diff --git a/examples/snap/Mo_Chen_PRM2017.snap b/examples/snap/Mo_Chen_PRM2017.snap deleted file mode 100644 index e5e5f3e180..0000000000 --- a/examples/snap/Mo_Chen_PRM2017.snap +++ /dev/null @@ -1,7 +0,0 @@ - -# DATE: 2017-09-18 CONTRIBUTOR: Chi Chen CITATION: C. Chen, Z. Deng, R. Tran, H. Tang, I.-H. Chu, S. P. Ong, "Accurate force field for molybdenum by machine learning large materials data" Physical Review Materials 1, 04 3603 (2017) -# Generated by Materials Virtual Lab -# Definition of SNAP potential. -pair_style snap -pair_coeff * * Mo_Chen_PRM2017.snapcoeff Mo Mo_Chen_PRM2017.snapparam Mo - diff --git a/examples/snap/Mo_Chen_PRM2017.snap b/examples/snap/Mo_Chen_PRM2017.snap new file mode 120000 index 0000000000..78422c66e2 --- /dev/null +++ b/examples/snap/Mo_Chen_PRM2017.snap @@ -0,0 +1 @@ +../../potentials/Mo_Chen_PRM2017.snap \ No newline at end of file diff --git a/examples/snap/Mo_Chen_PRM2017.snapcoeff b/examples/snap/Mo_Chen_PRM2017.snapcoeff deleted file mode 100644 index 577c45bd76..0000000000 --- a/examples/snap/Mo_Chen_PRM2017.snapcoeff +++ /dev/null @@ -1,35 +0,0 @@ -# DATE: 2017-09-18 CONTRIBUTOR: Chi Chen CITATION: C. Chen, Z. Deng, R. Tran, H. Tang, I.-H. Chu, S. P. Ong, "Accurate force field for molybdenum by machine learning large materials data" Physical Review Materials 1, 04 3603 (2017) -# Generated by Materials Virtual Lab -1 31 -Mo 0.5 1 --17.2757958404 -0.00431015861472 -0.0657685117891 -0.477733335702 -0.0152688837211 -0.77559888196 -0.284846429566 -0.148804982644 -0.0573702179736 -0.19281989434 -0.323441703578 -0.101324335724 -0.0139639846514 --0.0324444749083 -0.0349797952779 -0.0613023441282 -0.0881078513046 -0.118716074611 -0.0069662975532 --0.0174658914685 --0.0178902177779 -0.0195993756659 -0.0719238160707 -0.0344832661036 --0.0358616891662 --0.0292380783172 --0.0334933909866 -0.00595462520243 -0.0754556638328 --0.000972545258845 --0.0100170422751 diff --git a/examples/snap/Mo_Chen_PRM2017.snapcoeff b/examples/snap/Mo_Chen_PRM2017.snapcoeff new file mode 120000 index 0000000000..b2dfa99a06 --- /dev/null +++ b/examples/snap/Mo_Chen_PRM2017.snapcoeff @@ -0,0 +1 @@ +../../potentials/Mo_Chen_PRM2017.snapcoeff \ No newline at end of file diff --git a/examples/snap/Mo_Chen_PRM2017.snapparam b/examples/snap/Mo_Chen_PRM2017.snapparam deleted file mode 100644 index e618bc1dd4..0000000000 --- a/examples/snap/Mo_Chen_PRM2017.snapparam +++ /dev/null @@ -1,4 +0,0 @@ -# DATE: 2017-09-18 CONTRIBUTOR: Chi Chen CITATION: C. Chen, Z. Deng, R. Tran, H. Tang, I.-H. Chu, S. P. Ong, "Accurate force field for molybdenum by machine learning large materials data" Physical Review Materials 1, 04 3603 (2017) -# Generated by Materials Virtual Lab -rcutfac 4.615858 -twojmax 6 diff --git a/examples/snap/Mo_Chen_PRM2017.snapparam b/examples/snap/Mo_Chen_PRM2017.snapparam new file mode 120000 index 0000000000..b1dc628e01 --- /dev/null +++ b/examples/snap/Mo_Chen_PRM2017.snapparam @@ -0,0 +1 @@ +../../potentials/Mo_Chen_PRM2017.snapparam \ No newline at end of file diff --git a/examples/snap/Ta06A.snap b/examples/snap/Ta06A.snap deleted file mode 100644 index edcc002524..0000000000 --- a/examples/snap/Ta06A.snap +++ /dev/null @@ -1,17 +0,0 @@ -# DATE: 2014-09-05 CONTRIBUTOR: Aidan Thompson athomps@sandia.gov CITATION: Thompson, Swiler, Trott, Foiles and Tucker, arxiv.org, 1409.3880 (2014) - -# Definition of SNAP potential Ta_Cand06A -# Assumes 1 LAMMPS atom type - -variable zblcutinner equal 4 -variable zblcutouter equal 4.8 -variable zblz equal 73 - -# Specify hybrid with SNAP, ZBL - -pair_style hybrid/overlay & -zbl ${zblcutinner} ${zblcutouter} & -snap -pair_coeff 1 1 zbl ${zblz} ${zblz} -pair_coeff * * snap Ta06A.snapcoeff Ta Ta06A.snapparam Ta - diff --git a/examples/snap/Ta06A.snap b/examples/snap/Ta06A.snap new file mode 120000 index 0000000000..cc26b99d64 --- /dev/null +++ b/examples/snap/Ta06A.snap @@ -0,0 +1 @@ +../../potentials/Ta06A.snap \ No newline at end of file diff --git a/examples/snap/Ta06A.snapcoeff b/examples/snap/Ta06A.snapcoeff deleted file mode 100644 index ad2dfa4bc5..0000000000 --- a/examples/snap/Ta06A.snapcoeff +++ /dev/null @@ -1,37 +0,0 @@ -# DATE: 2014-09-05 CONTRIBUTOR: Aidan Thompson athomps@sandia.gov CITATION: Thompson, Swiler, Trott, Foiles and Tucker, arxiv.org, 1409.3880 (2014) - -# LAMMPS SNAP coefficients for Ta_Cand06A - -1 31 -Ta 0.5 1 --2.92477 --0.01137 --0.00775 --0.04907 --0.15047 -0.09157 -0.05590 -0.05785 --0.11615 --0.17122 --0.10583 -0.03941 --0.11284 -0.03939 --0.07331 --0.06582 --0.09341 --0.10587 --0.15497 -0.04820 -0.00205 -0.00060 --0.04898 --0.05084 --0.03371 --0.01441 --0.01501 --0.00599 --0.06373 -0.03965 -0.01072 diff --git a/examples/snap/Ta06A.snapcoeff b/examples/snap/Ta06A.snapcoeff new file mode 120000 index 0000000000..311d582ec6 --- /dev/null +++ b/examples/snap/Ta06A.snapcoeff @@ -0,0 +1 @@ +../../potentials/Ta06A.snapcoeff \ No newline at end of file diff --git a/examples/snap/Ta06A.snapparam b/examples/snap/Ta06A.snapparam deleted file mode 100644 index 283629d658..0000000000 --- a/examples/snap/Ta06A.snapparam +++ /dev/null @@ -1,15 +0,0 @@ -# DATE: 2014-09-05 CONTRIBUTOR: Aidan Thompson athomps@sandia.gov CITATION: Thompson, Swiler, Trott, Foiles and Tucker, arxiv.org, 1409.3880 (2014) - -# LAMMPS SNAP parameters for Ta_Cand06A - -# required -rcutfac 4.67637 -twojmax 6 - -# optional - -rfac0 0.99363 -rmin0 0 -diagonalstyle 3 -bzeroflag 0 -quadraticflag 0 diff --git a/examples/snap/Ta06A.snapparam b/examples/snap/Ta06A.snapparam new file mode 120000 index 0000000000..e697069cba --- /dev/null +++ b/examples/snap/Ta06A.snapparam @@ -0,0 +1 @@ +../../potentials/Ta06A.snapparam \ No newline at end of file diff --git a/examples/snap/W_2940_2017_2.snap b/examples/snap/W_2940_2017_2.snap deleted file mode 100644 index 04b8d58094..0000000000 --- a/examples/snap/W_2940_2017_2.snap +++ /dev/null @@ -1,16 +0,0 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] -# -# Definition of SNAP+ZBL potential. -variable zblcutinner equal 4 -variable zblcutouter equal 4.8 -variable zblz equal 74 - -# Specify hybrid with SNAP and ZBL - -pair_style hybrid/overlay & -zbl ${zblcutinner} ${zblcutouter} & -snap -pair_coeff 1 1 zbl ${zblz} ${zblz} -pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W - -#Nomenclature on the snap files are Element_DakotaID_Year_Month diff --git a/examples/snap/W_2940_2017_2.snap b/examples/snap/W_2940_2017_2.snap new file mode 120000 index 0000000000..907ee91562 --- /dev/null +++ b/examples/snap/W_2940_2017_2.snap @@ -0,0 +1 @@ +../../potentials/W_2940_2017_2.snap \ No newline at end of file diff --git a/examples/snap/W_2940_2017_2.snapcoeff b/examples/snap/W_2940_2017_2.snapcoeff deleted file mode 100644 index dcfea3feaf..0000000000 --- a/examples/snap/W_2940_2017_2.snapcoeff +++ /dev/null @@ -1,62 +0,0 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] -# -# LAMMPS SNAP coefficients for W - -1 56 -W 0.5 1 - 0.781170857801 - -0.001794941735 - -0.016628679036 - -0.066625537037 - -0.073716343967 - -0.062913923923 - 0.032552694672 - -0.134901744419 - -0.075076334103 - -0.148558616547 - -0.140808831101 - -0.166749145704 - -0.047487675984 - -0.049892090603 - -0.032483739965 - -0.114766534860 - -0.106759718242 - -0.125894850485 - -0.103409735225 - -0.095247335447 - -0.061998736346 - -0.053895610976 - -0.010799734206 - -0.011644828900 - -0.028316826924 - 0.011176085541 - 0.064619474684 - -0.023886279996 - -0.004099224312 - -0.056084222496 - -0.035551497650 - -0.056678501024 - -0.004905851656 - -0.015701146162 - -0.008462280779 - 0.016429018676 - 0.032432633993 - -0.010805361272 - -0.014841893457 - 0.019414134562 - -0.008112452759 - -0.002700775447 - 0.007032887063 - -0.009706065042 - 0.008385967833 - 0.028606085876 - -0.007003591067 - 0.006467260152 - -0.006666986361 - 0.029243285316 - 0.002477673872 - -0.000199497504 - 0.004068954075 - 0.006036129972 - -0.013010633924 - -0.008314173699 diff --git a/examples/snap/W_2940_2017_2.snapcoeff b/examples/snap/W_2940_2017_2.snapcoeff new file mode 120000 index 0000000000..5eff37c936 --- /dev/null +++ b/examples/snap/W_2940_2017_2.snapcoeff @@ -0,0 +1 @@ +../../potentials/W_2940_2017_2.snapcoeff \ No newline at end of file diff --git a/examples/snap/W_2940_2017_2.snapparam b/examples/snap/W_2940_2017_2.snapparam deleted file mode 100644 index 27ab61a266..0000000000 --- a/examples/snap/W_2940_2017_2.snapparam +++ /dev/null @@ -1,13 +0,0 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] -# -# required -rcutfac 4.73442 -twojmax 8 - -# optional - -rfac0 0.99363 -rmin0 0 -diagonalstyle 3 -bzeroflag 0 -quadraticflag 0 diff --git a/examples/snap/W_2940_2017_2.snapparam b/examples/snap/W_2940_2017_2.snapparam new file mode 120000 index 0000000000..af9dec2e52 --- /dev/null +++ b/examples/snap/W_2940_2017_2.snapparam @@ -0,0 +1 @@ +../../potentials/W_2940_2017_2.snapparam \ No newline at end of file diff --git a/examples/snap/W_2940_2017_2_He_JW2013.snap b/examples/snap/W_2940_2017_2_He_JW2013.snap deleted file mode 100644 index cb70916ec4..0000000000 --- a/examples/snap/W_2940_2017_2_He_JW2013.snap +++ /dev/null @@ -1,17 +0,0 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] -# -# Definition of SNAP+ZBL+Tabulated potential. -variable zblcutinner equal 4 -variable zblcutouter equal 4.8 -variable zblz equal 74 - -# Specify hybrid with SNAP and ZBL - -pair_style hybrid/overlay zbl ${zblcutinner} ${zblcutouter} snap table spline 10000 table spline 10000 -pair_coeff 1 1 zbl ${zblz} ${zblz} -pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W NULL -pair_coeff 2 2 table 1 He_He_JW2013.table HeHe -pair_coeff 1 2 table 2 W_He_JW2013.table WHe -#Hybrid/overlay will take all pair styles and add their contributions equally, order of pair_coeff doesnt matter here -#This is not the case for pair_style hybrid ... where only one pair_coeff is read for each type combination, order matters here. - diff --git a/examples/snap/W_2940_2017_2_He_JW2013.snap b/examples/snap/W_2940_2017_2_He_JW2013.snap new file mode 120000 index 0000000000..5e0f21ab3b --- /dev/null +++ b/examples/snap/W_2940_2017_2_He_JW2013.snap @@ -0,0 +1 @@ +../../potentials/W_2940_2017_2_He_JW2013.snap \ No newline at end of file diff --git a/potentials/Mo_Chen_PRM2017.snap b/potentials/Mo_Chen_PRM2017.snap index 579315b3dd..05d642358e 100644 --- a/potentials/Mo_Chen_PRM2017.snap +++ b/potentials/Mo_Chen_PRM2017.snap @@ -1,6 +1,7 @@ + # DATE: 2017-09-18 CONTRIBUTOR: Chi Chen CITATION: C. Chen, Z. Deng, R. Tran, H. Tang, I.-H. Chu, S. P. Ong, "Accurate force field for molybdenum by machine learning large materials data" Physical Review Materials 1, 04 3603 (2017) # Generated by Materials Virtual Lab # Definition of SNAP potential. pair_style snap -pair_coeff * * Mo_Chen_PRM2017.snapcoeff Mo Mo_Chen_PRM2017.snapparam Mo +pair_coeff * * Mo_Chen_PRM2017.snapcoeff Mo_Chen_PRM2017.snapparam Mo diff --git a/potentials/Ta06A.snap b/potentials/Ta06A.snap index 43ce31fdcc..d9feae0b46 100644 --- a/potentials/Ta06A.snap +++ b/potentials/Ta06A.snap @@ -2,7 +2,7 @@ # Definition of SNAP potential Ta_Cand06A # Assumes 1 LAMMPS atom type - + variable zblcutinner equal 4 variable zblcutouter equal 4.8 variable zblz equal 73 @@ -13,5 +13,5 @@ pair_style hybrid/overlay & zbl ${zblcutinner} ${zblcutouter} & snap pair_coeff 1 1 zbl ${zblz} ${zblz} -pair_coeff * * snap Ta06A.snapcoeff Ta Ta06A.snapparam Ta +pair_coeff * * snap Ta06A.snapcoeff Ta06A.snapparam Ta diff --git a/potentials/Ta06A.snapparam b/potentials/Ta06A.snapparam index 0627253341..283629d658 100644 --- a/potentials/Ta06A.snapparam +++ b/potentials/Ta06A.snapparam @@ -8,7 +8,8 @@ twojmax 6 # optional -gamma 1 rfac0 0.99363 rmin0 0 diagonalstyle 3 +bzeroflag 0 +quadraticflag 0 diff --git a/potentials/W_2940_2017_2.snap b/potentials/W_2940_2017_2.snap index 51eee41a0a..93c2bf866a 100644 --- a/potentials/W_2940_2017_2.snap +++ b/potentials/W_2940_2017_2.snap @@ -5,12 +5,12 @@ variable zblcutinner equal 4 variable zblcutouter equal 4.8 variable zblz equal 74 -# Specify hybrid with SNAP, ZBL, and long-range Coulomb +# Specify hybrid with SNAP and ZBL pair_style hybrid/overlay & zbl ${zblcutinner} ${zblcutouter} & snap pair_coeff 1 1 zbl ${zblz} ${zblz} -pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W +pair_coeff * * snap W_2940_2017_2.snapcoeff W_2940_2017_2.snapparam W #Nomenclature on the snap files are Element_DakotaID_Year_Month diff --git a/potentials/W_2940_2017_2.snapparam b/potentials/W_2940_2017_2.snapparam index e0b20005e6..27ab61a266 100644 --- a/potentials/W_2940_2017_2.snapparam +++ b/potentials/W_2940_2017_2.snapparam @@ -6,7 +6,8 @@ twojmax 8 # optional -gamma 1 rfac0 0.99363 rmin0 0 diagonalstyle 3 +bzeroflag 0 +quadraticflag 0 diff --git a/potentials/W_2940_2017_2_He_JW2013.snap b/potentials/W_2940_2017_2_He_JW2013.snap index ff0827c138..7eb4f65401 100644 --- a/potentials/W_2940_2017_2_He_JW2013.snap +++ b/potentials/W_2940_2017_2_He_JW2013.snap @@ -5,11 +5,11 @@ variable zblcutinner equal 4 variable zblcutouter equal 4.8 variable zblz equal 74 -# Specify hybrid with SNAP, ZBL, and long-range Coulomb +# Specify hybrid with SNAP and ZBL pair_style hybrid/overlay zbl ${zblcutinner} ${zblcutouter} snap table spline 10000 table spline 10000 -pair_coeff 1 1 zbl ${zblz} ${zblz} -pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W NULL +pair_coeff 1 1 zbl ${zblz} ${zblz} +pair_coeff * * snap W_2940_2017_2.snapcoeff W_2940_2017_2.snapparam W NULL pair_coeff 2 2 table 1 He_He_JW2013.table HeHe pair_coeff 1 2 table 2 W_He_JW2013.table WHe #Hybrid/overlay will take all pair styles and add their contributions equally, order of pair_coeff doesnt matter here diff --git a/src/SNAP/pair_snap.cpp b/src/SNAP/pair_snap.cpp index 9f4c6bf5e2..81c5e9f6d1 100644 --- a/src/SNAP/pair_snap.cpp +++ b/src/SNAP/pair_snap.cpp @@ -1416,11 +1416,7 @@ void PairSNAP::settings(int narg, char **arg) void PairSNAP::coeff(int narg, char **arg) { - // read SNAP element names between 2 filenames - // nelements = # of SNAP elements - // elements = list of unique element names - - if (narg < 6) error->all(FLERR,"Incorrect args for pair coefficients"); + if (narg < 5) error->all(FLERR,"Incorrect args for pair coefficients"); if (!allocated) allocate(); if (nelements) { @@ -1432,30 +1428,17 @@ void PairSNAP::coeff(int narg, char **arg) memory->destroy(coeffelem); } - nelements = narg - 4 - atom->ntypes; - if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients"); - char* type1 = arg[0]; char* type2 = arg[1]; char* coefffilename = arg[2]; - char** elemlist = &arg[3]; - char* paramfilename = arg[3+nelements]; - char** elemtypes = &arg[4+nelements]; + char* paramfilename = arg[3]; + char** elemtypes = &arg[4]; // insure I,J args are * * if (strcmp(type1,"*") != 0 || strcmp(type2,"*") != 0) error->all(FLERR,"Incorrect args for pair coefficients"); - elements = new char*[nelements]; - - for (int i = 0; i < nelements; i++) { - char* elemname = elemlist[i]; - int n = strlen(elemname) + 1; - elements[i] = new char[n]; - strcpy(elements[i],elemname); - } - // read snapcoeff and snapparam files read_files(coefffilename,paramfilename); @@ -1631,22 +1614,19 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) iword = 1; words[iword] = strtok(NULL,"' \t\n\r\f"); - int nelemfile = atoi(words[0]); + nelements = atoi(words[0]); ncoeffall = atoi(words[1]); - // Set up element lists + // set up element lists + elements = new char*[nelements]; memory->create(radelem,nelements,"pair:radelem"); memory->create(wjelem,nelements,"pair:wjelem"); memory->create(coeffelem,nelements,ncoeffall,"pair:coeffelem"); - int *found = new int[nelements]; - for (int ielem = 0; ielem < nelements; ielem++) - found[ielem] = 0; + // Loop over nelements blocks in the SNAP coefficient file - // Loop over elements in the SNAP coefficient file - - for (int ielemfile = 0; ielemfile < nelemfile; ielemfile++) { + for (int ielem = 0; ielem < nelements; ielem++) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); @@ -1673,33 +1653,12 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) words[iword] = strtok(NULL,"' \t\n\r\f"); char* elemtmp = words[0]; - double radtmp = atof(words[1]); - double wjtmp = atof(words[2]); + int n = strlen(elemtmp) + 1; + elements[ielem] = new char[n]; + strcpy(elements[ielem],elemtmp); - // skip if element name isn't in element list - - int ielem; - for (ielem = 0; ielem < nelements; ielem++) - if (strcmp(elemtmp,elements[ielem]) == 0) break; - if (ielem == nelements) { - if (comm->me == 0) - for (int icoeff = 0; icoeff < ncoeffall; icoeff++) - ptr = fgets(line,MAXLINE,fpcoeff); - continue; - } - - // skip if element already appeared - - if (found[ielem]) { - if (comm->me == 0) - for (int icoeff = 0; icoeff < ncoeffall; icoeff++) - ptr = fgets(line,MAXLINE,fpcoeff); - continue; - } - - found[ielem] = 1; - radelem[ielem] = radtmp; - wjelem[ielem] = wjtmp; + radelem[ielem] = atof(words[1]); + wjelem[ielem] = atof(words[2]); if (comm->me == 0) { @@ -1821,7 +1780,6 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) if (rcutfacflag == 0 || twojmaxflag == 0) error->all(FLERR,"Incorrect SNAP parameter file"); - delete[] found; } /* ---------------------------------------------------------------------- diff --git a/src/SNAP/pair_snap.h b/src/SNAP/pair_snap.h index d39cb0f8d4..1fa065755c 100644 --- a/src/SNAP/pair_snap.h +++ b/src/SNAP/pair_snap.h @@ -173,4 +173,8 @@ E: Incorrect format in SNAP parameter file Incorrect number of words per line in the parameter file. +E: Did not find all elements in SNAP coefficient file. + +One or more elements listed in the pair_coeff command were not found in the coefficient file. + */ From 00d719459f267c7756fb87b50a0b6507d88faf4e Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Tue, 4 Dec 2018 17:46:31 -0700 Subject: [PATCH 22/94] Fixed one error --- doc/src/pair_snap.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/src/pair_snap.txt b/doc/src/pair_snap.txt index 16cf0313c5..a796cfdeba 100644 --- a/doc/src/pair_snap.txt +++ b/doc/src/pair_snap.txt @@ -100,8 +100,7 @@ by the following commands: zbl $\{zblcutinner\} $\{zblcutouter\} snap pair_coeff * * zbl 0.0 pair_coeff 1 1 zbl $\{zblz\} - pair_coeff * * snap ../potentials/Ta06A.snapcoeff Ta & - ../potentials/Ta06A.snapparam Ta :pre + pair_coeff * * snap Ta06A.snapcoeff Ta06A.snapparam Ta :pre It is convenient to keep these commands in a separate file that can be inserted in any LAMMPS input script using the "include"_include.html From afaaf442d3d4d3debc5bbcbf82971f696acf3fba Mon Sep 17 00:00:00 2001 From: jrgissing Date: Thu, 6 Dec 2018 21:32:10 -0700 Subject: [PATCH 23/94] bond/react doc tweaks 2 --- doc/src/fix_bond_react.txt | 2 +- doc/utils/sphinx-config/false_positives.txt | 1 + src/USER-MISC/fix_bond_react.cpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/src/fix_bond_react.txt b/doc/src/fix_bond_react.txt index 5d6349a426..8f71cd14ec 100644 --- a/doc/src/fix_bond_react.txt +++ b/doc/src/fix_bond_react.txt @@ -318,7 +318,7 @@ unwanted by-products. Therefore, bond/react provides the option to delete a user-specified set of atoms. These pre-reaction atoms are identified in the map file. A deleted atom must still be included in the post-reaction molecule template, in which it cannot be bonded to -an undeleted atom. In addition to deleting unwanted reaction +an atom that is not deleted. In addition to deleting unwanted reaction by-products, this feature can be used to remove specific topologies, such as small rings, that may be otherwise indistinguishable. diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index de60206304..aab1dc12f8 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -507,6 +507,7 @@ deepskyblue defgrad deformable del +deleteIDs Dellago delocalization delocalized diff --git a/src/USER-MISC/fix_bond_react.cpp b/src/USER-MISC/fix_bond_react.cpp index 50efca8d09..600bb6a540 100644 --- a/src/USER-MISC/fix_bond_react.cpp +++ b/src/USER-MISC/fix_bond_react.cpp @@ -1653,13 +1653,13 @@ void FixBondReact::find_landlocked_atoms(int myrxn) } } - // additionally, if a deleted atom is bonded to a undeleted atom, bad + // additionally, if a deleted atom is bonded to an atom that is not deleted, bad for (int i = 0; i < onemol->natoms; i++) { if (delete_atoms[i][myrxn] == 1) { int ii = reverse_equiv[i][1][myrxn] - 1; for (int j = 0; j < twomol_nxspecial[ii][0]; j++) { if (delete_atoms[equivalences[twomol_xspecial[ii][j]-1][1][myrxn]-1][myrxn] == 0) { - error->one(FLERR,"A deleted atom cannot be bonded to an undeleted atom"); + error->one(FLERR,"A deleted atom cannot remain bonded to an atom that is not deleted"); } } } From 8b5887bfb1513fc79489d28baaf04b4b6ed6baa0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 12:05:29 -0500 Subject: [PATCH 24/94] remove MEAM and REAX from lib folder --- lib/README | 4 - lib/meam/.depend | 9 - lib/meam/.gitignore | 1 - lib/meam/Install.py | 1 - lib/meam/Makefile.g95 | 57 - lib/meam/Makefile.gfortran | 61 - lib/meam/Makefile.ifort | 57 - lib/meam/Makefile.lammps.empty | 5 - lib/meam/Makefile.lammps.gfortran | 5 - lib/meam/Makefile.lammps.glory | 5 - lib/meam/Makefile.lammps.ifort | 5 - lib/meam/Makefile.mpi | 61 - lib/meam/Makefile.pgf90 | 57 - lib/meam/Makefile.serial | 1 - lib/meam/Makefile.tbird | 59 - lib/meam/README | 51 - lib/meam/fm_exp.c | 133 - lib/meam/meam_cleanup.F | 26 - lib/meam/meam_data.F | 87 - lib/meam/meam_dens_final.F | 296 --- lib/meam/meam_dens_init.F | 564 ---- lib/meam/meam_force.F | 608 ----- lib/meam/meam_setup_done.F | 1041 -------- lib/meam/meam_setup_global.F | 111 - lib/meam/meam_setup_param.F | 204 -- lib/reax/Install.py | 1 - lib/reax/Makefile.g95 | 51 - lib/reax/Makefile.gfortran | 51 - lib/reax/Makefile.ifort | 51 - lib/reax/Makefile.lammps.empty | 5 - lib/reax/Makefile.lammps.gfortran | 5 - lib/reax/Makefile.lammps.ifort | 6 - lib/reax/Makefile.mpi | 51 - lib/reax/Makefile.pgf90 | 51 - lib/reax/Makefile.redsky | 51 - lib/reax/Makefile.serial | 1 - lib/reax/Makefile.tbird | 51 - lib/reax/README | 78 - lib/reax/cbka.blk | 116 - lib/reax/cbkabo.blk | 4 - lib/reax/cbkatomcoord.blk | 3 - lib/reax/cbkbo.blk | 3 - lib/reax/cbkboncor.blk | 5 - lib/reax/cbkbopi.blk | 3 - lib/reax/cbkbopi2.blk | 3 - lib/reax/cbkbosi.blk | 4 - lib/reax/cbkc.blk | 5 - lib/reax/cbkch.blk | 4 - lib/reax/cbkcha.blk | 5 - lib/reax/cbkcharmol.blk | 4 - lib/reax/cbkchb.blk | 3 - lib/reax/cbkconst.blk | 5 - lib/reax/cbkcovbon.blk | 7 - lib/reax/cbkd.blk | 7 - lib/reax/cbkdbodc.blk | 3 - lib/reax/cbkdbopi2ndc.blk | 6 - lib/reax/cbkdbopidc.blk | 5 - lib/reax/cbkdbopindc.blk | 6 - lib/reax/cbkdcell.blk | 5 - lib/reax/cbkdhdc.blk | 5 - lib/reax/cbkdistan.blk | 4 - lib/reax/cbkdrdc.blk | 5 - lib/reax/cbkefield.blk | 4 - lib/reax/cbkenergies.blk | 7 - lib/reax/cbkeregime.blk | 5 - lib/reax/cbkff.blk | 9 - lib/reax/cbkfftorang.blk | 8 - lib/reax/cbkh.blk | 5 - lib/reax/cbkhbond.blk | 5 - lib/reax/cbkia.blk | 6 - lib/reax/cbkidbo.blk | 7 - lib/reax/cbkimove.blk | 6 - lib/reax/cbkinit.blk | 6 - lib/reax/cbklonpar.blk | 5 - lib/reax/cbkmolec.blk | 6 - lib/reax/cbknmolat.blk | 6 - lib/reax/cbknonbon.blk | 6 - lib/reax/cbknubon2.blk | 5 - lib/reax/cbknvlbo.blk | 4 - lib/reax/cbknvlown.blk | 2 - lib/reax/cbkpairs.blk | 4 - lib/reax/cbkpres.blk | 4 - lib/reax/cbkqa.blk | 5 - lib/reax/cbkrbo.blk | 5 - lib/reax/cbkrestr.blk | 12 - lib/reax/cbksrtbon1.blk | 13 - lib/reax/cbksrthb.blk | 10 - lib/reax/cbktorang.blk | 5 - lib/reax/cbktorsion.blk | 7 - lib/reax/cbktregime.blk | 8 - lib/reax/cbkvalence.blk | 5 - lib/reax/cbkvregime.blk | 7 - lib/reax/cellcoord.blk | 4 - lib/reax/control.blk | 12 - lib/reax/opt.blk | 23 - lib/reax/reax_charges.F | 85 - lib/reax/reax_connect.F | 1547 ----------- lib/reax/reax_defs.h | 70 - lib/reax/reax_inout.F | 3870 ---------------------------- lib/reax/reax_lammps.F | 392 --- lib/reax/reax_poten.F | 3985 ----------------------------- lib/reax/reax_reac.F | 312 --- lib/reax/small.blk | 5 - lib/reax/valang.blk | 9 - 104 files changed, 14683 deletions(-) delete mode 100644 lib/meam/.depend delete mode 100644 lib/meam/.gitignore delete mode 120000 lib/meam/Install.py delete mode 100644 lib/meam/Makefile.g95 delete mode 100644 lib/meam/Makefile.gfortran delete mode 100644 lib/meam/Makefile.ifort delete mode 100644 lib/meam/Makefile.lammps.empty delete mode 100644 lib/meam/Makefile.lammps.gfortran delete mode 100644 lib/meam/Makefile.lammps.glory delete mode 100644 lib/meam/Makefile.lammps.ifort delete mode 100644 lib/meam/Makefile.mpi delete mode 100644 lib/meam/Makefile.pgf90 delete mode 120000 lib/meam/Makefile.serial delete mode 100644 lib/meam/Makefile.tbird delete mode 100644 lib/meam/README delete mode 100644 lib/meam/fm_exp.c delete mode 100644 lib/meam/meam_cleanup.F delete mode 100644 lib/meam/meam_data.F delete mode 100644 lib/meam/meam_dens_final.F delete mode 100644 lib/meam/meam_dens_init.F delete mode 100644 lib/meam/meam_force.F delete mode 100644 lib/meam/meam_setup_done.F delete mode 100644 lib/meam/meam_setup_global.F delete mode 100644 lib/meam/meam_setup_param.F delete mode 120000 lib/reax/Install.py delete mode 100644 lib/reax/Makefile.g95 delete mode 100644 lib/reax/Makefile.gfortran delete mode 100644 lib/reax/Makefile.ifort delete mode 100644 lib/reax/Makefile.lammps.empty delete mode 100644 lib/reax/Makefile.lammps.gfortran delete mode 100644 lib/reax/Makefile.lammps.ifort delete mode 100644 lib/reax/Makefile.mpi delete mode 100644 lib/reax/Makefile.pgf90 delete mode 100644 lib/reax/Makefile.redsky delete mode 120000 lib/reax/Makefile.serial delete mode 100644 lib/reax/Makefile.tbird delete mode 100644 lib/reax/README delete mode 100644 lib/reax/cbka.blk delete mode 100644 lib/reax/cbkabo.blk delete mode 100644 lib/reax/cbkatomcoord.blk delete mode 100644 lib/reax/cbkbo.blk delete mode 100644 lib/reax/cbkboncor.blk delete mode 100644 lib/reax/cbkbopi.blk delete mode 100644 lib/reax/cbkbopi2.blk delete mode 100644 lib/reax/cbkbosi.blk delete mode 100644 lib/reax/cbkc.blk delete mode 100644 lib/reax/cbkch.blk delete mode 100644 lib/reax/cbkcha.blk delete mode 100644 lib/reax/cbkcharmol.blk delete mode 100644 lib/reax/cbkchb.blk delete mode 100644 lib/reax/cbkconst.blk delete mode 100644 lib/reax/cbkcovbon.blk delete mode 100644 lib/reax/cbkd.blk delete mode 100644 lib/reax/cbkdbodc.blk delete mode 100644 lib/reax/cbkdbopi2ndc.blk delete mode 100644 lib/reax/cbkdbopidc.blk delete mode 100644 lib/reax/cbkdbopindc.blk delete mode 100644 lib/reax/cbkdcell.blk delete mode 100644 lib/reax/cbkdhdc.blk delete mode 100644 lib/reax/cbkdistan.blk delete mode 100644 lib/reax/cbkdrdc.blk delete mode 100644 lib/reax/cbkefield.blk delete mode 100644 lib/reax/cbkenergies.blk delete mode 100644 lib/reax/cbkeregime.blk delete mode 100644 lib/reax/cbkff.blk delete mode 100644 lib/reax/cbkfftorang.blk delete mode 100644 lib/reax/cbkh.blk delete mode 100644 lib/reax/cbkhbond.blk delete mode 100644 lib/reax/cbkia.blk delete mode 100644 lib/reax/cbkidbo.blk delete mode 100644 lib/reax/cbkimove.blk delete mode 100644 lib/reax/cbkinit.blk delete mode 100644 lib/reax/cbklonpar.blk delete mode 100644 lib/reax/cbkmolec.blk delete mode 100644 lib/reax/cbknmolat.blk delete mode 100644 lib/reax/cbknonbon.blk delete mode 100644 lib/reax/cbknubon2.blk delete mode 100644 lib/reax/cbknvlbo.blk delete mode 100644 lib/reax/cbknvlown.blk delete mode 100644 lib/reax/cbkpairs.blk delete mode 100644 lib/reax/cbkpres.blk delete mode 100644 lib/reax/cbkqa.blk delete mode 100644 lib/reax/cbkrbo.blk delete mode 100644 lib/reax/cbkrestr.blk delete mode 100644 lib/reax/cbksrtbon1.blk delete mode 100644 lib/reax/cbksrthb.blk delete mode 100644 lib/reax/cbktorang.blk delete mode 100644 lib/reax/cbktorsion.blk delete mode 100644 lib/reax/cbktregime.blk delete mode 100644 lib/reax/cbkvalence.blk delete mode 100644 lib/reax/cbkvregime.blk delete mode 100644 lib/reax/cellcoord.blk delete mode 100644 lib/reax/control.blk delete mode 100644 lib/reax/opt.blk delete mode 100644 lib/reax/reax_charges.F delete mode 100644 lib/reax/reax_connect.F delete mode 100644 lib/reax/reax_defs.h delete mode 100644 lib/reax/reax_inout.F delete mode 100644 lib/reax/reax_lammps.F delete mode 100644 lib/reax/reax_poten.F delete mode 100644 lib/reax/reax_reac.F delete mode 100644 lib/reax/small.blk delete mode 100644 lib/reax/valang.blk diff --git a/lib/README b/lib/README index 12c27b2a39..d89490e202 100644 --- a/lib/README +++ b/lib/README @@ -33,8 +33,6 @@ kokkos Kokkos package for GPU and many-core acceleration from Kokkos development team (Sandia) linalg set of BLAS and LAPACK routines needed by USER-ATC package from Axel Kohlmeyer (Temple U) -meam modified embedded atom method (MEAM) potential, MEAM package - from Greg Wagner (Sandia) message client/server communication library via MPI, sockets, files from Steve Plimpton (Sandia) molfile hooks to VMD molfile plugins, used by the USER-MOLFILE package @@ -51,8 +49,6 @@ qmmm quantum mechanics/molecular mechanics coupling interface from Axel Kohlmeyer (Temple U) quip interface to QUIP/libAtoms framework, USER-QUIP package from Albert Bartok-Partay and Gabor Csanyi (U Cambridge) -reax ReaxFF potential, REAX package - from Adri van Duin (Penn State) and Aidan Thompson (Sandia) smd hooks to Eigen library, used by USER-SMD package from Georg Ganzenmueller (Ernst Mach Institute, Germany) voronoi hooks to the Voro++ library, used by compute voronoi/atom command diff --git a/lib/meam/.depend b/lib/meam/.depend deleted file mode 100644 index 0945fba47a..0000000000 --- a/lib/meam/.depend +++ /dev/null @@ -1,9 +0,0 @@ -# dependencies. needed for parallel make -$(DIR)meam_data.o: meam_data.F -$(DIR)meam_cleanup.o: meam_cleanup.F $(DIR)meam_data.o -$(DIR)meam_dens_final.o: meam_dens_final.F $(DIR)meam_data.o -$(DIR)meam_dens_init.o: meam_dens_init.F $(DIR)meam_data.o -$(DIR)meam_force.o: meam_force.F $(DIR)meam_data.o -$(DIR)meam_setup_done.o: meam_setup_done.F $(DIR)meam_data.o -$(DIR)meam_setup_global.o: meam_setup_global.F $(DIR)meam_data.o -$(DIR)meam_setup_param.o: meam_setup_param.F $(DIR)meam_data.o diff --git a/lib/meam/.gitignore b/lib/meam/.gitignore deleted file mode 100644 index 63a7748cf4..0000000000 --- a/lib/meam/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.mod diff --git a/lib/meam/Install.py b/lib/meam/Install.py deleted file mode 120000 index ffe709d44c..0000000000 --- a/lib/meam/Install.py +++ /dev/null @@ -1 +0,0 @@ -../Install.py \ No newline at end of file diff --git a/lib/meam/Makefile.g95 b/lib/meam/Makefile.g95 deleted file mode 100644 index 91371441bd..0000000000 --- a/lib/meam/Makefile.g95 +++ /dev/null @@ -1,57 +0,0 @@ -# * -# *_________________________________________________________________________* -# * MEAM: MODEFIED EMBEDDED ATOM METHOD * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * AUTHORS: Greg Wagner, Sandia National Laboratories * -# * CONTACT: gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.gfortran - -# ------ FILES ------ - -SRC = meam_data.F meam_setup_done.F meam_setup_global.F meam_setup_param.F meam_dens_init.F meam_dens_final.F meam_force.F meam_cleanup.F - -FILES = $(SRC) Makefile - -# ------ DEFINITIONS ------ - -LIB = libmeam.a -OBJ = $(SRC:.F=.o) fm_exp.o - -# ------ SETTINGS ------ - -F90 = g95 -F90FLAGS = -O -fPIC -ARCHIVE = ar -ARCHFLAG = -rc -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F - $(F90) $(F90FLAGS) -c $< - -%.o:%.c - $(CC) $(F90FLAGS) -c $< - -include .depend -# ------ CLEAN ------ - -clean: - -rm *.o *.mod *~ $(LIB) - -tar: - -tar -cvf ../MEAM.tar $(FILES) diff --git a/lib/meam/Makefile.gfortran b/lib/meam/Makefile.gfortran deleted file mode 100644 index 509e4cebc3..0000000000 --- a/lib/meam/Makefile.gfortran +++ /dev/null @@ -1,61 +0,0 @@ -# * -# *_________________________________________________________________________* -# * MEAM: MODEFIED EMBEDDED ATOM METHOD * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * AUTHORS: Greg Wagner, Sandia National Laboratories * -# * CONTACT: gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.gfortran - -# ------ FILES ------ - -SRC = meam_data.F meam_setup_done.F meam_setup_global.F meam_setup_param.F meam_dens_init.F meam_dens_final.F meam_force.F meam_cleanup.F - -FILES = $(SRC) Makefile - -# ------ DEFINITIONS ------ - -LIB = libmeam.a -OBJ = $(SRC:.F=.o) fm_exp.o - -# ------ SETTINGS ------ - -F90 = gfortran -CC = gcc -F90FLAGS = -O3 -fPIC -ffast-math -ftree-vectorize -fexpensive-optimizations -fno-second-underscore -g -#F90FLAGS = -O -ARCHIVE = ar -ARCHFLAG = -rc -LINK = g++ -LINKFLAGS = -O -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F - $(F90) $(F90FLAGS) -c $< - -%.o:%.c - $(CC) $(F90FLAGS) -c $< - -include .depend -# ------ CLEAN ------ - -clean: - -rm *.o *.mod *~ $(LIB) - -tar: - -tar -cvf ../MEAM.tar $(FILES) diff --git a/lib/meam/Makefile.ifort b/lib/meam/Makefile.ifort deleted file mode 100644 index cd3bca9882..0000000000 --- a/lib/meam/Makefile.ifort +++ /dev/null @@ -1,57 +0,0 @@ -# * -# *_________________________________________________________________________* -# * MEAM: MODEFIED EMBEDDED ATOM METHOD * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * AUTHORS: Greg Wagner, Sandia National Laboratories * -# * CONTACT: gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.ifort - -# ------ FILES ------ - -SRC = meam_data.F meam_setup_done.F meam_setup_global.F meam_setup_param.F meam_dens_init.F meam_dens_final.F meam_force.F meam_cleanup.F - -FILES = $(SRC) Makefile - -# ------ DEFINITIONS ------ - -LIB = libmeam.a -OBJ = $(SRC:.F=.o) fm_exp.o - -# ------ SETTINGS ------ - -F90 = ifort -F90FLAGS = -O -fPIC -ARCHIVE = ar -ARCHFLAG = -rc -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F - $(F90) $(F90FLAGS) -c $< - -%.o:%.c - $(CC) $(F90FLAGS) -c $< - -include .depend -# ------ CLEAN ------ - -clean: - -rm *.o *.mod *~ $(LIB) - -tar: - -tar -cvf ../MEAM.tar $(FILES) diff --git a/lib/meam/Makefile.lammps.empty b/lib/meam/Makefile.lammps.empty deleted file mode 100644 index 10394b68ad..0000000000 --- a/lib/meam/Makefile.lammps.empty +++ /dev/null @@ -1,5 +0,0 @@ -# Settings that the LAMMPS build will import when this package library is used - -meam_SYSINC = -meam_SYSLIB = -meam_SYSPATH = diff --git a/lib/meam/Makefile.lammps.gfortran b/lib/meam/Makefile.lammps.gfortran deleted file mode 100644 index fa62c997dc..0000000000 --- a/lib/meam/Makefile.lammps.gfortran +++ /dev/null @@ -1,5 +0,0 @@ -# Settings that the LAMMPS build will import when this package library is used - -meam_SYSINC = -meam_SYSLIB = -lgfortran -meam_SYSPATH = diff --git a/lib/meam/Makefile.lammps.glory b/lib/meam/Makefile.lammps.glory deleted file mode 100644 index 153e699b72..0000000000 --- a/lib/meam/Makefile.lammps.glory +++ /dev/null @@ -1,5 +0,0 @@ -# Settings that the LAMMPS build will import when this package library is used - -meam_SYSINC = -meam_SYSLIB = -lifcore -lsvml -lompstub -limf -meam_SYSPATH = -L/opt/intel-11.1.046/lib/intel64 diff --git a/lib/meam/Makefile.lammps.ifort b/lib/meam/Makefile.lammps.ifort deleted file mode 100644 index bd4d98f929..0000000000 --- a/lib/meam/Makefile.lammps.ifort +++ /dev/null @@ -1,5 +0,0 @@ -# Settings that the LAMMPS build will import when this package library is used - -meam_SYSINC = -meam_SYSLIB = -lifcore -lsvml -lompstub -limf -meam_SYSPATH = -L/opt/intel/fce/10.0.023/lib diff --git a/lib/meam/Makefile.mpi b/lib/meam/Makefile.mpi deleted file mode 100644 index fd3dbde555..0000000000 --- a/lib/meam/Makefile.mpi +++ /dev/null @@ -1,61 +0,0 @@ -# * -# *_________________________________________________________________________* -# * MEAM: MODEFIED EMBEDDED ATOM METHOD * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * AUTHORS: Greg Wagner, Sandia National Laboratories * -# * CONTACT: gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.empty - -# ------ FILES ------ - -SRC = meam_data.F meam_setup_done.F meam_setup_global.F meam_setup_param.F meam_dens_init.F meam_dens_final.F meam_force.F meam_cleanup.F - -FILES = $(SRC) Makefile - -# ------ DEFINITIONS ------ - -LIB = libmeam.a -OBJ = $(SRC:.F=.o) fm_exp.o - -# ------ SETTINGS ------ - -F90 = mpifort -CC = mpicc -F90FLAGS = -O3 -fPIC -#F90FLAGS = -O -ARCHIVE = ar -ARCHFLAG = -rc -LINK = mpicxx -LINKFLAGS = -O -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F - $(F90) $(F90FLAGS) -c $< - -%.o:%.c - $(CC) $(F90FLAGS) -c $< - -include .depend -# ------ CLEAN ------ - -clean: - -rm *.o *.mod *~ $(LIB) - -tar: - -tar -cvf ../MEAM.tar $(FILES) diff --git a/lib/meam/Makefile.pgf90 b/lib/meam/Makefile.pgf90 deleted file mode 100644 index 32ce909f48..0000000000 --- a/lib/meam/Makefile.pgf90 +++ /dev/null @@ -1,57 +0,0 @@ -# * -# *_________________________________________________________________________* -# * MEAM: MODEFIED EMBEDDED ATOM METHOD * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * AUTHORS: Greg Wagner, Sandia National Laboratories * -# * CONTACT: gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.pgf90 - -# ------ FILES ------ - -SRC = meam_data.F meam_setup_done.F meam_setup_global.F meam_setup_param.F meam_dens_init.F meam_dens_final.F meam_force.F meam_cleanup.F - -FILES = $(SRC) Makefile - -# ------ DEFINITIONS ------ - -LIB = libmeam.a -OBJ = $(SRC:.F=.o) fm_exp.o - -# ------ SETTINGS ------ - -F90 = pgf90 -F90FLAGS = -O -fPIC -ARCHIVE = ar -ARCHFLAG = -rc -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F - $(F90) $(F90FLAGS) -c $< - -%.o:%.c - $(CC) $(F90FLAGS) -c $< - -include .depend -# ------ CLEAN ------ - -clean: - -rm *.o *.mod *~ $(LIB) - -tar: - -tar -cvf ../MEAM.tar $(FILES) diff --git a/lib/meam/Makefile.serial b/lib/meam/Makefile.serial deleted file mode 120000 index c52fbcb986..0000000000 --- a/lib/meam/Makefile.serial +++ /dev/null @@ -1 +0,0 @@ -Makefile.gfortran \ No newline at end of file diff --git a/lib/meam/Makefile.tbird b/lib/meam/Makefile.tbird deleted file mode 100644 index 7253d8305b..0000000000 --- a/lib/meam/Makefile.tbird +++ /dev/null @@ -1,59 +0,0 @@ -# * -# *_________________________________________________________________________* -# * MEAM: MODEFIED EMBEDDED ATOM METHOD * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * AUTHORS: Greg Wagner, Sandia National Laboratories * -# * CONTACT: gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.glory - -# ------ FILES ------ - -SRC = meam_data.F meam_setup_done.F meam_setup_global.F meam_setup_param.F meam_dens_init.F meam_dens_final.F meam_force.F meam_cleanup.F - -FILES = $(SRC) Makefile - -# ------ DEFINITIONS ------ - -LIB = libmeam.a -OBJ = $(SRC:.F=.o) fm_exp.o - -# ------ SETTINGS ------ - -F90 = mpif90 -F90FLAGS = -O -fPIC -ARCHIVE = ar -ARCHFLAG = -rc -LINK = g++ -LINKFLAGS = -O -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F - $(F90) $(F90FLAGS) -c $< - -%.o:%.c - $(CC) $(F90FLAGS) -c $< - -include .depend -# ------ CLEAN ------ - -clean: - -rm *.o *.mod *~ $(LIB) - -tar: - -tar -cvf ../MEAM.tar $(FILES) diff --git a/lib/meam/README b/lib/meam/README deleted file mode 100644 index b3111c1317..0000000000 --- a/lib/meam/README +++ /dev/null @@ -1,51 +0,0 @@ -MEAM (modified embedded atom method) library - -Greg Wagner, Sandia National Labs -gjwagne at sandia.gov -Jan 2007 - -This library is in implementation of the MEAM potential, specifically -designed to work with LAMMPS. - -------------------------------------------------- - -This directory has source files to build a library that LAMMPS -links against when using the MEAM package. - -This library must be built with a F90 compiler, before LAMMPS is -built, so LAMMPS can link against it. - -You can type "make lib-meam" from the src directory to see help on how -to build this library via make commands, or you can do the same thing -by typing "python Install.py" from within this directory, or you can -do it manually by following the instructions below. - -Build the library using one of the provided Makefile.* files or create -your own, specific to your compiler and system. For example: - -make -f Makefile.gfortran - -When you are done building this library, two files should -exist in this directory: - -libmeam.a the library LAMMPS will link against -Makefile.lammps settings the LAMMPS Makefile will import - -Makefile.lammps is created by the make command, by copying one of the -Makefile.lammps.* files. See the EXTRAMAKE setting at the top of the -Makefile.* files. - -IMPORTANT: You must examine the final Makefile.lammps to insure it is -correct for your system, else the LAMMPS build will likely fail. - -Makefile.lammps has settings for 3 variables: - -user-meam_SYSINC = leave blank for this package -user-meam_SYSLIB = auxiliary F90 libs needed to link a F90 lib with - a C++ program (LAMMPS) via a C++ compiler -user-meam_SYSPATH = path(s) to where those libraries are - -Because you have a F90 compiler on your system, you should have these -libraries. But you will have to figure out which ones are needed and -where they are. Examples of common configurations are in the -Makefile.lammps.* files. diff --git a/lib/meam/fm_exp.c b/lib/meam/fm_exp.c deleted file mode 100644 index 26d23b2e24..0000000000 --- a/lib/meam/fm_exp.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - Copyright (c) 2012,2013 Axel Kohlmeyer - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* faster versions of 2**x, e**x, and 10**x in single and double precision. - * - * Based on the Cephes math library 2.8 - */ - -#include -#include - -/* internal definitions for the fastermath library */ - -/* IEEE 754 double precision floating point data manipulation */ -typedef union -{ - double f; - uint64_t u; - struct {int32_t i0,i1;}; -} udi_t; -#define FM_DOUBLE_BIAS 1023 -#define FM_DOUBLE_EMASK 2146435072 -#define FM_DOUBLE_MBITS 20 -#define FM_DOUBLE_MMASK 1048575 -#define FM_DOUBLE_EZERO 1072693248 - -/* generate 2**num in floating point by bitshifting */ -#define FM_DOUBLE_INIT_EXP(var,num) \ - var.i0 = 0; \ - var.i1 = (((int) num) + FM_DOUBLE_BIAS) << 20 - -/* double precision constants */ -#define FM_DOUBLE_LOG2OFE 1.4426950408889634074 -#define FM_DOUBLE_LOGEOF2 6.9314718055994530942e-1 -#define FM_DOUBLE_LOG2OF10 3.32192809488736234789 -#define FM_DOUBLE_LOG10OF2 3.0102999566398119521e-1 -#define FM_DOUBLE_LOG10OFE 4.3429448190325182765e-1 -#define FM_DOUBLE_SQRT2 1.41421356237309504880 -#define FM_DOUBLE_SQRTH 0.70710678118654752440 - -/* optimizer friendly implementation of exp2(x). - * - * strategy: - * - * split argument into an integer part and a fraction: - * ipart = floor(x+0.5); - * fpart = x - ipart; - * - * compute exp2(ipart) from setting the ieee754 exponent - * compute exp2(fpart) using a pade' approximation for x in [-0.5;0.5[ - * - * the result becomes: exp2(x) = exp2(ipart) * exp2(fpart) - */ - -static const double fm_exp2_q[] = { -/* 1.00000000000000000000e0, */ - 2.33184211722314911771e2, - 4.36821166879210612817e3 -}; -static const double fm_exp2_p[] = { - 2.30933477057345225087e-2, - 2.02020656693165307700e1, - 1.51390680115615096133e3 -}; - -static double fm_exp2(double x) -{ - double ipart, fpart, px, qx; - udi_t epart; - - ipart = floor(x+0.5); - fpart = x - ipart; - FM_DOUBLE_INIT_EXP(epart,ipart); - - x = fpart*fpart; - - px = fm_exp2_p[0]; - px = px*x + fm_exp2_p[1]; - qx = x + fm_exp2_q[0]; - px = px*x + fm_exp2_p[2]; - qx = qx*x + fm_exp2_q[1]; - - px = px * fpart; - - x = 1.0 + 2.0*(px/(qx-px)); - return epart.f*x; -} - -double fm_exp_(double *x) -{ -#if defined(__BYTE_ORDER__) -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - return fm_exp2(FM_DOUBLE_LOG2OFE * (*x)); -#endif -#endif - return exp(*x); -} - -/* - * Local Variables: - * mode: c - * compile-command: "make -C .." - * c-basic-offset: 4 - * fill-column: 76 - * indent-tabs-mode: nil - * End: - */ diff --git a/lib/meam/meam_cleanup.F b/lib/meam/meam_cleanup.F deleted file mode 100644 index dce0c6469e..0000000000 --- a/lib/meam/meam_cleanup.F +++ /dev/null @@ -1,26 +0,0 @@ -c Declaration in pair_meam.h: -c -c void meam_cleanup() -c -c Call from PairMEAM destructor -c -c meam_cleanup() -c - - subroutine meam_cleanup - use meam_data - implicit none - - integer dealloc_error - - deallocate(phir,STAT=dealloc_error) - deallocate(phirar,STAT=dealloc_error) - deallocate(phirar1,STAT=dealloc_error) - deallocate(phirar2,STAT=dealloc_error) - deallocate(phirar3,STAT=dealloc_error) - deallocate(phirar4,STAT=dealloc_error) - deallocate(phirar5,STAT=dealloc_error) - deallocate(phirar6,STAT=dealloc_error) - - return - end diff --git a/lib/meam/meam_data.F b/lib/meam/meam_data.F deleted file mode 100644 index 719963bd59..0000000000 --- a/lib/meam/meam_data.F +++ /dev/null @@ -1,87 +0,0 @@ - - module meam_data - - integer, parameter :: maxelt = 5 - real*8 , external :: fm_exp - -c cutforce = force cutoff -c cutforcesq = force cutoff squared - - real*8 cutforce,cutforcesq - -c Ec_meam = cohesive energy -c re_meam = nearest-neighbor distance -c Omega_meam = atomic volume -c B_meam = bulk modulus -c Z_meam = number of first neighbors for reference structure -c ielt_meam = atomic number of element -c A_meam = adjustable parameter -c alpha_meam = sqrt(9*Omega*B/Ec) -c rho0_meam = density scaling parameter -c delta_meam = heat of formation for alloys -c beta[0-3]_meam = electron density constants -c t[0-3]_meam = coefficients on densities in Gamma computation -c rho_ref_meam = background density for reference structure -c ibar_meam(i) = selection parameter for Gamma function for elt i, -c lattce_meam(i,j) = lattce configuration for elt i or alloy (i,j) -c neltypes = maximum number of element type defined -c eltind = index number of pair (similar to Voigt notation; ij = ji) -c phir = pair potential function array -c phirar[1-6] = spline coeffs -c attrac_meam = attraction parameter in Rose energy -c repuls_meam = repulsion parameter in Rose energy -c nn2_meam = 1 if second nearest neighbors are to be computed, else 0 -c zbl_meam = 1 if zbl potential for small r to be use, else 0 -c emb_lin_neg = 1 if linear embedding function for rhob to be used, else 0 -c bkgd_dyn = 1 if reference densities follows Dynamo, else 0 -c Cmin_meam, Cmax_meam = min and max values in screening cutoff -c rc_meam = cutoff distance for meam -c delr_meam = cutoff region for meam -c ebound_meam = factor giving maximum boundary of sceen fcn ellipse -c augt1 = flag for whether t1 coefficient should be augmented -c ialloy = flag for newer alloy formulation (as in dynamo code) -c mix_ref_t = flag to recover "old" way of computing t in reference config -c erose_form = selection parameter for form of E_rose function -c gsmooth_factor = factor determining length of G smoothing region -c vind[23]D = Voight notation index maps for 2 and 3D -c v2D,v3D = array of factors to apply for Voight notation - -c nr,dr = pair function discretization parameters -c nrar,rdrar = spline coeff array parameters - - real*8 Ec_meam(maxelt,maxelt),re_meam(maxelt,maxelt) - real*8 Omega_meam(maxelt),Z_meam(maxelt) - real*8 A_meam(maxelt),alpha_meam(maxelt,maxelt),rho0_meam(maxelt) - real*8 delta_meam(maxelt,maxelt) - real*8 beta0_meam(maxelt),beta1_meam(maxelt) - real*8 beta2_meam(maxelt),beta3_meam(maxelt) - real*8 t0_meam(maxelt),t1_meam(maxelt) - real*8 t2_meam(maxelt),t3_meam(maxelt) - real*8 rho_ref_meam(maxelt) - integer ibar_meam(maxelt),ielt_meam(maxelt) - character*3 lattce_meam(maxelt,maxelt) - integer nn2_meam(maxelt,maxelt) - integer zbl_meam(maxelt,maxelt) - integer eltind(maxelt,maxelt) - integer neltypes - - real*8, allocatable :: phir(:,:) - - real*8, allocatable :: phirar(:,:),phirar1(:,:),phirar2(:,:), - $ phirar3(:,:),phirar4(:,:),phirar5(:,:),phirar6(:,:) - - real*8 attrac_meam(maxelt,maxelt),repuls_meam(maxelt,maxelt) - - real*8 Cmin_meam(maxelt,maxelt,maxelt) - real*8 Cmax_meam(maxelt,maxelt,maxelt) - real*8 rc_meam,delr_meam,ebound_meam(maxelt,maxelt) - integer augt1, ialloy, mix_ref_t, erose_form - integer emb_lin_neg, bkgd_dyn - real*8 gsmooth_factor - integer vind2D(3,3),vind3D(3,3,3) - integer v2D(6),v3D(10) - - integer nr,nrar - real*8 dr,rdrar - - end module diff --git a/lib/meam/meam_dens_final.F b/lib/meam/meam_dens_final.F deleted file mode 100644 index 098b00f296..0000000000 --- a/lib/meam/meam_dens_final.F +++ /dev/null @@ -1,296 +0,0 @@ -c Extern "C" declaration has the form: -c -c void meam_dens_final_(int *, int *, int *, int *, int *, double *, double *, -c int *, int *, int *, -c double *, double *, double *, double *, double *, double *, -c double *, double *, double *, double *, double *, double *, -c double *, double *, double *, double *, double *, int *); -c -c Call from pair_meam.cpp has the form: -c -c meam_dens_final_(&nlocal,&nmax,&eflag_either,&eflag_global,&eflag_atom, -c &eng_vdwl,eatom,ntype,type,fmap, -c &arho1[0][0],&arho2[0][0],arho2b,&arho3[0][0], -c &arho3b[0][0],&t_ave[0][0],&tsq_ave[0][0],gamma,dgamma1, -c dgamma2,dgamma3,rho,rho0,rho1,rho2,rho3,frhop,&errorflag); -c - - subroutine meam_dens_final(nlocal, nmax, - $ eflag_either, eflag_global, eflag_atom, eng_vdwl, eatom, - $ ntype, type, fmap, - $ Arho1, Arho2, Arho2b, Arho3, Arho3b, t_ave, tsq_ave, - $ Gamma, dGamma1, dGamma2, dGamma3, - $ rho, rho0, rho1, rho2, rho3, fp, errorflag) - - use meam_data - implicit none - - integer nlocal, nmax, eflag_either, eflag_global, eflag_atom - integer ntype, type, fmap - real*8 eng_vdwl, eatom, Arho1, Arho2 - real*8 Arho2b, Arho3, Arho3b - real*8 t_ave, tsq_ave - real*8 Gamma, dGamma1, dGamma2, dGamma3 - real*8 rho, rho0, rho1, rho2, rho3 - real*8 fp - integer errorflag - - dimension eatom(nmax) - dimension type(nmax), fmap(ntype) - dimension Arho1(3,nmax), Arho2(6,nmax), Arho2b(nmax) - dimension Arho3(10,nmax), Arho3b(3,nmax), t_ave(3,nmax) - dimension tsq_ave(3,nmax) - dimension Gamma(nmax), dGamma1(nmax), dGamma2(nmax) - dimension dGamma3(nmax), rho(nmax), rho0(nmax) - dimension rho1(nmax), rho2(nmax), rho3(nmax) - dimension fp(nmax) - - integer i, elti - integer m - real*8 rhob, G, dG, Gbar, dGbar, gam, shp(3), shpi(3), Z - real*8 B, denom, rho_bkgd - -c Complete the calculation of density - - do i = 1,nlocal - - elti = fmap(type(i)) - if (elti.gt.0) then - rho1(i) = 0.d0 - rho2(i) = -1.d0/3.d0*Arho2b(i)*Arho2b(i) - rho3(i) = 0.d0 - do m = 1,3 - rho1(i) = rho1(i) + Arho1(m,i)*Arho1(m,i) - rho3(i) = rho3(i) - 3.d0/5.d0*Arho3b(m,i)*Arho3b(m,i) - enddo - do m = 1,6 - rho2(i) = rho2(i) + v2D(m)*Arho2(m,i)*Arho2(m,i) - enddo - do m = 1,10 - rho3(i) = rho3(i) + v3D(m)*Arho3(m,i)*Arho3(m,i) - enddo - - if( rho0(i) .gt. 0.0 ) then - if (ialloy.eq.1) then - if (tsq_ave(1,i) .ne. 0.0d0) then - t_ave(1,i) = t_ave(1,i)/tsq_ave(1,i) - else - t_ave(1,i) = 0.0d0 - endif - if (tsq_ave(2,i) .ne. 0.0d0) then - t_ave(2,i) = t_ave(2,i)/tsq_ave(2,i) - else - t_ave(2,i) = 0.0d0 - endif - if (tsq_ave(3,i) .ne. 0.0d0) then - t_ave(3,i) = t_ave(3,i)/tsq_ave(3,i) - else - t_ave(3,i) = 0.0d0 - endif - else if (ialloy.eq.2) then - t_ave(1,i) = t1_meam(elti) - t_ave(2,i) = t2_meam(elti) - t_ave(3,i) = t3_meam(elti) - else - t_ave(1,i) = t_ave(1,i)/rho0(i) - t_ave(2,i) = t_ave(2,i)/rho0(i) - t_ave(3,i) = t_ave(3,i)/rho0(i) - endif - endif - - Gamma(i) = t_ave(1,i)*rho1(i) - $ + t_ave(2,i)*rho2(i) + t_ave(3,i)*rho3(i) - - if( rho0(i) .gt. 0.0 ) then - Gamma(i) = Gamma(i)/(rho0(i)*rho0(i)) - end if - - Z = Z_meam(elti) - - call G_gam(Gamma(i),ibar_meam(elti), - $ gsmooth_factor,G,errorflag) - if (errorflag.ne.0) return - call get_shpfcn(shp,lattce_meam(elti,elti)) - if (ibar_meam(elti).le.0) then - Gbar = 1.d0 - dGbar = 0.d0 - else - if (mix_ref_t.eq.1) then - gam = (t_ave(1,i)*shp(1)+t_ave(2,i)*shp(2) - $ +t_ave(3,i)*shp(3))/(Z*Z) - else - gam = (t1_meam(elti)*shp(1)+t2_meam(elti)*shp(2) - $ +t3_meam(elti)*shp(3))/(Z*Z) - endif - call G_gam(gam,ibar_meam(elti),gsmooth_factor, - $ Gbar,errorflag) - endif - rho(i) = rho0(i) * G - - if (mix_ref_t.eq.1) then - if (ibar_meam(elti).le.0) then - Gbar = 1.d0 - dGbar = 0.d0 - else - gam = (t_ave(1,i)*shp(1)+t_ave(2,i)*shp(2) - $ +t_ave(3,i)*shp(3))/(Z*Z) - call dG_gam(gam,ibar_meam(elti),gsmooth_factor, - $ Gbar,dGbar) - endif - rho_bkgd = rho0_meam(elti)*Z*Gbar - else - if (bkgd_dyn.eq.1) then - rho_bkgd = rho0_meam(elti)*Z - else - rho_bkgd = rho_ref_meam(elti) - endif - endif - rhob = rho(i)/rho_bkgd - denom = 1.d0/rho_bkgd - - call dG_gam(Gamma(i),ibar_meam(elti),gsmooth_factor,G,dG) - - dGamma1(i) = (G - 2*dG*Gamma(i))*denom - - if( rho0(i) .ne. 0.d0 ) then - dGamma2(i) = (dG/rho0(i))*denom - else - dGamma2(i) = 0.d0 - end if - -c dGamma3 is nonzero only if we are using the "mixed" rule for -c computing t in the reference system (which is not correct, but -c included for backward compatibility - if (mix_ref_t.eq.1) then - dGamma3(i) = rho0(i)*G*dGbar/(Gbar*Z*Z)*denom - else - dGamma3(i) = 0.0 - endif - - B = A_meam(elti)*Ec_meam(elti,elti) - - if( rhob .ne. 0.d0 ) then - if (emb_lin_neg.eq.1 .and. rhob.le.0) then - fp(i) = -B - else - fp(i) = B*(log(rhob)+1.d0) - endif - if (eflag_either.ne.0) then - if (eflag_global.ne.0) then - if (emb_lin_neg.eq.1 .and. rhob.le.0) then - eng_vdwl = eng_vdwl - B*rhob - else - eng_vdwl = eng_vdwl + B*rhob*log(rhob) - endif - endif - if (eflag_atom.ne.0) then - if (emb_lin_neg.eq.1 .and. rhob.le.0) then - eatom(i) = eatom(i) - B*rhob - else - eatom(i) = eatom(i) + B*rhob*log(rhob) - endif - endif - endif - else - if (emb_lin_neg.eq.1) then - fp(i) = -B - else - fp(i) = B - endif - endif - endif - enddo - - return - end - -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - - subroutine G_gam(Gamma,ibar,gsmooth_factor,G,errorflag) -c Compute G(Gamma) based on selection flag ibar: -c 0 => G = sqrt(1+Gamma) -c 1 => G = exp(Gamma/2) -c 2 => not implemented -c 3 => G = 2/(1+exp(-Gamma)) -c 4 => G = sqrt(1+Gamma) -c -5 => G = +-sqrt(abs(1+Gamma)) - use meam_data , only: fm_exp - implicit none - real*8 Gamma,G - real*8 gsmooth_factor, gsmooth_switchpoint - integer ibar, errorflag - if (ibar.eq.0.or.ibar.eq.4) then - gsmooth_switchpoint = -gsmooth_factor / (gsmooth_factor+1) - if (Gamma.lt.gsmooth_switchpoint) then -c e.g. gsmooth_factor is 99, then: -c gsmooth_switchpoint = -0.99 -c G = 0.01*(-0.99/Gamma)**99 - G = 1/(gsmooth_factor+1) - $ *(gsmooth_switchpoint/Gamma)**gsmooth_factor - G = sqrt(G) - else - G = sqrt(1.d0+Gamma) - endif - else if (ibar.eq.1) then - G = fm_exp(Gamma/2.d0) - else if (ibar.eq.3) then - G = 2.d0/(1.d0+exp(-Gamma)) - else if (ibar.eq.-5) then - if ((1.d0+Gamma).ge.0) then - G = sqrt(1.d0+Gamma) - else - G = -sqrt(-1.d0-Gamma) - endif - else - errorflag = 1 - endif - return - end - -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - - subroutine dG_gam(Gamma,ibar,gsmooth_factor,G,dG) -c Compute G(Gamma) and dG(gamma) based on selection flag ibar: -c 0 => G = sqrt(1+Gamma) -c 1 => G = fm_exp(Gamma/2) -c 2 => not implemented -c 3 => G = 2/(1+fm_exp(-Gamma)) -c 4 => G = sqrt(1+Gamma) -c -5 => G = +-sqrt(abs(1+Gamma)) - use meam_data , only: fm_exp - real*8 Gamma,G,dG - real*8 gsmooth_factor, gsmooth_switchpoint - integer ibar - if (ibar.eq.0.or.ibar.eq.4) then - gsmooth_switchpoint = -gsmooth_factor / (gsmooth_factor+1) - if (Gamma.lt.gsmooth_switchpoint) then -c e.g. gsmooth_factor is 99, then: -c gsmooth_switchpoint = -0.99 -c G = 0.01*(-0.99/Gamma)**99 - G = 1/(gsmooth_factor+1) - $ *(gsmooth_switchpoint/Gamma)**gsmooth_factor - G = sqrt(G) - dG = -gsmooth_factor*G/(2.0*Gamma) - else - G = sqrt(1.d0+Gamma) - dG = 1.d0/(2.d0*G) - endif - else if (ibar.eq.1) then - G = fm_exp(Gamma/2.d0) - dG = G/2.d0 - else if (ibar.eq.3) then - G = 2.d0/(1.d0+fm_exp(-Gamma)) - dG = G*(2.d0-G)/2 - else if (ibar.eq.-5) then - if ((1.d0+Gamma).ge.0) then - G = sqrt(1.d0+Gamma) - dG = 1.d0/(2.d0*G) - else - G = -sqrt(-1.d0-Gamma) - dG = -1.d0/(2.d0*G) - endif - endif - return - end - -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc diff --git a/lib/meam/meam_dens_init.F b/lib/meam/meam_dens_init.F deleted file mode 100644 index 2ca2558135..0000000000 --- a/lib/meam/meam_dens_init.F +++ /dev/null @@ -1,564 +0,0 @@ -c Extern "C" declaration has the form: -c -c void meam_dens_init_(int *, int *, int *, double *, int *, int *, int *, double *, -c int *, int *, int *, int *, -c double *, double *, double *, double *, double *, double *, -c double *, double *, double *, double *, double *, int *); -c -c -c Call from pair_meam.cpp has the form: -c -c meam_dens_init_(&i,&nmax,ntype,type,fmap,&x[0][0], -c &numneigh[i],firstneigh[i],&numneigh_full[i],firstneigh_full[i], -c &scrfcn[offset],&dscrfcn[offset],&fcpair[offset], -c rho0,&arho1[0][0],&arho2[0][0],arho2b, -c &arho3[0][0],&arho3b[0][0],&t_ave[0][0],&tsq_ave[0][0],&errorflag); -c - - subroutine meam_dens_init(i, nmax, - $ ntype, type, fmap, x, - $ numneigh, firstneigh, - $ numneigh_full, firstneigh_full, - $ scrfcn, dscrfcn, fcpair, rho0, arho1, arho2, arho2b, - $ arho3, arho3b, t_ave, tsq_ave, errorflag) - - use meam_data - implicit none - - integer i, nmax, ntype, type, fmap - real*8 x - integer numneigh, firstneigh, numneigh_full, firstneigh_full - real*8 scrfcn, dscrfcn, fcpair - real*8 rho0, arho1, arho2 - real*8 arho2b, arho3, arho3b, t_ave, tsq_ave - integer errorflag - integer j,jn - - dimension x(3,nmax) - dimension type(nmax), fmap(ntype) - dimension firstneigh(numneigh), firstneigh_full(numneigh_full) - dimension scrfcn(numneigh), dscrfcn(numneigh), fcpair(numneigh) - dimension rho0(nmax), arho1(3,nmax), arho2(6,nmax) - dimension arho2b(nmax), arho3(10,nmax), arho3b(3,nmax) - dimension t_ave(3,nmax), tsq_ave(3,nmax) - - errorflag = 0 - -c Compute screening function and derivatives - call getscreen(i, nmax, scrfcn, dscrfcn, fcpair, x, - $ numneigh, firstneigh, - $ numneigh_full, firstneigh_full, - $ ntype, type, fmap) - -c Calculate intermediate density terms to be communicated - call calc_rho1(i, nmax, ntype, type, fmap, x, - $ numneigh, firstneigh, - $ scrfcn, fcpair, rho0, arho1, arho2, arho2b, - $ arho3, arho3b, t_ave, tsq_ave) - - return - end - -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - - subroutine getscreen(i, nmax, scrfcn, dscrfcn, fcpair, x, - $ numneigh, firstneigh, - $ numneigh_full, firstneigh_full, - $ ntype, type, fmap) - - use meam_data - implicit none - - integer i, nmax - real*8 scrfcn, dscrfcn, fcpair, x - integer numneigh, firstneigh, numneigh_full, firstneigh_full - integer ntype, type, fmap - - dimension scrfcn(numneigh), dscrfcn(numneigh) - dimension fcpair(numneigh), x(3,nmax) - dimension firstneigh(numneigh), firstneigh_full(numneigh_full) - dimension type(nmax), fmap(ntype) - - integer jn,j,kn,k - integer elti,eltj,eltk - real*8 xitmp,yitmp,zitmp,delxij,delyij,delzij,rij2,rij - real*8 xjtmp,yjtmp,zjtmp,delxik,delyik,delzik,rik2,rik - real*8 xktmp,yktmp,zktmp,delxjk,delyjk,delzjk,rjk2,rjk - real*8 xik,xjk,sij,fcij,sfcij,dfcij,sikj,dfikj,cikj - real*8 Cmin,Cmax,delc,ebound,rbound,a,coef1,coef2 - real*8 coef1a,coef1b,coef2a,coef2b - real*8 dcikj - real*8 dC1a,dC1b,dC2a,dC2b - real*8 rnorm,fc,dfc,drinv - - drinv = 1.d0/delr_meam - elti = fmap(type(i)) - - if (elti.gt.0) then - - xitmp = x(1,i) - yitmp = x(2,i) - zitmp = x(3,i) - - do jn = 1,numneigh - j = firstneigh(jn) - - eltj = fmap(type(j)) - if (eltj.gt.0) then - -c First compute screening function itself, sij - xjtmp = x(1,j) - yjtmp = x(2,j) - zjtmp = x(3,j) - delxij = xjtmp - xitmp - delyij = yjtmp - yitmp - delzij = zjtmp - zitmp - rij2 = delxij*delxij + delyij*delyij + delzij*delzij - rij = sqrt(rij2) - if (rij.gt.rc_meam) then - fcij = 0.0 - dfcij = 0.d0 - sij = 0.d0 - else - rnorm = (rc_meam-rij)*drinv - call screen(i, j, nmax, x, rij2, sij, - $ numneigh_full, firstneigh_full, ntype, type, fmap) - call dfcut(rnorm,fc,dfc) - fcij = fc - dfcij = dfc*drinv - endif - -c Now compute derivatives - dscrfcn(jn) = 0.d0 - sfcij = sij*fcij - if (sfcij.eq.0.d0.or.sfcij.eq.1.d0) goto 100 - rbound = ebound_meam(elti,eltj) * rij2 - do kn = 1,numneigh_full - k = firstneigh_full(kn) - if (k.eq.j) goto 10 - eltk = fmap(type(k)) - if (eltk.eq.0) goto 10 - xktmp = x(1,k) - yktmp = x(2,k) - zktmp = x(3,k) - delxjk = xktmp - xjtmp - delyjk = yktmp - yjtmp - delzjk = zktmp - zjtmp - rjk2 = delxjk*delxjk + delyjk*delyjk + delzjk*delzjk - if (rjk2.gt.rbound) goto 10 - delxik = xktmp - xitmp - delyik = yktmp - yitmp - delzik = zktmp - zitmp - rik2 = delxik*delxik + delyik*delyik + delzik*delzik - if (rik2.gt.rbound) goto 10 - xik = rik2/rij2 - xjk = rjk2/rij2 - a = 1 - (xik-xjk)*(xik-xjk) -c if a < 0, then ellipse equation doesn't describe this case and -c atom k can't possibly screen i-j - if (a.le.0.d0) goto 10 - cikj = (2.d0*(xik+xjk) + a - 2.d0)/a - Cmax = Cmax_meam(elti,eltj,eltk) - Cmin = Cmin_meam(elti,eltj,eltk) - if (cikj.ge.Cmax) then - goto 10 -c Note that cikj may be slightly negative (within numerical -c tolerance) if atoms are colinear, so don't reject that case here -c (other negative cikj cases were handled by the test on "a" above) -c Note that we never have 0 ebound*rijsq, atom k is definitely outside the ellipse - rbound = ebound_meam(elti,eltj)*rijsq - - do nk = 1,numneigh_full - k = firstneigh_full(nk) - eltk = fmap(type(k)) - if (k.eq.j) goto 10 - delxjk = x(1,k) - x(1,j) - delyjk = x(2,k) - x(2,j) - delzjk = x(3,k) - x(3,j) - rjksq = delxjk*delxjk + delyjk*delyjk + delzjk*delzjk - if (rjksq.gt.rbound) goto 10 - delxik = x(1,k) - x(1,i) - delyik = x(2,k) - x(2,i) - delzik = x(3,k) - x(3,i) - riksq = delxik*delxik + delyik*delyik + delzik*delzik - if (riksq.gt.rbound) goto 10 - xik = riksq/rijsq - xjk = rjksq/rijsq - a = 1 - (xik-xjk)*(xik-xjk) -c if a < 0, then ellipse equation doesn't describe this case and -c atom k can't possibly screen i-j - if (a.le.0.d0) goto 10 - cikj = (2.d0*(xik+xjk) + a - 2.d0)/a - Cmax = Cmax_meam(elti,eltj,eltk) - Cmin = Cmin_meam(elti,eltj,eltk) - if (cikj.ge.Cmax) then - goto 10 -c note that cikj may be slightly negative (within numerical -c tolerance) if atoms are colinear, so don't reject that case here -c (other negative cikj cases were handled by the test on "a" above) - else if (cikj.le.Cmin) then - sij = 0.d0 - goto 20 - else - delc = Cmax - Cmin - cikj = (cikj-Cmin)/delc - call fcut(cikj,sikj) - endif - sij = sij * sikj - 10 continue - enddo - - 20 continue - - return - end - -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - - subroutine dsij(i,j,k,jn,nmax,numneigh,rij2,dsij1,dsij2, - $ ntype,type,fmap,x,scrfcn,fcpair) -c Inputs: i,j,k = id's of 3 atom triplet -c jn = id of i-j pair -c rij2 = squared distance between i and j -c Outputs: dsij1 = deriv. of sij w.r.t. rik -c dsij2 = deriv. of sij w.r.t. rjk - use meam_data - implicit none - integer i,j,k,jn,nmax,numneigh - integer elti,eltj,eltk - real*8 rij2,rik2,rjk2,dsij1,dsij2 - integer ntype, type, fmap - real*8 x, scrfcn, fcpair - - dimension type(nmax), fmap(ntype) - dimension x(3,nmax), scrfcn(numneigh), fcpair(numneigh) - - real*8 dxik,dyik,dzik - real*8 dxjk,dyjk,dzjk - real*8 rbound,delc,sij,xik,xjk,cikj,sikj,dfc,a - real*8 Cmax,Cmin,dCikj1,dCikj2 - - sij = scrfcn(jn)*fcpair(jn) - elti = fmap(type(i)) - eltj = fmap(type(j)) - eltk = fmap(type(k)) - Cmax = Cmax_meam(elti,eltj,eltk) - Cmin = Cmin_meam(elti,eltj,eltk) - - dsij1 = 0.d0 - dsij2 = 0.d0 - if ((sij.ne.0.d0).and.(sij.ne.1.d0)) then - rbound = rij2*ebound_meam(elti,eltj) - delc = Cmax-Cmin - dxjk = x(1,k) - x(1,j) - dyjk = x(2,k) - x(2,j) - dzjk = x(3,k) - x(3,j) - rjk2 = dxjk*dxjk + dyjk*dyjk + dzjk*dzjk - if (rjk2.le.rbound) then - dxik = x(1,k) - x(1,i) - dyik = x(2,k) - x(2,i) - dzik = x(3,k) - x(3,i) - rik2 = dxik*dxik + dyik*dyik + dzik*dzik - if (rik2.le.rbound) then - xik = rik2/rij2 - xjk = rjk2/rij2 - a = 1 - (xik-xjk)*(xik-xjk) - if (a.ne.0.d0) then - cikj = (2.d0*(xik+xjk) + a - 2.d0)/a - if (cikj.ge.Cmin.and.cikj.le.Cmax) then - cikj = (cikj-Cmin)/delc - call dfcut(cikj,sikj,dfc) - call dCfunc2(rij2,rik2,rjk2,dCikj1,dCikj2) - a = sij/delc*dfc/sikj - dsij1 = a*dCikj1 - dsij2 = a*dCikj2 - endif - endif - endif - endif - endif - - return - end - - -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - - subroutine fcut(xi,fc) -c cutoff function - implicit none - real*8 xi,fc - real*8 a - if (xi.ge.1.d0) then - fc = 1.d0 - else if (xi.le.0.d0) then - fc = 0.d0 - else - a = 1.d0-xi - a = a*a - a = a*a - a = 1.d0-a - fc = a*a -c fc = xi - endif - return - end - -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - - subroutine dfcut(xi,fc,dfc) -c cutoff function and its derivative - implicit none - real*8 xi,fc,dfc,a,a3,a4 - if (xi.ge.1.d0) then - fc = 1.d0 - dfc = 0.d0 - else if (xi.le.0.d0) then - fc = 0.d0 - dfc = 0.d0 - else - a = 1.d0-xi - a3 = a*a*a - a4 = a*a3 - fc = (1.d0-a4)**2 - dfc = 8*(1.d0-a4)*a3 -c fc = xi -c dfc = 1.d0 - endif - return - end - -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - - subroutine dCfunc(rij2,rik2,rjk2,dCikj) -c Inputs: rij,rij2,rik2,rjk2 -c Outputs: dCikj = derivative of Cikj w.r.t. rij - implicit none - real*8 rij2,rik2,rjk2,dCikj - real*8 rij4,a,b,denom - - rij4 = rij2*rij2 - a = rik2-rjk2 - b = rik2+rjk2 - denom = rij4 - a*a - denom = denom*denom - dCikj = -4*(-2*rij2*a*a + rij4*b + a*a*b)/denom - return - end - -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - - subroutine dCfunc2(rij2,rik2,rjk2,dCikj1,dCikj2) -c Inputs: rij,rij2,rik2,rjk2 -c Outputs: dCikj1 = derivative of Cikj w.r.t. rik -c dCikj2 = derivative of Cikj w.r.t. rjk - implicit none - real*8 rij2,rik2,rjk2,dCikj1,dCikj2 - real*8 rij4,rik4,rjk4,a,b,denom - - rij4 = rij2*rij2 - rik4 = rik2*rik2 - rjk4 = rjk2*rjk2 - a = rik2-rjk2 - b = rik2+rjk2 - denom = rij4 - a*a - denom = denom*denom - dCikj1 = 4*rij2*(rij4 + rik4 + 2*rik2*rjk2 - 3*rjk4 - 2*rij2*a)/ - $ denom - dCikj2 = 4*rij2*(rij4 - 3*rik4 + 2*rik2*rjk2 + rjk4 + 2*rij2*a)/ - $ denom - return - end - -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc - - - - diff --git a/lib/meam/meam_force.F b/lib/meam/meam_force.F deleted file mode 100644 index 1297eb2170..0000000000 --- a/lib/meam/meam_force.F +++ /dev/null @@ -1,608 +0,0 @@ -c Extern "C" declaration has the form: -c -c void meam_force_(int *, int *, int *, double *, int *, int *, int *, double *, -c int *, int *, int *, int *, double *, double *, -c double *, double *, double *, double *, double *, double *, -c double *, double *, double *, double *, double *, double *, -c double *, double *, double *, double *, double *, double *, int *); -c -c Call from pair_meam.cpp has the form: -c -c meam_force_(&i,&nmax,&eflag_either,&eflag_global,&eflag_atom,&vflag_atom, -c &eng_vdwl,eatom,&ntype,type,fmap,&x[0][0], -c &numneigh[i],firstneigh[i],&numneigh_full[i],firstneigh_full[i], -c &scrfcn[offset],&dscrfcn[offset],&fcpair[offset], -c dgamma1,dgamma2,dgamma3,rho0,rho1,rho2,rho3,frhop, -c &arho1[0][0],&arho2[0][0],arho2b,&arho3[0][0],&arho3b[0][0], -c &t_ave[0][0],&tsq_ave[0][0],&f[0][0],&vatom[0][0],&errorflag); -c - - subroutine meam_force(i, nmax, - $ eflag_either, eflag_global, eflag_atom, vflag_atom, - $ eng_vdwl, eatom, ntype, type, fmap, x, - $ numneigh, firstneigh, numneigh_full, firstneigh_full, - $ scrfcn, dscrfcn, fcpair, - $ dGamma1, dGamma2, dGamma3, rho0, rho1, rho2, rho3, fp, - $ Arho1, Arho2, Arho2b, Arho3, Arho3b, t_ave, tsq_ave, f, - $ vatom, errorflag) - - use meam_data - implicit none - - integer eflag_either, eflag_global, eflag_atom, vflag_atom - integer nmax, ntype, type, fmap - real*8 eng_vdwl, eatom, x - integer numneigh, firstneigh, numneigh_full, firstneigh_full - real*8 scrfcn, dscrfcn, fcpair - real*8 dGamma1, dGamma2, dGamma3 - real*8 rho0, rho1, rho2, rho3, fp - real*8 Arho1, Arho2, Arho2b - real*8 Arho3, Arho3b - real*8 t_ave, tsq_ave, f, vatom - integer errorflag - - dimension eatom(nmax) - dimension type(nmax), fmap(ntype) - dimension x(3,nmax) - dimension firstneigh(numneigh), firstneigh_full(numneigh_full) - dimension scrfcn(numneigh), dscrfcn(numneigh), fcpair(numneigh) - dimension dGamma1(nmax), dGamma2(nmax), dGamma3(nmax) - dimension rho0(nmax), rho1(nmax), rho2(nmax), rho3(nmax), fp(nmax) - dimension Arho1(3,nmax), Arho2(6,nmax), Arho2b(nmax) - dimension Arho3(10,nmax), Arho3b(3,nmax) - dimension t_ave(3,nmax), tsq_ave(3,nmax), f(3,nmax), vatom(6,nmax) - - integer i,j,jn,k,kn,kk,m,n,p,q - integer nv2,nv3,elti,eltj,eltk,ind - real*8 xitmp,yitmp,zitmp,delij(3),delref(3),rij2,rij,rij3 - real*8 delik(3),deljk(3),v(6),fi(3),fj(3) - real*8 Eu,astar,astarp,third,sixth - real*8 pp,phiforce,dUdrij,dUdsij,dUdrijm(3),force,forcem - real*8 B,r,recip,phi,phip,rhop,a - real*8 sij,fcij,dfcij,ds(3) - real*8 a0,a1,a1i,a1j,a2,a2i,a2j - real*8 a3i,a3j,a3i1,a3i2,a3j1,a3j2 - real*8 G,dG,Gbar,dGbar,gam,shpi(3),shpj(3),Z,denom - real*8 ai,aj,ro0i,ro0j,invrei,invrej - real*8 b0,rhoa0j,drhoa0j,rhoa0i,drhoa0i - real*8 b1,rhoa1j,drhoa1j,rhoa1i,drhoa1i - real*8 b2,rhoa2j,drhoa2j,rhoa2i,drhoa2i - real*8 a3,a3a,b3,rhoa3j,drhoa3j,rhoa3i,drhoa3i - real*8 drho0dr1,drho0dr2,drho0ds1,drho0ds2 - real*8 drho1dr1,drho1dr2,drho1ds1,drho1ds2 - real*8 drho1drm1(3),drho1drm2(3) - real*8 drho2dr1,drho2dr2,drho2ds1,drho2ds2 - real*8 drho2drm1(3),drho2drm2(3) - real*8 drho3dr1,drho3dr2,drho3ds1,drho3ds2 - real*8 drho3drm1(3),drho3drm2(3) - real*8 dt1dr1,dt1dr2,dt1ds1,dt1ds2 - real*8 dt2dr1,dt2dr2,dt2ds1,dt2ds2 - real*8 dt3dr1,dt3dr2,dt3ds1,dt3ds2 - real*8 drhodr1,drhodr2,drhods1,drhods2,drhodrm1(3),drhodrm2(3) - real*8 arg,arg1,arg2 - real*8 arg1i1,arg1j1,arg1i2,arg1j2,arg2i2,arg2j2 - real*8 arg1i3,arg1j3,arg2i3,arg2j3,arg3i3,arg3j3 - real*8 dsij1,dsij2,force1,force2 - real*8 t1i,t2i,t3i,t1j,t2j,t3j - - errorflag = 0 - third = 1.0/3.0 - sixth = 1.0/6.0 - -c Compute forces atom i - - elti = fmap(type(i)) - - if (elti.gt.0) then - xitmp = x(1,i) - yitmp = x(2,i) - zitmp = x(3,i) - -c Treat each pair - do jn = 1,numneigh - - j = firstneigh(jn) - eltj = fmap(type(j)) - - if (scrfcn(jn).ne.0.d0.and.eltj.gt.0) then - - sij = scrfcn(jn)*fcpair(jn) - delij(1) = x(1,j) - xitmp - delij(2) = x(2,j) - yitmp - delij(3) = x(3,j) - zitmp - rij2 = delij(1)*delij(1) + delij(2)*delij(2) - $ + delij(3)*delij(3) - if (rij2.lt.cutforcesq) then - rij = sqrt(rij2) - r = rij - -c Compute phi and phip - ind = eltind(elti,eltj) - pp = rij*rdrar + 1.0D0 - kk = pp - kk = min(kk,nrar-1) - pp = pp - kk - pp = min(pp,1.0D0) - phi = ((phirar3(kk,ind)*pp + phirar2(kk,ind))*pp - $ + phirar1(kk,ind))*pp + phirar(kk,ind) - phip = (phirar6(kk,ind)*pp + phirar5(kk,ind))*pp - $ + phirar4(kk,ind) - recip = 1.0d0/r - - if (eflag_either.ne.0) then - if (eflag_global.ne.0) eng_vdwl = eng_vdwl + phi*sij - if (eflag_atom.ne.0) then - eatom(i) = eatom(i) + 0.5*phi*sij - eatom(j) = eatom(j) + 0.5*phi*sij - endif - endif - -c write(1,*) "force_meamf: phi: ",phi -c write(1,*) "force_meamf: phip: ",phip - -c Compute pair densities and derivatives - invrei = 1.d0/re_meam(elti,elti) - ai = rij*invrei - 1.d0 - ro0i = rho0_meam(elti) - rhoa0i = ro0i*fm_exp(-beta0_meam(elti)*ai) - drhoa0i = -beta0_meam(elti)*invrei*rhoa0i - rhoa1i = ro0i*fm_exp(-beta1_meam(elti)*ai) - drhoa1i = -beta1_meam(elti)*invrei*rhoa1i - rhoa2i = ro0i*fm_exp(-beta2_meam(elti)*ai) - drhoa2i = -beta2_meam(elti)*invrei*rhoa2i - rhoa3i = ro0i*fm_exp(-beta3_meam(elti)*ai) - drhoa3i = -beta3_meam(elti)*invrei*rhoa3i - - if (elti.ne.eltj) then - invrej = 1.d0/re_meam(eltj,eltj) - aj = rij*invrej - 1.d0 - ro0j = rho0_meam(eltj) - rhoa0j = ro0j*fm_exp(-beta0_meam(eltj)*aj) - drhoa0j = -beta0_meam(eltj)*invrej*rhoa0j - rhoa1j = ro0j*fm_exp(-beta1_meam(eltj)*aj) - drhoa1j = -beta1_meam(eltj)*invrej*rhoa1j - rhoa2j = ro0j*fm_exp(-beta2_meam(eltj)*aj) - drhoa2j = -beta2_meam(eltj)*invrej*rhoa2j - rhoa3j = ro0j*fm_exp(-beta3_meam(eltj)*aj) - drhoa3j = -beta3_meam(eltj)*invrej*rhoa3j - else - rhoa0j = rhoa0i - drhoa0j = drhoa0i - rhoa1j = rhoa1i - drhoa1j = drhoa1i - rhoa2j = rhoa2i - drhoa2j = drhoa2i - rhoa3j = rhoa3i - drhoa3j = drhoa3i - endif - - if (ialloy.eq.1) then - rhoa1j = rhoa1j * t1_meam(eltj) - rhoa2j = rhoa2j * t2_meam(eltj) - rhoa3j = rhoa3j * t3_meam(eltj) - rhoa1i = rhoa1i * t1_meam(elti) - rhoa2i = rhoa2i * t2_meam(elti) - rhoa3i = rhoa3i * t3_meam(elti) - drhoa1j = drhoa1j * t1_meam(eltj) - drhoa2j = drhoa2j * t2_meam(eltj) - drhoa3j = drhoa3j * t3_meam(eltj) - drhoa1i = drhoa1i * t1_meam(elti) - drhoa2i = drhoa2i * t2_meam(elti) - drhoa3i = drhoa3i * t3_meam(elti) - endif - - nv2 = 1 - nv3 = 1 - arg1i1 = 0.d0 - arg1j1 = 0.d0 - arg1i2 = 0.d0 - arg1j2 = 0.d0 - arg1i3 = 0.d0 - arg1j3 = 0.d0 - arg3i3 = 0.d0 - arg3j3 = 0.d0 - do n = 1,3 - do p = n,3 - do q = p,3 - arg = delij(n)*delij(p)*delij(q)*v3D(nv3) - arg1i3 = arg1i3 + Arho3(nv3,i)*arg - arg1j3 = arg1j3 - Arho3(nv3,j)*arg - nv3 = nv3+1 - enddo - arg = delij(n)*delij(p)*v2D(nv2) - arg1i2 = arg1i2 + Arho2(nv2,i)*arg - arg1j2 = arg1j2 + Arho2(nv2,j)*arg - nv2 = nv2+1 - enddo - arg1i1 = arg1i1 + Arho1(n,i)*delij(n) - arg1j1 = arg1j1 - Arho1(n,j)*delij(n) - arg3i3 = arg3i3 + Arho3b(n,i)*delij(n) - arg3j3 = arg3j3 - Arho3b(n,j)*delij(n) - enddo - -c rho0 terms - drho0dr1 = drhoa0j * sij - drho0dr2 = drhoa0i * sij - -c rho1 terms - a1 = 2*sij/rij - drho1dr1 = a1*(drhoa1j-rhoa1j/rij)*arg1i1 - drho1dr2 = a1*(drhoa1i-rhoa1i/rij)*arg1j1 - a1 = 2.d0*sij/rij - do m = 1,3 - drho1drm1(m) = a1*rhoa1j*Arho1(m,i) - drho1drm2(m) = -a1*rhoa1i*Arho1(m,j) - enddo - -c rho2 terms - a2 = 2*sij/rij2 - drho2dr1 = a2*(drhoa2j - 2*rhoa2j/rij)*arg1i2 - $ - 2.d0/3.d0*Arho2b(i)*drhoa2j*sij - drho2dr2 = a2*(drhoa2i - 2*rhoa2i/rij)*arg1j2 - $ - 2.d0/3.d0*Arho2b(j)*drhoa2i*sij - a2 = 4*sij/rij2 - do m = 1,3 - drho2drm1(m) = 0.d0 - drho2drm2(m) = 0.d0 - do n = 1,3 - drho2drm1(m) = drho2drm1(m) - $ + Arho2(vind2D(m,n),i)*delij(n) - drho2drm2(m) = drho2drm2(m) - $ - Arho2(vind2D(m,n),j)*delij(n) - enddo - drho2drm1(m) = a2*rhoa2j*drho2drm1(m) - drho2drm2(m) = -a2*rhoa2i*drho2drm2(m) - enddo - -c rho3 terms - rij3 = rij*rij2 - a3 = 2*sij/rij3 - a3a = 6.d0/5.d0*sij/rij - drho3dr1 = a3*(drhoa3j - 3*rhoa3j/rij)*arg1i3 - $ - a3a*(drhoa3j - rhoa3j/rij)*arg3i3 - drho3dr2 = a3*(drhoa3i - 3*rhoa3i/rij)*arg1j3 - $ - a3a*(drhoa3i - rhoa3i/rij)*arg3j3 - a3 = 6*sij/rij3 - a3a = 6*sij/(5*rij) - do m = 1,3 - drho3drm1(m) = 0.d0 - drho3drm2(m) = 0.d0 - nv2 = 1 - do n = 1,3 - do p = n,3 - arg = delij(n)*delij(p)*v2D(nv2) - drho3drm1(m) = drho3drm1(m) - $ + Arho3(vind3D(m,n,p),i)*arg - drho3drm2(m) = drho3drm2(m) - $ + Arho3(vind3D(m,n,p),j)*arg - nv2 = nv2 + 1 - enddo - enddo - drho3drm1(m) = (a3*drho3drm1(m) - a3a*Arho3b(m,i)) - $ *rhoa3j - drho3drm2(m) = (-a3*drho3drm2(m) + a3a*Arho3b(m,j)) - $ *rhoa3i - enddo - -c Compute derivatives of weighting functions t wrt rij - t1i = t_ave(1,i) - t2i = t_ave(2,i) - t3i = t_ave(3,i) - t1j = t_ave(1,j) - t2j = t_ave(2,j) - t3j = t_ave(3,j) - - if (ialloy.eq.1) then - - a1i = 0.d0 - a1j = 0.d0 - a2i = 0.d0 - a2j = 0.d0 - a3i = 0.d0 - a3j = 0.d0 - if ( tsq_ave(1,i) .ne. 0.d0 ) then - a1i = drhoa0j*sij/tsq_ave(1,i) - endif - if ( tsq_ave(1,j) .ne. 0.d0 ) then - a1j = drhoa0i*sij/tsq_ave(1,j) - endif - if ( tsq_ave(2,i) .ne. 0.d0 ) then - a2i = drhoa0j*sij/tsq_ave(2,i) - endif - if ( tsq_ave(2,j) .ne. 0.d0 ) then - a2j = drhoa0i*sij/tsq_ave(2,j) - endif - if ( tsq_ave(3,i) .ne. 0.d0 ) then - a3i = drhoa0j*sij/tsq_ave(3,i) - endif - if ( tsq_ave(3,j) .ne. 0.d0 ) then - a3j = drhoa0i*sij/tsq_ave(3,j) - endif - - dt1dr1 = a1i*(t1_meam(eltj)-t1i*t1_meam(eltj)**2) - dt1dr2 = a1j*(t1_meam(elti)-t1j*t1_meam(elti)**2) - dt2dr1 = a2i*(t2_meam(eltj)-t2i*t2_meam(eltj)**2) - dt2dr2 = a2j*(t2_meam(elti)-t2j*t2_meam(elti)**2) - dt3dr1 = a3i*(t3_meam(eltj)-t3i*t3_meam(eltj)**2) - dt3dr2 = a3j*(t3_meam(elti)-t3j*t3_meam(elti)**2) - - else if (ialloy.eq.2) then - - dt1dr1 = 0.d0 - dt1dr2 = 0.d0 - dt2dr1 = 0.d0 - dt2dr2 = 0.d0 - dt3dr1 = 0.d0 - dt3dr2 = 0.d0 - - else - - ai = 0.d0 - if( rho0(i) .ne. 0.d0 ) then - ai = drhoa0j*sij/rho0(i) - end if - aj = 0.d0 - if( rho0(j) .ne. 0.d0 ) then - aj = drhoa0i*sij/rho0(j) - end if - - dt1dr1 = ai*(t1_meam(eltj)-t1i) - dt1dr2 = aj*(t1_meam(elti)-t1j) - dt2dr1 = ai*(t2_meam(eltj)-t2i) - dt2dr2 = aj*(t2_meam(elti)-t2j) - dt3dr1 = ai*(t3_meam(eltj)-t3i) - dt3dr2 = aj*(t3_meam(elti)-t3j) - - endif - -c Compute derivatives of total density wrt rij, sij and rij(3) - call get_shpfcn(shpi,lattce_meam(elti,elti)) - call get_shpfcn(shpj,lattce_meam(eltj,eltj)) - drhodr1 = dGamma1(i)*drho0dr1 - $ + dGamma2(i)* - $ (dt1dr1*rho1(i)+t1i*drho1dr1 - $ + dt2dr1*rho2(i)+t2i*drho2dr1 - $ + dt3dr1*rho3(i)+t3i*drho3dr1) - $ - dGamma3(i)* - $ (shpi(1)*dt1dr1+shpi(2)*dt2dr1+shpi(3)*dt3dr1) - drhodr2 = dGamma1(j)*drho0dr2 - $ + dGamma2(j)* - $ (dt1dr2*rho1(j)+t1j*drho1dr2 - $ + dt2dr2*rho2(j)+t2j*drho2dr2 - $ + dt3dr2*rho3(j)+t3j*drho3dr2) - $ - dGamma3(j)* - $ (shpj(1)*dt1dr2+shpj(2)*dt2dr2+shpj(3)*dt3dr2) - do m = 1,3 - drhodrm1(m) = 0.d0 - drhodrm2(m) = 0.d0 - drhodrm1(m) = dGamma2(i)* - $ (t1i*drho1drm1(m) - $ + t2i*drho2drm1(m) - $ + t3i*drho3drm1(m)) - drhodrm2(m) = dGamma2(j)* - $ (t1j*drho1drm2(m) - $ + t2j*drho2drm2(m) - $ + t3j*drho3drm2(m)) - enddo - -c Compute derivatives wrt sij, but only if necessary - if (dscrfcn(jn).ne.0.d0) then - drho0ds1 = rhoa0j - drho0ds2 = rhoa0i - a1 = 2.d0/rij - drho1ds1 = a1*rhoa1j*arg1i1 - drho1ds2 = a1*rhoa1i*arg1j1 - a2 = 2.d0/rij2 - drho2ds1 = a2*rhoa2j*arg1i2 - $ - 2.d0/3.d0*Arho2b(i)*rhoa2j - drho2ds2 = a2*rhoa2i*arg1j2 - $ - 2.d0/3.d0*Arho2b(j)*rhoa2i - a3 = 2.d0/rij3 - a3a = 6.d0/(5.d0*rij) - drho3ds1 = a3*rhoa3j*arg1i3 - a3a*rhoa3j*arg3i3 - drho3ds2 = a3*rhoa3i*arg1j3 - a3a*rhoa3i*arg3j3 - - if (ialloy.eq.1) then - - a1i = 0.d0 - a1j = 0.d0 - a2i = 0.d0 - a2j = 0.d0 - a3i = 0.d0 - a3j = 0.d0 - if ( tsq_ave(1,i) .ne. 0.d0 ) then - a1i = rhoa0j/tsq_ave(1,i) - endif - if ( tsq_ave(1,j) .ne. 0.d0 ) then - a1j = rhoa0i/tsq_ave(1,j) - endif - if ( tsq_ave(2,i) .ne. 0.d0 ) then - a2i = rhoa0j/tsq_ave(2,i) - endif - if ( tsq_ave(2,j) .ne. 0.d0 ) then - a2j = rhoa0i/tsq_ave(2,j) - endif - if ( tsq_ave(3,i) .ne. 0.d0 ) then - a3i = rhoa0j/tsq_ave(3,i) - endif - if ( tsq_ave(3,j) .ne. 0.d0 ) then - a3j = rhoa0i/tsq_ave(3,j) - endif - - dt1ds1 = a1i*(t1_meam(eltj)-t1i*t1_meam(eltj)**2) - dt1ds2 = a1j*(t1_meam(elti)-t1j*t1_meam(elti)**2) - dt2ds1 = a2i*(t2_meam(eltj)-t2i*t2_meam(eltj)**2) - dt2ds2 = a2j*(t2_meam(elti)-t2j*t2_meam(elti)**2) - dt3ds1 = a3i*(t3_meam(eltj)-t3i*t3_meam(eltj)**2) - dt3ds2 = a3j*(t3_meam(elti)-t3j*t3_meam(elti)**2) - - else if (ialloy.eq.2) then - - dt1ds1 = 0.d0 - dt1ds2 = 0.d0 - dt2ds1 = 0.d0 - dt2ds2 = 0.d0 - dt3ds1 = 0.d0 - dt3ds2 = 0.d0 - - else - - ai = 0.d0 - if( rho0(i) .ne. 0.d0 ) then - ai = rhoa0j/rho0(i) - end if - aj = 0.d0 - if( rho0(j) .ne. 0.d0 ) then - aj = rhoa0i/rho0(j) - end if - - dt1ds1 = ai*(t1_meam(eltj)-t1i) - dt1ds2 = aj*(t1_meam(elti)-t1j) - dt2ds1 = ai*(t2_meam(eltj)-t2i) - dt2ds2 = aj*(t2_meam(elti)-t2j) - dt3ds1 = ai*(t3_meam(eltj)-t3i) - dt3ds2 = aj*(t3_meam(elti)-t3j) - - endif - - drhods1 = dGamma1(i)*drho0ds1 - $ + dGamma2(i)* - $ (dt1ds1*rho1(i)+t1i*drho1ds1 - $ + dt2ds1*rho2(i)+t2i*drho2ds1 - $ + dt3ds1*rho3(i)+t3i*drho3ds1) - $ - dGamma3(i)* - $ (shpi(1)*dt1ds1+shpi(2)*dt2ds1+shpi(3)*dt3ds1) - drhods2 = dGamma1(j)*drho0ds2 - $ + dGamma2(j)* - $ (dt1ds2*rho1(j)+t1j*drho1ds2 - $ + dt2ds2*rho2(j)+t2j*drho2ds2 - $ + dt3ds2*rho3(j)+t3j*drho3ds2) - $ - dGamma3(j)* - $ (shpj(1)*dt1ds2+shpj(2)*dt2ds2+shpj(3)*dt3ds2) - endif - -c Compute derivatives of energy wrt rij, sij and rij(3) - dUdrij = phip*sij - $ + fp(i)*drhodr1 + fp(j)*drhodr2 - dUdsij = 0.d0 - if (dscrfcn(jn).ne.0.d0) then - dUdsij = phi - $ + fp(i)*drhods1 + fp(j)*drhods2 - endif - do m = 1,3 - dUdrijm(m) = fp(i)*drhodrm1(m) + fp(j)*drhodrm2(m) - enddo - -c Add the part of the force due to dUdrij and dUdsij - - force = dUdrij*recip + dUdsij*dscrfcn(jn) - do m = 1,3 - forcem = delij(m)*force + dUdrijm(m) - f(m,i) = f(m,i) + forcem - f(m,j) = f(m,j) - forcem - enddo - -c Tabulate per-atom virial as symmetrized stress tensor - - if (vflag_atom.ne.0) then - fi(1) = delij(1)*force + dUdrijm(1) - fi(2) = delij(2)*force + dUdrijm(2) - fi(3) = delij(3)*force + dUdrijm(3) - v(1) = -0.5 * (delij(1) * fi(1)) - v(2) = -0.5 * (delij(2) * fi(2)) - v(3) = -0.5 * (delij(3) * fi(3)) - v(4) = -0.25 * (delij(1)*fi(2) + delij(2)*fi(1)) - v(5) = -0.25 * (delij(1)*fi(3) + delij(3)*fi(1)) - v(6) = -0.25 * (delij(2)*fi(3) + delij(3)*fi(2)) - - vatom(1,i) = vatom(1,i) + v(1) - vatom(2,i) = vatom(2,i) + v(2) - vatom(3,i) = vatom(3,i) + v(3) - vatom(4,i) = vatom(4,i) + v(4) - vatom(5,i) = vatom(5,i) + v(5) - vatom(6,i) = vatom(6,i) + v(6) - vatom(1,j) = vatom(1,j) + v(1) - vatom(2,j) = vatom(2,j) + v(2) - vatom(3,j) = vatom(3,j) + v(3) - vatom(4,j) = vatom(4,j) + v(4) - vatom(5,j) = vatom(5,j) + v(5) - vatom(6,j) = vatom(6,j) + v(6) - endif - -c Now compute forces on other atoms k due to change in sij - - if (sij.eq.0.d0.or.sij.eq.1.d0) goto 100 - do kn = 1,numneigh_full - k = firstneigh_full(kn) - eltk = fmap(type(k)) - if (k.ne.j.and.eltk.gt.0) then - call dsij(i,j,k,jn,nmax,numneigh,rij2,dsij1,dsij2, - $ ntype,type,fmap,x,scrfcn,fcpair) - if (dsij1.ne.0.d0.or.dsij2.ne.0.d0) then - force1 = dUdsij*dsij1 - force2 = dUdsij*dsij2 - do m = 1,3 - delik(m) = x(m,k) - x(m,i) - deljk(m) = x(m,k) - x(m,j) - enddo - do m = 1,3 - f(m,i) = f(m,i) + force1*delik(m) - f(m,j) = f(m,j) + force2*deljk(m) - f(m,k) = f(m,k) - force1*delik(m) - $ - force2*deljk(m) - enddo - -c Tabulate per-atom virial as symmetrized stress tensor - - if (vflag_atom.ne.0) then - fi(1) = force1*delik(1) - fi(2) = force1*delik(2) - fi(3) = force1*delik(3) - fj(1) = force2*deljk(1) - fj(2) = force2*deljk(2) - fj(3) = force2*deljk(3) - v(1) = -third * (delik(1)*fi(1) + deljk(1)*fj(1)) - v(2) = -third * (delik(2)*fi(2) + deljk(2)*fj(2)) - v(3) = -third * (delik(3)*fi(3) + deljk(3)*fj(3)) - v(4) = -sixth * (delik(1)*fi(2) + deljk(1)*fj(2) + - $ delik(2)*fi(1) + deljk(2)*fj(1)) - v(5) = -sixth * (delik(1)*fi(3) + deljk(1)*fj(3) + - $ delik(3)*fi(1) + deljk(3)*fj(1)) - v(6) = -sixth * (delik(2)*fi(3) + deljk(2)*fj(3) + - $ delik(3)*fi(2) + deljk(3)*fj(2)) - - vatom(1,i) = vatom(1,i) + v(1) - vatom(2,i) = vatom(2,i) + v(2) - vatom(3,i) = vatom(3,i) + v(3) - vatom(4,i) = vatom(4,i) + v(4) - vatom(5,i) = vatom(5,i) + v(5) - vatom(6,i) = vatom(6,i) + v(6) - vatom(1,j) = vatom(1,j) + v(1) - vatom(2,j) = vatom(2,j) + v(2) - vatom(3,j) = vatom(3,j) + v(3) - vatom(4,j) = vatom(4,j) + v(4) - vatom(5,j) = vatom(5,j) + v(5) - vatom(6,j) = vatom(6,j) + v(6) - vatom(1,k) = vatom(1,k) + v(1) - vatom(2,k) = vatom(2,k) + v(2) - vatom(3,k) = vatom(3,k) + v(3) - vatom(4,k) = vatom(4,k) + v(4) - vatom(5,k) = vatom(5,k) + v(5) - vatom(6,k) = vatom(6,k) + v(6) - endif - - endif - endif -c end of k loop - enddo - endif - 100 continue - endif -c end of j loop - enddo - -c else if elti=0, this is not a meam atom - endif - - return - end diff --git a/lib/meam/meam_setup_done.F b/lib/meam/meam_setup_done.F deleted file mode 100644 index c94bce8b44..0000000000 --- a/lib/meam/meam_setup_done.F +++ /dev/null @@ -1,1041 +0,0 @@ -c Declaration in pair_meam.h: -c -c void meam_setup_done(double *) -c -c Call from pair_meam.cpp: -c -c meam_setup_done(&cutmax) -c - - subroutine meam_setup_done(cutmax) - use meam_data - implicit none - - real*8 cutmax - - integer nv2, nv3, m, n, p - -c Force cutoff - cutforce = rc_meam - cutforcesq = cutforce*cutforce - -c Pass cutoff back to calling program - cutmax = cutforce - -c Augment t1 term - t1_meam(:) = t1_meam(:) + augt1 * 3.d0/5.d0 * t3_meam(:) - -c Compute off-diagonal alloy parameters - call alloyparams - -c indices and factors for Voight notation - nv2 = 1 - nv3 = 1 - do m = 1,3 - do n = m,3 - vind2D(m,n) = nv2 - vind2D(n,m) = nv2 - nv2 = nv2+1 - do p = n,3 - vind3D(m,n,p) = nv3 - vind3D(m,p,n) = nv3 - vind3D(n,m,p) = nv3 - vind3D(n,p,m) = nv3 - vind3D(p,m,n) = nv3 - vind3D(p,n,m) = nv3 - nv3 = nv3+1 - enddo - enddo - enddo - - v2D(1) = 1 - v2D(2) = 2 - v2D(3) = 2 - v2D(4) = 1 - v2D(5) = 2 - v2D(6) = 1 - - v3D(1) = 1 - v3D(2) = 3 - v3D(3) = 3 - v3D(4) = 3 - v3D(5) = 6 - v3D(6) = 3 - v3D(7) = 1 - v3D(8) = 3 - v3D(9) = 3 - v3D(10) = 1 - - nv2 = 1 - do m = 1,neltypes - do n = m,neltypes - eltind(m,n) = nv2 - eltind(n,m) = nv2 - nv2 = nv2+1 - enddo - enddo - -c Compute background densities for reference structure - call compute_reference_density - -c Compute pair potentials and setup arrays for interpolation - nr = 1000 - dr = 1.1*rc_meam/nr - call compute_pair_meam - - return - end - -cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc -c Fill off-diagonal alloy parameters - subroutine alloyparams - use meam_data - implicit none - integer i,j,k - real*8 eb - -c Loop over pairs - do i = 1,neltypes - do j = 1,neltypes -c Treat off-diagonal pairs -c If i>j, set all equal to ij, set equal to the iebound, -c atom k definitely lies outside the screening function ellipse (so -c there is no need to calculate its effects). Here, compute it for all -c triplets (i,j,k) so that ebound(i,j) is the maximized over k - do i = 1,neltypes - do j = 1,neltypes - do k = 1,neltypes - eb = (Cmax_meam(i,j,k)*Cmax_meam(i,j,k)) - $ /(4.d0*(Cmax_meam(i,j,k)-1.d0)) - ebound_meam(i,j) = max(ebound_meam(i,j),eb) - enddo - enddo - enddo - - return - end - -c----------------------------------------------------------------------- -c compute MEAM pair potential for each pair of element types -c - - subroutine compute_pair_meam - use meam_data - implicit none - - real*8 r, temp - integer j,a,b,nv2 - real*8 astar,frac,phizbl - integer n,nmax,Z1,Z2 - real*8 arat,rarat,scrn,scrn2 - real*8 phiaa,phibb,phitmp - real*8 C,s111,s112,s221,S11,S22 - - real*8, external :: phi_meam - real*8, external :: zbl - real*8, external :: compute_phi - -c check for previously allocated arrays and free them - if(allocated(phir)) deallocate(phir) - if(allocated(phirar)) deallocate(phirar) - if(allocated(phirar1)) deallocate(phirar1) - if(allocated(phirar2)) deallocate(phirar2) - if(allocated(phirar3)) deallocate(phirar3) - if(allocated(phirar4)) deallocate(phirar4) - if(allocated(phirar5)) deallocate(phirar5) - if(allocated(phirar6)) deallocate(phirar6) - -c allocate memory for array that defines the potential - allocate(phir(nr,(neltypes*(neltypes+1))/2)) - -c allocate coeff memory - - allocate(phirar(nr,(neltypes*(neltypes+1))/2)) - allocate(phirar1(nr,(neltypes*(neltypes+1))/2)) - allocate(phirar2(nr,(neltypes*(neltypes+1))/2)) - allocate(phirar3(nr,(neltypes*(neltypes+1))/2)) - allocate(phirar4(nr,(neltypes*(neltypes+1))/2)) - allocate(phirar5(nr,(neltypes*(neltypes+1))/2)) - allocate(phirar6(nr,(neltypes*(neltypes+1))/2)) - -c loop over pairs of element types - nv2 = 0 - do a = 1,neltypes - do b = a,neltypes - nv2 = nv2 + 1 - -c loop over r values and compute - do j = 1,nr - - r = (j-1)*dr - - phir(j,nv2) = phi_meam(r,a,b) - -c if using second-nearest neighbor, solve recursive problem -c (see Lee and Baskes, PRB 62(13):8564 eqn.(21)) - if (nn2_meam(a,b).eq.1) then - call get_Zij(Z1,lattce_meam(a,b)) - call get_Zij2(Z2,arat,scrn,lattce_meam(a,b), - $ Cmin_meam(a,a,b),Cmax_meam(a,a,b)) - -c The B1, B2, and L12 cases with NN2 have a trick to them; we need to -c compute the contributions from second nearest neighbors, like a-a -c pairs, but need to include NN2 contributions to those pairs as -c well. - if (lattce_meam(a,b).eq.'b1'.or. - $ lattce_meam(a,b).eq.'b2'.or. - $ lattce_meam(a,b).eq.'l12'.or. - $ lattce_meam(a,b).eq.'dia') then - rarat = r*arat - -c phi_aa - phiaa = phi_meam(rarat,a,a) - call get_Zij(Z1,lattce_meam(a,a)) - call get_Zij2(Z2,arat,scrn,lattce_meam(a,a), - $ Cmin_meam(a,a,a),Cmax_meam(a,a,a)) - nmax = 10 - if (scrn.gt.0.0) then - do n = 1,nmax - phiaa = phiaa + - $ (-Z2*scrn/Z1)**n * phi_meam(rarat*arat**n,a,a) - enddo - endif - -c phi_bb - phibb = phi_meam(rarat,b,b) - call get_Zij(Z1,lattce_meam(b,b)) - call get_Zij2(Z2,arat,scrn,lattce_meam(b,b), - $ Cmin_meam(b,b,b),Cmax_meam(b,b,b)) - nmax = 10 - if (scrn.gt.0.0) then - do n = 1,nmax - phibb = phibb + - $ (-Z2*scrn/Z1)**n * phi_meam(rarat*arat**n,b,b) - enddo - endif - - if (lattce_meam(a,b).eq.'b1'. - $ or.lattce_meam(a,b).eq.'b2'. - $ or.lattce_meam(a,b).eq.'dia') then -c Add contributions to the B1 or B2 potential - call get_Zij(Z1,lattce_meam(a,b)) - call get_Zij2(Z2,arat,scrn,lattce_meam(a,b), - $ Cmin_meam(a,a,b),Cmax_meam(a,a,b)) - phir(j,nv2) = phir(j,nv2) - - $ Z2*scrn/(2*Z1) * phiaa - call get_Zij2(Z2,arat,scrn2,lattce_meam(a,b), - $ Cmin_meam(b,b,a),Cmax_meam(b,b,a)) - phir(j,nv2) = phir(j,nv2) - - $ Z2*scrn2/(2*Z1) * phibb - - else if (lattce_meam(a,b).eq.'l12') then -c The L12 case has one last trick; we have to be careful to compute -c the correct screening between 2nd-neighbor pairs. 1-1 -c second-neighbor pairs are screened by 2 type 1 atoms and two type -c 2 atoms. 2-2 second-neighbor pairs are screened by 4 type 1 -c atoms. - C = 1.d0 - call get_sijk(C,a,a,a,s111) - call get_sijk(C,a,a,b,s112) - call get_sijk(C,b,b,a,s221) - S11 = s111 * s111 * s112 * s112 - S22 = s221**4 - phir(j,nv2) = phir(j,nv2) - - $ 0.75*S11*phiaa - 0.25*S22*phibb - - endif - - else - nmax = 10 - do n = 1,nmax - phir(j,nv2) = phir(j,nv2) + - $ (-Z2*scrn/Z1)**n * phi_meam(r*arat**n,a,b) - enddo - endif - - endif - -c For Zbl potential: -c if astar <= -3 -c potential is zbl potential -c else if -3 < astar < -1 -c potential is linear combination with zbl potential -c endif - if (zbl_meam(a,b).eq.1) then - astar = alpha_meam(a,b) * (r/re_meam(a,b) - 1.d0) - if (astar.le.-3.d0) then - phir(j,nv2) = zbl(r,ielt_meam(a),ielt_meam(b)) - else if (astar.gt.-3.d0.and.astar.lt.-1.d0) then - call fcut(1-(astar+1.d0)/(-3.d0+1.d0),frac) - phizbl = zbl(r,ielt_meam(a),ielt_meam(b)) - phir(j,nv2) = frac*phir(j,nv2) + (1-frac)*phizbl - endif - endif - - enddo - -c call interpolation - call interpolate_meam(nv2) - - enddo - enddo - - return - end - - -c----------------------------------------------------------------------c -c Compute MEAM pair potential for distance r, element types a and b -c - real*8 recursive function phi_meam(r,a,b)result(phi_m) - use meam_data - implicit none - - - integer a,b - real*8 r - real*8 a1,a2,a12 - real*8 t11av,t21av,t31av,t12av,t22av,t32av - real*8 G1,G2,s1(3),s2(3),s12(3),rho0_1,rho0_2 - real*8 Gam1,Gam2,Z1,Z2 - real*8 rhobar1,rhobar2,F1,F2 - real*8 rhoa01,rhoa11,rhoa21,rhoa31 - real*8 rhoa02,rhoa12,rhoa22,rhoa32 - real*8 rho01,rho11,rho21,rho31 - real*8 rho02,rho12,rho22,rho32 - real*8 scalfac,phiaa,phibb - real*8 Eu - real*8 arat,scrn,scrn2 - integer Z12, errorflag - integer n,nmax,Z1nn,Z2nn - character*3 latta,lattb - real*8 rho_bkgd1, rho_bkgd2 - - real*8, external :: erose - -c Equation numbers below refer to: -c I. Huang et.al., Modelling simul. Mater. Sci. Eng. 3:615 - -c get number of neighbors in the reference structure -c Nref(i,j) = # of i's neighbors of type j - call get_Zij(Z12,lattce_meam(a,b)) - - call get_densref(r,a,b,rho01,rho11,rho21,rho31, - $ rho02,rho12,rho22,rho32) - -c if densities are too small, numerical problems may result; just return zero - if (rho01.le.1e-14.and.rho02.le.1e-14) then - phi_m = 0.0 - return - endif - -c calculate average weighting factors for the reference structure - if (lattce_meam(a,b).eq.'c11') then - if (ialloy.eq.2) then - t11av = t1_meam(a) - t12av = t1_meam(b) - t21av = t2_meam(a) - t22av = t2_meam(b) - t31av = t3_meam(a) - t32av = t3_meam(b) - else - scalfac = 1.0/(rho01+rho02) - t11av = scalfac*(t1_meam(a)*rho01 + t1_meam(b)*rho02) - t12av = t11av - t21av = scalfac*(t2_meam(a)*rho01 + t2_meam(b)*rho02) - t22av = t21av - t31av = scalfac*(t3_meam(a)*rho01 + t3_meam(b)*rho02) - t32av = t31av - endif - else -c average weighting factors for the reference structure, eqn. I.8 - call get_tavref(t11av,t21av,t31av,t12av,t22av,t32av, - $ t1_meam(a),t2_meam(a),t3_meam(a), - $ t1_meam(b),t2_meam(b),t3_meam(b), - $ r,a,b,lattce_meam(a,b)) - endif - -c for c11b structure, calculate background electron densities - if (lattce_meam(a,b).eq.'c11') then - latta = lattce_meam(a,a) - if (latta.eq.'dia') then - rhobar1 = ((Z12/2)*(rho02+rho01))**2 + - $ t11av*(rho12-rho11)**2 + - $ t21av/6.0*(rho22+rho21)**2 + - $ 121.0/40.*t31av*(rho32-rho31)**2 - rhobar1 = sqrt(rhobar1) - rhobar2 = (Z12*rho01)**2 + 2.0/3.0*t21av*rho21**2 - rhobar2 = sqrt(rhobar2) - else - rhobar2 = ((Z12/2)*(rho01+rho02))**2 + - $ t12av*(rho11-rho12)**2 + - $ t22av/6.0*(rho21+rho22)**2 + - $ 121.0/40.*t32av*(rho31-rho32)**2 - rhobar2 = sqrt(rhobar2) - rhobar1 = (Z12*rho02)**2 + 2.0/3.0*t22av*rho22**2 - rhobar1 = sqrt(rhobar1) - endif - else -c for other structures, use formalism developed in Huang's paper -c -c composition-dependent scaling, equation I.7 -c If using mixing rule for t, apply to reference structure; else -c use precomputed values - if (mix_ref_t.eq.1) then - Z1 = Z_meam(a) - Z2 = Z_meam(b) - if (ibar_meam(a).le.0) then - G1 = 1.d0 - else - call get_shpfcn(s1,lattce_meam(a,a)) - Gam1 = (s1(1)*t11av+s1(2)*t21av+s1(3)*t31av)/(Z1*Z1) - call G_gam(Gam1,ibar_meam(a),gsmooth_factor,G1,errorflag) - endif - if (ibar_meam(b).le.0) then - G2 = 1.d0 - else - call get_shpfcn(s2,lattce_meam(b,b)) - Gam2 = (s2(1)*t12av+s2(2)*t22av+s2(3)*t32av)/(Z2*Z2) - call G_gam(Gam2,ibar_meam(b),gsmooth_factor,G2,errorflag) - endif - rho0_1 = rho0_meam(a)*Z1*G1 - rho0_2 = rho0_meam(b)*Z2*G2 - endif - Gam1 = (t11av*rho11+t21av*rho21+t31av*rho31) - if (rho01 < 1.0d-14) then - Gam1 = 0.0d0 - else - Gam1 = Gam1/(rho01*rho01) - endif - Gam2 = (t12av*rho12+t22av*rho22+t32av*rho32) - if (rho02 < 1.0d-14) then - Gam2 = 0.0d0 - else - Gam2 = Gam2/(rho02*rho02) - endif - call G_gam(Gam1,ibar_meam(a),gsmooth_factor,G1,errorflag) - call G_gam(Gam2,ibar_meam(b),gsmooth_factor,G2,errorflag) - if (mix_ref_t.eq.1) then - rho_bkgd1 = rho0_1 - rho_bkgd2 = rho0_2 - else - if (bkgd_dyn.eq.1) then - rho_bkgd1 = rho0_meam(a)*Z_meam(a) - rho_bkgd2 = rho0_meam(b)*Z_meam(b) - else - rho_bkgd1 = rho_ref_meam(a) - rho_bkgd2 = rho_ref_meam(b) - endif - endif - rhobar1 = rho01/rho_bkgd1*G1 - rhobar2 = rho02/rho_bkgd2*G2 - - endif - -c compute embedding functions, eqn I.5 - if (rhobar1.eq.0.d0) then - F1 = 0.d0 - else - if (emb_lin_neg.eq.1 .and. rhobar1.le.0) then - F1 = -A_meam(a)*Ec_meam(a,a)*rhobar1 - else - F1 = A_meam(a)*Ec_meam(a,a)*rhobar1*log(rhobar1) - endif - endif - if (rhobar2.eq.0.d0) then - F2 = 0.d0 - else - if (emb_lin_neg.eq.1 .and. rhobar2.le.0) then - F2 = -A_meam(b)*Ec_meam(b,b)*rhobar2 - else - F2 = A_meam(b)*Ec_meam(b,b)*rhobar2*log(rhobar2) - endif - endif - -c compute Rose function, I.16 - Eu = erose(r,re_meam(a,b),alpha_meam(a,b), - $ Ec_meam(a,b),repuls_meam(a,b),attrac_meam(a,b),erose_form) - -c calculate the pair energy - if (lattce_meam(a,b).eq.'c11') then - latta = lattce_meam(a,a) - if (latta.eq.'dia') then - phiaa = phi_meam(r,a,a) - phi_m = (3*Eu - F2 - 2*F1 - 5*phiaa)/Z12 - else - phibb = phi_meam(r,b,b) - phi_m = (3*Eu - F1 - 2*F2 - 5*phibb)/Z12 - endif - else if (lattce_meam(a,b).eq.'l12') then - phiaa = phi_meam(r,a,a) -c account for second neighbor a-a potential here... - call get_Zij(Z1nn,lattce_meam(a,a)) - call get_Zij2(Z2nn,arat,scrn,lattce_meam(a,a), - $ Cmin_meam(a,a,a),Cmax_meam(a,a,a)) - nmax = 10 - if (scrn.gt.0.0) then - do n = 1,nmax - phiaa = phiaa + - $ (-Z2nn*scrn/Z1nn)**n * phi_meam(r*arat**n,a,a) - enddo - endif - phi_m = Eu/3. - F1/4. - F2/12. - phiaa - else -c -c potential is computed from Rose function and embedding energy - phi_m = (2*Eu - F1 - F2)/Z12 -c - endif - -c if r = 0, just return 0 - if (r.eq.0.d0) then - phi_m = 0.d0 - endif - - return - end - -c----------------------------------------------------------------------c -c Compute background density for reference structure of each element - subroutine compute_reference_density - use meam_data - implicit none - - integer a,Z,Z2,errorflag - real*8 gam,Gbar,shp(3) - real*8 rho0,rho0_2nn,arat,scrn - -c loop over element types - do a = 1,neltypes - - Z = Z_meam(a) - if (ibar_meam(a).le.0) then - Gbar = 1.d0 - else - call get_shpfcn(shp,lattce_meam(a,a)) - gam = (t1_meam(a)*shp(1)+t2_meam(a)*shp(2) - $ +t3_meam(a)*shp(3))/(Z*Z) - call G_gam(gam,ibar_meam(a),gsmooth_factor, - $ Gbar,errorflag) - endif - -c The zeroth order density in the reference structure, with -c equilibrium spacing, is just the number of first neighbors times -c the rho0_meam coefficient... - rho0 = rho0_meam(a)*Z - -c ...unless we have unscreened second neighbors, in which case we -c add on the contribution from those (accounting for partial -c screening) - if (nn2_meam(a,a).eq.1) then - call get_Zij2(Z2,arat,scrn,lattce_meam(a,a), - $ Cmin_meam(a,a,a),Cmax_meam(a,a,a)) - rho0_2nn = rho0_meam(a)*fm_exp(-beta0_meam(a)*(arat-1)) - rho0 = rho0 + Z2*rho0_2nn*scrn - endif - - rho_ref_meam(a) = rho0*Gbar - - enddo - - return - end - -c----------------------------------------------------------------------c -c Shape factors for various configurations - subroutine get_shpfcn(s,latt) - implicit none - real*8 s(3) - character*3 latt - if (latt.eq.'fcc'.or.latt.eq.'bcc'. - $ or.latt.eq.'b1'.or.latt.eq.'b2') then - s(1) = 0.d0 - s(2) = 0.d0 - s(3) = 0.d0 - else if (latt.eq.'hcp') then - s(1) = 0.d0 - s(2) = 0.d0 - s(3) = 1.d0/3.d0 - else if (latt.eq.'dia') then - s(1) = 0.d0 - s(2) = 0.d0 - s(3) = 32.d0/9.d0 - else if (latt.eq.'dim') then - s(1) = 1.d0 - s(2) = 2.d0/3.d0 -c s(3) = 1.d0 - s(3) = 0.4d0 - else - s(1) = 0.0 -c call error('Lattice not defined in get_shpfcn.') - endif - return - end -c------------------------------------------------------------------------------c -c Average weighting factors for the reference structure - subroutine get_tavref(t11av,t21av,t31av,t12av,t22av,t32av, - $ t11,t21,t31,t12,t22,t32, - $ r,a,b,latt) - use meam_data - implicit none - real*8 t11av,t21av,t31av,t12av,t22av,t32av - real*8 t11,t21,t31,t12,t22,t32,r - integer a,b - character*3 latt - real*8 rhoa01,rhoa02,a1,a2,rho01,rho02 - -c For ialloy = 2, no averaging is done - if (ialloy.eq.2) then - t11av = t11 - t21av = t21 - t31av = t31 - t12av = t12 - t22av = t22 - t32av = t32 - else - if (latt.eq.'fcc'.or.latt.eq.'bcc'.or.latt.eq.'dia' - $ .or.latt.eq.'hcp'.or.latt.eq.'b1' - $ .or.latt.eq.'dim'.or.latt.eq.'b2') then -c all neighbors are of the opposite type - t11av = t12 - t21av = t22 - t31av = t32 - t12av = t11 - t22av = t21 - t32av = t31 - else - a1 = r/re_meam(a,a) - 1.d0 - a2 = r/re_meam(b,b) - 1.d0 - rhoa01 = rho0_meam(a)*fm_exp(-beta0_meam(a)*a1) - rhoa02 = rho0_meam(b)*fm_exp(-beta0_meam(b)*a2) - if (latt.eq.'l12') then - rho01 = 8*rhoa01 + 4*rhoa02 - t11av = (8*t11*rhoa01 + 4*t12*rhoa02)/rho01 - t12av = t11 - t21av = (8*t21*rhoa01 + 4*t22*rhoa02)/rho01 - t22av = t21 - t31av = (8*t31*rhoa01 + 4*t32*rhoa02)/rho01 - t32av = t31 - else -c call error('Lattice not defined in get_tavref.') - endif - endif - endif - return - end -c------------------------------------------------------------------------------c -c Number of neighbors for the reference structure - subroutine get_Zij(Zij,latt) - implicit none - integer Zij - character*3 latt - if (latt.eq.'fcc') then - Zij = 12 - else if (latt.eq.'bcc') then - Zij = 8 - else if (latt.eq.'hcp') then - Zij = 12 - else if (latt.eq.'b1') then - Zij = 6 - else if (latt.eq.'dia') then - Zij = 4 - else if (latt.eq.'dim') then - Zij = 1 - else if (latt.eq.'c11') then - Zij = 10 - else if (latt.eq.'l12') then - Zij = 12 - else if (latt.eq.'b2') then - Zij = 8 - else -c call error('Lattice not defined in get_Zij.') - endif - return - end - -c------------------------------------------------------------------------------c -c Zij2 = number of second neighbors, a = distance ratio R1/R2, and S = second -c neighbor screening function for lattice type "latt" - - subroutine get_Zij2(Zij2,a,S,latt,cmin,cmax) - implicit none - integer Zij2 - real*8 a,S,cmin,cmax - character*3 latt - real*8 rratio,C,x,sijk - integer numscr - - if (latt.eq.'bcc') then - Zij2 = 6 - a = 2.d0/sqrt(3.d0) - numscr = 4 - else if (latt.eq.'fcc') then - Zij2 = 6 - a = sqrt(2.d0) - numscr = 4 - else if (latt.eq.'dia') then - Zij2 = 12 - a = sqrt(8.d0/3.d0) - numscr = 1 - if (cmin.lt.0.500001) then -c call error('can not do 2NN MEAM for dia') - endif - else if (latt.eq.'hcp') then - Zij2 = 6 - a = sqrt(2.d0) - numscr = 4 - else if (latt.eq.'b1') then - Zij2 = 12 - a = sqrt(2.d0) - numscr = 2 - else if (latt.eq.'l12') then - Zij2 = 6 - a = sqrt(2.d0) - numscr = 4 - else if (latt.eq.'b2') then - Zij2 = 6 - a = 2.d0/sqrt(3.d0) - numscr = 4 - else if (latt.eq.'dim') then -c this really shouldn't be allowed; make sure screening is zero - Zij2 = 0 - a = 1 - S = 0 - return - else -c call error('Lattice not defined in get_Zij2.') - endif - -c Compute screening for each first neighbor - C = 4.d0/(a*a) - 1.d0 - x = (C-cmin)/(cmax-cmin) - call fcut(x,sijk) -c There are numscr first neighbors screening the second neighbors - S = sijk**numscr - - return - end - - -c------------------------------------------------------------------------------c - subroutine get_sijk(C,i,j,k,sijk) - use meam_data - implicit none - real*8 C,sijk - integer i,j,k - real*8 x - x = (C-Cmin_meam(i,j,k))/(Cmax_meam(i,j,k)-Cmin_meam(i,j,k)) - call fcut(x,sijk) - return - end - -c------------------------------------------------------------------------------c -c Calculate density functions, assuming reference configuration - subroutine get_densref(r,a,b,rho01,rho11,rho21,rho31, - $ rho02,rho12,rho22,rho32) - use meam_data - implicit none - real*8 r,rho01,rho11,rho21,rho31,rho02,rho12,rho22,rho32 - real*8 a1,a2 - real*8 rhoa01,rhoa11,rhoa21,rhoa31,rhoa02,rhoa12,rhoa22,rhoa32 - real*8 s(3) - character*3 lat - integer a,b - integer Zij1nn,Zij2nn - real*8 rhoa01nn,rhoa02nn - real*8 arat,scrn,denom - real*8 C,s111,s112,s221,S11,S22 - - a1 = r/re_meam(a,a) - 1.d0 - a2 = r/re_meam(b,b) - 1.d0 - - rhoa01 = rho0_meam(a)*fm_exp(-beta0_meam(a)*a1) - rhoa11 = rho0_meam(a)*fm_exp(-beta1_meam(a)*a1) - rhoa21 = rho0_meam(a)*fm_exp(-beta2_meam(a)*a1) - rhoa31 = rho0_meam(a)*fm_exp(-beta3_meam(a)*a1) - rhoa02 = rho0_meam(b)*fm_exp(-beta0_meam(b)*a2) - rhoa12 = rho0_meam(b)*fm_exp(-beta1_meam(b)*a2) - rhoa22 = rho0_meam(b)*fm_exp(-beta2_meam(b)*a2) - rhoa32 = rho0_meam(b)*fm_exp(-beta3_meam(b)*a2) - - lat = lattce_meam(a,b) - - rho11 = 0.d0 - rho21 = 0.d0 - rho31 = 0.d0 - rho12 = 0.d0 - rho22 = 0.d0 - rho32 = 0.d0 - - call get_Zij(Zij1nn,lat) - - if (lat.eq.'fcc') then - rho01 = 12.d0*rhoa02 - rho02 = 12.d0*rhoa01 - else if (lat.eq.'bcc') then - rho01 = 8.d0*rhoa02 - rho02 = 8.d0*rhoa01 - else if (lat.eq.'b1') then - rho01 = 6*rhoa02 - rho02 = 6*rhoa01 - else if (lat.eq.'dia') then - rho01 = 4*rhoa02 - rho02 = 4*rhoa01 - rho31 = 32.d0/9.d0*rhoa32*rhoa32 - rho32 = 32.d0/9.d0*rhoa31*rhoa31 - else if (lat.eq.'hcp') then - rho01 = 12*rhoa02 - rho02 = 12*rhoa01 - rho31 = 1.d0/3.d0*rhoa32*rhoa32 - rho32 = 1.d0/3.d0*rhoa31*rhoa31 - else if (lat.eq.'dim') then - call get_shpfcn(s,'dim') - rho01 = rhoa02 - rho02 = rhoa01 - rho11 = s(1)*rhoa12*rhoa12 - rho12 = s(1)*rhoa11*rhoa11 - rho21 = s(2)*rhoa22*rhoa22 - rho22 = s(2)*rhoa21*rhoa21 - rho31 = s(3)*rhoa32*rhoa32 - rho32 = s(3)*rhoa31*rhoa31 - else if (lat.eq.'c11') then - rho01 = rhoa01 - rho02 = rhoa02 - rho11 = rhoa11 - rho12 = rhoa12 - rho21 = rhoa21 - rho22 = rhoa22 - rho31 = rhoa31 - rho32 = rhoa32 - else if (lat.eq.'l12') then - rho01 = 8*rhoa01 + 4*rhoa02 - rho02 = 12*rhoa01 - if (ialloy.eq.1) then - rho21 = 8./3.*(rhoa21*t2_meam(a)-rhoa22*t2_meam(b))**2 - denom = 8*rhoa01*t2_meam(a)**2 + 4*rhoa02*t2_meam(b)**2 - if (denom.gt.0.) then - rho21 = rho21/denom * rho01 - endif - else - rho21 = 8./3.*(rhoa21-rhoa22)*(rhoa21-rhoa22) - endif - else if (lat.eq.'b2') then - rho01 = 8.d0*rhoa02 - rho02 = 8.d0*rhoa01 - else -c call error('Lattice not defined in get_densref.') - endif - - if (nn2_meam(a,b).eq.1) then - - call get_Zij2(Zij2nn,arat,scrn,lat, - $ Cmin_meam(a,a,b),Cmax_meam(a,a,b)) - - a1 = arat*r/re_meam(a,a) - 1.d0 - a2 = arat*r/re_meam(b,b) - 1.d0 - - rhoa01nn = rho0_meam(a)*fm_exp(-beta0_meam(a)*a1) - rhoa02nn = rho0_meam(b)*fm_exp(-beta0_meam(b)*a2) - - if (lat.eq.'l12') then -c As usual, L12 thinks it's special; we need to be careful computing -c the screening functions - C = 1.d0 - call get_sijk(C,a,a,a,s111) - call get_sijk(C,a,a,b,s112) - call get_sijk(C,b,b,a,s221) - S11 = s111 * s111 * s112 * s112 - S22 = s221**4 - rho01 = rho01 + 6*S11*rhoa01nn - rho02 = rho02 + 6*S22*rhoa02nn - - else -c For other cases, assume that second neighbor is of same type, -c first neighbor may be of different type - - rho01 = rho01 + Zij2nn*scrn*rhoa01nn - -c Assume Zij2nn and arat don't depend on order, but scrn might - call get_Zij2(Zij2nn,arat,scrn,lat, - $ Cmin_meam(b,b,a),Cmax_meam(b,b,a)) - rho02 = rho02 + Zij2nn*scrn*rhoa02nn - - endif - - endif - - return - end - -c--------------------------------------------------------------------- -c Compute ZBL potential -c - real*8 function zbl(r,z1,z2) - use meam_data , only : fm_exp - implicit none - integer i,z1,z2 - real*8 r,c,d,a,azero,cc,x - dimension c(4),d(4) - data c /0.028171,0.28022,0.50986,0.18175/ - data d /0.20162,0.40290,0.94229,3.1998/ - data azero /0.4685/ - data cc /14.3997/ -c azero = (9pi^2/128)^1/3 (0.529) Angstroms - a = azero/(z1**0.23+z2**0.23) - zbl = 0.0 - x = r/a - do i=1,4 - zbl = zbl + c(i)*fm_exp(-d(i)*x) - enddo - if (r.gt.0.d0) zbl = zbl*z1*z2/r*cc - return - end - -c--------------------------------------------------------------------- -c Compute Rose energy function, I.16 -c - real*8 function erose(r,re,alpha,Ec,repuls,attrac,form) - use meam_data , only : fm_exp - implicit none - real*8 r,re,alpha,Ec,repuls,attrac,astar,a3 - integer form - - erose = 0.d0 - - if (r.gt.0.d0) then - astar = alpha * (r/re - 1.d0) - a3 = 0.d0 - if (astar.ge.0) then - a3 = attrac - else if (astar.lt.0) then - a3 = repuls - endif - if (form.eq.1) then - erose = -Ec*(1+astar+(-attrac+repuls/r)* - $ (astar**3))*fm_exp(-astar) - else if (form.eq.2) then - erose = -Ec * (1 +astar + a3*(astar**3))*fm_exp(-astar) - else - erose = -Ec * (1+ astar + a3*(astar**3)/(r/re))*fm_exp(-astar) - endif - endif - - return - end - -c ----------------------------------------------------------------------- - - subroutine interpolate_meam(ind) - use meam_data - implicit none - - integer j,ind - real*8 drar - -c map to coefficient space - - nrar = nr - drar = dr - rdrar = 1.0D0/drar - -c phir interp - do j = 1,nrar - phirar(j,ind) = phir(j,ind) - enddo - - phirar1(1,ind) = phirar(2,ind)-phirar(1,ind) - phirar1(2,ind) = 0.5D0*(phirar(3,ind)-phirar(1,ind)) - phirar1(nrar-1,ind) = 0.5D0*(phirar(nrar,ind) - $ -phirar(nrar-2,ind)) - phirar1(nrar,ind) = 0.0D0 - do j = 3,nrar-2 - phirar1(j,ind) = ((phirar(j-2,ind)-phirar(j+2,ind)) + - $ 8.0D0*(phirar(j+1,ind)-phirar(j-1,ind)))/12. - enddo - - do j = 1,nrar-1 - phirar2(j,ind) = 3.0D0*(phirar(j+1,ind)-phirar(j,ind)) - - $ 2.0D0*phirar1(j,ind) - phirar1(j+1,ind) - phirar3(j,ind) = phirar1(j,ind) + phirar1(j+1,ind) - - $ 2.0D0*(phirar(j+1,ind)-phirar(j,ind)) - enddo - phirar2(nrar,ind) = 0.0D0 - phirar3(nrar,ind) = 0.0D0 - - do j = 1,nrar - phirar4(j,ind) = phirar1(j,ind)/drar - phirar5(j,ind) = 2.0D0*phirar2(j,ind)/drar - phirar6(j,ind) = 3.0D0*phirar3(j,ind)/drar - enddo - - end - -c--------------------------------------------------------------------- -c Compute Rose energy function, I.16 -c - real*8 function compute_phi(rij, elti, eltj) - use meam_data - implicit none - - real*8 rij, pp - integer elti, eltj, ind, kk - - ind = eltind(elti, eltj) - pp = rij*rdrar + 1.0D0 - kk = pp - kk = min(kk,nrar-1) - pp = pp - kk - pp = min(pp,1.0D0) - compute_phi = ((phirar3(kk,ind)*pp + phirar2(kk,ind))*pp - $ + phirar1(kk,ind))*pp + phirar(kk,ind) - - return - end diff --git a/lib/meam/meam_setup_global.F b/lib/meam/meam_setup_global.F deleted file mode 100644 index d11dec5a4a..0000000000 --- a/lib/meam/meam_setup_global.F +++ /dev/null @@ -1,111 +0,0 @@ -c -c declaration in pair_meam.h: -c -c void meam_setup_global(int *, int *, double *, int *, double *, double *, -c double *, double *, double *, double *, double *, -c double *, double *, double *, double *, double *, -c double *, double *, int *); -c -c call in pair_meam.cpp: -c -c meam_setup_global(&nelements,lat,z,ielement,atwt,alpha,b0,b1,b2,b3, -c alat,esub,asub,t0,t1,t2,t3,rozero,ibar); -c -c - - subroutine meam_setup_global(nelt, lat, z, ielement, atwt, alpha, - $ b0, b1, b2, b3, alat, esub, asub, - $ t0, t1, t2, t3, rozero, ibar) - - use meam_data - implicit none - - integer nelt, lat, ielement, ibar - real*8 z, atwt, alpha, b0, b1, b2, b3 - real*8 alat, esub, asub, t0, t1, t2, t3 - real*8 rozero - - dimension lat(nelt), ielement(nelt), ibar(nelt) - dimension z(nelt), atwt(nelt), alpha(nelt) - dimension b0(nelt), b1(nelt), b2(nelt), b3(nelt) - dimension alat(nelt), esub(nelt), asub(nelt) - dimension t0(nelt), t1(nelt), t2(nelt), t3(nelt), rozero(nelt) - - integer i - real*8 tmplat(maxelt) - - neltypes = nelt - - do i = 1,nelt - - if (lat(i).eq.0) then - lattce_meam(i,i) = 'fcc' - else if (lat(i).eq.1) then - lattce_meam(i,i) = 'bcc' - else if (lat(i).eq.2) then - lattce_meam(i,i) = 'hcp' - else if (lat(i).eq.3) then - lattce_meam(i,i) = 'dim' - else if (lat(i).eq.4) then - lattce_meam(i,i) = 'dia' - else -c unknown - endif - - Z_meam(i) = z(i) - ielt_meam(i) = ielement(i) - alpha_meam(i,i) = alpha(i) - beta0_meam(i) = b0(i) - beta1_meam(i) = b1(i) - beta2_meam(i) = b2(i) - beta3_meam(i) = b3(i) - tmplat(i) = alat(i) - Ec_meam(i,i) = esub(i) - A_meam(i) = asub(i) - t0_meam(i) = t0(i) - t1_meam(i) = t1(i) - t2_meam(i) = t2(i) - t3_meam(i) = t3(i) - rho0_meam(i) = rozero(i) - ibar_meam(i) = ibar(i) - - if (lattce_meam(i,i).eq.'fcc') then - re_meam(i,i) = tmplat(i)/sqrt(2.d0) - elseif (lattce_meam(i,i).eq.'bcc') then - re_meam(i,i) = tmplat(i)*sqrt(3.d0)/2.d0 - elseif (lattce_meam(i,i).eq.'hcp') then - re_meam(i,i) = tmplat(i) - elseif (lattce_meam(i,i).eq.'dim') then - re_meam(i,i) = tmplat(i) - elseif (lattce_meam(i,i).eq.'dia') then - re_meam(i,i) = tmplat(i)*sqrt(3.d0)/4.d0 - else -c error - endif - - enddo - - -c Set some defaults - rc_meam = 4.0 - delr_meam = 0.1 - attrac_meam(:,:) = 0.0 - repuls_meam(:,:) = 0.0 - Cmax_meam(:,:,:) = 2.8 - Cmin_meam(:,:,:) = 2.0 - ebound_meam(:,:) = (2.8d0**2)/(4.d0*(2.8d0-1.d0)) - delta_meam(:,:) = 0.0 - nn2_meam(:,:) = 0 - zbl_meam(:,:) = 1 - gsmooth_factor = 99.0 - augt1 = 1 - ialloy = 0 - mix_ref_t = 0 - emb_lin_neg = 0 - bkgd_dyn = 0 - erose_form = 0 - - return - end - - diff --git a/lib/meam/meam_setup_param.F b/lib/meam/meam_setup_param.F deleted file mode 100644 index cfe7430285..0000000000 --- a/lib/meam/meam_setup_param.F +++ /dev/null @@ -1,204 +0,0 @@ -c -c do a sanity check on index parameters - subroutine meam_checkindex(num,lim,nidx,idx,ierr) - implicit none - integer i,num,lim,nidx,idx(3),ierr - - ierr = 0 - if (nidx.lt.num) then - ierr = 2 - return - endif - - do i=1,num - if ((idx(i).lt.1).or.(idx(i).gt.lim)) then - ierr = 3 - return - endif - enddo - end - -c -c Declaration in pair_meam.h: -c -c void meam_setup_param(int *, double *, int *, int *, int *); -c -c Call in pair_meam.cpp -c -c meam_setup_param(&which,&value,&nindex,index,&errorflag); -c -c -c -c The "which" argument corresponds to the index of the "keyword" array -c in pair_meam.cpp: -c -c 0 = Ec_meam -c 1 = alpha_meam -c 2 = rho0_meam -c 3 = delta_meam -c 4 = lattce_meam -c 5 = attrac_meam -c 6 = repuls_meam -c 7 = nn2_meam -c 8 = Cmin_meam -c 9 = Cmax_meam -c 10 = rc_meam -c 11 = delr_meam -c 12 = augt1 -c 13 = gsmooth_factor -c 14 = re_meam -c 15 = ialloy -c 16 = mixture_ref_t -c 17 = erose_form -c 18 = zbl_meam -c 19 = emb_lin_neg -c 20 = bkgd_dyn - - subroutine meam_setup_param(which, value, nindex, - $ index, errorflag) - - use meam_data - implicit none - - integer which, nindex, index(3), errorflag - real*8 value - integer i1, i2 - - errorflag = 0 - -c 0 = Ec_meam - if (which.eq.0) then - call meam_checkindex(2,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - Ec_meam(index(1),index(2)) = value - -c 1 = alpha_meam - else if (which.eq.1) then - call meam_checkindex(2,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - alpha_meam(index(1),index(2)) = value - -c 2 = rho0_meam - else if (which.eq.2) then - call meam_checkindex(1,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - rho0_meam(index(1)) = value - -c 3 = delta_meam - else if (which.eq.3) then - call meam_checkindex(2,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - delta_meam(index(1),index(2)) = value - -c 4 = lattce_meam - else if (which.eq.4) then - call meam_checkindex(2,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - if (value.eq.0) then - lattce_meam(index(1),index(2)) = "fcc" - else if (value.eq.1) then - lattce_meam(index(1),index(2)) = "bcc" - else if (value.eq.2) then - lattce_meam(index(1),index(2)) = "hcp" - else if (value.eq.3) then - lattce_meam(index(1),index(2)) = "dim" - else if (value.eq.4) then - lattce_meam(index(1),index(2)) = "dia" - else if (value.eq.5) then - lattce_meam(index(1),index(2)) = 'b1' - else if (value.eq.6) then - lattce_meam(index(1),index(2)) = 'c11' - else if (value.eq.7) then - lattce_meam(index(1),index(2)) = 'l12' - else if (value.eq.8) then - lattce_meam(index(1),index(2)) = 'b2' - endif - -c 5 = attrac_meam - else if (which.eq.5) then - call meam_checkindex(2,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - attrac_meam(index(1),index(2)) = value - -c 6 = repuls_meam - else if (which.eq.6) then - call meam_checkindex(2,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - repuls_meam(index(1),index(2)) = value - -c 7 = nn2_meam - else if (which.eq.7) then - call meam_checkindex(2,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - i1 = min(index(1),index(2)) - i2 = max(index(1),index(2)) - nn2_meam(i1,i2) = value - -c 8 = Cmin_meam - else if (which.eq.8) then - call meam_checkindex(3,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - Cmin_meam(index(1),index(2),index(3)) = value - -c 9 = Cmax_meam - else if (which.eq.9) then - call meam_checkindex(3,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - Cmax_meam(index(1),index(2),index(3)) = value - -c 10 = rc_meam - else if (which.eq.10) then - rc_meam = value - -c 11 = delr_meam - else if (which.eq.11) then - delr_meam = value - -c 12 = augt1 - else if (which.eq.12) then - augt1 = value - -c 13 = gsmooth - else if (which.eq.13) then - gsmooth_factor = value - -c 14 = re_meam - else if (which.eq.14) then - call meam_checkindex(2,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - re_meam(index(1),index(2)) = value - -c 15 = ialloy - else if (which.eq.15) then - ialloy = value - -c 16 = mixture_ref_t - else if (which.eq.16) then - mix_ref_t = value - -c 17 = erose_form - else if (which.eq.17) then - erose_form = value - -c 18 = zbl_meam - else if (which.eq.18) then - call meam_checkindex(2,maxelt,nindex,index,errorflag) - if (errorflag.ne.0) return - i1 = min(index(1),index(2)) - i2 = max(index(1),index(2)) - zbl_meam(i1,i2) = value - -c 19 = emb_lin_neg - else if (which.eq.19) then - emb_lin_neg = value - -c 20 = bkgd_dyn - else if (which.eq.20) then - bkgd_dyn = value - - else - errorflag = 1 - endif - - return - end diff --git a/lib/reax/Install.py b/lib/reax/Install.py deleted file mode 120000 index ffe709d44c..0000000000 --- a/lib/reax/Install.py +++ /dev/null @@ -1 +0,0 @@ -../Install.py \ No newline at end of file diff --git a/lib/reax/Makefile.g95 b/lib/reax/Makefile.g95 deleted file mode 100644 index 55c40daa00..0000000000 --- a/lib/reax/Makefile.g95 +++ /dev/null @@ -1,51 +0,0 @@ -# * -# *_________________________________________________________________________* -# * Fortran Library for Reactive Force Field * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * CONTRIBUTING AUTHORS: Hansohl Cho(MIT), Aidan Thompson(SNL) * -# * and Greg Wagner(SNL) * -# * CONTACT: hansohl@mit.edu, athompson@sandia.gov, gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.gfortran - -# ------ FILES ------ - -SRC = reax_connect.F reax_inout.F reax_lammps.F reax_poten.F reax_reac.F reax_charges.F - -HEADERFILES = reax_defs.h *.blk - -# ------ DEFINITIONS ------ - -LIB = libreax.a -OBJ = $(SRC:.F=.o) - -# ------ SETTINGS ------ - -F90 = g95 -F90FLAGS = -O -fPIC -ARCHIVE = ar -ARCHFLAG = -rc -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F $(HEADERFILES) - $(F90) $(F90FLAGS) -c $< - -# ------ CLEAN ------ - -clean: - -rm *.o $(LIB) diff --git a/lib/reax/Makefile.gfortran b/lib/reax/Makefile.gfortran deleted file mode 100644 index ab42301688..0000000000 --- a/lib/reax/Makefile.gfortran +++ /dev/null @@ -1,51 +0,0 @@ -# * -# *_________________________________________________________________________* -# * Fortran Library for Reactive Force Field * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * CONTRIBUTING AUTHORS: Hansohl Cho(MIT), Aidan Thompson(SNL) * -# * and Greg Wagner(SNL) * -# * CONTACT: hansohl@mit.edu, athompson@sandia.gov, gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.gfortran - -# ------ FILES ------ - -SRC = reax_connect.F reax_inout.F reax_lammps.F reax_poten.F reax_reac.F reax_charges.F - -HEADERFILES = reax_defs.h *.blk - -# ------ DEFINITIONS ------ - -LIB = libreax.a -OBJ = $(SRC:.F=.o) - -# ------ SETTINGS ------ - -F90 = gfortran -F90FLAGS = -O3 -fPIC -fno-second-underscore -ARCHIVE = ar -ARCHFLAG = -rc -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F $(HEADERFILES) - $(F90) $(F90FLAGS) -c $< - -# ------ CLEAN ------ - -clean: - -rm *.o $(LIB) diff --git a/lib/reax/Makefile.ifort b/lib/reax/Makefile.ifort deleted file mode 100644 index 1760cb9c6a..0000000000 --- a/lib/reax/Makefile.ifort +++ /dev/null @@ -1,51 +0,0 @@ -# * -# *_________________________________________________________________________* -# * Fortran Library for Reactive Force Field * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * CONTRIBUTING AUTHORS: Hansohl Cho(MIT), Aidan Thompson(SNL) * -# * and Greg Wagner(SNL) * -# * CONTACT: hansohl@mit.edu, athompson@sandia.gov, gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.ifort - -# ------ FILES ------ - -SRC = reax_connect.F reax_inout.F reax_lammps.F reax_poten.F reax_reac.F reax_charges.F - -HEADERFILES = reax_defs.h *.blk - -# ------ DEFINITIONS ------ - -LIB = libreax.a -OBJ = $(SRC:.F=.o) - -# ------ SETTINGS ------ - -F90 = ifort -F90FLAGS = -O -fPIC -ARCHIVE = ar -ARCHFLAG = -rc -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F $(HEADERFILES) - $(F90) $(F90FLAGS) -c $< - -# ------ CLEAN ------ - -clean: - -rm *.o $(LIB) diff --git a/lib/reax/Makefile.lammps.empty b/lib/reax/Makefile.lammps.empty deleted file mode 100644 index 758755f3c8..0000000000 --- a/lib/reax/Makefile.lammps.empty +++ /dev/null @@ -1,5 +0,0 @@ -# Settings that the LAMMPS build will import when this package library is used - -reax_SYSINC = -reax_SYSLIB = -reax_SYSPATH = diff --git a/lib/reax/Makefile.lammps.gfortran b/lib/reax/Makefile.lammps.gfortran deleted file mode 100644 index f5da63bc38..0000000000 --- a/lib/reax/Makefile.lammps.gfortran +++ /dev/null @@ -1,5 +0,0 @@ -# Settings that the LAMMPS build will import when this package library is used - -reax_SYSINC = -reax_SYSLIB = -lgfortran -reax_SYSPATH = diff --git a/lib/reax/Makefile.lammps.ifort b/lib/reax/Makefile.lammps.ifort deleted file mode 100644 index 69ac12606d..0000000000 --- a/lib/reax/Makefile.lammps.ifort +++ /dev/null @@ -1,6 +0,0 @@ -# Settings that the LAMMPS build will import when this package library is used - -reax_SYSINC = -reax_SYSLIB = -lifcore -reax_SYSPATH = - diff --git a/lib/reax/Makefile.mpi b/lib/reax/Makefile.mpi deleted file mode 100644 index 142f7e9bc6..0000000000 --- a/lib/reax/Makefile.mpi +++ /dev/null @@ -1,51 +0,0 @@ -# * -# *_________________________________________________________________________* -# * Fortran Library for Reactive Force Field * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * CONTRIBUTING AUTHORS: Hansohl Cho(MIT), Aidan Thompson(SNL) * -# * and Greg Wagner(SNL) * -# * CONTACT: hansohl@mit.edu, athompson@sandia.gov, gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.empty - -# ------ FILES ------ - -SRC = reax_connect.F reax_inout.F reax_lammps.F reax_poten.F reax_reac.F reax_charges.F - -HEADERFILES = reax_defs.h *.blk - -# ------ DEFINITIONS ------ - -LIB = libreax.a -OBJ = $(SRC:.F=.o) - -# ------ SETTINGS ------ - -F90 = mpifort -F90FLAGS = -O3 -fPIC -ARCHIVE = ar -ARCHFLAG = -rc -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F $(HEADERFILES) - $(F90) $(F90FLAGS) -c $< - -# ------ CLEAN ------ - -clean: - -rm *.o $(LIB) diff --git a/lib/reax/Makefile.pgf90 b/lib/reax/Makefile.pgf90 deleted file mode 100644 index dfc17eca11..0000000000 --- a/lib/reax/Makefile.pgf90 +++ /dev/null @@ -1,51 +0,0 @@ -# * -# *_________________________________________________________________________* -# * Fortran Library for Reactive Force Field * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * CONTRIBUTING AUTHORS: Hansohl Cho(MIT), Aidan Thompson(SNL) * -# * and Greg Wagner(SNL) * -# * CONTACT: hansohl@mit.edu, athompson@sandia.gov, gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.pgf90 - -# ------ FILES ------ - -SRC = reax_connect.F reax_inout.F reax_lammps.F reax_poten.F reax_reac.F reax_charges.F - -HEADERFILES = reax_defs.h *.blk - -# ------ DEFINITIONS ------ - -LIB = libreax.a -OBJ = $(SRC:.F=.o) - -# ------ SETTINGS ------ - -F90 = pgf90 -F90FLAGS = -O -fPIC -ARCHIVE = ar -ARCHFLAG = -rc -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F $(HEADERFILES) - $(F90) $(F90FLAGS) -c $< - -# ------ CLEAN ------ - -clean: - -rm *.o $(LIB) diff --git a/lib/reax/Makefile.redsky b/lib/reax/Makefile.redsky deleted file mode 100644 index f51a15d1f1..0000000000 --- a/lib/reax/Makefile.redsky +++ /dev/null @@ -1,51 +0,0 @@ -# * -# *_________________________________________________________________________* -# * Fortran Library for Reactive Force Field * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * CONTRIBUTING AUTHORS: Hansohl Cho(MIT), Aidan Thompson(SNL) * -# * and Greg Wagner(SNL) * -# * CONTACT: hansohl@mit.edu, athompson@sandia.gov, gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.ifort - -# ------ FILES ------ - -SRC = reax_connect.F reax_inout.F reax_lammps.F reax_poten.F reax_reac.F reax_charges.F - -HEADERFILES = reax_defs.h *.blk - -# ------ DEFINITIONS ------ - -LIB = libreax.a -OBJ = $(SRC:.F=.o) - -# ------ SETTINGS ------ - -F90 = mpif90 -F90FLAGS = -O -fPIC -ARCHIVE = ar -ARCHFLAG = -rc -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F $(HEADERFILES) - $(F90) $(F90FLAGS) -c $< - -# ------ CLEAN ------ - -clean: - -rm *.o $(LIB) diff --git a/lib/reax/Makefile.serial b/lib/reax/Makefile.serial deleted file mode 120000 index c52fbcb986..0000000000 --- a/lib/reax/Makefile.serial +++ /dev/null @@ -1 +0,0 @@ -Makefile.gfortran \ No newline at end of file diff --git a/lib/reax/Makefile.tbird b/lib/reax/Makefile.tbird deleted file mode 100644 index f51a15d1f1..0000000000 --- a/lib/reax/Makefile.tbird +++ /dev/null @@ -1,51 +0,0 @@ -# * -# *_________________________________________________________________________* -# * Fortran Library for Reactive Force Field * -# * DESCRIPTION: SEE READ-ME * -# * FILE NAME: Makefile * -# * CONTRIBUTING AUTHORS: Hansohl Cho(MIT), Aidan Thompson(SNL) * -# * and Greg Wagner(SNL) * -# * CONTACT: hansohl@mit.edu, athompson@sandia.gov, gjwagne@sandia.gov * -# *_________________________________________________________________________*/ - -SHELL = /bin/sh - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.ifort - -# ------ FILES ------ - -SRC = reax_connect.F reax_inout.F reax_lammps.F reax_poten.F reax_reac.F reax_charges.F - -HEADERFILES = reax_defs.h *.blk - -# ------ DEFINITIONS ------ - -LIB = libreax.a -OBJ = $(SRC:.F=.o) - -# ------ SETTINGS ------ - -F90 = mpif90 -F90FLAGS = -O -fPIC -ARCHIVE = ar -ARCHFLAG = -rc -USRLIB = -SYSLIB = - -# ------ MAKE PROCEDURE ------ - -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp $(EXTRAMAKE) Makefile.lammps - -# ------ COMPILE RULES ------ - -%.o:%.F $(HEADERFILES) - $(F90) $(F90FLAGS) -c $< - -# ------ CLEAN ------ - -clean: - -rm *.o $(LIB) diff --git a/lib/reax/README b/lib/reax/README deleted file mode 100644 index f21a470618..0000000000 --- a/lib/reax/README +++ /dev/null @@ -1,78 +0,0 @@ -ReaxFF library - -Aidan Thompson, Sandia National Labs -athomps at sandia.gov -Jan 2008 - -This library is an implementation of the ReaxFF potential, -specifically designed to work with LAMMPS. It is derived from Adri van -Duin's original serial code, with intervening incarnations in CMDF and -GRASP. - -------------------------------------------------- - -This directory has source files to build a library that LAMMPS -links against when using the REAX package. - -This library must be built with a F90 compiler, before LAMMPS is -built, so LAMMPS can link against it. - -You can type "make lib-reax" from the src directory to see help on how -to build this library via make commands, or you can do the same thing -by typing "python Install.py" from within this directory, or you can -do it manually by following the instructions below. - -Build the library using one of the provided Makefile.* files or create -your own, specific to your compiler and system. For example: - -make -f Makefile.gfortran - -When you are done building this library, two files should -exist in this directory: - -libreax.a the library LAMMPS will link against -Makefile.lammps settings the LAMMPS Makefile will import - -Makefile.lammps is created by the make command, by copying one of the -Makefile.lammps.* files. See the EXTRAMAKE setting at the top of the -Makefile.* files. - -IMPORTANT: You must examine the final Makefile.lammps to insure it is -correct for your system, else the LAMMPS build will likely fail. - -Makefile.lammps has settings for 3 variables: - -user-reax_SYSINC = leave blank for this package -user-reax_SYSLIB = auxiliary F90 libs needed to link a F90 lib with - a C++ program (LAMMPS) via a C++ compiler -user-reax_SYSPATH = path(s) to where those libraries are - -Because you have a F90 compiler on your system, you should have these -libraries. But you will have to figure out which ones are needed and -where they are. Examples of common configurations are in the -Makefile.lammps.* files. - -------------------------------------------------- - -Additional build notes: - -The include file reax_defs.h is used by both the ReaxFF library source -files and the LAMMPS pair_reax.cpp source file (in package src/REAX). -It contains dimensions of statically-allocated arrays created by the -ReaxFF library. The size of these arrays must be set small enough to -avoid exceeding the available machine memory, and large enough to fit -the actual data generated by ReaxFF. If you change the values in -reax_defs.h, you must first rebuild the library and then rebuild -LAMMPS. - -This library is called by functions in pair_reax.cpp. The C++ to -FORTRAN function calls in pair_reax.cpp assume that FORTRAN object -names are converted to C object names by appending an underscore -character. This is generally the case, but on machines that do not -conform to this convention, you will need to modify either the C++ -code or your compiler settings. The name conversion is handled by the -preprocessor macro called FORTRAN in the file pair_reax_fortran.h, -which is included by pair_reax.cpp. Different definitions of this -macro can be obtained by adding a machine-specific macro definition to -the CCFLAGS variable in your your LAMMPS Makefile e.g. -D_IBM. See -pair_reax_fortran.h for more info. diff --git a/lib/reax/cbka.blk b/lib/reax/cbka.blk deleted file mode 100644 index 4dbe0a36c6..0000000000 --- a/lib/reax/cbka.blk +++ /dev/null @@ -1,116 +0,0 @@ -#include "reax_defs.h" - implicit real*8 (a-h,o-z),integer(i-n) - parameter (nneighmax=NNEIGHMAXDEF) - parameter (nat=NATDEF) !Max number of atoms - parameter (nattot=NATTOTDEF) !Max number of global atoms - parameter (nsort=NSORTDEF) !Max number of atom types - parameter (mbond=MBONDDEF) !Max number of bonds connected to one atom - parameter (na1mx3=3*nat) !3*max number of atoms - parameter (navib=NAVIBDEF) !for 2nd derivatives - parameter (nbotym=NBOTYMDEF) !Max number of bond types - parameter (nvatym=NVATYMDEF) !Max number of valency angle types - parameter (ntotym=NTOTYMDEF) !Max number of torsion angle types - parameter (nhbtym=NHBTYMDEF) !Max number of hydrogen bond types - parameter (nodmtym=NODMTYMDEF) !Max number of off-diagonal Morse types - parameter (nboallmax=NBOALLMAXDEF) !Max number of all bonds - parameter (nbomax=NBOMAXDEF) !Max number of bonds - parameter (nhbmax=NHBMAXDEF) !Max number of hydrogen bonds - parameter (nvamax=NVAMAXDEF) !Max number of valency angles - parameter (nopmax=NOPMAXDEF) !Max number of out of plane angles - parameter (ntomax=NTOMAXDEF) !Max number of torsion angles - parameter (npamax=NPAMAXDEF) !Max number of general parameters in force field - parameter (nmolmax=NMOLMAXDEF) !Max number of molecules in system - parameter (nmolset=NMOLSETDEF) !Max number of molecules in training set - parameter (mrestra=MRESTRADEF) !Max number of restraints - parameter (mtreg=MTREGDEF) !Max number of temperature regimes - parameter (mtzone=MTZONEDEF) !Max number of temperature zones - parameter (mvreg=MVREGDEF) !Max number of volume regimes - parameter (mvzone=MVZONEDEF) !Max number of volume zones - parameter (mereg=MEREGDEF) !Max number of electric field regimes - parameter (mezone=MEZONEDEF) !Max number of electric field zones - character*1 qr,qrset,qresi2 - character*2 qaset,qadd - character*3 qresi1 - character*5 qlabel,qffty,qbgfaxes,qbgfsgn,qresi3 - character*20 qkeyw - character*25 qfile - character*40 qffield,qformat,qstrana2 - character*60 qremark,qremset,qmolset - character*200 qstrana1 - common - $/cbka/ dhbdc(nhbmax,3,3),cp(nat,3), - $ cadd(nat,3),d2(3*navib,3*navib), - $ veladd(3,nat), - $ aold(3,nat),dic(3,nat),pvdw1(nsort,nsort), - $ pvdw2(nsort,nsort),angimp(nat,6), - $ yt(na1mx3),pt(na1mx3),gi(na1mx3),enmolset(nmolset), - $ ai(na1mx3),bi(na1mx3),yi(na1mx3),pn(na1mx3),tbo(nat), - $ chgbgf(nattot), - $ abo2(nat),bor4(nat),bos(nbomax), - $ eldef(nat),vradic(nat), - $ vmo2(nat), - $ ro(nbomax),dbondr(nbomax), - $ dbosidr(nbomax),thgo(nopmax), - $ elmol(nmolmax), - $ elaf(nsort),vpq(nsort), - $ rvdw(nsort),alf(nsort),eps(nsort),chat(nsort), - $ rcore(nsort,nsort),ecore(nsort,nsort),acore(nsort,nsort), - $ vlp2(nsort), - $ valp2(nsort),vincr(nsort), - $ vval3(nsort), - $ vuncor(nbotym), - $ vop(nsort), - $ sigqeq(nsort), - $ rrcha(mrestra), - $ rmstra3(mrestra), - $ rmcha(mrestra), - $ rtcha(mrestra),rvcha(mrestra), - $ v2bo(ntotym),v3bo(ntotym), - $ eel,fctor,elr, - $ presx2,presy2,presz2, - $ tset2, - $ enmol,formol,vvol,tpnrad, - $ delvib, - $ taut2,tincr,xmasmd, - $ gdicmax,parc1,parc2,sumelec, - $ xinh,fsnh,vqnh,snh,ham,errnh,sumhe, - $ swa,swb2,swc0,swc1,swc2,swc3,swc4,swc5,swc6, - $ swc7,plr,endpo2,ccpar, - $ c4,estrmin,endpo,accincr, - $ endpoold,xadd,yadd,zadd,addist,taddmol, - $ Hug_E0, Hug_P0, Hug_V0, xImpVcm, shock_vel, - $ shock_z_sep - common - $/cbka/ - $ ioop(nopmax,9),ifreqset(nmolset), - $ ijk(nat,4),icgeopt(nmolset), - $ irap(50),irdo(50,2), - $ ityadd(nat), - $ nmoloo(nat),iradic(nat),idef(nsort),nasort(nsort), - $ ibgr1(nattot),ibgr2(nattot),idupc(6), - $ imolsta(nat), - $ ncent2(nbomax),irads,nrdd,nrddf,nbiolab,nuge, - $ nbon2,npar,nodmty,ngnh,irac,nincrop, - $ nboty,mdstep, - $ nreac, - $ nbonop,icelo2, - $ iaddfreq,iveladd,invt, - $ noop,ndtau, - $ nelc3,nfc,nsav2,nmmax,ibh2, - $ nmmaxold,nfcold,icellold,imodfile, - $ icelo2old,inmov1,inmov2,nchaold,naa,nadattempt, - $ nequi,iadj, - $ ntest,nmm, - $ nmolo5o,nradcount,nmollset,iflga, - $ iperiod,ibgfversion,iremark,iconne, - $ kx,ky,kz,iexco,iruid,ibity,nvlist, - $ ityrad,iredo,iexx,iexy,iexz,ncellopt, - $ ndata2,nprob,nit,i5758,ingeo,nmoloold,itemp, - $ icgeo,ishock_type,isymm, - $ qadd(nat),qlabel(nattot),qffty(nattot),qresi1(nattot), - $ qresi2(nattot),qresi3(nattot), - $ qremark(20),qformat(20),qr,qffield, - $ qstrana1,qstrana2,qmolset(nmolset) -*********************************************************************** - - diff --git a/lib/reax/cbkabo.blk b/lib/reax/cbkabo.blk deleted file mode 100644 index 957651d002..0000000000 --- a/lib/reax/cbkabo.blk +++ /dev/null @@ -1,4 +0,0 @@ - common - $/cbkabo/ abo(nat) - - diff --git a/lib/reax/cbkatomcoord.blk b/lib/reax/cbkatomcoord.blk deleted file mode 100644 index 711fab85a0..0000000000 --- a/lib/reax/cbkatomcoord.blk +++ /dev/null @@ -1,3 +0,0 @@ - common - $/cbkatomcoord/ id(nat,3),xmasat(nat),vel(3,nat),accel(3,nat) - diff --git a/lib/reax/cbkbo.blk b/lib/reax/cbkbo.blk deleted file mode 100644 index 4c7a552c73..0000000000 --- a/lib/reax/cbkbo.blk +++ /dev/null @@ -1,3 +0,0 @@ - common - $/cbkbo/ bo(nbomax) - diff --git a/lib/reax/cbkboncor.blk b/lib/reax/cbkboncor.blk deleted file mode 100644 index 96d89e3a7e..0000000000 --- a/lib/reax/cbkboncor.blk +++ /dev/null @@ -1,5 +0,0 @@ - common - $/cbkboncor/ dbosindc(nbomax,3,2*mbond+2),dbosidc(nbomax,3,2), - $ bo131(nsort),bo132(nsort),bo133(nsort), - $ ovc(nbotym),v13cor(nbotym) - diff --git a/lib/reax/cbkbopi.blk b/lib/reax/cbkbopi.blk deleted file mode 100644 index c58ba31306..0000000000 --- a/lib/reax/cbkbopi.blk +++ /dev/null @@ -1,3 +0,0 @@ - common - $/cbkbopi/ bopi(nbomax) - diff --git a/lib/reax/cbkbopi2.blk b/lib/reax/cbkbopi2.blk deleted file mode 100644 index f150895b05..0000000000 --- a/lib/reax/cbkbopi2.blk +++ /dev/null @@ -1,3 +0,0 @@ - common - $/cbkbopi2/ bopi2(nbomax) - diff --git a/lib/reax/cbkbosi.blk b/lib/reax/cbkbosi.blk deleted file mode 100644 index 27a73ce884..0000000000 --- a/lib/reax/cbkbosi.blk +++ /dev/null @@ -1,4 +0,0 @@ - common - $/cbkbosi/ bosi(nbomax) - - diff --git a/lib/reax/cbkc.blk b/lib/reax/cbkc.blk deleted file mode 100644 index 2a2519eb2e..0000000000 --- a/lib/reax/cbkc.blk +++ /dev/null @@ -1,5 +0,0 @@ - common - $/cbkc/ c(nat,3),cglobal(nattot,3),itag(nat), - $chgglobal(nattot) - - diff --git a/lib/reax/cbkch.blk b/lib/reax/cbkch.blk deleted file mode 100644 index e3199934be..0000000000 --- a/lib/reax/cbkch.blk +++ /dev/null @@ -1,4 +0,0 @@ - common - $/cbkch/ ch(nat) - - diff --git a/lib/reax/cbkcha.blk b/lib/reax/cbkcha.blk deleted file mode 100644 index 3bcc218711..0000000000 --- a/lib/reax/cbkcha.blk +++ /dev/null @@ -1,5 +0,0 @@ - common - $/cbkcha/ ech,syscha,chisys - $ vfieldx,vfieldy,vfieldz,nmcharge,ioldchg - - diff --git a/lib/reax/cbkcharmol.blk b/lib/reax/cbkcharmol.blk deleted file mode 100644 index 4ffeaf7d28..0000000000 --- a/lib/reax/cbkcharmol.blk +++ /dev/null @@ -1,4 +0,0 @@ - common - $/cbkcharmol/ vmcha(nmolmax), - $ iat1mc(nmolmax),iat2mc(nmolmax) - diff --git a/lib/reax/cbkchb.blk b/lib/reax/cbkchb.blk deleted file mode 100644 index b725afb662..0000000000 --- a/lib/reax/cbkchb.blk +++ /dev/null @@ -1,3 +0,0 @@ - common - $/cbkchb/ chi(nsort),eta(nsort),gam(nsort) - diff --git a/lib/reax/cbkconst.blk b/lib/reax/cbkconst.blk deleted file mode 100644 index e23dbbf20f..0000000000 --- a/lib/reax/cbkconst.blk +++ /dev/null @@ -1,5 +0,0 @@ - - common - $/cbkconst/ dgrrdn,one,half,three,zero,caljou,rgasc,xjouca - $ convmd - diff --git a/lib/reax/cbkcovbon.blk b/lib/reax/cbkcovbon.blk deleted file mode 100644 index b37545c152..0000000000 --- a/lib/reax/cbkcovbon.blk +++ /dev/null @@ -1,7 +0,0 @@ - - - common - $/cbkcovbon/ de2(nbotym),de3(nbotym),psi(nbotym), - $ psp(nbotym), - $ ltripstaball - diff --git a/lib/reax/cbkd.blk b/lib/reax/cbkd.blk deleted file mode 100644 index 4baf7f350e..0000000000 --- a/lib/reax/cbkd.blk +++ /dev/null @@ -1,7 +0,0 @@ - integer Lvirial,Latomvirial - - common - $/cbkd/ d(3,nat),estrain(nat) - - common - $/cbkvirial/ atomvirial(6,nat),virial(6),Lvirial,Latomvirial diff --git a/lib/reax/cbkdbodc.blk b/lib/reax/cbkdbodc.blk deleted file mode 100644 index a3c9722554..0000000000 --- a/lib/reax/cbkdbodc.blk +++ /dev/null @@ -1,3 +0,0 @@ - common - $/cbkdbodc/ dbodc(nbomax,3,2) - diff --git a/lib/reax/cbkdbopi2ndc.blk b/lib/reax/cbkdbopi2ndc.blk deleted file mode 100644 index 94fde9fd07..0000000000 --- a/lib/reax/cbkdbopi2ndc.blk +++ /dev/null @@ -1,6 +0,0 @@ - - - - common - $/cbkdbopi2ndc/ dbopi2ndc(nbomax,3,2*mbond+2) - diff --git a/lib/reax/cbkdbopidc.blk b/lib/reax/cbkdbopidc.blk deleted file mode 100644 index 559c6a77a1..0000000000 --- a/lib/reax/cbkdbopidc.blk +++ /dev/null @@ -1,5 +0,0 @@ - - - common - $/dbopidc/ dbopi2dc(nbomax,3,2),dbopidc(nbomax,3,2) - diff --git a/lib/reax/cbkdbopindc.blk b/lib/reax/cbkdbopindc.blk deleted file mode 100644 index 96285f7c86..0000000000 --- a/lib/reax/cbkdbopindc.blk +++ /dev/null @@ -1,6 +0,0 @@ - - - - common - $/dbopindc/ dbopindc(nbomax,3,2*mbond+2) - diff --git a/lib/reax/cbkdcell.blk b/lib/reax/cbkdcell.blk deleted file mode 100644 index c3f22240a6..0000000000 --- a/lib/reax/cbkdcell.blk +++ /dev/null @@ -1,5 +0,0 @@ - - - common - $/cbkdcell/ dcell(3,nat,27) - diff --git a/lib/reax/cbkdhdc.blk b/lib/reax/cbkdhdc.blk deleted file mode 100644 index e5e4638f28..0000000000 --- a/lib/reax/cbkdhdc.blk +++ /dev/null @@ -1,5 +0,0 @@ - - - common - $/cbkdhdc/ dhdc(nvamax,3,3) - diff --git a/lib/reax/cbkdistan.blk b/lib/reax/cbkdistan.blk deleted file mode 100644 index d752173f24..0000000000 --- a/lib/reax/cbkdistan.blk +++ /dev/null @@ -1,4 +0,0 @@ - common - $/cbkdistan/ axis(3),aaxh,baxh,caxh,iortho - - diff --git a/lib/reax/cbkdrdc.blk b/lib/reax/cbkdrdc.blk deleted file mode 100644 index 1d5615440e..0000000000 --- a/lib/reax/cbkdrdc.blk +++ /dev/null @@ -1,5 +0,0 @@ - - - common - $/cbkdrdc/ drdc(nbomax,3,2) - diff --git a/lib/reax/cbkefield.blk b/lib/reax/cbkefield.blk deleted file mode 100644 index 7991f4b98e..0000000000 --- a/lib/reax/cbkefield.blk +++ /dev/null @@ -1,4 +0,0 @@ - - common - $/cbkefield/ efix,efiy,efiz,c1 - diff --git a/lib/reax/cbkenergies.blk b/lib/reax/cbkenergies.blk deleted file mode 100644 index e0220e88ef..0000000000 --- a/lib/reax/cbkenergies.blk +++ /dev/null @@ -1,7 +0,0 @@ - - common - $/cbkenergies/ eb,eoop,epen,estrc,deda(3),pressu, - $ efi,elp,emol,ea,eres,et,eradbo, - $ ev,eco,ecoa,ehb,sw,ew,ep,ekin - - diff --git a/lib/reax/cbkeregime.blk b/lib/reax/cbkeregime.blk deleted file mode 100644 index 198862e5f1..0000000000 --- a/lib/reax/cbkeregime.blk +++ /dev/null @@ -1,5 +0,0 @@ - character*5 qetype - common - $/cbkeregime/ qetype(mereg,mezone),nnereg(mereg),nerc, - $ ereg(mereg,mezone),nitec(mereg) - diff --git a/lib/reax/cbkff.blk b/lib/reax/cbkff.blk deleted file mode 100644 index 36ffceea0c..0000000000 --- a/lib/reax/cbkff.blk +++ /dev/null @@ -1,9 +0,0 @@ - character*2 qas - common - $/cbkff/ gamcco(nsort,nsort),vpar(npamax),vovun(nsort), - $ stlp(nsort),aval(nsort),vlp1(nsort), - $ vover(nbotym),valp1(nsort), - $ vka(nvatym),qas(nsort),amas(nsort),e1(nbotym), - $ valf(nsort),de1(nbotym),swb,nvs(nvatym,3),nso,nvaty - - diff --git a/lib/reax/cbkfftorang.blk b/lib/reax/cbkfftorang.blk deleted file mode 100644 index 4154e5565d..0000000000 --- a/lib/reax/cbkfftorang.blk +++ /dev/null @@ -1,8 +0,0 @@ - - - - - common - $/cbkfftorang/ v4(ntotym),vconj(ntotym), - $ v1(ntotym),v2(ntotym),v3(ntotym) - diff --git a/lib/reax/cbkh.blk b/lib/reax/cbkh.blk deleted file mode 100644 index 7be7c5d7b3..0000000000 --- a/lib/reax/cbkh.blk +++ /dev/null @@ -1,5 +0,0 @@ - - - common - $/cbkh/ h(nvamax) - diff --git a/lib/reax/cbkhbond.blk b/lib/reax/cbkhbond.blk deleted file mode 100644 index 7a071ef096..0000000000 --- a/lib/reax/cbkhbond.blk +++ /dev/null @@ -1,5 +0,0 @@ - - common - - $/cbkhbond/ hhb(nhbmax) - diff --git a/lib/reax/cbkia.blk b/lib/reax/cbkia.blk deleted file mode 100644 index f7ada0e8fd..0000000000 --- a/lib/reax/cbkia.blk +++ /dev/null @@ -1,6 +0,0 @@ - - - - common - $/cbkia/ ia(nat,mbond+3),iag(nat,mbond+3) - diff --git a/lib/reax/cbkidbo.blk b/lib/reax/cbkidbo.blk deleted file mode 100644 index cc3fb49331..0000000000 --- a/lib/reax/cbkidbo.blk +++ /dev/null @@ -1,7 +0,0 @@ - - - - common - $/cbkidbo/ idbo(nbomax,2*mbond+2),dbondc(nbomax,3,2*mbond+2), - $ idbo1(nbomax) - diff --git a/lib/reax/cbkimove.blk b/lib/reax/cbkimove.blk deleted file mode 100644 index e65bd01e43..0000000000 --- a/lib/reax/cbkimove.blk +++ /dev/null @@ -1,6 +0,0 @@ - - - common - $/cbkimove/ imove(nattot) - - diff --git a/lib/reax/cbkinit.blk b/lib/reax/cbkinit.blk deleted file mode 100644 index 45ac3396a0..0000000000 --- a/lib/reax/cbkinit.blk +++ /dev/null @@ -1,6 +0,0 @@ - - character*40 qruid - common - $/cbkinit/ tsetor,nzero,none,ntwo,nthree,qruid,systime, - $ ustime,two,pi,avognr,axiss(3),pset,rdndgr - diff --git a/lib/reax/cbklonpar.blk b/lib/reax/cbklonpar.blk deleted file mode 100644 index 016888f286..0000000000 --- a/lib/reax/cbklonpar.blk +++ /dev/null @@ -1,5 +0,0 @@ - - - common - $/cbklonpar/ vlp(nat),dvlpdsbo(nat) - diff --git a/lib/reax/cbkmolec.blk b/lib/reax/cbkmolec.blk deleted file mode 100644 index 847ae44edb..0000000000 --- a/lib/reax/cbkmolec.blk +++ /dev/null @@ -1,6 +0,0 @@ - - - - common - $/cbkmolec/ nmolat2(nmolmax,nat),elmol2(nmolmax) - diff --git a/lib/reax/cbknmolat.blk b/lib/reax/cbknmolat.blk deleted file mode 100644 index a89f0f677c..0000000000 --- a/lib/reax/cbknmolat.blk +++ /dev/null @@ -1,6 +0,0 @@ - - - - common - $/cbknmolat/ nmolat(nmolmax,nat) - diff --git a/lib/reax/cbknonbon.blk b/lib/reax/cbknonbon.blk deleted file mode 100644 index c0ec0feaa1..0000000000 --- a/lib/reax/cbknonbon.blk +++ /dev/null @@ -1,6 +0,0 @@ - - - common - $/cbknonbon/ gamwco(nsort,nsort),sw1,p3co(nsort,nsort), - $ p2co(nsort,nsort),p1co(nsort,nsort) - diff --git a/lib/reax/cbknubon2.blk b/lib/reax/cbknubon2.blk deleted file mode 100644 index ecc7eafd47..0000000000 --- a/lib/reax/cbknubon2.blk +++ /dev/null @@ -1,5 +0,0 @@ - - - common - $/cbknubon2/ nubon1(nat,mbond), nubon2(nat,mbond) - diff --git a/lib/reax/cbknvlbo.blk b/lib/reax/cbknvlbo.blk deleted file mode 100644 index b9a3791811..0000000000 --- a/lib/reax/cbknvlbo.blk +++ /dev/null @@ -1,4 +0,0 @@ - common - $/cbknvlbo/ nvlbo(nneighmax*nat) - - diff --git a/lib/reax/cbknvlown.blk b/lib/reax/cbknvlown.blk deleted file mode 100644 index d51ce5531f..0000000000 --- a/lib/reax/cbknvlown.blk +++ /dev/null @@ -1,2 +0,0 @@ - common - $/cbknvlown/ nvlown(nneighmax*nat) diff --git a/lib/reax/cbkpairs.blk b/lib/reax/cbkpairs.blk deleted file mode 100644 index 028b0f2fac..0000000000 --- a/lib/reax/cbkpairs.blk +++ /dev/null @@ -1,4 +0,0 @@ - common - $/cbkpairs/ nvl1(nneighmax*nat),nvl2(nneighmax*nat),nvpair,nvlself - - diff --git a/lib/reax/cbkpres.blk b/lib/reax/cbkpres.blk deleted file mode 100644 index bf14b380c4..0000000000 --- a/lib/reax/cbkpres.blk +++ /dev/null @@ -1,4 +0,0 @@ - - common - $/cbkpres/ presx,presy,presz - diff --git a/lib/reax/cbkqa.blk b/lib/reax/cbkqa.blk deleted file mode 100644 index 63e88e7411..0000000000 --- a/lib/reax/cbkqa.blk +++ /dev/null @@ -1,5 +0,0 @@ - character*2 qa - common - $/cbkqa/ qa(nattot) - - diff --git a/lib/reax/cbkrbo.blk b/lib/reax/cbkrbo.blk deleted file mode 100644 index e9b99f008a..0000000000 --- a/lib/reax/cbkrbo.blk +++ /dev/null @@ -1,5 +0,0 @@ - - - common - $/cbkrbo/ rbo(nbomax),ibsym(nbomax),ib(nbomax,3) - diff --git a/lib/reax/cbkrestr.blk b/lib/reax/cbkrestr.blk deleted file mode 100644 index 15169677e4..0000000000 --- a/lib/reax/cbkrestr.blk +++ /dev/null @@ -1,12 +0,0 @@ - common - $/cbkrestr/ vkrv(mrestra),vrstra(mrestra),vkr2v(mrestra), - $ dismacen(mrestra),rmstra1(mrestra), - $ rrstra(mrestra),vkrst2(mrestra), - $ rmstra2(mrestra),rmstrax(mrestra),rmstray(mrestra), - $ rmstraz(mrestra),cmo(nat,3),vmo1(nat),trstra(mrestra), - $ vkrt(mrestra),vkr2t(mrestra),vkrstr(mrestra), - $ irstrav(mrestra,3),irstra(mrestra,2),itend(mrestra), - $ irstram(mrestra,5),itstart(mrestra),irstrat(mrestra,4), - $ imorph - - diff --git a/lib/reax/cbksrtbon1.blk b/lib/reax/cbksrtbon1.blk deleted file mode 100644 index 9a4d425e18..0000000000 --- a/lib/reax/cbksrtbon1.blk +++ /dev/null @@ -1,13 +0,0 @@ - character*60 qmol - common - $/cbksrtbon1/ dbodr(nbomax),dbopidr(nbomax), - $ dbopi2dr(nbomax), - $ rob1(nsort,nsort),rob2(nsort,nsort), - $ rob3(nsort,nsort), - $ rat(nsort),rapt(nsort),vnq(nsort),bom(nbotym), - $ pdp(nbotym),ptp(nbotym),pdo(nbotym), - $ popi(nbotym),bop1(nbotym),bop2(nbotym),cutoff, - $ nbs(nbotym,2), - $ nsbma2,nsbmax,nboty2,nbonall,qfile(nmolset),qmol - - diff --git a/lib/reax/cbksrthb.blk b/lib/reax/cbksrthb.blk deleted file mode 100644 index ad035f6c05..0000000000 --- a/lib/reax/cbksrthb.blk +++ /dev/null @@ -1,10 +0,0 @@ - - - common - $/cbksrthb/ vhb1(nhbtym),vhb2(nhbtym),rhb(nhbtym), - $ dehb(nhbtym),ihb(nhbmax,8),nhb, - $ nphb(nsort),nhbs(nhbtym,3),nhbty,hbcut, - $ lhbnew - - - diff --git a/lib/reax/cbktorang.blk b/lib/reax/cbktorang.blk deleted file mode 100644 index 3e8c94fd5f..0000000000 --- a/lib/reax/cbktorang.blk +++ /dev/null @@ -1,5 +0,0 @@ - - - common - $/cbktorang/ dargtdc(ntomax,3,4),thg(ntomax) - diff --git a/lib/reax/cbktorsion.blk b/lib/reax/cbktorsion.blk deleted file mode 100644 index 30f984b7df..0000000000 --- a/lib/reax/cbktorsion.blk +++ /dev/null @@ -1,7 +0,0 @@ - - - - common - $/cbktorsion/ nts(ntotym,4),ntoty,ntor,it(ntomax,11) - - diff --git a/lib/reax/cbktregime.blk b/lib/reax/cbktregime.blk deleted file mode 100644 index 06df64e192..0000000000 --- a/lib/reax/cbktregime.blk +++ /dev/null @@ -1,8 +0,0 @@ - common - $/cbktregime/ dttreg(mtreg,mtzone),tdamptreg(mtreg,mtzone), - $ ia1treg(mtreg,mtzone),ia2treg(mtreg,mtzone), - $ tsettreg(mtreg,mtzone),nntreg(mtreg),ittc(mtreg), - $ nittc(mtreg),ifieldz,ifieldx,ifieldy, - $ nrestra,nrestram,nrestrat,nrestrav,ntrc - - diff --git a/lib/reax/cbkvalence.blk b/lib/reax/cbkvalence.blk deleted file mode 100644 index 3e7bee9b60..0000000000 --- a/lib/reax/cbkvalence.blk +++ /dev/null @@ -1,5 +0,0 @@ - - - common - $/cbkvalence/ nval,iv(nvamax,6) - diff --git a/lib/reax/cbkvregime.blk b/lib/reax/cbkvregime.blk deleted file mode 100644 index ed2f5a45e6..0000000000 --- a/lib/reax/cbkvregime.blk +++ /dev/null @@ -1,7 +0,0 @@ - character*5 qvtype - common - $/cbkvregime/ ivsca(mvreg,mvzone),dvvreg(mvreg,mvzone), - $ nnvreg(mvreg),invrc,nitvc(mvreg), - $ qvtype(mvreg,mvzone) - - diff --git a/lib/reax/cellcoord.blk b/lib/reax/cellcoord.blk deleted file mode 100644 index 3cbee22656..0000000000 --- a/lib/reax/cellcoord.blk +++ /dev/null @@ -1,4 +0,0 @@ - - common - $/cellcoord/ tm11,tm21,tm31,tm22,tm32,tm33,angle(3),angles(3) - diff --git a/lib/reax/control.blk b/lib/reax/control.blk deleted file mode 100644 index 4e84f85b9e..0000000000 --- a/lib/reax/control.blk +++ /dev/null @@ -1,12 +0,0 @@ - common - $/control/ vrange,cutof2,cutof3,vlbora,tstep,range,taut,volcha, - $ axis1,axis2,axis3,taup, - $ icpres,nmethod,noutpt,inpt,napp,ianaly,ncha2, - $ nrand,ntscale,itstep,ndebug,icentr,itrout, - $ nchaudixmolo,itrans,nsav, - $ nrep1,ncontrol,nhop2,nsav3,ngeofor,ifreq, - $ nprevrun,maxstp,nvel,nsurp,ncons, - $ ncha,icell,imolde,nchaud -********************************************************************************* - - diff --git a/lib/reax/opt.blk b/lib/reax/opt.blk deleted file mode 100644 index c72df23d5c..0000000000 --- a/lib/reax/opt.blk +++ /dev/null @@ -1,23 +0,0 @@ - parameter (maxdat=5000) - parameter (maxmdat=2500) - parameter (maxkop=2500) - character*80 qff - character*60 qmdat - character*100 qdatid - character*2 qas2 - common - $/opt/ fpar(7,nvatym,40),datopt(maxdat),caldat(maxdat), - $ compdat(maxdat),weightdat(maxdat), - $ devi(maxdat),vkop(maxkop),devkop(maxkop),sdy(3), - $ valpar,valnew,change,vchange, - $ molin(maxmdat,nsort), - $ iboo(nbotym,2),idmo(nodmtym,2),ivao(nvatym,5), - $ itoo(ntotym,7),ihbo(nhbtym,5),iheada(maxmdat), - $ ndatm(maxmdat),iheada2(maxmdat),ichn(3), - $ ikop1(maxkop),ikop2(maxkop),idat(maxdat),mu1(maxkop), - $ mu2(maxkop), - $ ndata,imam,iopt,iheatf,nkop,iagain, - $ qdatid(maxdat),qmdat(maxmdat),qff(250),qas2(nsort) -*********************************************************************** - - diff --git a/lib/reax/reax_charges.F b/lib/reax/reax_charges.F deleted file mode 100644 index 5815501a29..0000000000 --- a/lib/reax/reax_charges.F +++ /dev/null @@ -1,85 +0,0 @@ -********************************************************************** -* * -* REAXFF Reactive force field program * -* * -* Developed and written by Adri van Duin, duin@wag.caltech.edu * -* * -* Copyright (c) 2001-2010 California Institute of Technology * -* * -* This is an open-source program. Feel free to modify its * -* contents. Please keep me informed of any useful modification * -* or addition that you made. Please do not distribute this * -* program to others; if people are interested in obtaining * -* a copy of this program let them contact me first. * -* * -********************************************************************** -************************************************************************ - - subroutine taper(r,r2) - -************************************************************************ -#include "cbka.blk" -#include "cbkconst.blk" -#include "cbkenergies.blk" -#include "cbkinit.blk" -#include "cbknonbon.blk" -************************************************************************ -* * -* Taper function for Coulomb interaction * -* * -************************************************************************ - r3=r2*r - SW=SWC7*R3*R3*R+SWC6*R3*R3+SWC5*R3*R2+SWC4*R2*R2+SWC3*R3+SWC2*R2+ - $SWC1*R+SWC0 - SW1=7.0D0*SWC7*R3*R3+6.0D0*SWC6*R3*R2+5.0D0*SWC5*R2*R2+ - $4.0D0*SWC4*R3+THREE*SWC3*R2+TWO*SWC2*R+SWC1 - return - end -************************************************************************ -************************************************************************ - - subroutine tap7th - -************************************************************************ -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkconst.blk" -#include "cbkd.blk" -#include "cbkff.blk" -#include "cbkh.blk" -#include "control.blk" - -************************************************************************ -* * -* 7th order taper function setup * -* * -************************************************************************ -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In tap7th' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - D1=SWB-SWA - D7=D1**7.0D0 - SWA2=SWA*SWA - SWA3=SWA2*SWA - SWB2=SWB*SWB - SWB3=SWB2*SWB - -************************************************************************ -* 7th order taper function * -************************************************************************ - - SWC7= 20.0D0/D7 - SWC6= -70.0D0*(SWA+SWB)/D7 - SWC5= 84.0D0*(SWA2+3.0D0*SWA*SWB+SWB2)/D7 - SWC4= -35.0D0*(SWA3+9.0D0*SWA2*SWB+9.0D0*SWA*SWB2+SWB3)/D7 - SWC3= 140.0D0*(SWA3*SWB+3.0D0*SWA2*SWB2+SWA*SWB3)/D7 - SWC2=-210.0D0*(SWA3*SWB2+SWA2*SWB3)/D7 - SWC1= 140.0D0*SWA3*SWB3/D7 - SWC0=(-35.0D0*SWA3*SWB2*SWB2+21.0D0*SWA2*SWB3*SWB2- - $7.0D0*SWA*SWB3*SWB3+SWB3*SWB3*SWB)/D7 - - return - END diff --git a/lib/reax/reax_connect.F b/lib/reax/reax_connect.F deleted file mode 100644 index e77875124f..0000000000 --- a/lib/reax/reax_connect.F +++ /dev/null @@ -1,1547 +0,0 @@ -********************************************************************** -* * -* REAXFF Reactive force field program * -* * -* Developed and written by Adri van Duin, duin@wag.caltech.edu * -* * -* Copyright (c) 2001-2010 California Institute of Technology * -* * -* This is an open-source program. Feel free to modify its * -* contents. Please keep me informed of any useful modification * -* or addition that you made. Please do not distribute this * -* program to others; if people are interested in obtaining * -* a copy of this program let them contact me first. * -* * -********************************************************************** -********************************************************************** - - subroutine srtatom - -********************************************************************** -#include "cbka.blk" -#include "cbkatomcoord.blk" -#include "cbkff.blk" -#include "cbkia.blk" -#include "cbkqa.blk" -#include "control.blk" -#include "opt.blk" -#include "small.blk" -********************************************************************** -* * -* Determine atom types in system * -* * -********************************************************************** -* Requires the following variables -* ndebug - opt.blk; determines whether to debug or not; everywhere -* xmasmd - cbka.blk; some sort of atmoic mass?; srtatom, reac.f -* molin - opt.blk; keeps info on?; srtatom -* nso - cbka.blk; number of atoms?; srtatom, inout.f -* nprob - cbka.blk; does?; connect.f, inout.f, reac.f -* nasort - cbka.blk; a sorting array; srtatom -* ia - cbka.blk; atom numbers?; poten.f, inout.f, connect.f, charges.f -* iag - cbka.blk; ; connect.f, inout.f, poten.f, reac.f -* xmasat - cbka.blk; does?; srtatom, reac.f -* amas - cbka.blk; ? ; srtatom, ffinpt, molanal, ovcor -* qa - cbka.blk; some sort of error statement variable?; srtatom, srtbon1, inout.f, radbo -* -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In srtatom' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - - xmasmd=0.0 - do i1=1,nso - molin(nprob,i1)=0 - nasort(i1)=0 - end do - do i1=1,na - ia(i1,1)=0 - iag(i1,1)=0 - do i2=1,nso - if (qa(i1).eq.qas(i2)) then - ia(i1,1)=i2 - iag(i1,1)=i2 - molin(nprob,i2)=molin(nprob,i2)+1 - xmasat(i1)=amas(i2) - xmasmd=xmasmd+amas(i2) - nasort(i2)=nasort(i2)+1 - end if - end do - if (ia(i1,1).eq.0) then - write (*,*)'Unknown atom type: ',qa(i1) - stop 'Unknown atom type' - end if - end do - - return - end -********************************************************************** -********************************************************************** - - subroutine molec - -********************************************************************** -#include "cbka.blk" -#include "cbkdcell.blk" -#include "cbkff.blk" -#include "cbkia.blk" -#include "cbkmolec.blk" -#include "cbknmolat.blk" -#include "control.blk" -#include "small.blk" - dimension nmolo2(nat),iseen(nmolmax),isee2(nmolmax) -********************************************************************** -* * -* Determine changes in molecules * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In molec' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - npreac=0 - - do i1=1,nmolo - natmol=0 - do i2=1,na - if (ia(i2,3+mbond).eq.i1) then - natmol=natmol+1 - nmolat(i1,natmol+1)=i2 - end if - end do - nmolat(i1,1)=natmol - end do - - if (nmolo5.lt.nmolo5o) nradcount=0 !reset reaction counter - do i1=1,nmolo5 - natmol=0 - do i2=1,na - if (iag(i2,3+mbond).eq.i1) then - natmol=natmol+1 - nmolat2(i1,natmol+1)=i2 - end if - end do - nmolat2(i1,1)=natmol - end do - nmolo5o=nmolo5 - - do i1=nmolo+1,nmoloold - do i2=1,nmolat(i1,1) - nmolat(i1,1+i2)=0 - end do - nmolat(i1,1)=0 - end do - - do i1=1,nmolo - elmol(i1)=0.0 - do i2=1,nmolat(i1,1) - ihu=nmolat(i1,i2+1) - ity=ia(ihu,1) - elmol(i1)=elmol(i1)+stlp(ity) - end do - end do - - do i1=1,nmolo5 - elmol2(i1)=0.0 - do i2=1,nmolat2(i1,1) - ihu=nmolat2(i1,i2+1) - ity=iag(ihu,1) - elmol2(i1)=elmol2(i1)+stlp(ity) - end do - end do - - return - end -********************************************************************** -********************************************************************** - - subroutine dista2 (n1,n2,dista,dx,dy,dz) - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -********************************************************************** -* * -* Determine interatomic distances * -* * -********************************************************************** -c$$$* if (ndebug.eq.1) then -c$$$C* open (65,file='fort.65',status='unknown',access='append') -c$$$* write (65,*) 'In dista2' -c$$$* call timer(65) -c$$$* close (65) -c$$$* end if - - dx=c(n1,1)-c(n2,1) - dy=c(n1,2)-c(n2,2) - dz=c(n1,3)-c(n2,3) - dista=sqrt(dx*dx+dy*dy+dz*dz) - - return - end -********************************************************************** -********************************************************************** - - subroutine srtbon1(lprune,lhb,hbcut_in,lhbnew_in,ltripstaball_in) - -********************************************************************** -#include "cbka.blk" -#include "cbkabo.blk" -#include "cbkbo.blk" -#include "cbkbosi.blk" -#include "cbkbopi.blk" -#include "cbkbopi2.blk" -#include "cbkc.blk" -#include "cbkch.blk" -#include "cbkconst.blk" -#include "cbkdbopidc.blk" -#include "cbkdrdc.blk" -#include "cbkia.blk" -#include "cbknubon2.blk" -#include "cbknvlbo.blk" -#include "cbkpairs.blk" -#include "cbknvlown.blk" -#include "cbkqa.blk" -#include "cbkrbo.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "small.blk" -#include "cbkdbodc.blk" -#include "cbksrtbon1.blk" -#include "cbkff.blk" -#include "cbksrthb.blk" -#include "cbkcovbon.blk" - logical found - integer nboncol(nboallmax) - integer iball(nboallmax,3) - -********************************************************************** -* * -* Determine connections within the molecule * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In srtbon1' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - -c Transfer hbcut, lhbnew, and ltripstaball from C++ calling function - hbcut = hbcut_in - lhbnew = lhbnew_in - ltripstaball = ltripstaball_in - - do i1=1,na - abo(i1)=0.0d0 - end do - nbonall=0 - nbon2=0 - nsbmax=0 - nsbma2=0 - - if (imolde.eq.0) then - - nmolo=0 - nmolo5=0 - end if - if (imolde.eq.0) then - do i1=1,na - do i2=2,mbond+3 - ia(i1,i2)=0 - iag(i1,i2)=0 - end do - end do - - else - - do i1=1,na - do i2=2,mbond+2 - ia(i1,i2)=0 - iag(i1,i2)=0 - end do - end do - - end if - - do i1=1,na - do i2=1,mbond - nubon1(i1,i2)=0 - nubon2(i1,i2)=0 - end do - end do - -* First detect all bonds and create preliminary list - - do 11 ivl=1,nvpair - if (nvlbo(ivl).eq.0) goto 11 !not in bond order range - i1=nvl1(ivl) - i2=nvl2(ivl) - call dista2(i1,i2,dis,dxm,dym,dzm) - ih1=ia(i1,1) - ih2=ia(i2,1) - disdx=dxm/dis - disdy=dym/dis - disdz=dzm/dis - itype=0 - if (ih1.gt.ih2) then - ih1=ia(i2,1) - ih2=ia(i1,1) - end if - do i3=1,nboty2 - if (ih1.eq.nbs(i3,1).and.ih2.eq.nbs(i3,2)) itype=i3 - end do - if (itype.eq.0.and.rat(ih1).gt.zero.and.rat(ih2).gt.zero) then -c$$$ call mdsav(1,qfile(nprob)) - write (*,*)qa(i1),'-',qa(i2),'Fatal: Unknown bond in molecule' - stop - end if - - rhulp=dis/rob1(ih1,ih2) - -********************************************************************** -* * -* Determine bond orders * -* * -********************************************************************** - rh2=zero - rh2p=zero - rh2pp=zero - ehulp=zero - ehulpp=zero - ehulppp=zero - if (rapt(ih1).gt.zero.and.rapt(ih2).gt.zero) then - rhulp2=dis/rob2(ih1,ih2) - rh2p=rhulp2**ptp(itype) - ehulpp=exp(pdp(itype)*rh2p) - end if - if (vnq(ih1).gt.zero.and.vnq(ih2).gt.zero) then - rhulp3=dis/rob3(ih1,ih2) - rh2pp=rhulp3**popi(itype) - ehulppp=exp(pdo(itype)*rh2pp) - end if - - if (rat(ih1).gt.zero.and.rat(ih2).gt.zero) then - rh2=rhulp**bop2(itype) - ehulp=(1.0+cutoff)*exp(bop1(itype)*rh2) - end if - - bor=ehulp+ehulpp+ehulppp - - j1=i1 - j2=i2 - -********************************************************************** -* * -* Determine bond orders * -* * -********************************************************************** - if (bor.gt.cutoff) then - nbonall=nbonall+1 - if (nbonall.gt.nboallmax) then - write (6,*)'nbonall = ',nbonall, - $ ' reax_defs.h::NBOALLMAXDEF = ',NBOALLMAXDEF, - $ ' after',ivl, ' of ',nvpair,' pairs completed.' - stop 'Too many bonds; maybe wrong cell parameters.' - end if - iball(nbonall,1)=itype - iball(nbonall,2)=j1 - iball(nbonall,3)=j2 - - ia(i1,2)=ia(i1,2)+1 - if (ia(i1,2).gt.mbond) then - write (6,*)'ia(i1,2) = ',ia(i1,2), - $ ' reax_defs.h::MBONDDEF = ',MBONDDEF, - $ ' after',ivl, ' of ',nvpair,' pairs completed.' - stop 'Too many bonds on atom. Increase MBONDDEF' - end if - - if (i1.ne.i2) then - ia(i2,2)=ia(i2,2)+1 - if (ia(i2,2).gt.mbond) then - write (6,*)'ia(i1,2) = ',ia(i1,2), - $ ' reax_defs.h::MBONDDEF = ',MBONDDEF, - $ ' after',ivl, ' of ',nvpair,' pairs completed.' - stop 'Too many bonds on atom. Increase MBONDDEF' - end if - endif - - ia(i1,ia(i1,2)+2)=i2 - ia(i2,ia(i2,2)+2)=i1 - if (abs(de1(iball(nbonall,1))).gt.-0.01) then - nubon2(i1,ia(i1,2))=nbonall - nubon2(i2,ia(i2,2))=nbonall - else - nbonall=nbonall-1 !Inorganics - end if - end if - 11 continue - -********************************************************************** -* * -* lprune controls level of bond-pruning performed to increase * -* performance. For correct results, it should be set to 4. * -* However, making it smaller can speed up * -* force calculation and may not have a big effect on forces. * -* Setting it to 0 turns off pruning, useful for debugging. * -* * -********************************************************************** -********************************************************************* -* * -* lhb controls whether or not to unprune ghost bonds that * -* may possibly form ghost hydrogen bonds. * -* Setting it to 1 causes unpruning, and so is the safe option. * -* If lprune = 0, then pruning is not used, results are exact * -* and lhb has no effect. * -* * -********************************************************************** - if (lprune .gt. 0) then -********************************************************************** -* * -* Eliminate bonds that are not in 1-6 interaction * -* with local atom, or closer. * -* Need additional sweep to catch possible hydrogen bonds * -* * -********************************************************************** - - ntmp0 = 0 - ntmp1 = 0 - ntmp2 = 0 - ntmp3 = 0 - ntmp4 = 0 - ntmp5 = 0 - ntmp6 = 0 - ntmphb = 0 - -* color 1 are bonds with two local atoms -* color 2 are bonds with one local atom -* color 3 are bonds adjacent to bond with one local atom - - do i1 = 1,nbonall - if (iball(i1,2).le.na_local) then - if (iball(i1,3).le.na_local) then - nboncol(i1) = 1 - ntmp1 = ntmp1+1 - else - nboncol(i1) = 2 - ntmp2 = ntmp2+1 - endif - else if (iball(i1,3).le.na_local) then - nboncol(i1) = 2 - ntmp2 = ntmp2+1 - else - nboncol(i1) = 0 - endif - end do - - if (lprune .ge. 3) then - do i1 = 1,nbonall - if (nboncol(i1).eq.2) then - if (iball(i1,2).le.na_local) then - i3=iball(i1,3) - else - i3=iball(i1,2) - endif - - do i4 = 1,ia(i3,2) - i5=nubon2(i3,i4) - if (nboncol(i5).eq.0) then - nboncol(i5)=3 - ntmp3 = ntmp3+1 - endif - end do - endif - end do - endif -* color 4 bonds are part of a 1-4 interaction with local atom - - if (lprune .ge. 4) then - do i1 = 1,nbonall - if (nboncol(i1).eq.3) then -* One end definitely has a bond of color 2 -* Find it and color bonds on other end 4 - i3=iball(i1,2) - i3b=0 - do i4 = 1,ia(i3,2) - i5=nubon2(i3,i4) - if (nboncol(i5).eq.2) then - i3b=iball(i1,3) - endif - end do - - if (i3b.eq.0) then - i3=iball(i1,3) - i3b=0 - do i4 = 1,ia(i3,2) - i5=nubon2(i3,i4) - if (nboncol(i5).eq.2) then - i3b=iball(i1,2) - endif - end do - endif - - if (i3b.eq.0) then - stop 'Could not find color 2 from color 3 bond' - endif - - do i4 = 1,ia(i3b,2) - i5=nubon2(i3b,i4) - if (nboncol(i5).eq.0) then - nboncol(i5)=4 - ntmp4 = ntmp4+1 - endif - end do - - endif - end do - endif - -* color 5 bonds are part of a 1-5 interaction with local atom - - if (lprune .ge. 5) then - do i1 = 1,nbonall - if (nboncol(i1).eq.4) then -* One end definitely has a bond of color 3 -* Find it and color bonds on other end 5 - i3=iball(i1,2) - i3b=0 - do i4 = 1,ia(i3,2) - i5=nubon2(i3,i4) - if (nboncol(i5).eq.3) then - i3b=iball(i1,3) - endif - end do - - if (i3b.eq.0) then - i3=iball(i1,3) - i3b=0 - do i4 = 1,ia(i3,2) - i5=nubon2(i3,i4) - if (nboncol(i5).eq.3) then - i3b=iball(i1,2) - endif - end do - endif - - if (i3b.eq.0) then - stop 'Could not find color 3 from color 4 bond' - endif - - do i4 = 1,ia(i3b,2) - i5=nubon2(i3b,i4) - if (nboncol(i5).eq.0) then - nboncol(i5)=5 - ntmp5 = ntmp5+1 - endif - end do - - endif - end do - endif - -* color 6 bonds are part of a 1-6 interaction with local atom - - if (lprune .ge. 6) then - do i1 = 1,nbonall - if (nboncol(i1).eq.5) then -* One end definitely has a bond of color 4 -* Find it and color bonds on other end 6 - i3=iball(i1,2) - i3b=0 - do i4 = 1,ia(i3,2) - i5=nubon2(i3,i4) - if (nboncol(i5).eq.4) then - i3b=iball(i1,3) - endif - end do - - if (i3b.eq.0) then - i3=iball(i1,3) - i3b=0 - do i4 = 1,ia(i3,2) - i5=nubon2(i3,i4) - if (nboncol(i5).eq.4) then - i3b=iball(i1,2) - endif - end do - endif - - if (i3b.eq.0) then - stop 'Could not find color 4 from color 5 bond' - endif - - do i4 = 1,ia(i3b,2) - i5=nubon2(i3b,i4) - if (nboncol(i5).eq.0) then - nboncol(i5)=6 - ntmp6 = ntmp6+1 - endif - end do - - endif - end do - endif - -* Catch all the possible hydrogen bonds -* This section replicates the logic used in srthb() - if (lhb .eq. 1) then -c Outer loop must be Verlet list, because ia() does not store Verlet entries, -c but it does store bond entries in nubon2() - do ivl=1,nvpair !Use Verlet-list to find donor-acceptor pairs - - j1=nvl1(ivl) - j2=nvl2(ivl) - ihhb1=nphb(ia(j1,1)) - ihhb2=nphb(ia(j2,1)) - - if (ihhb1.gt.ihhb2) then !Make j1 donor(H) atom and j2 acceptor(O) atom - j2=nvl1(ivl) - j1=nvl2(ivl) - ihhb1=nphb(ia(j1,1)) - ihhb2=nphb(ia(j2,1)) - end if - -* Only need to compute bonds where j1 is local - if (j1 .le. na_local) then - - if (ihhb1.eq.1.and.ihhb2.eq.2) then - call dista2(j1,j2,dishb,dxm,dym,dzm) - if (dishb.lt.hbcut) then - do i23=1,ia(j1,2) !Search for acceptor atoms bound to donor atom - if (nboncol(nubon2(j1,i23)).eq.0) then - j3=ia(j1,2+i23) - if (nphb(ia(j3,1)).eq.2.and.j3.ne.j2) then - nboncol(nubon2(j1,i23))=-1 - ntmphb = ntmphb+1 - endif - endif - end do - end if - end if - end if - end do - end if - -* Compact the list, removing all uncolored bonds - - nbon = 0 - do i1 = 1,nbonall - if (nboncol(i1).eq.0) then - ntmp0=ntmp0+1 - else - nbon = nbon+1 - - if (nbon.gt.nbomax) then - write (6,*)nbon,nbomax - write (6,*)'nbon = ',nbon,' reax_defs.h::NBOMAXDEF = ', - $ NBOMAXDEF,' after',i1, ' of ',nbonall, - $ ' initial bonds completed.' - stop 'Too many pruned bonds; increase NBOMAXDEF' - end if - - - ib(nbon,1) = iball(i1,1) - ib(nbon,2) = iball(i1,2) - ib(nbon,3) = iball(i1,3) - endif - end do - -********************************************************************** -* * -* Do not perform ghost-bond pruning * -* * -********************************************************************** - - else - - nbon = 0 - do i1 = 1,nbonall - nbon = nbon+1 - - if (nbon.gt.nbomax) then - write (6,*)nbon,nbomax - write (6,*)'nbon = ',nbon,' reax_defs.h::NBOMAXDEF = ', - $ NBOMAXDEF,' after',i1, ' of ',nbonall, - $ ' initial bonds completed.' - stop 'Too many pruned bonds; increase NBOMAXDEF' - end if - - ib(nbon,1) = iball(i1,1) - ib(nbon,2) = iball(i1,2) - ib(nbon,3) = iball(i1,3) - end do - - endif - - do i1=1,na - do i2=2,mbond+2 - ia(i1,i2)=0 - iag(i1,i2)=0 - end do - end do - -* Generate full set of bond data structures - - do 10 i0 = 1,nbon - i1 = ib(i0,2) - i2 = ib(i0,3) - call dista2(i1,i2,dis,dxm,dym,dzm) -* do 10 i1=1,na-1 -* do 10 i2=i1+1,na -* call dista2(i1,i2,dis,dxm,dym,dzm) - ih1=ia(i1,1) - ih2=ia(i2,1) -* if (dis.gt.5.0*rob) goto 10 - disdx=dxm/dis - disdy=dym/dis - disdz=dzm/dis - itype=0 - if (ih1.gt.ih2) then - ih1=ia(i2,1) - ih2=ia(i1,1) - end if - do i3=1,nboty2 - if (ih1.eq.nbs(i3,1).and.ih2.eq.nbs(i3,2)) itype=i3 - end do - if (itype.eq.0.and.rat(ih1).gt.zero.and.rat(ih2).gt.zero) then -c$$$ call mdsav(1,qfile(nprob)) - write (*,*)qa(i1),'-',qa(i2),'Fatal: Unknown bond in molecule' - stop - end if - - rhulp=dis/rob1(ih1,ih2) - -********************************************************************** -* * -* Determine bond orders * -* * -********************************************************************** - rh2=zero - rh2p=zero - rh2pp=zero - ehulp=zero - ehulpp=zero - ehulppp=zero - if (rapt(ih1).gt.zero.and.rapt(ih2).gt.zero) then - rhulp2=dis/rob2(ih1,ih2) - rh2p=rhulp2**ptp(itype) - ehulpp=exp(pdp(itype)*rh2p) - end if - if (vnq(ih1).gt.zero.and.vnq(ih2).gt.zero) then - rhulp3=dis/rob3(ih1,ih2) - rh2pp=rhulp3**popi(itype) - ehulppp=exp(pdo(itype)*rh2pp) - end if - - if (rat(ih1).gt.zero.and.rat(ih2).gt.zero) then - rh2=rhulp**bop2(itype) - ehulp=(1.0+cutoff)*exp(bop1(itype)*rh2) - end if - - bor=ehulp+ehulpp+ehulppp - borsi=ehulp - borpi=ehulpp - borpi2=ehulppp - dbordrob=bop2(itype)*bop1(itype)*rh2*(1.0/dis)*ehulp+ - $ptp(itype)*pdp(itype)*rh2p*(1.0/dis)*ehulpp+ - $popi(itype)*pdo(itype)*rh2pp*(1.0/dis)*ehulppp - dborsidrob=bop2(itype)*bop1(itype)*rh2*(1.0/dis)*ehulp - dborpidrob=ptp(itype)*pdp(itype)*rh2p*(1.0/dis)*ehulpp - dborpi2drob=popi(itype)*pdo(itype)*rh2pp*(1.0/dis)*ehulppp - - nbon2=nbon2+1 - j1=i1 - j2=i2 - -********************************************************************** -* * -* Determine bond orders * -* * -********************************************************************** - ib(i0,1)=itype - ib(i0,2)=j1 - ib(i0,3)=j2 - ibsym(i0)=ivl - drdc(i0,1,1)=disdx - drdc(i0,2,1)=disdy - drdc(i0,3,1)=disdz - drdc(i0,1,2)=-disdx - drdc(i0,2,2)=-disdy - drdc(i0,3,2)=-disdz - abo(i1)=abo(i1)+bor-cutoff - if (i1.ne.i2) abo(i2)=abo(i2)+bor-cutoff - bo(i0)=bor-cutoff - bos(i0)=bor-cutoff - bosi(i0)=borsi-cutoff - bopi(i0)=borpi - bopi2(i0)=borpi2 - rbo(i0)=dis - dbodr(i0)=dbordrob -* dbosidr(i0)=dborsidrob - dbopidr(i0)=dborpidrob - dbopi2dr(i0)=dborpi2drob - dbodc(i0,1,1)=dbodr(i0)*drdc(i0,1,1) - dbodc(i0,2,1)=dbodr(i0)*drdc(i0,2,1) - dbodc(i0,3,1)=dbodr(i0)*drdc(i0,3,1) - dbodc(i0,1,2)=dbodr(i0)*drdc(i0,1,2) - dbodc(i0,2,2)=dbodr(i0)*drdc(i0,2,2) - dbodc(i0,3,2)=dbodr(i0)*drdc(i0,3,2) -* dbosidc(i0,1,1)=dbosidr(i0)*drdc(i0,1,1) -* dbosidc(i0,2,1)=dbosidr(i0)*drdc(i0,2,1) -* dbosidc(i0,3,1)=dbosidr(i0)*drdc(i0,3,1) -* dbosidc(i0,1,2)=dbosidr(i0)*drdc(i0,1,2) -* dbosidc(i0,2,2)=dbosidr(i0)*drdc(i0,2,2) -* dbosidc(i0,3,2)=dbosidr(i0)*drdc(i0,3,2) - dbopidc(i0,1,1)=dbopidr(i0)*drdc(i0,1,1) - dbopidc(i0,2,1)=dbopidr(i0)*drdc(i0,2,1) - dbopidc(i0,3,1)=dbopidr(i0)*drdc(i0,3,1) - dbopidc(i0,1,2)=dbopidr(i0)*drdc(i0,1,2) - dbopidc(i0,2,2)=dbopidr(i0)*drdc(i0,2,2) - dbopidc(i0,3,2)=dbopidr(i0)*drdc(i0,3,2) - dbopi2dc(i0,1,1)=dbopi2dr(i0)*drdc(i0,1,1) - dbopi2dc(i0,2,1)=dbopi2dr(i0)*drdc(i0,2,1) - dbopi2dc(i0,3,1)=dbopi2dr(i0)*drdc(i0,3,1) - dbopi2dc(i0,1,2)=dbopi2dr(i0)*drdc(i0,1,2) - dbopi2dc(i0,2,2)=dbopi2dr(i0)*drdc(i0,2,2) - dbopi2dc(i0,3,2)=dbopi2dr(i0)*drdc(i0,3,2) - ia(i1,2)=ia(i1,2)+1 - if (i1.ne.i2) ia(i2,2)=ia(i2,2)+1 - ia(i1,ia(i1,2)+2)=i2 - ia(i2,ia(i2,2)+2)=i1 - if (ia(i1,2).gt.nsbma2) nsbma2=ia(i1,2) - if (ia(i2,2).gt.nsbma2) nsbma2=ia(i2,2) - if (bor.gt.cutof3) then - iag(i1,2)=iag(i1,2)+1 - iag(i2,2)=iag(i2,2)+1 - iag(i1,iag(i1,2)+2)=i2 - iag(i2,iag(i2,2)+2)=i1 - nubon1(i1,iag(i1,2))=i0 - nubon1(i2,iag(i2,2))=i0 - if (iag(i1,2).gt.nsbmax) nsbmax=iag(i1,2) - if (iag(i2,2).gt.nsbmax) nsbmax=iag(i2,2) - end if - nubon2(i1,ia(i1,2))=i0 - nubon2(i2,ia(i2,2))=i0 - - 10 continue - -********************************************************************** -* * -* Sort molecules * -* * -********************************************************************** - imolde = 1 - if (imolde.eq.1) return !fixed molecular definitions - - FOUND=.FALSE. - DO 31 K1=1,NA - IF (IA(K1,3+mbond).EQ.0) FOUND=.TRUE. - 31 IF (IA(K1,3+mbond).GT.NMOLO) NMOLO=IA(K1,3+mbond) - IF (.NOT.FOUND) GOTO 32 -************************************************************************ -* * -* Molecule numbers are assigned. No restrictions are made for the * -* sequence of the numbers in the connection table. * -* * -************************************************************************ - N3=1 - 34 N2=N3 - NMOLO=NMOLO+1 - if (nmolo.gt.nmolmax) then - write (*,*)nmolmax - write (*,*)'Too many molecules in system; increase nmolmax' - write (*,*)'nmolmax = ',nmolmax - write (*,*)'nmolo = ',nmolo - write (*,*)'n2 = ',n2 - stop 'Too many molecules in system' - end if - IA(N2,3+mbond)=NMOLO - 37 FOUND=.FALSE. - DO 36 N1=N2+1,NA - IF (IA(N1,3+mbond).NE.0) GOTO 36 - DO 35 L=1,mbond - IF (IA(N1,l+2).EQ.0) GOTO 36 - IF (IA(IA(N1,l+2),3+mbond).EQ.NMOLO) THEN - FOUND=.TRUE. - IA(N1,3+mbond)=NMOLO - GOTO 36 - ENDIF - 35 CONTINUE - 36 CONTINUE - IF (FOUND) GOTO 37 - DO 33 N3=N2+1,NA - 33 IF (IA(N3,3+mbond).EQ.0) GOTO 34 -************************************************************************ -* * -* The assigned or input molecule numbers are checked for their * -* consistency. * -* * -************************************************************************ - 32 FOUND=.FALSE. - DO 42 N1=1,NA - DO 41 L=1,mbond - IF (IA(N1,L+2).EQ.0) GOTO 42 - IF (IA(IA(N1,L+2),3+mbond).NE.IA(N1,3+mbond)) THEN - FOUND=.TRUE. - ENDIF - 41 CONTINUE - 42 CONTINUE - IF (FOUND) THEN - write (7,1000)NA,qmol - do i1=1,NA - write (7,1100)i1,ia(i1,1),(ia(i1,2+i2),i2=1,nsbmax), - $ia(i1,3+mbond) - end do - write (7,*)tm11,tm22,tm33,angle(1),angle(2),angle(3) - STOP' Mol.nrs. not consistent; maybe wrong cell parameters' - end if -********************************************************************** -* * -* Sort molecules again * -* This sort is on iag, enforces bond order cutoff * -* * -********************************************************************** - FOUND=.FALSE. - DO 61 K1=1,NA - IF (IAG(K1,3+mbond).EQ.0) FOUND=.TRUE. - 61 IF (IAG(K1,3+mbond).GT.NMOLO5) NMOLO5=IAG(K1,3+mbond) - IF (.NOT.FOUND) GOTO 62 -************************************************************************ -* * -* Molecule numbers are assigned. No restrictions are made for the * -* sequence of the numbers in the connection table. * -* * -************************************************************************ - N3=1 - 64 N2=N3 - NMOLO5=NMOLO5+1 - if (nmolo5.gt.nmolmax) stop 'Too many molecules in system' - IAG(N2,3+mbond)=NMOLO5 - 67 FOUND=.FALSE. - DO 66 N1=N2+1,NA - IF (IAG(N1,3+mbond).NE.0) GOTO 66 - DO 65 L=1,mbond - IF (IAG(N1,l+2).EQ.0) GOTO 66 - IF (IAG(IAG(N1,l+2),3+mbond).EQ.NMOLO5) THEN - FOUND=.TRUE. - IAG(N1,3+mbond)=NMOLO5 - GOTO 66 - ENDIF - 65 CONTINUE - 66 CONTINUE - IF (FOUND) GOTO 67 - DO 63 N3=N2+1,NA - 63 IF (IAG(N3,3+mbond).EQ.0) GOTO 64 -************************************************************************ -* * -* The assigned or input molecule numbers are checked for their * -* consistency. * -* * -************************************************************************ - 62 FOUND=.FALSE. - DO 72 N1=1,NA - DO 71 L=1,mbond - IF (IAG(N1,L+2).EQ.0) GOTO 72 - IF (IAG(IAG(N1,L+2),3+mbond).NE.IAG(N1,3+mbond)) THEN - FOUND=.TRUE. - ENDIF - 71 CONTINUE - 72 CONTINUE - IF (FOUND) THEN - write (7,1000)NA,qmol - do i1=1,NA - write (7,1100)i1,iag(i1,1),(iag(i1,2+i2),i2=1,nsbmax), - $iag(i1,3+mbond) - end do - write (7,*)tm11,tm22,tm33,angle(1),angle(2),angle(3) - STOP' Mol.nrs. not consistent; maybe wrong cell parameters' - ENDIF - -********************************************************************** -* * -* Format part * -* * -********************************************************************** - 1000 format (i3,2x,a60) - 1100 format (8i3) - end -********************************************************************** -********************************************************************** - - subroutine srtang - -********************************************************************** -#include "cbka.blk" -#include "cbkbo.blk" -#include "cbknubon2.blk" -#include "cbkff.blk" -#include "cbkia.blk" -#include "cbkrbo.blk" -#include "cbkvalence.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "small.blk" - - dimension a(3),b(3),j(3) - dimension ityva(100) - -********************************************************************** -* * -* Find valency angles in molecule * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In srtang' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - - nval=0 - if (nvaty.eq.0) return - do iindexatom=1,na - inumbonds=ia(iindexatom,2) - do jindexbond=1,inumbonds-1 - jindexbondlist = nubon2(iindexatom,jindexbond) - if (bo(jindexbondlist).lt.cutof2) goto 51 - k4=ib(jindexbondlist,2) - k5=ib(jindexbondlist,3) - do kindexbond=jindexbond+1,inumbonds - kindexbondlist = nubon2(iindexatom,kindexbond) - iju=0 - if (bo(kindexbondlist).lt.cutof2) goto 50 - if (bo(jindexbondlist)*bo(kindexbondlist).lt.0.001) goto 50 - k7=ib(kindexbondlist,2) - k8=ib(kindexbondlist,3) - -* Exclude angles that have no local atoms. -* Angles with non-local center atom are not needed for angle -* energies, but are needed to construct torsions. - if ( k4 .le. na_local .or. - $ k5 .le. na_local .or. - $ k7 .le. na_local .or. - $ k8 .le. na_local) then - - if (k4.eq.k7.and.k5.eq.k8.and.k4.ne.k8.and.k5.ne.k7) then - nval=nval+1 - iv(nval,2)=k5 - iv(nval,3)=k4 - iv(nval,4)=k8 - iv(nval,5)=jindexbondlist - iv(nval,6)=kindexbondlist - nval=nval+1 - iv(nval,2)=k4 - iv(nval,3)=k5 - iv(nval,4)=k7 - iv(nval,5)=jindexbondlist - iv(nval,6)=kindexbondlist - iju=2 - write(6,*) 'Aaaah!' - end if - if (iju.eq.2) goto 50 - - if (k4.eq.k8.and.k5.eq.k7.and.k4.ne.k7.and.k5.ne.k8) then - nval=nval+1 - iv(nval,2)=k5 - iv(nval,3)=k4 - iv(nval,4)=k7 - iv(nval,5)=jindexbondlist - iv(nval,6)=kindexbondlist - nval=nval+1 - iv(nval,2)=k4 - iv(nval,3)=k5 - iv(nval,4)=k8 - iv(nval,5)=jindexbondlist - iv(nval,6)=kindexbondlist - iju=2 - write(6,*) 'Aaaah!' - end if - if (iju.eq.2) goto 50 - - if (k4.eq.k7) then - nval=nval+1 - iv(nval,2)=k5 - iv(nval,3)=k4 - iv(nval,4)=k8 - iv(nval,5)=jindexbondlist - iv(nval,6)=kindexbondlist - iju=1 - end if - if (iju.eq.1) goto 50 - - if (k4.eq.k8) then - nval=nval+1 - iv(nval,2)=k5 - iv(nval,3)=k4 - iv(nval,4)=k7 - iv(nval,5)=jindexbondlist - iv(nval,6)=kindexbondlist - iju=1 - end if - if (iju.eq.1) goto 50 - - if (k5.eq.k7) then - nval=nval+1 - iv(nval,2)=k4 - iv(nval,3)=k5 - iv(nval,4)=k8 - iv(nval,5)=jindexbondlist - iv(nval,6)=kindexbondlist - iju=1 - end if - if (iju.eq.1) goto 50 - - if (k5.eq.k8) then - nval=nval+1 - iv(nval,2)=k4 - iv(nval,3)=k5 - iv(nval,4)=k7 - iv(nval,5)=jindexbondlist - iv(nval,6)=kindexbondlist - iju=1 - end if - if (iju.eq.1) goto 50 - - write (6,*)'nval = ',nval, - $ ' after',iindexatom, ' of ',na,' atoms completed.' - stop 'Adjacent bonds did not make an angle' - - endif - - 50 continue - - if (nval.gt.nvamax) then - write (6,*)'nval = ',nval,' reax_defs.h::NVAMAXDEF = ', - $ NVAMAXDEF, - $ ' after',iindexatom, ' of ',na,' atoms completed.' - stop 'Too many valency angles. Increase NVAMAXDEF' - endif - - if (iju.gt.0) then -********************************************************************** -* * -* Determine force field types of angles * -* * -********************************************************************** - ityva(1)=0 - ih1=ia(iv(nval,2),1) - ih2=ia(iv(nval,3),1) - ih3=ia(iv(nval,4),1) - if (ih3.lt.ih1) then - ih3=ia(iv(nval,2),1) - ih2=ia(iv(nval,3),1) - ih1=ia(iv(nval,4),1) - end if - - nfound=0 - do i3=1,nvaty - if (ih1.eq.nvs(i3,1).and.ih2.eq.nvs(i3,2).and. - $ih3.eq.nvs(i3,3)) then - nfound=nfound+1 - ityva(nfound)=i3 - end if - end do - - if (ityva(1).eq.0.or.abs(vka(ityva(1))).lt.0.001) then !Valence angle does not exist in force field;ignore - nval=nval-1 - ihul=0 - else - iv(nval,1)=ityva(1) - ihul=1 - - do i3=1,nfound-1 !Found multiple angles of the same type - nval=nval+1 - iv(nval,1)=ityva(i3+1) - do i4=2,6 - iv(nval,i4)=iv(nval-1,i4) - end do - - end do - - end if - - if (iju.eq.2) then - ityva(1)=0 - ih1=ia(iv(nval-ihul,2),1) - ih2=ia(iv(nval-ihul,3),1) - ih3=ia(iv(nval-ihul,4),1) - if (ih3.lt.ih1) then - ih3=ia(iv(nval-ihul,2),1) - ih2=ia(iv(nval-ihul,3),1) - ih1=ia(iv(nval-ihul,4),1) - end if - - nfound=0 - do i3=1,nvaty - if (ih1.eq.nvs(i3,1).and.ih2.eq.nvs(i3,2).and. - $ih3.eq.nvs(i3,3)) then - nfound=nfound+1 - ityva(nfound)=i3 - end if - end do - - if (ityva(1).eq.0.or.abs(vka(ityva(1))).lt.0.001) then !Valence angle does not exist in force field;ignore - if (ihul.eq.1) then - do i3=1,6 - iv(nval-1,i3)=iv(nval,i3) - end do - end if - nval=nval-1 - else - iv(nval-ihul,1)=ityva(1) - - do i3=1,nfound-1 !Found multiple angles of the same type - nval=nval+1 - iv(nval,1)=ityva(i3+1) - do i4=2,6 - iv(nval,i4)=iv(nval-1,i4) - end do - - end do - - end if - - end if - - end if - - end do - 51 continue - end do - end do - - nbonop=0 - - return - end -********************************************************************** -********************************************************************** - - subroutine srttor - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkbo.blk" -#include "cbkrbo.blk" -#include "cbkia.blk" -#include "cbktorsion.blk" -#include "cbkvalence.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "small.blk" -#include "cbknubon2.blk" -********************************************************************** -* * -* Find torsion angles in molecule * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$ open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In srttor' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - ntor=0 - if (ntoty.eq.0) return - do 61 i1=1,nbon - k2=ib(i1,2) - k3=ib(i1,3) -c Only compute interaction if both atoms local -c are local or else flip a coin - if (k2 .gt. na_local) go to 61 - if (k3 .gt. na_local) then - if (itag(k2) .lt. itag(k3)) go to 61 - if (itag(k2) .eq. itag(k3)) then - if(c(k2,3) .gt. c(k3,3)) go to 61 - if(c(k2,3) .eq. c(k3,3) .and. - $ c(k2,2) .gt. c(k3,2)) go to 61 - if(c(k2,3) .eq. c(k3,3) .and. - $ c(k2,2) .eq. c(k3,2) .and. - $ c(k2,1) .gt. c(k3,1)) go to 61 - endif - endif - - iob1=ia(k2,2) - iob2=ia(k3,2) - do 60 i2=1,iob1 !Atoms connected to k2 - k4=ia(k2,2+i2) - ibo2=nubon2(k2,i2) - do 60 i3=1,iob2 !Atoms connected to k3 - k5=ia(k3,2+i3) - ibo3=nubon2(k3,i3) - bopr=bo(i1)*bo(ibo2)*bo(ibo3) - if (bopr.gt.cutof2.and.k2.ne.k5.and.k3.ne.k4.and.k4.ne.k5) then - - ntor=ntor+1 - it(ntor,2)=k4 - it(ntor,3)=k2 - it(ntor,4)=k3 - it(ntor,5)=k5 - it(ntor,6)=ibo2 - it(ntor,7)=i1 - it(ntor,8)=ibo3 - -********************************************************************** -* * -* Determine force field types of torsion angles * -* * -********************************************************************** - ity=0 - ih1=ia(it(ntor,2),1) - ih2=ia(it(ntor,3),1) - ih3=ia(it(ntor,4),1) - ih4=ia(it(ntor,5),1) - - if (ih2.gt.ih3) then - ih1=ia(it(ntor,5),1) - ih2=ia(it(ntor,4),1) - ih3=ia(it(ntor,3),1) - ih4=ia(it(ntor,2),1) - end if - - if (ih2.eq.ih3.and.ih4.lt.ih1) then - ih1=ia(it(ntor,5),1) - ih2=ia(it(ntor,4),1) - ih3=ia(it(ntor,3),1) - ih4=ia(it(ntor,2),1) - end if - - do i4=1,ntoty - if (ih1.eq.nts(i4,1).and.ih2.eq.nts(i4,2).and.ih3.eq.nts(i4,3) - $.and.ih4.eq.nts(i4,4)) ity=i4 - end do - - if (ity.eq.0) then - do i4=1,ntoty - if (nts(i4,1).eq.0.and.ih2.eq.nts(i4,2).and.ih3.eq.nts(i4,3) - $.and.nts(i4,4).eq.0) ity=i4 - end do - end if - - if (ity.eq.0) then - ntor=ntor-1 !Torsion angle does not exist in force field: ignore - else - it(ntor,1)=ity - end if - - end if - - 60 continue - 61 continue - - if (ntor.gt.ntomax) stop 'Too many torsion angles' -* do i1=1,ntor -* write (41,'(20i4)')i1,it(i1,1),it(i1,2),it(i1,3), -* $it(i1,4),it(i1,5),it(i1,6),it(i1,7),it(i1,8) -* end do - - return - end -********************************************************************** -********************************************************************** - - subroutine srtoop - -********************************************************************** -#include "cbka.blk" -#include "cbkbo.blk" -#include "cbkrbo.blk" -#include "cbkvalence.blk" -#include "control.blk" -#include "small.blk" -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In srtoop' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if -********************************************************************** -* * -* Find out of plane angles in molecule * -* * -********************************************************************** - noop=0 - do i1=1,nval - k2=iv(i1,2) - k3=iv(i1,3) - k4=iv(i1,4) - k5=iv(i1,5) - k6=iv(i1,6) - do i2=1,nbon - k7=ib(i2,2) - k8=ib(i2,3) - if (bo(i2).gt.cutof2) then - if (k7.eq.k3.and.k8.ne.k4.and.k8.ne.k2) then - noop=noop+1 - ioop(noop,2)=k8 - ioop(noop,3)=k3 - ioop(noop,4)=k2 - ioop(noop,5)=k4 - ioop(noop,6)=i2 - ioop(noop,7)=iv(i1,5) - ioop(noop,8)=iv(i1,6) - ioop(noop,9)=i1 - end if - if (k8.eq.k3.and.k7.ne.k4.and.k7.ne.k2) then - noop=noop+1 - ioop(noop,2)=k7 - ioop(noop,3)=k3 - ioop(noop,4)=k2 - ioop(noop,5)=k4 - ioop(noop,6)=i2 - ioop(noop,7)=iv(i1,5) - ioop(noop,8)=iv(i1,6) - ioop(noop,9)=i1 - end if - end if - end do - end do - - do i1=1,noop - call caltor(ioop(i1,2),ioop(i1,3),ioop(i1,4),ioop(i1,5),hoop) - end do - -********************************************************************** - return - end -********************************************************************** - -********************************************************************** - - subroutine srthb - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkbo.blk" -#include "cbkconst.blk" -#include "cbkia.blk" -#include "cbkrbo.blk" -#include "cbksrthb.blk" -#include "control.blk" -#include "small.blk" -#include "cbkpairs.blk" -#include "cbknvlown.blk" -#include "cbknubon2.blk" -********************************************************************** -* * -* Find hydrogen bonds in molecule * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$ open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In srthb' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - nhb=0 -********************************************************************** -* * -* Locate donor/acceptor bonds * -* * -********************************************************************** -c Outer loop must be Verlet list, because ia() does not store Verlet entries, -c but it does store bond entries in nubon2() -c -c The problem with using the nvlown ownership criterion -c is that it would require that we unprune every bond that is within -c certain distance, as well as its first and second neighbor bonds. -c -c For the ownership criterion based on H atom location no unpruning is required. -c Apparently lprune=4 is sufficient here, implying that we need to capture first and -c second neighbor bonds of the O-H bond, and of course we need to include all hydrogen -c bond partners within hbcut. -c - - do 20 ivl=1,nvpair !Use Verlet-list to find donor-acceptor pairs - - j1=nvl1(ivl) - j2=nvl2(ivl) - ity1=ia(j1,1) - ity2=ia(j2,1) - ihhb1=nphb(ia(j1,1)) - ihhb2=nphb(ia(j2,1)) - - if (ihhb1.gt.ihhb2) then !Make j1 donor(H) atom and j2 acceptor(O) atom - j2=nvl1(ivl) - j1=nvl2(ivl) - ity1=ia(j1,1) - ity2=ia(j2,1) - ihhb1=nphb(ia(j1,1)) - ihhb2=nphb(ia(j2,1)) - end if - -* Only need to compute bonds where j1 is local - if (j1 .le. na_local) then - - if (ihhb1.eq.1.and.ihhb2.eq.2) then - call dista2(j1,j2,dishb,dxm,dym,dzm) - if (dishb.lt.hbcut) then - do 10 i23=1,ia(j1,2) !Search for acceptor atoms bound to donor atom - j3=ia(j1,2+i23) - ity3=ia(j3,1) - nbohb=nubon2(j1,i23) - if (nphb(ity3).eq.2.and.j3.ne.j2.and.bo(nbohb).gt.0.01) then -********************************************************************** -* * -* Accept hydrogen bond and find hydrogen bond type * -* * -********************************************************************** - nhb=nhb+1 - - if (nhb.gt.nhbmax) then - write (*,*)nhb,nhbmax - write (*,*)'Maximum number of hydrogen bonds exceeded' - stop 'Maximum number of hydrogen bonds exceeded' - end if - - ihb(nhb,1)=0 - - do i3=1,nhbty - if (ity3.eq.nhbs(i3,1).and.ity1.eq.nhbs(i3,2).and.ity2.eq. - $nhbs(i3,3)) ihb(nhb,1)=i3 - end do - - if (ihb(nhb,1).eq.0) then !Hydrogen bond not in force field - nhb=nhb-1 -* write (*,*)'Warning: added hydrogen bond ',ity3,ity1,ity2 -* nhbty=nhbty+1 -* nhbs(nhbty,1)=ity3 -* nhbs(nhbty,2)=ity1 -* nhbs(nhbty,3)=ity2 -* rhb(nhbty)=2.70 -* dehb(nhbty)=zero -* vhb1(nhbty)=5.0 -* vhb2(nhbty)=20.0 -* ihb(nhb,1)=nhbty - end if - - ihb(nhb,2)=j3 - ihb(nhb,3)=j1 - ihb(nhb,4)=j2 - ihb(nhb,5)=nbohb - ihb(nhb,6)=k1 - ihb(nhb,7)=k2 - ihb(nhb,8)=k3 -* write (64,*)nhb,ihb(nhb,1),j3,j1,j2,nbohb,k1,k2,k3,bo(nbohb), -* $dishb - - end if - - 10 continue - - end if - end if - end if - 20 end do - -* stop 'end in srthb' - return - end -********************************************************************** diff --git a/lib/reax/reax_defs.h b/lib/reax/reax_defs.h deleted file mode 100644 index e28533fa9b..0000000000 --- a/lib/reax/reax_defs.h +++ /dev/null @@ -1,70 +0,0 @@ -#define PORTABLECOMMENTFLAG -#ifndef PORTABLECOMMENTFLAG -// This is just a way to have portable comments -// for both C++ and FORTRAN preprocessing. - /* ///:EOH~ */ - /* */ - /* This file contains array dimension parameters for all the main */ - /* ReaxFF data structures, some of which need to be directly accessed */ - /* by Grasp C++ functions. If they are set too small, the calculation */ - /* will run out of allocated memory. If they are set too big, the machine */ - /* will not be able to allocate enough memory. */ - /* */ - - /* NNEIGHMAXDEF = Max number of neighbors / NATDEF */ - /* NATDEF = Max number of atoms */ - /* NATTOTDEF = Max number of global atoms */ - /* NSORTDEF = Max number of atom types */ - /* MBONDDEF = Max number of bonds connected to one atom */ - /* NAVIBDEF = for 2nd derivatives */ - /* NBOTYMDEF = Max number of bond types */ - /* NVATYMDEF = Max number of valency angle types */ - /* NTOTYMDEF = Max number of torsion angle types */ - /* NHBTYMDEF = Max number of hydrogen bond types */ - /* NODMTYMDEF = Max number of off-diagonal Morse types */ - /* NBOALLMAXDEF = Max number of all bonds */ - /* NBOMAXDEF = Max number of bonds */ - /* NHBMAXDEF = Max number of hydrogen bonds */ - /* NVAMAXDEF = Max number of valency angles */ - /* NOPMAXDEF = Max number of out of plane angles */ - /* NTOMAXDEF = Max number of torsion angles */ - /* NPAMAXDEF = Max number of general parameters in force field */ - /* NMOLMAXDEF = Max number of molecules in system */ - /* NMOLSETDEF = Max number of molecules in training set */ - /* MRESTRADEF = Max number of restraints */ - /* MTREGDEF = Max number of temperature regimes */ - /* MTZONEDEF = Max number of temperature zones */ - /* MVREGDEF = Max number of volume regimes */ - /* MVZONEDEF = Max number of volume zones */ - /* MEREGDEF = Max number of electric field regimes */ - /* MEZONEDEF = Max number of electric field zones */ -#endif - -#define NNEIGHMAXDEF 120 -#define NATDEF 40000 -#define NATTOTDEF 39744 -#define NSORTDEF 20 -#define MBONDDEF 20 -#define NAVIBDEF 50 -#define NBOTYMDEF 200 -#define NVATYMDEF 200 -#define NTOTYMDEF 200 -#define NHBTYMDEF 200 -#define NODMTYMDEF 20 -#define NBOALLMAXDEF 180000 -#define NBOMAXDEF 90000 -#define NHBMAXDEF 400000 -#define NVAMAXDEF 300000 -#define NOPMAXDEF 00010 -#define NTOMAXDEF 65000 -#define NPAMAXDEF 50 -#define NMOLMAXDEF 2000 -#define NMOLSETDEF 1500 -#define MRESTRADEF 100 -#define MTREGDEF 100 -#define MTZONEDEF 5 -#define MVREGDEF 100 -#define MVZONEDEF 6 -#define MEREGDEF 100 -#define MEZONEDEF 3 - diff --git a/lib/reax/reax_inout.F b/lib/reax/reax_inout.F deleted file mode 100644 index 944400a968..0000000000 --- a/lib/reax/reax_inout.F +++ /dev/null @@ -1,3870 +0,0 @@ -********************************************************************** -* * -* REAXFF Reactive force field program * -* * -* Developed and written by Adri van Duin, duin@wag.caltech.edu * -* * -* Copyright (c) 2001-2010 California Institute of Technology * -* * -* This is an open-source program. Feel free to modify its * -* contents. Please keep me informed of any useful modification * -* or addition that you made. Please do not distribute this * -* program to others; if people are interested in obtaining * -* a copy of this program let them contact me first. * -* * -********************************************************************** -********************************************************************** - - subroutine ffinpt - -********************************************************************** -#include "cbka.blk" -#include "cbkboncor.blk" -#include "cbkconst.blk" -#include "cbkcovbon.blk" -#include "cbkff.blk" -#include "cbkfftorang.blk" -#include "cbknonbon.blk" -#include "cbksrthb.blk" -#include "cbktorsion.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "opt.blk" -#include "valang.blk" -#include "cbksrtbon1.blk" -#include "cbkchb.blk" - dimension rcore2(nsort),ecore2(nsort),acore2(nsort) -********************************************************************** -* * -* Read in force field * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In ffinpt' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - open (4,file='ffield.reax',status='old') - rewind (4) - iline=0 - read (4,'(a40)',end=990,err=990)qffield - iline=iline+1 -********************************************************************** -* * -* Read in general force field parameters * -* * -********************************************************************** - read (4,1100,end=990,err=990)npar - iline=iline+1 - do i1=1,npar - read (4,1300,end=990,err=990)vpar(i1) - iline=iline+1 - end do - cutoff=0.01*vpar(30) - swa=vpar(12) - if (abs(swa).gt.0.01) write (*,*) - $'Warning: non-zero value for lower Taper-radius cutoff' - swb=vpar(13) - if (swb.lt.zero) stop - $'Negative value for upper Taper-radius cutoff' - if (swb.lt.5.0) write (*,*) - $'Warning: very low value for upper Taper-radius cutoff:',swb -********************************************************************** -* * -* Read in atom type data * -* * -********************************************************************** - read (4,1100,end=990,err=990) nso - iline=iline+1 - read (4,*,end=990,err=990) - iline=iline+1 - read (4,*,end=990,err=990) - iline=iline+1 - read (4,*,end=990,err=990) - iline=iline+1 - if (nso.gt.nsort) stop 'Maximum number of atom types exceeded' - do i1=1,nso - read (4,1200,end=990,err=990)qas(i1),rat(i1),aval(i1),amas(i1), - $rvdw(i1),eps(i1),gam(i1),rapt(i1),stlp(i1) - iline=iline+1 - read (4,1250,end=990,err=990)alf(i1),vop(i1),valf(i1), - $valp1(i1),valp2(i1),chi(i1),eta(i1),vnphb - iline=iline+1 - read (4,1250,end=990,err=990)vnq(i1),vlp1(i1),vincr(i1), - $bo131(i1),bo132(i1),bo133(i1),sigqeq(i1),default - iline=iline+1 - read (4,1250,end=990,err=990)vovun(i1),vval1(i1),vrom, - $vval3(i1),vval4(i1),rcore2(i1),ecore2(i1),acore2(i1) - iline=iline+1 - idef(i1)=int(default) - nphb(i1)=int(vnphb) - end do -********************************************************************** -* * -* Calculate van der Waals and Coulomb pair-parameters * -* * -********************************************************************** - do i1=1,nso - do i2=1,nso - rcore(i1,i2)=sqrt(rcore2(i1)*rcore2(i2)) - ecore(i1,i2)=sqrt(ecore2(i1)*ecore2(i2)) - acore(i1,i2)=sqrt(acore2(i1)*acore2(i2)) - p1co(i1,i2)=sqrt(4.0*rvdw(i1)*rvdw(i2)) - p2co(i1,i2)=sqrt(eps(i1)*eps(i2)) - p3co(i1,i2)=sqrt(alf(i1)*alf(i2)) - gamwh=sqrt(vop(i1)*vop(i2)) - gamwco(i1,i2)=1.0/gamwh**vpar(29) - gamch=sqrt(gam(i1)*gam(i2)) - gamcco(i1,i2)=1.0/gamch**3 - rob1(i1,i2)=0.50*(rat(i1)+rat(i2)) - rob2(i1,i2)=0.50*(rapt(i1)+rapt(i2)) - rob3(i1,i2)=0.50*(vnq(i1)+vnq(i2)) - end do - end do -********************************************************************** -* * -* Read in bond type data * -* * -********************************************************************** - read (4,1100,end=990,err=990)nboty - iline=iline+1 - read (4,*,end=990,err=990) - iline=iline+1 - if (2*nboty.gt.nbotym) stop 'Maximum nr. of bond types exceeded' - ih=0 - do i1=1,nboty - ih=ih+1 - read (4,1400,end=990,err=990)nbs(ih,1),nbs(ih,2),de1(ih), - $de2(ih),de3(ih),psi(ih),pdo(ih),v13cor(ih),popi(ih),vover(ih) - iline=iline+1 - read (4,1450,end=990,err=990)psp(ih),pdp(ih),ptp(ih), - $bom(ih),bop1(ih),bop2(ih),ovc(ih),vuncor(ih) - iline=iline+1 - if (nbs(ih,1).ne.nbs(ih,2)) then - ih=ih+1 - nbs(ih,1)=nbs(ih-1,2) - nbs(ih,2)=nbs(ih-1,1) - de1(ih)=de1(ih-1) - de2(ih)=de2(ih-1) - de3(ih)=de3(ih-1) - psi(ih)=psi(ih-1) - pdo(ih)=pdo(ih-1) - v13cor(ih)=v13cor(ih-1) - vover(ih)=vover(ih-1) - psp(ih)=psp(ih-1) - pdp(ih)=pdp(ih-1) - ptp(ih)=ptp(ih-1) - bop1(ih)=bop1(ih-1) - bop2(ih)=bop2(ih-1) -* bop3(ih)=bop3(ih-1) -* bop4(ih)=bop4(ih-1) - bom(ih)=bom(ih-1) - popi(ih)=popi(ih-1) - ovc(ih)=ovc(ih-1) - end if - end do - nboty2=ih -********************************************************************** -* * -* Read in off-diagonal parameters * -* * -********************************************************************** - read (4,1100,end=990,err=990)nodmty - iline=iline+1 - if (nodmty.gt.nodmtym) - $stop 'Maximum nr. of off-diagonal Morse types exceeded' - ih=0 - do i1=1,nodmty - ih=ih+1 - read (4,1400,end=990,err=990)nodm1,nodm2,deodmh,rodmh,godmh, - $rsig,rpi,rpi2 - iline=iline+1 - if (rsig.gt.zero) rob1(nodm1,nodm2)=rsig - if (rsig.gt.zero) rob1(nodm2,nodm1)=rsig - if (rpi.gt.zero) rob2(nodm1,nodm2)=rpi - if (rpi.gt.zero) rob2(nodm2,nodm1)=rpi - if (rpi2.gt.zero) rob3(nodm1,nodm2)=rpi2 - if (rpi2.gt.zero) rob3(nodm2,nodm1)=rpi2 - if (rodmh.gt.zero) p1co(nodm1,nodm2)=2.0*rodmh - if (rodmh.gt.zero) p1co(nodm2,nodm1)=2.0*rodmh - if (deodmh.gt.zero) p2co(nodm1,nodm2)=deodmh - if (deodmh.gt.zero) p2co(nodm2,nodm1)=deodmh - if (godmh.gt.zero) p3co(nodm1,nodm2)=godmh - if (godmh.gt.zero) p3co(nodm2,nodm1)=godmh - end do -********************************************************************** -* * -* Read in valency angle and conjugation type data * -* * -********************************************************************** - read (4,1100,end=990,err=990)nvaty - iline=iline+1 - if (nvaty.gt.nvatym) - $stop 'Maximum nr. of valency angle types exceeded' - do i1=1,nvaty - read (4,1500,end=990,err=990)nvs(i1,1),nvs(i1,2), - $nvs(i1,3),th0(i1),vka(i1),vka3(i1),vka8(i1),vkac(i1),vkap(i1), - $vval2(i1) - iline=iline+1 - end do -********************************************************************** -* * -* Read in torsion angle type data * -* * -********************************************************************** - read (4,1100,end=990,err=990)ntoty - iline=iline+1 - if (ntoty.gt.ntotym) - $stop 'Maximum nr. of torsion angle types exceeded' - do i1=1,ntoty - read (4,1600,end=990,err=990)nts(i1,1),nts(i1,2),nts(i1,3), - $nts(i1,4),v1(i1), - $v2(i1),v3(i1),v4(i1),vconj(i1),v2bo(i1),v3bo(i1) - iline=iline+1 - end do -********************************************************************** -* * -* Read in hydrogen bond type data * -* * -********************************************************************** - read (4,1100,end=990,err=990)nhbty - iline=iline+1 - if (nhbty.gt.nhbtym) - $stop 'Maximum nr. of hydrogen bond types exceeded' - do i1=1,nhbty - read (4,1500,end=990,err=990)nhbs(i1,1),nhbs(i1,2), - $nhbs(i1,3),rhb(i1),dehb(i1),vhb1(i1),vhb2(i1) - iline=iline+1 - end do -********************************************************************** -* * -* Calculate vdWaals interaction parameters * -* * -********************************************************************** - do i1=1,nso - do i2=1,nso - rr=(rvdw(i1)+rvdw(i2)) - rr2=rr*rr - eps2=sqrt(eps(i1)*eps(i2)) - rr6=rr2*rr2*rr2 - pvdw1(i1,i2)=eps2*rr6*rr6 - pvdw1(i2,i1)=eps2*rr6*rr6 - pvdw2(i1,i2)=2.0*eps2*rr6 - pvdw2(i2,i1)=2.0*eps2*rr6 - end do - end do -********************************************************************** -* * -* Error part * -* * -********************************************************************** - goto 999 - 990 write (*,*)'Error or end-of-file reading unit 4 on line:',iline - stop - 999 continue - close(4) -********************************************************************** -* * -* Format part * -* * -********************************************************************** - 1100 format (i3,2x,a2,3x,3d22.15) - 1200 format (1x,a2,10f9.4) - 1250 format (3x,10f9.4) - 1300 format (f10.4) - 1400 format (2i3,8f9.4) - 1450 format (6x,8f9.4) - 1500 format (3i3,7f9.4) - 1600 format (4i3,7f9.4) - return - end -********************************************************************** -*********************************************************************** - - subroutine mdsav(node) - -*********************************************************************** -#include "cbka.blk" -#include "cbkabo.blk" -#include "cbkatomcoord.blk" -#include "cbkbo.blk" -#include "cbkc.blk" -#include "cbkch.blk" -#include "cbkconst.blk" -#include "cbkdistan.blk" -#include "cbkenergies.blk" -#include "cbkia.blk" -#include "cbkinit.blk" -#include "cbklonpar.blk" -#include "cbknubon2.blk" -#include "cbkqa.blk" -#include "cbktregime.blk" -#include "cbksrtbon1.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "opt.blk" -#include "small.blk" - - dimension idum(mbond+3),bodum(mbond+3),qat2(2) - character*25 qfileh - character*33 qfile2 - character*4 qext - character*6 qmdfi - character *7 var - character *3 qat2,pepname - character *1 qrtemp -************************************************************************ -* * -* Save coordinates, velocities and accelerations of MD-system * -* * -************************************************************************ -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In mdsav' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - -************************************************************************ -c -c This is just for test purposes -c -************************************************************************ -c$$$ write(6,*) '***************************' -c$$$ write(6,*) 'mdsav node number is ',node -c$$$ write(6,*) '***************************' - return - - - qfileh='Unknown' - qmdfi='moldyn' - pepname=' ' - ipeptide=0 - if (ni.eq.2) qmdfi='molsav' - - if (iopt.eq.0) then - - do i1=1,mbond+3 - idum(i1)=nzero - bodum(i1)=zero - end do -C if (napp.eq.1) -C $open (7,file='fort.7',status='unknown',access='append') - if (napp.ne.1) - $open (7,file='fort.7',status='unknown') - nsbmaxh=5*((nsbmax/5)+1) - write (7,100)na,qmol,mdstep,nsbmaxh - if (nbiolab.eq.1) write (67,101)na,qmol - do i1=1,na - bosum=0.0 - do i3=1,nsbmax - if (iag(i1,2+i3).gt.0) bosum=bosum+bo(nubon1(i1,i3)) - end do - if (nsbmax.lt.5) then - write (7,200)i1,iag(i1,1),(iag(i1,2+i2),i2=1,iag(i1,2)), - $(idum(i2),i2=1,5-iag(i1,2)), - $iag(i1,3+mbond),(bo(nubon1(i1,i2)),i2=1,iag(i1,2)), - $(bodum(i2),i2=1,5-iag(i1,2)),abo(i1),vlp(i1),ch(i1) - if (nbiolab.eq.1) then !Delphi-connection table output - write (67,201)i1,iag(i1,1),(iag(i1,2+i2),i2=1,iag(i1,2)) - end if - else if (nsbmax.lt.10) then - write (7,210)i1,iag(i1,1),(iag(i1,2+i2),i2=1,iag(i1,2)), - $(idum(i2),i2=1,10-iag(i1,2)), - $iag(i1,3+mbond),(bo(nubon1(i1,i2)),i2=1,iag(i1,2)), - $(bodum(i2),i2=1,10-iag(i1,2)),abo(i1),vlp(i1),ch(i1) - else if (nsbmax.lt.15) then - write (7,220)i1,iag(i1,1),(iag(i1,2+i2),i2=1,iag(i1,2)), - $(idum(i2),i2=1,15-iag(i1,2)), - $iag(i1,3+mbond),(bo(nubon1(i1,i2)),i2=1,iag(i1,2)), - $(bodum(i2),i2=1,15-iag(i1,2)),abo(i1),vlp(i1),ch(i1) - else if (nsbmax.lt.20) then - write (7,230)i1,iag(i1,1),(iag(i1,2+i2),i2=1,iag(i1,2)), - $(idum(i2),i2=1,20-iag(i1,2)), - $iag(i1,3+mbond),(bo(nubon1(i1,i2)),i2=1,iag(i1,2)), - $(bodum(i2),i2=1,20-iag(i1,2)),abo(i1),vlp(i1),ch(i1) - else if (nsbmax.lt.25) then - write (7,240)i1,iag(i1,1),(iag(i1,2+i2),i2=1,iag(i1,2)), - $(idum(i2),i2=1,25-iag(i1,2)), - $iag(i1,3+mbond),(bo(nubon1(i1,i2)),i2=1,iag(i1,2)), - $(bodum(i2),i2=1,25-iag(i1,2)),abo(i1),vlp(i1),ch(i1) - else if (nsbmax.gt.25) then - write (7,250)i1,iag(i1,1),(iag(i1,2+i2),i2=1,iag(i1,2)), - $(idum(i2),i2=1,35-iag(i1,2)), - $iag(i1,3+mbond),(bo(nubon1(i1,i2)),i2=1,iag(i1,2)), - $(bodum(i2),i2=1,35-iag(i1,2)),abo(i1),vlp(i1),ch(i1) - end if - end do - boss=zero - vlps=0.0 -C if (napp.eq.1) -C $open (8,file='fort.8',status='unknown',access='append') - if (napp.ne.1) - $open (8,file='fort.8',status='unknown') - nsbmaxh=5*((nsbma2/5)+1) - write (8,100)na,qmol,mdstep,nsbmaxh - chsum=0.0 - do i1=1,na - bosum=0.0 - do i3=1,nsbma2 - if (ia(i1,2+i3).gt.0) bosum=bosum+bo(nubon2(i1,i3)) - end do - if (nsbma2.lt.5) then - write (8,200)i1,ia(i1,1),(ia(i1,2+i2),i2=1,ia(i1,2)), - $(idum(i2),i2=1,5-ia(i1,2)), - $ia(i1,3+mbond),(bo(nubon2(i1,i2)),i2=1,ia(i1,2)), - $(bodum(i2),i2=1,5-ia(i1,2)),abo(i1),vlp(i1),ch(i1) - else if (nsbma2.lt.10) then - write (8,210)i1,ia(i1,1),(ia(i1,2+i2),i2=1,ia(i1,2)), - $(idum(i2),i2=1,10-ia(i1,2)), - $ia(i1,3+mbond),(bo(nubon2(i1,i2)),i2=1,ia(i1,2)), - $(bodum(i2),i2=1,10-ia(i1,2)),abo(i1),vlp(i1),ch(i1) - else if (nsbma2.lt.15) then - write (8,220)i1,ia(i1,1),(ia(i1,2+i2),i2=1,ia(i1,2)), - $(idum(i2),i2=1,15-ia(i1,2)), - $ia(i1,3+mbond),(bo(nubon2(i1,i2)),i2=1,ia(i1,2)), - $(bodum(i2),i2=1,15-ia(i1,2)),abo(i1),vlp(i1),ch(i1) - else if (nsbma2.lt.20) then - write (8,230)i1,ia(i1,1),(ia(i1,2+i2),i2=1,ia(i1,2)), - $(idum(i2),i2=1,20-ia(i1,2)), - $ia(i1,3+mbond),(bo(nubon2(i1,i2)),i2=1,ia(i1,2)), - $(bodum(i2),i2=1,20-ia(i1,2)),abo(i1),vlp(i1),ch(i1) - else if (nsbma2.lt.25) then - write (8,240)i1,ia(i1,1),(ia(i1,2+i2),i2=1,ia(i1,2)), - $(idum(i2),i2=1,25-ia(i1,2)), - $ia(i1,3+mbond),(bo(nubon2(i1,i2)),i2=1,ia(i1,2)), - $(bodum(i2),i2=1,25-ia(i1,2)),abo(i1),vlp(i1),ch(i1) - end if - boss=boss+bosum/2.0 - vlps=vlps+vlp(i1) - chsum=chsum+ch(i1) - end do - write (7,*)2.0*boss,vlps,2.0*boss+2.0*vlps,chsum - close(8) - close(7) - - end if - - if (noutpt.eq.0) then - write (var,'(f7.4)')float(mdstep/nsav)/1d4 - if (ni.eq.0) open (unit=67,file=qmdfi//var(3:7), - $status='unknown') - write (67,300)qmol - do i1=1,na - write (67,400)i1,qa(i1),(c(i1,i2),i2=1,3) - end do - write (67,*) - close(67) - end if - - if (noutpt.eq.2) then -C open (88,file='moldyn.bgf',status='unknown',access='append') - call writebgf(88) - close (88) - end if - - if ((ni.eq.1.and.iopt.eq.0).or.(ni.eq.1.and.iopt.eq.1.and. - $iflga.eq.1)) then - qrtemp=qr - if (qr.eq.'I') qr='C' - if (qfileh.eq.' ') then - write (*,*)'Warning: no file name given; use Unknown' - qfileh='Unknown' - end if - qfile2=qfileh - if (imodfile.eq.0) then - istart=1 - qstrana1(1:25)=qfileh - call stranal(istart,iend,vout,iout,1) - qfile2=qfileh(istart:iend-1)//".geo" - end if - call writegeo(98) - - if (imodfile.eq.1.or.iopt.eq.0) then - open (88,file=qfile2,status='unknown') - call writegeo(88) - close (88) - end if - - qr=qrtemp - - if (iopt.eq.0) then - - do i1=1,na - write (56,410) i1,ch(i1) - write (55,410) i1,chgbgf(i1) - end do -********************************************************************** -* * -* Write .pdb output file * -* * -********************************************************************** - open (unit=47,file='output.pdb',status='unknown') - do i1=1,na - write (47,412)'ATOM ',i1,qa(i1),pepname,ipeptide,c(i1,1), - $c(i1,2),c(i1,3),1.0,2.2,qa(i1) - end do - write (47,*) 'TER' - write (47,*) 'END' - close (47) - - if (nsurp.eq.0) then - if (kx.gt.0.or.ky.gt.0.or.kz.gt.0) then - qrtemp=qr -********************************************************************** -* * -* Write crystal structure including periodic images * -* * -********************************************************************** -* mux=(1+kx+kx) -* muy=(1+ky+ky) -* muz=(1+kz+kz) -* qr='F' -* write (86,'(2x,a1,1x,a60)')qr,qmol -* qr=qrtemp -* write (86,'(3f10.4)')mux*axiss(1),muy*axiss(2),muz*axiss(3) -* write (86,'(3f10.4)')angle(1),angle(2),angle(3) -* do i1=1,na -* write (86,'(i4,1x,a2,3x,3d22.15)')i1,qa(i1),(c(i1,i2),i2=1,3) -* end do -* nhulp=na+1 -* do k1=-kx,kx -* do k2=-ky,ky -* do k3=-kz,kz -* if (k1.ne.0.or.k2.ne.0.or.k3.ne.0) then -* do i1=1,na -* cx=c(i1,1)+k1*tm11 -* cy=c(i1,2)+k1*tm21+k2*tm22 -* cz=c(i1,3)+k1*tm31+k2*tm32+k3*tm33 -* write (86,'(i4,1x,a2,3x,3d22.15)')nhulp,qa(i1),cx,cy,cz -* nhulp=nhulp+1 -* end do -* end if -* end do -* end do -* end do -* write (86,*) -********************************************************************** -* * -* Write crystal structure with extra unit cells * -* * -********************************************************************** - mux=1+iexx - muy=1+iexy - muz=1+iexz - qr='F' - write (85,'(2x,a1,1x,a60)')qr,qmol - qr=qrtemp - write (85,'(3f10.4)')mux*axiss(1),muy*axiss(2),muz*axiss(3) - write (85,'(3f10.4)')angle(1),angle(2),angle(3) - do i1=1,na - write (85,'(i4,1x,a2,3x,3d22.15)')i1,qa(i1),(c(i1,i2),i2=1,3) - end do - nhulp=na+1 - do k1=0,iexx - do k2=0,iexy - do k3=0,iexz - if (k1.ne.0.or.k2.ne.0.or.k3.ne.0) then - do i1=1,na - cx=c(i1,1)+k1*tm11 - cy=c(i1,2)+k1*tm21+k2*tm22 - cz=c(i1,3)+k1*tm31+k2*tm32+k3*tm33 - write (85,'(i4,1x,a2,3x,3d22.15)')nhulp,qa(i1),cx,cy,cz - nhulp=nhulp+1 - end do - end if - end do - end do - end do - write (85,*) - - end if - end if - end if - - end if - - if (ni.eq.0.or.ni.eq.2) then -********************************************************************** -* * -* Write ASCII trajectory file * -* * -********************************************************************** - if (ni.eq.0) open(unit=66,file=qmdfi//'.vel',status='unknown') - if (ni.eq.2) then - write (var,'(f7.4)')float(mdstep/nsav3)/1d4 - open (unit=66,file=qmdfi//var(3:7),status='unknown') - end if - write (66,500)axis(1),axis(2),axis(3) - write (66,550)angle(1),angle(2),angle(3) - write (66,600)na,((c(i,j),j=1,3),qlabel(i),i=1,na) - write (66,700)((vel(j,i),j=1,3),i=1,na) - write (66,800)((accel(j,i),j=1,3),i=1,na) - write (66,900)((aold(j,i),j=1,3),i=1,na) - write (66,1000)tempmd - write (66,1050) - close (66) - end if - if (ni.ne.2.and.iopt.eq.0) then - -C open (unit=68,file='xmolout',status='unknown',access='append') - write (68,1200)na - write (68,1300)qmol,mdstep+nit+nprevrun,estrc, - $axis(1),axis(2),axis(3),angle(1),angle(2),angle(3) - do i1=1,na - if (ixmolo.eq.0) write (68,1400)qa(i1),(c(i1,i2),i2=1,3) - if (ixmolo.eq.1) write (68,1400)qa(i1),(c(i1,i2),i2=1,3), - $(vel(i2,i1)/1e+10,i2=1,3),iag(i1,3+mbond) - if (ixmolo.eq.2) write (68,1401)qa(i1),(c(i1,i2),i2=1,3), - $iag(i1,3+mbond) - end do - close (68) - - if (itrout.ne.0) then -C open (unit=69,file='xmolout2',status='unknown',access='append') - write (69,1200)na - write (69,1300)qmol,mdstep+nit+nprevrun,estrc, - $axis(1),axis(2),axis(3),angle(1),angle(2),angle(3) - do i1=1,na - if (ixmolo.eq.0) write (69,1400)qa(i1),(cp(i1,i2),i2=1,3) - if (ixmolo.eq.1) write (69,1400)qa(i1),(cp(i1,i2),i2=1,3), - $(vel(i2,i1)/1e+10,i2=1,3),iag(i1,3+mbond) - if (ixmolo.eq.2) write (68,1401)qa(i1),(c(i1,i2),i2=1,3), - $iag(i1,3+mbond) - end do - close (69) - end if - - call molanal - end if -********************************************************************** -* * -* Generate BIOGRAF output-file * -* * -********************************************************************** - if ((ni.eq.1.and.iopt.eq.0).or.(ni.eq.1.and.iopt.eq.1.and. - $iflga.eq.1)) then - - if (qfileh.eq.' ') then - write (*,*)'Warning: no file name given; use Unknown' - qfileh='Unknown' - end if - qfile2=qfileh - if (imodfile.eq.0) then - istart=1 - qstrana1(1:25)=qfileh - call stranal(istart,iend,vout,iout,1) - qfile2=qfileh(istart:iend-1)//".bgf" - end if - call writebgf(90) - - if (imodfile.eq.1.or.iopt.eq.0) then - open (88,file=qfile2,status='unknown') - call writebgf(88) - close (88) - end if - - end if - - return -********************************************************************** -* * -* Format part * -* * -********************************************************************** - 100 format (i4,1x,a40,'Iteration:',i8,' #Bonds:',i4) - 101 format (i3,2x,a40) - 200 format (8i4,8f7.3) - 201 format (8i3) - 210 format (13i4,13f7.3) - 220 format (18i4,18f7.3) - 230 format (23i4,23f7.3) - 240 format (28i4,28f7.3) - 250 format (38i4,38f7.3) - 300 format (2x,a1,1x,a60) - 301 format (2x,a1,1x,f6.2,a60) - 302 format (2x,a1,1x,2f6.2,a60) - 310 format (2x,a1,1x,a60) - 320 format (3f10.4) - 400 format (i4,1x,a2,3x,3(d21.14,1x),1x,a5,1x,i5) - 410 format (i4,f12.6) - 412 format(A6,I5,1x,A2,3x,A3,2x,i4,4x,3f8.3,f6.2,f6.2,4x,2x,A6) - 500 format (1x,'Lattice parameters:',/(3f15.8)) - 550 format (3f15.8) - 600 format (i4,1x,'Atom coordinates (Angstrom):',/ - $(3d24.15,1x,a5)) - 700 format (1x,'Atom velocities (Angstrom/s):',/(3d24.15)) - 800 format (1x,'Atom accelerations (Angstrom/s**2):',/(3d24.15)) - 900 format (1x,'Previous atom accelerations:',/(3d24.15)) - 1000 format (1x,'MD-temperature (K):',/(1d24.15)) - 1050 format (1x,'Connections, bond orders and lone pairs:') - 1100 format (8i3,8f8.4) - 1200 format (i4) - 1300 format (a40,i6,f12.4,6f7.2) - 1400 format (a2,3f10.5,3f15.5,i6) - 1401 format (a2,3f10.5,i6) - 1500 format ('BIOGRF',i4) - 1600 format ('XTLGRF',i4) - 1700 format ('DESCRP ',a60) - 1800 format ('REMARK ',a60) - 1900 format ('FFIELD ',a40) - 2000 format ('RUTYPE ',a40) - 2100 format ('CRYSTX ',6f11.5) - 2200 format ('CELLS ',6i5) - 2300 format ('# At1 At2 R12 Force1 Force2 ', - $'dR12/dIteration(MD only)') - 2400 format ('BOND RESTRAINT ',2i4,f8.4,f8.2,f8.5,f10.7) - 2500 format ('# At1 At2 At3 Angle Force1 Force2', - $' dAngle/dIteration (MD only)') - 2600 format ('ANGLE RESTRAINT ',3i4,2f8.2,f8.4,f9.6) - 2700 format ('# At1 At2 At3 At3 Angle Force1 ', - $'Force2 dAngle/dIteration (MD only)') - 2800 format ('TORSION RESTRAINT ',4i4,2f8.2,f8.4,f9.6) - 2900 format ('FORMAT ATOM (a6,1x,i5,1x,a5,1x,a3,1x,a1,1x,a5,', - $'3f10.5,1x,a5,i3,i2,1x,f8.5)') - 3000 format ('HETATM',1x,i5,1x,a5,1x,a3,1x,a1,1x,a5,3f10.5,1x, - $a5,i3,i2,1x,f8.5) - 3100 format ('FORMAT CONECT (a6,12i6)') - 3200 format ('CONECT',12i6) - 3300 format ('UNIT ENERGY kcal') - 3400 format ('ENERGY',5x,f14.6) - 3500 format ('END') - end - -************************************************************************ -************************************************************************ - - subroutine readc - -************************************************************************ -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkcha.blk" -#include "cbkconst.blk" -#include "cbkdistan.blk" -#include "cbkinit.blk" -#include "cbktregime.blk" -#include "control.blk" -#include "opt.blk" -#include "small.blk" - - character*6 qident - character*20 qhulp -* dimension qident(100) -************************************************************************ -* * -* Read control file * -* * -************************************************************************ -c$$$c if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$c write (65,*) 'In readc' -c$$$c call timer(65) -c$$$c close (65) -c$$$c end if - if (mdstep.gt.0.or.nit.gt.0) nmmsav=nmm -************************************************************************ -* * -* Set default values * -* * -************************************************************************ - nreac=0 - axis1=200.0d0 - axis2=200.0d0 - axis3=200.0d0 - cutof2=0.001d0 - cutof3=0.300d0 - tsetor=298.0d0 - tset2=298.0d0 - pset=0.0d0 - tincr=0.0d0 - tstep=0.5d0 -* swa=0.0 !Moved to force field -* swb=12.5 !Moved to force field - taut=2.5d0 - taut2=2.5d0 - ndtau=50000 - taup=500.0d0 - vqnd=100.0d0 - errnh=1.0d0 - range=2.5d0 - maxstp=1000 - nequi=0 - nmethod=3 - ncha=3 - ncha2=1 - nchaud=1 - nvlist=25 - nrep1=5 - nsav=50 - icheck=0 - ivels=0 - itfix=0 - ncontrol=25 - noutpt=0 - napp=0 - nsurp=0 - ncons=2 - nrand=0 - nmm=0 - endpo=1.0d0 - endpo2=1.0d0 - nfc=50 - nsav2=50 - nmmax=50 - i5758=0 - parc1=1.0d0 - parc2=0.001d0 - icell=0 - ingeo=1 - ccpar=1.0005d0 - icelo2=0 - nrdd=0 - nrddf=200000 - nbiolab=0 -c ngeofor=0 - nincrop=0 - accerr=2.50d0 - vrange=2.50d0 - vlbora=5.00d0 - nsav3=1000 - nhop2=25 - nprevrun=0 - ndebug=0 - volcha=10.00d0 - ixmolo=0 - inpt=0 - iconne=0 - imolde=0 - ianaly=0 - icentr=0 - itrans=0 - itrout=0 - tpnrad=300.0d0 - ityrad=3 - iexx=1 - iexy=1 - iexz=1 - syscha=0.00d0 - inmov1=0 - inmov2=0 - vfield=0.00d0 - itstep=0 - ifreq=0 - isymm=1 - icpres=0 - delvib=0.0001d0 -c shock variables - shock_vel = 2.d0 ! impact velocity for shock simulations (nm/ps) - shock_z_sep = 10.0d0 ! separation z value to apply initial velocities in shocks - ishock_type = 0.0d0 ! shock type. 0: simple impact; 1: compressing c axis -c Hugoniostat variables - Hug_E0 = 0.d0 ! Reference energy - Hug_P0 = 0.d0 ! Reference pressure - Hug_V0 = 0.d0 ! Reference volume -c Shear flow simulations for viscosity - xImpVcm = 1.d0 ! velocity applied in shear simulations (in nm/ps), left half mover at -xImpVcm and right at +xImpVcm -c$$$************************************************************************ -c$$$* * -c$$$* Read control-file * -c$$$* * -c$$$************************************************************************ -c$$$ open (10,file='control',status='old') -c$$$ 10 read (10,'(a20)',end=20,err=30)qhulp -c$$$ if (qhulp(1:1).eq.'#') goto 10 -c$$$ read (qhulp,*,err=30)vhulp -c$$$ read (qhulp,'(8x,a6)',err=30)qident -c$$$ if (qident.eq.'Hug_V0') Hug_P0=vhulp -c$$$ if (qident.eq.'Hug_P0') Hug_V0=vhulp -c$$$ if (qident.eq.'Hug_E0') Hug_E0=vhulp -c$$$ if (qident.eq.'shea_v') xImpVcm=vhulp -c$$$ if (qident.eq.'shok_t') ishock_type=int(vhulp) -c$$$ if (qident.eq.'shok_z') shock_z_sep=vhulp -c$$$ if (qident.eq.'shok_v') shock_vel=vhulp -c$$$ if (qident.eq.'nreac') nreac=int(vhulp) -c$$$ if (qident.eq.'axis1') axis1=vhulp -c$$$ if (qident.eq.'axis2') axis2=vhulp -c$$$ if (qident.eq.'axis3') axis3=vhulp -c$$$ if (qident.eq.'cutof2') cutof2=vhulp -c$$$ if (qident.eq.'cutof3') cutof3=vhulp -c$$$ if (qident.eq.'mdtemp') tsetor=vhulp -c$$$ if (qident.eq.'mdtem2') tset2=vhulp -c$$$ if (qident.eq.'mdpres') pset=vhulp*0.001 -c$$$ if (qident.eq.'tincr') tincr=vhulp -c$$$ if (qident.eq.'tstep') tstep=vhulp -c$$$* if (qident.eq.'lowtap') swa=vhulp !Moved to force field -c$$$* if (qident.eq.'uptap') swb=vhulp !Moved to force field -c$$$ if (qident.eq.'tdamp1') taut=vhulp -c$$$ if (qident.eq.'tdamp2') taut2=vhulp -c$$$ if (qident.eq.'ntdamp') ndtau=int(vhulp) -c$$$ if (qident.eq.'pdamp1') taup=vhulp -c$$$ if (qident.eq.'tdhoov') vqnd=vhulp -c$$$ if (qident.eq.'achoov') errnh=vhulp/100.0 -c$$$ if (qident.eq.'range') range=vhulp -c$$$ if (qident.eq.'nmdit') maxstp=int(vhulp) -c$$$ if (qident.eq.'nmdeqi') nequi=int(vhulp) -c$$$ if (qident.eq.'imdmet') nmethod=int(vhulp) -c$$$ if (qident.eq.'icharg') ncha=int(vhulp) - nchaold=ncha -c$$$ if (qident.eq.'ichaen') ncha2=int(vhulp) -c$$$ if (qident.eq.'ichupd') nchaud=int(vhulp) -c$$$ if (qident.eq.'iout1') nrep1=int(vhulp) -c$$$ if (qident.eq.'iout2') nsav=int(vhulp) -c$$$ if (qident.eq.'icheck') ntest=int(vhulp) -c$$$ if (qident.eq.'ivels') nvel=int(vhulp) -c$$$ if (qident.eq.'itfix') ntscale=int(vhulp) -c$$$ if (qident.eq.'irecon') ncontrol=int(vhulp) -c$$$ if (qident.eq.'iout3') noutpt=int(vhulp) -c$$$ if (qident.eq.'iappen') napp=int(vhulp) -c$$$ if (qident.eq.'isurpr') nsurp=int(vhulp) -c$$$ if (qident.eq.'itdmet') ncons=int(vhulp) -c$$$ if (qident.eq.'iravel') nrand=int(vhulp) -c$$$ if (qident.eq.'imetho') nmm=int(vhulp) -c$$$ if (qident.eq.'endmm') endpo=vhulp - endpoold=endpo -c$$$ if (qident.eq.'endmd') endpo2=vhulp -c$$$ if (qident.eq.'imaxmo') nfc=int(vhulp) - nfcold=nfc -c$$$ if (qident.eq.'iout4') nsav2=int(vhulp) -c$$$ if (qident.eq.'imaxit') nmmax=int(vhulp) - nmmaxold=nmmax -c$$$ if (qident.eq.'iout5') i5758=int(vhulp) -c$$$ if (qident.eq.'parsca') parc1=vhulp -c$$$ if (qident.eq.'parext') parc2=vhulp -c$$$ if (qident.eq.'icelop') icell=int(vhulp) - icellold=icell -c$$$ if (qident.eq.'igeopt') ingeo=int(vhulp) -c$$$ if (qident.eq.'celopt') ccpar=vhulp -c$$$ if (qident.eq.'icelo2') icelo2=int(vhulp) - icelo2old=icelo2 -c$$$ if (qident.eq.'ideve1') nrdd=int(vhulp) -c$$$ if (qident.eq.'ideve2') nrddf=int(vhulp) -c$$$ if (qident.eq.'ibiola') nbiolab=int(vhulp) -c$$$c if (qident.eq.'igeofo') ngeofor=int(vhulp) -c$$$ if (qident.eq.'iincop') nincrop=int(vhulp) -c$$$ if (qident.eq.'accerr') accincr=vhulp -c$$$ if (qident.eq.'iout6') nsav3=int(vhulp) -c$$$ if (qident.eq.'irten') nhop2=int(vhulp) -c$$$ if (qident.eq.'npreit') nprevrun=int(vhulp) -c$$$ if (qident.eq.'idebug') ndebug=int(vhulp) -c$$$ if (qident.eq.'volcha') volcha=vhulp -c$$$ if (qident.eq.'ixmolo') ixmolo=int(vhulp) -c$$$ if (qident.eq.'inpt') inpt=int(vhulp) -c$$$ if (qident.eq.'iconne') iconne=int(vhulp) -c$$$ if (qident.eq.'imolde') imolde=int(vhulp) -c$$$ if (qident.eq.'ianaly') ianaly=int(vhulp) -c$$$ if (qident.eq.'icentr') icentr=int(vhulp) -c$$$ if (qident.eq.'itrans') itrans=int(vhulp) -c$$$ if (qident.eq.'itrout') itrout=int(vhulp) -c$$$ if (qident.eq.'nvlist') nvlist=int(vhulp) -c$$$ if (qident.eq.'vrange') vrange=vhulp -c$$$ if (qident.eq.'vlbora') vlbora=vhulp -c$$$ if (qident.eq.'tpnrad') tpnrad=vhulp -c$$$ if (qident.eq.'ityrad') ityrad=int(vhulp) -c$$$ if (qident.eq.'iexx') iexx=int(vhulp) -c$$$ if (qident.eq.'iexy') iexy=int(vhulp) -c$$$ if (qident.eq.'iexz') iexz=int(vhulp) -c$$$ if (qident.eq.'syscha') syscha=vhulp -c$$$ if (qident.eq.'inmov1') inmov1=int(vhulp) -c$$$ if (qident.eq.'inmov2') inmov2=int(vhulp) -c$$$ if (qident.eq.'itstep') itstep=int(vhulp) -c$$$ if (qident.eq.'ifreq') ifreq=int(vhulp) -c$$$ if (qident.eq.'isymm') isymm=int(vhulp) -c$$$ if (qident.eq.'icpres') icpres=int(vhulp) -c$$$ if (qident.eq.'delvib') delvib=vhulp -c$$$ goto 10 -c$$$ 20 continue - close (10) - axis(1)=axis1 - axis(2)=axis2 - axis(3)=axis3 - if (axiss(1).gt.zero) then - axis(1)=axiss(1) - axis(2)=axiss(2) - axis(3)=axiss(3) - end if - if (tincr.lt.0.0001.and.tincr.gt.-0.0001) tset=tsetor - iequi=1 - if (nequi.gt.0) iequi=0 - if (iopt.eq.1.and.napp.eq.1) then - stop 'No fort.7 and fort.8 append with iopt=1 !' - end if - if (mdstep.gt.0.or.nit.gt.0) nmm=nmmsav - if (mdstep.gt.0.and.itstep.eq.1) then - tstepmax=tstep - tstep=tstep*(tsetor/tempmd) - if (tstep.gt.tstepmax) tstep=tstepmax - end if - tstep=1.0d-15*tstep - taus=taut - taut=1.0d-15*taut - taut2=1.0d-15*taut2 - taup=1.0d-15*taup - ts2=tstep/2.0 - ts22=tstep*ts2 - return - 30 continue - write (*,*)'Error reading control-file' - stop 'Error reading control-file' -************************************************************************ -* * -* Format part * -* * -************************************************************************ - 1050 format (f7.3) - 1055 format (f7.4) - 1056 format (f9.4) - 1060 format (i8) - 1070 format (f7.5) - end -************************************************************************ -************************************************************************ - - subroutine staint - -************************************************************************ -#include "cbka.blk" -#include "cbkdcell.blk" -#include "cbkqa.blk" -#include "control.blk" -#include "small.blk" -#include "cbkc.blk" -#include "cbkconst.blk" - dimension bvt(nat,4) -************************************************************************ -* * -* Generate cartesian coordinates from internal coordinate input * -* * -************************************************************************ -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In staint' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - k=0 - 10 read (3,1200,end=20,err=20)(ijk(k+1,k1),k1=1,3),k2,qa(k+1), - $bvt(k+1,3),bvt(k+1,2),bvt(k+1,1) - qlabel(k+1)=qa(k+1) - qresi1(k+1)=' ' - qresi2(k+1)=' ' - qresi3(k+1)=' ' - qffty(k+1)=' ' - if (k2.ne.k+1) then - write (*,*)'Wrong order in internal coordinates at atom:',k2 - goto 20 -* stop 'Wrong order in internal coordinates' - end if - k=k+1 - if (k.gt.nat) then - write (*,*)na,nat - stop 'Maximum number of atoms exceeded' - end if - goto 10 - 20 continue - na=k - -************************************************************************ -* * -* CALCULATION OF CARTESIAN COORDINATES FROM INTERNAL COORDINAATES * -* * -************************************************************************ - - 12 C(1,1)=ZERO - C(1,2)=ZERO - C(1,3)=ZERO - C(2,1)=BVT(2,1) - C(2,2)=ZERO - C(2,3)=ZERO - HR=(BVT(3,2)-90.0D0)*DGRRDN - C(3,1)=C(2,1)+BVT(3,1)*SIN(HR) - C(3,2)=BVT(3,1)*COS(HR) - C(3,3)=ZERO - DO 32 K1=4,NA - J=IJK(K1,2) - KB=K1-1 - XH=C(J,1) - YH=C(J,2) - ZH=C(J,3) - DO 13 K2=1,KB - C(K2,1)=C(K2,1)-XH - C(K2,2)=C(K2,2)-YH - C(K2,3)=C(K2,3)-ZH - DO 13 K3=1,3 - 13 IF (ABS(C(K2,K3)).LT.1.0D-15) C(K2,K3)=1.0D-15 - K=IJK(K1,3) - P2=C(K,2)*C(K,2)+C(K,3)*C(K,3) - IF (P2.NE.ZERO) THEN - P=SQRT(P2) - Q=SQRT(C(K,1)*C(K,1)+P2) - SA=C(K,2)/P - CA=C(K,3)/P - SB=-C(K,1)/Q - CB=P/Q - ELSE - SA=ZERO - CA=ONE - SB=ONE - CB=ZERO - ENDIF - DO 16 K2=1,KB - AZ=C(K2,1) - BZ=C(K2,2) - C(K2,1)=AZ*CB+BZ*SB*SA+C(K2,3)*SB*CA - C(K2,2)=BZ*CA-C(K2,3)*SA - 16 C(K2,3)=-AZ*SB+BZ*CB*SA+C(K2,3)*CB*CA - IF (C(K,3).LE.ZERO) THEN - DO 17 K2=1,KB - 17 C(K2,3)=-C(K2,3) - ENDIF - I=IJK(K1,1) - IF (1.0D5*ABS(C(I,1)).LE.ABS(C(I,2))) THEN - T1=HALF*PI - ELSE - YX=ABS(C(I,2)/C(I,1)) - T1=ATAN(YX) - ENDIF - IF (C(I,1).GE.ZERO.AND.C(I,2).LT.ZERO) T1=TWO*PI-T1 - IF (C(I,1).LT.ZERO.AND.C(I,2).GE.ZERO) T1=PI-T1 - IF (C(I,1).LT.ZERO.AND.C(I,2).LT.ZERO) T1=T1+PI - DO 31 K2=1,KB - IF (C(K2,1).EQ.ZERO.AND.C(K2,2).EQ.ZERO) GOTO 31 - IF (1.0D5*ABS(C(K2,1)).LT.ABS(C(K2,2))) THEN - T2=HALF*PI - ELSE - YX=ABS(C(K2,2)/C(K2,1)) - T2=ATAN(YX) - ENDIF - IF (C(K2,1).GE.ZERO.AND.C(K2,2).LT.ZERO) T2=TWO*PI-T2 - IF (C(K2,1).LT.ZERO.AND.C(K2,2).GE.ZERO) T2=PI-T2 - IF (C(K2,1).LT.ZERO.AND.C(K2,2).LT.ZERO) T2=T2+PI - T3=T2-T1 - IF (T3.LT.ZERO)T3=T3+TWO*PI - RZ=SQRT(C(K2,1)*C(K2,1)+C(K2,2)*C(K2,2)) - C(K2,1)=RZ*COS(T3) - C(K2,2)=RZ*SIN(T3) - 31 CONTINUE - HR=(BVT(K1,2)-90.0D0)*DGRRDN - HT=BVT(K1,3)*DGRRDN - CHR=COS(HR) - C(K1,1)=BVT(K1,1)*CHR*COS(HT) - C(K1,2)=BVT(K1,1)*CHR*SIN(HT) - 32 C(K1,3)=C(IJK(K1,3),3)+BVT(K1,1)*SIN(HR) - - return - 1200 FORMAT(4I3,1X,A2,3F10.5,4X,I1,F10.5) - end -************************************************************************ -************************************************************************ - - subroutine outint - -************************************************************************ -#include "cbka.blk" -#include "cbkabo.blk" -#include "cbkbo.blk" -#include "cbkconst.blk" -#include "cbkia.blk" -#include "cbkinit.blk" -#include "cbknubon2.blk" -#include "cbkqa.blk" -#include "cbktregime.blk" -#include "control.blk" -#include "small.blk" -#include "cbksrtbon1.blk" -************************************************************************ -* * -* Output internal coordinates * -* * -************************************************************************ - dimension dvdc(3,3),dargdc(3,3) -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In outint' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - write (91,50)qmol - open (82,file='output.MOP',status='unknown') - write (82,*) - write (82,'(a40)')qmol - write (82,*) - close (82) - -* IF (NMOLO.GT.1) THEN -* WRITE(6,*)' OUTPUT INTERNAL COORDINATES NOT POSSIBLE FOR ', -* $'CALCULATION ON MORE THAN ONE MOLECULE' -* RETURN -* END IF - -************************************************************************ -* * -* Output of internal coordinates. * -* First 3 atoms of other input file. * -* * -************************************************************************ - N1=1 - N2=2 - N3=3 -C open (82,file='output.MOP',status='unknown',access='append') - write(91,100)N1,qa(n1) - write(82,'(2x,a2,f12.6,i3,f12.6,i3,f12.6,i3,1x,3i4)')qa(n1), - $zero,nzero,zero,nzero,zero,nzero,nzero,nzero,nzero - call dista2(n1,n2,rr,dx,dy,dz) - write(91,200)N1,N2,qa(n2),RR - write(82,'(2x,a2,f12.6,i3,f12.6,i3,f12.6,i3,1x,3i4)')qa(n2), - $rr,none,zero,nzero,zero,nzero,n1,nzero,nzero - close (82) - - call dista2(n2,n3,rr,dx,dy,dz) - hv=zero - call calvalres(n1,n2,n3,arg,hv,dvdc,dargdc) - WRITE(91,300)N1,N2,N3,qa(n3),rdndgr*HV,RR -C open (82,file='output.MOP',status='unknown',access='append') - write(82,'(2x,a2,f12.6,i3,f12.6,i3,f12.6,i3,1x,3i4)')qa(n3), - $rr,none,rdndgr*hv,none,zero,nzero,n2,n1,nzero - close (82) - - naih=3 - - do i1=naih+1,na - bomax=zero - j1=0 - do i2=1,ia(i1,2) - iob=ia(i1,2+i2) - ncubo=nubon2(i1,i2) - if (bo(ncubo).gt.bomax.and.iob.lt.i1) then - bomax=bo(ncubo) - j1=iob - end if - end do - if (j1.eq.0) j1=i1-1 - call dista2(j1,i1,rr,dx,dy,dz) - - bomax=zero - j2=0 - do i2=1,ia(j1,2) - iob=ia(j2,2+i2) - ncubo=nubon2(j1,i2) - if (bo(ncubo).gt.bomax.and.iob.lt.i1.and. - $abo(iob).gt.bo(ncubo)+0.2) then - bomax=bo(ncubo) - j2=iob - end if - end do - if (j2.eq.0) j2=i1-2 - if (j2.eq.j1) j2=j2+1 - - call calvalres(j2,j1,i1,arg,hh,dvdc,dargdc) - - bomax=zero - j3=0 - do i2=1,ia(j2,2) - iob=ia(j2,2+i2) - ncubo=nubon2(j2,i2) - if (bo(ncubo).gt.bomax.and.iob.lt.i1.and.iob.ne.j1) then - bomax=bo(ncubo) - j3=iob - end if - end do - if (j3.eq.0) j3=i1-3 - if (j3.eq.j2.and.j3.ne.j1-1) j3=j3+1 - if (j3.eq.j2.and.j3.ne.j1-2) j3=j3+2 - if (j3.eq.j1.and.j3.ne.j2-1) j3=j3+1 - if (j3.eq.j1.and.j3.ne.j2-2) j3=j3+2 - - call caltor(j3,j2,j1,i1,ht) - - write(91,400)j3,j2,j1,i1,qa(i1),ht,rdndgr*hh,rr -C open (82,file='output.MOP',status='unknown',access='append') - write(82,'(2x,a2,f12.6,i3,f12.6,i3,f12.6,i3,1x,3i4)')qa(i1), - $rr,none,rdndgr*hh,none,ht,none,j1,j2,j3 - close (82) - end do - - close(82) - return - 50 format (' I',2x,a60) - 100 FORMAT(9X,I3,1x,a2) - 200 FORMAT(6X,2I3,1x,a2,20X,F10.5) - 300 FORMAT(3X,3I3,1x,a2,10X,2F10.5) - 400 FORMAT(4I3,1x,a2,3F10.5) - - end -************************************************************************ -************************************************************************ - - subroutine outres - -************************************************************************ -#include "cbka.blk" -#include "cbkbo.blk" -#include "cbkch.blk" -#include "cbkd.blk" -#include "cbkenergies.blk" -#include "cbkh.blk" -#include "cbkimove.blk" -#include "cbkrbo.blk" -#include "cbktorang.blk" -#include "cbktorsion.blk" -#include "cbktregime.blk" -#include "cbkvalence.blk" -#include "control.blk" -#include "opt.blk" -#include "small.blk" -#include "cbkinit.blk" - -************************************************************************ -* * -* Output molecular data * -* * -************************************************************************ - dimension isort(100),iad1(100),iad2(100),iad3(100),iad4(100) - character*60 qm2 -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In outres' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - read (9,100,end=50)idata,qm2 -* if (qm2.ne.qmol) then -* write (*,*)'Wrong molecule in outres-file' -* write (*,*)qmol -* write (*,*)qm2 -* return -* end if - do 25 i1=1,idata - read (9,200)isort(i1),iad1(i1),iad2(i1),iad3(i1),iad4(i1) - ndata2=ndata2+1 - - if (isort(i1).eq.1) then -* do i2=1,nbon -* if (ib(i2,2).eq.iad1(i1).and.ib(i2,3).eq.iad2(i1)) then -* if (iopt.ne.1) write (81,*)iad1(i1),iad2(i1),rbo(i2) -* caldat(ndata2)=rbo(i2) -* end if -* end do - call dista2(iad1(i1),iad2(i1),dish,dx,dy,dz) - write (81,*)iad1(i1),iad2(i1),dish - caldat(ndata2)=dish - end if - - if (isort(i1).eq.2) then - do i2=1,nval - if (iv(i2,2).eq.iad1(i1).and.iv(i2,3).eq.iad2(i1).and. - $iv(i2,4).eq.iad3(i1)) then - if (iopt.ne.1) write (81,*)iad1(i1),iad2(i1), - $iad3(i1),h(i2)*rdndgr - caldat(ndata2)=h(i2)*rdndgr - end if - end do - end if - - if (isort(i1).eq.3) then - do i2=1,ntor - if (it(i2,2).eq.iad1(i1).and.it(i2,3).eq.iad2(i1).and. - $it(i2,4).eq.iad3(i1).and.it(i2,5).eq.iad4(i1)) then - if (iopt.ne.1) write (81,*)iad1(i1),iad2(i1),iad3(i1),iad4(i1), - $abs(thg(i2)) - caldat(ndata2)=abs(thg(i2)) - end if - end do - end if - - if (isort(i1).eq.4) then - if (iopt.ne.1) write (81,*)estrmin - caldat(ndata2)=estrmin - end if - - if (isort(i1).eq.5) then - if (iopt.ne.1) write (81,*)estrmin - caldat(ndata2)=estrmin - end if - - if (isort(i1).eq.6) then - if (iopt.ne.1) write (81,*)iad1(i1),axiss(iad1(i1)) - caldat(ndata2)=axiss(iad1(i1)) - end if - - if (isort(i1).eq.7) then - if (iopt.ne.1) write (81,*)eco - caldat(ndata2)=eco - end if - - if (isort(i1).eq.8) then - do i2=1,nbon - if (ib(i2,2).eq.iad1(i1).and.ib(i2,3).eq.iad2(i1)) then - if (iopt.ne.1) write (81,*)iad1(i1),iad2(i1),bo(i2) - caldat(ndata2)=bo(i2) - end if - end do - end if - - if (isort(i1).eq.9) then - if (iopt.ne.1) write (81,*)ch(iad1(i1)) - caldat(ndata2)=ch(iad1(i1)) - end if - - if (isort(i1).eq.10) then - rmsg=0.0 - nmovh=0 - do i2=1,na - do i3=1,3 - rmsg=rmsg+imove(i2)*d(i3,i2)*d(i3,i2) - nmovh=nmovh+imove(i2) - end do - end do - rmsg=sqrt(rmsg/float(nmovh*3)) - - if (iopt.ne.1) write (81,*)rmsg - caldat(ndata2)=rmsg - end if - - if (isort(i1).eq.11) then - if (iopt.ne.1) write (81,*)1000.0*pressu - caldat(ndata2)=1000.0*pressu - end if - - 25 continue - - 50 return -************************************************************************ -* * -* Format part * -* * -************************************************************************ - 100 format (i3,a60) - 200 format (5i3) - end -************************************************************************ -************************************************************************ - - subroutine readgeo - -************************************************************************ -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkconst.blk" -#include "cbkdistan.blk" -#include "cbkinit.blk" -#include "cbkqa.blk" -#include "cbksrtbon1.blk" -#include "cbktregime.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "small.blk" - character*80 qromb - character*25 qfileh -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In readgeo' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - - if (ngeofor.eq.-1) return - -********************************************************************** -* * -* Read in system geometry * -* * -********************************************************************** - if (ngeofor.eq.0) then - call readdelphi (qfileh,iend,naold) - namov=na - end if - - if (ngeofor.eq.1) then - call readbgf(iend,naold) - end if - - - - if (ngeofor.eq.2) then -********************************************************************** -* * -* Read in free format (xmol) geometry * -* * -********************************************************************** - qr='1' - read (3,'(i6)')na - namov=na - read (3,'(a60)')qmol - do i1=1,na - read (3,'(a80)')qromb - ifirstchar=80 - do i2=1,80 - if (qromb(i2:i2).ne.' '.and.i2.lt.ifirstchar) ifirstchar=i2 - end do - read (qromb(ifirstchar:80),'(a2)')qa(i1) - read (qromb(ifirstchar+2:80),*)c(i1,1),c(i1,2),c(i1,3) - qlabel(i1)=qa(i1) - qresi1(i1)=' ' - qresi2(i1)=' ' - qresi3(i1)=' ' - qffty(i1)=' ' - end do - ibity=1 - axiss(1)=-1.0 - end if - - - if (ngeofor.eq.3) then -********************************************************************** -* * -* Read in ChemDraw CC1-file * -* * -********************************************************************** - qr='1' - read (3,*)na - namov=na - read (3,'(a60)')qmol - do i1=1,na - read (3,'(2x,a2,5x,3f12.6)')qa(i1),c(i1,1),c(i1,2),c(i1,3) - end do - end if - - if (ngeofor.eq.4) then -********************************************************************** -* * -* Read in .pdb-format * -* * -********************************************************************** - qr='C' - call readpdb(iendf) - namov=na - ibity=1 - axiss(1)=-1.0 - qfile(nprob)=qmol - if (iendf.eq.1) stop 'End-of-file while reading in .pdb' - end if - -********************************************************************** -* * -* Set up periodic system * -* * -********************************************************************** - axis(1)=axiss(1) - axis(2)=axiss(2) - axis(3)=axiss(3) - angle(1)=angles(1) - angle(2)=angles(2) - angle(3)=angles(3) - if (axiss(1).lt.zero) then - axis(1)=axis1 - axis(2)=axis2 - axis(3)=axis3 - angle(1)=90.0 - angle(2)=90.0 - angle(3)=90.0 - end if - halfa=angle(1)*dgrrdn - hbeta=angle(2)*dgrrdn - hgamma=angle(3)*dgrrdn - sinalf=sin(halfa) - cosalf=cos(halfa) - sinbet=sin(hbeta) - cosbet=cos(hbeta) - cosphi=(cos(hgamma)-cosalf*cosbet)/(sinalf*sinbet) - if (cosphi.gt.1.0) cosphi=1.0 - sinphi=sqrt(one-cosphi*cosphi) - tm11=axis(1)*sinbet*sinphi - tm21=axis(1)*sinbet*cosphi - tm31=axis(1)*cosbet - tm22=axis(2)*sinalf - tm32=axis(2)*cosalf - tm33=axis(3) - - return - end -************************************************************************ -************************************************************************ - - subroutine readdelphi (qfileh,iend,naold) - -************************************************************************ -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkconst.blk" -#include "cbkd.blk" -#include "cbkdcell.blk" -#include "cbkdistan.blk" -#include "cbkff.blk" -#include "cbkh.blk" -#include "cbkinit.blk" -#include "cbkqa.blk" -#include "cbkrestr.blk" -#include "cbksrtbon1.blk" -#include "cbktregime.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "opt.blk" -#include "small.blk" - character*25 qfileh -********************************************************************** -* * -* Read in geometries in Delphi-format (xyz) * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In readdelphi' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - - if (imodfile.eq.1) then - open (3,file=qfileh,status='old') - end if - nmmax=nmmaxold - nfc=nfcold - ibity=1 - iredo=1 - endpo=endpoold - icell=icellold - icelo2=icelo2old - iend=0 - read (3,1000,end=900)qr,qmol -********************************************************************** -* * -* Read in restraint information (optional) * -* * -********************************************************************** - if (qr.eq.'R'.or.qr.eq.'P'.or.qr.eq.'X') then - qmol=qmol(7:60) - qmolset(nuge)=qmol - read (18,1070,end=4,err=4) nrestra - do i1=1,nrestra - read (18,1090)irstra(i1,1),irstra(i1,2),rrstra(i1),vkrstr(i1), - $vkrst2(i1),rrcha(i1) - end do - 4 continue - end if -********************************************************************** -* * -* Read in torsion restraint information (optional) * -* * -********************************************************************** - if (qr.eq.'T'.or.qr.eq.'X') then - if (qr.eq.'T') then - qmol=qmol(7:60) - qmolset(nuge)=qmol - end if - read (28,1070,end=6,err=6) nrestrat - do i1=1,nrestrat - read (28,1091)irstrat(i1,1),irstrat(i1,2),irstrat(i1,3), - $irstrat(i1,4),trstra(i1),vkrt(i1),vkr2t(i1),rtcha(i1) - end do - 6 continue - end if -********************************************************************** -* * -* Read in valency angle restraint information (optional) * -* * -********************************************************************** - if (qr.eq.'V') then - qmol=qmol(7:60) - qmolset(nuge)=qmol - read (38,1070,end=7,err=7) nrestrav - do i1=1,nrestrav - read (38,1092)irstrav(i1,1),irstrav(i1,2),irstrav(i1,3), - $vrstra(i1),vkrv(i1),vkr2v(i1) - end do - 7 continue - end if -********************************************************************** -* * -* Read in geometry * -* * -********************************************************************** - ibh2=0 - iequi=1 - iexco=0 - if (nequi.gt.0) iequi=0 - axiss(1)=-1.0 - - if (qr.eq.'O'.or.qr.eq.'L') stop 'Not xyz-format' - - if (qr.eq.'I') then !Delphi internal coordinates - if (nsurp.ge.2) stop 'Int.coordinates only with 1 gemetry' - call staint - goto 20 - end if - - if (qr.eq.'B') then !Previous geometry with volume reduction - read (3,*) - vred=(1.0-0.01*volcha)**(0.33333) - iexco=1 - na=naold - do i1=1,3 - qmol=qmol - axiss(i1)=vred*axis(i1) - angles(i1)=angle(i1) - do i2=1,na - c(i2,i1)=vred*c(i2,i1) - end do - end do - - halfa=angles(1)*dgrrdn - hbeta=angles(2)*dgrrdn - hgamma=angles(3)*dgrrdn - sinalf=sin(halfa) - cosalf=cos(halfa) - sinbet=sin(hbeta) - cosbet=cos(hbeta) - cosphi=(cos(hgamma)-cosalf*cosbet)/(sinalf*sinbet) - if (cosphi.gt.1.0) cosphi=1.0 - sinphi=sqrt(one-cosphi*cosphi) - tm11=axiss(1)*sinbet*sinphi - tm21=axiss(1)*sinbet*cosphi - tm31=axiss(1)*cosbet - tm22=axiss(2)*sinalf - tm32=axiss(2)*cosalf - tm33=axiss(3) - kx=int(2.0*swb/tm11) - ky=int(2.0*swb/tm22) - kz=int(2.0*swb/tm33) - ibity=2 - - goto 20 - end if - - if (qr.eq.'S') then !Previous geometry with volume expansion - read (3,*) - vexp=(1.0+0.01*volcha)**(0.33333) - na=naold - iexco=1 - do i1=1,3 - qmol=qmol - axiss(i1)=vexp*axis(i1) - angles(i1)=angle(i1) - do i2=1,na - c(i2,i1)=vexp*c(i2,i1) - end do - end do - - halfa=angles(1)*dgrrdn - hbeta=angles(2)*dgrrdn - hgamma=angles(3)*dgrrdn - sinalf=sin(halfa) - cosalf=cos(halfa) - sinbet=sin(hbeta) - cosbet=cos(hbeta) - cosphi=(cos(hgamma)-cosalf*cosbet)/(sinalf*sinbet) - if (cosphi.gt.1.0) cosphi=1.0 - sinphi=sqrt(one-cosphi*cosphi) - tm11=axiss(1)*sinbet*sinphi - tm21=axiss(1)*sinbet*cosphi - tm31=axiss(1)*cosbet - tm22=axiss(2)*sinalf - tm32=axiss(2)*cosalf - tm33=axiss(3) - kx=int(2.0*swb/tm11) - ky=int(2.0*swb/tm22) - kz=int(2.0*swb/tm33) - ibity=2 - - goto 20 - end if - - if (qr.eq.'F'.or.qr.eq.'Y'.or.qr.eq.'3'.or.qr.eq.'5'. - $or.qr.eq.'P') then - kx=0 - ky=0 - kz=0 - ibity=2 - read(3,1005)axiss(1),axiss(2),axiss(3) - read(3,1005)angles(1),angles(2),angles(3) - - halfa=angles(1)*dgrrdn - hbeta=angles(2)*dgrrdn - hgamma=angles(3)*dgrrdn - sinalf=sin(halfa) - cosalf=cos(halfa) - sinbet=sin(hbeta) - cosbet=cos(hbeta) - cosphi=(cos(hgamma)-cosalf*cosbet)/(sinalf*sinbet) - if (cosphi.gt.1.0) cosphi=1.0 - sinphi=sqrt(one-cosphi*cosphi) - tm11=axiss(1)*sinbet*sinphi - tm21=axiss(1)*sinbet*cosphi - tm31=axiss(1)*cosbet - tm22=axiss(2)*sinalf - tm32=axiss(2)*cosalf - tm33=axiss(3) - kx=int(2.0*swb/tm11) - ky=int(2.0*swb/tm22) - kz=int(2.0*swb/tm33) - - end if - - if (qr.eq.'M'.or.qr.eq.'A') then - nmmsav=nmm - nmm=2 - end if - - if (qr.eq.'A') nmm=1 - - if (qr.eq.'D') then - endpo=endpo/25 - nmmax=nmmax*5 - qruid='HIGH PRECISION' - end if - - if (qr.eq.'H') then - nmmax=nmmax/10 - qruid='LOW PRECISION' - end if - - if (qr.eq.'1'.or.qr.eq.'5') then - nmm=1 - nmmax=1 - qruid='SINGLE POINT' - end if - - if (qr.eq.'Y') then - icell=0 - qruid='NO CELL OPT' - end if - - 10 read (3,1100,end=20,err=20)ir,qa(na+1),(c(na+1,i2),i2=1,3) - qlabel(na+1)=qa(na+1) - qresi1(na+1)=' ' - qresi2(na+1)=' ' - qresi3(na+1)=' ' - qffty(na+1)=' ' - if (ir.eq.0) goto 20 - na=na+1 - - if (na.gt.nat) then - write (*,*)'Maximum number of atom exceeded ',na,nat - stop 'Maximum number of atoms exceeded' - end if - - goto 10 - 20 continue - - if (imodfile.eq.1) close (3) - - return - 900 iend=1 - return - 1000 format (2x,a1,1x,a60) - 1005 format (3f10.4) - 1070 format (i3) - 1090 format (2i4,2f8.4,f8.6,f10.8) - 1091 format (4i4,2f8.4,3f8.6) - 1092 format (3i4,2f8.4,2f8.6) - 1100 format (i4,1x,a2,3x,3d22.15,1x,a5,1x,i5) - end -************************************************************************ -************************************************************************ - - subroutine readbgf(iendf,naold) - -************************************************************************ -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkcha.blk" -#include "cbkcharmol.blk" -#include "cbkconst.blk" -#include "cbkd.blk" -#include "cbkdcell.blk" -#include "cbkdistan.blk" -#include "cbkenergies.blk" -#include "cbkff.blk" -#include "cbkh.blk" -#include "cbkimove.blk" -#include "cbkinit.blk" -#include "cbkqa.blk" -#include "cbkrestr.blk" -#include "cbksrtbon1.blk" -#include "cbktregime.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "opt.blk" -#include "small.blk" - character*80 qromb - character*2 qrom - character*5 quen - character*5 qlabhulp - character*25 qfileh - character*200 qhulp -********************************************************************** -* * -* Read in BIOGRAF-geometry * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In readbgf' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - - iendf=0 - ienread=0 - iredo=0 - qremark(1)=' ' - enmol=zero - formol=zero -c$$$ if (imodfile.eq.1) then -c$$$ open (3,file=qfileh,status='old') -c$$$ end if - open (3,file='fort.3',status='old') - read (3,'(a40)',end=900)qromb - ibity=0 - if (qromb(1:6).eq.'BIOGRF') ibity=1 - if (qromb(1:6).eq.'XTLGRF') ibity=2 - if (ibity.eq.0) then - write (*,*)qromb(1:6) - stop 'Unknown Biograf-file' - end if - read (qromb,'(6x,i4)')ibgfversion - if (ibity.eq.1) qr='C' - if (ibity.eq.2) qr='F' - iremark=0 - iformat=0 - iline=0 - iexco=0 - iruid=1 - vvol=1.0 - nmcharge=0 - nmmax=nmmaxold - nfc=nfcold - ncha=nchaold - endpo=endpoold - icell=icellold - icelo2=icelo2old - axiss(1)=-1.0 - - 30 read (3,'(a200)',end=46,err=40)qhulp - qstrana1(1:200)=qhulp - iline=iline+1 - irecog=0 - - if (qhulp(1:6).eq.'DESCRP') then - read (qhulp,'(7x,a40)',end=46,err=46)qmol - irecog=1 - end if - - if (qhulp(1:6).eq.'REMARK') then - if (iremark.lt.20) iremark=iremark+1 - read (qhulp,'(7x,a40)',end=46,err=46)qremark(iremark) - irecog=1 - end if - - if (qhulp(1:6).eq.'FORMAT') then - if (iformat.lt.20) iformat=iformat+1 - read(qhulp,'(7x,a40)',end=46,err=46)qformat(iformat) - irecog=1 - end if - - if (qhulp(1:7).eq.'VCHANGE') then - read (qhulp(8:60),*)vvol - vred=(1.0+(vvol-1.0))**(0.33333333) - iexco=1 - na=naold - qmol=qmol - do i1=1,3 - axiss(i1)=vred*axis(i1) - angles(i1)=angle(i1) - do i2=1,na - cglobal(i2,i1)=vred*cglobal(i2,i1) - end do - end do - - halfa=angles(1)*dgrrdn - hbeta=angles(2)*dgrrdn - hgamma=angles(3)*dgrrdn - sinalf=sin(halfa) - cosalf=cos(halfa) - sinbet=sin(hbeta) - cosbet=cos(hbeta) - cosphi=(cos(hgamma)-cosalf*cosbet)/(sinalf*sinbet) - if (cosphi.gt.1.0) cosphi=1.0 - sinphi=sqrt(one-cosphi*cosphi) - tm11=axiss(1)*sinbet*sinphi - tm21=axiss(1)*sinbet*cosphi - tm31=axiss(1)*cosbet - tm22=axiss(2)*sinalf - tm32=axiss(2)*cosalf - tm33=axiss(3) - kx=int(2.0*swb/tm11) - ky=int(2.0*swb/tm22) - kz=int(2.0*swb/tm33) - ibity=2 - irecog=1 - end if - - if (qhulp(1:7).eq.'VCHANGX') then - read (qhulp(8:60),*)vvol - vred=vvol - iexco=1 - na=naold - qmol=qmol - do i1=1,3 - axiss(i1)=axis(i1) - angles(i1)=angle(i1) - do i2=1,na - cglobal(i2,i1)=cglobal(i2,i1) - end do - end do - - axiss(1)=vred*axiss(1) - do i2=1,na - cglobal(i2,1)=vred*cglobal(i2,1) - end do - - halfa=angles(1)*dgrrdn - hbeta=angles(2)*dgrrdn - hgamma=angles(3)*dgrrdn - sinalf=sin(halfa) - cosalf=cos(halfa) - sinbet=sin(hbeta) - cosbet=cos(hbeta) - cosphi=(cos(hgamma)-cosalf*cosbet)/(sinalf*sinbet) - if (cosphi.gt.1.0) cosphi=1.0 - sinphi=sqrt(one-cosphi*cosphi) - tm11=axiss(1)*sinbet*sinphi - tm21=axiss(1)*sinbet*cosphi - tm31=axiss(1)*cosbet - tm22=axiss(2)*sinalf - tm32=axiss(2)*cosalf - tm33=axiss(3) - kx=int(2.0*swb/tm11) - ky=int(2.0*swb/tm22) - kz=int(2.0*swb/tm33) - ibity=2 - irecog=1 - end if - - if (qhulp(1:7).eq.'VCHANGY') then - read (qhulp(8:60),*)vvol - vred=vvol - iexco=1 - na=naold - qmol=qmol - do i1=1,3 - axiss(i1)=axis(i1) - angles(i1)=angle(i1) - do i2=1,na - cglobal(i2,i1)=cglobal(i2,i1) - end do - end do - - axiss(2)=vred*axiss(2) - do i2=1,na - cglobal(i2,2)=vred*cglobal(i2,2) - end do - - halfa=angles(1)*dgrrdn - hbeta=angles(2)*dgrrdn - hgamma=angles(3)*dgrrdn - sinalf=sin(halfa) - cosalf=cos(halfa) - sinbet=sin(hbeta) - cosbet=cos(hbeta) - cosphi=(cos(hgamma)-cosalf*cosbet)/(sinalf*sinbet) - if (cosphi.gt.1.0) cosphi=1.0 - sinphi=sqrt(one-cosphi*cosphi) - tm11=axiss(1)*sinbet*sinphi - tm21=axiss(1)*sinbet*cosphi - tm31=axiss(1)*cosbet - tm22=axiss(2)*sinalf - tm32=axiss(2)*cosalf - tm33=axiss(3) - kx=int(2.0*swb/tm11) - ky=int(2.0*swb/tm22) - kz=int(2.0*swb/tm33) - ibity=2 - irecog=1 - end if - - if (qhulp(1:7).eq.'VCHANGZ') then - read (qhulp(8:60),*)vvol - vred=vvol - iexco=1 - na=naold - qmol=qmol - - do i1=1,3 - axiss(i1)=axis(i1) - angles(i1)=angle(i1) - do i2=1,na - cglobal(i2,i1)=cglobal(i2,i1) - end do - end do - - axiss(3)=vred*axiss(3) - do i2=1,na - cglobal(i2,3)=vred*cglobal(i2,3) - end do - - halfa=angles(1)*dgrrdn - hbeta=angles(2)*dgrrdn - hgamma=angles(3)*dgrrdn - sinalf=sin(halfa) - cosalf=cos(halfa) - sinbet=sin(hbeta) - cosbet=cos(hbeta) - cosphi=(cos(hgamma)-cosalf*cosbet)/(sinalf*sinbet) - if (cosphi.gt.1.0) cosphi=1.0 - sinphi=sqrt(one-cosphi*cosphi) - tm11=axiss(1)*sinbet*sinphi - tm21=axiss(1)*sinbet*cosphi - tm31=axiss(1)*cosbet - tm22=axiss(2)*sinalf - tm32=axiss(2)*cosalf - tm33=axiss(3) - kx=int(2.0*swb/tm11) - ky=int(2.0*swb/tm22) - kz=int(2.0*swb/tm33) - ibity=2 - irecog=1 - end if - - if (qhulp(1:6).eq.'CRYSTX') then - read (qhulp,'(8x,6f11.5)',end=46,err=46)axiss(1), - $axiss(2),axiss(3),angles(1),angles(2),angles(3) - kx=0 - ky=0 - kz=0 - halfa=angles(1)*dgrrdn - hbeta=angles(2)*dgrrdn - hgamma=angles(3)*dgrrdn - sinalf=sin(halfa) - cosalf=cos(halfa) - sinbet=sin(hbeta) - cosbet=cos(hbeta) - cosphi=(cos(hgamma)-cosalf*cosbet)/(sinalf*sinbet) - if (cosphi.gt.1.0) cosphi=1.0 - sinphi=sqrt(one-cosphi*cosphi) - tm11=axiss(1)*sinbet*sinphi - tm21=axiss(1)*sinbet*cosphi - tm31=axiss(1)*cosbet - tm22=axiss(2)*sinalf - tm32=axiss(2)*cosalf - tm33=axiss(3) - kx=int(2.0*swb/tm11) - ky=int(2.0*swb/tm22) - kz=int(2.0*swb/tm33) - qr='F' - if (nmmax.eq.1.and.nmmaxold.gt.1) qr='5' - if (icell.eq.0.and.icellold.gt.0) qr='Y' - ibity=2 - irecog=1 - end if - - if (qhulp(1:6).eq.'PERIOD') then - read (qhulp,'(7x,i3)',end=46,err=46)iperiod - irecog=1 - end if - - if (qhulp(1:4).eq.'AXES') then - read (qhulp,'(7x,a3)',end=46,err=46)qbgfaxes - irecog=1 - end if - - if (qhulp(1:6).eq.'SGNAME') then - read (qhulp,'(7x,a3)',end=46,err=46)qbgfsgn - irecog=1 - end if - -* if (qhulp(1:5).eq.'CELLS') then -* read (qhulp,'(7x,*)',end=40,err=40)kx,ky,kz -* irecog=1 -* end if - - if (qhulp(1:6).eq.'HETATM') then - if (ibgfversion.lt.400) then - read (qhulp, - $'(7x,i5,1x,a5,1x,a3,1x,a1,1x,a5,3f10.5,1x,a5,i3,i2,1x,f8.5)' - $,end=40,err=40) - $ir,qlabel(na+1),qresi1(na+1),qresi2(na+1),qresi3(na+1), - $cglobal(na+1,1),cglobal(na+1,2), - $cglobal(na+1,3),qffty(na+1),ibgr1(na+1),ibgr2(na+1), - $chgglobal(na+1) - else - stop 'Unsupported Biograf-version' - end if - qlabhulp=qlabel(na+1) - if (qlabhulp(1:1).eq.' ') qlabhulp=qlabhulp(2:5) - if (qlabhulp(1:1).eq.' ') qlabhulp=qlabhulp(2:4) - if (qlabhulp(1:1).eq.' ') qlabhulp=qlabhulp(2:3) - if (qlabhulp(1:1).eq.'C ') qa(na+1)='C ' - if (qlabhulp(1:2).eq.'Ca') qa(na+1)='Ca' - if (qlabhulp(1:2).eq.'Cl') qa(na+1)='Cl' - if (qlabhulp(1:2).eq.'Cu') qa(na+1)='Cu' - if (qlabhulp(1:2).eq.'Co') qa(na+1)='Co' - if (qlabhulp(1:1).eq.'H ') qa(na+1)='H ' - if (qlabhulp(1:2).eq.'He') qa(na+1)='He' - if (qlabhulp(1:1).eq.'N ') qa(na+1)='N ' - if (qlabhulp(1:2).eq.'Ni') qa(na+1)='Ni' - if (qlabhulp(1:1).eq.'O ') qa(na+1)='O ' - if (qlabhulp(1:1).eq.'B ') qa(na+1)='B ' - if (qlabhulp(1:1).eq.'F ') qa(na+1)='F ' - if (qlabhulp(1:2).eq.'Fe') qa(na+1)='Fe' - if (qlabhulp(1:1).eq.'P ') qa(na+1)='P ' - if (qlabhulp(1:1).eq.'S ') qa(na+1)='S ' - if (qlabhulp(1:1).eq.'Y ') qa(na+1)='Y ' - if (qlabhulp(1:2).eq.'Al ') qa(na+1)='Al' - if (qlabhulp(1:2).eq.'Au ') qa(na+1)='Au' - if (qlabhulp(1:2).eq.'Si') qa(na+1)='Si' - if (qlabhulp(1:2).eq.'Pt') qa(na+1)='Pt' - if (qlabhulp(1:2).eq.'Mo') qa(na+1)='Mo' - if (qlabhulp(1:2).eq.'Mg') qa(na+1)='Mg' - if (qlabhulp(1:2).eq.'Ar') qa(na+1)='Ar' - if (qlabhulp(1:2).eq.'Zr') qa(na+1)='Zr' - if (qlabhulp(1:2).eq.'Ti') qa(na+1)='Ti' - if (qlabhulp(1:2).eq.'Ru') qa(na+1)='Ru' - if (qlabhulp(1:2).eq.'Ba') qa(na+1)='Ba' - if (qlabhulp(1:2).eq.'Bi') qa(na+1)='Bi' - if (qlabhulp(1:2).eq.'Li') qa(na+1)='Li' - if (qlabhulp(1:2).eq.'V ') qa(na+1)='V ' - if (qlabhulp(1:2).eq.'X ') qa(na+1)='X ' - na=na+1 - if (na.gt.nattot) then - write (*,*)'Number of atoms:read ',na - write (*,*)'Maximum number of atoms: ',nattot - stop - $'Maximum number of atoms exceeded; increase nattot in cbka.blk' - end if - irecog=1 - end if - - if (qhulp(1:6).eq.'RUTYPE') then !run-type identifiers - irecrun=0 - read (qhulp,'(7x,a40)',end=46,err=46)qruid - - if (qruid(1:10).eq.'NORMAL RUN') then - iruid=0 - irecrun=1 - end if - - if (qruid(1:14).eq.'HIGH PRECISION') then - endpo=endpo/25 - nmmax=nmmax*5 - qr='D' - iruid=1 - irecrun=1 - end if - - if (qruid(1:13).eq.'LOW PRECISION') then - nmmax=nmmax/10 - qr='H' - iruid=1 - irecrun=1 - end if - - if (qruid(1:12).eq.'SINGLE POINT') then - iruid=1 - nmmax=1 - qr='1' - if (ibity.eq.2) qr='5' - irecrun=1 - end if - - if (qruid(1:11).eq.'NO CELL OPT') then - iruid=1 - icell=0 - if (ibity.eq.2) qr='Y' - irecrun=1 - end if - - if (qruid(1:8).eq.'CELL OPT') then - iruid=1 - icell=1 - iexco=0 !Override from VCHANGE - read (qruid,'(8x,i6)',end=46,err=46)ncellopt - if (ncellopt.eq.2) icell=2 !cell optimisation during energy minimisation - if (ncellopt.eq.3) icelo2=4 !c/a optimisation - if (ncellopt.eq.4) icelo2=1 !only a optimisation - if (ncellopt.eq.5) icelo2=2 !only b optimisation - if (ncellopt.eq.6) icelo2=3 !only c optimisation - if (ncellopt.eq.7) then - icelo2=4 !c/a optimisation - icell=2 !cell optimisation during energy minimisation - end if - if (ibity.eq.2) qr='F' - irecrun=1 - end if - - if (qruid(1:6).eq.'MAXMOV') then - iruid=1 - read (qruid,'(6x,i6)',end=46,err=46)nfc - irecrun=1 - end if - - if (qruid(1:4).eq.'REDO') then - iruid=1 - read (qruid,'(4x,i6)',end=46,err=46)iredo - irecrun=1 - end if - - if (qruid(1:5).eq.'MAXIT') then - iruid=1 - read (qruid,'(6x,i6)',end=46,err=46)nmmax - if (qruid(14:18).eq.'ENDPO') then - read (qruid,'(18x,f6.3)',end=46,err=46)endpo - end if - irecrun=1 - end if - if (qruid(1:5).eq.'ENDPO') then - iruid=1 - read (qruid,'(6x,f6.3)',end=46,err=46)endpo - irecrun=1 - end if - - if (qruid(1:9).eq.'CHARGEMET') then - iruid=1 - read (qruid,'(9x,i6)',end=46,err=46)ncha - irecrun=1 - end if - - if (irecrun.eq.0) then - write (*,*)'Warning: ignored RUTYPE identifier ',qruid(1:12) - end if - - irecog=1 - end if - - if (qhulp(1:14).eq.'BOND RESTRAINT') then - nrestra=nrestra+1 - istart=15 - call stranal(istart,iend,vout,iout,1) - irstra(nrestra,1)=iout - istart=iend - call stranal(istart,iend,vout,iout,1) - irstra(nrestra,2)=iout - istart=iend - call stranal(istart,iend,vout,iout,1) - rrstra(nrestra)=vout - istart=iend - call stranal(istart,iend,vout,iout,1) - vkrstr(nrestra)=vout - istart=iend - call stranal(istart,iend,vout,iout,1) - vkrst2(nrestra)=vout - istart=iend - call stranal(istart,iend,vout,iout,1) - rrcha(nrestra)=vout - istart=iend - call stranal(istart,iend,vout,iout,1) - itstart(nrestra)=iout - istart=iend - call stranal(istart,iend,vout,iout,1) - itend(nrestra)=iout - istart=iend -* read (qhulp,'(15x,2i4,f8.4,f8.2,f8.5,f10.7)',end=46,err=46) -* $irstra(nrestra,1),irstra(nrestra,2),rrstra(nrestra), -* $vkrstr(nrestra),vkrst2(nrestra),rrcha(nrestra) - qr='R' - irecog=1 - end if - - if (qhulp(1:15).eq.'ANGLE RESTRAINT') then - nrestrav=nrestrav+1 - read (qhulp,'(16x,3i4,2f8.2,f8.4,f9.6)',end=46,err=46) - $irstrav(nrestrav,1),irstrav(nrestrav,2),irstrav(nrestrav,3), - $vrstra(nrestrav),vkrv(nrestrav),vkr2v(nrestrav), - $rvcha(nrestrav) - qr='V' - irecog=1 - end if - - if (qhulp(1:17).eq.'TORSION RESTRAINT') then - nrestrat=nrestrat+1 - read (qhulp,'(18x,4i4,2f8.2,f8.4,f9.6)',end=46,err=46) - $irstrat(nrestrat,1),irstrat(nrestrat,2),irstrat(nrestrat,3), - $irstrat(nrestrat,4),trstra(nrestrat),vkrt(nrestrat), - $vkr2t(nrestrat),rtcha(nrestrat) - qr='T' - irecog=1 - end if - - if (qhulp(1:16).eq.'MASCEN RESTRAINT') then - nrestram=nrestram+1 - istart=17 - call stranal(istart,iend,vout,iout,1) - istart=iend - irstram(nrestram,1)=0 - if (qstrana2.eq.'x') irstram(nrestram,1)=1 - if (qstrana2.eq.'y') irstram(nrestram,1)=2 - if (qstrana2.eq.'z') irstram(nrestram,1)=3 - if (qstrana2.eq.'p') irstram(nrestram,1)=4 !fixed center of mass - if (irstram(nrestram,1).eq.0) - $stop 'Error in mass centre restraint' - call stranal(istart,iend,vout,iout,1) - istart=iend - irstram(nrestram,2)=iout - call stranal(istart,iend,vout,iout,1) - istart=iend - irstram(nrestram,3)=iout - call stranal(istart,iend,vout,iout,1) - istart=iend - rmstra1(nrestram)=vout - call stranal(istart,iend,vout,iout,1) - istart=iend - if (irstram(nrestram,1).le.3) irstram(nrestram,4)=iout - if (irstram(nrestram,1).eq.4) rmstra2(nrestram)=vout - call stranal(istart,iend,vout,iout,1) - istart=iend - if (irstram(nrestram,1).le.3) irstram(nrestram,5)=iout - if (irstram(nrestram,1).eq.4) rmstra3(nrestram)=vout - call stranal(istart,iend,vout,iout,1) - istart=iend - if (irstram(nrestram,1).le.3) rmstra2(nrestram)=vout - call stranal(istart,iend,vout,iout,1) - istart=iend - if (irstram(nrestram,1).le.3) rmstra3(nrestram)=vout - call stranal(istart,iend,vout,iout,1) - istart=iend - if (irstram(nrestram,1).le.3) rmcha(nrestram)=vout - irecog=1 - end if - - if (qhulp(1:9).eq.'MOLCHARGE') then - nmcharge=nmcharge+1 - istart=10 - call stranal(istart,iend,vout,iout,1) - istart=iend - iat1mc(nmcharge)=iout - call stranal(istart,iend,vout,iout,1) - istart=iend - iat2mc(nmcharge)=iout - call stranal(istart,iend,vout,iout,1) - istart=iend - vmcha(nmcharge)=vout - irecog=1 - end if - - if (qhulp(1:8).eq.'FIXATOMS') then - istart=9 - call stranal(istart,iend,vout,iout,1) - if1=iout - istart=iend - call stranal(istart,iend,vout,iout,1) - if2=iout - do i12=if1,if2 - imove(i12)=0 - end do - irecog=1 - end if - - if (qhulp(1:11).eq.'UNIT ENERGY') then - eenconv=zero - read (qhulp,'(14x,a5)',end=46,err=46)quen - if (quen.eq.'eV') eenconv=23.0408 - if (quen.eq.'EV') eenconv=23.0408 - if (quen.eq.'ev') eenconv=23.0408 - if (quen.eq.'h') eenconv=627.5 - if (quen.eq.'H') eenconv=627.5 - if (quen.eq.'kcal') eenconv=1.0 - if (quen.eq.'kCal') eenconv=1.0 - if (quen.eq.'KCAL') eenconv=1.0 - if (eenconv.eq.zero) then - write (*,*)quen,': unknown energy unit; assuming kcal/mol' - eenconv=1.0 - end if - irecog=1 - end if - - if (qhulp(1:6).eq.'ENERGY') then - read (qhulp(7:80),*,end=46,err=46)enmol - ienread=1 - irecog=1 - end if - - if (qhulp(1:6).eq.'GEOUPD') then - icgeopt(nprob)=0 - icgeo=0 - irecog=1 - end if - - if (qhulp(1:9).eq.'NO GEOUPD') then - icgeopt(nprob)=1 - icgeo=1 - irecog=1 - end if - - if (qhulp(1:9).eq.'FREQUENCY') then - ifreqset(nprob)=1 - ifreq=1 - irecog=1 - end if - -* if (qhulp(1:5).eq.'FORCE') then -* read (qhulp(6:80),*,end=46,err=46)formol -* ienread=1 -* irecog=1 -* end if - - if (qhulp(1:6).eq.'FFIELD') goto 30 - if (qhulp(1:6).eq.'CONECT') goto 30 - if (qhulp(1:5).eq.'ORDER') goto 30 - if (qhulp(1:1).eq.'#') goto 30 - if (qhulp(1:3).eq.'END') goto 45 - - if (irecog.eq.0) then - write (*,*)'Warning: ignored line starting with: ',qhulp(1:10) - end if - - goto 30 - - 40 write (*,*)'Error on line ',iline+1,' of Biograf-input' - stop - 45 read (3,*,err=46,end=46) - 46 continue - if (ienread.eq.1) then - if (eenconv.eq.zero) then - write (*,*)'No energy unit given; assuming kcal/mol' - eenconv=1.0 - end if - enmol=enmol*eenconv !Convert energies to kcal/mol - end if - - namov=0 !calculate number of moving atoms - do i1=1,na - if (imove(i1).eq.1) namov=namov+1 - end do - - if (imodfile.eq.1) close (3) - return - 900 iendf=1 - return - end -************************************************************************ -************************************************************************ - - subroutine readpdb (iendf) - -************************************************************************ -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkqa.blk" -#include "control.blk" -#include "opt.blk" -#include "small.blk" -#include "cbksrtbon1.blk" - character*200 qhulp -********************************************************************** -* * -* Read in .pdb-geometry * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In readpdb' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - iendf=1 - qmol='pdb_in' - 5 read (3,'(a200)',end=10,err=900) qhulp - qstrana1(1:200)=qhulp - istart=1 - call stranal(istart,iend,vout,iout,1) - istart=iend - - if (qstrana2(1:6).eq.'HEADER') then - call stranal(istart,iend,vout,iout,1) - istart=iend - qmol=qstrana2(1:20) - end if - - if (qstrana2(1:6).eq.'HETATM'.or.qstrana2(1:4).eq.'ATOM') then - call stranal(istart,iend,vout,iout,1) - istart=iend - call stranal(istart,iend,vout,iout,1) - istart=iend - qa(na+1)=qstrana2(1:2) - call stranal(istart,iend,vout,iout,1) - istart=iend - call stranal(istart,iend,vout,iout,1) - istart=iend - call stranal(istart,iend,vout,iout,1) - istart=iend - c(na+1,1)=vout - call stranal(istart,iend,vout,iout,1) - istart=iend - c(na+1,2)=vout - call stranal(istart,iend,vout,iout,1) - istart=iend - c(na+1,3)=vout - na=na+1 - end if - - if (qstrana2(1:3).eq.'END'.or.qstrana2(2:4).eq.'END') then - iendf=0 - goto 10 - end if - - goto 5 - 10 continue - return - 900 write (*,*)'Error reading in .pdb-format' - stop 'Error reading in .pdb-format' - end -************************************************************************ -************************************************************************ - - subroutine readtreg - -************************************************************************ -#include "cbka.blk" -#include "cbktregime.blk" -#include "control.blk" -#include "small.blk" - dimension isumattreg(mtreg) - character*200 qrom -********************************************************************** -* * -* Read in temperature regime * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In readtreg' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - ntrc=0 - open (19,file='tregime.in',status='old',err=60) - 10 read (19,'(a200)',end=50,err=900)qrom - qstrana1(1:200)=qrom - if (qrom(1:1).eq.'#') goto 10 - istart=1 - ntrc=ntrc+1 - if (ntrc.gt.mtreg) then - write (*,*)'Too many temperature regimes in tregime.in;', - $' inrease mtreg in cbka.blk' - stop 'Too many temperature regimes in tregime.in' - end if - call stranal(istart,iend,vout,iout,1) - nittc(ntrc)=iout - istart=iend - - if (ntrc.gt.1) then - if (nittc(ntrc).lt.nittc(ntrc-1)) then - ntrc=ntrc-1 - write (*,*)'Warning: wrong order or empty line in tregime.in' - write (*,*)'Ignored lines below iteration:',nittc(ntrc) - goto 50 - end if - end if - - call stranal(istart,iend,vout,iout,1) - nntreg(ntrc)=iout - if (nntreg(ntrc).gt.mtzone) then - write (*,*)'Too many temperature zones in tregime.in;', - $' inrease mtzone in cbka.blk' - stop 'Too many temperature zones in tregime.in' - end if - istart=iend - isumattreg(ntrc)=0 - do i1=1,nntreg(ntrc) - call stranal(istart,iend,vout,iout,1) - ia1treg(ntrc,i1)=iout - istart=iend - call stranal(istart,iend,vout,iout,1) - ia2treg(ntrc,i1)=iout - istart=iend - isumattreg(ntrc)=isumattreg(ntrc)+1+ia2treg(ntrc,i1)- - $ia1treg(ntrc,i1) - call stranal(istart,iend,vout,iout,1) - tsettreg(ntrc,i1)=vout - istart=iend - call stranal(istart,iend,vout,iout,1) - tdamptreg(ntrc,i1)=vout - istart=iend - call stranal(istart,iend,vout,iout,1) - dttreg(ntrc,i1)=vout - istart=iend - end do - goto 10 - 50 continue - close (19) - 60 continue -********************************************************************** -* * -* Check consistency temperature programs in tregime.in * -* * -********************************************************************** - if (ntrc.gt.0) then - do i1=1,ntrc - if (isumattreg(i1).ne.na) then - write (*,*)'Inconsistency in temperature regime nr.',i1 - write (*,*)'Number of atoms defined in tregime.in:', - $isumattreg(i1) - write (*,*)'Number of atoms in system:',na - stop 'Inconsistency in tregime.in' - end if - end do - end if - - return - 900 stop 'Error reading tregime.in' - end -************************************************************************ -************************************************************************ - - subroutine readvreg - -************************************************************************ -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkvregime.blk" -#include "control.blk" - character*200 qrom -********************************************************************** -* * -* Read in volume regime * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In readvreg' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - nvrc=0 - open (19,file='vregime.in',status='old',err=60) - 10 read (19,'(a200)',end=50,err=900)qrom - qstrana1(1:200)=qrom - if (qrom(1:1).eq.'#') goto 10 - istart=1 - nvrc=nvrc+1 - if (nvrc.gt.mvreg) then - write (*,*)'Too many volume regimes in vregime.in;', - $' inrease mvreg in cbka.blk' - stop 'Too many volume regimes in vregime.in' - end if - - call stranal(istart,iend,vout,iout,1) - nitvc(nvrc)=iout - istart=iend - - if (nvrc.gt.1) then - if (nitvc(nvrc).lt.nitvc(nvrc-1)) then - nvrc=nvrc-1 - write (*,*)'Warning: wrong order or empty line in vregime.in' - write (*,*)'Ignored lines below iteration:',nitvc(nvrc) - goto 50 - end if - end if - - call stranal(istart,iend,vout,iout,1) - nnvreg(nvrc)=iout - if (nnvreg(nvrc).gt.mvzone) then - write (*,*)'Too many volume regimes in vregime.in;', - $' inrease mvzone in cbka.blk' - stop 'Too many volume zones in vregime.in' - end if - istart=iend - do i1=1,nnvreg(nvrc) - call stranal(istart,iend,vout,iout,1) - if (qstrana2(1:1).ne.'a'.and.qstrana2(1:1).ne.'b'.and. - $qstrana2(1:1).ne.'c'.and.qstrana2(1:4).ne.'alfa'.and. - $qstrana2(1:4).ne.'beta'.and.qstrana2(1:5).ne.'gamma') then - write (*,*)qstrana2 - write (*,*)'Invalid cell parameter type in vregime.in ;', - $' use a,b,c,alfa,beta or gamma' - stop 'Invalid cell parameter type in vregime.in' - end if - qvtype(nvrc,i1)=qstrana2 - istart=iend - call stranal(istart,iend,vout,iout,1) - dvvreg(nvrc,i1)=vout - istart=iend - call stranal(istart,iend,vout,iout,1) - ivsca(nvrc,i1)=1 - if (qstrana2(1:1).eq.'n') ivsca(nvrc,i1)=0 - istart=iend - end do - goto 10 - 50 continue - close (19) - 60 continue - return - 900 stop 'Error reading vregime.in' - end -************************************************************************ -************************************************************************ - - subroutine readereg - -************************************************************************ -#include "cbka.blk" -#include "cbkeregime.blk" -#include "control.blk" - character*200 qrom -********************************************************************** -* * -* Read in electric field regime * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In readereg' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - nerc=0 - open (19,file='eregime.in',status='old',err=60) - 10 read (19,'(a200)',end=50,err=900)qrom - qstrana1(1:200)=qrom - if (qrom(1:1).eq.'#') goto 10 - istart=1 - nerc=nerc+1 - if (nerc.gt.mereg) then - write (*,*)'Too many electric field regimes in eregime.in;', - $' inrease mereg in cbka.blk' - stop 'Too many electric field regimes in eregime.in' - end if - call stranal(istart,iend,vout,iout,1) - nitec(nerc)=iout - - if (nerc.gt.1) then - if (nitec(nerc).lt.nitec(nerc-1)) then - nerc=nerc-1 - write (*,*)'Warning: wrong order or empty line in eregime.in' - write (*,*)'Ignored lines below iteration:',nitec(nerc) - goto 50 - end if - end if - - istart=iend - call stranal(istart,iend,vout,iout,1) - nnereg(nerc)=iout - if (nnereg(nerc).gt.mezone) then - write (*,*)'Too many electric field zones in eregime.in;', - $' inrease mezone in cbka.blk' - stop 'Too many electric field zones in vregime.in' - end if - istart=iend - do i1=1,nnereg(nerc) - call stranal(istart,iend,vout,iout,1) - if (qstrana2(1:1).ne.'x'.and.qstrana2(1:1).ne.'y'.and. - $qstrana2(1:1).ne.'z') then - write (*,*)qstrana2 - write (*,*)'Invalid field direction in eregime.in ;', - $' use x,y or z' - stop 'Invalid field direction in eregime.in' - end if - qetype(nerc,i1)=qstrana2 - istart=iend - call stranal(istart,iend,vout,iout,1) - ereg(nerc,i1)=vout - istart=iend - end do - goto 10 - 50 continue - close (19) - 60 continue - return - 900 stop 'Error reading vregime.in' - end -************************************************************************ -************************************************************************ - - subroutine readaddmol - -************************************************************************ -#include "cbka.blk" -#include "cbkatomcoord.blk" -#include "cbkc.blk" -#include "cbkff.blk" -#include "cbkh.blk" -#include "control.blk" - character*80 qromb - character*200 qhulp - character*5 qlabhulp -********************************************************************** -* * -* Read in molecule coordinates. This molecule will be added to * -* the system at regular intervals * -* Accepts only .bgf-format * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In readaddmol' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if -********************************************************************** -* * -* Set default values * -* * -********************************************************************** - iaddfreq=-1 !frequency of molecule addition; <0: no addition - xadd=-9000.0 !x-coordinate for added molecule; <-5000.0: random - yadd=-9000.0 !y-coordinate for added molecule; <-5000.0: random - zadd=-9000.0 !z-coordinate for added molecule; <-5000.0: random - iveladd=1 !1: random initial velocities; 2: read in velocities - !from addmol.vel - addist=-1.00 !Minimum distance between added molecule and rest - !of system. < 0.0: do not check - nadattempt=10 !Number of attempts at adding the molecule - taddmol=-1.0 !Temperature added molecule. <0.0: system temperature - open (19,file='addmol.bgf',status='old',err=60) - read (19,'(a40)',end=900,err=900)qromb - if (qromb(1:6).ne.'BIOGRF') then - write (*,*)'addmol.bgf should start with BIOGRF' - stop 'addmol.bgf should start with BIOGRF' - end if - naa=0 - iline=0 - 30 read (19,'(a200)',end=900,err=900)qhulp - irecog=0 - iline=iline+1 - - if (qhulp(1:6).eq.'DESCRP') then - irecog=1 - end if - - if (qhulp(1:6).eq.'FORMAT') then - irecog=1 - end if - - if (qhulp(1:6).eq.'REMARK') then - irecog=1 - end if - - if (qhulp(1:6).eq.'HETATM') then - irecog=1 - read (qhulp,'(7x,i5,1x,a5,1x,3x,1x,1x,1x,5x,3f10.5)' - $,end=900,err=900) - $ir,qlabhulp,cadd(naa+1,1),cadd(naa+1,2),cadd(naa+1,3) - if (qlabhulp(1:1).eq.' ') qlabhulp=qlabhulp(2:5) - if (qlabhulp(1:1).eq.' ') qlabhulp=qlabhulp(2:4) - if (qlabhulp(1:1).eq.' ') qlabhulp=qlabhulp(2:3) - if (qlabhulp(1:1).eq.'C ') qadd(naa+1)='C ' - if (qlabhulp(1:2).eq.'Ca') qadd(naa+1)='Ca' - if (qlabhulp(1:2).eq.'Cl') qadd(naa+1)='Cl' - if (qlabhulp(1:2).eq.'Cu') qadd(naa+1)='Cu' - if (qlabhulp(1:2).eq.'Co') qadd(naa+1)='Co' - if (qlabhulp(1:1).eq.'H ') qadd(naa+1)='H ' - if (qlabhulp(1:2).eq.'He') qadd(naa+1)='He' - if (qlabhulp(1:1).eq.'N ') qadd(naa+1)='N ' - if (qlabhulp(1:2).eq.'Ni') qadd(naa+1)='Ni' - if (qlabhulp(1:1).eq.'O ') qadd(naa+1)='O ' - if (qlabhulp(1:1).eq.'B ') qadd(naa+1)='B ' - if (qlabhulp(1:1).eq.'F ') qadd(naa+1)='F ' - if (qlabhulp(1:2).eq.'Fe') qadd(naa+1)='Fe' - if (qlabhulp(1:1).eq.'P ') qadd(naa+1)='P ' - if (qlabhulp(1:1).eq.'S ') qadd(naa+1)='S ' - if (qlabhulp(1:1).eq.'Y ') qadd(naa+1)='Y ' - if (qlabhulp(1:2).eq.'Al') qadd(naa+1)='Al' - if (qlabhulp(1:2).eq.'Au') qadd(naa+1)='Au' - if (qlabhulp(1:2).eq.'Si') qadd(naa+1)='Si' - if (qlabhulp(1:2).eq.'Pt') qadd(naa+1)='Pt' - if (qlabhulp(1:2).eq.'Mo') qadd(naa+1)='Mo' - if (qlabhulp(1:2).eq.'Mg') qadd(naa+1)='Mg' - if (qlabhulp(1:2).eq.'Ar') qadd(naa+1)='Ar' - if (qlabhulp(1:2).eq.'Zr') qadd(naa+1)='Zr' - if (qlabhulp(1:2).eq.'Ba') qadd(naa+1)='Ba' - if (qlabhulp(1:2).eq.'X ') qadd(naa+1)='X ' - ityadd(naa+1)=0 - do i1=1,nso !Find force field type - if (qadd(naa+1).eq.qas(i1)) ityadd(naa+1)=i1 - end do - if (ityadd(naa+1).eq.0) then - write (*,*) 'Unknown atom type:',qadd(naa+1) - stop 'Unknown atom type' - end if - naa=naa+1 - end if - - if (qhulp(1:7).eq.'FREQADD') then - irecog=1 - read (qhulp,'(8x,i6)',end=900,err=900) iaddfreq - end if - - if (qhulp(1:6).eq.'VELADD') then - irecog=1 - read (qhulp,'(8x,i6)',end=900,err=900) iveladd - end if - - if (qhulp(1:6).eq.'STARTX') then - irecog=1 - read (qhulp,'(7x,f8.2)',end=900,err=900) xadd - end if - - if (qhulp(1:6).eq.'STARTY') then - irecog=1 - read (qhulp,'(7x,f8.2)',end=900,err=900) yadd - end if - - if (qhulp(1:6).eq.'STARTZ') then - irecog=1 - read (qhulp,'(7x,f8.2)',end=900,err=900) zadd - end if - - if (qhulp(1:6).eq.'ADDIST') then - irecog=1 - read (qhulp,'(7x,f8.2)',end=900,err=900) addist - end if - - if (qhulp(1:8).eq.'NATTEMPT') then - irecog=1 - read (qhulp,'(9x,i6)',end=900,err=900) nadattempt - end if - - if (qhulp(1:7).eq.'TADDMOL') then - irecog=1 - read (qhulp,'(8x,f8.2)',end=900,err=900) taddmol - end if - - if (qhulp(1:6).eq.'FFIELD') goto 30 - if (qhulp(1:6).eq.'CONECT') goto 30 - if (qhulp(1:5).eq.'ORDER') goto 30 - if (qhulp(1:1).eq.'#') goto 30 - if (qhulp(1:3).eq.'END') goto 45 - - if (irecog.eq.0) then - write (*,*)'Warning: ignored line starting with: ',qhulp(1:10) - end if - - goto 30 - - 45 continue - close (19) - if (iveladd.eq.2) then - open (19,file='addmol.vel',status='old',err=800) - read (19,*) - read (19,'(3d24.15)',err=850,end=850) - $((veladd(j,i),j=1,3),i=1,naa) - close (19) - end if -************************************************************************ -* * -* Place molecule at origin * -* * -************************************************************************ - ccx=0.0 - ccy=0.0 - ccz=0.0 - do i1=1,naa - ccx=ccx+cadd(i1,1)/float(naa) - ccy=ccy+cadd(i1,2)/float(naa) - ccz=ccz+cadd(i1,3)/float(naa) - end do - do i1=1,naa - cadd(i1,1)=cadd(i1,1)-ccx - cadd(i1,2)=cadd(i1,2)-ccy - cadd(i1,3)=cadd(i1,3)-ccz - end do - - 60 continue - return - 800 stop 'Error opening addmol.vel' - 850 stop 'Error or end of file reading addmol.vel' - 900 write (*,*)'Error or end-of-file reading addmol.bgf on line:', - $iline - return - end -************************************************************************ -********************************************************************** - - subroutine writegeo(nunit1) - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkconst.blk" -#include "cbkqa.blk" -#include "cbkrestr.blk" -#include "cbktregime.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "opt.blk" -#include "small.blk" -#include "cbksrtbon1.blk" -#include "cbkinit.blk" -********************************************************************** -* * -* Copy new geometries to unit nunit1 * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In writegeo' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - if (axiss(1).lt.zero) then - if (nrestra.eq.0.and.nrestrat.eq.0.and. - $nrestrav.eq.0) - $write (nunit1,300)qr,qmol - if (nrestra.gt.0) write (nunit1,301)qr, - $rrstra(1),qmol - if (nrestrav.gt.0) write (nunit1,301)qr, - $vrstra(1),qmol - if (nrestrat.gt.0) write (nunit1,301)qr, - $trstra(1),qmol - else - write (nunit1,310)qr,qmol - write (nunit1,320)axiss(1),axiss(2),axiss(3) - write (nunit1,320)angles(1),angles(2),angles(3) - end if - do i1=1,na - if (nbiolab.ne.1) write (nunit1,400)i1,qa(i1),(c(i1,i2),i2=1,3) - if (nbiolab.eq.1) write (nunit1,401)i1,qa(i1),(c(i1,i2),i2=1,3) !Delphi-format - end do - if (nbiolab.ne.1) write (nunit1,*) - - return - - 300 format (2x,a1,1x,a60) - 301 format (2x,a1,1x,f6.2,a60) - 310 format (2x,a1,1x,a60) - 320 format (3f10.4) - 400 format (i4,1x,a2,3x,3(d21.14,1x),1x,a5,1x,i5) - 401 format (i3,2x,a2,3x,3(d21.14,1x),1x,a5,1x,i5) - end -********************************************************************** -********************************************************************** - - subroutine writebgf(nunit1) - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkcha.blk" -#include "cbkcharmol.blk" -#include "cbkconst.blk" -#include "cbkenergies.blk" -#include "cbkia.blk" -#include "cbkimove.blk" -#include "cbkinit.blk" -#include "cbkqa.blk" -#include "cbkrestr.blk" -#include "cbktregime.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "opt.blk" -#include "cbksrtbon1.blk" -#include "small.blk" - - dimension qdir(3) - character*2 qt - character*1 qdir -********************************************************************** -* * -* Copy new Biograf-geometries to unit nunit1 * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In newbgf' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - irom=1 - qdir(1)='x' - qdir(2)='y' - qdir(3)='z' - ibgfversion=200 - if (ibity.eq.1) write (nunit1,1500)ibgfversion - if (ibity.eq.2) write (nunit1,1600)ibgfversion -* if (qr.ne.'F'.and.qr.ne.'5'.and.qr.ne.'Y') -* $write (nunit1,1500)ibgfversion -* if (qr.eq.'F'.or.qr.eq.'5'.or.qr.eq.'Y') -* $write (nunit1,1600)ibgfversion - write (nunit1,1700)qmol -* write (nunit1,1700)qkeyw(nprob) - do i1=1,iremark - write (nunit1,1800)qremark(i1) - end do - qruid='NORMAL RUN' - if (iruid.eq.0) then - write (nunit1,2000) - else - if (abs(endpo-endpoold).gt.1e-5) write (nunit1,2010)endpo - if (nmmax.ne.nmmaxold) write (nunit1,2020)nmmax - if (nfc.ne.nfcold) write (nunit1,2030)nfc - if (ncha.ne.nchaold) write (nunit1,2036)ncha - if (iredo.gt.1) write (nunit1,2035)iredo - if (icell.ne.icellold) then - if (icell.eq.0) write (nunit1,2033) - if (icell.gt.0) write (nunit1,2034)ncellopt - end if - end if - if (iexco.ne.0.and.nsurp.gt.0) then - write (nunit1,2040)vvol - write (nunit1,3500) - write (nunit1,*) - return - end if - if (nmcharge.gt.0) then - do i3=1,nmcharge - write (nunit1,2050)iat1mc(i3),iat2mc(i3),vmcha(i3) - end do - end if - - ims=0 - do i1=1,na - if (ims.eq.0.and.imove(i1).eq.0) then - if1=i1 - ims=1 - end if - if (ims.eq.1.and.imove(i1).eq.1) then - write (nunit1,2060)if1,i1-1 - ims=0 - end if - end do - if (ims.eq.1) then - write (nunit1,2060)if1,na - end if - -* if (qr.eq.'F'.or.qr.eq.'5'.or.qr.eq.'Y') - if (ibity.eq.2) - $write (nunit1,2100)axiss(1),axiss(2),axiss(3),angles(1), - $angles(2),angles(3) - - if (nrestra.gt.0) write (nunit1,2300) - do i2=1,nrestra - write (nunit1,2400) - $irstra(i2,1),irstra(i2,2),rrstra(i2), - $vkrstr(i2),vkrst2(i2),rrcha(i2),itstart(i2),itend(i2) - end do - - if (nrestrav.gt.0) write (nunit1,2500) - do i2=1,nrestrav - write (nunit1,2600) - $irstrav(i2,1),irstrav(i2,2),irstrav(i2,3), - $vrstra(i2),vkrv(i2),vkr2v(i2),zero - end do - - if (nrestrat.gt.0) write (nunit1,2700) - do i2=1,nrestrat - write (nunit1,2800) - $irstrat(i2,1),irstrat(i2,2),irstrat(i2,3), - $irstrat(i2,4),trstra(i2),vkrt(i2), - $vkr2t(i2),zero - end do - - if (nrestram.gt.0) write (nunit1,2810) - do i2=1,nrestram - write (nunit1,2820) - $qdir(irstram(i2,1)),irstram(i2,2),irstram(i2,3), - $rmstra1(i2),irstram(i2,4),irstram(i2,5),rmstra2(i2), - $rmstra3(i2),rmcha(i2) - end do - - if (icgeo.eq.0.and.ingeo.eq.0) write (nunit1,2830) - if (icgeo.eq.1.and.ingeo.eq.1) write (nunit1,2840) - if (ifreq.eq.1) write (nunit1,2850) - write (nunit1,2900) - do i2=1,na - write (nunit1,3000)i2,qa(i2),c(i2,1),c(i2,2),c(i2,3), - $qa(i2),irom,irom,chgbgf(i2) - end do - write (nunit1,3100) - if (nsurp.lt.2) then - do i1=1,na - write (nunit1,3200)i1,(iag(i1,2+i2),i2=1,iag(i1,2)) - end do - write (nunit1,3300) - write (nunit1,3400)estrc - end if - - write (nunit1,3500) - write (nunit1,*) - - return - 1500 format ('BIOGRF',i4) - 1600 format ('XTLGRF',i4) - 1700 format ('DESCRP ',a60) - 1800 format ('REMARK ',a60) - 1900 format ('FFIELD ',a40) - 2000 format ('RUTYPE NORMAL RUN') - 2010 format ('RUTYPE ENDPO',f6.3) - 2020 format ('RUTYPE MAXIT',i6) - 2030 format ('RUTYPE MAXMOV',i6) - 2033 format ('RUTYPE NO CELL OPT') - 2034 format ('RUTYPE CELL OPT',i6) - 2035 format ('RUTYPE REDO',i6) - 2036 format ('RUTYPE CHARGEMET',i6) - 2040 format ('VCHANGE',f8.4) - 2050 format ('MOLCHARGE',2i4,f6.2) - 2060 format ('FIXATOMS',2i6) - 2100 format ('CRYSTX ',6f11.5) - 2200 format ('CELLS ',6i5) - 2300 format ('# At1 At2 R12 Force1 Force2 ', - $'dR12/dIter(MD) Start (MD) End (MD)') - 2400 format ('BOND RESTRAINT ',2i4,f8.4,f8.2,f8.4,1x,f10.7,2i8) - 2500 format ('# At1 At2 At3 Angle Force1 Force2', - $' dAngle/dIteration (MD only)') - 2600 format ('ANGLE RESTRAINT ',3i4,2f8.2,f8.4,f9.6) - 2700 format ('# At1 At2 At3 At3 Angle Force1 ', - $'Force2 dAngle/dIteration (MD only)') - 2800 format ('TORSION RESTRAINT ',4i4,2f8.2,f8.4,f9.6) - 2810 format ('# x/y/z At1 At2 R At3 At4 Force1', - $' Force2 dR/dIteration (MD only)') - 2820 format ('MASCEN RESTRAINT ',a1,1x,2i4,f8.2,2i4,2f8.2,f9.6) - 2830 format ('GEOUPD') - 2840 format ('NO GEOUPD') - 2850 format ('FREQUENCY') - 2900 format ('FORMAT ATOM (a6,1x,i5,1x,a5,1x,a3,1x,a1,1x,a5,', - $'3f10.5,1x,a5,i3,i2,1x,f8.5)') - 3000 format ('HETATM',1x,i5,1x,a2,3x,1x,3x,1x,1x,1x,5x,3f10.5,1x, - $a5,i3,i2,1x,f8.5) - 3100 format ('FORMAT CONECT (a6,12i6)') - 3200 format ('CONECT',12i6) - 3300 format ('UNIT ENERGY kcal') - 3400 format ('ENERGY',5x,f14.6) - 3500 format ('END') - - end -********************************************************************** -********************************************************************** - - subroutine writeen(tottime,sum1,sdev,sdeva,sum12,sumt,sump, - $sumtt,tmax,eaver,eav2,eav3,etot2,ediff) -********************************************************************** -#include "cbka.blk" -#include "cbkcha.blk" -#include "cbkenergies.blk" -#include "cbkrestr.blk" -#include "cbktorang.blk" -#include "cbktorsion.blk" -#include "cbktregime.blk" -#include "control.blk" -#include "small.blk" - - dimension disres(mrestra) -********************************************************************** -* * -* Write out MD statistics to units 71,73 and 76 * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In writeen' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - - if (nrep1.gt.1) - $sdev=sqrt((sum12-sum1*sum1/float(nrep1))/float(nrep1-1)) - eavn=eaver/float(mdstep) - if (mdstep.gt.1) - $sdeva=sqrt((eav3-eav2*eav2/float(mdstep))/float(mdstep-1)) -C open (71,file='fort.71',status='unknown',access='append') -C open (73,file='fort.73',status='unknown',access='append') - write (71,'(i8,2i4,1x,19(f10.2,1x))')mdstep+nprevrun,nmolo, - $nmolo5,estrc,ekin,estrc+ekin,tempmd,sum1/float(nrep1),eavn, - $sumt/float(nrep1),tmax,sump/float(nrep1),sdev,sdeva,tset, - $tstep*1d+15,rmsg,tottime - write (73,'(i8,1x,14(f10.2,1x))')mdstep+nprevrun,eb,ea,elp, - $emol,ev,ecoa,ehb,et,eco,ew,ep,ech,efi - close (71) - close (73) - - if ((sumt/float(nrep1)).gt.tset) then - if (invt.eq.0) write (*,*)'Switched to NVT in iteration',mdstep - invt=1 - end if - -C if (nrestra.gt.0.or.nrestrat.gt.0) -C $open (76,file='fort.76',status='unknown',access='append') - - if (nrestra.gt.0) then - do i2=1,nrestra - call dista2(irstra(i2,1),irstra(i2,2),disres(i2),dx,dy,dz) - end do -C open (76,file='fort.76',status='unknown',access='append') - write (76,'(i8,1x,40f12.4)')mdstep,eres,estrc, - $(rrstra(i2),disres(i2),i2=1,nrestra) - end if - - if (nrestrat.gt.0) then -C open (76,file='fort.76',status='unknown',access='append') - do i2=1,nrestrat - do i3=1,ntor - ih1=irstrat(i2,1) - ih2=irstrat(i2,2) - ih3=irstrat(i2,3) - ih4=irstrat(i2,4) - if (ih1.eq.it(i3,2).and.ih2.eq.it(i3,3).and.ih3.eq.it(i3,4) - $.and.ih4.eq.it(i3,5)) ittr=i3 - end do - write (76,'(i8,1x,40f12.4)')mdstep,eres, - $trstra(i2),thg(ittr) - end do - end if - - if (nrestra.gt.0.or.nrestrat.gt.0) close(76) - - if (nrestram.gt.0) then -C open (76,file='fort.76',status='unknown',access='append') - do i2=1,nrestram - write (76,'(2i8,1x,20f12.4)')mdstep,i2,eres,rmstra1(i2), - $dismacen(i2) - end do - close (76) - end if - - return - end -********************************************************************** -************************************************************************ - - subroutine molanal - -************************************************************************ -#include "cbka.blk" -#include "cbkbo.blk" -#include "cbkconst.blk" -#include "cbkdcell.blk" -#include "cbkff.blk" -#include "cbkia.blk" -#include "cbkrbo.blk" -#include "control.blk" -#include "opt.blk" -#include "small.blk" -#include "cbksrtbon1.blk" - dimension iam(nat,mbond+3),nmolata(nmolmax,nat) - dimension molfra(nmolmax,nsort),ndup(nmolmax) - character*40 qmolan1 - character*100 qmolan - logical found -************************************************************************ -* * -* Analyse and output molecular fragments * -* * -************************************************************************ -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In molanal' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - - do i1=1,nmolmax - do i2=1,nsort - molfra(i1,i2)=0 - end do - ndup(i1)=1 - end do - - do i1=1,na - do i2=1,mbond+3 - iam(i1,i2)=0 - end do - end do -************************************************************************ -* * -* Create connection table based on corrected bond orders * -* * -************************************************************************ - do i1=1,nbon - if (bo(i1).gt.cutof3) then - j1=ib(i1,2) - j2=ib(i1,3) - iam(j1,2)=iam(j1,2)+1 - iam(j1,2+iam(j1,2))=j2 - iam(j2,2)=iam(j2,2)+1 - iam(j2,2+iam(j2,2))=j1 - end if - end do -********************************************************************** -* * -* Find molecules * -* * -********************************************************************** - nmolo6=0 - found=.FALSE. - DO 61 k1=1,na - IF (iam(K1,3+mbond).EQ.0) found=.TRUE. - 61 IF (iam(K1,3+mbond).GT.nmolo6) nmolo6=iam(K1,3+mbond) - IF (.NOT.FOUND) GOTO 62 -************************************************************************ -* * -* Molecule numbers are assigned. No restrictions are made for the * -* sequence of the numbers in the connection table. * -* * -************************************************************************ - N3=1 - 64 N2=N3 - nmolo6=nmolo6+1 - if (nmolo6.gt.nmolmax) stop 'Too many molecules in system' - iam(N2,3+mbond)=nmolo6 - 67 FOUND=.FALSE. - DO 66 N1=N2+1,na - IF (iam(N1,3+mbond).NE.0) GOTO 66 - DO 65 L=1,mbond - IF (iam(N1,l+2).EQ.0) GOTO 66 - IF (iam(iam(N1,l+2),3+mbond).EQ.nmolo6) THEN - FOUND=.TRUE. - iam(N1,3+mbond)=nmolo6 - GOTO 66 - ENDIF - 65 CONTINUE - 66 CONTINUE - IF (FOUND) GOTO 67 - DO 63 N3=N2+1,NA - 63 if (iam(N3,3+mbond).eq.0) goto 64 -************************************************************************ -* * -* The assigned or input molecule numbers are checked for their * -* consistency. * -* * -************************************************************************ - 62 FOUND=.FALSE. - DO 72 N1=1,NA - DO 71 L=1,mbond - IF (iam(N1,L+2).EQ.0) GOTO 72 - IF (iam(iam(N1,L+2),3+mbond).NE.iam(N1,3+mbond)) THEN - FOUND=.TRUE. - ENDIF - 71 CONTINUE - 72 CONTINUE - IF (FOUND) THEN - write (7,'(i4,a40)')na,qmol - do i1=1,na - write (7,'(40i4)')i1,iam(i1,1),(iam(i1,2+i2),i2=1,nsbmax), - $iam(i1,3+mbond) - end do - STOP' Mol.nrs. not consistent; maybe wrong cell parameters' - ENDIF - - do i1=1,nmolo6 - natmol=0 - do i2=1,na - if (iam(i2,3+mbond).eq.i1) then - natmol=natmol+1 - nmolata(i1,natmol+1)=i2 - end if - end do - nmolata(i1,1)=natmol - end do -************************************************************************ -* * -* Analyze molecules * -* * -************************************************************************ - do i1=1,nmolo6 - do i2=1,nmolata(i1,1) - i3=nmolata(i1,1+i2) - ityp=ia(i3,1) - molfra(i1,ityp)=molfra(i1,ityp)+1 - end do - end do - - do i1=1,nmolo6 - isee=0 - do i2=1,nmolo6 - isee2=1 - do i3=1,nso - if (molfra(i1,i3).ne.molfra(i2,i3)) isee2=0 - end do - if (isee2.eq.1.and.i1.gt.i2.and.isee.eq.0) then !molecule type already exists - ndup(i2)=ndup(i2)+1 - ndup(i1)=0 - isee=1 - end if - - end do - end do - -C open (45,file='molfra.out',status='unknown',access='append') - if (mdstep.eq.0) write (45,100)cutof3 - write (45,110) - ntotmol=0 - ntotat=0 - vtotmass=zero - do i1=1,nmolo6 - if (ndup(i1).gt.0) then -* write (45,110)i1,(molfra(i1,i2),i2=1,nso),ndup(i1) - ntotmol=ntotmol+ndup(i1) - qmolan=' ' - qmolan1=' ' - istart=-4 - ihulp=0 - vmass=zero - do i2=1,nso - vmass=vmass+molfra(i1,i2)*amas(i2) - ntotat=ntotat+molfra(i1,i2)*ndup(i1) - if (molfra(i1,i2).gt.0) then - istart=istart+6 - iend=istart+5 - if (molfra(i1,i2).gt.1) then - write (qmolan(istart:iend),'(a2,i3)')qas(i2),molfra(i1,i2) - else - write (qmolan(istart:iend-2),'(a2)')qas(i2) - end if - end if - end do - ihulp=1 - do i2=1,iend - if (qmolan(i2:i2).ne.' ') then - qmolan1(ihulp:ihulp)=qmolan(i2:i2) - ihulp=ihulp+1 - end if - end do - -* write (45,120)ndup(i1),qmolan(1:iend),vmass - write (45,120)mdstep,ndup(i1),qmolan1,vmass - vtotmass=vtotmass+ndup(i1)*vmass - end if - end do - write (45,*)'Total number of molecules:',ntotmol - write (45,*)'Total number of atoms:',ntotat - write (45,*)'Total system mass:',vtotmass - close (45) - return - 100 format('Bond order cutoff:',f6.4) - 110 format('Iteration Freq. Molecular formula',15x,'Molecular mass') - 120 format(i8,i4,' x ',a35,f10.4) - end -************************************************************************ -************************************************************************ - - subroutine stranal(istart,iend,vout,iout,icheck) - -************************************************************************ -#include "cbka.blk" -#include "cbkconst.blk" -#include "opt.blk" - - character*1 qchar - dimension qchar(5) -********************************************************************** -* * -* Analyze string for special characters; find words in string * -* * -********************************************************************** - qchar(1)=' ' - qchar(2)='/' - - ifound1=0 - do i1=istart,200 - ifound2=0 - do i2=1,icheck - - if (qstrana1(i1:i1).eq.qchar(i2)) then - ifound2=1 - if (ifound1.eq.1) then !End of word - iend=i1 - goto 10 - end if - - end if - - end do - - if (ifound2.eq.0.and.ifound1.eq.0) then !Start of word - istart2=i1 - ifound1=1 - end if - - end do - - 10 continue - qstrana2=' ' - vout=zero - iout=0 - - if (ifound1.eq.1) then - qstrana2=qstrana1(istart2:iend-1) - istart=istart2 - vout=zero - read (qstrana2,*,end=20,err=20) vout - 20 iout=int(vout) - end if - - return - end -************************************************************************ -********************************************************************** - - subroutine dipmom(naold,dpmm,xdip,ydip,zdip,xdir,ydir,zdir) - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkch.blk" -#include "cbkconst.blk" -#include "control.blk" -#include "small.blk" -********************************************************************** -* * -* Calculate and output dipole moment * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In dipmom' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if -************************************************************************ -* * -* CONVERSION FACTOR TO DEBYE UNITS IS CALCULATED * -* THE CALCULATION IS INITIALIZED * -* * -************************************************************************ - - ELCHG=1.60217733D-19 ! [C] = [As] - CLIGHT=2.99792458D8 ! [m/s] - DBCONV=ONE/(CLIGHT*ELCHG*1.0D11) - - CHCPX=ZERO - CHCPY=ZERO - CHCPZ=ZERO - CHCMX=ZERO - CHCMY=ZERO - CHCMZ=ZERO - XDIP=ZERO - YDIP=ZERO - ZDIP=ZERO - XGRD=ZERO - YGRD=ZERO - ZGRD=ZERO -************************************************************************ -* * -* CALCULATION OF MAGNITUDE AND CENTRES OF POSITIVE AND NEGATIVE * -* CHARGES * -* * -************************************************************************ - - if (na.eq.0) na=naold - CHRG=ZERO - DO 4 K1=1,NA - CHK1=CH(K1) - IF (CHK1.EQ.ZERO) GOTO 4 - IF (CHK1.LT.ZERO) GOTO 3 - CHRG=CHRG+CHK1 - CHCPX=CHCPX+CHK1*C(K1,1) - CHCPY=CHCPY+CHK1*C(K1,2) - CHCPZ=CHCPZ+CHK1*C(K1,3) - GOTO 4 - 3 CHCMX=CHCMX-CHK1*C(K1,1) - CHCMY=CHCMY-CHK1*C(K1,2) - CHCMZ=CHCMZ-CHK1*C(K1,3) - 4 CONTINUE - -************************************************************************ -* * -* CALCULATION OF DISTANCE BETWEEN CENTRES AND OF DIPOLE MOMENT * -* IN DEBIJE UNITS * -* * -************************************************************************ - - CHDSTX=CHCPX-CHCMX - CHDSTY=CHCPY-CHCMY - CHDSTZ=CHCPZ-CHCMZ - DPMM=SQRT(CHDSTX*CHDSTX+CHDSTY*CHDSTY+CHDSTZ*CHDSTZ)/DBCONV - IF(DPMM.LT.1.0D-4)RETURN - XDIP=HALF*(CHCPX+CHCMX)/CHRG - YDIP=HALF*(CHCPY+CHCMY)/CHRG - ZDIP=HALF*(CHCPZ+CHCMZ)/CHRG - GRTST=MAX(CHDSTX,CHDSTY,CHDSTZ) - XDIR=-CHDSTX/GRTST - YDIR=-CHDSTY/GRTST - ZDIR=-CHDSTZ/GRTST - open (64,file='dipole.out',status='unknown') - write (64,100)dpmm,xdip,ydip,zdip,xdir,ydir,zdir - close (64) - - 100 format ('Dipole moment (Debye):',f12.4,' Location:',3f12.4, - $' Direction (-side):',3f12.4) - return - end -************************************************************************ -********************************************************************** - - subroutine readtraj(ivels) - -********************************************************************** -#include "cbka.blk" -#include "cbkatomcoord.blk" -#include "cbkc.blk" -#include "cbkconst.blk" -#include "cbkdistan.blk" -#include "cbktregime.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "small.blk" -#include "cbkinit.blk" -********************************************************************** -* * -* Read in trajectory file * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In readtraj' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - - open(unit=66,file='moldyn.vel',status='old',err=10) - ivels=1 - read (66,*) - read (66,100)aaxis,baxis,caxis - read (66,100)angles(1),angles(2),angles(3) - if (qr.eq.'F'.or.qr.eq.'P'.or.ngeofor.eq.1) then - axis(1)=aaxis - axis(2)=baxis - axis(3)=caxis - axiss(1)=axis(1) - axiss(2)=axis(2) - axiss(3)=axis(3) - angle(1)=angles(1) - angle(2)=angles(2) - angle(3)=angles(3) - halfa=angle(1)*dgrrdn - hbeta=angle(2)*dgrrdn - hgamma=angle(3)*dgrrdn - sinalf=sin(halfa) - cosalf=cos(halfa) - sinbet=sin(hbeta) - cosbet=cos(hbeta) - cosphi=(cos(hgamma)-cosalf*cosbet)/(sinalf*sinbet) - if (cosphi.gt.1.0) cosphi=1.0 - sinphi=sqrt(one-cosphi*cosphi) - tm11=axis(1)*sinbet*sinphi - tm21=axis(1)*sinbet*cosphi - tm31=axis(1)*cosbet - tm22=axis(2)*sinalf - tm32=axis(2)*cosalf - tm33=axis(3) - end if - if (aaxis.ne.axis(1).or.baxis.ne.axis(2).or.caxis.ne.axis(3)) - $stop 'Wrong cell parameters in moldyn.vel' - read (66,200)nan - if (nan.ne.na) stop 'Wrong number of atoms in moldyn.vel-file' - if (nbiolab.eq.1) write (*,*)'Warning: using labels in vels-file' - read (66,250)((c(i,j),j=1,3),qlabel(i),i=1,na) - read (66,*) - read (66,300)((vel(j,i),j=1,3),i=1,na) - read (66,*) - read (66,300)((accel(j,i),j=1,3),i=1,na) - read (66,*) - read (66,300,end=10,err=10)((aold(j,i),j=1,3),i=1,na) - read (66,*) - read (66,300,end=10,err=10)tempmd - read (66,*) - read (66,350,end=10,err=10)nsbma2 - 10 continue -********************************************************************** -* * -* Format part * -* * -********************************************************************** - 100 format(3d15.8) - 200 format(i4) - 250 format(3d24.15,1x,a5) - 300 format(3d24.15) - 350 format(i3) - 400 format (8i3,8f8.4) - return - end -********************************************************************** diff --git a/lib/reax/reax_lammps.F b/lib/reax/reax_lammps.F deleted file mode 100644 index 116e88827d..0000000000 --- a/lib/reax/reax_lammps.F +++ /dev/null @@ -1,392 +0,0 @@ -********************************************************************** -* * -* REAXFF Reactive force field program * -* * -* Developed and written by Adri van Duin, duin@wag.caltech.edu * -* * -* Copyright (c) 2001-2010 California Institute of Technology * -* * -* This is an open-source program. Feel free to modify its * -* contents. Please keep me informed of any useful modification * -* or addition that you made. Please do not distribute this * -* program to others; if people are interested in obtaining * -* a copy of this program let them contact me first. * -* * -********************************************************************** -********************************************************************** - - subroutine getswb(swb_tmp) - -********************************************************************** -#include "cbka.blk" -#include "cbkff.blk" - real*8 swb_tmp - -********************************************************************** -* * -* Report the value of swb * -* * -********************************************************************** - - swb_tmp = swb - - return - end - -********************************************************************** - - subroutine getswa(swa_tmp) - -********************************************************************** -#include "cbka.blk" -#include "cbkff.blk" - real*8 swa_tmp - -********************************************************************** -* * -* Report the value of swa * -* * -********************************************************************** - - swa_tmp = swa - - return - end - -********************************************************************** - - subroutine getvrange(vrange_tmp) - -********************************************************************** -#include "cbka.blk" -#include "control.blk" - real*8 vrange_tmp - -********************************************************************** -* * -* Report the value of vrange * -* * -********************************************************************** - - vrange_tmp = vrange - - return - end - -********************************************************************** - - subroutine getnvlist(nvlist_tmp) - -********************************************************************** -#include "cbka.blk" - integer nvlist_tmp - -********************************************************************** -* * -* Report the value of nvlist * -* * -********************************************************************** - - nvlist_tmp = nvlist - - return - end - -********************************************************************** - - subroutine getvlbora(vlbora_tmp) - -********************************************************************** -#include "cbka.blk" -#include "control.blk" - real*8 vlbora_tmp - -********************************************************************** -* * -* Report the value of vlbora * -* * -********************************************************************** - - vlbora_tmp = vlbora - - return - end - -********************************************************************** - - subroutine getnval(nval_tmp) - -********************************************************************** -#include "cbka.blk" -#include "cbkvalence.blk" - integer nval_tmp - -********************************************************************** -* * -* Report the value of nval * -* * -********************************************************************** - - nval_tmp = nval - - return - end - -********************************************************************** - - subroutine getntor(ntor_tmp) - -********************************************************************** -#include "cbka.blk" -#include "cbktorsion.blk" - integer ntor_tmp - -********************************************************************** -* * -* Report the value of ntor * -* * -********************************************************************** - - ntor_tmp = ntor - - return - end - - -********************************************************************** - - subroutine getnhb(nhb_tmp) - -********************************************************************** -#include "cbka.blk" -#include "cbksrthb.blk" - integer nhb_tmp - -********************************************************************** -* * -* Report the value of nhb * -* * -********************************************************************** - - nhb_tmp = nhb - - return - end - - -********************************************************************** - - subroutine getnbonall(nbonall_tmp) - -********************************************************************** -#include "cbka.blk" -#include "cbksrtbon1.blk" - integer nbonall_tmp - -********************************************************************** -* * -* Report the value of nbonall * -* * -********************************************************************** - - nbonall_tmp = nbonall - - return - end - - -********************************************************************** - - subroutine getnneighmax(nneighmax_tmp) - -********************************************************************** -#include "cbka.blk" - integer nneighmax_tmp - -********************************************************************** -* * -* Report the value of nneighmax * -* * -********************************************************************** - - nneighmax_tmp = nneighmax - - return - end - -********************************************************************** - - subroutine getnat(nat_tmp) - -********************************************************************** -#include "cbka.blk" - integer nat_tmp - -********************************************************************** -* * -* Report the value of nat * -* * -********************************************************************** - - nat_tmp = nat - - return - end - -********************************************************************** - - subroutine getnattot(nattot_tmp) - -********************************************************************** -#include "cbka.blk" - integer nattot_tmp - -********************************************************************** -* * -* Report the value of nattot * -* * -********************************************************************** - - nattot_tmp = nattot - - return - end - -********************************************************************** - - subroutine getnsort(nsort_tmp) - -********************************************************************** -#include "cbka.blk" - integer nsort_tmp - -********************************************************************** -* * -* Report the value of nsort * -* * -********************************************************************** - - nsort_tmp = nsort - - return - end - -********************************************************************** - - subroutine getmbond(mbond_tmp) - -********************************************************************** -#include "cbka.blk" - integer mbond_tmp - -********************************************************************** -* * -* Report the value of mbond * -* * -********************************************************************** - - mbond_tmp = mbond - - return - end - -********************************************************************** - - subroutine getnso(nso_tmp) - -********************************************************************** -#include "cbka.blk" -#include "cbkff.blk" - integer nso_tmp - -********************************************************************** -* * -* Report the value of nso * -* * -********************************************************************** - - nso_tmp = nso - - return - end - - -********************************************************************** - - subroutine setngeofor(ngeofor_tmp) - -********************************************************************** -#include "cbka.blk" -#include "control.blk" - integer ngeofor_tmp - -********************************************************************** -* * -* Set value of ngeofor -* * -********************************************************************** - - ngeofor = ngeofor_tmp - return - end - -********************************************************************** - - subroutine getnsbmax(nsbmax_tmp) - -********************************************************************** -#include "cbka.blk" -#include "cbksrtbon1.blk" - integer nsbmax_tmp - -********************************************************************** -* * -* Report the value of nsbmax * -* * -********************************************************************** - - nsbmax_tmp = nsbmax - - return - end - -********************************************************************** - - subroutine getnsbma2(nsbma2_tmp) - -********************************************************************** -#include "cbka.blk" -#include "cbksrtbon1.blk" - integer nsbma2_tmp - -********************************************************************** -* * -* Report the value of nsbma2 * -* * -********************************************************************** - - nsbma2_tmp = nsbma2 - - return - end - -********************************************************************** - - subroutine getcutof3(cutof3_tmp) - -********************************************************************** -#include "cbka.blk" -#include "control.blk" - real*8 cutof3_tmp - -********************************************************************** -* * -* Report the value of cutof3 * -* * -********************************************************************** - - cutof3_tmp = cutof3 - - return - end - diff --git a/lib/reax/reax_poten.F b/lib/reax/reax_poten.F deleted file mode 100644 index 2228f8546b..0000000000 --- a/lib/reax/reax_poten.F +++ /dev/null @@ -1,3985 +0,0 @@ -********************************************************************** -* * -* REAXFF Reactive force field program * -* * -* Developed and written by Adri van Duin, duin@wag.caltech.edu * -* * -* Copyright (c) 2001-2010 California Institute of Technology * -* * -* This is an open-source program. Feel free to modify its * -* contents. Please keep me informed of any useful modification * -* or addition that you made. Please do not distribute this * -* program to others; if people are interested in obtaining * -* a copy of this program let them contact me first. * -* * -********************************************************************** -******************************************************************** - - subroutine calval - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkdhdc.blk" -#include "cbkdrdc.blk" -#include "cbkh.blk" -#include "cbkrbo.blk" -#include "cbkvalence.blk" -#include "cellcoord.blk" -#include "control.blk" - dimension a(3),b(3),j(3),dradc(3,3),drbdc(3,3),dtdc(3,3), - $dargdc(3,3),dndc(3,3),dadc(3),dbdc(3) -********************************************************************** -* * -* Calculate valency angles and their derivatives to cartesian * -* coordinates * -* Valency angle energies are calculated in valang * -* * -********************************************************************** -********************************************************************** -* Description of variables used in this routine. -* -* ndebug: stored in cbka.blk; control-parameter -* third: local variable -* twothird: local variable -* dadc(3): local array; stores derivative distance to cartesians -* dbdc(3): local array; stores derivative distance to cartesians -* i1: local do-loop counter -* i2: local do-loop counter -* k1: local do-loop counter -* k2: local do-loop counter -* dradc(3,3): local array; stores derivatives bond lengths to -* cartesians -* drbdc(3,3): local array; stores derivatives bond lengths to -* cartesians -* nval: stored in cbka.blk; number of valence angles -* ity: local integer; atom type -* iv(nvalmax,6): stored in cbka.blk; valence angle identifiers -* j(3): local integer array; stores valence angle atom numbers -* la: local integer: stores bond numbers in valence angle -* lb: local integer: stores bond numbers in valence angle -* ivl1: local integer; stores symmetric copy number of bond -* ivl2: local integer; stores symmetric copy number of bond -* ibsym(nbomax): stored in cbka.blk; symmetric copy number of bond -* isign1: local integer; -1 or 1 -* isign2: local integer; -1 or 1 -* rla: local variable; stores bond length for bond la -* rlb: local variable; stores bond length for bond lb -* rbo(nbomax): stored in cbka.blk; stores bond lengths -* ix1,iy1,iz1,ix2,iy2,iz2: local integers; periodic cell shifts -* a(3): local variable; distance in x,y and z-direction between atoms -* b(3): local variable; distance in x,y and z-direction between atoms -* c(nat,3): stored in cbka.blk; cartesian coordinate array -* tm11,tm21,tm22,tm31,tm32,tm33: stored in cbka.blk; periodic cell -* matrix -* poem: local variable; product of bond lengths -* tel: local variable; cross-product of x,y and z-interatomic -* distances -* arg: local variable; cosine of angle between bonds a and b -* arg2: local variable; square of arg -* s1ma22: local variable; used to check whether angle gets to 180 -* degrees -* s1ma2: local variable; square root of s1ma22 -* hl: local variable; angle (in radians) between bonds a and b -* h(nvamax): stored in cbka.blk; angle (in radians) between bonds a -* and b -* ib(nbomax,3): stored in cbka.blk: bond distance identifiers -* drdc(nbomax,3,2): stored in cbka.blk; derivatives bond distances -* to cartesian coordinates -* dndc(3,3): local variable; temporary storage for calculating -* derivatives of valence angle to cartesians -* dtdc(3,3): local variable; temporary storage for calculating -* derivatives of valence angle to cartesians -* dargdc(3,3): local variable; temporary storage for calculating -* derivatives of valence angle to cartesians -* dhdc(nvamax,3,3): stored in cbka.blk; derivatives of valence angle -* to cartesians -* -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In calval' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - - third=1.0/3.0 - twothird=2.0/3.0 - dadc(1)=-1.0 - dadc(2)=1.0 - dadc(3)=0.0 - dbdc(1)=0.0 - dbdc(2)=1.0 - dbdc(3)=-1.0 - do k1=1,3 - do k2=1,3 - dradc(k1,k2)=0.0 - drbdc(k1,k2)=0.0 - end do - end do - if (nval.eq.0) return - - do 10 i1=1,nval - ity=iv(i1,1) - j(1)=iv(i1,2) - j(2)=iv(i1,3) - j(3)=iv(i1,4) -********************************************************************** -* * -* Determine valency angle * -* * -********************************************************************** - la=iv(i1,5) - lb=iv(i1,6) - ivl1=ibsym(la) - ivl2=ibsym(lb) - isign1=1 - isign2=1 - rla=rbo(la) - rlb=rbo(lb) - - call dista2(j(2),j(1),dis,a(1),a(2),a(3)) - call dista2(j(2),j(3),dis,b(1),b(2),b(3)) - - poem=rla*rlb - tel=a(1)*b(1)+a(2)*b(2)+a(3)*b(3) - arg=tel/poem - arg2=arg*arg - s1ma22=1.0-arg2 - if (s1ma22.lt.1.0d-10) s1ma22=1.0d-10 - s1ma2=sqrt(s1ma22) - if (arg.gt.1.0) arg=1.0 - if (arg.lt.-1.0) arg=-1.0 - hl=acos(arg) - h(i1)=hl -********************************************************************** -* * -* Calculate derivative valency angle to cartesian coordinates * -* * -********************************************************************** - if (j(1).eq.ib(la,2)) then - do k1=1,3 - dradc(k1,1)=drdc(la,k1,1) - dradc(k1,2)=drdc(la,k1,2) - end do - else - do k1=1,3 - dradc(k1,1)=drdc(la,k1,2) - dradc(k1,2)=drdc(la,k1,1) - end do - end if - if (j(2).eq.ib(lb,2)) then - do k1=1,3 - drbdc(k1,2)=drdc(lb,k1,1) - drbdc(k1,3)=drdc(lb,k1,2) - end do - else - do k1=1,3 - drbdc(k1,2)=drdc(lb,k1,2) - drbdc(k1,3)=drdc(lb,k1,1) - end do - end if - do k1=1,3 - do k2=1,3 - dndc(k1,k2)=rla*drbdc(k1,k2)+rlb*dradc(k1,k2) - dtdc(k1,k2)=a(k1)*dbdc(k2)+b(k1)*dadc(k2) - dargdc(k1,k2)=(dtdc(k1,k2)-arg*dndc(k1,k2))/poem - dhdc(i1,k1,k2)=-dargdc(k1,k2)/s1ma2 - end do - end do - - 10 continue - - return - end -********************************************************************** -********************************************************************** - - subroutine boncor - -********************************************************************** -#include "cbka.blk" -#include "cbkabo.blk" -#include "cbkc.blk" -#include "cbkbo.blk" -#include "cbkboncor.blk" -#include "cbkbosi.blk" -#include "cbkbopi.blk" -#include "cbkbopi2.blk" -#include "cbkconst.blk" -#include "cbkdbopi2ndc.blk" -#include "cbkdbopidc.blk" -#include "cbkdbopindc.blk" -#include "cbkff.blk" -#include "cbkia.blk" -#include "cbkidbo.blk" -#include "cbknubon2.blk" -#include "cbkrbo.blk" -#include "control.blk" -#include "small.blk" -#include "cbkdbodc.blk" -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In boncor' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if -********************************************************************** -* * -* Correction for overcoordination and 1-3 bond orders * -* * -********************************************************************** -********************************************************************** -* Description of variables used in this routine. -* -* ndebug: stored in cbka.blk; control-parameter -* i1: local do-loop counter -* i2: local do-loop counter -* k1: local do-loop counter -* k2: local do-loop counter -* nbon: stored in cbka.blk; number of bonds in system -* ibt: local integer; stores bond type -* ib(nbomax,3): stored in cbka.blk: bond distance identifiers -* j1: local integer; stores atom number 1st atom in bond -* j2: local integer; stores atom number 2nd atom in bond -* ovc(nbotym): stored in cbka.blk: force field parameter for -* overcoordination correction -* v13cor(nbotym): stored in cbka.blk: force field parameter for -* 1-3 bond order correction -* idbo1(nbomax): stored in cbka.blk; number of atoms in the -* derivative of the bond order -* idbo(nbomax,2*mbond): stored in cbka.blk; atom numbers of the -* atoms in the derivative of the bond order -* dbondc(nbomax,3,2*mbond): stored in cbka.blk; derivative of -* corrected total bond orders to cartesians -* dbosindc(nbomax,3,2*mbond): stored in cbka.blk; derivative of -* corrected sigma bond orders to cartesians -* dbopindc(nbomax,3,2*mbond): stored in cbka.blk; derivative of -* corrected pi bond orders to cartesians -* dbopi2ndc(nbomax,3,2*mbond): stored in cbka.blk; derivative of -* corrected double pi bond orders to cartesians -* dbodc(nbomax,3,2): stored in cbka.blk; derivative of -* uncorrected total bond orders to cartesians -* dbosidc(nbomax,3,2): stored in cbka.blk; derivative of -* uncorrected sigma bond orders to cartesians -* dbopidc(nbomax,3,2): stored in cbka.blk; derivative of -* uncorrected pi bond orders to cartesians -* dbopi2dc(nbomax,3,2): stored in cbka.blk; derivative of -* uncorrected double pi bond orders to cartesians -* boo: local variable; storage of uncorrected total bond order -* bo(nbomax): stored in cbka.blk; total bond order -* bopi(nbomax): stored in cbka.blk; pi bond order -* bopi2(nbomax): stored in cbka.blk; double pi bond order -* bopio: local variable; storage of uncorrected pi bond order -* bopi2o: local variable; storage of uncorrected double pi bond order -* iti: local integer; atom type first atom in bond -* itj: local integer; atom type second atom in bond -* ia(nat,mbond+3): stored in cbka.blk; connection table without bond -* order cutoff -* aboi: local variable: total bond order around atom i -* aboj: local variable: total bond order around atom j -* abo(nat): stored in cbka.blk; total bond order around atoms -* vp131: local variable; force field cross-term -* vp132: local variable; force field cross-term -* vp133: local variable; force field cross-term -* bo131(nsort): stored in cbka.blk; force field parameter for 1-3 -* bond order correction -* bo132(nsort): stored in cbka.blk; force field parameter for 1-3 -* bond order correction -* bo133(nsort): stored in cbka.blk; force field parameter for 1-3 -* bond order correction -* corrtot:local variable; total correction on bond order -* dbodsboi1: local variable; derivative of bond order to sum of bond -* orders around atom i -* dbodsboj1: local variable; derivative of bond order to sum of bond -* orders around atom j -* ovi: local variable; overcoordination on atom i -* ovj: local variable; overcoordination on atom j -* aval(nat): stored in cbka.blk; nr. of valence electrons on atom -* exphu1: local variable; stores exponential -* exphu2: local variable; stores exponential -* exp11: local variable; stores exponential -* exp21: local variable; stores exponential -* vpar(npamax): stored in cbka.blk: general parameters -* exphu12: local variable; stores sum of exponential -* ovcor: local variable; temporary storage for BO/ovcor corr. -* huli: local variable; temporary storage for BO/ovcor corr. -* hulj: local variable; temporary storage for BO/ovcor corr. -* corr1: local variable; temporary storage for BO/ovcor corr. -* corr2: local variable; temporary storage for BO/ovcor corr. -* dbodsboi2: local variable; derivative of 1-3 BO correction to sum -* of bond orders around atom i -* dbodsboj2: local variable; derivative of 1-3 BO correction to sum -* of bond orders around atom i -* bocor1: local variable; 1-3 bond order correction -* bocor2: local variable; 1-3 bond order correction -* ovi2: local variable; overcoordination on atom i with reference to -* total number of electrons on atom i, including lone -* pairs -* ovj2: local variable; overcoordination on atom j with reference to -* total number of electrons on atom j, including lone -* pairs -* valf(nsort): stored in cbka.blk; total number of electrons on -* atom, including lone pairs -* cor1: local variable; temporary storage for BO/1-3 bond corr. -* cor2: local variable; temporary storage for BO/1-3 bond corr. -* exphu3: local variable; storage exponential -* exphu4: local variable; storage exponential -* corrtot2: local variable; square of corrtot -* dbodboo: local variable; derivative of corrected total bond order to -* uncorrected bond order -* dbopidbopio: local variable; derivative of corrected pi bond order -* to uncorrected pi bond order -* dbopidboo: local variable; derivative of corrected pi bond order -* to uncorrected total bond order -* dbopi2dbopi2o: local variable; derivative of corrected double pi bond order -* to uncorrected double pi bond order -* dbopi2dboo: local variable; derivative of corrected double pi bond order -* to uncorrected total bond order -* dbodsboit: local variable; derivative of total bond order to sum -* of bond orders around atom i -* dbodsbojt: local variable; derivative of total bond order to sum -* of bond orders around atom j -* vhui: local variable; temporary storage -* vhuj: local variable; temporary storage -* dbopidsboit: local variable; derivative of pi bond order to sum -* of bond orders around atom i -* dbopidsbojt: local variable; derivative of pi bond order to sum -* of bond orders around atom j -* dbopi2dsboit: local variable; derivative of pi bond order to sum -* of bond orders around atom i -* dbopi2dsbojt: local variable; derivative of pi bond order to sum -* of bond orders around atom j -* nco: local integer; counter for number of atoms in derivative -* ihl: local integer; helps to access right dbodc-term -* nubon2(nat,mbond): stored in cbka.blk; stored bond number as a -* function of atom number and connection number -* iob: local integer; atom number of second atom in bond -* ncubo: local integer; stores number of current bond -* na: stored in cbka.blk: number of atoms in system -* zero: stored in cbka.blk: value 0.00 -* -********************************************************************** - do 10 i1=1,nbon - ibt=ib(i1,1) - j1=ib(i1,2) - j2=ib(i1,3) - if (ovc(ibt).lt.0.001.and.v13cor(ibt).lt.0.001) then - idbo1(i1)=2 - idbo(i1,1)=j1 - idbo(i1,2)=j2 - do k1=1,3 - dbondc(i1,k1,1)=dbodc(i1,k1,1) - dbondc(i1,k1,2)=dbodc(i1,k1,2) - dbosindc(i1,k1,1)=dbosidc(i1,k1,1) - dbosindc(i1,k1,2)=dbosidc(i1,k1,2) - dbopindc(i1,k1,1)=dbopidc(i1,k1,1) - dbopindc(i1,k1,2)=dbopidc(i1,k1,2) - dbopi2ndc(i1,k1,1)=dbopi2dc(i1,k1,1) - dbopi2ndc(i1,k1,2)=dbopi2dc(i1,k1,2) - end do - goto 10 - end if - boo=bo(i1) - bopio=bopi(i1) - bopi2o=bopi2(i1) - iti=ia(j1,1) - itj=ia(j2,1) - aboi=abo(j1) - aboj=abo(j2) - vp131=sqrt(bo131(iti)*bo131(itj)) - vp132=sqrt(bo132(iti)*bo132(itj)) - vp133=sqrt(bo133(iti)*bo133(itj)) - corrtot=1.0 - dbodsboi1=zero - dbodsboj1=zero - if (ovc(ibt).gt.0.001) then - ovi=aboi-aval(iti) - ovj=aboj-aval(itj) - -********************************************************************** -* * -* Correction for overcoordination * -* * -********************************************************************** - exphu1=exp(-vpar(2)*ovi) - exphu2=exp(-vpar(2)*ovj) - exp11=exp(-vpar(1)*ovi) - exp21=exp(-vpar(1)*ovj) - exphu12=(exphu1+exphu2) - ovcor=-(1.0/vpar(2))*log(0.50*exphu12) -* huli=((1.0/ovc(ibt))*aval(iti)+exp11+exp21) -* hulj=((1.0/ovc(ibt))*aval(itj)+exp11+exp21) - huli=aval(iti)+exp11+exp21 - hulj=aval(itj)+exp11+exp21 - corr1=huli/(huli+ovcor) - corr2=hulj/(hulj+ovcor) - corrtot=0.50*(corr1+corr2) - - dbodsboi1=0.50*(-vpar(1)*exp11/(huli+ovcor)- - $(corr1/(huli+ovcor))* - $(-vpar(1)*exp11+exphu1/exphu12)-vpar(1)*exp11/(hulj+ovcor)- - $(corr2/(hulj+ovcor))*(-vpar(1)*exp11+exphu1/exphu12)) - dbodsboj1=0.50*(-vpar(1)*exp21/(huli+ovcor)- - $(corr1/(huli+ovcor))* - $(-vpar(1)*exp21+exphu2/exphu12)-vpar(1)*exp21/(hulj+ovcor)- - $(corr2/(hulj+ovcor))*(-vpar(1)*exp21+exphu2/exphu12)) - end if -********************************************************************** -* * -* Correction for 1-3 bond orders * -* * -********************************************************************** - dbodsboi2=zero - dbodsboj2=zero - bocor1=1.0 - bocor2=1.0 - if (v13cor(ibt).gt.0.001) then - ovi2=aboi-vval3(iti) !Modification for metal surfaces - ovj2=aboj-vval3(itj) -* ovi2=aboi-valf(iti) -* ovj2=aboj-valf(itj) -* ovi2=aboi-aval(iti) -* ovj2=aboj-aval(itj) - cor1=vp131*boo*boo-ovi2 - cor2=vp131*boo*boo-ovj2 -* exphu3=v13cor(ibt)*exp(-vp132*cor1+vp133) -* exphu4=v13cor(ibt)*exp(-vp132*cor2+vp133) - exphu3=exp(-vp132*cor1+vp133) - exphu4=exp(-vp132*cor2+vp133) - bocor1=1.0/(1.0+exphu3) - bocor2=1.0/(1.0+exphu4) - dbodsboi2=-bocor1*bocor1*bocor2*vp132*exphu3 - dbodsboj2=-bocor1*bocor2*bocor2*vp132*exphu4 - end if - - bo(i1)=boo*corrtot*bocor1*bocor2 - if (bo(i1).lt.1e-10) bo(i1)=zero - corrtot2=corrtot*corrtot - bopi(i1)=bopio*corrtot2*bocor1*bocor2 - bopi2(i1)=bopi2o*corrtot2*bocor1*bocor2 - if (bopi(i1).lt.1e-10) bopi(i1)=zero - if (bopi2(i1).lt.1e-10) bopi2(i1)=zero - - dbodboo=corrtot*bocor1*bocor2+corrtot* - $bocor1*bocor1*bocor2*boo*vp132*vp131*2.0*boo*exphu3+ - $corrtot*bocor1*bocor2*bocor2*boo* - $vp132*vp131*exphu4*2.0*boo - - dbopidbopio=corrtot2*bocor1*bocor2 - - dbopidboo=corrtot2* - $bocor1*bocor1*bocor2*boo*vp132*vp131*2.0*bopio*exphu3+ - $corrtot2*bocor1*bocor2*bocor2*boo* - $vp132*vp131*exphu4*2.0*bopio - - dbopi2dbopi2o=corrtot2*bocor1*bocor2 - - dbopi2dboo=corrtot2* - $bocor1*bocor1*bocor2*boo*vp132*vp131*2.0*bopi2o*exphu3+ - $corrtot2*bocor1*bocor2*bocor2*boo* - $vp132*vp131*exphu4*2.0*bopi2o - - dbodsboit=boo*dbodsboi1*bocor1*bocor2+boo*corrtot*dbodsboi2 - dbodsbojt=boo*dbodsboj1*bocor1*bocor2+boo*corrtot*dbodsboj2 - - vhui=2.0*corrtot*dbodsboi1*bocor1*bocor2+corrtot2*dbodsboi2 - vhuj=2.0*corrtot*dbodsboj1*bocor1*bocor2+corrtot2*dbodsboj2 - dbopidsboit=bopio*vhui - dbopidsbojt=bopio*vhuj - - dbopi2dsboit=bopi2o*vhui - dbopi2dsbojt=bopi2o*vhuj - -********************************************************************** -* * -* Calculate bond order derivatives * -* * -********************************************************************** - idbo1(i1)=2+ia(j1,2)+ia(j2,2) - idbo(i1,1)=j1 - idbo(i1,2)=j2 - nco=0 - do k1=1,3 - dbondc(i1,k1,1)=dbodc(i1,k1,1)*dbodboo - dbondc(i1,k1,2)=dbodc(i1,k1,2)*dbodboo -* dbosindc(i1,k1,1)=dbosidc(i1,k1,1)*dbosidboo -* dbosindc(i1,k1,2)=dbosidc(i1,k1,2)*dbosidboo - dbopindc(i1,k1,1)=dbopidc(i1,k1,1)*dbopidbopio+ - $dbodc(i1,k1,1)*dbopidboo - dbopindc(i1,k1,2)=dbopidc(i1,k1,2)*dbopidbopio+ - $dbodc(i1,k1,2)*dbopidboo - dbopi2ndc(i1,k1,1)=dbopi2dc(i1,k1,1)*dbopi2dbopi2o+ - $dbodc(i1,k1,1)*dbopi2dboo - dbopi2ndc(i1,k1,2)=dbopi2dc(i1,k1,2)*dbopi2dbopi2o+ - $dbodc(i1,k1,2)*dbopi2dboo - end do - do i2=1,ia(j1,2) - ihl=0 - iob=ia(j1,2+i2) - if (iob.lt.j1) ihl=1 - ncubo=nubon2(j1,i2) - idbo(i1,2+nco+1)=iob - do k1=1,3 - dbondc(i1,k1,1)=dbondc(i1,k1,1)+dbodc(ncubo,k1,1+ihl)*dbodsboit - dbondc(i1,k1,2+nco+1)=dbodc(ncubo,k1,2-ihl)*dbodsboit - -* dbosindc(i1,k1,1)=dbosindc(i1,k1,1)+ -* $dbodc(ncubo,k1,1+ihl)*dbosidsboit -* dbosindc(i1,k1,2+nco+1)=dbodc(ncubo,k1,2-ihl)*dbosidsboit - - dbopindc(i1,k1,1)=dbopindc(i1,k1,1)+ - $dbodc(ncubo,k1,1+ihl)*dbopidsboit - dbopindc(i1,k1,2+nco+1)=dbodc(ncubo,k1,2-ihl)*dbopidsboit - - dbopi2ndc(i1,k1,1)=dbopi2ndc(i1,k1,1)+ - $dbodc(ncubo,k1,1+ihl)*dbopi2dsboit - dbopi2ndc(i1,k1,2+nco+1)=dbodc(ncubo,k1,2-ihl)*dbopi2dsboit - - end do - nco=nco+1 - end do - do i2=1,ia(j2,2) - ihl=0 - iob=ia(j2,2+i2) - if (iob.lt.j2) ihl=1 - ncubo=nubon2(j2,i2) - idbo(i1,2+nco+1)=iob - do k1=1,3 - - dbondc(i1,k1,2)=dbondc(i1,k1,2)+dbodc(ncubo,k1,1+ihl)*dbodsbojt - dbondc(i1,k1,2+nco+1)=dbodc(ncubo,k1,2-ihl)*dbodsbojt - -* dbosindc(i1,k1,2)=dbosindc(i1,k1,2)+ -* $dbodc(ncubo,k1,1+ihl)*dbosidsbojt -* dbosindc(i1,k1,2+nco+1)=dbodc(ncubo,k1,2-ihl)*dbosidsbojt - - dbopindc(i1,k1,2)=dbopindc(i1,k1,2)+ - $dbodc(ncubo,k1,1+ihl)*dbopidsbojt - dbopindc(i1,k1,2+nco+1)=dbodc(ncubo,k1,2-ihl)*dbopidsbojt - - dbopi2ndc(i1,k1,2)=dbopi2ndc(i1,k1,2)+ - $dbodc(ncubo,k1,1+ihl)*dbopi2dsbojt - dbopi2ndc(i1,k1,2+nco+1)=dbodc(ncubo,k1,2-ihl)*dbopi2dsbojt - - end do - nco=nco+1 - end do - - 10 continue - - do i1=1,na - abo(i1)=zero - end do -* do i1=1,na -* do i2=1,ia(i1,2) -* iob=ia(i1,2+i2) -* ncubo=nubon2(i1,i2) -* abo(i1)=abo(i1)+bo(ncubo) -* end do -* end do - do i1=1,nbon - j1=ib(i1,2) - j2=ib(i1,3) - abo(j1)=abo(j1)+bo(i1) - if (j1.ne.j2) abo(j2)=abo(j2)+bo(i1) - end do - - 15 continue - return - end -********************************************************************** -********************************************************************** - - subroutine lonpar - -********************************************************************** -#include "cbka.blk" -#include "cbkabo.blk" -#include "cbkconst.blk" -#include "cbkc.blk" -#include "cbkd.blk" -#include "cbkdcell.blk" -#include "cbkenergies.blk" -#include "cbkff.blk" -#include "cbkia.blk" -#include "cbkidbo.blk" -#include "cbklonpar.blk" -#include "cbknubon2.blk" -#include "control.blk" -#include "small.blk" - dimension virial_tmp(3,3),virialsym(6) -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In lonpar' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if -********************************************************************** -* * -* Calculate lone pair energy and first derivatives * -* * -********************************************************************** - elp=zero - do i1=1,na -********************************************************************** -* * -* Determine number of lone pairs on atoms -* * -********************************************************************** - ity=ia(i1,1) - voptlp=0.50*(stlp(ity)-aval(ity)) - vlp(i1)=zero - vund=abo(i1)-stlp(ity) - vlph=2.0*int(vund/2.0) - vlpex=vund-vlph - vp16h=vpar(16)-1.0 - - expvlp=exp(-vpar(16)*(2.0+vlpex)*(2.0+vlpex)) - dvlpdsbo(i1)=-vpar(16)*2.0*(2.0+vlpex)*expvlp - vlp(i1)=expvlp-int(vund/2.0) -* expvlp=exp(-vpar(16)*(2.0+vlpex)) -* dvlpdsbo(i1)=-vpar(16)*expvlp -* expvlp=exp(-6.0*((-0.50*vlpex)**vpar(16))) -* vlp(i1)=(1.0-expvlp)-int(vund/2.0) -* dvlpdsbo(i1)=-0.5*6.0*vpar(16)*((-0.5*vlpex)**vp16h)* -* $expvlp -********************************************************************** -* * -* Calculate lone pair energy * -* * -********************************************************************** - if (i1 .le. na_local) then - - diffvlp=voptlp-vlp(i1) - exphu1=exp(-75.0*diffvlp) - hulp1=1.0/(1.0+exphu1) - elph=vlp1(ity)*diffvlp*hulp1 -* elph=vlp1(ity)*diffvlp - delpdvlp=-vlp1(ity)*hulp1-vlp1(ity)*diffvlp*hulp1*hulp1* - $75.0*exphu1 - - elp=elp+elph - estrain(i1)=estrain(i1)+elph !atom energy - - delpdsbo=delpdvlp*dvlpdsbo(i1) -********************************************************************** -* * -* Calculate first derivative of lone pair energy to * -* cartesian coordinates * -* * -********************************************************************** - do i3=1,ia(i1,2) - iob=ia(i1,2+i3) - ncubo=nubon2(i1,i3) - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - do k1=1,3 - ftmp = delpdsbo*dbondc(ncubo,k1,i4) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ncubo) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - endif - - end do - endif - - end do - - return - end -********************************************************************** -********************************************************************** - - subroutine covbon - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkabo.blk" -#include "cbkbo.blk" -#include "cbkbosi.blk" -#include "cbkbopi.blk" -#include "cbkbopi2.blk" -#include "cbkconst.blk" -#include "cbkcovbon.blk" -#include "cbkd.blk" -#include "cbkdbopi2ndc.blk" -#include "cbkdbopindc.blk" -#include "cbkdcell.blk" -#include "cbkenergies.blk" -#include "cbkff.blk" -#include "cbkia.blk" -#include "cbkidbo.blk" -#include "cbknubon2.blk" -#include "cbkqa.blk" -#include "cbkrbo.blk" -#include "control.blk" -#include "small.blk" - dimension virial_tmp(3,3),virialsym(6) -********************************************************************** -* * -* Calculate bond energy and first derivatives * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In covbon' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - eb=0.0d0 - if (nbon.eq.0) return -********************************************************************** -* * -* Calculate bond energies * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write(65,*) 'Bond forces' -c$$$ write(65,*) 'nbon = ',nbon -c$$$ endif - - do 20 i1=1,nbon - - boa=bo(i1) -* if (boa.lt.cutof2) goto 20 - j1=ib(i1,2) - j2=ib(i1,3) - -c Only compute interaction if both atoms -c are local or else flip a coin - if (j1 .gt. na_local) go to 20 - if (j2 .gt. na_local) then - if (itag(j1) .lt. itag(j2)) go to 20 - if (itag(j1) .eq. itag(j2)) then - if(c(j1,3) .gt. c(j2,3)) go to 20 - if(c(j1,3) .eq. c(j2,3) .and. - $ c(j1,2) .gt. c(j2,2)) go to 20 - if(c(j1,3) .eq. c(j2,3) .and. - $ c(j1,2) .eq. c(j2,2) .and. - $ c(j1,1) .gt. c(j2,1)) go to 20 - endif - endif - vsymm=1.0 - if (j1.eq.j2) vsymm=0.5 - - bopia=bopi(i1) - bopi2a=bopi2(i1) - bosia=boa-bopia-bopi2a - if (bosia.lt.zero) bosia=zero - it1=ia(j1,1) - it2=ia(j2,1) - ibt=ib(i1,1) - de1h=vsymm*de1(ibt) - de2h=vsymm*de2(ibt) - de3h=vsymm*de3(ibt) - - bopo1=bosia**psp(ibt) - exphu1=exp(psi(ibt)*(1.0-bopo1)) - ebh=-de1h*bosia*exphu1-de2h*bopia-de3h*bopi2a - - debdbo=-de1h*exphu1+de1h*exphu1*psp(ibt)*psi(ibt)*bopo1 - debdbopi=-de2h - debdbopi2=-de3h - - eb=eb+ebh - estrain(j1)=estrain(j1)+0.50*ebh !1st atom energy - estrain(j2)=estrain(j2)+0.50*ebh !2nd atom energy - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i2=1,idbo1(i1) - ihu=idbo(i1,i2) - do k1=1,3 - ftmp = debdbo*(dbondc(i1,k1,i2)-dbopindc(i1,k1,i2)- - $dbopi2ndc(i1,k1,i2))+ - $debdbopi*dbopindc(i1,k1,i2)+ - $debdbopi2*dbopi2ndc(i1,k1,i2) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(i1) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i2=1,idbo1(i1) - ihu=idbo(i1,i2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - -********************************************************************** -* * -* Stabilisation terminal triple bond in CO * -* * -********************************************************************** - if (boa.lt.1.00) goto 20 -* Stabilization for all triple bonds (not just for CO) in ReaxFF combustion FF - if (ltripstaball.eq.1 .or. - $ (qa(j1).eq.'C '.and.qa(j2).eq.'O ').or. - $ (qa(j1).eq.'O '.and.qa(j2).eq.'C ')) then - - ba=(boa-2.50)*(boa-2.50) - exphu=exp(-vpar(8)*ba) - oboa=abo(j1)-boa - obob=abo(j2)-boa - exphua1=exp(-vpar(4)*oboa) - exphub1=exp(-vpar(4)*obob) - ovoab=abo(j1)-aval(it1)+abo(j2)-aval(it2) - exphuov=exp(vpar(5)*ovoab) - hulpov=1.0/(1.0+25.0*exphuov) - - estriph=vpar(11)*exphu*hulpov*(exphua1+exphub1) - - eb=eb+estriph - estrain(j1)=estrain(j1)+0.50*estriph !1st atom energy - estrain(j2)=estrain(j2)+0.50*estriph !2nd atom energy - - decobdbo=vpar(4)*vpar(11)*exphu*hulpov*(exphua1+exphub1) - $-2.0*vpar(11)*vpar(8)*(boa-2.50)*hulpov*exphu* - $(exphua1+exphub1) - decobdboua=-25.0*vpar(5)*vpar(11)*exphu*exphuov*hulpov*hulpov* - $(exphua1+exphub1)-vpar(11)*exphu*vpar(4)*hulpov*exphua1 - decobdboub=-25.0*vpar(5)*vpar(11)*exphu*exphuov*hulpov*hulpov* - $(exphua1+exphub1)-vpar(11)*exphu*vpar(4)*hulpov*exphub1 - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i2=1,idbo1(i1) - ihu=idbo(i1,i2) - do k1=1,3 - ftmp = decobdbo*dbondc(i1,k1,i2) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(i1) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i2=1,idbo1(i1) - ihu=idbo(i1,i2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - do i3=1,ia(j1,2) - iob=ia(j1,2+i3) - ncubo=nubon2(j1,i3) - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - do k1=1,3 - ftmp = decobdboua*dbondc(ncubo,k1,i4) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ncubo) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - end do - - do i3=1,ia(j2,2) - iob=ia(j2,2+i3) - ncubo=nubon2(j2,i3) - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - do k1=1,3 - ftmp = decobdboub*dbondc(ncubo,k1,i4) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ncubo) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - end do - - endif - - 20 continue - - return - end -********************************************************************** -********************************************************************** - - subroutine ovcor - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkabo.blk" -#include "cbkbo.blk" -#include "cbkbopi.blk" -#include "cbkbopi2.blk" -#include "cbkconst.blk" -#include "cbkd.blk" -#include "cbkdbopi2ndc.blk" -#include "cbkdbopindc.blk" -#include "cbkdcell.blk" -#include "cbkenergies.blk" -#include "cbkff.blk" -#include "cbkia.blk" -#include "cbkidbo.blk" -#include "cbklonpar.blk" -#include "cbknubon2.blk" -#include "cbkrbo.blk" -#include "control.blk" -#include "small.blk" -********************************************************************** -* * -* Calculate atom energy * -* Correction for over- and undercoordinated atoms * -* * -********************************************************************** - dimension vlptemp(nat) - dimension virial_tmp(3,3),virialsym(6) -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In ovcor' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - do i1=1,na - ity1=ia(i1,1) - vlptemp(i1)=vlp(i1) - if (amas(ity1).gt.21.0) vlptemp(i1)=0.50*(stlp(ity1)-aval(ity1)) !Only for 1st-row elements - end do - 25 ea=zero - eaot=zero - eaut=zero - epen=0.0 - - do 30 i1=1,na_local - ity1=ia(i1,1) - dfvl=1.0 - if (amas(ity1).gt.21.0) dfvl=0.0 !Only for 1st-row elements -********************************************************************** -* * -* Calculate overcoordination energy * -* Valency is corrected for lone pairs * -* * -********************************************************************** - - voptlp=0.50*(stlp(ity1)-aval(ity1)) - diffvlph=dfvl*(voptlp-vlptemp(i1)) -********************************************************************** -* * -* Determine coordination neighboring atoms * -* * -********************************************************************** - sumov=0.0 - sumov2=0.0 - do i3=1,ia(i1,2) - iat2=ia(i1,2+i3) - ity2=ia(iat2,1) - ncubo=nubon2(i1,i3) - if (bo(ncubo).gt.0.0) then - ibt=ib(ncubo,1) - voptlp2=0.50*(stlp(ity2)-aval(ity2)) - diffvlp2=dfvl*(voptlp2-vlptemp(iat2)) - sumov=sumov+(bopi(ncubo)+bopi2(ncubo))* - $(abo(iat2)-aval(ity2)-diffvlp2) - sumov2=sumov2+vover(ibt)*de1(ibt)*bo(ncubo) - endif - end do - - exphu1=exp(vpar(32)*sumov) - vho=1.0/(1.0+vpar(33)*exphu1) - diffvlp=diffvlph*vho - - vov1=abo(i1)-aval(ity1)-diffvlp - dvov1dsumov=diffvlph*vpar(32)*vpar(33)*vho*vho*exphu1 - exphuo=exp(vovun(ity1)*vov1) - hulpo=1.0/(1.0+exphuo) - - hulpp=(1.0/(vov1+aval(ity1)+1e-8)) - - eah=sumov2*hulpp*hulpo*vov1 - deadvov1=-sumov2*hulpp*hulpp*vov1*hulpo+ - $sumov2*hulpp*hulpo-sumov2*hulpp*vov1*vovun(ity1)* - $hulpo*hulpo*exphuo - - ea=ea+eah - estrain(i1)=estrain(i1)+eah !atom energy -********************************************************************** -* * -* Calculate first derivative of overcoordination energy to * -* cartesian coordinates * -* * -********************************************************************** - do i3=1,ia(i1,2) - iob=ia(i1,2+i3) - ncubo=nubon2(i1,i3) - if (bo(ncubo).gt.0.0) then - ibt=ib(ncubo,1) - deadbo=vover(ibt)*de1(ibt)*hulpp*hulpo*vov1 - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - do k1=1,3 - ftmp = deadvov1*(1.0+dfvl*vho*dvlpdsbo(i1))* - $dbondc(ncubo,k1,i4)+deadbo*dbondc(ncubo,k1,i4) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ncubo) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - endif - end do - - do i2=1,ia(i1,2) - - iat2=ia(i1,2+i2) - ity2=ia(iat2,1) - nbosa=nubon2(i1,i2) - if (bo(nbosa).gt.0.0) then - deadvov2=deadvov1*dvov1dsumov*(bopi(nbosa)+bopi2(nbosa)) - - voptlp2=0.50*(stlp(ity2)-aval(ity2)) - diffvlp2=dfvl*(voptlp2-vlptemp(iat2)) - deadpibo=deadvov1*dvov1dsumov*(abo(iat2)-aval(ity2)-diffvlp2) - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i4=1,idbo1(nbosa) - ihu=idbo(nbosa,i4) - do k1=1,3 - ftmp = deadpibo*(dbopindc(nbosa,k1,i4)+ - $dbopi2ndc(nbosa,k1,i4)) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(nbosa) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i4=1,idbo1(nbosa) - ihu=idbo(nbosa,i4) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - endif - - do i3=1,ia(iat2,2) - iob=ia(iat2,2+i3) - ncubo=nubon2(iat2,i3) - if (bo(ncubo).gt.0.0) then - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - do k1=1,3 - ftmp = deadvov2*(1.0+dfvl*dvlpdsbo(iat2))* - $dbondc(ncubo,k1,i4) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ncubo) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - endif - end do - - endif - - end do - -********************************************************************** -* * -* Calculate undercoordination energy * -* * -********************************************************************** - if (valp1(ity1).lt.zero) goto 30 !skip undercoordination - exphu2=exp(vpar(10)*sumov) - vuhu1=1.0+vpar(9)*exphu2 - hulpu2=1.0/vuhu1 - - exphu3=-exp(vpar(7)*vov1) - hulpu3=-(1.0+exphu3) - - dise2=valp1(ity1) - exphuu=exp(-vovun(ity1)*vov1) - hulpu=1.0/(1.0+exphuu) - eahu=dise2*hulpu*hulpu2*hulpu3 - deaudvov1=dise2*hulpu2*vovun(ity1)*hulpu*hulpu*exphuu*hulpu3- - $dise2*hulpu*hulpu2*vpar(7)*exphu3 - - ea=ea+eahu - estrain(i1)=estrain(i1)+eahu !atom energy - - deaudsumov=-dise2*hulpu*vpar(9)*vpar(10)*hulpu3*exphu2* - $hulpu2*hulpu2 - -********************************************************************** -* * -* Calculate first derivative of atom energy to cartesian * -* coordinates * -* * -********************************************************************** - - do i3=1,ia(i1,2) - iob=ia(i1,2+i3) - ncubo=nubon2(i1,i3) - if (bo(ncubo).gt.0.0) then - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - do k1=1,3 - ftmp = deaudvov1*(1.0+dfvl*vho*dvlpdsbo(i1))* - $dbondc(ncubo,k1,i4) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ncubo) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - endif - end do - - do i2=1,ia(i1,2) - - iat2=ia(i1,2+i2) - ity2=ia(iat2,1) - nbosa=nubon2(i1,i2) - if (bo(nbosa).gt.0.0) then - deadvov2=(deaudsumov+dvov1dsumov*deaudvov1)* - $(bopi(nbosa)+bopi2(nbosa)) - - voptlp2=0.50*(stlp(ity2)-aval(ity2)) - diffvlp2=dfvl*(voptlp2-vlptemp(iat2)) - deadpibo1=(dvov1dsumov*deaudvov1+deaudsumov)* - $(abo(iat2)-aval(ity2)-diffvlp2) - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i4=1,idbo1(nbosa) - ihu=idbo(nbosa,i4) - do k1=1,3 - ftmp = deadpibo1* - $(dbopindc(nbosa,k1,i4)+dbopi2ndc(nbosa,k1,i4)) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(nbosa) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i4=1,idbo1(nbosa) - ihu=idbo(nbosa,i4) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - do i3=1,ia(iat2,2) - iob=ia(iat2,2+i3) - ncubo=nubon2(iat2,i3) - if (bo(ncubo).gt.0.0) then - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - do k1=1,3 - ftmp = deadvov2*(1.0+dfvl*dvlpdsbo(iat2))* - $dbondc(ncubo,k1,i4) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ncubo) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - endif - end do - - endif - - end do - - - 30 continue - -********************************************************************** -* * -* Calculate correction for C2 * -* * -********************************************************************** - if (abs(vpar(6)).gt.0.001) then - do 40 i1=1,na_local - ity1=ia(i1,1) - vov4=abo(i1)-aval(ity1) - - do i2=1,ia(i1,2) - iat2=ia(i1,2+i2) - nbohu=nubon2(i1,i2) - if (bo(nbohu).gt.0.0) then - - ibt=ib(nbohu,1) - elph=zero - deahu2dbo=zero - deahu2dsbo=zero - vov3=bo(nbohu)-vov4-0.040*(vov4**4) - if (vov3.gt.3.0) then - elph=vpar(6)*(vov3-3.0)*(vov3-3.0) - deahu2dbo=2.0*vpar(6)*(vov3-3.0) - deahu2dsbo=2.0*vpar(6)*(vov3-3.0)*(-1.0- - $0.16*(vov4**3)) - end if - - elp=elp+elph - estrain(i1)=estrain(i1)+elph !atom energy - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i3=1,idbo1(nbohu) - ihu=idbo(nbohu,i3) - do k1=1,3 - ftmp = deahu2dbo*dbondc(nbohu,k1,i3) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(nbohu) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i3=1,idbo1(nbohu) - ihu=idbo(nbohu,i3) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - do i3=1,ia(i1,2) - iob=ia(i1,2+i3) - ncubo=nubon2(i1,i3) - if (bo(ncubo).gt.0.0) then - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - do k1=1,3 - ftmp = deahu2dsbo*dbondc(ncubo,k1,i4) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ncubo) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - end if - end do - - end if - end do - - 40 continue - end if - - return - end -********************************************************************** -********************************************************************** - - subroutine molen - -********************************************************************** -#include "cbka.blk" -#include "cbkbo.blk" -#include "cbkconst.blk" -#include "cbkc.blk" -#include "cbkd.blk" -#include "cbkenergies.blk" -#include "cbkff.blk" -#include "cbkia.blk" -#include "cbkidbo.blk" -#include "cbknmolat.blk" -#include "cbknubon2.blk" -#include "control.blk" -#include "small.blk" - dimension virial_tmp(3,3),virialsym(6) -********************************************************************** -* * -* Calculate molecular energy and first derivatives * -* Only used to prevent creating virtual electrons * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In molen' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - emol=zero - return - do i1=1,nmolo - - enelm=0.0 - do i2=1,na - if (ia(i2,3+mbond).eq.i1) then - it1=ia(i2,1) - enelm=enelm+aval(it1) - end if - end do - - na1m=nmolat(i1,1) - - enelm=2*int(enelm*0.50) -* enelm=elmol(i1) - bomsum=zero - do i2=1,na1m - ihu=nmolat(i1,i2+1) - do i3=1,ia(ihu,2) - ihu2=nubon2(ihu,i3) - bomsum=bomsum+bo(ihu2) - end do - end do - diff=(bomsum-enelm) - exphu=exp(-vpar(37)*diff) - exphu2=1.0/(1.0+15.0*exphu) - emolh=zero - demoldsbo=zero - emolh=vpar(38)*exphu2 - emol=emol+emolh - demoldsbo=vpar(38)*vpar(37)*15.0*exphu2*exphu2*exphu - - do i2=1,na1m - ihu1=nmolat(i1,i2+1) - do i3=1,ia(ihu1,2) - iob=ia(ihu1,2+i3) - ncubo=nubon2(ihu1,i3) - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - do k1=1,3 - ftmp = demoldsbo*dbondc(ncubo,k1,i4) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ncubo) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i4=1,idbo1(ncubo) - ihu=idbo(ncubo,i4) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - end do - end do - - - end do - - - return - end -********************************************************************** -********************************************************************** - - subroutine valang - -********************************************************************** -#include "cbka.blk" -#include "cbkabo.blk" -#include "cbkbo.blk" -#include "cbkbopi.blk" -#include "cbkbopi2.blk" -#include "cbkconst.blk" -#include "cbkc.blk" -#include "cbkd.blk" -#include "cbkdbopi2ndc.blk" -#include "cbkdbopindc.blk" -#include "cbkdcell.blk" -#include "cbkdhdc.blk" -#include "cbkenergies.blk" -#include "cbkff.blk" -#include "cbkh.blk" -#include "cbkia.blk" -#include "cbkidbo.blk" -#include "cbklonpar.blk" -#include "cbknubon2.blk" -#include "cbkvalence.blk" -#include "control.blk" -#include "valang.blk" -#include "small.blk" - dimension j(3) - dimension virial_tmp(3,3),virialsym(6) -********************************************************************** -* * -* Calculate valency angle energies and first derivatives * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In valang' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if -* eco=0.0 - ev=0.0 - ecoa=0.0 - if (nval.eq.0) return - - do 10 i1=1,nval - ity=iv(i1,1) - j(1)=iv(i1,2) - j(2)=iv(i1,3) - j(3)=iv(i1,4) - - if (j(2) .le. na_local) then - - la=iv(i1,5) - lb=iv(i1,6) - boa=bo(la)-cutof2 - bob=bo(lb)-cutof2 - if (boa.lt.zero.or.bob.lt.zero) goto 10 - - hl=h(i1) ! Calculated earlier in routine calval -********************************************************************** -* * -* Calculate valency angle energy * -* * -********************************************************************** - nbocen=ia(j(2),2) - sbo2=0.0 - vmbo=1.0 - - do i2=1,nbocen - ibv=nubon2(j(2),i2) - if (bo(ibv).gt.0.0) then - vmbo=vmbo*exp(-bo(ibv)**8) - sbo2=sbo2+bopi(ibv)+bopi2(ibv) - endif - end do - - ity2=ia(j(2),1) -* exbo=abo(j(2))-stlp(ia(j(2),1)) - exbo=abo(j(2))-valf(ity2) -* if (exbo.gt.zero) exbo=zero -* expov=exp(vka8(ity)*exbo) -* expov2=exp(-vpar(13)*exbo) -* htov1=2.0+expov2 -* htov2=1.0+expov+expov2 -* evboadj=htov1/htov2 - evboadj=1.0 - expun=exp(-vkac(ity)*exbo) - expun2=exp(vpar(15)*exbo) - htun1=2.0+expun2 - htun2=1.0+expun+expun2 - evboadj2=vval4(ity2)-(vval4(ity2)-1.0)*htun1/htun2 -********************************************************************** -* * -* Calculate number of lone pairs * -* * -********************************************************************** - dsbo2dvlp=(1.0-vmbo) - vlpadj=zero - exlp1=abo(j(2))-stlp(ia(j(2),1)) - exlp2=2.0*int(exlp1/2.0) - exlp=exlp1-exlp2 - if (exlp.lt.zero) then -* expvlp=exp(-vpar(16)*(2.0+exlp)*(2.0+exlp)) -* vlpadj=expvlp-int(exlp1/2.0) -* dsbo2dvlp=(1.0-vmbo)*(1.0-vpar(34)*2.0* -* $(2.0+exlp)*vpar(16)*expvlp) - vlpadj=vlp(j(2)) - dsbo2dvlp=(1.0-vmbo)*(1.0+vpar(34)*dvlpdsbo(j(2))) - end if - - sbo2=sbo2+(1.0-vmbo)*(-exbo-vpar(34)*vlpadj) - dsbo2dvmbo=exbo+vpar(34)*vlpadj - - sbo2h=sbo2 - powv=vpar(17) - if (sbo2.le.0.0) sbo2h=0.0 - if (sbo2.gt.0.0.and.sbo2.le.1.0) sbo2h=sbo2**powv - if (sbo2.gt.1.0.and.sbo2.lt.2.0) sbo2h=2.0-(2.0-sbo2)**powv - if (sbo2.gt.2.0) sbo2h=2.0 - thba=th0(ity) - expsbo=exp(-vpar(18)*(2.0-sbo2h)) - thetao=180.0-thba*(1.0-expsbo) - - thetao=thetao*dgrrdn - thdif=(thetao-hl) - thdi2=thdif*thdif - dthsbo=dgrrdn*thba*vpar(18)*expsbo - if (sbo2.lt.0.0) dthsbo=zero - if (sbo2.gt.0.0.and.sbo2.le.1.0) - $dthsbo=powv*(sbo2**(powv-1.0))*dgrrdn*thba*vpar(18)*expsbo - if (sbo2.gt.1.0.and.sbo2.lt.2.0) - $dthsbo=powv*((2.0-sbo2)**(powv-1.0))*dgrrdn*thba*vpar(18)*expsbo - if (sbo2.gt.2.0) dthsbo=zero - - exphu=vka(ity)*exp(-vka3(ity)*thdi2) - exphu2=vka(ity)-exphu - if (vka(ity).lt.zero) exphu2=exphu2-vka(ity) !To avoid linear Me-H-Me angles (6/6/06) - boap=boa**vval2(ity) - boap2=boa**(vval2(ity)-1.0) - bobp=bob**vval2(ity) - bobp2=bob**(vval2(ity)-1.0) - exa=exp(-vval1(ity2)*boap) - exb=exp(-vval1(ity2)*bobp) - dexadboa=vval2(ity)*vval1(ity2)*exa*boap2 - dexbdbob=vval2(ity)*vval1(ity2)*exb*bobp2 - exa2=(1.0-exa) - exb2=(1.0-exb) - - evh=evboadj2*evboadj*exa2*exb2*exphu2 - devdlb=evboadj2*evboadj*dexbdbob*exa2*exphu2 - devdla=evboadj2*evboadj*dexadboa*exb2*exphu2 - devdsbo=2.0*evboadj2*evboadj*dthsbo*exa2*exb2* - $vka3(ity)*thdif*exphu - devdh=-2.0*evboadj2*evboadj*exa2*exb2*vka3(ity)*thdif*exphu - - devdsbo2= - $evboadj*exa2*exb2*exphu2*(vval4(ity2)-1.0)*(-vpar(15)*expun2/htun2 - $+htun1*(vpar(15)*expun2-vkac(ity)*expun)/(htun2*htun2)) - -* devdsbo2=-evboadj2*exa2*exb2*exphu2*(vpar(13)*expov2/htov2+ -* $htov1*(vka8(ity)*expov-vpar(13)*expov2)/(htov2*htov2))+ -* $evboadj*exa2*exb2*exphu2*(vpar(14)-1.0)*(-vpar(15)*expun2/htun2 -* $+htun1*(vpar(15)*expun2-vkac(ity)*expun)/(htun2*htun2)) - - if (j(2) .le. na_local) then - ev=ev+evh - estrain(j(2))=estrain(j(2))+evh !central atom energy - endif - -* write (64,'(4i8,18f8.2)')mdstep,j(1),j(2),j(3),sbo2,sbo2h, -* $thetao*rdndgr,hl*rdndgr,bo(la),bo(lb),bopi(la), -* $vlp(j(2)),exbo,vlpadj,vmbo,evh,ev,vka(ity) -********************************************************************** -* * -* Calculate penalty for two double bonds in valency angle * -* * -********************************************************************** - exbo=abo(j(2))-aval(ia(j(2),1)) - expov=exp(vpar(22)*exbo) - expov2=exp(-vpar(21)*exbo) - htov1=2.0+expov2 - htov2=1.0+expov+expov2 - ecsboadj=htov1/htov2 - exphu1=exp(-vpar(20)*(boa-2.0)*(boa-2.0)) - exphu2=exp(-vpar(20)*(bob-2.0)*(bob-2.0)) - - epenh=vkap(ity)*ecsboadj*exphu1*exphu2 - estrain(j(2))=estrain(j(2))+epenh - epen=epen+epenh - decoadboa=-2.0*vpar(20)*epenh*(boa-2.0) - decoadbob=-2.0*vpar(20)*epenh*(bob-2.0) - - decdsbo2=-vkap(ity)*exphu1*exphu2*(vpar(21)*expov2/htov2+htov1* - $(vpar(22)*expov-vpar(21)*expov2)/(htov2*htov2)) -********************************************************************** -* * -* Calculate valency angle conjugation energy * -* * -********************************************************************** - unda=abo(j(1))-boa -* ovb=abo(j(2))-valf(ia(j(2),1)) - ovb=abo(j(2))-vval3(ia(j(2),1)) !Modification for Ru 7/6/2004 - - undc=abo(j(3))-bob - ba=(boa-1.50)*(boa-1.50) - bb=(bob-1.50)*(bob-1.50) - exphua=exp(-vpar(31)*ba) - exphub=exp(-vpar(31)*bb) - exphuua=exp(-vpar(39)*unda*unda) - exphuob=exp(vpar(3)*ovb) - exphuuc=exp(-vpar(39)*undc*undc) - hulpob=1.0/(1.0+exphuob) - ecoah=vka8(ity)*exphua*exphub*exphuua*exphuuc*hulpob - decodbola=-2.0*vka8(ity)*(boa-1.50)*vpar(31)*exphua*exphub - $*exphuua*exphuuc*hulpob+vpar(39)*vka8(ity)*exphua*exphub* - $exphuua*exphuuc*hulpob*2.0*unda - decodbolb=-2.0*vka8(ity)*(bob-1.50)*vpar(31)*exphua*exphub - $*exphuua*exphuuc*hulpob+vpar(39)*vka8(ity)*exphua*exphub* - $exphuua*exphuuc*hulpob*2.0*undc - decodboua=-2.0*unda*vka8(ity)*vpar(39)*exphua*exphub - $*exphuua*exphuuc*hulpob - decodbouc=-2.0*undc*vka8(ity)*vpar(39)*exphua*exphub - $*exphuua*exphuuc*hulpob - decodboob=-vka8(ity)*exphua*exphub*exphuua*exphuuc*hulpob* - $hulpob*vpar(3)*exphuob -* decodboob=zero -* decodboua=zero -* decodbouc=zero - - ecoa=ecoa+ecoah - estrain(j(2))=estrain(j(2))+ecoah !central atom energy - -********************************************************************** -* * -* Calculate derivative valency energy to cartesian coordinates * -* * -********************************************************************** - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do k1=1,3 - do k2=1,3 - ftmp = devdh*dhdc(i1,k1,k2) - d(k1,j(k2))=d(k1,j(k2))+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(j(k2),k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/3 - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do k2=1,3 - ihu=j(k2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i2=1,idbo1(la) - ihu=idbo(la,i2) - do k1=1,3 - ftmp = (devdla+decoadboa+decodbola)* - $dbondc(la,k1,i2) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(la) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i2=1,idbo1(la) - ihu=idbo(la,i2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i2=1,idbo1(lb) - ihu=idbo(lb,i2) - do k1=1,3 - ftmp = (devdlb+decoadbob+decodbolb)* - $dbondc(lb,k1,i2) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(lb) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i2=1,idbo1(lb) - ihu=idbo(lb,i2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - do i2=1,nbocen - j5=ia(j(2),2+i2) - ibv=nubon2(j(2),i2) - if (bo(ibv).gt.0.0) then - dvmbodbo=-vmbo*8.0*bo(ibv)**7 - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i3=1,idbo1(ibv) - ihu=idbo(ibv,i3) - do k1=1,3 - ftmp = (-dsbo2dvlp*devdsbo+devdsbo2+decdsbo2 - $+dvmbodbo*dsbo2dvmbo*devdsbo)* - $dbondc(ibv,k1,i3)+devdsbo*(dbopindc(ibv,k1,i3)+ - $dbopi2ndc(ibv,k1,i3)) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ibv) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i3=1,idbo1(ibv) - ihu=idbo(ibv,i3) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - endif - end do - - do i2=1,ia(j(1),2) - j5=ia(j(1),2+i2) - ibv=nubon2(j(1),i2) - if (bo(ibv).gt.0.0) then - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i3=1,idbo1(ibv) - ihu=idbo(ibv,i3) - do k1=1,3 - ftmp = decodboua*dbondc(ibv,k1,i3) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ibv) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i3=1,idbo1(ibv) - ihu=idbo(ibv,i3) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - endif - end do - - do i2=1,ia(j(2),2) - j5=ia(j(2),2+i2) - ibv=nubon2(j(2),i2) - if (bo(ibv).gt.0.0) then - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i3=1,idbo1(ibv) - ihu=idbo(ibv,i3) - do k1=1,3 - ftmp = decodboob*dbondc(ibv,k1,i3) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ibv) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i3=1,idbo1(ibv) - ihu=idbo(ibv,i3) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - endif - end do - - do i2=1,ia(j(3),2) - j5=ia(j(3),2+i2) - ibv=nubon2(j(3),i2) - if (bo(ibv).gt.0.0) then - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i3=1,idbo1(ibv) - ihu=idbo(ibv,i3) - do k1=1,3 - ftmp = decodbouc*dbondc(ibv,k1,i3) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ibv) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i3=1,idbo1(ibv) - ihu=idbo(ibv,i3) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - endif - end do - - endif - - 10 continue - - return - end -********************************************************************** -********************************************************************** - - subroutine hbond - -********************************************************************** -#include "cbka.blk" -#include "cbkbo.blk" -#include "cbkconst.blk" -#include "cbkc.blk" -#include "cbkd.blk" -#include "cbkdcell.blk" -#include "cbkenergies.blk" -#include "cbkidbo.blk" -#include "cbksrthb.blk" -#include "control.blk" -#include "cbkhbond.blk" -#include "small.blk" - dimension drda(3),j(3),dvdc(3,3),dargdc(3,3) - dimension virial_tmp(3,3),virialsym(6) -********************************************************************** -* * -* Calculate hydrogen bond energies and first derivatives * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In hbond' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - ehb=zero - do 10 i1=1,nhb - ityhb=ihb(i1,1) - j(1)=ihb(i1,2) - j(2)=ihb(i1,3) - j(3)=ihb(i1,4) - la=ihb(i1,5) - boa=bo(la) - call dista2(j(2),j(3),rda,dxm,dym,dzm) - drda(1)=dxm/rda - drda(2)=dym/rda - drda(3)=dzm/rda - call calvalhb(j(1),j(2),j(3),ix,iy,iz,arg,hhb(i1),dvdc,dargdc) - rhu1=rhb(ityhb)/rda - rhu2=rda/rhb(ityhb) - sinhu=sin(hhb(i1)/2.0) - sin2=sinhu*sinhu - exphu1=exp(-vhb1(ityhb)*boa) - exphu2=exp(-vhb2(ityhb)*(rhu1+rhu2-2.0)) - if (lhbnew .eq. 0) then - ehbh=(1.0-exphu1)*dehb(ityhb)*exphu2*sin2*sin2*sin2*sin2 - else - ehbh=(1.0-exphu1)*dehb(ityhb)*exphu2*sin2*sin2 - endif - ehb=ehb+ehbh - estrain(j(2))=estrain(j(2))+ehbh !2nd atom energy - -********************************************************************** -* * -* Calculate first derivatives * -* * -********************************************************************** - if (lhbnew .eq. 0) then - dehbdbo=vhb1(ityhb)*exphu1*dehb(ityhb)*exphu2*sin2*sin2* - $ sin2*sin2 - dehbdv=(1.0-exphu1)*dehb(ityhb)*exphu2* - $ 4.0*sin2*sin2*sin2*sinhu*cos(hhb(i1)/2.0) - dehbdrda=(1.0-exphu1)*dehb(ityhb)*sin2*sin2*sin2*sin2* - $ vhb2(ityhb)*(rhb(ityhb)/(rda*rda)-1.0/rhb(ityhb))*exphu2 - else - dehbdbo=vhb1(ityhb)*exphu1*dehb(ityhb)*exphu2*sin2*sin2 - dehbdv=(1.0-exphu1)*dehb(ityhb)*exphu2* - $ 2.0*sin2*sinhu*cos(hhb(i1)/2.0) - dehbdrda=(1.0-exphu1)*dehb(ityhb)*sin2*sin2* - $ vhb2(ityhb)*(rhb(ityhb)/(rda*rda)-1.0/rhb(ityhb))*exphu2 - endif - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do k1=1,3 - ftmp = dehbdrda*drda(k1) - d(k1,j(2))=d(k1,j(2))+ftmp - d(k1,j(3))=d(k1,j(3))-ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ - $ ftmp*c(j(2),k1p)-ftmp*c(j(3),k1p) - end do - endif - - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/2 - do k1 = 1,6 - vtmp = virialsym(k1)*frac - ihu = j(2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - ihu = j(3) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - endif - - endif - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do k1=1,3 - do k2=1,3 - ftmp = dehbdv*dvdc(k1,k2) - d(k1,j(k2))=d(k1,j(k2))+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(j(k2),k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/3 - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do k2=1,3 - ihu=j(k2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i2=1,idbo1(la) - ihu=idbo(la,i2) - do k1=1,3 - ftmp = dehbdbo*dbondc(la,k1,i2) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(la) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i2=1,idbo1(la) - ihu=idbo(la,i2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - 10 continue - return - end - -********************************************************************** -********************************************************************** - - subroutine torang - -********************************************************************** -#include "cbka.blk" -#include "cbkabo.blk" -#include "cbkbo.blk" -#include "cbkbopi.blk" -#include "cbkc.blk" -#include "cbkconst.blk" -#include "cbkd.blk" -#include "cbkdbopindc.blk" -#include "cbkdcell.blk" -#include "cbkdhdc.blk" -#include "cbkdrdc.blk" -#include "cbkenergies.blk" -#include "cbkff.blk" -#include "cbkfftorang.blk" -#include "cbkh.blk" -#include "cbkia.blk" -#include "cbkidbo.blk" -#include "cbkinit.blk" -#include "cbknubon2.blk" -#include "cbkrbo.blk" -#include "cbktorang.blk" -#include "cbktorsion.blk" -#include "cbktregime.blk" -#include "cbkvalence.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "small.blk" - - DIMENSION A(3),DRDA(3),DADC(4),DRADC(3,4),DRBDC(3,4), - $DRCDC(3,4),DHDDC(3,4),DHEDC(3,4),DRVDC(3,4),DTDC(3,4), - $DNDC(3,4) - dimension j(4),dh1rdc(3,3),dh2rdc(3,3),dargdc(3,3) - dimension virial_tmp(3,3),virialsym(6) -********************************************************************** -* * -* Calculate torsion angle energies and first derivatives * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In torang' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - do k1=1,3 - do k2=1,4 - dhddc(k1,k2)=0.0 - dhedc(k1,k2)=0.0 - dradc(k1,k2)=0.0 - drbdc(k1,k2)=0.0 - drcdc(k1,k2)=0.0 - end do - end do - et=0.0 - eth12=0.0 - eco=0.0 - dadc(1)=1.0 - dadc(2)=0.0 - dadc(3)=0.0 - dadc(4)=-1.0 - if (ntor.eq.0) return - - do 10 i1=1,ntor - j(1)=it(i1,2) - j(2)=it(i1,3) - j(3)=it(i1,4) - j(4)=it(i1,5) - - ity=it(i1,1) - la=it(i1,6) - lb=it(i1,7) - lc=it(i1,8) - call calvalres(j(1),j(2),j(3),arg1,ht1,dh1rdc,dargdc) - call calvalres(j(2),j(3),j(4),arg2,ht2,dh2rdc,dargdc) - boa=bo(la)-cutof2 - bob=bo(lb)-cutof2 - boc=bo(lc)-cutof2 - if (boa.lt.zero.or.bob.lt.zero.or.boc.lt.zero) - $goto 10 - r42=0.0 - ivl1=ibsym(la) - ivl2=ibsym(lb) - ivl3=ibsym(lc) - isign1=1 - isign2=1 - isign3=1 - rla=rbo(la) - rlb=rbo(lb) - - call dista2(j(1),j(4),r4,a(1),a(2),a(3)) -********************************************************************** -* * -* Determine torsion angle * -* * -********************************************************************** - d142=r4*r4 - rla=rbo(la) - rlb=rbo(lb) - rlc=rbo(lc) - coshd=cos(ht1) - coshe=cos(ht2) - sinhd=sin(ht1) - sinhe=sin(ht2) - poem=2.0*rla*rlc*sinhd*sinhe - poem2=poem*poem - tel=rla*rla+rlb*rlb+rlc*rlc-d142-2.0*(rla*rlb*coshd-rla*rlc* - $coshd*coshe+rlb*rlc*coshe) - if (poem.lt.1e-20) poem=1e-20 - arg=tel/poem - if (arg.gt.1.0) arg=1.0 - if (arg.lt.-1.0) arg=-1.0 - arg2=arg*arg - thg(i1)=acos(arg)*rdndgr - k1=j(1) - k2=j(2) - k3=j(3) - k4=j(4) - call dista2(k3,k2,dis,x3,y3,z3) - y32z32=y3*y3+z3*z3 - wort1=sqrt(y32z32)+1e-6 - wort2=sqrt(y32z32+x3*x3)+1e-6 -* if (wort1.lt.1e-6) wort1=1e-6 -* if (wort2.lt.1e-6) wort2=1e-6 - sinalf=y3/wort1 - cosalf=z3/wort1 - sinbet=x3/wort2 - cosbet=wort1/wort2 - call dista2(k1,k2,dis,x1,y1,z1) - x1=x1*cosbet-y1*sinalf*sinbet-z1*cosalf*sinbet - y1=y1*cosalf-z1*sinalf - wort3=sqrt(x1*x1+y1*y1)+1e-6 -* if (wort3.lt.1e-6) wort3=1e-6 - singam=y1/wort3 - cosgam=x1/wort3 - call dista2(k4,k2,dis,x4,y4,z4) - x4=x4*cosbet-y4*sinalf*sinbet-z4*cosalf*sinbet - y4=y4*cosalf-z4*sinalf - y4=x4*singam-y4*cosgam - if (y4.gt.0.0) thg(i1)=-thg(i1) - if (thg(i1).lt.-179.999999d0) thg(i1)=-179.999999d0 - if (thg(i1).gt.179.999999d0) thg(i1)=179.999999d0 - th2=thg(i1)*dgrrdn -********************************************************************** -* * -* Calculate torsion angle energy * -* * -********************************************************************** - exbo1=abo(j(2))-valf(ia(j(2),1)) - exbo2=abo(j(3))-valf(ia(j(3),1)) - htovt=exbo1+exbo2 - expov=exp(vpar(26)*htovt) - expov2=exp(-vpar(25)*(htovt)) - htov1=2.0+expov2 - htov2=1.0+expov+expov2 - etboadj=htov1/htov2 - - btb2=bopi(lb)-1.0+etboadj - bo2t=1.0-btb2 - bo2p=bo2t*bo2t - bocor2=exp(v4(ity)*bo2p) - - hsin=sinhd*sinhe - ethhulp=0.50*v1(ity)*(1.0+arg)+v2(ity)*bocor2*(1.0-arg2)+ - $v3(ity)*(0.50+2.0*arg2*arg-1.50*arg) - - exphua=exp(-vpar(24)*boa) - exphub=exp(-vpar(24)*bob) - exphuc=exp(-vpar(24)*boc) - bocor4=(1.0-exphua)*(1.0-exphub)*(1.0-exphuc) - eth=hsin*ethhulp*bocor4 - - detdar=hsin*bocor4*(0.50*v1(ity)-2.0*v2(ity)*bocor2*arg+ - $v3(ity)*(6.0*arg2-1.5d0)) - detdhd=coshd*sinhe*bocor4*ethhulp - detdhe=sinhd*coshe*bocor4*ethhulp - - detdboa=vpar(24)*exphua*(1.0-exphub)*(1.0-exphuc)*ethhulp*hsin - detdbopib=-bocor4*2.0*v4(ity)*v2(ity)* - $bo2t*bocor2*(1.0-arg2)*hsin - detdbob=vpar(24)*exphub*(1.0-exphua)* - $(1.0-exphuc)*ethhulp*hsin - detdboc=vpar(24)*exphuc*(1.0-exphua)* - $(1.0-exphub)*ethhulp*hsin - - detdsbo1=-(detdbopib)* - $(vpar(25)*expov2/htov2+htov1* - $(vpar(26)*expov-vpar(25)*expov2)/(htov2*htov2)) - - et=et+eth - estrain(j(2))=estrain(j(2))+0.50*eth !2nd atom energy - estrain(j(3))=estrain(j(3))+0.50*eth !3rd atom energy - -********************************************************************** -* * -* Calculate conjugation energy * -* * -********************************************************************** - ba=(boa-1.50)*(boa-1.50) - bb=(bob-1.50)*(bob-1.50) - bc=(boc-1.50)*(boc-1.50) - exphua1=exp(-vpar(28)*ba) - exphub1=exp(-vpar(28)*bb) - exphuc1=exp(-vpar(28)*bc) - sbo=exphua1*exphub1*exphuc1 - dbohua=-2.0*(boa-1.50)*vpar(28)*exphua1*exphub1*exphuc1 - dbohub=-2.0*(bob-1.50)*vpar(28)*exphua1*exphub1*exphuc1 - dbohuc=-2.0*(boc-1.50)*vpar(28)*exphua1*exphub1*exphuc1 - arghu0=(arg2-1.0)*sinhd*sinhe - ehulp=vconj(ity)*(arghu0+1.0) - ecoh=ehulp*sbo - decodar=sbo*vconj(ity)*2.0*arg*sinhd*sinhe - decodbola=dbohua*ehulp - decodbolb=dbohub*ehulp - decodbolc=dbohuc*ehulp - decodhd=coshd*sinhe*vconj(ity)*sbo*(arg2-1.0) - decodhe=coshe*sinhd*vconj(ity)*sbo*(arg2-1.0) - - eco=eco+ecoh - estrain(j(2))=estrain(j(2))+0.50*ecoh !2nd atom energy - estrain(j(3))=estrain(j(3))+0.50*ecoh !3rd atom energy - - 1 continue -********************************************************************** -* * -* Calculate derivative torsion angle and conjugation energy * -* to cartesian coordinates * -* * -********************************************************************** - SINTH=SIN(THG(i1)*DGRRDN) - IF (SINTH.GE.0.0.AND.SINTH.LT.1.0D-10) SINTH=1.0D-10 - IF (SINTH.LT.0.0.AND.SINTH.GT.-1.0D-10) SINTH=-1.0D-10 - IF (j(1).EQ.IB(LA,2)) THEN - DO K1=1,3 - DRADC(K1,1)=DRDC(LA,K1,1) - DRADC(K1,2)=DRDC(LA,K1,2) - end do - ELSE - DO K1=1,3 - DRADC(K1,1)=DRDC(LA,K1,2) - DRADC(K1,2)=DRDC(LA,K1,1) - end do - ENDIF - IF (j(2).EQ.IB(LB,2)) THEN - DO K1=1,3 - DRBDC(K1,2)=DRDC(LB,K1,1) - DRBDC(K1,3)=DRDC(LB,K1,2) - end do - ELSE - DO K1=1,3 - DRBDC(K1,2)=DRDC(LB,K1,2) - DRBDC(K1,3)=DRDC(LB,K1,1) - end do - ENDIF - IF (j(3).EQ.IB(LC,2)) THEN - DO K1=1,3 - DRCDC(K1,3)=DRDC(LC,K1,1) - DRCDC(K1,4)=DRDC(LC,K1,2) - end do - ELSE - DO K1=1,3 - DRCDC(K1,3)=DRDC(LC,K1,2) - DRCDC(K1,4)=DRDC(LC,K1,1) - end do - ENDIF - - do k1=1,3 - dhddc(1,k1)=dh1rdc(1,k1) - dhddc(2,k1)=dh1rdc(2,k1) - dhddc(3,k1)=dh1rdc(3,k1) - dhedc(1,k1+1)=dh2rdc(1,k1) - dhedc(2,k1+1)=dh2rdc(2,k1) - dhedc(3,k1+1)=dh2rdc(3,k1) - end do - -********************************************************************** -* write (64,*)j(1),j(2),j(3),j(4) -* do k1=1,3 -* write (64,'(10f12.4)')(dh1rdc(k1,k2),k2=1,3), -* $(dhdc(ld,k1,k2),k2=1,3),(dhddc(k1,k2),k2=1,4) -* write (64,'(10f12.4)')(dh2rdc(k1,k2),k2=1,3), -* $(dhdc(le,k1,k2),k2=1,3),(dhedc(k1,k2),k2=1,4) -* end do -* write (64,*) -********************************************************************** - HTRA=RLA+COSHD*(RLC*COSHE-RLB) - HTRB=RLB-RLA*COSHD-RLC*COSHE - HTRC=RLC+COSHE*(RLA*COSHD-RLB) - HTHD=RLA*SINHD*(RLB-RLC*COSHE) - HTHE=RLC*SINHE*(RLB-RLA*COSHD) - HNRA=RLC*SINHD*SINHE - HNRC=RLA*SINHD*SINHE - HNHD=RLA*RLC*COSHD*SINHE - HNHE=RLA*RLC*SINHD*COSHE - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - DO K1=1,3 - DRDA(K1)=A(K1)/R4 - DO K2=1,4 - DRVDC(K1,K2)=DRDA(K1)*DADC(K2) - DTDC(K1,K2)=2.0*(DRADC(K1,K2)*HTRA+DRBDC(K1,K2)*HTRB+DRCDC(K1,K2 - $)*HTRC-DRVDC(K1,K2)*R4+DHDDC(K1,K2)*HTHD+DHEDC(K1,K2)*HTHE) - DNDC(K1,K2)=2.0*(DRADC(K1,K2)*HNRA+DRCDC(K1,K2)*HNRC+DHDDC(K1,K2 - $)*HNHD+DHEDC(K1,K2)*HNHE) - DARGTDC(i1,K1,K2)=(DTDC(K1,K2)-ARG*DNDC(K1,K2))/POEM - - ftmp = DARGTDC(i1,K1,K2)*detdar+ - $dargtdc(i1,k1,k2)*decodar+(detdhd+decodhd)*dhddc(k1,k2)+ - $(detdhe+decodhe)*dhedc(k1,k2) - D(K1,J(K2))=D(K1,J(K2))+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(j(k2),k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/4 - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do k2=1,4 - ihu=j(k2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i2=1,idbo1(la) - ihu=idbo(la,i2) - do k1=1,3 - ftmp = dbondc(la,k1,i2)*(detdboa+decodbola) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(la) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i2=1,idbo1(la) - ihu=idbo(la,i2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i2=1,idbo1(lb) - ihu=idbo(lb,i2) - do k1=1,3 - ftmp = dbondc(lb,k1,i2)*(detdbob+decodbolb) - $ +dbopindc(lb,k1,i2)*detdbopib - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(lb) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i2=1,idbo1(lb) - ihu=idbo(lb,i2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i2=1,idbo1(lc) - ihu=idbo(lc,i2) - do k1=1,3 - ftmp = dbondc(lc,k1,i2)*(detdboc+decodbolc) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(lc) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i2=1,idbo1(lc) - ihu=idbo(lc,i2) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - do i2=1,ia(j(2),2) - iob=ia(j(2),2+i2) - ncubo=nubon2(j(2),i2) - if (bo(ncubo).gt.0.0) then - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i3=1,idbo1(ncubo) - ihu=idbo(ncubo,i3) - do k1=1,3 - ftmp = detdsbo1*dbondc(ncubo,k1,i3) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ncubo) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i3=1,idbo1(ncubo) - ihu=idbo(ncubo,i3) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - endif - end do - - do i2=1,ia(j(3),2) - iob=ia(j(3),2+i2) - ncubo=nubon2(j(3),i2) - if (bo(ncubo).gt.0.0) then - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do i3=1,idbo1(ncubo) - ihu=idbo(ncubo,i3) - do k1=1,3 - ftmp = detdsbo1*dbondc(ncubo,k1,i3) - d(k1,ihu)=d(k1,ihu)+ftmp - - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k1,k1p)=virial_tmp(k1,k1p)+ftmp*c(ihu,k1p) - end do - endif - - end do - end do - - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/idbo1(ncubo) - do k1 = 1,6 - vtmp = virialsym(k1)*frac - do i3=1,idbo1(ncubo) - ihu=idbo(ncubo,i3) - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - end do - endif - - endif - - endif - end do - - 10 continue - - return - end -********************************************************************** -********************************************************************** - - subroutine nonbon - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkch.blk" -#include "cbkconst.blk" -#include "cbkd.blk" -#include "cbkdcell.blk" -#include "cbkenergies.blk" -#include "cbkff.blk" -#include "cbkia.blk" -#include "cbknonbon.blk" -#include "cbkpairs.blk" -#include "cbknvlown.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "small.blk" - - dimension a(3),da(6) - dimension virial_tmp(3,3),virialsym(6) -********************************************************************** -* * -* Calculate vdWaals and Coulomb energies and derivatives * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In nonbon' -c$$$ call timer(65) -c$$$ end if - - ew=0.0 - ep=0.0 - - c1c=332.0638 - third=one/three - fothird=4.0/3.0 - twothird=2.0/3.0 - h15=(vpar(29)-1.0)/vpar(29) - - nptmp=0 - nstmp=0 - do 10 ivl=1,nvpair-nvlself -c Use precomputed midpoint criterion to decide if interaction is owned. - if (nvlown(ivl).eq.1) then - - i1=nvl1(ivl) - i2=nvl2(ivl) - - call dista2(i1,i2,rr,a(1),a(2),a(3)) - if (rr.gt.swb.or.rr.lt.0.001) goto 10 - - ity1=ia(i1,1) - ity2=ia(i2,1) - imol1=iag(i1,3+mbond) - imol2=iag(i2,3+mbond) - rr2=rr*rr - - sw=1.0 - sw1=0.0 - call taper(rr,rr2) -********************************************************************** -* * -* Calculate vdWaals energy * -* * -********************************************************************** - p1=p1co(ity1,ity2) - p2=p2co(ity1,ity2) - p3=p3co(ity1,ity2) - hulpw=(rr**vpar(29)+gamwco(ity1,ity2)) - rrw=hulpw**(1.0/vpar(29)) - h1=exp(p3*(1.0-rrw/p1)) - h2=exp(0.50*p3*(1.0-rrw/p1)) - - ewh=p2*(h1-2.0*h2) - rrhuw=rr**(vpar(29)-1.0) - dewdr=(p2*p3/p1)*(h2-h1)*rrhuw*(hulpw**(-h15)) - -********************************************************************** -* * -* Calculate Coulomb energy * -* * -********************************************************************** - q1q2=ch(i1)*ch(i2) - hulp1=(rr2*rr+gamcco(ity1,ity2)) - eph=c1c*q1q2/(hulp1**third) - depdr=-c1c*q1q2*rr2/(hulp1**fothird) -********************************************************************** -* * -* Taper correction * -* * -********************************************************************** - ephtap=eph*sw - depdrtap=depdr*sw+eph*sw1 - ewhtap=ewh*sw - dewdrtap=dewdr*sw+ewh*sw1 - -* write (64,*)i1,i2,p1,p2,p3,gamwco(ity1,ity2),vpar(29),ewh,ew - ew=ew+ewhtap - ep=ep+ephtap - estrain(i1)=estrain(i1)+0.50*(ewhtap+ephtap) !1st atom energy - estrain(i2)=estrain(i2)+0.50*(ewhtap+ephtap) !2nd atom energy - -********************************************************************** -* * -* Calculate derivatives vdWaals energy to cartesian * -* coordinates * -* * -********************************************************************** - - if (Lvirial.eq.1) then - do k1=1,3 - do k2=1,3 - virial_tmp(k1,k2) = 0.0 - end do - end do - endif - - do k4=1,3 - ftmp = (dewdrtap+depdrtap)*(a(k4)/rr) - d(k4,i1)=d(k4,i1)+ftmp - d(k4,i2)=d(k4,i2)-ftmp - if (Lvirial.eq.1) then - do k1p=1,3 - virial_tmp(k4,k1p)=virial_tmp(k4,k1p)+ - $ ftmp*c(i1,k1p)-ftmp*c(i2,k1p) - end do - endif - end do - - if (Lvirial.eq.1) then - virialsym(1) = virial_tmp(1,1) - virialsym(2) = virial_tmp(2,2) - virialsym(3) = virial_tmp(3,3) - virialsym(4) = virial_tmp(1,2) - virialsym(5) = virial_tmp(1,3) - virialsym(6) = virial_tmp(2,3) - do k1 = 1,6 - virial(k1) = virial(k1) + virialsym(k1) - end do - - if (Latomvirial.eq.1) then - frac = 1.0d0/2 - do k1 = 1,6 - vtmp = virialsym(k1)*frac - ihu=i1 - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - ihu=i2 - atomvirial(k1,ihu) = atomvirial(k1,ihu) + vtmp - end do - endif - - endif - - endif - - 10 continue - - return - end - -********************************************************************** -********************************************************************** - - subroutine efield - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkch.blk" -#include "cbkcha.blk" -#include "cbkd.blk" -#include "cbkefield.blk" -#include "cbkenergies.blk" -#include "cbktregime.blk" -#include "control.blk" -#include "small.blk" -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In efield' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if -********************************************************************** -* * -* Electric field * -* * -********************************************************************** - efi=0.0 - efix=0.0 - efiy=0.0 - efiz=0.0 - c1c=332.0638 !Coulomb energy conversion - c1=23.02 !conversion from kcal to eV - - if (ifieldx.eq.1) then - do i1=1,na - efih=vfieldx*c1*c1c*ch(i1)*c(i1,1) - efix=efix+efih - estrain(i1)=estrain(i1)+efih !atom energy - - defidc=c1*c1c*vfieldx*ch(i1) - d(1,i1)=d(1,i1)+defidc - end do - end if - - if (ifieldy.eq.1) then - do i1=1,na - efih=vfieldy*c1*c1c*ch(i1)*c(i1,2) - efiy=efiy+efih - estrain(i1)=estrain(i1)+efih !atom energy - - defidc=c1*c1c*vfieldy*ch(i1) - d(2,i1)=d(2,i1)+defidc - end do - end if - - if (ifieldz.eq.1) then - do i1=1,na - efih=vfieldz*c1*c1c*ch(i1)*c(i1,3) - efiz=efiz+efih - estrain(i1)=estrain(i1)+efih !atom energy - - defidc=c1*c1c*vfieldz*ch(i1) - d(3,i1)=d(3,i1)+defidc - end do - end if - - efi=efix+efiy+efiz - return - end -********************************************************************** -********************************************************************** - - subroutine restraint - -********************************************************************** -#include "cbka.blk" -#include "cbkatomcoord.blk" -#include "cbkc.blk" -#include "cbkconst.blk" -#include "cbkd.blk" -#include "cbkenergies.blk" -#include "cbkrestr.blk" -#include "cbktorang.blk" -#include "cbktorsion.blk" -#include "cbktregime.blk" -#include "control.blk" -#include "small.blk" -#include "cbkinit.blk" - dimension drda(3),j(4),dhrdc(3,3),dargdc(3,3) -********************************************************************** -* * -* Calculate distance restraint energy * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In restraint' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - do i1=1,nrestra - ih1=irstra(i1,1) - ih2=irstra(i1,2) - if (itend(i1).eq.0.or.(mdstep.gt.itstart(i1).and.mdstep.lt. - $itend(i1))) then - call dista2(ih1,ih2,rr,dx,dy,dz) - diffr=rr-rrstra(i1) -* diffr=rrstra(i1) - exphu=exp(-vkrst2(i1)*(diffr*diffr)) - erh=vkrstr(i1)*(1.0-exphu) - deresdr=2.0*vkrst2(i1)*diffr*vkrstr(i1)*exphu -* deresdr=-2.0*vkrst2(i1)*diffr*vkrstr(i1)*exphu - eres=eres+erh - drda(1)=dx/rr - drda(2)=dy/rr - drda(3)=dz/rr - do k1=1,3 - d(k1,ih1)=d(k1,ih1)+deresdr*drda(k1) - d(k1,ih2)=d(k1,ih2)-deresdr*drda(k1) - end do - end if - end do - -********************************************************************** -* * -* Calculate angle restraint energy * -* * -********************************************************************** - do i1=1,nrestrav - j(1)=irstrav(i1,1) - j(2)=irstrav(i1,2) - j(3)=irstrav(i1,3) - ittr=0 -* do i2=1,nval -* if (j(1).eq.iv(i2,2).and.j(2).eq.iv(i2,3).and.j(3).eq.iv(i2,4)) -* $ittr=i2 -* end do -* if (ittr.eq.0) stop 'Wrong valence angle restraint' - call calvalres(j(1),j(2),j(3),arg,hr,dhrdc,dargdc) - vaval=hr*rdndgr - diffv=-(vaval-vrstra(i1))*dgrrdn - exphu=exp(-vkr2v(i1)*(diffv*diffv)) - erh=vkrv(i1)*(1.0-exphu) - deresdv=-2.0*vkr2v(i1)*diffv*vkrv(i1)*exphu - eres=eres+erh - do k1=1,3 - do k2=1,3 - d(k1,j(k2))=d(k1,j(k2))+deresdv*dhrdc(k1,k2) - end do - end do - - end do - -********************************************************************** -* * -* Calculate torsion restraint energy * -* * -********************************************************************** - do i1=1,nrestrat - j(1)=irstrat(i1,1) - j(2)=irstrat(i1,2) - j(3)=irstrat(i1,3) - j(4)=irstrat(i1,4) - ittr=0 - do i2=1,ntor - if (j(1).eq.it(i2,2).and.j(2).eq.it(i2,3).and.j(3).eq.it(i2,4) - $.and.j(4).eq.it(i2,5)) ittr=i2 - if (j(4).eq.it(i2,2).and.j(3).eq.it(i2,3).and.j(2).eq.it(i2,4) - $.and.j(1).eq.it(i2,5)) ittr=i2 - end do - if (ittr.eq.0) then - write (*,*)'Wrong torsion restraint' - write (*,*)i1,j(1),j(2),j(3),j(4) - stop 'Wrong torsion restraint' - end if - vtor=thg(ittr) - difft=-(vtor-trstra(i1))*dgrrdn - exphu=exp(-vkr2t(i1)*(difft*difft)) - erh=vkrt(i1)*(1.0-exphu) - deresdt=2.0*vkr2t(i1)*difft*vkrt(i1)*exphu - if (vtor.lt.zero) deresdt=-deresdt - eres=eres+erh - do k1=1,3 - do k2=1,4 - d(k1,j(k2))=d(k1,j(k2))+deresdt*dargtdc(ittr,k1,k2) - end do - end do - - end do -********************************************************************** -* * -* Calculate mass centre restraint energy * -* * -********************************************************************** - do i1=1,nrestram - j1=irstram(i1,2) - j2=irstram(i1,3) - j3=irstram(i1,4) - j4=irstram(i1,5) - kdir=irstram(i1,1) - cmx1=0.0 - cmy1=0.0 - cmz1=0.0 - cmx2=0.0 - cmy2=0.0 - cmz2=0.0 - summas1=0.0 - summas2=0.0 - do i2=j1,j2 - cmx1=cmx1+c(i2,1)*xmasat(i2) - cmy1=cmy1+c(i2,2)*xmasat(i2) - cmz1=cmz1+c(i2,3)*xmasat(i2) - summas1=summas1+xmasat(i2) - end do - cmx1=cmx1/summas1 - cmy1=cmy1/summas1 - cmz1=cmz1/summas1 - if (mdstep.lt.2) then - rmstrax(i1)=cmx1 - rmstray(i1)=cmy1 - rmstraz(i1)=cmz1 - end if - if (kdir.le.3) then - do i2=j3,j4 - cmx2=cmx2+c(i2,1)*xmasat(i2) - cmy2=cmy2+c(i2,2)*xmasat(i2) - cmz2=cmz2+c(i2,3)*xmasat(i2) - summas2=summas2+xmasat(i2) - end do - cmx2=cmx2/summas2 - cmy2=cmy2/summas2 - cmz2=cmz2/summas2 - end if - if (kdir.eq.1) dist=cmx1-cmx2 - if (kdir.eq.2) dist=cmy1-cmy2 - if (kdir.eq.3) dist=cmz1-cmz2 - if (kdir.eq.4) then - distx=cmx1-rmstrax(i1) - disty=cmy1-rmstray(i1) - distz=cmz1-rmstraz(i1) - dist=sqrt(distx*distx+disty*disty+distz*distz) - end if - dismacen(i1)=dist - dist=dist-rmstra1(i1) - erh=rmstra2(i1)*dist*dist - deresdr=2.0*dist*rmstra2(i1) -* exphu=exp(-rmstra3(i1)*(dist*dist)) -* erh=rmstra2(i1)*(1.0-exphu) -* deresdr=2.0*rmstra3(i1)*dist*rmstra2(i1)*exphu - eres=eres+erh - if (kdir.le.3) then - do i2=j1,j2 - d(kdir,i2)=d(kdir,i2)+deresdr*xmasat(i2)/summas1 - end do - do i2=j3,j4 - d(kdir,i2)=d(kdir,i2)-deresdr*xmasat(i2)/summas2 - end do - end if - if (kdir.eq.4.and.mdstep.gt.5) then - do i2=j1,j2 - d(1,i2)=d(1,i2)+deresdr*(distx/dist)*(xmasat(i2)/summas1) - d(2,i2)=d(2,i2)+deresdr*(disty/dist)*(xmasat(i2)/summas1) - d(3,i2)=d(3,i2)+deresdr*(distz/dist)*(xmasat(i2)/summas1) - end do - end if - end do -********************************************************************** -* * -* Calculate morphing energy * -* * -********************************************************************** - if (imorph.eq.1) then - distot=zero - do i1=1,na - dmx=c(i1,1)-cmo(i1,1) - dmy=c(i1,2)-cmo(i1,2) - dmz=c(i1,3)-cmo(i1,3) - dism=sqrt(dmx*dmx+dmy*dmy+dmz*dmz) - distot=distot+dism -* exphu=exp(-vmo2(i1)*(dism*dism)) -* erh=vmo1(i1)*(1.0-exphu) - erh=vmo1(i1)*dism - eres=eres+erh -* deresddis=2.0*vmo2(i1)*dism*vmo1(i1)*exphu - deresddis=vmo1(i1) - drda1=dmx/dism - drda2=dmy/dism - drda3=dmz/dism - d(1,i1)=d(1,i1)+deresddis*drda1 - d(2,i1)=d(2,i1)+deresddis*drda2 - d(3,i1)=d(3,i1)+deresddis*drda3 - end do - - end if - - - return - end -********************************************************************** -******************************************************************** - - subroutine calvalres (ja1,ja2,ja3,arg,hr,dhrdc,dargdc) - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" - dimension a(3),b(3),j(3),dradc(3,3),drbdc(3,3),dtdc(3,3), - $dargdc(3,3),dndc(3,3),dadc(3),dbdc(3),dhrdc(3,3) -********************************************************************** -* * -* Calculate valency angles and their derivatives to cartesian * -* coordinates for restraint calculations * -* * -********************************************************************** -c$$$* if (ndebug.eq.1) then -c$$$C* open (65,file='fort.65',status='unknown',access='append') -c$$$* write (65,*) 'In calvalres' -c$$$* call timer(65) -c$$$* close (65) -c$$$* end if - - dadc(1)=-1.0 - dadc(2)=1.0 - dadc(3)=0.0 - dbdc(1)=0.0 - dbdc(2)=1.0 - dbdc(3)=-1.0 - do k1=1,3 - do k2=1,3 - dradc(k1,k2)=0.0 - drbdc(k1,k2)=0.0 - end do - end do -********************************************************************** -* * -* Determine valency angle * -* * -********************************************************************** - call dista2(ja1,ja2,rla,dx1,dy1,dz1) - call dista2(ja2,ja3,rlb,dx2,dy2,dz2) - - a(1)=-dx1 - a(2)=-dy1 - a(3)=-dz1 - b(1)=dx2 - b(2)=dy2 - b(3)=dz2 - poem=rla*rlb - tel=a(1)*b(1)+a(2)*b(2)+a(3)*b(3) - arg=tel/poem - arg2=arg*arg - s1ma22=1.0-arg2 - if (s1ma22.lt.1.0d-10) s1ma22=1.0d-10 - s1ma2=sqrt(s1ma22) - if (arg.gt.1.0) arg=1.0 - if (arg.lt.-1.0) arg=-1.0 - hr=acos(arg) -********************************************************************** -* * -* Calculate derivative valency angle to cartesian coordinates * -* * -********************************************************************** - do k1=1,3 - dradc(k1,1)=-a(k1)/rla - dradc(k1,2)=a(k1)/rla - end do - - do k1=1,3 - drbdc(k1,2)=b(k1)/rlb - drbdc(k1,3)=-b(k1)/rlb - end do - - do k1=1,3 - do k2=1,3 - dndc(k1,k2)=rla*drbdc(k1,k2)+rlb*dradc(k1,k2) - dtdc(k1,k2)=a(k1)*dbdc(k2)+b(k1)*dadc(k2) - dargdc(k1,k2)=(dtdc(k1,k2)-arg*dndc(k1,k2))/poem - dhrdc(k1,k2)=-dargdc(k1,k2)/s1ma2 - end do - end do - - 10 continue - - return - end -********************************************************************** -******************************************************************** - - subroutine calvalhb (ja1,ja2,ja3,ix,iy,iz,arg,hr,dhrdc,dargdc) - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" - dimension a(3),b(3),j(3),dradc(3,3),drbdc(3,3),dtdc(3,3), - $dargdc(3,3),dndc(3,3),dadc(3),dbdc(3),dhrdc(3,3) -********************************************************************** -* * -* Calculate valency angles and their derivatives to cartesian * -* coordinates for hydrogen bond calculations * -* * -********************************************************************** -c$$$* if (ndebug.eq.1) then -c$$$* open (65,file='fort.65',status='unknown',access='append') -c$$$* write (65,*) 'In calvalhb' -c$$$* call timer(65) -c$$$* close (65) -c$$$* end if - - dadc(1)=-1.0 - dadc(2)=1.0 - dadc(3)=0.0 - dbdc(1)=0.0 - dbdc(2)=1.0 - dbdc(3)=-1.0 - do k1=1,3 - do k2=1,3 - dradc(k1,k2)=0.0 - drbdc(k1,k2)=0.0 - end do - end do -********************************************************************** -* * -* Determine valency angle * -* * -********************************************************************** - call dista2(ja1,ja2,rla,dx1,dy1,dz1) - call dista2(ja2,ja3,rlb,dx2,dy2,dz2) - - a(1)=-dx1 - a(2)=-dy1 - a(3)=-dz1 - b(1)=dx2 - b(2)=dy2 - b(3)=dz2 - poem=rla*rlb - tel=a(1)*b(1)+a(2)*b(2)+a(3)*b(3) - arg=tel/poem - arg2=arg*arg - s1ma22=1.0-arg2 - if (s1ma22.lt.1.0d-10) s1ma22=1.0d-10 - s1ma2=sqrt(s1ma22) - if (arg.gt.1.0) arg=1.0 - if (arg.lt.-1.0) arg=-1.0 - hr=acos(arg) -********************************************************************** -* * -* Calculate derivative valency angle to cartesian coordinates * -* * -********************************************************************** - do k1=1,3 - dradc(k1,1)=-a(k1)/rla - dradc(k1,2)=a(k1)/rla - end do - - do k1=1,3 - drbdc(k1,2)=b(k1)/rlb - drbdc(k1,3)=-b(k1)/rlb - end do - - do k1=1,3 - do k2=1,3 - dndc(k1,k2)=rla*drbdc(k1,k2)+rlb*dradc(k1,k2) - dtdc(k1,k2)=a(k1)*dbdc(k2)+b(k1)*dadc(k2) - dargdc(k1,k2)=(dtdc(k1,k2)-arg*dndc(k1,k2))/poem - dhrdc(k1,k2)=-dargdc(k1,k2)/s1ma2 - end do - end do - - 10 continue - - return - end -********************************************************************** -********************************************************************** - - subroutine caltor(ja1,ja2,ja3,ja4,ht) - -********************************************************************** -#include "cbka.blk" -#include "cbkenergies.blk" -#include "cbktregime.blk" -#include "control.blk" -#include "cbkinit.blk" - DIMENSION A(3),DRDA(3),DADC(4),DRADC(3,4),DRBDC(3,4), - $DRCDC(3,4),DHDDC(3,4),DHEDC(3,4),DRVDC(3,4),DTDC(3,4), - $DNDC(3,4) - dimension j(4),dvdc1(3,3),dargdc1(3,3),dvdc2(3,3),dargdc2(3,3) -********************************************************************** -* * -* Calculate torsion angle (for internal coordinates output) * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In caltor' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - do k1=1,3 - do k2=1,4 - dhddc(k1,k2)=0.0 - dhedc(k1,k2)=0.0 - dradc(k1,k2)=0.0 - drbdc(k1,k2)=0.0 - drcdc(k1,k2)=0.0 - end do - end do - et=0.0 - eco=0.0 - dadc(1)=1.0 - dadc(2)=0.0 - dadc(3)=0.0 - dadc(4)=-1.0 - call dista2(ja1,ja2,rla,dx1,dy1,dz1) - call dista2(ja2,ja3,rlb,dx2,dy2,dz2) - call dista2(ja3,ja4,rlc,dx2,dy2,dz2) - call dista2(ja1,ja4,r4,dx2,dy2,dz2) - call calvalres(ja1,ja2,ja3,arg1,h1,dvdc1,dargdc1) - call calvalres(ja2,ja3,ja4,arg2,h2,dvdc2,dargdc2) -********************************************************************** -* * -* Determine torsion angle * -* * -********************************************************************** - d142=r4*r4 - coshd=cos(h1) - coshe=cos(h2) - sinhd=sin(h1) - sinhe=sin(h2) - poem=2.0*rla*rlc*sinhd*sinhe - poem2=poem*poem - tel=rla*rla+rlb*rlb+rlc*rlc-d142-2.0*(rla*rlb*coshd-rla*rlc* - $coshd*coshe+rlb*rlc*coshe) - arg=tel/poem - if (arg.gt.1.0) arg=1.0 - if (arg.lt.-1.0) arg=-1.0 - arg2=arg*arg - ht=acos(arg)*rdndgr - k1=ja1 - k2=ja2 - k3=ja3 - k4=ja4 - call dista2(k3,k2,dis,x3,y3,z3) - y32z32=y3*y3+z3*z3 - wort1=sqrt(y32z32)+1e-6 - wort2=sqrt(y32z32+x3*x3)+1e-6 - sinalf=y3/wort1 - cosalf=z3/wort1 - sinbet=x3/wort2 - cosbet=wort1/wort2 - call dista2(k1,k2,dis,x1,y1,z1) - x1=x1*cosbet-y1*sinalf*sinbet-z1*cosalf*sinbet - y1=y1*cosalf-z1*sinalf - wort3=sqrt(x1*x1+y1*y1)+1e-6 - singam=y1/wort3 - cosgam=x1/wort3 - call dista2(k4,k2,dis,x4,y4,z4) - x4=x4*cosbet-y4*sinalf*sinbet-z4*cosalf*sinbet - y4=y4*cosalf-z4*sinalf - y4=x4*singam-y4*cosgam - if (y4.gt.0.0) ht=-ht - if (ht.lt.-179.999999d0) ht=-179.999999d0 - if (ht.gt.179.999999d0) ht=179.999999d0 - - return - end -********************************************************************** diff --git a/lib/reax/reax_reac.F b/lib/reax/reax_reac.F deleted file mode 100644 index 73c625d7f1..0000000000 --- a/lib/reax/reax_reac.F +++ /dev/null @@ -1,312 +0,0 @@ -********************************************************************** -* * -* REAXFF Reactive force field program * -* * -* Developed and written by Adri van Duin, duin@wag.caltech.edu * -* * -* Copyright (c) 2001-2010 California Institute of Technology * -* * -* This is an open-source program. Feel free to modify its * -* contents. Please keep me informed of any useful modification * -* or addition that you made. Please do not distribute this * -* program to others; if people are interested in obtaining * -* a copy of this program let them contact me first. * -* * -********************************************************************** -********************************************************************** -* * -* REAXFF Reactive force field program * -* * -* Developed and written by Adri van Duin, duin@wag.caltech.edu * -* * -* Copyright (c) 2001-2010 California Institute of Technology * -* * -* This is an open-source program. Feel free to modify its * -* contents. Please keep me informed of any useful modification * -* or addition that you made. Please do not distribute this * -* program to others; if people are interested in obtaining * -* a copy of this program let them contact me first. * -* * -********************************************************************** -********************************************************************** - - subroutine encalc - -********************************************************************** -#include "cbka.blk" -#include "cbkc.blk" -#include "cbkcha.blk" -#include "cbkconst.blk" -#include "cbkd.blk" -#include "cbkdcell.blk" -#include "cbkenergies.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "small.blk" -********************************************************************** -* * -* Calculate energy and first derivatives * -* * -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In encalc' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if - estrc=0.0 - do i1=1,na - do i2=1,3 - d(i2,i1)=0.0 - estrain(i1)=0.0 - end do - end do - eb=zero - ea=zero - elp=zero - emol=zero - ev=zero - ehb=zero - ecoa=zero - epen=zero - et=zero - eco=zero - eres=zero - eradbo=zero - efi=zero - - if(Lvirial.eq.1) then - do k1 = 1,6 - virial(k1) = zero - end do - endif - - if (Latomvirial.eq.1) then - do i1=1,na - do i2=1,6 - atomvirial(i2,i1)=0.0 - end do - end do - endif - - call boncor - call lonpar - call covbon - call ovcor - - call srtang !Determine valency angles - call srttor !Determine torsion angles -* call srtoop !Determine out of plane angles - call srthb !Determine hydrogen bonds - - call calval - call valang - -* call oopang - - call torang - call hbond - !print *, 'called hbond' - !print *, nchaud - - call nonbon - call efield - - call restraint - -c -c Use this to print out fort.73-style energies -c It only works correctly in serial mode -c -c write (6,'(i8,1x,14(f21.10,1x))')mdstep+nprevrun,eb,ea,elp, -c $emol,ev+epen,ecoa,ehb,et,eco,ew,ep,ech,efi - - estrc=eb+ea+elp+ev+ecoa+emol+epen+et+ehb+eco+ew+ep+ncha2*ech+efi - if (estrc.gt.zero) return - if (estrc.le.zero) then - goto 10 - else - write (*,*)mdstep - write (92,*)eb,ea,elp,ev,ecoa,emol,epen,eoop,et,eco,ew, - $ep,ech,eres,eradbo - stop 'Energy not a number' - end if - - 10 continue - return - end -********************************************************************** -********************************************************************** - - subroutine reaxinit - -********************************************************************** -#include "cbka.blk" -#include "cbkatomcoord.blk" -#include "cbkc.blk" -#include "cbkcha.blk" -#include "cbkconst.blk" -#include "cbkdcell.blk" -#include "cbkdistan.blk" -#include "cbkenergies.blk" -#include "cbkia.blk" -#include "cbkimove.blk" -#include "cbkinit.blk" -#include "cbktregime.blk" -#include "cellcoord.blk" -#include "control.blk" -#include "opt.blk" -#include "small.blk" -********************************************************************** -c$$$ if (ndebug.eq.1) then -c$$$C open (65,file='fort.65',status='unknown',access='append') -c$$$ write (65,*) 'In init' -c$$$ call timer(65) -c$$$ close (65) -c$$$ end if -********************************************************************** -* * -* Initialize variables * -* * -********************************************************************** - convmd=4.184*1.0d26 - pi=3.14159265 - avognr=6.0221367d23 - rdndgr=180.0/pi - dgrrdn=1.0/rdndgr - rgasc=8.314510 - caljou=4.184 - xjouca=1.0/caljou - ech=zero - zero=0.0 - one=1.0 - two=2.0 - three=3.0 - half=one/two - nzero=0 - none=1 - ntwo=2 - nthree=3 - invt=0 - ndata2=0 - iheatf=0 - nradcount=0 - itemp=1 - xinh=zero - ifieldx=0 - ifieldy=0 - ifieldz=0 - mdstep=0 - kx=0 - ky=0 - kz=0 - nit=0 - nbon=0 - angle(1)=90.0 - angle(2)=90.0 - angle(3)=90.0 - axiss(1)=zero - axiss(2)=zero - axiss(3)=zero - do i1=1,nat - id(i1,1)=0 - id(i1,2)=0 - id(i1,3)=0 - end do - icgeo=0 - sumhe=zero - ustime=zero - systime=zero - vpmax=zero - vpmin=zero - dseed=0 - iagain=0 - do i1=1,nat - do i2=1,mbond+3 - ia(i1,i2)=0 - iag(i1,i2)=0 - end do - end do - - ioldchg=0 - na=0 - nrestra=0 - nrestrav=0 - nrestrat=0 - nrestram=0 - tset=tsetor - tm11=axis(1) - tm21=zero - tm31=zero - tm22=axis(2) - tm32=zero - tm33=axis(3) - qruid='NORMAL RUN' -c$$$ do i1=1,nat -c$$$ imove(i1)=1 -c$$$ end do - -********************************************************************** -* * -* Write file headers * -* * -********************************************************************** -Cc open (71,file='fort.71',status='unknown',access='append') -c write (71,10) -c close (71) -Cc open (73,file='fort.73',status='unknown',access='append') -c write (73,20) -c close (73) -c if (ntrc.gt.0) then -Cc open (75,file='fort.75',status='unknown',access='append') -c write (75,30) -c close (75) -c end if -c if (nmethod.eq.4) then -Cc open (59,file='fort.59',status='unknown',access='append') -c write (59,40) -c close (59) -c end if - - return -********************************************************************** -* * -* Format part * -* * -********************************************************************** - 10 format (' Iter. Nmol Epot Ekin Etot ', - $' T(K) Eaver(block) Eaver(total) Taver Tmax ', - $' Pres(MPa) sdev(Epot) sdev(Eaver) Tset Timestep', - $' RMSG Totaltime') - 20 format (' Iter. Ebond Eatom Elp Emol', - $' Eval Ecoa Ehbo Etors Econj', - $' Evdw Ecoul Echarge Efield') - 30 format (' Iter. Tsys Tzone1 Tset1 Tzone2 Tset2') - 40 format (' Iter. a b c px', - $'(MPa) py(MPa) pz(MPa) pset(MPa) Volume ') - end -********************************************************************** -************************************************************************ - -c subroutine timer(nunit) - -************************************************************************ -c#include "cbka.blk" -c#include "cbkinit.blk" -c real timear -c real tarray(2) -c#ifdef _IBM -c call dtime_(tarray,timear) -c#else -c call dtime(tarray,timear) -c#endif - -c ustime=ustime+tarray(1) -c systime=systime+tarray(2) -c write (nunit,100)ustime,systime,ustime+systime -c return -c 100 format ('User time:',f20.4,' System time:',f20.4, -c $' Total time:',f20.4) -c end -************************************************************************ -************************************************************************ diff --git a/lib/reax/small.blk b/lib/reax/small.blk deleted file mode 100644 index 9ec66b6e17..0000000000 --- a/lib/reax/small.blk +++ /dev/null @@ -1,5 +0,0 @@ - common - $/rsmall/ tset,dseed,tempmd,ts2,ts22,nmolo,nmolo5,nbon,na,namov, - $ na_local - - diff --git a/lib/reax/valang.blk b/lib/reax/valang.blk deleted file mode 100644 index c4b0027b8a..0000000000 --- a/lib/reax/valang.blk +++ /dev/null @@ -1,9 +0,0 @@ - - - - common - $/cbkvalang/ vval1(nsort),vval2(nvatym), - $ vval4(nsort),vkac(nvatym),vkap(nvatym), - $ vka3(nvatym),vka8(nvatym),th0(nvatym) - - From 054c52584294905d2982fa747e6a57fbf672410e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 12:07:51 -0500 Subject: [PATCH 25/94] remove REAX and MEAM from src folder --- src/MEAM/Install.sh | 67 --- src/MEAM/README | 11 - src/MEAM/pair_meam.cpp | 949 ------------------------------ src/MEAM/pair_meam.h | 159 ----- src/REAX/Install.sh | 67 --- src/REAX/fix_reax_bonds.cpp | 267 --------- src/REAX/fix_reax_bonds.h | 77 --- src/REAX/pair_reax.cpp | 1067 ---------------------------------- src/REAX/pair_reax.h | 154 ----- src/REAX/pair_reax_fortran.h | 210 ------- 10 files changed, 3028 deletions(-) delete mode 100755 src/MEAM/Install.sh delete mode 100644 src/MEAM/README delete mode 100644 src/MEAM/pair_meam.cpp delete mode 100644 src/MEAM/pair_meam.h delete mode 100755 src/REAX/Install.sh delete mode 100644 src/REAX/fix_reax_bonds.cpp delete mode 100644 src/REAX/fix_reax_bonds.h delete mode 100644 src/REAX/pair_reax.cpp delete mode 100644 src/REAX/pair_reax.h delete mode 100644 src/REAX/pair_reax_fortran.h diff --git a/src/MEAM/Install.sh b/src/MEAM/Install.sh deleted file mode 100755 index 7bfc76c0e2..0000000000 --- a/src/MEAM/Install.sh +++ /dev/null @@ -1,67 +0,0 @@ -# Install/unInstall package files in LAMMPS -# mode = 0/1/2 for uninstall/install/update - -mode=$1 - -# enforce using portable C locale -LC_ALL=C -export LC_ALL - -# arg1 = file, arg2 = file it depends on - -action () { - if (test $mode = 0) then - rm -f ../$1 - elif (! cmp -s $1 ../$1) then - if (test -z "$2" || test -e ../$2) then - cp $1 .. - if (test $mode = 2) then - echo " updating src/$1" - fi - fi - elif (test -n "$2") then - if (test ! -e ../$2) then - rm -f ../$1 - fi - fi -} - -# all package files with no dependencies - -for file in *.cpp *.h; do - test -f ${file} && action $file -done - -# edit 2 Makefile.package files to include/exclude package info - -if (test $1 = 1) then - - if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*meam[^ \t]* //' ../Makefile.package - sed -i -e 's|^PKG_INC =[ \t]*|&-I../../lib/meam |' ../Makefile.package - sed -i -e 's|^PKG_PATH =[ \t]*|&-L../../lib/meam |' ../Makefile.package - sed -i -e 's|^PKG_LIB =[ \t]*|&-lmeam |' ../Makefile.package - sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(meam_SYSINC) |' ../Makefile.package - sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(meam_SYSLIB) |' ../Makefile.package - sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(meam_SYSPATH) |' ../Makefile.package - fi - - if (test -e ../Makefile.package.settings) then - sed -i -e '/^include.*meam.*$/d' ../Makefile.package.settings - # multiline form needed for BSD sed on Macs - sed -i -e '4 i \ -include ..\/..\/lib\/meam\/Makefile.lammps -' ../Makefile.package.settings - fi - -elif (test $1 = 0) then - - if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*meam[^ \t]* //' ../Makefile.package - fi - - if (test -e ../Makefile.package.settings) then - sed -i -e '/^include.*meam.*$/d' ../Makefile.package.settings - fi - -fi diff --git a/src/MEAM/README b/src/MEAM/README deleted file mode 100644 index 2f2bf275fb..0000000000 --- a/src/MEAM/README +++ /dev/null @@ -1,11 +0,0 @@ -This package implements the MEAM potential as a LAMMPS pair style. - -This package uses an external library in lib/meam which must be -compiled before making LAMMPS. See the lib/meam/README file and the -LAMMPS manual for information on building LAMMPS with external -libraries. The settings in the Makefile.lammps file in that directory -must be correct for LAMMPS to build correctly with this package -installed. - -The person who created the MEAM library and this pair style is Greg -Wagner (while at Sandia, now at Northwestern U). diff --git a/src/MEAM/pair_meam.cpp b/src/MEAM/pair_meam.cpp deleted file mode 100644 index 38e8e97810..0000000000 --- a/src/MEAM/pair_meam.cpp +++ /dev/null @@ -1,949 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -/* ---------------------------------------------------------------------- - Contributing author: Greg Wagner (SNL) -------------------------------------------------------------------------- */ - -#include -#include -#include -#include -#include "pair_meam.h" -#include "atom.h" -#include "force.h" -#include "comm.h" -#include "memory.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "memory.h" -#include "error.h" - -using namespace LAMMPS_NS; - -#define MAXLINE 1024 - -enum{FCC,BCC,HCP,DIM,DIAMOND,B1,C11,L12,B2}; -static const int nkeywords = 21; -static const char *keywords[] = { - "Ec","alpha","rho0","delta","lattce", - "attrac","repuls","nn2","Cmin","Cmax","rc","delr", - "augt1","gsmooth_factor","re","ialloy", - "mixture_ref_t","erose_form","zbl", - "emb_lin_neg","bkgd_dyn"}; - -/* ---------------------------------------------------------------------- */ - -PairMEAM::PairMEAM(LAMMPS *lmp) : Pair(lmp) -{ - if (comm->me == 0) - error->warning(FLERR,"THE pair_style meam COMMAND IS OBSOLETE AND " - "WILL BE REMOVED VERY SOON. PLEASE USE meam/c"); - - single_enable = 0; - restartinfo = 0; - one_coeff = 1; - manybody_flag = 1; - - nmax = 0; - rho = rho0 = rho1 = rho2 = rho3 = frhop = NULL; - gamma = dgamma1 = dgamma2 = dgamma3 = arho2b = NULL; - arho1 = arho2 = arho3 = arho3b = t_ave = tsq_ave = NULL; - - maxneigh = 0; - allocated = 0; - scrfcn = dscrfcn = fcpair = NULL; - - nelements = 0; - elements = NULL; - mass = NULL; - - // set comm size needed by this Pair - - comm_forward = 38; - comm_reverse = 30; -} - -/* ---------------------------------------------------------------------- - free all arrays - check if allocated, since class can be destructed when incomplete -------------------------------------------------------------------------- */ - -PairMEAM::~PairMEAM() -{ - meam_cleanup_(); - - memory->destroy(rho); - memory->destroy(rho0); - memory->destroy(rho1); - memory->destroy(rho2); - memory->destroy(rho3); - memory->destroy(frhop); - memory->destroy(gamma); - memory->destroy(dgamma1); - memory->destroy(dgamma2); - memory->destroy(dgamma3); - memory->destroy(arho2b); - - memory->destroy(arho1); - memory->destroy(arho2); - memory->destroy(arho3); - memory->destroy(arho3b); - memory->destroy(t_ave); - memory->destroy(tsq_ave); - - memory->destroy(scrfcn); - memory->destroy(dscrfcn); - memory->destroy(fcpair); - - for (int i = 0; i < nelements; i++) delete [] elements[i]; - delete [] elements; - delete [] mass; - - if (allocated) { - memory->destroy(setflag); - memory->destroy(cutsq); - delete [] map; - delete [] fmap; - } -} - -/* ---------------------------------------------------------------------- */ - -void PairMEAM::compute(int eflag, int vflag) -{ - int i,j,ii,n,inum_half,errorflag; - int *ilist_half,*numneigh_half,**firstneigh_half; - int *numneigh_full,**firstneigh_full; - - if (eflag || vflag) ev_setup(eflag,vflag); - else evflag = vflag_fdotr = eflag_global = vflag_global = - eflag_atom = vflag_atom = 0; - - // grow local arrays if necessary - - if (atom->nmax > nmax) { - memory->destroy(rho); - memory->destroy(rho0); - memory->destroy(rho1); - memory->destroy(rho2); - memory->destroy(rho3); - memory->destroy(frhop); - memory->destroy(gamma); - memory->destroy(dgamma1); - memory->destroy(dgamma2); - memory->destroy(dgamma3); - memory->destroy(arho2b); - memory->destroy(arho1); - memory->destroy(arho2); - memory->destroy(arho3); - memory->destroy(arho3b); - memory->destroy(t_ave); - memory->destroy(tsq_ave); - - nmax = atom->nmax; - - memory->create(rho,nmax,"pair:rho"); - memory->create(rho0,nmax,"pair:rho0"); - memory->create(rho1,nmax,"pair:rho1"); - memory->create(rho2,nmax,"pair:rho2"); - memory->create(rho3,nmax,"pair:rho3"); - memory->create(frhop,nmax,"pair:frhop"); - memory->create(gamma,nmax,"pair:gamma"); - memory->create(dgamma1,nmax,"pair:dgamma1"); - memory->create(dgamma2,nmax,"pair:dgamma2"); - memory->create(dgamma3,nmax,"pair:dgamma3"); - memory->create(arho2b,nmax,"pair:arho2b"); - memory->create(arho1,nmax,3,"pair:arho1"); - memory->create(arho2,nmax,6,"pair:arho2"); - memory->create(arho3,nmax,10,"pair:arho3"); - memory->create(arho3b,nmax,3,"pair:arho3b"); - memory->create(t_ave,nmax,3,"pair:t_ave"); - memory->create(tsq_ave,nmax,3,"pair:tsq_ave"); - } - - // neighbor list info - - inum_half = listhalf->inum; - ilist_half = listhalf->ilist; - numneigh_half = listhalf->numneigh; - firstneigh_half = listhalf->firstneigh; - numneigh_full = listfull->numneigh; - firstneigh_full = listfull->firstneigh; - - // strip neighbor lists of any special bond flags before using with MEAM - // necessary before doing neigh_f2c and neigh_c2f conversions each step - - if (neighbor->ago == 0) { - neigh_strip(inum_half,ilist_half,numneigh_half,firstneigh_half); - neigh_strip(inum_half,ilist_half,numneigh_full,firstneigh_full); - } - - // check size of scrfcn based on half neighbor list - - int nlocal = atom->nlocal; - int nall = nlocal + atom->nghost; - - n = 0; - for (ii = 0; ii < inum_half; ii++) n += numneigh_half[ilist_half[ii]]; - - if (n > maxneigh) { - memory->destroy(scrfcn); - memory->destroy(dscrfcn); - memory->destroy(fcpair); - maxneigh = n; - memory->create(scrfcn,maxneigh,"pair:scrfcn"); - memory->create(dscrfcn,maxneigh,"pair:dscrfcn"); - memory->create(fcpair,maxneigh,"pair:fcpair"); - } - - // zero out local arrays - - for (i = 0; i < nall; i++) { - rho0[i] = 0.0; - arho2b[i] = 0.0; - arho1[i][0] = arho1[i][1] = arho1[i][2] = 0.0; - for (j = 0; j < 6; j++) arho2[i][j] = 0.0; - for (j = 0; j < 10; j++) arho3[i][j] = 0.0; - arho3b[i][0] = arho3b[i][1] = arho3b[i][2] = 0.0; - t_ave[i][0] = t_ave[i][1] = t_ave[i][2] = 0.0; - tsq_ave[i][0] = tsq_ave[i][1] = tsq_ave[i][2] = 0.0; - } - - double **x = atom->x; - double **f = atom->f; - int *type = atom->type; - int ntype = atom->ntypes; - - // change neighbor list indices to Fortran indexing - - neigh_c2f(inum_half,ilist_half,numneigh_half,firstneigh_half); - neigh_c2f(inum_half,ilist_half,numneigh_full,firstneigh_full); - - // 3 stages of MEAM calculation - // loop over my atoms followed by communication - - int ifort; - int offset = 0; - errorflag = 0; - - for (ii = 0; ii < inum_half; ii++) { - i = ilist_half[ii]; - ifort = i+1; - meam_dens_init_(&ifort,&nmax,&ntype,type,fmap,&x[0][0], - &numneigh_half[i],firstneigh_half[i], - &numneigh_full[i],firstneigh_full[i], - &scrfcn[offset],&dscrfcn[offset],&fcpair[offset], - rho0,&arho1[0][0],&arho2[0][0],arho2b, - &arho3[0][0],&arho3b[0][0],&t_ave[0][0],&tsq_ave[0][0], - &errorflag); - if (errorflag) { - char str[128]; - sprintf(str,"MEAM library error %d",errorflag); - error->one(FLERR,str); - } - offset += numneigh_half[i]; - } - - comm->reverse_comm_pair(this); - - meam_dens_final_(&nlocal,&nmax,&eflag_either,&eflag_global,&eflag_atom, - &eng_vdwl,eatom,&ntype,type,fmap, - &arho1[0][0],&arho2[0][0],arho2b,&arho3[0][0], - &arho3b[0][0],&t_ave[0][0],&tsq_ave[0][0],gamma,dgamma1, - dgamma2,dgamma3,rho,rho0,rho1,rho2,rho3,frhop,&errorflag); - if (errorflag) { - char str[128]; - sprintf(str,"MEAM library error %d",errorflag); - error->one(FLERR,str); - } - - comm->forward_comm_pair(this); - - offset = 0; - - // vptr is first value in vatom if it will be used by meam_force() - // else vatom may not exist, so pass dummy ptr - - double *vptr; - if (vflag_atom) vptr = &vatom[0][0]; - else vptr = &cutmax; - - for (ii = 0; ii < inum_half; ii++) { - i = ilist_half[ii]; - ifort = i+1; - meam_force_(&ifort,&nmax,&eflag_either,&eflag_global,&eflag_atom, - &vflag_atom,&eng_vdwl,eatom,&ntype,type,fmap,&x[0][0], - &numneigh_half[i],firstneigh_half[i], - &numneigh_full[i],firstneigh_full[i], - &scrfcn[offset],&dscrfcn[offset],&fcpair[offset], - dgamma1,dgamma2,dgamma3,rho0,rho1,rho2,rho3,frhop, - &arho1[0][0],&arho2[0][0],arho2b,&arho3[0][0],&arho3b[0][0], - &t_ave[0][0],&tsq_ave[0][0],&f[0][0],vptr,&errorflag); - if (errorflag) { - char str[128]; - sprintf(str,"MEAM library error %d",errorflag); - error->one(FLERR,str); - } - offset += numneigh_half[i]; - } - - // change neighbor list indices back to C indexing - - neigh_f2c(inum_half,ilist_half,numneigh_half,firstneigh_half); - neigh_f2c(inum_half,ilist_half,numneigh_full,firstneigh_full); - - if (vflag_fdotr) virial_fdotr_compute(); -} - -/* ---------------------------------------------------------------------- */ - -void PairMEAM::allocate() -{ - allocated = 1; - int n = atom->ntypes; - - memory->create(setflag,n+1,n+1,"pair:setflag"); - memory->create(cutsq,n+1,n+1,"pair:cutsq"); - - map = new int[n+1]; - fmap = new int[n]; -} - -/* ---------------------------------------------------------------------- - global settings -------------------------------------------------------------------------- */ - -void PairMEAM::settings(int narg, char **/*arg*/) -{ - if (narg != 0) error->all(FLERR,"Illegal pair_style command"); -} - -/* ---------------------------------------------------------------------- - set coeffs for one or more type pairs -------------------------------------------------------------------------- */ - -void PairMEAM::coeff(int narg, char **arg) -{ - int i,j,m,n; - - if (!allocated) allocate(); - - if (narg < 6) error->all(FLERR,"Incorrect args for pair coefficients"); - - // insure I,J args are * * - - if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0) - error->all(FLERR,"Incorrect args for pair coefficients"); - - // read MEAM element names between 2 filenames - // nelements = # of MEAM elements - // elements = list of unique element names - - if (nelements) { - for (i = 0; i < nelements; i++) delete [] elements[i]; - delete [] elements; - delete [] mass; - } - nelements = narg - 4 - atom->ntypes; - if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients"); - elements = new char*[nelements]; - mass = new double[nelements]; - - for (i = 0; i < nelements; i++) { - n = strlen(arg[i+3]) + 1; - elements[i] = new char[n]; - strcpy(elements[i],arg[i+3]); - } - - // read MEAM library and parameter files - // pass all parameters to MEAM package - // tell MEAM package that setup is done - - read_files(arg[2],arg[2+nelements+1]); - meam_setup_done_(&cutmax); - - // read args that map atom types to MEAM elements - // map[i] = which element the Ith atom type is, -1 if not mapped - - for (i = 4 + nelements; i < narg; i++) { - m = i - (4+nelements) + 1; - for (j = 0; j < nelements; j++) - if (strcmp(arg[i],elements[j]) == 0) break; - if (j < nelements) map[m] = j; - else if (strcmp(arg[i],"NULL") == 0) map[m] = -1; - else error->all(FLERR,"Incorrect args for pair coefficients"); - } - - // clear setflag since coeff() called once with I,J = * * - - n = atom->ntypes; - for (int i = 1; i <= n; i++) - for (int j = i; j <= n; j++) - setflag[i][j] = 0; - - // set setflag i,j for type pairs where both are mapped to elements - // set mass for i,i in atom class - - int count = 0; - for (int i = 1; i <= n; i++) - for (int j = i; j <= n; j++) - if (map[i] >= 0 && map[j] >= 0) { - setflag[i][j] = 1; - if (i == j) atom->set_mass(FLERR,i,mass[map[i]]); - count++; - } - - if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); -} - -/* ---------------------------------------------------------------------- - init specific to this pair style -------------------------------------------------------------------------- */ - -void PairMEAM::init_style() -{ - if (force->newton_pair == 0) - error->all(FLERR,"Pair style MEAM requires newton pair on"); - - // need full and half neighbor list - - int irequest_full = neighbor->request(this,instance_me); - neighbor->requests[irequest_full]->id = 1; - neighbor->requests[irequest_full]->half = 0; - neighbor->requests[irequest_full]->full = 1; - int irequest_half = neighbor->request(this,instance_me); - neighbor->requests[irequest_half]->id = 2; - - // setup Fortran-style mapping array needed by MEAM package - // fmap is indexed from 1:ntypes by Fortran and stores a Fortran index - // if type I is not a MEAM atom, fmap stores a 0 - - for (int i = 1; i <= atom->ntypes; i++) fmap[i-1] = map[i] + 1; -} - -/* ---------------------------------------------------------------------- - neighbor callback to inform pair style of neighbor list to use - half or full -------------------------------------------------------------------------- */ - -void PairMEAM::init_list(int id, NeighList *ptr) -{ - if (id == 1) listfull = ptr; - else if (id == 2) listhalf = ptr; -} - -/* ---------------------------------------------------------------------- - init for one type pair i,j and corresponding j,i -------------------------------------------------------------------------- */ - -double PairMEAM::init_one(int /*i*/, int /*j*/) -{ - return cutmax; -} - -/* ---------------------------------------------------------------------- */ - -void PairMEAM::read_files(char *globalfile, char *userfile) -{ - // open global meamf file on proc 0 - - FILE *fp; - if (comm->me == 0) { - fp = force->open_potential(globalfile); - if (fp == NULL) { - char str[128]; - snprintf(str,128,"Cannot open MEAM potential file %s",globalfile); - error->one(FLERR,str); - } - } - - // allocate parameter arrays - - int params_per_line = 19; - - int *lat = new int[nelements]; - int *ielement = new int[nelements]; - int *ibar = new int[nelements]; - double *z = new double[nelements]; - double *atwt = new double[nelements]; - double *alpha = new double[nelements]; - double *b0 = new double[nelements]; - double *b1 = new double[nelements]; - double *b2 = new double[nelements]; - double *b3 = new double[nelements]; - double *alat = new double[nelements]; - double *esub = new double[nelements]; - double *asub = new double[nelements]; - double *t0 = new double[nelements]; - double *t1 = new double[nelements]; - double *t2 = new double[nelements]; - double *t3 = new double[nelements]; - double *rozero = new double[nelements]; - - bool *found = new bool[nelements]; - for (int i = 0; i < nelements; i++) found[i] = false; - - // read each set of params from global MEAM file - // one set of params can span multiple lines - // store params if element name is in element list - // if element name appears multiple times, only store 1st entry - - int i,n,nwords; - char **words = new char*[params_per_line+1]; - char line[MAXLINE],*ptr; - int eof = 0; - - int nset = 0; - while (1) { - if (comm->me == 0) { - ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { - eof = 1; - fclose(fp); - } else n = strlen(line) + 1; - } - MPI_Bcast(&eof,1,MPI_INT,0,world); - if (eof) break; - MPI_Bcast(&n,1,MPI_INT,0,world); - MPI_Bcast(line,n,MPI_CHAR,0,world); - - // strip comment, skip line if blank - - if ((ptr = strchr(line,'#'))) *ptr = '\0'; - nwords = atom->count_words(line); - if (nwords == 0) continue; - - // concatenate additional lines until have params_per_line words - - while (nwords < params_per_line) { - n = strlen(line); - if (comm->me == 0) { - ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { - eof = 1; - fclose(fp); - } else n = strlen(line) + 1; - } - MPI_Bcast(&eof,1,MPI_INT,0,world); - if (eof) break; - MPI_Bcast(&n,1,MPI_INT,0,world); - MPI_Bcast(line,n,MPI_CHAR,0,world); - if ((ptr = strchr(line,'#'))) *ptr = '\0'; - nwords = atom->count_words(line); - } - - if (nwords != params_per_line) - error->all(FLERR,"Incorrect format in MEAM potential file"); - - // words = ptrs to all words in line - // strip single and double quotes from words - - nwords = 0; - words[nwords++] = strtok(line,"' \t\n\r\f"); - while ((words[nwords++] = strtok(NULL,"' \t\n\r\f"))) continue; - - // skip if element name isn't in element list - - for (i = 0; i < nelements; i++) - if (strcmp(words[0],elements[i]) == 0) break; - if (i >= nelements) continue; - - // skip if element already appeared - - if (found[i] == true) continue; - found[i] = true; - - // map lat string to an integer - - if (strcmp(words[1],"fcc") == 0) lat[i] = FCC; - else if (strcmp(words[1],"bcc") == 0) lat[i] = BCC; - else if (strcmp(words[1],"hcp") == 0) lat[i] = HCP; - else if (strcmp(words[1],"dim") == 0) lat[i] = DIM; - else if (strcmp(words[1],"dia") == 0) lat[i] = DIAMOND; - else error->all(FLERR,"Unrecognized lattice type in MEAM file 1"); - - // store parameters - - z[i] = atof(words[2]); - ielement[i] = atoi(words[3]); - atwt[i] = atof(words[4]); - alpha[i] = atof(words[5]); - b0[i] = atof(words[6]); - b1[i] = atof(words[7]); - b2[i] = atof(words[8]); - b3[i] = atof(words[9]); - alat[i] = atof(words[10]); - esub[i] = atof(words[11]); - asub[i] = atof(words[12]); - t0[i] = atof(words[13]); - t1[i] = atof(words[14]); - t2[i] = atof(words[15]); - t3[i] = atof(words[16]); - rozero[i] = atof(words[17]); - ibar[i] = atoi(words[18]); - - nset++; - } - - // error if didn't find all elements in file - - if (nset != nelements) - error->all(FLERR,"Did not find all elements in MEAM library file"); - - // pass element parameters to MEAM package - - meam_setup_global_(&nelements,lat,z,ielement,atwt,alpha,b0,b1,b2,b3, - alat,esub,asub,t0,t1,t2,t3,rozero,ibar); - - // set element masses - - for (i = 0; i < nelements; i++) mass[i] = atwt[i]; - - // clean-up memory - - delete [] words; - - delete [] lat; - delete [] ielement; - delete [] ibar; - delete [] z; - delete [] atwt; - delete [] alpha; - delete [] b0; - delete [] b1; - delete [] b2; - delete [] b3; - delete [] alat; - delete [] esub; - delete [] asub; - delete [] t0; - delete [] t1; - delete [] t2; - delete [] t3; - delete [] rozero; - delete [] found; - - // done if user param file is NULL - - if (strcmp(userfile,"NULL") == 0) return; - - // open user param file on proc 0 - - if (comm->me == 0) { - fp = force->open_potential(userfile); - if (fp == NULL) { - char str[128]; - snprintf(str,128,"Cannot open MEAM potential file %s",userfile); - error->one(FLERR,str); - } - } - - // read settings - // pass them one at a time to MEAM package - // match strings to list of corresponding ints - - int which; - double value; - int nindex,index[3]; - int maxparams = 6; - char **params = new char*[maxparams]; - int nparams; - - eof = 0; - while (1) { - if (comm->me == 0) { - ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { - eof = 1; - fclose(fp); - } else n = strlen(line) + 1; - } - MPI_Bcast(&eof,1,MPI_INT,0,world); - if (eof) break; - MPI_Bcast(&n,1,MPI_INT,0,world); - MPI_Bcast(line,n,MPI_CHAR,0,world); - - // strip comment, skip line if blank - - if ((ptr = strchr(line,'#'))) *ptr = '\0'; - nparams = atom->count_words(line); - if (nparams == 0) continue; - - // words = ptrs to all words in line - - nparams = 0; - params[nparams++] = strtok(line,"=(), '\t\n\r\f"); - while (nparams < maxparams && - (params[nparams++] = strtok(NULL,"=(), '\t\n\r\f"))) - continue; - nparams--; - - for (which = 0; which < nkeywords; which++) - if (strcmp(params[0],keywords[which]) == 0) break; - if (which == nkeywords) { - char str[128]; - snprintf(str,128,"Keyword %s in MEAM parameter file not recognized", - params[0]); - error->all(FLERR,str); - } - nindex = nparams - 2; - for (i = 0; i < nindex; i++) index[i] = atoi(params[i+1]); - - // map lattce_meam value to an integer - - if (which == 4) { - if (strcmp(params[nparams-1],"fcc") == 0) value = FCC; - else if (strcmp(params[nparams-1],"bcc") == 0) value = BCC; - else if (strcmp(params[nparams-1],"hcp") == 0) value = HCP; - else if (strcmp(params[nparams-1],"dim") == 0) value = DIM; - else if (strcmp(params[nparams-1],"dia") == 0) value = DIAMOND; - else if (strcmp(params[nparams-1],"b1") == 0) value = B1; - else if (strcmp(params[nparams-1],"c11") == 0) value = C11; - else if (strcmp(params[nparams-1],"l12") == 0) value = L12; - else if (strcmp(params[nparams-1],"b2") == 0) value = B2; - else error->all(FLERR,"Unrecognized lattice type in MEAM file 2"); - } - else value = atof(params[nparams-1]); - - // pass single setting to MEAM package - - int errorflag = 0; - meam_setup_param_(&which,&value,&nindex,index,&errorflag); - if (errorflag) { - char str[128]; - sprintf(str,"MEAM library error %d",errorflag); - error->all(FLERR,str); - } - } - - delete [] params; -} - -/* ---------------------------------------------------------------------- */ - -int PairMEAM::pack_forward_comm(int n, int *list, double *buf, - int /*pbc_flag*/, int * /*pbc*/) -{ - int i,j,k,m; - - m = 0; - for (i = 0; i < n; i++) { - j = list[i]; - buf[m++] = rho0[j]; - buf[m++] = rho1[j]; - buf[m++] = rho2[j]; - buf[m++] = rho3[j]; - buf[m++] = frhop[j]; - buf[m++] = gamma[j]; - buf[m++] = dgamma1[j]; - buf[m++] = dgamma2[j]; - buf[m++] = dgamma3[j]; - buf[m++] = arho2b[j]; - buf[m++] = arho1[j][0]; - buf[m++] = arho1[j][1]; - buf[m++] = arho1[j][2]; - buf[m++] = arho2[j][0]; - buf[m++] = arho2[j][1]; - buf[m++] = arho2[j][2]; - buf[m++] = arho2[j][3]; - buf[m++] = arho2[j][4]; - buf[m++] = arho2[j][5]; - for (k = 0; k < 10; k++) buf[m++] = arho3[j][k]; - buf[m++] = arho3b[j][0]; - buf[m++] = arho3b[j][1]; - buf[m++] = arho3b[j][2]; - buf[m++] = t_ave[j][0]; - buf[m++] = t_ave[j][1]; - buf[m++] = t_ave[j][2]; - buf[m++] = tsq_ave[j][0]; - buf[m++] = tsq_ave[j][1]; - buf[m++] = tsq_ave[j][2]; - } - - return m; -} - -/* ---------------------------------------------------------------------- */ - -void PairMEAM::unpack_forward_comm(int n, int first, double *buf) -{ - int i,k,m,last; - - m = 0; - last = first + n; - for (i = first; i < last; i++) { - rho0[i] = buf[m++]; - rho1[i] = buf[m++]; - rho2[i] = buf[m++]; - rho3[i] = buf[m++]; - frhop[i] = buf[m++]; - gamma[i] = buf[m++]; - dgamma1[i] = buf[m++]; - dgamma2[i] = buf[m++]; - dgamma3[i] = buf[m++]; - arho2b[i] = buf[m++]; - arho1[i][0] = buf[m++]; - arho1[i][1] = buf[m++]; - arho1[i][2] = buf[m++]; - arho2[i][0] = buf[m++]; - arho2[i][1] = buf[m++]; - arho2[i][2] = buf[m++]; - arho2[i][3] = buf[m++]; - arho2[i][4] = buf[m++]; - arho2[i][5] = buf[m++]; - for (k = 0; k < 10; k++) arho3[i][k] = buf[m++]; - arho3b[i][0] = buf[m++]; - arho3b[i][1] = buf[m++]; - arho3b[i][2] = buf[m++]; - t_ave[i][0] = buf[m++]; - t_ave[i][1] = buf[m++]; - t_ave[i][2] = buf[m++]; - tsq_ave[i][0] = buf[m++]; - tsq_ave[i][1] = buf[m++]; - tsq_ave[i][2] = buf[m++]; - } -} - -/* ---------------------------------------------------------------------- */ - -int PairMEAM::pack_reverse_comm(int n, int first, double *buf) -{ - int i,k,m,last; - - m = 0; - last = first + n; - for (i = first; i < last; i++) { - buf[m++] = rho0[i]; - buf[m++] = arho2b[i]; - buf[m++] = arho1[i][0]; - buf[m++] = arho1[i][1]; - buf[m++] = arho1[i][2]; - buf[m++] = arho2[i][0]; - buf[m++] = arho2[i][1]; - buf[m++] = arho2[i][2]; - buf[m++] = arho2[i][3]; - buf[m++] = arho2[i][4]; - buf[m++] = arho2[i][5]; - for (k = 0; k < 10; k++) buf[m++] = arho3[i][k]; - buf[m++] = arho3b[i][0]; - buf[m++] = arho3b[i][1]; - buf[m++] = arho3b[i][2]; - buf[m++] = t_ave[i][0]; - buf[m++] = t_ave[i][1]; - buf[m++] = t_ave[i][2]; - buf[m++] = tsq_ave[i][0]; - buf[m++] = tsq_ave[i][1]; - buf[m++] = tsq_ave[i][2]; - } - - return m; -} - -/* ---------------------------------------------------------------------- */ - -void PairMEAM::unpack_reverse_comm(int n, int *list, double *buf) -{ - int i,j,k,m; - - m = 0; - for (i = 0; i < n; i++) { - j = list[i]; - rho0[j] += buf[m++]; - arho2b[j] += buf[m++]; - arho1[j][0] += buf[m++]; - arho1[j][1] += buf[m++]; - arho1[j][2] += buf[m++]; - arho2[j][0] += buf[m++]; - arho2[j][1] += buf[m++]; - arho2[j][2] += buf[m++]; - arho2[j][3] += buf[m++]; - arho2[j][4] += buf[m++]; - arho2[j][5] += buf[m++]; - for (k = 0; k < 10; k++) arho3[j][k] += buf[m++]; - arho3b[j][0] += buf[m++]; - arho3b[j][1] += buf[m++]; - arho3b[j][2] += buf[m++]; - t_ave[j][0] += buf[m++]; - t_ave[j][1] += buf[m++]; - t_ave[j][2] += buf[m++]; - tsq_ave[j][0] += buf[m++]; - tsq_ave[j][1] += buf[m++]; - tsq_ave[j][2] += buf[m++]; - } -} - -/* ---------------------------------------------------------------------- - memory usage of local atom-based arrays -------------------------------------------------------------------------- */ - -double PairMEAM::memory_usage() -{ - double bytes = 11 * nmax * sizeof(double); - bytes += (3 + 6 + 10 + 3 + 3 + 3) * nmax * sizeof(double); - bytes += 3 * maxneigh * sizeof(double); - return bytes; -} - -/* ---------------------------------------------------------------------- - strip special bond flags from neighbor list entries - are not used with MEAM - need to do here so Fortran lib doesn't see them - done once per reneighbor so that neigh_f2c and neigh_c2f don't see them -------------------------------------------------------------------------- */ - -void PairMEAM::neigh_strip(int inum, int *ilist, - int *numneigh, int **firstneigh) -{ - int i,j,ii,jnum; - int *jlist; - - for (ii = 0; ii < inum; ii++) { - i = ilist[ii]; - jlist = firstneigh[i]; - jnum = numneigh[i]; - for (j = 0; j < jnum; j++) jlist[j] &= NEIGHMASK; - } -} - -/* ---------------------------------------------------------------------- - toggle neighbor list indices between zero- and one-based values - needed for access by MEAM Fortran library -------------------------------------------------------------------------- */ - -void PairMEAM::neigh_f2c(int inum, int *ilist, int *numneigh, int **firstneigh) -{ - int i,j,ii,jnum; - int *jlist; - - for (ii = 0; ii < inum; ii++) { - i = ilist[ii]; - jlist = firstneigh[i]; - jnum = numneigh[i]; - for (j = 0; j < jnum; j++) jlist[j]--; - } -} - -void PairMEAM::neigh_c2f(int inum, int *ilist, int *numneigh, int **firstneigh) -{ - int i,j,ii,jnum; - int *jlist; - - for (ii = 0; ii < inum; ii++) { - i = ilist[ii]; - jlist = firstneigh[i]; - jnum = numneigh[i]; - for (j = 0; j < jnum; j++) jlist[j]++; - } -} diff --git a/src/MEAM/pair_meam.h b/src/MEAM/pair_meam.h deleted file mode 100644 index 24aec1c3ed..0000000000 --- a/src/MEAM/pair_meam.h +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifdef PAIR_CLASS - -PairStyle(meam,PairMEAM) - -#else - -#ifndef LMP_PAIR_MEAM_H -#define LMP_PAIR_MEAM_H - -extern "C" { - void meam_setup_global_(int *, int *, double *, int *, double *, double *, - double *, double *, double *, double *, double *, - double *, double *, double *, double *, double *, - double *, double *, int *); - void meam_setup_param_(int *, double *, int *, int *, int *); - void meam_setup_done_(double *); - - void meam_dens_init_(int *, int *, int *, int *, int *, - double *, int *, int *, int *, int *, - double *, double *, double *, double *, - double *, double *, - double *, double *, double *, double *, double *, - int *); - - void meam_dens_final_(int *, int *, int *, int *, int *, double *, double *, - int *, int *, int *, - double *, double *, double *, double *, - double *, double *, double *, - double *, double *, double *, double *, - double *, double *, - double *, double *, double *, double *, int *); - - void meam_force_(int *, int *, int *, int *, int *, int *, - double *, double *, int *, int *, int *, - double *, int *, int *, int *, int *, double *, double *, - double *, double *, double *, double *, double *, double *, - double *, double *, double *, double *, double *, double *, - double *, double *, double *, double *, double *, double *, int *); - - void meam_cleanup_(); -} - - -#include "pair.h" - -namespace LAMMPS_NS { - -class PairMEAM : public Pair { - public: - PairMEAM(class LAMMPS *); - ~PairMEAM(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - void init_list(int, class NeighList *); - double init_one(int, int); - - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); - - private: - double cutmax; // max cutoff for all elements - int nelements; // # of unique elements - char **elements; // names of unique elements - double *mass; // mass of each element - - int *map; // mapping from atom types to elements - int *fmap; // Fortran version of map array for MEAM lib - - int maxneigh; - double *scrfcn,*dscrfcn,*fcpair; - - int nmax; - double *rho,*rho0,*rho1,*rho2,*rho3,*frhop; - double *gamma,*dgamma1,*dgamma2,*dgamma3,*arho2b; - double **arho1,**arho2,**arho3,**arho3b,**t_ave,**tsq_ave; - - void allocate(); - void read_files(char *, char *); - void neigh_strip(int, int *, int *, int **); - void neigh_f2c(int, int *, int *, int **); - void neigh_c2f(int, int *, int *, int **); -}; - -} - -#endif -#endif - -/* ERROR/WARNING messages: - -W: The pair_style meam command is unsupported. Please use pair_style meam/c instead - -UNDOCUMENTED - -E: MEAM library error %d - -A call to the MEAM Fortran library returned an error. - -E: Illegal ... command - -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. - -E: Incorrect args for pair coefficients - -Self-explanatory. Check the input script or data file. - -E: Pair style MEAM requires newton pair on - -See the newton command. This is a restriction to use the MEAM -potential. - -E: Cannot open MEAM potential file %s - -The specified MEAM potential file cannot be opened. Check that the -path and name are correct. - -E: Incorrect format in MEAM potential file - -Incorrect number of words per line in the potential file. - -E: Unrecognized lattice type in MEAM file 1 - -The lattice type in an entry of the MEAM library file is not -valid. - -E: Did not find all elements in MEAM library file - -The requested elements were not found in the MEAM file. - -E: Keyword %s in MEAM parameter file not recognized - -Self-explanatory. - -E: Unrecognized lattice type in MEAM file 2 - -The lattice type in an entry of the MEAM parameter file is not -valid. - -*/ diff --git a/src/REAX/Install.sh b/src/REAX/Install.sh deleted file mode 100755 index bf8c8dbca2..0000000000 --- a/src/REAX/Install.sh +++ /dev/null @@ -1,67 +0,0 @@ -# Install/unInstall package files in LAMMPS -# mode = 0/1/2 for uninstall/install/update - -mode=$1 - -# arg1 = file, arg2 = file it depends on - -# enforce using portable C locale -LC_ALL=C -export LC_ALL - -action () { - if (test $mode = 0) then - rm -f ../$1 - elif (! cmp -s $1 ../$1) then - if (test -z "$2" || test -e ../$2) then - cp $1 .. - if (test $mode = 2) then - echo " updating src/$1" - fi - fi - elif (test -n "$2") then - if (test ! -e ../$2) then - rm -f ../$1 - fi - fi -} - -# all package files with no dependencies - -for file in *.cpp *.h; do - test -f ${file} && action $file -done - -# edit 2 Makefile.package files to include/exclude package info - -if (test $1 = 1) then - - if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*reax[^ \t]* //' ../Makefile.package - sed -i -e 's|^PKG_INC =[ \t]*|&-I../../lib/reax |' ../Makefile.package - sed -i -e 's|^PKG_PATH =[ \t]*|&-L../../lib/reax |' ../Makefile.package - sed -i -e 's|^PKG_LIB =[ \t]*|&-lreax |' ../Makefile.package - sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(reax_SYSINC) |' ../Makefile.package - sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(reax_SYSLIB) |' ../Makefile.package - sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(reax_SYSPATH) |' ../Makefile.package - fi - - if (test -e ../Makefile.package.settings) then - sed -i -e '/^include.*reax.*$/d' ../Makefile.package.settings - # multiline form needed for BSD sed on Macs - sed -i -e '4 i \ -include ..\/..\/lib\/reax\/Makefile.lammps -' ../Makefile.package.settings - fi - -elif (test $1 = 0) then - - if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*reax[^ \t]* //' ../Makefile.package - fi - - if (test -e ../Makefile.package.settings) then - sed -i -e '/^include.*reax.*$/d' ../Makefile.package.settings - fi - -fi diff --git a/src/REAX/fix_reax_bonds.cpp b/src/REAX/fix_reax_bonds.cpp deleted file mode 100644 index c6c1d309ee..0000000000 --- a/src/REAX/fix_reax_bonds.cpp +++ /dev/null @@ -1,267 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -/* ---------------------------------------------------------------------- - Contributing author: Aidan Thompson (Sandia) -------------------------------------------------------------------------- */ - -#ifdef LAMMPS_BIGBIG -#error LAMMPS_BIGBIG is not supported by the REAX package -#endif - -#include -#include -#include "fix_reax_bonds.h" -#include "pair_reax_fortran.h" -#include "atom.h" -#include "update.h" -#include "force.h" -#include "modify.h" -#include "compute.h" -#include "input.h" -#include "variable.h" -#include "memory.h" -#include "error.h" - -using namespace LAMMPS_NS; -using namespace FixConst; - -/* ---------------------------------------------------------------------- */ - -FixReaxBonds::FixReaxBonds(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) -{ - if (narg < 5) error->all(FLERR,"Illegal fix reax/bonds command"); - - MPI_Comm_rank(world,&me); - - nevery = force->inumeric(FLERR,arg[3]); - if (nevery < 1) error->all(FLERR,"Illegal fix reax/bonds command"); - - if (me == 0) { - char *suffix = strrchr(arg[4],'.'); - if (suffix && strcmp(suffix,".gz") == 0) { -#ifdef LAMMPS_GZIP - char gzip[128]; - snprintf(gzip,128,"gzip -6 > %s",arg[4]); -#ifdef _WIN32 - fp = _popen(gzip,"wb"); -#else - fp = popen(gzip,"w"); -#endif -#else - error->one(FLERR,"Cannot open gzipped file"); -#endif - } else fp = fopen(arg[4],"w"); - - if (fp == NULL) { - char str[128]; - snprintf(str,128,"Cannot open fix reax/bonds file %s",arg[4]); - error->one(FLERR,str); - } - } -} - -/* ---------------------------------------------------------------------- */ - -FixReaxBonds::~FixReaxBonds() -{ - if (me == 0) fclose(fp); -} - -/* ---------------------------------------------------------------------- */ - -int FixReaxBonds::setmask() -{ - int mask = 0; - mask |= END_OF_STEP; - return mask; -} - -/* ---------------------------------------------------------------------- - perform initial write -------------------------------------------------------------------------- */ - -void FixReaxBonds::setup(int vflag) -{ - end_of_step(); -} - -/* ---------------------------------------------------------------------- */ - -void FixReaxBonds::init() -{ - // insure ReaxFF is defined - - if (force->pair_match("reax",1) == NULL) - error->all(FLERR,"Cannot use fix reax/bonds without pair_style reax"); -} - -/* ---------------------------------------------------------------------- */ - -void FixReaxBonds::end_of_step() -{ - OutputReaxBonds(update->ntimestep,fp); - if (me == 0) fflush(fp); -} - -/* ---------------------------------------------------------------------- */ - -void FixReaxBonds::OutputReaxBonds(bigint ntimestep, FILE *fp) -{ - int nparticles,nparticles_tot,nbuf,nbuf_local,most,j; - int ii,jn,mbond,numbonds,nsbmax,nsbmax_most; - int nprocs,nlocal_tmp,itmp; - int k,kk,jj,jbufknum; - double cutof3; - double *buf; - MPI_Request irequest; - - MPI_Comm_size(world,&nprocs); - - nparticles = atom->nlocal; - nparticles_tot = static_cast (atom->natoms); - - jn = ReaxParams::nat; - mbond = ReaxParams::mbond; - FORTRAN(getnsbmax,GETNSBMAX)(&nsbmax); - FORTRAN(getcutof3,GETCUTOF3)(&cutof3); - MPI_Allreduce(&nparticles,&most,1,MPI_INT,MPI_MAX,world); - MPI_Allreduce(&nsbmax,&nsbmax_most,1,MPI_INT,MPI_MAX,world); - - if (me == 0) { - fprintf(fp,"# Timestep " BIGINT_FORMAT " \n",ntimestep); - fprintf(fp,"# \n"); - fprintf(fp,"# Number of particles %d \n",nparticles_tot); - fprintf(fp,"# \n"); - fprintf(fp,"# Max number of bonds per atom %d with " - "coarse bond order cutoff %5.3f \n", - nsbmax_most,cutof3); - fprintf(fp,"# Particle connection table and bond orders \n"); - fprintf(fp,"# id type nb id_1...id_nb mol bo_1...bo_nb abo nlp q \n"); - } - - // allocate a temporary buffer for the snapshot info - // big enough for largest number of atoms on any one proc - // nbuf_local = size of local buffer for table of atom bonds - - nbuf = 1+(2*nsbmax_most+7)*most; - memory->create(buf,nbuf,"reax/bonds:buf"); - - j = 0; - buf[j++] = nparticles; - for (int iparticle=0;iparticletag[iparticle]; //atom tag - buf[j++] = FORTRAN(cbkia,CBKIA).iag[iparticle]; //atom type - jbufknum = j++; - numbonds = FORTRAN(cbkia,CBKIA).iag[iparticle+jn]; - - // connection table based on coarse bond order cutoff (> cutof3) - - kk = 0; - for (k=0;k cutof3) { - kk++; - jj = FORTRAN(cbkia,CBKIA).iag[iparticle+jn*(k+2)]; - buf[j++] = FORTRAN(cbkc,CBKC).itag[jj-1]; - } - } - buf[jbufknum] = kk; //no.bonds - buf[j++]=FORTRAN(cbkia,CBKIA).iag[iparticle+jn*(mbond+2)]; //molec.id - - // bond orders (> cutof3) - - kk = 0; - for (k=0;k cutof3) { - kk++; - buf[j++] = FORTRAN(cbkbo,CBKBO).bo[ii-1]; - } - } - - // atom bond order (abo), no. of lone pairs (vlp), charge (ch) - - buf[j++] = FORTRAN(cbkabo,CBKABO).abo[iparticle]; - buf[j++] = FORTRAN(cbklonpar,CBKLONPAR).vlp[iparticle]; - buf[j++] = atom->q[iparticle]; - } - nbuf_local = j-1; - - // node 0 pings each node, receives their buffer, writes to file - // all other nodes wait for ping, send buffer to node 0 - - if (me == 0) { - for (int inode = 0; inode nsbmax_most) - error->one(FLERR,"Fix reax/bonds numbonds > nsbmax_most"); - - // print connection table - - for (k=0;kdestroy(buf); -} - -/* ---------------------------------------------------------------------- */ - -int FixReaxBonds::nint(const double &r) -{ - int i = 0; - if (r>0.0) i = static_cast(r+0.5); - else if (r<0.0) i = static_cast(r-0.5); - return i; -} diff --git a/src/REAX/fix_reax_bonds.h b/src/REAX/fix_reax_bonds.h deleted file mode 100644 index 03bad1ef16..0000000000 --- a/src/REAX/fix_reax_bonds.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifdef FIX_CLASS - -FixStyle(reax/bonds,FixReaxBonds) - -#else - -#ifndef LMP_FIX_REAX_BONDS_H -#define LMP_FIX_REAX_BONDS_H - -#include -#include "fix.h" - -namespace LAMMPS_NS { - -class FixReaxBonds : public Fix { - public: - FixReaxBonds(class LAMMPS *, int, char **); - ~FixReaxBonds(); - int setmask(); - void init(); - void setup(int); - void end_of_step(); - - private: - int me; - int nfreq; - FILE *fp; - - void OutputReaxBonds(bigint, FILE*); - int nint(const double&); -}; - -} - -#endif -#endif - -/* ERROR/WARNING messages: - -E: Illegal ... command - -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. - -E: Cannot open gzipped file - -UNDOCUMENTED - -E: Cannot open fix reax/bonds file %s - -The output file for the fix reax/bonds command cannot be opened. -Check that the path and name are correct. - -E: Cannot use fix reax/bonds without pair_style reax - -Self-explanatory. - -E: Fix reax/bonds numbonds > nsbmax_most - -The limit of the number of bonds expected by the ReaxFF force field -was exceeded. - -*/ diff --git a/src/REAX/pair_reax.cpp b/src/REAX/pair_reax.cpp deleted file mode 100644 index a430380711..0000000000 --- a/src/REAX/pair_reax.cpp +++ /dev/null @@ -1,1067 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -/* ---------------------------------------------------------------------- - Contributing authors: Aidan Thompson (Sandia, athomps@sandia.gov) - Hansohl Cho (MIT, hansohl@mit.edu) - LAMMPS implementation of the Reactive Force Field (ReaxFF) is based on - Aidan Thompson's GRASP code - (General Reactive Atomistic Simulation Program) - and Ardi Van Duin's original ReaxFF code -------------------------------------------------------------------------- */ - -#include -#include -#include -#include -#include -#include "pair_reax.h" -#include "pair_reax_fortran.h" -#include "atom.h" -#include "update.h" -#include "force.h" -#include "comm.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "memory.h" -#include "error.h" - -using namespace LAMMPS_NS; - -#define SMALL 0.0001 - -/* ---------------------------------------------------------------------- */ - -PairREAX::PairREAX(LAMMPS *lmp) : Pair(lmp) -{ - if (comm->me == 0) - error->warning(FLERR,"THE pair_style reax COMMAND IS OBSOLETE AND " - "WILL BE REMOVED VERY SOON. PLEASE USE reax/c"); - - single_enable = 0; - restartinfo = 0; - one_coeff = 1; - manybody_flag = 1; - no_virial_fdotr_compute = 1; - - nextra = 14; - pvector = new double[nextra]; - - cutmax = 0.0; - hbcut = 6.0; - ihbnew = 1; - itripstaball = 1; - iprune = 4; - ihb = 1; - chpot = 0; - - nmax = 0; - arow_ptr = NULL; - ch = NULL; - elcvec = NULL; - rcg = NULL; - wcg = NULL; - pcg = NULL; - poldcg = NULL; - qcg = NULL; - - matmax = 0; - aval = NULL; - acol_ind = NULL; - - comm_forward = 1; - comm_reverse = 1; - - precision = 1.0e-6; -} - -/* ---------------------------------------------------------------------- - free all arrays - check if allocated, since class can be destructed when incomplete -------------------------------------------------------------------------- */ - -PairREAX::~PairREAX() -{ - delete [] pvector; - - if (allocated) { - memory->destroy(setflag); - memory->destroy(cutsq); - - for (int i = 1; i <= atom->ntypes; i++) - delete [] param_list[i].params; - delete [] param_list; - - delete [] map; - } - - memory->destroy(arow_ptr); - memory->destroy(ch); - memory->destroy(elcvec); - memory->destroy(rcg); - memory->destroy(wcg); - memory->destroy(pcg); - memory->destroy(poldcg); - memory->destroy(qcg); - - memory->destroy(aval); - memory->destroy(acol_ind); -} - -/* ---------------------------------------------------------------------- */ - -void PairREAX::compute(int eflag, int vflag) -{ - int i,j; - double evdwl,ecoul; - double energy_charge_equilibration; - - evdwl = ecoul = 0.0; - if (eflag || vflag) ev_setup(eflag,vflag); - else ev_unset(); - - if (vflag_global) FORTRAN(cbkvirial, CBKVIRIAL).Lvirial = 1; - else FORTRAN(cbkvirial, CBKVIRIAL).Lvirial = 0; - - if (vflag_atom) FORTRAN(cbkvirial, CBKVIRIAL).Latomvirial = 1; - else FORTRAN(cbkvirial, CBKVIRIAL).Latomvirial = 0; - - // reallocate charge equilibration and CG arrays if necessary - - if (atom->nmax > nmax) { - memory->destroy(rcg); - memory->destroy(wcg); - memory->destroy(pcg); - memory->destroy(poldcg); - memory->destroy(qcg); - - nmax = atom->nmax; - int n = nmax+1; - - memory->create(arow_ptr,n,"reax:arow_ptr"); - memory->create(ch,n,"reax:ch"); - memory->create(elcvec,n,"reax:elcvec"); - memory->create(rcg,n,"reax:rcg"); - memory->create(wcg,n,"reax:wcg"); - memory->create(pcg,n,"reax:pcg"); - memory->create(poldcg,n,"reax:poldcg"); - memory->create(qcg,n,"reax:qcg"); - } - - // calculate the atomic charge distribution - - compute_charge(energy_charge_equilibration); - - // transfer LAMMPS positions and neighbor lists to REAX - - write_reax_positions(); - write_reax_vlist(); - - // determine whether this bond is owned by the processor or not - - FORTRAN(srtbon1, SRTBON1)(&iprune, &ihb, &hbcut, &ihbnew, &itripstaball); - - // communicate local atomic bond order to ghost atomic bond order - - packflag = 0; - comm->forward_comm_pair(this); - - FORTRAN(molec, MOLEC)(); - FORTRAN(encalc, ENCALC)(); - FORTRAN(mdsav, MDSAV)(&comm->me); - - // read forces from ReaxFF Fortran - - read_reax_forces(); - - // extract global and per-atom energy from ReaxFF Fortran - // compute_charge already contributed to eatom - - if (eflag_global) { - evdwl += FORTRAN(cbkenergies, CBKENERGIES).eb; - evdwl += FORTRAN(cbkenergies, CBKENERGIES).ea; - evdwl += FORTRAN(cbkenergies, CBKENERGIES).elp; - evdwl += FORTRAN(cbkenergies, CBKENERGIES).emol; - evdwl += FORTRAN(cbkenergies, CBKENERGIES).ev; - evdwl += FORTRAN(cbkenergies, CBKENERGIES).epen; - evdwl += FORTRAN(cbkenergies, CBKENERGIES).ecoa; - evdwl += FORTRAN(cbkenergies, CBKENERGIES).ehb; - evdwl += FORTRAN(cbkenergies, CBKENERGIES).et; - evdwl += FORTRAN(cbkenergies, CBKENERGIES).eco; - evdwl += FORTRAN(cbkenergies, CBKENERGIES).ew; - evdwl += FORTRAN(cbkenergies, CBKENERGIES).efi; - - ecoul += FORTRAN(cbkenergies, CBKENERGIES).ep; - ecoul += energy_charge_equilibration; - - eng_vdwl += evdwl; - eng_coul += ecoul; - - // Store the different parts of the energy - // in a list for output by compute pair command - - pvector[0] = FORTRAN(cbkenergies, CBKENERGIES).eb; - pvector[1] = FORTRAN(cbkenergies, CBKENERGIES).ea; - pvector[2] = FORTRAN(cbkenergies, CBKENERGIES).elp; - pvector[3] = FORTRAN(cbkenergies, CBKENERGIES).emol; - pvector[4] = FORTRAN(cbkenergies, CBKENERGIES).ev; - pvector[5] = FORTRAN(cbkenergies, CBKENERGIES).epen; - pvector[6] = FORTRAN(cbkenergies, CBKENERGIES).ecoa; - pvector[7] = FORTRAN(cbkenergies, CBKENERGIES).ehb; - pvector[8] = FORTRAN(cbkenergies, CBKENERGIES).et; - pvector[9] = FORTRAN(cbkenergies, CBKENERGIES).eco; - pvector[10] = FORTRAN(cbkenergies, CBKENERGIES).ew; - pvector[11] = FORTRAN(cbkenergies, CBKENERGIES).ep; - pvector[12] = FORTRAN(cbkenergies, CBKENERGIES).efi; - pvector[13] = energy_charge_equilibration; - - } - - if (eflag_atom) { - int ntotal = atom->nlocal + atom->nghost; - for (i = 0; i < ntotal; i++) - eatom[i] += FORTRAN(cbkd,CBKD).estrain[i]; - } - - // extract global and per-atom virial from ReaxFF Fortran - - if (vflag_global) { - virial[0] = -FORTRAN(cbkvirial, CBKVIRIAL).virial[0]; - virial[1] = -FORTRAN(cbkvirial, CBKVIRIAL).virial[1]; - virial[2] = -FORTRAN(cbkvirial, CBKVIRIAL).virial[2]; - virial[3] = -FORTRAN(cbkvirial, CBKVIRIAL).virial[3]; - virial[4] = -FORTRAN(cbkvirial, CBKVIRIAL).virial[4]; - virial[5] = -FORTRAN(cbkvirial, CBKVIRIAL).virial[5]; - } - - if (vflag_atom) { - int ntotal = atom->nlocal + atom->nghost; - j = 0; - for (i = 0; i < ntotal; i++) { - vatom[i][0] = -FORTRAN(cbkvirial, CBKVIRIAL).atomvirial[j+0]; - vatom[i][1] = -FORTRAN(cbkvirial, CBKVIRIAL).atomvirial[j+1]; - vatom[i][2] = -FORTRAN(cbkvirial, CBKVIRIAL).atomvirial[j+2]; - vatom[i][3] = -FORTRAN(cbkvirial, CBKVIRIAL).atomvirial[j+3]; - vatom[i][4] = -FORTRAN(cbkvirial, CBKVIRIAL).atomvirial[j+4]; - vatom[i][5] = -FORTRAN(cbkvirial, CBKVIRIAL).atomvirial[j+5]; - j += 6; - } - } -} - -/* ---------------------------------------------------------------------- */ - -void PairREAX::write_reax_positions() -{ - int j, jx, jy, jz, jia; - - double **x = atom->x; - double *q = atom->q; - int *type = atom->type; - int *tag = atom->tag; - int nlocal = atom->nlocal; - int nghost = atom->nghost; - - FORTRAN(rsmall, RSMALL).na = nlocal+nghost; - FORTRAN(rsmall, RSMALL).na_local = nlocal; - - if (nlocal+nghost > ReaxParams::nat) - error->one(FLERR,"Reax_defs.h setting for NATDEF is too small"); - - jx = 0; - jy = ReaxParams::nat; - jz = 2*ReaxParams::nat; - jia = 0; - - j = 0; - for (int i = 0; i < nlocal+nghost; i++, j++) { - FORTRAN(cbkc, CBKC).c[j+jx] = x[i][0]; - FORTRAN(cbkc, CBKC).c[j+jy] = x[i][1]; - FORTRAN(cbkc, CBKC).c[j+jz] = x[i][2]; - FORTRAN(cbkch, CBKCH).ch[j] = q[i]; - FORTRAN(cbkia, CBKIA).ia[j+jia] = map[type[i]]; - FORTRAN(cbkia, CBKIA).iag[j+jia] = map[type[i]]; - FORTRAN(cbkc, CBKC).itag[j] = tag[i]; - } -} - -/* ---------------------------------------------------------------------- */ - -void PairREAX::write_reax_vlist() -{ - int ii, jj, i, j, iii, jjj; - double xitmp, yitmp, zitmp; - double xjtmp, yjtmp, zjtmp; - int itag,jtag; - int nvpair, nvlself, nvpairmax; - int nbond; - int inum,jnum; - int *ilist,*jlist,*numneigh,**firstneigh; - double delr2; - double delx, dely, delz; - - double **x = atom->x; - int *tag = atom->tag; - int nlocal = atom->nlocal; - int nghost = atom->nghost; - - nvpairmax = ReaxParams::nneighmax * ReaxParams::nat; - - nvpair = 0; - nvlself =0; - nbond = 0; - - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - firstneigh = list->firstneigh; - - for (ii = 0; ii < inum; ii++) { - i = ilist[ii]; - xitmp = x[i][0]; - yitmp = x[i][1]; - zitmp = x[i][2]; - itag = tag[i]; - jlist = firstneigh[i]; - jnum = numneigh[i]; - - for (jj = 0; jj < jnum; jj++) { - j = jlist[jj]; - j &= NEIGHMASK; - - xjtmp = x[j][0]; - yjtmp = x[j][1]; - zjtmp = x[j][2]; - jtag = tag[j]; - - delx = xitmp - xjtmp; - dely = yitmp - yjtmp; - delz = zitmp - zjtmp; - - delr2 = delx*delx+dely*dely+delz*delz; - - if (delr2 <= rcutvsq) { - if (i < j) { - iii = i+1; - jjj = j+1; - } else { - iii = j+1; - jjj = i+1; - } - if (nvpair >= nvpairmax) - error->one(FLERR,"Reax_defs.h setting for NNEIGHMAXDEF is too small"); - - FORTRAN(cbkpairs, CBKPAIRS).nvl1[nvpair] = iii; - FORTRAN(cbkpairs, CBKPAIRS).nvl2[nvpair] = jjj; - FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 0; - - if (delr2 <= rcutbsq) { - FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 1; - nbond++; - } - - FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 0; - - if (j < nlocal) - FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1; - else if (itag < jtag) - FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1; - else if (itag == jtag) { - if (delz > SMALL) - FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1; - else if (fabs(delz) < SMALL) { - if (dely > SMALL) - FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1; - else if (fabs(dely) < SMALL && delx > SMALL) - FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1; - } - } - nvpair++; - } - } - } - - int ntotal = nlocal + nghost; - - for (int i = nlocal; i < ntotal; i++) { - xitmp = x[i][0]; - yitmp = x[i][1]; - zitmp = x[i][2]; - itag = tag[i]; - - for (int j = i+1; j < ntotal; j++) { - xjtmp = x[j][0]; - yjtmp = x[j][1]; - zjtmp = x[j][2]; - jtag = tag[j]; - - delx = xitmp - xjtmp; - dely = yitmp - yjtmp; - delz = zitmp - zjtmp; - - delr2 = delx*delx+dely*dely+delz*delz; - - // don't need to check the double count since i < j in the ghost region - - if (delr2 <= rcutvsq) { - iii = i+1; - jjj = j+1; - - if (nvpair >= nvpairmax) - error->one(FLERR,"Reax_defs.h setting for NNEIGHMAXDEF is too small"); - - FORTRAN(cbkpairs, CBKPAIRS).nvl1[nvpair] = iii; - FORTRAN(cbkpairs, CBKPAIRS).nvl2[nvpair] = jjj; - FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 0; - - if (delr2 <= rcutbsq) { - FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 1; - nbond++; - } - - FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 0; - nvpair++; - } - } - } - - FORTRAN(cbkpairs, CBKPAIRS).nvpair = nvpair; - FORTRAN(cbkpairs, CBKPAIRS).nvlself = nvlself; -} - -/* ---------------------------------------------------------------------- */ - -void PairREAX::read_reax_forces() -{ - double ftmp[3]; - - double **f = atom->f; - int ntotal = atom->nlocal + atom->nghost; - - int j = 0; - for (int i = 0; i < ntotal; i++) { - ftmp[0] = -FORTRAN(cbkd, CBKD).d[j]; - ftmp[1] = -FORTRAN(cbkd, CBKD).d[j+1]; - ftmp[2] = -FORTRAN(cbkd, CBKD).d[j+2]; - f[i][0] = ftmp[0]; - f[i][1] = ftmp[1]; - f[i][2] = ftmp[2]; - j += 3; - } -} - -/* ---------------------------------------------------------------------- */ - -void PairREAX::allocate() -{ - allocated = 1; - int n = atom->ntypes; - - memory->create(setflag,n+1,n+1,"pair:setflag"); - memory->create(cutsq,n+1,n+1,"pair:cutsq"); - - param_list = new ff_params[n+1]; - for (int i = 1; i <= n; i++) - param_list[i].params = new double[5]; - - map = new int[n+1]; -} - -/* ---------------------------------------------------------------------- - global settings -------------------------------------------------------------------------- */ - -void PairREAX::settings(int narg, char **arg) -{ - if (narg != 0 && narg !=4) error->all(FLERR,"Illegal pair_style command"); - - if (narg == 4) { - hbcut = force->numeric(FLERR,arg[0]); - ihbnew = static_cast (force->numeric(FLERR,arg[1])); - itripstaball = static_cast (force->numeric(FLERR,arg[2])); - precision = force->numeric(FLERR,arg[3]); - - if (hbcut <= 0.0 || - (ihbnew != 0 && ihbnew != 1) || - (itripstaball != 0 && itripstaball != 1) || - precision <= 0.0) - error->all(FLERR,"Illegal pair_style command"); - } -} - -/* ---------------------------------------------------------------------- - set coeffs for one or more type pairs -------------------------------------------------------------------------- */ - -void PairREAX::coeff(int narg, char **arg) -{ - if (!allocated) allocate(); - - if (narg != 3 + atom->ntypes) - error->all(FLERR,"Incorrect args for pair coefficients"); - - // insure I,J args are * * - - if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0) - error->all(FLERR,"Incorrect args for pair coefficients"); - - // insure filename is ffield.reax - - if (strcmp(arg[2],"ffield.reax") != 0) - error->all(FLERR,"Incorrect args for pair coefficients"); - - // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL - // NOTE: for now throw an error if NULL is used to disallow use with hybrid - // qEq matrix solver needs to be modified to exclude atoms - - for (int i = 3; i < narg; i++) { - if (strcmp(arg[i],"NULL") == 0) { - map[i-2] = -1; - error->all(FLERR,"Cannot currently use pair reax with pair hybrid"); - continue; - } - map[i-2] = force->inumeric(FLERR,arg[i]); - } - - int n = atom->ntypes; - - int count = 0; - for (int i = 1; i <= n; i++) - for (int j = i; j <= n; j++) { - setflag[i][j] = 1; - count++; - } - - if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); -} - -/* ---------------------------------------------------------------------- - init specific to this pair style -------------------------------------------------------------------------- */ - -void PairREAX::init_style() -{ - if (atom->tag_enable == 0) - error->all(FLERR,"Pair style reax requires atom IDs"); - if (force->newton_pair == 0) - error->all(FLERR,"Pair style reax requires newton pair on"); - if (!atom->q_flag) - error->all(FLERR,"Pair style reax requires atom attribute q"); - if (strcmp(update->unit_style,"real") != 0 && comm->me == 0) - error->warning(FLERR,"Not using real units with pair reax"); - - int irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->newton = 2; - - FORTRAN(readc, READC)(); - FORTRAN(reaxinit, REAXINIT)(); - FORTRAN(ffinpt, FFINPT)(); - FORTRAN(tap7th, TAP7TH)(); - - // turn off read_in by fort.3 in REAX Fortran - - int ngeofor_tmp = -1; - FORTRAN(setngeofor, SETNGEOFOR)(&ngeofor_tmp); - if (comm->me == 0) FORTRAN(readgeo, READGEO)(); - - // initial setup for cutoff radius of VLIST and BLIST in ReaxFF - - double vlbora; - - FORTRAN(getswb, GETSWB)(&swb); - cutmax=MAX(swb, hbcut); - rcutvsq=cutmax*cutmax; - FORTRAN(getvlbora, GETVLBORA)(&vlbora); - rcutbsq=vlbora*vlbora; - - // parameters for charge equilibration from ReaxFF input, fort.4 - // verify that no LAMMPS type to REAX type mapping was invalid - - int nelements; - FORTRAN(getnso, GETNSO)(&nelements); - - FORTRAN(getswa, GETSWA)(&swa); - double chi, eta, gamma; - for (int itype = 1; itype <= atom->ntypes; itype++) { - if (map[itype] < 1 || map[itype] > nelements) - error->all(FLERR,"Invalid REAX atom type"); - chi = FORTRAN(cbkchb, CBKCHB).chi[map[itype]-1]; - eta = FORTRAN(cbkchb, CBKCHB).eta[map[itype]-1]; - gamma = FORTRAN(cbkchb, CBKCHB).gam[map[itype]-1]; - param_list[itype].np = 5; - param_list[itype].rcutsq = cutmax; - param_list[itype].params[0] = chi; - param_list[itype].params[1] = eta; - param_list[itype].params[2] = gamma; - param_list[itype].params[3] = swa; - param_list[itype].params[4] = swb; - } - - taper_setup(); -} - -/* ---------------------------------------------------------------------- - init for one type pair i,j and corresponding j,i -------------------------------------------------------------------------- */ - -double PairREAX::init_one(int i, int j) -{ - return cutmax; -} - -/* ---------------------------------------------------------------------- */ - -int PairREAX::pack_forward_comm(int n, int *list, double *buf, - int pbc_flag, int *pbc) -{ - int i,j,m; - - m = 0; - - if (packflag == 0) { - for (i = 0; i < n; i++) { - j = list[i]; - buf[m++] = FORTRAN(cbkabo, CBKABO).abo[j]; - } - - } else { - for (i = 0; i < n; i++) { - j = list[i]; - buf[m++] = wcg[j]; - } - } - - return m; -} - -/* ---------------------------------------------------------------------- */ - -void PairREAX::unpack_forward_comm(int n, int first, double *buf) -{ - int i,m,last; - - m = 0; - last = first + n; - - if (packflag == 0) { - for (i = first; i < last; i++) - FORTRAN(cbkabo, CBKABO).abo[i] = buf[m++]; - - } else { - for (i = first; i < last; i++) - wcg[i] = buf[m++]; - } -} - -/* ---------------------------------------------------------------------- */ - -int PairREAX::pack_reverse_comm(int n, int first, double *buf) -{ - int i,m,last; - - m = 0; - last = first + n; - for (i = first; i < last; i++) - buf[m++] = wcg[i]; - - return m; -} - -/* ---------------------------------------------------------------------- */ - -void PairREAX::unpack_reverse_comm(int n, int *list, double *buf) -{ - int i,j,m; - - m = 0; - for (i = 0; i < n; i++) { - j = list[i]; - wcg[j] += buf[m++]; - } -} - -/* ---------------------------------------------------------------------- - charge equilibration routines -------------------------------------------------------------------------- */ - -/* ---------------------------------------------------------------------- */ - -void PairREAX::taper_setup() -{ - double swb2,swa2,swb3,swa3,d1,d7; - - d1=swb-swa; - d7=pow(d1,7.0); - swa2=swa*swa; - swa3=swa2*swa; - swb2=swb*swb; - swb3=swb2*swb; - - swc7= 20.0e0/d7; - swc6= -70.0e0*(swa+swb)/d7; - swc5= 84.0e0*(swa2+3.0e0*swa*swb+swb2)/d7; - swc4= -35.0e0*(swa3+9.0e0*swa2*swb+9.0e0*swa*swb2+swb3)/d7; - swc3= 140.0e0*(swa3*swb+3.0e0*swa2*swb2+swa*swb3)/d7; - swc2=-210.0e0*(swa3*swb2+swa2*swb3)/d7; - swc1= 140.0e0*swa3*swb3/d7; - swc0=(-35.0e0*swa3*swb2*swb2+21.0e0*swa2*swb3*swb2- - 7.0e0*swa*swb3*swb3+swb3*swb3*swb)/d7; -} - -/* ---------------------------------------------------------------------- */ - -double PairREAX::taper_E(const double &r, const double &r2) -{ - double r3=r2*r; - return swc7*r3*r3*r+swc6*r3*r3+swc5*r3*r2+swc4*r2*r2+swc3*r3+swc2*r2+ - swc1*r+swc0; -} - -/* ---------------------------------------------------------------------- */ - -double PairREAX::taper_F(const double &r, const double &r2) -{ - double r3=r2*r; - return 7.0e0*swc7*r3*r3+6.0e0*swc6*r3*r2+5.0e0*swc5*r2*r2+ - 4.0e0*swc4*r3+3.0e0*swc3*r2+2.0e0*swc2*r+swc1; -} - -/* ---------------------------------------------------------------------- - compute current charge distributions based on the charge equilibration -------------------------------------------------------------------------- */ - -void PairREAX::compute_charge(double &energy_charge_equilibration) -{ - double xitmp, yitmp, zitmp; - double xjtmp, yjtmp, zjtmp; - int itype, jtype, itag, jtag; - int ii, jj, i, j; - double delr2, delr_norm, gamt, hulp1, hulp2; - double delx, dely, delz; - double qsum,qi; - int nmatentries; - double sw; - int inum,jnum; - int *ilist,*jlist,*numneigh,**firstneigh; - - double **x = atom->x; - double *q = atom->q; - int *type = atom->type; - int *tag = atom->tag; - - int nlocal = atom->nlocal; - int nghost = atom->nghost; - - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - firstneigh = list->firstneigh; - - // realloc neighbor based arrays if necessary - - int numneigh_total = 0; - for (ii = 0; ii < inum; ii++) - numneigh_total += numneigh[ilist[ii]]; - - if (numneigh_total + 2*nlocal > matmax) { - memory->destroy(aval); - memory->destroy(acol_ind); - matmax = numneigh_total + 2*nlocal; - memory->create(aval,matmax,"reax:aval"); - memory->create(acol_ind,matmax,"reax:acol_ind"); - } - - // build linear system - - nmatentries = 0; - - for (ii = 0; ii < inum; ii++) { - i = ilist[ii]; - xitmp = x[i][0]; - yitmp = x[i][1]; - zitmp = x[i][2]; - itype = type[i]; - itag = tag[i]; - jlist = firstneigh[i]; - jnum = numneigh[i]; - - arow_ptr[i] = nmatentries; - aval[nmatentries] = 2.0*param_list[itype].params[1]; - acol_ind[nmatentries] = i; - nmatentries++; - - aval[nmatentries] = 1.0; - acol_ind[nmatentries] = nlocal + nghost; - nmatentries++; - - for (jj = 0; jj < jnum; jj++) { - j = jlist[jj]; - j &= NEIGHMASK; - - xjtmp = x[j][0]; - yjtmp = x[j][1]; - zjtmp = x[j][2]; - jtype = type[j]; - jtag = tag[j]; - - delx = xitmp - xjtmp; - dely = yitmp - yjtmp; - delz = zitmp - zjtmp; - - delr2 = delx*delx+dely*dely+delz*delz; - - // avoid counting local-ghost pair twice since - // ReaxFF uses half neigh list with newton off - - if (j >= nlocal) { - if (itag > jtag) { - if ((itag+jtag) % 2 == 0) continue; - } else if (itag < jtag) { - if ((itag+jtag) % 2 == 1) continue; - } else { - if (zjtmp < zitmp) continue; - if (zjtmp == zitmp && yjtmp < yitmp) continue; - if (zjtmp == zitmp && yjtmp == yitmp && xjtmp < xitmp) continue; - } - } - - // rcutvsq = cutmax*cutmax, in ReaxFF - - if (delr2 <= rcutvsq) { - gamt = sqrt(param_list[itype].params[2]*param_list[jtype].params[2]); - delr_norm = sqrt(delr2); - sw = taper_E(delr_norm, delr2); - hulp1=(delr_norm*delr2+(1.0/(gamt*gamt*gamt))); - hulp2=sw*14.40/cbrt(hulp1); - aval[nmatentries] = hulp2; - acol_ind[nmatentries] = j; - nmatentries++; - } - } - } - - // in this case, we don't use Midpoint method - // so, we don't need to consider ghost-ghost interactions - // but, need to fill the arow_ptr[] arrays for the ghost atoms - - for (i = nlocal; i < nlocal+nghost; i++) - arow_ptr[i] = nmatentries; - arow_ptr[nlocal+nghost] = nmatentries; - - // add rhs matentries to linear system - - for (ii =0; iireverse_comm_pair(this); - comm->forward_comm_pair(this); - - MPI_Allreduce(&w[n-1], &sumtmp, 1, MPI_DOUBLE, MPI_SUM, world); - w[n-1] = sumtmp; - rho_old = one; - - for (iter = 1; iter < maxiter; iter++) { - rho = 0.0; - for (int i=0; i 1) { - beta = rho/rho_old; - for (int i = 0; ireverse_comm_pair(this); - comm->forward_comm_pair(this); - - MPI_Allreduce(&w[n-1], &sumtmp, 1, MPI_DOUBLE, MPI_SUM, world); - w[n-1] = sumtmp; - - for (int i=0; i Fortran calling syntax -// It defines the FORTRAN macro for converting variable and function -// names from FORTRAN to C. Different compilers do this in different -// ways. The default is add an underscore to the lower case string. -// Other definitions of the macro can be invoked by defining the -// corresponding macro at compile time using -D e.g. -D_IBM - -// CONS(a,b) should return ab, the concatenation of its arguments. -// If compiler is using strict ISO C standards, the ## works. -// Otherwise try the old /**/ trick and test. -// If that fails, you will need to figure out -// a definition for the FORTRAN macro that works on your machine. - -#if __STDC__ -#define CONS(a,b) a##b -#elif defined(_IBM) -#define CONS(a,b) a##b -#else -#define CONS(a,b) a/**/b -#warning "The following declaration is a test of the CONS macro" -#warning "If it fails, pair_reax_fortran.h must be modified by hand" -static int my_apples_my_oranges = 1; -static int my_applesoroanges = CONS(my_apples,_my_oranges); -#endif - - -#ifdef _IBM -#define FORTRAN(lcname,ucname) lcname -#endif - -#ifdef _F2C_LINUX -#define FORTRAN(lcname,ucname) CONS(lcname,__) -#endif - -#ifndef FORTRAN -#define FORTRAN(lcname,ucname) CONS(lcname,_) -#endif - -// hard-wired array sizes set in Fortran library -// accesses include file from Fortran library - -#include "reax_defs.h" - -class ReaxParams { - public: - enum {nneighmax=NNEIGHMAXDEF, - nat=NATDEF, - nattot=NATTOTDEF, - nsort=NSORTDEF, - mbond=MBONDDEF, - nbomax=NBOMAXDEF, - }; -}; - -// data structures corresponding to values in Fortran library - -extern "C" struct { - double abo[ReaxParams::nat]; -} FORTRAN(cbkabo,CBKABO); - -extern "C" struct { - double bo[ReaxParams::nbomax]; -} FORTRAN(cbkbo,CBKBO); - -extern "C" struct { - double c[3*ReaxParams::nat]; double cglobal[3*ReaxParams::nattot]; - int itag[ReaxParams::nat]; -} FORTRAN(cbkc,CBKC); - -extern "C" struct { -double ch[ReaxParams::nat]; -} FORTRAN(cbkch,CBKCH); - -extern "C" struct { - double chi[ReaxParams::nsort]; - double eta[ReaxParams::nsort]; - double gam[ReaxParams::nsort]; -} FORTRAN(cbkchb,CBKCHB); - -extern "C" struct { - double d[3*ReaxParams::nat]; double estrain[ReaxParams::nat]; -} FORTRAN(cbkd,CBKD); - -extern "C" struct { - double atomvirial[6*ReaxParams::nat]; - double virial[6]; - int Lvirial; - int Latomvirial; -} FORTRAN(cbkvirial,CBKVIRIAL); - -extern "C" struct { - int ia[ReaxParams::nat*(ReaxParams::mbond+3)]; - int iag[ReaxParams::nat*(ReaxParams::mbond+3)]; -} FORTRAN(cbkia,CBKIA); - -extern "C" struct { - double vlp[ReaxParams::nat]; - double dvlpdsbo[ReaxParams::nat]; -} FORTRAN(cbklonpar,CBKLONPAR); - -extern "C" struct { - int nubon1[ReaxParams::nat*(ReaxParams::mbond)]; - int nubon2[ReaxParams::nat*(ReaxParams::mbond)]; -} FORTRAN(cbknubon2,CBKNUBON2); - -extern "C" struct { - int nvl1[ReaxParams::nneighmax * ReaxParams::nat]; - int nvl2[ReaxParams::nneighmax * ReaxParams::nat]; - int nvpair; - int nvlself; -} FORTRAN(cbkpairs,CBKPAIRS); - -extern "C" struct { - int nvlbo[ReaxParams::nneighmax * ReaxParams::nat]; -} FORTRAN(cbknvlbo,CBKNVLBO); - -extern "C" struct { - int nvlown[ReaxParams::nneighmax * ReaxParams::nat]; -} FORTRAN(cbknvlown,CBKNVLOWN); - -extern "C" struct { - char qa[20*ReaxParams::nattot+10]; -} FORTRAN(cbkqa,CBKQA); - -extern "C" struct { - double eb; - double eoop; - double epen; - double estrc; - double deda[3]; - double pressu; - double efi; - double elp; - double emol; - double ea; - double eres; - double et; - double eradbo; - double ev; - double eco; - double ecoa; - double ehb; - double sw; - double ew; - double ep; - double ekin; -} FORTRAN(cbkenergies,CBKENERGIES); - -extern "C" struct { - double tset; - double dseed; - double tempmd; - double ts2; - double ts22; - int nmolo; - int nmolo5; - int nbon; - int na; - int namov; - int na_local; -} FORTRAN(rsmall,RSMALL); - -// external routines provided by Fortran library - -extern "C" void FORTRAN(readc,READC)(); -extern "C" void FORTRAN(reaxinit,REAXINIT)(); -extern "C" void FORTRAN(ffinpt,FFINPT)(); -extern "C" void FORTRAN(tap7th,TAP7TH)(); -extern "C" void FORTRAN(taper,TAPER)(double*,double*); -extern "C" void FORTRAN(readgeo,READGEO)(); -extern "C" void FORTRAN(srtatom,SRTATOM)(); -extern "C" void FORTRAN(vlist,VLIST) (); -extern "C" void FORTRAN(srtbon1,SRTBON1)(int*,int*,double*,int*,int*); -extern "C" void FORTRAN(molec,MOLEC)(); -extern "C" void FORTRAN(encalc,ENCALC)(); -extern "C" void FORTRAN(getswb,GETSWB)(double*); -extern "C" void FORTRAN(getswa,GETSWA)(double*); -extern "C" void FORTRAN(getvrange,GET_VRANGE)(double*); -extern "C" void FORTRAN(getnvlist,GET_NVLIST)(int*); -extern "C" void FORTRAN(getvlbora,GETVLBORA)(double*); -extern "C" void FORTRAN(cgsolve,CGSOLVE) - (int*,double*,int*,double*,double*,int*); -extern "C" void FORTRAN(getnval,GETNVAL)(int*); -extern "C" void FORTRAN(getntor,GETNTOR)(int*); -extern "C" void FORTRAN(getnhb,GETNHB)(int*); -extern "C" void FORTRAN(getnbonall,GETNBONALL)(int*); -extern "C" void FORTRAN(getnneighmax,GETNNEIGHMAX)(int*); -extern "C" void FORTRAN(getnat,GETNAT)(int*); -extern "C" void FORTRAN(getnattot,GETNATTOT)(int*); -extern "C" void FORTRAN(getnsort,GETNSORT)(int*); -extern "C" void FORTRAN(getmbond,GETMBOND)(int*); -extern "C" void FORTRAN(getnso,GETNSO)(int*); -extern "C" void FORTRAN(setngeofor,SETNGEOFOR)(int*); -extern "C" void FORTRAN(mdsav,MDSAV)(int*); -extern "C" void FORTRAN(getnsbmax,GETNSBMAX)(int*); -extern "C" void FORTRAN(getnsbma2,GETNSBMA2)(int*); -extern "C" void FORTRAN(getcutof3,GETCUTOF3)(double*); From a9c3b8aca0aafc34f07e4a04ed58f1fa5a6c1973 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 12:11:56 -0500 Subject: [PATCH 26/94] add reax to DEPRECATED pair style and state when it was removed from LAMMPS --- src/pair_deprecated.cpp | 4 ++++ src/pair_deprecated.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/pair_deprecated.cpp b/src/pair_deprecated.cpp index d8b3716341..5d05d4d739 100644 --- a/src/pair_deprecated.cpp +++ b/src/pair_deprecated.cpp @@ -48,6 +48,10 @@ void PairDeprecated::settings(int, char **) my_style = hybrid->keywords[hybrid->nstyles]; } + if (strcmp(my_style,"reax") == 0) { + writemsg(lmp,"\nPair style 'reax' has been removed from LAMMPS " + "after the 12 December 2018 version\n\n",1); + if (strcmp(my_style,"DEPRECATED") == 0) { writemsg(lmp,"\nPair style 'DEPRECATED' is a dummy style\n\n",0); diff --git a/src/pair_deprecated.h b/src/pair_deprecated.h index 29d6efffaf..029ec5e6d4 100644 --- a/src/pair_deprecated.h +++ b/src/pair_deprecated.h @@ -14,6 +14,7 @@ #ifdef PAIR_CLASS PairStyle(DEPRECATED,PairDeprecated) +PairStyle(reax,PairDeprecated) #else From 1de2f5fc01da48391fd04bb194bc89c4d6ea9029 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 12:12:29 -0500 Subject: [PATCH 27/94] make pair style `meam` an alias of `meam/c` --- src/USER-MEAMC/pair_meamc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/USER-MEAMC/pair_meamc.h b/src/USER-MEAMC/pair_meamc.h index 476a70dd04..a006e70bdb 100644 --- a/src/USER-MEAMC/pair_meamc.h +++ b/src/USER-MEAMC/pair_meamc.h @@ -14,6 +14,7 @@ #ifdef PAIR_CLASS PairStyle(meam/c,PairMEAMC) +PairStyle(meam,PairMEAMC) #else From 3f49eb8515418da97b27fb6480fca5f9ebc3e4dd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 12:14:03 -0500 Subject: [PATCH 28/94] remove meam and reax from build system --- cmake/CMakeLists.txt | 8 ++++---- src/Makefile | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 7ee1b7f521..bb3c6f37d1 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -171,7 +171,7 @@ set(LAMMPS_DEPS) set(LAMMPS_API_DEFINES) set(DEFAULT_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE GRANULAR - KSPACE MANYBODY MC MEAM MESSAGE MISC MOLECULE PERI REAX REPLICA RIGID SHOCK + KSPACE MANYBODY MC MESSAGE MISC MOLECULE PERI REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI POEMS LATTE USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESO USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-LB USER-MANIFOLD @@ -191,11 +191,11 @@ endforeach() ###################################################### # packages with special compiler needs or external libs ###################################################### -if(PKG_REAX OR PKG_MEAM OR PKG_USER-QUIP OR PKG_USER-QMMM OR PKG_LATTE OR PKG_USER-SCAFACOS) +if(PKG_USER-QUIP OR PKG_USER-QMMM OR PKG_LATTE OR PKG_USER-SCAFACOS) enable_language(Fortran) endif() -if(PKG_MEAM OR PKG_USER-H5MD OR PKG_USER-QMMM OR PKG_USER-SCAFACOS) +if(PKG_USER-H5MD OR PKG_USER-QMMM OR PKG_USER-SCAFACOS) enable_language(C) endif() @@ -826,7 +826,7 @@ endforeach() ############################################## # add lib sources of (simple) enabled packages ############################################ -foreach(SIMPLE_LIB REAX MEAM POEMS USER-ATC USER-AWPMD USER-COLVARS USER-H5MD +foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-QMMM) if(PKG_${SIMPLE_LIB}) string(REGEX REPLACE "^USER-" "" PKG_LIB "${SIMPLE_LIB}") diff --git a/src/Makefile b/src/Makefile index 1fda92b2c4..c58d5bd9eb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -53,9 +53,9 @@ endif # PACKEXT = subset that require an external (downloaded) library PACKAGE = asphere body class2 colloid compress coreshell dipole gpu \ - granular kim kokkos kspace latte manybody mc meam message misc \ + granular kim kokkos kspace latte manybody mc message misc \ molecule mpiio mscg opt peri poems \ - python qeq reax replica rigid shock snap spin srd voronoi + python qeq replica rigid shock snap spin srd voronoi PACKUSER = user-atc user-awpmd user-bocs user-cgdna user-cgsdk user-colvars \ user-diffraction user-dpd user-drude user-eff user-fep user-h5md \ @@ -65,15 +65,15 @@ PACKUSER = user-atc user-awpmd user-bocs user-cgdna user-cgsdk user-colvars \ user-qtb user-quip user-reaxc user-scafacos user-smd user-smtbq \ user-sdpd user-sph user-tally user-uef user-vtk -PACKLIB = compress gpu kim kokkos latte meam message mpiio mscg poems \ - python reax voronoi \ +PACKLIB = compress gpu kim kokkos latte message mpiio mscg poems \ + python voronoi \ user-atc user-awpmd user-colvars user-h5md user-lb user-molfile \ user-netcdf user-plumed user-qmmm user-quip user-scafacos \ user-smd user-vtk PACKSYS = compress mpiio python user-lb -PACKINT = gpu kokkos meam message poems reax user-atc user-awpmd user-colvars +PACKINT = gpu kokkos message poems user-atc user-awpmd user-colvars PACKEXT = kim latte mscg voronoi \ user-h5md user-molfile user-netcdf user-plumed user-qmmm user-quip \ From 93efe3e40e83ccb1d3906691368fd8bd87415cda Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 12:21:15 -0500 Subject: [PATCH 29/94] update docs for meam and meam/c pair style --- doc/src/pair_meam.txt | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/doc/src/pair_meam.txt b/doc/src/pair_meam.txt index b4893d1db1..b57339b180 100644 --- a/doc/src/pair_meam.txt +++ b/doc/src/pair_meam.txt @@ -6,18 +6,17 @@ :line -pair_style meam command :h3 pair_style meam/c command :h3 [Syntax:] pair_style style :pre -style = {meam} or {meam/c} +style = {meam/c} [Examples:] -pair_style meam +pair_style meam/c pair_coeff * * ../potentials/library.meam Si ../potentials/si.meam Si pair_coeff * * ../potentials/library.meam Ni Al NULL Ni Al Ni Ni :pre @@ -27,14 +26,16 @@ NOTE: The behavior of the MEAM potential for alloy systems has changed as of November 2010; see description below of the mixture_ref_t parameter -Style {meam} computes pairwise interactions for a variety of materials +Style {meam/c} computes pairwise interactions for a variety of materials using modified embedded-atom method (MEAM) potentials "(Baskes)"_#Baskes. Conceptually, it is an extension to the original "EAM potentials"_pair_eam.html which adds angular forces. It is thus suitable for modeling metals and alloys with fcc, bcc, hcp and diamond cubic structures, as well as covalently bonded materials like -silicon and carbon. Style {meam/c} is a translation of the {meam} code -from (mostly) Fortran to C++. It is functionally equivalent to {meam}. +silicon and carbon. Style {meam/c} is a translation of the (now obsolete) +{meam} code from Fortran to C++. It is functionally equivalent to {meam} +but more efficient, and thus {meam} has been removed from LAMMPS after +the 12 December 2018 release. In the MEAM formulation, the total energy E of a system of atoms is given by: @@ -352,13 +353,8 @@ This pair style can only be used via the {pair} keyword of the [Restrictions:] -The {meam} style is part of the MEAM package. It is only enabled if -LAMMPS was built with that package, which also requires the MEAM -library be built and linked with LAMMPS. The {meam/c} style is -provided in the USER-MEAMC package. It is only enabled if LAMMPS was -built with that package. In contrast to the {meam} style, {meam/c} -does not require a separate library to be compiled and it can be -instantiated multiple times in a "hybrid"_pair_hybrid.html pair style. +The {meam/c} style is provided in the USER-MEAMC package. It is +only enabled if LAMMPS was built with that package. See the "Build package"_Build_package.html doc page for more info. [Related commands:] From dedc6cf20c512f29ebf71fc66f26736373b662de Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 14:16:08 -0500 Subject: [PATCH 30/94] remove obsolete reax tools and rename pair_meam.txt to pair_meamc.txt --- doc/src/{pair_meam.txt => pair_meamc.txt} | 0 tools/reax/bondConnectCheck.f90 | 232 ------- tools/reax/bonds.reax | 784 --------------------- tools/reax/mol_fra.c | 801 ---------------------- 4 files changed, 1817 deletions(-) rename doc/src/{pair_meam.txt => pair_meamc.txt} (100%) delete mode 100644 tools/reax/bondConnectCheck.f90 delete mode 100644 tools/reax/bonds.reax delete mode 100644 tools/reax/mol_fra.c diff --git a/doc/src/pair_meam.txt b/doc/src/pair_meamc.txt similarity index 100% rename from doc/src/pair_meam.txt rename to doc/src/pair_meamc.txt diff --git a/tools/reax/bondConnectCheck.f90 b/tools/reax/bondConnectCheck.f90 deleted file mode 100644 index feff1ed3ed..0000000000 --- a/tools/reax/bondConnectCheck.f90 +++ /dev/null @@ -1,232 +0,0 @@ -!# DEC.9, 2010 -!# HLL -!# NCSU -!# -!# This is a program to read the output from 'fix reax/bond', TPRD, Lammps -!# The output is saved into file "bonds.reax", where each image is divided -!# into three parts: -!# -!# (1) Head, 7 Lines; -!# (2) Body, No._of_atom Lines; -!# (3) Tail, 1 Line -!# -!# The total number of images is related with the output frequence and number of iterations. -!# In this case, it is "number of iteration+1". -!# -!# Each line in Body part is made up of the following parameters: -!# id, type, nb, id_1, id_2, ... id_nb, mol, bo_1, bo_2, ... bo_nb, abo, nlp, q -!# abo = atomic bond order -!# nlp = number of lone pairs -!# q = atomic charge -!# -!# PLEASE DOUBLE CHECK YOUR OWN LAMMPS INPUT SCRIPT & OUTPUT AND MAKE CORRESPONDING CHSNGES - -program main -implicit none - -integer I, J, K, L -integer image, natom -integer headline, tailline -integer id, atype, nb, bd1, bd2, bd3, bd4, mol -double precision bo1, bo2, bo3, bo4, abo, nlp, q - -open (unit=10, file='bonds.reax') - -open (unit=20, file='N129.txt', status='unknown') -open (unit=21, file='N133.txt', status='unknown') -open (unit=22, file='N137.txt', status='unknown') -open (unit=23, file='N141.txt', status='unknown') -open (unit=24, file='N145.txt', status='unknown') -open (unit=25, file='N149.txt', status='unknown') -open (unit=26, file='N153.txt', status='unknown') -open (unit=27, file='N157.txt', status='unknown') - -open (unit=30, file='reactionRecord.txt', status='unknown') - -!# Make changes accordingly. -image = 1 -headline = 7 -tailline = 1 -natom = 384 - -do I = 1, image+1 - -! Skip the head part - do J = 1, headline - read(10,*) - end do - -! Each image has 'natom' lines - do K = 1, natom - -! read in the first three number each line to determine: -! (1) what type of atom it is, atype -! the correspondence in Lammps: 1-C, 2-H, 3-O, 4-N, 5-S -! (2) how many bonds it has, nb -! this 'nb' determines the following bond_link information & bond_order paramaters of the same line - - read(10,*) id, atype, nb - -! TEST -! write(*,*) id, atype, nb - - if (atype .eq. 4) then - - backspace 10 - -! Should have some easier way to replace this "IF", I am just toooo lazy. -! Thanks to the fact that the maximum number of bonds is 4. ^-^ -!??? is it possible that nb = 0 ??? KEEP THAT IN MIND. - - if (nb.eq.0) then - - read(10,*) id, atype, nb, mol, abo, nlp, q - - if (id .eq. 129) then - write(20, 200) id, atype, nb, mol, abo, nlp, q - elseif (id .eq. 133) then - write(21, 200) id, atype, nb, mol, abo, nlp, q - elseif (id .eq. 137) then - write(22, 200) id, atype, nb, mol, abo, nlp, q - elseif (id .eq. 141) then - write(23, 200) id, atype, nb, mol, abo, nlp, q - elseif (id .eq. 145) then - write(24, 200) id, atype, nb, mol, abo, nlp, q - elseif (id .eq. 149) then - write(25, 200) id, atype, nb, mol, abo, nlp, q - elseif (id .eq. 153) then - write(26, 200) id, atype, nb, mol, abo, nlp, q - elseif (id .eq. 157) then - write(27, 200) id, atype, nb, mol, abo, nlp, q - 200 format(4I4, 3f14.3) - endif - -! If bd .ne. 3, it measn reaction is happening to Nitrogen atom. - write (30, 300) I, id, atype, nb, mol, abo, nlp, q - 300 format(5I4, 3f14.3) - - - elseif (nb.eq.1) then - - read(10,*) id, atype, nb, bd1, mol, bo1, abo, nlp, q - - if (id .eq. 129) then - write(20, 201) id, atype, nb, bd1, mol, bo1, abo, nlp, q - elseif (id .eq. 133) then - write(21, 201) id, atype, nb, bd1, mol, bo1, abo, nlp, q - elseif (id .eq. 137) then - write(22, 201) id, atype, nb, bd1, mol, bo1, abo, nlp, q - elseif (id .eq. 141) then - write(23, 201) id, atype, nb, bd1, mol, bo1, abo, nlp, q - elseif (id .eq. 145) then - write(24, 201) id, atype, nb, bd1, mol, bo1, abo, nlp, q - elseif (id .eq. 149) then - write(25, 201) id, atype, nb, bd1, mol, bo1, abo, nlp, q - elseif (id .eq. 153) then - write(26, 201) id, atype, nb, bd1, mol, bo1, abo, nlp, q - elseif (id .eq. 157) then - write(27, 201) id, atype, nb, bd1, mol, bo1, abo, nlp, q - 201 format(5I4, 4f14.3) - endif - - ! If bd .ne. 3, it measn reaction is happening to Nitrogen atom. - write (30, 301) I, id, atype, nb, bd1, mol, bo1, abo, nlp, q - 301 format(6I4, 4f14.3) - - elseif (nb.eq.2) then - - read(10,*) id, atype, nb, bd1, bd2, mol, bo1, bo2, abo, nlp, q - - if (id .eq. 129) then - write(20, 202) id, atype, nb, bd1, bd2, mol, bo1, bo2, abo, nlp, q - elseif (id .eq. 133) then - write(21, 202) id, atype, nb, bd1, bd2, mol, bo1, bo2, abo, nlp, q - elseif (id .eq. 137) then - write(22, 202) id, atype, nb, bd1, bd2, mol, bo1, bo2, abo, nlp, q - elseif (id .eq. 141) then - write(23, 202) id, atype, nb, bd1, bd2, mol, bo1, bo2, abo, nlp, q - elseif (id .eq. 145) then - write(24, 202) id, atype, nb, bd1, bd2, mol, bo1, bo2, abo, nlp, q - elseif (id .eq. 149) then - write(25, 202) id, atype, nb, bd1, bd2, mol, bo1, bo2, abo, nlp, q - elseif (id .eq. 153) then - write(26, 202) id, atype, nb, bd1, bd2, mol, bo1, bo2, abo, nlp, q - elseif (id .eq. 157) then - write(27, 202) id, atype, nb, bd1, bd2, mol, bo1, bo2, abo, nlp, q - 202 format(6I4, 5f14.3) - endif - -! If bd .ne. 3, it measn reaction is happening to Nitrogen atom. - write (30, 302) I, id, atype, nb, bd1, bd2, mol, bo1, bo2, abo, nlp, q - 302 format(7I4, 5f14.3) - - elseif (nb.eq.3) then - - read(10,*) id, atype, nb, bd1, bd2, bd3, mol, bo1, bo2, bo3, abo, nlp, q - - - if (id .eq. 129) then - write(20, 203) id, atype, nb, bd1, bd2, bd3, mol, bo1, bo2, bo3, abo, nlp, q - elseif (id .eq. 133) then - write(21, 203) id, atype, nb, bd1, bd2, bd3, mol, bo1, bo2, bo3, abo, nlp, q - elseif (id .eq. 137) then - write(22, 203) id, atype, nb, bd1, bd2, bd3, mol, bo1, bo2, bo3, abo, nlp, q - elseif (id .eq. 141) then - write(23, 203) id, atype, nb, bd1, bd2, bd3, mol, bo1, bo2, bo3, abo, nlp, q - elseif (id .eq. 145) then - write(24, 203) id, atype, nb, bd1, bd2, bd3, mol, bo1, bo2, bo3, abo, nlp, q - elseif (id .eq. 149) then - write(25, 203) id, atype, nb, bd1, bd2, bd3, mol, bo1, bo2, bo3, abo, nlp, q - elseif (id .eq. 153) then - write(26, 203) id, atype, nb, bd1, bd2, bd3, mol, bo1, bo2, bd3, abo, nlp, q - elseif (id .eq. 157) then - write(27, 203) id, atype, nb, bd1, bd2, bd3, mol, bo1, bo2, bo3, abo, nlp, q - 203 format(7I4, 6f14.3) - endif - - elseif (nb.eq.4) then - - read(10,*) id, atype, nb, bd1, bd2, bd3, bd4, mol, bo1, bo2, bo3, bo4, abo, nlp, q - - if (id .eq. 129) then - write(20, 204) id, atype, nb, bd1, bd2, bd3, bd4, mol, bo1, bo2, bo3, bo4, abo, nlp, q - elseif (id .eq. 133) then - write(21, 204) id, atype, nb, bd1, bd2, bd3, bd4, mol, bo1, bo2, bo3, bo4, abo, nlp, q - elseif (id .eq. 137) then - write(22, 204) id, atype, nb, bd1, bd2, bd3, bd4, mol, bo1, bo2, bo3, bo4, abo, nlp, q - elseif (id .eq. 141) then - write(23, 204) id, atype, nb, bd1, bd2, bd3, bd4, mol, bo1, bo2, bo3, bo4, abo, nlp, q - elseif (id .eq. 145) then - write(24, 204) id, atype, nb, bd1, bd2, bd3, bd4, mol, bo1, bo2, bo3, bo4, abo, nlp, q - elseif (id .eq. 149) then - write(25, 204) id, atype, nb, bd1, bd2, bd3, bd4, mol, bo1, bo2, bo3, bo4, abo, nlp, q - elseif (id .eq. 153) then - write(26, 204) id, atype, nb, bd1, bd2, bd3, bd4, mol, bo1, bo2, bd3, bo4, abo, nlp, q - elseif (id .eq. 157) then - write(27, 204) id, atype, nb, bd1, bd2, bd3, bd4, mol, bo1, bo2, bo3, bo4, abo, nlp, q - 204 format(8I4, 7f14.3) - endif - -! If bd .ne. 3, it measn reaction is happening to Nitrogen atom. - write (30, 304) I, id, atype, nb, bd1, bd2, bd3, bd4, mol, bo1, bo2, bo3, bo4, abo, nlp, q - 304 format(9I4, 7f14.3) - -! Corresponding to "if (nb.eq.0) then " - - endif - -! Corresponding to "if (atype .eq. 4) then" - endif - - - enddo - - do L =1,tailline - read(10,*) - enddo - - enddo - - end program main - - diff --git a/tools/reax/bonds.reax b/tools/reax/bonds.reax deleted file mode 100644 index 4c7af471ba..0000000000 --- a/tools/reax/bonds.reax +++ /dev/null @@ -1,784 +0,0 @@ -# Timestep 0 -# -# Number of particles 384 -# -# Max.number of bonds per atom 3 with coarse bond order cutoff 0.300 -# Particle connection table and bond orders -# id type nb id_1...id_nb mol bo_1...bo_nb abo nlp q - 1 1 3 2 6 13 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 2 1 3 1 3 14 0 1.324 1.345 1.300 3.969 0.000 0.193 - 3 1 3 2 4 15 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 4 1 3 3 5 16 0 1.336 1.306 1.324 3.967 0.000 0.196 - 5 1 3 4 6 17 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 6 1 3 1 5 18 0 1.332 1.317 1.318 3.967 0.000 0.191 - 7 2 1 14 0 0.873 1.075 0.000 0.366 - 8 2 1 14 0 0.897 1.056 0.000 0.386 - 9 2 1 16 0 0.905 1.051 0.000 0.379 - 10 2 2 16 23 0 0.838 0.267 1.105 0.000 0.385 - 11 2 2 18 24 0 0.868 0.216 1.083 0.000 0.377 - 12 2 1 18 0 0.881 1.069 0.000 0.386 - 13 4 3 1 20 19 0 1.109 1.198 1.197 3.504 0.165 0.344 - 14 4 3 2 7 8 0 1.300 0.873 0.897 3.070 0.966 -0.469 - 15 4 3 3 21 22 0 1.083 1.211 1.214 3.508 0.160 0.371 - 16 4 3 4 9 10 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 17 4 3 5 23 24 0 1.143 1.171 1.190 3.504 0.165 0.341 - 18 4 3 6 11 12 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 19 3 1 13 0 1.197 1.393 2.000 -0.381 - 20 3 1 13 0 1.198 1.407 2.000 -0.413 - 21 3 1 15 0 1.211 1.378 2.000 -0.375 - 22 3 1 15 0 1.214 1.368 2.000 -0.399 - 23 3 2 10 17 0 0.267 1.171 1.446 2.000 -0.388 - 24 3 2 11 17 0 0.216 1.190 1.413 2.000 -0.411 - 25 1 3 30 26 37 0 1.332 1.324 1.109 3.767 0.000 -0.073 - 26 1 3 25 27 38 0 1.324 1.345 1.300 3.969 0.000 0.193 - 27 1 3 26 28 39 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 28 1 3 27 29 40 0 1.336 1.306 1.324 3.967 0.000 0.196 - 29 1 3 28 30 41 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 30 1 3 25 29 42 0 1.332 1.317 1.318 3.967 0.000 0.191 - 31 2 1 38 0 0.873 1.075 0.000 0.366 - 32 2 1 38 0 0.897 1.056 0.000 0.386 - 33 2 1 40 0 0.905 1.051 0.000 0.379 - 34 2 2 47 40 0 0.267 0.838 1.105 0.000 0.385 - 35 2 2 42 48 0 0.868 0.216 1.083 0.000 0.377 - 36 2 1 42 0 0.881 1.069 0.000 0.386 - 37 4 3 25 43 44 0 1.109 1.197 1.198 3.504 0.165 0.344 - 38 4 3 26 32 31 0 1.300 0.897 0.873 3.070 0.966 -0.469 - 39 4 3 27 45 46 0 1.083 1.211 1.214 3.508 0.160 0.371 - 40 4 3 28 33 34 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 41 4 3 29 47 48 0 1.143 1.171 1.190 3.504 0.165 0.341 - 42 4 3 30 35 36 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 43 3 1 37 0 1.197 1.393 2.000 -0.381 - 44 3 1 37 0 1.198 1.407 2.000 -0.413 - 45 3 1 39 0 1.211 1.378 2.000 -0.375 - 46 3 1 39 0 1.214 1.368 2.000 -0.399 - 47 3 2 34 41 0 0.267 1.171 1.446 2.000 -0.388 - 48 3 2 35 41 0 0.216 1.190 1.413 2.000 -0.411 - 49 1 3 50 54 61 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 50 1 3 49 51 62 0 1.324 1.345 1.300 3.969 0.000 0.193 - 51 1 3 50 52 63 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 52 1 3 51 53 64 0 1.336 1.306 1.324 3.967 0.000 0.196 - 53 1 3 52 54 65 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 54 1 3 49 53 66 0 1.332 1.317 1.318 3.967 0.000 0.191 - 55 2 1 62 0 0.873 1.075 0.000 0.366 - 56 2 1 62 0 0.897 1.056 0.000 0.386 - 57 2 1 64 0 0.905 1.051 0.000 0.379 - 58 2 2 64 71 0 0.838 0.267 1.105 0.000 0.385 - 59 2 2 66 72 0 0.868 0.216 1.083 0.000 0.377 - 60 2 1 66 0 0.881 1.069 0.000 0.386 - 62 4 3 50 55 56 0 1.300 0.873 0.897 3.070 0.966 -0.469 - 63 4 3 51 69 70 0 1.083 1.211 1.214 3.508 0.160 0.371 - 64 4 3 52 57 58 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 65 4 3 53 71 72 0 1.143 1.171 1.190 3.504 0.165 0.341 - 66 4 3 54 59 60 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 69 3 1 63 0 1.211 1.378 2.000 -0.375 - 70 3 1 63 0 1.214 1.368 2.000 -0.399 - 71 3 2 58 65 0 0.267 1.171 1.446 2.000 -0.388 - 72 3 2 59 65 0 0.216 1.190 1.413 2.000 -0.411 - 73 1 3 78 74 85 0 1.332 1.324 1.109 3.767 0.000 -0.073 - 74 1 3 73 75 86 0 1.324 1.345 1.300 3.969 0.000 0.193 - 75 1 3 74 76 87 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 76 1 3 75 77 88 0 1.336 1.306 1.324 3.967 0.000 0.196 - 77 1 3 76 78 89 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 78 1 3 73 77 90 0 1.332 1.317 1.318 3.967 0.000 0.191 - 79 2 1 86 0 0.873 1.075 0.000 0.366 - 80 2 1 86 0 0.897 1.056 0.000 0.386 - 81 2 1 88 0 0.905 1.051 0.000 0.379 - 82 2 2 95 88 0 0.267 0.838 1.105 0.000 0.385 - 83 2 2 90 96 0 0.868 0.216 1.083 0.000 0.377 - 84 2 1 90 0 0.881 1.069 0.000 0.386 - 85 4 3 73 91 92 0 1.109 1.197 1.198 3.504 0.165 0.344 - 86 4 3 74 80 79 0 1.300 0.897 0.873 3.070 0.966 -0.469 - 87 4 3 75 93 94 0 1.083 1.211 1.214 3.508 0.160 0.371 - 88 4 3 76 81 82 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 89 4 3 77 95 96 0 1.143 1.171 1.190 3.504 0.165 0.341 - 90 4 3 78 83 84 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 91 3 1 85 0 1.197 1.393 2.000 -0.381 - 92 3 1 85 0 1.198 1.407 2.000 -0.413 - 93 3 1 87 0 1.211 1.378 2.000 -0.375 - 94 3 1 87 0 1.214 1.368 2.000 -0.399 - 95 3 2 82 89 0 0.267 1.171 1.446 2.000 -0.388 - 96 3 2 83 89 0 0.216 1.190 1.413 2.000 -0.411 - 97 1 3 98 102 109 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 98 1 3 97 99 110 0 1.324 1.345 1.300 3.969 0.000 0.193 - 99 1 3 98 100 111 0 1.345 1.337 1.083 3.767 0.000 -0.060 - 100 1 3 99 101 112 0 1.337 1.306 1.324 3.967 0.000 0.196 - 101 1 3 100 113 102 0 1.306 1.143 1.317 3.769 0.000 -0.063 - 102 1 3 97 101 114 0 1.332 1.317 1.318 3.967 0.000 0.191 - 103 2 1 110 0 0.873 1.075 0.000 0.366 - 104 2 1 110 0 0.897 1.056 0.000 0.386 - 105 2 1 112 0 0.905 1.051 0.000 0.379 - 106 2 2 119 112 0 0.267 0.838 1.105 0.000 0.385 - 107 2 2 114 120 0 0.868 0.216 1.083 0.000 0.377 - 108 2 1 114 0 0.881 1.069 0.000 0.386 - 109 4 3 116 97 115 0 1.198 1.109 1.197 3.504 0.165 0.344 - 110 4 3 103 104 98 0 0.873 0.897 1.300 3.070 0.966 -0.469 - 111 4 3 99 117 118 0 1.083 1.211 1.214 3.508 0.160 0.371 - 112 4 3 100 105 106 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 113 4 3 101 119 120 0 1.143 1.171 1.190 3.504 0.165 0.341 - 114 4 3 102 107 108 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 115 3 1 109 0 1.197 1.393 2.000 -0.381 - 116 3 1 109 0 1.198 1.407 2.000 -0.413 - 117 3 1 111 0 1.211 1.378 2.000 -0.375 - 118 3 1 111 0 1.214 1.368 2.000 -0.399 - 119 3 2 106 113 0 0.267 1.171 1.446 2.000 -0.388 - 120 3 2 107 113 0 0.216 1.190 1.413 2.000 -0.411 - 121 1 3 126 122 133 0 1.332 1.324 1.109 3.767 0.000 -0.073 - 122 1 3 121 123 134 0 1.324 1.345 1.300 3.969 0.000 0.193 - 123 1 3 122 124 135 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 124 1 3 123 125 136 0 1.336 1.306 1.324 3.967 0.000 0.196 - 125 1 3 124 126 137 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 126 1 3 121 125 138 0 1.332 1.317 1.318 3.967 0.000 0.191 - 127 2 1 134 0 0.873 1.075 0.000 0.366 - 128 2 1 134 0 0.897 1.056 0.000 0.386 - 129 2 1 136 0 0.905 1.051 0.000 0.379 - 130 2 2 143 136 0 0.267 0.838 1.105 0.000 0.385 - 131 2 2 138 144 0 0.868 0.216 1.083 0.000 0.377 - 132 2 1 138 0 0.881 1.069 0.000 0.386 - 133 4 3 121 139 140 0 1.109 1.197 1.198 3.504 0.165 0.344 - 134 4 3 122 127 128 0 1.300 0.873 0.897 3.070 0.966 -0.469 - 135 4 3 123 141 142 0 1.083 1.211 1.214 3.508 0.160 0.371 - 136 4 3 124 129 130 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 137 4 3 125 143 144 0 1.143 1.171 1.190 3.504 0.165 0.341 - 138 4 3 126 131 132 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 139 3 1 133 0 1.197 1.393 2.000 -0.381 - 140 3 1 133 0 1.198 1.407 2.000 -0.413 - 141 3 1 135 0 1.211 1.378 2.000 -0.375 - 142 3 1 135 0 1.214 1.368 2.000 -0.399 - 143 3 2 130 137 0 0.267 1.171 1.446 2.000 -0.388 - 144 3 2 131 137 0 0.216 1.190 1.413 2.000 -0.411 - 145 1 3 146 150 157 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 146 1 3 145 147 158 0 1.324 1.345 1.300 3.969 0.000 0.193 - 147 1 3 146 148 159 0 1.345 1.337 1.083 3.767 0.000 -0.060 - 148 1 3 147 149 160 0 1.337 1.306 1.324 3.967 0.000 0.196 - 149 1 3 148 161 150 0 1.306 1.143 1.317 3.769 0.000 -0.063 - 150 1 3 145 149 162 0 1.332 1.317 1.318 3.967 0.000 0.191 - 151 2 1 158 0 0.873 1.075 0.000 0.366 - 152 2 1 158 0 0.897 1.056 0.000 0.386 - 153 2 1 160 0 0.905 1.051 0.000 0.379 - 154 2 2 167 160 0 0.267 0.838 1.105 0.000 0.385 - 155 2 2 168 162 0 0.216 0.868 1.083 0.000 0.377 - 156 2 1 162 0 0.881 1.069 0.000 0.386 - 158 4 3 151 152 146 0 0.873 0.897 1.300 3.070 0.966 -0.469 - 159 4 3 147 165 166 0 1.083 1.211 1.214 3.508 0.160 0.371 - 160 4 3 148 153 154 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 161 4 3 149 167 168 0 1.143 1.171 1.190 3.504 0.165 0.341 - 162 4 3 150 155 156 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 165 3 1 159 0 1.211 1.378 2.000 -0.375 - 166 3 1 159 0 1.214 1.368 2.000 -0.399 - 167 3 2 154 161 0 0.267 1.171 1.446 2.000 -0.388 - 168 3 2 155 161 0 0.216 1.190 1.413 2.000 -0.411 - 169 1 3 174 170 181 0 1.332 1.324 1.109 3.767 0.000 -0.073 - 170 1 3 169 171 182 0 1.324 1.345 1.300 3.969 0.000 0.193 - 171 1 3 170 172 183 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 172 1 3 171 173 184 0 1.336 1.306 1.324 3.967 0.000 0.196 - 173 1 3 172 174 185 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 174 1 3 169 173 186 0 1.332 1.317 1.318 3.967 0.000 0.191 - 175 2 1 182 0 0.873 1.075 0.000 0.366 - 176 2 1 182 0 0.897 1.056 0.000 0.386 - 177 2 1 184 0 0.905 1.051 0.000 0.379 - 178 2 2 191 184 0 0.267 0.838 1.105 0.000 0.385 - 179 2 2 186 192 0 0.868 0.216 1.083 0.000 0.377 - 180 2 1 186 0 0.881 1.069 0.000 0.386 - 181 4 3 169 187 188 0 1.109 1.197 1.198 3.504 0.165 0.344 - 182 4 3 170 175 176 0 1.300 0.873 0.897 3.070 0.966 -0.469 - 183 4 3 171 189 190 0 1.083 1.211 1.214 3.508 0.160 0.371 - 184 4 3 172 177 178 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 185 4 3 173 191 192 0 1.143 1.171 1.190 3.504 0.165 0.341 - 186 4 3 174 179 180 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 187 3 1 181 0 1.197 1.393 2.000 -0.381 - 188 3 1 181 0 1.198 1.407 2.000 -0.413 - 189 3 1 183 0 1.211 1.378 2.000 -0.375 - 190 3 1 183 0 1.214 1.368 2.000 -0.399 - 191 3 2 178 185 0 0.267 1.171 1.446 2.000 -0.388 - 192 3 2 179 185 0 0.216 1.190 1.413 2.000 -0.411 - 193 1 3 194 198 205 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 194 1 3 193 195 206 0 1.324 1.345 1.300 3.969 0.000 0.193 - 195 1 3 194 196 207 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 196 1 3 195 197 208 0 1.336 1.306 1.324 3.967 0.000 0.196 - 197 1 3 196 198 209 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 198 1 3 193 197 210 0 1.332 1.317 1.318 3.967 0.000 0.191 - 199 2 1 206 0 0.873 1.075 0.000 0.366 - 200 2 1 206 0 0.897 1.056 0.000 0.386 - 201 2 1 208 0 0.905 1.051 0.000 0.379 - 202 2 2 208 215 0 0.838 0.267 1.105 0.000 0.385 - 203 2 2 210 216 0 0.868 0.216 1.083 0.000 0.377 - 204 2 1 210 0 0.881 1.069 0.000 0.386 - 205 4 3 212 193 211 0 1.198 1.109 1.197 3.504 0.165 0.344 - 206 4 3 199 200 194 0 0.873 0.897 1.300 3.070 0.966 -0.469 - 207 4 3 195 213 214 0 1.083 1.211 1.214 3.508 0.160 0.371 - 208 4 3 196 201 202 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 209 4 3 197 215 216 0 1.143 1.171 1.190 3.504 0.165 0.341 - 210 4 3 198 203 204 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 211 3 1 205 0 1.197 1.393 2.000 -0.381 - 212 3 1 205 0 1.198 1.407 2.000 -0.413 - 213 3 1 207 0 1.211 1.378 2.000 -0.375 - 214 3 1 207 0 1.214 1.368 2.000 -0.399 - 215 3 2 202 209 0 0.267 1.171 1.446 2.000 -0.388 - 216 3 2 203 209 0 0.216 1.190 1.413 2.000 -0.411 - 217 1 3 218 222 229 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 218 1 3 217 219 230 0 1.324 1.345 1.300 3.969 0.000 0.193 - 219 1 3 218 220 231 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 220 1 3 219 221 232 0 1.336 1.306 1.324 3.967 0.000 0.196 - 221 1 3 220 222 233 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 222 1 3 217 221 234 0 1.332 1.317 1.318 3.967 0.000 0.191 - 223 2 1 230 0 0.873 1.075 0.000 0.366 - 224 2 1 230 0 0.897 1.056 0.000 0.386 - 225 2 1 232 0 0.905 1.051 0.000 0.379 - 226 2 2 239 232 0 0.267 0.838 1.105 0.000 0.385 - 227 2 2 234 240 0 0.868 0.216 1.083 0.000 0.377 - 228 2 1 234 0 0.881 1.069 0.000 0.386 - 229 4 3 217 235 236 0 1.109 1.197 1.198 3.504 0.165 0.344 - 230 4 3 218 223 224 0 1.300 0.873 0.897 3.070 0.966 -0.469 - 231 4 3 219 237 238 0 1.083 1.211 1.214 3.508 0.160 0.371 - 232 4 3 225 226 220 0 0.905 0.838 1.324 3.068 0.968 -0.443 - 233 4 3 221 239 240 0 1.143 1.171 1.190 3.504 0.165 0.341 - 234 4 3 222 227 228 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 235 3 1 229 0 1.197 1.393 2.000 -0.381 - 236 3 1 229 0 1.198 1.407 2.000 -0.413 - 237 3 1 231 0 1.211 1.378 2.000 -0.375 - 238 3 1 231 0 1.214 1.368 2.000 -0.399 - 239 3 2 233 226 0 1.171 0.267 1.446 2.000 -0.388 - 240 3 2 227 233 0 0.216 1.190 1.413 2.000 -0.411 - 241 1 3 242 246 253 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 242 1 3 241 243 254 0 1.324 1.345 1.300 3.969 0.000 0.193 - 243 1 3 242 244 255 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 244 1 3 243 245 256 0 1.336 1.306 1.324 3.967 0.000 0.196 - 245 1 3 244 246 257 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 246 1 3 241 245 258 0 1.332 1.317 1.318 3.967 0.000 0.191 - 247 2 1 254 0 0.873 1.075 0.000 0.366 - 248 2 1 254 0 0.897 1.056 0.000 0.386 - 249 2 1 256 0 0.905 1.051 0.000 0.379 - 250 2 2 256 263 0 0.838 0.267 1.105 0.000 0.385 - 251 2 2 258 264 0 0.868 0.216 1.083 0.000 0.377 - 252 2 1 258 0 0.881 1.069 0.000 0.386 - 254 4 3 247 248 242 0 0.873 0.897 1.300 3.070 0.966 -0.469 - 255 4 3 243 261 262 0 1.083 1.211 1.214 3.508 0.160 0.371 - 256 4 3 244 249 250 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 257 4 3 245 263 264 0 1.143 1.171 1.190 3.504 0.165 0.341 - 258 4 3 246 251 252 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 261 3 1 255 0 1.211 1.378 2.000 -0.375 - 262 3 1 255 0 1.214 1.368 2.000 -0.399 - 263 3 2 250 257 0 0.267 1.171 1.446 2.000 -0.388 - 264 3 2 251 257 0 0.216 1.190 1.413 2.000 -0.411 - 265 1 3 266 270 277 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 266 1 3 265 267 278 0 1.324 1.345 1.300 3.969 0.000 0.193 - 267 1 3 266 268 279 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 268 1 3 267 269 280 0 1.336 1.306 1.324 3.967 0.000 0.196 - 269 1 3 268 270 281 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 270 1 3 265 269 282 0 1.332 1.317 1.318 3.967 0.000 0.191 - 271 2 1 278 0 0.873 1.075 0.000 0.366 - 272 2 1 278 0 0.897 1.056 0.000 0.386 - 273 2 1 280 0 0.905 1.051 0.000 0.379 - 274 2 2 287 280 0 0.267 0.838 1.105 0.000 0.385 - 275 2 2 282 288 0 0.868 0.216 1.083 0.000 0.377 - 276 2 1 282 0 0.881 1.069 0.000 0.386 - 277 4 3 265 283 284 0 1.109 1.197 1.198 3.504 0.165 0.344 - 278 4 3 266 271 272 0 1.300 0.873 0.897 3.070 0.966 -0.469 - 279 4 3 267 285 286 0 1.083 1.211 1.214 3.508 0.160 0.371 - 280 4 3 273 274 268 0 0.905 0.838 1.324 3.068 0.968 -0.443 - 281 4 3 269 287 288 0 1.143 1.171 1.190 3.504 0.165 0.341 - 282 4 3 270 275 276 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 283 3 1 277 0 1.197 1.393 2.000 -0.381 - 284 3 1 277 0 1.198 1.407 2.000 -0.413 - 285 3 1 279 0 1.211 1.378 2.000 -0.375 - 286 3 1 279 0 1.214 1.368 2.000 -0.399 - 287 3 2 281 274 0 1.171 0.267 1.446 2.000 -0.388 - 288 3 2 275 281 0 0.216 1.190 1.413 2.000 -0.411 - 289 1 3 290 294 301 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 290 1 3 289 291 302 0 1.324 1.345 1.300 3.969 0.000 0.193 - 291 1 3 290 303 292 0 1.345 1.083 1.337 3.767 0.000 -0.060 - 292 1 3 291 293 304 0 1.337 1.306 1.324 3.967 0.000 0.196 - 293 1 3 292 294 305 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 294 1 3 289 293 306 0 1.332 1.317 1.318 3.967 0.000 0.191 - 295 2 1 302 0 0.873 1.075 0.000 0.366 - 296 2 1 302 0 0.897 1.056 0.000 0.386 - 297 2 1 304 0 0.905 1.051 0.000 0.379 - 298 2 2 311 304 0 0.267 0.838 1.105 0.000 0.385 - 299 2 2 312 306 0 0.216 0.868 1.083 0.000 0.377 - 300 2 1 306 0 0.881 1.069 0.000 0.386 - 301 4 3 289 308 307 0 1.109 1.198 1.197 3.504 0.165 0.344 - 302 4 3 290 295 296 0 1.300 0.873 0.897 3.070 0.966 -0.469 - 303 4 3 291 309 310 0 1.083 1.211 1.214 3.508 0.160 0.371 - 304 4 3 292 297 298 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 305 4 3 293 311 312 0 1.143 1.171 1.190 3.504 0.165 0.341 - 306 4 3 294 299 300 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 307 3 1 301 0 1.197 1.393 2.000 -0.381 - 308 3 1 301 0 1.198 1.407 2.000 -0.413 - 309 3 1 303 0 1.211 1.378 2.000 -0.375 - 310 3 1 303 0 1.214 1.368 2.000 -0.399 - 311 3 2 298 305 0 0.267 1.171 1.446 2.000 -0.388 - 312 3 2 299 305 0 0.216 1.190 1.413 2.000 -0.411 - 313 1 3 314 318 325 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 314 1 3 313 315 326 0 1.324 1.345 1.300 3.969 0.000 0.193 - 315 1 3 314 316 327 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 316 1 3 315 317 328 0 1.336 1.306 1.324 3.967 0.000 0.196 - 317 1 3 316 318 329 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 318 1 3 313 317 330 0 1.332 1.317 1.318 3.967 0.000 0.191 - 319 2 1 326 0 0.873 1.075 0.000 0.366 - 320 2 1 326 0 0.897 1.056 0.000 0.386 - 321 2 1 328 0 0.905 1.051 0.000 0.379 - 322 2 2 335 328 0 0.267 0.838 1.105 0.000 0.385 - 323 2 2 330 336 0 0.868 0.216 1.083 0.000 0.377 - 324 2 1 330 0 0.881 1.069 0.000 0.386 - 325 4 3 313 331 332 0 1.109 1.197 1.198 3.504 0.165 0.344 - 326 4 3 314 320 319 0 1.300 0.897 0.873 3.070 0.966 -0.469 - 327 4 3 315 333 334 0 1.083 1.211 1.214 3.508 0.160 0.371 - 328 4 3 321 322 316 0 0.905 0.838 1.324 3.068 0.968 -0.443 - 329 4 3 317 335 336 0 1.143 1.171 1.190 3.504 0.165 0.341 - 330 4 3 318 323 324 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 331 3 1 325 0 1.197 1.393 2.000 -0.381 - 332 3 1 325 0 1.198 1.407 2.000 -0.413 - 333 3 1 327 0 1.211 1.378 2.000 -0.375 - 334 3 1 327 0 1.214 1.368 2.000 -0.399 - 335 3 2 329 322 0 1.171 0.267 1.446 2.000 -0.388 - 336 3 2 323 329 0 0.216 1.190 1.413 2.000 -0.411 - 337 1 3 338 342 349 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 338 1 3 337 339 350 0 1.324 1.345 1.300 3.969 0.000 0.193 - 339 1 3 338 351 340 0 1.345 1.083 1.337 3.767 0.000 -0.060 - 340 1 3 339 341 352 0 1.337 1.306 1.324 3.967 0.000 0.196 - 341 1 3 340 342 353 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 342 1 3 337 341 354 0 1.332 1.317 1.318 3.967 0.000 0.191 - 343 2 1 350 0 0.873 1.075 0.000 0.366 - 344 2 1 350 0 0.897 1.056 0.000 0.386 - 345 2 1 352 0 0.905 1.051 0.000 0.379 - 346 2 2 352 359 0 0.838 0.267 1.105 0.000 0.385 - 347 2 2 360 354 0 0.216 0.868 1.083 0.000 0.377 - 348 2 1 354 0 0.881 1.069 0.000 0.386 - 350 4 3 338 343 344 0 1.300 0.873 0.897 3.070 0.966 -0.469 - 351 4 3 339 357 358 0 1.083 1.211 1.214 3.508 0.160 0.371 - 352 4 3 340 345 346 0 1.324 0.905 0.838 3.068 0.968 -0.443 - 353 4 3 341 360 359 0 1.143 1.190 1.171 3.504 0.165 0.341 - 354 4 3 342 347 348 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 357 3 1 351 0 1.211 1.378 2.000 -0.375 - 358 3 1 351 0 1.214 1.368 2.000 -0.399 - 359 3 2 346 353 0 0.267 1.171 1.446 2.000 -0.388 - 360 3 2 347 353 0 0.216 1.190 1.413 2.000 -0.411 - 361 1 3 362 366 373 0 1.324 1.332 1.109 3.767 0.000 -0.073 - 362 1 3 361 363 374 0 1.324 1.345 1.300 3.969 0.000 0.193 - 363 1 3 362 364 375 0 1.345 1.336 1.083 3.767 0.000 -0.060 - 364 1 3 363 365 376 0 1.336 1.306 1.324 3.967 0.000 0.196 - 365 1 3 364 366 377 0 1.306 1.317 1.143 3.769 0.000 -0.063 - 366 1 3 361 365 378 0 1.332 1.317 1.318 3.967 0.000 0.191 - 367 2 1 374 0 0.873 1.075 0.000 0.366 - 368 2 1 374 0 0.897 1.056 0.000 0.386 - 369 2 1 376 0 0.905 1.051 0.000 0.379 - 370 2 2 383 376 0 0.267 0.838 1.105 0.000 0.385 - 371 2 2 378 384 0 0.868 0.216 1.083 0.000 0.377 - 372 2 1 378 0 0.881 1.069 0.000 0.386 - 373 4 3 361 379 380 0 1.109 1.197 1.198 3.504 0.165 0.344 - 374 4 3 362 368 367 0 1.300 0.897 0.873 3.070 0.966 -0.469 - 375 4 3 363 381 382 0 1.083 1.211 1.214 3.508 0.160 0.371 - 376 4 3 369 370 364 0 0.905 0.838 1.324 3.068 0.968 -0.443 - 377 4 3 365 383 384 0 1.143 1.171 1.190 3.504 0.165 0.341 - 378 4 3 366 371 372 0 1.318 0.868 0.881 3.067 0.969 -0.438 - 379 3 1 373 0 1.197 1.393 2.000 -0.381 - 380 3 1 373 0 1.198 1.407 2.000 -0.413 - 381 3 1 375 0 1.211 1.378 2.000 -0.375 - 382 3 1 375 0 1.214 1.368 2.000 -0.399 - 383 3 2 377 370 0 1.171 0.267 1.446 2.000 -0.388 - 384 3 2 371 377 0 0.216 1.190 1.413 2.000 -0.411 - 61 4 3 49 68 67 0 1.109 1.198 1.197 3.504 0.165 0.344 - 67 3 1 61 0 1.197 1.393 2.000 -0.381 - 68 3 1 61 0 1.198 1.407 2.000 -0.413 - 157 4 3 164 145 163 0 1.198 1.109 1.197 3.504 0.165 0.344 - 163 3 1 157 0 1.197 1.393 2.000 -0.381 - 164 3 1 157 0 1.198 1.407 2.000 -0.413 - 253 4 3 260 241 259 0 1.198 1.109 1.197 3.504 0.165 0.344 - 259 3 1 253 0 1.197 1.393 2.000 -0.381 - 260 3 1 253 0 1.198 1.407 2.000 -0.413 - 349 4 3 337 356 355 0 1.109 1.198 1.197 3.504 0.165 0.344 - 355 3 1 349 0 1.197 1.393 2.000 -0.381 - 356 3 1 349 0 1.198 1.407 2.000 -0.413 -# -# Timestep 25 -# -# Number of particles 384 -# -# Max.number of bonds per atom 3 with coarse bond order cutoff 0.300 -# Particle connection table and bond orders -# id type nb id_1...id_nb mol bo_1...bo_nb abo nlp q - 1 1 3 2 6 13 0 1.321 1.328 1.129 3.783 0.000 -0.075 - 2 1 3 1 3 14 0 1.321 1.341 1.325 3.987 0.000 0.190 - 3 1 3 2 4 15 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 4 1 3 3 5 16 0 1.333 1.303 1.350 3.985 0.000 0.194 - 5 1 3 4 6 17 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 6 1 3 1 5 18 0 1.328 1.313 1.344 3.985 0.000 0.188 - 7 2 2 14 20 0 0.855 0.269 1.123 0.000 0.366 - 8 2 2 14 21 0 0.878 0.236 1.114 0.000 0.387 - 9 2 2 16 22 0 0.885 0.232 1.116 0.000 0.380 - 10 2 2 16 23 0 0.827 0.291 1.118 0.000 0.385 - 11 2 2 18 24 0 0.852 0.273 1.124 0.000 0.377 - 12 2 2 18 19 0 0.862 0.262 1.125 0.000 0.387 - 13 4 3 1 20 19 0 1.129 1.232 1.231 3.591 0.083 0.362 - 14 4 3 2 7 8 0 1.325 0.855 0.878 3.058 0.977 -0.457 - 15 4 3 3 21 22 0 1.103 1.245 1.247 3.595 0.081 0.390 - 16 4 3 4 9 10 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 17 4 3 5 23 24 0 1.161 1.206 1.224 3.591 0.084 0.359 - 18 4 3 6 11 12 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 19 3 2 12 13 0 0.262 1.231 1.504 2.000 -0.395 - 20 3 2 7 13 0 0.269 1.232 1.511 2.000 -0.426 - 21 3 2 8 15 0 0.236 1.245 1.491 2.000 -0.389 - 22 3 2 9 15 0 0.232 1.247 1.489 2.000 -0.415 - 23 3 2 10 17 0 0.291 1.206 1.508 2.000 -0.397 - 24 3 2 11 17 0 0.273 1.224 1.507 2.000 -0.422 - 25 1 3 30 26 37 0 1.328 1.321 1.129 3.783 0.000 -0.075 - 26 1 3 25 27 38 0 1.321 1.341 1.325 3.987 0.000 0.190 - 27 1 3 26 28 39 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 28 1 3 27 29 40 0 1.333 1.303 1.350 3.985 0.000 0.194 - 29 1 3 28 30 41 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 30 1 3 25 29 42 0 1.328 1.313 1.344 3.985 0.000 0.188 - 31 2 2 44 38 0 0.269 0.855 1.123 0.000 0.366 - 32 2 2 38 45 0 0.878 0.236 1.114 0.000 0.387 - 33 2 2 40 46 0 0.885 0.232 1.116 0.000 0.380 - 34 2 2 47 40 0 0.291 0.827 1.118 0.000 0.385 - 35 2 2 42 48 0 0.852 0.273 1.124 0.000 0.377 - 36 2 2 42 43 0 0.862 0.262 1.125 0.000 0.387 - 37 4 3 25 43 44 0 1.129 1.231 1.232 3.591 0.083 0.362 - 38 4 3 26 32 31 0 1.325 0.878 0.855 3.058 0.977 -0.457 - 39 4 3 27 45 46 0 1.103 1.245 1.247 3.595 0.081 0.390 - 40 4 3 28 33 34 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 41 4 3 29 47 48 0 1.161 1.206 1.224 3.591 0.084 0.359 - 42 4 3 30 35 36 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 43 3 2 36 37 0 0.262 1.231 1.504 2.000 -0.395 - 44 3 2 31 37 0 0.269 1.232 1.511 2.000 -0.426 - 45 3 2 32 39 0 0.236 1.245 1.491 2.000 -0.389 - 46 3 2 33 39 0 0.232 1.247 1.489 2.000 -0.415 - 47 3 2 34 41 0 0.291 1.206 1.508 2.000 -0.397 - 48 3 2 35 41 0 0.273 1.224 1.507 2.000 -0.422 - 49 1 3 50 54 61 0 1.321 1.328 1.129 3.783 0.000 -0.075 - 50 1 3 49 51 62 0 1.321 1.341 1.325 3.987 0.000 0.190 - 51 1 3 50 52 63 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 52 1 3 51 53 64 0 1.333 1.303 1.350 3.985 0.000 0.194 - 53 1 3 52 54 65 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 54 1 3 49 53 66 0 1.328 1.313 1.344 3.985 0.000 0.188 - 55 2 2 62 68 0 0.855 0.269 1.123 0.000 0.366 - 56 2 2 62 69 0 0.878 0.236 1.114 0.000 0.387 - 57 2 2 64 70 0 0.885 0.232 1.116 0.000 0.380 - 58 2 2 64 71 0 0.827 0.291 1.118 0.000 0.385 - 59 2 2 66 72 0 0.852 0.273 1.124 0.000 0.377 - 60 2 2 66 67 0 0.862 0.262 1.125 0.000 0.387 - 62 4 3 50 55 56 0 1.325 0.855 0.878 3.058 0.977 -0.457 - 63 4 3 51 69 70 0 1.103 1.245 1.247 3.595 0.081 0.390 - 64 4 3 52 57 58 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 65 4 3 53 71 72 0 1.161 1.206 1.224 3.591 0.084 0.359 - 66 4 3 54 59 60 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 69 3 2 56 63 0 0.236 1.245 1.491 2.000 -0.389 - 70 3 2 57 63 0 0.232 1.247 1.489 2.000 -0.415 - 71 3 2 58 65 0 0.291 1.206 1.508 2.000 -0.397 - 72 3 2 59 65 0 0.273 1.224 1.507 2.000 -0.422 - 73 1 3 78 74 85 0 1.328 1.321 1.129 3.783 0.000 -0.075 - 74 1 3 73 75 86 0 1.321 1.341 1.325 3.987 0.000 0.190 - 75 1 3 74 76 87 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 76 1 3 75 77 88 0 1.333 1.303 1.350 3.985 0.000 0.194 - 77 1 3 76 78 89 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 78 1 3 73 77 90 0 1.328 1.313 1.344 3.985 0.000 0.188 - 79 2 2 92 86 0 0.269 0.855 1.123 0.000 0.366 - 80 2 2 86 93 0 0.878 0.236 1.114 0.000 0.387 - 81 2 2 88 94 0 0.885 0.232 1.116 0.000 0.380 - 82 2 2 95 88 0 0.291 0.827 1.118 0.000 0.385 - 83 2 2 90 96 0 0.852 0.273 1.124 0.000 0.377 - 84 2 2 90 91 0 0.862 0.262 1.125 0.000 0.387 - 85 4 3 73 91 92 0 1.129 1.231 1.232 3.591 0.083 0.362 - 86 4 3 74 80 79 0 1.325 0.878 0.855 3.058 0.977 -0.457 - 87 4 3 75 93 94 0 1.103 1.245 1.247 3.595 0.081 0.390 - 88 4 3 76 81 82 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 89 4 3 77 95 96 0 1.161 1.206 1.224 3.591 0.084 0.359 - 90 4 3 78 83 84 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 91 3 2 84 85 0 0.262 1.231 1.504 2.000 -0.395 - 92 3 2 79 85 0 0.269 1.232 1.511 2.000 -0.426 - 93 3 2 80 87 0 0.236 1.245 1.491 2.000 -0.389 - 94 3 2 81 87 0 0.232 1.247 1.489 2.000 -0.415 - 95 3 2 82 89 0 0.291 1.206 1.508 2.000 -0.397 - 96 3 2 83 89 0 0.273 1.224 1.507 2.000 -0.422 - 97 1 3 109 98 102 0 1.129 1.321 1.328 3.783 0.000 -0.075 - 98 1 3 99 97 110 0 1.341 1.321 1.325 3.987 0.000 0.190 - 99 1 3 98 100 111 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 100 1 3 99 101 112 0 1.333 1.303 1.350 3.985 0.000 0.194 - 101 1 3 100 113 102 0 1.303 1.161 1.313 3.784 0.000 -0.066 - 102 1 3 101 114 97 0 1.313 1.344 1.328 3.985 0.000 0.188 - 103 2 2 110 116 0 0.855 0.269 1.123 0.000 0.366 - 104 2 2 110 117 0 0.878 0.236 1.114 0.000 0.387 - 105 2 2 112 118 0 0.885 0.232 1.116 0.000 0.380 - 106 2 2 119 112 0 0.291 0.827 1.118 0.000 0.385 - 107 2 2 114 120 0 0.852 0.273 1.124 0.000 0.377 - 108 2 2 114 115 0 0.862 0.262 1.125 0.000 0.387 - 109 4 3 97 116 115 0 1.129 1.232 1.231 3.591 0.083 0.362 - 110 4 3 103 104 98 0 0.855 0.878 1.325 3.058 0.977 -0.457 - 111 4 3 99 117 118 0 1.103 1.245 1.247 3.595 0.081 0.390 - 112 4 3 100 105 106 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 113 4 3 101 119 120 0 1.161 1.206 1.224 3.591 0.084 0.359 - 114 4 3 102 107 108 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 115 3 2 109 108 0 1.231 0.262 1.504 2.000 -0.395 - 116 3 2 103 109 0 0.269 1.232 1.511 2.000 -0.426 - 117 3 2 111 104 0 1.245 0.236 1.491 2.000 -0.389 - 118 3 2 105 111 0 0.232 1.247 1.489 2.000 -0.415 - 119 3 2 106 113 0 0.291 1.206 1.508 2.000 -0.397 - 120 3 2 107 113 0 0.273 1.224 1.507 2.000 -0.422 - 121 1 3 126 122 133 0 1.328 1.321 1.129 3.783 0.000 -0.075 - 122 1 3 121 123 134 0 1.321 1.341 1.325 3.987 0.000 0.190 - 123 1 3 122 124 135 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 124 1 3 123 125 136 0 1.333 1.303 1.350 3.985 0.000 0.194 - 125 1 3 124 126 137 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 126 1 3 121 125 138 0 1.328 1.313 1.344 3.985 0.000 0.188 - 127 2 2 134 140 0 0.855 0.269 1.123 0.000 0.366 - 128 2 2 134 141 0 0.878 0.236 1.114 0.000 0.387 - 129 2 2 136 142 0 0.885 0.232 1.116 0.000 0.380 - 130 2 2 143 136 0 0.291 0.827 1.118 0.000 0.385 - 131 2 2 138 144 0 0.852 0.273 1.124 0.000 0.377 - 132 2 2 138 139 0 0.862 0.262 1.125 0.000 0.387 - 133 4 3 121 139 140 0 1.129 1.231 1.232 3.591 0.083 0.362 - 134 4 3 122 127 128 0 1.325 0.855 0.878 3.058 0.977 -0.457 - 135 4 3 123 141 142 0 1.103 1.245 1.247 3.595 0.081 0.390 - 136 4 3 124 129 130 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 137 4 3 125 143 144 0 1.161 1.206 1.224 3.591 0.084 0.359 - 138 4 3 126 131 132 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 139 3 2 132 133 0 0.262 1.231 1.504 2.000 -0.395 - 140 3 2 127 133 0 0.269 1.232 1.511 2.000 -0.426 - 141 3 2 128 135 0 0.236 1.245 1.491 2.000 -0.389 - 142 3 2 129 135 0 0.232 1.247 1.489 2.000 -0.415 - 143 3 2 130 137 0 0.291 1.206 1.508 2.000 -0.397 - 144 3 2 131 137 0 0.273 1.224 1.507 2.000 -0.422 - 145 1 3 157 146 150 0 1.129 1.321 1.328 3.783 0.000 -0.075 - 146 1 3 147 145 158 0 1.341 1.321 1.325 3.987 0.000 0.190 - 147 1 3 146 148 159 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 148 1 3 147 149 160 0 1.333 1.303 1.350 3.985 0.000 0.194 - 149 1 3 148 161 150 0 1.303 1.161 1.313 3.784 0.000 -0.066 - 150 1 3 149 162 145 0 1.313 1.344 1.328 3.985 0.000 0.188 - 151 2 2 158 164 0 0.855 0.269 1.123 0.000 0.366 - 152 2 2 158 165 0 0.878 0.236 1.114 0.000 0.387 - 153 2 2 160 166 0 0.885 0.232 1.116 0.000 0.380 - 154 2 2 167 160 0 0.291 0.827 1.118 0.000 0.385 - 155 2 2 168 162 0 0.273 0.852 1.124 0.000 0.377 - 156 2 2 162 163 0 0.862 0.262 1.125 0.000 0.387 - 158 4 3 151 152 146 0 0.855 0.878 1.325 3.058 0.977 -0.457 - 159 4 3 147 165 166 0 1.103 1.245 1.247 3.595 0.081 0.390 - 160 4 3 148 153 154 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 161 4 3 149 167 168 0 1.161 1.206 1.224 3.591 0.084 0.359 - 162 4 3 150 155 156 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 165 3 2 159 152 0 1.245 0.236 1.491 2.000 -0.389 - 166 3 2 153 159 0 0.232 1.247 1.489 2.000 -0.415 - 167 3 2 154 161 0 0.291 1.206 1.508 2.000 -0.397 - 168 3 2 155 161 0 0.273 1.224 1.507 2.000 -0.422 - 169 1 3 174 170 181 0 1.328 1.321 1.129 3.783 0.000 -0.075 - 170 1 3 169 171 182 0 1.321 1.341 1.325 3.987 0.000 0.190 - 171 1 3 170 172 183 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 172 1 3 171 173 184 0 1.333 1.303 1.350 3.985 0.000 0.194 - 173 1 3 172 174 185 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 174 1 3 169 173 186 0 1.328 1.313 1.344 3.985 0.000 0.188 - 175 2 2 182 188 0 0.855 0.269 1.123 0.000 0.366 - 176 2 2 182 189 0 0.878 0.236 1.114 0.000 0.387 - 177 2 2 184 190 0 0.885 0.232 1.116 0.000 0.380 - 178 2 2 191 184 0 0.291 0.827 1.118 0.000 0.385 - 179 2 2 186 192 0 0.852 0.273 1.124 0.000 0.377 - 180 2 2 186 187 0 0.862 0.262 1.125 0.000 0.387 - 181 4 3 169 187 188 0 1.129 1.231 1.232 3.591 0.083 0.362 - 182 4 3 170 175 176 0 1.325 0.855 0.878 3.058 0.977 -0.457 - 183 4 3 171 189 190 0 1.103 1.245 1.247 3.595 0.081 0.390 - 184 4 3 172 177 178 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 185 4 3 173 191 192 0 1.161 1.206 1.224 3.591 0.084 0.359 - 186 4 3 174 179 180 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 187 3 2 180 181 0 0.262 1.231 1.504 2.000 -0.395 - 188 3 2 175 181 0 0.269 1.232 1.511 2.000 -0.426 - 189 3 2 176 183 0 0.236 1.245 1.491 2.000 -0.389 - 190 3 2 177 183 0 0.232 1.247 1.489 2.000 -0.415 - 191 3 2 178 185 0 0.291 1.206 1.508 2.000 -0.397 - 192 3 2 179 185 0 0.273 1.224 1.507 2.000 -0.422 - 193 1 3 205 194 198 0 1.129 1.321 1.328 3.783 0.000 -0.075 - 194 1 3 195 193 206 0 1.341 1.321 1.325 3.987 0.000 0.190 - 195 1 3 194 196 207 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 196 1 3 195 197 208 0 1.333 1.303 1.350 3.985 0.000 0.194 - 197 1 3 196 198 209 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 198 1 3 197 193 210 0 1.313 1.328 1.344 3.985 0.000 0.188 - 199 2 2 206 212 0 0.855 0.269 1.123 0.000 0.366 - 200 2 2 206 213 0 0.878 0.236 1.114 0.000 0.387 - 201 2 2 214 208 0 0.232 0.885 1.116 0.000 0.380 - 202 2 2 208 215 0 0.827 0.291 1.118 0.000 0.385 - 203 2 2 210 216 0 0.852 0.273 1.124 0.000 0.377 - 204 2 2 210 211 0 0.862 0.262 1.125 0.000 0.387 - 205 4 3 193 212 211 0 1.129 1.232 1.231 3.591 0.083 0.362 - 206 4 3 199 200 194 0 0.855 0.878 1.325 3.058 0.977 -0.457 - 207 4 3 195 213 214 0 1.103 1.245 1.247 3.595 0.081 0.390 - 208 4 3 196 201 202 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 209 4 3 197 215 216 0 1.161 1.206 1.224 3.591 0.084 0.359 - 210 4 3 198 203 204 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 211 3 2 205 204 0 1.231 0.262 1.504 2.000 -0.395 - 212 3 2 199 205 0 0.269 1.232 1.511 2.000 -0.426 - 213 3 2 207 200 0 1.245 0.236 1.491 2.000 -0.389 - 214 3 2 201 207 0 0.232 1.247 1.489 2.000 -0.415 - 215 3 2 202 209 0 0.291 1.206 1.508 2.000 -0.397 - 216 3 2 203 209 0 0.273 1.224 1.507 2.000 -0.422 - 217 1 3 218 222 229 0 1.321 1.328 1.129 3.783 0.000 -0.075 - 218 1 3 217 219 230 0 1.321 1.341 1.325 3.987 0.000 0.190 - 219 1 3 218 220 231 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 220 1 3 219 221 232 0 1.333 1.303 1.350 3.985 0.000 0.194 - 221 1 3 220 222 233 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 222 1 3 217 221 234 0 1.328 1.313 1.344 3.985 0.000 0.188 - 223 2 2 230 236 0 0.855 0.269 1.123 0.000 0.366 - 224 2 2 230 237 0 0.878 0.236 1.114 0.000 0.387 - 225 2 2 232 238 0 0.885 0.232 1.116 0.000 0.380 - 226 2 2 239 232 0 0.291 0.827 1.118 0.000 0.385 - 227 2 2 234 240 0 0.852 0.273 1.124 0.000 0.377 - 228 2 2 234 235 0 0.862 0.262 1.125 0.000 0.387 - 229 4 3 217 235 236 0 1.129 1.231 1.232 3.591 0.083 0.362 - 230 4 3 218 223 224 0 1.325 0.855 0.878 3.058 0.977 -0.457 - 231 4 3 219 237 238 0 1.103 1.245 1.247 3.595 0.081 0.390 - 232 4 3 225 226 220 0 0.885 0.827 1.350 3.061 0.974 -0.433 - 233 4 3 221 239 240 0 1.161 1.206 1.224 3.591 0.084 0.359 - 234 4 3 222 227 228 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 235 3 2 228 229 0 0.262 1.231 1.504 2.000 -0.395 - 236 3 2 223 229 0 0.269 1.232 1.511 2.000 -0.426 - 237 3 2 231 224 0 1.245 0.236 1.491 2.000 -0.389 - 238 3 2 225 231 0 0.232 1.247 1.489 2.000 -0.415 - 239 3 2 233 226 0 1.206 0.291 1.508 2.000 -0.397 - 240 3 2 227 233 0 0.273 1.224 1.507 2.000 -0.422 - 241 1 3 253 242 246 0 1.129 1.321 1.328 3.783 0.000 -0.075 - 242 1 3 243 241 254 0 1.341 1.321 1.325 3.987 0.000 0.190 - 243 1 3 242 244 255 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 244 1 3 243 245 256 0 1.333 1.303 1.350 3.985 0.000 0.194 - 245 1 3 244 246 257 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 246 1 3 245 241 258 0 1.313 1.328 1.344 3.985 0.000 0.188 - 247 2 2 254 260 0 0.855 0.269 1.123 0.000 0.366 - 248 2 2 254 261 0 0.878 0.236 1.114 0.000 0.387 - 249 2 2 262 256 0 0.232 0.885 1.116 0.000 0.380 - 250 2 2 256 263 0 0.827 0.291 1.118 0.000 0.385 - 251 2 2 258 264 0 0.852 0.273 1.124 0.000 0.377 - 252 2 2 258 259 0 0.862 0.262 1.125 0.000 0.387 - 254 4 3 247 248 242 0 0.855 0.878 1.325 3.058 0.977 -0.457 - 255 4 3 243 261 262 0 1.103 1.245 1.247 3.595 0.081 0.390 - 256 4 3 244 249 250 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 257 4 3 245 263 264 0 1.161 1.206 1.224 3.591 0.084 0.359 - 258 4 3 246 251 252 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 261 3 2 255 248 0 1.245 0.236 1.491 2.000 -0.389 - 262 3 2 249 255 0 0.232 1.247 1.489 2.000 -0.415 - 263 3 2 250 257 0 0.291 1.206 1.508 2.000 -0.397 - 264 3 2 251 257 0 0.273 1.224 1.507 2.000 -0.422 - 265 1 3 266 270 277 0 1.321 1.328 1.129 3.783 0.000 -0.075 - 266 1 3 265 267 278 0 1.321 1.341 1.325 3.987 0.000 0.190 - 267 1 3 266 268 279 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 268 1 3 267 269 280 0 1.333 1.303 1.350 3.985 0.000 0.194 - 269 1 3 268 270 281 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 270 1 3 265 269 282 0 1.328 1.313 1.344 3.985 0.000 0.188 - 271 2 2 278 284 0 0.855 0.269 1.123 0.000 0.366 - 272 2 2 278 285 0 0.878 0.236 1.114 0.000 0.387 - 273 2 2 280 286 0 0.885 0.232 1.116 0.000 0.380 - 274 2 2 287 280 0 0.291 0.827 1.118 0.000 0.385 - 275 2 2 282 288 0 0.852 0.273 1.124 0.000 0.377 - 276 2 2 282 283 0 0.862 0.262 1.125 0.000 0.387 - 277 4 3 265 283 284 0 1.129 1.231 1.232 3.591 0.083 0.362 - 278 4 3 266 271 272 0 1.325 0.855 0.878 3.058 0.977 -0.457 - 279 4 3 267 285 286 0 1.103 1.245 1.247 3.595 0.081 0.390 - 280 4 3 273 274 268 0 0.885 0.827 1.350 3.061 0.974 -0.433 - 281 4 3 269 287 288 0 1.161 1.206 1.224 3.591 0.084 0.359 - 282 4 3 270 275 276 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 283 3 2 276 277 0 0.262 1.231 1.504 2.000 -0.395 - 284 3 2 271 277 0 0.269 1.232 1.511 2.000 -0.426 - 285 3 2 279 272 0 1.245 0.236 1.491 2.000 -0.389 - 286 3 2 273 279 0 0.232 1.247 1.489 2.000 -0.415 - 287 3 2 281 274 0 1.206 0.291 1.508 2.000 -0.397 - 288 3 2 275 281 0 0.273 1.224 1.507 2.000 -0.422 - 289 1 3 290 294 301 0 1.321 1.328 1.129 3.783 0.000 -0.075 - 290 1 3 289 291 302 0 1.321 1.341 1.325 3.987 0.000 0.190 - 291 1 3 290 303 292 0 1.341 1.103 1.333 3.783 0.000 -0.063 - 292 1 3 291 293 304 0 1.333 1.303 1.350 3.985 0.000 0.194 - 293 1 3 292 294 305 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 294 1 3 289 293 306 0 1.328 1.313 1.344 3.985 0.000 0.188 - 295 2 2 302 308 0 0.855 0.269 1.123 0.000 0.366 - 296 2 2 302 309 0 0.878 0.236 1.114 0.000 0.387 - 297 2 2 310 304 0 0.232 0.885 1.116 0.000 0.380 - 298 2 2 311 304 0 0.291 0.827 1.118 0.000 0.385 - 299 2 2 312 306 0 0.273 0.852 1.124 0.000 0.377 - 300 2 2 306 307 0 0.862 0.262 1.125 0.000 0.387 - 301 4 3 289 308 307 0 1.129 1.232 1.231 3.591 0.083 0.362 - 302 4 3 290 295 296 0 1.325 0.855 0.878 3.058 0.977 -0.457 - 303 4 3 291 309 310 0 1.103 1.245 1.247 3.595 0.081 0.390 - 304 4 3 292 297 298 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 305 4 3 293 311 312 0 1.161 1.206 1.224 3.591 0.084 0.359 - 306 4 3 294 299 300 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 307 3 2 300 301 0 0.262 1.231 1.504 2.000 -0.395 - 308 3 2 295 301 0 0.269 1.232 1.511 2.000 -0.426 - 309 3 2 296 303 0 0.236 1.245 1.491 2.000 -0.389 - 310 3 2 297 303 0 0.232 1.247 1.489 2.000 -0.415 - 311 3 2 298 305 0 0.291 1.206 1.508 2.000 -0.397 - 312 3 2 299 305 0 0.273 1.224 1.507 2.000 -0.422 - 313 1 3 314 318 325 0 1.321 1.328 1.129 3.783 0.000 -0.075 - 314 1 3 313 315 326 0 1.321 1.341 1.325 3.987 0.000 0.190 - 315 1 3 314 316 327 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 316 1 3 315 317 328 0 1.333 1.303 1.350 3.985 0.000 0.194 - 317 1 3 316 318 329 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 318 1 3 313 317 330 0 1.328 1.313 1.344 3.985 0.000 0.188 - 319 2 2 332 326 0 0.269 0.855 1.123 0.000 0.366 - 320 2 2 326 333 0 0.878 0.236 1.114 0.000 0.387 - 321 2 2 328 334 0 0.885 0.232 1.116 0.000 0.380 - 322 2 2 335 328 0 0.291 0.827 1.118 0.000 0.385 - 323 2 2 330 336 0 0.852 0.273 1.124 0.000 0.377 - 324 2 2 330 331 0 0.862 0.262 1.125 0.000 0.387 - 325 4 3 313 331 332 0 1.129 1.231 1.232 3.591 0.083 0.362 - 326 4 3 314 320 319 0 1.325 0.878 0.855 3.058 0.977 -0.457 - 327 4 3 315 333 334 0 1.103 1.245 1.247 3.595 0.081 0.390 - 328 4 3 321 322 316 0 0.885 0.827 1.350 3.061 0.974 -0.433 - 329 4 3 317 335 336 0 1.161 1.206 1.224 3.591 0.084 0.359 - 330 4 3 318 323 324 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 331 3 2 324 325 0 0.262 1.231 1.504 2.000 -0.395 - 332 3 2 319 325 0 0.269 1.232 1.511 2.000 -0.426 - 333 3 2 327 320 0 1.245 0.236 1.491 2.000 -0.389 - 334 3 2 321 327 0 0.232 1.247 1.489 2.000 -0.415 - 335 3 2 329 322 0 1.206 0.291 1.508 2.000 -0.397 - 336 3 2 323 329 0 0.273 1.224 1.507 2.000 -0.422 - 337 1 3 338 342 349 0 1.321 1.328 1.129 3.783 0.000 -0.075 - 338 1 3 337 339 350 0 1.321 1.341 1.325 3.987 0.000 0.190 - 339 1 3 338 351 340 0 1.341 1.103 1.333 3.783 0.000 -0.063 - 340 1 3 339 341 352 0 1.333 1.303 1.350 3.985 0.000 0.194 - 341 1 3 340 342 353 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 342 1 3 337 341 354 0 1.328 1.313 1.344 3.985 0.000 0.188 - 343 2 2 350 356 0 0.855 0.269 1.123 0.000 0.366 - 344 2 2 350 357 0 0.878 0.236 1.114 0.000 0.387 - 345 2 2 358 352 0 0.232 0.885 1.116 0.000 0.380 - 346 2 2 352 359 0 0.827 0.291 1.118 0.000 0.385 - 347 2 2 360 354 0 0.273 0.852 1.124 0.000 0.377 - 348 2 2 354 355 0 0.862 0.262 1.125 0.000 0.387 - 350 4 3 338 343 344 0 1.325 0.855 0.878 3.058 0.977 -0.457 - 351 4 3 339 357 358 0 1.103 1.245 1.247 3.595 0.081 0.390 - 352 4 3 340 345 346 0 1.350 0.885 0.827 3.061 0.974 -0.433 - 353 4 3 341 360 359 0 1.161 1.224 1.206 3.591 0.084 0.359 - 354 4 3 342 347 348 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 357 3 2 344 351 0 0.236 1.245 1.491 2.000 -0.389 - 358 3 2 345 351 0 0.232 1.247 1.489 2.000 -0.415 - 359 3 2 346 353 0 0.291 1.206 1.508 2.000 -0.397 - 360 3 2 347 353 0 0.273 1.224 1.507 2.000 -0.422 - 361 1 3 362 366 373 0 1.321 1.328 1.129 3.783 0.000 -0.075 - 362 1 3 361 363 374 0 1.321 1.341 1.325 3.987 0.000 0.190 - 363 1 3 362 364 375 0 1.341 1.333 1.103 3.783 0.000 -0.063 - 364 1 3 363 365 376 0 1.333 1.303 1.350 3.985 0.000 0.194 - 365 1 3 364 366 377 0 1.303 1.313 1.161 3.784 0.000 -0.066 - 366 1 3 361 365 378 0 1.328 1.313 1.344 3.985 0.000 0.188 - 367 2 2 380 374 0 0.269 0.855 1.123 0.000 0.366 - 368 2 2 374 381 0 0.878 0.236 1.114 0.000 0.387 - 369 2 2 376 382 0 0.885 0.232 1.116 0.000 0.380 - 370 2 2 383 376 0 0.291 0.827 1.118 0.000 0.385 - 371 2 2 378 384 0 0.852 0.273 1.124 0.000 0.377 - 372 2 2 378 379 0 0.862 0.262 1.125 0.000 0.387 - 373 4 3 361 379 380 0 1.129 1.231 1.232 3.591 0.083 0.362 - 374 4 3 362 368 367 0 1.325 0.878 0.855 3.058 0.977 -0.457 - 375 4 3 363 381 382 0 1.103 1.245 1.247 3.595 0.081 0.390 - 376 4 3 369 370 364 0 0.885 0.827 1.350 3.061 0.974 -0.433 - 377 4 3 365 383 384 0 1.161 1.206 1.224 3.591 0.084 0.359 - 378 4 3 366 371 372 0 1.344 0.852 0.862 3.058 0.977 -0.427 - 379 3 2 372 373 0 0.262 1.231 1.504 2.000 -0.395 - 380 3 2 367 373 0 0.269 1.232 1.511 2.000 -0.426 - 381 3 2 375 368 0 1.245 0.236 1.491 2.000 -0.389 - 382 3 2 369 375 0 0.232 1.247 1.489 2.000 -0.415 - 383 3 2 377 370 0 1.206 0.291 1.508 2.000 -0.397 - 384 3 2 371 377 0 0.273 1.224 1.507 2.000 -0.422 - 61 4 3 49 68 67 0 1.129 1.232 1.231 3.591 0.083 0.362 - 67 3 2 60 61 0 0.262 1.231 1.504 2.000 -0.395 - 68 3 2 55 61 0 0.269 1.232 1.511 2.000 -0.426 - 157 4 3 145 164 163 0 1.129 1.232 1.231 3.591 0.083 0.362 - 163 3 2 157 156 0 1.231 0.262 1.504 2.000 -0.395 - 164 3 2 151 157 0 0.269 1.232 1.511 2.000 -0.426 - 253 4 3 241 260 259 0 1.129 1.232 1.231 3.591 0.083 0.362 - 259 3 2 253 252 0 1.231 0.262 1.504 2.000 -0.395 - 260 3 2 247 253 0 0.269 1.232 1.511 2.000 -0.426 - 349 4 3 337 356 355 0 1.129 1.232 1.231 3.591 0.083 0.362 - 355 3 2 348 349 0 0.262 1.231 1.504 2.000 -0.395 - 356 3 2 343 349 0 0.269 1.232 1.511 2.000 -0.426 -# diff --git a/tools/reax/mol_fra.c b/tools/reax/mol_fra.c deleted file mode 100644 index cd217db21c..0000000000 --- a/tools/reax/mol_fra.c +++ /dev/null @@ -1,801 +0,0 @@ -/*** modified on 12/09/2010 by Aidan Thompson ***/ -/*** modified on 10/21/2010 by avv/cfdrc ***/ -/*** this code was given to LAMMPS by Sergey Zybin, CalTech ***/ - -#include -#include -#include - -#define Cutoff "Cutoff.dic" -#define Snapshots "bonds.reax" -#define Output1 "fra.out" -#define Output2 "mol.out" -#define Output3 "num.out" -#define Output4 "dipol.out" -#define Output5 "vibtemp.out" -#define Output6 "conc.out" - -#define MaxNumBonds 10 //Max Number of bonds per atom -#define MaxMolTypes 80000 //Max Number of molecule types -#define Natomtypes 4 //C,H,O,N - -#define Carbon 0 -#define Hydrogen 1 -#define Nitrogen 3 -#define Oxygen 2 - -// Prototypes for functions - -void FileOpenError(FILE *fp,char *name); -void Allocation(); -int AtomIndicator(char *symbol); -void SkipLine(FILE *fp); - -int Natom,Nmolecule;//total numbers of atoms and molecules -int Nmoltype=0;//number of species -int *Atomdic;//this array stores atom type accessible by atom id-1. -int *MolName;//an array that stores number of atoms of each type for each molecule by using counters of Natomtypes*imoleculetypes+atomtype so if H2 is the second molecule entry the array will have 4=0, 5=2, 6=0, 7=0. -int *MolType;//array with the same info as MolName but accessed by Nmoltype, not molecule id. -int *Mol;//an array that stores the molecule id for each atom -int *NMol;//an array that stores the number of molecules of this species for this frame -double *Netc;//an array that stores charge -double Mass[Natomtypes]; -double *rx,*ry,*rz,*Charge; -double *vx,*vy,*vz; -double COdic[Natomtypes][Natomtypes]; -double latc_x[3],latc_y[3],latc_z[3];//lattice parameters of the box read from config.out -double Ilatc_x[3],Ilatc_y[3],Ilatc_z[3];//normalized box lengths -double Origin[3];//origin coordinates of the box -FILE *trj,*dpol,*vtemp,*conc; - -main() { - - void GetAtomlist(); - void GetAtomlist_mod(); - void GetCOdict(); - void AnalyzeTrajectory(); - void PostProcess(); - - GetAtomlist_mod(Snapshots); - GetCOdict(Cutoff); - AnalyzeTrajectory(Snapshots,Output3); - PostProcess(Output1,Output2,Output3); - -} - -void GetAtomlist_mod(char *name) { -/*This subroutine reads the bonds.petn file to set the number of atoms. It also checks that a full frame exists because it loops over the first frame to populate the Atomdic with the proper type for each atom id.*/ - FILE *fp; - char buffer[1000]; - int i,j, Nlink, iatom, itemp, id; - double BO,dtemp;//BO is bond order - - fp=fopen(name,"r"); - FileOpenError(fp,name); - - while(fscanf(fp,"%s",buffer)!=EOF) { - - if(strcmp(buffer,"particles")==0) { - fscanf(fp,"%d",&Natom); - printf("# of atoms : %d\n",Natom); - Allocation(); - } - if(strcmp(buffer,"q")==0) { - - for(i=0;iCOdic[iatomtype][jatomtype]) { - if(Molid!=MolTemp[iatom]) { - if(MolTemp[jatom]==-1) MolTemp[jatom]=MolTemp[iatom]; - else { - for(k=0;k Date: Mon, 10 Dec 2018 14:38:25 -0500 Subject: [PATCH 31/94] remove meam and reax from documentation --- doc/src/Build_extras.txt | 44 +------ doc/src/Build_package.txt | 1 - doc/src/Commands_fix.txt | 3 +- doc/src/Commands_pair.txt | 3 +- doc/src/Install_windows.txt | 4 +- doc/src/Packages_details.txt | 43 +------ doc/src/Packages_standard.txt | 1 - doc/src/Packages_user.txt | 2 +- doc/src/Tools.txt | 2 +- doc/src/fix.txt | 5 +- doc/src/fix_reax_bonds.txt | 22 ++-- doc/src/fix_reaxc_species.txt | 5 +- doc/src/fixes.txt | 2 +- doc/src/lammps.book | 2 +- doc/src/pair_hybrid.txt | 13 +- doc/src/pair_meam_spline.txt | 2 +- doc/src/pair_meam_sw_spline.txt | 2 +- doc/src/pair_reax.txt | 216 -------------------------------- doc/src/pair_reaxc.txt | 14 +-- doc/src/pair_style.txt | 4 +- doc/src/pairs.txt | 3 +- tools/reax/README.txt | 14 +-- 22 files changed, 41 insertions(+), 366 deletions(-) delete mode 100644 doc/src/pair_reax.txt diff --git a/doc/src/Build_extras.txt b/doc/src/Build_extras.txt index 60bb5bbfea..e13165c7d2 100644 --- a/doc/src/Build_extras.txt +++ b/doc/src/Build_extras.txt @@ -36,7 +36,6 @@ This is the list of packages that may require additional steps. "OPT"_#opt, "POEMS"_#poems, "PYTHON"_#python, -"REAX"_#reax, "VORONOI"_#voronoi, "USER-ATC"_#user-atc, "USER-AWPMD"_#user-awpmd, @@ -536,45 +535,6 @@ build fails. :line -REAX package :h4,link(reax) - -NOTE: the use of the REAX package and its "pair_style -reax"_pair_reax.html command is discouraged, as it is no longer -maintained. Please use the USER-REAXC package and its "pair_style -reax/c"_pair_reaxc.html command instead, and possibly its KOKKOS -enabled variant (pair_style reax/c/kk), which has a more robust memory -management. See the "pair_style reax/c"_pair_reaxc.html doc page for -details. - -[CMake build]: - -No additional settings are needed besides "-D PKG_REAX=yes". - -[Traditional make]: - -Before building LAMMPS, you must build the REAX library in lib/reax. -You can do this manually if you prefer; follow the instructions in -lib/reax/README. You can also do it in one step from the lammps/src -dir, using a command like these, which simply invoke the -lib/reax/Install.py script with the specified args: - -make lib-reax # print help message -make lib-reax args="-m serial" # build with GNU Fortran compiler (settings as with "make serial") -make lib-reax args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi") -make lib-reax args="-m ifort" # build with Intel ifort compiler :pre - -The build should produce two files: lib/reax/libreax.a and -lib/reax/Makefile.lammps. The latter is copied from an existing -Makefile.lammps.* and has settings needed to link C++ (LAMMPS) with -Fortran (REAX library). Typically the two compilers used for LAMMPS -and the REAX library need to be consistent (e.g. both Intel or both -GNU compilers). If necessary, you can edit/create a new -lib/reax/Makefile.machine file for your system, which should define an -EXTRAMAKE variable to specify a corresponding Makefile.lammps.machine -file. - -:line - VORONOI package :h4,link(voronoi) To build with this package, you must download and build the "Voro++ @@ -621,8 +581,8 @@ The USER-ATC package requires the MANYBODY package also be installed. [CMake build]: -No additional settings are needed besides "-D PKG_REAX=yes" and "-D -PKG_MANYBODY=yes". +No additional settings are needed besides "-D PKG_USER-ATC=yes" +and "-D PKG_MANYBODY=yes". [Traditional make]: diff --git a/doc/src/Build_package.txt b/doc/src/Build_package.txt index 82833b867c..01c82d724e 100644 --- a/doc/src/Build_package.txt +++ b/doc/src/Build_package.txt @@ -47,7 +47,6 @@ packages: "OPT"_Build_extras.html#opt, "POEMS"_Build_extras.html#poems, "PYTHON"_Build_extras.html#python, -"REAX"_Build_extras.html#reax, "VORONOI"_Build_extras.html#voronoi, "USER-ATC"_Build_extras.html#user-atc, "USER-AWPMD"_Build_extras.html#user-awpmd, diff --git a/doc/src/Commands_fix.txt b/doc/src/Commands_fix.txt index fb4515b486..678cc9ba0d 100644 --- a/doc/src/Commands_fix.txt +++ b/doc/src/Commands_fix.txt @@ -169,8 +169,7 @@ OPT. "qmmm"_fix_qmmm.html, "qtb"_fix_qtb.html, "rattle"_fix_shake.html, -"reax/bonds"_fix_reax_bonds.html, -"reax/c/bonds (k)"_fix_reax_bonds.html, +"reax/c/bonds (k)"_fix_reaxc_bonds.html, "reax/c/species (k)"_fix_reaxc_species.html, "recenter"_fix_recenter.html, "restrain"_fix_restrain.html, diff --git a/doc/src/Commands_pair.txt b/doc/src/Commands_pair.txt index bf2b2b4f39..c6e60ecd59 100644 --- a/doc/src/Commands_pair.txt +++ b/doc/src/Commands_pair.txt @@ -160,8 +160,7 @@ OPT. "lubricateU/poly"_pair_lubricateU.html, "mdpd"_pair_meso.html, "mdpd/rhosum"_pair_meso.html, -"meam"_pair_meam.html, -"meam/c"_pair_meam.html, +"meam/c"_pair_meamc.html, "meam/spline (o)"_pair_meam_spline.html, "meam/sw/spline"_pair_meam_sw_spline.html, "mgpt"_pair_mgpt.html, diff --git a/doc/src/Install_windows.txt b/doc/src/Install_windows.txt index df87754c5f..0f306ec64c 100644 --- a/doc/src/Install_windows.txt +++ b/doc/src/Install_windows.txt @@ -23,8 +23,8 @@ install the Windows MPI package (MPICH2 from Argonne National Labs), needed to run in parallel. The LAMMPS binaries contain all optional packages included in the -source distribution except: KIM, REAX, KOKKOS, USER-INTEL, -and USER-QMMM. The serial version also does not include the MPIIO and +source distribution except: KIM, KOKKOS, USER-INTEL, and USER-QMMM. +The serial version also does not include the MPIIO and USER-LB packages. GPU support is provided for OpenCL. The installer site also has instructions on how to run LAMMPS under diff --git a/doc/src/Packages_details.txt b/doc/src/Packages_details.txt index 364ff3fe30..2d04d4e517 100644 --- a/doc/src/Packages_details.txt +++ b/doc/src/Packages_details.txt @@ -45,7 +45,6 @@ as contained in the file name. "LATTE"_#PKG-LATTE, "MANYBODY"_#PKG-MANYBODY, "MC"_#PKG-MC, -"MEAM"_#PKG-MEAM, "MESSAGE"_#PKG-MESSAGE, "MISC"_#PKG-MISC, "MOLECULE"_#PKG-MOLECULE, @@ -533,37 +532,6 @@ http://lammps.sandia.gov/movies.html#gcmc :ul :line -MEAM package :link(PKG-MEAM),h4 - -[Contents:] - -A pair style for the modified embedded atom (MEAM) potential. - -Please note that the use of the MEAM package is discouraged as -it has been superseded by the "USER-MEAMC"_#PKG-USER-MEAMC package, -which is a direct translation of the MEAM package to C++. -USER-MEAMC contains additional optimizations making it run faster -than MEAM on most machines, while providing the identical features -and user interface. - -[Author:] Greg Wagner (Northwestern U) while at Sandia. - -[Install:] - -This package has "specific installation -instructions"_Build_extras.html#gpu on the "Build -extras"_Build_extras.html doc page. - -[Supporting info:] - -src/MEAM: filenames -> commands -src/meam/README -lib/meam/README -"pair_style meam"_pair_meam.html -examples/meam :ul - -:line - MESSAGE package :link(PKG-MESSAGE),h4 [Contents:] @@ -1552,10 +1520,9 @@ USER-MEAMC package :link(PKG-USER-MEAMC),h4 [Contents:] A pair style for the modified embedded atom (MEAM) potential -translated from the Fortran version in the "MEAM"_#PKG-MEAM package -to plain C++. In contrast to the MEAM package, no library -needs to be compiled and the pair style can be instantiated -multiple times. +translated from the Fortran version in the (obsolete) "MEAM" package +to plain C++. The USER-MEAMC fully replaces the MEAM package, which +has been removed from LAMMPS after the 12 December 2018 version. [Author:] Sebastian Huetter, (Otto-von-Guericke University Magdeburg) based on the Fortran version of Greg Wagner (Northwestern U) while at @@ -1565,8 +1532,8 @@ Sandia. src/USER-MEAMC: filenames -> commands src/USER-MEAMC/README -"pair_style meam/c"_pair_meam.html -examples/meam :ul +"pair_style meam/c"_pair_meamc.html +examples/meamc :ul :line diff --git a/doc/src/Packages_standard.txt b/doc/src/Packages_standard.txt index 583ecf39fe..98c1adffcd 100644 --- a/doc/src/Packages_standard.txt +++ b/doc/src/Packages_standard.txt @@ -46,7 +46,6 @@ Package, Description, Doc page, Example, Library "LATTE"_Packages_details.html#PKG-LATTE, quantum DFTB forces via LATTE, "fix latte"_fix_latte.html, latte, ext "MANYBODY"_Packages_details.html#PKG-MANYBODY, many-body potentials, "pair_style tersoff"_pair_tersoff.html, shear, no "MC"_Packages_details.html#PKG-MC, Monte Carlo options, "fix gcmc"_fix_gcmc.html, n/a, no -"MEAM"_Packages_details.html#PKG-MEAM, modified EAM potential, "pair_style meam"_pair_meam.html, meam, int "MESSAGE"_Packages_details.html#PKG-MESSAGE, client/server messaging, "message"_message.html, message, int "MISC"_Packages_details.html#PKG-MISC, miscellaneous single-file commands, n/a, no, no "MOLECULE"_Packages_details.html#PKG-MOLECULE, molecular system force fields, "Howto bioFF"_Howto_bioFF.html, peptide, no diff --git a/doc/src/Packages_user.txt b/doc/src/Packages_user.txt index 077a7ce69d..cea3db4377 100644 --- a/doc/src/Packages_user.txt +++ b/doc/src/Packages_user.txt @@ -53,7 +53,7 @@ Package, Description, Doc page, Example, Library "USER-INTEL"_Packages_details.html#PKG-USER-INTEL, optimized Intel CPU and KNL styles,"Speed intel"_Speed_intel.html, "Benchmarks"_http://lammps.sandia.gov/bench.html, no "USER-LB"_Packages_details.html#PKG-USER-LB, Lattice Boltzmann fluid,"fix lb/fluid"_fix_lb_fluid.html, USER/lb, no "USER-MANIFOLD"_Packages_details.html#PKG-USER-MANIFOLD, motion on 2d surfaces,"fix manifoldforce"_fix_manifoldforce.html, USER/manifold, no -"USER-MEAMC"_Packages_details.html#PKG-USER-MEAMC, modified EAM potential (C++), "pair_style meam/c"_pair_meam.html, meam, no +"USER-MEAMC"_Packages_details.html#PKG-USER-MEAMC, modified EAM potential (C++), "pair_style meam/c"_pair_meamc.html, meamc, no "USER-MESO"_Packages_details.html#PKG-USER-MESO, mesoscale DPD models, "pair_style edpd"_pair_meso.html, USER/meso, no "USER-MGPT"_Packages_details.html#PKG-USER-MGPT, fast MGPT multi-ion potentials, "pair_style mgpt"_pair_mgpt.html, USER/mgpt, no "USER-MISC"_Packages_details.html#PKG-USER-MISC, single-file contributions, USER-MISC/README, USER/misc, no diff --git a/doc/src/Tools.txt b/doc/src/Tools.txt index d2e53d8b77..02ee582970 100644 --- a/doc/src/Tools.txt +++ b/doc/src/Tools.txt @@ -486,7 +486,7 @@ README for more info on Pizza.py and how to use these scripts. reax tool :h4,link(reax_tool) The reax sub-directory contains stand-alond codes that can -post-process the output of the "fix reax/bonds"_fix_reax_bonds.html +post-process the output of the "fix reax/c/bonds"_fix_reaxc_bonds.html command from a LAMMPS simulation using "ReaxFF"_pair_reax.html. See the README.txt file for more info. diff --git a/doc/src/fix.txt b/doc/src/fix.txt index 916e9887f9..395f2ad7a9 100644 --- a/doc/src/fix.txt +++ b/doc/src/fix.txt @@ -312,9 +312,8 @@ accelerated styles exist. "qmmm"_fix_qmmm.html - "qtb"_fix_qtb.html - "rattle"_fix_shake.html - RATTLE constraints on bonds and/or angles -"reax/bonds"_fix_reax_bonds.html - write out ReaxFF bond information -"reax/c/bonds"_fix_reax_bonds.html - -"reax/c/species"_fix_reaxc_species.html - +"reax/c/bonds"_fix_reaxc_bonds.html - write out ReaxFF bond information +"reax/c/species"_fix_reaxc_species.html - write out ReaxFF molecule information "recenter"_fix_recenter.html - constrain the center-of-mass position of a group of atoms "restrain"_fix_restrain.html - constrain a bond, angle, dihedral "rhok"_fix_rhok.html - diff --git a/doc/src/fix_reax_bonds.txt b/doc/src/fix_reax_bonds.txt index 06d30d871a..9cd4ed7610 100644 --- a/doc/src/fix_reax_bonds.txt +++ b/doc/src/fix_reax_bonds.txt @@ -6,13 +6,12 @@ :line -fix reax/bonds command :h3 fix reax/c/bonds command :h3 fix reax/c/bonds/kk command :h3 [Syntax:] -fix ID group-ID reax/bonds Nevery filename :pre +fix ID group-ID reaxc/bonds Nevery filename :pre ID, group-ID are documented in "fix"_fix.html command reax/bonds = style name of this fix command @@ -21,16 +20,14 @@ filename = name of output file :ul [Examples:] -fix 1 all reax/bonds 100 bonds.tatb fix 1 all reax/c/bonds 100 bonds.reaxc :pre [Description:] -Write out the bond information computed by the ReaxFF potential -specified by "pair_style reax"_pair_reax.html or "pair_style -reax/c"_pair_reaxc.html in the exact same format as the original -stand-alone ReaxFF code of Adri van Duin. The bond information is -written to {filename} on timesteps that are multiples of {Nevery}, +Write out the bond information computed by the ReaxFF potential specified +by "pair_style reax/c"_pair_reaxc.html in the exact same format as the +original stand-alone ReaxFF code of Adri van Duin. The bond information +is written to {filename} on timesteps that are multiples of {Nevery}, including timestep 0. For time-averaged chemical species analysis, please see the "fix reaxc/c/species"_fix_reaxc_species.html command. @@ -94,12 +91,8 @@ more instructions on how to use the accelerated styles effectively. [Restrictions:] -The fix reax/bonds command requires that the "pair_style -reax"_pair_reax.html be invoked. This fix is part of the REAX -package. It is only enabled if LAMMPS was built with that package, -which also requires the REAX library be built and linked with LAMMPS. The fix reax/c/bonds command requires that the "pair_style -reax/c"_pair_reaxc.html be invoked. This fix is part of the +reax/c"_pair_reaxc.html is invoked. This fix is part of the USER-REAXC package. It is only enabled if LAMMPS was built with that package. See the "Build package"_Build_package.html doc page for more info. @@ -109,7 +102,6 @@ To write gzipped bond files, you must compile LAMMPS with the [Related commands:] -"pair_style reax"_pair_reax.html, "pair_style -reax/c"_pair_reaxc.html, "fix reax/c/species"_fix_reaxc_species.html +"pair_style reax/c"_pair_reaxc.html, "fix reax/c/species"_fix_reaxc_species.html [Default:] none diff --git a/doc/src/fix_reaxc_species.txt b/doc/src/fix_reaxc_species.txt index 980384ff34..60fa3a1d70 100644 --- a/doc/src/fix_reaxc_species.txt +++ b/doc/src/fix_reaxc_species.txt @@ -161,7 +161,7 @@ more instructions on how to use the accelerated styles effectively. [Restrictions:] -The fix species currently only works with "pair_style +The "fix reax/c/species" currently only works with "pair_style reax/c"_pair_reaxc.html and it requires that the "pair_style reax/c"_pair_reaxc.html be invoked. This fix is part of the USER-REAXC package. It is only enabled if LAMMPS was built with that @@ -177,8 +177,7 @@ It should be possible to extend it to other reactive pair_styles (such as [Related commands:] -"pair_style reax/c"_pair_reaxc.html, "fix -reax/bonds"_fix_reax_bonds.html +"pair_style reax/c"_pair_reaxc.html, "fix reax/c/bonds"_fix_reaxc_bonds.html [Default:] diff --git a/doc/src/fixes.txt b/doc/src/fixes.txt index eb52583dce..3853bb77a9 100644 --- a/doc/src/fixes.txt +++ b/doc/src/fixes.txt @@ -135,7 +135,7 @@ Fixes :h1 fix_qeq_reax fix_qmmm fix_qtb - fix_reax_bonds + fix_reaxc_bonds fix_reaxc_species fix_recenter fix_restrain diff --git a/doc/src/lammps.book b/doc/src/lammps.book index 3ec314e09e..c63f39eec4 100644 --- a/doc/src/lammps.book +++ b/doc/src/lammps.book @@ -598,7 +598,7 @@ pair_lj_soft.html pair_lubricate.html pair_lubricateU.html pair_mdf.html -pair_meam.html +pair_meamc.html pair_meam_spline.html pair_meam_sw_spline.html pair_meso.html diff --git a/doc/src/pair_hybrid.txt b/doc/src/pair_hybrid.txt index 59af479b9f..4467ac1d51 100644 --- a/doc/src/pair_hybrid.txt +++ b/doc/src/pair_hybrid.txt @@ -70,15 +70,10 @@ other pairwise potential for several different atom type pairs in your model, then you should just list the sub-style once and use the pair_coeff command to assign parameters for the different type pairs. -NOTE: There are two exceptions to this option to list an individual -pair style multiple times. The first is for pair styles implemented -as Fortran libraries: "pair_style meam"_pair_meam.html and "pair_style -reax"_pair_reax.html ("pair_style reax/c"_pair_reaxc.html is OK). -This is because unlike a C++ class, they can not be instantiated -multiple times, due to the manner in which they were coded in Fortran. -The second is for GPU-enabled pair styles in the GPU package. This is -b/c the GPU package also currently assumes that only one instance of a -pair style is being used. +NOTE: There is one exception to this option to list an individual +pair style multiple times: GPU-enabled pair styles in the GPU package. +This is because the GPU package currently assumes that only one +instance of a pair style is being used. In the pair_coeff commands, the name of a pair style must be added after the I,J type specification, with the remaining coefficients diff --git a/doc/src/pair_meam_spline.txt b/doc/src/pair_meam_spline.txt index 74adba2432..7a185b4d55 100644 --- a/doc/src/pair_meam_spline.txt +++ b/doc/src/pair_meam_spline.txt @@ -152,7 +152,7 @@ info. [Related commands:] -"pair_coeff"_pair_coeff.html, "pair_style meam"_pair_meam.html +"pair_coeff"_pair_coeff.html, "pair_style meam/c"_pair_meamc.html [Default:] none diff --git a/doc/src/pair_meam_sw_spline.txt b/doc/src/pair_meam_sw_spline.txt index 77322953cf..a9ad3484d3 100644 --- a/doc/src/pair_meam_sw_spline.txt +++ b/doc/src/pair_meam_sw_spline.txt @@ -116,7 +116,7 @@ info. [Related commands:] -"pair_coeff"_pair_coeff.html, "pair_style meam"_pair_meam.html, +"pair_coeff"_pair_coeff.html, "pair_style meam/c"_pair_meamc.html, "pair_style meam/spline"_pair_meam_spline.html [Default:] none diff --git a/doc/src/pair_reax.txt b/doc/src/pair_reax.txt deleted file mode 100644 index a3b84955cd..0000000000 --- a/doc/src/pair_reax.txt +++ /dev/null @@ -1,216 +0,0 @@ -"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c - -:link(lws,http://lammps.sandia.gov) -:link(ld,Manual.html) -:link(lc,Commands_all.html) - -:line - -pair_style reax command :h3 - -[Syntax:] - -pair_style reax hbcut hbnewflag tripflag precision :pre - -hbcut = hydrogen-bond cutoff (optional) (distance units) -hbnewflag = use old or new hbond function style (0 or 1) (optional) -tripflag = apply stabilization to all triple bonds (0 or 1) (optional) -precision = precision for charge equilibration (optional) :ul - -[Examples:] - -pair_style reax -pair_style reax 10.0 0 1 1.0e-5 -pair_coeff * * ffield.reax 3 1 2 2 -pair_coeff * * ffield.reax 3 NULL NULL 3 :pre - -[Description:] - -Style {reax} computes the ReaxFF potential of van Duin, Goddard and -co-workers. ReaxFF uses distance-dependent bond-order functions to -represent the contributions of chemical bonding to the potential -energy. There is more than one version of ReaxFF. The version -implemented in LAMMPS uses the functional forms documented in the -supplemental information of the following paper: -"(Chenoweth)"_#Chenoweth_20081. The version integrated into LAMMPS matches -the most up-to-date version of ReaxFF as of summer 2010. - -WARNING: pair style reax is now deprecated and will soon be retired. Users -should switch to "pair_style reax/c"_pair_reaxc.html. The {reax} style -differs from the {reax/c} style in the lo-level implementation details. -The {reax} style is a -Fortran library, linked to LAMMPS. The {reax/c} style was initially -implemented as stand-alone C code and is now integrated into LAMMPS as -a package. - -LAMMPS requires that a file called ffield.reax be provided, containing -the ReaxFF parameters for each atom type, bond type, etc. The format -is identical to the ffield file used by van Duin and co-workers. The -filename is required as an argument in the pair_coeff command. Any -value other than "ffield.reax" will be rejected (see below). - -LAMMPS provides several different versions of ffield.reax in its -potentials dir, each called potentials/ffield.reax.label. These are -documented in potentials/README.reax. The default ffield.reax -contains parameterizations for the following elements: C, H, O, N. - -NOTE: We do not distribute a wide variety of ReaxFF force field files -with LAMMPS. Adri van Duin's group at PSU is the central repository -for this kind of data as they are continuously deriving and updating -parameterizations for different classes of materials. You can submit -a contact request at the Materials Computation Center (MCC) website -"https://www.mri.psu.edu/materials-computation-center/connect-mcc"_https://www.mri.psu.edu/materials-computation-center/connect-mcc, -describing the material(s) you are interested in modeling with ReaxFF. -They can tell -you what is currently available or what it would take to create a -suitable ReaxFF parameterization. - -The format of these files is identical to that used originally by van -Duin. We have tested the accuracy of {pair_style reax} potential -against the original ReaxFF code for the systems mentioned above. You -can use other ffield files for specific chemical systems that may be -available elsewhere (but note that their accuracy may not have been -tested). - -The {hbcut}, {hbnewflag}, {tripflag}, and {precision} settings are -optional arguments. If none are provided, default settings are used: -{hbcut} = 6 (which is Angstroms in real units), {hbnewflag} = 1 (use -new hbond function style), {tripflag} = 1 (apply stabilization to all -triple bonds), and {precision} = 1.0e-6 (one part in 10^6). If you -wish to override any of these defaults, then all of the settings must -be specified. - -Two examples using {pair_style reax} are provided in the examples/reax -sub-directory, along with corresponding examples for -"pair_style reax/c"_pair_reaxc.html. Note that while the energy and force -calculated by both of these pair styles match very closely, the -contributions due to the valence angles differ slightly due to -the fact that with {pair_style reax/c} the default value of {thb_cutoff_sq} -is 0.00001, while for {pair_style reax} it is hard-coded to be 0.001. - -Use of this pair style requires that a charge be defined for every -atom since the {reax} pair style performs a charge equilibration (QEq) -calculation. See the "atom_style"_atom_style.html and -"read_data"_read_data.html commands for details on how to specify -charges. - -The thermo variable {evdwl} stores the sum of all the ReaxFF potential -energy contributions, with the exception of the Coulombic and charge -equilibration contributions which are stored in the thermo variable -{ecoul}. The output of these quantities is controlled by the -"thermo"_thermo.html command. - -This pair style tallies a breakdown of the total ReaxFF potential -energy into sub-categories, which can be accessed via the "compute -pair"_compute_pair.html command as a vector of values of length 14. -The 14 values correspond to the following sub-categories (the variable -names in italics match those used in the ReaxFF FORTRAN library): - -{eb} = bond energy -{ea} = atom energy -{elp} = lone-pair energy -{emol} = molecule energy (always 0.0) -{ev} = valence angle energy -{epen} = double-bond valence angle penalty -{ecoa} = valence angle conjugation energy -{ehb} = hydrogen bond energy -{et} = torsion energy -{eco} = conjugation energy -{ew} = van der Waals energy -{ep} = Coulomb energy -{efi} = electric field energy (always 0.0) -{eqeq} = charge equilibration energy :ol - -To print these quantities to the log file (with descriptive column -headings) the following commands could be included in an input script: - -compute reax all pair reax -variable eb equal c_reax\[1\] -variable ea equal c_reax\[2\] -... -variable eqeq equal c_reax\[14\] -thermo_style custom step temp epair v_eb v_ea ... v_eqeq :pre - -Only a single pair_coeff command is used with the {reax} style which -specifies a ReaxFF potential file with parameters for all needed -elements. These are mapped to LAMMPS atom types by specifying N -additional arguments after the filename in the pair_coeff command, -where N is the number of LAMMPS atom types: - -filename -N indices = mapping of ReaxFF elements to atom types :ul - -The specification of the filename and the mapping of LAMMPS atom types -recognized by the ReaxFF is done differently than for other LAMMPS -potentials, due to the non-portable difficulty of passing character -strings (e.g. filename, element names) between C++ and Fortran. - -The filename has to be "ffield.reax" and it has to exist in the -directory you are running LAMMPS in. This means you cannot prepend a -path to the file in the potentials dir. Rather, you should copy that -file into the directory you are running from. If you wish to use -another ReaxFF potential file, then name it "ffield.reax" and put it -in the directory you run from. - -In the ReaxFF potential file, near the top, after the general -parameters, is the atomic parameters section that contains element -names, each with a couple dozen numeric parameters. If there are M -elements specified in the {ffield} file, think of these as numbered 1 -to M. Each of the N indices you specify for the N atom types of LAMMPS -atoms must be an integer from 1 to M. Atoms with LAMMPS type 1 will -be mapped to whatever element you specify as the first index value, -etc. If a mapping value is specified as NULL, the mapping is not -performed. This can be used when a ReaxFF potential is used as part -of the {hybrid} pair style. The NULL values are placeholders for atom -types that will be used with other potentials. - -NOTE: Currently the reax pair style cannot be used as part of the -{hybrid} pair style. Some additional changes still need to be made to -enable this. - -As an example, say your LAMMPS simulation has 4 atom types and the -elements are ordered as C, H, O, N in the {ffield} file. If you want -the LAMMPS atom type 1 and 2 to be C, type 3 to be N, and type 4 to be -H, you would use the following pair_coeff command: - -pair_coeff * * ffield.reax 1 1 4 2 :pre - -:line - -[Mixing, shift, table, tail correction, restart, rRESPA info]: - -This pair style does not support the "pair_modify"_pair_modify.html -mix, shift, table, and tail options. - -This pair style does not write its information to "binary restart -files"_restart.html, since it is stored in potential files. Thus, you -need to re-specify the pair_style and pair_coeff commands in an input -script that reads a restart file. - -This pair style can only be used via the {pair} keyword of the -"run_style respa"_run_style.html command. It does not support the -{inner}, {middle}, {outer} keywords. - -[Restrictions:] - -The ReaxFF potential files provided with LAMMPS in the potentials -directory are parameterized for real "units"_units.html. You can use -the ReaxFF potential with any LAMMPS units, but you would need to -create your own potential file with coefficients listed in the -appropriate units if your simulation doesn't use "real" units. - -[Related commands:] - -"pair_coeff"_pair_coeff.html, "pair_style reax/c"_pair_reaxc.html, -"fix_reax_bonds"_fix_reax_bonds.html - -[Default:] - -The keyword defaults are {hbcut} = 6, {hbnewflag} = 1, {tripflag} = 1, -{precision} = 1.0e-6. - -:line - -:link(Chenoweth_20081) -[(Chenoweth_2008)] Chenoweth, van Duin and Goddard, -Journal of Physical Chemistry A, 112, 1040-1053 (2008). diff --git a/doc/src/pair_reaxc.txt b/doc/src/pair_reaxc.txt index e63f4a90ee..636f472b88 100644 --- a/doc/src/pair_reaxc.txt +++ b/doc/src/pair_reaxc.txt @@ -37,7 +37,7 @@ pair_coeff * * ffield.reax C H O N :pre Style {reax/c} computes the ReaxFF potential of van Duin, Goddard and co-workers. ReaxFF uses distance-dependent bond-order functions to represent the contributions of chemical bonding to the potential -energy. There is more than one version of ReaxFF. The version +energy. There is more than one version of ReaxFF. The version implemented in LAMMPS uses the functional forms documented in the supplemental information of the following paper: "(Chenoweth et al., 2008)"_#Chenoweth_20082. The version integrated into LAMMPS matches @@ -56,11 +56,10 @@ consideration when using the {reax/c/kk} style is the choice of either half or full neighbor lists. This setting can be changed using the Kokkos "package"_package.html command. -The {reax/c} style differs from the "pair_style reax"_pair_reax.html -command in the lo-level implementation details. The {reax} style is a -Fortran library, linked to LAMMPS. The {reax/c} style was initially -implemented as stand-alone C code and is now integrated into LAMMPS as -a package. +The {reax/c} style differs from the (obsolete) "pair_style reax" +command in the implementation details. The {reax} style was a +Fortran library, linked to LAMMPS. The {reax} style has been removed +from LAMMPS after the 12 December 2018 version. LAMMPS provides several different versions of ffield.reax in its potentials dir, each called potentials/ffield.reax.label. These are @@ -338,8 +337,7 @@ appropriate units if your simulation doesn't use "real" units. "pair_coeff"_pair_coeff.html, "fix qeq/reax"_fix_qeq_reax.html, "fix reax/c/bonds"_fix_reax_bonds.html, "fix -reax/c/species"_fix_reaxc_species.html, "pair_style -reax"_pair_reax.html +reax/c/species"_fix_reaxc_species.html [Default:] diff --git a/doc/src/pair_style.txt b/doc/src/pair_style.txt index 46a4f31dd4..ea746f8943 100644 --- a/doc/src/pair_style.txt +++ b/doc/src/pair_style.txt @@ -226,8 +226,7 @@ accelerated styles exist. "lubricateU/poly"_pair_lubricateU.html - hydrodynamic lubrication forces for Fast Lubrication with polydispersity "mdpd"_pair_meso.html - mDPD particle interactions "mdpd/rhosum"_pair_meso.html - mDPD particle interactions for mass density -"meam"_pair_meam.html - modified embedded atom method (MEAM) in Fortran -"meam/c"_pair_meam.html - modified embedded atom method (MEAM) in C +"meam/c"_pair_meamc.html - modified embedded atom method (MEAM) in C "meam/spline"_pair_meam_spline.html - splined version of MEAM "meam/sw/spline"_pair_meam_sw_spline.html - splined version of MEAM with a Stillinger-Weber term "mgpt"_pair_mgpt.html - simplified model generalized pseudopotential theory (MGPT) potential @@ -260,7 +259,6 @@ accelerated styles exist. "polymorphic"_pair_polymorphic.html - polymorphic 3-body potential "python"_pair_python.html - "quip"_pair_quip.html - -"reax"_pair_reax.html - ReaxFF potential in Fortran "reax/c"_pair_reaxc.html - ReaxFF potential in C "rebo"_pair_airebo.html - 2nd generation REBO potential of Brenner "resquared"_pair_resquared.html - Everaers RE-Squared ellipsoidal potential diff --git a/doc/src/pairs.txt b/doc/src/pairs.txt index ca79051053..7a7ad86d0d 100644 --- a/doc/src/pairs.txt +++ b/doc/src/pairs.txt @@ -63,7 +63,7 @@ Pair Styles :h1 pair_lubricate pair_lubricateU pair_mdf - pair_meam + pair_meamc pair_meam_spline pair_meam_sw_spline pair_meso @@ -82,7 +82,6 @@ Pair Styles :h1 pair_polymorphic pair_python pair_quip - pair_reax pair_reaxc pair_resquared pair_sdk diff --git a/tools/reax/README.txt b/tools/reax/README.txt index 2a7ff29f26..3c9fe4506b 100644 --- a/tools/reax/README.txt +++ b/tools/reax/README.txt @@ -4,19 +4,7 @@ The programs in this folder can be used to analyze the output of simulations using the ReaxFF potentials; -mol_fra.c: reads the output of fix reax/bonds - and identifies fragments - Compile it using a C compiler - To test, run it with Cutoff.dic and bonds.reax - Contact: Aidan Thompson - -bondConnectCheck.f90: reads the output of fix reax/bonds. - Does not do fragment analysis. - Compile it using FORTRAN compiler - To test, run it with bonds.reax - Contact: Paul Liangliang Huang - reaxc_bond.pl: reads the bonding information in the .trj file produced by pair_style reax/c and - outputs molecule counts for each frame. + outputs molecule counts for each frame. From e2c39a1acdca11f38885043d26cf9476c6371b63 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 14:38:58 -0500 Subject: [PATCH 32/94] rename page for fix reax/c/bonds --- doc/src/{fix_reax_bonds.txt => fix_reaxc_bonds.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/src/{fix_reax_bonds.txt => fix_reaxc_bonds.txt} (100%) diff --git a/doc/src/fix_reax_bonds.txt b/doc/src/fix_reaxc_bonds.txt similarity index 100% rename from doc/src/fix_reax_bonds.txt rename to doc/src/fix_reaxc_bonds.txt From 1933c2eb5fd3045b24976484999fcff80beb58b9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 14:51:21 -0500 Subject: [PATCH 33/94] next chunk of documentation changes for the removal of REAX and MEAM --- doc/src/Commands_pair.txt | 1 - doc/src/Packages_details.txt | 40 ++------------------- doc/src/Packages_standard.txt | 1 - doc/src/Tools.txt | 2 +- doc/src/compute_pair.txt | 6 ++-- doc/src/lammps.book | 2 +- doc/src/pair_reaxc.txt | 10 +++--- doc/utils/sphinx-config/false_positives.txt | 1 + 8 files changed, 13 insertions(+), 50 deletions(-) diff --git a/doc/src/Commands_pair.txt b/doc/src/Commands_pair.txt index c6e60ecd59..2691ccaebf 100644 --- a/doc/src/Commands_pair.txt +++ b/doc/src/Commands_pair.txt @@ -193,7 +193,6 @@ OPT. "polymorphic"_pair_polymorphic.html, "python"_pair_python.html, "quip"_pair_quip.html, -"reax"_pair_reax.html, "reax/c (ko)"_pair_reaxc.html, "rebo (io)"_pair_airebo.html, "resquared (go)"_pair_resquared.html, diff --git a/doc/src/Packages_details.txt b/doc/src/Packages_details.txt index 2d04d4e517..4768c50ca4 100644 --- a/doc/src/Packages_details.txt +++ b/doc/src/Packages_details.txt @@ -55,7 +55,6 @@ as contained in the file name. "POEMS"_#PKG-POEMS, "PYTHON"_#PKG-PYTHON, "QEQ"_#PKG-QEQ, -"REAX"_#PKG-REAX, "REPLICA"_#PKG-REPLICA2, "RIGID"_#PKG-RIGID, "SHOCK"_#PKG-SHOCK, @@ -802,38 +801,6 @@ examples/streitz :ul :line -REAX package :link(PKG-REAX),h4 - -[Contents:] - -NOTE: the use of the REAX package is discouraged, as it is no longer -maintained. Please use the "USER-REAXC"_#PKG-USER-REAXC package instead, -and possibly the KOKKOS enabled variant of that, which has a more robust -memory management. - -A pair style which wraps a Fortran library which implements the ReaxFF -potential, which is a universal reactive force field. Also included is -a "fix reax/bonds"_fix_reax_bonds.html command for monitoring molecules -as bonds are created and destroyed. - -[Author:] Aidan Thompson (Sandia). - -[Install:] - -This package has "specific installation -instructions"_Build_extras.html#gpu on the "Build -extras"_Build_extras.html doc page. - -[Supporting info:] - -src/REAX: filenames -> commands -lib/reax/README -"pair_style reax"_pair_reax.html -"fix reax/bonds"_fix_reax_bonds.html -examples/reax :ul - -:line - REPLICA package :link(PKG-REPLICA2),h4 [Contents:] @@ -1861,9 +1828,8 @@ USER-REAXC package :link(PKG-USER-REAXC),h4 [Contents:] -A pair style which implements the ReaxFF potential in C/C++ (in -contrast to the "REAX package"_#PKG-REAX and its Fortran library). ReaxFF -is universal reactive force field. See the src/USER-REAXC/README file +A pair style which implements the ReaxFF potential in C/C++. ReaxFF +is a universal reactive force field. See the src/USER-REAXC/README file for more info on differences between the two packages. Also two fixes for monitoring molecules as bonds are created and destroyed. @@ -1874,7 +1840,7 @@ for monitoring molecules as bonds are created and destroyed. src/USER-REAXC: filenames -> commands src/USER-REAXC/README "pair_style reax/c"_pair_reaxc.html -"fix reax/c/bonds"_fix_reax_bonds.html +"fix reax/c/bonds"_fix_reaxc_bonds.html "fix reax/c/species"_fix_reaxc_species.html examples/reax :ul diff --git a/doc/src/Packages_standard.txt b/doc/src/Packages_standard.txt index 98c1adffcd..7fb1d99174 100644 --- a/doc/src/Packages_standard.txt +++ b/doc/src/Packages_standard.txt @@ -56,7 +56,6 @@ Package, Description, Doc page, Example, Library "POEMS"_Packages_details.html#PKG-POEMS, coupled rigid body motion, "fix poems"_fix_poems.html, rigid, int "PYTHON"_Packages_details.html#PKG-PYTHON, embed Python code in an input script, "python"_python.html, python, sys "QEQ"_Packages_details.html#PKG-QEQ, QEq charge equilibration, "fix qeq"_fix_qeq.html, qeq, no -"REAX"_Packages_details.html#PKG-REAX, ReaxFF potential (Fortran), "pair_style reax"_pair_reax.html, reax, int "REPLICA"_Packages_details.html#PKG-REPLICA2, multi-replica methods, "Howto replica"_Howto_replica.html, tad, no "RIGID"_Packages_details.html#PKG-RIGID, rigid bodies and constraints, "fix rigid"_fix_rigid.html, rigid, no "SHOCK"_Packages_details.html#PKG-SHOCK, shock loading methods, "fix msst"_fix_msst.html, n/a, no diff --git a/doc/src/Tools.txt b/doc/src/Tools.txt index 02ee582970..88c8f0f77f 100644 --- a/doc/src/Tools.txt +++ b/doc/src/Tools.txt @@ -487,7 +487,7 @@ reax tool :h4,link(reax_tool) The reax sub-directory contains stand-alond codes that can post-process the output of the "fix reax/c/bonds"_fix_reaxc_bonds.html -command from a LAMMPS simulation using "ReaxFF"_pair_reax.html. See +command from a LAMMPS simulation using "ReaxFF"_pair_reaxc.html. See the README.txt file for more info. These tools were written by Aidan Thompson at Sandia. diff --git a/doc/src/compute_pair.txt b/doc/src/compute_pair.txt index 1ced6eecfc..c1bd4f74d9 100644 --- a/doc/src/compute_pair.txt +++ b/doc/src/compute_pair.txt @@ -24,7 +24,7 @@ nsub = {n}-instance of a sub-style, if a pair style is used multiple times in a compute 1 all pair gauss compute 1 all pair lj/cut/coul/cut ecoul compute 1 all pair tersoff 2 epair -compute 1 all pair reax :pre +compute 1 all pair reax/c :pre [Description:] @@ -60,8 +60,8 @@ corrections, even if they are enabled via the "pair_modify"_pair_modify.html command. Some pair styles tally additional quantities, e.g. a breakdown of -potential energy into a dozen or so components is tallied by the -"pair_style reax"_pair_reax.html command. These values (1 or more) +potential energy into 14 components is tallied by the "pair_style +reax/c"_pair_reaxc.html command. These values (1 or more) are stored as a global vector by this compute. See the doc page for "individual pair styles"_pair_style.html for info on these values. diff --git a/doc/src/lammps.book b/doc/src/lammps.book index c63f39eec4..e38aefce5f 100644 --- a/doc/src/lammps.book +++ b/doc/src/lammps.book @@ -356,7 +356,7 @@ fix_qeq_comb.html fix_qeq_reax.html fix_qmmm.html fix_qtb.html -fix_reax_bonds.html +fix_reaxc_bonds.html fix_reaxc_species.html fix_recenter.html fix_restrain.html diff --git a/doc/src/pair_reaxc.txt b/doc/src/pair_reaxc.txt index 636f472b88..37482beacf 100644 --- a/doc/src/pair_reaxc.txt +++ b/doc/src/pair_reaxc.txt @@ -97,9 +97,8 @@ correspond to those used by Adri van Duin's stand-alone serial code. If these are changed by setting control variables in the control file, the results from LAMMPS and the serial code will not agree. -Two examples using {pair_style reax/c} are provided in the examples/reax -sub-directory, along with corresponding examples for -"pair_style reax"_pair_reax.html. +Examples using {pair_style reax/c} are provided in the examples/reax +sub-directory. Use of this pair style requires that a charge be defined for every atom. See the "atom_style"_atom_style.html and @@ -192,8 +191,7 @@ where N is the number of LAMMPS atom types: filename N indices = ReaxFF elements :ul -The filename is the ReaxFF potential file. Unlike for the {reax} -pair style, any filename can be used. +The filename is the ReaxFF potential file. In the ReaxFF potential file, near the top, after the general parameters, is the atomic parameters section that contains element @@ -336,7 +334,7 @@ appropriate units if your simulation doesn't use "real" units. [Related commands:] "pair_coeff"_pair_coeff.html, "fix qeq/reax"_fix_qeq_reax.html, "fix -reax/c/bonds"_fix_reax_bonds.html, "fix +reax/c/bonds"_fix_reaxc_bonds.html, "fix reax/c/species"_fix_reaxc_species.html [Default:] diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index de60206304..945d3982e4 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1522,6 +1522,7 @@ mdf mdpd mDPD meam +meamc MEAMC meamf meanDist From 0b5c273e2db77633d08640db1c6d313472f2be4e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 15:16:34 -0500 Subject: [PATCH 34/94] update examples for removal of reax and meam --- examples/meam/in.meam | 30 --- examples/meam/log.27Nov18.meam.g++.1 | 96 ---------- examples/meam/log.27Nov18.meam.g++.4 | 96 ---------- examples/meam/log.27Nov18.meam.shear.g++.1 | 209 --------------------- examples/meam/log.27Nov18.meam.shear.g++.4 | 209 --------------------- examples/reax/README | 8 +- examples/reax/in.reax.rdx | 52 ----- examples/reax/in.reax.tatb | 53 ------ examples/reax/log.8March18.reax.rdx.g++.1 | 107 ----------- examples/reax/log.8March18.reax.rdx.g++.4 | 107 ----------- examples/reax/log.8March18.reax.tatb.g++.1 | 103 ---------- examples/reax/log.8March18.reax.tatb.g++.4 | 103 ---------- 12 files changed, 2 insertions(+), 1171 deletions(-) delete mode 100644 examples/meam/in.meam delete mode 100644 examples/meam/log.27Nov18.meam.g++.1 delete mode 100644 examples/meam/log.27Nov18.meam.g++.4 delete mode 100644 examples/meam/log.27Nov18.meam.shear.g++.1 delete mode 100644 examples/meam/log.27Nov18.meam.shear.g++.4 delete mode 100644 examples/reax/in.reax.rdx delete mode 100644 examples/reax/in.reax.tatb delete mode 100644 examples/reax/log.8March18.reax.rdx.g++.1 delete mode 100644 examples/reax/log.8March18.reax.rdx.g++.4 delete mode 100644 examples/reax/log.8March18.reax.tatb.g++.1 delete mode 100644 examples/reax/log.8March18.reax.tatb.g++.4 diff --git a/examples/meam/in.meam b/examples/meam/in.meam deleted file mode 100644 index b4463be365..0000000000 --- a/examples/meam/in.meam +++ /dev/null @@ -1,30 +0,0 @@ -# Test of MEAM potential for SiC system - -units metal -boundary p p p - -atom_style atomic - -read_data data.meam - -pair_style meam -pair_coeff * * library.meam Si C SiC.meam Si C - -neighbor 0.3 bin -neigh_modify delay 10 - -fix 1 all nve -thermo 10 -timestep 0.001 - -#dump 1 all atom 50 dump.meam - -#dump 2 all image 10 image.*.jpg element element & -# axes yes 0.8 0.02 view 60 -30 -#dump_modify 2 pad 3 element Si C - -#dump 3 all movie 10 movie.mpg element element & -# axes yes 0.8 0.02 view 60 -30 -#dump_modify 3 pad 3 element Si C - -run 100 diff --git a/examples/meam/log.27Nov18.meam.g++.1 b/examples/meam/log.27Nov18.meam.g++.1 deleted file mode 100644 index 502d919923..0000000000 --- a/examples/meam/log.27Nov18.meam.g++.1 +++ /dev/null @@ -1,96 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# Test of MEAM potential for SiC system - -units metal -boundary p p p - -atom_style atomic - -read_data data.meam - orthogonal box = (-6 -6 -6) to (5.97232 5.97232 5.97232) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 128 atoms - -pair_style meam -WARNING: THE pair_style meam COMMAND IS OBSOLETE AND WILL BE REMOVED VERY SOON. PLEASE USE meam/c (src/MEAM/pair_meam.cpp:51) -pair_coeff * * library.meam Si C SiC.meam Si C -Reading potential file library.meam with DATE: 2012-06-29 -Reading potential file SiC.meam with DATE: 2007-06-11 - -neighbor 0.3 bin -neigh_modify delay 10 - -fix 1 all nve -thermo 10 -timestep 0.001 - -#dump 1 all atom 50 dump.meam - -#dump 2 all image 10 image.*.jpg element element # axes yes 0.8 0.02 view 60 -30 -#dump_modify 2 pad 3 element Si C - -#dump 3 all movie 10 movie.mpg element element # axes yes 0.8 0.02 view 60 -30 -#dump_modify 3 pad 3 element Si C - -run 100 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.3 - ghost atom cutoff = 4.3 - binsize = 2.15, bins = 6 6 6 - 2 neighbor lists, perpetual/occasional/extra = 2 0 0 - (1) pair meam, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard - (2) pair meam, perpetual, half/full from (1) - attributes: half, newton on - pair build: halffull/newton - stencil: none - bin: none -Per MPI rank memory allocation (min/avg/max) = 8.103 | 8.103 | 8.103 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 0 -636.38121 0 -636.38121 -76571.819 - 10 1807.8862 -666.21959 0 -636.54126 -150571.49 - 20 1932.4467 -668.2581 0 -636.53498 -120223.52 - 30 1951.3652 -668.58139 0 -636.54771 -100508.4 - 40 2172.5974 -672.22715 0 -636.5617 -110753.34 - 50 2056.9149 -670.33108 0 -636.56468 -105418.07 - 60 1947.9564 -668.52788 0 -636.55015 -111413.04 - 70 1994.7712 -669.28849 0 -636.54225 -109645.76 - 80 2126.0903 -671.43755 0 -636.53557 -97475.831 - 90 2065.755 -670.4349 0 -636.52338 -95858.837 - 100 2051.4553 -670.20799 0 -636.53122 -107068.9 -Loop time of 0.0545483 on 1 procs for 100 steps with 128 atoms - -Performance: 158.392 ns/day, 0.152 hours/ns, 1833.239 timesteps/s -99.4% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.050821 | 0.050821 | 0.050821 | 0.0 | 93.17 -Neigh | 0.0026484 | 0.0026484 | 0.0026484 | 0.0 | 4.86 -Comm | 0.0006423 | 0.0006423 | 0.0006423 | 0.0 | 1.18 -Output | 0.00011492 | 0.00011492 | 0.00011492 | 0.0 | 0.21 -Modify | 0.00021195 | 0.00021195 | 0.00021195 | 0.0 | 0.39 -Other | | 0.0001101 | | | 0.20 - -Nlocal: 128 ave 128 max 128 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 543 ave 543 max 543 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 1526 ave 1526 max 1526 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 3052 ave 3052 max 3052 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 3052 -Ave neighs/atom = 23.8438 -Neighbor list builds = 10 -Dangerous builds = 10 -Total wall time: 0:00:00 diff --git a/examples/meam/log.27Nov18.meam.g++.4 b/examples/meam/log.27Nov18.meam.g++.4 deleted file mode 100644 index d02591e122..0000000000 --- a/examples/meam/log.27Nov18.meam.g++.4 +++ /dev/null @@ -1,96 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# Test of MEAM potential for SiC system - -units metal -boundary p p p - -atom_style atomic - -read_data data.meam - orthogonal box = (-6 -6 -6) to (5.97232 5.97232 5.97232) - 1 by 2 by 2 MPI processor grid - reading atoms ... - 128 atoms - -pair_style meam -WARNING: THE pair_style meam COMMAND IS OBSOLETE AND WILL BE REMOVED VERY SOON. PLEASE USE meam/c (src/MEAM/pair_meam.cpp:51) -pair_coeff * * library.meam Si C SiC.meam Si C -Reading potential file library.meam with DATE: 2012-06-29 -Reading potential file SiC.meam with DATE: 2007-06-11 - -neighbor 0.3 bin -neigh_modify delay 10 - -fix 1 all nve -thermo 10 -timestep 0.001 - -#dump 1 all atom 50 dump.meam - -#dump 2 all image 10 image.*.jpg element element # axes yes 0.8 0.02 view 60 -30 -#dump_modify 2 pad 3 element Si C - -#dump 3 all movie 10 movie.mpg element element # axes yes 0.8 0.02 view 60 -30 -#dump_modify 3 pad 3 element Si C - -run 100 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.3 - ghost atom cutoff = 4.3 - binsize = 2.15, bins = 6 6 6 - 2 neighbor lists, perpetual/occasional/extra = 2 0 0 - (1) pair meam, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard - (2) pair meam, perpetual, half/full from (1) - attributes: half, newton on - pair build: halffull/newton - stencil: none - bin: none -Per MPI rank memory allocation (min/avg/max) = 8.024 | 8.026 | 8.027 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 0 -636.38121 0 -636.38121 -76571.819 - 10 1807.8862 -666.21959 0 -636.54126 -150571.49 - 20 1932.4467 -668.2581 0 -636.53498 -120223.52 - 30 1951.3652 -668.58139 0 -636.54771 -100508.4 - 40 2172.5974 -672.22715 0 -636.5617 -110753.34 - 50 2056.9149 -670.33108 0 -636.56468 -105418.07 - 60 1947.9564 -668.52788 0 -636.55015 -111413.04 - 70 1994.7712 -669.28849 0 -636.54225 -109645.76 - 80 2126.0903 -671.43755 0 -636.53557 -97475.831 - 90 2065.755 -670.4349 0 -636.52338 -95858.837 - 100 2051.4553 -670.20799 0 -636.53122 -107068.9 -Loop time of 0.023721 on 4 procs for 100 steps with 128 atoms - -Performance: 364.234 ns/day, 0.066 hours/ns, 4215.667 timesteps/s -95.5% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.019888 | 0.020242 | 0.020626 | 0.2 | 85.33 -Neigh | 0.00071859 | 0.00076133 | 0.00082922 | 0.0 | 3.21 -Comm | 0.0019681 | 0.0022618 | 0.002651 | 0.5 | 9.53 -Output | 0.00018048 | 0.0002225 | 0.00034213 | 0.0 | 0.94 -Modify | 8.2016e-05 | 8.6308e-05 | 9.203e-05 | 0.0 | 0.36 -Other | | 0.000147 | | | 0.62 - -Nlocal: 32 ave 36 max 30 min -Histogram: 1 2 0 0 0 0 0 0 0 1 -Nghost: 293.75 ave 305 max 285 min -Histogram: 2 0 0 0 0 0 0 1 0 1 -Neighs: 381.5 ave 413 max 334 min -Histogram: 1 0 0 0 1 0 0 0 0 2 -FullNghs: 763 ave 866 max 678 min -Histogram: 1 0 1 0 0 1 0 0 0 1 - -Total # of neighbors = 3052 -Ave neighs/atom = 23.8438 -Neighbor list builds = 10 -Dangerous builds = 10 -Total wall time: 0:00:00 diff --git a/examples/meam/log.27Nov18.meam.shear.g++.1 b/examples/meam/log.27Nov18.meam.shear.g++.1 deleted file mode 100644 index 8eab38bc70..0000000000 --- a/examples/meam/log.27Nov18.meam.shear.g++.1 +++ /dev/null @@ -1,209 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# 3d metal shear simulation - -units metal -boundary s s p - -atom_style atomic -lattice fcc 3.52 -Lattice spacing in x,y,z = 3.52 3.52 3.52 -region box block 0 16.0 0 10.0 0 2.828427 -create_box 3 box -Created orthogonal box = (0 0 0) to (56.32 35.2 9.95606) - 1 by 1 by 1 MPI processor grid - -lattice fcc 3.52 orient x 1 0 0 orient y 0 1 1 orient z 0 -1 1 origin 0.5 0 0 -Lattice spacing in x,y,z = 3.52 4.97803 4.97803 -create_atoms 1 box -Created 1912 atoms - Time spent = 0.0007267 secs - -pair_style meam -WARNING: THE pair_style meam COMMAND IS OBSOLETE AND WILL BE REMOVED VERY SOON. PLEASE USE meam/c (src/MEAM/pair_meam.cpp:51) -pair_coeff * * library.meam Ni4 Ni.meam Ni4 Ni4 Ni4 -Reading potential file library.meam with DATE: 2012-06-29 -Reading potential file Ni.meam with DATE: 2007-06-11 - -neighbor 0.3 bin -neigh_modify delay 5 - -region lower block INF INF INF 0.9 INF INF -region upper block INF INF 6.1 INF INF INF -group lower region lower -264 atoms in group lower -group upper region upper -264 atoms in group upper -group boundary union lower upper -528 atoms in group boundary -group mobile subtract all boundary -1384 atoms in group mobile - -set group lower type 2 - 264 settings made for type -set group upper type 3 - 264 settings made for type - -# void - -#region void cylinder z 8 5 2.5 INF INF -#delete_atoms region void - -# temp controllers - -compute new3d mobile temp -compute new2d mobile temp/partial 0 1 1 - -# equilibrate - -velocity mobile create 300.0 5812775 temp new3d -fix 1 all nve -fix 2 boundary setforce 0.0 0.0 0.0 - -fix 3 mobile temp/rescale 10 300.0 300.0 10.0 1.0 -fix_modify 3 temp new3d - -thermo 25 -thermo_modify temp new3d -WARNING: Temperature for thermo pressure is not for group all (src/thermo.cpp:488) - -timestep 0.001 -run 100 -Neighbor list info ... - update every 1 steps, delay 5 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.3 - ghost atom cutoff = 4.3 - binsize = 2.15, bins = 27 17 5 - 2 neighbor lists, perpetual/occasional/extra = 2 0 0 - (1) pair meam, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard - (2) pair meam, perpetual, half/full from (1) - attributes: half, newton on - pair build: halffull/newton - stencil: none - bin: none -Per MPI rank memory allocation (min/avg/max) = 9.788 | 9.788 | 9.788 Mbytes -Step Temp E_pair E_mol TotEng Press Volume - 0 300 -8232.7767 0 -8179.1466 1386.6643 19547.02 - 25 222.78953 -8188.1215 0 -8148.2941 9095.9008 19547.02 - 50 300 -8149.7654 0 -8096.1353 10633.141 19684.382 - 75 304.80657 -8163.4557 0 -8108.9665 7045.457 19759.745 - 100 300 -8173.6884 0 -8120.0584 5952.521 19886.589 -Loop time of 0.894544 on 1 procs for 100 steps with 1912 atoms - -Performance: 9.659 ns/day, 2.485 hours/ns, 111.789 timesteps/s -99.4% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.87012 | 0.87012 | 0.87012 | 0.0 | 97.27 -Neigh | 0.01798 | 0.01798 | 0.01798 | 0.0 | 2.01 -Comm | 0.0016143 | 0.0016143 | 0.0016143 | 0.0 | 0.18 -Output | 0.00011492 | 0.00011492 | 0.00011492 | 0.0 | 0.01 -Modify | 0.0035381 | 0.0035381 | 0.0035381 | 0.0 | 0.40 -Other | | 0.001176 | | | 0.13 - -Nlocal: 1912 ave 1912 max 1912 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1672 ave 1672 max 1672 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 23806 ave 23806 max 23806 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 47612 ave 47612 max 47612 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 47612 -Ave neighs/atom = 24.9017 -Neighbor list builds = 5 -Dangerous builds = 0 - -# shear - -velocity upper set 1.0 0 0 -velocity mobile ramp vx 0.0 1.0 y 1.4 8.6 sum yes - -unfix 3 -fix 3 mobile temp/rescale 10 300.0 300.0 10.0 1.0 -fix_modify 3 temp new2d - -#dump 1 all atom 500 dump.meam.shear - -#dump 2 all image 100 image.*.jpg type type # axes yes 0.8 0.02 view 0 0 zoom 1.5 up 0 1 0 adiam 2.0 -#dump_modify 2 pad 4 - -#dump 3 all movie 100 movie.mpg type type # axes yes 0.8 0.02 view 0 0 zoom 1.5 up 0 1 0 adiam 2.0 -#dump_modify 3 pad 4 - -thermo 100 -thermo_modify temp new2d -WARNING: Temperature for thermo pressure is not for group all (src/thermo.cpp:488) - -reset_timestep 0 -run 3000 -Per MPI rank memory allocation (min/avg/max) = 9.964 | 9.964 | 9.964 Mbytes -Step Temp E_pair E_mol TotEng Press Volume - 0 300.39988 -8173.6884 0 -8137.8874 4992.9811 19894.297 - 100 292.06374 -8177.7096 0 -8142.9021 2568.3762 19871.53 - 200 306.69894 -8177.1357 0 -8140.584 874.24259 20047.24 - 300 295.68229 -8172.9213 0 -8137.6825 -1049.0836 20091.759 - 400 308.99958 -8169.6355 0 -8132.8096 -1785.9335 20121.698 - 500 303.85723 -8163.984 0 -8127.7709 -150.56268 20183.813 - 600 300 -8157.7632 0 -8122.0099 1492.5742 20279.887 - 700 300 -8148.1328 0 -8112.3794 3506.9234 20435.302 - 800 300 -8139.1821 0 -8103.4288 3628.3957 20509.519 - 900 305.03425 -8126.7734 0 -8090.4201 5316.2206 20638.992 - 1000 304.00321 -8112.1616 0 -8075.9311 7441.9638 20767.243 - 1100 304.14041 -8096.5041 0 -8060.2573 9646.6972 20888.167 - 1200 302.78454 -8080.5931 0 -8044.5079 11516.208 20995.917 - 1300 308.67064 -8061.6724 0 -8024.8857 11496.471 21130.013 - 1400 309.82994 -8046.27 0 -8009.3451 12926.819 21247.271 - 1500 300 -8035.0317 0 -7999.2784 15346.797 21370.637 - 1600 300 -8030.6636 0 -7994.9102 14803.43 21496.446 - 1700 300 -8024.4819 0 -7988.7286 13175.257 21611.262 - 1800 300 -8022.8531 0 -7987.0998 10315.63 21743.178 - 1900 300 -8028.4095 0 -7992.6561 6882.0635 21855.551 - 2000 300 -8036.9005 0 -8001.1472 3508.9237 21983.802 - 2100 300 -8037.8224 0 -8002.0691 2724.0594 22112.054 - 2200 306.93248 -8035.3297 0 -7998.7501 4400.6008 22228.091 - 2300 306.24125 -8036.748 0 -8000.2508 6075.0546 22352.678 - 2400 300 -8038.8534 0 -8003.1 8701.8498 22465.051 - 2500 308.34129 -8034.0796 0 -7997.3322 10977.68 22600.632 - 2600 299.70072 -8028.8815 0 -7993.1638 15468.97 22715.447 - 2700 298.78276 -8019.1655 0 -7983.5572 18076.132 22844.921 - 2800 305.57845 -8014.3542 0 -7977.936 17573.035 22962.179 - 2900 300 -8015.7677 0 -7980.0144 13461.463 23087.988 - 3000 300 -8010.5908 0 -7974.8375 9333.4855 23199.139 -Loop time of 29.4592 on 1 procs for 3000 steps with 1912 atoms - -Performance: 8.799 ns/day, 2.728 hours/ns, 101.836 timesteps/s -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 28.489 | 28.489 | 28.489 | 0.0 | 96.71 -Neigh | 0.77356 | 0.77356 | 0.77356 | 0.0 | 2.63 -Comm | 0.052517 | 0.052517 | 0.052517 | 0.0 | 0.18 -Output | 0.00095224 | 0.00095224 | 0.00095224 | 0.0 | 0.00 -Modify | 0.10813 | 0.10813 | 0.10813 | 0.0 | 0.37 -Other | | 0.03525 | | | 0.12 - -Nlocal: 1912 ave 1912 max 1912 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1668 ave 1668 max 1668 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 23391 ave 23391 max 23391 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 46782 ave 46782 max 46782 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 46782 -Ave neighs/atom = 24.4676 -Neighbor list builds = 219 -Dangerous builds = 0 -Total wall time: 0:00:30 diff --git a/examples/meam/log.27Nov18.meam.shear.g++.4 b/examples/meam/log.27Nov18.meam.shear.g++.4 deleted file mode 100644 index 708e470925..0000000000 --- a/examples/meam/log.27Nov18.meam.shear.g++.4 +++ /dev/null @@ -1,209 +0,0 @@ -LAMMPS (27 Nov 2018) - using 1 OpenMP thread(s) per MPI task -# 3d metal shear simulation - -units metal -boundary s s p - -atom_style atomic -lattice fcc 3.52 -Lattice spacing in x,y,z = 3.52 3.52 3.52 -region box block 0 16.0 0 10.0 0 2.828427 -create_box 3 box -Created orthogonal box = (0 0 0) to (56.32 35.2 9.95606) - 2 by 2 by 1 MPI processor grid - -lattice fcc 3.52 orient x 1 0 0 orient y 0 1 1 orient z 0 -1 1 origin 0.5 0 0 -Lattice spacing in x,y,z = 3.52 4.97803 4.97803 -create_atoms 1 box -Created 1912 atoms - Time spent = 0.000408649 secs - -pair_style meam -WARNING: THE pair_style meam COMMAND IS OBSOLETE AND WILL BE REMOVED VERY SOON. PLEASE USE meam/c (src/MEAM/pair_meam.cpp:51) -pair_coeff * * library.meam Ni4 Ni.meam Ni4 Ni4 Ni4 -Reading potential file library.meam with DATE: 2012-06-29 -Reading potential file Ni.meam with DATE: 2007-06-11 - -neighbor 0.3 bin -neigh_modify delay 5 - -region lower block INF INF INF 0.9 INF INF -region upper block INF INF 6.1 INF INF INF -group lower region lower -264 atoms in group lower -group upper region upper -264 atoms in group upper -group boundary union lower upper -528 atoms in group boundary -group mobile subtract all boundary -1384 atoms in group mobile - -set group lower type 2 - 264 settings made for type -set group upper type 3 - 264 settings made for type - -# void - -#region void cylinder z 8 5 2.5 INF INF -#delete_atoms region void - -# temp controllers - -compute new3d mobile temp -compute new2d mobile temp/partial 0 1 1 - -# equilibrate - -velocity mobile create 300.0 5812775 temp new3d -fix 1 all nve -fix 2 boundary setforce 0.0 0.0 0.0 - -fix 3 mobile temp/rescale 10 300.0 300.0 10.0 1.0 -fix_modify 3 temp new3d - -thermo 25 -thermo_modify temp new3d -WARNING: Temperature for thermo pressure is not for group all (src/thermo.cpp:488) - -timestep 0.001 -run 100 -Neighbor list info ... - update every 1 steps, delay 5 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 4.3 - ghost atom cutoff = 4.3 - binsize = 2.15, bins = 27 17 5 - 2 neighbor lists, perpetual/occasional/extra = 2 0 0 - (1) pair meam, perpetual - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard - (2) pair meam, perpetual, half/full from (1) - attributes: half, newton on - pair build: halffull/newton - stencil: none - bin: none -Per MPI rank memory allocation (min/avg/max) = 8.954 | 8.957 | 8.959 Mbytes -Step Temp E_pair E_mol TotEng Press Volume - 0 300 -8232.7767 0 -8179.1466 1386.6643 19547.02 - 25 221.59546 -8187.6813 0 -8148.0673 9100.4509 19547.02 - 50 300 -8150.0685 0 -8096.4384 10317.407 19685.743 - 75 307.76021 -8164.6669 0 -8109.6496 6289.7138 19757.814 - 100 300 -8176.5141 0 -8122.884 4162.2559 19873.327 -Loop time of 0.263516 on 4 procs for 100 steps with 1912 atoms - -Performance: 32.787 ns/day, 0.732 hours/ns, 379.483 timesteps/s -98.3% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.24401 | 0.2486 | 0.25128 | 0.6 | 94.34 -Neigh | 0.0046518 | 0.0047416 | 0.0048261 | 0.1 | 1.80 -Comm | 0.0054512 | 0.0082117 | 0.012793 | 3.1 | 3.12 -Output | 0.00010562 | 0.00013095 | 0.00019932 | 0.0 | 0.05 -Modify | 0.0010016 | 0.0010275 | 0.0010595 | 0.1 | 0.39 -Other | | 0.0008045 | | | 0.31 - -Nlocal: 478 ave 492 max 465 min -Histogram: 2 0 0 0 0 0 0 0 1 1 -Nghost: 809 ave 822 max 795 min -Histogram: 1 1 0 0 0 0 0 0 0 2 -Neighs: 5916 ave 6133 max 5658 min -Histogram: 1 0 0 1 0 0 0 0 1 1 -FullNghs: 11832 ave 12277 max 11299 min -Histogram: 1 0 0 1 0 0 0 0 1 1 - -Total # of neighbors = 47328 -Ave neighs/atom = 24.7531 -Neighbor list builds = 5 -Dangerous builds = 0 - -# shear - -velocity upper set 1.0 0 0 -velocity mobile ramp vx 0.0 1.0 y 1.4 8.6 sum yes - -unfix 3 -fix 3 mobile temp/rescale 10 300.0 300.0 10.0 1.0 -fix_modify 3 temp new2d - -#dump 1 all atom 500 dump.meam.shear - -#dump 2 all image 100 image.*.jpg type type # axes yes 0.8 0.02 view 0 0 zoom 1.5 up 0 1 0 adiam 2.0 -#dump_modify 2 pad 4 - -#dump 3 all movie 100 movie.mpg type type # axes yes 0.8 0.02 view 0 0 zoom 1.5 up 0 1 0 adiam 2.0 -#dump_modify 3 pad 4 - -thermo 100 -thermo_modify temp new2d -WARNING: Temperature for thermo pressure is not for group all (src/thermo.cpp:488) - -reset_timestep 0 -run 3000 -Per MPI rank memory allocation (min/avg/max) = 8.999 | 9.002 | 9.005 Mbytes -Step Temp E_pair E_mol TotEng Press Volume - 0 295.32113 -8176.5141 0 -8141.3183 3169.3113 19886.93 - 100 292.00251 -8176.5358 0 -8141.7356 -825.04802 19918.765 - 200 306.11682 -8176.7719 0 -8140.2895 -1370.6886 19948.877 - 300 300 -8172.6262 0 -8136.8729 -1735.9765 20085.714 - 400 306.88489 -8168.435 0 -8131.8611 -933.02058 20117.012 - 500 308.99003 -8166.2906 0 -8129.4658 -1049.3138 20198.256 - 600 304.23435 -8158.0946 0 -8121.8366 583.93595 20328.848 - 700 296.44479 -8149.7914 0 -8114.4618 1985.4155 20421.046 - 800 307.75738 -8139.1649 0 -8102.487 4319.078 20513.183 - 900 304.61422 -8126.9246 0 -8090.6214 6654.0962 20640.213 - 1000 300 -8113.8464 0 -8078.0931 7760.1237 20768.465 - 1100 300.17873 -8097.7469 0 -8061.9722 8438.1259 20874.731 - 1200 306.01441 -8083.3367 0 -8046.8665 10835.588 20994.432 - 1300 300 -8067.022 0 -8031.2687 11216.061 21126.348 - 1400 300 -8053.223 0 -8017.4696 10570.211 21253.378 - 1500 300 -8043.4848 0 -8007.7314 11360.762 21375.523 - 1600 300 -8034.6201 0 -7998.8667 11371.282 21498.889 - 1700 300 -8028.6797 0 -7992.9263 9596.8454 21613.705 - 1800 300 -8033.0802 0 -7997.3268 8767.8176 21743.178 - 1900 303.23288 -8035.1821 0 -7999.0434 8065.2879 21859.215 - 2000 300 -8025.0795 0 -7989.3262 9321.8098 21980.138 - 2100 300 -8041.3621 0 -8005.6088 6674.2623 22108.39 - 2200 300 -8039.7261 0 -8003.9727 7548.8847 22225.648 - 2300 300 -8052.3497 0 -8016.5964 8936.4935 22352.678 - 2400 300 -8049.395 0 -8013.6416 12633.909 22476.044 - 2500 308.48099 -8039.9448 0 -8003.1807 16242.081 22593.303 - 2600 300 -8032.1953 0 -7996.442 18386.669 22722.776 - 2700 303.49413 -8027.6563 0 -7991.4865 14415.581 22829.042 - 2800 304.13476 -8017.3394 0 -7981.0933 7457.1076 22953.629 - 2900 300 -8010.3658 0 -7974.6124 2815.5155 23074.552 - 3000 309.49253 -7999.74 0 -7962.8553 756.7511 23210.132 -Loop time of 8.57528 on 4 procs for 3000 steps with 1912 atoms - -Performance: 30.226 ns/day, 0.794 hours/ns, 349.843 timesteps/s -98.5% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 8.0046 | 8.0451 | 8.1075 | 1.5 | 93.82 -Neigh | 0.20142 | 0.20699 | 0.21469 | 1.2 | 2.41 -Comm | 0.1972 | 0.2657 | 0.312 | 9.3 | 3.10 -Output | 0.00087762 | 0.0015897 | 0.0037148 | 3.1 | 0.02 -Modify | 0.030267 | 0.031624 | 0.032929 | 0.7 | 0.37 -Other | | 0.02427 | | | 0.28 - -Nlocal: 478 ave 507 max 447 min -Histogram: 1 1 0 0 0 0 0 0 1 1 -Nghost: 799.75 ave 842 max 763 min -Histogram: 2 0 0 0 0 0 0 1 0 1 -Neighs: 5806.5 ave 6097 max 5507 min -Histogram: 1 0 1 0 0 0 0 1 0 1 -FullNghs: 11613 ave 12159 max 11039 min -Histogram: 1 0 1 0 0 0 0 1 0 1 - -Total # of neighbors = 46452 -Ave neighs/atom = 24.295 -Neighbor list builds = 224 -Dangerous builds = 0 -Total wall time: 0:00:08 diff --git a/examples/reax/README b/examples/reax/README index fe9d33df94..e839f0ea99 100644 --- a/examples/reax/README +++ b/examples/reax/README @@ -1,12 +1,8 @@ This directory contains input files for two short ReaxFF simulations (RDX and TATB crystals) using the ReaxFF parameterization developed for nitramines. The parameter file ffield.reax is the same as that in -subdirectory RDX (see below). Input files for both pair_style reax and -pair_style reax/c are provided. - -In addition, each subdirectory contains validated parameter files for -a particular published version of ReaxFF. In all cases, the examples -use pair_style reax/c. +subdirectory RDX (see below). In addition, each subdirectory contains +validated parameter files for a particular published version of ReaxFF. Disclaimer: Using these force fields for systems they have not been explicitly trained against may produce unrealistic results. Please diff --git a/examples/reax/in.reax.rdx b/examples/reax/in.reax.rdx deleted file mode 100644 index 768b8e4546..0000000000 --- a/examples/reax/in.reax.rdx +++ /dev/null @@ -1,52 +0,0 @@ -# ReaxFF potential for RDX system - -units real - -atom_style charge -read_data data.rdx - -# reax args: hbcut hbnewflag tripflag precision - -pair_style reax 6.0 1 1 1.0e-6 -pair_coeff * * ffield.reax 1 2 3 4 - -compute reax all pair reax - -variable eb equal c_reax[1] -variable ea equal c_reax[2] -variable elp equal c_reax[3] -variable emol equal c_reax[4] -variable ev equal c_reax[5] -variable epen equal c_reax[6] -variable ecoa equal c_reax[7] -variable ehb equal c_reax[8] -variable et equal c_reax[9] -variable eco equal c_reax[10] -variable ew equal c_reax[11] -variable ep equal c_reax[12] -variable efi equal c_reax[13] -variable eqeq equal c_reax[14] - -neighbor 2.5 bin -neigh_modify every 10 delay 0 check no - -fix 1 all nve - -thermo 10 -thermo_style custom step temp epair etotal press & - v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb & - v_et v_eco v_ew v_ep v_efi v_eqeq - -timestep 1.0 - -#dump 1 all custom 10 dump.reax.rdx id type q xs ys zs - -#dump 2 all image 25 image.*.jpg type type & -# axes yes 0.8 0.02 view 60 -30 -#dump_modify 2 pad 3 - -#dump 3 all movie 25 movie.mpg type type & -# axes yes 0.8 0.02 view 60 -30 -#dump_modify 3 pad 3 - -run 100 diff --git a/examples/reax/in.reax.tatb b/examples/reax/in.reax.tatb deleted file mode 100644 index a9a4cd9e5e..0000000000 --- a/examples/reax/in.reax.tatb +++ /dev/null @@ -1,53 +0,0 @@ -# ReaxFF potential for TATB system - -units real - -atom_style charge -read_data data.tatb - -# reax args: hbcut hbnewflag tripflag precision -pair_style reax 6.0 1 1 1.0e-6 -pair_coeff * * ffield.reax 1 2 3 4 - -compute reax all pair reax - -variable eb equal c_reax[1] -variable ea equal c_reax[2] -variable elp equal c_reax[3] -variable emol equal c_reax[4] -variable ev equal c_reax[5] -variable epen equal c_reax[6] -variable ecoa equal c_reax[7] -variable ehb equal c_reax[8] -variable et equal c_reax[9] -variable eco equal c_reax[10] -variable ew equal c_reax[11] -variable ep equal c_reax[12] -variable efi equal c_reax[13] -variable eqeq equal c_reax[14] - -neighbor 2.5 bin -neigh_modify delay 0 every 5 check no - -fix 1 all nve - -thermo 5 -thermo_style custom step temp epair etotal press & - v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa & - v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq - -timestep 0.0625 - -#dump 1 all custom 100 dump.reax.tatb id type q x y z - -#dump 2 all image 5 image.*.jpg type type & -# axes yes 0.8 0.02 view 60 -30 -#dump_modify 2 pad 3 - -#dump 3 all movie 5 movie.mpg type type & -# axes yes 0.8 0.02 view 60 -30 -#dump_modify 3 pad 3 - -fix 2 all reax/bonds 25 bonds.reax.tatb - -run 25 diff --git a/examples/reax/log.8March18.reax.rdx.g++.1 b/examples/reax/log.8March18.reax.rdx.g++.1 deleted file mode 100644 index c2edc5d51f..0000000000 --- a/examples/reax/log.8March18.reax.rdx.g++.1 +++ /dev/null @@ -1,107 +0,0 @@ -LAMMPS (8 Mar 2018) - using 1 OpenMP thread(s) per MPI task -# ReaxFF potential for RDX system - -units real - -atom_style charge -read_data data.rdx - orthogonal box = (35 35 35) to (48 48 48) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 21 atoms - -# reax args: hbcut hbnewflag tripflag precision - -pair_style reax 6.0 1 1 1.0e-6 -WARNING: The pair_style reax command is unsupported. Please switch to pair_style reax/c instead (../pair_reax.cpp:49) -pair_coeff * * ffield.reax 1 2 3 4 - -compute reax all pair reax - -variable eb equal c_reax[1] -variable ea equal c_reax[2] -variable elp equal c_reax[3] -variable emol equal c_reax[4] -variable ev equal c_reax[5] -variable epen equal c_reax[6] -variable ecoa equal c_reax[7] -variable ehb equal c_reax[8] -variable et equal c_reax[9] -variable eco equal c_reax[10] -variable ew equal c_reax[11] -variable ep equal c_reax[12] -variable efi equal c_reax[13] -variable eqeq equal c_reax[14] - -neighbor 2.5 bin -neigh_modify every 10 delay 0 check no - -fix 1 all nve - -thermo 10 -thermo_style custom step temp epair etotal press v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq - -timestep 1.0 - -#dump 1 all custom 10 dump.reax.rdx id type q xs ys zs - -#dump 2 all image 25 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 2 pad 3 - -#dump 3 all movie 25 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 3 pad 3 - -run 100 -Neighbor list info ... - update every 10 steps, delay 0 steps, check no - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12.5 - ghost atom cutoff = 12.5 - binsize = 6.25, bins = 3 3 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair reax, perpetual - attributes: half, newton off - pair build: half/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -Per MPI rank memory allocation (min/avg/max) = 3.278 | 3.278 | 3.278 Mbytes -Step Temp E_pair TotEng Press v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq - 0 0 -1885.1269 -1885.1269 27233.074 -2958.4712 79.527715 0.31082031 0 97.771125 25.846176 -0.18034154 0 16.709078 -9.1620736 938.43732 -244.79973 0 168.8842 - 10 1281.7558 -1989.1322 -1912.7188 -19609.913 -2733.8828 -15.775275 0.20055725 0 55.02023 3.1070523 -77.710916 0 14.963568 -5.8082203 843.41939 -180.17724 0 107.5115 - 20 516.83079 -1941.677 -1910.8655 -12525.412 -2801.8626 7.410797 0.073134186 0 81.986983 0.2281551 -57.494871 0 30.656735 -10.102557 877.78695 -158.93385 0 88.574159 - 30 467.26411 -1940.978 -1913.1215 -35957.489 -2755.021 -6.9179958 0.049322453 0 78.853173 0.13604393 -51.653635 0 19.862871 -9.7098575 853.79334 -151.232 0 80.86177 - 40 647.45528 -1951.1994 -1912.6006 -5883.713 -2798.3556 17.334814 0.15102862 0 63.235117 0.18070924 -54.598957 0 17.325007 -12.052278 883.0167 -164.21335 0 96.777424 - 50 716.38088 -1949.4735 -1906.7656 5473.1969 -2800.9309 9.2056861 0.15413274 0 85.371466 3.2986127 -78.253597 0 34.861774 -8.553123 882.01431 -193.85254 0 117.21068 - 60 1175.2705 -1975.961 -1905.8958 -1939.4966 -2726.5816 -11.651996 0.24296786 0 48.320654 7.1799691 -75.363638 0 16.520127 -4.8869441 844.75401 -194.23297 0 119.73841 - 70 1156.701 -1975.3497 -1906.3916 24628.304 -2880.5225 25.652501 0.26894311 0 83.724852 7.1049152 -68.70096 0 24.750735 -8.6338267 911.20079 -183.40562 0 113.21047 - 80 840.23677 -1955.4769 -1905.3851 -17731.334 -2755.7299 -8.0167723 0.1386797 0 86.147417 2.2387319 -76.945843 0 23.595869 -7.260968 853.63487 -167.88288 0 94.603961 - 90 365.79122 -1926.4061 -1904.599 898.38479 -2842.1832 47.368107 0.23109002 0 92.288071 0.38031213 -61.361485 0 18.476336 -12.25546 900.24233 -186.48046 0 116.88827 - 100 801.32158 -1953.418 -1905.6462 -2417.6887 -2802.7247 4.6676477 0.18046575 0 76.729987 5.4177322 -77.102566 0 24.997175 -7.7554074 898.67337 -196.89114 0 120.38946 -Loop time of 0.463306 on 1 procs for 100 steps with 21 atoms - -Performance: 18.649 ns/day, 1.287 hours/ns, 215.840 timesteps/s -99.6% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.46143 | 0.46143 | 0.46143 | 0.0 | 99.60 -Neigh | 0.00087953 | 0.00087953 | 0.00087953 | 0.0 | 0.19 -Comm | 0.00042653 | 0.00042653 | 0.00042653 | 0.0 | 0.09 -Output | 0.00034237 | 0.00034237 | 0.00034237 | 0.0 | 0.07 -Modify | 0.00010109 | 0.00010109 | 0.00010109 | 0.0 | 0.02 -Other | | 0.000124 | | | 0.03 - -Nlocal: 21 ave 21 max 21 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 546 ave 546 max 546 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 1106 ave 1106 max 1106 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 1106 -Ave neighs/atom = 52.6667 -Neighbor list builds = 10 -Dangerous builds not checked -Total wall time: 0:00:00 diff --git a/examples/reax/log.8March18.reax.rdx.g++.4 b/examples/reax/log.8March18.reax.rdx.g++.4 deleted file mode 100644 index 9526e25661..0000000000 --- a/examples/reax/log.8March18.reax.rdx.g++.4 +++ /dev/null @@ -1,107 +0,0 @@ -LAMMPS (8 Mar 2018) - using 1 OpenMP thread(s) per MPI task -# ReaxFF potential for RDX system - -units real - -atom_style charge -read_data data.rdx - orthogonal box = (35 35 35) to (48 48 48) - 1 by 2 by 2 MPI processor grid - reading atoms ... - 21 atoms - -# reax args: hbcut hbnewflag tripflag precision - -pair_style reax 6.0 1 1 1.0e-6 -WARNING: The pair_style reax command is unsupported. Please switch to pair_style reax/c instead (../pair_reax.cpp:49) -pair_coeff * * ffield.reax 1 2 3 4 - -compute reax all pair reax - -variable eb equal c_reax[1] -variable ea equal c_reax[2] -variable elp equal c_reax[3] -variable emol equal c_reax[4] -variable ev equal c_reax[5] -variable epen equal c_reax[6] -variable ecoa equal c_reax[7] -variable ehb equal c_reax[8] -variable et equal c_reax[9] -variable eco equal c_reax[10] -variable ew equal c_reax[11] -variable ep equal c_reax[12] -variable efi equal c_reax[13] -variable eqeq equal c_reax[14] - -neighbor 2.5 bin -neigh_modify every 10 delay 0 check no - -fix 1 all nve - -thermo 10 -thermo_style custom step temp epair etotal press v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq - -timestep 1.0 - -#dump 1 all custom 10 dump.reax.rdx id type q xs ys zs - -#dump 2 all image 25 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 2 pad 3 - -#dump 3 all movie 25 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 3 pad 3 - -run 100 -Neighbor list info ... - update every 10 steps, delay 0 steps, check no - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12.5 - ghost atom cutoff = 12.5 - binsize = 6.25, bins = 3 3 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair reax, perpetual - attributes: half, newton off - pair build: half/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -Per MPI rank memory allocation (min/avg/max) = 3.262 | 3.36 | 3.647 Mbytes -Step Temp E_pair TotEng Press v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq - 0 0 -1885.1268 -1885.1268 27233.074 -2958.4712 79.527715 0.31082031 0 97.771125 25.846176 -0.18034154 0 16.709078 -9.1620736 938.43732 -244.79972 0 168.88428 - 10 1281.7558 -1989.1322 -1912.7187 -19609.913 -2733.8828 -15.775275 0.20055725 0 55.020231 3.1070523 -77.710916 0 14.963568 -5.8082203 843.41939 -180.17724 0 107.51152 - 20 516.83079 -1941.677 -1910.8655 -12525.412 -2801.8626 7.410797 0.073134187 0 81.986983 0.2281551 -57.494871 0 30.656735 -10.102557 877.78695 -158.93385 0 88.574168 - 30 467.26411 -1940.978 -1913.1215 -35957.489 -2755.021 -6.9179959 0.049322449 0 78.853173 0.13604392 -51.653635 0 19.862871 -9.7098575 853.79334 -151.232 0 80.861765 - 40 647.45479 -1951.1995 -1912.6007 -5883.7199 -2798.3556 17.334805 0.15102868 0 63.235116 0.18070946 -54.59897 0 17.32501 -12.052277 883.0166 -164.21339 0 96.777473 - 50 716.37927 -1949.466 -1906.7582 5473.2486 -2800.9309 9.2056758 0.15413278 0 85.37143 3.2986099 -78.253596 0 34.861773 -8.5531243 882.01424 -193.85223 0 117.21791 - 60 1175.2698 -1975.9612 -1905.896 -1939.5206 -2726.5818 -11.651942 0.24296793 0 48.320679 7.1799538 -75.36365 0 16.520134 -4.8869515 844.75405 -194.23289 0 119.7383 - 70 1156.6963 -1975.3494 -1906.3915 24628.423 -2880.5221 25.65242 0.26894312 0 83.724787 7.1049615 -68.700925 0 24.750729 -8.6338123 911.2006 -183.40591 0 113.21091 - 80 840.238 -1955.4788 -1905.387 -17731.371 -2755.7301 -8.0167357 0.13868007 0 86.147246 2.2387405 -76.945868 0 23.595868 -7.2609697 853.6349 -167.88312 0 94.602512 - 90 365.78645 -1926.4072 -1904.6004 898.36945 -2842.1831 47.368307 0.23108998 0 92.288039 0.38031101 -61.361464 0 18.476388 -12.255481 900.24216 -186.48066 0 116.88716 - 100 801.31322 -1953.4165 -1905.6452 -2417.2041 -2802.7247 4.6678077 0.18046498 0 76.730367 5.4176812 -77.102592 0 24.9973 -7.7554425 898.6732 -196.89097 0 120.39043 -Loop time of 0.404551 on 4 procs for 100 steps with 21 atoms - -Performance: 21.357 ns/day, 1.124 hours/ns, 247.188 timesteps/s -97.4% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.2191 | 0.28038 | 0.39839 | 13.2 | 69.31 -Neigh | 5.8651e-05 | 0.00025928 | 0.00062203 | 0.0 | 0.06 -Comm | 0.0046599 | 0.12307 | 0.1845 | 19.9 | 30.42 -Output | 0.00055337 | 0.00062728 | 0.00071192 | 0.0 | 0.16 -Modify | 5.3167e-05 | 7.844e-05 | 0.00010109 | 0.0 | 0.02 -Other | | 0.0001363 | | | 0.03 - -Nlocal: 5.25 ave 15 max 0 min -Histogram: 1 0 2 0 0 0 0 0 0 1 -Nghost: 355.5 ave 432 max 282 min -Histogram: 1 0 0 0 1 1 0 0 0 1 -Neighs: 301.25 ave 827 max 0 min -Histogram: 1 0 2 0 0 0 0 0 0 1 - -Total # of neighbors = 1205 -Ave neighs/atom = 57.381 -Neighbor list builds = 10 -Dangerous builds not checked -Total wall time: 0:00:00 diff --git a/examples/reax/log.8March18.reax.tatb.g++.1 b/examples/reax/log.8March18.reax.tatb.g++.1 deleted file mode 100644 index 53d77cd1da..0000000000 --- a/examples/reax/log.8March18.reax.tatb.g++.1 +++ /dev/null @@ -1,103 +0,0 @@ -LAMMPS (8 Mar 2018) - using 1 OpenMP thread(s) per MPI task -# ReaxFF potential for TATB system - -units real - -atom_style charge -read_data data.tatb - triclinic box = (0 0 0) to (13.624 17.1149 15.1826) with tilt (-5.75316 -6.32547 7.42573) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 384 atoms - -# reax args: hbcut hbnewflag tripflag precision -pair_style reax 6.0 1 1 1.0e-6 -WARNING: The pair_style reax command is unsupported. Please switch to pair_style reax/c instead (../pair_reax.cpp:49) -pair_coeff * * ffield.reax 1 2 3 4 - -compute reax all pair reax - -variable eb equal c_reax[1] -variable ea equal c_reax[2] -variable elp equal c_reax[3] -variable emol equal c_reax[4] -variable ev equal c_reax[5] -variable epen equal c_reax[6] -variable ecoa equal c_reax[7] -variable ehb equal c_reax[8] -variable et equal c_reax[9] -variable eco equal c_reax[10] -variable ew equal c_reax[11] -variable ep equal c_reax[12] -variable efi equal c_reax[13] -variable eqeq equal c_reax[14] - -neighbor 2.5 bin -neigh_modify delay 0 every 5 check no - -fix 1 all nve - -thermo 5 -thermo_style custom step temp epair etotal press v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq - -timestep 0.0625 - -#dump 1 all custom 100 dump.reax.tatb id type q x y z - -#dump 2 all image 5 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 2 pad 3 - -#dump 3 all movie 5 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 3 pad 3 - -fix 2 all reax/bonds 25 bonds.reax.tatb - -run 25 -Neighbor list info ... - update every 5 steps, delay 0 steps, check no - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12.5 - ghost atom cutoff = 12.5 - binsize = 6.25, bins = 5 4 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair reax, perpetual - attributes: half, newton off - pair build: half/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -Per MPI rank memory allocation (min/avg/max) = 7.764 | 7.764 | 7.764 Mbytes -Step Temp E_pair TotEng Press v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq - 0 0 -44767.08 -44767.08 7294.6353 -61120.591 486.4378 4.7236377 0 1568.024 20.788929 -279.51642 -1556.4696 252.57147 -655.84699 18862.412 -8740.6378 0 6391.0231 - 5 0.63682806 -44767.737 -44767.01 8391.5964 -61118.763 486.82916 4.723415 0 1567.835 20.768662 -278.20804 -1557.6962 252.64683 -655.74117 18859.328 -8738.2728 0 6388.8127 - 10 2.4306958 -44769.409 -44766.634 11717.376 -61113.142 487.89093 4.7227063 0 1567.2936 20.705084 -274.37509 -1560.8546 252.87219 -655.43578 18850.19 -8731.0693 0 6381.7942 - 15 5.0590493 -44772.631 -44766.855 17125.067 -61103.34 489.28007 4.7214008 0 1566.4744 20.590604 -268.28962 -1566.5961 252.97781 -654.93836 18835.335 -8719.3013 0 6370.4551 - 20 8.067859 -44775.936 -44766.725 24620.627 -61088.791 490.42346 4.7193467 0 1565.5541 20.415031 -260.38512 -1574.1001 253.39805 -654.26837 18815.312 -8703.3748 0 6355.1614 - 25 10.975538 -44777.233 -44764.702 34381.173 -61068.889 490.53149 4.7164093 0 1566.5715 20.169755 -251.23109 -1582.8552 253.88696 -653.46042 18790.855 -8683.8691 0 6336.3409 -Loop time of 7.80129 on 1 procs for 25 steps with 384 atoms - -Performance: 0.017 ns/day, 1386.896 hours/ns, 3.205 timesteps/s -99.5% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 7.7384 | 7.7384 | 7.7384 | 0.0 | 99.19 -Neigh | 0.058615 | 0.058615 | 0.058615 | 0.0 | 0.75 -Comm | 0.0022428 | 0.0022428 | 0.0022428 | 0.0 | 0.03 -Output | 0.00033212 | 0.00033212 | 0.00033212 | 0.0 | 0.00 -Modify | 0.0013618 | 0.0013618 | 0.0013618 | 0.0 | 0.02 -Other | | 0.0003309 | | | 0.00 - -Nlocal: 384 ave 384 max 384 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 7559 ave 7559 max 7559 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 286828 ave 286828 max 286828 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 286828 -Ave neighs/atom = 746.948 -Neighbor list builds = 5 -Dangerous builds not checked -Total wall time: 0:00:08 diff --git a/examples/reax/log.8March18.reax.tatb.g++.4 b/examples/reax/log.8March18.reax.tatb.g++.4 deleted file mode 100644 index e3acac9d0e..0000000000 --- a/examples/reax/log.8March18.reax.tatb.g++.4 +++ /dev/null @@ -1,103 +0,0 @@ -LAMMPS (8 Mar 2018) - using 1 OpenMP thread(s) per MPI task -# ReaxFF potential for TATB system - -units real - -atom_style charge -read_data data.tatb - triclinic box = (0 0 0) to (13.624 17.1149 15.1826) with tilt (-5.75316 -6.32547 7.42573) - 1 by 2 by 2 MPI processor grid - reading atoms ... - 384 atoms - -# reax args: hbcut hbnewflag tripflag precision -pair_style reax 6.0 1 1 1.0e-6 -WARNING: The pair_style reax command is unsupported. Please switch to pair_style reax/c instead (../pair_reax.cpp:49) -pair_coeff * * ffield.reax 1 2 3 4 - -compute reax all pair reax - -variable eb equal c_reax[1] -variable ea equal c_reax[2] -variable elp equal c_reax[3] -variable emol equal c_reax[4] -variable ev equal c_reax[5] -variable epen equal c_reax[6] -variable ecoa equal c_reax[7] -variable ehb equal c_reax[8] -variable et equal c_reax[9] -variable eco equal c_reax[10] -variable ew equal c_reax[11] -variable ep equal c_reax[12] -variable efi equal c_reax[13] -variable eqeq equal c_reax[14] - -neighbor 2.5 bin -neigh_modify delay 0 every 5 check no - -fix 1 all nve - -thermo 5 -thermo_style custom step temp epair etotal press v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq - -timestep 0.0625 - -#dump 1 all custom 100 dump.reax.tatb id type q x y z - -#dump 2 all image 5 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 2 pad 3 - -#dump 3 all movie 5 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 -#dump_modify 3 pad 3 - -fix 2 all reax/bonds 25 bonds.reax.tatb - -run 25 -Neighbor list info ... - update every 5 steps, delay 0 steps, check no - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12.5 - ghost atom cutoff = 12.5 - binsize = 6.25, bins = 5 4 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair reax, perpetual - attributes: half, newton off - pair build: half/bin/newtoff - stencil: half/bin/3d/newtoff - bin: standard -Per MPI rank memory allocation (min/avg/max) = 4.402 | 4.402 | 4.402 Mbytes -Step Temp E_pair TotEng Press v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq - 0 0 -44767.08 -44767.08 7294.6353 -61120.591 486.4378 4.7236377 0 1568.024 20.788929 -279.51642 -1556.4696 252.57147 -655.84699 18862.412 -8740.6378 0 6391.0231 - 5 0.63682727 -44767.816 -44767.089 8391.1708 -61118.763 486.82916 4.723415 0 1567.835 20.768662 -278.20804 -1557.6962 252.64683 -655.74117 18859.328 -8738.3973 0 6388.8581 - 10 2.4306941 -44769.405 -44766.63 11717.306 -61113.142 487.89094 4.7227063 0 1567.2936 20.705084 -274.3751 -1560.8546 252.87219 -655.43578 18850.19 -8731.08 0 6381.8083 - 15 5.0590444 -44772.6 -44766.824 17125.207 -61103.34 489.28008 4.7214008 0 1566.4744 20.590604 -268.28963 -1566.5961 252.97781 -654.93836 18835.335 -8719.2653 0 6370.4505 - 20 8.0678523 -44775.983 -44766.772 24620.114 -61088.791 490.42348 4.7193467 0 1565.5541 20.415031 -260.38513 -1574.1001 253.39804 -654.26837 18815.312 -8703.5228 0 6355.2629 - 25 10.975532 -44777.234 -44764.704 34381.065 -61068.889 490.53151 4.7164093 0 1566.5715 20.169755 -251.23111 -1582.8552 253.88696 -653.46042 18790.855 -8683.898 0 6336.3682 -Loop time of 3.74388 on 4 procs for 25 steps with 384 atoms - -Performance: 0.036 ns/day, 665.579 hours/ns, 6.678 timesteps/s -98.7% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 3.478 | 3.6025 | 3.7215 | 4.8 | 96.22 -Neigh | 0.012731 | 0.01299 | 0.013174 | 0.2 | 0.35 -Comm | 0.0073411 | 0.12653 | 0.25119 | 25.4 | 3.38 -Output | 0.00050354 | 0.00081849 | 0.0011628 | 0.0 | 0.02 -Modify | 0.00049281 | 0.00082356 | 0.001157 | 0.0 | 0.02 -Other | | 0.0002663 | | | 0.01 - -Nlocal: 96 ave 96 max 96 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Nghost: 5118 ave 5118 max 5118 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Neighs: 79754 ave 79754 max 79754 min -Histogram: 4 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 319016 -Ave neighs/atom = 830.771 -Neighbor list builds = 5 -Dangerous builds not checked -Total wall time: 0:00:03 From 30017697e39e2268b8489d975d04779b23f64c2e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 15:20:39 -0500 Subject: [PATCH 35/94] update src/.gitignore and src/Purge.list for removed styles --- src/.gitignore | 5 ----- src/Purge.list | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/.gitignore b/src/.gitignore index acba20b79d..3051c613f8 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -565,8 +565,6 @@ /fix_qeq_reax.h /fix_qmmm.cpp /fix_qmmm.h -/fix_reax_bonds.cpp -/fix_reax_bonds.h /fix_reaxc.cpp /fix_reaxc.h /fix_reaxc_bonds.cpp @@ -898,9 +896,6 @@ /pair_peri_ves.h /pair_quip.cpp /pair_quip.h -/pair_reax.cpp -/pair_reax.h -/pair_reax_fortran.h /pair_reaxc.cpp /pair_reaxc.h /pair_rebo.cpp diff --git a/src/Purge.list b/src/Purge.list index 6cfc580c25..6cd8276419 100644 --- a/src/Purge.list +++ b/src/Purge.list @@ -24,6 +24,14 @@ style_nstencil.h style_ntopo.h # other auto-generated files lmpinstalledpkgs.h +# removed on 12 December 2018 +pair_reax.cpp +pair_reax.h +pair_reax_fortran.h +fix_bond_reax.cpp +fix_bond_reax.h +pair_meam.cpp +pair_meam.h # renamed on 25 September 2018 compute_smd_triangle_mesh_vertices.h compute_smd_triangle_mesh_vertices.cpp From 70868ca070d63decc902298c58587f4c907b87bf Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 15:31:38 -0500 Subject: [PATCH 36/94] remove extra line from PDF manual config --- doc/src/lammps.book | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/src/lammps.book b/doc/src/lammps.book index e38aefce5f..d752d2a929 100644 --- a/doc/src/lammps.book +++ b/doc/src/lammps.book @@ -617,7 +617,6 @@ pair_peri.html pair_polymorphic.html pair_python.html pair_quip.html -pair_reax.html pair_reaxc.html pair_resquared.html pair_sdk.html From 264dd59c75680fbe49d6ca5929249beee25e0298 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Dec 2018 17:58:42 -0500 Subject: [PATCH 37/94] also output integer sizes and the corresponding define with lmp -h --- src/lammps.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lammps.cpp b/src/lammps.cpp index 894239924d..6c5f937c8a 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -1088,6 +1088,18 @@ void LAMMPS::print_config(FILE *fp) if (Info::has_jpeg_support()) fputs("-DLAMMPS_JPEG\n",fp); if (Info::has_ffmpeg_support()) fputs("-DLAMMPS_FFMPEG\n",fp); if (Info::has_exceptions()) fputs("-DLAMMPS_EXCEPTIONS\n",fp); +#if defined(LAMMPS_BIGBIG) + fputs("-DLAMMPS_BIGBIG\n",fp); +#elif defined(LAMMPS_SMALLBIG) + fputs("-DLAMMPS_SMALLBIG\n",fp); +#else // defined(LAMMPS_SMALLSMALL) + fputs("-DLAMMPS_SMALLSMALL\n",fp); +#endif + fprintf(fp,"\nsizeof(smallint): %3d-bit\n",(int)sizeof(smallint)*8); + fprintf(fp,"sizeof(imageint): %3d-bit\n",(int)sizeof(imageint)*8); + fprintf(fp,"sizeof(tagint): %3d-bit\n",(int)sizeof(tagint)*8); + fprintf(fp,"sizeof(bigint): %3d-bit\n",(int)sizeof(bigint)*8); + fputs("\nInstalled packages:\n\n",fp); for (int i = 0; NULL != (pkg = installed_packages[i]); ++i) { From eeaeab083293df853de9230e5271452996278692 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 Dec 2018 05:31:12 -0500 Subject: [PATCH 38/94] add example for using fix controller with a moving wall to adjust pressure --- .../{in.controller => in.controller.temp} | 0 ...++.1 => log.27Nov18.controller.temp.g++.1} | 0 ...++.4 => log.27Nov18.controller.temp.g++.4} | 0 .../log.27Nov18.controller.wall.g++.1 | 142 ++++++++++++++++++ .../log.27Nov18.controller.wall.g++.2 | 142 ++++++++++++++++++ 5 files changed, 284 insertions(+) rename examples/controller/{in.controller => in.controller.temp} (100%) rename examples/controller/{log.27Nov18.controller.g++.1 => log.27Nov18.controller.temp.g++.1} (100%) rename examples/controller/{log.27Nov18.controller.g++.4 => log.27Nov18.controller.temp.g++.4} (100%) create mode 100644 examples/controller/log.27Nov18.controller.wall.g++.1 create mode 100644 examples/controller/log.27Nov18.controller.wall.g++.2 diff --git a/examples/controller/in.controller b/examples/controller/in.controller.temp similarity index 100% rename from examples/controller/in.controller rename to examples/controller/in.controller.temp diff --git a/examples/controller/log.27Nov18.controller.g++.1 b/examples/controller/log.27Nov18.controller.temp.g++.1 similarity index 100% rename from examples/controller/log.27Nov18.controller.g++.1 rename to examples/controller/log.27Nov18.controller.temp.g++.1 diff --git a/examples/controller/log.27Nov18.controller.g++.4 b/examples/controller/log.27Nov18.controller.temp.g++.4 similarity index 100% rename from examples/controller/log.27Nov18.controller.g++.4 rename to examples/controller/log.27Nov18.controller.temp.g++.4 diff --git a/examples/controller/log.27Nov18.controller.wall.g++.1 b/examples/controller/log.27Nov18.controller.wall.g++.1 new file mode 100644 index 0000000000..ac660f2fdb --- /dev/null +++ b/examples/controller/log.27Nov18.controller.wall.g++.1 @@ -0,0 +1,142 @@ +LAMMPS (27 Nov 2018) + using 1 OpenMP thread(s) per MPI task +# 3d Lennard-Jones melt, thermostatted by fix controller + +units lj +atom_style atomic +boundary p p m +processors * * 1 +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 +region box block 0 10 0 10 -4 14 +region slab block 0 10 0 10 0 10 +create_box 1 box +Created orthogonal box = (0 0 -6.71838) to (16.796 16.796 23.5143) + 1 by 1 by 1 MPI processor grid +create_atoms 1 region slab +Created 4200 atoms + Time spent = 0.000752687 secs +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 2 every 2 check yes + +fix 1 all nve +fix 3 all langevin 1.5 1.5 0.5 412513 + +variable zhi internal $(10.5*zlat) +variable zhi internal 17.635760009516324942 +variable kwall equal 20.0 +fix 2 all wall/harmonic zlo -0.5 ${kwall} 0.0 2.5 zhi v_zhi ${kwall} 0.0 2.5 +fix 2 all wall/harmonic zlo -0.5 20 0.0 2.5 zhi v_zhi ${kwall} 0.0 2.5 +fix 2 all wall/harmonic zlo -0.5 20 0.0 2.5 zhi v_zhi 20 0.0 2.5 + +variable pzz equal pzz +fix ave all ave/time 10 10 100 v_pzz +# equilibrate + +thermo_style custom step temp pxx pyy pzz f_ave v_zhi +thermo 500 +run 2500 +Neighbor list info ... + update every 2 steps, delay 2 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 12 12 22 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.639 | 3.639 | 3.639 Mbytes +Step Temp Pxx Pyy Pzz f_ave v_zhi + 0 1.44 -2.8234811 -2.8425184 -2.7022745 0 17.63576 + 500 1.4850596 3.1161377 2.9246345 2.9122136 2.9795403 17.63576 + 1000 1.4706875 2.4918963 2.4698964 2.3538419 2.5181301 17.63576 + 1500 1.4978967 1.9196563 2.0442863 1.978316 1.9215971 17.63576 + 2000 1.4738152 1.6424128 1.5875245 1.7098788 1.6222172 17.63576 + 2500 1.5012535 1.3324666 1.3078613 1.30772 1.3830807 17.63576 +Loop time of 9.88972 on 1 procs for 2500 steps with 4200 atoms + +Performance: 109204.308 tau/day, 252.788 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 5.9583 | 5.9583 | 5.9583 | 0.0 | 60.25 +Neigh | 3.0444 | 3.0444 | 3.0444 | 0.0 | 30.78 +Comm | 0.095146 | 0.095146 | 0.095146 | 0.0 | 0.96 +Output | 0.00018764 | 0.00018764 | 0.00018764 | 0.0 | 0.00 +Modify | 0.73726 | 0.73726 | 0.73726 | 0.0 | 7.45 +Other | | 0.05447 | | | 0.55 + +Nlocal: 4200 ave 4200 max 4200 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 3278 ave 3278 max 3278 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 125488 ave 125488 max 125488 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 125488 +Ave neighs/atom = 29.8781 +Neighbor list builds = 414 +Dangerous builds = 0 + +# use time averaged pressure for control +#fix 10 all controller 100 -0.05 20.0 0.0 0.0 f_ave 1.5 zhi + +# use instantaneous pressure for control +fix 10 all controller 100 -0.05 50.0 0.0 0.0 v_pzz 1.5 zhi + +# run with controller + +run 5000 +Per MPI rank memory allocation (min/avg/max) = 3.645 | 3.645 | 3.645 Mbytes +Step Temp Pxx Pyy Pzz f_ave v_zhi + 2500 1.5012535 1.332723 1.3081129 1.3079716 1.3830807 17.63576 + 3000 1.4976659 1.2148748 1.2873541 1.4929784 1.337029 17.052206 + 3500 1.5099561 1.2602054 1.2429245 1.3566909 1.2922544 15.926241 + 4000 1.4993048 1.3600782 1.2700229 1.441161 1.3958688 15.38517 + 4500 1.5361306 1.4939463 1.4981484 1.6511208 1.4778535 15.14012 + 5000 1.4858931 1.3755603 1.4202936 1.3321859 1.4463033 14.710626 + 5500 1.495093 1.5412773 1.3726815 1.3337702 1.4661477 14.551062 + 6000 1.4867063 1.4204076 1.4972286 1.5325972 1.5125403 14.727292 + 6500 1.5036424 1.4449136 1.5290335 1.5163832 1.4974 14.866821 + 7000 1.5376638 1.4409843 1.4434687 1.3927467 1.5097986 14.730925 + 7500 1.4880255 1.4006281 1.4538957 1.4700911 1.4904586 14.531748 +Loop time of 18.1541 on 1 procs for 5000 steps with 4200 atoms + +Performance: 118981.600 tau/day, 275.420 timesteps/s +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 10.685 | 10.685 | 10.685 | 0.0 | 58.86 +Neigh | 5.6863 | 5.6863 | 5.6863 | 0.0 | 31.32 +Comm | 0.19485 | 0.19485 | 0.19485 | 0.0 | 1.07 +Output | 0.0003798 | 0.0003798 | 0.0003798 | 0.0 | 0.00 +Modify | 1.479 | 1.479 | 1.479 | 0.0 | 8.15 +Other | | 0.1086 | | | 0.60 + +Nlocal: 4200 ave 4200 max 4200 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 3252 ave 3252 max 3252 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 126902 ave 126902 max 126902 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 126902 +Ave neighs/atom = 30.2148 +Neighbor list builds = 815 +Dangerous builds = 0 + +Total wall time: 0:00:28 diff --git a/examples/controller/log.27Nov18.controller.wall.g++.2 b/examples/controller/log.27Nov18.controller.wall.g++.2 new file mode 100644 index 0000000000..acecf705fd --- /dev/null +++ b/examples/controller/log.27Nov18.controller.wall.g++.2 @@ -0,0 +1,142 @@ +LAMMPS (27 Nov 2018) + using 1 OpenMP thread(s) per MPI task +# 3d Lennard-Jones melt, thermostatted by fix controller + +units lj +atom_style atomic +boundary p p m +processors * * 1 +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 +region box block 0 10 0 10 -4 14 +region slab block 0 10 0 10 0 10 +create_box 1 box +Created orthogonal box = (0 0 -6.71838) to (16.796 16.796 23.5143) + 2 by 1 by 1 MPI processor grid +create_atoms 1 region slab +Created 4200 atoms + Time spent = 0.00055027 secs +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 2 every 2 check yes + +fix 1 all nve +fix 3 all langevin 1.5 1.5 0.5 412513 + +variable zhi internal $(10.5*zlat) +variable zhi internal 17.635760009516324942 +variable kwall equal 20.0 +fix 2 all wall/harmonic zlo -0.5 ${kwall} 0.0 2.5 zhi v_zhi ${kwall} 0.0 2.5 +fix 2 all wall/harmonic zlo -0.5 20 0.0 2.5 zhi v_zhi ${kwall} 0.0 2.5 +fix 2 all wall/harmonic zlo -0.5 20 0.0 2.5 zhi v_zhi 20 0.0 2.5 + +variable pzz equal pzz +fix ave all ave/time 10 10 100 v_pzz +# equilibrate + +thermo_style custom step temp pxx pyy pzz f_ave v_zhi +thermo 500 +run 2500 +Neighbor list info ... + update every 2 steps, delay 2 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 12 12 22 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.205 | 3.205 | 3.205 Mbytes +Step Temp Pxx Pyy Pzz f_ave v_zhi + 0 1.44 -2.8234811 -2.8425184 -2.7022745 0 17.63576 + 500 1.4685077 2.9959993 2.9101136 2.9557017 2.9691654 17.63576 + 1000 1.4660014 2.3677693 2.4832805 2.3853443 2.495998 17.63576 + 1500 1.503875 1.9958194 1.8192177 1.8732779 1.9196618 17.63576 + 2000 1.508944 1.6772869 1.6171356 1.5363361 1.6221247 17.63576 + 2500 1.4754205 1.4808824 1.3803411 1.3538329 1.433588 17.63576 +Loop time of 5.20209 on 2 procs for 2500 steps with 4200 atoms + +Performance: 207608.821 tau/day, 480.576 timesteps/s +99.2% CPU use with 2 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.0816 | 3.1008 | 3.1199 | 1.1 | 59.61 +Neigh | 1.5272 | 1.5364 | 1.5455 | 0.7 | 29.53 +Comm | 0.12968 | 0.15815 | 0.18662 | 7.2 | 3.04 +Output | 0.00012827 | 0.00048637 | 0.00084448 | 0.0 | 0.01 +Modify | 0.3743 | 0.37516 | 0.37602 | 0.1 | 7.21 +Other | | 0.03114 | | | 0.60 + +Nlocal: 2100 ave 2121 max 2079 min +Histogram: 1 0 0 0 0 0 0 0 0 1 +Nghost: 2593 ave 2606 max 2580 min +Histogram: 1 0 0 0 0 0 0 0 0 1 +Neighs: 62766.5 ave 63603 max 61930 min +Histogram: 1 0 0 0 0 0 0 0 0 1 + +Total # of neighbors = 125533 +Ave neighs/atom = 29.8888 +Neighbor list builds = 410 +Dangerous builds = 0 + +# use time averaged pressure for control +#fix 10 all controller 100 -0.05 20.0 0.0 0.0 f_ave 1.5 zhi + +# use instantaneous pressure for control +fix 10 all controller 100 -0.05 50.0 0.0 0.0 v_pzz 1.5 zhi + +# run with controller + +run 5000 +Per MPI rank memory allocation (min/avg/max) = 3.208 | 3.208 | 3.208 Mbytes +Step Temp Pxx Pyy Pzz f_ave v_zhi + 2500 1.4754205 1.482216 1.3815843 1.3550522 1.433588 17.63576 + 3000 1.4805196 1.4121967 1.3859531 1.4360385 1.3724589 16.755204 + 3500 1.4909046 1.3658062 1.3441219 1.3839841 1.3998033 15.699356 + 4000 1.500835 1.4985308 1.4043943 1.3989491 1.4418757 15.030304 + 4500 1.5371526 1.4614358 1.4941526 1.455191 1.5121676 14.738878 + 5000 1.4766657 1.4037866 1.2404757 1.3679074 1.4173969 14.670117 + 5500 1.48302 1.5591058 1.3928461 1.3952178 1.5334476 14.58675 + 6000 1.5191325 1.4416274 1.5290468 1.5077685 1.5176605 14.560389 + 6500 1.495773 1.6695592 1.6621934 1.6073908 1.5508856 14.668722 + 7000 1.5033866 1.48723 1.5054815 1.4755225 1.5024653 14.676533 + 7500 1.5512429 1.6282941 1.7399228 1.6351273 1.6851571 14.671092 +Loop time of 9.76074 on 2 procs for 5000 steps with 4200 atoms + +Performance: 221294.755 tau/day, 512.256 timesteps/s +98.5% CPU use with 2 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 5.5979 | 5.6281 | 5.6583 | 1.3 | 57.66 +Neigh | 2.9053 | 2.9335 | 2.9618 | 1.6 | 30.05 +Comm | 0.31645 | 0.37703 | 0.43762 | 9.9 | 3.86 +Output | 0.00025439 | 0.0009656 | 0.0016768 | 0.0 | 0.01 +Modify | 0.75674 | 0.75966 | 0.76258 | 0.3 | 7.78 +Other | | 0.06145 | | | 0.63 + +Nlocal: 2100 ave 2109 max 2091 min +Histogram: 1 0 0 0 0 0 0 0 0 1 +Nghost: 2578 ave 2578 max 2578 min +Histogram: 2 0 0 0 0 0 0 0 0 0 +Neighs: 63578.5 ave 64145 max 63012 min +Histogram: 1 0 0 0 0 0 0 0 0 1 + +Total # of neighbors = 127157 +Ave neighs/atom = 30.2755 +Neighbor list builds = 816 +Dangerous builds = 0 + +Total wall time: 0:00:14 From bbe863f1acbde06cbf55ccbd82445fbc3f3c7284 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 Dec 2018 05:43:19 -0500 Subject: [PATCH 39/94] add input for controlling a wall for a slab --- examples/controller/in.controller.wall | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 examples/controller/in.controller.wall diff --git a/examples/controller/in.controller.wall b/examples/controller/in.controller.wall new file mode 100644 index 0000000000..4e60b3e7de --- /dev/null +++ b/examples/controller/in.controller.wall @@ -0,0 +1,46 @@ +# 3d Lennard-Jones melt, thermostatted by fix controller + +units lj +atom_style atomic +boundary p p m +processors * * 1 +lattice fcc 0.8442 +region box block 0 10 0 10 -4 14 +region slab block 0 10 0 10 0 10 +create_box 1 box +create_atoms 1 region slab +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 2 every 2 check yes + +fix 1 all nve +fix 3 all langevin 1.5 1.5 0.5 412513 + +variable zhi internal $(10.5*zlat) +variable kwall equal 20.0 +fix 2 all wall/harmonic zlo -0.5 ${kwall} 0.0 2.5 zhi v_zhi ${kwall} 0.0 2.5 + +variable pzz equal pzz +fix ave all ave/time 10 10 100 v_pzz +# equilibrate + +thermo_style custom step temp pxx pyy pzz f_ave v_zhi +thermo 500 +run 2500 + +# use time averaged pressure for control +#fix 10 all controller 100 -0.05 20.0 0.0 0.0 f_ave 1.5 zhi + +# use instantaneous pressure for control +fix 10 all controller 100 -0.05 50.0 0.0 0.0 v_pzz 1.5 zhi + +# run with controller + +run 5000 + From 113a2e328edf8b82adac80b9006ded2d7b91b73d Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Tue, 11 Dec 2018 10:47:34 -0700 Subject: [PATCH 40/94] Change fix nvt/sllod to allow suffix styles of fix deform --- src/fix_nvt_sllod.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fix_nvt_sllod.cpp b/src/fix_nvt_sllod.cpp index 012d67c318..1893829586 100644 --- a/src/fix_nvt_sllod.cpp +++ b/src/fix_nvt_sllod.cpp @@ -80,7 +80,7 @@ void FixNVTSllod::init() int i; for (i = 0; i < modify->nfix; i++) - if (strcmp(modify->fix[i]->style,"deform") == 0) { + if (strstr(modify->fix[i]->style,"deform")) { if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform " "remap option"); From 3ad4c0db354274746cac2209e92b7966aee2e86d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 Dec 2018 21:02:52 -0500 Subject: [PATCH 41/94] expose "make spelling" in the doc folder to the documentation --- doc/Makefile | 1 + doc/src/Manual_build.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/Makefile b/doc/Makefile index fbb9de2d84..d117c2d98c 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -48,6 +48,7 @@ help: @echo " clean-all reset the entire build environment" @echo " txt2html build txt2html tool" @echo " anchor_check scan for duplicate anchor labels" + @echo " spelling spell-check the manual" # ------------------------------------------ diff --git a/doc/src/Manual_build.txt b/doc/src/Manual_build.txt index 42c77c4500..af67752994 100644 --- a/doc/src/Manual_build.txt +++ b/doc/src/Manual_build.txt @@ -65,6 +65,8 @@ make epub # generate LAMMPS.epub in ePUB format using Sphinx make mobi # generate LAMMPS.mobi in MOBI format using ebook-convert make clean # remove intermediate RST files created by HTML build make clean-all # remove entire build folder and any cached data :pre +make anchor_check # check for duplicate anchor labels +make spelling # spell-check the manual :line From 35cfedab398fe8f31425832367fe1bb706910978 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 Dec 2018 21:13:03 -0500 Subject: [PATCH 42/94] document PDF manual generation --- doc/src/Manual_build.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/src/Manual_build.txt b/doc/src/Manual_build.txt index af67752994..e9df0d2cfc 100644 --- a/doc/src/Manual_build.txt +++ b/doc/src/Manual_build.txt @@ -108,7 +108,14 @@ This will install virtualenv from the Python Package Index. Installing prerequisites for PDF build -[TBA] +Building the PDF manual requires a working C++ compiler (to +compile the txt2html tool and a working installation of +"HTMLDOC"_https://www.msweet.org/htmldoc/ +HTMLDOC has its own list of prerequisites, but in most cases +you can install a binary package of it either through your +Linux package manager or MacOS (dmg) and Windows installer +(msi) packages from its +"GitHub releases page at"_https://github.com/michaelrsweet/htmldoc/releases :line From 04b365818eee24496a419db2586753971f2c59d0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 Dec 2018 23:01:52 -0500 Subject: [PATCH 43/94] fix typo --- src/pair_deprecated.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pair_deprecated.cpp b/src/pair_deprecated.cpp index 5d05d4d739..04c0ec9da8 100644 --- a/src/pair_deprecated.cpp +++ b/src/pair_deprecated.cpp @@ -51,6 +51,7 @@ void PairDeprecated::settings(int, char **) if (strcmp(my_style,"reax") == 0) { writemsg(lmp,"\nPair style 'reax' has been removed from LAMMPS " "after the 12 December 2018 version\n\n",1); + } if (strcmp(my_style,"DEPRECATED") == 0) { writemsg(lmp,"\nPair style 'DEPRECATED' is a dummy style\n\n",0); From ba98cff5a811e942c0ef910fc96d5a9c6badc067 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 Dec 2018 23:03:01 -0500 Subject: [PATCH 44/94] avoid merge conflict --- doc/src/Tools.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/Tools.txt b/doc/src/Tools.txt index 88c8f0f77f..4002e471cf 100644 --- a/doc/src/Tools.txt +++ b/doc/src/Tools.txt @@ -485,7 +485,7 @@ README for more info on Pizza.py and how to use these scripts. reax tool :h4,link(reax_tool) -The reax sub-directory contains stand-alond codes that can +The reax sub-directory contains stand-alone codes that can post-process the output of the "fix reax/c/bonds"_fix_reaxc_bonds.html command from a LAMMPS simulation using "ReaxFF"_pair_reaxc.html. See the README.txt file for more info. From c4f7b36dc52d3b02adb2923a7cb468297e6686c3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 Dec 2018 23:14:43 -0500 Subject: [PATCH 45/94] whitespace cleanup --- src/pair_deprecated.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pair_deprecated.cpp b/src/pair_deprecated.cpp index 04c0ec9da8..0b1342fb2d 100644 --- a/src/pair_deprecated.cpp +++ b/src/pair_deprecated.cpp @@ -58,5 +58,3 @@ void PairDeprecated::settings(int, char **) } } - - From f2f7bcfa5a3813c2352a8e7bc0bcf9c0db41b71a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 Dec 2018 23:45:27 -0500 Subject: [PATCH 46/94] add new false positive --- doc/utils/sphinx-config/false_positives.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index de60206304..92eebaa7ff 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -571,6 +571,7 @@ dlopen dm dmax Dmax +dmg dmi dnf Dobson From 5362b1cfdee6134b3a7cec4d936a61bc827065c6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 12 Dec 2018 00:02:06 -0500 Subject: [PATCH 47/94] use more accurate strncmp() check instead of strstr() and apply the same change to all affected variants of fix nvt/sllod --- src/USER-EFF/fix_nvt_sllod_eff.cpp | 2 +- src/USER-INTEL/fix_nvt_sllod_intel.cpp | 2 +- src/USER-OMP/fix_nvt_sllod_omp.cpp | 2 +- src/fix_nvt_sllod.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/USER-EFF/fix_nvt_sllod_eff.cpp b/src/USER-EFF/fix_nvt_sllod_eff.cpp index 13cb34048c..ed2274dcf9 100644 --- a/src/USER-EFF/fix_nvt_sllod_eff.cpp +++ b/src/USER-EFF/fix_nvt_sllod_eff.cpp @@ -75,7 +75,7 @@ void FixNVTSllodEff::init() int i; for (i = 0; i < modify->nfix; i++) - if (strcmp(modify->fix[i]->style,"deform") == 0) { + if (strncmp(modify->fix[i]->style,"deform",6) == 0) { if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod/eff with inconsistent fix deform " "remap option"); diff --git a/src/USER-INTEL/fix_nvt_sllod_intel.cpp b/src/USER-INTEL/fix_nvt_sllod_intel.cpp index ad7e1384f0..f5a5dabfb1 100644 --- a/src/USER-INTEL/fix_nvt_sllod_intel.cpp +++ b/src/USER-INTEL/fix_nvt_sllod_intel.cpp @@ -76,7 +76,7 @@ void FixNVTSllodIntel::init() int i; for (i = 0; i < modify->nfix; i++) - if (strcmp(modify->fix[i]->style,"deform") == 0) { + if (strncmp(modify->fix[i]->style,"deform",6) == 0) { if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform " "remap option"); diff --git a/src/USER-OMP/fix_nvt_sllod_omp.cpp b/src/USER-OMP/fix_nvt_sllod_omp.cpp index 6ef1188d53..e439647c12 100644 --- a/src/USER-OMP/fix_nvt_sllod_omp.cpp +++ b/src/USER-OMP/fix_nvt_sllod_omp.cpp @@ -82,7 +82,7 @@ void FixNVTSllodOMP::init() int i; for (i = 0; i < modify->nfix; i++) - if (strcmp(modify->fix[i]->style,"deform") == 0) { + if (strncmp(modify->fix[i]->style,"deform",6) == 0) { if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod/omp with inconsistent fix " "deform remap option"); diff --git a/src/fix_nvt_sllod.cpp b/src/fix_nvt_sllod.cpp index 1893829586..c7d23364a7 100644 --- a/src/fix_nvt_sllod.cpp +++ b/src/fix_nvt_sllod.cpp @@ -80,7 +80,7 @@ void FixNVTSllod::init() int i; for (i = 0; i < modify->nfix; i++) - if (strstr(modify->fix[i]->style,"deform")) { + if (strncmp(modify->fix[i]->style,"deform",6) == 0) { if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform " "remap option"); From 5b0c43108d161baaf77c69c3c786b882dd85f94b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 12 Dec 2018 16:39:27 -0500 Subject: [PATCH 48/94] detect missing initialization and run it instead of crashing with a non-descript segfault --- src/compute_reduce.cpp | 20 ++++++-- src/compute_reduce_chunk.cpp | 97 ++++++++++++++++++++--------------- src/compute_reduce_region.cpp | 13 ++++- 3 files changed, 82 insertions(+), 48 deletions(-) diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index e3c3c5b70a..16dc84628a 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; -enum{SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; // also in ReduceRegion -enum{X,V,F,COMPUTE,FIX,VARIABLE}; +enum{SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; // also in ComputeReduceRegion +enum{UNKNOWN=-1,X,V,F,COMPUTE,FIX,VARIABLE}; enum{PERATOM,LOCAL}; #define INVOKED_VECTOR 2 @@ -92,6 +92,10 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : flavor = new int[nargnew]; ids = new char*[nargnew]; value2index = new int[nargnew]; + for (int i=0; i < nargnew; ++i) { + which[i] = argindex[i] = flavor[i] = value2index[i] = UNKNOWN; + ids[i] = NULL; + } nvalues = 0; iarg = 0; @@ -345,7 +349,7 @@ void ComputeReduce::init() error->all(FLERR,"Variable name for compute reduce does not exist"); value2index[m] = ivariable; - } else value2index[m] = -1; + } else value2index[m] = UNKNOWN; } // set index and check validity of region @@ -468,8 +472,16 @@ double ComputeReduce::compute_one(int m, int flag) index = -1; int vidx = value2index[m]; - int aidx = argindex[m]; + // initialization in case it has not yet been run, e.g. when + // the compute was invoked right after it has been created + + if (vidx == UNKNOWN) { + init(); + vidx = value2index[m]; + } + + int aidx = argindex[m]; int *mask = atom->mask; int nlocal = atom->nlocal; diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index 32c4d9c786..f31672ef74 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -28,7 +28,7 @@ using namespace LAMMPS_NS; enum{SUM,MINN,MAXX}; -enum{COMPUTE,FIX,VARIABLE}; +enum{UNKNOWN=-1,COMPUTE,FIX,VARIABLE}; #define INVOKED_PERATOM 8 @@ -74,6 +74,10 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : argindex = new int[nargnew]; ids = new char*[nargnew]; value2index = new int[nargnew]; + for (int i=0; i < nargnew; ++i) { + which[i] = argindex[i] = value2index[i] = UNKNOWN; + ids[i] = NULL; + } nvalues = 0; iarg = 0; @@ -123,46 +127,46 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : if (which[i] == COMPUTE) { int icompute = modify->find_compute(ids[i]); if (icompute < 0) - error->all(FLERR,"Compute ID for compute reduce/chunk does not exist"); + error->all(FLERR,"Compute ID for compute reduce/chunk does not exist"); if (!modify->compute[icompute]->peratom_flag) - error->all(FLERR,"Compute reduce/chunk compute does not " - "calculate per-atom values"); + error->all(FLERR,"Compute reduce/chunk compute does not " + "calculate per-atom values"); if (argindex[i] == 0 && - modify->compute[icompute]->size_peratom_cols != 0) - error->all(FLERR,"Compute reduce/chunk compute does not " - "calculate a per-atom vector"); + modify->compute[icompute]->size_peratom_cols != 0) + error->all(FLERR,"Compute reduce/chunk compute does not " + "calculate a per-atom vector"); if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0) - error->all(FLERR,"Compute reduce/chunk compute does not " - "calculate a per-atom array"); + error->all(FLERR,"Compute reduce/chunk compute does not " + "calculate a per-atom array"); if (argindex[i] && argindex[i] > modify->compute[icompute]->size_peratom_cols) - error->all(FLERR, - "Compute reduce/chunk compute array is accessed out-of-range"); + error->all(FLERR, + "Compute reduce/chunk compute array is accessed out-of-range"); } else if (which[i] == FIX) { int ifix = modify->find_fix(ids[i]); if (ifix < 0) - error->all(FLERR,"Fix ID for compute reduce/chunk does not exist"); + error->all(FLERR,"Fix ID for compute reduce/chunk does not exist"); if (!modify->fix[ifix]->peratom_flag) - error->all(FLERR,"Compute reduce/chunk fix does not " - "calculate per-atom values"); + error->all(FLERR,"Compute reduce/chunk fix does not " + "calculate per-atom values"); if (argindex[i] == 0 && - modify->fix[ifix]->size_peratom_cols != 0) - error->all(FLERR,"Compute reduce/chunk fix does not " - "calculate a per-atom vector"); + modify->fix[ifix]->size_peratom_cols != 0) + error->all(FLERR,"Compute reduce/chunk fix does not " + "calculate a per-atom vector"); if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0) - error->all(FLERR,"Compute reduce/chunk fix does not " - "calculate a per-atom array"); + error->all(FLERR,"Compute reduce/chunk fix does not " + "calculate a per-atom array"); if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols) - error->all(FLERR,"Compute reduce/chunk fix array is " + error->all(FLERR,"Compute reduce/chunk fix array is " "accessed out-of-range"); } else if (which[i] == VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) - error->all(FLERR,"Variable name for compute reduce/chunk does not exist"); + error->all(FLERR,"Variable name for compute reduce/chunk does not exist"); if (input->variable->atomstyle(ivariable) == 0) - error->all(FLERR,"Compute reduce/chunk variable is " + error->all(FLERR,"Compute reduce/chunk variable is " "not atom-style variable"); } } @@ -354,10 +358,19 @@ void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride) int *mask = atom->mask; int nlocal = atom->nlocal; - int index; + int index = -1; + int vidx = value2index[m]; + + // initialization in case it has not yet been run, e.g. when + // the compute was invoked right after it has been created + + if (vidx == UNKNOWN) { + init(); + vidx = value2index[m]; + } if (which[m] == COMPUTE) { - Compute *compute = modify->compute[value2index[m]]; + Compute *compute = modify->compute[vidx]; if (!(compute->invoked_flag & INVOKED_PERATOM)) { compute->compute_peratom(); @@ -367,26 +380,26 @@ void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride) if (argindex[m] == 0) { double *vcompute = compute->vector_atom; for (int i = 0; i < nlocal; i++) { - if (!(mask[i] & groupbit)) continue; - index = ichunk[i]-1; - if (index < 0) continue; - combine(vchunk[index*nstride],vcompute[i]); + if (!(mask[i] & groupbit)) continue; + index = ichunk[i]-1; + if (index < 0) continue; + combine(vchunk[index*nstride],vcompute[i]); } } else { double **acompute = compute->array_atom; int argindexm1 = argindex[m] - 1; for (int i = 0; i < nlocal; i++) { - if (!(mask[i] & groupbit)) continue; - index = ichunk[i]-1; - if (index < 0) continue; - combine(vchunk[index*nstride],acompute[i][argindexm1]); + if (!(mask[i] & groupbit)) continue; + index = ichunk[i]-1; + if (index < 0) continue; + combine(vchunk[index*nstride],acompute[i][argindexm1]); } } // access fix fields, check if fix frequency is a match } else if (which[m] == FIX) { - Fix *fix = modify->fix[value2index[m]]; + Fix *fix = modify->fix[vidx]; if (update->ntimestep % fix->peratom_freq) error->all(FLERR,"Fix used in compute reduce/chunk not " "computed at compatible time"); @@ -394,19 +407,19 @@ void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride) if (argindex[m] == 0) { double *vfix = fix->vector_atom; for (int i = 0; i < nlocal; i++) { - if (!(mask[i] & groupbit)) continue; - index = ichunk[i]-1; - if (index < 0) continue; - combine(vchunk[index*nstride],vfix[i]); + if (!(mask[i] & groupbit)) continue; + index = ichunk[i]-1; + if (index < 0) continue; + combine(vchunk[index*nstride],vfix[i]); } } else { double **afix = fix->array_atom; int argindexm1 = argindex[m] - 1; for (int i = 0; i < nlocal; i++) { - if (!(mask[i] & groupbit)) continue; - index = ichunk[i]-1; - if (index < 0) continue; - combine(vchunk[index*nstride],afix[i][argindexm1]); + if (!(mask[i] & groupbit)) continue; + index = ichunk[i]-1; + if (index < 0) continue; + combine(vchunk[index*nstride],afix[i][argindexm1]); } } @@ -419,7 +432,7 @@ void ComputeReduceChunk::compute_one(int m, double *vchunk, int nstride) memory->create(varatom,maxatom,"reduce/chunk:varatom"); } - input->variable->compute_atom(value2index[m],igroup,varatom,1,0); + input->variable->compute_atom(vidx,igroup,varatom,1,0); for (int i = 0; i < nlocal; i++) { if (!(mask[i] & groupbit)) continue; index = ichunk[i]-1; diff --git a/src/compute_reduce_region.cpp b/src/compute_reduce_region.cpp index 77cd6371c6..3dd671ce2b 100644 --- a/src/compute_reduce_region.cpp +++ b/src/compute_reduce_region.cpp @@ -28,8 +28,8 @@ using namespace LAMMPS_NS; -enum{SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; // also in ComputeReduce -enum{X,V,F,COMPUTE,FIX,VARIABLE}; +enum{SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; // also in ComputeReduce +enum{UNKNOWN=-1,X,V,F,COMPUTE,FIX,VARIABLE}; enum{PERATOM,LOCAL}; #define INVOKED_VECTOR 2 @@ -70,6 +70,15 @@ double ComputeReduceRegion::compute_one(int m, int flag) int nlocal = atom->nlocal; int n = value2index[m]; + + // initialization in case it has not yet been run, + // e.g. when invoked + if (n == UNKNOWN) { + init(); + n = value2index[m]; + } + + int aidx = argindex[m]; int j = argindex[m]; double one = 0.0; From 6f33ce9dba55ff55254c19bc1a4606452d194dfc Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 12 Dec 2018 17:31:42 -0700 Subject: [PATCH 49/94] Made two changes: -recomputed up-to-date pressure tensor (fixes energy conservation problem with aniso) -changed ndof for iso (fixes volume fluctuation problem with iso) --- src/compute_pressure.cpp | 54 ++++++++++++++++++++++++++++++++++++++++ src/compute_pressure.h | 1 + src/fix_nh.cpp | 19 ++++++++++---- 3 files changed, 69 insertions(+), 5 deletions(-) diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index dde02a5aed..33d5a8f349 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -261,6 +261,60 @@ void ComputePressure::compute_vector() } } +/* ---------------------------------------------------------------------- + compute pressure tensor + assume KE tensor has already been computed +------------------------------------------------------------------------- */ + +void ComputePressure::compute_vector_ke_scalar() +{ + invoked_vector = update->ntimestep; + if (update->vflag_global != invoked_vector) + error->all(FLERR,"Virial was not tallied on needed timestep"); + + if (force->kspace && kspace_virial && force->kspace->scalar_pressure_flag) + error->all(FLERR,"Must use 'kspace_modify pressure/scalar no' for " + "tensor components with kspace_style msm"); + + // invoke temperature if it hasn't been already + + double t; + if (keflag) { + if (temperature->invoked_scalar != update->ntimestep) + t = temperature->compute_scalar(); + else t = temperature->scalar; + } + + if (dimension == 3) { + inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); + virial_compute(6,3); + if (keflag) { + double kescalar = temperature->dof * boltz * t / 3.0; + for (int i = 0; i < 3; i++) + vector[i] = (kescalar + virial[i]) * inv_volume * nktv2p; + for (int i = 3; i < 6; i++) + vector[i] = virial[i] * inv_volume * nktv2p; + } else + for (int i = 0; i < 6; i++) + vector[i] = virial[i] * inv_volume * nktv2p; + } else { + inv_volume = 1.0 / (domain->xprd * domain->yprd); + virial_compute(4,2); + if (keflag) { + double kescalar = temperature->dof * boltz * t / 2.0; + vector[0] = (kescalar + virial[0]) * inv_volume * nktv2p; + vector[1] = (kescalar + virial[1]) * inv_volume * nktv2p; + vector[3] = virial[3] * inv_volume * nktv2p; + vector[2] = vector[4] = vector[5] = 0.0; + } else { + vector[0] = virial[0] * inv_volume * nktv2p; + vector[1] = virial[1] * inv_volume * nktv2p; + vector[3] = virial[3] * inv_volume * nktv2p; + vector[2] = vector[4] = vector[5] = 0.0; + } + } +} + /* ---------------------------------------------------------------------- */ void ComputePressure::virial_compute(int n, int ndiag) diff --git a/src/compute_pressure.h b/src/compute_pressure.h index a59a64e634..508aa45fe5 100644 --- a/src/compute_pressure.h +++ b/src/compute_pressure.h @@ -31,6 +31,7 @@ class ComputePressure : public Compute { virtual void init(); virtual double compute_scalar(); virtual void compute_vector(); + void compute_vector_ke_scalar(); void reset_extra_compute_fix(const char *); protected: diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index a1a562f2bb..b65554dbe1 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -29,6 +29,7 @@ #include "modify.h" #include "fix_deform.h" #include "compute.h" +#include "compute_pressure.h" #include "kspace.h" #include "update.h" #include "respa.h" @@ -777,7 +778,7 @@ void FixNH::setup(int /*vflag*/) if (pstat_flag) { if (pstyle == ISO) pressure->compute_scalar(); - else pressure->compute_vector(); + else ((ComputePressure *)pressure)->compute_vector_ke_scalar(); couple(); pressure->addstep(update->ntimestep+1); } @@ -850,7 +851,7 @@ void FixNH::initial_integrate(int /*vflag*/) pressure->compute_scalar(); } else { temperature->compute_vector(); - pressure->compute_vector(); + ((ComputePressure *)pressure)->compute_vector_ke_scalar(); } couple(); pressure->addstep(update->ntimestep+1); @@ -904,9 +905,16 @@ void FixNH::final_integrate() t_current = temperature->compute_scalar(); tdof = temperature->dof; + // need to recompute pressure to account for change in KE + // t_current is up-to-date, but compute_temperature is not + // compute appropriately coupled elements of mvv_current + if (pstat_flag) { if (pstyle == ISO) pressure->compute_scalar(); - else pressure->compute_vector(); + else { + temperature->compute_vector(); + ((ComputePressure *)pressure)->compute_vector_ke_scalar(); + } couple(); pressure->addstep(update->ntimestep+1); } @@ -957,7 +965,7 @@ void FixNH::initial_integrate_respa(int /*vflag*/, int ilevel, int /*iloop*/) pressure->compute_scalar(); } else { temperature->compute_vector(); - pressure->compute_vector(); + ((ComputePressure *)pressure)->compute_vector_ke_scalar(); } couple(); pressure->addstep(update->ntimestep+1); @@ -1871,7 +1879,8 @@ void FixNH::nhc_press_integrate() } } - lkt_press = pdof * kt; + if (pstyle == ISO) lkt_press = kt; + else lkt_press = pdof * kt; etap_dotdot[0] = (kecurrent - lkt_press)/etap_mass[0]; double ncfac = 1.0/nc_pchain; From 4f38878cf48fbabb76a638c29bc7f742f2e01a96 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 12 Dec 2018 17:48:02 -0700 Subject: [PATCH 50/94] Removed unnecessary changes to ComputePressure --- src/compute_pressure.cpp | 54 ---------------------------------------- src/compute_pressure.h | 1 - src/fix_nh.cpp | 9 +++---- 3 files changed, 4 insertions(+), 60 deletions(-) diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index 33d5a8f349..dde02a5aed 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -261,60 +261,6 @@ void ComputePressure::compute_vector() } } -/* ---------------------------------------------------------------------- - compute pressure tensor - assume KE tensor has already been computed -------------------------------------------------------------------------- */ - -void ComputePressure::compute_vector_ke_scalar() -{ - invoked_vector = update->ntimestep; - if (update->vflag_global != invoked_vector) - error->all(FLERR,"Virial was not tallied on needed timestep"); - - if (force->kspace && kspace_virial && force->kspace->scalar_pressure_flag) - error->all(FLERR,"Must use 'kspace_modify pressure/scalar no' for " - "tensor components with kspace_style msm"); - - // invoke temperature if it hasn't been already - - double t; - if (keflag) { - if (temperature->invoked_scalar != update->ntimestep) - t = temperature->compute_scalar(); - else t = temperature->scalar; - } - - if (dimension == 3) { - inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); - virial_compute(6,3); - if (keflag) { - double kescalar = temperature->dof * boltz * t / 3.0; - for (int i = 0; i < 3; i++) - vector[i] = (kescalar + virial[i]) * inv_volume * nktv2p; - for (int i = 3; i < 6; i++) - vector[i] = virial[i] * inv_volume * nktv2p; - } else - for (int i = 0; i < 6; i++) - vector[i] = virial[i] * inv_volume * nktv2p; - } else { - inv_volume = 1.0 / (domain->xprd * domain->yprd); - virial_compute(4,2); - if (keflag) { - double kescalar = temperature->dof * boltz * t / 2.0; - vector[0] = (kescalar + virial[0]) * inv_volume * nktv2p; - vector[1] = (kescalar + virial[1]) * inv_volume * nktv2p; - vector[3] = virial[3] * inv_volume * nktv2p; - vector[2] = vector[4] = vector[5] = 0.0; - } else { - vector[0] = virial[0] * inv_volume * nktv2p; - vector[1] = virial[1] * inv_volume * nktv2p; - vector[3] = virial[3] * inv_volume * nktv2p; - vector[2] = vector[4] = vector[5] = 0.0; - } - } -} - /* ---------------------------------------------------------------------- */ void ComputePressure::virial_compute(int n, int ndiag) diff --git a/src/compute_pressure.h b/src/compute_pressure.h index 508aa45fe5..a59a64e634 100644 --- a/src/compute_pressure.h +++ b/src/compute_pressure.h @@ -31,7 +31,6 @@ class ComputePressure : public Compute { virtual void init(); virtual double compute_scalar(); virtual void compute_vector(); - void compute_vector_ke_scalar(); void reset_extra_compute_fix(const char *); protected: diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index b65554dbe1..deca0ad83d 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -29,7 +29,6 @@ #include "modify.h" #include "fix_deform.h" #include "compute.h" -#include "compute_pressure.h" #include "kspace.h" #include "update.h" #include "respa.h" @@ -778,7 +777,7 @@ void FixNH::setup(int /*vflag*/) if (pstat_flag) { if (pstyle == ISO) pressure->compute_scalar(); - else ((ComputePressure *)pressure)->compute_vector_ke_scalar(); + else pressure->compute_vector(); couple(); pressure->addstep(update->ntimestep+1); } @@ -851,7 +850,7 @@ void FixNH::initial_integrate(int /*vflag*/) pressure->compute_scalar(); } else { temperature->compute_vector(); - ((ComputePressure *)pressure)->compute_vector_ke_scalar(); + pressure->compute_vector(); } couple(); pressure->addstep(update->ntimestep+1); @@ -913,7 +912,7 @@ void FixNH::final_integrate() if (pstyle == ISO) pressure->compute_scalar(); else { temperature->compute_vector(); - ((ComputePressure *)pressure)->compute_vector_ke_scalar(); + pressure->compute_vector(); } couple(); pressure->addstep(update->ntimestep+1); @@ -965,7 +964,7 @@ void FixNH::initial_integrate_respa(int /*vflag*/, int ilevel, int /*iloop*/) pressure->compute_scalar(); } else { temperature->compute_vector(); - ((ComputePressure *)pressure)->compute_vector_ke_scalar(); + pressure->compute_vector(); } couple(); pressure->addstep(update->ntimestep+1); From deb21ad4e2643040b90e1a6e07f93b3061454644 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 13 Dec 2018 14:06:12 -0500 Subject: [PATCH 51/94] support variables for more region properties add code to allow the center of a spherical or cylindrical region to be determined as variables and thus change over time. --- doc/src/region.txt | 13 ++-- src/region_cylinder.cpp | 141 +++++++++++++++++++++++++++++++++------- src/region_cylinder.h | 4 +- src/region_sphere.cpp | 109 ++++++++++++++++++++++++++----- src/region_sphere.h | 5 +- 5 files changed, 226 insertions(+), 46 deletions(-) diff --git a/doc/src/region.txt b/doc/src/region.txt index acc85dcebb..e343557b7f 100644 --- a/doc/src/region.txt +++ b/doc/src/region.txt @@ -26,7 +26,7 @@ style = {delete} or {block} or {cone} or {cylinder} or {plane} or {prism} or {sp dim = {x} or {y} or {z} = axis of cylinder c1,c2 = coords of cylinder axis in other 2 dimensions (distance units) radius = cylinder radius (distance units) - radius can be a variable (see below) + c1,c2, and radius can be a variable (see below) lo,hi = bounds of cylinder in dim (distance units) {plane} args = px py pz nx ny nz px,py,pz = point on the plane (distance units) @@ -39,7 +39,7 @@ style = {delete} or {block} or {cone} or {cylinder} or {plane} or {prism} or {sp {sphere} args = x y z radius x,y,z = center of sphere (distance units) radius = radius of sphere (distance units) - radius can be a variable (see below) + x,y,z, and radius can be a variable (see below) {union} args = N reg-ID1 reg-ID2 ... N = # of regions to follow, must be 2 or greater reg-ID1,reg-ID2, ... = IDs of regions to join together @@ -179,12 +179,17 @@ The {radius} value for style {sphere} and {cylinder} can be specified as an equal-style "variable"_variable.html. If the value is a variable, it should be specified as v_name, where name is the variable name. In this case, the variable will be evaluated each timestep, and -its value used to determine the radius of the region. +its value used to determine the radius of the region. For style {sphere} +also the x-, y-, and z- coordinate of the center of the sphere and for +style {cylinder} the two center positions c1 and c2 for the location of +the cylinder axes can be a variable with the same kind of effect and +requirements than for the radius. Equal-style variables can specify formulas with various mathematical functions, and include "thermo_style"_thermo_style.html command keywords for the simulation box parameters and timestep and elapsed -time. Thus it is easy to specify a time-dependent radius. +time. Thus it is easy to specify a time-dependent radius or have +a time dependent position of the sphere or cylinder region. See the "Howto tricilinc"_Howto_triclinic.html doc page for a geometric description of triclinic boxes, as defined by LAMMPS, and diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index 0b15a3644d..0bc567ff4f 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -30,7 +30,7 @@ enum{CONSTANT,VARIABLE}; /* ---------------------------------------------------------------------- */ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : - Region(lmp, narg, arg), rstr(NULL) + Region(lmp, narg, arg), c1str(NULL), c2str(NULL), rstr(NULL) { options(narg-8,&arg[8]); @@ -44,17 +44,76 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : axis = arg[2][0]; if (axis == 'x') { - c1 = yscale*force->numeric(FLERR,arg[3]); - c2 = zscale*force->numeric(FLERR,arg[4]); + if (strstr(arg[3],"v_") == arg[3]) { + int n = strlen(arg[3]+2) + 1; + c1str = new char[n]; + strcpy(c1str,arg[3]+2); + c1 = 0.0; + c1style = VARIABLE; + varshape = 1; + } else { + c1 = yscale*force->numeric(FLERR,arg[3]); + c1style = CONSTANT; + } + if (strstr(arg[4],"v_") == arg[4]) { + int n = strlen(arg[4]+2) + 1; + c2str = new char[n]; + strcpy(c2str,arg[4]+2); + c2 = 0.0; + c2style = VARIABLE; + varshape = 1; + } else { + c2 = zscale*force->numeric(FLERR,arg[4]); + c2style = CONSTANT; + } } else if (axis == 'y') { - c1 = xscale*force->numeric(FLERR,arg[3]); - c2 = zscale*force->numeric(FLERR,arg[4]); + if (strstr(arg[3],"v_") == arg[3]) { + int n = strlen(arg[3]+2) + 1; + c1str = new char[n]; + strcpy(c1str,arg[3]+2); + c1 = 0.0; + c1style = VARIABLE; + varshape = 1; + } else { + c1 = xscale*force->numeric(FLERR,arg[3]); + c1style = CONSTANT; + } + if (strstr(arg[4],"v_") == arg[4]) { + int n = strlen(arg[4]+2) + 1; + c2str = new char[n]; + strcpy(c2str,arg[4]+2); + c2 = 0.0; + c2style = VARIABLE; + varshape = 1; + } else { + c2 = zscale*force->numeric(FLERR,arg[4]); + c2style = CONSTANT; + } } else if (axis == 'z') { - c1 = xscale*force->numeric(FLERR,arg[3]); - c2 = yscale*force->numeric(FLERR,arg[4]); + if (strstr(arg[3],"v_") == arg[3]) { + int n = strlen(arg[3]+2) + 1; + c1str = new char[n]; + strcpy(c1str,arg[3]+2); + c1 = 0.0; + c1style = VARIABLE; + varshape = 1; + } else { + c1 = xscale*force->numeric(FLERR,arg[3]); + c1style = CONSTANT; + } + if (strstr(arg[4],"v_") == arg[4]) { + int n = strlen(arg[4]+2) + 1; + c2str = new char[n]; + strcpy(c2str,arg[4]+2); + c2 = 0.0; + c2style = VARIABLE; + varshape = 1; + } else { + c2 = yscale*force->numeric(FLERR,arg[4]); + c2style = CONSTANT; + } } - rstr = NULL; if (strstr(arg[5],"v_") == arg[5]) { int n = strlen(&arg[5][2]) + 1; rstr = new char[n]; @@ -62,8 +121,6 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : radius = 0.0; rstyle = VARIABLE; varshape = 1; - variable_check(); - shape_update(); } else { radius = force->numeric(FLERR,arg[5]); if (axis == 'x') radius *= yscale; @@ -71,6 +128,11 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : rstyle = CONSTANT; } + if (varshape) { + variable_check(); + shape_update(); + } + if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) { if (domain->box_exist == 0) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); @@ -167,6 +229,8 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : RegCylinder::~RegCylinder() { + delete [] c1str; + delete [] c2str; delete [] rstr; delete [] contact; } @@ -176,7 +240,7 @@ RegCylinder::~RegCylinder() void RegCylinder::init() { Region::init(); - if (rstr) variable_check(); + if (varshape) variable_check(); } /* ---------------------------------------------------------------------- @@ -667,12 +731,27 @@ int RegCylinder::surface_exterior(double *x, double cutoff) void RegCylinder::shape_update() { - radius = input->variable->compute_equal(rvar); - if (radius < 0.0) - error->one(FLERR,"Variable evaluation in region gave bad value"); - if (axis == 'x') radius *= xscale; - else if (axis == 'y') radius*= yscale; - else radius *= zscale; + if (c1style == VARIABLE) c1 = input->variable->compute_equal(c1var); + if (c2style == VARIABLE) c2 = input->variable->compute_equal(c2var); + if (rstyle == VARIABLE) { + radius = input->variable->compute_equal(rvar); + if (radius < 0.0) + error->one(FLERR,"Variable evaluation in region gave bad value"); + } + + if (axis == 'x') { + if (c1style == VARIABLE) c1 *= yscale; + if (c2style == VARIABLE) c2 *= zscale; + if (rstyle == VARIABLE) radius *= yscale; + } else if (axis == 'y') { + if (c1style == VARIABLE) c1 *= xscale; + if (c2style == VARIABLE) c2 *= zscale; + if (rstyle == VARIABLE) radius *= xscale; + } else { // axis == 'z' + if (c1style == VARIABLE) c1 *= xscale; + if (c2style == VARIABLE) c2 *= yscale; + if (rstyle == VARIABLE) radius *= xscale; + } } /* ---------------------------------------------------------------------- @@ -681,11 +760,29 @@ void RegCylinder::shape_update() void RegCylinder::variable_check() { - rvar = input->variable->find(rstr); - if (rvar < 0) - error->all(FLERR,"Variable name for region cylinder does not exist"); - if (!input->variable->equalstyle(rvar)) - error->all(FLERR,"Variable for region cylinder is invalid style"); + if (c1style == VARIABLE) { + c1var = input->variable->find(c1str); + if (c1var < 0) + error->all(FLERR,"Variable name for region cylinder does not exist"); + if (!input->variable->equalstyle(c1var)) + error->all(FLERR,"Variable for region cylinder is invalid style"); + } + + if (c2style == VARIABLE) { + c2var = input->variable->find(c2str); + if (c2var < 0) + error->all(FLERR,"Variable name for region cylinder does not exist"); + if (!input->variable->equalstyle(c2var)) + error->all(FLERR,"Variable for region cylinder is invalid style"); + } + + if (rstyle == VARIABLE) { + rvar = input->variable->find(rstr); + if (rvar < 0) + error->all(FLERR,"Variable name for region cylinder does not exist"); + if (!input->variable->equalstyle(rvar)) + error->all(FLERR,"Variable for region cylinder is invalid style"); + } } diff --git a/src/region_cylinder.h b/src/region_cylinder.h index a6b513b2d7..55b4bf3142 100644 --- a/src/region_cylinder.h +++ b/src/region_cylinder.h @@ -43,8 +43,10 @@ class RegCylinder : public Region { double c1,c2; double radius; double lo,hi; + int c1style,c1var; + int c2style,c2var; int rstyle,rvar; - char *rstr; + char *c1str,*c2str,*rstr; void variable_check(); diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp index 5645b3369d..8080ef5882 100644 --- a/src/region_sphere.cpp +++ b/src/region_sphere.cpp @@ -28,15 +28,46 @@ enum{CONSTANT,VARIABLE}; /* ---------------------------------------------------------------------- */ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : - Region(lmp, narg, arg) + Region(lmp, narg, arg), xstr(NULL), ystr(NULL), zstr(NULL), rstr(NULL) { options(narg-6,&arg[6]); - xc = xscale*force->numeric(FLERR,arg[2]); - yc = yscale*force->numeric(FLERR,arg[3]); - zc = zscale*force->numeric(FLERR,arg[4]); + if (strstr(arg[2],"v_") == arg[2]) { + int n = strlen(arg[2]+2) + 1; + xstr = new char[n]; + strcpy(xstr,arg[2]+2); + xc = 0.0; + xstyle = VARIABLE; + varshape = 1; + } else { + xc = xscale*force->numeric(FLERR,arg[2]); + xstyle = CONSTANT; + } + + if (strstr(arg[3],"v_") == arg[3]) { + int n = strlen(arg[3]+2) + 1; + ystr = new char[n]; + strcpy(ystr,arg[3]+2); + yc = 0.0; + ystyle = VARIABLE; + varshape = 1; + } else { + yc = yscale*force->numeric(FLERR,arg[3]); + ystyle = CONSTANT; + } + + if (strstr(arg[4],"v_") == arg[4]) { + int n = strlen(arg[4]+2) + 1; + zstr = new char[n]; + strcpy(zstr,arg[4]+2); + zc = 0.0; + zstyle = VARIABLE; + varshape = 1; + } else { + zc = zscale*force->numeric(FLERR,arg[4]); + zstyle = CONSTANT; + } - rstr = NULL; if (strstr(arg[5],"v_") == arg[5]) { int n = strlen(&arg[5][2]) + 1; rstr = new char[n]; @@ -44,19 +75,22 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : radius = 0.0; rstyle = VARIABLE; varshape = 1; - variable_check(); - shape_update(); } else { radius = xscale*force->numeric(FLERR,arg[5]); rstyle = CONSTANT; } + if (varshape) { + variable_check(); + shape_update(); + } + // error check if (radius < 0.0) error->all(FLERR,"Illegal region sphere command"); // extent of sphere - // for variable radius, uses initial radius + // for variable radius, uses initial radius and origin for variable center if (interior) { bboxflag = 1; @@ -77,6 +111,9 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : RegSphere::~RegSphere() { + delete [] xstr; + delete [] ystr; + delete [] zstr; delete [] rstr; delete [] contact; } @@ -86,7 +123,7 @@ RegSphere::~RegSphere() void RegSphere::init() { Region::init(); - if (rstr) variable_check(); + if (varshape) variable_check(); } /* ---------------------------------------------------------------------- @@ -168,9 +205,20 @@ int RegSphere::surface_exterior(double *x, double cutoff) void RegSphere::shape_update() { - radius = xscale * input->variable->compute_equal(rvar); - if (radius < 0.0) - error->one(FLERR,"Variable evaluation in region gave bad value"); + if (xstyle == VARIABLE) + xc = xscale * input->variable->compute_equal(xvar); + + if (ystyle == VARIABLE) + yc = yscale * input->variable->compute_equal(yvar); + + if (zstyle == VARIABLE) + zc = zscale * input->variable->compute_equal(zvar); + + if (rstyle == VARIABLE) { + radius = xscale * input->variable->compute_equal(rvar); + if (radius < 0.0) + error->one(FLERR,"Variable evaluation in region gave bad value"); + } } /* ---------------------------------------------------------------------- @@ -179,13 +227,38 @@ void RegSphere::shape_update() void RegSphere::variable_check() { - rvar = input->variable->find(rstr); - if (rvar < 0) - error->all(FLERR,"Variable name for region sphere does not exist"); - if (!input->variable->equalstyle(rvar)) - error->all(FLERR,"Variable for region sphere is invalid style"); -} + if (xstyle == VARIABLE) { + xvar = input->variable->find(xstr); + if (xvar < 0) + error->all(FLERR,"Variable name for region sphere does not exist"); + if (!input->variable->equalstyle(xvar)) + error->all(FLERR,"Variable for region sphere is invalid style"); + } + if (ystyle == VARIABLE) { + yvar = input->variable->find(ystr); + if (yvar < 0) + error->all(FLERR,"Variable name for region sphere does not exist"); + if (!input->variable->equalstyle(yvar)) + error->all(FLERR,"Variable for region sphere is invalid style"); + } + + if (zstyle == VARIABLE) { + zvar = input->variable->find(zstr); + if (zvar < 0) + error->all(FLERR,"Variable name for region sphere does not exist"); + if (!input->variable->equalstyle(zvar)) + error->all(FLERR,"Variable for region sphere is invalid style"); + } + + if (rstyle == VARIABLE) { + rvar = input->variable->find(rstr); + if (rvar < 0) + error->all(FLERR,"Variable name for region sphere does not exist"); + if (!input->variable->equalstyle(rvar)) + error->all(FLERR,"Variable for region sphere is invalid style"); + } +} /* ---------------------------------------------------------------------- Set values needed to calculate velocity due to shape changes. diff --git a/src/region_sphere.h b/src/region_sphere.h index c003a91651..82bac6a619 100644 --- a/src/region_sphere.h +++ b/src/region_sphere.h @@ -40,8 +40,11 @@ class RegSphere : public Region { private: double xc,yc,zc; double radius; + int xstyle,xvar; + int ystyle,yvar; + int zstyle,zvar; int rstyle,rvar; - char *rstr; + char *xstr,*ystr,*zstr,*rstr; void variable_check(); }; From ea8376b3fa927c299b3b8f9ef05813202ad53c7f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 14 Dec 2018 14:21:31 -0500 Subject: [PATCH 52/94] skip writing redundant version information to the screen when using the -h/-help flag. --- src/lammps.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lammps.cpp b/src/lammps.cpp index 6c5f937c8a..67387d9a41 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -415,7 +415,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : } } - if (universe->me == 0) { + if ((universe->me == 0) && !helpflag) { if (screen) fprintf(screen,"LAMMPS (%s)\n",universe->version); if (logfile) fprintf(logfile,"LAMMPS (%s)\n",universe->version); } @@ -489,7 +489,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // screen and logfile messages for universe and world - if (universe->me == 0) { + if ((universe->me == 0) && (!helpflag)) { if (universe->uscreen) { fprintf(universe->uscreen,"LAMMPS (%s)\n",universe->version); fprintf(universe->uscreen,"Running on %d partitions of processors\n", @@ -502,7 +502,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : } } - if (me == 0) { + if ((me == 0) && (!helpflag)) { if (screen) { fprintf(screen,"LAMMPS (%s)\n",universe->version); fprintf(screen,"Processor partition = %d\n",universe->iworld); @@ -587,16 +587,15 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : memory->destroy(plast); } - // allocate top-level classes - - create(); - post_create(); - // if helpflag set, print help and quit with "success" status + // otherwise allocate top level classes. if (helpflag) { if (universe->me == 0 && screen) help(); error->done(0); + } else { + create(); + post_create(); } // if either restart conversion option was used, invoke 2 commands and quit From 94a4b599610942b8ae756d9eb002eeeeb902ade2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 14 Dec 2018 14:22:13 -0500 Subject: [PATCH 53/94] place queries for OS and compiler into functions in Info and use them for both, the info command and lmp -h/-help --- src/info.cpp | 117 +++++++++++++++++++++++++++++++++---------------- src/info.h | 3 ++ src/lammps.cpp | 8 ++++ 3 files changed, 90 insertions(+), 38 deletions(-) diff --git a/src/info.cpp b/src/info.cpp index 672ce72b74..20ad2a4b8b 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -262,11 +262,20 @@ void Info::command(int narg, char **arg) if (flags & CONFIG) { fprintf(out,"\nLAMMPS version: %s / %s\n\n", universe->version, universe->num_ver); + + char *infobuf = get_os_info(); + fprintf(out,"\nOS information: %s\n",infobuf); + delete[] infobuf; + fprintf(out,"sizeof(smallint): %3d-bit\n",(int)sizeof(smallint)*8); fprintf(out,"sizeof(imageint): %3d-bit\n",(int)sizeof(imageint)*8); fprintf(out,"sizeof(tagint): %3d-bit\n",(int)sizeof(tagint)*8); fprintf(out,"sizeof(bigint): %3d-bit\n",(int)sizeof(bigint)*8); + infobuf = get_compiler_info(); + fprintf(out,"\nCompiler: %s\n",infobuf); + delete[] infobuf; + fputs("\nActive compile time flags:\n\n",out); if (has_gzip_support()) fputs("-DLAMMPS_GZIP\n",out); if (has_png_support()) fputs("-DLAMMPS_PNG\n",out); @@ -274,6 +283,14 @@ void Info::command(int narg, char **arg) if (has_ffmpeg_support()) fputs("-DLAMMPS_FFMPEG\n",out); if (has_exceptions()) fputs("-DLAMMPS_EXCEPTIONS\n",out); +#if defined(LAMMPS_BIGBIG) + fputs("-DLAMMPS_BIGBIG\n",out); +#elif defined(LAMMPS_SMALLBIG) + fputs("-DLAMMPS_SMALLBIG\n",out); +#else // defined(LAMMPS_SMALLSMALL) + fputs("-DLAMMPS_SMALLSMALL\n",out); +#endif + const char *pkg; int ncword, ncline = 0; @@ -288,44 +305,6 @@ void Info::command(int narg, char **arg) ncline += ncword + 1; } fputs("\n",out); - -#if defined(_WIN32) - DWORD fullversion,majorv,minorv,buildv=0; - - fullversion = GetVersion(); - majorv = (DWORD) (LOBYTE(LOWORD(fullversion))); - minorv = (DWORD) (HIBYTE(LOWORD(fullversion))); - if (fullversion < 0x80000000) - buildv = (DWORD) (HIWORD(fullversion)); - - SYSTEM_INFO si; - GetSystemInfo(&si); - - const char *machine; - switch (si.wProcessorArchitecture) { - case PROCESSOR_ARCHITECTURE_AMD64: - machine = (const char *) "x86_64"; - break; - case PROCESSOR_ARCHITECTURE_ARM: - machine = (const char *) "arm"; - break; - case PROCESSOR_ARCHITECTURE_IA64: - machine = (const char *) "ia64"; - break; - case PROCESSOR_ARCHITECTURE_INTEL: - machine = (const char *) "i386"; - break; - default: - machine = (const char *) "(unknown)"; - } - fprintf(out,"\nOS information: Windows %d.%d (%d) on %s\n", - majorv,minorv,buildv,machine); -#else - struct utsname ut; - uname(&ut); - fprintf(out,"\nOS information: %s %s on %s\n", - ut.sysname, ut.release, ut.machine); -#endif } if (flags & MEMORY) { @@ -1103,6 +1082,68 @@ bool Info::has_package(const char * package_name) { return false; } +/* ---------------------------------------------------------------------- */ +#define _INFOBUF_SIZE 256 + +char *Info::get_os_info() +{ + char *buf = new char[_INFOBUF_SIZE]; + +#if defined(_WIN32) + DWORD fullversion,majorv,minorv,buildv=0; + + fullversion = GetVersion(); + majorv = (DWORD) (LOBYTE(LOWORD(fullversion))); + minorv = (DWORD) (HIBYTE(LOWORD(fullversion))); + if (fullversion < 0x80000000) + buildv = (DWORD) (HIWORD(fullversion)); + + SYSTEM_INFO si; + GetSystemInfo(&si); + + const char *machine; + switch (si.wProcessorArchitecture) { + case PROCESSOR_ARCHITECTURE_AMD64: + machine = (const char *) "x86_64"; + break; + case PROCESSOR_ARCHITECTURE_ARM: + machine = (const char *) "arm"; + break; + case PROCESSOR_ARCHITECTURE_IA64: + machine = (const char *) "ia64"; + break; + case PROCESSOR_ARCHITECTURE_INTEL: + machine = (const char *) "i386"; + break; + default: + machine = (const char *) "(unknown)"; + } + snprintf(buf,_INFOBUF_SIZE,"Windows %d.%d (%d) on %s", + majorv,minorv,buildv,machine); +#else + struct utsname ut; + uname(&ut); + snprintf(buf,_INFOBUF_SIZE,"%s %s on %s", + ut.sysname, ut.release, ut.machine); +#endif + return buf; +} + +char *Info::get_compiler_info() +{ + char *buf = new char[_INFOBUF_SIZE]; +#if __clang__ + snprintf(buf,_INFOBUF_SIZE,"Clang C++ %s", __VERSION__); +#elif __INTEL_COMPILER + snprintf(buf,_INFOBUF_SIZE,"Intel C++ %s", __VERSION__); +#elif __GNUC__ + snprintf(buf,_INFOBUF_SIZE,"GNU C++ %s", __VERSION__); +#else + snprintf(buf,_INFOBUF_SIZE,"(Unknown)"); +#endif + return buf; +} + /* ---------------------------------------------------------------------- */ char **Info::get_variable_names(int &num) { diff --git a/src/info.h b/src/info.h index 058400df78..2ad8424393 100644 --- a/src/info.h +++ b/src/info.h @@ -40,6 +40,9 @@ class Info : protected Pointers { static bool has_exceptions(); static bool has_package(const char * package_name); + static char *get_os_info(); + static char *get_compiler_info(); + char **get_variable_names(int &num); private: diff --git a/src/lammps.cpp b/src/lammps.cpp index 67387d9a41..29926732ec 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -1081,6 +1081,14 @@ void LAMMPS::print_config(FILE *fp) const char *pkg; int ncword, ncline = 0; + char *infobuf = Info::get_os_info(); + fprintf(fp,"OS: %s\n\n",infobuf); + delete[] infobuf; + + infobuf = Info::get_compiler_info(); + fprintf(fp,"Compiler: %s\n\n",infobuf); + delete[] infobuf; + fputs("Active compile time flags:\n\n",fp); if (Info::has_gzip_support()) fputs("-DLAMMPS_GZIP\n",fp); if (Info::has_png_support()) fputs("-DLAMMPS_PNG\n",fp); From 875f7776c67342922ae22661ea311a625fba79ad Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 14 Dec 2018 15:28:31 -0500 Subject: [PATCH 54/94] small whitespace adjustment --- src/info.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.cpp b/src/info.cpp index 20ad2a4b8b..ec4e3ce9a9 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -264,7 +264,7 @@ void Info::command(int narg, char **arg) universe->version, universe->num_ver); char *infobuf = get_os_info(); - fprintf(out,"\nOS information: %s\n",infobuf); + fprintf(out,"OS information: %s\n\n",infobuf); delete[] infobuf; fprintf(out,"sizeof(smallint): %3d-bit\n",(int)sizeof(smallint)*8); From 24e2d4bb49fe4446c1db6188f69cbae2bd69740a Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 14 Dec 2018 18:27:34 -0700 Subject: [PATCH 55/94] Added changes to other FixNH variants (just KOKKOS, in this case) --- src/KOKKOS/fix_nh_kokkos.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/KOKKOS/fix_nh_kokkos.cpp b/src/KOKKOS/fix_nh_kokkos.cpp index 42d421e92e..9e86e47bc9 100644 --- a/src/KOKKOS/fix_nh_kokkos.cpp +++ b/src/KOKKOS/fix_nh_kokkos.cpp @@ -269,7 +269,10 @@ void FixNHKokkos::final_integrate() //atomKK->sync(pressure->execution_space,pressure->datamask_read); //atomKK->modified(pressure->execution_space,pressure->datamask_modify); if (pstyle == ISO) pressure->compute_scalar(); - else pressure->compute_vector(); + else { + temperature->compute_vector(); + pressure->compute_vector(); + } couple(); pressure->addstep(update->ntimestep+1); } From f7a2cd689bdd7cbc74b0ea60fc786f7e4137fe49 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 15 Dec 2018 19:14:59 -0500 Subject: [PATCH 56/94] document default setting for flip flag --- doc/src/fix_nh.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/fix_nh.txt b/doc/src/fix_nh.txt index 1071e1f808..a07d4e7965 100644 --- a/doc/src/fix_nh.txt +++ b/doc/src/fix_nh.txt @@ -626,10 +626,10 @@ over time or the atom count becomes very small. [Default:] -The keyword defaults are tchain = 3, pchain = 3, mtk = yes, tloop = +The keyword defaults are tchain = 3, pchain = 3, mtk = yes, tloop = 1, ploop = 1, nreset = 0, drag = 0.0, dilate = all, couple = none, -scaleyz = scalexz = scalexy = yes if periodic in 2nd dimension and -not coupled to barostat, otherwise no. +flip = yes, scaleyz = scalexz = scalexy = yes if periodic in 2nd +dimension and not coupled to barostat, otherwise no. :line From 5508438ba19615c9e2d6f15098c36333c73348e2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 16 Dec 2018 18:30:44 -0500 Subject: [PATCH 57/94] make included Pizza.py code for reading dumps compatible with python 2.7 --- tools/python/pizza/dump.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/python/pizza/dump.py b/tools/python/pizza/dump.py index 36a24dcd39..8098a2c4b7 100644 --- a/tools/python/pizza/dump.py +++ b/tools/python/pizza/dump.py @@ -472,7 +472,7 @@ class dump: yprdinv = 1.0 / (snap.yhi - snap.ylo) zprdinv = 1.0 / (snap.zhi - snap.zlo) atoms = snap.atoms - if atoms != None: + if type(atoms) != types.NoneType: atoms[:,x] = (atoms[:,x] - snap.xlo) * xprdinv atoms[:,y] = (atoms[:,y] - snap.ylo) * yprdinv atoms[:,z] = (atoms[:,z] - snap.zlo) * zprdinv @@ -502,7 +502,7 @@ class dump: h4inv = (h3*h5 - h1*h4) / (h0*h1*h2) h5inv = xy / (h0*h1) atoms = snap.atoms - if atoms != None: + if type(atoms) != types.NoneType: atoms[:,x] = (atoms[:,x] - snap.xlo)*h0inv + \ (atoms[:,y] - snap.ylo)*h5inv + \ (atoms[:,z] - snap.zlo)*h4inv @@ -536,7 +536,7 @@ class dump: yprd = snap.yhi - snap.ylo zprd = snap.zhi - snap.zlo atoms = snap.atoms - if atoms != None: + if type(atoms) != types.NoneType: atoms[:,x] = snap.xlo + atoms[:,x]*xprd atoms[:,y] = snap.ylo + atoms[:,y]*yprd atoms[:,z] = snap.zlo + atoms[:,z]*zprd @@ -560,7 +560,7 @@ class dump: h4 = xz h5 = xy atoms = snap.atoms - if atoms != None: + if type(atoms) != types.NoneType: atoms[:,x] = snap.xlo + atoms[:,x]*h0 + atoms[:,y]*h5 + atoms[:,z]*h4 atoms[:,y] = snap.ylo + atoms[:,y]*h1 + atoms[:,z]*h3 atoms[:,z] = snap.zlo + atoms[:,z]*h2 From 34e0c05b092c5ebde43be80fbf3c49a9e88464f2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 16 Dec 2018 20:36:48 -0500 Subject: [PATCH 58/94] allow -suffix and -package command line flags to be use independently --- src/lammps.cpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/lammps.cpp b/src/lammps.cpp index 29926732ec..944033264c 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -761,26 +761,27 @@ void LAMMPS::post_create() // check that KOKKOS package classes were instantiated // check that GPU, INTEL, USER-OMP fixes were compiled with LAMMPS - if (!suffix_enable) return; + if (suffix_enable) { - if (strcmp(suffix,"gpu") == 0 && !modify->check_package("GPU")) - error->all(FLERR,"Using suffix gpu without GPU package installed"); - if (strcmp(suffix,"intel") == 0 && !modify->check_package("INTEL")) - error->all(FLERR,"Using suffix intel without USER-INTEL package installed"); - if (strcmp(suffix,"kk") == 0 && - (kokkos == NULL || kokkos->kokkos_exists == 0)) - error->all(FLERR,"Using suffix kk without KOKKOS package enabled"); - if (strcmp(suffix,"omp") == 0 && !modify->check_package("OMP")) - error->all(FLERR,"Using suffix omp without USER-OMP package installed"); + if (strcmp(suffix,"gpu") == 0 && !modify->check_package("GPU")) + error->all(FLERR,"Using suffix gpu without GPU package installed"); + if (strcmp(suffix,"intel") == 0 && !modify->check_package("INTEL")) + error->all(FLERR,"Using suffix intel without USER-INTEL package installed"); + if (strcmp(suffix,"kk") == 0 && + (kokkos == NULL || kokkos->kokkos_exists == 0)) + error->all(FLERR,"Using suffix kk without KOKKOS package enabled"); + if (strcmp(suffix,"omp") == 0 && !modify->check_package("OMP")) + error->all(FLERR,"Using suffix omp without USER-OMP package installed"); - if (strcmp(suffix,"gpu") == 0) input->one("package gpu 1"); - if (strcmp(suffix,"intel") == 0) input->one("package intel 1"); - if (strcmp(suffix,"omp") == 0) input->one("package omp 0"); + if (strcmp(suffix,"gpu") == 0) input->one("package gpu 1"); + if (strcmp(suffix,"intel") == 0) input->one("package intel 1"); + if (strcmp(suffix,"omp") == 0) input->one("package omp 0"); - if (suffix2) { - if (strcmp(suffix2,"gpu") == 0) input->one("package gpu 1"); - if (strcmp(suffix2,"intel") == 0) input->one("package intel 1"); - if (strcmp(suffix2,"omp") == 0) input->one("package omp 0"); + if (suffix2) { + if (strcmp(suffix2,"gpu") == 0) input->one("package gpu 1"); + if (strcmp(suffix2,"intel") == 0) input->one("package intel 1"); + if (strcmp(suffix2,"omp") == 0) input->one("package omp 0"); + } } // invoke any command-line package commands From 6625a066b6a5eb18239ca7becc4824896371f020 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Mon, 17 Dec 2018 17:57:51 +0100 Subject: [PATCH 59/94] Update pair_lj_class2.h --- src/CLASS2/pair_lj_class2.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CLASS2/pair_lj_class2.h b/src/CLASS2/pair_lj_class2.h index 4a89ce2a3f..02a1f44ff7 100644 --- a/src/CLASS2/pair_lj_class2.h +++ b/src/CLASS2/pair_lj_class2.h @@ -39,6 +39,7 @@ class PairLJClass2 : public Pair { void write_data(FILE *); void write_data_all(FILE *); double single(int, int, int, int, double, double, double, double &); + void *extract(const char *, int &); protected: double cut_global; From 0ad44efe24ef8117e08b6b852b750fb2de49d13e Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Mon, 17 Dec 2018 18:00:47 +0100 Subject: [PATCH 60/94] Update pair_lj_class2_coul_cut.h --- src/CLASS2/pair_lj_class2_coul_cut.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CLASS2/pair_lj_class2_coul_cut.h b/src/CLASS2/pair_lj_class2_coul_cut.h index 9b9c654ec6..f33502e23a 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.h +++ b/src/CLASS2/pair_lj_class2_coul_cut.h @@ -40,6 +40,7 @@ class PairLJClass2CoulCut : public Pair { void write_data(FILE *); void write_data_all(FILE *); double single(int, int, int, int, double, double, double, double &); + void *extract(const char *, int &); protected: double cut_lj_global,cut_coul_global; From 968e56694ff0a5bb2f87958265f1c8c2a399d3ec Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Mon, 17 Dec 2018 18:02:27 +0100 Subject: [PATCH 61/94] Update pair_lj_class2.cpp --- src/CLASS2/pair_lj_class2.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp index 6451921dc5..e6546b1acc 100644 --- a/src/CLASS2/pair_lj_class2.cpp +++ b/src/CLASS2/pair_lj_class2.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include "pair_lj_class2.h" #include "atom.h" #include "comm.h" @@ -394,3 +395,13 @@ double PairLJClass2::single(int /*i*/, int /*j*/, int itype, int jtype, double r offset[itype][jtype]; return factor_lj*philj; } + +/* ---------------------------------------------------------------------- */ + +void *PairLJClass2::extract(const char *str, int &dim) +{ + dim = 2; + if (strcmp(str,"epsilon") == 0) return (void *) epsilon; + if (strcmp(str,"sigma") == 0) return (void *) sigma; + return NULL; +} From d91c7f38f6dbd1da75a2fb657e300658d7fabfc8 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Mon, 17 Dec 2018 18:03:25 +0100 Subject: [PATCH 62/94] Update pair_lj_class2_coul_cut.cpp --- src/CLASS2/pair_lj_class2_coul_cut.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp index 5cd5ad0e32..8c1a5bf560 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.cpp +++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include "pair_lj_class2_coul_cut.h" #include "atom.h" #include "comm.h" @@ -466,3 +467,16 @@ double PairLJClass2CoulCut::single(int i, int j, int itype, int jtype, return eng; } + +/* ---------------------------------------------------------------------- */ + +void *PairLJClass2CoulCut::extract(const char *str, int &dim) +{ + dim = 0; + if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; + dim = 2; + if (strcmp(str,"epsilon") == 0) return (void *) epsilon; + if (strcmp(str,"sigma") == 0) return (void *) sigma; + return NULL; +} + From 96eb0ad527a1a7bd22260ebfee4a1d84526f1748 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Mon, 17 Dec 2018 18:04:13 +0100 Subject: [PATCH 63/94] Update pair_lj_class2_coul_long.cpp --- src/CLASS2/pair_lj_class2_coul_long.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index bf892bc894..04dbb7fcce 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -549,5 +549,8 @@ void *PairLJClass2CoulLong::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; + dim = 2; + if (strcmp(str,"epsilon") == 0) return (void *) epsilon; + if (strcmp(str,"sigma") == 0) return (void *) sigma; return NULL; } From 90e125a73a4efad02c0a038d5e65ebb86bde2543 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 17 Dec 2018 14:03:26 -0500 Subject: [PATCH 64/94] make error message for input parameter type mismatch more specific to show what is incorrect --- doc/src/Errors_common.txt | 5 ++- src/force.cpp | 68 +++++++++++++++++++++------------------ 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/doc/src/Errors_common.txt b/doc/src/Errors_common.txt index 651040ebc9..da90aad64b 100644 --- a/doc/src/Errors_common.txt +++ b/doc/src/Errors_common.txt @@ -74,7 +74,7 @@ is an integer or floating-point number, respectively, and reject the input with an error message (for instance, when an integer is required, but a floating-point number 1.0 is provided): -ERROR: Expected integer parameter in input script or data file :pre +ERROR: Expected integer parameter instead of '1.0' in input script or data file :pre Some commands allow for using variable references in place of numeric constants so that the value can be evaluated and may change over the @@ -85,6 +85,9 @@ reading the input and before parsing commands, NOTE: Using a variable reference (i.e. {v_name}) is only allowed if the documentation of the corresponding command explicitly says it is. +Otherwise, you will receive an error message of this kind: + +ERROR: Expected floating point parameter instead of 'v_name' in input script or data file :pre Generally, LAMMPS will print a message to the screen and logfile and exit gracefully when it encounters a fatal error. Sometimes it will diff --git a/src/force.cpp b/src/force.cpp index 2bfd809451..567cf2c9c5 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -934,20 +934,21 @@ void Force::boundsbig(const char *file, int line, char *str, double Force::numeric(const char *file, int line, char *str) { - if (!str) - error->all(file,line,"Expected floating point parameter " - "in input script or data file"); - int n = strlen(str); + int n = 0; + + if (str) n = strlen(str); if (n == 0) - error->all(file,line,"Expected floating point parameter " - "in input script or data file"); + error->all(file,line,"Expected floating point parameter instead of" + " NULL or empty string in input script or data file"); for (int i = 0; i < n; i++) { if (isdigit(str[i])) continue; if (str[i] == '-' || str[i] == '+' || str[i] == '.') continue; if (str[i] == 'e' || str[i] == 'E') continue; - error->all(file,line,"Expected floating point parameter " - "in input script or data file"); + char msg[256]; + snprintf(msg,256,"Expected floating point parameter instead of " + "'%s' in input script or data file",str); + error->all(file,line,msg); } return atof(str); @@ -961,18 +962,19 @@ double Force::numeric(const char *file, int line, char *str) int Force::inumeric(const char *file, int line, char *str) { - if (!str) - error->all(file,line, - "Expected integer parameter in input script or data file"); - int n = strlen(str); + int n = 0; + + if (str) n = strlen(str); if (n == 0) - error->all(file,line, - "Expected integer parameter in input script or data file"); + error->all(file,line,"Expected integer parameter instead of " + "NULL or empty string in input script or data file"); for (int i = 0; i < n; i++) { if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue; - error->all(file,line, - "Expected integer parameter in input script or data file"); + char msg[256]; + snprintf(msg,256,"Expected integer parameter instead of " + "'%s' in input script or data file",str); + error->all(file,line,msg); } return atoi(str); @@ -986,18 +988,19 @@ int Force::inumeric(const char *file, int line, char *str) bigint Force::bnumeric(const char *file, int line, char *str) { - if (!str) - error->all(file,line, - "Expected integer parameter in input script or data file"); - int n = strlen(str); + int n = 0; + + if (str) n = strlen(str); if (n == 0) - error->all(file,line, - "Expected integer parameter in input script or data file"); + error->all(file,line,"Expected integer parameter instead of " + "NULL or empty string in input script or data file"); for (int i = 0; i < n; i++) { if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue; - error->all(file,line, - "Expected integer parameter in input script or data file"); + char msg[256]; + snprintf(msg,256,"Expected integer parameter instead of " + "'%s' in input script or data file",str); + error->all(file,line,msg); } return ATOBIGINT(str); @@ -1011,18 +1014,19 @@ bigint Force::bnumeric(const char *file, int line, char *str) tagint Force::tnumeric(const char *file, int line, char *str) { - if (!str) - error->all(file,line, - "Expected integer parameter in input script or data file"); - int n = strlen(str); + int n = 0; + + if (str) n = strlen(str); if (n == 0) - error->all(file,line, - "Expected integer parameter in input script or data file"); + error->all(file,line,"Expected integer parameter instead of " + "NULL or empty string in input script or data file"); for (int i = 0; i < n; i++) { if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue; - error->all(file,line, - "Expected integer parameter in input script or data file"); + char msg[256]; + snprintf(msg,256,"Expected integer parameter instead of " + "'%s' in input script or data file",str); + error->all(file,line,msg); } return ATOTAGINT(str); From caba050f2905ca5d2c4ee5f52ab0c1247c80027b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 19 Dec 2018 02:03:27 -0500 Subject: [PATCH 65/94] update list of items to check for contributing code to current status --- doc/src/Modify_contribute.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/src/Modify_contribute.txt b/doc/src/Modify_contribute.txt index 61b1405106..31d459de1a 100644 --- a/doc/src/Modify_contribute.txt +++ b/doc/src/Modify_contribute.txt @@ -108,9 +108,13 @@ your contribution(s) to be added to main LAMMPS code or one of its standard packages, it needs to be written in a style compatible with other LAMMPS source files. This means: 2-character indentation per level, [no tabs], no lines over 80 characters. I/O is done via -the C-style stdio library, class header files should not import any -system headers outside , STL containers should be avoided -in headers, and forward declarations used where possible or needed. +the C-style stdio library (mixing of stdio and iostreams is generally +discouraged), class header files should not import any system headers +outside of , STL containers should be avoided in headers, +system header from the C library should use the C++-style names +(, , or ) instead of the C-style names +, , or ), and forward declarations +used where possible or needed to avoid including headers. All added code should be placed into the LAMMPS_NS namespace or a sub-namespace; global or static variables should be avoided, as they conflict with the modular nature of LAMMPS and the C++ class structure. From ba3ee71edfd89637cfeca66b05434145398c4fbf Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 19 Dec 2018 02:09:31 -0500 Subject: [PATCH 66/94] update the github workflow checklist with a missing requirement --- doc/github-development-workflow.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/github-development-workflow.md b/doc/github-development-workflow.md index a34c3389df..2a5e34bb63 100644 --- a/doc/github-development-workflow.md +++ b/doc/github-development-workflow.md @@ -139,6 +139,7 @@ Here are some items to check: Forward declarations should be used instead when possible. * iostreams should be avoided. LAMMPS uses stdio from the C-library. * use of STL in headers and class definitions should be avoided. + * there must not be any "using namespace XXX;" statements in headers. * static class members should be avoided at all cost. * anything storing atom IDs should be using `tagint` and not `int`. This can be flagged by the compiler only for pointers and only when From 5fb8f23cb4e8b8149707619ae01b3295cfad937f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 19 Dec 2018 02:24:16 -0500 Subject: [PATCH 67/94] update false positives list for recent manual changes --- doc/utils/sphinx-config/false_positives.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 92eebaa7ff..40622ed91d 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -436,6 +436,9 @@ CSiC csld cslib CSlib +cstdio +cstdlib +cstring cstyle csvr Ctypes @@ -1135,6 +1138,7 @@ inv invariants inversed ionocovalent +iostreams iparam ipi ipp @@ -2500,7 +2504,9 @@ Startstep statcoul statcoulombs statvolt +stdlib stdin +stdio steelblue Stegailov Steinbach From 685ed827d7daa371fd86033dbfdd30f41c80424b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 19 Dec 2018 06:46:19 -0500 Subject: [PATCH 68/94] small formatting changes --- doc/github-development-workflow.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/github-development-workflow.md b/doc/github-development-workflow.md index 2a5e34bb63..e4cd7cbbdb 100644 --- a/doc/github-development-workflow.md +++ b/doc/github-development-workflow.md @@ -6,7 +6,7 @@ choices the LAMMPS developers have agreed on. Git and GitHub provide the tools, but do not set policies, so it is up to the developers to come to an agreement as to how to define and interpret policies. This document is likely to change as our experiences and needs change and we try to -adapt accordingly. Last change 2018-11-15. +adapt accordingly. Last change 2018-12-19. ## Table of Contents @@ -129,17 +129,17 @@ Here are some items to check: * stdlib.h -> cstdlib * string.h -> cstring * time.h -> ctime - Do not replace (as they are C++-11): `inttypes.h` and `stdint.h`. + * Do NOT replace (as they are C++-11): `inttypes.h` and `stdint.h`. * Code should follow the C++-98 standard. C++-11 is only accepted in individual special purpose packages - * indentation is two spaces per level - * there should be no tabs and no trailing whitespace + * indentation is 2 spaces per level + * there should be NO tabs and no trailing whitespace * header files, especially of new styles, should not include any other headers, except the header with the base class or cstdio. Forward declarations should be used instead when possible. * iostreams should be avoided. LAMMPS uses stdio from the C-library. * use of STL in headers and class definitions should be avoided. - * there must not be any "using namespace XXX;" statements in headers. + * there MUST NOT be any "using namespace XXX;" statements in headers. * static class members should be avoided at all cost. * anything storing atom IDs should be using `tagint` and not `int`. This can be flagged by the compiler only for pointers and only when From 6ebef96c23983fbed54c2ba7ab078e17a0a117a9 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Thu, 20 Dec 2018 08:58:32 -0700 Subject: [PATCH 69/94] Gentoo is not pre-built --- doc/src/Install_linux.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/Install_linux.txt b/doc/src/Install_linux.txt index f1da9de66e..4e965a156e 100644 --- a/doc/src/Install_linux.txt +++ b/doc/src/Install_linux.txt @@ -15,7 +15,7 @@ Binaries are available for different versions of Linux: "Pre-built Fedora Linux executables"_#fedora "Pre-built EPEL Linux executables (RHEL, CentOS)"_#epel "Pre-built OpenSuse Linux executables"_#opensuse -"Pre-built Gentoo Linux executable"_#gentoo :all(b) +"Gentoo Linux executable"_#gentoo :all(b) :line @@ -150,7 +150,7 @@ Thanks to Christoph Junghans (LANL) for making LAMMPS available in OpenSuse. :line -Pre-built Gentoo Linux executable :h4,link(gentoo) +Gentoo Linux executable :h4,link(gentoo) LAMMPS is part of Gentoo's main package tree and can be installed by typing: From e2d871ac23ca903e381a36183c6962b5e6b20406 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Thu, 20 Dec 2018 09:01:44 -0700 Subject: [PATCH 70/94] update Fedora rpm docu --- doc/src/Install_linux.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/Install_linux.txt b/doc/src/Install_linux.txt index 4e965a156e..ec063e7a95 100644 --- a/doc/src/Install_linux.txt +++ b/doc/src/Install_linux.txt @@ -87,11 +87,11 @@ linking to the C library interface (lammps-devel, lammps-mpich-devel, lammps-openmpi-devel), the header for compiling programs using the C library interface (lammps-headers), and the LAMMPS python module for Python 3. All packages can be installed at the same -time and the name of the LAMMPS executable is {lmp} in all 3 cases. -By default, {lmp} will refer to the serial executable, unless -one of the MPI environment modules is loaded +time and the name of the LAMMPS executable is {lmp} and {lmp_openmpi} +or {lmp_mpich} respectively. By default, {lmp} will refer to the +serial executable, unless one of the MPI environment modules is loaded ("module load mpi/mpich-x86_64" or "module load mpi/openmpi-x86_64"). -Then the corresponding parallel LAMMPS executable is used. +Then the corresponding parallel LAMMPS executable can be used. The same mechanism applies when loading the LAMMPS python module. To install LAMMPS with OpenMPI and run an input in.lj with 2 CPUs do: From f8a5a78c2c66e43dc62432e810cdec0205c2ad7a Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Thu, 20 Dec 2018 09:17:34 -0700 Subject: [PATCH 71/94] doc: add CMAKE_VERBOSE_MAKEFILE and CXX_COMPILER_LAUNCHER --- cmake/README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index ae9ea8d1f7..ce3b4502af 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -24,7 +24,7 @@ tasks, act as a reference and provide examples of typical use cases. * [Build directory vs. Source Directory](#build-directory-vs-source-directory) * [Defining and using presets](#defining-and-using-presets) * [Reference](#reference) - * [Common CMAKE Configuration Options](#common-cmake-configuration-options) + * [Common CMake Configuration Options](#common-cmake-configuration-options) * [LAMMPS Configuration Options](#lammps-configuration-options) * [Parallelization and Accelerator Packages](#parallelization-and-accelerator-packages) * [Default Packages](#default-packages) @@ -179,7 +179,7 @@ cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake # Reference -## Common CMAKE Configuration Options +## Common CMake Configuration Options @@ -208,6 +208,16 @@ cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake + + + + +
Enable verbose output from Makefile builds (useful for debugging), the same can be achived by adding `VERBOSE=1` to the `make` call. +
+
off (default)
+
on
+
+
@@ -1729,6 +1739,13 @@ cache by setting the `CMAKE_C_COMPILER`, `CMAKE_CXX_COMPILER`, value of `FC` environment variable at first `cmake` run + + CXX_COMPILER_LAUNCHER + CMake will run this tool and pass the compiler and its arguments to the tool. Some example tools are distcc and ccache. + + (empty) + + From cc1c93a3d9ddaa65a6784199a1f85185ce13ea33 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Dec 2018 00:24:58 -0500 Subject: [PATCH 72/94] correct broken formatting and add explicit links to ParmEd and InterMol, a few tweaks --- doc/src/Intro_nonfeatures.txt | 37 ++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/doc/src/Intro_nonfeatures.txt b/doc/src/Intro_nonfeatures.txt index 5d4b556e7c..079d25ed54 100644 --- a/doc/src/Intro_nonfeatures.txt +++ b/doc/src/Intro_nonfeatures.txt @@ -16,7 +16,7 @@ functionality for setting up simulations and analyzing their output. Specifically, LAMMPS was not conceived and designed for: being run thru a GUI -build molecular systems, or building molecular topologies +building molecular systems, or building molecular topologies assign force-field coefficients automagically perform sophisticated analysis of your MD simulation visualize your MD simulation interactively @@ -24,18 +24,18 @@ plot your output data :ul Although over the years these limitations have been somewhat reduced through features added to LAMMPS or external tools -that either interface with LAMMPS or extend LAMMPS. +that either closely interface with LAMMPS or extend LAMMPS. Here are suggestions on how to perform these tasks: -GUI: LAMMPS can be built as a library and a Python wrapper that wraps +[GUI:] LAMMPS can be built as a library and a Python wrapper that wraps the library interface is provided. Thus, GUI interfaces can be written in Python (or C or C++ if desired) that run LAMMPS and visualize or plot its output. Examples of this are provided in the python directory and described on the "Python"_Python_head.html doc -page. Also, there are several external wrappers or GUI front ends.:ulb,l +page. Also, there are several external wrappers or GUI front ends. :ulb,l -Builder: Several pre-processing tools are packaged with LAMMPS. Some +[Builder:] Several pre-processing tools are packaged with LAMMPS. Some of them convert input files in formats produced by other MD codes such as CHARMM, AMBER, or Insight into LAMMPS input formats. Some of them are simple programs that will build simple molecular systems, such as @@ -45,15 +45,20 @@ the "Tools"_Tools.html doc page for details on tools packaged with LAMMPS. The "Pre/post processing page"_http:/lammps.sandia.gov/prepost.html of the LAMMPS website describes a variety of 3rd party tools for this task. Furthermore, -some LAMMPS internal commands to reconstruct topology, as well as -the option to insert molecule templates instead of atoms.:l +some LAMMPS internal commands allow to reconstruct, or selectively add +topology information, as well as provide the option to insert molecule +templates instead of atoms for building bulk molecular systems. :l -Force-field assignment: The conversion tools described in the previous +[Force-field assignment:] The conversion tools described in the previous bullet for CHARMM, AMBER, and Insight will also assign force field coefficients in the LAMMPS format, assuming you provide CHARMM, AMBER, -or BIOVIA (formerly Accelrys) force field files. :l +or BIOVIA (formerly Accelrys) force field files. The tools +"ParmEd"_https://parmed.github.io/ParmEd/html/index.html and +"InterMol"_https://github.com/shirtsgroup/InterMol are particularly +powerful and flexible in converting force field and topology data +between various MD simulation programs. :l -Simulation analysis: If you want to perform analysis on-the-fly as +[Simulation analysis:] If you want to perform analysis on-the-fly as your simulation runs, see the "compute"_compute.html and "fix"_fix.html doc pages, which list commands that can be used in a LAMMPS input script. Also see the "Modify"_Modify.html doc page for @@ -71,22 +76,22 @@ tools/python directory can extract and massage data in dump files to make it easier to import into other programs. See the "Tools"_Tools.html doc page for details on these various options. :l -Visualization: LAMMPS can produce JPG or PNG snapshot images +[Visualization:] LAMMPS can produce NETPBM, JPG or PNG snapshot images on-the-fly via its "dump image"_dump_image.html command and pass -them to an external program FFmpeg to generate movies from them. For -high-quality, interactive visualization there are many excellent and -free tools available. See the "Other Codes +them to an external program, "FFmpeg"_https://www.ffmpeg.org to generate +movies from them. For high-quality, interactive visualization there are +many excellent and free tools available. See the "Other Codes page"_http://lammps.sandia.gov/viz.html page of the LAMMPS website for visualization packages that can use LAMMPS output data. :l -Plotting: See the next bullet about Pizza.py as well as the +[Plotting:] See the next bullet about Pizza.py as well as the "Python"_Python_head.html doc page for examples of plotting LAMMPS output. Scripts provided with the {python} tool in the tools directory will extract and massage data in log and dump files to make it easier to analyze and plot. See the "Tools"_Tools.html doc page for more discussion of the various tools. :l -Pizza.py: Our group has also written a separate toolkit called +[Pizza.py:] Our group has also written a separate toolkit called "Pizza.py"_http://pizza.sandia.gov which can do certain kinds of setup, analysis, plotting, and visualization (via OpenGL) for LAMMPS simulations. It thus provides some functionality for several of the From 2d4411130ff12b6247fbe99d90e4c54822d503bb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Dec 2018 01:01:07 -0500 Subject: [PATCH 73/94] ensure that binsize is initialized in all cases --- src/atom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atom.cpp b/src/atom.cpp index 72bdc8a0e7..315097261b 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -1886,7 +1886,7 @@ void Atom::setup_sort_bins() // check if neighbor cutoff = 0.0 // and in that case, disable sorting - double binsize; + double binsize = 0.0; if (userbinsize > 0.0) binsize = userbinsize; else if (neighbor->cutneighmax > 0.0) binsize = 0.5 * neighbor->cutneighmax; From b19ee27f86e280b449f78133449e650aa98e7f1b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Dec 2018 01:01:33 -0500 Subject: [PATCH 74/94] initialize two more struct Tree members to appease coverity scan --- src/variable.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/variable.h b/src/variable.h index 9a6aa4c0b4..f0f3b2e6b6 100644 --- a/src/variable.h +++ b/src/variable.h @@ -88,17 +88,15 @@ class Variable : protected Pointers { int nvector; // length of array for vector-style variable int nstride; // stride between atoms if array is a 2d array int selfalloc; // 1 if array is allocated here, else 0 - int ivalue1,ivalue2; // extra values for needed for gmask,rmask,grmask + int ivalue1,ivalue2; // extra values needed for gmask,rmask,grmask int nextra; // # of additional args beyond first 2 Tree *first,*second; // ptrs further down tree for first 2 args Tree **extra; // ptrs further down tree for nextra args Tree() : array(NULL), iarray(NULL), barray(NULL), - selfalloc(0), nextra(0), - first(NULL), second(NULL), extra(NULL) - { - } + selfalloc(0), ivalue1(0), ivalue2(0), nextra(0), + first(NULL), second(NULL), extra(NULL) {} }; int compute_python(int); From 99ace5b435b36201fe2034cf2e8b3ddba9097a63 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Fri, 28 Dec 2018 11:21:13 +0100 Subject: [PATCH 75/94] "mixing rule" for lambda in init_one() method The values of the lambda[i][j] were equal to zero and different from lambda[i][i] when the user was not using explicit pair_coeff commands for the i-j pairs in the input script. The "mixing rule" included in this file is the same with the one in the pair_lj_cut_coul_cut_soft.cpp and pair_lj_cut_coul_long_soft.cpp files. --- src/USER-FEP/pair_lj_cut_soft.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/USER-FEP/pair_lj_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_soft.cpp index a33445f6f8..1322565473 100644 --- a/src/USER-FEP/pair_lj_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_soft.cpp @@ -566,6 +566,9 @@ double PairLJCutSoft::init_one(int i, int j) epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j], sigma[i][i],sigma[j][j]); sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]); + if (lambda[i][i] != lambda[j][j]) + error->all(FLERR,"Pair lj/cut/soft different lambda values in mix"); + lambda[i][j] = lambda[i][i]; cut[i][j] = mix_distance(cut[i][i],cut[j][j]); } From 3a7350575cd964dca1876d5574558a0dbacdde1b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Dec 2018 17:38:55 -0500 Subject: [PATCH 76/94] tweak coeff argument parsing settings for lj/class2/coul/long --- src/CLASS2/pair_lj_class2_coul_cut.cpp | 4 +++- src/CLASS2/pair_lj_class2_coul_long.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp index 5cd5ad0e32..b7d39fcac0 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.cpp +++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp @@ -216,7 +216,9 @@ void PairLJClass2CoulCut::settings(int narg, char **arg) void PairLJClass2CoulCut::coeff(int narg, char **arg) { - if (narg < 4 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients"); + if (narg < 4 || narg > 6) + error->all(FLERR,"Incorrect args for pair coefficients"); + if (!allocated) allocate(); int ilo,ihi,jlo,jhi; diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index bf892bc894..fcac78337f 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -252,8 +252,9 @@ void PairLJClass2CoulLong::settings(int narg, char **arg) void PairLJClass2CoulLong::coeff(int narg, char **arg) { - if (narg < 4 || narg > 6) + if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients"); + if (!allocated) allocate(); int ilo,ihi,jlo,jhi; From 92e1cbe7881178e73daf4e189dee12fa6f9fbb6e Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Fri, 28 Dec 2018 17:57:13 -0700 Subject: [PATCH 77/94] cmake: find install location of FindLAMMPS.cmake --- cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index e950db99c5..9499095449 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1325,7 +1325,7 @@ if(BUILD_LIB) configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_LIB_SUFFIX}.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_LIB_SUFFIX}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) configure_file(FindLAMMPS.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindLAMMPS${LAMMPS_LIB_SUFFIX}.cmake @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FindLAMMPS${LAMMPS_LIB_SUFFIX}.cmake DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/Module) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FindLAMMPS${LAMMPS_LIB_SUFFIX}.cmake DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/Modules) else() list(APPEND LMP_SOURCES ${LIB_SOURCES}) endif() From 7177c541d4a5e449d7c91600e31121eb1dc8258c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Dec 2018 12:20:24 -0500 Subject: [PATCH 78/94] consistent source format: replace '}else{' with '} else {' --- src/KOKKOS/fix_langevin_kokkos.cpp | 2 +- src/USER-FEP/pair_morse_soft.cpp | 14 ++++---- src/USER-LB/fix_lb_fluid.cpp | 32 +++++++++---------- src/USER-LB/fix_lb_momentum.cpp | 4 +-- src/USER-LB/fix_lb_pc.cpp | 10 +++--- src/USER-LB/fix_lb_rigid_pc_sphere.cpp | 16 +++++----- src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp | 8 ++--- src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp | 6 ++-- src/USER-MANIFOLD/manifold_cylinder_dent.cpp | 4 +-- src/USER-MANIFOLD/manifold_gaussian_bump.cpp | 8 ++--- src/USER-MANIFOLD/manifold_spine.cpp | 6 ++-- src/USER-MANIFOLD/manifold_thylakoid.cpp | 8 ++--- 12 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp index 8c403d3325..7d1861afd7 100644 --- a/src/KOKKOS/fix_langevin_kokkos.cpp +++ b/src/KOKKOS/fix_langevin_kokkos.cpp @@ -578,7 +578,7 @@ FSUM FixLangevinKokkos::post_force_item(int i) const if (v(i,0) == 0.0) fran[0] = 0.0; if (v(i,1) == 0.0) fran[1] = 0.0; if (v(i,2) == 0.0) fran[2] = 0.0; - }else{ + } else { fdrag[0] = gamma1*v(i,0); fdrag[1] = gamma1*v(i,1); fdrag[2] = gamma1*v(i,2); diff --git a/src/USER-FEP/pair_morse_soft.cpp b/src/USER-FEP/pair_morse_soft.cpp index 965d570863..f4c5a4b910 100644 --- a/src/USER-FEP/pair_morse_soft.cpp +++ b/src/USER-FEP/pair_morse_soft.cpp @@ -116,7 +116,7 @@ void PairMorseSoft::compute(int eflag, int vflag) // Force computation: fpair = 3.0*a*B*dexp3*s1 + 2.0*a*D*(dexp2 - dexp); fpair /= r; - }else{ + } else { llf = MathSpecial::powint( l / shift_range, nlambda ); phi = V0 + B*dexp3; phi *= llf; @@ -124,7 +124,7 @@ void PairMorseSoft::compute(int eflag, int vflag) // Force computation: if (r == 0.0){ fpair = 0.0; - }else{ + } else { fpair = 3.0*a*B*dexp3 + 2.0*a*D*(dexp2 - dexp); fpair *= llf / r; } @@ -234,7 +234,8 @@ void PairMorseSoft::settings(int narg, char **arg) double PairMorseSoft::init_one(int i, int j) { - if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); + if (setflag[i][j] == 0) + error->all(FLERR,"All pair coeffs are not set"); morse1[i][j] = 2.0*d0[i][j]*alpha[i][j]; @@ -259,8 +260,7 @@ double PairMorseSoft::init_one(int i, int j) if (l >= shift_range){ s1 = (l - 1.0) / (shift_range - 1.0); offset[i][j] = V0 + B*dexp3 * s1; - - }else{ + } else { llf = MathSpecial::powint( l / shift_range, nlambda ); offset[i][j] = V0 + B*dexp3; offset[i][j] *= llf; @@ -392,7 +392,7 @@ double PairMorseSoft::single(int /*i*/, int /*j*/, int itype, int jtype, double // Force computation: fforce = 3.0*a*B*dexp3*s1 + 2.0*a*D*(dexp2 - dexp); fforce /= r; - }else{ + } else { llf = MathSpecial::powint( l / shift_range, nlambda ); phi = V0 + B*dexp3; phi *= llf; @@ -400,7 +400,7 @@ double PairMorseSoft::single(int /*i*/, int /*j*/, int itype, int jtype, double // Force computation: if (r == 0.0){ fforce = 0.0; - }else{ + } else { fforce = 3.0*a*B*dexp3 + 2.0*a*D*(dexp2 - dexp); fforce *= llf / r; } diff --git a/src/USER-LB/fix_lb_fluid.cpp b/src/USER-LB/fix_lb_fluid.cpp index fecd6f2b25..7e1ea89531 100644 --- a/src/USER-LB/fix_lb_fluid.cpp +++ b/src/USER-LB/fix_lb_fluid.cpp @@ -231,7 +231,7 @@ a z wall velocity without implementing fixed BCs in z"); initializeLB = &FixLbFluid::initializeLB15; equilibriumdist = &FixLbFluid::equilibriumdist15; update_full = &FixLbFluid::update_full15; - }else{ + } else { initializeLB = &FixLbFluid::initializeLB19; equilibriumdist = &FixLbFluid::equilibriumdist19; update_full = &FixLbFluid::update_full19; @@ -379,7 +379,7 @@ a z wall velocity without implementing fixed BCs in z"); char str[128]; if(setdx == 1){ sprintf(str,"Using a lattice-Boltzmann grid of %i by %i by %i total grid points. To change, use the dx keyword",Nbx,Nby,Nbz); - }else{ + } else { sprintf(str,"Using a lattice-Boltzmann grid of %i by %i by %i total grid points.",Nbx,Nby,Nbz); } error->message(FLERR,str); @@ -544,7 +544,7 @@ FixLbFluid::~FixLbFluid() if(setGamma == 1){ delete [] Gamma; - }else{ + } else { delete [] NodeArea; } } @@ -841,7 +841,7 @@ void FixLbFluid::calc_fluidforce(void) if(mask[i] & groupbit){ if(trilinear_stencil==1) { trilinear_interpolation(i); - }else{ + } else { peskin_interpolation(i); } @@ -1219,7 +1219,7 @@ require more frequent neighborlist rebuilds"); massone = massone/dm_lb; gammavalue = 2.0*(mnode*massone)*dtoverdtcollision/(mnode+massone); - }else{ + } else { gammavalue = Gamma[type[i]]; } @@ -1350,7 +1350,7 @@ void FixLbFluid::rescale(void) for(int i=0; i<= atom->ntypes; i++){ NodeArea[i] = NodeArea[i]/dx_lb/dx_lb; } - }else{ + } else { for(int i=0; i<= atom->ntypes; i++){ Gamma[i] = Gamma[i]*dt_lb/dm_lb; } @@ -1388,7 +1388,7 @@ satisfy the Courant condition.\n"); noisefactor = 1.0; if(a_0 <= 0.333333333333333){ K_0 = 5.17*(0.333333333333333 - a_0); - }else{ + } else { K_0 = 2.57*(a_0 - 0.333333333333333); } dtoverdtcollision = dt_lb*6.0*viscosity/densityinit_real/dx_lb/dx_lb; @@ -1821,7 +1821,7 @@ void FixLbFluid::initialize_feq(void) // If using the standary LB integrator, do not need to send feqn. if(typeLB == 1){ numrequests = 4; - }else{ + } else { numrequests = 8; } @@ -1888,7 +1888,7 @@ void FixLbFluid::initialize_feq(void) feqoldn[i][j][k][p] = feqn[i][j][k][p]; } } - }else{ + } else { step = 1; read_restartfile(); @@ -2576,7 +2576,7 @@ void FixLbFluid::streamout(void) } } } - }else{ + } else { for(i=1; iperiodicity[2]==0){ if(comm->myloc[2]==comm->procgrid[2]-1){ kstart=comm->myloc[2]*(subNbz-3); - }else{ + } else { kstart=comm->myloc[2]*(subNbz-2); } - }else{ + } else { kstart=comm->myloc[2]*(subNbz-2); } iend=istart+subNbx-2; @@ -2659,7 +2659,7 @@ void FixLbFluid::update_full15(void) //-------------------------------------------------------------------------- if(typeLB == 1){ numrequests = 4; - }else{ + } else { numrequests = 8; } @@ -2777,7 +2777,7 @@ void FixLbFluid::update_full15(void) } } } - }else{ + } else { update_periodic(1,subNbx-1,1,subNby-1,1,2); } if(comm->myloc[2]==comm->procgrid[2]-1){ @@ -3019,7 +3019,7 @@ void FixLbFluid::update_full19(void) //-------------------------------------------------------------------------- if(typeLB == 1){ numrequests = 4; - }else{ + } else { numrequests = 8; } @@ -3135,7 +3135,7 @@ void FixLbFluid::update_full19(void) } } } - }else{ + } else { update_periodic(1,subNbx-1,1,subNby-1,1,2); } if(comm->myloc[2]==comm->procgrid[2]-1){ diff --git a/src/USER-LB/fix_lb_momentum.cpp b/src/USER-LB/fix_lb_momentum.cpp index 490b95ef71..df17561380 100644 --- a/src/USER-LB/fix_lb_momentum.cpp +++ b/src/USER-LB/fix_lb_momentum.cpp @@ -201,7 +201,7 @@ void FixLbMomentum::end_of_step() ucmx*u_lb[i][j][k][1]*ucmz-ucmx*ucmy*u_lb[i][j][k][2]+ ucmx*ucmy*ucmz); etacov[14]=0.0; - }else{ + } else { etacov[0] = 0.0; etacov[1] = rho*ucmx; etacov[2] = rho*ucmy; @@ -263,7 +263,7 @@ void FixLbMomentum::end_of_step() ucmx*u_old[1]*ucmz-ucmx*ucmy*u_old[2]+ ucmx*ucmy*ucmz); etacov[14]=0.0; - }else{ + } else { etacov[0] = 0.0; etacov[1] = density_old*ucmx; etacov[2] = density_old*ucmy; diff --git a/src/USER-LB/fix_lb_pc.cpp b/src/USER-LB/fix_lb_pc.cpp index c5c12d6c11..89c0bf59a7 100644 --- a/src/USER-LB/fix_lb_pc.cpp +++ b/src/USER-LB/fix_lb_pc.cpp @@ -164,7 +164,7 @@ void FixLbPC::initial_integrate(int /*vflag*/) { v[i][0] += f[i][0]*dtfm; v[i][1] += f[i][1]*dtfm; v[i][2] += f[i][2]*dtfm; - }else{ + } else { v[i][0] = (v[i][0]-up[i][0]-f[i][0]*force->ftm2v/Gamma_MD[type[i]])*expminusdttimesgamma + f[i][0]*force->ftm2v/Gamma_MD[type[i]] + up[i][0]; v[i][1] = (v[i][1]-up[i][1]-f[i][1]*force->ftm2v/Gamma_MD[type[i]])*expminusdttimesgamma + @@ -195,7 +195,7 @@ void FixLbPC::initial_integrate(int /*vflag*/) { v[i][0] += f[i][0]*dtfm; v[i][1] += f[i][1]*dtfm; v[i][2] += f[i][2]*dtfm; - }else{ + } else { v[i][0] = (v[i][0]-up[i][0]-f[i][0]*force->ftm2v/Gamma_MD[type[i]])*expminusdttimesgamma + f[i][0]*force->ftm2v/Gamma_MD[type[i]] + up[i][0]; v[i][1] = (v[i][1]-up[i][1]-f[i][1]*force->ftm2v/Gamma_MD[type[i]])*expminusdttimesgamma + @@ -234,7 +234,7 @@ void FixLbPC::final_integrate() v[i][0] += 0.5*(f[i][0] - force_old[i][0])*dtfm; v[i][1] += 0.5*(f[i][1] - force_old[i][1])*dtfm; v[i][2] += 0.5*(f[i][2] - force_old[i][2])*dtfm; - }else{ + } else { v[i][0] += DMDcoeff*((f[i][0] - force_old[i][0])*force->ftm2v/Gamma_MD[type[i]] + up[i][0] - up_old[i][0])/dtv; v[i][1] += DMDcoeff*((f[i][1] - force_old[i][1])*force->ftm2v/Gamma_MD[type[i]] + up[i][1] - up_old[i][1])/dtv; v[i][2] += DMDcoeff*((f[i][2] - force_old[i][2])*force->ftm2v/Gamma_MD[type[i]] + up[i][2] - up_old[i][2])/dtv; @@ -255,7 +255,7 @@ void FixLbPC::final_integrate() v[i][0] += 0.5*(f[i][0] - force_old[i][0])*dtfm; v[i][1] += 0.5*(f[i][1] - force_old[i][1])*dtfm; v[i][2] += 0.5*(f[i][2] - force_old[i][2])*dtfm; - }else{ + } else { v[i][0] += DMDcoeff*((f[i][0] - force_old[i][0])*force->ftm2v/Gamma_MD[type[i]] + up[i][0] - up_old[i][0])/dtv; v[i][1] += DMDcoeff*((f[i][1] - force_old[i][1])*force->ftm2v/Gamma_MD[type[i]] + up[i][1] - up_old[i][1])/dtv; v[i][2] += DMDcoeff*((f[i][2] - force_old[i][2])*force->ftm2v/Gamma_MD[type[i]] + up[i][2] - up_old[i][2])/dtv; @@ -438,7 +438,7 @@ int FixLbPC::unpack_exchange(int nlocal, double *buf) } } } - }else{ + } else { FfP[0] = (1.-dx1)*(1.-dy1)*(1.-dz1); FfP[1] = (1.-dx1)*(1.-dy1)*dz1; FfP[2] = (1.-dx1)*dy1*(1.-dz1); diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index 2601539727..0b3d75b984 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -387,7 +387,7 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) : if((mask[j] & groupbit) && (mask[j] & groupbit_lb_fluid) && (mask[j] & group->bitmask[igroupinner])) error->one(FLERR,"the inner nodes specified in lb/rigid/pc/sphere should not be included in the lb/fluid fix"); } - }else{ + } else { for(int j=0; jone(FLERR,"use the innerNodes keyword in the lb/rigid/pc/sphere fix for atoms which do not interact with the lb/fluid"); @@ -536,7 +536,7 @@ void FixLbRigidPCSphere::init() if(!(mask[i] & group->bitmask[igroupinner])){ sum[ibody][4] += massone; } - }else{ + } else { sum[ibody][4] += massone; } } @@ -581,7 +581,7 @@ void FixLbRigidPCSphere::init() sum[ibody][0] += dx*dx + dy*dy + dz*dz; sum[ibody][1] += Gamma[type[i]]; } - }else{ + } else { ibody = body[i]; xbox = (image[i] & IMGMASK) - IMGMAX; @@ -619,7 +619,7 @@ void FixLbRigidPCSphere::init() if(Gamma_MD[ibody]*dt_lb/dm_lb - Gamma[type[i]] > eps) error->one(FLERR,"All atoms in a rigid body must have the same gamma value"); } - }else{ + } else { ibody = body[i]; if(Gamma_MD[ibody]*dt_lb/dm_lb - Gamma[type[i]] > eps) @@ -798,7 +798,7 @@ void FixLbRigidPCSphere::initial_integrate(int vflag) sum[ibody][1] += up[i][1]*massone; sum[ibody][2] += up[i][2]*massone; } - }else{ + } else { sum[ibody][0] += up[i][0]*massone; sum[ibody][1] += up[i][1]*massone; sum[ibody][2] += up[i][2]*massone; @@ -841,7 +841,7 @@ void FixLbRigidPCSphere::initial_integrate(int vflag) sum[ibody][4] += -Gamma_MD[ibody]*(v[i][1]-up[i][1]); sum[ibody][5] += -Gamma_MD[ibody]*(v[i][2]-up[i][2]); } - }else{ + } else { sum[ibody][0] += Gamma_MD[ibody]*(dy * ((up[i][2]-vcm[ibody][2])) - dz * ((up[i][1]-vcm[ibody][1]))); sum[ibody][1] += Gamma_MD[ibody]*(dz * ((up[i][0]-vcm[ibody][0])) - @@ -1054,7 +1054,7 @@ void FixLbRigidPCSphere::final_integrate() sum[ibody][5] += Gamma_MD[ibody]*(dx * ((up[i][1]-vcm[ibody][1])) - dy * ((up[i][0]-vcm[ibody][0]))); } - }else{ + } else { sum[ibody][0] += up[i][0]*massone; sum[ibody][1] += up[i][1]*massone; sum[ibody][2] += up[i][2]*massone; @@ -1659,7 +1659,7 @@ double FixLbRigidPCSphere::compute_array(int i, int j) } } } - }else{ + } else { FfP[0] = (1.-dx1)*(1.-dy1)*(1.-dz1); FfP[1] = (1.-dx1)*(1.-dy1)*dz1; FfP[2] = (1.-dx1)*dy1*(1.-dz1); diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index 3c6c70f6df..379cff1b5d 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -129,7 +129,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, len = strlen(arg[i+6]) - 1; // -1 because -2 for v_, +1 for \0. is_var[i] = 1; offset = 2; - }else{ + } else { force->numeric(FLERR,arg[i+6]); // Check if legal number. len = strlen( arg[i+6] ) + 1; // +1 for \0. is_var[i] = 0; @@ -163,7 +163,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, char msg[2048]; sprintf(msg,"Error parsing arg \"%s\".\n", arg[argi]); error->all(FLERR, msg); - }else{ + } else { argi += 1; } } @@ -247,7 +247,7 @@ int FixNVEManifoldRattle::was_var( const char *str ) { if( strlen(str) > 2 ){ return (str[0] == 'v') && (str[1] == '_'); - }else{ + } else { return 0; } } @@ -295,7 +295,7 @@ void FixNVEManifoldRattle::update_var_params() double new_val = input->variable->compute_equal(tvars[i]); ptr_params[i] = new_val; - }else{ + } else { error->all(FLERR, "Variable for fix nve/manifold/rattle is invalid style"); } diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp index 2a204d2048..873360094d 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -125,7 +125,7 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, char msg[2048]; sprintf(msg,"Error parsing arg \"%s\".\n", arg[argi]); error->all(FLERR, msg); - }else{ + } else { argi += 1; } } @@ -281,7 +281,7 @@ void FixNVTManifoldRattle::nhc_temp_integrate() if( eta_mass[0] > 0.0 ){ eta_dotdot[0] = (kecurrent - ke_target)/eta_mass[0]; - }else{ + } else { eta_dotdot[0] = 0; } @@ -314,7 +314,7 @@ void FixNVTManifoldRattle::nhc_temp_integrate() if( eta_mass[0] > 0.0 ){ eta_dotdot[0] = (kecurrent - ke_target) / eta_mass[0]; - }else{ + } else { eta_dotdot[0] = 0.0; } diff --git a/src/USER-MANIFOLD/manifold_cylinder_dent.cpp b/src/USER-MANIFOLD/manifold_cylinder_dent.cpp index 4df4c833d3..d779b96c90 100644 --- a/src/USER-MANIFOLD/manifold_cylinder_dent.cpp +++ b/src/USER-MANIFOLD/manifold_cylinder_dent.cpp @@ -21,7 +21,7 @@ double manifold_cylinder_dent::g( const double *x ) double k = MathConst::MY_2PI / l; double c = R - 0.5*a*( 1.0 + cos(k*x[2]) ); return c*c - r2; - }else{ + } else { return R*R - r2; } } @@ -36,7 +36,7 @@ void manifold_cylinder_dent::n( const double *x, double *n ) n[0] = -2*x[0]; n[1] = -2*x[1]; n[2] = c*a*k*sin(k*x[2]); - }else{ + } else { n[0] = -2*x[0]; n[1] = -2*x[1]; n[2] = 0.0; diff --git a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp index b95162740b..c5b8948488 100644 --- a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp +++ b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp @@ -163,7 +163,7 @@ double manifold_gaussian_bump::g( const double *x ) double rr = sqrt( x2 ); double z_taper_func = lut_get_z( rr ); return x[2] - z_taper_func; - }else{ + } else { return x[2]; } } @@ -193,7 +193,7 @@ void manifold_gaussian_bump::n( const double *x, double *nn ) nn[0] = der_part * x[0]; nn[1] = der_part * x[1]; - }else{ + } else { nn[0] = nn[1] = 0.0; } } @@ -226,7 +226,7 @@ double manifold_gaussian_bump::g_and_n( const double *x, double *nn ) nn[1] = der_part * x[1]; return x[2] - z_taper_func; - }else{ + } else { nn[0] = nn[1] = 0.0; return x[2]; } @@ -364,7 +364,7 @@ void manifold_gaussian_bump::test_lut() taper_z = gaussian_bump(xx); }else if( xx < rc2 ){ taper_z = lut_get_z( xx ); - }else{ + } else { taper_z = 0.0; } fprintf( fp, "%g %g %g %g %g %g %g\n", xx, gaussian_bump(xx), taper_z, diff --git a/src/USER-MANIFOLD/manifold_spine.cpp b/src/USER-MANIFOLD/manifold_spine.cpp index 0ca4c67002..b8b108d3fc 100644 --- a/src/USER-MANIFOLD/manifold_spine.cpp +++ b/src/USER-MANIFOLD/manifold_spine.cpp @@ -48,7 +48,7 @@ double manifold_spine::g_and_n( const double *x, double *nn ) if( x[2] > 0 ){ BB = B; cc = c; - }else{ + } else { BB = B2; cc = 1.0; } @@ -97,7 +97,7 @@ void manifold_spine::n( const double *x, double *nn ) if( x[2] > 0 ){ BB = B; cc = c; - }else{ + } else { BB = B2; cc = 1.0; } @@ -141,7 +141,7 @@ double manifold_spine::g( const double *x ) if( x[2] > 0 ){ BB = B; cc = c; - }else{ + } else { BB = B2; cc = 1.0; } diff --git a/src/USER-MANIFOLD/manifold_thylakoid.cpp b/src/USER-MANIFOLD/manifold_thylakoid.cpp index 93cf60ad03..ed947d4b3d 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid.cpp @@ -87,7 +87,7 @@ double manifold_thylakoid::g( const double *x ) double con_val = p->g(x); if( std::isfinite(con_val) ){ return con_val; - }else{ + } else { char msg[2048]; sprintf(msg,"Error, thyla_part of type %d returned %f as constraint val!", p->type, con_val); @@ -109,7 +109,7 @@ void manifold_thylakoid::n( const double *x, double *n ) p->n(x,n); if( std::isfinite(n[0]) && std::isfinite(n[1]) && std::isfinite(n[2]) ){ return; - }else{ + } else { char msg[2048]; sprintf(msg,"Error, thyla_part of type %d returned (%f,%f,%f) as gradient!", p->type, n[0], n[1], n[2]); @@ -532,11 +532,11 @@ int manifold_thylakoid::is_in_domain( thyla_part *part, const double *x ) if( dist2 < RR2 ){ return true; - }else{ + } else { // Domain was ok, but radius not. return false; } - }else{ + } else { return true; } } From 31427a238095cc09439c7dee96c43c1b6c646e94 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Dec 2018 12:32:59 -0500 Subject: [PATCH 79/94] consistent formatting: replace "if( XXX ){" with "if (XXX) {" --- src/KOKKOS/pair_reaxc_kokkos.cpp | 2 +- src/USER-MANIFOLD/fix_manifoldforce.cpp | 8 ++-- src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp | 36 ++++++++-------- src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp | 26 ++++++------ src/USER-MANIFOLD/manifold_cylinder_dent.cpp | 4 +- src/USER-MANIFOLD/manifold_gaussian_bump.cpp | 20 ++++----- src/USER-MANIFOLD/manifold_spine.cpp | 6 +-- src/USER-MANIFOLD/manifold_thylakoid.cpp | 42 +++++++++---------- .../manifold_thylakoid_shared.cpp | 2 +- src/USER-MANIFOLD/manifold_torus.cpp | 4 +- src/USER-OMP/reaxc_init_md_omp.cpp | 2 +- src/USER-OMP/reaxc_valence_angles_omp.cpp | 2 +- src/USER-REAXC/pair_reaxc.cpp | 2 +- src/USER-REAXC/reaxc_allocate.cpp | 2 +- src/USER-REAXC/reaxc_ffield.cpp | 6 +-- src/USER-REAXC/reaxc_init_md.cpp | 2 +- src/USER-REAXC/reaxc_io_tools.cpp | 4 +- src/USER-REAXC/reaxc_reset_tools.cpp | 2 +- src/USER-REAXC/reaxc_valence_angles.cpp | 2 +- 19 files changed, 87 insertions(+), 87 deletions(-) diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index fc4298bf6d..d4dc976c4a 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -2569,7 +2569,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeAngular= 0.0 ){ + if (vlpex >= 0.0) { vlpadj = 0.0; dSBO2 = prod_SBO - 1.0; } else{ diff --git a/src/USER-MANIFOLD/fix_manifoldforce.cpp b/src/USER-MANIFOLD/fix_manifoldforce.cpp index 4e717ce556..f792dc9886 100644 --- a/src/USER-MANIFOLD/fix_manifoldforce.cpp +++ b/src/USER-MANIFOLD/fix_manifoldforce.cpp @@ -53,14 +53,14 @@ FixManifoldForce::FixManifoldForce(LAMMPS *lmp, int narg, char **arg) : // Command is given as // fix manifoldforce manifold_name manifold_args - if( narg < 5 ){ + if (narg < 5) { error->all(FLERR,"Illegal fix manifoldforce! No manifold given"); } const char *m_name = arg[3]; ptr_m = create_manifold(m_name,lmp,narg,arg); // Construct manifold from factory: - if( !ptr_m ){ + if (!ptr_m) { char msg[2048]; snprintf(msg,2048,"Manifold pointer for manifold '%s' was NULL for some reason", arg[3]); error->all(FLERR,msg); @@ -70,7 +70,7 @@ FixManifoldForce::FixManifoldForce(LAMMPS *lmp, int narg, char **arg) : // After constructing the manifold, you can safely make // room for the parameters nvars = ptr_m->nparams(); - if( narg < nvars+4 ){ + if (narg < nvars+4) { char msg[2048]; sprintf(msg,"Manifold %s needs at least %d argument(s)!", m_name, nvars); @@ -78,7 +78,7 @@ FixManifoldForce::FixManifoldForce(LAMMPS *lmp, int narg, char **arg) : } ptr_m->params = new double[nvars]; - if( ptr_m->params == NULL ){ + if (ptr_m->params == NULL) { error->all(FLERR,"Parameter pointer was NULL!"); } diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index 379cff1b5d..5c0215aa95 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -101,7 +101,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, max_iter = force->numeric( FLERR, arg[4] ); ptr_m = create_manifold(arg[5], lmp, narg, arg); - if( !ptr_m ){ + if (!ptr_m) { error->all(FLERR,"Error creating manifold pointer"); } @@ -111,12 +111,12 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, tstyle = new int[nvars]; is_var = new int[nvars]; - if( !tstrs || !tvars || !tstyle || !is_var ){ + if (!tstrs || !tvars || !tstyle || !is_var) { error->all(FLERR, "Error creating manifold arg arrays"); } // Check if you have enough args: - if( 6 + nvars > narg ){ + if (6 + nvars > narg) { char msg[2048]; sprintf(msg, "Not enough args for manifold %s, %d expected but got %d\n", ptr_m->id(), nvars, narg - 6); @@ -125,7 +125,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, // Loop over manifold args: for( int i = 0; i < nvars; ++i ){ int len = 0, offset = 0; - if( was_var( arg[i+6] ) ){ + if (was_var( arg[i+6] )) { len = strlen(arg[i+6]) - 1; // -1 because -2 for v_, +1 for \0. is_var[i] = 1; offset = 2; @@ -151,15 +151,15 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, // Loop over rest of args: int argi = 6 + nvars; while( argi < narg ){ - if( strcmp(arg[argi], "every") == 0 ){ + if (strcmp(arg[argi], "every") == 0) { nevery = force->inumeric(FLERR,arg[argi+1]); next_output = update->ntimestep + nevery; - if( comm->me == 0 ){ + if (comm->me == 0) { fprintf(screen,"Outputing every %d steps, next is %d\n", nevery, next_output); } argi += 2; - }else if( error_on_unknown_keyword ){ + }else if (error_on_unknown_keyword) { char msg[2048]; sprintf(msg,"Error parsing arg \"%s\".\n", arg[argi]); error->all(FLERR, msg); @@ -175,7 +175,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, ---------------------------------------------------------------------------*/ FixNVEManifoldRattle::~FixNVEManifoldRattle() { - if( tstrs ){ + if (tstrs) { for( int i = 0; i < nvars; ++i ){ delete [] tstrs[i]; } @@ -204,7 +204,7 @@ void FixNVEManifoldRattle::reset_dt() void FixNVEManifoldRattle::print_stats( const char *header ) { double n = stats.natoms; - if( n > 0 ){ + if (n > 0) { stats.x_iters_per_atom += stats.x_iters / n; stats.v_iters_per_atom += stats.v_iters / n; } @@ -223,7 +223,7 @@ void FixNVEManifoldRattle::print_stats( const char *header ) stats.v_iters_per_atom = stats.v_iters = 0; - if( me == 0 ){ + if (me == 0) { double inv_tdiff = 1.0/( static_cast(ntimestep) - stats.last_out ); stats.last_out = ntimestep; @@ -245,7 +245,7 @@ void FixNVEManifoldRattle::print_stats( const char *header ) ---------------------------------------------------------------------------*/ int FixNVEManifoldRattle::was_var( const char *str ) { - if( strlen(str) > 2 ){ + if (strlen(str) > 2) { return (str[0] == 'v') && (str[1] == '_'); } else { return 0; @@ -284,13 +284,13 @@ void FixNVEManifoldRattle::update_var_params() double *ptr_params = ptr_m->params; for( int i = 0; i < nvars; ++i ){ - if( is_var[i] ){ + if (is_var[i]) { tvars[i] = input->variable->find(tstrs[i]); - if( tvars[i] < 0 ){ + if (tvars[i] < 0) { error->all(FLERR, "Variable name for fix nve/manifold/rattle does not exist"); } - if( input->variable->equalstyle(tvars[i]) ){ + if (input->variable->equalstyle(tvars[i])) { tstyle[i] = EQUAL; double new_val = input->variable->compute_equal(tvars[i]); @@ -369,7 +369,7 @@ void FixNVEManifoldRattle::final_integrate() void FixNVEManifoldRattle::end_of_step() { if (nevery && (update->ntimestep == next_output)){ - if( comm->me == 0 ){ + if (comm->me == 0) { print_stats( "nve/manifold/rattle" ); next_output += nevery; } @@ -415,7 +415,7 @@ void FixNVEManifoldRattle::nve_x_rattle(int igroup, int groupbit) } } - if( nevery > 0 ){ + if (nevery > 0) { // Count ALL atoms this fix works on: MPI_Allreduce(&natoms,&stats.natoms,1,MPI_INT,MPI_SUM,world); } @@ -557,7 +557,7 @@ void FixNVEManifoldRattle::rattle_manifold_x(double *x, double *v, // gg = ptr_m->g(x); } - if( iters >= max_iter && res > tolerance ){ + if (iters >= max_iter && res > tolerance) { char msg[2048]; sprintf(msg,"Failed to constrain atom %d (x = (%f, %f, %f)! res = %e, iters = %d\n", tagi, x[0], x[1], x[2], res, iters); @@ -650,7 +650,7 @@ void FixNVEManifoldRattle::rattle_manifold_v(double *v, double *f, ++iters; }while( (res > tolerance) && (iters < max_iter) ); - if( iters >= max_iter && res >= tolerance ){ + if (iters >= max_iter && res >= tolerance) { char msg[2048]; sprintf(msg,"Failed to constrain atom %d (x = (%f, %f, %f)! res = %e, iters = %d\n", tagi, x[0], x[1], x[2], res, iters); diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp index 873360094d..47a1d65bbd 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -104,7 +104,7 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, int argi = 6 + ptr_m->nparams(); while( argi < narg ) { - if( strcmp( arg[argi], "temp") == 0 ){ + if (strcmp( arg[argi], "temp") == 0) { if( argi+3 >= narg ) error->all(FLERR,"Keyword 'temp' needs 3 arguments"); @@ -115,13 +115,13 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, got_temp = 1; argi += 4; - }else if( strcmp( arg[argi], "tchain" ) == 0 ){ + }else if (strcmp( arg[argi], "tchain" ) == 0) { if( argi+1 >= narg ) error->all(FLERR,"Keyword 'tchain' needs 1 argument"); mtchain = force->inumeric(FLERR, arg[argi+1]); argi += 2; - }else if( error_on_unknown_keyword ){ + }else if (error_on_unknown_keyword) { char msg[2048]; sprintf(msg,"Error parsing arg \"%s\".\n", arg[argi]); error->all(FLERR, msg); @@ -134,7 +134,7 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, if( !got_temp ) error->all(FLERR,"Fix nvt/manifold/rattle needs 'temp'!"); - if( t_period < 0.0 ){ + if (t_period < 0.0) { error->all(FLERR,"Fix nvt/manifold/rattle damping parameter must be > 0.0"); } @@ -153,7 +153,7 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, modify->add_compute(3,newarg); delete [] newarg; int icompute = modify->find_compute(id_temp); - if( icompute < 0 ){ + if (icompute < 0) { error->all(FLERR,"Temperature ID for fix nvt/manifold/rattle " "does not exist"); } @@ -217,7 +217,7 @@ void FixNVTManifoldRattle::init() update_var_params(); int icompute = modify->find_compute(id_temp); - if( icompute < 0 ){ + if (icompute < 0) { error->all(FLERR,"Temperature ID for fix nvt/manifold/rattle " "does not exist"); } @@ -279,7 +279,7 @@ void FixNVTManifoldRattle::nhc_temp_integrate() eta_mass[ich] = boltz * t_target * inv_t_freq2; } - if( eta_mass[0] > 0.0 ){ + if (eta_mass[0] > 0.0) { eta_dotdot[0] = (kecurrent - ke_target)/eta_mass[0]; } else { eta_dotdot[0] = 0; @@ -300,7 +300,7 @@ void FixNVTManifoldRattle::nhc_temp_integrate() factor_eta = exp(-dthalf*eta_dot[0]); - if( factor_eta == 0 ){ + if (factor_eta == 0) { char msg[2048]; sprintf(msg, "WTF, factor_eta is 0! dthalf = %f, eta_dot[0] = %f", dthalf, eta_dot[0]); @@ -312,7 +312,7 @@ void FixNVTManifoldRattle::nhc_temp_integrate() t_current *= factor_eta*factor_eta; kecurrent = tdof * boltz * t_current; - if( eta_mass[0] > 0.0 ){ + if (eta_mass[0] > 0.0) { eta_dotdot[0] = (kecurrent - ke_target) / eta_mass[0]; } else { eta_dotdot[0] = 0.0; @@ -346,17 +346,17 @@ void FixNVTManifoldRattle::nh_v_temp() - if( which == NOBIAS ){ + if (which == NOBIAS) { for( int i = 0; i < nlocal; ++i ){ - if( mask[i] & groupbit ){ + if (mask[i] & groupbit) { v[i][0] *= factor_eta; v[i][1] *= factor_eta; v[i][2] *= factor_eta; } } - }else if( which == BIAS ){ + }else if (which == BIAS) { for( int i = 0; i < nlocal; ++i ){ - if( mask[i] & groupbit ){ + if (mask[i] & groupbit) { temperature->remove_bias(i,v[i]); v[i][0] *= factor_eta; v[i][1] *= factor_eta; diff --git a/src/USER-MANIFOLD/manifold_cylinder_dent.cpp b/src/USER-MANIFOLD/manifold_cylinder_dent.cpp index d779b96c90..6fe8e3453c 100644 --- a/src/USER-MANIFOLD/manifold_cylinder_dent.cpp +++ b/src/USER-MANIFOLD/manifold_cylinder_dent.cpp @@ -17,7 +17,7 @@ double manifold_cylinder_dent::g( const double *x ) { double l = params[1], R = params[0], a = params[2]; double r2 = x[1]*x[1] + x[0]*x[0]; - if( fabs(x[2]) < 0.5*l ){ + if (fabs(x[2]) < 0.5*l) { double k = MathConst::MY_2PI / l; double c = R - 0.5*a*( 1.0 + cos(k*x[2]) ); return c*c - r2; @@ -30,7 +30,7 @@ double manifold_cylinder_dent::g( const double *x ) void manifold_cylinder_dent::n( const double *x, double *n ) { double l = params[1], R = params[0], a = params[2]; - if( fabs(x[2]) < 0.5*l ){ + if (fabs(x[2]) < 0.5*l) { double k = MathConst::MY_2PI / l; double c = R - 0.5*a*(1.0 + cos(k*x[2])); n[0] = -2*x[0]; diff --git a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp index c5b8948488..322f9671c2 100644 --- a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp +++ b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp @@ -50,7 +50,7 @@ public: double get_t_from_x( double xx ) const { - if( xx < x0 || xx > x1 ){ + if (xx < x0 || xx > x1) { char msg[2048]; sprintf(msg, "x ( %g ) out of bounds [%g, %g]", xx, x0, x1 ); err->one(FLERR, msg); @@ -72,7 +72,7 @@ public: ff = x(t) - xx; ffp = xp(t); double res = ff; - if( fabs( res ) < tol ){ + if (fabs( res ) < tol) { return t; } } @@ -157,9 +157,9 @@ double manifold_gaussian_bump::g( const double *x ) xf[2] = 0.0; double x2 = dot(xf,xf); - if( x2 < rc12 ){ + if (x2 < rc12) { return x[2] - gaussian_bump_x2( x2 ); - }else if( x2 < rc22 ){ + }else if (x2 < rc22) { double rr = sqrt( x2 ); double z_taper_func = lut_get_z( rr ); return x[2] - z_taper_func; @@ -178,12 +178,12 @@ void manifold_gaussian_bump::n( const double *x, double *nn ) double x2 = dot(xf,xf); - if( x2 < rc12 ){ + if (x2 < rc12) { double factor = gaussian_bump_x2(x2); factor /= (ll*ll); nn[0] = factor * x[0]; nn[1] = factor * x[1]; - }else if( x2 < rc22 ){ + }else if (x2 < rc22) { double rr = sqrt( x2 ); double zp_taper_func = lut_get_zp( rr ); @@ -207,14 +207,14 @@ double manifold_gaussian_bump::g_and_n( const double *x, double *nn ) nn[2] = 1.0; double x2 = dot(xf,xf); - if( x2 < rc12 ){ + if (x2 < rc12) { double gb = gaussian_bump_x2(x2); double factor = gb / (ll*ll); nn[0] = factor * x[0]; nn[1] = factor * x[1]; return x[2] - gb; - }else if( x2 < rc22 ){ + }else if (x2 < rc22) { double z_taper_func, zp_taper_func; double rr = sqrt( x2 ); lut_get_z_and_zp( rr, z_taper_func, zp_taper_func ); @@ -360,9 +360,9 @@ void manifold_gaussian_bump::test_lut() double gg = g( x ); n( x, nn ); double taper_z; - if( xx <= rc1 ){ + if (xx <= rc1) { taper_z = gaussian_bump(xx); - }else if( xx < rc2 ){ + }else if (xx < rc2) { taper_z = lut_get_z( xx ); } else { taper_z = 0.0; diff --git a/src/USER-MANIFOLD/manifold_spine.cpp b/src/USER-MANIFOLD/manifold_spine.cpp index b8b108d3fc..9641f53885 100644 --- a/src/USER-MANIFOLD/manifold_spine.cpp +++ b/src/USER-MANIFOLD/manifold_spine.cpp @@ -45,7 +45,7 @@ double manifold_spine::g_and_n( const double *x, double *nn ) double AMs, AMc; double dazc, dAMs; - if( x[2] > 0 ){ + if (x[2] > 0) { BB = B; cc = c; } else { @@ -94,7 +94,7 @@ void manifold_spine::n( const double *x, double *nn ) double AMs, AMc; double dazc, dAMs; - if( x[2] > 0 ){ + if (x[2] > 0) { BB = B; cc = c; } else { @@ -138,7 +138,7 @@ double manifold_spine::g( const double *x ) double c2, As, azc, Apart; double AMs; - if( x[2] > 0 ){ + if (x[2] > 0) { BB = B; cc = c; } else { diff --git a/src/USER-MANIFOLD/manifold_thylakoid.cpp b/src/USER-MANIFOLD/manifold_thylakoid.cpp index ed947d4b3d..1c479ff25f 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid.cpp @@ -46,7 +46,7 @@ void manifold_thylakoid::post_param_init() LB = params[1]; lB = params[2]; - if( comm->me == 0 ){ + if (comm->me == 0) { fprintf(screen,"My params are now: lT = %f, LT = %f, pad = %f, " "wB = %f, LB = %f, lB = %f\n", lT, LT, pad, wB, LB, lB ); fprintf(screen,"Calling init_domains() from post_param_init().\n"); @@ -57,7 +57,7 @@ void manifold_thylakoid::post_param_init() void manifold_thylakoid::checkup() { - if( comm->me == 0 ){ + if (comm->me == 0 ) { fprintf(screen,"This is checkup of thylakoid %p\n", this); fprintf(screen,"I have %ld parts. They are:\n", parts.size()); for( int i = 0; i < parts.size(); ++i ){ @@ -85,7 +85,7 @@ double manifold_thylakoid::g( const double *x ) error->one(FLERR,msg); } double con_val = p->g(x); - if( std::isfinite(con_val) ){ + if (std::isfinite(con_val)) { return con_val; } else { char msg[2048]; @@ -107,7 +107,7 @@ void manifold_thylakoid::n( const double *x, double *n ) error->one(FLERR,msg); } p->n(x,n); - if( std::isfinite(n[0]) && std::isfinite(n[1]) && std::isfinite(n[2]) ){ + if (std::isfinite(n[0]) && std::isfinite(n[1]) && std::isfinite(n[2])) { return; } else { char msg[2048]; @@ -122,7 +122,7 @@ thyla_part *manifold_thylakoid::get_thyla_part( const double *x, int * /*err_fla for( std::size_t i = 0; i < parts.size(); ++i ){ thyla_part *p = parts[i]; - if( is_in_domain(p,x) ){ + if (is_in_domain(p,x)) { if( idx != NULL ) *idx = i; return p; } @@ -140,7 +140,7 @@ thyla_part *manifold_thylakoid::get_thyla_part( const double *x, int * /*err_fla void manifold_thylakoid::init_domains() { - if( wB + 2*lB > LT ){ + if (wB + 2*lB > LT) { char msg[2048]; sprintf(msg,"LT = %f not large enough to accomodate bridge with " "wB = %f and lB = %f! %f > %f\n", LT, wB, lB, wB + 2*lB, LT); @@ -152,19 +152,19 @@ void manifold_thylakoid::init_domains() y0 = -( 0.5*LT + lT + pad ); z0 = -15; #ifdef MANIFOLD_THYLAKOID_DEBUG - if( comm->me == 0 ){ + if (comm->me == 0) { fprintf(screen,"x0, y0, z0 = %f, %f, %f\n",x0,y0,z0); } #endif // MANIFOLD_THYLAKOID_DEBUG #ifndef USE_PHONY_LAMMPS - if( x0 < domain->boxlo[0] ){ + if (x0 < domain->boxlo[0]) { char msg[2048]; sprintf(msg,"Thylakoid expects xlo of at most %f, but found %f", x0, domain->boxlo[0]); error->one(FLERR,msg); } - if( y0 < domain->boxlo[1] ){ + if (y0 < domain->boxlo[1]) { char msg[2048]; sprintf(msg,"Thylakoid expects ylo of at most %f, but found %f", y0, domain->boxlo[1]); @@ -243,7 +243,7 @@ void manifold_thylakoid::init_domains() // double X0, double R0, double R, double s, #ifdef MANIFOLD_THYLAKOID_DEBUG - if( comm->me == 0 ){ + if (comm->me == 0) { fprintf(screen,"x0, r0, R = %f, %f, %f\n", bl.pt[0], rB, lB); } #endif // MANIFOLD_THYLAKOID_DEBUG @@ -266,7 +266,7 @@ void manifold_thylakoid::init_domains() // double X0, double R0, double R, double s, #ifdef MANIFOLD_THYLAKOID_DEBUG - if( comm->me == 0 ){ + if (comm->me == 0) { fprintf(screen,"x0, r0, R = %f, %f, %f\n", br.pt[0], rB, lB); } #endif // MANIFOLD_THYLAKOID_DEBUG @@ -293,7 +293,7 @@ void manifold_thylakoid::init_domains() p = make_cyl_part( 0, 1, 1, bc.pt, rB ); set_domain( p, bc.lo, bc.hi ); #ifdef MANIFOLD_THYLAKOID_DEBUG - if( comm->me == 0 ){ + if (comm->me == 0) { fprintf(screen,"Cylinder lives on [ %f x %f ] x [ %f x %f ] x [ %f x %f]\n", bc.lo[0], bc.hi[0], bc.lo[1], bc.hi[1], bc.lo[2], bc.hi[2]); } @@ -405,7 +405,7 @@ void manifold_thylakoid::init_domains() parts.push_back(p); // Check if this plane lines up with bl: - if( fabs(plr.pt[0] - bl.pt[0] + lB) > 1e-8 ){ + if (fabs(plr.pt[0] - bl.pt[0] + lB) > 1e-8) { char msg[2048]; sprintf(msg,"Origins of plane left right and bridge left misaligned! %f != %f!\n", plr.pt[0], bl.pt[0] - lB ); @@ -458,7 +458,7 @@ void manifold_thylakoid::init_domains() set_domain(p, prr.lo, prr.hi); parts.push_back(p); - if( fabs(prr.pt[0] - br.pt[0] - lB) > 1e-8 ){ + if (fabs(prr.pt[0] - br.pt[0] - lB) > 1e-8) { char msg[2048]; sprintf(msg,"Origins of plane left right and bridge left misaligned! %f != %f!\n", prr.pt[0], br.pt[0] + lB); @@ -467,7 +467,7 @@ void manifold_thylakoid::init_domains() // For debugging, print the domains and coms: #ifdef MANIFOLD_THYLAKOID_DEBUG - if( comm->me == 0 ){ + if (comm->me == 0) { FILE *fp_doms = fopen("test_doms.dat","w"); FILE *fp_coms = fopen("test_coms.dat","w"); print_part_data(fp_doms, fp_coms); @@ -482,20 +482,20 @@ void manifold_thylakoid::set_domain( thyla_part *p, const std::vector &l const std::vector &hi ) { #ifdef MANIFOLD_THYLAKOID_DEBUG - if( comm->me == 0 ){ + if (comm->me == 0) { fprintf(screen,"Adding part with domain [%f, %f] x [%f, %f] x [%f, %f]\n", lo[0],hi[0],lo[1],hi[1],lo[2],hi[2] ); } #endif // MANIFOLD_THYLAKOID_DEBUG - if( lo[0] >= hi[0] ){ + if (lo[0] >= hi[0]) { char msg[2048]; sprintf(msg,"xlo >= xhi (%f >= %f)",lo[0],hi[0]); error->one(FLERR,msg); - }else if( lo[1] >= hi[1] ){ + }else if (lo[1] >= hi[1]) { char msg[2048]; sprintf(msg,"ylo >= yhi (%f >= %f)",lo[1],hi[1]); error->one(FLERR,msg); - }else if( lo[2] >= hi[2] ){ + }else if (lo[2] >= hi[2]) { char msg[2048]; sprintf(msg,"zlo >= zhi (%f >= %f)",lo[2],hi[2]); error->one(FLERR,msg); @@ -519,7 +519,7 @@ int manifold_thylakoid::is_in_domain( thyla_part *part, const double *x ) // From here on out, domain is ok. - if( part->type == thyla_part::THYLA_TYPE_CYL_TO_PLANE ){ + if (part->type == thyla_part::THYLA_TYPE_CYL_TO_PLANE) { double R0 = part->params[1]; double R = part->params[2]; @@ -530,7 +530,7 @@ int manifold_thylakoid::is_in_domain( thyla_part *part, const double *x ) double RR2 = RR*RR; - if( dist2 < RR2 ){ + if (dist2 < RR2) { return true; } else { // Domain was ok, but radius not. diff --git a/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp b/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp index 4c4297f822..78735421c7 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp @@ -33,7 +33,7 @@ thyla_part::thyla_part( int type, double *args, double xlo, double ylo, double z params[4] = args[4]; // y0 params[5] = args[5]; // z0 params[6] = args[6]; // R - if( (args[0] != 0.0) && (args[1] != 0.0) && (args[2] != 0.0) ){ + if ((args[0] != 0.0) && (args[1] != 0.0) && (args[2] != 0.0)) { err_flag = -1; return; } diff --git a/src/USER-MANIFOLD/manifold_torus.cpp b/src/USER-MANIFOLD/manifold_torus.cpp index 0b4ca24370..4806af5213 100644 --- a/src/USER-MANIFOLD/manifold_torus.cpp +++ b/src/USER-MANIFOLD/manifold_torus.cpp @@ -14,7 +14,7 @@ double manifold_torus::g( const double *x ) { double R = params[0]; double r = params[1]; - if( R < r ){ + if (R < r) { error->all(FLERR,"Large radius < small radius!"); } @@ -27,7 +27,7 @@ void manifold_torus::n( const double *x, double *n ) { double R = params[0]; double r = params[1]; - if( R < r ){ + if (R < r) { error->all(FLERR,"Large radius < small radius!"); } diff --git a/src/USER-OMP/reaxc_init_md_omp.cpp b/src/USER-OMP/reaxc_init_md_omp.cpp index f4368e59c9..b7b6839df5 100644 --- a/src/USER-OMP/reaxc_init_md_omp.cpp +++ b/src/USER-OMP/reaxc_init_md_omp.cpp @@ -135,7 +135,7 @@ void InitializeOMP( reax_system *system, control_params *control, MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( Init_System(system, control, msg) == FAILURE ){ + if (Init_System(system, control, msg) == FAILURE) { fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); fprintf( stderr, "p%d: system could not be initialized! terminating.\n", system->my_rank ); diff --git a/src/USER-OMP/reaxc_valence_angles_omp.cpp b/src/USER-OMP/reaxc_valence_angles_omp.cpp index fbad0f8077..cf89cf8095 100644 --- a/src/USER-OMP/reaxc_valence_angles_omp.cpp +++ b/src/USER-OMP/reaxc_valence_angles_omp.cpp @@ -308,7 +308,7 @@ void Valence_AnglesOMP( reax_system *system, control_params *control, } // modifications to match Adri's code - 09/01/09 - if( workspace->vlpex[j] >= 0 ){ + if (workspace->vlpex[j] >= 0) { vlpadj = 0; dSBO2 = prod_SBO - 1; } diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index 85bd8471b4..39ff1320d8 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -735,7 +735,7 @@ int PairReaxC::write_reax_lists() j &= NEIGHMASK; get_distance( x[j], x[i], &d_sqr, &dvec ); - if( d_sqr <= (cutoff_sqr) ){ + if (d_sqr <= (cutoff_sqr)) { dist[j] = sqrt( d_sqr ); set_far_nbr( &far_list[num_nbrs], j, dist[j], dvec ); ++num_nbrs; diff --git a/src/USER-REAXC/reaxc_allocate.cpp b/src/USER-REAXC/reaxc_allocate.cpp index c6c103b6f4..653fb13473 100644 --- a/src/USER-REAXC/reaxc_allocate.cpp +++ b/src/USER-REAXC/reaxc_allocate.cpp @@ -489,7 +489,7 @@ void ReAllocate( reax_system *system, control_params *control, /* bonds list */ num_bonds = est_3body = -1; - if( Nflag || realloc->bonds ){ + if (Nflag || realloc->bonds) { Reallocate_Bonds_List( system, (*lists)+BONDS, &num_bonds, &est_3body, comm ); realloc->bonds = 0; diff --git a/src/USER-REAXC/reaxc_ffield.cpp b/src/USER-REAXC/reaxc_ffield.cpp index 7932e9cbd8..ce032f4f3a 100644 --- a/src/USER-REAXC/reaxc_ffield.cpp +++ b/src/USER-REAXC/reaxc_ffield.cpp @@ -258,8 +258,8 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, val = atof(tmp[1]); reax->sbp[i].lgre = val; } - if( reax->sbp[i].rcore2>0.01 && reax->sbp[i].acore2>0.01 ){ // Inner-wall - if( reax->sbp[i].gamma_w>0.5 ){ // Shielding vdWaals + if (reax->sbp[i].rcore2>0.01 && reax->sbp[i].acore2>0.01) { // Inner-wall + if (reax->sbp[i].gamma_w>0.5) { // Shielding vdWaals if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 3 ) { if (errorflag && (me == 0)) fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n" \ @@ -290,7 +290,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, } } else{ // No Inner wall parameters present - if( reax->sbp[i].gamma_w>0.5 ){ // Shielding vdWaals + if (reax->sbp[i].gamma_w>0.5) { // Shielding vdWaals if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 1 ) { if (me == 0) fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n" \ diff --git a/src/USER-REAXC/reaxc_init_md.cpp b/src/USER-REAXC/reaxc_init_md.cpp index 88fb9cf17f..3657fc8d78 100644 --- a/src/USER-REAXC/reaxc_init_md.cpp +++ b/src/USER-REAXC/reaxc_init_md.cpp @@ -227,7 +227,7 @@ void Initialize( reax_system *system, control_params *control, MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( Init_System(system, control, msg) == FAILURE ){ + if (Init_System(system, control, msg) == FAILURE) { fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); fprintf( stderr, "p%d: system could not be initialized! terminating.\n", system->my_rank ); diff --git a/src/USER-REAXC/reaxc_io_tools.cpp b/src/USER-REAXC/reaxc_io_tools.cpp index c3cb9825ff..16014b2e61 100644 --- a/src/USER-REAXC/reaxc_io_tools.cpp +++ b/src/USER-REAXC/reaxc_io_tools.cpp @@ -41,7 +41,7 @@ int Init_Output_Files( reax_system *system, control_params *control, char temp[MAX_STR+8]; int ret; - if( out_control->write_steps > 0 ){ + if (out_control->write_steps > 0) { ret = Init_Traj( system, control, out_control, mpi_data, msg ); if( ret == FAILURE ) return ret; @@ -124,7 +124,7 @@ void Output_Results( reax_system *system, control_params *control, out_control->energy_update_freq > 0 && data->step % out_control->energy_update_freq == 0 ) { - if( control->virial ){ + if (control->virial) { fprintf( out_control->prs, "%8d%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f\n", data->step, diff --git a/src/USER-REAXC/reaxc_reset_tools.cpp b/src/USER-REAXC/reaxc_reset_tools.cpp index 1b16f10aee..26c006cdac 100644 --- a/src/USER-REAXC/reaxc_reset_tools.cpp +++ b/src/USER-REAXC/reaxc_reset_tools.cpp @@ -127,7 +127,7 @@ void Reset_Neighbor_Lists( reax_system *system, control_params *control, reax_list *bonds, *hbonds; /* bonds list */ - if( system->N > 0 ){ + if (system->N > 0) { bonds = (*lists) + BONDS; total_bonds = 0; diff --git a/src/USER-REAXC/reaxc_valence_angles.cpp b/src/USER-REAXC/reaxc_valence_angles.cpp index 118735fbbd..bc844fdb1c 100644 --- a/src/USER-REAXC/reaxc_valence_angles.cpp +++ b/src/USER-REAXC/reaxc_valence_angles.cpp @@ -140,7 +140,7 @@ void Valence_Angles( reax_system *system, control_params *control, prod_SBO *= exp( -temp ); } - if( workspace->vlpex[j] >= 0 ){ + if (workspace->vlpex[j] >= 0) { vlpadj = 0; dSBO2 = prod_SBO - 1; } From c588b44cf11eaca2bc3343eb6a499d002c51657c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Dec 2018 12:35:01 -0500 Subject: [PATCH 80/94] consistent formating: replace "} else{" with "} else {" --- src/KOKKOS/pair_reaxc_kokkos.cpp | 2 +- src/SRD/fix_srd.cpp | 4 ++-- src/USER-LB/fix_lb_fluid.cpp | 6 +++--- src/USER-LB/fix_lb_pc.cpp | 6 +++--- src/USER-LB/fix_lb_rigid_pc_sphere.cpp | 6 +++--- src/USER-REAXC/reaxc_ffield.cpp | 2 +- src/USER-REAXC/reaxc_lookup.cpp | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index d4dc976c4a..e9b6527725 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -2572,7 +2572,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeAngular= 0.0) { vlpadj = 0.0; dSBO2 = prod_SBO - 1.0; - } else{ + } else { vlpadj = nlp; dSBO2 = (prod_SBO - 1.0) * (1.0 - p_val8 * d_dDelta_lp[i]); } diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index 186f51e06a..d87d2b5e56 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -1348,7 +1348,7 @@ void FixSRD::collisions_single() atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1); if (insideflag == INSIDE_ERROR) error->one(FLERR,str); error->warning(FLERR,str); - } else{ + } else { sprintf(str, "SRD particle " TAGINT_FORMAT " started " "inside wall %d on step " BIGINT_FORMAT " bounce %d", @@ -1507,7 +1507,7 @@ void FixSRD::collisions_multi() atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1); if (insideflag == INSIDE_ERROR) error->one(FLERR,str); error->warning(FLERR,str); - } else{ + } else { sprintf(str, "SRD particle " TAGINT_FORMAT " started " "inside wall %d on step " BIGINT_FORMAT " bounce %d", diff --git a/src/USER-LB/fix_lb_fluid.cpp b/src/USER-LB/fix_lb_fluid.cpp index 7e1ea89531..222b0eea3c 100644 --- a/src/USER-LB/fix_lb_fluid.cpp +++ b/src/USER-LB/fix_lb_fluid.cpp @@ -1023,7 +1023,7 @@ void FixLbFluid::peskin_interpolation(int i) r=sqrt(rsq); if(rsq>1){ weightx=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; - } else{ + } else { weightx=(3.0-2.0*r+sqrt(1.0+4.0*r-4.0*rsq))/8.; } } @@ -1035,7 +1035,7 @@ void FixLbFluid::peskin_interpolation(int i) r=sqrt(rsq); if(rsq>1){ weighty=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; - } else{ + } else { weighty=(3.0-2.0*r+sqrt(1.0+4.0*r-4.0*rsq))/8.; } } @@ -1047,7 +1047,7 @@ void FixLbFluid::peskin_interpolation(int i) r=sqrt(rsq); if(rsq>1){ weightz=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; - } else{ + } else { weightz=(3.0-2.0*r+sqrt(1.0+4.0*r-4.0*rsq))/8.; } } diff --git a/src/USER-LB/fix_lb_pc.cpp b/src/USER-LB/fix_lb_pc.cpp index 89c0bf59a7..30b7059c74 100644 --- a/src/USER-LB/fix_lb_pc.cpp +++ b/src/USER-LB/fix_lb_pc.cpp @@ -393,7 +393,7 @@ int FixLbPC::unpack_exchange(int nlocal, double *buf) r=sqrt(rsq); if(rsq>1){ weightx=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; - } else{ + } else { weightx=(3.0-2.0*r+sqrt(1.0+4.0*r-4.0*rsq))/8.; } } @@ -405,7 +405,7 @@ int FixLbPC::unpack_exchange(int nlocal, double *buf) r=sqrt(rsq); if(rsq>1){ weighty=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; - } else{ + } else { weighty=(3.0-2.0*r+sqrt(1.0+4.0*r-4.0*rsq))/8.; } } @@ -417,7 +417,7 @@ int FixLbPC::unpack_exchange(int nlocal, double *buf) r=sqrt(rsq); if(rsq>1){ weightz=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; - } else{ + } else { weightz=(3.0-2.0*r+sqrt(1.0+4.0*r-4.0*rsq))/8.; } } diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index 0b3d75b984..14dbeb0f1d 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -1614,7 +1614,7 @@ double FixLbRigidPCSphere::compute_array(int i, int j) r=sqrt(rsq); if(rsq>1){ weightx=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; - } else{ + } else { weightx=(3.0-2.0*r+sqrt(1.0+4.0*r-4.0*rsq))/8.; } } @@ -1626,7 +1626,7 @@ double FixLbRigidPCSphere::compute_array(int i, int j) r=sqrt(rsq); if(rsq>1){ weighty=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; - } else{ + } else { weighty=(3.0-2.0*r+sqrt(1.0+4.0*r-4.0*rsq))/8.; } } @@ -1638,7 +1638,7 @@ double FixLbRigidPCSphere::compute_array(int i, int j) r=sqrt(rsq); if(rsq>1){ weightz=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; - } else{ + } else { weightz=(3.0-2.0*r+sqrt(1.0+4.0*r-4.0*rsq))/8.; } } diff --git a/src/USER-REAXC/reaxc_ffield.cpp b/src/USER-REAXC/reaxc_ffield.cpp index ce032f4f3a..66acb6ea9a 100644 --- a/src/USER-REAXC/reaxc_ffield.cpp +++ b/src/USER-REAXC/reaxc_ffield.cpp @@ -270,7 +270,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, "Keeping vdWaals-setting for earlier atoms.\n", reax->sbp[i].name ); errorflag = 0; - } else{ + } else { reax->gp.vdw_type = 3; } } diff --git a/src/USER-REAXC/reaxc_lookup.cpp b/src/USER-REAXC/reaxc_lookup.cpp index 918099a631..0e71c662aa 100644 --- a/src/USER-REAXC/reaxc_lookup.cpp +++ b/src/USER-REAXC/reaxc_lookup.cpp @@ -264,7 +264,7 @@ int Init_Lookup_Tables( reax_system *system, control_params *control, Natural_Cubic_Spline( &h[1], &fCEclmb[1], &(LR[i][j].CEclmb[1]), control->tabulate+1, comm ); - } else{ + } else { LR[i][j].n = 0; } } From 991ca25dd7f201a8fdf7f0dfd1e8bbf1978cc384 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Dec 2018 14:47:50 -0500 Subject: [PATCH 81/94] consistent formatting: adjust cases of "dangling else", add curly braces --- src/KOKKOS/fix_langevin_kokkos.cpp | 96 ++++++++--------------- src/KOKKOS/pair_reaxc_kokkos.cpp | 6 +- src/USER-AWPMD/pair_awpmd_cut.cpp | 16 ++-- src/USER-LB/fix_lb_fluid.cpp | 37 ++++----- src/USER-LB/fix_lb_pc.cpp | 12 +-- src/USER-LB/fix_lb_rigid_pc_sphere.cpp | 21 ++--- src/USER-MISC/fix_ttm_mod.cpp | 7 +- src/USER-MISC/pair_srp.cpp | 7 +- src/USER-OMP/reaxc_nonbonded_omp.cpp | 8 +- src/USER-OMP/reaxc_valence_angles_omp.cpp | 6 +- src/USER-REAXC/reaxc_ffield.cpp | 9 +-- src/USER-REAXC/reaxc_forces.cpp | 12 +-- src/USER-REAXC/reaxc_nonbonded.cpp | 10 +-- src/USER-REAXC/reaxc_traj.cpp | 19 +++-- src/USER-REAXC/reaxc_valence_angles.cpp | 6 +- src/region.cpp | 3 +- src/region_block.cpp | 7 +- src/region_cylinder.cpp | 41 ++++------ 18 files changed, 127 insertions(+), 196 deletions(-) diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp index 7d1861afd7..63b749a556 100644 --- a/src/KOKKOS/fix_langevin_kokkos.cpp +++ b/src/KOKKOS/fix_langevin_kokkos.cpp @@ -195,8 +195,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else{ + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -204,8 +203,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -214,8 +212,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -223,8 +220,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else{ + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -234,8 +230,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -243,8 +238,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -253,8 +247,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -262,8 +255,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -274,8 +266,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -283,8 +274,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -293,8 +283,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -302,8 +291,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -313,8 +301,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -322,8 +309,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -332,8 +318,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -341,8 +326,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -354,8 +338,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -363,8 +346,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -373,8 +355,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -382,8 +363,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -393,8 +373,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -402,8 +381,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -412,8 +390,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -421,8 +398,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -433,8 +409,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -442,8 +417,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -452,8 +426,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -461,8 +434,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -472,8 +444,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -481,8 +452,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -491,8 +461,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } @@ -500,8 +469,7 @@ void FixLangevinKokkos::post_force(int vflag) if (zeroflag) { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_reduce(nlocal,post_functor,s_fsum); - } - else { + } else { FixLangevinKokkosPostForceFunctor post_functor(this); Kokkos::parallel_for(nlocal,post_functor); } diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index e9b6527725..6e0857e80d 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -530,9 +530,7 @@ int PairReaxCKokkos::Init_Lookup_Tables() Natural_Cubic_Spline( &h[1], &fCEclmb[1], &(LR[i][j].CEclmb[1]), control->tabulate+1, world ); - }// else{ - // LR[i][j].n = 0; - //}// + } } free(h); free(fh); @@ -622,7 +620,7 @@ void PairReaxCKokkos::LR_vdW_Coulomb( int i, int j, double r_ij, LR_ lr->CEvd = dTap * twbp->D * (exp1 - 2.0 * exp2) - Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13; } - else{ // no shielding + else { // no shielding exp1 = exp( twbp->alpha * (1.0 - r_ij / twbp->r_vdW) ); exp2 = exp( 0.5 * twbp->alpha * (1.0 - r_ij / twbp->r_vdW) ); diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index 2dcb3e6296..806e4f3a14 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -274,13 +274,12 @@ void PairAWPMDCut::compute(int eflag, int vflag) int i = ilist[ii]; if(gmap[i]<0) // this particle was filtered out continue; - if(spin[i]==0){ // this is an ion, copying forces + if (spin[i]==0) { // this is an ion, copying forces int ion=gmap[i]; f[i][0]=fi[ion][0]; f[i][0]=fi[ion][1]; f[i][0]=fi[ion][2]; - } - else { // electron + } else { // electron int iel=gmap[i]; int s=spin[i] >0 ? 0 : 1; wpmd->get_wp_force(s,iel,(Vector_3 *)f[i],(Vector_3 *)(atom->vforce+3*i),atom->erforce+i,atom->ervelforce+i,(Vector_2 *)(atom->csforce+2*i)); @@ -304,12 +303,11 @@ void PairAWPMDCut::compute(int eflag, int vflag) if (eflag_atom) { // transfer per-atom energies here for (int i = 0; i < ntot; i++) { - if(gmap[i]<0) // this particle was filtered out + if (gmap[i]<0) // this particle was filtered out continue; - if(spin[i]==0){ + if (spin[i]==0) { eatom[i]=wpmd->Eiep[gmap[i]]+wpmd->Eiip[gmap[i]]; - } - else { + } else { int s=spin[i] >0 ? 0 : 1; eatom[i]=wpmd->Eep[s][gmap[i]]+wpmd->Eeip[s][gmap[i]]+wpmd->Eeep[s][gmap[i]]+wpmd->Ewp[s][gmap[i]]; } @@ -474,9 +472,9 @@ void PairAWPMDCut::coeff(int narg, char **arg) if(cut_global<0) cut_global=half_box_length; - if (!allocated) + if (!allocated) { allocate(); - else{ + } else { int i,j; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) diff --git a/src/USER-LB/fix_lb_fluid.cpp b/src/USER-LB/fix_lb_fluid.cpp index 222b0eea3c..864bb02f3f 100644 --- a/src/USER-LB/fix_lb_fluid.cpp +++ b/src/USER-LB/fix_lb_fluid.cpp @@ -1017,9 +1017,9 @@ void FixLbFluid::peskin_interpolation(int i) for(ii=-1; ii<3; ii++){ rsq=(-dx1+ii)*(-dx1+ii); - if(rsq>=4) + if(rsq>=4) { weightx=0.0; - else{ + } else { r=sqrt(rsq); if(rsq>1){ weightx=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; @@ -1029,9 +1029,9 @@ void FixLbFluid::peskin_interpolation(int i) } for(jj=-1; jj<3; jj++){ rsq=(-dy1+jj)*(-dy1+jj); - if(rsq>=4) + if(rsq>=4) { weighty=0.0; - else{ + } else { r=sqrt(rsq); if(rsq>1){ weighty=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; @@ -1041,9 +1041,9 @@ void FixLbFluid::peskin_interpolation(int i) } for(kk=-1; kk<3; kk++){ rsq=(-dz1+kk)*(-dz1+kk); - if(rsq>=4) + if(rsq>=4) { weightz=0.0; - else{ + } else { r=sqrt(rsq); if(rsq>1){ weightz=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; @@ -1090,8 +1090,7 @@ require more frequent neighborlist rebuilds"); massone = massone/dm_lb; gammavalue = 2.0*(mnode*massone)*dtoverdtcollision/(mnode+massone); - } - else{ + } else { gammavalue = Gamma[type[i]]; } @@ -2836,8 +2835,7 @@ void FixLbFluid::update_full15(void) } } } - } - else{ + } else { update_periodic(1,subNbx-1,1,subNby-1,subNbz-2,subNbz-1); } } @@ -2866,8 +2864,7 @@ void FixLbFluid::update_full15(void) if(typeLB == 1){ fnew[i][j][k][5]=fnew[i][j][k-1][6]; tmp1=fnew[i][j][k-1][11]+fnew[i][j][k-1][12]+fnew[i][j][k-1][13]+fnew[i][j][k-1][14]; - } - else{ + } else { fnew[i][j][k][5]=fnew[i][j][k-1][6] + (0.5-Dcoeff*(tau+0.5))*feqn[i][j][k+1][5]; tmp1=fnew[i][j][k-1][11]+fnew[i][j][k-1][12]+fnew[i][j][k-1][13]+fnew[i][j][k-1][14] + (0.5-Dcoeff*(tau+0.5))*(feqn[i-1][j-1][k+1][7] + feqn[i+1][j-1][k+1][8] + @@ -2908,8 +2905,7 @@ void FixLbFluid::update_full15(void) if(typeLB == 1){ fnew[i][j][k][6]=fnew[i][j][k+1][5]; tmp1=fnew[i][j][k+1][7]+fnew[i][j][k+1][8]+fnew[i][j][k+1][9]+fnew[i][j][k+1][10]; - } - else{ + } else { fnew[i][j][k][6]=fnew[i][j][k+1][5] + (0.5-Dcoeff*(tau+0.5))*feqn[i][j][k-1][6]; tmp1=fnew[i][j][k+1][7]+fnew[i][j][k+1][8]+fnew[i][j][k+1][9]+fnew[i][j][k+1][10] + (0.5-Dcoeff*(tau+0.5))*(feqn[i-1][j-1][k-1][11] + feqn[i+1][j-1][k-1][12] + @@ -2941,7 +2937,7 @@ void FixLbFluid::update_full15(void) //-------------------------------------------------------------------------- // Periodic z boundary conditions. //-------------------------------------------------------------------------- - }else { + } else { for(i=0; i=4) + if(rsq>=4) { weightx=0.0; - else{ + } else { r=sqrt(rsq); if(rsq>1){ weightx=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; @@ -399,9 +399,9 @@ int FixLbPC::unpack_exchange(int nlocal, double *buf) } for(jj=-1; jj<3; jj++){ rsq=(-dy1+jj)*(-dy1+jj); - if(rsq>=4) + if(rsq>=4) { weighty=0.0; - else{ + } else { r=sqrt(rsq); if(rsq>1){ weighty=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; @@ -411,9 +411,9 @@ int FixLbPC::unpack_exchange(int nlocal, double *buf) } for(kk=-1; kk<3; kk++){ rsq=(-dz1+kk)*(-dz1+kk); - if(rsq>=4) + if(rsq>=4) { weightz=0.0; - else{ + } else { r=sqrt(rsq); if(rsq>1){ weightz=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index 14dbeb0f1d..a950fffdf0 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -328,7 +328,7 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) : MPI_Allreduce(ncount,nrigid,nbody,MPI_INT,MPI_SUM,world); //count the number of atoms in the shell. - if(inner_nodes == 1){ + if (inner_nodes == 1) { int *mask = atom->mask; for(ibody=0; ibodyremap(xcm[ibody],imagebody[ibody]); - if (original == imagebody[ibody]) remapflag[ibody][3] = 0; - else { + if (original == imagebody[ibody]) { + remapflag[ibody][3] = 0; + } else { oldimage = original & IMGMASK; newimage = imagebody[ibody] & IMGMASK; remapflag[ibody][0] = newimage - oldimage; @@ -1608,9 +1609,9 @@ double FixLbRigidPCSphere::compute_array(int i, int j) for(ii=-1; ii<3; ii++){ rsq=(-dx1+ii)*(-dx1+ii); - if(rsq>=4) + if(rsq>=4) { weightx=0.0; - else{ + } else { r=sqrt(rsq); if(rsq>1){ weightx=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; @@ -1620,9 +1621,9 @@ double FixLbRigidPCSphere::compute_array(int i, int j) } for(jj=-1; jj<3; jj++){ rsq=(-dy1+jj)*(-dy1+jj); - if(rsq>=4) + if(rsq>=4) { weighty=0.0; - else{ + } else { r=sqrt(rsq); if(rsq>1){ weighty=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; @@ -1632,9 +1633,9 @@ double FixLbRigidPCSphere::compute_array(int i, int j) } for(kk=-1; kk<3; kk++){ rsq=(-dz1+kk)*(-dz1+kk); - if(rsq>=4) + if(rsq>=4) { weightz=0.0; - else{ + } else { r=sqrt(rsq); if(rsq>1){ weightz=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.; diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index 423ec788c5..a34c2eb42f 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -346,9 +346,9 @@ void FixTTMMod::init() void FixTTMMod::setup(int vflag) { - if (strstr(update->integrate_style,"verlet")) + if (strstr(update->integrate_style,"verlet")) { post_force_setup(vflag); - else { + } else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); post_force_respa_setup(vflag,nlevels_respa-1,0); ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); @@ -428,8 +428,7 @@ void FixTTMMod::post_force(int /*vflag*/) flangevin[i][1] -= pres_factor/ionic_density/dy*(C_iu*T_iu-C_i*T_i); flangevin[i][2] -= pres_factor/ionic_density/dz*(C_if*T_if-C_i*T_i); } - } - else{ + } else { flangevin[i][0] -= pres_factor/ionic_density/dx*(C_ir*T_ir-C_i*T_i); flangevin[i][1] -= pres_factor/ionic_density/dy*(C_iu*T_iu-C_i*T_i); flangevin[i][2] -= pres_factor/ionic_density/dz*(C_if*T_if-C_i*T_i); diff --git a/src/USER-MISC/pair_srp.cpp b/src/USER-MISC/pair_srp.cpp index 93ef09386a..97b3aa6c43 100644 --- a/src/USER-MISC/pair_srp.cpp +++ b/src/USER-MISC/pair_srp.cpp @@ -258,8 +258,7 @@ void PairSRP::compute(int eflag, int vflag) } } } - } - else{ + } else { // using min distance option for (ii = 0; ii < inum; ii++) { @@ -361,9 +360,9 @@ void PairSRP::settings(int narg, char **arg) cut_global = force->numeric(FLERR,arg[0]); // wildcard - if (strcmp(arg[1],"*") == 0) + if (strcmp(arg[1],"*") == 0) { btype = 0; - else { + } else { btype = force->inumeric(FLERR,arg[1]); if ((btype > atom->nbondtypes) || (btype <= 0)) error->all(FLERR,"Illegal pair_style command"); diff --git a/src/USER-OMP/reaxc_nonbonded_omp.cpp b/src/USER-OMP/reaxc_nonbonded_omp.cpp index 9ad238f79c..194f433634 100644 --- a/src/USER-OMP/reaxc_nonbonded_omp.cpp +++ b/src/USER-OMP/reaxc_nonbonded_omp.cpp @@ -162,7 +162,7 @@ void vdW_Coulomb_Energy_OMP( reax_system *system, control_params *control, CEvd = dTap * e_vdW - Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13; } - else{ // no shielding + else { // no shielding exp1 = exp( twbp->alpha * (1.0 - r_ij / twbp->r_vdW) ); exp2 = exp( 0.5 * twbp->alpha * (1.0 - r_ij / twbp->r_vdW) ); @@ -222,8 +222,7 @@ void vdW_Coulomb_Energy_OMP( reax_system *system, control_params *control, rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec ); rvec_ScaledAdd( workspace->forceReduction[reductionOffset+j], +(CEvd + CEclmb), nbr_pj->dvec ); - } - else { /* NPT, iNPT or sNPT */ + } else { /* NPT, iNPT or sNPT */ /* for pressure coupling, terms not related to bond order derivatives are added directly into pressure vector/tensor */ @@ -362,8 +361,7 @@ void Tabulated_vdW_Coulomb_Energy_OMP(reax_system *system,control_params *contro rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec ); rvec_ScaledAdd( workspace->forceReduction[froffset+j], +(CEvd + CEclmb), nbr_pj->dvec ); - } - else { // NPT, iNPT or sNPT + } else { // NPT, iNPT or sNPT /* for pressure coupling, terms not related to bond order derivatives are added directly into pressure vector/tensor */ rvec_Scale( temp, CEvd + CEclmb, nbr_pj->dvec ); diff --git a/src/USER-OMP/reaxc_valence_angles_omp.cpp b/src/USER-OMP/reaxc_valence_angles_omp.cpp index cf89cf8095..a9c9d8ebfd 100644 --- a/src/USER-OMP/reaxc_valence_angles_omp.cpp +++ b/src/USER-OMP/reaxc_valence_angles_omp.cpp @@ -311,8 +311,7 @@ void Valence_AnglesOMP( reax_system *system, control_params *control, if (workspace->vlpex[j] >= 0) { vlpadj = 0; dSBO2 = prod_SBO - 1; - } - else{ + } else { vlpadj = workspace->nlp[j]; dSBO2 = (prod_SBO - 1) * (1 - p_val8 * workspace->dDelta_lp[j]); } @@ -543,8 +542,7 @@ void Valence_AnglesOMP( reax_system *system, control_params *control, CEval8, p_ijk->dcos_di ); rvec_ScaledAdd( workspace->forceReduction[reductionOffset+k], CEval8, p_ijk->dcos_dk ); - } - else { + } else { /* terms not related to bond order derivatives are added directly into forces and pressure vector/tensor */ rvec_Scale( force, CEval8, p_ijk->dcos_di ); diff --git a/src/USER-REAXC/reaxc_ffield.cpp b/src/USER-REAXC/reaxc_ffield.cpp index 66acb6ea9a..d060b866d3 100644 --- a/src/USER-REAXC/reaxc_ffield.cpp +++ b/src/USER-REAXC/reaxc_ffield.cpp @@ -273,8 +273,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, } else { reax->gp.vdw_type = 3; } - } - else { // No shielding vdWaals parameters present + } else { // No shielding vdWaals parameters present if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 2 ) { if (me == 0) fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n" \ @@ -288,8 +287,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, reax->gp.vdw_type = 2; } } - } - else{ // No Inner wall parameters present + } else { // No Inner wall parameters present if (reax->sbp[i].gamma_w>0.5) { // Shielding vdWaals if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 1 ) { if (me == 0) @@ -642,8 +640,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, reax->fbp[j][k][m][n].prm[0].p_cot1 = val; reax->fbp[n][m][k][j].prm[0].p_cot1 = val; } - } - else { /* This means the entry is of the form 0-X-Y-0 */ + } else { /* This means the entry is of the form 0-X-Y-0 */ if( k < reax->num_atom_types && m < reax->num_atom_types ) for( p = 0; p < reax->num_atom_types; p++ ) for( o = 0; o < reax->num_atom_types; o++ ) { diff --git a/src/USER-REAXC/reaxc_forces.cpp b/src/USER-REAXC/reaxc_forces.cpp index dfcc9fd4ae..e5a8fa2e93 100644 --- a/src/USER-REAXC/reaxc_forces.cpp +++ b/src/USER-REAXC/reaxc_forces.cpp @@ -215,8 +215,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, if( i < system->n ) { local = 1; cutoff = MAX( control->hbond_cut, control->bond_cut ); - } - else { + } else { local = 0; cutoff = control->bond_cut; } @@ -240,8 +239,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, if( nbr_pj->d <= cutoff ) flag = 1; else flag = 0; - } - else{ + } else { nbr_pj->dvec[0] = atom_j->x[0] - atom_i->x[0]; nbr_pj->dvec[1] = atom_j->x[1] - atom_i->x[1]; nbr_pj->dvec[2] = atom_j->x[2] - atom_i->x[2]; @@ -249,8 +247,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, if( nbr_pj->d <= SQR(cutoff) ) { nbr_pj->d = sqrt(nbr_pj->d); flag = 1; - } - else { + } else { flag = 0; } } @@ -357,8 +354,7 @@ void Estimate_Storages( reax_system *system, control_params *control, cutoff = control->nonb_cut; ++(*Htop); ihb = sbp_i->p_hbond; - } - else { + } else { local = 0; cutoff = control->bond_cut; ihb = -1; diff --git a/src/USER-REAXC/reaxc_nonbonded.cpp b/src/USER-REAXC/reaxc_nonbonded.cpp index b44632ec29..6e4582364f 100644 --- a/src/USER-REAXC/reaxc_nonbonded.cpp +++ b/src/USER-REAXC/reaxc_nonbonded.cpp @@ -127,7 +127,7 @@ void vdW_Coulomb_Energy( reax_system *system, control_params *control, CEvd = dTap * e_vdW - Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13; } - else{ // no shielding + else { // no shielding exp1 = exp( twbp->alpha * (1.0 - r_ij / twbp->r_vdW) ); exp2 = exp( 0.5 * twbp->alpha * (1.0 - r_ij / twbp->r_vdW) ); @@ -184,8 +184,7 @@ void vdW_Coulomb_Energy( reax_system *system, control_params *control, if( control->virial == 0 ) { rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec ); rvec_ScaledAdd( workspace->f[j], +(CEvd + CEclmb), nbr_pj->dvec ); - } - else { /* NPT, iNPT or sNPT */ + } else { /* NPT, iNPT or sNPT */ rvec_Scale( temp, CEvd + CEclmb, nbr_pj->dvec ); rvec_ScaledAdd( workspace->f[i], -1., temp ); @@ -297,8 +296,7 @@ void Tabulated_vdW_Coulomb_Energy( reax_system *system,control_params *control, if( control->virial == 0 ) { rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec ); rvec_ScaledAdd( workspace->f[j], +(CEvd + CEclmb), nbr_pj->dvec ); - } - else { // NPT, iNPT or sNPT + } else { // NPT, iNPT or sNPT rvec_Scale( temp, CEvd + CEclmb, nbr_pj->dvec ); rvec_ScaledAdd( workspace->f[i], -1., temp ); @@ -388,7 +386,7 @@ void LR_vdW_Coulomb( reax_system *system, storage *workspace, lr->CEvd = dTap * twbp->D * (exp1 - 2.0 * exp2) - Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13; } - else{ // no shielding + else { // no shielding exp1 = exp( twbp->alpha * (1.0 - r_ij / twbp->r_vdW) ); exp2 = exp( 0.5 * twbp->alpha * (1.0 - r_ij / twbp->r_vdW) ); diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp index 8a8de2707c..63a31b9577 100644 --- a/src/USER-REAXC/reaxc_traj.cpp +++ b/src/USER-REAXC/reaxc_traj.cpp @@ -291,10 +291,10 @@ int Write_Init_Desc( reax_system *system, control_params * /*control*/, out_control->line, INIT_DESC_LEN+1 ); } - if( me != MASTER_NODE ) + if (me != MASTER_NODE) { MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, np * INIT_DESCS + me, mpi_data->world ); - else{ + } else { buffer_len = system->n * INIT_DESC_LEN; for( i = 0; i < np; ++i ) if( i != MASTER_NODE ) { @@ -344,8 +344,7 @@ int Init_Traj( reax_system *system, control_params *control, if( out_control->traj_method == REG_TRAJ) { if( system->my_rank == MASTER_NODE ) out_control->strj = fopen( fname, "w" ); - } - else { + } else { strcpy( msg, "init_traj: unknown trajectory option" ); return FAILURE; } @@ -540,10 +539,10 @@ int Write_Atoms( reax_system *system, control_params * /*control*/, strncpy( out_control->buffer + i*line_len, out_control->line, line_len+1 ); } - if( me != MASTER_NODE ) + if (me != MASTER_NODE) { MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, np*ATOM_LINES+me, mpi_data->world ); - else{ + } else { buffer_len = system->n * line_len; for( i = 0; i < np; ++i ) if( i != MASTER_NODE ) { @@ -630,10 +629,10 @@ int Write_Bonds(reax_system *system, control_params *control, reax_list *bonds, } } - if( me != MASTER_NODE ) + i(f me != MASTER_NODE) { MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, np*BOND_LINES+me, mpi_data->world ); - else{ + } else { buffer_len = my_bonds * line_len; for( i = 0; i < np; ++i ) if( i != MASTER_NODE ) { @@ -725,10 +724,10 @@ int Write_Angles( reax_system *system, control_params *control, } } - if( me != MASTER_NODE ) + if (me != MASTER_NODE) { MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, np*ANGLE_LINES+me, mpi_data->world ); - else{ + } else { buffer_len = my_angles * line_len; for( i = 0; i < np; ++i ) if( i != MASTER_NODE ) { diff --git a/src/USER-REAXC/reaxc_valence_angles.cpp b/src/USER-REAXC/reaxc_valence_angles.cpp index bc844fdb1c..df51d1034c 100644 --- a/src/USER-REAXC/reaxc_valence_angles.cpp +++ b/src/USER-REAXC/reaxc_valence_angles.cpp @@ -143,8 +143,7 @@ void Valence_Angles( reax_system *system, control_params *control, if (workspace->vlpex[j] >= 0) { vlpadj = 0; dSBO2 = prod_SBO - 1; - } - else{ + } else { vlpadj = workspace->nlp[j]; dSBO2 = (prod_SBO - 1) * (1 - p_val8 * workspace->dDelta_lp[j]); } @@ -359,8 +358,7 @@ void Valence_Angles( reax_system *system, control_params *control, rvec_ScaledAdd( workspace->f[i], CEval8, p_ijk->dcos_di ); rvec_ScaledAdd( workspace->f[j], CEval8, p_ijk->dcos_dj ); rvec_ScaledAdd( workspace->f[k], CEval8, p_ijk->dcos_dk ); - } - else { + } else { rvec_Scale( force, CEval8, p_ijk->dcos_di ); rvec_Add( workspace->f[i], force ); rvec_iMultiply( ext_press, pbond_ij->rel_box, force ); diff --git a/src/region.cpp b/src/region.cpp index c52c0181aa..6b49a2819b 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -174,8 +174,7 @@ int Region::surface(double x, double y, double z, double cutoff) if (!openflag) { if (interior) ncontact = surface_interior(xnear,cutoff); else ncontact = surface_exterior(xnear,cutoff); - } - else{ + } else { // one of surface_int/ext() will return 0 // so no need to worry about offset of contact indices ncontact = surface_exterior(xnear,cutoff) + surface_interior(xnear,cutoff); diff --git a/src/region_block.cpp b/src/region_block.cpp index eeca132378..e55c481189 100644 --- a/src/region_block.cpp +++ b/src/region_block.cpp @@ -308,7 +308,7 @@ int RegBlock::surface_exterior(double *x, double cutoff) // could be edge or corner pt of block // do not add contact point if r >= cutoff - if (!openflag){ + if (!openflag) { if (x[0] < xlo) xp = xlo; else if (x[0] > xhi) xp = xhi; else xp = x[0]; @@ -318,13 +318,12 @@ int RegBlock::surface_exterior(double *x, double cutoff) if (x[2] < zlo) zp = zlo; else if (x[2] > zhi) zp = zhi; else zp = x[2]; - } - else{ + } else { mindist = BIG; for (int i = 0; i < 6; i++){ if (open_faces[i]) continue; dist = find_closest_point(i,x,xc,yc,zc); - if (dist < mindist){ + if (dist < mindist) { xp = xc; yp = yc; zp = zc; diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index 0bc567ff4f..7709c57aab 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -471,14 +471,14 @@ int RegCylinder::surface_exterior(double *x, double cutoff) if (x[0] < lo) xp = lo; else if (x[0] > hi) xp = hi; else xp = x[0]; - } + + } else { // closest point on curved surface - else { dr = r - radius; dr2 = dr*dr; - if (!open_faces[2]){ + if (!open_faces[2]) { yp = c1 + del1*radius/r; zp = c2 + del2*radius/r; if (x[0] < lo) { @@ -504,7 +504,7 @@ int RegCylinder::surface_exterior(double *x, double cutoff) else d2 = dr2 + dx*dx; if (d2 < d2prev) { xp = lo; - if (r < radius){ + if (r < radius) { yp = x[1]; zp = x[2]; } @@ -565,11 +565,11 @@ int RegCylinder::surface_exterior(double *x, double cutoff) if (x[1] < lo) yp = lo; else if (x[1] > hi) yp = hi; else yp = x[1]; - } + + } else { // closest point on curved surface - else { dr = r - radius; dr2 = dr*dr; if (!open_faces[2]){ @@ -659,25 +659,23 @@ int RegCylinder::surface_exterior(double *x, double cutoff) if (x[2] < lo) zp = lo; else if (x[2] > hi) zp = hi; else zp = x[2]; - } + + } else { // closest point on curved surface - else { dr = r - radius; dr2 = dr*dr; - if (!open_faces[2]){ + if (!open_faces[2]) { xp = c1 + del1*radius/r; yp = c2 + del2*radius/r; if (x[2] < lo) { dx = lo-x[2]; zp = lo; - } - else if (x[2] > hi) { + } else if (x[2] > hi) { dx = x[2]-hi; zp = hi; - } - else { + } else { dx = 0; zp = x[2]; } @@ -795,17 +793,15 @@ void RegCylinder::variable_check() void RegCylinder::set_velocity_shape() { - if (axis == 'x'){ + if (axis == 'x') { xcenter[0] = 0; xcenter[1] = c1; xcenter[2] = c2; - } - else if (axis == 'y'){ + } else if (axis == 'y') { xcenter[0] = c1; xcenter[1] = 0; xcenter[2] = c2; - } - else{ + } else { xcenter[0] = c1; xcenter[1] = c2; xcenter[2] = 0; @@ -825,17 +821,15 @@ void RegCylinder::set_velocity_shape() void RegCylinder::velocity_contact_shape(double *vwall, double *xc) { double delx, dely, delz; // Displacement of contact point in x,y,z - if (axis == 'x'){ + if (axis == 'x') { delx = 0; dely = (xc[1] - xcenter[1])*(1 - rprev/radius); delz = (xc[2] - xcenter[2])*(1 - rprev/radius); - } - else if (axis == 'y'){ + } else if (axis == 'y') { delx = (xc[0] - xcenter[0])*(1 - rprev/radius); dely = 0; delz = (xc[2] - xcenter[2])*(1 - rprev/radius); - } - else{ + } else { delx = (xc[0] - xcenter[0])*(1 - rprev/radius); dely = (xc[1] - xcenter[1])*(1 - rprev/radius); delz = 0; @@ -843,6 +837,5 @@ void RegCylinder::velocity_contact_shape(double *vwall, double *xc) vwall[0] += delx/update->dt; vwall[1] += dely/update->dt; vwall[2] += delz/update->dt; - //printf ("R is %g, prev %g, velocity of wall at %g %g %g is %g %g %g\n",radius,rprev,xc[0],xc[1],xc[2],vwall[0],vwall[1],vwall[2]); } From 2e7054113491bff61a2bc71af4d26cf15eb20338 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Dec 2018 14:49:28 -0500 Subject: [PATCH 82/94] consistent formatting: replace '}else' with '} else' --- src/KOKKOS/npair_kokkos.cpp | 10 +++++----- src/KOKKOS/npair_ssa_kokkos.cpp | 4 ++-- src/REPLICA/fix_neb.cpp | 2 +- src/USER-LB/fix_lb_fluid.cpp | 12 ++++++------ src/USER-LB/fix_lb_rigid_pc_sphere.cpp | 2 +- src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp | 2 +- src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp | 6 +++--- src/USER-MANIFOLD/manifold_gaussian_bump.cpp | 8 ++++---- src/USER-MANIFOLD/manifold_thylakoid.cpp | 4 ++-- src/USER-REAXC/reaxc_traj.cpp | 2 +- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/KOKKOS/npair_kokkos.cpp b/src/KOKKOS/npair_kokkos.cpp index 6f75e6cabc..88017c3f9d 100644 --- a/src/KOKKOS/npair_kokkos.cpp +++ b/src/KOKKOS/npair_kokkos.cpp @@ -383,7 +383,7 @@ void NeighborKokkosExecute:: if (which == 0){ if(n:: if (which == 0){ if(n::build_ItemCuda(typename Kokkos::TeamPoli if (which == 0){ if(n::build_ItemCuda(typename Kokkos::TeamPoli if (which == 0){ if(n:: if (which == 0){ if(n::build_locals_onePhase(const bool firstTr if (which == 0){ if(n::build_ghosts_onePhase(int workPhase) con if (which == 0){ if(nroot_proc[0]; MPI_Bcast(&vIni,1,MPI_DOUBLE,procFirst,uworld); - }else { + } else { if (me == 0) MPI_Bcast(&vIni,1,MPI_DOUBLE,0,rootworld); diff --git a/src/USER-LB/fix_lb_fluid.cpp b/src/USER-LB/fix_lb_fluid.cpp index 864bb02f3f..6f1dfc9982 100644 --- a/src/USER-LB/fix_lb_fluid.cpp +++ b/src/USER-LB/fix_lb_fluid.cpp @@ -1391,7 +1391,7 @@ satisfy the Courant condition.\n"); K_0 = 2.57*(a_0 - 0.333333333333333); } dtoverdtcollision = dt_lb*6.0*viscosity/densityinit_real/dx_lb/dx_lb; - }else if(typeLB==2){ + } else if(typeLB==2){ expminusdtovertau=exp(-1.0/tau); Dcoeff=(1.0-(1.0-expminusdtovertau)*tau); namp = 2.0*kB*T/3.; @@ -2019,7 +2019,7 @@ void FixLbFluid::equilibriumdist15(int xstart, int xend, int ystart, int yend, i (u_lb[i][j][k][0]*drhoz+u_lb[i][j][k][2]*drhox); Pyz = kappa_lb*drhoy*drhoz+(tau-0.5)*(1.0/3.0-dPdrho)* (u_lb[i][j][k][1]*drhoz+u_lb[i][j][k][2]*drhoy); - }else if(typeLB==2){ + } else if(typeLB==2){ Pxx = p0 + kappa_lb*(drhox*drhox - 0.5*grs)+tau*(1.0/3.0-dPdrho)* (3.0*u_lb[i][j][k][0]*drhox+u_lb[i][j][k][1]*drhoy+u_lb[i][j][k][2]*drhoz); Pyy = p0 + kappa_lb*(drhoy*drhoy - 0.5*grs)+tau*(1.0/3.0-dPdrho)* @@ -2197,7 +2197,7 @@ void FixLbFluid::equilibriumdist19(int xstart, int xend, int ystart, int yend, i (u_lb[i][j][k][0]*drhoz+u_lb[i][j][k][2]*drhox); Pyz = kappa_lb*drhoy*drhoz+(tau-0.5)*(1.0/3.0-dPdrho)* (u_lb[i][j][k][1]*drhoz+u_lb[i][j][k][2]*drhoy); - }else if(typeLB==2){ + } else if(typeLB==2){ Pxx = p0 + kappa_lb*(drhox*drhox - 0.5*grs)+tau*(1.0/3.0-dPdrho)* (3.0*u_lb[i][j][k][0]*drhox+u_lb[i][j][k][1]*drhoy+u_lb[i][j][k][2]*drhoz); Pyy = p0 + kappa_lb*(drhoy*drhoy - 0.5*grs)+tau*(1.0/3.0-dPdrho)* @@ -2488,7 +2488,7 @@ void FixLbFluid::update_periodic(int xstart, int xend, int ystart, int yend, int fnew[i][j][k][m] = f_lb[imod][jmod][kmod][m] + (feq[imod][jmod][kmod][m]-f_lb[imod][jmod][kmod][m])/tau; } - }else if(typeLB==2){ + } else if(typeLB==2){ for(m=0; mmyloc[2]==0){ for(i=1; imyloc[2]==0){ for(i=1; iall(FLERR,"Illegal fix lb/rigid/pc/sphere command"); + } else error->all(FLERR,"Illegal fix lb/rigid/pc/sphere command"); // error check on nbody diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index 5c0215aa95..8b5cf6334c 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -159,7 +159,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, nevery, next_output); } argi += 2; - }else if (error_on_unknown_keyword) { + } else if (error_on_unknown_keyword) { char msg[2048]; sprintf(msg,"Error parsing arg \"%s\".\n", arg[argi]); error->all(FLERR, msg); diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp index 47a1d65bbd..877aa3baa7 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -115,13 +115,13 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, got_temp = 1; argi += 4; - }else if (strcmp( arg[argi], "tchain" ) == 0) { + } else if (strcmp( arg[argi], "tchain" ) == 0) { if( argi+1 >= narg ) error->all(FLERR,"Keyword 'tchain' needs 1 argument"); mtchain = force->inumeric(FLERR, arg[argi+1]); argi += 2; - }else if (error_on_unknown_keyword) { + } else if (error_on_unknown_keyword) { char msg[2048]; sprintf(msg,"Error parsing arg \"%s\".\n", arg[argi]); error->all(FLERR, msg); @@ -354,7 +354,7 @@ void FixNVTManifoldRattle::nh_v_temp() v[i][2] *= factor_eta; } } - }else if (which == BIAS) { + } else if (which == BIAS) { for( int i = 0; i < nlocal; ++i ){ if (mask[i] & groupbit) { temperature->remove_bias(i,v[i]); diff --git a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp index 322f9671c2..91095d6b82 100644 --- a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp +++ b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp @@ -159,7 +159,7 @@ double manifold_gaussian_bump::g( const double *x ) double x2 = dot(xf,xf); if (x2 < rc12) { return x[2] - gaussian_bump_x2( x2 ); - }else if (x2 < rc22) { + } else if (x2 < rc22) { double rr = sqrt( x2 ); double z_taper_func = lut_get_z( rr ); return x[2] - z_taper_func; @@ -183,7 +183,7 @@ void manifold_gaussian_bump::n( const double *x, double *nn ) factor /= (ll*ll); nn[0] = factor * x[0]; nn[1] = factor * x[1]; - }else if (x2 < rc22) { + } else if (x2 < rc22) { double rr = sqrt( x2 ); double zp_taper_func = lut_get_zp( rr ); @@ -214,7 +214,7 @@ double manifold_gaussian_bump::g_and_n( const double *x, double *nn ) nn[1] = factor * x[1]; return x[2] - gb; - }else if (x2 < rc22) { + } else if (x2 < rc22) { double z_taper_func, zp_taper_func; double rr = sqrt( x2 ); lut_get_z_and_zp( rr, z_taper_func, zp_taper_func ); @@ -362,7 +362,7 @@ void manifold_gaussian_bump::test_lut() double taper_z; if (xx <= rc1) { taper_z = gaussian_bump(xx); - }else if (xx < rc2) { + } else if (xx < rc2) { taper_z = lut_get_z( xx ); } else { taper_z = 0.0; diff --git a/src/USER-MANIFOLD/manifold_thylakoid.cpp b/src/USER-MANIFOLD/manifold_thylakoid.cpp index 1c479ff25f..373a6cd4c7 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid.cpp @@ -491,11 +491,11 @@ void manifold_thylakoid::set_domain( thyla_part *p, const std::vector &l char msg[2048]; sprintf(msg,"xlo >= xhi (%f >= %f)",lo[0],hi[0]); error->one(FLERR,msg); - }else if (lo[1] >= hi[1]) { + } else if (lo[1] >= hi[1]) { char msg[2048]; sprintf(msg,"ylo >= yhi (%f >= %f)",lo[1],hi[1]); error->one(FLERR,msg); - }else if (lo[2] >= hi[2]) { + } else if (lo[2] >= hi[2]) { char msg[2048]; sprintf(msg,"zlo >= zhi (%f >= %f)",lo[2],hi[2]); error->one(FLERR,msg); diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp index 63a31b9577..946833afaa 100644 --- a/src/USER-REAXC/reaxc_traj.cpp +++ b/src/USER-REAXC/reaxc_traj.cpp @@ -629,7 +629,7 @@ int Write_Bonds(reax_system *system, control_params *control, reax_list *bonds, } } - i(f me != MASTER_NODE) { + if (me != MASTER_NODE) { MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, np*BOND_LINES+me, mpi_data->world ); } else { From 01163c9ae831c5fb34ca2fd6ee8707d0a4d14b78 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Dec 2018 16:30:38 -0500 Subject: [PATCH 83/94] correct error in Purge.list for removed files of the REAX package --- src/Purge.list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Purge.list b/src/Purge.list index 6cd8276419..8ea084960e 100644 --- a/src/Purge.list +++ b/src/Purge.list @@ -28,8 +28,8 @@ lmpinstalledpkgs.h pair_reax.cpp pair_reax.h pair_reax_fortran.h -fix_bond_reax.cpp -fix_bond_reax.h +fix_reax_bonds.cpp +fix_reax_bonds.h pair_meam.cpp pair_meam.h # renamed on 25 September 2018 From 6e866f82a788c98adaad1d5c61f54a38932e4140 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Dec 2018 16:31:44 -0500 Subject: [PATCH 84/94] correct typo (missing increment operator) in fix bond/react --- src/USER-MISC/fix_bond_react.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-MISC/fix_bond_react.cpp b/src/USER-MISC/fix_bond_react.cpp index 600bb6a540..b9a8d58c41 100644 --- a/src/USER-MISC/fix_bond_react.cpp +++ b/src/USER-MISC/fix_bond_react.cpp @@ -2560,7 +2560,7 @@ void FixBondReact::update_everything() else { for (int j = 0; j < atom->num_improper[i]; j++) { int m = atom->map(atom->improper_atom2[i][j]); - if (m >= 0 && m < nlocal) delta_imprp; + if (m >= 0 && m < nlocal) delta_imprp++; } } } From f25bfd5931157fb150e6613ba1d7d83afd0ab92b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Dec 2018 17:04:28 -0500 Subject: [PATCH 85/94] consistent formatting: replace "if( XXX )" with "if (XXX)" --- src/KOKKOS/fix_enforce2d_kokkos.cpp | 12 +- src/KOKKOS/pair_reaxc_kokkos.cpp | 50 +++---- src/MANYBODY/pair_comb3.cpp | 4 +- src/MANYBODY/pair_lcbop.cpp | 32 ++--- src/QEQ/fix_qeq_dynamic.cpp | 2 +- src/QEQ/fix_qeq_fire.cpp | 2 +- src/QEQ/fix_qeq_point.cpp | 2 +- src/QEQ/fix_qeq_shielded.cpp | 2 +- src/QEQ/fix_qeq_slater.cpp | 2 +- src/USER-DPD/nbin_ssa.cpp | 12 +- src/USER-MANIFOLD/fix_manifoldforce.cpp | 2 +- src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp | 12 +- src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp | 20 +-- src/USER-MANIFOLD/manifold_gaussian_bump.cpp | 6 +- src/USER-MANIFOLD/manifold_thylakoid.cpp | 4 +- src/USER-MISC/fix_rhok.cpp | 16 +-- src/USER-MISC/pair_srp.cpp | 4 +- src/USER-OMP/pair_reaxc_omp.cpp | 2 +- src/USER-OMP/reaxc_bond_orders_omp.cpp | 22 ++-- src/USER-OMP/reaxc_bonds_omp.cpp | 4 +- src/USER-OMP/reaxc_forces_omp.cpp | 26 ++-- src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp | 6 +- src/USER-OMP/reaxc_init_md_omp.cpp | 18 +-- src/USER-OMP/reaxc_multi_body_omp.cpp | 8 +- src/USER-OMP/reaxc_nonbonded_omp.cpp | 6 +- src/USER-OMP/reaxc_torsion_angles_omp.cpp | 6 +- src/USER-OMP/reaxc_valence_angles_omp.cpp | 16 +-- src/USER-QUIP/pair_quip.cpp | 2 +- src/USER-REAXC/pair_reaxc.cpp | 10 +- src/USER-REAXC/reaxc_allocate.cpp | 26 ++-- src/USER-REAXC/reaxc_bond_orders.cpp | 32 ++--- src/USER-REAXC/reaxc_bonds.cpp | 6 +- src/USER-REAXC/reaxc_control.cpp | 122 +++++++++--------- src/USER-REAXC/reaxc_ffield.cpp | 10 +- src/USER-REAXC/reaxc_forces.cpp | 60 ++++----- src/USER-REAXC/reaxc_hydrogen_bonds.cpp | 6 +- src/USER-REAXC/reaxc_init_md.cpp | 28 ++-- src/USER-REAXC/reaxc_io_tools.cpp | 16 +-- src/USER-REAXC/reaxc_list.cpp | 2 +- src/USER-REAXC/reaxc_lookup.cpp | 6 +- src/USER-REAXC/reaxc_multi_body.cpp | 8 +- src/USER-REAXC/reaxc_nonbonded.cpp | 6 +- src/USER-REAXC/reaxc_reset_tools.cpp | 16 +-- src/USER-REAXC/reaxc_system_props.cpp | 2 +- src/USER-REAXC/reaxc_tool_box.cpp | 12 +- src/USER-REAXC/reaxc_torsion_angles.cpp | 26 ++-- src/USER-REAXC/reaxc_traj.cpp | 56 ++++---- src/USER-REAXC/reaxc_valence_angles.cpp | 24 ++-- src/USER-REAXC/reaxc_vector.cpp | 2 +- src/VORONOI/compute_voronoi_atom.cpp | 12 +- 50 files changed, 394 insertions(+), 394 deletions(-) diff --git a/src/KOKKOS/fix_enforce2d_kokkos.cpp b/src/KOKKOS/fix_enforce2d_kokkos.cpp index 26075b269c..f4f239123b 100644 --- a/src/KOKKOS/fix_enforce2d_kokkos.cpp +++ b/src/KOKKOS/fix_enforce2d_kokkos.cpp @@ -56,13 +56,13 @@ void FixEnforce2DKokkos::post_force(int vflag) v = atomKK->k_v.view(); f = atomKK->k_f.view(); - if( atomKK->omega_flag ) + if (atomKK->omega_flag) omega = atomKK->k_omega.view(); - if( atomKK->angmom_flag ) + if (atomKK->angmom_flag) angmom = atomKK->k_angmom.view(); - if( atomKK->torque_flag ) + if (atomKK->torque_flag) torque = atomKK->k_torque.view(); @@ -72,9 +72,9 @@ void FixEnforce2DKokkos::post_force(int vflag) if (igroup == atomKK->firstgroup) nlocal = atomKK->nfirst; int flag_mask = 0; - if( atomKK->omega_flag ) flag_mask |= 1; - if( atomKK->angmom_flag ) flag_mask |= 2; - if( atomKK->torque_flag ) flag_mask |= 4; + if (atomKK->omega_flag) flag_mask |= 1; + if (atomKK->angmom_flag) flag_mask |= 2; + if (atomKK->torque_flag) flag_mask |= 4; copymode = 1; switch( flag_mask ){ diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index 6e0857e80d..22e3e6b28f 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -554,7 +554,7 @@ void PairReaxCKokkos::Deallocate_Lookup_Tables() for( i = 0; i <= ntypes; ++i ) { for( j = i; j <= ntypes; ++j ) - if( LR[i][j].n ) { + if (LR[i][j].n) { sfree( LR[i][j].y, "LR[i,j].y" ); sfree( LR[i][j].H, "LR[i,j].H" ); sfree( LR[i][j].vdW, "LR[i,j].vdW" ); @@ -1317,7 +1317,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeTabulatedLJCoulomb::operator()(PairReaxBondOrder3, const int &ii) const F_FLOAT Clp = 2.0 * gp[15] * explp1 * (2.0 + vlpex); d_dDelta_lp[i] = Clp; - if( paramssing(itype).mass > 21.0 ) { + if (paramssing(itype).mass > 21.0) { nlp_temp = 0.5 * (paramssing(itype).valency_e - paramssing(itype).valency); d_Delta_lp_temp[i] = paramssing(itype).nlp_opt - nlp_temp; } else { @@ -2578,13 +2578,13 @@ void PairReaxCKokkos::operator()(PairReaxComputeAngular 0.0 && SBO <= 1.0 ) { + } else if (SBO > 0.0 && SBO <= 1.0) { SBO2 = pow( SBO, p_val9 ); CSBO2 = p_val9 * pow( SBO, p_val9 - 1.0 ); - } else if( SBO > 1.0 && SBO < 2.0 ) { + } else if (SBO > 1.0 && SBO < 2.0) { SBO2 = 2.0 - pow( 2.0-SBO, p_val9 ); CSBO2 = p_val9 * pow( 2.0 - SBO, p_val9 - 1.0 ); } else { @@ -2640,8 +2640,8 @@ void PairReaxCKokkos::operator()(PairReaxComputeAngular 1.0 ) cos_theta = 1.0; - if( cos_theta < -1.0 ) cos_theta = -1.0; + if (cos_theta > 1.0) cos_theta = 1.0; + if (cos_theta < -1.0) cos_theta = -1.0; theta = acos(cos_theta); const F_FLOAT inv_dists = 1.0 / (rij * rik); @@ -2682,7 +2682,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeAngular= 0 ) + if (p_val1 >= 0) expval12theta = p_val1 * (1.0 - expval2theta); else // To avoid linear Me-H-Me angles (6/6/06) expval12theta = p_val1 * -expval2theta; @@ -2910,8 +2910,8 @@ void PairReaxCKokkos::operator()(PairReaxComputeTorsion 1.0 ) cos_ijk = 1.0; - if( cos_ijk < -1.0 ) cos_ijk = -1.0; + if (cos_ijk > 1.0) cos_ijk = 1.0; + if (cos_ijk < -1.0) cos_ijk = -1.0; theta_ijk = acos(cos_ijk); // dcos_ijk @@ -2925,7 +2925,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeTorsion= 0 && sin_ijk <= 1e-10 ) + if (sin_ijk >= 0 && sin_ijk <= 1e-10) tan_ijk_i = cos_ijk / 1e-10; else if( sin_ijk <= 0 && sin_ijk >= -1e-10 ) tan_ijk_i = -cos_ijk / 1e-10; @@ -2952,8 +2952,8 @@ void PairReaxCKokkos::operator()(PairReaxComputeTorsion 1.0 ) cos_jil = 1.0; - if( cos_jil < -1.0 ) cos_jil = -1.0; + if (cos_jil > 1.0) cos_jil = 1.0; + if (cos_jil < -1.0) cos_jil = -1.0; theta_jil = acos(cos_jil); // dcos_jil @@ -2968,7 +2968,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeTorsion= 0 && sin_jil <= 1e-10 ) + if (sin_jil >= 0 && sin_jil <= 1e-10) tan_jil_i = cos_jil / 1e-10; else if( sin_jil <= 0 && sin_jil >= -1e-10 ) tan_jil_i = -cos_jil / 1e-10; @@ -3008,21 +3008,21 @@ void PairReaxCKokkos::operator()(PairReaxComputeTorsion 1.0 ) arg = 1.0; - if( arg < -1.0 ) arg = -1.0; + if (arg > 1.0) arg = 1.0; + if (arg < -1.0) arg = -1.0; F_FLOAT sin_ijk_rnd = sin_ijk; F_FLOAT sin_jil_rnd = sin_jil; - if( sin_ijk >= 0 && sin_ijk <= 1e-10 ) sin_ijk_rnd = 1e-10; + if (sin_ijk >= 0 && sin_ijk <= 1e-10) sin_ijk_rnd = 1e-10; else if( sin_ijk <= 0 && sin_ijk >= -1e-10 ) sin_ijk_rnd = -1e-10; - if( sin_jil >= 0 && sin_jil <= 1e-10 ) sin_jil_rnd = 1e-10; + if (sin_jil >= 0 && sin_jil <= 1e-10) sin_jil_rnd = 1e-10; else if( sin_jil <= 0 && sin_jil >= -1e-10 ) sin_jil_rnd = -1e-10; // dcos_omega_di @@ -3196,7 +3196,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeHydrogen::operator()(PairReaxComputeHydrogen= HB_THRESHOLD ) { + if (paramssing(jtype).p_hbond == 2 && bo_ij >= HB_THRESHOLD) { hblist[top] = jj; top ++; } @@ -3256,8 +3256,8 @@ void PairReaxCKokkos::operator()(PairReaxComputeHydrogen 1.0 ) cos_theta = 1.0; - if( cos_theta < -1.0 ) cos_theta = -1.0; + if (cos_theta > 1.0) cos_theta = 1.0; + if (cos_theta < -1.0) cos_theta = -1.0; theta = acos(cos_theta); const F_FLOAT inv_dists = 1.0 / (rij * rik); @@ -3475,7 +3475,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeBond1= 1.00 ) { + if (BO_i >= 1.00) { if( gp[37] == 2 || (imass == 12.0000 && jmass == 15.9990) || (jmass == 12.0000 && imass == 15.9990) ) { const F_FLOAT exphu = exp(-gp[7] * SQR(BO_i - 2.50) ); diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index 106b83eeba..8e7a59d15f 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -1250,7 +1250,7 @@ void PairComb3::compute(int eflag, int vflag) // torsion: i-j-k-l: apply to all C-C bonds - if( params[iparam_ij].tor_flag != 0 ) { + if (params[iparam_ij].tor_flag != 0) { srmu = vec3_dot(delrj,delrk)/(sqrt(rsq1*rsq2)); srmu = sqrt(1.0-srmu*srmu); @@ -2578,7 +2578,7 @@ void PairComb3::tables() rvdw[1][inty] = params[iparam_ij].vsig * 0.950; // radius check: outer radius vs. sigma - if( rvdw[0][inty] > rvdw[1][inty] ) + if (rvdw[0][inty] > rvdw[1][inty]) error->all(FLERR,"Error in vdw spline: inner radius > outer radius"); rrc[0] = rvdw[1][inty]; diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp index 88477e48f3..7d683e8ed8 100644 --- a/src/MANYBODY/pair_lcbop.cpp +++ b/src/MANYBODY/pair_lcbop.cpp @@ -402,7 +402,7 @@ void PairLCBOP::FSR(int eflag, int /*vflag*/) r_sq = delx*delx + dely*dely + delz*delz; rijmag = sqrt(r_sq); f_c_ij = f_c( rijmag,r_1,r_2,&df_c_ij ); - if( f_c_ij <= TOL ) continue; + if (f_c_ij <= TOL) continue; VR = A*exp(-alpha*rijmag); dVRdi = -alpha*VR; @@ -502,10 +502,10 @@ void PairLCBOP::FLR(int eflag, int /*vflag*/) df_c_ij = -df_c_ij; // derivative may be inherited from previous call, see f_c_LR definition f_c_ij *= f_c_LR( rijmag, r_1_LR, r_2_LR, &df_c_ij ); - if( f_c_ij <= TOL ) continue; + if (f_c_ij <= TOL) continue; V = dVdi = 0; - if( rijmag r_1*r_1 ) { // && riksq < r_2*r_2, if second condition not fulfilled neighbor would not be in the list + if (riksq > r_1*r_1) { // && riksq < r_2*r_2, if second condition not fulfilled neighbor would not be in the list double rikmag = sqrt(riksq); double df_c_ik; f_c( rikmag, r_1, r_2, &df_c_ik ); @@ -598,7 +598,7 @@ void PairLCBOP::FMij( int i, int j, double factor, double **f, int vflag_atom ) double Fx = 1-f_c_LR(Nki, 2,3,&dF); dF = -dF; - if( df_c_ik > TOL ) { + if (df_c_ik > TOL) { double factor2 = factor*df_c_ik*Fx; // F = factor2*(-grad rikmag) // grad_i rikmag = \vec{rik} /rikmag @@ -613,7 +613,7 @@ void PairLCBOP::FMij( int i, int j, double factor, double **f, int vflag_atom ) if (vflag_atom) v_tally2(atomi,atomk,fpair,rik); } - if( dF > TOL ) { + if (dF > TOL) { double factor2 = factor*f_c_ik*dF; FNij( atomk, atomi, factor2, f, vflag_atom ); } @@ -676,12 +676,12 @@ double PairLCBOP::bondorder(int i, int j, double rij[3], double num_Nconj = ( Nij+1 )*( Nji+1 )*( Nij_el+Nji_el ) - 4*( Nij+Nji+2); double den_Nconj = Nij*( 3-Nij )*( Nji+1 ) + Nji*( 3-Nji )*( Nij+1 ) + eps; Nconj = num_Nconj / den_Nconj; - if( Nconj <= 0 ) { + if (Nconj <= 0) { Nconj = 0; dNconj_dNij = 0; dNconj_dNji = 0; dNconj_dNel = 0; - } else if( Nconj >= 1 ) { + } else if (Nconj >= 1) { Nconj = 1; dNconj_dNij = 0; dNconj_dNji = 0; @@ -703,21 +703,21 @@ double PairLCBOP::bondorder(int i, int j, double rij[3], Fij_conj = F_conj( Nij, Nji, Nconj, &dF_dNij, &dF_dNji, &dF_dNconj ); /*forces for Nij*/ - if( 3-Nij > TOL ) { + if (3-Nij > TOL) { double factor = -VA*0.5*( dF_dNij + dF_dNconj*( dNconj_dNij + dNconj_dNel*dNij_el_dNij ) ); FNij( i, j, factor, f, vflag_atom ); } /*forces for Nji*/ - if( 3-Nji > TOL ) { + if (3-Nji > TOL) { double factor = -VA*0.5*( dF_dNji + dF_dNconj*( dNconj_dNji + dNconj_dNel*dNji_el_dNji ) ); FNij( j, i, factor, f, vflag_atom ); } /*forces for Mij*/ - if( 3-Mij > TOL ) { + if (3-Mij > TOL) { double factor = -VA*0.5*( dF_dNconj*dNconj_dNel*dNij_el_dMij ); FMij( i, j, factor, f, vflag_atom ); } - if( 3-Mji > TOL ) { + if (3-Mji > TOL) { double factor = -VA*0.5*( dF_dNconj*dNconj_dNel*dNji_el_dMji ); FMij( j, i, factor, f, vflag_atom ); } @@ -900,14 +900,14 @@ double PairLCBOP::gSpline( double x, double *dgdc ) { /* ---------------------------------------------------------------------- */ double PairLCBOP::hSpline( double x, double *dhdx ) { - if( x < -d ) { + if (x < -d) { double z = kappa*( x+d ); double y = pow(z, 10.0); double w = pow( 1+y, -0.1 ); *dhdx = kappa*L*w/(1+y); return L*( 1 + z*w ); } - if( x > d ) { + if (x > d) { *dhdx = R_1; return R_0 + R_1*( x-d ); } @@ -941,13 +941,13 @@ double PairLCBOP::F_conj( double N_ij, double N_ji, double N_conj_ij, double *dF double dF_0_dx = 0, dF_0_dy = 0; double dF_1_dx = 0, dF_1_dy = 0; double l, r; - if( N_conj_ij < 1 ) { + if (N_conj_ij < 1) { l = (1-y)* (1-x); r = ( f0.f_00 + x* x* f0.f_x_10 + y* y* f0.f_y_01 ); F_0 += l*r; dF_0_dx += -(1-y)*r +l*2*x* f0.f_x_10; dF_0_dy += -(1-x)*r +l*2*y* f0.f_y_01; l = (1-y)* x; r = ( f0.f_10 + (1-x)*(1-x)*f0.f_x_00 + y* y* f0.f_y_11 ); F_0 += l*r; dF_0_dx += (1-y)*r -l*2*(1-x)*f0.f_x_00; dF_0_dy += -x* r +l*2*y* f0.f_y_11; l = y* (1-x); r = ( f0.f_01 + x* x* f0.f_x_11 + (1-y)*(1-y)*f0.f_y_00 ); F_0 += l*r; dF_0_dx += -y* r +l*2*x* f0.f_x_11; dF_0_dy += (1-x)*r -l*2*(1-y)*f0.f_y_00; l = y* x; r = ( f0.f_11 + (1-x)*(1-x)*f0.f_x_01 + (1-y)*(1-y)*f0.f_y_10 ); F_0 += l*r; dF_0_dx += y* r -l*2*(1-x)*f0.f_x_01; dF_0_dy += x* r -l*2*(1-y)*f0.f_y_10; } - if( N_conj_ij > 0 ) { + if (N_conj_ij > 0) { l = (1-y)* (1-x); r = ( f0.f_00 + x* x* f1.f_x_10 + y* y* f1.f_y_01 ); F_1 += l*r; dF_1_dx += -(1-y)*r +l*2*x* f1.f_x_10; dF_1_dy += -(1-x)*r +l*2*y* f1.f_y_01; l = (1-y)* x; r = ( f1.f_10 + (1-x)*(1-x)*f1.f_x_00 + y* y* f1.f_y_11 ); F_1 += l*r; dF_1_dx += (1-y)*r -l*2*(1-x)*f1.f_x_00; dF_1_dy += -x* r +l*2*y* f1.f_y_11; l = y* (1-x); r = ( f1.f_01 + x* x* f1.f_x_11 + (1-y)*(1-y)*f1.f_y_00 ); F_1 += l*r; dF_1_dx += -y* r +l*2*x* f1.f_x_11; dF_1_dy += (1-x)*r -l*2*(1-y)*f1.f_y_00; diff --git a/src/QEQ/fix_qeq_dynamic.cpp b/src/QEQ/fix_qeq_dynamic.cpp index f496c7e6c0..1f1dd966f5 100644 --- a/src/QEQ/fix_qeq_dynamic.cpp +++ b/src/QEQ/fix_qeq_dynamic.cpp @@ -251,7 +251,7 @@ int FixQEqDynamic::pack_forward_comm(int n, int *list, double *buf, { int m=0; - if( pack_flag == 1 ) + if (pack_flag == 1) for(m = 0; m < n; m++) buf[m] = atom->q[list[m]]; else if( pack_flag == 2 ) for(m = 0; m < n; m++) buf[m] = qf[list[m]]; diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp index 83c9907f1b..a8591c2b9b 100644 --- a/src/QEQ/fix_qeq_fire.cpp +++ b/src/QEQ/fix_qeq_fire.cpp @@ -315,7 +315,7 @@ int FixQEqFire::pack_forward_comm(int n, int *list, double *buf, { int m = 0; - if( pack_flag == 1 ) + if (pack_flag == 1) for(m = 0; m < n; m++) buf[m] = atom->q[list[m]]; else if( pack_flag == 2 ) for(m = 0; m < n; m++) buf[m] = qf[list[m]]; diff --git a/src/QEQ/fix_qeq_point.cpp b/src/QEQ/fix_qeq_point.cpp index db2d800c06..2afedbaa69 100644 --- a/src/QEQ/fix_qeq_point.cpp +++ b/src/QEQ/fix_qeq_point.cpp @@ -75,7 +75,7 @@ void FixQEqPoint::pre_force(int /*vflag*/) if( atom->nmax > nmax ) reallocate_storage(); - if( nlocal > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE ) + if (nlocal > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE) reallocate_matrix(); init_matvec(); diff --git a/src/QEQ/fix_qeq_shielded.cpp b/src/QEQ/fix_qeq_shielded.cpp index 88cd1ab3ad..1c59474b47 100644 --- a/src/QEQ/fix_qeq_shielded.cpp +++ b/src/QEQ/fix_qeq_shielded.cpp @@ -119,7 +119,7 @@ void FixQEqShielded::pre_force(int /*vflag*/) if( atom->nmax > nmax ) reallocate_storage(); - if( nlocal > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE ) + if (nlocal > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE) reallocate_matrix(); init_matvec(); diff --git a/src/QEQ/fix_qeq_slater.cpp b/src/QEQ/fix_qeq_slater.cpp index 81fdc73241..68edbd80f7 100644 --- a/src/QEQ/fix_qeq_slater.cpp +++ b/src/QEQ/fix_qeq_slater.cpp @@ -116,7 +116,7 @@ void FixQEqSlater::pre_force(int /*vflag*/) if( atom->nmax > nmax ) reallocate_storage(); - if( nlocal > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE ) + if (nlocal > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE) reallocate_matrix(); init_matvec(); diff --git a/src/USER-DPD/nbin_ssa.cpp b/src/USER-DPD/nbin_ssa.cpp index 4c57a8e70f..dcd434cb4a 100644 --- a/src/USER-DPD/nbin_ssa.cpp +++ b/src/USER-DPD/nbin_ssa.cpp @@ -147,12 +147,12 @@ int NBinSSA::coord2ssaAIR(const double *x) if(iz < 0){ return -1; } else if(iz == 0){ - if( iy<0 ) return -1; // bottom left/middle/right - if( (iy==0) && (ix<0) ) return -1; // left atoms - if( (iy==0) && (ix==0) ) return 0; // Locally owned atoms - if( (iy==0) && (ix>0) ) return 2; // Right atoms - if( (iy>0) && (ix==0) ) return 1; // Top-middle atoms - if( (iy>0) && (ix!=0) ) return 3; // Top-right and top-left atoms + if (iy<0) return -1; // bottom left/middle/right + if ((iy==0) && (ix<0) ) return -1; // left atoms + if ((iy==0) && (ix==0)) return 0; // Locally owned atoms + if ((iy==0) && (ix>0) ) return 2; // Right atoms + if ((iy>0) && (ix==0)) return 1; // Top-middle atoms + if ((iy>0) && (ix!=0)) return 3; // Top-right and top-left atoms } else { // iz > 0 if((ix==0) && (iy==0)) return 4; // Back atoms if((ix==0) && (iy!=0)) return 5; // Top-back and bottom-back atoms diff --git a/src/USER-MANIFOLD/fix_manifoldforce.cpp b/src/USER-MANIFOLD/fix_manifoldforce.cpp index f792dc9886..00293bfec7 100644 --- a/src/USER-MANIFOLD/fix_manifoldforce.cpp +++ b/src/USER-MANIFOLD/fix_manifoldforce.cpp @@ -89,7 +89,7 @@ FixManifoldForce::FixManifoldForce(LAMMPS *lmp, int narg, char **arg) : double *params = ptr_m->params; for( int i = 0; i < nvars; ++i ){ - if( was_var( arg[i+4] ) ) + if (was_var( arg[i+4] )) error->all(FLERR,"Equal-style variables not allowed with fix manifoldforce"); // Use force->numeric to trigger an error if arg is not a number. diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index 8b5cf6334c..e86b3c97ea 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -182,9 +182,9 @@ FixNVEManifoldRattle::~FixNVEManifoldRattle() delete [] tstrs; } - if( tvars ) delete [] tvars; - if( tstyle ) delete [] tstyle; - if( is_var ) delete [] is_var; + if (tvars ) delete [] tvars; + if (tstyle) delete [] tstyle; + if (is_var) delete [] is_var; } @@ -261,7 +261,7 @@ int FixNVEManifoldRattle::setmask() int mask = 0; mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; - if( nevery > 0 ) mask |= END_OF_STEP; + if (nevery > 0) mask |= END_OF_STEP; return mask; } @@ -322,7 +322,7 @@ int FixNVEManifoldRattle::dof(int /*igroup*/) // Make sure that, if there is just no or one atom, no dofs are subtracted, // since for the first atom already 3 dofs are subtracted because of the // centre of mass corrections: - if( dofs <= 1 ) dofs = 0; + if (dofs <= 1) dofs = 0; stats.dofs_removed = dofs; return dofs; @@ -549,7 +549,7 @@ void FixNVEManifoldRattle::rattle_manifold_x(double *x, double *v, res = infnorm<4>(R); ++iters; - if( (res < tolerance) || (iters >= max_iter) ) break; + if ((res < tolerance) || (iters >= max_iter)) break; // Update nn and g. gg = ptr_m->g(x); diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp index 877aa3baa7..1e9d0015f1 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -105,7 +105,7 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, while( argi < narg ) { if (strcmp( arg[argi], "temp") == 0) { - if( argi+3 >= narg ) + if (argi+3 >= narg) error->all(FLERR,"Keyword 'temp' needs 3 arguments"); t_start = force->numeric(FLERR, arg[argi+1]); @@ -116,7 +116,7 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, argi += 4; } else if (strcmp( arg[argi], "tchain" ) == 0) { - if( argi+1 >= narg ) + if (argi+1 >= narg) error->all(FLERR,"Keyword 'tchain' needs 1 argument"); mtchain = force->inumeric(FLERR, arg[argi+1]); @@ -158,7 +158,7 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, "does not exist"); } temperature = modify->compute[icompute]; - if( temperature->tempbias ) which = BIAS; + if (temperature->tempbias) which = BIAS; else which = NOBIAS; // Set t_freq from t_period @@ -184,13 +184,13 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, FixNVTManifoldRattle::~FixNVTManifoldRattle() { // Deallocate heap-allocated objects. - if( eta ) delete[] eta; - if( eta_dot ) delete[] eta_dot; - if( eta_dotdot ) delete[] eta_dotdot; - if( eta_mass ) delete[] eta_mass; + if (eta) delete[] eta; + if (eta_dot) delete[] eta_dot; + if (eta_dotdot) delete[] eta_dotdot; + if (eta_mass) delete[] eta_mass; modify->delete_compute(id_temp); - if( id_temp ) delete[] id_temp; + if (id_temp) delete[] id_temp; } @@ -201,7 +201,7 @@ int FixNVTManifoldRattle::setmask() int mask = 0; mask |= INITIAL_INTEGRATE; mask |= FINAL_INTEGRATE; - if( nevery > 0 ) mask |= END_OF_STEP; + if (nevery > 0) mask |= END_OF_STEP; return mask; } @@ -222,7 +222,7 @@ void FixNVTManifoldRattle::init() "does not exist"); } temperature = modify->compute[icompute]; - if( temperature->tempbias ) which = BIAS; + if (temperature->tempbias) which = BIAS; else which = NOBIAS; } diff --git a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp index 91095d6b82..c40f3c73bb 100644 --- a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp +++ b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp @@ -139,8 +139,8 @@ manifold_gaussian_bump::manifold_gaussian_bump(class LAMMPS* lmp, manifold_gaussian_bump::~manifold_gaussian_bump() { - if( lut_z ) delete lut_z; - if( lut_zp ) delete lut_zp; + if (lut_z ) delete lut_z; + if (lut_zp) delete lut_zp; } @@ -349,7 +349,7 @@ void manifold_gaussian_bump::lut_get_z_and_zp( double rr, double &zz, void manifold_gaussian_bump::test_lut() { double x[3], nn[3]; - if( comm->me != 0 ) return; + if (comm->me != 0) return; FILE *fp = fopen( "test_lut_gaussian.dat", "w" ); double dx = 0.1; diff --git a/src/USER-MANIFOLD/manifold_thylakoid.cpp b/src/USER-MANIFOLD/manifold_thylakoid.cpp index 373a6cd4c7..530e0a876d 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid.cpp @@ -123,7 +123,7 @@ thyla_part *manifold_thylakoid::get_thyla_part( const double *x, int * /*err_fla for( std::size_t i = 0; i < parts.size(); ++i ){ thyla_part *p = parts[i]; if (is_in_domain(p,x)) { - if( idx != NULL ) *idx = i; + if (idx != NULL) *idx = i; return p; } } @@ -515,7 +515,7 @@ int manifold_thylakoid::is_in_domain( thyla_part *part, const double *x ) (x[1] >= part->ylo) && (x[1] <= part->yhi) && (x[2] >= part->zlo) && (x[2] <= part->zhi); - if( !domain_ok ) return false; + if (!domain_ok) return false; // From here on out, domain is ok. diff --git a/src/USER-MISC/fix_rhok.cpp b/src/USER-MISC/fix_rhok.cpp index 78d63b79a8..6a6e71ebaa 100644 --- a/src/USER-MISC/fix_rhok.cpp +++ b/src/USER-MISC/fix_rhok.cpp @@ -52,7 +52,7 @@ FixRhok::FixRhok( LAMMPS* inLMP, int inArgc, char** inArgv ) if (lmp->citeme) lmp->citeme->add(cite_fix_rhok); // Check arguments - if( inArgc != 8 ) + if (inArgc != 8) error->all(FLERR,"Illegal fix rhoKUmbrella command" ); // Set up fix flags @@ -104,7 +104,7 @@ void FixRhok::init() { // RESPA boilerplate - if( strcmp( update->integrate_style, "respa" ) == 0 ) + if (strcmp( update->integrate_style, "respa" ) == 0) mNLevelsRESPA = ((Respa *) update->integrate)->nlevels; // Count the number of affected particles @@ -112,7 +112,7 @@ FixRhok::init() int *mask = atom->mask; int nlocal = atom->nlocal; for( int i = 0; i < nlocal; i++ ) { // Iterate through all atoms on this CPU - if( mask[i] & groupbit ) { // ...only those affected by this fix + if (mask[i] & groupbit) { // ...only those affected by this fix nThisLocal++; } } @@ -125,7 +125,7 @@ FixRhok::init() void FixRhok::setup( int inVFlag ) { - if( strcmp( update->integrate_style, "verlet" ) == 0 ) + if (strcmp( update->integrate_style, "verlet" ) == 0) post_force( inVFlag ); else { @@ -157,7 +157,7 @@ FixRhok::post_force( int /*inVFlag*/ ) mRhoKLocal[1] = 0.0; for( int i = 0; i < nlocal; i++ ) { // Iterate through all atoms on this CPU - if( mask[i] & groupbit ) { // ...only those affected by this fix + if (mask[i] & groupbit) { // ...only those affected by this fix // rho_k = sum_i exp( - i k.r_i ) mRhoKLocal[0] += cos( mK[0]*x[i][0] + mK[1]*x[i][1] + mK[2]*x[i][2] ); @@ -180,7 +180,7 @@ FixRhok::post_force( int /*inVFlag*/ ) + mRhoKGlobal[1]*mRhoKGlobal[1] ); for( int i = 0; i < nlocal; i++ ) { // Iterate through all atoms on this CPU - if( mask[i] & groupbit ) { // ...only those affected by this fix + if (mask[i] & groupbit) { // ...only those affected by this fix // Calculate forces // U = kappa/2 ( |rho_k| - rho_k^0 )^2 @@ -208,7 +208,7 @@ FixRhok::post_force( int /*inVFlag*/ ) void FixRhok::post_force_respa( int inVFlag, int inILevel, int /*inILoop*/ ) { - if( inILevel == mNLevelsRESPA - 1 ) + if (inILevel == mNLevelsRESPA - 1) post_force( inVFlag ); } @@ -233,7 +233,7 @@ FixRhok::compute_scalar() double FixRhok::compute_vector( int inI ) { - if( inI == 0 ) + if (inI == 0) return mRhoKGlobal[0]; // Real part else if( inI == 1 ) return mRhoKGlobal[1]; // Imagniary part diff --git a/src/USER-MISC/pair_srp.cpp b/src/USER-MISC/pair_srp.cpp index 97b3aa6c43..8f34e846c5 100644 --- a/src/USER-MISC/pair_srp.cpp +++ b/src/USER-MISC/pair_srp.cpp @@ -197,7 +197,7 @@ void PairSRP::compute(int eflag, int vflag) j = jlist[jj]; // enforce 1-2 exclusions - if( (sbmask(j) & exclude) ) + if ((sbmask(j) & exclude)) continue; j &= NEIGHMASK; @@ -274,7 +274,7 @@ void PairSRP::compute(int eflag, int vflag) j = jlist[jj]; // enforce 1-2 exclusions - if( (sbmask(j) & exclude) ) + if ((sbmask(j) & exclude)) continue; j &= NEIGHMASK; diff --git a/src/USER-OMP/pair_reaxc_omp.cpp b/src/USER-OMP/pair_reaxc_omp.cpp index 7a42ef9054..da16ee518b 100644 --- a/src/USER-OMP/pair_reaxc_omp.cpp +++ b/src/USER-OMP/pair_reaxc_omp.cpp @@ -218,7 +218,7 @@ void PairReaxCOMP::compute(int eflag, int vflag) write_reax_lists(); // timing for filling in the reax lists - if( comm->me == 0 ) { + if (comm->me == 0) { t_end = MPI_Wtime(); data->timing.nbrs = t_end - t_start; } diff --git a/src/USER-OMP/reaxc_bond_orders_omp.cpp b/src/USER-OMP/reaxc_bond_orders_omp.cpp index 12186c2645..7edc593aa2 100644 --- a/src/USER-OMP/reaxc_bond_orders_omp.cpp +++ b/src/USER-OMP/reaxc_bond_orders_omp.cpp @@ -171,7 +171,7 @@ void Add_dBond_to_ForcesOMP( reax_system *system, int i, int pj, rvec_Add(workspace->forceReduction[reductionOffset+k],temp ); - if( system->pair_ptr->vflag_atom ) { + if (system->pair_ptr->vflag_atom) { rvec_Scale(fk_tmp, -1.0, temp); rvec_ScaledSum(delki,1.,system->my_atoms[k].x,-1.,system->my_atoms[i].x); @@ -201,7 +201,7 @@ void Add_dBond_to_ForcesOMP( reax_system *system, int i, int pj, rvec_Add(workspace->forceReduction[reductionOffset+k],temp ); - if( system->pair_ptr->vflag_atom ) { + if (system->pair_ptr->vflag_atom) { rvec_Scale(fk_tmp, -1.0, temp); rvec_ScaledSum(delki,1.,system->my_atoms[k].x,-1.,system->my_atoms[i].x); @@ -313,7 +313,7 @@ void Add_dBond_to_Forces_NPTOMP( reax_system *system, int i, int pj, rvec_Add(workspace->forceReduction[reductionOffset+k],temp ); /* pressure */ - if( k != i ) { + if (k != i) { ivec_Sum( rel_box, nbr_k->rel_box, nbr_j->rel_box ); //rel_box(k, i) rvec_iMultiply( ext_press, rel_box, temp ); rvec_Add( workspace->my_ext_pressReduction[tid], ext_press ); @@ -493,7 +493,7 @@ void BOOMP( reax_system *system, control_params * /* control */, simulation_data if( i < j || workspace->bond_mark[j] > 3) { twbp = &( system->reax_param.tbp[type_i][type_j] ); - if( twbp->ovc < 0.001 && twbp->v13cor < 0.001 ) { + if (twbp->ovc < 0.001 && twbp->v13cor < 0.001) { bo_ij->C1dbo = 1.000000; bo_ij->C2dbo = 0.000000; bo_ij->C3dbo = 0.000000; @@ -515,7 +515,7 @@ void BOOMP( reax_system *system, control_params * /* control */, simulation_data Deltap_boc_j = workspace->Deltap_boc[j]; /* on page 1 */ - if( twbp->ovc >= 0.001 ) { + if (twbp->ovc >= 0.001) { /* Correction for overcoordination */ exp_p1i = exp( -p_boc1 * Deltap_i ); exp_p2i = exp( -p_boc2 * Deltap_i ); @@ -556,7 +556,7 @@ void BOOMP( reax_system *system, control_params * /* control */, simulation_data Cf1_ij = Cf1_ji = 0.0; } - if( twbp->v13cor >= 0.001 ) { + if (twbp->v13cor >= 0.001) { /* Correction for 1-3 bond orders */ exp_f4 =exp(-(twbp->p_boc4 * SQR( bo_ij->BO ) - Deltap_boc_i) * twbp->p_boc3 + twbp->p_boc5); @@ -607,13 +607,13 @@ void BOOMP( reax_system *system, control_params * /* control */, simulation_data } /* neglect bonds that are < 1e-10 */ - if( bo_ij->BO < 1e-10 ) + if (bo_ij->BO < 1e-10) bo_ij->BO = 0.0; - if( bo_ij->BO_s < 1e-10 ) + if (bo_ij->BO_s < 1e-10) bo_ij->BO_s = 0.0; - if( bo_ij->BO_pi < 1e-10 ) + if (bo_ij->BO_pi < 1e-10) bo_ij->BO_pi = 0.0; - if( bo_ij->BO_pi2 < 1e-10 ) + if (bo_ij->BO_pi2 < 1e-10) bo_ij->BO_pi2 = 0.0; workspace->total_bond_order[i] += bo_ij->BO; //now keeps total_BO @@ -705,7 +705,7 @@ void BOOMP( reax_system *system, control_params * /* control */, simulation_data workspace->Clp[j] = 2.0 * p_lp1 * explp1 * (2.0 + workspace->vlpex[j]); workspace->dDelta_lp[j] = workspace->Clp[j]; - if( sbp_j->mass > 21.0 ) { + if (sbp_j->mass > 21.0) { workspace->nlp_temp[j] = 0.5 * (sbp_j->valency_e - sbp_j->valency); workspace->Delta_lp_temp[j] = sbp_j->nlp_opt - workspace->nlp_temp[j]; workspace->dDelta_lp_temp[j] = 0.; diff --git a/src/USER-OMP/reaxc_bonds_omp.cpp b/src/USER-OMP/reaxc_bonds_omp.cpp index c7f7e8f853..5160c6f55d 100644 --- a/src/USER-OMP/reaxc_bonds_omp.cpp +++ b/src/USER-OMP/reaxc_bonds_omp.cpp @@ -99,9 +99,9 @@ void BondsOMP( reax_system *system, control_params * /* control */, for (pj = start_i; pj < end_i; ++pj) { j = bonds->select.bond_list[pj].nbr; - if( system->my_atoms[i].orig_id > system->my_atoms[j].orig_id ) continue; + if (system->my_atoms[i].orig_id > system->my_atoms[j].orig_id) continue; - if( system->my_atoms[i].orig_id == system->my_atoms[j].orig_id ) { + if (system->my_atoms[i].orig_id == system->my_atoms[j].orig_id) { if (system->my_atoms[j].x[2] < system->my_atoms[i].x[2]) continue; if (system->my_atoms[j].x[2] == system->my_atoms[i].x[2] && system->my_atoms[j].x[1] < system->my_atoms[i].x[1]) continue; diff --git a/src/USER-OMP/reaxc_forces_omp.cpp b/src/USER-OMP/reaxc_forces_omp.cpp index 9cd0130516..80741a46a8 100644 --- a/src/USER-OMP/reaxc_forces_omp.cpp +++ b/src/USER-OMP/reaxc_forces_omp.cpp @@ -64,7 +64,7 @@ void Init_Force_FunctionsOMP( control_params *control ) Interaction_Functions[2] = Atom_EnergyOMP; //Dummy_Interaction; Interaction_Functions[3] = Valence_AnglesOMP; //Dummy_Interaction; Interaction_Functions[4] = Torsion_AnglesOMP; //Dummy_Interaction; - if( control->hbond_cut > 0 ) + if (control->hbond_cut > 0) Interaction_Functions[5] = Hydrogen_BondsOMP; else Interaction_Functions[5] = Dummy_Interaction; Interaction_Functions[6] = Dummy_Interaction; //empty @@ -113,7 +113,7 @@ void Compute_NonBonded_ForcesOMP( reax_system *system, control_params *control, startTimeBase = MPI_Wtime(); #endif - if( control->tabulate == 0 ) + if (control->tabulate == 0) vdW_Coulomb_Energy_OMP( system, control, data, workspace, lists, out_control ); else @@ -275,7 +275,7 @@ void Validate_ListsOMP( reax_system *system, storage * /*workspace */, reax_list { /* bond list */ - if( N > 0 ) { + if (N > 0) { bonds = *lists + BONDS; #if defined(_OPENMP) @@ -284,11 +284,11 @@ void Validate_ListsOMP( reax_system *system, storage * /*workspace */, reax_list for( i = 0; i < N; ++i ) { system->my_atoms[i].num_bonds = MAX(Num_Entries(i,bonds)*2, MIN_BONDS); - if( i < N-1 ) + if (i < N-1) comp = Start_Index(i+1, bonds); else comp = bonds->num_intrs; - if( End_Index(i, bonds) > comp ) { + if (End_Index(i, bonds) > comp) { fprintf( stderr, "step%d-bondchk failed: i=%d end(i)=%d str(i+1)=%d\n", step, i, End_Index(i,bonds), comp ); MPI_Abort( comm, INSUFFICIENT_MEMORY ); @@ -298,7 +298,7 @@ void Validate_ListsOMP( reax_system *system, storage * /*workspace */, reax_list /* hbonds list */ - if( numH > 0 ) { + if (numH > 0) { hbonds = *lists + HBONDS; #if defined(_OPENMP) @@ -306,15 +306,15 @@ void Validate_ListsOMP( reax_system *system, storage * /*workspace */, reax_list #endif for( i = 0; i < n; ++i ) { Hindex = system->my_atoms[i].Hindex; - if( Hindex > -1 ) { + if (Hindex > -1) { system->my_atoms[i].num_hbonds = (int)(MAX( Num_Entries(Hindex, hbonds)*saferzone, MIN_HBONDS )); - if( Hindex < numH-1 ) + if (Hindex < numH-1) comp = Start_Index(Hindex+1, hbonds); else comp = hbonds->num_intrs; - if( End_Index(Hindex, hbonds) > comp ) { + if (End_Index(Hindex, hbonds) > comp) { fprintf(stderr,"step%d-hbondchk failed: H=%d end(H)=%d str(H+1)=%d\n", step, Hindex, End_Index(Hindex,hbonds), comp ); MPI_Abort( comm, INSUFFICIENT_MEMORY ); @@ -402,7 +402,7 @@ void Init_Forces_noQEq_OMP( reax_system *system, control_params *control, // #pragma omp critical // { // btop_i = End_Index(i, bonds); -// if( BOp(workspace, bonds, control->bo_cut, i, btop_i, nbr_pj, sbp_i, sbp_j, twbp) ) { +// if (BOp(workspace, bonds, control->bo_cut, i, btop_i, nbr_pj, sbp_i, sbp_j, twbp)) { // num_bonds++; // btop_i++; // Set_End_Index(i, btop_i, bonds); @@ -418,19 +418,19 @@ void Init_Forces_noQEq_OMP( reax_system *system, control_params *control, double BO, BO_s, BO_pi, BO_pi2; double bo_cut = control->bo_cut; - if( sbp_i->r_s > 0.0 && sbp_j->r_s > 0.0 ) { + if (sbp_i->r_s > 0.0 && sbp_j->r_s > 0.0) { C12 = twbp->p_bo1 * pow( nbr_pj->d / twbp->r_s, twbp->p_bo2 ); BO_s = (1.0 + bo_cut) * exp( C12 ); } else BO_s = C12 = 0.0; - if( sbp_i->r_pi > 0.0 && sbp_j->r_pi > 0.0 ) { + if (sbp_i->r_pi > 0.0 && sbp_j->r_pi > 0.0) { C34 = twbp->p_bo3 * pow( nbr_pj->d / twbp->r_p, twbp->p_bo4 ); BO_pi = exp( C34 ); } else BO_pi = C34 = 0.0; - if( sbp_i->r_pi_pi > 0.0 && sbp_j->r_pi_pi > 0.0 ) { + if (sbp_i->r_pi_pi > 0.0 && sbp_j->r_pi_pi > 0.0) { C56 = twbp->p_bo5 * pow( nbr_pj->d / twbp->r_pp, twbp->p_bo6 ); BO_pi2= exp( C56 ); } diff --git a/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp b/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp index 85380efd89..7acf26262e 100644 --- a/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp +++ b/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp @@ -110,7 +110,7 @@ void Hydrogen_BondsOMP( reax_system *system, control_params *control, // for( j = 0; j < system->n; ++j ) for( j = ifrom; j < ito; ++j ) { /* j has to be of type H */ - if( system->reax_param.sbp[system->my_atoms[j].type].p_hbond == 1 ) { + if (system->reax_param.sbp[system->my_atoms[j].type].p_hbond == 1) { /*set j's variables */ type_j = system->my_atoms[j].type; start_j = Start_Index(j, bonds); @@ -146,7 +146,7 @@ void Hydrogen_BondsOMP( reax_system *system, control_params *control, pbond_ij = &( bonds->select.bond_list[pi] ); i = pbond_ij->nbr; - if( system->my_atoms[i].orig_id != system->my_atoms[k].orig_id ) { + if (system->my_atoms[i].orig_id != system->my_atoms[k].orig_id) { bo_ij = &(pbond_ij->bo_data); type_i = system->my_atoms[i].type; if(type_i < 0) continue; @@ -179,7 +179,7 @@ void Hydrogen_BondsOMP( reax_system *system, control_params *control, /* hydrogen bond forces */ bo_ij->Cdbo += CEhb1; // dbo term - if( control->virial == 0 ) { + if (control->virial == 0) { // dcos terms rvec_ScaledAdd(workspace->forceReduction[reductionOffset+i], +CEhb2, dcos_theta_di ); rvec_ScaledAdd(workspace->forceReduction[reductionOffset+j], +CEhb2, dcos_theta_dj ); diff --git a/src/USER-OMP/reaxc_init_md_omp.cpp b/src/USER-OMP/reaxc_init_md_omp.cpp index b7b6839df5..4266c62a1c 100644 --- a/src/USER-OMP/reaxc_init_md_omp.cpp +++ b/src/USER-OMP/reaxc_init_md_omp.cpp @@ -65,7 +65,7 @@ int Init_ListsOMP( reax_system *system, control_params *control, Estimate_Storages( system, control, lists, &Htop, hb_top, bond_top, &num_3body, comm ); - if( control->hbond_cut > 0 ) { + if (control->hbond_cut > 0) { /* init H indexes */ total_hbonds = 0; for( i = 0; i < system->n; ++i ) { @@ -127,7 +127,7 @@ void InitializeOMP( reax_system *system, control_params *control, char msg[MAX_STR]; - if( Init_MPI_Datatypes(system, workspace, mpi_data, comm, msg) == FAILURE ) { + if (Init_MPI_Datatypes(system, workspace, mpi_data, comm, msg) == FAILURE) { fprintf( stderr, "p%d: init_mpi_datatypes: could not create datatypes\n", system->my_rank ); fprintf( stderr, "p%d: mpi_data couldn't be initialized! terminating.\n", @@ -142,15 +142,15 @@ void InitializeOMP( reax_system *system, control_params *control, MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( Init_Simulation_Data( system, control, data, msg ) == FAILURE ) { + if (Init_Simulation_Data( system, control, data, msg ) == FAILURE) { fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); fprintf( stderr, "p%d: sim_data couldn't be initialized! terminating.\n", system->my_rank ); MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( Init_Workspace( system, control, workspace, mpi_data->world, msg ) == - FAILURE ) { + if (Init_Workspace( system, control, workspace, mpi_data->world, msg ) == + FAILURE) { fprintf( stderr, "p%d:init_workspace: not enough memory\n", system->my_rank ); fprintf( stderr, "p%d:workspace couldn't be initialized! terminating.\n", @@ -158,8 +158,8 @@ void InitializeOMP( reax_system *system, control_params *control, MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( Init_ListsOMP( system, control, data, workspace, lists, mpi_data, msg ) == - FAILURE ) { + if (Init_ListsOMP( system, control, data, workspace, lists, mpi_data, msg ) == + FAILURE) { fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); fprintf( stderr, "p%d: system could not be initialized! terminating.\n", system->my_rank ); @@ -173,8 +173,8 @@ void InitializeOMP( reax_system *system, control_params *control, MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( control->tabulate ) { - if( Init_Lookup_Tables( system, control, workspace, mpi_data, msg ) == FAILURE ) { + if (control->tabulate) { + if (Init_Lookup_Tables( system, control, workspace, mpi_data, msg ) == FAILURE) { fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); fprintf( stderr, "p%d: couldn't create lookup table! terminating.\n", system->my_rank ); diff --git a/src/USER-OMP/reaxc_multi_body_omp.cpp b/src/USER-OMP/reaxc_multi_body_omp.cpp index 635e22b8f9..e3fa568a33 100644 --- a/src/USER-OMP/reaxc_multi_body_omp.cpp +++ b/src/USER-OMP/reaxc_multi_body_omp.cpp @@ -133,19 +133,19 @@ void Atom_EnergyOMP( reax_system *system, control_params * /* control */, e_lp, 0.0, 0.0, 0.0, 0.0, 0.0, thr); /* correction for C2 */ - if( p_lp3 > 0.001 && !strcmp(system->reax_param.sbp[type_i].name, "C") ) + if (p_lp3 > 0.001 && !strcmp(system->reax_param.sbp[type_i].name, "C")) for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) { j = bonds->select.bond_list[pj].nbr; type_j = system->my_atoms[j].type; if(type_j < 0) continue; - if( !strcmp( system->reax_param.sbp[type_j].name, "C" ) ) { + if (!strcmp( system->reax_param.sbp[type_j].name, "C" )) { twbp = &( system->reax_param.tbp[type_i][type_j]); bo_ij = &( bonds->select.bond_list[pj].bo_data ); Di = workspace->Delta[i]; vov3 = bo_ij->BO - Di - 0.040*pow(Di, 4.); - if( vov3 > 3. ) { + if (vov3 > 3.) { total_Elp += e_lph = p_lp3 * SQR(vov3-3.0); deahu2dbo = 2.*p_lp3*(vov3 - 3.); @@ -172,7 +172,7 @@ void Atom_EnergyOMP( reax_system *system, control_params * /* control */, sbp_i = &(system->reax_param.sbp[ type_i ]); /* over-coordination energy */ - if( sbp_i->mass > 21.0 ) + if (sbp_i->mass > 21.0) dfvl = 0.0; else dfvl = 1.0; // only for 1st-row elements diff --git a/src/USER-OMP/reaxc_nonbonded_omp.cpp b/src/USER-OMP/reaxc_nonbonded_omp.cpp index 194f433634..128767202b 100644 --- a/src/USER-OMP/reaxc_nonbonded_omp.cpp +++ b/src/USER-OMP/reaxc_nonbonded_omp.cpp @@ -218,7 +218,7 @@ void vdW_Coulomb_Energy_OMP( reax_system *system, control_params *control, delij[0], delij[1], delij[2], thr); } - if( control->virial == 0 ) { + if (control->virial == 0) { rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec ); rvec_ScaledAdd( workspace->forceReduction[reductionOffset+j], +(CEvd + CEclmb), nbr_pj->dvec ); @@ -327,7 +327,7 @@ void Tabulated_vdW_Coulomb_Energy_OMP(reax_system *system,control_params *contro /* Cubic Spline Interpolation */ r = (int)(r_ij * t->inv_dx); - if( r == 0 ) ++r; + if (r == 0) ++r; base = (double)(r+1) * t->dx; dif = r_ij - base; @@ -357,7 +357,7 @@ void Tabulated_vdW_Coulomb_Energy_OMP(reax_system *system,control_params *contro f_tmp, delij[0], delij[1], delij[2], thr); } - if( control->virial == 0 ) { + if (control->virial == 0) { rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec ); rvec_ScaledAdd( workspace->forceReduction[froffset+j], +(CEvd + CEclmb), nbr_pj->dvec ); diff --git a/src/USER-OMP/reaxc_torsion_angles_omp.cpp b/src/USER-OMP/reaxc_torsion_angles_omp.cpp index 94a06bf1f9..2b2ed3af4a 100644 --- a/src/USER-OMP/reaxc_torsion_angles_omp.cpp +++ b/src/USER-OMP/reaxc_torsion_angles_omp.cpp @@ -198,7 +198,7 @@ void Torsion_AnglesOMP( reax_system *system, control_params *control, sin_ijk = sin( theta_ijk ); cos_ijk = cos( theta_ijk ); //tan_ijk_i = 1. / tan( theta_ijk ); - if( sin_ijk >= 0 && sin_ijk <= MIN_SINE ) + if (sin_ijk >= 0 && sin_ijk <= MIN_SINE) tan_ijk_i = cos_ijk / MIN_SINE; else if( sin_ijk <= 0 && sin_ijk >= -MIN_SINE ) tan_ijk_i = cos_ijk / -MIN_SINE; @@ -237,7 +237,7 @@ void Torsion_AnglesOMP( reax_system *system, control_params *control, sin_jkl = sin( theta_jkl ); cos_jkl = cos( theta_jkl ); //tan_jkl_i = 1. / tan( theta_jkl ); - if( sin_jkl >= 0 && sin_jkl <= MIN_SINE ) + if (sin_jkl >= 0 && sin_jkl <= MIN_SINE) tan_jkl_i = cos_jkl / MIN_SINE; else if( sin_jkl <= 0 && sin_jkl >= -MIN_SINE ) tan_jkl_i = cos_jkl / -MIN_SINE; @@ -338,7 +338,7 @@ void Torsion_AnglesOMP( reax_system *system, control_params *control, //bo_kl->Cdbo += (CEtors6 + CEconj3); bo_kl->CdboReduction[tid] += (CEtors6 + CEconj3); - if( control->virial == 0 ) { + if (control->virial == 0) { /* dcos_theta_ijk */ rvec_ScaledAdd( workspace->f[j], CEtors7 + CEconj4, p_ijk->dcos_dj ); diff --git a/src/USER-OMP/reaxc_valence_angles_omp.cpp b/src/USER-OMP/reaxc_valence_angles_omp.cpp index a9c9d8ebfd..d4e07764d1 100644 --- a/src/USER-OMP/reaxc_valence_angles_omp.cpp +++ b/src/USER-OMP/reaxc_valence_angles_omp.cpp @@ -319,13 +319,13 @@ void Valence_AnglesOMP( reax_system *system, control_params *control, SBO = SBOp + (1 - prod_SBO) * (-workspace->Delta_boc[j] - p_val8 * vlpadj); dSBO1 = -8 * prod_SBO * ( workspace->Delta_boc[j] + p_val8 * vlpadj ); - if( SBO <= 0 ) + if (SBO <= 0) SBO2 = 0, CSBO2 = 0; - else if( SBO > 0 && SBO <= 1 ) { + else if (SBO > 0 && SBO <= 1) { SBO2 = pow( SBO, p_val9 ); CSBO2 = p_val9 * pow( SBO, p_val9 - 1 ); } - else if( SBO > 1 && SBO < 2 ) { + else if (SBO > 1 && SBO < 2) { SBO2 = 2 - pow( 2-SBO, p_val9 ); CSBO2 = p_val9 * pow( 2 - SBO, p_val9 - 1 ); } @@ -398,7 +398,7 @@ void Valence_AnglesOMP( reax_system *system, control_params *control, p_ijk->theta = theta; sin_theta = sin( theta ); - if( sin_theta < 1.0e-5 ) + if (sin_theta < 1.0e-5) sin_theta = 1.0e-5; ++my_offset; // add this to the list of 3-body interactions @@ -412,7 +412,7 @@ void Valence_AnglesOMP( reax_system *system, control_params *control, for (cnt = 0; cnt < thbh->cnt; ++cnt) { - if( fabs(thbh->prm[cnt].p_val1) > 0.001 ) { + if (fabs(thbh->prm[cnt].p_val1) > 0.001) { thbp = &( thbh->prm[cnt] ); /* ANGLE ENERGY */ @@ -536,7 +536,7 @@ void Valence_AnglesOMP( reax_system *system, control_params *control, bo_jt->Cdbopi2 += CEval5; } - if( control->virial == 0 ) { + if (control->virial == 0) { rvec_ScaledAdd( workspace->f[j], CEval8, p_ijk->dcos_dj ); rvec_ScaledAdd( workspace->forceReduction[reductionOffset+i], CEval8, p_ijk->dcos_di ); @@ -598,9 +598,9 @@ void Valence_AnglesOMP( reax_system *system, control_params *control, data->my_en.e_pen = total_Epen; data->my_en.e_coa = total_Ecoa; - if( num_thb_intrs >= thb_intrs->num_intrs * DANGER_ZONE ) { + if (num_thb_intrs >= thb_intrs->num_intrs * DANGER_ZONE) { workspace->realloc.num_3body = num_thb_intrs * TWICE; - if( num_thb_intrs > thb_intrs->num_intrs ) { + if (num_thb_intrs > thb_intrs->num_intrs) { fprintf( stderr, "step%d-ran out of space on angle_list: top=%d, max=%d", data->step, num_thb_intrs, thb_intrs->num_intrs ); MPI_Abort( MPI_COMM_WORLD, INSUFFICIENT_MEMORY ); diff --git a/src/USER-QUIP/pair_quip.cpp b/src/USER-QUIP/pair_quip.cpp index 6f5040d037..99c107bb84 100644 --- a/src/USER-QUIP/pair_quip.cpp +++ b/src/USER-QUIP/pair_quip.cpp @@ -252,7 +252,7 @@ void PairQUIP::coeff(int narg, char **arg) } } - if( narg != (4+n) ) { + if (narg != (4+n)) { char str[1024]; sprintf(str,"Number of arguments %d is not correct, it should be %d", narg, 4+n); error->all(FLERR,str); diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index 39ff1320d8..1c8f4c1e11 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -137,9 +137,9 @@ PairReaxC::~PairReaxC() // deallocate reax data-structures - if( control->tabulate ) Deallocate_Lookup_Tables( system ); + if (control->tabulate ) Deallocate_Lookup_Tables( system); - if( control->hbond_cut > 0 ) Delete_List( lists+HBONDS, world ); + if (control->hbond_cut > 0 ) Delete_List( lists+HBONDS, world); Delete_List( lists+BONDS, world ); Delete_List( lists+THREE_BODIES, world ); Delete_List( lists+FAR_NBRS, world ); @@ -157,7 +157,7 @@ PairReaxC::~PairReaxC() memory->destroy( mpi_data ); // deallocate interface storage - if( allocated ) { + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); memory->destroy(cutghost); @@ -519,7 +519,7 @@ void PairReaxC::compute(int eflag, int vflag) Reset( system, control, data, workspace, &lists, world ); workspace->realloc.num_far = write_reax_lists(); // timing for filling in the reax lists - if( comm->me == 0 ) { + if (comm->me == 0) { t_end = MPI_Wtime(); data->timing.nbrs = t_end - t_start; } @@ -683,7 +683,7 @@ int PairReaxC::estimate_reax_lists() j &= NEIGHMASK; get_distance( x[j], x[i], &d_sqr, &dvec ); - if( d_sqr <= SQR(control->nonb_cut) ) + if (d_sqr <= SQR(control->nonb_cut)) ++num_nbrs; } } diff --git a/src/USER-REAXC/reaxc_allocate.cpp b/src/USER-REAXC/reaxc_allocate.cpp index 653fb13473..700e68514c 100644 --- a/src/USER-REAXC/reaxc_allocate.cpp +++ b/src/USER-REAXC/reaxc_allocate.cpp @@ -122,7 +122,7 @@ void DeAllocate_Workspace( control_params * /*control*/, storage *workspace ) { int i; - if( !workspace->allocated ) + if (!workspace->allocated) return; workspace->allocated = 0; @@ -338,13 +338,13 @@ static int Reallocate_HBonds_List( reax_system *system, reax_list *hbonds, total_hbonds = 0; for( i = 0; i < system->n; ++i ) - if( (system->my_atoms[i].Hindex) >= 0 ) { + if ((system->my_atoms[i].Hindex) >= 0) { total_hbonds += system->my_atoms[i].num_hbonds; } total_hbonds = (int)(MAX( total_hbonds*saferzone, mincap*MIN_HBONDS )); Delete_List( hbonds, comm ); - if( !Make_List( system->Hcap, total_hbonds, TYP_HBOND, hbonds, comm ) ) { + if (!Make_List( system->Hcap, total_hbonds, TYP_HBOND, hbonds, comm )) { fprintf( stderr, "not enough space for hbonds list. terminating!\n" ); MPI_Abort( comm, INSUFFICIENT_MEMORY ); } @@ -429,10 +429,10 @@ void ReAllocate( reax_system *system, control_params *control, system->total_cap = MAX( (int)(system->N * safezone), mincap ); } - if( Nflag ) { + if (Nflag) { /* system */ ret = Allocate_System( system, system->local_cap, system->total_cap, msg ); - if( ret != SUCCESS ) { + if (ret != SUCCESS) { fprintf( stderr, "not enough space for atom_list: total_cap=%d", system->total_cap ); fprintf( stderr, "terminating...\n" ); @@ -443,7 +443,7 @@ void ReAllocate( reax_system *system, control_params *control, DeAllocate_Workspace( control, workspace ); ret = Allocate_Workspace( system, control, workspace, system->local_cap, system->total_cap, comm, msg ); - if( ret != SUCCESS ) { + if (ret != SUCCESS) { fprintf( stderr, "no space for workspace: local_cap=%d total_cap=%d", system->local_cap, system->total_cap ); fprintf( stderr, "terminating...\n" ); @@ -454,11 +454,11 @@ void ReAllocate( reax_system *system, control_params *control, renbr = (data->step - data->prev_steps) % control->reneighbor == 0; /* far neighbors */ - if( renbr ) { + if (renbr) { far_nbrs = *lists + FAR_NBRS; - if( Nflag || realloc->num_far >= far_nbrs->num_intrs * DANGER_ZONE ) { - if( realloc->num_far > far_nbrs->num_intrs ) { + if (Nflag || realloc->num_far >= far_nbrs->num_intrs * DANGER_ZONE) { + if (realloc->num_far > far_nbrs->num_intrs) { fprintf( stderr, "step%d-ran out of space on far_nbrs: top=%d, max=%d", data->step, realloc->num_far, far_nbrs->num_intrs ); MPI_Abort( comm, INSUFFICIENT_MEMORY ); @@ -473,7 +473,7 @@ void ReAllocate( reax_system *system, control_params *control, } /* hydrogen bonds list */ - if( control->hbond_cut > 0 ) { + if (control->hbond_cut > 0) { Hflag = 0; if( system->numH >= DANGER_ZONE * system->Hcap || (0 && system->numH <= LOOSE_ZONE * system->Hcap) ) { @@ -481,7 +481,7 @@ void ReAllocate( reax_system *system, control_params *control, system->Hcap = int(MAX( system->numH * saferzone, mincap )); } - if( Hflag || realloc->hbonds ) { + if (Hflag || realloc->hbonds) { ret = Reallocate_HBonds_List( system, (*lists)+HBONDS, comm ); realloc->hbonds = 0; } @@ -497,10 +497,10 @@ void ReAllocate( reax_system *system, control_params *control, } /* 3-body list */ - if( realloc->num_3body > 0 ) { + if (realloc->num_3body > 0) { Delete_List( (*lists)+THREE_BODIES, comm ); - if( num_bonds == -1 ) + if (num_bonds == -1) num_bonds = ((*lists)+BONDS)->num_intrs; realloc->num_3body = (int)(MAX(realloc->num_3body*safezone, MIN_3BODIES)); diff --git a/src/USER-REAXC/reaxc_bond_orders.cpp b/src/USER-REAXC/reaxc_bond_orders.cpp index 572d27526c..11bb04bbbf 100644 --- a/src/USER-REAXC/reaxc_bond_orders.cpp +++ b/src/USER-REAXC/reaxc_bond_orders.cpp @@ -110,7 +110,7 @@ void Add_dBond_to_Forces_NPT( int i, int pj, simulation_data *data, /* force */ rvec_Add( workspace->f[k], temp ); /* pressure */ - if( k != i ) { + if (k != i) { ivec_Sum( rel_box, nbr_k->rel_box, nbr_j->rel_box ); //rel_box(k, i) rvec_iMultiply( ext_press, rel_box, temp ); rvec_Add( data->my_ext_press, ext_press ); @@ -225,7 +225,7 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj, rvec_ScaledAdd( temp, -coef.C3dbopi2, nbr_k->bo_data.dBOp); rvec_Add( workspace->f[k], temp ); - if( system->pair_ptr->vflag_atom ) { + if (system->pair_ptr->vflag_atom) { rvec_Scale(fk_tmp, -1.0, temp); rvec_ScaledSum(delki,1.,system->my_atoms[k].x,-1.,system->my_atoms[i].x); system->pair_ptr->v_tally(k,fk_tmp,delki); @@ -245,7 +245,7 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj, rvec_ScaledAdd( temp, -coef.C4dbopi2, nbr_k->bo_data.dBOp); rvec_Add( workspace->f[k], temp ); - if( system->pair_ptr->vflag_atom ) { + if (system->pair_ptr->vflag_atom) { rvec_Scale(fk_tmp, -1.0, temp); rvec_ScaledSum(delki,1.,system->my_atoms[k].x,-1.,system->my_atoms[i].x); system->pair_ptr->v_tally(k,fk_tmp,delki); @@ -271,19 +271,19 @@ int BOp( storage *workspace, reax_list *bonds, double bo_cut, j = nbr_pj->nbr; r2 = SQR(nbr_pj->d); - if( sbp_i->r_s > 0.0 && sbp_j->r_s > 0.0 ) { + if (sbp_i->r_s > 0.0 && sbp_j->r_s > 0.0) { C12 = twbp->p_bo1 * pow( nbr_pj->d / twbp->r_s, twbp->p_bo2 ); BO_s = (1.0 + bo_cut) * exp( C12 ); } else BO_s = C12 = 0.0; - if( sbp_i->r_pi > 0.0 && sbp_j->r_pi > 0.0 ) { + if (sbp_i->r_pi > 0.0 && sbp_j->r_pi > 0.0) { C34 = twbp->p_bo3 * pow( nbr_pj->d / twbp->r_p, twbp->p_bo4 ); BO_pi = exp( C34 ); } else BO_pi = C34 = 0.0; - if( sbp_i->r_pi_pi > 0.0 && sbp_j->r_pi_pi > 0.0 ) { + if (sbp_i->r_pi_pi > 0.0 && sbp_j->r_pi_pi > 0.0) { C56 = twbp->p_bo5 * pow( nbr_pj->d / twbp->r_pp, twbp->p_bo6 ); BO_pi2= exp( C56 ); } @@ -292,7 +292,7 @@ int BOp( storage *workspace, reax_list *bonds, double bo_cut, /* Initially BO values are the uncorrected ones, page 1 */ BO = BO_s + BO_pi + BO_pi2; - if( BO >= bo_cut ) { + if (BO >= bo_cut) { /****** bonds i-j and j-i ******/ ibond = &( bonds->select.bond_list[btop_i] ); btop_j = End_Index( j, bonds ); @@ -410,10 +410,10 @@ void BO( reax_system *system, control_params * /*control*/, simulation_data * /* bo_ij = &( bonds->select.bond_list[pj].bo_data ); // fprintf( stderr, "\tj:%d - ubo: %8.3f\n", j+1, bo_ij->BO ); - if( i < j || workspace->bond_mark[j] > 3 ) { + if (i < j || workspace->bond_mark[j] > 3) { twbp = &( system->reax_param.tbp[type_i][type_j] ); - if( twbp->ovc < 0.001 && twbp->v13cor < 0.001 ) { + if (twbp->ovc < 0.001 && twbp->v13cor < 0.001) { bo_ij->C1dbo = 1.000000; bo_ij->C2dbo = 0.000000; bo_ij->C3dbo = 0.000000; @@ -435,7 +435,7 @@ void BO( reax_system *system, control_params * /*control*/, simulation_data * /* Deltap_boc_j = workspace->Deltap_boc[j]; /* on page 1 */ - if( twbp->ovc >= 0.001 ) { + if (twbp->ovc >= 0.001) { /* Correction for overcoordination */ exp_p1i = exp( -p_boc1 * Deltap_i ); exp_p2i = exp( -p_boc2 * Deltap_i ); @@ -475,7 +475,7 @@ void BO( reax_system *system, control_params * /*control*/, simulation_data * /* Cf1_ij = Cf1_ji = 0.0; } - if( twbp->v13cor >= 0.001 ) { + if (twbp->v13cor >= 0.001) { /* Correction for 1-3 bond orders */ exp_f4 =exp(-(twbp->p_boc4 * SQR( bo_ij->BO ) - Deltap_boc_i) * twbp->p_boc3 + twbp->p_boc5); @@ -527,13 +527,13 @@ void BO( reax_system *system, control_params * /*control*/, simulation_data * /* } /* neglect bonds that are < 1e-10 */ - if( bo_ij->BO < 1e-10 ) + if (bo_ij->BO < 1e-10) bo_ij->BO = 0.0; - if( bo_ij->BO_s < 1e-10 ) + if (bo_ij->BO_s < 1e-10) bo_ij->BO_s = 0.0; - if( bo_ij->BO_pi < 1e-10 ) + if (bo_ij->BO_pi < 1e-10) bo_ij->BO_pi = 0.0; - if( bo_ij->BO_pi2 < 1e-10 ) + if (bo_ij->BO_pi2 < 1e-10) bo_ij->BO_pi2 = 0.0; workspace->total_bond_order[i] += bo_ij->BO; //now keeps total_BO @@ -576,7 +576,7 @@ void BO( reax_system *system, control_params * /*control*/, simulation_data * /* workspace->Clp[j] = 2.0 * p_lp1 * explp1 * (2.0 + workspace->vlpex[j]); workspace->dDelta_lp[j] = workspace->Clp[j]; - if( sbp_j->mass > 21.0 ) { + if (sbp_j->mass > 21.0) { workspace->nlp_temp[j] = 0.5 * (sbp_j->valency_e - sbp_j->valency); workspace->Delta_lp_temp[j] = sbp_j->nlp_opt - workspace->nlp_temp[j]; workspace->dDelta_lp_temp[j] = 0.; diff --git a/src/USER-REAXC/reaxc_bonds.cpp b/src/USER-REAXC/reaxc_bonds.cpp index 6fde18e5c2..b5ab91941f 100644 --- a/src/USER-REAXC/reaxc_bonds.cpp +++ b/src/USER-REAXC/reaxc_bonds.cpp @@ -62,9 +62,9 @@ void Bonds( reax_system *system, control_params * /*control*/, for( pj = start_i; pj < end_i; ++pj ) { j = bonds->select.bond_list[pj].nbr; - if( system->my_atoms[i].orig_id > system->my_atoms[j].orig_id ) + if (system->my_atoms[i].orig_id > system->my_atoms[j].orig_id) continue; - if( system->my_atoms[i].orig_id == system->my_atoms[j].orig_id ) { + if (system->my_atoms[i].orig_id == system->my_atoms[j].orig_id) { if (system->my_atoms[j].x[2] < system->my_atoms[i].x[2]) continue; if (system->my_atoms[j].x[2] == system->my_atoms[i].x[2] && system->my_atoms[j].x[1] < system->my_atoms[i].x[1]) continue; @@ -104,7 +104,7 @@ void Bonds( reax_system *system, control_params * /*control*/, bo_ij->Cdbopi2 -= (CEbo + twbp->De_pp); /* Stabilisation terminal triple bond */ - if( bo_ij->BO >= 1.00 ) { + if (bo_ij->BO >= 1.00) { if( gp37 == 2 || (sbp_i->mass == 12.0000 && sbp_j->mass == 15.9990) || (sbp_j->mass == 12.0000 && sbp_i->mass == 15.9990) ) { diff --git a/src/USER-REAXC/reaxc_control.cpp b/src/USER-REAXC/reaxc_control.cpp index 11a89020b8..dd2b5a32ad 100644 --- a/src/USER-REAXC/reaxc_control.cpp +++ b/src/USER-REAXC/reaxc_control.cpp @@ -118,16 +118,16 @@ char Read_Control_File( char *control_file, control_params* control, fgets( s, MAX_LINE, fp ); Tokenize( s, &tmp ); - if( strcmp(tmp[0], "simulation_name") == 0 ) { + if (strcmp(tmp[0], "simulation_name") == 0) { strcpy( control->sim_name, tmp[1] ); } - else if( strcmp(tmp[0], "ensemble_type") == 0 ) { + else if (strcmp(tmp[0], "ensemble_type") == 0) { ival = atoi(tmp[1]); control->ensemble = ival; - if( ival == iNPT || ival ==sNPT || ival == NPT ) + if (ival == iNPT || ival ==sNPT || ival == NPT) control->virial = 1; } - else if( strcmp(tmp[0], "nsteps") == 0 ) { + else if (strcmp(tmp[0], "nsteps") == 0) { ival = atoi(tmp[1]); control->nsteps = ival; } @@ -135,7 +135,7 @@ char Read_Control_File( char *control_file, control_params* control, val = atof(tmp[1]); control->dt = val * 1.e-3; // convert dt from fs to ps! } - else if( strcmp(tmp[0], "proc_by_dim") == 0 ) { + else if (strcmp(tmp[0], "proc_by_dim") == 0) { ival = atoi(tmp[1]); control->procs_by_dim[0] = ival; ival = atoi(tmp[2]); @@ -146,220 +146,220 @@ char Read_Control_File( char *control_file, control_params* control, control->nprocs = control->procs_by_dim[0]*control->procs_by_dim[1]* control->procs_by_dim[2]; } - else if( strcmp(tmp[0], "random_vel") == 0 ) { + else if (strcmp(tmp[0], "random_vel") == 0) { ival = atoi(tmp[1]); control->random_vel = ival; } - else if( strcmp(tmp[0], "restart_format") == 0 ) { + else if (strcmp(tmp[0], "restart_format") == 0) { ival = atoi(tmp[1]); out_control->restart_format = ival; } - else if( strcmp(tmp[0], "restart_freq") == 0 ) { + else if (strcmp(tmp[0], "restart_freq") == 0) { ival = atoi(tmp[1]); out_control->restart_freq = ival; } - else if( strcmp(tmp[0], "reposition_atoms") == 0 ) { + else if (strcmp(tmp[0], "reposition_atoms") == 0) { ival = atoi(tmp[1]); control->reposition_atoms = ival; } - else if( strcmp(tmp[0], "restrict_bonds") == 0 ) { + else if (strcmp(tmp[0], "restrict_bonds") == 0) { ival = atoi( tmp[1] ); control->restrict_bonds = ival; } - else if( strcmp(tmp[0], "remove_CoM_vel") == 0 ) { + else if (strcmp(tmp[0], "remove_CoM_vel") == 0) { ival = atoi(tmp[1]); control->remove_CoM_vel = ival; } - else if( strcmp(tmp[0], "debug_level") == 0 ) { + else if (strcmp(tmp[0], "debug_level") == 0) { ival = atoi(tmp[1]); out_control->debug_level = ival; } - else if( strcmp(tmp[0], "energy_update_freq") == 0 ) { + else if (strcmp(tmp[0], "energy_update_freq") == 0) { ival = atoi(tmp[1]); out_control->energy_update_freq = ival; } - else if( strcmp(tmp[0], "reneighbor") == 0 ) { + else if (strcmp(tmp[0], "reneighbor") == 0) { ival = atoi( tmp[1] ); control->reneighbor = ival; } - else if( strcmp(tmp[0], "vlist_buffer") == 0 ) { + else if (strcmp(tmp[0], "vlist_buffer") == 0) { val = atof(tmp[1]); control->vlist_cut= val + control->nonb_cut; } - else if( strcmp(tmp[0], "nbrhood_cutoff") == 0 ) { + else if (strcmp(tmp[0], "nbrhood_cutoff") == 0) { val = atof(tmp[1]); control->bond_cut = val; } - else if( strcmp(tmp[0], "bond_graph_cutoff") == 0 ) { + else if (strcmp(tmp[0], "bond_graph_cutoff") == 0) { val = atof(tmp[1]); control->bg_cut = val; } - else if( strcmp(tmp[0], "thb_cutoff") == 0 ) { + else if (strcmp(tmp[0], "thb_cutoff") == 0) { val = atof(tmp[1]); control->thb_cut = val; } - else if( strcmp(tmp[0], "thb_cutoff_sq") == 0 ) { + else if (strcmp(tmp[0], "thb_cutoff_sq") == 0) { val = atof(tmp[1]); control->thb_cutsq = val; } - else if( strcmp(tmp[0], "hbond_cutoff") == 0 ) { + else if (strcmp(tmp[0], "hbond_cutoff") == 0) { val = atof( tmp[1] ); control->hbond_cut = val; } - else if( strcmp(tmp[0], "ghost_cutoff") == 0 ) { + else if (strcmp(tmp[0], "ghost_cutoff") == 0) { val = atof(tmp[1]); control->user_ghost_cut = val; } - else if( strcmp(tmp[0], "tabulate_long_range") == 0 ) { + else if (strcmp(tmp[0], "tabulate_long_range") == 0) { ival = atoi( tmp[1] ); control->tabulate = ival; } - else if( strcmp(tmp[0], "qeq_freq") == 0 ) { + else if (strcmp(tmp[0], "qeq_freq") == 0) { ival = atoi( tmp[1] ); control->qeq_freq = ival; } - else if( strcmp(tmp[0], "q_err") == 0 ) { + else if (strcmp(tmp[0], "q_err") == 0) { val = atof( tmp[1] ); control->q_err = val; } - else if( strcmp(tmp[0], "ilu_refactor") == 0 ) { + else if (strcmp(tmp[0], "ilu_refactor") == 0) { ival = atoi( tmp[1] ); control->refactor = ival; } - else if( strcmp(tmp[0], "ilu_droptol") == 0 ) { + else if (strcmp(tmp[0], "ilu_droptol") == 0) { val = atof( tmp[1] ); control->droptol = val; } - else if( strcmp(tmp[0], "temp_init") == 0 ) { + else if (strcmp(tmp[0], "temp_init") == 0) { val = atof(tmp[1]); control->T_init = val; - if( control->T_init < 0.1 ) + if (control->T_init < 0.1) control->T_init = 0.1; } - else if( strcmp(tmp[0], "temp_final") == 0 ) { + else if (strcmp(tmp[0], "temp_final") == 0) { val = atof(tmp[1]); control->T_final = val; - if( control->T_final < 0.1 ) + if (control->T_final < 0.1) control->T_final = 0.1; } - else if( strcmp(tmp[0], "t_mass") == 0 ) { + else if (strcmp(tmp[0], "t_mass") == 0) { val = atof(tmp[1]); control->Tau_T = val * 1.e-3; // convert t_mass from fs to ps } - else if( strcmp(tmp[0], "t_mode") == 0 ) { + else if (strcmp(tmp[0], "t_mode") == 0) { ival = atoi(tmp[1]); control->T_mode = ival; } - else if( strcmp(tmp[0], "t_rate") == 0 ) { + else if (strcmp(tmp[0], "t_rate") == 0) { val = atof(tmp[1]); control->T_rate = val; } - else if( strcmp(tmp[0], "t_freq") == 0 ) { + else if (strcmp(tmp[0], "t_freq") == 0) { val = atof(tmp[1]); control->T_freq = val; } - else if( strcmp(tmp[0], "pressure") == 0 ) { - if( control->ensemble == iNPT ) { + else if (strcmp(tmp[0], "pressure") == 0) { + if (control->ensemble == iNPT) { control->P[0] = control->P[1] = control->P[2] = atof(tmp[1]); } - else if( control->ensemble == sNPT ) { + else if (control->ensemble == sNPT) { control->P[0] = atof(tmp[1]); control->P[1] = atof(tmp[2]); control->P[2] = atof(tmp[3]); } } - else if( strcmp(tmp[0], "p_mass") == 0 ) { + else if (strcmp(tmp[0], "p_mass") == 0) { // convert p_mass from fs to ps - if( control->ensemble == iNPT ) { + if (control->ensemble == iNPT) { control->Tau_P[0] = control->Tau_P[1] = control->Tau_P[2] = atof(tmp[1]) * 1.e-3; } - else if( control->ensemble == sNPT ) { + else if (control->ensemble == sNPT) { control->Tau_P[0] = atof(tmp[1]) * 1.e-3; control->Tau_P[1] = atof(tmp[2]) * 1.e-3; control->Tau_P[2] = atof(tmp[3]) * 1.e-3; } } - else if( strcmp(tmp[0], "pt_mass") == 0 ) { + else if (strcmp(tmp[0], "pt_mass") == 0) { val = atof(tmp[1]); control->Tau_PT[0] = control->Tau_PT[1] = control->Tau_PT[2] = val * 1.e-3; // convert pt_mass from fs to ps } - else if( strcmp(tmp[0], "compress") == 0 ) { + else if (strcmp(tmp[0], "compress") == 0) { val = atof(tmp[1]); control->compressibility = val; } - else if( strcmp(tmp[0], "press_mode") == 0 ) { + else if (strcmp(tmp[0], "press_mode") == 0) { ival = atoi(tmp[1]); control->press_mode = ival; } - else if( strcmp(tmp[0], "geo_format") == 0 ) { + else if (strcmp(tmp[0], "geo_format") == 0) { ival = atoi( tmp[1] ); control->geo_format = ival; } - else if( strcmp(tmp[0], "write_freq") == 0 ) { + else if (strcmp(tmp[0], "write_freq") == 0) { ival = atoi(tmp[1]); out_control->write_steps = ival; } - else if( strcmp(tmp[0], "traj_compress") == 0 ) { + else if (strcmp(tmp[0], "traj_compress") == 0) { ival = atoi(tmp[1]); out_control->traj_compress = ival; } - else if( strcmp(tmp[0], "traj_method") == 0 ) { + else if (strcmp(tmp[0], "traj_method") == 0) { ival = atoi(tmp[1]); out_control->traj_method = ival; } - else if( strcmp(tmp[0], "traj_title") == 0 ) { + else if (strcmp(tmp[0], "traj_title") == 0) { strcpy( out_control->traj_title, tmp[1] ); } - else if( strcmp(tmp[0], "atom_info") == 0 ) { + else if (strcmp(tmp[0], "atom_info") == 0) { ival = atoi(tmp[1]); out_control->atom_info += ival * 4; } - else if( strcmp(tmp[0], "atom_velocities") == 0 ) { + else if (strcmp(tmp[0], "atom_velocities") == 0) { ival = atoi(tmp[1]); out_control->atom_info += ival * 2; } - else if( strcmp(tmp[0], "atom_forces") == 0 ) { + else if (strcmp(tmp[0], "atom_forces") == 0) { ival = atoi(tmp[1]); out_control->atom_info += ival * 1; } - else if( strcmp(tmp[0], "bond_info") == 0 ) { + else if (strcmp(tmp[0], "bond_info") == 0) { ival = atoi(tmp[1]); out_control->bond_info = ival; } - else if( strcmp(tmp[0], "angle_info") == 0 ) { + else if (strcmp(tmp[0], "angle_info") == 0) { ival = atoi(tmp[1]); out_control->angle_info = ival; } - else if( strcmp(tmp[0], "molecular_analysis") == 0 ) { + else if (strcmp(tmp[0], "molecular_analysis") == 0) { ival = atoi(tmp[1]); control->molecular_analysis = ival; } - else if( strcmp(tmp[0], "ignore") == 0 ) { + else if (strcmp(tmp[0], "ignore") == 0) { control->num_ignored = atoi(tmp[1]); for( i = 0; i < control->num_ignored; ++i ) control->ignore[atoi(tmp[i+2])] = 1; } - else if( strcmp(tmp[0], "dipole_anal") == 0 ) { + else if (strcmp(tmp[0], "dipole_anal") == 0) { ival = atoi(tmp[1]); control->dipole_anal = ival; } - else if( strcmp(tmp[0], "freq_dipole_anal") == 0 ) { + else if (strcmp(tmp[0], "freq_dipole_anal") == 0) { ival = atoi(tmp[1]); control->freq_dipole_anal = ival; } - else if( strcmp(tmp[0], "diffusion_coef") == 0 ) { + else if (strcmp(tmp[0], "diffusion_coef") == 0) { ival = atoi(tmp[1]); control->diffusion_coef = ival; } - else if( strcmp(tmp[0], "freq_diffusion_coef") == 0 ) { + else if (strcmp(tmp[0], "freq_diffusion_coef") == 0) { ival = atoi(tmp[1]); control->freq_diffusion_coef = ival; } - else if( strcmp(tmp[0], "restrict_type") == 0 ) { + else if (strcmp(tmp[0], "restrict_type") == 0) { ival = atoi(tmp[1]); control->restrict_type = ival; } @@ -370,7 +370,7 @@ char Read_Control_File( char *control_file, control_params* control, } /* determine target T */ - if( control->T_mode == 0 ) + if (control->T_mode == 0) control->T = control->T_final; else control->T = control->T_init; diff --git a/src/USER-REAXC/reaxc_ffield.cpp b/src/USER-REAXC/reaxc_ffield.cpp index d060b866d3..dd8f12f9d2 100644 --- a/src/USER-REAXC/reaxc_ffield.cpp +++ b/src/USER-REAXC/reaxc_ffield.cpp @@ -260,7 +260,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, if (reax->sbp[i].rcore2>0.01 && reax->sbp[i].acore2>0.01) { // Inner-wall if (reax->sbp[i].gamma_w>0.5) { // Shielding vdWaals - if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 3 ) { + if (reax->gp.vdw_type != 0 && reax->gp.vdw_type != 3) { if (errorflag && (me == 0)) fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n" \ "Force field parameters for element %s\n" \ @@ -274,7 +274,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, reax->gp.vdw_type = 3; } } else { // No shielding vdWaals parameters present - if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 2 ) { + if (reax->gp.vdw_type != 0 && reax->gp.vdw_type != 2) { if (me == 0) fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n" \ "Force field parameters for element %s\n" \ @@ -289,7 +289,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, } } else { // No Inner wall parameters present if (reax->sbp[i].gamma_w>0.5) { // Shielding vdWaals - if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 1 ) { + if (reax->gp.vdw_type != 0 && reax->gp.vdw_type != 1) { if (me == 0) fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n" \ "Force field parameters for element %s\n" \ @@ -641,7 +641,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, reax->fbp[n][m][k][j].prm[0].p_cot1 = val; } } else { /* This means the entry is of the form 0-X-Y-0 */ - if( k < reax->num_atom_types && m < reax->num_atom_types ) + if (k < reax->num_atom_types && m < reax->num_atom_types) for( p = 0; p < reax->num_atom_types; p++ ) for( o = 0; o < reax->num_atom_types; o++ ) { reax->fbp[p][k][m][o].cnt = 1; @@ -687,7 +687,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, m = atoi(tmp[2]) - 1; - if( j < reax->num_atom_types && m < reax->num_atom_types ) { + if (j < reax->num_atom_types && m < reax->num_atom_types) { val = atof(tmp[3]); reax->hbp[j][k][m].r0_hb = val; diff --git a/src/USER-REAXC/reaxc_forces.cpp b/src/USER-REAXC/reaxc_forces.cpp index e5a8fa2e93..721a88603e 100644 --- a/src/USER-REAXC/reaxc_forces.cpp +++ b/src/USER-REAXC/reaxc_forces.cpp @@ -55,7 +55,7 @@ void Init_Force_Functions( control_params *control ) Interaction_Functions[2] = Atom_Energy; //Dummy_Interaction; Interaction_Functions[3] = Valence_Angles; //Dummy_Interaction; Interaction_Functions[4] = Torsion_Angles; //Dummy_Interaction; - if( control->hbond_cut > 0 ) + if (control->hbond_cut > 0) Interaction_Functions[5] = Hydrogen_Bonds; else Interaction_Functions[5] = Dummy_Interaction; Interaction_Functions[6] = Dummy_Interaction; //empty @@ -87,7 +87,7 @@ void Compute_NonBonded_Forces( reax_system *system, control_params *control, { /* van der Waals and Coulomb interactions */ - if( control->tabulate == 0 ) + if (control->tabulate == 0) vdW_Coulomb_Energy( system, control, data, workspace, lists, out_control ); else @@ -105,8 +105,8 @@ void Compute_Total_Force( reax_system *system, control_params *control, for( i = 0; i < system->N; ++i ) for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) - if( i < bonds->select.bond_list[pj].nbr ) { - if( control->virial == 0 ) + if (i < bonds->select.bond_list[pj].nbr) { + if (control->virial == 0) Add_dBond_to_Forces( system, i, pj, workspace, lists ); else Add_dBond_to_Forces_NPT( i, pj, data, workspace, lists ); @@ -123,17 +123,17 @@ void Validate_Lists( reax_system *system, storage * /*workspace*/, reax_list **l double saferzone = system->saferzone; /* bond list */ - if( N > 0 ) { + if (N > 0) { bonds = *lists + BONDS; for( i = 0; i < N; ++i ) { system->my_atoms[i].num_bonds = MAX(Num_Entries(i,bonds)*2, MIN_BONDS); - if( i < N-1 ) + if (i < N-1) comp = Start_Index(i+1, bonds); else comp = bonds->num_intrs; - if( End_Index(i, bonds) > comp ) { + if (End_Index(i, bonds) > comp) { fprintf( stderr, "step%d-bondchk failed: i=%d end(i)=%d str(i+1)=%d\n", step, i, End_Index(i,bonds), comp ); MPI_Abort( comm, INSUFFICIENT_MEMORY ); @@ -143,12 +143,12 @@ void Validate_Lists( reax_system *system, storage * /*workspace*/, reax_list **l /* hbonds list */ - if( numH > 0 ) { + if (numH > 0) { hbonds = *lists + HBONDS; for( i = 0; i < N; ++i ) { Hindex = system->my_atoms[i].Hindex; - if( Hindex > -1 ) { + if (Hindex > -1) { system->my_atoms[i].num_hbonds = (int)(MAX( Num_Entries(Hindex, hbonds)*saferzone, MIN_HBONDS )); @@ -156,11 +156,11 @@ void Validate_Lists( reax_system *system, storage * /*workspace*/, reax_list **l //(Start_Index(i+1,hbonds)-Start_Index(i,hbonds))*0.90/*DANGER_ZONE*/){ // workspace->realloc.hbonds = 1; - if( Hindex < numH-1 ) + if (Hindex < numH-1) comp = Start_Index(Hindex+1, hbonds); else comp = hbonds->num_intrs; - if( End_Index(Hindex, hbonds) > comp ) { + if (End_Index(Hindex, hbonds) > comp) { fprintf(stderr,"step%d-hbondchk failed: H=%d end(H)=%d str(H+1)=%d\n", step, Hindex, End_Index(Hindex,hbonds), comp ); MPI_Abort( comm, INSUFFICIENT_MEMORY ); @@ -212,7 +212,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, btop_i = End_Index( i, bonds ); sbp_i = &(system->reax_param.sbp[type_i]); - if( i < system->n ) { + if (i < system->n) { local = 1; cutoff = MAX( control->hbond_cut, control->bond_cut ); } else { @@ -222,9 +222,9 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, ihb = -1; ihb_top = -1; - if( local && control->hbond_cut > 0 ) { + if (local && control->hbond_cut > 0) { ihb = sbp_i->p_hbond; - if( ihb == 1 ) + if (ihb == 1) ihb_top = End_Index( atom_i->Hindex, hbonds ); else ihb_top = -1; } @@ -235,8 +235,8 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, j = nbr_pj->nbr; atom_j = &(system->my_atoms[j]); - if( renbr ) { - if( nbr_pj->d <= cutoff ) + if (renbr) { + if (nbr_pj->d <= cutoff) flag = 1; else flag = 0; } else { @@ -244,7 +244,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, nbr_pj->dvec[1] = atom_j->x[1] - atom_i->x[1]; nbr_pj->dvec[2] = atom_j->x[2] - atom_i->x[2]; nbr_pj->d = rvec_Norm_Sqr( nbr_pj->dvec ); - if( nbr_pj->d <= SQR(cutoff) ) { + if (nbr_pj->d <= SQR(cutoff)) { nbr_pj->d = sqrt(nbr_pj->d); flag = 1; } else { @@ -252,26 +252,26 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, } } - if( flag ) { + if (flag) { type_j = atom_j->type; if (type_j < 0) continue; sbp_j = &(system->reax_param.sbp[type_j]); twbp = &(system->reax_param.tbp[type_i][type_j]); - if( local ) { + if (local) { /* hydrogen bond lists */ if( control->hbond_cut > 0 && (ihb==1 || ihb==2) && nbr_pj->d <= control->hbond_cut ) { // fprintf( stderr, "%d %d\n", atom1, atom2 ); jhb = sbp_j->p_hbond; - if( ihb == 1 && jhb == 2 ) { + if (ihb == 1 && jhb == 2) { hbonds->select.hbond_list[ihb_top].nbr = j; hbonds->select.hbond_list[ihb_top].scl = 1; hbonds->select.hbond_list[ihb_top].ptr = nbr_pj; ++ihb_top; ++num_hbonds; } - else if( j < system->n && ihb == 2 && jhb == 1 ) { + else if (j < system->n && ihb == 2 && jhb == 1) { jhb_top = End_Index( atom_j->Hindex, hbonds ); hbonds->select.hbond_list[jhb_top].nbr = i; hbonds->select.hbond_list[jhb_top].scl = -1; @@ -289,9 +289,9 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, num_bonds += 2; ++btop_i; - if( workspace->bond_mark[j] > workspace->bond_mark[i] + 1 ) + if (workspace->bond_mark[j] > workspace->bond_mark[i] + 1) workspace->bond_mark[j] = workspace->bond_mark[i] + 1; - else if( workspace->bond_mark[i] > workspace->bond_mark[j] + 1 ) { + else if (workspace->bond_mark[i] > workspace->bond_mark[j] + 1) { workspace->bond_mark[i] = workspace->bond_mark[j] + 1; } } @@ -299,7 +299,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, } Set_End_Index( i, btop_i, bonds ); - if( local && ihb == 1 ) + if (local && ihb == 1) Set_End_Index( atom_i->Hindex, ihb_top, hbonds ); } @@ -349,7 +349,7 @@ void Estimate_Storages( reax_system *system, control_params *control, end_i = End_Index(i, far_nbrs); sbp_i = &(system->reax_param.sbp[type_i]); - if( i < system->n ) { + if (i < system->n) { local = 1; cutoff = control->nonb_cut; ++(*Htop); @@ -372,15 +372,15 @@ void Estimate_Storages( reax_system *system, control_params *control, sbp_j = &(system->reax_param.sbp[type_j]); twbp = &(system->reax_param.tbp[type_i][type_j]); - if( local ) { - if( j < system->n || atom_i->orig_id < atom_j->orig_id ) //tryQEq ||1 + if (local) { + if (j < system->n || atom_i->orig_id < atom_j->orig_id) //tryQEq ||1 ++(*Htop); /* hydrogen bond lists */ if( control->hbond_cut > 0.1 && (ihb==1 || ihb==2) && nbr_pj->d <= control->hbond_cut ) { jhb = sbp_j->p_hbond; - if( ihb == 1 && jhb == 2 ) + if (ihb == 1 && jhb == 2) ++hb_top[i]; else if( j < system->n && ihb == 2 && jhb == 1 ) ++hb_top[j]; @@ -388,7 +388,7 @@ void Estimate_Storages( reax_system *system, control_params *control, } /* uncorrected bond orders */ - if( nbr_pj->d <= control->bond_cut ) { + if (nbr_pj->d <= control->bond_cut) { if( sbp_i->r_s > 0.0 && sbp_j->r_s > 0.0) { C12 = twbp->p_bo1 * pow( r_ij / twbp->r_s, twbp->p_bo2 ); BO_s = (1.0 + control->bo_cut) * exp( C12 ); @@ -410,7 +410,7 @@ void Estimate_Storages( reax_system *system, control_params *control, /* Initially BO values are the uncorrected ones, page 1 */ BO = BO_s + BO_pi + BO_pi2; - if( BO >= control->bo_cut ) { + if (BO >= control->bo_cut) { ++bond_top[i]; ++bond_top[j]; } diff --git a/src/USER-REAXC/reaxc_hydrogen_bonds.cpp b/src/USER-REAXC/reaxc_hydrogen_bonds.cpp index 6442dd47e9..be34df7571 100644 --- a/src/USER-REAXC/reaxc_hydrogen_bonds.cpp +++ b/src/USER-REAXC/reaxc_hydrogen_bonds.cpp @@ -63,7 +63,7 @@ void Hydrogen_Bonds( reax_system *system, control_params *control, hbond_list = hbonds->select.hbond_list; for( j = 0; j < system->n; ++j ) - if( system->reax_param.sbp[system->my_atoms[j].type].p_hbond == 1 ) { + if (system->reax_param.sbp[system->my_atoms[j].type].p_hbond == 1) { type_j = system->my_atoms[j].type; start_j = Start_Index(j, bonds); end_j = End_Index(j, bonds); @@ -98,7 +98,7 @@ void Hydrogen_Bonds( reax_system *system, control_params *control, pbond_ij = &( bonds->select.bond_list[pi] ); i = pbond_ij->nbr; - if( system->my_atoms[i].orig_id != system->my_atoms[k].orig_id ) { + if (system->my_atoms[i].orig_id != system->my_atoms[k].orig_id) { bo_ij = &(pbond_ij->bo_data); type_i = system->my_atoms[i].type; if (type_i < 0) continue; @@ -133,7 +133,7 @@ void Hydrogen_Bonds( reax_system *system, control_params *control, /* hydrogen bond forces */ bo_ij->Cdbo += CEhb1; // dbo term - if( control->virial == 0 ) { + if (control->virial == 0) { // dcos terms rvec_ScaledAdd( workspace->f[i], +CEhb2, dcos_theta_di ); rvec_ScaledAdd( workspace->f[j], +CEhb2, dcos_theta_dj ); diff --git a/src/USER-REAXC/reaxc_init_md.cpp b/src/USER-REAXC/reaxc_init_md.cpp index 3657fc8d78..c164c6f161 100644 --- a/src/USER-REAXC/reaxc_init_md.cpp +++ b/src/USER-REAXC/reaxc_init_md.cpp @@ -52,7 +52,7 @@ int Init_System( reax_system *system, control_params *control, char * /*msg*/ ) /* estimate numH and Hcap */ system->numH = 0; - if( control->hbond_cut > 0 ) + if (control->hbond_cut > 0) for( i = 0; i < system->n; ++i ) { atom = &(system->my_atoms[i]); if (system->reax_param.sbp[ atom->type ].p_hbond == 1 && atom->type >= 0) @@ -71,7 +71,7 @@ int Init_Simulation_Data( reax_system *system, control_params *control, Reset_Simulation_Data( data, control->virial ); /* initialize the timer(s) */ - if( system->my_rank == MASTER_NODE ) { + if (system->my_rank == MASTER_NODE) { data->timing.start = Get_Time( ); } @@ -89,10 +89,10 @@ void Init_Taper( control_params *control, storage *workspace, MPI_Comm comm ) swa = control->nonb_low; swb = control->nonb_cut; - if( fabs( swa ) > 0.01 ) + if (fabs( swa ) > 0.01) fprintf( stderr, "Warning: non-zero lower Taper-radius cutoff\n" ); - if( swb < 0 ) { + if (swb < 0) { fprintf( stderr, "Negative upper Taper-radius cutoff\n" ); MPI_Abort( comm, INVALID_INPUT ); } @@ -125,7 +125,7 @@ int Init_Workspace( reax_system *system, control_params *control, ret = Allocate_Workspace( system, control, workspace, system->local_cap, system->total_cap, comm, msg ); - if( ret != SUCCESS ) + if (ret != SUCCESS) return ret; memset( &(workspace->realloc), 0, sizeof(reallocate_data) ); @@ -168,7 +168,7 @@ int Init_Lists( reax_system *system, control_params *control, Estimate_Storages( system, control, lists, &Htop, hb_top, bond_top, &num_3body, comm ); - if( control->hbond_cut > 0 ) { + if (control->hbond_cut > 0) { /* init H indexes */ total_hbonds = 0; for( i = 0; i < system->n; ++i ) { @@ -219,7 +219,7 @@ void Initialize( reax_system *system, control_params *control, char msg[MAX_STR]; - if( Init_MPI_Datatypes(system, workspace, mpi_data, comm, msg) == FAILURE ) { + if (Init_MPI_Datatypes(system, workspace, mpi_data, comm, msg) == FAILURE) { fprintf( stderr, "p%d: init_mpi_datatypes: could not create datatypes\n", system->my_rank ); fprintf( stderr, "p%d: mpi_data couldn't be initialized! terminating.\n", @@ -234,15 +234,15 @@ void Initialize( reax_system *system, control_params *control, MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( Init_Simulation_Data( system, control, data, msg ) == FAILURE ) { + if (Init_Simulation_Data( system, control, data, msg ) == FAILURE) { fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); fprintf( stderr, "p%d: sim_data couldn't be initialized! terminating.\n", system->my_rank ); MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( Init_Workspace( system, control, workspace, mpi_data->world, msg ) == - FAILURE ) { + if (Init_Workspace( system, control, workspace, mpi_data->world, msg ) == + FAILURE) { fprintf( stderr, "p%d:init_workspace: not enough memory\n", system->my_rank ); fprintf( stderr, "p%d:workspace couldn't be initialized! terminating.\n", @@ -250,8 +250,8 @@ void Initialize( reax_system *system, control_params *control, MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( Init_Lists( system, control, data, workspace, lists, mpi_data, msg ) == - FAILURE ) { + if (Init_Lists( system, control, data, workspace, lists, mpi_data, msg ) == + FAILURE) { fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); fprintf( stderr, "p%d: system could not be initialized! terminating.\n", system->my_rank ); @@ -265,8 +265,8 @@ void Initialize( reax_system *system, control_params *control, MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( control->tabulate ) { - if( Init_Lookup_Tables( system, control, workspace, mpi_data, msg ) == FAILURE ) { + if (control->tabulate) { + if (Init_Lookup_Tables( system, control, workspace, mpi_data, msg ) == FAILURE) { fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); fprintf( stderr, "p%d: couldn't create lookup table! terminating.\n", system->my_rank ); diff --git a/src/USER-REAXC/reaxc_io_tools.cpp b/src/USER-REAXC/reaxc_io_tools.cpp index 16014b2e61..f71fcbec8e 100644 --- a/src/USER-REAXC/reaxc_io_tools.cpp +++ b/src/USER-REAXC/reaxc_io_tools.cpp @@ -43,17 +43,17 @@ int Init_Output_Files( reax_system *system, control_params *control, if (out_control->write_steps > 0) { ret = Init_Traj( system, control, out_control, mpi_data, msg ); - if( ret == FAILURE ) + if (ret == FAILURE) return ret; } - if( system->my_rank == MASTER_NODE ) { + if (system->my_rank == MASTER_NODE) { /* These files are written only by the master node */ - if( out_control->energy_update_freq > 0 ) { + if (out_control->energy_update_freq > 0) { /* init potentials file */ sprintf( temp, "%s.pot", control->sim_name ); - if( (out_control->pot = fopen( temp, "w" )) != NULL ) { + if ((out_control->pot = fopen( temp, "w" )) != NULL) { fflush( out_control->pot ); } else { @@ -69,7 +69,7 @@ int Init_Output_Files( reax_system *system, control_params *control, control->ensemble == iNPT || control->ensemble == sNPT ) { sprintf( temp, "%s.prs", control->sim_name ); - if( (out_control->prs = fopen( temp, "w" )) != NULL ) { + if ((out_control->prs = fopen( temp, "w" )) != NULL) { fprintf(out_control->prs,"%8s%13s%13s%13s%13s%13s%13s%13s\n", "step", "Pint/norm[x]", "Pint/norm[y]", "Pint/norm[z]", "Pext/Ptot[x]", "Pext/Ptot[y]", "Pext/Ptot[z]", "Pkin/V" ); @@ -90,11 +90,11 @@ int Init_Output_Files( reax_system *system, control_params *control, int Close_Output_Files( reax_system *system, control_params *control, output_controls *out_control, mpi_datatypes * /*mpi_data*/ ) { - if( out_control->write_steps > 0 ) + if (out_control->write_steps > 0) End_Traj( system->my_rank, out_control ); - if( system->my_rank == MASTER_NODE ) { - if( out_control->energy_update_freq > 0 ) { + if (system->my_rank == MASTER_NODE) { + if (out_control->energy_update_freq > 0) { fclose( out_control->pot ); } diff --git a/src/USER-REAXC/reaxc_list.cpp b/src/USER-REAXC/reaxc_list.cpp index c15ba7927c..8a3bb9d322 100644 --- a/src/USER-REAXC/reaxc_list.cpp +++ b/src/USER-REAXC/reaxc_list.cpp @@ -97,7 +97,7 @@ int Make_List(int n, int num_intrs, int type, reax_list *l, MPI_Comm comm) void Delete_List( reax_list *l, MPI_Comm comm ) { - if( l->allocated == 0 ) + if (l->allocated == 0) return; l->allocated = 0; diff --git a/src/USER-REAXC/reaxc_lookup.cpp b/src/USER-REAXC/reaxc_lookup.cpp index 0e71c662aa..92945ebdb5 100644 --- a/src/USER-REAXC/reaxc_lookup.cpp +++ b/src/USER-REAXC/reaxc_lookup.cpp @@ -198,9 +198,9 @@ int Init_Lookup_Tables( reax_system *system, control_params *control, MPI_INT, MPI_SUM, mpi_data->world ); for( i = 0; i < num_atom_types; ++i ) { - if( aggregated[i] ) { + if (aggregated[i]) { for( j = i; j < num_atom_types; ++j ) { - if( aggregated[j] ) { + if (aggregated[j]) { LR[i][j].xmin = 0; LR[i][j].xmax = control->nonb_cut; LR[i][j].n = control->tabulate + 2; @@ -290,7 +290,7 @@ void Deallocate_Lookup_Tables( reax_system *system ) for( i = 0; i < ntypes; ++i ) { for( j = i; j < ntypes; ++j ) - if( LR[i][j].n ) { + if (LR[i][j].n) { sfree( LR[i][j].y, "LR[i,j].y" ); sfree( LR[i][j].H, "LR[i,j].H" ); sfree( LR[i][j].vdW, "LR[i,j].vdW" ); diff --git a/src/USER-REAXC/reaxc_multi_body.cpp b/src/USER-REAXC/reaxc_multi_body.cpp index 360a9431cf..6991833799 100644 --- a/src/USER-REAXC/reaxc_multi_body.cpp +++ b/src/USER-REAXC/reaxc_multi_body.cpp @@ -95,19 +95,19 @@ void Atom_Energy( reax_system *system, control_params *control, system->pair_ptr->ev_tally(i,i,system->n,1,e_lp,0.0,0.0,0.0,0.0,0.0); /* correction for C2 */ - if( p_lp3 > 0.001 && !strcmp(system->reax_param.sbp[type_i].name, "C") ) + if (p_lp3 > 0.001 && !strcmp(system->reax_param.sbp[type_i].name, "C")) for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) { j = bonds->select.bond_list[pj].nbr; type_j = system->my_atoms[j].type; if (type_j < 0) continue; - if( !strcmp( system->reax_param.sbp[type_j].name, "C" ) ) { + if (!strcmp( system->reax_param.sbp[type_j].name, "C" )) { twbp = &( system->reax_param.tbp[type_i][type_j]); bo_ij = &( bonds->select.bond_list[pj].bo_data ); Di = workspace->Delta[i]; vov3 = bo_ij->BO - Di - 0.040*pow(Di, 4.); - if( vov3 > 3. ) { + if (vov3 > 3.) { data->my_en.e_lp += e_lph = p_lp3 * SQR(vov3-3.0); deahu2dbo = 2.*p_lp3*(vov3 - 3.); @@ -132,7 +132,7 @@ void Atom_Energy( reax_system *system, control_params *control, sbp_i = &(system->reax_param.sbp[ type_i ]); /* over-coordination energy */ - if( sbp_i->mass > 21.0 ) + if (sbp_i->mass > 21.0) dfvl = 0.0; else dfvl = 1.0; // only for 1st-row elements diff --git a/src/USER-REAXC/reaxc_nonbonded.cpp b/src/USER-REAXC/reaxc_nonbonded.cpp index 6e4582364f..6c912ace50 100644 --- a/src/USER-REAXC/reaxc_nonbonded.cpp +++ b/src/USER-REAXC/reaxc_nonbonded.cpp @@ -181,7 +181,7 @@ void vdW_Coulomb_Energy( reax_system *system, control_params *control, f_tmp,delij[0],delij[1],delij[2]); } - if( control->virial == 0 ) { + if (control->virial == 0) { rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec ); rvec_ScaledAdd( workspace->f[j], +(CEvd + CEclmb), nbr_pj->dvec ); } else { /* NPT, iNPT or sNPT */ @@ -263,7 +263,7 @@ void Tabulated_vdW_Coulomb_Energy( reax_system *system,control_params *control, /* Cubic Spline Interpolation */ r = (int)(r_ij * t->inv_dx); - if( r == 0 ) ++r; + if (r == 0) ++r; base = (double)(r+1) * t->dx; dif = r_ij - base; @@ -293,7 +293,7 @@ void Tabulated_vdW_Coulomb_Energy( reax_system *system,control_params *control, f_tmp,delij[0],delij[1],delij[2]); } - if( control->virial == 0 ) { + if (control->virial == 0) { rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec ); rvec_ScaledAdd( workspace->f[j], +(CEvd + CEclmb), nbr_pj->dvec ); } else { // NPT, iNPT or sNPT diff --git a/src/USER-REAXC/reaxc_reset_tools.cpp b/src/USER-REAXC/reaxc_reset_tools.cpp index 26c006cdac..80faed1e9f 100644 --- a/src/USER-REAXC/reaxc_reset_tools.cpp +++ b/src/USER-REAXC/reaxc_reset_tools.cpp @@ -36,11 +36,11 @@ void Reset_Atoms( reax_system* system, control_params *control ) reax_atom *atom; system->numH = 0; - if( control->hbond_cut > 0 ) + if (control->hbond_cut > 0) for( i = 0; i < system->n; ++i ) { atom = &(system->my_atoms[i]); if (atom->type < 0) continue; - if( system->reax_param.sbp[ atom->type ].p_hbond == 1 ) + if (system->reax_param.sbp[ atom->type ].p_hbond == 1) atom->Hindex = system->numH++; else atom->Hindex = -1; } @@ -139,9 +139,9 @@ void Reset_Neighbor_Lists( reax_system *system, control_params *control, } /* is reallocation needed? */ - if( total_bonds >= bonds->num_intrs * DANGER_ZONE ) { + if (total_bonds >= bonds->num_intrs * DANGER_ZONE) { workspace->realloc.bonds = 1; - if( total_bonds >= bonds->num_intrs ) { + if (total_bonds >= bonds->num_intrs) { fprintf(stderr, "p%d: not enough space for bonds! total=%d allocated=%d\n", system->my_rank, total_bonds, bonds->num_intrs ); @@ -150,14 +150,14 @@ void Reset_Neighbor_Lists( reax_system *system, control_params *control, } } - if( control->hbond_cut > 0 && system->numH > 0 ) { + if (control->hbond_cut > 0 && system->numH > 0) { hbonds = (*lists) + HBONDS; total_hbonds = 0; /* reset start-end indexes */ for( i = 0; i < system->n; ++i ) { Hindex = system->my_atoms[i].Hindex; - if( Hindex > -1 ) { + if (Hindex > -1) { Set_Start_Index( Hindex, total_hbonds, hbonds ); Set_End_Index( Hindex, total_hbonds, hbonds ); total_hbonds += system->my_atoms[i].num_hbonds; @@ -165,9 +165,9 @@ void Reset_Neighbor_Lists( reax_system *system, control_params *control, } /* is reallocation needed? */ - if( total_hbonds >= hbonds->num_intrs * 0.90/*DANGER_ZONE*/ ) { + if (total_hbonds >= hbonds->num_intrs * 0.90/*DANGER_ZONE*/) { workspace->realloc.hbonds = 1; - if( total_hbonds >= hbonds->num_intrs ) { + if (total_hbonds >= hbonds->num_intrs) { fprintf(stderr, "p%d: not enough space for hbonds! total=%d allocated=%d\n", system->my_rank, total_hbonds, hbonds->num_intrs ); diff --git a/src/USER-REAXC/reaxc_system_props.cpp b/src/USER-REAXC/reaxc_system_props.cpp index 54eeb6da1e..5024feffcf 100644 --- a/src/USER-REAXC/reaxc_system_props.cpp +++ b/src/USER-REAXC/reaxc_system_props.cpp @@ -60,7 +60,7 @@ void Compute_System_Energy( reax_system *system, simulation_data *data, data->my_en.e_tot = data->my_en.e_pot + E_CONV * data->my_en.e_kin; - if( system->my_rank == MASTER_NODE ) { + if (system->my_rank == MASTER_NODE) { data->sys_en.e_bond = sys_en[0]; data->sys_en.e_ov = sys_en[1]; data->sys_en.e_un = sys_en[2]; diff --git a/src/USER-REAXC/reaxc_tool_box.cpp b/src/USER-REAXC/reaxc_tool_box.cpp index 1678d0a53c..9e662e7a45 100644 --- a/src/USER-REAXC/reaxc_tool_box.cpp +++ b/src/USER-REAXC/reaxc_tool_box.cpp @@ -58,7 +58,7 @@ void *smalloc( rc_bigint n, const char *name, MPI_Comm comm ) { void *ptr; - if( n <= 0 ) { + if (n <= 0) { fprintf( stderr, "WARNING: trying to allocate %ld bytes for array %s. ", n, name ); fprintf( stderr, "returning NULL.\n" ); @@ -66,7 +66,7 @@ void *smalloc( rc_bigint n, const char *name, MPI_Comm comm ) } ptr = malloc( n ); - if( ptr == NULL ) { + if (ptr == NULL) { fprintf( stderr, "ERROR: failed to allocate %ld bytes for array %s", n, name ); MPI_Abort( comm, INSUFFICIENT_MEMORY ); @@ -81,14 +81,14 @@ void *scalloc( rc_bigint n, rc_bigint size, const char *name, MPI_Comm comm ) { void *ptr; - if( n <= 0 ) { + if (n <= 0) { fprintf( stderr, "WARNING: trying to allocate %ld elements for array %s. ", n, name ); fprintf( stderr, "returning NULL.\n" ); return NULL; } - if( size <= 0 ) { + if (size <= 0) { fprintf( stderr, "WARNING: elements size for array %s is %ld. ", name, size ); fprintf( stderr, "returning NULL.\n" ); @@ -96,7 +96,7 @@ void *scalloc( rc_bigint n, rc_bigint size, const char *name, MPI_Comm comm ) } ptr = calloc( n, size ); - if( ptr == NULL ) { + if (ptr == NULL) { fprintf( stderr, "ERROR: failed to allocate %ld bytes for array %s", n*size, name ); MPI_Abort( comm, INSUFFICIENT_MEMORY ); @@ -109,7 +109,7 @@ void *scalloc( rc_bigint n, rc_bigint size, const char *name, MPI_Comm comm ) /* safe free */ void sfree( void *ptr, const char *name ) { - if( ptr == NULL ) { + if (ptr == NULL) { fprintf( stderr, "WARNING: trying to free the already NULL pointer %s!\n", name ); return; diff --git a/src/USER-REAXC/reaxc_torsion_angles.cpp b/src/USER-REAXC/reaxc_torsion_angles.cpp index 2abfbde61d..9ff70e038d 100644 --- a/src/USER-REAXC/reaxc_torsion_angles.cpp +++ b/src/USER-REAXC/reaxc_torsion_angles.cpp @@ -74,19 +74,19 @@ double Calculate_Omega( rvec dvec_ij, double r_ij, hnhe = r_ij * r_kl * sin_ijk * cos_jkl; poem = 2.0 * r_ij * r_kl * sin_ijk * sin_jkl; - if( poem < 1e-20 ) poem = 1e-20; + if (poem < 1e-20) poem = 1e-20; tel = SQR( r_ij ) + SQR( r_jk ) + SQR( r_kl ) - SQR( r_li ) - 2.0 * ( r_ij * r_jk * cos_ijk - r_ij * r_kl * cos_ijk * cos_jkl + r_jk * r_kl * cos_jkl ); arg = tel / poem; - if( arg > 1.0 ) arg = 1.0; - if( arg < -1.0 ) arg = -1.0; + if (arg > 1.0) arg = 1.0; + if (arg < -1.0) arg = -1.0; - if( sin_ijk >= 0 && sin_ijk <= MIN_SINE ) sin_ijk = MIN_SINE; + if (sin_ijk >= 0 && sin_ijk <= MIN_SINE) sin_ijk = MIN_SINE; else if( sin_ijk <= 0 && sin_ijk >= -MIN_SINE ) sin_ijk = -MIN_SINE; - if( sin_jkl >= 0 && sin_jkl <= MIN_SINE ) sin_jkl = MIN_SINE; + if (sin_jkl >= 0 && sin_jkl <= MIN_SINE) sin_jkl = MIN_SINE; else if( sin_jkl <= 0 && sin_jkl >= -MIN_SINE ) sin_jkl = -MIN_SINE; // dcos_omega_di @@ -181,9 +181,9 @@ void Torsion_Angles( reax_system *system, control_params *control, bo_jk = &( pbond_jk->bo_data ); BOA_jk = bo_jk->BO - control->thb_cut; - if( system->my_atoms[j].orig_id > system->my_atoms[k].orig_id ) + if (system->my_atoms[j].orig_id > system->my_atoms[k].orig_id) continue; - if( system->my_atoms[j].orig_id == system->my_atoms[k].orig_id ) { + if (system->my_atoms[j].orig_id == system->my_atoms[k].orig_id) { if (system->my_atoms[k].x[2] < system->my_atoms[j].x[2]) continue; if (system->my_atoms[k].x[2] == system->my_atoms[j].x[2] && system->my_atoms[k].x[1] < system->my_atoms[j].x[1]) continue; @@ -192,10 +192,10 @@ void Torsion_Angles( reax_system *system, control_params *control, system->my_atoms[k].x[0] < system->my_atoms[j].x[0]) continue; } - if( bo_jk->BO > control->thb_cut/*0*/ && Num_Entries(pk, thb_intrs) ) { + if (bo_jk->BO > control->thb_cut/*0*/ && Num_Entries(pk, thb_intrs)) { pj = pbond_jk->sym_index; // pj points to j on k's list - if( Num_Entries(pj, thb_intrs) ) { + if (Num_Entries(pj, thb_intrs)) { type_k = system->my_atoms[k].type; Delta_k = workspace->Delta_boc[k]; r_jk = pbond_jk->d; @@ -218,7 +218,7 @@ void Torsion_Angles( reax_system *system, control_params *control, pbond_ij = &( bonds->select.bond_list[pij] ); bo_ij = &( pbond_ij->bo_data ); - if( bo_ij->BO > control->thb_cut/*0*/ ) { + if (bo_ij->BO > control->thb_cut/*0*/) { i = p_ijk->thb; type_i = system->my_atoms[i].type; r_ij = pbond_ij->d; @@ -228,7 +228,7 @@ void Torsion_Angles( reax_system *system, control_params *control, sin_ijk = sin( theta_ijk ); cos_ijk = cos( theta_ijk ); //tan_ijk_i = 1. / tan( theta_ijk ); - if( sin_ijk >= 0 && sin_ijk <= MIN_SINE ) + if (sin_ijk >= 0 && sin_ijk <= MIN_SINE) tan_ijk_i = cos_ijk / MIN_SINE; else if( sin_ijk <= 0 && sin_ijk >= -MIN_SINE ) tan_ijk_i = cos_ijk / -MIN_SINE; @@ -260,7 +260,7 @@ void Torsion_Angles( reax_system *system, control_params *control, sin_jkl = sin( theta_jkl ); cos_jkl = cos( theta_jkl ); //tan_jkl_i = 1. / tan( theta_jkl ); - if( sin_jkl >= 0 && sin_jkl <= MIN_SINE ) + if (sin_jkl >= 0 && sin_jkl <= MIN_SINE) tan_jkl_i = cos_jkl / MIN_SINE; else if( sin_jkl <= 0 && sin_jkl >= -MIN_SINE ) tan_jkl_i = cos_jkl / -MIN_SINE; @@ -357,7 +357,7 @@ void Torsion_Angles( reax_system *system, control_params *control, bo_jk->Cdbo += (CEtors5 + CEconj2); bo_kl->Cdbo += (CEtors6 + CEconj3); - if( control->virial == 0 ) { + if (control->virial == 0) { /* dcos_theta_ijk */ rvec_ScaledAdd( workspace->f[i], CEtors7 + CEconj4, p_ijk->dcos_dk ); diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp index 946833afaa..648719af4f 100644 --- a/src/USER-REAXC/reaxc_traj.cpp +++ b/src/USER-REAXC/reaxc_traj.cpp @@ -32,12 +32,12 @@ int Reallocate_Output_Buffer( output_controls *out_control, int req_space, MPI_Comm comm ) { - if( out_control->buffer_len > 0 ) + if (out_control->buffer_len > 0) free( out_control->buffer ); out_control->buffer_len = (int)(req_space*SAFE_ZONE); out_control->buffer = (char*) malloc(out_control->buffer_len*sizeof(char)); - if( out_control->buffer == NULL ) { + if (out_control->buffer == NULL) { fprintf( stderr, "insufficient memory for required buffer size %d. terminating!\n", (int) (req_space*SAFE_ZONE) ); @@ -51,7 +51,7 @@ int Reallocate_Output_Buffer( output_controls *out_control, int req_space, void Write_Skip_Line( output_controls *out_control, mpi_datatypes * /*mpi_data*/, int my_rank, int skip, int num_section ) { - if( my_rank == MASTER_NODE ) + if (my_rank == MASTER_NODE) fprintf( out_control->strj, INT2_LINE, "chars_to_skip_section:", skip, num_section ); } @@ -82,11 +82,11 @@ int Write_Header( reax_system *system, control_params *control, num_hdr_lines = NUM_HEADER_LINES; my_hdr_lines = num_hdr_lines * ( system->my_rank == MASTER_NODE ); buffer_req = my_hdr_lines * HEADER_LINE_LEN; - if( buffer_req > out_control->buffer_len * DANGER_ZONE ) + if (buffer_req > out_control->buffer_len * DANGER_ZONE) Reallocate_Output_Buffer( out_control, buffer_req, mpi_data->world ); /* only the master node writes into trajectory header */ - if( system->my_rank == MASTER_NODE ) { + if (system->my_rank == MASTER_NODE) { /* clear the contents of line & buffer */ out_control->line[0] = 0; out_control->buffer[0] = 0; @@ -252,7 +252,7 @@ int Write_Header( reax_system *system, control_params *control, } /* dump out the buffer */ - if( system->my_rank == MASTER_NODE ) + if (system->my_rank == MASTER_NODE) fprintf( out_control->strj, "%s", out_control->buffer ); return SUCCESS; @@ -273,11 +273,11 @@ int Write_Init_Desc( reax_system *system, control_params * /*control*/, Write_Skip_Line( out_control, mpi_data, me, system->bigN * INIT_DESC_LEN, system->bigN ); - if( out_control->traj_method == REG_TRAJ && me == MASTER_NODE ) + if (out_control->traj_method == REG_TRAJ && me == MASTER_NODE) buffer_req = system->bigN * INIT_DESC_LEN + 1; else buffer_req = system->n * INIT_DESC_LEN + 1; - if( buffer_req > out_control->buffer_len * DANGER_ZONE ) + if (buffer_req > out_control->buffer_len * DANGER_ZONE) Reallocate_Output_Buffer( out_control, buffer_req, mpi_data->world ); out_control->line[0] = 0; @@ -297,7 +297,7 @@ int Write_Init_Desc( reax_system *system, control_params * /*control*/, } else { buffer_len = system->n * INIT_DESC_LEN; for( i = 0; i < np; ++i ) - if( i != MASTER_NODE ) { + if (i != MASTER_NODE) { MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len, MPI_CHAR, i, np*INIT_DESCS+i, mpi_data->world, &status ); MPI_Get_count( &status, MPI_CHAR, &cnt ); @@ -342,7 +342,7 @@ int Init_Traj( reax_system *system, control_params *control, /* write trajectory header and atom info, if applicable */ if( out_control->traj_method == REG_TRAJ) { - if( system->my_rank == MASTER_NODE ) + if (system->my_rank == MASTER_NODE) out_control->strj = fopen( fname, "w" ); } else { strcpy( msg, "init_traj: unknown trajectory option" ); @@ -366,11 +366,11 @@ int Write_Frame_Header( reax_system *system, control_params *control, num_frm_hdr_lines = 22; my_frm_hdr_lines = num_frm_hdr_lines * ( me == MASTER_NODE ); buffer_req = my_frm_hdr_lines * HEADER_LINE_LEN; - if( buffer_req > out_control->buffer_len * DANGER_ZONE ) + if (buffer_req > out_control->buffer_len * DANGER_ZONE) Reallocate_Output_Buffer( out_control, buffer_req, mpi_data->world ); /* only the master node writes into trajectory header */ - if( me == MASTER_NODE ) { + if (me == MASTER_NODE) { /* clear the contents of line & buffer */ out_control->line[0] = 0; out_control->buffer[0] = 0; @@ -473,7 +473,7 @@ int Write_Frame_Header( reax_system *system, control_params *control, } /* dump out the buffer */ - if( system->my_rank == MASTER_NODE ) + if (system->my_rank == MASTER_NODE) fprintf( out_control->strj, "%s", out_control->buffer ); return SUCCESS; @@ -495,11 +495,11 @@ int Write_Atoms( reax_system *system, control_params * /*control*/, Write_Skip_Line( out_control, mpi_data, me, system->bigN*line_len, system->bigN ); - if( out_control->traj_method == REG_TRAJ && me == MASTER_NODE ) + if (out_control->traj_method == REG_TRAJ && me == MASTER_NODE) buffer_req = system->bigN * line_len + 1; else buffer_req = system->n * line_len + 1; - if( buffer_req > out_control->buffer_len * DANGER_ZONE ) + if (buffer_req > out_control->buffer_len * DANGER_ZONE) Reallocate_Output_Buffer( out_control, buffer_req, mpi_data->world ); /* fill in buffer */ @@ -545,7 +545,7 @@ int Write_Atoms( reax_system *system, control_params * /*control*/, } else { buffer_len = system->n * line_len; for( i = 0; i < np; ++i ) - if( i != MASTER_NODE ) { + if (i != MASTER_NODE) { MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len, MPI_CHAR, i, np*ATOM_LINES+i, mpi_data->world, &status ); MPI_Get_count( &status, MPI_CHAR, &cnt ); @@ -587,11 +587,11 @@ int Write_Bonds(reax_system *system, control_params *control, reax_list *bonds, Write_Skip_Line( out_control, mpi_data, me, num_bonds*line_len, num_bonds ); - if( out_control->traj_method == REG_TRAJ && me == MASTER_NODE ) + if (out_control->traj_method == REG_TRAJ && me == MASTER_NODE) buffer_req = num_bonds * line_len + 1; else buffer_req = my_bonds * line_len + 1; - if( buffer_req > out_control->buffer_len * DANGER_ZONE ) + if (buffer_req > out_control->buffer_len * DANGER_ZONE) Reallocate_Output_Buffer( out_control, buffer_req, mpi_data->world ); /* fill in the buffer */ @@ -635,7 +635,7 @@ int Write_Bonds(reax_system *system, control_params *control, reax_list *bonds, } else { buffer_len = my_bonds * line_len; for( i = 0; i < np; ++i ) - if( i != MASTER_NODE ) { + if (i != MASTER_NODE) { MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len, MPI_CHAR, i, np*BOND_LINES+i, mpi_data->world, &status ); MPI_Get_count( &status, MPI_CHAR, &cnt ); @@ -671,7 +671,7 @@ int Write_Angles( reax_system *system, control_params *control, bo_ij = &(bonds->select.bond_list[pi]); i = bo_ij->nbr; - if( bo_ij->bo_data.BO >= control->bg_cut ) // physical j&i bond + if (bo_ij->bo_data.BO >= control->bg_cut) // physical j&i bond for( pk = Start_Index( pi, thb_intrs ); pk < End_Index( pi, thb_intrs ); ++pk ) { angle_ijk = &(thb_intrs->select.three_body_list[pk]); @@ -688,11 +688,11 @@ int Write_Angles( reax_system *system, control_params *control, Write_Skip_Line( out_control, mpi_data, me, num_angles*line_len, num_angles ); - if( out_control->traj_method == REG_TRAJ && me == MASTER_NODE ) + if (out_control->traj_method == REG_TRAJ && me == MASTER_NODE) buffer_req = num_angles * line_len + 1; else buffer_req = my_angles * line_len + 1; - if( buffer_req > out_control->buffer_len * DANGER_ZONE ) + if (buffer_req > out_control->buffer_len * DANGER_ZONE) Reallocate_Output_Buffer( out_control, buffer_req, mpi_data->world ); /* fill in the buffer */ @@ -704,7 +704,7 @@ int Write_Angles( reax_system *system, control_params *control, bo_ij = &(bonds->select.bond_list[pi]); i = bo_ij->nbr; - if( bo_ij->bo_data.BO >= control->bg_cut ) // physical j&i bond + if (bo_ij->bo_data.BO >= control->bg_cut) // physical j&i bond for( pk = Start_Index( pi, thb_intrs ); pk < End_Index( pi, thb_intrs ); ++pk ) { angle_ijk = &(thb_intrs->select.three_body_list[pk]); @@ -730,7 +730,7 @@ int Write_Angles( reax_system *system, control_params *control, } else { buffer_len = my_angles * line_len; for( i = 0; i < np; ++i ) - if( i != MASTER_NODE ) { + if (i != MASTER_NODE) { MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len, MPI_CHAR, i, np*ANGLE_LINES+i, mpi_data->world, &status ); MPI_Get_count( &status, MPI_CHAR, &cnt ); @@ -750,13 +750,13 @@ int Append_Frame( reax_system *system, control_params *control, { Write_Frame_Header( system, control, data, out_control, mpi_data ); - if( out_control->write_atoms ) + if (out_control->write_atoms) Write_Atoms( system, control, out_control, mpi_data ); - if( out_control->write_bonds ) + if (out_control->write_bonds) Write_Bonds( system, control, (*lists + BONDS), out_control, mpi_data ); - if( out_control->write_angles ) + if (out_control->write_angles) Write_Angles( system, control, (*lists + BONDS), (*lists + THREE_BODIES), out_control, mpi_data ); @@ -766,7 +766,7 @@ int Append_Frame( reax_system *system, control_params *control, int End_Traj( int my_rank, output_controls *out_control ) { - if( my_rank == MASTER_NODE ) + if (my_rank == MASTER_NODE) fclose( out_control->strj ); free( out_control->buffer ); diff --git a/src/USER-REAXC/reaxc_valence_angles.cpp b/src/USER-REAXC/reaxc_valence_angles.cpp index df51d1034c..ae9367deff 100644 --- a/src/USER-REAXC/reaxc_valence_angles.cpp +++ b/src/USER-REAXC/reaxc_valence_angles.cpp @@ -44,8 +44,8 @@ void Calculate_Theta( rvec dvec_ji, double d_ji, rvec dvec_jk, double d_jk, double *theta, double *cos_theta ) { (*cos_theta) = Dot( dvec_ji, dvec_jk, 3 ) / ( d_ji * d_jk ); - if( *cos_theta > 1. ) *cos_theta = 1.0; - if( *cos_theta < -1. ) *cos_theta = -1.0; + if (*cos_theta > 1.) *cos_theta = 1.0; + if (*cos_theta < -1.) *cos_theta = -1.0; (*theta) = acos( *cos_theta ); } @@ -151,13 +151,13 @@ void Valence_Angles( reax_system *system, control_params *control, SBO = SBOp + (1 - prod_SBO) * (-workspace->Delta_boc[j] - p_val8 * vlpadj); dSBO1 = -8 * prod_SBO * ( workspace->Delta_boc[j] + p_val8 * vlpadj ); - if( SBO <= 0 ) + if (SBO <= 0) SBO2 = 0, CSBO2 = 0; - else if( SBO > 0 && SBO <= 1 ) { + else if (SBO > 0 && SBO <= 1) { SBO2 = pow( SBO, p_val9 ); CSBO2 = p_val9 * pow( SBO, p_val9 - 1 ); } - else if( SBO > 1 && SBO < 2 ) { + else if (SBO > 1 && SBO < 2) { SBO2 = 2 - pow( 2-SBO, p_val9 ); CSBO2 = p_val9 * pow( 2 - SBO, p_val9 - 1 ); } @@ -183,7 +183,7 @@ void Valence_Angles( reax_system *system, control_params *control, end_pk = End_Index( pk, thb_intrs ); for( t = start_pk; t < end_pk; ++t ) - if( thb_intrs->select.three_body_list[t].thb == i ) { + if (thb_intrs->select.three_body_list[t].thb == i) { p_ijk = &(thb_intrs->select.three_body_list[num_thb_intrs] ); p_kji = &(thb_intrs->select.three_body_list[t]); @@ -220,7 +220,7 @@ void Valence_Angles( reax_system *system, control_params *control, p_ijk->theta = theta; sin_theta = sin( theta ); - if( sin_theta < 1.0e-5 ) + if (sin_theta < 1.0e-5) sin_theta = 1.0e-5; ++num_thb_intrs; @@ -233,7 +233,7 @@ void Valence_Angles( reax_system *system, control_params *control, thbh = &( system->reax_param.thbp[ type_i ][ type_j ][ type_k ] ); for( cnt = 0; cnt < thbh->cnt; ++cnt ) { - if( fabs(thbh->prm[cnt].p_val1) > 0.001 ) { + if (fabs(thbh->prm[cnt].p_val1) > 0.001) { thbp = &( thbh->prm[cnt] ); /* ANGLE ENERGY */ @@ -263,7 +263,7 @@ void Valence_Angles( reax_system *system, control_params *control, theta_0 = DEG2RAD( theta_0 ); expval2theta = exp( -p_val2 * SQR(theta_0 - theta) ); - if( p_val1 >= 0 ) + if (p_val1 >= 0) expval12theta = p_val1 * (1.0 - expval2theta); else // To avoid linear Me-H-Me angles (6/6/06) expval12theta = p_val1 * -expval2theta; @@ -354,7 +354,7 @@ void Valence_Angles( reax_system *system, control_params *control, bo_jt->Cdbopi2 += CEval5; } - if( control->virial == 0 ) { + if (control->virial == 0) { rvec_ScaledAdd( workspace->f[i], CEval8, p_ijk->dcos_di ); rvec_ScaledAdd( workspace->f[j], CEval8, p_ijk->dcos_dj ); rvec_ScaledAdd( workspace->f[k], CEval8, p_ijk->dcos_dk ); @@ -402,9 +402,9 @@ void Valence_Angles( reax_system *system, control_params *control, } } - if( num_thb_intrs >= thb_intrs->num_intrs * DANGER_ZONE ) { + if (num_thb_intrs >= thb_intrs->num_intrs * DANGER_ZONE) { workspace->realloc.num_3body = num_thb_intrs; - if( num_thb_intrs > thb_intrs->num_intrs ) { + if (num_thb_intrs > thb_intrs->num_intrs) { fprintf( stderr, "step%d-ran out of space on angle_list: top=%d, max=%d", data->step, num_thb_intrs, thb_intrs->num_intrs ); MPI_Abort( MPI_COMM_WORLD, INSUFFICIENT_MEMORY ); diff --git a/src/USER-REAXC/reaxc_vector.cpp b/src/USER-REAXC/reaxc_vector.cpp index 977b17a6dc..b54d329ce9 100644 --- a/src/USER-REAXC/reaxc_vector.cpp +++ b/src/USER-REAXC/reaxc_vector.cpp @@ -105,7 +105,7 @@ void rtensor_MatVec( rvec ret, rtensor m, rvec v ) int i; rvec temp; - if( ret == v ) + if (ret == v) { for( i = 0; i < 3; ++i ) temp[i] = m[i][0] * v[0] + m[i][1] * v[1] + m[i][2] * v[2]; diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index 621e29ff4b..f884530fd9 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -90,7 +90,7 @@ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg], "surface") == 0) { if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command"); // group all is a special case where we just skip group testing - if(strcmp(arg[iarg+1], "all") == 0) { + if (strcmp(arg[iarg+1], "all") == 0) { surface = VOROSURF_ALL; } else { sgroup = group->find(arg[iarg+1]); @@ -266,7 +266,7 @@ void ComputeVoronoi::buildCells() double **x = atom->x; // setup bounds for voro++ domain for orthogonal and triclinic simulation boxes - if( domain->triclinic ) { + if (domain->triclinic) { // triclinic box: embed parallelepiped into orthogonal voro++ domain // cutghost is in lamda coordinates for triclinic boxes, use subxx_lamda @@ -356,7 +356,7 @@ void ComputeVoronoi::buildCells() // pass coordinates for local and ghost atoms to voro++ for (i = 0; i < nall; i++) { - if( !onlyGroup || (mask[i] & groupbit) ) + if (!onlyGroup || (mask[i] & groupbit)) con_poly->put(i,x[i][0],x[i][1],x[i][2],rfield[i]); } } else { @@ -374,7 +374,7 @@ void ComputeVoronoi::buildCells() // pass coordinates for local and ghost atoms to voro++ for (i = 0; i < nall; i++) - if( !onlyGroup || (mask[i] & groupbit) ) + if (!onlyGroup || (mask[i] & groupbit)) con_mono->put(i,x[i][0],x[i][1],x[i][2]); } } @@ -625,7 +625,7 @@ double ComputeVoronoi::memory_usage() void ComputeVoronoi::compute_vector() { invoked_vector = update->ntimestep; - if( invoked_peratom < invoked_vector ) compute_peratom(); + if (invoked_peratom < invoked_vector) compute_peratom(); for( int i=0; intimestep; - if( invoked_peratom < invoked_local ) compute_peratom(); + if (invoked_peratom < invoked_local) compute_peratom(); } /* ---------------------------------------------------------------------- */ From 1991ff6c48706c2819f259f02a2cd790fefa2338 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Dec 2018 17:08:12 -0500 Subject: [PATCH 86/94] consistent formatting: replace "if( XXX)" with "if (XXX)" --- src/KOKKOS/fix_qeq_reax_kokkos.cpp | 4 ++-- src/KOKKOS/pair_reaxc_kokkos.cpp | 8 ++++---- src/MANYBODY/pair_comb3.cpp | 6 +++--- src/MANYBODY/pair_lcbop.cpp | 2 +- src/MISC/xdr_compat.cpp | 4 ++-- src/MOLECULE/bond_gromos.cpp | 4 ++-- src/MOLECULE/bond_harmonic.cpp | 4 ++-- src/QEQ/fix_qeq.cpp | 4 ++-- src/QEQ/fix_qeq_dynamic.cpp | 4 ++-- src/QEQ/fix_qeq_fire.cpp | 4 ++-- src/QEQ/fix_qeq_point.cpp | 2 +- src/QEQ/fix_qeq_shielded.cpp | 2 +- src/QEQ/fix_qeq_slater.cpp | 2 +- src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp | 8 ++++---- src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp | 6 +++--- src/USER-MANIFOLD/manifold_gaussian_bump.cpp | 8 ++++---- src/USER-MANIFOLD/manifold_thylakoid_shared.cpp | 2 +- src/USER-MESO/pair_edpd.cpp | 2 +- src/USER-MESO/pair_tdpd.cpp | 2 +- src/USER-OMP/pair_reaxc_omp.cpp | 2 +- src/USER-OMP/reaxc_bond_orders_omp.cpp | 8 ++++---- src/USER-OMP/reaxc_init_md_omp.cpp | 2 +- src/USER-OMP/reaxc_multi_body_omp.cpp | 4 ++-- src/USER-OMP/reaxc_nonbonded_omp.cpp | 4 ++-- src/USER-OMP/reaxc_torsion_angles_omp.cpp | 2 +- src/USER-OMP/reaxc_valence_angles_omp.cpp | 6 +++--- src/USER-QUIP/pair_quip.cpp | 2 +- src/USER-REAXC/pair_reaxc.cpp | 2 +- src/USER-REAXC/reaxc_bond_orders.cpp | 4 ++-- src/USER-REAXC/reaxc_bonds.cpp | 4 ++-- src/USER-REAXC/reaxc_forces.cpp | 12 ++++++------ src/USER-REAXC/reaxc_init_md.cpp | 2 +- src/USER-REAXC/reaxc_multi_body.cpp | 6 +++--- src/USER-REAXC/reaxc_nonbonded.cpp | 6 +++--- src/USER-REAXC/reaxc_torsion_angles.cpp | 6 +++--- src/USER-REAXC/reaxc_traj.cpp | 2 +- src/USER-REAXC/reaxc_valence_angles.cpp | 8 ++++---- 37 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index 578afd2077..52a90eda01 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -1115,7 +1115,7 @@ int FixQEqReaxKokkos::pack_forward_comm(int n, int *list, double *bu { int m; - if( pack_flag == 1) + if (pack_flag == 1) for(m = 0; m < n; m++) buf[m] = h_d[list[m]]; else if( pack_flag == 2 ) for(m = 0; m < n; m++) buf[m] = h_s[list[m]]; @@ -1134,7 +1134,7 @@ void FixQEqReaxKokkos::unpack_forward_comm(int n, int first, double { int i, m; - if( pack_flag == 1) + if (pack_flag == 1) for(m = 0, i = first; m < n; m++, i++) h_d[i] = buf[m]; else if( pack_flag == 2) for(m = 0, i = first; m < n; m++, i++) h_s[i] = buf[m]; diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index 22e3e6b28f..d78927b79a 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -1534,7 +1534,7 @@ void PairReaxCKokkos::operator()(PairReaxBuildListsFull, const int & // hbond list if (i < nlocal && cut_hbsq > 0.0 && (ihb == 1 || ihb == 2) && rsq <= cut_hbsq) { jhb = paramssing(jtype).p_hbond; - if( ihb == 1 && jhb == 2) { + if (ihb == 1 && jhb == 2) { const int jj_index = hb_index - hb_first_i; if (jj_index >= maxhb) { d_resize_hb() = 1; @@ -1702,7 +1702,7 @@ void PairReaxCKokkos::operator()(PairReaxBuildListsHalf, // hbond list if (i < nlocal && cut_hbsq > 0.0 && (ihb == 1 || ihb == 2) && rsq <= cut_hbsq) { jhb = paramssing(jtype).p_hbond; - if( ihb == 1 && jhb == 2) { + if (ihb == 1 && jhb == 2) { if (NEIGHFLAG == HALF) { j_index = hb_first_i + d_hb_num[i]; d_hb_num[i]++; @@ -1925,7 +1925,7 @@ void PairReaxCKokkos::operator()(PairReaxBuildListsHalf_LessAtomics< // hbond list if (i < nlocal && cut_hbsq > 0.0 && (ihb == 1 || ihb == 2) && rsq <= cut_hbsq) { jhb = paramssing(jtype).p_hbond; - if( ihb == 1 && jhb == 2) { + if (ihb == 1 && jhb == 2) { if (NEIGHFLAG == HALF) { j_index = hb_first_i + d_hb_num[i]; d_hb_num[i]++; @@ -3476,7 +3476,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeBond1= 1.00) { - if( gp[37] == 2 || (imass == 12.0000 && jmass == 15.9990) || + if (gp[37] == 2 || (imass == 12.0000 && jmass == 15.9990) || (jmass == 12.0000 && imass == 15.9990) ) { const F_FLOAT exphu = exp(-gp[7] * SQR(BO_i - 2.50) ); const F_FLOAT exphua1 = exp(-gp[3] * (d_total_bo[i]-BO_i)); diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index 8e7a59d15f..d82f6dfed0 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -208,7 +208,7 @@ void PairComb3::coeff(int narg, char **arg) nelements = 0; for (i = 3; i < narg; i++) { if ((strcmp(arg[i],"C") == 0) && (cflag == 0)) { - if( comm->me == 0 && screen) fprintf(screen, + if (comm->me == 0 && screen) fprintf(screen, " PairComb3: Found C: reading additional library file\n"); read_lib(); cflag = 1; @@ -922,7 +922,7 @@ void PairComb3::Short_neigh() icontrol = params[iparam_ij].jelementgp; - if( icontrol == 1) + if (icontrol == 1) xcctmp[i] += comb_fc(rr1,¶ms[iparam_ij]) * params[iparam_ij].pcross; if (icontrol == 2) xchtmp[i] += comb_fc(rr1,¶ms[iparam_ij]) * params[iparam_ij].pcross; @@ -1382,7 +1382,7 @@ void PairComb3::compute(int eflag, int vflag) } // torsion and radical: apply to all C-C bonds - if( params[iparam_ijk].tor_flag != 0 && fabs(ptorr)>1.0e-8) { + if (params[iparam_ijk].tor_flag != 0 && fabs(ptorr)>1.0e-8) { srmu = vec3_dot(delrj,delrk)/(sqrt(rsq1*rsq2)); srmu = sqrt(1.0-srmu*srmu); diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp index 7d683e8ed8..0c8b3ef2a6 100644 --- a/src/MANYBODY/pair_lcbop.cpp +++ b/src/MANYBODY/pair_lcbop.cpp @@ -122,7 +122,7 @@ void PairLCBOP::allocate() ------------------------------------------------------------------------- */ void PairLCBOP::settings(int narg, char **/*arg*/) { - if( narg != 0 ) error->all(FLERR,"Illegal pair_style command"); + if (narg != 0 ) error->all(FLERR,"Illegal pair_style command"); } /* ---------------------------------------------------------------------- diff --git a/src/MISC/xdr_compat.cpp b/src/MISC/xdr_compat.cpp index 0f4d73cdd9..2d8d0ce7e5 100644 --- a/src/MISC/xdr_compat.cpp +++ b/src/MISC/xdr_compat.cpp @@ -70,7 +70,7 @@ static xdr_uint32_t xdr_swapbytes(xdr_uint32_t x) static xdr_uint32_t xdr_htonl(xdr_uint32_t x) { short s=0x0F00; - if( *((char *)&s)==(char)0x0F) { + if (*((char *)&s)==(char)0x0F) { /* bigendian, do nothing */ return x; } else { @@ -82,7 +82,7 @@ static xdr_uint32_t xdr_htonl(xdr_uint32_t x) static xdr_uint32_t xdr_ntohl(xdr_uint32_t x) { short s=0x0F00; - if( *((char *)&s)==(char)0x0F) { + if (*((char *)&s)==(char)0x0F) { /* bigendian, do nothing */ return x; } else { diff --git a/src/MOLECULE/bond_gromos.cpp b/src/MOLECULE/bond_gromos.cpp index 279f4fb2d4..57091903af 100644 --- a/src/MOLECULE/bond_gromos.cpp +++ b/src/MOLECULE/bond_gromos.cpp @@ -204,7 +204,7 @@ double BondGromos::single(int type, double rsq, int /*i*/, int /*j*/, void *BondGromos::extract( char *str, int &dim ) { dim = 1; - if( strcmp(str,"kappa")==0) return (void*) k; - if( strcmp(str,"r0")==0) return (void*) r0; + if (strcmp(str,"kappa")==0) return (void*) k; + if (strcmp(str,"r0")==0) return (void*) r0; return NULL; } diff --git a/src/MOLECULE/bond_harmonic.cpp b/src/MOLECULE/bond_harmonic.cpp index f795610b37..fb4581d0d6 100644 --- a/src/MOLECULE/bond_harmonic.cpp +++ b/src/MOLECULE/bond_harmonic.cpp @@ -207,8 +207,8 @@ double BondHarmonic::single(int type, double rsq, int /*i*/, int /*j*/, void *BondHarmonic::extract( char *str, int &dim ) { dim = 1; - if( strcmp(str,"kappa")==0) return (void*) k; - if( strcmp(str,"r0")==0) return (void*) r0; + if (strcmp(str,"kappa")==0) return (void*) k; + if (strcmp(str,"r0")==0) return (void*) r0; return NULL; } diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index 49e0a6d423..ab412338d8 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -475,7 +475,7 @@ int FixQEq::pack_forward_comm(int n, int *list, double *buf, { int m; - if( pack_flag == 1) + if (pack_flag == 1) for(m = 0; m < n; m++) buf[m] = d[list[m]]; else if( pack_flag == 2 ) for(m = 0; m < n; m++) buf[m] = s[list[m]]; @@ -493,7 +493,7 @@ void FixQEq::unpack_forward_comm(int n, int first, double *buf) { int i, m; - if( pack_flag == 1) + if (pack_flag == 1) for(m = 0, i = first; m < n; m++, i++) d[i] = buf[m]; else if( pack_flag == 2) for(m = 0, i = first; m < n; m++, i++) s[i] = buf[m]; diff --git a/src/QEQ/fix_qeq_dynamic.cpp b/src/QEQ/fix_qeq_dynamic.cpp index 1f1dd966f5..ba88f4f1c3 100644 --- a/src/QEQ/fix_qeq_dynamic.cpp +++ b/src/QEQ/fix_qeq_dynamic.cpp @@ -103,7 +103,7 @@ void FixQEqDynamic::pre_force(int /*vflag*/) if (update->ntimestep % nevery) return; - if( atom->nmax > nmax ) reallocate_storage(); + if (atom->nmax > nmax) reallocate_storage(); inum = list->inum; ilist = list->ilist; @@ -265,7 +265,7 @@ void FixQEqDynamic::unpack_forward_comm(int n, int first, double *buf) { int i, m; - if( pack_flag == 1) + if (pack_flag == 1) for(m = 0, i = first; m < n; m++, i++) atom->q[i] = buf[m]; else if( pack_flag == 2) for(m = 0, i = first; m < n; m++, i++) qf[i] = buf[m]; diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp index a8591c2b9b..1e3686f99c 100644 --- a/src/QEQ/fix_qeq_fire.cpp +++ b/src/QEQ/fix_qeq_fire.cpp @@ -122,7 +122,7 @@ void FixQEqFire::pre_force(int /*vflag*/) if (ntimestep % nevery) return; - if( atom->nmax > nmax ) reallocate_storage(); + if (atom->nmax > nmax) reallocate_storage(); inum = list->inum; ilist = list->ilist; @@ -329,7 +329,7 @@ void FixQEqFire::unpack_forward_comm(int n, int first, double *buf) { int i, m; - if( pack_flag == 1) + if (pack_flag == 1) for(m = 0, i = first; m < n; m++, i++) atom->q[i] = buf[m]; else if( pack_flag == 2) for(m = 0, i = first; m < n; m++, i++) qf[i] = buf[m]; diff --git a/src/QEQ/fix_qeq_point.cpp b/src/QEQ/fix_qeq_point.cpp index 2afedbaa69..9517343974 100644 --- a/src/QEQ/fix_qeq_point.cpp +++ b/src/QEQ/fix_qeq_point.cpp @@ -73,7 +73,7 @@ void FixQEqPoint::pre_force(int /*vflag*/) nlocal = atom->nlocal; - if( atom->nmax > nmax ) reallocate_storage(); + if (atom->nmax > nmax) reallocate_storage(); if (nlocal > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE) reallocate_matrix(); diff --git a/src/QEQ/fix_qeq_shielded.cpp b/src/QEQ/fix_qeq_shielded.cpp index 1c59474b47..7fe273fc40 100644 --- a/src/QEQ/fix_qeq_shielded.cpp +++ b/src/QEQ/fix_qeq_shielded.cpp @@ -117,7 +117,7 @@ void FixQEqShielded::pre_force(int /*vflag*/) nlocal = atom->nlocal; - if( atom->nmax > nmax ) reallocate_storage(); + if (atom->nmax > nmax) reallocate_storage(); if (nlocal > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE) reallocate_matrix(); diff --git a/src/QEQ/fix_qeq_slater.cpp b/src/QEQ/fix_qeq_slater.cpp index 68edbd80f7..3443a519a2 100644 --- a/src/QEQ/fix_qeq_slater.cpp +++ b/src/QEQ/fix_qeq_slater.cpp @@ -114,7 +114,7 @@ void FixQEqSlater::pre_force(int /*vflag*/) nlocal = atom->nlocal; nall = atom->nlocal + atom->nghost; - if( atom->nmax > nmax ) reallocate_storage(); + if (atom->nmax > nmax) reallocate_storage(); if (nlocal > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE) reallocate_matrix(); diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index e86b3c97ea..794a324f03 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -84,8 +84,8 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, int error_on_unknown_keyword ) : Fix(lmp,narg,arg) { - if( lmp->citeme) lmp->citeme->add(cite_fix_nve_manifold_rattle); - if( narg < 6 ) error->all(FLERR, "Illegal fix nve/manifold/rattle command"); + if (lmp->citeme) lmp->citeme->add(cite_fix_nve_manifold_rattle); + if (narg < 6 ) error->all(FLERR, "Illegal fix nve/manifold/rattle command"); // Set all bits/settings: time_integrate = 1; @@ -135,12 +135,12 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, is_var[i] = 0; } tstrs[i] = new char[len]; - if( tstrs[i] == NULL ) error->all(FLERR,"Error allocating space for args."); + if (tstrs[i] == NULL ) error->all(FLERR,"Error allocating space for args."); strcpy( tstrs[i], arg[i+6] + offset ); } ptr_m->params = new double[nvars]; - if( !ptr_m->params ) error->all(FLERR,"Failed to allocate params!"); + if (!ptr_m->params ) error->all(FLERR,"Failed to allocate params!"); for( int i = 0; i < nvars; ++i ){ // If param i was variable type, it will be set later... ptr_m->params[i] = is_var[i] ? 0.0 : force->numeric( FLERR, arg[i+6] ); diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp index 1e9d0015f1..a4eed66336 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -86,7 +86,7 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, { if (lmp->citeme) lmp->citeme->add(cite_fix_nvt_manifold_rattle); - if( narg < 6 ) error->all(FLERR,"Illegal fix nvt/manifold/rattle command"); + if (narg < 6 ) error->all(FLERR,"Illegal fix nvt/manifold/rattle command"); // Set all bits/settings: dof_flag = 1; @@ -132,7 +132,7 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, reset_dt(); - if( !got_temp ) error->all(FLERR,"Fix nvt/manifold/rattle needs 'temp'!"); + if (!got_temp ) error->all(FLERR,"Fix nvt/manifold/rattle needs 'temp'!"); if (t_period < 0.0) { error->all(FLERR,"Fix nvt/manifold/rattle damping parameter must be > 0.0"); @@ -341,7 +341,7 @@ void FixNVTManifoldRattle::nh_v_temp() double **v = atom->v; int *mask = atom->mask; int nlocal = atom->nlocal; - if( igroup == atom->firstgroup) nlocal = atom->nfirst; + if (igroup == atom->firstgroup) nlocal = atom->nfirst; diff --git a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp index c40f3c73bb..b9b7ae7279 100644 --- a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp +++ b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp @@ -42,10 +42,10 @@ public: void test() { - if( fabs( x(0) - x0 ) > 1e-8 ) err->one(FLERR, "x0 wrong"); - if( fabs( x(1) - x1 ) > 1e-8 ) err->one(FLERR, "x1 wrong"); - if( fabs( y(0) - y0 ) > 1e-8 ) err->one(FLERR, "y0 wrong"); - if( fabs( y(1) - y1 ) > 1e-8 ) err->one(FLERR, "y1 wrong"); + if (fabs( x(0) - x0 ) > 1e-8 ) err->one(FLERR, "x0 wrong"); + if (fabs( x(1) - x1 ) > 1e-8 ) err->one(FLERR, "x1 wrong"); + if (fabs( y(0) - y0 ) > 1e-8 ) err->one(FLERR, "y0 wrong"); + if (fabs( y(1) - y1 ) > 1e-8 ) err->one(FLERR, "y1 wrong"); } double get_t_from_x( double xx ) const diff --git a/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp b/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp index 78735421c7..1c6b4dd06a 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp @@ -38,7 +38,7 @@ thyla_part::thyla_part( int type, double *args, double xlo, double ylo, double z return; } // The others should be 1. - if( (args[0] != 1.0) && (args[0] != 0.0) && + if ( (args[0] != 1.0) && (args[0] != 0.0) && (args[1] != 1.0) && (args[1] != 0.0) && (args[2] != 1.0) && (args[2] != 0.0) ){ err_flag = -1; diff --git a/src/USER-MESO/pair_edpd.cpp b/src/USER-MESO/pair_edpd.cpp index 5ed63a2a8b..1f6222944a 100644 --- a/src/USER-MESO/pair_edpd.cpp +++ b/src/USER-MESO/pair_edpd.cpp @@ -191,7 +191,7 @@ void PairEDPD::compute(int eflag, int vflag) // heat transfer double dQc,dQd,dQr; - if( r < cutT[itype][jtype]) { + if (r < cutT[itype][jtype]) { double wrT = 1.0 - r/cutT[itype][jtype]; wrT = MAX(0.0,MIN(1.0,wrT)); wrT = pow(wrT, 0.5*powerT[itype][jtype]); diff --git a/src/USER-MESO/pair_tdpd.cpp b/src/USER-MESO/pair_tdpd.cpp index 821d8c0486..a41282c0d8 100644 --- a/src/USER-MESO/pair_tdpd.cpp +++ b/src/USER-MESO/pair_tdpd.cpp @@ -161,7 +161,7 @@ void PairTDPD::compute(int eflag, int vflag) f[i][2] += delz*fpair; // chemical concentration transport - if( r < cutcc[itype][jtype]) { + if (r < cutcc[itype][jtype]) { for(int k=0; kbig_box.box_norms[0] = 0; system->big_box.box_norms[1] = 0; system->big_box.box_norms[2] = 0; - if( comm->me == 0 ) t_start = MPI_Wtime(); + if (comm->me == 0 ) t_start = MPI_Wtime(); // setup data structures setup(); diff --git a/src/USER-OMP/reaxc_bond_orders_omp.cpp b/src/USER-OMP/reaxc_bond_orders_omp.cpp index 7edc593aa2..33780f5e3f 100644 --- a/src/USER-OMP/reaxc_bond_orders_omp.cpp +++ b/src/USER-OMP/reaxc_bond_orders_omp.cpp @@ -113,7 +113,7 @@ void Add_dBond_to_ForcesOMP( reax_system *system, int i, int pj, rvec_Add(workspace->forceReduction[reductionOffset+i],temp ); - if( system->pair_ptr->vflag_atom) { + if (system->pair_ptr->vflag_atom) { rvec_Scale(fi_tmp, -1.0, temp); rvec_ScaledSum( delij, 1., system->my_atoms[i].x,-1., system->my_atoms[j].x ); @@ -147,7 +147,7 @@ void Add_dBond_to_ForcesOMP( reax_system *system, int i, int pj, rvec_Add(workspace->forceReduction[reductionOffset+j],temp ); - if( system->pair_ptr->vflag_atom) { + if (system->pair_ptr->vflag_atom) { rvec_Scale(fj_tmp, -1.0, temp); rvec_ScaledSum( delji, 1., system->my_atoms[j].x,-1., system->my_atoms[i].x ); @@ -490,7 +490,7 @@ void BOOMP( reax_system *system, control_params * /* control */, simulation_data if(type_j < 0) continue; bo_ij = &( bonds->select.bond_list[pj].bo_data ); - if( i < j || workspace->bond_mark[j] > 3) { + if (i < j || workspace->bond_mark[j] > 3) { twbp = &( system->reax_param.tbp[type_i][type_j] ); if (twbp->ovc < 0.001 && twbp->v13cor < 0.001) { @@ -654,7 +654,7 @@ void BOOMP( reax_system *system, control_params * /* control */, simulation_data type_j = system->my_atoms[j].type; if(type_j < 0) continue; - if( i < j || workspace->bond_mark[j] > 3) { + if (i < j || workspace->bond_mark[j] > 3) { // Computed in previous for-loop } else { /* We only need to update bond orders from bo_ji diff --git a/src/USER-OMP/reaxc_init_md_omp.cpp b/src/USER-OMP/reaxc_init_md_omp.cpp index 4266c62a1c..bd15b3b9df 100644 --- a/src/USER-OMP/reaxc_init_md_omp.cpp +++ b/src/USER-OMP/reaxc_init_md_omp.cpp @@ -166,7 +166,7 @@ void InitializeOMP( reax_system *system, control_params *control, MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( Init_Output_Files(system,control,out_control,mpi_data,msg)== FAILURE) { + if (Init_Output_Files(system,control,out_control,mpi_data,msg)== FAILURE) { fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); fprintf( stderr, "p%d: could not open output files! terminating...\n", system->my_rank ); diff --git a/src/USER-OMP/reaxc_multi_body_omp.cpp b/src/USER-OMP/reaxc_multi_body_omp.cpp index e3fa568a33..7552e7a733 100644 --- a/src/USER-OMP/reaxc_multi_body_omp.cpp +++ b/src/USER-OMP/reaxc_multi_body_omp.cpp @@ -128,7 +128,7 @@ void Atom_EnergyOMP( reax_system *system, control_params * /* control */, if(numbonds > 0) workspace->CdDelta[i] += CElp; // lp - 1st term /* tally into per-atom energy */ - if( system->pair_ptr->evflag) + if (system->pair_ptr->evflag) pair_reax_ptr->ev_tally_thr_proxy(system->pair_ptr, i, i, system->n, 1, e_lp, 0.0, 0.0, 0.0, 0.0, 0.0, thr); @@ -155,7 +155,7 @@ void Atom_EnergyOMP( reax_system *system, control_params * /* control */, workspace->CdDelta[i] += deahu2dsbo; /* tally into per-atom energy */ - if( system->pair_ptr->evflag) + if (system->pair_ptr->evflag) pair_reax_ptr->ev_tally_thr_proxy(system->pair_ptr, i, j, system->n, 1, e_lph, 0.0, 0.0, 0.0, 0.0, 0.0, thr); } diff --git a/src/USER-OMP/reaxc_nonbonded_omp.cpp b/src/USER-OMP/reaxc_nonbonded_omp.cpp index 128767202b..41b1474791 100644 --- a/src/USER-OMP/reaxc_nonbonded_omp.cpp +++ b/src/USER-OMP/reaxc_nonbonded_omp.cpp @@ -208,7 +208,7 @@ void vdW_Coulomb_Energy_OMP( reax_system *system, control_params *control, ( dTap - Tap * r_ij / dr3gamij_1 ) / dr3gamij_3; /* tally into per-atom energy */ - if( system->pair_ptr->evflag || system->pair_ptr->vflag_atom) { + if (system->pair_ptr->evflag || system->pair_ptr->vflag_atom) { pe_vdw = Tap * (e_vdW + e_core + e_lg); rvec_ScaledSum( delij, 1., system->my_atoms[i].x, -1., system->my_atoms[j].x ); @@ -349,7 +349,7 @@ void Tabulated_vdW_Coulomb_Energy_OMP(reax_system *system,control_params *contro CEclmb *= system->my_atoms[i].q * system->my_atoms[j].q; /* tally into per-atom energy */ - if( system->pair_ptr->evflag || system->pair_ptr->vflag_atom) { + if (system->pair_ptr->evflag || system->pair_ptr->vflag_atom) { rvec_ScaledSum( delij, 1., system->my_atoms[i].x, -1., system->my_atoms[j].x ); f_tmp = -(CEvd + CEclmb); diff --git a/src/USER-OMP/reaxc_torsion_angles_omp.cpp b/src/USER-OMP/reaxc_torsion_angles_omp.cpp index 2b2ed3af4a..d290dc264f 100644 --- a/src/USER-OMP/reaxc_torsion_angles_omp.cpp +++ b/src/USER-OMP/reaxc_torsion_angles_omp.cpp @@ -417,7 +417,7 @@ void Torsion_AnglesOMP( reax_system *system, control_params *control, } /* tally into per-atom virials */ - if( system->pair_ptr->vflag_atom || system->pair_ptr->evflag) { + if (system->pair_ptr->vflag_atom || system->pair_ptr->evflag) { // acquire vectors rvec_ScaledSum( delil, 1., system->my_atoms[l].x, diff --git a/src/USER-OMP/reaxc_valence_angles_omp.cpp b/src/USER-OMP/reaxc_valence_angles_omp.cpp index d4e07764d1..4164d39cab 100644 --- a/src/USER-OMP/reaxc_valence_angles_omp.cpp +++ b/src/USER-OMP/reaxc_valence_angles_omp.cpp @@ -561,7 +561,7 @@ void Valence_AnglesOMP( reax_system *system, control_params *control, } /* tally into per-atom virials */ - if( system->pair_ptr->vflag_atom || system->pair_ptr->evflag) { + if (system->pair_ptr->vflag_atom || system->pair_ptr->evflag) { /* Acquire vectors */ rvec_ScaledSum( delij, 1., system->my_atoms[i].x, @@ -575,10 +575,10 @@ void Valence_AnglesOMP( reax_system *system, control_params *control, eng_tmp = e_ang + e_pen + e_coa; - if( system->pair_ptr->evflag) + if (system->pair_ptr->evflag) pair_reax_ptr->ev_tally_thr_proxy(system->pair_ptr, j, j, system->N, 1, eng_tmp, 0.0, 0.0, 0.0, 0.0, 0.0, thr); - if( system->pair_ptr->vflag_atom) + if (system->pair_ptr->vflag_atom) // NEED TO MAKE AN OMP VERSION OF THIS CALL! system->pair_ptr->v_tally3( i, j, k, fi_tmp, fk_tmp, delij, delkj); } diff --git a/src/USER-QUIP/pair_quip.cpp b/src/USER-QUIP/pair_quip.cpp index 99c107bb84..fce6313754 100644 --- a/src/USER-QUIP/pair_quip.cpp +++ b/src/USER-QUIP/pair_quip.cpp @@ -271,7 +271,7 @@ void PairQUIP::coeff(int narg, char **arg) for (int i = 4; i < narg; i++) { - if( 0 == sscanf(arg[i],"%d",&map[i-4])) { + if (0 == sscanf(arg[i],"%d",&map[i-4])) { char str[1024]; sprintf(str,"Incorrect atomic number %s at position %d",arg[i],i); error->all(FLERR,str); diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index 1c8f4c1e11..4be85a58cd 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -510,7 +510,7 @@ void PairReaxC::compute(int eflag, int vflag) system->big_box.box_norms[0] = 0; system->big_box.box_norms[1] = 0; system->big_box.box_norms[2] = 0; - if( comm->me == 0 ) t_start = MPI_Wtime(); + if (comm->me == 0 ) t_start = MPI_Wtime(); // setup data structures diff --git a/src/USER-REAXC/reaxc_bond_orders.cpp b/src/USER-REAXC/reaxc_bond_orders.cpp index 11bb04bbbf..1ed58a0bfd 100644 --- a/src/USER-REAXC/reaxc_bond_orders.cpp +++ b/src/USER-REAXC/reaxc_bond_orders.cpp @@ -189,7 +189,7 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj, rvec_ScaledAdd( temp, coef.C3dbopi2, workspace->dDeltap_self[i] ); rvec_Add( workspace->f[i], temp ); - if( system->pair_ptr->vflag_atom) { + if (system->pair_ptr->vflag_atom) { rvec_Scale(fi_tmp, -1.0, temp); rvec_ScaledSum( delij, 1., system->my_atoms[i].x,-1., system->my_atoms[j].x ); system->pair_ptr->v_tally(i,fi_tmp,delij); @@ -208,7 +208,7 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj, rvec_ScaledAdd( temp, coef.C4dbopi2, workspace->dDeltap_self[j]); rvec_Add( workspace->f[j], temp ); - if( system->pair_ptr->vflag_atom) { + if (system->pair_ptr->vflag_atom) { rvec_Scale(fj_tmp, -1.0, temp); rvec_ScaledSum( delji, 1., system->my_atoms[j].x,-1., system->my_atoms[i].x ); system->pair_ptr->v_tally(j,fj_tmp,delji); diff --git a/src/USER-REAXC/reaxc_bonds.cpp b/src/USER-REAXC/reaxc_bonds.cpp index b5ab91941f..48fb872324 100644 --- a/src/USER-REAXC/reaxc_bonds.cpp +++ b/src/USER-REAXC/reaxc_bonds.cpp @@ -95,7 +95,7 @@ void Bonds( reax_system *system, control_params * /*control*/, -twbp->De_pp * bo_ij->BO_pi2; /* tally into per-atom energy */ - if( system->pair_ptr->evflag) + if (system->pair_ptr->evflag) system->pair_ptr->ev_tally(i,j,natoms,1,ebond,0.0,0.0,0.0,0.0,0.0); /* calculate derivatives of Bond Orders */ @@ -125,7 +125,7 @@ void Bonds( reax_system *system, control_params * /*control*/, (gp3*exphub1 + 25.0*gp4*exphuov*hulpov*(exphua1+exphub1)); /* tally into per-atom energy */ - if( system->pair_ptr->evflag) + if (system->pair_ptr->evflag) system->pair_ptr->ev_tally(i,j,natoms,1,estriph,0.0,0.0,0.0,0.0,0.0); bo_ij->Cdbo += decobdbo; diff --git a/src/USER-REAXC/reaxc_forces.cpp b/src/USER-REAXC/reaxc_forces.cpp index 721a88603e..19b3cc4975 100644 --- a/src/USER-REAXC/reaxc_forces.cpp +++ b/src/USER-REAXC/reaxc_forces.cpp @@ -260,7 +260,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, if (local) { /* hydrogen bond lists */ - if( control->hbond_cut > 0 && (ihb==1 || ihb==2) && + if (control->hbond_cut > 0 && (ihb==1 || ihb==2) && nbr_pj->d <= control->hbond_cut ) { // fprintf( stderr, "%d %d\n", atom1, atom2 ); jhb = sbp_j->p_hbond; @@ -282,7 +282,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control, } } - if( //(workspace->bond_mark[i] < 3 || workspace->bond_mark[j] < 3) && + if (//(workspace->bond_mark[i] < 3 || workspace->bond_mark[j] < 3) && nbr_pj->d <= control->bond_cut && BOp( workspace, bonds, control->bo_cut, i , btop_i, nbr_pj, sbp_i, sbp_j, twbp ) ) { @@ -377,7 +377,7 @@ void Estimate_Storages( reax_system *system, control_params *control, ++(*Htop); /* hydrogen bond lists */ - if( control->hbond_cut > 0.1 && (ihb==1 || ihb==2) && + if (control->hbond_cut > 0.1 && (ihb==1 || ihb==2) && nbr_pj->d <= control->hbond_cut ) { jhb = sbp_j->p_hbond; if (ihb == 1 && jhb == 2) @@ -389,19 +389,19 @@ void Estimate_Storages( reax_system *system, control_params *control, /* uncorrected bond orders */ if (nbr_pj->d <= control->bond_cut) { - if( sbp_i->r_s > 0.0 && sbp_j->r_s > 0.0) { + if (sbp_i->r_s > 0.0 && sbp_j->r_s > 0.0) { C12 = twbp->p_bo1 * pow( r_ij / twbp->r_s, twbp->p_bo2 ); BO_s = (1.0 + control->bo_cut) * exp( C12 ); } else BO_s = C12 = 0.0; - if( sbp_i->r_pi > 0.0 && sbp_j->r_pi > 0.0) { + if (sbp_i->r_pi > 0.0 && sbp_j->r_pi > 0.0) { C34 = twbp->p_bo3 * pow( r_ij / twbp->r_p, twbp->p_bo4 ); BO_pi = exp( C34 ); } else BO_pi = C34 = 0.0; - if( sbp_i->r_pi_pi > 0.0 && sbp_j->r_pi_pi > 0.0) { + if (sbp_i->r_pi_pi > 0.0 && sbp_j->r_pi_pi > 0.0) { C56 = twbp->p_bo5 * pow( r_ij / twbp->r_pp, twbp->p_bo6 ); BO_pi2= exp( C56 ); } diff --git a/src/USER-REAXC/reaxc_init_md.cpp b/src/USER-REAXC/reaxc_init_md.cpp index c164c6f161..5901b76326 100644 --- a/src/USER-REAXC/reaxc_init_md.cpp +++ b/src/USER-REAXC/reaxc_init_md.cpp @@ -258,7 +258,7 @@ void Initialize( reax_system *system, control_params *control, MPI_Abort( mpi_data->world, CANNOT_INITIALIZE ); } - if( Init_Output_Files(system,control,out_control,mpi_data,msg)== FAILURE) { + if (Init_Output_Files(system,control,out_control,mpi_data,msg)== FAILURE) { fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); fprintf( stderr, "p%d: could not open output files! terminating...\n", system->my_rank ); diff --git a/src/USER-REAXC/reaxc_multi_body.cpp b/src/USER-REAXC/reaxc_multi_body.cpp index 6991833799..f7d72a2678 100644 --- a/src/USER-REAXC/reaxc_multi_body.cpp +++ b/src/USER-REAXC/reaxc_multi_body.cpp @@ -91,7 +91,7 @@ void Atom_Energy( reax_system *system, control_params *control, workspace->CdDelta[i] += CElp; // lp - 1st term /* tally into per-atom energy */ - if( system->pair_ptr->evflag) + if (system->pair_ptr->evflag) system->pair_ptr->ev_tally(i,i,system->n,1,e_lp,0.0,0.0,0.0,0.0,0.0); /* correction for C2 */ @@ -117,7 +117,7 @@ void Atom_Energy( reax_system *system, control_params *control, workspace->CdDelta[i] += deahu2dsbo; /* tally into per-atom energy */ - if( system->pair_ptr->evflag) + if (system->pair_ptr->evflag) system->pair_ptr->ev_tally(i,j,system->n,1,e_lph,0.0,0.0,0.0,0.0,0.0); } @@ -201,7 +201,7 @@ void Atom_Energy( reax_system *system, control_params *control, p_ovun4 * exp_ovun1 * SQR(inv_exp_ovun1) + CEunder2; /* tally into per-atom energy */ - if( system->pair_ptr->evflag) { + if (system->pair_ptr->evflag) { eng_tmp = e_ov; if (numbonds > 0 || control->enobondsflag) eng_tmp += e_un; diff --git a/src/USER-REAXC/reaxc_nonbonded.cpp b/src/USER-REAXC/reaxc_nonbonded.cpp index 6c912ace50..c13bc0d89f 100644 --- a/src/USER-REAXC/reaxc_nonbonded.cpp +++ b/src/USER-REAXC/reaxc_nonbonded.cpp @@ -172,7 +172,7 @@ void vdW_Coulomb_Energy( reax_system *system, control_params *control, ( dTap - Tap * r_ij / dr3gamij_1 ) / dr3gamij_3; /* tally into per-atom energy */ - if( system->pair_ptr->evflag || system->pair_ptr->vflag_atom) { + if (system->pair_ptr->evflag || system->pair_ptr->vflag_atom) { pe_vdw = Tap * (e_vdW + e_core + e_lg); rvec_ScaledSum( delij, 1., system->my_atoms[i].x, -1., system->my_atoms[j].x ); @@ -285,7 +285,7 @@ void Tabulated_vdW_Coulomb_Energy( reax_system *system,control_params *control, CEclmb *= system->my_atoms[i].q * system->my_atoms[j].q; /* tally into per-atom energy */ - if( system->pair_ptr->evflag || system->pair_ptr->vflag_atom) { + if (system->pair_ptr->evflag || system->pair_ptr->vflag_atom) { rvec_ScaledSum( delij, 1., system->my_atoms[i].x, -1., system->my_atoms[j].x ); f_tmp = -(CEvd + CEclmb); @@ -330,7 +330,7 @@ void Compute_Polarization_Energy( reax_system *system, simulation_data *data ) data->my_en.e_pol += en_tmp; /* tally into per-atom energy */ - if( system->pair_ptr->evflag) + if (system->pair_ptr->evflag) system->pair_ptr->ev_tally(i,i,system->n,1,0.0,en_tmp,0.0,0.0,0.0,0.0); } } diff --git a/src/USER-REAXC/reaxc_torsion_angles.cpp b/src/USER-REAXC/reaxc_torsion_angles.cpp index 9ff70e038d..ed76368d68 100644 --- a/src/USER-REAXC/reaxc_torsion_angles.cpp +++ b/src/USER-REAXC/reaxc_torsion_angles.cpp @@ -438,7 +438,7 @@ void Torsion_Angles( reax_system *system, control_params *control, } /* tally into per-atom virials */ - if( system->pair_ptr->vflag_atom || system->pair_ptr->evflag) { + if (system->pair_ptr->vflag_atom || system->pair_ptr->evflag) { // acquire vectors rvec_ScaledSum( delil, 1., system->my_atoms[l].x, @@ -463,9 +463,9 @@ void Torsion_Angles( reax_system *system, control_params *control, // tally eng_tmp = e_tor + e_con; - if( system->pair_ptr->evflag) + if (system->pair_ptr->evflag) system->pair_ptr->ev_tally(j,k,natoms,1,eng_tmp,0.0,0.0,0.0,0.0,0.0); - if( system->pair_ptr->vflag_atom) + if (system->pair_ptr->vflag_atom) system->pair_ptr->v_tally4(i,j,k,l,fi_tmp,fj_tmp,fk_tmp,delil,deljl,delkl); } } // pl check ends diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp index 648719af4f..54d8b3219c 100644 --- a/src/USER-REAXC/reaxc_traj.cpp +++ b/src/USER-REAXC/reaxc_traj.cpp @@ -341,7 +341,7 @@ int Init_Traj( reax_system *system, control_params *control, out_control->buffer = NULL; /* write trajectory header and atom info, if applicable */ - if( out_control->traj_method == REG_TRAJ) { + if (out_control->traj_method == REG_TRAJ) { if (system->my_rank == MASTER_NODE) out_control->strj = fopen( fname, "w" ); } else { diff --git a/src/USER-REAXC/reaxc_valence_angles.cpp b/src/USER-REAXC/reaxc_valence_angles.cpp index ae9367deff..af1f1f8003 100644 --- a/src/USER-REAXC/reaxc_valence_angles.cpp +++ b/src/USER-REAXC/reaxc_valence_angles.cpp @@ -226,7 +226,7 @@ void Valence_Angles( reax_system *system, control_params *control, ++num_thb_intrs; - if( (j < system->n) && (BOA_jk > 0.0) && + if ((j < system->n) && (BOA_jk > 0.0) && (bo_ij->BO > control->thb_cut) && (bo_jk->BO > control->thb_cut) && (bo_ij->BO * bo_jk->BO > control->thb_cutsq) ) { @@ -373,7 +373,7 @@ void Valence_Angles( reax_system *system, control_params *control, } /* tally into per-atom virials */ - if( system->pair_ptr->vflag_atom || system->pair_ptr->evflag) { + if (system->pair_ptr->vflag_atom || system->pair_ptr->evflag) { /* Acquire vectors */ rvec_ScaledSum( delij, 1., system->my_atoms[i].x, @@ -387,9 +387,9 @@ void Valence_Angles( reax_system *system, control_params *control, eng_tmp = e_ang + e_pen + e_coa; - if( system->pair_ptr->evflag) + if (system->pair_ptr->evflag) system->pair_ptr->ev_tally(j,j,system->N,1,eng_tmp,0.0,0.0,0.0,0.0,0.0); - if( system->pair_ptr->vflag_atom) + if (system->pair_ptr->vflag_atom) system->pair_ptr->v_tally3(i,j,k,fi_tmp,fk_tmp,delij,delkj); } } From 19e12aada5dae0e45b6fc907c1ae1a3062972e66 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 3 Jan 2019 13:44:18 -0500 Subject: [PATCH 87/94] Patch release 4 January 2019 --- doc/src/Manual.txt | 4 ++-- src/version.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/Manual.txt b/doc/src/Manual.txt index bbbc11a1ba..ba88ba732c 100644 --- a/doc/src/Manual.txt +++ b/doc/src/Manual.txt @@ -1,7 +1,7 @@ LAMMPS Users Manual - + @@ -21,7 +21,7 @@ :line LAMMPS Documentation :c,h1 -12 Dec 2018 version :c,h2 +4 Jan 2019 version :c,h2 "What is a LAMMPS version?"_Manual_version.html diff --git a/src/version.h b/src/version.h index 9b4a006f86..4fc3352f65 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "12 Dec 2018" +#define LAMMPS_VERSION "4 Jan 2019" From 7323179de33278b687b17a4e89998f4b9dda8a21 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 3 Jan 2019 17:17:10 -0500 Subject: [PATCH 88/94] rename pair style lebedeva to lebedeva/z to be consistent with kolmolgorov/crespi/z --- doc/src/Commands_pair.txt | 1 + doc/src/lammps.book | 1 + doc/src/pair_ilp_graphene_hbn.txt | 3 ++- doc/src/pair_kolmogorov_crespi_full.txt | 1 + doc/src/pair_kolmogorov_crespi_z.txt | 11 +++++---- ...{pair_lebedeva.txt => pair_lebedeva_z.txt} | 23 ++++++++++-------- doc/src/pair_style.txt | 1 + doc/src/pairs.txt | 1 + examples/USER/misc/lebedeva/2particles.in | 24 +++++++++---------- src/USER-MISC/README | 1 + src/USER-MISC/pair_lebedeva.cpp | 22 ++++++++--------- src/USER-MISC/pair_lebedeva.h | 12 +++++----- 12 files changed, 57 insertions(+), 44 deletions(-) rename doc/src/{pair_lebedeva.txt => pair_lebedeva_z.txt} (69%) diff --git a/doc/src/Commands_pair.txt b/doc/src/Commands_pair.txt index 2691ccaebf..46f4950ad7 100644 --- a/doc/src/Commands_pair.txt +++ b/doc/src/Commands_pair.txt @@ -107,6 +107,7 @@ OPT. "kolmogorov/crespi/full"_pair_kolmogorov_crespi_full.html, "kolmogorov/crespi/z"_pair_kolmogorov_crespi_z.html, "lcbop"_pair_lcbop.html, +"lebedeva/z"_pair_lebedeva_z.html, "lennard/mdf"_pair_mdf.html, "line/lj"_pair_line_lj.html, "list"_pair_list.html, diff --git a/doc/src/lammps.book b/doc/src/lammps.book index d752d2a929..a1bbaf896e 100644 --- a/doc/src/lammps.book +++ b/doc/src/lammps.book @@ -585,6 +585,7 @@ pair_kim.html pair_kolmogorov_crespi_full.html pair_kolmogorov_crespi_z.html pair_lcbop.html +pair_lebedeva_z.html pair_line_lj.html pair_list.html pair_lj.html diff --git a/doc/src/pair_ilp_graphene_hbn.txt b/doc/src/pair_ilp_graphene_hbn.txt index a8d74dca0f..76dda14ec6 100644 --- a/doc/src/pair_ilp_graphene_hbn.txt +++ b/doc/src/pair_ilp_graphene_hbn.txt @@ -10,7 +10,7 @@ pair_style ilp/graphene/hbn command :h3 [Syntax:] -pair_style hybrid/overlay ilp/graphene/hbn cutoff tap_flag :pre +pair_style \[hybrid/overlay ...\] ilp/graphene/hbn cutoff tap_flag :pre cutoff = global cutoff (distance units) tap_flag = 0/1 to turn off/on the taper function @@ -110,6 +110,7 @@ units, if your simulation does not use {metal} units. "pair_style hybrid/overlay"_pair_hybrid.html, "pair_style pair_kolmogorov_crespi_z"_pair_kolmogorov_crespi_z.html, "pair_style pair_kolmogorov_crespi_full"_pair_kolmogorov_crespi_full.html, +"pair_style pair_lebedeva_z"_pair_lebedeva_z.html, "pair_style pair_coul_shield"_pair_coul_shield.html. [Default:] tap_flag = 1 diff --git a/doc/src/pair_kolmogorov_crespi_full.txt b/doc/src/pair_kolmogorov_crespi_full.txt index a13825abe5..6d76a24bdb 100644 --- a/doc/src/pair_kolmogorov_crespi_full.txt +++ b/doc/src/pair_kolmogorov_crespi_full.txt @@ -100,6 +100,7 @@ units. "pair_coeff"_pair_coeff.html, "pair_none"_pair_none.html, "pair_style hybrid/overlay"_pair_hybrid.html, +"pair_style pair_lebedeva_z"_pair_lebedeva_z.html, "pair_style kolmogorov/crespi/z"_pair_kolmogorov_crespi_z.html, "pair_style ilp/graphene/hbn"_pair_ilp_graphene_hbn.html. diff --git a/doc/src/pair_kolmogorov_crespi_z.txt b/doc/src/pair_kolmogorov_crespi_z.txt index a494c927b8..aabb3460e7 100644 --- a/doc/src/pair_kolmogorov_crespi_z.txt +++ b/doc/src/pair_kolmogorov_crespi_z.txt @@ -10,7 +10,7 @@ pair_style kolmogorov/crespi/z command :h3 [Syntax:] -pair_style hybrid/overlay kolmogorov/crespi/z cutoff :pre +pair_style \[hybrid/overlay ...\] kolmogorov/crespi/z cutoff :pre [Examples:] @@ -56,9 +56,12 @@ package"_Build_package.html doc page for more info. [Related commands:] -"pair_coeff"_pair_coeff.html -"pair_none"_pair_none.html -"pair_style hybrid/overlay"_pair_hybrid.html +"pair_coeff"_pair_coeff.html, +"pair_none"_pair_none.html, +"pair_style hybrid/overlay"_pair_hybrid.html, +"pair_style ilp/graphene/hbn"_pair_ilp_graphene_hbn.html. +"pair_style kolmogorov/crespi/full"_pair_kolmogorov_crespi_full.html, +"pair_style lebedeva/z"_pair_lebedeva_z.html [Default:] none diff --git a/doc/src/pair_lebedeva.txt b/doc/src/pair_lebedeva_z.txt similarity index 69% rename from doc/src/pair_lebedeva.txt rename to doc/src/pair_lebedeva_z.txt index 6b9eabc611..9eab56d0d9 100644 --- a/doc/src/pair_lebedeva.txt +++ b/doc/src/pair_lebedeva_z.txt @@ -6,25 +6,25 @@ :line -pair_style lebedeva command :h3 +pair_style lebedeva/z command :h3 [Syntax:] -pair_style hybrid/overlay lebedeva cutoff :pre +pair_style \[hybrid/overlay ...\] lebedeva/z cutoff :pre [Examples:] -pair_style hybrid/overlay lebedeva 20.0 +pair_style hybrid/overlay lebedeva/z 20.0 pair_coeff * * none -pair_coeff 1 2 lebedeva CC.Lebedeva C C :pre +pair_coeff 1 2 lebedeva/z CC.Lebedeva C C :pre -pair_style hybrid/overlay rebo lebedeva 14.0 +pair_style hybrid/overlay rebo lebedeva/z 14.0 pair_coeff * * rebo CH.airebo C C -pair_coeff 1 2 lebedeva CC.Lebedeva C C :pre +pair_coeff 1 2 lebedeva/z CC.Lebedeva C C :pre [Description:] -The {lebedeva} style computes the Lebedeva interaction +The {lebedeva/z} style computes the Lebedeva interaction potential as described in "(Lebedeva et al.)"_#Leb01. An important simplification is made, which is to take all normals along the z-axis. @@ -50,9 +50,12 @@ package"_Build_package.html doc page for more info. [Related commands:] -"pair_coeff"_pair_coeff.html -"pair_none"_pair_none.html -"pair_style hybrid/overlay"_pair_hybrid.html +"pair_coeff"_pair_coeff.html, +"pair_style none"_pair_none.html, +"pair_style hybrid/overlay"_pair_hybrid.html, +"pair_style ilp/graphene/hbd"_pair_ilp_graphene_hbn.html, +"pair_style kolmogorov/crespi/z"_pair_kolmogorov_crespi_z.html, +"pair_style kolmogorov/crespi/full"_pair_kolmogorov_crespi_full.html. [Default:] none diff --git a/doc/src/pair_style.txt b/doc/src/pair_style.txt index ea746f8943..714ec55d2e 100644 --- a/doc/src/pair_style.txt +++ b/doc/src/pair_style.txt @@ -174,6 +174,7 @@ accelerated styles exist. "kolmogorov/crespi/full"_pair_kolmogorov_crespi_full.html - Kolmogorov-Crespi (KC) potential with no simplifications "kolmogorov/crespi/z"_pair_kolmogorov_crespi_z.html - Kolmogorov-Crespi (KC) potential with normals along z-axis "lcbop"_pair_lcbop.html - long-range bond-order potential (LCBOP) +"lebedeva/z"_pair_lebedeva_z.html - Lebedeva inter-layer potential for graphene with normals along z-axis "lennard/mdf"_pair_mdf.html - LJ potential in A/B form with a taper function "line/lj"_pair_line_lj.html - LJ potential between line segments "list"_pair_list.html - potential between pairs of atoms explicitly listed in an input file diff --git a/doc/src/pairs.txt b/doc/src/pairs.txt index 7a7ad86d0d..2810252402 100644 --- a/doc/src/pairs.txt +++ b/doc/src/pairs.txt @@ -50,6 +50,7 @@ Pair Styles :h1 pair_kolmogorov_crespi_full pair_kolmogorov_crespi_z pair_lcbop + pair_lebedeva_z pair_line_lj pair_list pair_lj diff --git a/examples/USER/misc/lebedeva/2particles.in b/examples/USER/misc/lebedeva/2particles.in index 2a9851f383..81cca2e473 100644 --- a/examples/USER/misc/lebedeva/2particles.in +++ b/examples/USER/misc/lebedeva/2particles.in @@ -1,4 +1,4 @@ -# After running LAMMPS with this input script a number of dump files is created. +# After running LAMMPS with this input script a number of dump files is created. # To extract the data from there I used grep script: # grep '^2 ' *cfg > LammpsResult.dat # After that after removing some text from LammpsResult.dat, @@ -8,17 +8,17 @@ # Email: softquake@gmail.com -# ---------- Start simulation --------------------- +# ---------- Start simulation --------------------- clear -units metal -dimension 3 -boundary f f f -atom_style atomic +units metal +dimension 3 +boundary f f f +atom_style atomic # ========================== Create Atomistic Structure =========================== region whole block 0 20 0 20 0 10 -create_box 2 whole +create_box 2 whole read_data 2particles.dat add append @@ -27,22 +27,22 @@ group graphite type 1 2 group graphene1 type 1 group graphene2 type 2 -pair_style hybrid/overlay lebedeva 20 +pair_style hybrid/overlay lebedeva/z 20 pair_coeff * * none -pair_coeff 1 2 lebedeva CC.Lebedeva C C +pair_coeff 1 2 lebedeva/z CC.Lebedeva C C mass 1 12.01 # Carbon mass 2 12.01 # Carbon -neighbor 0.3 bin -neigh_modify delay 1 check yes +neighbor 0.3 bin +neigh_modify delay 1 check yes compute peratom all pe/atom dump 1 all custom 1 dump_lebedeva_*.cfg id x y z c_peratom fx fy fz dump_modify 1 pad 3 -thermo 10 +thermo 10 thermo_style custom step pe press temp thermo_modify lost ignore diff --git a/src/USER-MISC/README b/src/USER-MISC/README index cf948df233..13e406d42f 100644 --- a/src/USER-MISC/README +++ b/src/USER-MISC/README @@ -71,6 +71,7 @@ pair_style dipole/sf, Mario Orsi, orsimario at gmail.com, 8 Aug 11 pair_style edip, Luca Ferraro, luca.ferraro at caspur.it, 15 Sep 11 pair_style extep, Jaap Kroes (Radboud U), jaapkroes at gmail dot com, 28 Nov 17 pair_style gauss/cut, Axel Kohlmeyer, akohlmey at gmail.com, 1 Dec 11 +pair_style lebedeva/z, Zbigniew Koziol (National Center for Nuclear Research), softquake at gmail dot com, 4 Jan 19 pair_style lennard/mdf, Paolo Raiteri, p.raiteri at curtin.edu.au, 2 Dec 15 pair_style list, Axel Kohlmeyer (Temple U), akohlmey at gmail.com, 1 Jun 13 pair_style lj/mdf, Paolo Raiteri, p.raiteri at curtin.edu.au, 2 Dec 15 diff --git a/src/USER-MISC/pair_lebedeva.cpp b/src/USER-MISC/pair_lebedeva.cpp index 16305e84cd..b7773c80b0 100644 --- a/src/USER-MISC/pair_lebedeva.cpp +++ b/src/USER-MISC/pair_lebedeva.cpp @@ -17,7 +17,7 @@ e-mail: softquake at gmail dot com Writing this was based on C code of Kolmogorov-Crespi potential of Jaap Kroes and others. - + This is potential described in [Lebedeva et al., Physica E, 44(6), 949-954, 2012.] ------------------------------------------------------------------------- */ @@ -41,7 +41,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -PairLebedeva::PairLebedeva(LAMMPS *lmp) : Pair(lmp) +PairLebedevaZ::PairLebedevaZ(LAMMPS *lmp) : Pair(lmp) { single_enable = 0; @@ -59,7 +59,7 @@ PairLebedeva::PairLebedeva(LAMMPS *lmp) : Pair(lmp) /* ---------------------------------------------------------------------- */ -PairLebedeva::~PairLebedeva() +PairLebedevaZ::~PairLebedevaZ() { if (allocated) { memory->destroy(setflag); @@ -78,7 +78,7 @@ PairLebedeva::~PairLebedeva() /* ---------------------------------------------------------------------- */ -void PairLebedeva::compute(int eflag, int vflag) +void PairLebedevaZ::compute(int eflag, int vflag) { int i,j,ii,jj,inum,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair,der; @@ -122,7 +122,7 @@ void PairLebedeva::compute(int eflag, int vflag) rhosq = delx*delx + dely*dely; rho = sqrt(rhosq); rsq = rhosq + delz*delz; - + if (rsq < cutsq[itype][jtype]) { int iparam_ij = elem2param[map[itype]][map[jtype]]; @@ -173,7 +173,7 @@ void PairLebedeva::compute(int eflag, int vflag) allocate all arrays ------------------------------------------------------------------------- */ -void PairLebedeva::allocate() +void PairLebedevaZ::allocate() { allocated = 1; int n = atom->ntypes; @@ -193,7 +193,7 @@ void PairLebedeva::allocate() global settings ------------------------------------------------------------------------- */ -void PairLebedeva::settings(int narg, char **arg) +void PairLebedevaZ::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); if (strcmp(force->pair_style,"hybrid/overlay")!=0) @@ -215,7 +215,7 @@ void PairLebedeva::settings(int narg, char **arg) set coeffs for one or more type pairs ------------------------------------------------------------------------- */ -void PairLebedeva::coeff(int narg, char **arg) +void PairLebedevaZ::coeff(int narg, char **arg) { int i,j,n; @@ -258,7 +258,7 @@ void PairLebedeva::coeff(int narg, char **arg) read_file(arg[2]); - + double cut_one = cut_global; int count = 0; @@ -278,7 +278,7 @@ void PairLebedeva::coeff(int narg, char **arg) init for one type pair i,j and corresponding j,i ------------------------------------------------------------------------- */ -double PairLebedeva::init_one(int i, int j) +double PairLebedevaZ::init_one(int i, int j) { if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); @@ -296,7 +296,7 @@ double PairLebedeva::init_one(int i, int j) read Lebedeva potential file ------------------------------------------------------------------------- */ -void PairLebedeva::read_file(char *filename) +void PairLebedevaZ::read_file(char *filename) { int params_per_line = 12; char **words = new char*[params_per_line+1]; diff --git a/src/USER-MISC/pair_lebedeva.h b/src/USER-MISC/pair_lebedeva.h index 66e759d202..ae229e0541 100644 --- a/src/USER-MISC/pair_lebedeva.h +++ b/src/USER-MISC/pair_lebedeva.h @@ -13,21 +13,21 @@ #ifdef PAIR_CLASS -PairStyle(lebedeva,PairLebedeva) +PairStyle(lebedeva/z,PairLebedevaZ) #else -#ifndef LMP_PAIR_LEBEDEVA_H -#define LMP_PAIR_LEBEDEVA_H +#ifndef LMP_PAIR_LEBEDEVA_Z_H +#define LMP_PAIR_LEBEDEVA_Z_H #include "pair.h" namespace LAMMPS_NS { -class PairLebedeva : public Pair { +class PairLebedevaZ : public Pair { public: - PairLebedeva(class LAMMPS *); - virtual ~PairLebedeva(); + PairLebedevaZ(class LAMMPS *); + virtual ~PairLebedevaZ(); virtual void compute(int, int); void settings(int, char **); From 0cc9a445e8697b5130a8d872dfc61ff11b3b34d9 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 4 Jan 2019 17:09:11 -0700 Subject: [PATCH 89/94] add parallel dump file info to rerun doc page --- doc/src/rerun.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/src/rerun.txt b/doc/src/rerun.txt index 2b893eff1f..3d5cdfff3c 100644 --- a/doc/src/rerun.txt +++ b/doc/src/rerun.txt @@ -107,6 +107,14 @@ However if you specify a series of dump files in an incorrect order (with respect to the timesteps they contain), you may skip large numbers of snapshots +Note that the dump files specified as part of the {dump} keyword can +be parallel files, i.e. written as multiple files either per processor +and/or per snapshot. If that is the case they will also be read in +parallel which can make the rerun command operate dramatically faster +for large systems. See the doc page for the "read_dump"_read_dump and +"dump"_dump.html commands which describe how to read and write +parallel dump files. + The {first}, {last}, {every}, {skip} keywords determine which snapshots are read from the dump file(s). Snapshots are skipped until they have a timestamp >= {Nfirst}. When a snapshot with a timestamp > From 9ae84bc3677d720461725f3b0ca65925f68a520e Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sun, 6 Jan 2019 17:07:35 -0700 Subject: [PATCH 90/94] bond/react: check template for topology overflow --- src/USER-MISC/fix_bond_react.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/USER-MISC/fix_bond_react.cpp b/src/USER-MISC/fix_bond_react.cpp index b9a8d58c41..45dccba868 100644 --- a/src/USER-MISC/fix_bond_react.cpp +++ b/src/USER-MISC/fix_bond_react.cpp @@ -290,6 +290,8 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : open(files[i]); onemol = atom->molecules[unreacted_mol[i]]; twomol = atom->molecules[reacted_mol[i]]; + onemol->check_attributes(0); + twomol->check_attributes(0); if (onemol->natoms != twomol->natoms) error->all(FLERR,"Post-reacted template must contain the same " "number of atoms as the pre-reacted template"); From 98e0d6eab20b8ede722bab26bbf0a02ca3d36241 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 6 Jan 2019 21:42:08 -0500 Subject: [PATCH 91/94] rename sources for pair style lebedeva to be consistent with style name --- src/Purge.list | 3 + ...{pair_lebedeva.cpp => pair_lebedeva_z.cpp} | 872 +++++++++--------- .../{pair_lebedeva.h => pair_lebedeva_z.h} | 166 ++-- 3 files changed, 522 insertions(+), 519 deletions(-) rename src/USER-MISC/{pair_lebedeva.cpp => pair_lebedeva_z.cpp} (95%) rename src/USER-MISC/{pair_lebedeva.h => pair_lebedeva_z.h} (96%) diff --git a/src/Purge.list b/src/Purge.list index 8ea084960e..4eea4cb950 100644 --- a/src/Purge.list +++ b/src/Purge.list @@ -24,6 +24,9 @@ style_nstencil.h style_ntopo.h # other auto-generated files lmpinstalledpkgs.h +# renamed on 7 January 2019 +pair_lebedeva.cpp +pair_lebedeva.h # removed on 12 December 2018 pair_reax.cpp pair_reax.h diff --git a/src/USER-MISC/pair_lebedeva.cpp b/src/USER-MISC/pair_lebedeva_z.cpp similarity index 95% rename from src/USER-MISC/pair_lebedeva.cpp rename to src/USER-MISC/pair_lebedeva_z.cpp index b7773c80b0..be9adb993d 100644 --- a/src/USER-MISC/pair_lebedeva.cpp +++ b/src/USER-MISC/pair_lebedeva_z.cpp @@ -1,436 +1,436 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -/* ---------------------------------------------------------------------- - Contributing author: Zbigniew Koziol - (National Center for Nuclear Research, Poland) - e-mail: softquake at gmail dot com - Writing this was based on C code of Kolmogorov-Crespi potential - of Jaap Kroes and others. - - This is potential described in - [Lebedeva et al., Physica E, 44(6), 949-954, 2012.] -------------------------------------------------------------------------- */ - -#include -#include -#include -#include -#include "pair_lebedeva.h" -#include "atom.h" -#include "comm.h" -#include "force.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" - -using namespace LAMMPS_NS; - -#define MAXLINE 1024 -#define DELTA 4 - -/* ---------------------------------------------------------------------- */ - -PairLebedevaZ::PairLebedevaZ(LAMMPS *lmp) : Pair(lmp) -{ - single_enable = 0; - - // initialize element to parameter maps - nelements = 0; - elements = NULL; - nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; - - // always compute energy offset - offset_flag = 1; -} - -/* ---------------------------------------------------------------------- */ - -PairLebedevaZ::~PairLebedevaZ() -{ - if (allocated) { - memory->destroy(setflag); - memory->destroy(cutsq); - memory->destroy(cut); - memory->destroy(offset); - } - - if (elements) - for (int i = 0; i < nelements; i++) delete [] elements[i]; - delete [] elements; - memory->destroy(params); - memory->destroy(elem2param); - if (allocated) delete [] map; -} - -/* ---------------------------------------------------------------------- */ - -void PairLebedevaZ::compute(int eflag, int vflag) -{ - int i,j,ii,jj,inum,jnum,itype,jtype; - double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair,der; - double rsq,r,rhosq,rho,exp1,exp2,exp3,r6,r8; - double frho,sumD,Ulm,fxy,fz,rdsq; - int *ilist,*jlist,*numneigh,**firstneigh; - - evdwl = 0.0; - if (eflag || vflag) ev_setup(eflag,vflag); - else evflag = vflag_fdotr = 0; - - double **x = atom->x; - double **f = atom->f; - int *type = atom->type; - int nlocal = atom->nlocal; - int newton_pair = force->newton_pair; - - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - firstneigh = list->firstneigh; - - // loop over neighbors of my atoms - for (ii = 0; ii < inum; ii++) { - i = ilist[ii]; - xtmp = x[i][0]; - ytmp = x[i][1]; - ztmp = x[i][2]; - itype = type[i]; - jlist = firstneigh[i]; - jnum = numneigh[i]; - for (jj = 0; jj < jnum; jj++) { - j = jlist[jj]; - j &= NEIGHMASK; - jtype = type[j]; - - delx = xtmp - x[j][0]; - dely = ytmp - x[j][1]; - delz = ztmp - x[j][2]; - // rho^2 = r^2 - z^2 - rhosq = delx*delx + dely*dely; - rho = sqrt(rhosq); - rsq = rhosq + delz*delz; - - if (rsq < cutsq[itype][jtype]) { - - int iparam_ij = elem2param[map[itype]][map[jtype]]; - Param& p = params[iparam_ij]; - - r = sqrt(rsq); - r6 = rsq*rsq*rsq; - r8 = r6*rsq; - - // store exponents - exp1 = exp(-p.alpha*(r-p.z0)); - exp2 = exp(-p.lambda1*rhosq); - exp3 = exp(-p.lambda2*(delz*delz-p.z02)); - sumD = 1+p.D1*rhosq+p.D2*rhosq*rhosq; - Ulm = -p.A*p.z06/r6+ p.B*exp1+p.C*sumD*exp2*exp3; - - // derivatives - fpair = -6.0*p.A*p.z06/r8+p.B*p.alpha*exp1/r; // used for x,y,z - der = p.D1+2*p.D2*rhosq-p.lambda1*sumD; // used for x,y - fxy = fpair - 2*p.C*exp2*exp3*der; - fz = fpair + 2*p.C*p.lambda2*sumD*exp2*exp3; - - f[i][0] += delx*fxy; - f[i][1] += dely*fxy; - f[i][2] += delz*fz; - if (newton_pair || j < nlocal) { - f[j][0] -= delx*fxy; - f[j][1] -= dely*fxy; - f[j][2] -= delz*fz; - } - - if (eflag) { - evdwl = Ulm - offset[itype][jtype]; - } - - if (evflag){ - ev_tally_xyz(i,j,nlocal,newton_pair,evdwl,0, - -fxy,-fxy,-fz,delx,dely,delz); - } - } - } - } - - if (vflag_fdotr) virial_fdotr_compute(); -} - -/* ---------------------------------------------------------------------- - allocate all arrays -------------------------------------------------------------------------- */ - -void PairLebedevaZ::allocate() -{ - allocated = 1; - int n = atom->ntypes; - - memory->create(setflag,n+1,n+1,"pair:setflag"); - for (int i = 1; i <= n; i++) - for (int j = i; j <= n; j++) - setflag[i][j] = 0; - - memory->create(cutsq,n+1,n+1,"pair:cutsq"); - memory->create(cut,n+1,n+1,"pair:cut"); - memory->create(offset,n+1,n+1,"pair:offset"); - map = new int[atom->ntypes+1]; -} - -/* ---------------------------------------------------------------------- - global settings -------------------------------------------------------------------------- */ - -void PairLebedevaZ::settings(int narg, char **arg) -{ - if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - if (strcmp(force->pair_style,"hybrid/overlay")!=0) - error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); - - cut_global = force->numeric(FLERR,arg[0]); - - // reset cutoffs that have been explicitly set - - if (allocated) { - int i,j; - for (i = 1; i <= atom->ntypes; i++) - for (j = i; j <= atom->ntypes; j++) - if (setflag[i][j]) cut[i][j] = cut_global; - } -} - -/* ---------------------------------------------------------------------- - set coeffs for one or more type pairs -------------------------------------------------------------------------- */ - -void PairLebedevaZ::coeff(int narg, char **arg) -{ - int i,j,n; - - if (narg != 3 + atom->ntypes) - error->all(FLERR,"Incorrect args for pair coefficients"); - if (!allocated) allocate(); - - int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); - - // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL - // nelements = # of unique elements - // elements = list of element names - - if (elements) { - for (i = 0; i < nelements; i++) delete [] elements[i]; - delete [] elements; - } - elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; - - nelements = 0; - for (i = 3; i < narg; i++) { - if (strcmp(arg[i],"NULL") == 0) { - map[i-2] = -1; - continue; - } - for (j = 0; j < nelements; j++) - if (strcmp(arg[i],elements[j]) == 0) break; - map[i-2] = j; - if (j == nelements) { - n = strlen(arg[i]) + 1; - elements[j] = new char[n]; - strcpy(elements[j],arg[i]); - nelements++; - } - } - - - read_file(arg[2]); - - double cut_one = cut_global; - - int count = 0; - for (int i = ilo; i <= ihi; i++) { - for (int j = MAX(jlo,i); j <= jhi; j++) { - cut[i][j] = cut_one; - setflag[i][j] = 1; - count++; - } - } - - if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); -} - - -/* ---------------------------------------------------------------------- - init for one type pair i,j and corresponding j,i -------------------------------------------------------------------------- */ - -double PairLebedevaZ::init_one(int i, int j) -{ - if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); - - if (offset_flag && (cut[i][j] > 0.0)) { - int iparam_ij = elem2param[map[i]][map[j]]; - Param& p = params[iparam_ij]; - offset[i][j] = -p.A*pow(p.z0/cut[i][j],6); - } else offset[i][j] = 0.0; - offset[j][i] = offset[i][j]; - - return cut[i][j]; -} - -/* ---------------------------------------------------------------------- - read Lebedeva potential file -------------------------------------------------------------------------- */ - -void PairLebedevaZ::read_file(char *filename) -{ - int params_per_line = 12; - char **words = new char*[params_per_line+1]; - memory->sfree(params); - params = NULL; - nparams = maxparam = 0; - - // open file on proc 0 - - FILE *fp; - if (comm->me == 0) { - fp = force->open_potential(filename); - if (fp == NULL) { - char str[128]; - sprintf(str,"Cannot open Lebedeva potential file %s",filename); - error->one(FLERR,str); - } - } - - // read each line out of file, skipping blank lines or leading '#' - // store line of params if all 3 element tags are in element list - - int i,j,n,m,nwords,ielement,jelement; - char line[MAXLINE],*ptr; - int eof = 0; - - while (1) { - if (comm->me == 0) { - ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { - eof = 1; - fclose(fp); - } else n = strlen(line) + 1; - } - MPI_Bcast(&eof,1,MPI_INT,0,world); - if (eof) break; - MPI_Bcast(&n,1,MPI_INT,0,world); - MPI_Bcast(line,n,MPI_CHAR,0,world); - - // strip comment, skip line if blank - - if ((ptr = strchr(line,'#'))) *ptr = '\0'; - nwords = atom->count_words(line); - if (nwords == 0) continue; - - // concatenate additional lines until have params_per_line words - - while (nwords < params_per_line) { - n = strlen(line); - if (comm->me == 0) { - ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { - eof = 1; - fclose(fp); - } else n = strlen(line) + 1; - } - MPI_Bcast(&eof,1,MPI_INT,0,world); - if (eof) break; - MPI_Bcast(&n,1,MPI_INT,0,world); - MPI_Bcast(line,n,MPI_CHAR,0,world); - if ((ptr = strchr(line,'#'))) *ptr = '\0'; - nwords = atom->count_words(line); - } - - if (nwords != params_per_line) - error->all(FLERR,"Insufficient format in Lebedeva potential file"); - - // words = ptrs to all words in line - - nwords = 0; - words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; - - // ielement,jelement = 1st args - // if these 2 args are in element list, then parse this line - // else skip to next line (continue) - - for (ielement = 0; ielement < nelements; ielement++) - if (strcmp(words[0],elements[ielement]) == 0) break; - if (ielement == nelements) continue; - for (jelement = 0; jelement < nelements; jelement++) - if (strcmp(words[1],elements[jelement]) == 0) break; - if (jelement == nelements) continue; - - // load up parameter settings and error check their values - - if (nparams == maxparam) { - maxparam += DELTA; - params = (Param *) memory->srealloc(params,maxparam*sizeof(Param), - "pair:params"); - } - params[nparams].ielement = ielement; - params[nparams].jelement = jelement; - params[nparams].A = atof(words[2]); - params[nparams].B = atof(words[3]); - params[nparams].C = atof(words[4]); - params[nparams].z0 = atof(words[5]); - params[nparams].alpha = atof(words[6]); - params[nparams].D1 = atof(words[7]); - params[nparams].D2 = atof(words[8]); - params[nparams].lambda1 = atof(words[9]); - params[nparams].lambda2 = atof(words[10]); - // S provides a convenient scaling of all energies - params[nparams].S = atof(words[11]); - - // energies in meV further scaled by S - double meV = 1.0e-3*params[nparams].S; - params[nparams].A *= meV; - params[nparams].B *= meV; - params[nparams].C *= meV; - - // precompute some quantities. That speeds up later process - params[nparams].z02 = pow(params[nparams].z0,2); - params[nparams].z06 = pow(params[nparams].z0,6); - - nparams++; - if(nparams >= pow(atom->ntypes,3)) break; - } - memory->destroy(elem2param); - memory->create(elem2param,nelements,nelements,"pair:elem2param"); - for (i = 0; i < nelements; i++) { - for (j = 0; j < nelements; j++) { - n = -1; - for (m = 0; m < nparams; m++) { - if (i == params[m].ielement && j == params[m].jelement) { - if (n >= 0) error->all(FLERR,"Potential file has duplicate entry"); - n = m; - } - } - if (n < 0) error->all(FLERR,"Potential file is missing an entry"); - elem2param[i][j] = n; - } - } - delete [] words; -} - -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Zbigniew Koziol + (National Center for Nuclear Research, Poland) + e-mail: softquake at gmail dot com + Writing this was based on C code of Kolmogorov-Crespi potential + of Jaap Kroes and others. + + This is potential described in + [Lebedeva et al., Physica E, 44(6), 949-954, 2012.] +------------------------------------------------------------------------- */ + +#include +#include +#include +#include +#include "pair_lebedeva_z.h" +#include "atom.h" +#include "comm.h" +#include "force.h" +#include "neigh_list.h" +#include "memory.h" +#include "error.h" + +using namespace LAMMPS_NS; + +#define MAXLINE 1024 +#define DELTA 4 + +/* ---------------------------------------------------------------------- */ + +PairLebedevaZ::PairLebedevaZ(LAMMPS *lmp) : Pair(lmp) +{ + single_enable = 0; + + // initialize element to parameter maps + nelements = 0; + elements = NULL; + nparams = maxparam = 0; + params = NULL; + elem2param = NULL; + map = NULL; + + // always compute energy offset + offset_flag = 1; +} + +/* ---------------------------------------------------------------------- */ + +PairLebedevaZ::~PairLebedevaZ() +{ + if (allocated) { + memory->destroy(setflag); + memory->destroy(cutsq); + memory->destroy(cut); + memory->destroy(offset); + } + + if (elements) + for (int i = 0; i < nelements; i++) delete [] elements[i]; + delete [] elements; + memory->destroy(params); + memory->destroy(elem2param); + if (allocated) delete [] map; +} + +/* ---------------------------------------------------------------------- */ + +void PairLebedevaZ::compute(int eflag, int vflag) +{ + int i,j,ii,jj,inum,jnum,itype,jtype; + double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair,der; + double rsq,r,rhosq,rho,exp1,exp2,exp3,r6,r8; + double frho,sumD,Ulm,fxy,fz,rdsq; + int *ilist,*jlist,*numneigh,**firstneigh; + + evdwl = 0.0; + if (eflag || vflag) ev_setup(eflag,vflag); + else evflag = vflag_fdotr = 0; + + double **x = atom->x; + double **f = atom->f; + int *type = atom->type; + int nlocal = atom->nlocal; + int newton_pair = force->newton_pair; + + inum = list->inum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + + // loop over neighbors of my atoms + for (ii = 0; ii < inum; ii++) { + i = ilist[ii]; + xtmp = x[i][0]; + ytmp = x[i][1]; + ztmp = x[i][2]; + itype = type[i]; + jlist = firstneigh[i]; + jnum = numneigh[i]; + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + j &= NEIGHMASK; + jtype = type[j]; + + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + // rho^2 = r^2 - z^2 + rhosq = delx*delx + dely*dely; + rho = sqrt(rhosq); + rsq = rhosq + delz*delz; + + if (rsq < cutsq[itype][jtype]) { + + int iparam_ij = elem2param[map[itype]][map[jtype]]; + Param& p = params[iparam_ij]; + + r = sqrt(rsq); + r6 = rsq*rsq*rsq; + r8 = r6*rsq; + + // store exponents + exp1 = exp(-p.alpha*(r-p.z0)); + exp2 = exp(-p.lambda1*rhosq); + exp3 = exp(-p.lambda2*(delz*delz-p.z02)); + sumD = 1+p.D1*rhosq+p.D2*rhosq*rhosq; + Ulm = -p.A*p.z06/r6+ p.B*exp1+p.C*sumD*exp2*exp3; + + // derivatives + fpair = -6.0*p.A*p.z06/r8+p.B*p.alpha*exp1/r; // used for x,y,z + der = p.D1+2*p.D2*rhosq-p.lambda1*sumD; // used for x,y + fxy = fpair - 2*p.C*exp2*exp3*der; + fz = fpair + 2*p.C*p.lambda2*sumD*exp2*exp3; + + f[i][0] += delx*fxy; + f[i][1] += dely*fxy; + f[i][2] += delz*fz; + if (newton_pair || j < nlocal) { + f[j][0] -= delx*fxy; + f[j][1] -= dely*fxy; + f[j][2] -= delz*fz; + } + + if (eflag) { + evdwl = Ulm - offset[itype][jtype]; + } + + if (evflag){ + ev_tally_xyz(i,j,nlocal,newton_pair,evdwl,0, + -fxy,-fxy,-fz,delx,dely,delz); + } + } + } + } + + if (vflag_fdotr) virial_fdotr_compute(); +} + +/* ---------------------------------------------------------------------- + allocate all arrays +------------------------------------------------------------------------- */ + +void PairLebedevaZ::allocate() +{ + allocated = 1; + int n = atom->ntypes; + + memory->create(setflag,n+1,n+1,"pair:setflag"); + for (int i = 1; i <= n; i++) + for (int j = i; j <= n; j++) + setflag[i][j] = 0; + + memory->create(cutsq,n+1,n+1,"pair:cutsq"); + memory->create(cut,n+1,n+1,"pair:cut"); + memory->create(offset,n+1,n+1,"pair:offset"); + map = new int[atom->ntypes+1]; +} + +/* ---------------------------------------------------------------------- + global settings +------------------------------------------------------------------------- */ + +void PairLebedevaZ::settings(int narg, char **arg) +{ + if (narg != 1) error->all(FLERR,"Illegal pair_style command"); + if (strcmp(force->pair_style,"hybrid/overlay")!=0) + error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); + + cut_global = force->numeric(FLERR,arg[0]); + + // reset cutoffs that have been explicitly set + + if (allocated) { + int i,j; + for (i = 1; i <= atom->ntypes; i++) + for (j = i; j <= atom->ntypes; j++) + if (setflag[i][j]) cut[i][j] = cut_global; + } +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more type pairs +------------------------------------------------------------------------- */ + +void PairLebedevaZ::coeff(int narg, char **arg) +{ + int i,j,n; + + if (narg != 3 + atom->ntypes) + error->all(FLERR,"Incorrect args for pair coefficients"); + if (!allocated) allocate(); + + int ilo,ihi,jlo,jhi; + force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); + force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + + // read args that map atom types to elements in potential file + // map[i] = which element the Ith atom type is, -1 if NULL + // nelements = # of unique elements + // elements = list of element names + + if (elements) { + for (i = 0; i < nelements; i++) delete [] elements[i]; + delete [] elements; + } + elements = new char*[atom->ntypes]; + for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + + nelements = 0; + for (i = 3; i < narg; i++) { + if (strcmp(arg[i],"NULL") == 0) { + map[i-2] = -1; + continue; + } + for (j = 0; j < nelements; j++) + if (strcmp(arg[i],elements[j]) == 0) break; + map[i-2] = j; + if (j == nelements) { + n = strlen(arg[i]) + 1; + elements[j] = new char[n]; + strcpy(elements[j],arg[i]); + nelements++; + } + } + + + read_file(arg[2]); + + double cut_one = cut_global; + + int count = 0; + for (int i = ilo; i <= ihi; i++) { + for (int j = MAX(jlo,i); j <= jhi; j++) { + cut[i][j] = cut_one; + setflag[i][j] = 1; + count++; + } + } + + if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); +} + + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +double PairLebedevaZ::init_one(int i, int j) +{ + if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); + + if (offset_flag && (cut[i][j] > 0.0)) { + int iparam_ij = elem2param[map[i]][map[j]]; + Param& p = params[iparam_ij]; + offset[i][j] = -p.A*pow(p.z0/cut[i][j],6); + } else offset[i][j] = 0.0; + offset[j][i] = offset[i][j]; + + return cut[i][j]; +} + +/* ---------------------------------------------------------------------- + read Lebedeva potential file +------------------------------------------------------------------------- */ + +void PairLebedevaZ::read_file(char *filename) +{ + int params_per_line = 12; + char **words = new char*[params_per_line+1]; + memory->sfree(params); + params = NULL; + nparams = maxparam = 0; + + // open file on proc 0 + + FILE *fp; + if (comm->me == 0) { + fp = force->open_potential(filename); + if (fp == NULL) { + char str[128]; + sprintf(str,"Cannot open Lebedeva potential file %s",filename); + error->one(FLERR,str); + } + } + + // read each line out of file, skipping blank lines or leading '#' + // store line of params if all 3 element tags are in element list + + int i,j,n,m,nwords,ielement,jelement; + char line[MAXLINE],*ptr; + int eof = 0; + + while (1) { + if (comm->me == 0) { + ptr = fgets(line,MAXLINE,fp); + if (ptr == NULL) { + eof = 1; + fclose(fp); + } else n = strlen(line) + 1; + } + MPI_Bcast(&eof,1,MPI_INT,0,world); + if (eof) break; + MPI_Bcast(&n,1,MPI_INT,0,world); + MPI_Bcast(line,n,MPI_CHAR,0,world); + + // strip comment, skip line if blank + + if ((ptr = strchr(line,'#'))) *ptr = '\0'; + nwords = atom->count_words(line); + if (nwords == 0) continue; + + // concatenate additional lines until have params_per_line words + + while (nwords < params_per_line) { + n = strlen(line); + if (comm->me == 0) { + ptr = fgets(&line[n],MAXLINE-n,fp); + if (ptr == NULL) { + eof = 1; + fclose(fp); + } else n = strlen(line) + 1; + } + MPI_Bcast(&eof,1,MPI_INT,0,world); + if (eof) break; + MPI_Bcast(&n,1,MPI_INT,0,world); + MPI_Bcast(line,n,MPI_CHAR,0,world); + if ((ptr = strchr(line,'#'))) *ptr = '\0'; + nwords = atom->count_words(line); + } + + if (nwords != params_per_line) + error->all(FLERR,"Insufficient format in Lebedeva potential file"); + + // words = ptrs to all words in line + + nwords = 0; + words[nwords++] = strtok(line," \t\n\r\f"); + while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + + // ielement,jelement = 1st args + // if these 2 args are in element list, then parse this line + // else skip to next line (continue) + + for (ielement = 0; ielement < nelements; ielement++) + if (strcmp(words[0],elements[ielement]) == 0) break; + if (ielement == nelements) continue; + for (jelement = 0; jelement < nelements; jelement++) + if (strcmp(words[1],elements[jelement]) == 0) break; + if (jelement == nelements) continue; + + // load up parameter settings and error check their values + + if (nparams == maxparam) { + maxparam += DELTA; + params = (Param *) memory->srealloc(params,maxparam*sizeof(Param), + "pair:params"); + } + params[nparams].ielement = ielement; + params[nparams].jelement = jelement; + params[nparams].A = atof(words[2]); + params[nparams].B = atof(words[3]); + params[nparams].C = atof(words[4]); + params[nparams].z0 = atof(words[5]); + params[nparams].alpha = atof(words[6]); + params[nparams].D1 = atof(words[7]); + params[nparams].D2 = atof(words[8]); + params[nparams].lambda1 = atof(words[9]); + params[nparams].lambda2 = atof(words[10]); + // S provides a convenient scaling of all energies + params[nparams].S = atof(words[11]); + + // energies in meV further scaled by S + double meV = 1.0e-3*params[nparams].S; + params[nparams].A *= meV; + params[nparams].B *= meV; + params[nparams].C *= meV; + + // precompute some quantities. That speeds up later process + params[nparams].z02 = pow(params[nparams].z0,2); + params[nparams].z06 = pow(params[nparams].z0,6); + + nparams++; + if(nparams >= pow(atom->ntypes,3)) break; + } + memory->destroy(elem2param); + memory->create(elem2param,nelements,nelements,"pair:elem2param"); + for (i = 0; i < nelements; i++) { + for (j = 0; j < nelements; j++) { + n = -1; + for (m = 0; m < nparams; m++) { + if (i == params[m].ielement && j == params[m].jelement) { + if (n >= 0) error->all(FLERR,"Potential file has duplicate entry"); + n = m; + } + } + if (n < 0) error->all(FLERR,"Potential file is missing an entry"); + elem2param[i][j] = n; + } + } + delete [] words; +} + +/* ---------------------------------------------------------------------- */ diff --git a/src/USER-MISC/pair_lebedeva.h b/src/USER-MISC/pair_lebedeva_z.h similarity index 96% rename from src/USER-MISC/pair_lebedeva.h rename to src/USER-MISC/pair_lebedeva_z.h index ae229e0541..e221087a0a 100644 --- a/src/USER-MISC/pair_lebedeva.h +++ b/src/USER-MISC/pair_lebedeva_z.h @@ -1,83 +1,83 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifdef PAIR_CLASS - -PairStyle(lebedeva/z,PairLebedevaZ) - -#else - -#ifndef LMP_PAIR_LEBEDEVA_Z_H -#define LMP_PAIR_LEBEDEVA_Z_H - -#include "pair.h" - -namespace LAMMPS_NS { - -class PairLebedevaZ : public Pair { - public: - PairLebedevaZ(class LAMMPS *); - virtual ~PairLebedevaZ(); - - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - - protected: - int me; - - struct Param { - double z0,A,B,C,alpha,D1,D2,lambda1,lambda2,S; - double z02,z06; - int ielement,jelement; - }; - Param *params; // parameter set for I-J interactions - char **elements; // names of unique elements - int **elem2param; // mapping from element pairs to parameters - int *map; // mapping from atom types to elements - int nelements; // # of unique elements - int nparams; // # of stored parameter sets - int maxparam; // max # of parameter sets - - double cut_global; - double **cut; - double **offset; - void read_file( char * ); - void allocate(); -}; - -} - -#endif -#endif - -/* ERROR/WARNING messages: - -E: Illegal ... command - -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. - -E: Incorrect args for pair coefficients - -Self-explanatory. Check the input script or data file. - -E: All pair coeffs are not set - -All pair coefficients must be set in the data file or by the -pair_coeff command before running a simulation. - -*/ - +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS + +PairStyle(lebedeva/z,PairLebedevaZ) + +#else + +#ifndef LMP_PAIR_LEBEDEVA_Z_H +#define LMP_PAIR_LEBEDEVA_Z_H + +#include "pair.h" + +namespace LAMMPS_NS { + +class PairLebedevaZ : public Pair { + public: + PairLebedevaZ(class LAMMPS *); + virtual ~PairLebedevaZ(); + + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + double init_one(int, int); + + protected: + int me; + + struct Param { + double z0,A,B,C,alpha,D1,D2,lambda1,lambda2,S; + double z02,z06; + int ielement,jelement; + }; + Param *params; // parameter set for I-J interactions + char **elements; // names of unique elements + int **elem2param; // mapping from element pairs to parameters + int *map; // mapping from atom types to elements + int nelements; // # of unique elements + int nparams; // # of stored parameter sets + int maxparam; // max # of parameter sets + + double cut_global; + double **cut; + double **offset; + void read_file( char * ); + void allocate(); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Incorrect args for pair coefficients + +Self-explanatory. Check the input script or data file. + +E: All pair coeffs are not set + +All pair coefficients must be set in the data file or by the +pair_coeff command before running a simulation. + +*/ + From 7fe7dd95d0df0223cc4245a9260788c99e218222 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 7 Jan 2019 12:09:36 -0700 Subject: [PATCH 92/94] Fix memory issue in pair_reaxc_kokkos --- src/KOKKOS/pair_reaxc_kokkos.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index d78927b79a..9930894f45 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -1434,14 +1434,6 @@ void PairReaxCKokkos::allocate_array() d_CdDelta = typename AT::t_ffloat_1d("reax/c/kk:CdDelta",nmax); d_sum_ovun = typename AT::t_ffloat_2d_dl("reax/c/kk:sum_ovun",nmax,3); - // FixReaxCSpecies - if (fixspecies_flag) { - memoryKK->destroy_kokkos(k_tmpid,tmpid); - memoryKK->destroy_kokkos(k_tmpbo,tmpbo); - memoryKK->create_kokkos(k_tmpid,tmpid,nmax,MAXSPECBOND,"pair:tmpid"); - memoryKK->create_kokkos(k_tmpbo,tmpbo,nmax,MAXSPECBOND,"pair:tmpbo"); - } - // FixReaxCBonds d_abo = typename AT::t_ffloat_2d("reax/c/kk:abo",nmax,maxbo); d_neighid = typename AT::t_tagint_2d("reax/c/kk:neighid",nmax,maxbo); @@ -4237,6 +4229,14 @@ void PairReaxCKokkos::pack_bond_buffer_item(int i, int &j, const boo template void PairReaxCKokkos::FindBondSpecies() { + + if (nmax > k_tmpid.extent(0)) { + memoryKK->destroy_kokkos(k_tmpid,tmpid); + memoryKK->destroy_kokkos(k_tmpbo,tmpbo); + memoryKK->create_kokkos(k_tmpid,tmpid,nmax,MAXSPECBOND,"pair:tmpid"); + memoryKK->create_kokkos(k_tmpbo,tmpbo,nmax,MAXSPECBOND,"pair:tmpbo"); + } + copymode = 1; Kokkos::parallel_for(Kokkos::RangePolicy(0,nmax),*this); From 8387b2953b8875c55c5e6d322a318db7126376f5 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Wed, 9 Jan 2019 23:14:24 -0700 Subject: [PATCH 93/94] bond_react:correctly delete internally-created fixes --- src/USER-MISC/fix_bond_react.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/USER-MISC/fix_bond_react.cpp b/src/USER-MISC/fix_bond_react.cpp index 45dccba868..e7dc816b8b 100644 --- a/src/USER-MISC/fix_bond_react.cpp +++ b/src/USER-MISC/fix_bond_react.cpp @@ -445,10 +445,10 @@ FixBondReact::~FixBondReact() delete [] exclude_group; // check nfix in case all fixes have already been deleted - if (id_fix1 == NULL && modify->nfix) modify->delete_fix(id_fix1); + if (id_fix1 && modify->nfix) modify->delete_fix(id_fix1); delete [] id_fix1; - if (id_fix3 == NULL && modify->nfix) modify->delete_fix(id_fix3); + if (id_fix3 && modify->nfix) modify->delete_fix(id_fix3); delete [] id_fix3; } From b0af54ac374f90adb28c0b5a22f2f92495c2a21e Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sun, 13 Jan 2019 00:07:03 -0700 Subject: [PATCH 94/94] bond/react:limit reaction occurrences --- doc/src/fix_bond_react.txt | 7 +++++-- src/USER-MISC/fix_bond_react.cpp | 23 ++++++++++++++++------- src/USER-MISC/fix_bond_react.h | 2 +- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/doc/src/fix_bond_react.txt b/doc/src/fix_bond_react.txt index 8f71cd14ec..9c82e2f0ff 100644 --- a/doc/src/fix_bond_react.txt +++ b/doc/src/fix_bond_react.txt @@ -36,10 +36,12 @@ react = mandatory argument indicating new reaction specification :l template-ID(post-reacted) = ID of a molecule template containing post-reaction topology :l map_file = name of file specifying corresponding atom-IDs in the pre- and post-reacted templates :l zero or more individual keyword/value pairs may be appended to each react argument :l - individual_keyword = {prob} or {stabilize_steps} or {update_edges} :l + individual_keyword = {prob} or {max_rxn} or {stabilize_steps} or {update_edges} :l {prob} values = fraction seed fraction = initiate reaction with this probability if otherwise eligible seed = random number seed (positive integer) + {max_rxn} value = N + N = maximum number of reactions allowed to occur {stabilize_steps} value = timesteps timesteps = number of timesteps to apply the internally-created "nve/limit"_fix_nve_limit.html fix to reacting atoms {update_edges} value = {none} or {charges} or {custom} @@ -285,7 +287,8 @@ The {prob} keyword can affect whether an eligible reaction actually occurs. The fraction setting must be a value between 0.0 and 1.0. A uniform random number between 0.0 and 1.0 is generated and the eligible reaction only occurs if the random number is less than the -fraction. +fraction. Up to N reactions are permitted to occur, as optionally +specified by the {max_rxn} keyword. The {stabilize_steps} keyword allows for the specification of how many timesteps a reaction site is stabilized before being returned to the diff --git a/src/USER-MISC/fix_bond_react.cpp b/src/USER-MISC/fix_bond_react.cpp index e7dc816b8b..4d4642f102 100644 --- a/src/USER-MISC/fix_bond_react.cpp +++ b/src/USER-MISC/fix_bond_react.cpp @@ -161,6 +161,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(unreacted_mol,nreacts,"bond/react:unreacted_mol"); memory->create(reacted_mol,nreacts,"bond/react:reacted_mol"); memory->create(fraction,nreacts,"bond/react:fraction"); + memory->create(max_rxn,nreacts,"bond/react:max_rxn"); memory->create(seed,nreacts,"bond/react:seed"); memory->create(limit_duration,nreacts,"bond/react:limit_duration"); memory->create(stabilize_steps_flag,nreacts,"bond/react:stabilize_steps_flag"); @@ -179,6 +180,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < nreacts; i++) { fraction[i] = 1; seed[i] = 12345; + max_rxn[i] = BIG; stabilize_steps_flag[i] = 0; update_edges_flag[i] = 0; // set default limit duration to 60 timesteps @@ -244,6 +246,13 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : if (seed[rxn] <= 0) error->all(FLERR,"Illegal fix bond/react command: " "probability seed must be positive"); iarg += 3; + } else if (strcmp(arg[iarg],"max_rxn") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " + "'max_rxn' has too few arguments"); + max_rxn[rxn] = force->inumeric(FLERR,arg[iarg+1]); + if (max_rxn[rxn] < 0) error->all(FLERR,"Illegal fix bond/react command: " + "'max_rxn' cannot be negative"); + iarg += 2; } else if (strcmp(arg[iarg],"stabilize_steps") == 0) { if (stabilization_flag == 0) error->all(FLERR,"Stabilize_steps keyword " "used without stabilization keyword"); @@ -379,9 +388,6 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : FixBondReact::~FixBondReact() { - // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - for (int i = 0; i < nreacts; i++) { delete random[i]; } @@ -396,6 +402,7 @@ FixBondReact::~FixBondReact() memory->destroy(edge); memory->destroy(equivalences); memory->destroy(reverse_equiv); + memory->destroy(landlocked_atoms); memory->destroy(custom_edges); memory->destroy(delete_atoms); @@ -405,6 +412,7 @@ FixBondReact::~FixBondReact() memory->destroy(reacted_mol); memory->destroy(fraction); memory->destroy(seed); + memory->destroy(max_rxn); memory->destroy(limit_duration); memory->destroy(stabilize_steps_flag); memory->destroy(update_edges_flag); @@ -434,7 +442,6 @@ FixBondReact::~FixBondReact() memory->destroy(restore); memory->destroy(glove); memory->destroy(pioneers); - memory->destroy(landlocked_atoms); memory->destroy(local_mega_glove); memory->destroy(ghostly_mega_glove); } @@ -452,7 +459,7 @@ FixBondReact::~FixBondReact() delete [] id_fix3; } - if (id_fix2 == NULL && modify->nfix) modify->delete_fix(id_fix2); + if (id_fix2 && modify->nfix) modify->delete_fix(id_fix2); delete [] id_fix2; delete [] statted_id; @@ -748,6 +755,7 @@ void FixBondReact::post_integrate() int j; for (rxnID = 0; rxnID < nreacts; rxnID++) { + if (max_rxn[rxnID] <= reaction_count_total[rxnID]) continue; for (int ii = 0; ii < nall; ii++) { partner[ii] = 0; finalpartner[ii] = 0; @@ -1148,12 +1156,13 @@ void FixBondReact::superimpose_algorithm() for (int i = 0; i < nreacts; i++) reaction_count_total[i] += reaction_count[i]; - // this assumes compute_vector is called from process 0 - // ...so doesn't bother to bcast ghostly_rxn_count if (me == 0) for (int i = 0; i < nreacts; i++) reaction_count_total[i] += ghostly_rxn_count[i]; + // bcast ghostly_rxn_count + MPI_Bcast(&reaction_count_total[0], nreacts, MPI_INT, 0, world); + // this updates topology next step next_reneighbor = update->ntimestep; diff --git a/src/USER-MISC/fix_bond_react.h b/src/USER-MISC/fix_bond_react.h index d6e7b785e7..2b85bbd281 100644 --- a/src/USER-MISC/fix_bond_react.h +++ b/src/USER-MISC/fix_bond_react.h @@ -54,7 +54,7 @@ class FixBondReact : public Fix { FILE *fp; int *iatomtype,*jatomtype; int *seed; - double **cutsq,*fraction; + double **cutsq,*fraction,*max_rxn; tagint lastcheck; int stabilization_flag; int custom_exclude_flag;