From 4d78d987c6d512b6d379b70ce9ef9c386f41b418 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 24 Feb 2023 07:34:58 -0500 Subject: [PATCH 001/172] add unmap_inv function --- src/domain.cpp | 23 +++++++++++++++++++++++ src/domain.h | 1 + 2 files changed, 24 insertions(+) diff --git a/src/domain.cpp b/src/domain.cpp index e1a508ac51..dcad723b9f 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -1500,6 +1500,29 @@ void Domain::remap_near(double *xnew, double *xold) if (triclinic) lamda2x(coordnew,xnew); } +/* ---------------------------------------------------------------------- + remap the point to specific image flags + x overwritten with result, reset image flag + for triclinic, use h[] to add in tilt factors in other dims as needed +------------------------------------------------------------------------- */ + +void Domain::unmap_inv(double *x, imageint image) +{ + int xbox = (image & IMGMASK) - IMGMAX; + int ybox = (image >> IMGBITS & IMGMASK) - IMGMAX; + int zbox = (image >> IMG2BITS) - IMGMAX; + + if (triclinic == 0) { + x[0] -= xbox*xprd; + x[1] -= ybox*yprd; + x[2] -= zbox*zprd; + } else { + x[0] -= h[0]*xbox + h[5]*ybox + h[4]*zbox; + x[1] -= h[1]*ybox + h[3]*zbox; + x[2] -= h[2]*zbox; + } +} + /* ---------------------------------------------------------------------- unmap the point via image flags x overwritten with result, don't reset image flag diff --git a/src/domain.h b/src/domain.h index 1e9e9caae1..738dc8a2a3 100644 --- a/src/domain.h +++ b/src/domain.h @@ -126,6 +126,7 @@ class Domain : protected Pointers { void remap(double *, imageint &); void remap(double *); void remap_near(double *, double *); + void unmap_inv(double *x, imageint); void unmap(double *, imageint); void unmap(const double *, imageint, double *); void image_flip(int, int, int); From b0b14bd1d166c78d7357e76a733c56ca8d73970d Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 24 Feb 2023 07:48:34 -0500 Subject: [PATCH 002/172] add fix pimd/langevin --- src/REPLICA/fix_pimd_langevin.cpp | 1751 +++++++++++++++++++++++++++++ src/REPLICA/fix_pimd_langevin.h | 198 ++++ 2 files changed, 1949 insertions(+) create mode 100644 src/REPLICA/fix_pimd_langevin.cpp create mode 100644 src/REPLICA/fix_pimd_langevin.h diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp new file mode 100644 index 0000000000..9ac8fc3b17 --- /dev/null +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -0,0 +1,1751 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + 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. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Package FixPIMDLangevin + Purpose Quantum Path Integral Algorithm for Quantum Chemistry + Copyright Voth Group @ University of Chicago + Authors Chris Knight & Yuxing Peng (yuxing at uchicago.edu) + + Updated Oct-01-2011 + Version 1.0 + + Updated Jun-07-2022 + Yifan Li @ Princeton University (yifanl0716@gmail.com) + Added components: + - Multi-processor parallelism for each bead + - White-noise Langevin thermostat + - Bussi-Zykova-Parrinello barostat (isotropic and anisotropic) + - Several quantum estimators + Futher plans: + - Triclinic barostat +------------------------------------------------------------------------- */ + +#include "fix_pimd_langevin.h" + +#include "atom.h" +#include "comm.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "group.h" +#include "math_const.h" +#include "memory.h" +#include "modify.h" +#include "random_mars.h" +#include "universe.h" +#include "utils.h" +#include "update.h" + +#include +#include + +using namespace LAMMPS_NS; +using namespace FixConst; +using namespace MathConst; + +enum { PIMD, NMPIMD, CMD }; +enum { physical, normal }; +enum { baoab, obabo }; +enum { ISO, ANISO, TRICLINIC }; +enum { PILE_L }; +enum { MTTK, BZP }; +// char* Barostats[] = {"MTTK", "BZP"}; +std::map Barostats {{MTTK, "MTTK"}, {BZP, "BZP"}}; +enum { nve, nvt, nph, npt }; +enum{SINGLE_PROC, MULTI_PROC}; + +/* ---------------------------------------------------------------------- */ + +FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), random(nullptr), c_pe(nullptr), c_press(nullptr) { + time_integrate = 1; + tagsend = tagrecv = nullptr; + bufsend = bufrecv = nullptr; + bufsendall = bufrecvall = nullptr; + bufsorted = bufsortedall = nullptr; + outsorted = buftransall = nullptr; + + ntotal = 0; + maxlocal = maxunwrap = maxxc = 0; + bufbeads = nullptr; + x_unwrap = xc = nullptr; + xcall = nullptr; + // x_unwrap = x_unwrapsort = x_unwrapall = nullptr; + // tag_init = tag_initall = nullptr; + counts = nullptr; + + sizeplan = 0; + plansend = planrecv = nullptr; + + M_x2xp = M_xp2x = M_f2fp = M_fp2f = nullptr; + lam = nullptr; + modeindex = nullptr; + + mass = nullptr; + + method = PIMD; + ensemble = nvt; + integrator = obabo; + thermostat = PILE_L; + barostat = BZP; + fmass = 1.0; + sp = 1.0; + temp = 298.15; + Lan_temp = 298.15; + tau = 1.0; + tau_p = 1.0; + Pext = 1.0; + tstat_flag = 1; + pstat_flag = 0; + mapflag = 1; + removecomflag = 1; + fmmode = physical; + pstyle = ISO; + for (int i=0; i<6; i++) p_flag[i] = 0; + + for (int i = 3; i < narg - 1; i += 2) { + if (strcmp(arg[i], "method") == 0) { + if (strcmp(arg[i + 1], "pimd") == 0) + method = PIMD; + else if (strcmp(arg[i + 1], "nmpimd") == 0) + method = NMPIMD; + else if (strcmp(arg[i + 1], "cmd") == 0) + method = CMD; + else + error->universe_all(FLERR, "Unknown method parameter for fix pimd"); + } + else if(strcmp(arg[i], "integrator")==0) + + { + if(strcmp(arg[i+1], "obabo")==0) integrator=obabo; + else if(strcmp(arg[i+1], "baoab")==0) integrator=baoab; + else error->universe_all(FLERR, "Unknown integrator parameter for fix pimd. Only obabo and baoab integrators are supported!"); + } + + else if(strcmp(arg[i], "ensemble")==0) + { + if(strcmp(arg[i+1], "nve")==0) { ensemble = nve; tstat_flag = 0; pstat_flag = 0; } + else if(strcmp(arg[i+1], "nvt")==0) { ensemble = nvt; tstat_flag = 1; pstat_flag = 0; } + else if(strcmp(arg[i+1], "nph")==0) { ensemble = nph; tstat_flag = 0; pstat_flag = 1; } + else if(strcmp(arg[i+1], "npt")==0) { ensemble = npt; tstat_flag = 1; pstat_flag = 1; } + else error->universe_all(FLERR, "Unknown ensemble parameter for fix pimd. Only nve and nvt ensembles are supported!"); + } + + else if (strcmp(arg[i], "fmass") == 0) { + fmass = utils::numeric(FLERR, arg[i + 1], false, lmp); + if (fmass < 0.0 || fmass > 1.0) + error->universe_all(FLERR, "Invalid fmass value for fix pimd"); + } + + else if(strcmp(arg[i], "fmmode")==0) + { + if(strcmp(arg[i+1], "physical")==0) fmmode=physical; + else if(strcmp(arg[i+1], "normal")==0) fmmode=normal; + else error->universe_all(FLERR, "Unknown fictitious mass mode for fix pimd. Only physical mass and normal mode mass are supported!"); + } + + else if(strcmp(arg[i],"scale")==0) + { + pilescale = atof(arg[i+1]); + if(pilescale<0.0) error->universe_all(FLERR,"Invalid pile scale value for fix pimd"); + } + + else if (strcmp(arg[i], "temp") == 0) { + temp = utils::numeric(FLERR, arg[i + 1], false, lmp); + if (temp < 0.0) error->universe_all(FLERR, "Invalid temp value for fix pimd"); + } + + else if (strcmp(arg[i], "lj") == 0) { + lj_epsilon = utils::numeric(FLERR, arg[i+1], false, lmp); + lj_sigma = utils::numeric(FLERR, arg[i+2], false, lmp); + lj_mass = utils::numeric(FLERR, arg[i+3], false, lmp); + other_planck = utils::numeric(FLERR, arg[i+4], false, lmp); + i++; + i++; + i++; + } + + else if(strcmp(arg[i], "thermostat")==0) + { + if(strcmp(arg[i+1],"PILE_L")==0) + { + thermostat = PILE_L; + seed = atoi(arg[i+2]); + i++; + } + } + + else if(strcmp(arg[i], "tau")==0) + { + tau = atof(arg[i+1]); + } + + else if(strcmp(arg[i], "press")==0) + { + Pext = atof(arg[i+1]); + if(Pext<0.0) error->universe_all(FLERR,"Invalid press value for fix pimd"); + } + + else if(strcmp(arg[i], "barostat")==0) + { + if(strcmp(arg[i+1],"MTTK")==0) + { + barostat = MTTK; + } + else if(strcmp(arg[i+1],"BZP")==0) + { + barostat = BZP; + } + else error->universe_all(FLERR,"Unknown barostat parameter for fix pimd"); + } + + else if(strcmp(arg[i], "iso")==0) + { + pstyle = ISO; + i--; + } + + else if(strcmp(arg[i], "aniso")==0) + { + pstyle = ANISO; + i--; + } + + else if(strcmp(arg[i], "taup")==0) + { + tau_p = atof(arg[i+1]); + if(tau_p<=0.0) error->universe_all(FLERR, "Invalid tau_p value for fix pimd"); + } + else if(strcmp(arg[i], "fixcom")==0) + { + if(strcmp(arg[i+1], "yes")==0) removecomflag = 1; + else if(strcmp(arg[i+1], "no")==0) removecomflag = 0; + } + + else if(strcmp(arg[i], "map")==0) + { + if(strcmp(arg[i+1], "yes")==0) mapflag = 1; + else if(strcmp(arg[i+1], "no")==0) mapflag = 0; + } + + else error->universe_all(FLERR, fmt::format("Unknown keyword {} for fix pimd", arg[i])); + } + + /* Initiation */ + + int nlocal = atom->nlocal; + // xc = new double[nlocal*3]; + // x_unwrap = new double[nlocal*3]; + + global_freq = 1; + vector_flag = 1; + size_vector = 11; + // if(pstyle==ISO) {size_vector = 15;} + // else if(pstyle==ANISO) {size_vector = 23;} + extvector = 1; + // comm_forward = 1; + + // some initilizations + + id_pe = new char[8]; + strcpy(id_pe, "pimd_pe"); + char **newarg = new char*[3]; + newarg[0] = id_pe; + newarg[1] = (char *) "all"; + newarg[2] = (char *) "pe"; + modify->add_compute(3,newarg); + delete [] newarg; + + + id_press = new char[12]; + strcpy(id_press, "pimd_press"); + newarg = new char*[5]; + newarg[0] = id_press; + newarg[1] = (char*) "all"; + newarg[2] = (char*) "pressure"; + newarg[3] = (char*) "thermo_temp"; + newarg[4] = (char*) "virial"; + modify->add_compute(5, newarg); + delete [] newarg; + + vol0 = domain->xprd * domain->yprd * domain->zprd; + + fixedpoint[0] = 0.5*(domain->boxlo[0]+domain->boxhi[0]); + fixedpoint[1] = 0.5*(domain->boxlo[1]+domain->boxhi[1]); + fixedpoint[2] = 0.5*(domain->boxlo[2]+domain->boxhi[2]); + + // initialize Marsaglia RNG with processor-unique seed + + if(integrator==baoab || integrator==obabo) + { + Lan_temp = temp; + random = new RanMars(lmp, seed + universe->me); + } + + me = comm->me; + nprocs = comm->nprocs; + if(nprocs == 1) cmode = SINGLE_PROC; + else cmode = MULTI_PROC; + + nprocs_universe = universe->nprocs; + nreplica = universe->nworlds; + ireplica = universe->iworld; + + int *iroots = new int[nreplica]; + MPI_Group uworldgroup,rootgroup; + + for (int i=0; iroot_proc[i]; + MPI_Comm_group(universe->uworld, &uworldgroup); + MPI_Group_incl(uworldgroup, nreplica, iroots, &rootgroup); + MPI_Comm_create(universe->uworld, rootgroup, &rootworld); + if (rootgroup != MPI_GROUP_NULL) MPI_Group_free(&rootgroup); + if (uworldgroup != MPI_GROUP_NULL) MPI_Group_free(&uworldgroup); + delete [] iroots; + + ntotal = atom->natoms; + if(atom->nmax > maxlocal) reallocate(); + if(atom->nmax > maxunwrap) reallocate_x_unwrap(); + if(atom->nmax > maxxc) reallocate_xc(); + memory->create(xcall, ntotal*3, "FixPIMDLangevin:xcall"); + // init_x_unwrap(); + + if (cmode == SINGLE_PROC) + { + memory->create(bufsorted, ntotal, 3, "FixPIMDLangevin:bufsorted"); + memory->create(outsorted, ntotal, 3, "FixPIMDLangevin:outsorted"); + memory->create(bufsortedall, nreplica*ntotal, 3, "FixPIMDLangevin:bufsortedall"); + memory->create(buftransall, nreplica*ntotal, 3, "FixPIMDLangevin:buftransall"); + memory->create(counts, nreplica, "FixPIMDLangevin:counts"); + memory->create(displacements, nreplica, "FixPIMDLangevin:displacements"); + } + + if ((cmode == MULTI_PROC) && (counts == nullptr)) { + // printf("me = %d, creating bufrecvall\n", universe->me); + memory->create(bufsendall,ntotal,3,"FixPIMDLangevin:bufsendall"); + memory->create(bufrecvall,ntotal,3,"FixPIMDLangevin:bufrecvall"); + // printf("me = %d, bufrecvall[0][0] = %.4f\n", universe->me, bufrecvall[0][0]); + memory->create(tagsendall,ntotal,"FixPIMDLangevin:tagsendall"); + memory->create(tagrecvall,ntotal,"FixPIMDLangevin:tagrecvall"); + // printf("me = %d, tagrecvall[0] = %d\n", universe->me, tagrecvall[0]); + memory->create(counts,nprocs,"FixPIMDLangevin:counts"); + memory->create(displacements,nprocs,"FixPIMDLangevin:displacements"); + // memory->create(x_unwrapall, ntotal, 3, "FixPIMDLangevin:x_unwrapall"); + // memory->create(tag_initall, ntotal, "FixPIMDLangevin:tag_initall"); + // printf("me = %d, tag_initall[0] = %d\n", universe->me, tag_initall[0]); + } + + // printf("me = %d constructing finished\n", universe->me); +} + +/* ---------------------------------------------------------------------- */ + +FixPIMDLangevin::~FixPIMDLangevin() +{ + +} + +/* ---------------------------------------------------------------------- */ + +int FixPIMDLangevin::setmask() +{ + int mask = 0; + mask |= POST_FORCE; + mask |= INITIAL_INTEGRATE; + // mask |= POST_NEIGHBOR; + mask |= FINAL_INTEGRATE; + mask |= END_OF_STEP; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::init() +{ + if (atom->map_style == Atom::MAP_NONE) + error->all(FLERR, "Fix pimd requires an atom map, see atom_modify"); + + if (universe->me == 0 && universe->uscreen) + fprintf(universe->uscreen, "Fix pimd initializing Path-Integral ...\n"); + + // prepare the constants + + masstotal = group->mass(igroup); + np = universe->nworlds; + inverse_np = 1.0 / np; + + const double Boltzmann = force->boltz; + if (strcmp(update->unit_style,"lj") == 0) { + double planck_star = sqrt(lj_epsilon)*sqrt(atom->mass[0])*lj_sigma; + planck = other_planck / planck_star; + } + else planck = force->hplanck; + const double Planck = planck; + printf("planck = %.6e\n", planck); + + // if(force->boltz == 1.0) { hbar = Planck; } + // else { hbar = Planck / (2.0 * MY_PI); } + hbar = Planck / (2.0 * MY_PI); + // hbar = Planck; + kBT = force->boltz * temp; + double beta = 1.0 / (Boltzmann * temp); + double _fbond = 1.0 * np * np / (beta * beta * hbar * hbar); + + omega_np = np / (hbar * beta) * sqrt(force->mvv2e); + beta_np = 1.0 / force->boltz / temp / np; + fbond = _fbond * force->mvv2e; + // printf("_fbond = %.16e\nfbond = %.16e\n", _fbond, fbond); + + if (universe->me == 0) + printf("Fix pimd -P/(beta^2 * hbar^2) = %20.7lE (kcal/mol/A^2)\n\n", fbond); + + if(integrator==obabo) + { + dtf = 0.5 * update->dt * force->ftm2v; + dtv = 0.5 * update->dt; + dtv2 = dtv * dtv; + dtv3 = 1./3 * dtv2 * dtv * force->ftm2v; + } + else if(integrator==baoab) + { + dtf = 0.5 * update->dt * force->ftm2v; + dtv = 0.5 * update->dt; + dtv2 = dtv * dtv; + dtv3 = 1./3 * dtv2 * dtv * force->ftm2v; + } + else + { + error->universe_all(FLERR,"Unknown integrator parameter for fix pimd"); + } + + comm_init(); + + mass = new double[atom->ntypes + 1]; + + nmpimd_init(); + + Langevin_init(); + if (pstat_flag) baro_init(); + + int ipe = modify->find_compute(id_pe); + c_pe = modify->compute[ipe]; + + int ipress = modify->find_compute(id_press); + c_press = modify->compute[ipress]; + + t_prim = t_vir = t_cv = p_prim = p_vir = p_cv = p_md = 0.0; + + if(universe->me==0) fprintf(screen, "Fix pimd successfully initialized!\n"); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::setup(int vflag) +{ + if(universe->me==0) printf("Setting up Path-Integral ...\n"); + int nlocal = atom->nlocal; + tagint *tag = atom->tag; + double **x = atom->x; + double **v = atom->v; + imageint *image = atom->image; + // nlocal_init = nlocal; + if(mapflag){ + for(int i=0; iunmap(x[i], image[i]); + } + } + // printf("me = %d after unmapping x_unwrap\n", universe->me); + + // printf("setup already here\n"); + if(method==NMPIMD) + { + inter_replica_comm(x); + // printf("me = %d after inter\n", universe->me); + // printf("%.4f %.4f %.4f\n", bufbeads[0][0], bufbeads[0][1], bufbeads[0][2]); + if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); + else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); + } + collect_xc(); + // printf("me = %d setup x2xp done\n", universe->me); + compute_spring_energy(); + if(method==NMPIMD) + { + inter_replica_comm(x); + if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_xp2x[universe->iworld]); + else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); + // nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); + } + // printf("me = %d setup xp2x done\n", universe->me); + if(mapflag){ + for(int i=0; iunmap_inv(x[i], image[i]); + } + } + + if(method==NMPIMD) + { + inter_replica_comm(v); + if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, v, M_x2xp[universe->iworld]); + else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, v, M_x2xp[universe->iworld]); + // nmpimd_transform(bufbeads, atom->v, M_x2xp[universe->iworld]); + } + // printf("me = %d setup v2vp done\n", universe->me); + // compute_xc(); + // update_x_unwrap(); + // printf("setting up %d\n", vflag); + if(universe->me==0 && screen) fprintf(screen,"Setting up Path-Integral ...\n"); + if(universe->me==0) printf("Setting up Path-Integral ...\n"); + // printf("setting up, m = %.4e\n", mass[1]); + post_force(vflag); + // int idx = atom->map(1); + // printf("irplica = %d, x[1] = %.6f %.6f %.6f xu[1] = %.6f %.6f %.6f xc[1] = %.6f %.6f %.6f\n", ireplica, x[idx][0], x[idx][1], x[idx][2], x_unwrap[idx][0], x_unwrap[idx][1], x_unwrap[idx][2], xc[idx][0], xc[idx][1], xc[idx][2]); + // printf("after post_force, m = %.4e\n", mass[1]); + // printf("me = %d after post_force\n", universe->me); + compute_totke(); + // compute_pote(); + // if(pstyle==ANISO) compute_stress_tensor(); + end_of_step(); + c_pe->addstep(update->ntimestep+1); + c_press->addstep(update->ntimestep+1); + // printf("setup ending: \ncell = %.16e %.16e %.16e\nvol = %.16e\n", domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); + // printf("me = %d, setup finished\n", universe->me); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::initial_integrate(int /*vflag*/) +{ + // printf("step = %d start initial_integrate\ncell = %.16e %.16e %.16e\nvol = %.16e\n", update->ntimestep, domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); + // printf("me = %d, step %d initial_integrate starts!\n", universe->me, update->ntimestep); + // printf("me = %d, step %d if starts!\n", universe->me, update->ntimestep); + int nlocal = atom->nlocal; + tagint *tag = atom->tag; + double **x = atom->x; + imageint *image = atom->image; + if(mapflag){ + for(int i=0; iunmap(x[i], image[i]); + } + } + if(integrator==obabo) + { + // printf("me = %d, step %d obabo starts!\n", universe->me, update->ntimestep); + if(tstat_flag) + { + o_step(); + // if(removecomflag) remove_com_motion(); + if(pstat_flag) press_o_step(); + } + if(pstat_flag) + { + compute_totke(); + // printf("me = %d, step %d after totke!\n", universe->me, update->ntimestep); + compute_p_cv(); + press_v_step(); + } + /* + if(pstat_flag) + { + } + */ + // printf("me = %d, step %d before b_step 1!\n", universe->me, update->ntimestep); + b_step(); + // printf("me = %d, step %d after b_step 1!\n", universe->me, update->ntimestep); + // if(removecomflag) remove_com_motion(); + if(method==NMPIMD) + { + inter_replica_comm(x); + if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); + else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); + // nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); + } + qc_step(); + a_step(); + qc_step(); + a_step(); + // printf("me = %d, step %d after 2 a_step's!\n", universe->me, update->ntimestep); + } + else if(integrator==baoab) + { + if(pstat_flag) + { + compute_totke(); + compute_p_cv(); + press_v_step(); + } + b_step(); + // if(removecomflag) remove_com_motion(); + if(method==NMPIMD) + { + inter_replica_comm(x); + if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); + else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); + // nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); + } + qc_step(); + a_step(); + if(tstat_flag) + { + o_step(); + // if(removecomflag) remove_com_motion(); + if(pstat_flag) press_o_step(); + } + qc_step(); + a_step(); + } + else + { + error->universe_all(FLERR,"Unknown integrator parameter for fix pimd"); + } + collect_xc(); + compute_spring_energy(); + + if(method==NMPIMD) + { + inter_replica_comm(x); + if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_xp2x[universe->iworld]); + else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); + // nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); + } + + + if(mapflag){ + for(int i=0; iunmap_inv(x[i], image[i]); + } + } + // printf("step = %d\ncell = %.16e %.16e %.16e\nvol = %.16e\n", update->ntimestep, domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); + // printf("me = %d, step %d initial_integrate ends!\n", universe->me, update->ntimestep); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::final_integrate() +{ + if(pstat_flag) + { + compute_totke(); + compute_p_cv(); + press_v_step(); + } + b_step(); + // if(removecomflag) remove_com_motion(); + if(integrator==obabo) + { + if(tstat_flag) + { + o_step(); + // if(removecomflag) remove_com_motion(); + if(pstat_flag) press_o_step(); + } + } + else if(integrator==baoab) + { + + } + else + { + error->universe_all(FLERR,"Unknown integrator parameter for fix pimd"); + } +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::post_force(int /*flag*/) +{ + // printf("step = %d\ncell = %.16e %.16e %.16e\nvol = %.16e\n", update->ntimestep, domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); + if(atom->nmax > maxunwrap) reallocate_x_unwrap(); + if(atom->nmax > maxxc) reallocate_xc(); + // printf("me = %d, step %d post_force starts!\n", universe->me, update->ntimestep); + int nlocal = atom->nlocal; + double **x = atom->x; + double **f = atom->f; + imageint *image = atom->image; + tagint *tag = atom->tag; + for(int i=0; iunmap(x_unwrap[i], image[i]); + } + } + for(int i=0; imap(1); + // printf("in post_force, x_unwrap: %.6f %.6f %.6f xcall: %.6f %.6f %.6f xc: %.6f %.6f %.6f\n", x_unwrap[idx][0], x_unwrap[idx][1], x_unwrap[idx][2], xcall[0], xcall[1], xcall[2], xc[idx][0], xc[idx][1], xc[idx][2]); + // MPI_Barrier(universe->uworld); + // update_x_unwrap(); + // MPI_Barrier(universe->uworld); + // compute_xc(); + // MPI_Barrier(universe->uworld); + // if(mapflag) + // { + // for(int i=0; iunmap_inv(x[i], image[i]); + // } + // } + compute_vir(); + compute_vir_(); + // compute_t_prim(); + // compute_t_vir(); + compute_pote(); + if(method==NMPIMD) + { + inter_replica_comm(f); + if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, f, M_x2xp[universe->iworld]); + else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, f, M_x2xp[universe->iworld]); + // nmpimd_transform(bufbeads, f, M_x2xp[universe->iworld]); + } + c_pe->addstep(update->ntimestep+1); + c_press->addstep(update->ntimestep+1); + // printf("me = %d, step %d post_force ends!\n", universe->me, update->ntimestep); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::end_of_step() +{ + compute_totke(); + // inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); + // compute_p_prim(); + compute_p_cv(); + compute_tote(); + if(pstat_flag) compute_totenthalpy(); + + if(update->ntimestep % 10000 == 0) + { + if(universe->me==0) printf("This is the end of step %ld.\n", update->ntimestep); + } + // if(universe->me==0) printf("me = %d This is the end of step %ld.\n", universe->me, update->ntimestep); + // printf("me = %d This is the end of step %ld.\n\n", universe->me, update->ntimestep); +} + +void FixPIMDLangevin::collect_xc() +{ + int nlocal = atom->nlocal; + double **x = atom->x; + tagint *tag = atom->tag; + if(ireplica == 0) + { + if(cmode == SINGLE_PROC) + { + for(int i=0; imap(1); + // printf("in init_int, x: %.6f %.6f %.6f xcall: %.6f %.6f %.6f\n", x[idx][0], x[idx][1], x[idx][2], xcall[0], xcall[1], xcall[2]); + + if(cmode == MULTI_PROC) + { + // printf("trying to add\n"); + // MPI_Reduce(MPI_IN_PLACE, xcall, ntotal*3, MPI_DOUBLE, MPI_SUM, 0, world); + MPI_Allreduce(MPI_IN_PLACE, xcall, ntotal*3, MPI_DOUBLE, MPI_SUM, world); + // printf("added\n"); + } + } + MPI_Bcast(xcall, ntotal*3, MPI_DOUBLE, 0, universe->uworld); +} + +/* ---------------------------------------------------------------------- */ +/* +void FixPIMDLangevin::update_x_unwrap() +{ + // MPI_Barrier(universe->uworld); + // printf("me = %d, starting update_xu\n", universe->me); + int nlocal = atom->nlocal; + double **x = atom->x; + // delete x_unwrap; + // memory->sfree(x_unwrap); + // printf("me = %d, before deleting xu\n", universe->me); + delete [] x_unwrap; + x_unwrap = nullptr; + x_unwrap = (double*) memory->srealloc(x_unwrap, sizeof(double)*(nlocal+200)*3, "FixDPPimd::x_unwrap"); + // printf("me = %d, before newing xu\n", universe->me); + // x_unwrap = new double[nlocal*3]; + // printf("me = %d, doing xu\n", universe->me); + for(int i=0; ime); + // MPI_Barrier(universe->uworld); +} +*/ +/* ---------------------------------------------------------------------- */ +/* +void FixPIMDLangevin::compute_xc() +{ + int natoms = atom->natoms; + MPI_Barrier(universe->uworld); + comm_exec(atom->x); + MPI_Barrier(universe->uworld); + int nlocal = atom->nlocal; + delete [] xc; + xc = nullptr; + xc = (double*) memory->srealloc(xc, sizeof(double) * nlocal * 3, "FixDPPimd:xc"); + for(int i=0; inlocal; + int *type = atom->type; + double **v = atom->v; + double **f = atom->f; + + for(int i=0; inlocal; + double **x = atom->x; + double **v = atom->v; + tagint *tag = atom->tag; + double oldlo, oldhi; + if(!pstat_flag) { + if(universe->iworld == 0) + { + for(int i=0; intimestep, domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); + if(universe->iworld == 0) + { + double expp[3], expq[3]; + // printf("pstyle = %d vw[0] = %.8e\n", pstyle, vw[0]); + if(pstyle == ISO) {vw[1] = vw[0]; vw[2] = vw[0];} + for(int j=0; j<3; j++) + { + expq[j] = exp(dtv * vw[j]); + expp[j] = exp(-dtv * vw[j]); + } + if(barostat == BZP) + { + for(int i=0; iboxlo[0]; + oldhi = domain->boxhi[0]; + + domain->boxlo[0] = (oldlo-fixedpoint[0])*expq[0] + fixedpoint[0]; + domain->boxhi[0] = (oldhi-fixedpoint[0])*expq[0] + fixedpoint[0]; + + oldlo = domain->boxlo[1]; + oldhi = domain->boxhi[1]; + domain->boxlo[1] = (oldlo-fixedpoint[1])*expq[1] + fixedpoint[1]; + domain->boxhi[1] = (oldhi-fixedpoint[1])*expq[1] + fixedpoint[1]; + + oldlo = domain->boxlo[2]; + oldhi = domain->boxhi[2]; + domain->boxlo[2] = (oldlo-fixedpoint[2])*expq[2] + fixedpoint[2]; + domain->boxhi[2] = (oldhi-fixedpoint[2])*expq[2] + fixedpoint[2]; + } + } + MPI_Barrier(universe->uworld); + MPI_Bcast(&domain->boxlo[0], 3, MPI_DOUBLE, 0, universe->uworld); + MPI_Bcast(&domain->boxhi[0], 3, MPI_DOUBLE, 0, universe->uworld); + domain->set_global_box(); + domain->set_local_box(); + } + volume = domain->xprd * domain->yprd * domain->zprd; + // printf("step = %d end qc_step\ncell = %.16e %.16e %.16e\nvol = %.16e\n", update->ntimestep, domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::a_step(){ + int n = atom->nlocal; + double **x = atom->x; + double **v = atom->v; + double x0, x1, x2, v0, v1, v2; // three components of x[i] and v[i] + + if(universe->iworld != 0) + { + // printf("iworld = %d c = %.4e s = %.4e w = %.4e\n", universe->iworld, Lan_c[universe->iworld], Lan_s[universe->iworld], _omega_k[universe->iworld]); + for(int i=0; iiworld] * x0 + 1./_omega_k[universe->iworld] * Lan_s[universe->iworld] * v0; + x[i][1] = Lan_c[universe->iworld] * x1 + 1./_omega_k[universe->iworld] * Lan_s[universe->iworld] * v1; + x[i][2] = Lan_c[universe->iworld] * x2 + 1./_omega_k[universe->iworld] * Lan_s[universe->iworld] * v2; + v[i][0] = -1.*_omega_k[universe->iworld] * Lan_s[universe->iworld] * x0 + Lan_c[universe->iworld] * v0; + v[i][1] = -1.*_omega_k[universe->iworld] * Lan_s[universe->iworld] * x1 + Lan_c[universe->iworld] * v1; + v[i][2] = -1.*_omega_k[universe->iworld] * Lan_s[universe->iworld] * x2 + Lan_c[universe->iworld] * v2; + } + } +} + +/* ---------------------------------------------------------------------- */ +/* +void FixPIMDLangevin::remove_com_motion(){ + if(universe->iworld == 0) + { + // double **x = atom->x; + double **v = atom->v; + int *mask = atom->mask; + int nlocal = atom->nlocal; + if (dynamic) masstotal = group->mass(igroup); + double vcm[3]; + group->vcm(igroup,masstotal,vcm); + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + v[i][0] -= vcm[0]; + v[i][1] -= vcm[1]; + v[i][2] -= vcm[2]; + } + } + } +} +*/ +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::baro_init() +{ + vw[0] = vw[1] = vw[2] = vw[3] = vw[4] = vw[5] = 0.0; + if(pstyle == ISO) {W = 3 * (atom->natoms) * tau_p * tau_p * np * kBT;} // consistent with the definition in i-Pi + // printf("tau_p = %.6e np = %.6e kBT = %.6e W = %.6e\n", tau_p, np, kBT, W);} + else if(pstyle == ANISO) {W = atom->natoms * tau_p * tau_p * np * kBT;} + Vcoeff = 1.0; + std::string out = fmt::format("\nInitializing PIMD {:s} barostat...\n", Barostats[barostat]); + out += fmt::format("The barostat mass is W = {:.16e}\n", W); + utils::logmesg(lmp, out); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::press_v_step() +{ + int nlocal = atom->nlocal; + double **f = atom->f; + double **v = atom->v; + int *type = atom->type; + volume = domain->xprd * domain->yprd * domain->zprd; + + if(pstyle == ISO) + { + if(barostat == BZP) + { + // printf("me = %d step = %d start press_v_step, baro.p = %.30e p_cv = %.30e\n", universe->me, update->ntimestep, W*vw[0], np*p_cv); + vw[0] += dtv * 3 * (volume * np * (p_cv - Pext) / force->nktv2p + Vcoeff / beta_np) / W; + // printf("me = %d step = %d add p-Pext, baro.p = %.30e\n", universe->me, update->ntimestep, W*vw[0]); + if(universe->iworld==0) + { + double dvw_proc = 0.0, dvw = 0.0; + for(int i = 0; i < nlocal; i++) + { + for(int j = 0; j < 3; j++) + { + dvw_proc += dtv2 * f[i][j] * v[i][j] / W + dtv3 * f[i][j] * f[i][j] / mass[type[i]] / W; + } + } + MPI_Allreduce(&dvw_proc, &dvw, 1, MPI_DOUBLE, MPI_SUM, world); + vw[0] += dvw; + } + MPI_Barrier(universe->uworld); + MPI_Bcast(&vw[0], 1, MPI_DOUBLE, 0, universe->uworld); + // printf("me = %d step = %d end press_v_step, baro.p = %.30e\n\n", universe->me, update->ntimestep, W*vw[0]); + } + else if(barostat == MTTK) + { + mtk_term1 = 2. / atom->natoms * totke / 3; + f_omega = (volume * np * (p_md - Pext) + mtk_term1) / W; + vw[0] += 0.5 * dtv * f_omega; + } + } + else if(pstyle == ANISO) + { + compute_stress_tensor(); + for(int ii=0; ii<3; ii++) + { + vw[ii] += dtv * (volume * np * (stress_tensor[ii] - Pext) / force->nktv2p + Vcoeff / beta_np) / W; + if(universe->iworld==0) + { + double dvw_proc = 0.0, dvw = 0.0; + for(int i = 0; i < nlocal; i++) + { + dvw_proc += dtv2 * f[i][ii] * v[i][ii] / W + dtv3 * f[i][ii] * f[i][ii] / mass[type[i]] / W; + } + MPI_Allreduce(&dvw_proc, &dvw, 1, MPI_DOUBLE, MPI_SUM, world); + vw[ii] += dvw; + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::press_o_step() +{ + if(pstyle==ISO) + { + if(universe->me==0) + { + r1 = random->gaussian(); + vw[0] = c1 * vw[0] + c2 * sqrt(1. / W / beta_np) * r1; + } + MPI_Barrier(universe->uworld); + MPI_Bcast(&vw[0], 1, MPI_DOUBLE, 0, universe->uworld); + } + else if(pstyle==ANISO) + { + if(universe->me==0) + { + r1 = random->gaussian(); + r2 = random->gaussian(); + r3 = random->gaussian(); + vw[0] = c1 * vw[0] + c2 * sqrt(1. / W / beta_np) * r1; + vw[1] = c1 * vw[1] + c2 * sqrt(1. / W / beta_np) * r2; + vw[2] = c1 * vw[2] + c2 * sqrt(1. / W / beta_np) * r3; + } + MPI_Barrier(universe->uworld); + MPI_Bcast(&vw, 3, MPI_DOUBLE, 0, universe->uworld); + } +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::Langevin_init() +{ + // printf("in Langevin_init\n"); + double beta = 1.0 / kBT; + _omega_np = np / beta / hbar; + double _omega_np_dt_half = _omega_np * update->dt * 0.5; + // printf("omega_np = %.4e wdt = %.4e\n", _omega_np, _omega_np_dt_half); + + _omega_k = new double[np]; + Lan_c = new double[np]; + Lan_s = new double[np]; + if(fmmode==physical){ + for (int i=0; i 0) gamma = 1.0 / tau; + else gamma = np / beta / hbar; + + if(integrator==obabo) c1 = exp(-gamma * 0.5 * update->dt); // tau is the damping time of the centroid mode. + else if(integrator==baoab) c1 = exp(-gamma * update->dt); + else error->universe_all(FLERR, "Unknown integrator parameter for fix pimd. Only obabo and baoab integrators is supported!"); + + c2 = sqrt(1.0 - c1 * c1); // note that c1 and c2 here only works for the centroid mode. + + if( thermostat == PILE_L ) + { + std::string out = "\nInitializing PI Langevin equation thermostat...\n"; + out += "Bead ID | omega | tau | c1 | c2\n"; + tau_k = new double[np]; + c1_k = new double[np]; + c2_k = new double[np]; + tau_k[0] = tau; c1_k[0] = c1; c2_k[0] = c2; + for(int i=1; idt / tau_k[i]); + else if(integrator==baoab) c1_k[i] = exp(-1.0 * update->dt / tau_k[i]); + else error->universe_all(FLERR, "Unknown integrator parameter for fix pimd. Only obabo and baoab integrators is supported!"); + c2_k[i] = sqrt(1.0 - c1_k[i] * c1_k[i]); + } + for(int i=0; inlocal; + int *type = atom->type; + double beta_np = 1.0 / force->boltz / Lan_temp / np * force->mvv2e; + if(thermostat == PILE_L) + { + for(int i=0; igaussian(); + r2 = random->gaussian(); + r3 = random->gaussian(); + atom->v[i][0] = c1_k[universe->iworld] * atom->v[i][0] + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r1; + atom->v[i][1] = c1_k[universe->iworld] * atom->v[i][1] + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r2; + atom->v[i][2] = c1_k[universe->iworld] * atom->v[i][2] + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r3; + } + } +} + +/* ---------------------------------------------------------------------- + Normal Mode PIMD +------------------------------------------------------------------------- */ + +void FixPIMDLangevin::nmpimd_init() +{ + memory->create(M_x2xp, np, np, "fix_feynman:M_x2xp"); + memory->create(M_xp2x, np, np, "fix_feynman:M_xp2x"); + + lam = (double*) memory->smalloc(sizeof(double)*np, "FixPIMDLangevin::lam"); + + // Set up eigenvalues + for(int i=0; iiworld; + for(int i=1; i<=atom->ntypes; i++) + { + mass[i] = atom->mass[i]; + if(iworld) + { + if(fmmode==physical) { mass[i] *= 1.0; } + else if(fmmode==normal) { mass[i] *= lam[iworld]; } + mass[i] *= fmass; + } + } +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::nmpimd_transform(double **src, double **des, double *vector) +{ + if(cmode == SINGLE_PROC) + { + for(int i=0; itag[i]; + for(int d=0; d<3; d++) + { + des[i][d] = bufsorted[tagtmp-1][d]; + } + } + } + else if(cmode == MULTI_PROC) + { + int n = atom->nlocal; + int m = 0; + + for (int i = 0; i < n; i++) + for (int d = 0; d < 3; d++) { + des[i][d] = 0.0; + for (int j = 0; j < np; j++) { des[i][d] += (src[j][m] * vector[j]); } + m++; + } + } +} + +/* ---------------------------------------------------------------------- + Comm operations +------------------------------------------------------------------------- */ + +void FixPIMDLangevin::comm_init() +{ + // if(me == 0){ + if (sizeplan) { + delete [] plansend; + delete [] planrecv; + } + + sizeplan = np - 1; + plansend = new int[sizeplan]; + planrecv = new int[sizeplan]; + modeindex = new int[sizeplan]; + for (int i = 0; i < sizeplan; i++) { + int isend, irecv; + isend = ireplica + i + 1; + if (isend >= nreplica) isend -= nreplica; + irecv = ireplica - (i + 1); + if (irecv < 0) irecv += nreplica; + plansend[i] = universe->root_proc[isend]; + planrecv[i] = universe->root_proc[irecv]; + modeindex[i] = irecv; + } + // } +} + +/* ---------------------------------------------------------------------- */ +/* +void FixPIMDLangevin::init_x_unwrap() +{ + maxunwrap = atom->nmax; + memory->destroy(x_unwrap); + memory->destroy(tag_init); + memory->destroy(image_init); + memory->destroy(x_unwrapsort); + memory->create(x_unwrap, maxunwrap, 3, "FixPIMDLangevin:x_unwrap"); + memory->create(tag_init, maxunwrap, "FixPIMDLangevin:tag_init"); + memory->create(image_init, maxunwrap, "FixPIMDLangevin:image_init"); + memory->create(x_unwrapsort, ntotal, 3, "FixPIMDLangevin:x_unwrapsort"); +} +*/ +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::reallocate_xc() +{ + maxxc = atom->nmax; + memory->destroy(xc); + memory->create(xc, maxxc, 3, "FixPIMDLangevin:xc"); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::reallocate_x_unwrap() +{ + maxunwrap = atom->nmax; + memory->destroy(x_unwrap); + memory->create(x_unwrap, maxunwrap, 3, "FixPIMDLangevin:x_unwrap"); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::reallocate() +{ + maxlocal = atom->nmax; + memory->destroy(bufsend); + memory->destroy(bufrecv); + memory->destroy(tagsend); + memory->destroy(tagrecv); + memory->destroy(bufbeads); + memory->create(bufsend, maxlocal, 3, "FixPIMDLangevin:bufsend"); + memory->create(bufrecv, maxlocal, 3, "FixPIMDLangevin:bufrecv"); + memory->create(tagsend, maxlocal, "FixPIMDLangevin:tagsend"); + memory->create(tagrecv, maxlocal, "FixPIMDLangevin:tagrecv"); + memory->create(bufbeads, nreplica, maxlocal*3, "FixPIMDLangevin:bufrecv"); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::inter_replica_comm(double **ptr) +{ + MPI_Request requests[2]; + MPI_Status statuses[2]; + if (atom->nmax > maxlocal) reallocate(); + int nlocal = atom->nlocal; + // printf("me = %d starting inter_comm, nlocal = %d ntotal = %d\n", universe->me, nlocal, ntotal); + tagint *tag = atom->tag; + int i, m; + + // copy local values + for(i=0; itag[i]; + bufsorted[tagtmp-1][0] = ptr[i][0]; + bufsorted[tagtmp-1][1] = ptr[i][1]; + bufsorted[tagtmp-1][2] = ptr[i][2]; + m++; + } + MPI_Allgather(&m, 1, MPI_INT, counts, 1, MPI_INT, universe->uworld); + for (i = 0; i < nreplica; i++) { counts[i] *= 3; } + displacements[0] = 0; + for (i = 0; i < nreplica-1; i++) { displacements[i+1] = displacements[i] + counts[i]; } + MPI_Allgatherv(bufsorted[0], 3*m, MPI_DOUBLE, bufsortedall[0], counts, displacements, MPI_DOUBLE, universe->uworld); + // printf("me = %d bufsortedall[0] = %.8f %.8f %.8f bufsortedall[ntotal] = %.8f %.8f %.8f\n", universe->iworld, bufsortedall[0][0], bufsortedall[0][1], bufsortedall[0][2], bufsortedall[ntotal][0], bufsortedall[ntotal][1], bufsortedall[ntotal][2]); + /* + m = 0; + for(i=0; ime, nlocal, ntotal, m, sizeplan); + for(int iplan=0; iplanuworld, &requests[0]); + MPI_Irecv(tagrecv, ntotal, MPI_LMP_TAGINT, planrecv[iplan], 0, universe->uworld, &requests[1]); + // printf("me = %d iplan = %d irecv finished, plansend = %d, planrecv = %d, modeindex = %d\n", universe->me, iplan, plansend[iplan], planrecv[iplan], modeindex[iplan]); + // printf("bufsend[0]: %.4f %.4f %.4f\ntagsend[0]: %d\n", bufsend[0][0], bufsend[0][1], bufsend[0][2], tagsend[0]); + // printf("bufsend[255]: %.4f %.4f %.4f\ntagsend[255]: %d\n", bufsend[255][0], bufsend[255][1], bufsend[255][2], tagsend[255]); + MPI_Send(bufsend[0], 3*ntotal, MPI_DOUBLE, plansend[iplan], 0, universe->uworld); + MPI_Send(tagsend, ntotal, MPI_LMP_TAGINT, plansend[iplan], 0, universe->uworld); + // printf("me = %d MPI_Send done\n", universe->me); + MPI_Waitall(2, requests, statuses); + // printf("me = %d iplan = %d send recv finished\n", iplan, universe->me); + for(i=0; imap(tagrecv[i]); + bufbeads[modeindex[iplan]][3*m+0] = bufrecv[i][0]; + bufbeads[modeindex[iplan]][3*m+1] = bufrecv[i][1]; + bufbeads[modeindex[iplan]][3*m+2] = bufrecv[i][2]; + } + } + */ + // printf("me = %d finishing inter_comm\n", universe->me); + } + else if(cmode == MULTI_PROC) + { + m = 0; + // printf("me = %d trying to copy bufsend\n", universe->me); + for(i=0; ime, m); + // if(me==0) {for(i=0; ime, i, counts[i]);}} + // printf("me = %d") + MPI_Gather(&m, 1, MPI_INT, counts, 1, MPI_INT, 0, world); + // printf("me = %d counts gathered\n", universe->me); + // if(me==0) {for(i=0; ime, i, counts[i]);}} + displacements[0] = 0; + // printf("me = %d displacements[0] = %d\n", universe->me, displacements[0]); + for (i = 0; i < nprocs-1; i++) { displacements[i+1] = displacements[i] + counts[i]; } + // printf("me = %d displacements done\n", universe->me); + // if(me==0) {for(i=0; ime, i, displacements[i]);}} + MPI_Gatherv(tagsend, m, MPI_LMP_TAGINT, tagsendall, counts, displacements, MPI_LMP_TAGINT, 0, world); + // printf("me = %d tags gathered\n", universe->me); + for (i = 0; i < nprocs; i++) { counts[i] *= 3; } + for (i = 0; i < nprocs-1; i++) { displacements[i+1] = displacements[i] + counts[i]; } + MPI_Gatherv(bufsend[0], 3*m, MPI_DOUBLE, bufsendall[0], counts, displacements, MPI_DOUBLE, 0, world); + // printf("me = %d bufsend gathered\n", universe->me); + // printf("me = %d, tagrecvall[0] = %d bufrecvall[0][0] = %.4f\n", universe->me, tagrecvall[0], bufrecvall[0][0]); + + // printf("universe->me = %d comm->me = %d sizeplan = %d\n", universe->me, comm->me, sizeplan); + for(int iplan=0; iplanuworld, &requests[0]); + MPI_Irecv(tagrecvall, ntotal, MPI_LMP_TAGINT, planrecv[iplan], 0, universe->uworld, &requests[1]); + MPI_Send(bufsendall[0], 3*ntotal, MPI_DOUBLE, plansend[iplan], 0, universe->uworld); + MPI_Send(tagsendall, ntotal, MPI_LMP_TAGINT, plansend[iplan], 0, universe->uworld); + MPI_Waitall(2,requests,statuses); + } + // else{ + // printf("me = %d not sendrecceving\n", universe->me); + // } + + // printf("me = %d sendrecv finished\n", universe->me); + // printf("me = %d to be bcasted: tag[0] = %d bufrecvall[0][0] = %.4f\n", universe->me, tagrecvall[0], bufrecvall[0][0]); + MPI_Bcast(tagrecvall, ntotal, MPI_LMP_TAGINT, 0, world); + MPI_Bcast(bufrecvall[0], 3*ntotal, MPI_DOUBLE, 0, world); + // printf("me = %d broadcasted\n", universe->me); + for(i=0; imap(tagrecvall[i]); + if (m < 0 || m >= nlocal) continue; + bufbeads[modeindex[iplan]][3*m+0] = bufrecvall[i][0]; + bufbeads[modeindex[iplan]][3*m+1] = bufrecvall[i][1]; + bufbeads[modeindex[iplan]][3*m+2] = bufrecvall[i][2]; + } + } + // printf("me = %d, tag[0] = %d bufrecvall[0][0] = %.4f bufbeads[0][0] = %.4f bufbeads[1][0] = %.4f bufbeads done\n", universe->me, tag[0], bufrecvall[0][0], bufbeads[0][0], bufbeads[1][0]); + } +} + +/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::compute_vir_() +{ + int nlocal = atom->nlocal; + xf = vir_ = xcf = centroid_vir = 0.0; + int idx = atom->map(1); + // printf("in post_force, x_unwrap: %.6f %.6f %.6f xcall: %.6f %.6f %.6f\n", x_unwrap[idx][0], x_unwrap[idx][1], x_unwrap[idx][2], xcall[0], xcall[1], xcall[2]); + // printf("in compute_vir, xu = %.6f %.6f %.6f xc = %.6f %.6f %.6f\n", x_unwrap[idx][0], x_unwrap[idx][1], x_unwrap[idx][2], xc[idx][0], xc[idx][1], xc[idx][2]); + for(int i=0; if[i][j]; + xcf += (x_unwrap[i][j] - xc[i][j]) * atom->f[i][j]; + } + // int idx = atom->map(i+1); + // printf("me = %d step = %d tag = %d idx = %d xu = %.6f %.6f %.6f xc = %.6f %.6f %.6f f = %.6f %.6f %.6f\n", universe->me, update->ntimestep, i+1, idx, x_unwrap[idx][0], x_unwrap[idx][1], x_unwrap[idx][2], xc[idx][0], xc[idx][1], xc[idx][2], atom->f[idx][0], atom->f[idx][1], atom->f[idx][2]); + } + MPI_Allreduce(&xf, &vir_, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); + MPI_Allreduce(&xcf, ¢roid_vir, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); + if(pstyle == ANISO){ + for(int i=0; i<6; i++) c_vir_tensor[i] = 0.0; + for(int i=0; if[i][0]; + c_vir_tensor[1] += (x_unwrap[i][1] - xc[i][1]) * atom->f[i][1]; + c_vir_tensor[2] += (x_unwrap[i][2] - xc[i][2]) * atom->f[i][2]; + c_vir_tensor[3] += (x_unwrap[i][0] - xc[i][0]) * atom->f[i][1]; + c_vir_tensor[4] += (x_unwrap[i][0] - xc[i][0]) * atom->f[i][2]; + c_vir_tensor[5] += (x_unwrap[i][1] - xc[i][1]) * atom->f[i][2]; + } + MPI_Allreduce(MPI_IN_PLACE, &c_vir_tensor, 6, MPI_DOUBLE, MPI_SUM, universe->uworld); + } +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::compute_vir() +{ + volume = domain->xprd * domain->yprd * domain->zprd; + c_press->compute_vector(); + virial[0] = c_press->vector[0]*volume; + virial[1] = c_press->vector[1]*volume; + virial[2] = c_press->vector[2]*volume; + virial[3] = c_press->vector[3]*volume; + virial[4] = c_press->vector[4]*volume; + virial[5] = c_press->vector[5]*volume; + for(int i=0; i<6; i++) virial[i] /= universe->procs_per_world[universe->iworld]; + double vir_bead=(virial[0]+virial[1]+virial[2]); + MPI_Allreduce(&vir_bead, &vir, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); + MPI_Allreduce(MPI_IN_PLACE, &virial[0], 6, MPI_DOUBLE, MPI_SUM, universe->uworld); + // printf("me = %d step = %d vir = %.30e\n", universe->me, update->ntimestep, vir); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::compute_stress_tensor() +{ + int nlocal = atom->nlocal; + int *type = atom->type; + if(universe->iworld == 0){ + inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); + for(int i=0; i<6; i++) ke_tensor[i] = 0.0; + for(int i=0; iv[i][0] * atom->v[i][0] * force->mvv2e; + ke_tensor[1] += 0.5 * mass[type[i]] * atom->v[i][1] * atom->v[i][1] * force->mvv2e; + ke_tensor[2] += 0.5 * mass[type[i]] * atom->v[i][2] * atom->v[i][2] * force->mvv2e; + ke_tensor[3] += 0.5 * mass[type[i]] * atom->v[i][0] * atom->v[i][1] * force->mvv2e; + ke_tensor[4] += 0.5 * mass[type[i]] * atom->v[i][0] * atom->v[i][2] * force->mvv2e; + ke_tensor[5] += 0.5 * mass[type[i]] * atom->v[i][1] * atom->v[i][2] * force->mvv2e; + } + // MPI_Allreduce(&ke_tensor, &ke_tensor, 6, MPI_DOUBLE, MPI_SUM, world); + MPI_Allreduce(MPI_IN_PLACE, &ke_tensor, 6, MPI_DOUBLE, MPI_SUM, world); + for(int i=0; i<6; i++) + { + stress_tensor[i] = inv_volume * ((2*ke_tensor[i] - c_vir_tensor[i]) * force->nktv2p + virial[i]) / np; + // printf("i = %d, c_vir = %.6f, virial = %.6f stress = %.6f\n", i, c_vir_tensor[i], virial[i], stress_tensor[i]); + } + } + MPI_Bcast(&stress_tensor, 6, MPI_DOUBLE, 0, universe->uworld); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::compute_totke() +{ + kine = 0.0; + totke = ke_bead = 0.0; + int nlocal = atom->nlocal; + int *type = atom->type; + for(int i=0; iv[i][j] * atom->v[i][j]; + } + } + kine *= force->mvv2e; + // printf("me = %d, kine = %.6e\n", universe->me, kine); + MPI_Allreduce(&kine, &ke_bead, 1, MPI_DOUBLE, MPI_SUM, world); + // MPI_Allreduce(&kine, &totke, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); + // totke *= force->mvv2e / np; + + // c_press->compute_scalar(); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::compute_spring_energy() +{ + spring_energy = 0.0; + total_spring_energy = se_bead = 0.0; + + double **x = atom->x; + double* _mass = atom->mass; + int* type = atom->type; + int nlocal = atom->nlocal; + // printf("iworld = %d, fbond = %.4e lam = %.4e\n", universe->iworld, fbond, lam[universe->iworld]); + + for(int i=0; iiworld] * (x[i][0]*x[i][0] + x[i][1]*x[i][1] + x[i][2]*x[i][2]); + } + MPI_Allreduce(&spring_energy, &se_bead, 1, MPI_DOUBLE, MPI_SUM, world); + // MPI_Allreduce(&spring_energy, &total_spring_energy, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); + // total_spring_energy /= np; +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::compute_pote() +{ + pe_bead = 0.0; + pot_energy_partition = 0.0; + pote = 0.0; + c_pe->compute_scalar(); + pe_bead = c_pe->scalar; + pot_energy_partition = pe_bead / universe->procs_per_world[universe->iworld]; + // MPI_Allreduce(&pot_energy_partition, &pote, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); + // pote /= np; +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::compute_tote() +{ + tote = totke + pote + total_spring_energy; +} + +/* ---------------------------------------------------------------------- */ +/* +void FixPIMDLangevin::compute_t_prim() +{ + t_prim = 1.5 * atom->natoms * np * force->boltz * temp - total_spring_energy; +} +*/ +/* ---------------------------------------------------------------------- */ +/* +void FixPIMDLangevin::compute_t_vir() +{ + t_vir = -0.5 / np * vir_; + t_cv = 1.5 * atom->natoms * force->boltz * temp - 0.5 / np * centroid_vir; +} +*/ +/* ---------------------------------------------------------------------- */ +/* +void FixPIMDLangevin::compute_p_prim() +{ + p_prim = atom->natoms * np * force->boltz * temp * inv_volume - 1.0 / 1.5 * inv_volume * total_spring_energy; + p_prim *= force->nktv2p; +} +*/ +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::compute_p_cv() +{ + inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); + // p_md = 2. / 3 * inv_volume * ((totke - total_spring_energy) * force->nktv2p + 0.5 * vir / np) ; + // printf("inv_V = %.30e ke = %.30e cv = %.30e vir = %.30e\n", inv_volume, ke_bead, centroid_vir, vir); + if(universe->iworld == 0) + { + p_cv = 1. / 3. * inv_volume * ((2. * ke_bead - 1. * centroid_vir) * force->nktv2p + 1. * vir) / np; + } + MPI_Bcast(&p_cv, 1, MPI_DOUBLE, 0, universe->uworld); +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::compute_totenthalpy() +{ + volume = domain->xprd * domain->yprd * domain->zprd; + if(barostat == BZP) + { + if(pstyle == ISO) + { + totenthalpy = tote + 0.5*W*vw[0]*vw[0]/np + Pext * volume / force->nktv2p - Vcoeff * kBT * log(volume); + } + else if(pstyle == ANISO) + { + totenthalpy = tote + 0.5*W*vw[0]*vw[0]/np + 0.5*W*vw[1]*vw[1]/np + 0.5*W*vw[2]*vw[2]/np + Pext * volume / force->nktv2p - Vcoeff * kBT * log(volume); + } + } + else if(barostat == MTTK) totenthalpy = tote + 1.5*W*vw[0]*vw[0]/np + Pext * (volume - vol0); +} + +/* ---------------------------------------------------------------------- */ + +double FixPIMDLangevin::compute_vector(int n) +{ + if(n==0) { return ke_bead; } + if(n==1) { return se_bead; } + if(n==2) { return pe_bead; } + if(n==3) { return tote; } + // if(n==3) { return W*vw[0]; } + if(!pstat_flag) + { + if(n==4) { return t_prim; } + if(n==5) { return t_vir; } + if(n==6) { return t_cv; } + } + else if(pstat_flag) + { + if(pstyle == ISO) + { + if(barostat == BZP) + { + if(n==4) { return 0.5*W*vw[0]*vw[0]; } + } + else if(barostat == MTTK) + { + if(n==4) { return 1.5*W*vw[0]*vw[0]; } + } + if(n==5) { volume = domain->xprd * domain->yprd * domain->zprd; return np * Pext * volume / force->nktv2p; } + if(n==6) { volume = domain->xprd * domain->yprd * domain->zprd; return - Vcoeff * np * kBT * log(volume); } + if(n==7) { return totenthalpy; } + if(n==8) { return p_cv; } + if(n==9) { return total_spring_energy; } + } + else if(pstyle == ANISO) + { + + } + } + /* + + if(n==7) { return p_prim; } + if(n==8) { return p_md; } + if(n==9) { return p_cv; } + if(n==10) {return totenthalpy; + if(pstyle == ISO){ + if(n==11) { return vw[0]; } + if(n==12) { + if(barostat == BZP) { return 0.5*W*vw[0]*vw[0]; } + else if(barostat == MTTK) { return 1.5*W*vw[0]*vw[0]; } + } + if(n==13) { volume = domain->xprd * domain->yprd * domain->zprd; return np * Pext * volume / force->nktv2p; } + if(n==14) { volume = domain->xprd * domain->yprd * domain->zprd; + // printf("Vcoeff = %.6e np = %d kBT = %.6e logV = %.6e\n", Vcoeff, np, kBT, log(volume)); + return - Vcoeff * np * kBT * log(volume); } + } + else if(pstyle==ANISO){ + if(n>10 && n<=13) return vw[n-11]; + if(n==14) return 0.5*W*vw[0]*vw[0]+0.5*W*vw[1]*vw[1]+0.5*W*vw[2]*vw[2]; + if(n>14 && n<21) return stress_tensor[n-15]; + if(n==21) { volume = domain->xprd * domain->yprd * domain->zprd; return np * Pext * volume / force->nktv2p; } + if(n==22) { volume = domain->xprd * domain->yprd * domain->zprd; return - Vcoeff * np * kBT * log(volume); } + } + return 0.0; + */ +} diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h new file mode 100644 index 0000000000..02e78935aa --- /dev/null +++ b/src/REPLICA/fix_pimd_langevin.h @@ -0,0 +1,198 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS development team: developers@lammps.org + + 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 +// clang-format off +FixStyle(pimd/langevin,FixPIMDLangevin); +// clang-format on +#else + +#ifndef FIX_PIMD_LANGEVIN_H +#define FIX_PIMD_LANGEVIN_H + +#include "fix.h" + +namespace LAMMPS_NS { + +class FixPIMDLangevin : public Fix { + public: + FixPIMDLangevin(class LAMMPS *, int, char **); + ~FixPIMDLangevin() override; + + int setmask() override; + + void init() override; + void setup(int) override; +// void post_neighbor() override; + void post_force(int) override; + void initial_integrate(int) override; + void final_integrate() override; + void end_of_step() override; + + double compute_vector(int) override; + + /* System setting variables */ + int method; // PIMD or NMPIMD or CMD + int fmmode; // physical or normal + int np; // number of beads + double inverse_np; // 1.0/np + double temp; // temperature + double planck, hbar; // Planck's constant + double lj_epsilon, lj_sigma, lj_mass; // LJ unit energy, length, and mass scales + double other_planck; + double kBT; // k_B * temp + double beta, beta_np; // beta = 1./kBT beta_np = 1./kBT/np + int thermostat; // NHC or PILE_L + int barostat; // BZP + int integrator; // obabo or baoab + int ensemble; // nve or nvt or nph or npt + int mapflag; // should be 1 if number of beads > 1 + int removecomflag; + double masstotal; + + // void remove_com_motion(); + + double fixedpoint[3]; // location of dilation fixed-point + /* ring-polymer model */ + + double omega_np, fbond, spring_energy, sp; + + /* fictitious mass */ + + double fmass, *mass; + + /* inter-partition communication */ + + MPI_Comm rootworld; + int me, nprocs, ireplica, nreplica, nprocs_universe; + int ntotal, maxlocal; + + int cmode; + int sizeplan; + int *plansend, *planrecv; + + tagint *tagsend, *tagrecv; + double **bufsend, **bufrecv, **bufbeads; + double **bufsorted, **bufsortedall; + double **outsorted, **buftransall; + + tagint *tagsendall, *tagrecvall; + double **bufsendall, **bufrecvall; + + int *counts, *displacements; + + void comm_init(); + void inter_replica_comm(double **ptr); + + /* normal-mode operations */ + + double *lam, **M_x2xp, **M_xp2x, **M_f2fp, **M_fp2f; + int *modeindex; + + void reallocate(); + void nmpimd_init(); + void nmpimd_transform(double **src, double **des, double **mat); + void nmpimd_transform(double **, double **, double *); + + /* Langevin integration */ + + double dtv, dtf, dtv2, dtv3; + double gamma, c1, c2, tau; + double *tau_k, *c1_k, *c2_k; + double pilescale=1.0; + double Lan_temp; + double r1, r2, r3; + double _omega_np, *_omega_k, *Lan_s, *Lan_c; // sin(omega_k*dt*0.5), cos(omega_k*dt*0.5) + + class RanMars *random; + int seed=975481; + FILE *frand; + + int tstat_flag; // tstat_flat = 1 if thermostat if used + void Langevin_init(); + void b_step(); // integrate for dt/2 according to B part (v <- v + f * dt/2) + void a_step(); // integrate for dt/2 according to A part (non-centroid mode, harmonic force between replicas) + void qc_step(); // integrate for dt/2 for the centroid mode (x <- x + v * dt/2) + void o_step(); // integrate for dt according to O part (O-U process, for thermostating) + + /* Bussi-Zykova-Parrinello barostat */ + + double f_omega, mtk_term1; + int pstat_flag; // pstat_flag = 1 if barostat is used + int pstyle; // pstyle = ISO or ANISO (will support TRICLINIC in the future) + double W, tau_p, Pext, totenthalpy = 0.0, Vcoeff; + int p_flag[6]; + double vw[6]; // barostat velocity + double ke_tensor[6]; // kinetic energy tensor + double c_vir_tensor[6]; // centroid-virial tensor + double stress_tensor[6]; // path integral centroid-virial stress tensor + + void baro_init(); + void press_v_step(); + void press_o_step(); + + /* centroid-virial estimator computation */ + double vol0 = 0.0; + double inv_volume = 0.0; + // double inv_volume = 0.0, vol_ = 0.0, vol0 = 0.0; + double volume = 0.0; + double **xc, *xcall; + int maxxc; + // int n_unwrap; + int maxunwrap; + // int maxunwrap, nlocal_init; +// tagint *tag_init, *tag_initall; +// imageint *image_init, *image_initall; + double **x_unwrap; +// double **x_unwrap, **x_unwrapsort; +// double **x_unwrapall; +// void init_x_unwrap(); + void reallocate_x_unwrap(); + void reallocate_xc(); + void collect_xc(); + // void compute_xc(); + // void compute_fc(); + double xf, vir, vir_, xcf, centroid_vir; + double t_vir, t_cv, p_prim, p_vir, p_cv, p_cv_, p_md; + // double vir_, xcf, vir2; + + /* Computes */ + double kine, pote, tote, totke; + double ke_bead, se_bead, pe_bead, pot_energy_partition; + double total_spring_energy; + double t_prim; + // double p_prim; + char *id_pe; + char *id_press; + class Compute *c_pe; + class Compute *c_press; + + void compute_totke(); // 1: kinetic energy + void compute_spring_energy(); // 2: spring elastic energy + void compute_pote(); // 3: potential energy + void compute_tote(); // 4: total energy: 1+2+3 for all the beads + // void compute_t_prim(); // 5: primitive kinetic energy estimator + // void compute_p_prim(); // primitive pressure estimator + void compute_stress_tensor(); + // void compute_t_vir(); // centroid-virial kinetic energy estimator + void compute_p_cv(); // centroid-virial pressure estimator + // void compute_p_vir(); // centroid-virial pressure estimator + void compute_vir(); + void compute_vir_(); + void compute_totenthalpy(); +}; + +} // namespace LAMMPS_NS + +#endif +#endif From c351b63919f8646cb7943742e6cffed32aa52d79 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 24 Feb 2023 11:48:28 -0500 Subject: [PATCH 003/172] fix pimd/langevin put properties and functions below protected --- src/REPLICA/fix_pimd_langevin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index 02e78935aa..4f0390c700 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -41,6 +41,7 @@ class FixPIMDLangevin : public Fix { double compute_vector(int) override; + protected: /* System setting variables */ int method; // PIMD or NMPIMD or CMD int fmmode; // physical or normal From 3737b5f774b99ed5d8a34b10de6057817afbb875 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 25 Feb 2023 16:22:27 -0500 Subject: [PATCH 004/172] whitespace fixes and clang-format on the header --- src/REPLICA/fix_pimd_langevin.cpp | 90 +++++++++++++++---------------- src/REPLICA/fix_pimd_langevin.h | 86 ++++++++++++++--------------- 2 files changed, 86 insertions(+), 90 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 9ac8fc3b17..1b2e734922 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -146,7 +146,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n fmass = utils::numeric(FLERR, arg[i + 1], false, lmp); if (fmass < 0.0 || fmass > 1.0) error->universe_all(FLERR, "Invalid fmass value for fix pimd"); - } + } else if(strcmp(arg[i], "fmmode")==0) { @@ -164,7 +164,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n else if (strcmp(arg[i], "temp") == 0) { temp = utils::numeric(FLERR, arg[i + 1], false, lmp); if (temp < 0.0) error->universe_all(FLERR, "Invalid temp value for fix pimd"); - } + } else if (strcmp(arg[i], "lj") == 0) { lj_epsilon = utils::numeric(FLERR, arg[i+1], false, lmp); @@ -178,7 +178,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n else if(strcmp(arg[i], "thermostat")==0) { - if(strcmp(arg[i+1],"PILE_L")==0) + if(strcmp(arg[i+1],"PILE_L")==0) { thermostat = PILE_L; seed = atoi(arg[i+2]); @@ -190,7 +190,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n { tau = atof(arg[i+1]); } - + else if(strcmp(arg[i], "press")==0) { Pext = atof(arg[i+1]); @@ -199,7 +199,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n else if(strcmp(arg[i], "barostat")==0) { - if(strcmp(arg[i+1],"MTTK")==0) + if(strcmp(arg[i+1],"MTTK")==0) { barostat = MTTK; } @@ -292,7 +292,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n Lan_temp = temp; random = new RanMars(lmp, seed + universe->me); } - + me = comm->me; nprocs = comm->nprocs; if(nprocs == 1) cmode = SINGLE_PROC; @@ -385,7 +385,7 @@ void FixPIMDLangevin::init() inverse_np = 1.0 / np; const double Boltzmann = force->boltz; - if (strcmp(update->unit_style,"lj") == 0) { + if (strcmp(update->unit_style,"lj") == 0) { double planck_star = sqrt(lj_epsilon)*sqrt(atom->mass[0])*lj_sigma; planck = other_planck / planck_star; } @@ -517,10 +517,10 @@ void FixPIMDLangevin::setup(int vflag) // compute_pote(); // if(pstyle==ANISO) compute_stress_tensor(); end_of_step(); - c_pe->addstep(update->ntimestep+1); + c_pe->addstep(update->ntimestep+1); c_press->addstep(update->ntimestep+1); // printf("setup ending: \ncell = %.16e %.16e %.16e\nvol = %.16e\n", domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); - // printf("me = %d, setup finished\n", universe->me); + // printf("me = %d, setup finished\n", universe->me); } /* ---------------------------------------------------------------------- */ @@ -557,7 +557,7 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) press_v_step(); } /* - if(pstat_flag) + if(pstat_flag) { } */ @@ -580,7 +580,7 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) } else if(integrator==baoab) { - if(pstat_flag) + if(pstat_flag) { compute_totke(); compute_p_cv(); @@ -604,7 +604,7 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) if(pstat_flag) press_o_step(); } qc_step(); - a_step(); + a_step(); } else { @@ -612,7 +612,7 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) } collect_xc(); compute_spring_energy(); - + if(method==NMPIMD) { inter_replica_comm(x); @@ -636,7 +636,7 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) void FixPIMDLangevin::final_integrate() { - if(pstat_flag) + if(pstat_flag) { compute_totke(); compute_p_cv(); @@ -655,7 +655,7 @@ void FixPIMDLangevin::final_integrate() } else if(integrator==baoab) { - + } else { @@ -720,8 +720,8 @@ void FixPIMDLangevin::post_force(int /*flag*/) else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, f, M_x2xp[universe->iworld]); // nmpimd_transform(bufbeads, f, M_x2xp[universe->iworld]); } - c_pe->addstep(update->ntimestep+1); - c_press->addstep(update->ntimestep+1); + c_pe->addstep(update->ntimestep+1); + c_press->addstep(update->ntimestep+1); // printf("me = %d, step %d post_force ends!\n", universe->me, update->ntimestep); } @@ -804,7 +804,7 @@ void FixPIMDLangevin::update_x_unwrap() // x_unwrap = new double[nlocal*3]; // printf("me = %d, doing xu\n", universe->me); for(int i=0; iboxlo[0]; oldhi = domain->boxhi[0]; - + domain->boxlo[0] = (oldlo-fixedpoint[0])*expq[0] + fixedpoint[0]; domain->boxhi[0] = (oldhi-fixedpoint[0])*expq[0] + fixedpoint[0]; @@ -912,13 +912,13 @@ void FixPIMDLangevin::qc_step(){ oldhi = domain->boxhi[1]; domain->boxlo[1] = (oldlo-fixedpoint[1])*expq[1] + fixedpoint[1]; domain->boxhi[1] = (oldhi-fixedpoint[1])*expq[1] + fixedpoint[1]; - + oldlo = domain->boxlo[2]; oldhi = domain->boxhi[2]; domain->boxlo[2] = (oldlo-fixedpoint[2])*expq[2] + fixedpoint[2]; domain->boxhi[2] = (oldhi-fixedpoint[2])*expq[2] + fixedpoint[2]; } - } + } MPI_Barrier(universe->uworld); MPI_Bcast(&domain->boxlo[0], 3, MPI_DOUBLE, 0, universe->uworld); MPI_Bcast(&domain->boxhi[0], 3, MPI_DOUBLE, 0, universe->uworld); @@ -942,8 +942,8 @@ void FixPIMDLangevin::a_step(){ // printf("iworld = %d c = %.4e s = %.4e w = %.4e\n", universe->iworld, Lan_c[universe->iworld], Lan_s[universe->iworld], _omega_k[universe->iworld]); for(int i=0; iiworld] * x0 + 1./_omega_k[universe->iworld] * Lan_s[universe->iworld] * v0; @@ -967,7 +967,7 @@ void FixPIMDLangevin::remove_com_motion(){ int nlocal = atom->nlocal; if (dynamic) masstotal = group->mass(igroup); double vcm[3]; - group->vcm(igroup,masstotal,vcm); + group->vcm(igroup,masstotal,vcm); for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { v[i][0] -= vcm[0]; @@ -999,7 +999,7 @@ void FixPIMDLangevin::press_v_step() int nlocal = atom->nlocal; double **f = atom->f; double **v = atom->v; - int *type = atom->type; + int *type = atom->type; volume = domain->xprd * domain->yprd * domain->zprd; if(pstyle == ISO) @@ -1079,7 +1079,7 @@ void FixPIMDLangevin::press_o_step() vw[2] = c1 * vw[2] + c2 * sqrt(1. / W / beta_np) * r3; } MPI_Barrier(universe->uworld); - MPI_Bcast(&vw, 3, MPI_DOUBLE, 0, universe->uworld); + MPI_Bcast(&vw, 3, MPI_DOUBLE, 0, universe->uworld); } } @@ -1099,7 +1099,7 @@ void FixPIMDLangevin::Langevin_init() if(fmmode==physical){ for (int i=0; i 0) gamma = 1.0 / tau; else gamma = np / beta / hbar; - + if(integrator==obabo) c1 = exp(-gamma * 0.5 * update->dt); // tau is the damping time of the centroid mode. - else if(integrator==baoab) c1 = exp(-gamma * update->dt); + else if(integrator==baoab) c1 = exp(-gamma * update->dt); else error->universe_all(FLERR, "Unknown integrator parameter for fix pimd. Only obabo and baoab integrators is supported!"); c2 = sqrt(1.0 - c1 * c1); // note that c1 and c2 here only works for the centroid mode. @@ -1125,7 +1125,7 @@ void FixPIMDLangevin::Langevin_init() if( thermostat == PILE_L ) { std::string out = "\nInitializing PI Langevin equation thermostat...\n"; - out += "Bead ID | omega | tau | c1 | c2\n"; + out += "Bead ID | omega | tau | c1 | c2\n"; tau_k = new double[np]; c1_k = new double[np]; c2_k = new double[np]; @@ -1162,7 +1162,7 @@ void FixPIMDLangevin::o_step() r1 = random->gaussian(); r2 = random->gaussian(); r3 = random->gaussian(); - atom->v[i][0] = c1_k[universe->iworld] * atom->v[i][0] + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r1; + atom->v[i][0] = c1_k[universe->iworld] * atom->v[i][0] + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r1; atom->v[i][1] = c1_k[universe->iworld] * atom->v[i][1] + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r2; atom->v[i][2] = c1_k[universe->iworld] * atom->v[i][2] + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r3; } @@ -1188,7 +1188,7 @@ void FixPIMDLangevin::nmpimd_init() // Set up eigenvectors for degenerated modes for(int j=0; jdestroy(tag_init); memory->destroy(image_init); memory->destroy(x_unwrapsort); - memory->create(x_unwrap, maxunwrap, 3, "FixPIMDLangevin:x_unwrap"); + memory->create(x_unwrap, maxunwrap, 3, "FixPIMDLangevin:x_unwrap"); memory->create(tag_init, maxunwrap, "FixPIMDLangevin:tag_init"); memory->create(image_init, maxunwrap, "FixPIMDLangevin:image_init"); memory->create(x_unwrapsort, ntotal, 3, "FixPIMDLangevin:x_unwrapsort"); @@ -1552,7 +1552,7 @@ void FixPIMDLangevin::compute_stress_tensor() } // MPI_Allreduce(&ke_tensor, &ke_tensor, 6, MPI_DOUBLE, MPI_SUM, world); MPI_Allreduce(MPI_IN_PLACE, &ke_tensor, 6, MPI_DOUBLE, MPI_SUM, world); - for(int i=0; i<6; i++) + for(int i=0; i<6; i++) { stress_tensor[i] = inv_volume * ((2*ke_tensor[i] - c_vir_tensor[i]) * force->nktv2p + virial[i]) / np; // printf("i = %d, c_vir = %.6f, virial = %.6f stress = %.6f\n", i, c_vir_tensor[i], virial[i], stress_tensor[i]); @@ -1600,7 +1600,7 @@ void FixPIMDLangevin::compute_spring_energy() for(int i=0; iiworld] * (x[i][0]*x[i][0] + x[i][1]*x[i][1] + x[i][2]*x[i][2]); + spring_energy += 0.5 * _mass[type[i]] * fbond * lam[universe->iworld] * (x[i][0]*x[i][0] + x[i][1]*x[i][1] + x[i][2]*x[i][2]); } MPI_Allreduce(&spring_energy, &se_bead, 1, MPI_DOUBLE, MPI_SUM, world); // MPI_Allreduce(&spring_energy, &total_spring_energy, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); @@ -1660,7 +1660,7 @@ void FixPIMDLangevin::compute_p_cv() // printf("inv_V = %.30e ke = %.30e cv = %.30e vir = %.30e\n", inv_volume, ke_bead, centroid_vir, vir); if(universe->iworld == 0) { - p_cv = 1. / 3. * inv_volume * ((2. * ke_bead - 1. * centroid_vir) * force->nktv2p + 1. * vir) / np; + p_cv = 1. / 3. * inv_volume * ((2. * ke_bead - 1. * centroid_vir) * force->nktv2p + 1. * vir) / np; } MPI_Bcast(&p_cv, 1, MPI_DOUBLE, 0, universe->uworld); } @@ -1670,7 +1670,7 @@ void FixPIMDLangevin::compute_p_cv() void FixPIMDLangevin::compute_totenthalpy() { volume = domain->xprd * domain->yprd * domain->zprd; - if(barostat == BZP) + if(barostat == BZP) { if(pstyle == ISO) { @@ -1719,23 +1719,23 @@ double FixPIMDLangevin::compute_vector(int n) } else if(pstyle == ANISO) { - + } } /* - + if(n==7) { return p_prim; } if(n==8) { return p_md; } if(n==9) { return p_cv; } if(n==10) {return totenthalpy; if(pstyle == ISO){ if(n==11) { return vw[0]; } - if(n==12) { + if(n==12) { if(barostat == BZP) { return 0.5*W*vw[0]*vw[0]; } else if(barostat == MTTK) { return 1.5*W*vw[0]*vw[0]; } } if(n==13) { volume = domain->xprd * domain->yprd * domain->zprd; return np * Pext * volume / force->nktv2p; } - if(n==14) { volume = domain->xprd * domain->yprd * domain->zprd; + if(n==14) { volume = domain->xprd * domain->yprd * domain->zprd; // printf("Vcoeff = %.6e np = %d kBT = %.6e logV = %.6e\n", Vcoeff, np, kBT, log(volume)); return - Vcoeff * np * kBT * log(volume); } } diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index 4f0390c700..cf2d63b91c 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -33,7 +33,6 @@ class FixPIMDLangevin : public Fix { void init() override; void setup(int) override; -// void post_neighbor() override; void post_force(int) override; void initial_integrate(int) override; void final_integrate() override; @@ -43,26 +42,24 @@ class FixPIMDLangevin : public Fix { protected: /* System setting variables */ - int method; // PIMD or NMPIMD or CMD - int fmmode; // physical or normal - int np; // number of beads - double inverse_np; // 1.0/np - double temp; // temperature - double planck, hbar; // Planck's constant - double lj_epsilon, lj_sigma, lj_mass; // LJ unit energy, length, and mass scales + int method; // PIMD or NMPIMD or CMD + int fmmode; // physical or normal + int np; // number of beads + double inverse_np; // 1.0/np + double temp; // temperature + double planck, hbar; // Planck's constant + double lj_epsilon, lj_sigma, lj_mass; // LJ unit energy, length, and mass scales double other_planck; - double kBT; // k_B * temp - double beta, beta_np; // beta = 1./kBT beta_np = 1./kBT/np - int thermostat; // NHC or PILE_L - int barostat; // BZP - int integrator; // obabo or baoab - int ensemble; // nve or nvt or nph or npt - int mapflag; // should be 1 if number of beads > 1 + double kBT; // k_B * temp + double beta, beta_np; // beta = 1./kBT beta_np = 1./kBT/np + int thermostat; // NHC or PILE_L + int barostat; // BZP + int integrator; // obabo or baoab + int ensemble; // nve or nvt or nph or npt + int mapflag; // should be 1 if number of beads > 1 int removecomflag; double masstotal; - // void remove_com_motion(); - double fixedpoint[3]; // location of dilation fixed-point /* ring-polymer model */ @@ -82,7 +79,7 @@ class FixPIMDLangevin : public Fix { int sizeplan; int *plansend, *planrecv; - tagint *tagsend, *tagrecv; + tagint *tagsend, *tagrecv; double **bufsend, **bufrecv, **bufbeads; double **bufsorted, **bufsortedall; double **outsorted, **buftransall; @@ -110,33 +107,34 @@ class FixPIMDLangevin : public Fix { double dtv, dtf, dtv2, dtv3; double gamma, c1, c2, tau; double *tau_k, *c1_k, *c2_k; - double pilescale=1.0; + double pilescale = 1.0; double Lan_temp; double r1, r2, r3; - double _omega_np, *_omega_k, *Lan_s, *Lan_c; // sin(omega_k*dt*0.5), cos(omega_k*dt*0.5) + double _omega_np, *_omega_k, *Lan_s, *Lan_c; // sin(omega_k*dt*0.5), cos(omega_k*dt*0.5) class RanMars *random; - int seed=975481; + int seed = 975481; FILE *frand; - int tstat_flag; // tstat_flat = 1 if thermostat if used + int tstat_flag; // tstat_flat = 1 if thermostat if used void Langevin_init(); - void b_step(); // integrate for dt/2 according to B part (v <- v + f * dt/2) - void a_step(); // integrate for dt/2 according to A part (non-centroid mode, harmonic force between replicas) - void qc_step(); // integrate for dt/2 for the centroid mode (x <- x + v * dt/2) - void o_step(); // integrate for dt according to O part (O-U process, for thermostating) - + void b_step(); // integrate for dt/2 according to B part (v <- v + f * dt/2) + void + a_step(); // integrate for dt/2 according to A part (non-centroid mode, harmonic force between replicas) + void qc_step(); // integrate for dt/2 for the centroid mode (x <- x + v * dt/2) + void o_step(); // integrate for dt according to O part (O-U process, for thermostating) + /* Bussi-Zykova-Parrinello barostat */ double f_omega, mtk_term1; - int pstat_flag; // pstat_flag = 1 if barostat is used - int pstyle; // pstyle = ISO or ANISO (will support TRICLINIC in the future) + int pstat_flag; // pstat_flag = 1 if barostat is used + int pstyle; // pstyle = ISO or ANISO (will support TRICLINIC in the future) double W, tau_p, Pext, totenthalpy = 0.0, Vcoeff; int p_flag[6]; - double vw[6]; // barostat velocity - double ke_tensor[6]; // kinetic energy tensor - double c_vir_tensor[6]; // centroid-virial tensor - double stress_tensor[6]; // path integral centroid-virial stress tensor + double vw[6]; // barostat velocity + double ke_tensor[6]; // kinetic energy tensor + double c_vir_tensor[6]; // centroid-virial tensor + double stress_tensor[6]; // path integral centroid-virial stress tensor void baro_init(); void press_v_step(); @@ -152,12 +150,12 @@ class FixPIMDLangevin : public Fix { // int n_unwrap; int maxunwrap; // int maxunwrap, nlocal_init; -// tagint *tag_init, *tag_initall; -// imageint *image_init, *image_initall; + // tagint *tag_init, *tag_initall; + // imageint *image_init, *image_initall; double **x_unwrap; -// double **x_unwrap, **x_unwrapsort; -// double **x_unwrapall; -// void init_x_unwrap(); + // double **x_unwrap, **x_unwrapsort; + // double **x_unwrapall; + // void init_x_unwrap(); void reallocate_x_unwrap(); void reallocate_xc(); void collect_xc(); @@ -178,22 +176,20 @@ class FixPIMDLangevin : public Fix { class Compute *c_pe; class Compute *c_press; - void compute_totke(); // 1: kinetic energy - void compute_spring_energy(); // 2: spring elastic energy - void compute_pote(); // 3: potential energy - void compute_tote(); // 4: total energy: 1+2+3 for all the beads + void compute_totke(); // 1: kinetic energy + void compute_spring_energy(); // 2: spring elastic energy + void compute_pote(); // 3: potential energy + void compute_tote(); // 4: total energy: 1+2+3 for all the beads // void compute_t_prim(); // 5: primitive kinetic energy estimator // void compute_p_prim(); // primitive pressure estimator void compute_stress_tensor(); // void compute_t_vir(); // centroid-virial kinetic energy estimator - void compute_p_cv(); // centroid-virial pressure estimator + void compute_p_cv(); // centroid-virial pressure estimator // void compute_p_vir(); // centroid-virial pressure estimator void compute_vir(); void compute_vir_(); void compute_totenthalpy(); }; - } // namespace LAMMPS_NS - #endif #endif From 0911565660831d554272900e6d140c5a3f46c170 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 25 Feb 2023 16:36:01 -0500 Subject: [PATCH 005/172] prepare for inclusion of fix pimd/langevin --- doc/src/Commands_fix.rst | 1 + doc/src/fix.rst | 3 +- doc/src/fix_pimd.rst | 70 ++++++++++++++++++++++------------------ src/.gitignore | 2 ++ 4 files changed, 44 insertions(+), 32 deletions(-) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index d275b33eba..9c5b0d4a0f 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -168,6 +168,7 @@ OPT. * :doc:`pafi ` * :doc:`pair ` * :doc:`phonon ` + * :doc:`pimd/langevin ` * :doc:`pimd/nvt ` * :doc:`planeforce ` * :doc:`plumed ` diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 2dfe97a3ec..6f9f29db25 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -320,7 +320,8 @@ accelerated styles exist. * :doc:`pafi ` - constrained force averages on hyper-planes to compute free energies (PAFI) * :doc:`pair ` - access per-atom info from pair styles * :doc:`phonon ` - calculate dynamical matrix from MD simulations -* :doc:`pimd/nvt ` - Feynman path integral molecular dynamics with Nose-Hoover thermostat +* :doc:`pimd/langevin ` - Feynman path-integral molecular dynamics with stochastic thermostat +* :doc:`pimd/nvt ` - Feynman path-integral molecular dynamics with Nose-Hoover thermostat * :doc:`planeforce ` - constrain atoms to move in a plane * :doc:`plumed ` - wrapper on PLUMED free energy library * :doc:`poems ` - constrain clusters of atoms to move as coupled rigid bodies diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 0a4f9a38fb..342530e6a9 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -1,17 +1,21 @@ +.. index:: fix pimd/langevin .. index:: fix pimd/nvt +fix pimd/langevin command +========================= + fix pimd/nvt command -================ +==================== Syntax """""" .. parsed-literal:: - fix ID group-ID pimd/nvt keyword value ... + fix ID group-ID style keyword value ... * ID, group-ID are documented in :doc:`fix ` command -* pimd/nvt = style name of this fix command +* style = *pimd/langevin* or *pimd/nvt* = style name of this fix command * zero or more keyword/value pairs may be appended * keyword = *method* or *fmass* or *sp* or *temp* or *nhc* @@ -35,14 +39,15 @@ Description .. versionchanged:: TBD -Fix pimd was renamed to fix pimd/nvt. +Fix pimd was renamed to fix *pimd/nvt* and fix *pimd/langevin* was added. -This command performs quantum molecular dynamics simulations based on -the Feynman path integral to include effects of tunneling and +These fix commands perform quantum molecular dynamics simulations based +on the Feynman path-integral to include effects of tunneling and zero-point motion. In this formalism, the isomorphism of a quantum partition function for the original system to a classical partition function for a ring-polymer system is exploited, to efficiently sample configurations from the canonical ensemble :ref:`(Feynman) `. + The classical partition function and its components are given by the following equations: @@ -53,27 +58,28 @@ by the following equations: V_{eff} = & \sum_{i=1}^P \bigg[ \frac{mP}{2\beta^2 \hbar^2} (q_i - q_{i+1})^2 + \frac{1}{P} V(q_i)\bigg] The interested user is referred to any of the numerous references on -this methodology, but briefly, each quantum particle in a path -integral simulation is represented by a ring-polymer of P quasi-beads, -labeled from 1 to P. During the simulation, each quasi-bead interacts -with beads on the other ring-polymers with the same imaginary time -index (the second term in the effective potential above). The -quasi-beads also interact with the two neighboring quasi-beads through -the spring potential in imaginary-time space (first term in effective -potential). To sample the canonical ensemble, a Nose-Hoover massive -chain thermostat is applied :ref:`(Tuckerman) `. With the -massive chain algorithm, a chain of NH thermostats is coupled to each -degree of freedom for each quasi-bead. The keyword *temp* sets the -target temperature for the system and the keyword *nhc* sets the -number *Nc* of thermostats in each chain. For example, for a -simulation of N particles with P beads in each ring-polymer, the total -number of NH thermostats would be 3 x N x P x Nc. +this methodology, but briefly, each quantum particle in a path integral +simulation is represented by a ring-polymer of P quasi-beads, labeled +from 1 to P. During the simulation, each quasi-bead interacts with +beads on the other ring-polymers with the same imaginary time index (the +second term in the effective potential above). The quasi-beads also +interact with the two neighboring quasi-beads through the spring +potential in imaginary-time space (first term in effective potential). +To sample the canonical ensemble, a Nose-Hoover massive chain thermostat +is applied :ref:`(Tuckerman) `. With the massive chain +algorithm, a chain of NH thermostats is coupled to each degree of +freedom for each quasi-bead. The keyword *temp* sets the target +temperature for the system and the keyword *nhc* sets the number *Nc* of +thermostats in each chain. For example, for a simulation of N particles +with P beads in each ring-polymer, the total number of NH thermostats +would be 3 x N x P x Nc. .. note:: - Fix pimd/nvt implements a complete velocity-verlet integrator + Fix *pimd/nvt* implements a complete velocity-verlet integrator combined with NH massive chain thermostat, so no other time integration fix should be used. + Similarly fix *pimd/langeving* implements ... The *method* keyword determines what style of PIMD is performed. A value of *pimd* is standard PIMD. A value of *nmpimd* is for @@ -158,16 +164,18 @@ related tasks for each of the partitions, e.g. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -Fix pimd/nvt writes the state of the Nose/Hoover thermostat over all +Fix *pimd/nvt* writes the state of the Nose/Hoover thermostat over all quasi-beads to :doc:`binary restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. +Fix *pimd/langevin* ... + None of the :doc:`fix_modify ` options are relevant to fix pimd/nvt. -Fix pimd/nvt computes a global 3-vector, which can be accessed by +Fix *pimd/nvt* computes a global 3-vector, which can be accessed by various :doc:`output commands `. The three quantities in the global vector are: @@ -176,21 +184,21 @@ the global vector are: #. the current value of the scalar virial estimator for the kinetic energy of the quantum system :ref:`(Herman) `. -The vector values calculated by fix pimd/nvt are "extensive", except for the +The vector values calculated by fix *pimd/nvt* are "extensive", except for the temperature, which is "intensive". -No parameter of fix pimd/nvt can be used with the *start/stop* keywords -of the :doc:`run ` command. Fix pimd/nvt is not invoked during +No parameter of fix *pimd/nvt* can be used with the *start/stop* keywords +of the :doc:`run ` command. Fix *pimd/nvt* is not invoked during :doc:`energy minimization `. Restrictions """""""""""" -This fix is part of the REPLICA package. It is only enabled if LAMMPS -was built with that package. See the :doc:`Build package +These fixes are part of the REPLICA package. They are only enabled if +LAMMPS was built with that package. See the :doc:`Build package ` page for more info. -Fix pimd/nvt cannot be used with :doc:`lj units `. +Fix *pimd/nvt* cannot be used with :doc:`lj units `. A PIMD simulation can be initialized with a single data file read via the :doc:`read_data ` command. However, this means all @@ -207,7 +215,7 @@ variable, e.g. Default """"""" -The keyword defaults for fix pimd/nvt are method = pimd, fmass = 1.0, sp +The keyword defaults for fix *pimd/nvt* are method = pimd, fmass = 1.0, sp = 1.0, temp = 300.0, and nhc = 2. ---------- diff --git a/src/.gitignore b/src/.gitignore index 8f0f577a45..cbe9e76216 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1533,6 +1533,8 @@ /fix_mol_swap.h /fix_pimd.cpp /fix_pimd.h +/fix_pimd_langevin.cpp +/fix_pimd_langevin.h /fix_pimd_nvt.cpp /fix_pimd_nvt.h /fix_qbmsst.cpp From 00a5930d4c93bafe8f2cd8978ab5c5ddfc290ef2 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Sat, 25 Feb 2023 18:58:56 -0500 Subject: [PATCH 006/172] delete default seed --- src/REPLICA/fix_pimd_langevin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index cf2d63b91c..3af036caf9 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -113,7 +113,7 @@ class FixPIMDLangevin : public Fix { double _omega_np, *_omega_k, *Lan_s, *Lan_c; // sin(omega_k*dt*0.5), cos(omega_k*dt*0.5) class RanMars *random; - int seed = 975481; + int seed; FILE *frand; int tstat_flag; // tstat_flat = 1 if thermostat if used From c950df2ede6bc519ed5f63691bac9579855af715 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Sat, 25 Feb 2023 19:53:19 -0500 Subject: [PATCH 007/172] delete commented-out code --- src/REPLICA/fix_pimd_langevin.cpp | 271 ------------------------------ 1 file changed, 271 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 1b2e734922..d4e8648504 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -81,8 +81,6 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n bufbeads = nullptr; x_unwrap = xc = nullptr; xcall = nullptr; - // x_unwrap = x_unwrapsort = x_unwrapall = nullptr; - // tag_init = tag_initall = nullptr; counts = nullptr; sizeplan = 0; @@ -245,16 +243,11 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n /* Initiation */ int nlocal = atom->nlocal; - // xc = new double[nlocal*3]; - // x_unwrap = new double[nlocal*3]; global_freq = 1; vector_flag = 1; size_vector = 11; - // if(pstyle==ISO) {size_vector = 15;} - // else if(pstyle==ANISO) {size_vector = 23;} extvector = 1; - // comm_forward = 1; // some initilizations @@ -318,7 +311,6 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n if(atom->nmax > maxunwrap) reallocate_x_unwrap(); if(atom->nmax > maxxc) reallocate_xc(); memory->create(xcall, ntotal*3, "FixPIMDLangevin:xcall"); - // init_x_unwrap(); if (cmode == SINGLE_PROC) { @@ -331,21 +323,14 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n } if ((cmode == MULTI_PROC) && (counts == nullptr)) { - // printf("me = %d, creating bufrecvall\n", universe->me); memory->create(bufsendall,ntotal,3,"FixPIMDLangevin:bufsendall"); memory->create(bufrecvall,ntotal,3,"FixPIMDLangevin:bufrecvall"); - // printf("me = %d, bufrecvall[0][0] = %.4f\n", universe->me, bufrecvall[0][0]); memory->create(tagsendall,ntotal,"FixPIMDLangevin:tagsendall"); memory->create(tagrecvall,ntotal,"FixPIMDLangevin:tagrecvall"); - // printf("me = %d, tagrecvall[0] = %d\n", universe->me, tagrecvall[0]); memory->create(counts,nprocs,"FixPIMDLangevin:counts"); memory->create(displacements,nprocs,"FixPIMDLangevin:displacements"); - // memory->create(x_unwrapall, ntotal, 3, "FixPIMDLangevin:x_unwrapall"); - // memory->create(tag_initall, ntotal, "FixPIMDLangevin:tag_initall"); - // printf("me = %d, tag_initall[0] = %d\n", universe->me, tag_initall[0]); } - // printf("me = %d constructing finished\n", universe->me); } /* ---------------------------------------------------------------------- */ @@ -391,12 +376,8 @@ void FixPIMDLangevin::init() } else planck = force->hplanck; const double Planck = planck; - printf("planck = %.6e\n", planck); - // if(force->boltz == 1.0) { hbar = Planck; } - // else { hbar = Planck / (2.0 * MY_PI); } hbar = Planck / (2.0 * MY_PI); - // hbar = Planck; kBT = force->boltz * temp; double beta = 1.0 / (Boltzmann * temp); double _fbond = 1.0 * np * np / (beta * beta * hbar * hbar); @@ -404,7 +385,6 @@ void FixPIMDLangevin::init() omega_np = np / (hbar * beta) * sqrt(force->mvv2e); beta_np = 1.0 / force->boltz / temp / np; fbond = _fbond * force->mvv2e; - // printf("_fbond = %.16e\nfbond = %.16e\n", _fbond, fbond); if (universe->me == 0) printf("Fix pimd -P/(beta^2 * hbar^2) = %20.7lE (kcal/mol/A^2)\n\n", fbond); @@ -458,35 +438,27 @@ void FixPIMDLangevin::setup(int vflag) double **x = atom->x; double **v = atom->v; imageint *image = atom->image; - // nlocal_init = nlocal; if(mapflag){ for(int i=0; iunmap(x[i], image[i]); } } - // printf("me = %d after unmapping x_unwrap\n", universe->me); - // printf("setup already here\n"); if(method==NMPIMD) { inter_replica_comm(x); - // printf("me = %d after inter\n", universe->me); - // printf("%.4f %.4f %.4f\n", bufbeads[0][0], bufbeads[0][1], bufbeads[0][2]); if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); } collect_xc(); - // printf("me = %d setup x2xp done\n", universe->me); compute_spring_energy(); if(method==NMPIMD) { inter_replica_comm(x); if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_xp2x[universe->iworld]); else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); - // nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); } - // printf("me = %d setup xp2x done\n", universe->me); if(mapflag){ for(int i=0; iiworld]); else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, v, M_x2xp[universe->iworld]); - // nmpimd_transform(bufbeads, atom->v, M_x2xp[universe->iworld]); } - // printf("me = %d setup v2vp done\n", universe->me); - // compute_xc(); - // update_x_unwrap(); - // printf("setting up %d\n", vflag); if(universe->me==0 && screen) fprintf(screen,"Setting up Path-Integral ...\n"); if(universe->me==0) printf("Setting up Path-Integral ...\n"); - // printf("setting up, m = %.4e\n", mass[1]); post_force(vflag); - // int idx = atom->map(1); - // printf("irplica = %d, x[1] = %.6f %.6f %.6f xu[1] = %.6f %.6f %.6f xc[1] = %.6f %.6f %.6f\n", ireplica, x[idx][0], x[idx][1], x[idx][2], x_unwrap[idx][0], x_unwrap[idx][1], x_unwrap[idx][2], xc[idx][0], xc[idx][1], xc[idx][2]); - // printf("after post_force, m = %.4e\n", mass[1]); - // printf("me = %d after post_force\n", universe->me); compute_totke(); - // compute_pote(); - // if(pstyle==ANISO) compute_stress_tensor(); end_of_step(); c_pe->addstep(update->ntimestep+1); c_press->addstep(update->ntimestep+1); - // printf("setup ending: \ncell = %.16e %.16e %.16e\nvol = %.16e\n", domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); - // printf("me = %d, setup finished\n", universe->me); } /* ---------------------------------------------------------------------- */ void FixPIMDLangevin::initial_integrate(int /*vflag*/) { - // printf("step = %d start initial_integrate\ncell = %.16e %.16e %.16e\nvol = %.16e\n", update->ntimestep, domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); - // printf("me = %d, step %d initial_integrate starts!\n", universe->me, update->ntimestep); - // printf("me = %d, step %d if starts!\n", universe->me, update->ntimestep); int nlocal = atom->nlocal; tagint *tag = atom->tag; double **x = atom->x; @@ -542,41 +497,28 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) } if(integrator==obabo) { - // printf("me = %d, step %d obabo starts!\n", universe->me, update->ntimestep); if(tstat_flag) { o_step(); - // if(removecomflag) remove_com_motion(); if(pstat_flag) press_o_step(); } if(pstat_flag) { compute_totke(); - // printf("me = %d, step %d after totke!\n", universe->me, update->ntimestep); compute_p_cv(); press_v_step(); } - /* - if(pstat_flag) - { - } - */ - // printf("me = %d, step %d before b_step 1!\n", universe->me, update->ntimestep); b_step(); - // printf("me = %d, step %d after b_step 1!\n", universe->me, update->ntimestep); - // if(removecomflag) remove_com_motion(); if(method==NMPIMD) { inter_replica_comm(x); if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); - // nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); } qc_step(); a_step(); qc_step(); a_step(); - // printf("me = %d, step %d after 2 a_step's!\n", universe->me, update->ntimestep); } else if(integrator==baoab) { @@ -587,20 +529,17 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) press_v_step(); } b_step(); - // if(removecomflag) remove_com_motion(); if(method==NMPIMD) { inter_replica_comm(x); if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); - // nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); } qc_step(); a_step(); if(tstat_flag) { o_step(); - // if(removecomflag) remove_com_motion(); if(pstat_flag) press_o_step(); } qc_step(); @@ -618,7 +557,6 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) inter_replica_comm(x); if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_xp2x[universe->iworld]); else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); - // nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); } @@ -628,8 +566,6 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) domain->unmap_inv(x[i], image[i]); } } - // printf("step = %d\ncell = %.16e %.16e %.16e\nvol = %.16e\n", update->ntimestep, domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); - // printf("me = %d, step %d initial_integrate ends!\n", universe->me, update->ntimestep); } /* ---------------------------------------------------------------------- */ @@ -643,13 +579,11 @@ void FixPIMDLangevin::final_integrate() press_v_step(); } b_step(); - // if(removecomflag) remove_com_motion(); if(integrator==obabo) { if(tstat_flag) { o_step(); - // if(removecomflag) remove_com_motion(); if(pstat_flag) press_o_step(); } } @@ -667,10 +601,8 @@ void FixPIMDLangevin::final_integrate() void FixPIMDLangevin::post_force(int /*flag*/) { - // printf("step = %d\ncell = %.16e %.16e %.16e\nvol = %.16e\n", update->ntimestep, domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); if(atom->nmax > maxunwrap) reallocate_x_unwrap(); if(atom->nmax > maxxc) reallocate_xc(); - // printf("me = %d, step %d post_force starts!\n", universe->me, update->ntimestep); int nlocal = atom->nlocal; double **x = atom->x; double **f = atom->f; @@ -695,34 +627,17 @@ void FixPIMDLangevin::post_force(int /*flag*/) xc[i][2] = xcall[3*(tag[i]-1)+2]; } int idx = atom->map(1); - // printf("in post_force, x_unwrap: %.6f %.6f %.6f xcall: %.6f %.6f %.6f xc: %.6f %.6f %.6f\n", x_unwrap[idx][0], x_unwrap[idx][1], x_unwrap[idx][2], xcall[0], xcall[1], xcall[2], xc[idx][0], xc[idx][1], xc[idx][2]); - // MPI_Barrier(universe->uworld); - // update_x_unwrap(); - // MPI_Barrier(universe->uworld); - // compute_xc(); - // MPI_Barrier(universe->uworld); - // if(mapflag) - // { - // for(int i=0; iunmap_inv(x[i], image[i]); - // } - // } compute_vir(); compute_vir_(); - // compute_t_prim(); - // compute_t_vir(); compute_pote(); if(method==NMPIMD) { inter_replica_comm(f); if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, f, M_x2xp[universe->iworld]); else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, f, M_x2xp[universe->iworld]); - // nmpimd_transform(bufbeads, f, M_x2xp[universe->iworld]); } c_pe->addstep(update->ntimestep+1); c_press->addstep(update->ntimestep+1); - // printf("me = %d, step %d post_force ends!\n", universe->me, update->ntimestep); } /* ---------------------------------------------------------------------- */ @@ -730,8 +645,6 @@ void FixPIMDLangevin::post_force(int /*flag*/) void FixPIMDLangevin::end_of_step() { compute_totke(); - // inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); - // compute_p_prim(); compute_p_cv(); compute_tote(); if(pstat_flag) compute_totenthalpy(); @@ -740,8 +653,6 @@ void FixPIMDLangevin::end_of_step() { if(universe->me==0) printf("This is the end of step %ld.\n", update->ntimestep); } - // if(universe->me==0) printf("me = %d This is the end of step %ld.\n", universe->me, update->ntimestep); - // printf("me = %d This is the end of step %ld.\n\n", universe->me, update->ntimestep); } void FixPIMDLangevin::collect_xc() @@ -773,74 +684,15 @@ void FixPIMDLangevin::collect_xc() xcall[3*(tag[i]-1)+2] = x[i][2] / sqrt(np); } int idx = atom->map(1); - // printf("in init_int, x: %.6f %.6f %.6f xcall: %.6f %.6f %.6f\n", x[idx][0], x[idx][1], x[idx][2], xcall[0], xcall[1], xcall[2]); if(cmode == MULTI_PROC) { - // printf("trying to add\n"); - // MPI_Reduce(MPI_IN_PLACE, xcall, ntotal*3, MPI_DOUBLE, MPI_SUM, 0, world); MPI_Allreduce(MPI_IN_PLACE, xcall, ntotal*3, MPI_DOUBLE, MPI_SUM, world); - // printf("added\n"); } } MPI_Bcast(xcall, ntotal*3, MPI_DOUBLE, 0, universe->uworld); } -/* ---------------------------------------------------------------------- */ -/* -void FixPIMDLangevin::update_x_unwrap() -{ - // MPI_Barrier(universe->uworld); - // printf("me = %d, starting update_xu\n", universe->me); - int nlocal = atom->nlocal; - double **x = atom->x; - // delete x_unwrap; - // memory->sfree(x_unwrap); - // printf("me = %d, before deleting xu\n", universe->me); - delete [] x_unwrap; - x_unwrap = nullptr; - x_unwrap = (double*) memory->srealloc(x_unwrap, sizeof(double)*(nlocal+200)*3, "FixDPPimd::x_unwrap"); - // printf("me = %d, before newing xu\n", universe->me); - // x_unwrap = new double[nlocal*3]; - // printf("me = %d, doing xu\n", universe->me); - for(int i=0; ime); - // MPI_Barrier(universe->uworld); -} -*/ -/* ---------------------------------------------------------------------- */ -/* -void FixPIMDLangevin::compute_xc() -{ - int natoms = atom->natoms; - MPI_Barrier(universe->uworld); - comm_exec(atom->x); - MPI_Barrier(universe->uworld); - int nlocal = atom->nlocal; - delete [] xc; - xc = nullptr; - xc = (double*) memory->srealloc(xc, sizeof(double) * nlocal * 3, "FixDPPimd:xc"); - for(int i=0; intimestep, domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); if(universe->iworld == 0) { double expp[3], expq[3]; - // printf("pstyle = %d vw[0] = %.8e\n", pstyle, vw[0]); if(pstyle == ISO) {vw[1] = vw[0]; vw[2] = vw[0];} for(int j=0; j<3; j++) { @@ -926,7 +776,6 @@ void FixPIMDLangevin::qc_step(){ domain->set_local_box(); } volume = domain->xprd * domain->yprd * domain->zprd; - // printf("step = %d end qc_step\ncell = %.16e %.16e %.16e\nvol = %.16e\n", update->ntimestep, domain->xprd, domain->yprd, domain->zprd, domain->xprd * domain->yprd * domain->zprd); } /* ---------------------------------------------------------------------- */ @@ -939,7 +788,6 @@ void FixPIMDLangevin::a_step(){ if(universe->iworld != 0) { - // printf("iworld = %d c = %.4e s = %.4e w = %.4e\n", universe->iworld, Lan_c[universe->iworld], Lan_s[universe->iworld], _omega_k[universe->iworld]); for(int i=0; iiworld == 0) - { - // double **x = atom->x; - double **v = atom->v; - int *mask = atom->mask; - int nlocal = atom->nlocal; - if (dynamic) masstotal = group->mass(igroup); - double vcm[3]; - group->vcm(igroup,masstotal,vcm); - for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) { - v[i][0] -= vcm[0]; - v[i][1] -= vcm[1]; - v[i][2] -= vcm[2]; - } - } - } -} -*/ /* ---------------------------------------------------------------------- */ void FixPIMDLangevin::baro_init() { vw[0] = vw[1] = vw[2] = vw[3] = vw[4] = vw[5] = 0.0; if(pstyle == ISO) {W = 3 * (atom->natoms) * tau_p * tau_p * np * kBT;} // consistent with the definition in i-Pi - // printf("tau_p = %.6e np = %.6e kBT = %.6e W = %.6e\n", tau_p, np, kBT, W);} else if(pstyle == ANISO) {W = atom->natoms * tau_p * tau_p * np * kBT;} Vcoeff = 1.0; std::string out = fmt::format("\nInitializing PIMD {:s} barostat...\n", Barostats[barostat]); @@ -1006,9 +831,7 @@ void FixPIMDLangevin::press_v_step() { if(barostat == BZP) { - // printf("me = %d step = %d start press_v_step, baro.p = %.30e p_cv = %.30e\n", universe->me, update->ntimestep, W*vw[0], np*p_cv); vw[0] += dtv * 3 * (volume * np * (p_cv - Pext) / force->nktv2p + Vcoeff / beta_np) / W; - // printf("me = %d step = %d add p-Pext, baro.p = %.30e\n", universe->me, update->ntimestep, W*vw[0]); if(universe->iworld==0) { double dvw_proc = 0.0, dvw = 0.0; @@ -1024,7 +847,6 @@ void FixPIMDLangevin::press_v_step() } MPI_Barrier(universe->uworld); MPI_Bcast(&vw[0], 1, MPI_DOUBLE, 0, universe->uworld); - // printf("me = %d step = %d end press_v_step, baro.p = %.30e\n\n", universe->me, update->ntimestep, W*vw[0]); } else if(barostat == MTTK) { @@ -1087,11 +909,9 @@ void FixPIMDLangevin::press_o_step() void FixPIMDLangevin::Langevin_init() { - // printf("in Langevin_init\n"); double beta = 1.0 / kBT; _omega_np = np / beta / hbar; double _omega_np_dt_half = _omega_np * update->dt * 0.5; - // printf("omega_np = %.4e wdt = %.4e\n", _omega_np, _omega_np_dt_half); _omega_k = new double[np]; Lan_c = new double[np]; @@ -1102,7 +922,6 @@ void FixPIMDLangevin::Langevin_init() _omega_k[i] = _omega_np * sqrt(lam[i]); Lan_c[i] = cos(sqrt(lam[i])*_omega_np_dt_half); Lan_s[i] = sin(sqrt(lam[i])*_omega_np_dt_half); - // printf("lam = %.4e s = %.4e c = %.4e w = %.4e\n", lam[i], Lan_s[i], Lan_c[i], _omega_k[i]); } } else if(fmmode==normal){ @@ -1292,24 +1111,8 @@ void FixPIMDLangevin::comm_init() planrecv[i] = universe->root_proc[irecv]; modeindex[i] = irecv; } - // } } -/* ---------------------------------------------------------------------- */ -/* -void FixPIMDLangevin::init_x_unwrap() -{ - maxunwrap = atom->nmax; - memory->destroy(x_unwrap); - memory->destroy(tag_init); - memory->destroy(image_init); - memory->destroy(x_unwrapsort); - memory->create(x_unwrap, maxunwrap, 3, "FixPIMDLangevin:x_unwrap"); - memory->create(tag_init, maxunwrap, "FixPIMDLangevin:tag_init"); - memory->create(image_init, maxunwrap, "FixPIMDLangevin:image_init"); - memory->create(x_unwrapsort, ntotal, 3, "FixPIMDLangevin:x_unwrapsort"); -} -*/ /* ---------------------------------------------------------------------- */ void FixPIMDLangevin::reallocate_xc() @@ -1353,7 +1156,6 @@ void FixPIMDLangevin::inter_replica_comm(double **ptr) MPI_Status statuses[2]; if (atom->nmax > maxlocal) reallocate(); int nlocal = atom->nlocal; - // printf("me = %d starting inter_comm, nlocal = %d ntotal = %d\n", universe->me, nlocal, ntotal); tagint *tag = atom->tag; int i, m; @@ -1382,43 +1184,10 @@ void FixPIMDLangevin::inter_replica_comm(double **ptr) displacements[0] = 0; for (i = 0; i < nreplica-1; i++) { displacements[i+1] = displacements[i] + counts[i]; } MPI_Allgatherv(bufsorted[0], 3*m, MPI_DOUBLE, bufsortedall[0], counts, displacements, MPI_DOUBLE, universe->uworld); - // printf("me = %d bufsortedall[0] = %.8f %.8f %.8f bufsortedall[ntotal] = %.8f %.8f %.8f\n", universe->iworld, bufsortedall[0][0], bufsortedall[0][1], bufsortedall[0][2], bufsortedall[ntotal][0], bufsortedall[ntotal][1], bufsortedall[ntotal][2]); - /* - m = 0; - for(i=0; ime, nlocal, ntotal, m, sizeplan); - for(int iplan=0; iplanuworld, &requests[0]); - MPI_Irecv(tagrecv, ntotal, MPI_LMP_TAGINT, planrecv[iplan], 0, universe->uworld, &requests[1]); - // printf("me = %d iplan = %d irecv finished, plansend = %d, planrecv = %d, modeindex = %d\n", universe->me, iplan, plansend[iplan], planrecv[iplan], modeindex[iplan]); - // printf("bufsend[0]: %.4f %.4f %.4f\ntagsend[0]: %d\n", bufsend[0][0], bufsend[0][1], bufsend[0][2], tagsend[0]); - // printf("bufsend[255]: %.4f %.4f %.4f\ntagsend[255]: %d\n", bufsend[255][0], bufsend[255][1], bufsend[255][2], tagsend[255]); - MPI_Send(bufsend[0], 3*ntotal, MPI_DOUBLE, plansend[iplan], 0, universe->uworld); - MPI_Send(tagsend, ntotal, MPI_LMP_TAGINT, plansend[iplan], 0, universe->uworld); - // printf("me = %d MPI_Send done\n", universe->me); - MPI_Waitall(2, requests, statuses); - // printf("me = %d iplan = %d send recv finished\n", iplan, universe->me); - for(i=0; imap(tagrecv[i]); - bufbeads[modeindex[iplan]][3*m+0] = bufrecv[i][0]; - bufbeads[modeindex[iplan]][3*m+1] = bufrecv[i][1]; - bufbeads[modeindex[iplan]][3*m+2] = bufrecv[i][2]; - } - } - */ - // printf("me = %d finishing inter_comm\n", universe->me); } else if(cmode == MULTI_PROC) { m = 0; - // printf("me = %d trying to copy bufsend\n", universe->me); for(i=0; ime, m); - // if(me==0) {for(i=0; ime, i, counts[i]);}} - // printf("me = %d") MPI_Gather(&m, 1, MPI_INT, counts, 1, MPI_INT, 0, world); - // printf("me = %d counts gathered\n", universe->me); - // if(me==0) {for(i=0; ime, i, counts[i]);}} displacements[0] = 0; - // printf("me = %d displacements[0] = %d\n", universe->me, displacements[0]); for (i = 0; i < nprocs-1; i++) { displacements[i+1] = displacements[i] + counts[i]; } - // printf("me = %d displacements done\n", universe->me); - // if(me==0) {for(i=0; ime, i, displacements[i]);}} MPI_Gatherv(tagsend, m, MPI_LMP_TAGINT, tagsendall, counts, displacements, MPI_LMP_TAGINT, 0, world); - // printf("me = %d tags gathered\n", universe->me); for (i = 0; i < nprocs; i++) { counts[i] *= 3; } for (i = 0; i < nprocs-1; i++) { displacements[i+1] = displacements[i] + counts[i]; } MPI_Gatherv(bufsend[0], 3*m, MPI_DOUBLE, bufsendall[0], counts, displacements, MPI_DOUBLE, 0, world); - // printf("me = %d bufsend gathered\n", universe->me); - // printf("me = %d, tagrecvall[0] = %d bufrecvall[0][0] = %.4f\n", universe->me, tagrecvall[0], bufrecvall[0][0]); - - // printf("universe->me = %d comm->me = %d sizeplan = %d\n", universe->me, comm->me, sizeplan); for(int iplan=0; iplanuworld); MPI_Waitall(2,requests,statuses); } - // else{ - // printf("me = %d not sendrecceving\n", universe->me); - // } - - // printf("me = %d sendrecv finished\n", universe->me); - // printf("me = %d to be bcasted: tag[0] = %d bufrecvall[0][0] = %.4f\n", universe->me, tagrecvall[0], bufrecvall[0][0]); MPI_Bcast(tagrecvall, ntotal, MPI_LMP_TAGINT, 0, world); MPI_Bcast(bufrecvall[0], 3*ntotal, MPI_DOUBLE, 0, world); - // printf("me = %d broadcasted\n", universe->me); for(i=0; imap(tagrecvall[i]); @@ -1474,7 +1223,6 @@ void FixPIMDLangevin::inter_replica_comm(double **ptr) bufbeads[modeindex[iplan]][3*m+2] = bufrecvall[i][2]; } } - // printf("me = %d, tag[0] = %d bufrecvall[0][0] = %.4f bufbeads[0][0] = %.4f bufbeads[1][0] = %.4f bufbeads done\n", universe->me, tag[0], bufrecvall[0][0], bufbeads[0][0], bufbeads[1][0]); } } @@ -1486,8 +1234,6 @@ void FixPIMDLangevin::compute_vir_() int nlocal = atom->nlocal; xf = vir_ = xcf = centroid_vir = 0.0; int idx = atom->map(1); - // printf("in post_force, x_unwrap: %.6f %.6f %.6f xcall: %.6f %.6f %.6f\n", x_unwrap[idx][0], x_unwrap[idx][1], x_unwrap[idx][2], xcall[0], xcall[1], xcall[2]); - // printf("in compute_vir, xu = %.6f %.6f %.6f xc = %.6f %.6f %.6f\n", x_unwrap[idx][0], x_unwrap[idx][1], x_unwrap[idx][2], xc[idx][0], xc[idx][1], xc[idx][2]); for(int i=0; if[i][j]; xcf += (x_unwrap[i][j] - xc[i][j]) * atom->f[i][j]; } - // int idx = atom->map(i+1); - // printf("me = %d step = %d tag = %d idx = %d xu = %.6f %.6f %.6f xc = %.6f %.6f %.6f f = %.6f %.6f %.6f\n", universe->me, update->ntimestep, i+1, idx, x_unwrap[idx][0], x_unwrap[idx][1], x_unwrap[idx][2], xc[idx][0], xc[idx][1], xc[idx][2], atom->f[idx][0], atom->f[idx][1], atom->f[idx][2]); } MPI_Allreduce(&xf, &vir_, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); MPI_Allreduce(&xcf, ¢roid_vir, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); @@ -1530,7 +1274,6 @@ void FixPIMDLangevin::compute_vir() double vir_bead=(virial[0]+virial[1]+virial[2]); MPI_Allreduce(&vir_bead, &vir, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); MPI_Allreduce(MPI_IN_PLACE, &virial[0], 6, MPI_DOUBLE, MPI_SUM, universe->uworld); - // printf("me = %d step = %d vir = %.30e\n", universe->me, update->ntimestep, vir); } /* ---------------------------------------------------------------------- */ @@ -1550,12 +1293,10 @@ void FixPIMDLangevin::compute_stress_tensor() ke_tensor[4] += 0.5 * mass[type[i]] * atom->v[i][0] * atom->v[i][2] * force->mvv2e; ke_tensor[5] += 0.5 * mass[type[i]] * atom->v[i][1] * atom->v[i][2] * force->mvv2e; } - // MPI_Allreduce(&ke_tensor, &ke_tensor, 6, MPI_DOUBLE, MPI_SUM, world); MPI_Allreduce(MPI_IN_PLACE, &ke_tensor, 6, MPI_DOUBLE, MPI_SUM, world); for(int i=0; i<6; i++) { stress_tensor[i] = inv_volume * ((2*ke_tensor[i] - c_vir_tensor[i]) * force->nktv2p + virial[i]) / np; - // printf("i = %d, c_vir = %.6f, virial = %.6f stress = %.6f\n", i, c_vir_tensor[i], virial[i], stress_tensor[i]); } } MPI_Bcast(&stress_tensor, 6, MPI_DOUBLE, 0, universe->uworld); @@ -1577,12 +1318,7 @@ void FixPIMDLangevin::compute_totke() } } kine *= force->mvv2e; - // printf("me = %d, kine = %.6e\n", universe->me, kine); MPI_Allreduce(&kine, &ke_bead, 1, MPI_DOUBLE, MPI_SUM, world); - // MPI_Allreduce(&kine, &totke, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); - // totke *= force->mvv2e / np; - - // c_press->compute_scalar(); } /* ---------------------------------------------------------------------- */ @@ -1596,15 +1332,12 @@ void FixPIMDLangevin::compute_spring_energy() double* _mass = atom->mass; int* type = atom->type; int nlocal = atom->nlocal; - // printf("iworld = %d, fbond = %.4e lam = %.4e\n", universe->iworld, fbond, lam[universe->iworld]); for(int i=0; iiworld] * (x[i][0]*x[i][0] + x[i][1]*x[i][1] + x[i][2]*x[i][2]); } MPI_Allreduce(&spring_energy, &se_bead, 1, MPI_DOUBLE, MPI_SUM, world); - // MPI_Allreduce(&spring_energy, &total_spring_energy, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); - // total_spring_energy /= np; } /* ---------------------------------------------------------------------- */ @@ -1617,8 +1350,6 @@ void FixPIMDLangevin::compute_pote() c_pe->compute_scalar(); pe_bead = c_pe->scalar; pot_energy_partition = pe_bead / universe->procs_per_world[universe->iworld]; - // MPI_Allreduce(&pot_energy_partition, &pote, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); - // pote /= np; } /* ---------------------------------------------------------------------- */ @@ -1656,8 +1387,6 @@ void FixPIMDLangevin::compute_p_prim() void FixPIMDLangevin::compute_p_cv() { inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); - // p_md = 2. / 3 * inv_volume * ((totke - total_spring_energy) * force->nktv2p + 0.5 * vir / np) ; - // printf("inv_V = %.30e ke = %.30e cv = %.30e vir = %.30e\n", inv_volume, ke_bead, centroid_vir, vir); if(universe->iworld == 0) { p_cv = 1. / 3. * inv_volume * ((2. * ke_bead - 1. * centroid_vir) * force->nktv2p + 1. * vir) / np; From f84765f29e5f3f5236db7b583532fb1a5f4ac916 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Sat, 25 Feb 2023 20:34:10 -0500 Subject: [PATCH 008/172] update document for fix pimd/langevin --- doc/src/fix_pimd.rst | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 342530e6a9..4d08497928 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -17,16 +17,29 @@ Syntax * ID, group-ID are documented in :doc:`fix ` command * style = *pimd/langevin* or *pimd/nvt* = style name of this fix command * zero or more keyword/value pairs may be appended -* keyword = *method* or *fmass* or *sp* or *temp* or *nhc* +* keywords for style *pimd/nvt* .. parsed-literal:: - + *keywords* = *method* or *fmass* or *sp* or *temp* or *nhc* *method* value = *pimd* or *nmpimd* or *cmd* *fmass* value = scaling factor on mass *sp* value = scaling factor on Planck constant *temp* value = temperature (temperarate units) *nhc* value = Nc = number of chains in Nose-Hoover thermostat +* keywords for style *pimd/langevin* + + .. parsed-literal:: + *keywords* = *method* or *integrator* or *ensemble* or *fmass* or *fmmode* or *scale* or *lj* or *temp* or *thermostat* or *tau* or *press* or *barostat* or *taup* or *iso* or *aniso* + *method* value = *nmpimd* + *fmass* value = scaling factor on mass + *sp* value = scaling factor on Planck constant + *temp* value = target temperature (temperarate units) + *thermostat* values = PILE_L *seed* + *seed* = random number seed + *tau* value = thermostat damping parameter (time unit) + *press* value = target pressure (pressure units) + Examples """""""" From 25a1996ece081752364cfca146ac0a74d8b9a699 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 25 Feb 2023 22:40:30 -0500 Subject: [PATCH 009/172] some formatting and programming style updates --- src/REPLICA/fix_pimd_langevin.cpp | 1209 ++++++++++++++--------------- src/REPLICA/fix_pimd_langevin.h | 5 +- 2 files changed, 569 insertions(+), 645 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index d4e8648504..22bed54c3b 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -14,13 +14,7 @@ /* ---------------------------------------------------------------------- Package FixPIMDLangevin Purpose Quantum Path Integral Algorithm for Quantum Chemistry - Copyright Voth Group @ University of Chicago - Authors Chris Knight & Yuxing Peng (yuxing at uchicago.edu) - Updated Oct-01-2011 - Version 1.0 - - Updated Jun-07-2022 Yifan Li @ Princeton University (yifanl0716@gmail.com) Added components: - Multi-processor parallelism for each bead @@ -45,8 +39,8 @@ #include "modify.h" #include "random_mars.h" #include "universe.h" -#include "utils.h" #include "update.h" +#include "utils.h" #include #include @@ -56,19 +50,22 @@ using namespace FixConst; using namespace MathConst; enum { PIMD, NMPIMD, CMD }; -enum { physical, normal }; -enum { baoab, obabo }; +enum { PHYSICAL, NORMAL }; +enum { BAOAB, OBABO }; enum { ISO, ANISO, TRICLINIC }; enum { PILE_L }; enum { MTTK, BZP }; // char* Barostats[] = {"MTTK", "BZP"}; -std::map Barostats {{MTTK, "MTTK"}, {BZP, "BZP"}}; -enum { nve, nvt, nph, npt }; -enum{SINGLE_PROC, MULTI_PROC}; + +static std::map Barostats{{MTTK, "MTTK"}, {BZP, "BZP"}}; +enum { NVE, NVT, NPH, NPT }; +enum { SINGLE_PROC, MULTI_PROC }; /* ---------------------------------------------------------------------- */ -FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), random(nullptr), c_pe(nullptr), c_press(nullptr) { +FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg), random(nullptr), c_pe(nullptr), c_press(nullptr) +{ time_integrate = 1; tagsend = tagrecv = nullptr; bufsend = bufrecv = nullptr; @@ -93,24 +90,24 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n mass = nullptr; method = PIMD; - ensemble = nvt; - integrator = obabo; + ensemble = NVT; + integrator = OBABO; thermostat = PILE_L; barostat = BZP; fmass = 1.0; sp = 1.0; - temp = 298.15; - Lan_temp = 298.15; - tau = 1.0; - tau_p = 1.0; - Pext = 1.0; - tstat_flag = 1; - pstat_flag = 0; - mapflag = 1; + temp = 298.15; + Lan_temp = 298.15; + tau = 1.0; + tau_p = 1.0; + Pext = 1.0; + tstat_flag = 1; + pstat_flag = 0; + mapflag = 1; removecomflag = 1; - fmmode = physical; - pstyle = ISO; - for (int i=0; i<6; i++) p_flag[i] = 0; + fmmode = PHYSICAL; + pstyle = ISO; + for (int i = 0; i < 6; i++) p_flag[i] = 0; for (int i = 3; i < narg - 1; i += 2) { if (strcmp(arg[i], "method") == 0) { @@ -121,129 +118,138 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n else if (strcmp(arg[i + 1], "cmd") == 0) method = CMD; else - error->universe_all(FLERR, "Unknown method parameter for fix pimd"); - } - else if(strcmp(arg[i], "integrator")==0) + error->universe_all(FLERR, "Unknown method parameter for fix pimd/langevin"); + } else if (strcmp(arg[i], "integrator") == 0) { - if(strcmp(arg[i+1], "obabo")==0) integrator=obabo; - else if(strcmp(arg[i+1], "baoab")==0) integrator=baoab; - else error->universe_all(FLERR, "Unknown integrator parameter for fix pimd. Only obabo and baoab integrators are supported!"); + if (strcmp(arg[i + 1], "obabo") == 0) + integrator = OBABO; + else if (strcmp(arg[i + 1], "baoab") == 0) + integrator = BAOAB; + else + error->universe_all(FLERR, + "Unknown integrator parameter for fix pimd/langevin. Only obabo and baoab " + "integrators are supported!"); } - else if(strcmp(arg[i], "ensemble")==0) - { - if(strcmp(arg[i+1], "nve")==0) { ensemble = nve; tstat_flag = 0; pstat_flag = 0; } - else if(strcmp(arg[i+1], "nvt")==0) { ensemble = nvt; tstat_flag = 1; pstat_flag = 0; } - else if(strcmp(arg[i+1], "nph")==0) { ensemble = nph; tstat_flag = 0; pstat_flag = 1; } - else if(strcmp(arg[i+1], "npt")==0) { ensemble = npt; tstat_flag = 1; pstat_flag = 1; } - else error->universe_all(FLERR, "Unknown ensemble parameter for fix pimd. Only nve and nvt ensembles are supported!"); + else if (strcmp(arg[i], "ensemble") == 0) { + if (strcmp(arg[i + 1], "nve") == 0) { + ensemble = NVE; + tstat_flag = 0; + pstat_flag = 0; + } else if (strcmp(arg[i + 1], "nvt") == 0) { + ensemble = NVT; + tstat_flag = 1; + pstat_flag = 0; + } else if (strcmp(arg[i + 1], "nph") == 0) { + ensemble = NPH; + tstat_flag = 0; + pstat_flag = 1; + } else if (strcmp(arg[i + 1], "npt") == 0) { + ensemble = NPT; + tstat_flag = 1; + pstat_flag = 1; + } else + error->universe_all( + FLERR, + "Unknown ensemble parameter for fix pimd/langevin. Only nve and nvt ensembles are supported!"); } - else if (strcmp(arg[i], "fmass") == 0) { + else if (strcmp(arg[i], "fmass") == 0) { fmass = utils::numeric(FLERR, arg[i + 1], false, lmp); if (fmass < 0.0 || fmass > 1.0) - error->universe_all(FLERR, "Invalid fmass value for fix pimd"); + error->universe_all(FLERR, "Invalid fmass value for fix pimd/langevin"); } - else if(strcmp(arg[i], "fmmode")==0) - { - if(strcmp(arg[i+1], "physical")==0) fmmode=physical; - else if(strcmp(arg[i+1], "normal")==0) fmmode=normal; - else error->universe_all(FLERR, "Unknown fictitious mass mode for fix pimd. Only physical mass and normal mode mass are supported!"); + else if (strcmp(arg[i], "fmmode") == 0) { + if (strcmp(arg[i + 1], "physical") == 0) + fmmode = PHYSICAL; + else if (strcmp(arg[i + 1], "normal") == 0) + fmmode = NORMAL; + else + error->universe_all(FLERR, + "Unknown fictitious mass mode for fix pimd/langevin. Only physical mass and " + "normal mode mass are supported!"); } - else if(strcmp(arg[i],"scale")==0) - { - pilescale = atof(arg[i+1]); - if(pilescale<0.0) error->universe_all(FLERR,"Invalid pile scale value for fix pimd"); + else if (strcmp(arg[i], "scale") == 0) { + pilescale = atof(arg[i + 1]); + if (pilescale < 0.0) error->universe_all(FLERR, "Invalid pile scale value for fix pimd/langevin"); } else if (strcmp(arg[i], "temp") == 0) { temp = utils::numeric(FLERR, arg[i + 1], false, lmp); - if (temp < 0.0) error->universe_all(FLERR, "Invalid temp value for fix pimd"); + if (temp < 0.0) error->universe_all(FLERR, "Invalid temp value for fix pimd/langevin"); } else if (strcmp(arg[i], "lj") == 0) { - lj_epsilon = utils::numeric(FLERR, arg[i+1], false, lmp); - lj_sigma = utils::numeric(FLERR, arg[i+2], false, lmp); - lj_mass = utils::numeric(FLERR, arg[i+3], false, lmp); - other_planck = utils::numeric(FLERR, arg[i+4], false, lmp); + lj_epsilon = utils::numeric(FLERR, arg[i + 1], false, lmp); + lj_sigma = utils::numeric(FLERR, arg[i + 2], false, lmp); + lj_mass = utils::numeric(FLERR, arg[i + 3], false, lmp); + other_planck = utils::numeric(FLERR, arg[i + 4], false, lmp); i++; i++; i++; } - else if(strcmp(arg[i], "thermostat")==0) - { - if(strcmp(arg[i+1],"PILE_L")==0) - { + else if (strcmp(arg[i], "thermostat") == 0) { + if (strcmp(arg[i + 1], "PILE_L") == 0) { thermostat = PILE_L; - seed = atoi(arg[i+2]); + seed = atoi(arg[i + 2]); i++; } } - else if(strcmp(arg[i], "tau")==0) - { - tau = atof(arg[i+1]); + else if (strcmp(arg[i], "tau") == 0) { + tau = atof(arg[i + 1]); } - else if(strcmp(arg[i], "press")==0) - { - Pext = atof(arg[i+1]); - if(Pext<0.0) error->universe_all(FLERR,"Invalid press value for fix pimd"); + else if (strcmp(arg[i], "press") == 0) { + Pext = atof(arg[i + 1]); + if (Pext < 0.0) error->universe_all(FLERR, "Invalid press value for fix pimd/langevin"); } - else if(strcmp(arg[i], "barostat")==0) - { - if(strcmp(arg[i+1],"MTTK")==0) - { + else if (strcmp(arg[i], "barostat") == 0) { + if (strcmp(arg[i + 1], "MTTK") == 0) { barostat = MTTK; - } - else if(strcmp(arg[i+1],"BZP")==0) - { + } else if (strcmp(arg[i + 1], "BZP") == 0) { barostat = BZP; - } - else error->universe_all(FLERR,"Unknown barostat parameter for fix pimd"); + } else + error->universe_all(FLERR, "Unknown barostat parameter for fix pimd/langevin"); } - else if(strcmp(arg[i], "iso")==0) - { + else if (strcmp(arg[i], "iso") == 0) { pstyle = ISO; i--; } - else if(strcmp(arg[i], "aniso")==0) - { + else if (strcmp(arg[i], "aniso") == 0) { pstyle = ANISO; i--; } - else if(strcmp(arg[i], "taup")==0) - { - tau_p = atof(arg[i+1]); - if(tau_p<=0.0) error->universe_all(FLERR, "Invalid tau_p value for fix pimd"); - } - else if(strcmp(arg[i], "fixcom")==0) - { - if(strcmp(arg[i+1], "yes")==0) removecomflag = 1; - else if(strcmp(arg[i+1], "no")==0) removecomflag = 0; + else if (strcmp(arg[i], "taup") == 0) { + tau_p = atof(arg[i + 1]); + if (tau_p <= 0.0) error->universe_all(FLERR, "Invalid tau_p value for fix pimd/langevin"); + } else if (strcmp(arg[i], "fixcom") == 0) { + if (strcmp(arg[i + 1], "yes") == 0) + removecomflag = 1; + else if (strcmp(arg[i + 1], "no") == 0) + removecomflag = 0; } - else if(strcmp(arg[i], "map")==0) - { - if(strcmp(arg[i+1], "yes")==0) mapflag = 1; - else if(strcmp(arg[i+1], "no")==0) mapflag = 0; + else if (strcmp(arg[i], "map") == 0) { + if (strcmp(arg[i + 1], "yes") == 0) + mapflag = 1; + else if (strcmp(arg[i + 1], "no") == 0) + mapflag = 0; + } else { + error->universe_all(FLERR, fmt::format("Unknown keyword {} for fix {}", arg[i], style)); } - - else error->universe_all(FLERR, fmt::format("Unknown keyword {} for fix pimd", arg[i])); } /* Initiation */ - int nlocal = atom->nlocal; - global_freq = 1; vector_flag = 1; size_vector = 11; @@ -253,92 +259,87 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n id_pe = new char[8]; strcpy(id_pe, "pimd_pe"); - char **newarg = new char*[3]; + char **newarg = new char *[3]; newarg[0] = id_pe; newarg[1] = (char *) "all"; newarg[2] = (char *) "pe"; - modify->add_compute(3,newarg); - delete [] newarg; - + modify->add_compute(3, newarg); + delete[] newarg; id_press = new char[12]; strcpy(id_press, "pimd_press"); - newarg = new char*[5]; + newarg = new char *[5]; newarg[0] = id_press; - newarg[1] = (char*) "all"; - newarg[2] = (char*) "pressure"; - newarg[3] = (char*) "thermo_temp"; - newarg[4] = (char*) "virial"; + newarg[1] = (char *) "all"; + newarg[2] = (char *) "pressure"; + newarg[3] = (char *) "thermo_temp"; + newarg[4] = (char *) "virial"; modify->add_compute(5, newarg); - delete [] newarg; + delete[] newarg; vol0 = domain->xprd * domain->yprd * domain->zprd; - fixedpoint[0] = 0.5*(domain->boxlo[0]+domain->boxhi[0]); - fixedpoint[1] = 0.5*(domain->boxlo[1]+domain->boxhi[1]); - fixedpoint[2] = 0.5*(domain->boxlo[2]+domain->boxhi[2]); + fixedpoint[0] = 0.5 * (domain->boxlo[0] + domain->boxhi[0]); + fixedpoint[1] = 0.5 * (domain->boxlo[1] + domain->boxhi[1]); + fixedpoint[2] = 0.5 * (domain->boxlo[2] + domain->boxhi[2]); // initialize Marsaglia RNG with processor-unique seed - if(integrator==baoab || integrator==obabo) - { + if (integrator == BAOAB || integrator == OBABO) { Lan_temp = temp; random = new RanMars(lmp, seed + universe->me); } me = comm->me; nprocs = comm->nprocs; - if(nprocs == 1) cmode = SINGLE_PROC; - else cmode = MULTI_PROC; + if (nprocs == 1) + cmode = SINGLE_PROC; + else + cmode = MULTI_PROC; nprocs_universe = universe->nprocs; nreplica = universe->nworlds; ireplica = universe->iworld; int *iroots = new int[nreplica]; - MPI_Group uworldgroup,rootgroup; + MPI_Group uworldgroup, rootgroup; - for (int i=0; iroot_proc[i]; + for (int i = 0; i < nreplica; i++) iroots[i] = universe->root_proc[i]; MPI_Comm_group(universe->uworld, &uworldgroup); MPI_Group_incl(uworldgroup, nreplica, iroots, &rootgroup); MPI_Comm_create(universe->uworld, rootgroup, &rootworld); if (rootgroup != MPI_GROUP_NULL) MPI_Group_free(&rootgroup); if (uworldgroup != MPI_GROUP_NULL) MPI_Group_free(&uworldgroup); - delete [] iroots; + delete[] iroots; ntotal = atom->natoms; - if(atom->nmax > maxlocal) reallocate(); - if(atom->nmax > maxunwrap) reallocate_x_unwrap(); - if(atom->nmax > maxxc) reallocate_xc(); - memory->create(xcall, ntotal*3, "FixPIMDLangevin:xcall"); + if (atom->nmax > maxlocal) reallocate(); + if (atom->nmax > maxunwrap) reallocate_x_unwrap(); + if (atom->nmax > maxxc) reallocate_xc(); + memory->create(xcall, ntotal * 3, "FixPIMDLangevin:xcall"); - if (cmode == SINGLE_PROC) - { + if (cmode == SINGLE_PROC) { memory->create(bufsorted, ntotal, 3, "FixPIMDLangevin:bufsorted"); memory->create(outsorted, ntotal, 3, "FixPIMDLangevin:outsorted"); - memory->create(bufsortedall, nreplica*ntotal, 3, "FixPIMDLangevin:bufsortedall"); - memory->create(buftransall, nreplica*ntotal, 3, "FixPIMDLangevin:buftransall"); + memory->create(bufsortedall, nreplica * ntotal, 3, "FixPIMDLangevin:bufsortedall"); + memory->create(buftransall, nreplica * ntotal, 3, "FixPIMDLangevin:buftransall"); memory->create(counts, nreplica, "FixPIMDLangevin:counts"); memory->create(displacements, nreplica, "FixPIMDLangevin:displacements"); } if ((cmode == MULTI_PROC) && (counts == nullptr)) { - memory->create(bufsendall,ntotal,3,"FixPIMDLangevin:bufsendall"); - memory->create(bufrecvall,ntotal,3,"FixPIMDLangevin:bufrecvall"); - memory->create(tagsendall,ntotal,"FixPIMDLangevin:tagsendall"); - memory->create(tagrecvall,ntotal,"FixPIMDLangevin:tagrecvall"); - memory->create(counts,nprocs,"FixPIMDLangevin:counts"); - memory->create(displacements,nprocs,"FixPIMDLangevin:displacements"); + memory->create(bufsendall, ntotal, 3, "FixPIMDLangevin:bufsendall"); + memory->create(bufrecvall, ntotal, 3, "FixPIMDLangevin:bufrecvall"); + memory->create(tagsendall, ntotal, "FixPIMDLangevin:tagsendall"); + memory->create(tagrecvall, ntotal, "FixPIMDLangevin:tagrecvall"); + memory->create(counts, nprocs, "FixPIMDLangevin:counts"); + memory->create(displacements, nprocs, "FixPIMDLangevin:displacements"); } - } /* ---------------------------------------------------------------------- */ -FixPIMDLangevin::~FixPIMDLangevin() -{ - -} +FixPIMDLangevin::~FixPIMDLangevin() {} /* ---------------------------------------------------------------------- */ @@ -358,10 +359,10 @@ int FixPIMDLangevin::setmask() void FixPIMDLangevin::init() { if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR, "Fix pimd requires an atom map, see atom_modify"); + error->all(FLERR, "fix pimd/langevin requires an atom map, see atom_modify"); if (universe->me == 0 && universe->uscreen) - fprintf(universe->uscreen, "Fix pimd initializing Path-Integral ...\n"); + fprintf(universe->uscreen, "fix pimd/langevin initializing Path-Integral ...\n"); // prepare the constants @@ -369,43 +370,38 @@ void FixPIMDLangevin::init() np = universe->nworlds; inverse_np = 1.0 / np; - const double Boltzmann = force->boltz; - if (strcmp(update->unit_style,"lj") == 0) { - double planck_star = sqrt(lj_epsilon)*sqrt(atom->mass[0])*lj_sigma; + double planck; + if (strcmp(update->unit_style, "lj") == 0) { + double planck_star = sqrt(lj_epsilon) * sqrt(atom->mass[0]) * lj_sigma; planck = other_planck / planck_star; + } else { + planck = force->hplanck; } - else planck = force->hplanck; - const double Planck = planck; - hbar = Planck / (2.0 * MY_PI); + hbar = planck / (2.0 * MY_PI); kBT = force->boltz * temp; - double beta = 1.0 / (Boltzmann * temp); + double beta = 1.0 / (force->boltz * temp); double _fbond = 1.0 * np * np / (beta * beta * hbar * hbar); omega_np = np / (hbar * beta) * sqrt(force->mvv2e); - beta_np = 1.0 / force->boltz / temp / np; + beta_np = 1.0 / force->boltz / temp * inverse_np; fbond = _fbond * force->mvv2e; if (universe->me == 0) - printf("Fix pimd -P/(beta^2 * hbar^2) = %20.7lE (kcal/mol/A^2)\n\n", fbond); + printf("fix pimd/langevin -P/(beta^2 * hbar^2) = %20.7lE (kcal/mol/A^2)\n\n", fbond); - if(integrator==obabo) - { + if (integrator == OBABO) { dtf = 0.5 * update->dt * force->ftm2v; dtv = 0.5 * update->dt; dtv2 = dtv * dtv; - dtv3 = 1./3 * dtv2 * dtv * force->ftm2v; - } - else if(integrator==baoab) - { + dtv3 = THIRD * dtv2 * dtv * force->ftm2v; + } else if (integrator == BAOAB) { dtf = 0.5 * update->dt * force->ftm2v; dtv = 0.5 * update->dt; dtv2 = dtv * dtv; - dtv3 = 1./3 * dtv2 * dtv * force->ftm2v; - } - else - { - error->universe_all(FLERR,"Unknown integrator parameter for fix pimd"); + dtv3 = THIRD * dtv2 * dtv * force->ftm2v; + } else { + error->universe_all(FLERR, "Unknown integrator parameter for fix pimd/langevin"); } comm_init(); @@ -425,60 +421,56 @@ void FixPIMDLangevin::init() t_prim = t_vir = t_cv = p_prim = p_vir = p_cv = p_md = 0.0; - if(universe->me==0) fprintf(screen, "Fix pimd successfully initialized!\n"); + if (universe->me == 0) fprintf(screen, "fix pimd/langevin successfully initialized!\n"); } /* ---------------------------------------------------------------------- */ void FixPIMDLangevin::setup(int vflag) { - if(universe->me==0) printf("Setting up Path-Integral ...\n"); + if (universe->me == 0) printf("Setting up Path-Integral ...\n"); int nlocal = atom->nlocal; - tagint *tag = atom->tag; double **x = atom->x; double **v = atom->v; imageint *image = atom->image; - if(mapflag){ - for(int i=0; iunmap(x[i], image[i]); - } + if (mapflag) { + for (int i = 0; i < nlocal; i++) domain->unmap(x[i], image[i]); } - if(method==NMPIMD) - { + if (method == NMPIMD) { inter_replica_comm(x); - if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); - else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); + if (cmode == SINGLE_PROC) + nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); + else if (cmode == MULTI_PROC) + nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); } collect_xc(); compute_spring_energy(); - if(method==NMPIMD) - { + if (method == NMPIMD) { inter_replica_comm(x); - if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_xp2x[universe->iworld]); - else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); + if (cmode == SINGLE_PROC) + nmpimd_transform(bufsortedall, x, M_xp2x[universe->iworld]); + else if (cmode == MULTI_PROC) + nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); } - if(mapflag){ - for(int i=0; iunmap_inv(x[i], image[i]); - } + if (mapflag) { + for (int i = 0; i < nlocal; i++) domain->unmap_inv(x[i], image[i]); } - if(method==NMPIMD) - { + if (method == NMPIMD) { inter_replica_comm(v); - if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, v, M_x2xp[universe->iworld]); - else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, v, M_x2xp[universe->iworld]); + if (cmode == SINGLE_PROC) + nmpimd_transform(bufsortedall, v, M_x2xp[universe->iworld]); + else if (cmode == MULTI_PROC) + nmpimd_transform(bufbeads, v, M_x2xp[universe->iworld]); } - if(universe->me==0 && screen) fprintf(screen,"Setting up Path-Integral ...\n"); - if(universe->me==0) printf("Setting up Path-Integral ...\n"); + if (universe->me == 0 && screen) fprintf(screen, "Setting up Path-Integral ...\n"); + if (universe->me == 0) printf("Setting up Path-Integral ...\n"); post_force(vflag); compute_totke(); end_of_step(); - c_pe->addstep(update->ntimestep+1); - c_press->addstep(update->ntimestep+1); + c_pe->addstep(update->ntimestep + 1); + c_press->addstep(update->ntimestep + 1); } /* ---------------------------------------------------------------------- */ @@ -486,158 +478,133 @@ void FixPIMDLangevin::setup(int vflag) void FixPIMDLangevin::initial_integrate(int /*vflag*/) { int nlocal = atom->nlocal; - tagint *tag = atom->tag; double **x = atom->x; imageint *image = atom->image; - if(mapflag){ - for(int i=0; iunmap(x[i], image[i]); - } + if (mapflag) { + for (int i = 0; i < nlocal; i++) domain->unmap(x[i], image[i]); } - if(integrator==obabo) - { - if(tstat_flag) - { + if (integrator == OBABO) { + if (tstat_flag) { o_step(); - if(pstat_flag) press_o_step(); + if (pstat_flag) press_o_step(); } - if(pstat_flag) - { + if (pstat_flag) { compute_totke(); compute_p_cv(); press_v_step(); } - b_step(); - if(method==NMPIMD) - { + b_step(); + if (method == NMPIMD) { inter_replica_comm(x); - if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); - else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); + if (cmode == SINGLE_PROC) + nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); + else if (cmode == MULTI_PROC) + nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); } - qc_step(); - a_step(); - qc_step(); - a_step(); + qc_step(); + a_step(); + qc_step(); + a_step(); + } else if (integrator == BAOAB) { + if (pstat_flag) { + compute_totke(); + compute_p_cv(); + press_v_step(); } - else if(integrator==baoab) - { - if(pstat_flag) - { - compute_totke(); - compute_p_cv(); - press_v_step(); - } - b_step(); - if(method==NMPIMD) - { - inter_replica_comm(x); - if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); - else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); - } - qc_step(); - a_step(); - if(tstat_flag) - { - o_step(); - if(pstat_flag) press_o_step(); - } - qc_step(); - a_step(); - } - else - { - error->universe_all(FLERR,"Unknown integrator parameter for fix pimd"); - } - collect_xc(); - compute_spring_energy(); - - if(method==NMPIMD) - { + b_step(); + if (method == NMPIMD) { inter_replica_comm(x); - if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, x, M_xp2x[universe->iworld]); - else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); + if (cmode == SINGLE_PROC) + nmpimd_transform(bufsortedall, x, M_x2xp[universe->iworld]); + else if (cmode == MULTI_PROC) + nmpimd_transform(bufbeads, x, M_x2xp[universe->iworld]); } - - - if(mapflag){ - for(int i=0; iunmap_inv(x[i], image[i]); - } + qc_step(); + a_step(); + if (tstat_flag) { + o_step(); + if (pstat_flag) press_o_step(); } + qc_step(); + a_step(); + } else { + error->universe_all(FLERR, "Unknown integrator parameter for fix pimd/langevin"); + } + collect_xc(); + compute_spring_energy(); + + if (method == NMPIMD) { + inter_replica_comm(x); + if (cmode == SINGLE_PROC) + nmpimd_transform(bufsortedall, x, M_xp2x[universe->iworld]); + else if (cmode == MULTI_PROC) + nmpimd_transform(bufbeads, x, M_xp2x[universe->iworld]); + } + + if (mapflag) { + for (int i = 0; i < nlocal; i++) { domain->unmap_inv(x[i], image[i]); } + } } /* ---------------------------------------------------------------------- */ void FixPIMDLangevin::final_integrate() { - if(pstat_flag) - { - compute_totke(); - compute_p_cv(); - press_v_step(); + if (pstat_flag) { + compute_totke(); + compute_p_cv(); + press_v_step(); + } + b_step(); + if (integrator == OBABO) { + if (tstat_flag) { + o_step(); + if (pstat_flag) press_o_step(); } - b_step(); - if(integrator==obabo) - { - if(tstat_flag) - { - o_step(); - if(pstat_flag) press_o_step(); - } - } - else if(integrator==baoab) - { + } else if (integrator == BAOAB) { - } - else - { - error->universe_all(FLERR,"Unknown integrator parameter for fix pimd"); - } + } else { + error->universe_all(FLERR, "Unknown integrator parameter for fix pimd/langevin"); + } } /* ---------------------------------------------------------------------- */ void FixPIMDLangevin::post_force(int /*flag*/) { - if(atom->nmax > maxunwrap) reallocate_x_unwrap(); - if(atom->nmax > maxxc) reallocate_xc(); + if (atom->nmax > maxunwrap) reallocate_x_unwrap(); + if (atom->nmax > maxxc) reallocate_xc(); int nlocal = atom->nlocal; double **x = atom->x; double **f = atom->f; imageint *image = atom->image; tagint *tag = atom->tag; - for(int i=0; iunmap(x_unwrap[i], image[i]); - } + if (mapflag) { + for (int i = 0; i < nlocal; i++) { domain->unmap(x_unwrap[i], image[i]); } } - for(int i=0; imap(1); + compute_vir(); compute_vir_(); compute_pote(); - if(method==NMPIMD) - { + if (method == NMPIMD) { inter_replica_comm(f); - if(cmode == SINGLE_PROC) nmpimd_transform(bufsortedall, f, M_x2xp[universe->iworld]); - else if(cmode == MULTI_PROC) nmpimd_transform(bufbeads, f, M_x2xp[universe->iworld]); + if (cmode == SINGLE_PROC) + nmpimd_transform(bufsortedall, f, M_x2xp[universe->iworld]); + else if (cmode == MULTI_PROC) + nmpimd_transform(bufbeads, f, M_x2xp[universe->iworld]); } - c_pe->addstep(update->ntimestep+1); - c_press->addstep(update->ntimestep+1); + c_pe->addstep(update->ntimestep + 1); + c_press->addstep(update->ntimestep + 1); } /* ---------------------------------------------------------------------- */ @@ -647,11 +614,10 @@ void FixPIMDLangevin::end_of_step() compute_totke(); compute_p_cv(); compute_tote(); - if(pstat_flag) compute_totenthalpy(); + if (pstat_flag) compute_totenthalpy(); - if(update->ntimestep % 10000 == 0) - { - if(universe->me==0) printf("This is the end of step %ld.\n", update->ntimestep); + if (update->ntimestep % 10000 == 0) { + if (universe->me == 0) printf("This is the end of step %ld.\n", update->ntimestep); } } @@ -660,37 +626,28 @@ void FixPIMDLangevin::collect_xc() int nlocal = atom->nlocal; double **x = atom->x; tagint *tag = atom->tag; - if(ireplica == 0) - { - if(cmode == SINGLE_PROC) - { - for(int i=0; imap(1); - if(cmode == MULTI_PROC) - { - MPI_Allreduce(MPI_IN_PLACE, xcall, ntotal*3, MPI_DOUBLE, MPI_SUM, world); + if (cmode == MULTI_PROC) { + MPI_Allreduce(MPI_IN_PLACE, xcall, ntotal * 3, MPI_DOUBLE, MPI_SUM, world); } } - MPI_Bcast(xcall, ntotal*3, MPI_DOUBLE, 0, universe->uworld); + MPI_Bcast(xcall, ntotal * 3, MPI_DOUBLE, 0, universe->uworld); } /* ---------------------------------------------------------------------- */ @@ -703,51 +660,45 @@ void FixPIMDLangevin::b_step() double **v = atom->v; double **f = atom->f; - for(int i=0; inlocal; double **x = atom->x; double **v = atom->v; - tagint *tag = atom->tag; double oldlo, oldhi; - if(!pstat_flag) { - if(universe->iworld == 0) - { - for(int i=0; iiworld == 0) { + for (int i = 0; i < nlocal; i++) { x[i][0] += dtv * v[i][0]; x[i][1] += dtv * v[i][1]; x[i][2] += dtv * v[i][2]; } } - } - else{ - if(universe->iworld == 0) - { + } else { + if (universe->iworld == 0) { double expp[3], expq[3]; - if(pstyle == ISO) {vw[1] = vw[0]; vw[2] = vw[0];} - for(int j=0; j<3; j++) - { + if (pstyle == ISO) { + vw[1] = vw[0]; + vw[2] = vw[0]; + } + for (int j = 0; j < 3; j++) { expq[j] = exp(dtv * vw[j]); expp[j] = exp(-dtv * vw[j]); } - if(barostat == BZP) - { - for(int i=0; iboxlo[0]; oldhi = domain->boxhi[0]; - domain->boxlo[0] = (oldlo-fixedpoint[0])*expq[0] + fixedpoint[0]; - domain->boxhi[0] = (oldhi-fixedpoint[0])*expq[0] + fixedpoint[0]; + domain->boxlo[0] = (oldlo - fixedpoint[0]) * expq[0] + fixedpoint[0]; + domain->boxhi[0] = (oldhi - fixedpoint[0]) * expq[0] + fixedpoint[0]; oldlo = domain->boxlo[1]; oldhi = domain->boxhi[1]; - domain->boxlo[1] = (oldlo-fixedpoint[1])*expq[1] + fixedpoint[1]; - domain->boxhi[1] = (oldhi-fixedpoint[1])*expq[1] + fixedpoint[1]; + domain->boxlo[1] = (oldlo - fixedpoint[1]) * expq[1] + fixedpoint[1]; + domain->boxhi[1] = (oldhi - fixedpoint[1]) * expq[1] + fixedpoint[1]; oldlo = domain->boxlo[2]; oldhi = domain->boxhi[2]; - domain->boxlo[2] = (oldlo-fixedpoint[2])*expq[2] + fixedpoint[2]; - domain->boxhi[2] = (oldhi-fixedpoint[2])*expq[2] + fixedpoint[2]; + domain->boxlo[2] = (oldlo - fixedpoint[2]) * expq[2] + fixedpoint[2]; + domain->boxhi[2] = (oldhi - fixedpoint[2]) * expq[2] + fixedpoint[2]; } } MPI_Barrier(universe->uworld); @@ -780,26 +731,33 @@ void FixPIMDLangevin::qc_step(){ /* ---------------------------------------------------------------------- */ -void FixPIMDLangevin::a_step(){ +void FixPIMDLangevin::a_step() +{ int n = atom->nlocal; double **x = atom->x; double **v = atom->v; - double x0, x1, x2, v0, v1, v2; // three components of x[i] and v[i] + double x0, x1, x2, v0, v1, v2; // three components of x[i] and v[i] - if(universe->iworld != 0) - { - for(int i=0; iiworld != 0) { + for (int i = 0; i < n; i++) { x0 = x[i][0]; x1 = x[i][1]; x2 = x[i][2]; - v0 = v[i][0]; v1 = v[i][1]; v2 = v[i][2]; - x[i][0] = Lan_c[universe->iworld] * x0 + 1./_omega_k[universe->iworld] * Lan_s[universe->iworld] * v0; - x[i][1] = Lan_c[universe->iworld] * x1 + 1./_omega_k[universe->iworld] * Lan_s[universe->iworld] * v1; - x[i][2] = Lan_c[universe->iworld] * x2 + 1./_omega_k[universe->iworld] * Lan_s[universe->iworld] * v2; - v[i][0] = -1.*_omega_k[universe->iworld] * Lan_s[universe->iworld] * x0 + Lan_c[universe->iworld] * v0; - v[i][1] = -1.*_omega_k[universe->iworld] * Lan_s[universe->iworld] * x1 + Lan_c[universe->iworld] * v1; - v[i][2] = -1.*_omega_k[universe->iworld] * Lan_s[universe->iworld] * x2 + Lan_c[universe->iworld] * v2; + v0 = v[i][0]; + v1 = v[i][1]; + v2 = v[i][2]; + x[i][0] = Lan_c[universe->iworld] * x0 + + 1.0 / _omega_k[universe->iworld] * Lan_s[universe->iworld] * v0; + x[i][1] = Lan_c[universe->iworld] * x1 + + 1.0 / _omega_k[universe->iworld] * Lan_s[universe->iworld] * v1; + x[i][2] = Lan_c[universe->iworld] * x2 + + 1.0 / _omega_k[universe->iworld] * Lan_s[universe->iworld] * v2; + v[i][0] = -1.0 * _omega_k[universe->iworld] * Lan_s[universe->iworld] * x0 + + Lan_c[universe->iworld] * v0; + v[i][1] = -1.0 * _omega_k[universe->iworld] * Lan_s[universe->iworld] * x1 + + Lan_c[universe->iworld] * v1; + v[i][2] = -1.0 * _omega_k[universe->iworld] * Lan_s[universe->iworld] * x2 + + Lan_c[universe->iworld] * v2; } } } @@ -809,8 +767,12 @@ void FixPIMDLangevin::a_step(){ void FixPIMDLangevin::baro_init() { vw[0] = vw[1] = vw[2] = vw[3] = vw[4] = vw[5] = 0.0; - if(pstyle == ISO) {W = 3 * (atom->natoms) * tau_p * tau_p * np * kBT;} // consistent with the definition in i-Pi - else if(pstyle == ANISO) {W = atom->natoms * tau_p * tau_p * np * kBT;} + if (pstyle == ISO) { + W = 3 * (atom->natoms) * tau_p * tau_p * np * kBT; + } // consistent with the definition in i-Pi + else if (pstyle == ANISO) { + W = atom->natoms * tau_p * tau_p * np * kBT; + } Vcoeff = 1.0; std::string out = fmt::format("\nInitializing PIMD {:s} barostat...\n", Barostats[barostat]); out += fmt::format("The barostat mass is W = {:.16e}\n", W); @@ -827,18 +789,13 @@ void FixPIMDLangevin::press_v_step() int *type = atom->type; volume = domain->xprd * domain->yprd * domain->zprd; - if(pstyle == ISO) - { - if(barostat == BZP) - { + if (pstyle == ISO) { + if (barostat == BZP) { vw[0] += dtv * 3 * (volume * np * (p_cv - Pext) / force->nktv2p + Vcoeff / beta_np) / W; - if(universe->iworld==0) - { + if (universe->iworld == 0) { double dvw_proc = 0.0, dvw = 0.0; - for(int i = 0; i < nlocal; i++) - { - for(int j = 0; j < 3; j++) - { + for (int i = 0; i < nlocal; i++) { + for (int j = 0; j < 3; j++) { dvw_proc += dtv2 * f[i][j] * v[i][j] / W + dtv3 * f[i][j] * f[i][j] / mass[type[i]] / W; } } @@ -847,26 +804,21 @@ void FixPIMDLangevin::press_v_step() } MPI_Barrier(universe->uworld); MPI_Bcast(&vw[0], 1, MPI_DOUBLE, 0, universe->uworld); + } else if (barostat == MTTK) { + mtk_term1 = 2. / atom->natoms * totke / 3; + f_omega = (volume * np * (p_md - Pext) + mtk_term1) / W; + vw[0] += 0.5 * dtv * f_omega; } - else if(barostat == MTTK) - { - mtk_term1 = 2. / atom->natoms * totke / 3; - f_omega = (volume * np * (p_md - Pext) + mtk_term1) / W; - vw[0] += 0.5 * dtv * f_omega; - } - } - else if(pstyle == ANISO) - { + } else if (pstyle == ANISO) { compute_stress_tensor(); - for(int ii=0; ii<3; ii++) - { - vw[ii] += dtv * (volume * np * (stress_tensor[ii] - Pext) / force->nktv2p + Vcoeff / beta_np) / W; - if(universe->iworld==0) - { + for (int ii = 0; ii < 3; ii++) { + vw[ii] += + dtv * (volume * np * (stress_tensor[ii] - Pext) / force->nktv2p + Vcoeff / beta_np) / W; + if (universe->iworld == 0) { double dvw_proc = 0.0, dvw = 0.0; - for(int i = 0; i < nlocal; i++) - { - dvw_proc += dtv2 * f[i][ii] * v[i][ii] / W + dtv3 * f[i][ii] * f[i][ii] / mass[type[i]] / W; + for (int i = 0; i < nlocal; i++) { + dvw_proc += + dtv2 * f[i][ii] * v[i][ii] / W + dtv3 * f[i][ii] * f[i][ii] / mass[type[i]] / W; } MPI_Allreduce(&dvw_proc, &dvw, 1, MPI_DOUBLE, MPI_SUM, world); vw[ii] += dvw; @@ -879,26 +831,21 @@ void FixPIMDLangevin::press_v_step() void FixPIMDLangevin::press_o_step() { - if(pstyle==ISO) - { - if(universe->me==0) - { + if (pstyle == ISO) { + if (universe->me == 0) { r1 = random->gaussian(); - vw[0] = c1 * vw[0] + c2 * sqrt(1. / W / beta_np) * r1; + vw[0] = c1 * vw[0] + c2 * sqrt(1.0 / W / beta_np) * r1; } MPI_Barrier(universe->uworld); MPI_Bcast(&vw[0], 1, MPI_DOUBLE, 0, universe->uworld); - } - else if(pstyle==ANISO) - { - if(universe->me==0) - { + } else if (pstyle == ANISO) { + if (universe->me == 0) { r1 = random->gaussian(); r2 = random->gaussian(); r3 = random->gaussian(); - vw[0] = c1 * vw[0] + c2 * sqrt(1. / W / beta_np) * r1; - vw[1] = c1 * vw[1] + c2 * sqrt(1. / W / beta_np) * r2; - vw[2] = c1 * vw[2] + c2 * sqrt(1. / W / beta_np) * r3; + vw[0] = c1 * vw[0] + c2 * sqrt(1.0 / W / beta_np) * r1; + vw[1] = c1 * vw[1] + c2 * sqrt(1.0 / W / beta_np) * r2; + vw[2] = c1 * vw[2] + c2 * sqrt(1.0 / W / beta_np) * r3; } MPI_Barrier(universe->uworld); MPI_Bcast(&vw, 3, MPI_DOUBLE, 0, universe->uworld); @@ -916,52 +863,61 @@ void FixPIMDLangevin::Langevin_init() _omega_k = new double[np]; Lan_c = new double[np]; Lan_s = new double[np]; - if(fmmode==physical){ - for (int i=0; i 0) gamma = 1.0 / tau; - else gamma = np / beta / hbar; + if (tau > 0) + gamma = 1.0 / tau; + else + gamma = np / beta / hbar; - if(integrator==obabo) c1 = exp(-gamma * 0.5 * update->dt); // tau is the damping time of the centroid mode. - else if(integrator==baoab) c1 = exp(-gamma * update->dt); - else error->universe_all(FLERR, "Unknown integrator parameter for fix pimd. Only obabo and baoab integrators is supported!"); + if (integrator == OBABO) + c1 = exp(-gamma * 0.5 * update->dt); // tau is the damping time of the centroid mode. + else if (integrator == BAOAB) + c1 = exp(-gamma * update->dt); + else + error->universe_all(FLERR, + "Unknown integrator parameter for fix pimd/langevin. Only obabo and " + "baoab integrators are supported!"); - c2 = sqrt(1.0 - c1 * c1); // note that c1 and c2 here only works for the centroid mode. + c2 = sqrt(1.0 - c1 * c1); // note that c1 and c2 here only works for the centroid mode. - if( thermostat == PILE_L ) - { + if (thermostat == PILE_L) { std::string out = "\nInitializing PI Langevin equation thermostat...\n"; out += "Bead ID | omega | tau | c1 | c2\n"; tau_k = new double[np]; c1_k = new double[np]; c2_k = new double[np]; - tau_k[0] = tau; c1_k[0] = c1; c2_k[0] = c2; - for(int i=1; idt / tau_k[i]); - else if(integrator==baoab) c1_k[i] = exp(-1.0 * update->dt / tau_k[i]); - else error->universe_all(FLERR, "Unknown integrator parameter for fix pimd. Only obabo and baoab integrators is supported!"); + if (integrator == OBABO) + c1_k[i] = exp(-0.5 * update->dt / tau_k[i]); + else if (integrator == BAOAB) + c1_k[i] = exp(-1.0 * update->dt / tau_k[i]); + else + error->universe_all(FLERR, + "Unknown integrator parameter for fix pimd/langevin. Only obabo and " + "baoab integrators are supported!"); c2_k[i] = sqrt(1.0 - c1_k[i] * c1_k[i]); } - for(int i=0; inlocal; int *type = atom->type; - double beta_np = 1.0 / force->boltz / Lan_temp / np * force->mvv2e; - if(thermostat == PILE_L) - { - for(int i=0; iboltz / Lan_temp * inverse_np * force->mvv2e; + if (thermostat == PILE_L) { + for (int i = 0; i < nlocal; i++) { r1 = random->gaussian(); r2 = random->gaussian(); r3 = random->gaussian(); - atom->v[i][0] = c1_k[universe->iworld] * atom->v[i][0] + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r1; - atom->v[i][1] = c1_k[universe->iworld] * atom->v[i][1] + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r2; - atom->v[i][2] = c1_k[universe->iworld] * atom->v[i][2] + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r3; + atom->v[i][0] = c1_k[universe->iworld] * atom->v[i][0] + + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r1; + atom->v[i][1] = c1_k[universe->iworld] * atom->v[i][1] + + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r2; + atom->v[i][2] = c1_k[universe->iworld] * atom->v[i][2] + + c2_k[universe->iworld] * sqrt(1.0 / mass[type[i]] / beta_np) * r3; } } } @@ -994,94 +951,79 @@ void FixPIMDLangevin::o_step() void FixPIMDLangevin::nmpimd_init() { - memory->create(M_x2xp, np, np, "fix_feynman:M_x2xp"); - memory->create(M_xp2x, np, np, "fix_feynman:M_xp2x"); + memory->create(M_x2xp, np, np, "fix_feynman:M_x2xp"); + memory->create(M_xp2x, np, np, "fix_feynman:M_xp2x"); - lam = (double*) memory->smalloc(sizeof(double)*np, "FixPIMDLangevin::lam"); + lam = (double *) memory->smalloc(sizeof(double) * np, "FixPIMDLangevin::lam"); - // Set up eigenvalues - for(int i=0; iiworld; - for(int i=1; i<=atom->ntypes; i++) - { - mass[i] = atom->mass[i]; - if(iworld) - { - if(fmmode==physical) { mass[i] *= 1.0; } - else if(fmmode==normal) { mass[i] *= lam[iworld]; } - mass[i] *= fmass; + // Set up Ut + for (int i = 0; i < np; i++) + for (int j = 0; j < np; j++) { M_xp2x[i][j] = M_x2xp[j][i]; } + + // Set up masses + int iworld = universe->iworld; + for (int i = 1; i <= atom->ntypes; i++) { + mass[i] = atom->mass[i]; + if (iworld) { + if (fmmode == PHYSICAL) { + mass[i] *= 1.0; + } else if (fmmode == NORMAL) { + mass[i] *= lam[iworld]; } + mass[i] *= fmass; } + } } /* ---------------------------------------------------------------------- */ void FixPIMDLangevin::nmpimd_transform(double **src, double **des, double *vector) { - if(cmode == SINGLE_PROC) - { - for(int i=0; itag[i]; - for(int d=0; d<3; d++) - { - des[i][d] = bufsorted[tagtmp-1][d]; - } + for (int d = 0; d < 3; d++) { des[i][d] = bufsorted[tagtmp - 1][d]; } } - } - else if(cmode == MULTI_PROC) - { - int n = atom->nlocal; - int m = 0; + } else if (cmode == MULTI_PROC) { + int n = atom->nlocal; + int m = 0; - for (int i = 0; i < n; i++) - for (int d = 0; d < 3; d++) { - des[i][d] = 0.0; - for (int j = 0; j < np; j++) { des[i][d] += (src[j][m] * vector[j]); } - m++; - } + for (int i = 0; i < n; i++) + for (int d = 0; d < 3; d++) { + des[i][d] = 0.0; + for (int j = 0; j < np; j++) { des[i][d] += (src[j][m] * vector[j]); } + m++; + } } } @@ -1092,25 +1034,25 @@ void FixPIMDLangevin::nmpimd_transform(double **src, double **des, double *vecto void FixPIMDLangevin::comm_init() { // if(me == 0){ - if (sizeplan) { - delete [] plansend; - delete [] planrecv; - } + if (sizeplan) { + delete[] plansend; + delete[] planrecv; + } - sizeplan = np - 1; - plansend = new int[sizeplan]; - planrecv = new int[sizeplan]; - modeindex = new int[sizeplan]; - for (int i = 0; i < sizeplan; i++) { - int isend, irecv; - isend = ireplica + i + 1; - if (isend >= nreplica) isend -= nreplica; - irecv = ireplica - (i + 1); - if (irecv < 0) irecv += nreplica; - plansend[i] = universe->root_proc[isend]; - planrecv[i] = universe->root_proc[irecv]; - modeindex[i] = irecv; - } + sizeplan = np - 1; + plansend = new int[sizeplan]; + planrecv = new int[sizeplan]; + modeindex = new int[sizeplan]; + for (int i = 0; i < sizeplan; i++) { + int isend, irecv; + isend = ireplica + i + 1; + if (isend >= nreplica) isend -= nreplica; + irecv = ireplica - (i + 1); + if (irecv < 0) irecv += nreplica; + plansend[i] = universe->root_proc[isend]; + planrecv[i] = universe->root_proc[irecv]; + modeindex[i] = irecv; + } } /* ---------------------------------------------------------------------- */ @@ -1145,7 +1087,7 @@ void FixPIMDLangevin::reallocate() memory->create(bufrecv, maxlocal, 3, "FixPIMDLangevin:bufrecv"); memory->create(tagsend, maxlocal, "FixPIMDLangevin:tagsend"); memory->create(tagrecv, maxlocal, "FixPIMDLangevin:tagrecv"); - memory->create(bufbeads, nreplica, maxlocal*3, "FixPIMDLangevin:bufrecv"); + memory->create(bufbeads, nreplica, maxlocal * 3, "FixPIMDLangevin:bufrecv"); } /* ---------------------------------------------------------------------- */ @@ -1160,36 +1102,31 @@ void FixPIMDLangevin::inter_replica_comm(double **ptr) int i, m; // copy local values - for(i=0; itag[i]; - bufsorted[tagtmp-1][0] = ptr[i][0]; - bufsorted[tagtmp-1][1] = ptr[i][1]; - bufsorted[tagtmp-1][2] = ptr[i][2]; + bufsorted[tagtmp - 1][0] = ptr[i][0]; + bufsorted[tagtmp - 1][1] = ptr[i][1]; + bufsorted[tagtmp - 1][2] = ptr[i][2]; m++; } MPI_Allgather(&m, 1, MPI_INT, counts, 1, MPI_INT, universe->uworld); for (i = 0; i < nreplica; i++) { counts[i] *= 3; } displacements[0] = 0; - for (i = 0; i < nreplica-1; i++) { displacements[i+1] = displacements[i] + counts[i]; } - MPI_Allgatherv(bufsorted[0], 3*m, MPI_DOUBLE, bufsortedall[0], counts, displacements, MPI_DOUBLE, universe->uworld); - } - else if(cmode == MULTI_PROC) - { + for (i = 0; i < nreplica - 1; i++) { displacements[i + 1] = displacements[i] + counts[i]; } + MPI_Allgatherv(bufsorted[0], 3 * m, MPI_DOUBLE, bufsortedall[0], counts, displacements, + MPI_DOUBLE, universe->uworld); + } else if (cmode == MULTI_PROC) { m = 0; - for(i=0; iuworld, &requests[0]); - MPI_Irecv(tagrecvall, ntotal, MPI_LMP_TAGINT, planrecv[iplan], 0, universe->uworld, &requests[1]); - MPI_Send(bufsendall[0], 3*ntotal, MPI_DOUBLE, plansend[iplan], 0, universe->uworld); + for (i = 0; i < nprocs - 1; i++) { displacements[i + 1] = displacements[i] + counts[i]; } + MPI_Gatherv(bufsend[0], 3 * m, MPI_DOUBLE, bufsendall[0], counts, displacements, MPI_DOUBLE, 0, + world); + for (int iplan = 0; iplan < sizeplan; iplan++) { + if (me == 0) { + MPI_Irecv(bufrecvall[0], 3 * ntotal, MPI_DOUBLE, planrecv[iplan], 0, universe->uworld, + &requests[0]); + MPI_Irecv(tagrecvall, ntotal, MPI_LMP_TAGINT, planrecv[iplan], 0, universe->uworld, + &requests[1]); + MPI_Send(bufsendall[0], 3 * ntotal, MPI_DOUBLE, plansend[iplan], 0, universe->uworld); MPI_Send(tagsendall, ntotal, MPI_LMP_TAGINT, plansend[iplan], 0, universe->uworld); - MPI_Waitall(2,requests,statuses); + MPI_Waitall(2, requests, statuses); } MPI_Bcast(tagrecvall, ntotal, MPI_LMP_TAGINT, 0, world); - MPI_Bcast(bufrecvall[0], 3*ntotal, MPI_DOUBLE, 0, world); - for(i=0; imap(tagrecvall[i]); if (m < 0 || m >= nlocal) continue; - bufbeads[modeindex[iplan]][3*m+0] = bufrecvall[i][0]; - bufbeads[modeindex[iplan]][3*m+1] = bufrecvall[i][1]; - bufbeads[modeindex[iplan]][3*m+2] = bufrecvall[i][2]; + bufbeads[modeindex[iplan]][3 * m + 0] = bufrecvall[i][0]; + bufbeads[modeindex[iplan]][3 * m + 1] = bufrecvall[i][1]; + bufbeads[modeindex[iplan]][3 * m + 2] = bufrecvall[i][2]; } } } @@ -1233,20 +1172,17 @@ void FixPIMDLangevin::compute_vir_() { int nlocal = atom->nlocal; xf = vir_ = xcf = centroid_vir = 0.0; - int idx = atom->map(1); - for(int i=0; if[i][j]; xcf += (x_unwrap[i][j] - xc[i][j]) * atom->f[i][j]; } } MPI_Allreduce(&xf, &vir_, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); MPI_Allreduce(&xcf, ¢roid_vir, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); - if(pstyle == ANISO){ - for(int i=0; i<6; i++) c_vir_tensor[i] = 0.0; - for(int i=0; if[i][0]; c_vir_tensor[1] += (x_unwrap[i][1] - xc[i][1]) * atom->f[i][1]; c_vir_tensor[2] += (x_unwrap[i][2] - xc[i][2]) * atom->f[i][2]; @@ -1264,14 +1200,14 @@ void FixPIMDLangevin::compute_vir() { volume = domain->xprd * domain->yprd * domain->zprd; c_press->compute_vector(); - virial[0] = c_press->vector[0]*volume; - virial[1] = c_press->vector[1]*volume; - virial[2] = c_press->vector[2]*volume; - virial[3] = c_press->vector[3]*volume; - virial[4] = c_press->vector[4]*volume; - virial[5] = c_press->vector[5]*volume; - for(int i=0; i<6; i++) virial[i] /= universe->procs_per_world[universe->iworld]; - double vir_bead=(virial[0]+virial[1]+virial[2]); + virial[0] = c_press->vector[0] * volume; + virial[1] = c_press->vector[1] * volume; + virial[2] = c_press->vector[2] * volume; + virial[3] = c_press->vector[3] * volume; + virial[4] = c_press->vector[4] * volume; + virial[5] = c_press->vector[5] * volume; + for (int i = 0; i < 6; i++) virial[i] /= universe->procs_per_world[universe->iworld]; + double vir_bead = (virial[0] + virial[1] + virial[2]); MPI_Allreduce(&vir_bead, &vir, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); MPI_Allreduce(MPI_IN_PLACE, &virial[0], 6, MPI_DOUBLE, MPI_SUM, universe->uworld); } @@ -1282,10 +1218,10 @@ void FixPIMDLangevin::compute_stress_tensor() { int nlocal = atom->nlocal; int *type = atom->type; - if(universe->iworld == 0){ + if (universe->iworld == 0) { inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); - for(int i=0; i<6; i++) ke_tensor[i] = 0.0; - for(int i=0; iv[i][0] * atom->v[i][0] * force->mvv2e; ke_tensor[1] += 0.5 * mass[type[i]] * atom->v[i][1] * atom->v[i][1] * force->mvv2e; ke_tensor[2] += 0.5 * mass[type[i]] * atom->v[i][2] * atom->v[i][2] * force->mvv2e; @@ -1294,9 +1230,9 @@ void FixPIMDLangevin::compute_stress_tensor() ke_tensor[5] += 0.5 * mass[type[i]] * atom->v[i][1] * atom->v[i][2] * force->mvv2e; } MPI_Allreduce(MPI_IN_PLACE, &ke_tensor, 6, MPI_DOUBLE, MPI_SUM, world); - for(int i=0; i<6; i++) - { - stress_tensor[i] = inv_volume * ((2*ke_tensor[i] - c_vir_tensor[i]) * force->nktv2p + virial[i]) / np; + for (int i = 0; i < 6; i++) { + stress_tensor[i] = + inv_volume * ((2 * ke_tensor[i] - c_vir_tensor[i]) * force->nktv2p + virial[i]) / np; } } MPI_Bcast(&stress_tensor, 6, MPI_DOUBLE, 0, universe->uworld); @@ -1310,12 +1246,8 @@ void FixPIMDLangevin::compute_totke() totke = ke_bead = 0.0; int nlocal = atom->nlocal; int *type = atom->type; - for(int i=0; iv[i][j] * atom->v[i][j]; - } + for (int i = 0; i < nlocal; i++) { + for (int j = 0; j < 3; j++) { kine += 0.5 * mass[type[i]] * atom->v[i][j] * atom->v[i][j]; } } kine *= force->mvv2e; MPI_Allreduce(&kine, &ke_bead, 1, MPI_DOUBLE, MPI_SUM, world); @@ -1329,13 +1261,13 @@ void FixPIMDLangevin::compute_spring_energy() total_spring_energy = se_bead = 0.0; double **x = atom->x; - double* _mass = atom->mass; - int* type = atom->type; + double *_mass = atom->mass; + int *type = atom->type; int nlocal = atom->nlocal; - for(int i=0; iiworld] * (x[i][0]*x[i][0] + x[i][1]*x[i][1] + x[i][2]*x[i][2]); + for (int i = 0; i < nlocal; i++) { + spring_energy += 0.5 * _mass[type[i]] * fbond * lam[universe->iworld] * + (x[i][0] * x[i][0] + x[i][1] * x[i][1] + x[i][2] * x[i][2]); } MPI_Allreduce(&spring_energy, &se_bead, 1, MPI_DOUBLE, MPI_SUM, world); } @@ -1370,8 +1302,8 @@ void FixPIMDLangevin::compute_t_prim() /* void FixPIMDLangevin::compute_t_vir() { - t_vir = -0.5 / np * vir_; - t_cv = 1.5 * atom->natoms * force->boltz * temp - 0.5 / np * centroid_vir; + t_vir = -0.5 * inverse_np * vir_; + t_cv = 1.5 * atom->natoms * force->boltz * temp - 0.5 * inverse_np * centroid_vir; } */ /* ---------------------------------------------------------------------- */ @@ -1387,9 +1319,8 @@ void FixPIMDLangevin::compute_p_prim() void FixPIMDLangevin::compute_p_cv() { inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); - if(universe->iworld == 0) - { - p_cv = 1. / 3. * inv_volume * ((2. * ke_bead - 1. * centroid_vir) * force->nktv2p + 1. * vir) / np; + if (universe->iworld == 0) { + p_cv = THIRD * inv_volume * ((2.0 * ke_bead - centroid_vir) * force->nktv2p + vir) / np; } MPI_Bcast(&p_cv, 1, MPI_DOUBLE, 0, universe->uworld); } @@ -1399,58 +1330,53 @@ void FixPIMDLangevin::compute_p_cv() void FixPIMDLangevin::compute_totenthalpy() { volume = domain->xprd * domain->yprd * domain->zprd; - if(barostat == BZP) - { - if(pstyle == ISO) - { - totenthalpy = tote + 0.5*W*vw[0]*vw[0]/np + Pext * volume / force->nktv2p - Vcoeff * kBT * log(volume); + if (barostat == BZP) { + if (pstyle == ISO) { + totenthalpy = tote + 0.5 * W * vw[0] * vw[0] * inverse_np + Pext * volume / force->nktv2p - + Vcoeff * kBT * log(volume); + } else if (pstyle == ANISO) { + totenthalpy = tote + 0.5 * W * vw[0] * vw[0] * inverse_np + 0.5 * W * vw[1] * vw[1] * inverse_np + + 0.5 * W * vw[2] * vw[2] * inverse_np + Pext * volume / force->nktv2p - Vcoeff * kBT * log(volume); } - else if(pstyle == ANISO) - { - totenthalpy = tote + 0.5*W*vw[0]*vw[0]/np + 0.5*W*vw[1]*vw[1]/np + 0.5*W*vw[2]*vw[2]/np + Pext * volume / force->nktv2p - Vcoeff * kBT * log(volume); - } - } - else if(barostat == MTTK) totenthalpy = tote + 1.5*W*vw[0]*vw[0]/np + Pext * (volume - vol0); + } else if (barostat == MTTK) + totenthalpy = tote + 1.5 * W * vw[0] * vw[0] * inverse_np + Pext * (volume - vol0); } /* ---------------------------------------------------------------------- */ double FixPIMDLangevin::compute_vector(int n) { - if(n==0) { return ke_bead; } - if(n==1) { return se_bead; } - if(n==2) { return pe_bead; } - if(n==3) { return tote; } + if (n == 0) return ke_bead; + if (n == 1) return se_bead; + if (n == 2) return pe_bead; + if (n == 3) return tote; // if(n==3) { return W*vw[0]; } - if(!pstat_flag) - { - if(n==4) { return t_prim; } - if(n==5) { return t_vir; } - if(n==6) { return t_cv; } - } - else if(pstat_flag) - { - if(pstyle == ISO) - { - if(barostat == BZP) - { - if(n==4) { return 0.5*W*vw[0]*vw[0]; } + if (!pstat_flag) { + if (n == 4) return t_prim; + if (n == 5) return t_vir; + if (n == 6) return t_cv; + } else if (pstat_flag) { + if (pstyle == ISO) { + if (barostat == BZP) { + if (n == 4) return 0.5 * W * vw[0] * vw[0]; + } else if (barostat == MTTK) { + if (n == 4) return 1.5 * W * vw[0] * vw[0]; } - else if(barostat == MTTK) - { - if(n==4) { return 1.5*W*vw[0]*vw[0]; } + if (n == 5) { + volume = domain->xprd * domain->yprd * domain->zprd; + return np * Pext * volume / force->nktv2p; } - if(n==5) { volume = domain->xprd * domain->yprd * domain->zprd; return np * Pext * volume / force->nktv2p; } - if(n==6) { volume = domain->xprd * domain->yprd * domain->zprd; return - Vcoeff * np * kBT * log(volume); } - if(n==7) { return totenthalpy; } - if(n==8) { return p_cv; } - if(n==9) { return total_spring_energy; } - } - else if(pstyle == ANISO) - { - + if (n == 6) { + volume = domain->xprd * domain->yprd * domain->zprd; + return -Vcoeff * np * kBT * log(volume); + } + if (n == 7) return totenthalpy; + if (n == 8) return p_cv; + if (n == 9) return total_spring_energy; + } else if (pstyle == ANISO) { } } + /* if(n==7) { return p_prim; } @@ -1474,7 +1400,6 @@ double FixPIMDLangevin::compute_vector(int n) if(n>14 && n<21) return stress_tensor[n-15]; if(n==21) { volume = domain->xprd * domain->yprd * domain->zprd; return np * Pext * volume / force->nktv2p; } if(n==22) { volume = domain->xprd * domain->yprd * domain->zprd; return - Vcoeff * np * kBT * log(volume); } - } + } */ return 0.0; - */ } diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index 3af036caf9..93f4670808 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -47,7 +47,7 @@ class FixPIMDLangevin : public Fix { int np; // number of beads double inverse_np; // 1.0/np double temp; // temperature - double planck, hbar; // Planck's constant + double hbar; // Planck's constant double lj_epsilon, lj_sigma, lj_mass; // LJ unit energy, length, and mass scales double other_planck; double kBT; // k_B * temp @@ -119,8 +119,7 @@ class FixPIMDLangevin : public Fix { int tstat_flag; // tstat_flat = 1 if thermostat if used void Langevin_init(); void b_step(); // integrate for dt/2 according to B part (v <- v + f * dt/2) - void - a_step(); // integrate for dt/2 according to A part (non-centroid mode, harmonic force between replicas) + void a_step(); // integrate for dt/2 according to A part (non-centroid mode, harmonic force between replicas) void qc_step(); // integrate for dt/2 for the centroid mode (x <- x + v * dt/2) void o_step(); // integrate for dt according to O part (O-U process, for thermostating) From 6b1cad1e3d1624b947a2798dca3c80bb63161cd0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 25 Feb 2023 23:16:51 -0500 Subject: [PATCH 010/172] programming style updates --- src/REPLICA/fix_pimd_langevin.cpp | 155 ++++++++++++------------------ src/REPLICA/fix_pimd_langevin.h | 6 +- 2 files changed, 62 insertions(+), 99 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 22bed54c3b..24b677b141 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -64,7 +64,7 @@ enum { SINGLE_PROC, MULTI_PROC }; /* ---------------------------------------------------------------------- */ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), random(nullptr), c_pe(nullptr), c_press(nullptr) + Fix(lmp, narg, arg), random(nullptr), c_pe(nullptr), c_press(nullptr) { time_integrate = 1; tagsend = tagrecv = nullptr; @@ -101,12 +101,17 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : tau = 1.0; tau_p = 1.0; Pext = 1.0; + pilescale = 1.0; tstat_flag = 1; pstat_flag = 0; mapflag = 1; removecomflag = 1; fmmode = PHYSICAL; pstyle = ISO; + totenthalpy = 0.0; + + int seed = -1; + for (int i = 0; i < 6; i++) p_flag[i] = 0; for (int i = 3; i < narg - 1; i += 2) { @@ -119,20 +124,17 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : method = CMD; else error->universe_all(FLERR, "Unknown method parameter for fix pimd/langevin"); - } else if (strcmp(arg[i], "integrator") == 0) - - { + } else if (strcmp(arg[i], "integrator") == 0) { if (strcmp(arg[i + 1], "obabo") == 0) integrator = OBABO; else if (strcmp(arg[i + 1], "baoab") == 0) integrator = BAOAB; else - error->universe_all(FLERR, - "Unknown integrator parameter for fix pimd/langevin. Only obabo and baoab " - "integrators are supported!"); - } - - else if (strcmp(arg[i], "ensemble") == 0) { + error->universe_all( + FLERR, + "Unknown integrator parameter for fix pimd/langevin. Only obabo and baoab " + "integrators are supported!"); + } else if (strcmp(arg[i], "ensemble") == 0) { if (strcmp(arg[i + 1], "nve") == 0) { ensemble = NVE; tstat_flag = 0; @@ -150,95 +152,69 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : tstat_flag = 1; pstat_flag = 1; } else - error->universe_all( - FLERR, - "Unknown ensemble parameter for fix pimd/langevin. Only nve and nvt ensembles are supported!"); - } - - else if (strcmp(arg[i], "fmass") == 0) { + error->universe_all(FLERR, + "Unknown ensemble parameter for fix pimd/langevin. Only nve and nvt " + "ensembles are supported!"); + } else if (strcmp(arg[i], "fmass") == 0) { fmass = utils::numeric(FLERR, arg[i + 1], false, lmp); if (fmass < 0.0 || fmass > 1.0) error->universe_all(FLERR, "Invalid fmass value for fix pimd/langevin"); - } - - else if (strcmp(arg[i], "fmmode") == 0) { + } else if (strcmp(arg[i], "fmmode") == 0) { if (strcmp(arg[i + 1], "physical") == 0) fmmode = PHYSICAL; else if (strcmp(arg[i + 1], "normal") == 0) fmmode = NORMAL; else - error->universe_all(FLERR, - "Unknown fictitious mass mode for fix pimd/langevin. Only physical mass and " - "normal mode mass are supported!"); - } - - else if (strcmp(arg[i], "scale") == 0) { - pilescale = atof(arg[i + 1]); - if (pilescale < 0.0) error->universe_all(FLERR, "Invalid pile scale value for fix pimd/langevin"); - } - - else if (strcmp(arg[i], "temp") == 0) { + error->universe_all( + FLERR, + "Unknown fictitious mass mode for fix pimd/langevin. Only physical mass and " + "normal mode mass are supported!"); + } else if (strcmp(arg[i], "scale") == 0) { + pilescale = utils::numeric(FLERR, arg[i + 1], false, lmp); + if (pilescale < 0.0) + error->universe_all(FLERR, "Invalid pile scale value for fix pimd/langevin"); + } else if (strcmp(arg[i], "temp") == 0) { temp = utils::numeric(FLERR, arg[i + 1], false, lmp); if (temp < 0.0) error->universe_all(FLERR, "Invalid temp value for fix pimd/langevin"); - } - - else if (strcmp(arg[i], "lj") == 0) { + } else if (strcmp(arg[i], "lj") == 0) { lj_epsilon = utils::numeric(FLERR, arg[i + 1], false, lmp); lj_sigma = utils::numeric(FLERR, arg[i + 2], false, lmp); lj_mass = utils::numeric(FLERR, arg[i + 3], false, lmp); other_planck = utils::numeric(FLERR, arg[i + 4], false, lmp); - i++; - i++; - i++; - } - - else if (strcmp(arg[i], "thermostat") == 0) { + i += 3; + } else if (strcmp(arg[i], "thermostat") == 0) { if (strcmp(arg[i + 1], "PILE_L") == 0) { thermostat = PILE_L; - seed = atoi(arg[i + 2]); + seed = utils::inumeric(FLERR, arg[i + 2], false, lmp); i++; } - } - - else if (strcmp(arg[i], "tau") == 0) { - tau = atof(arg[i + 1]); - } - - else if (strcmp(arg[i], "press") == 0) { - Pext = atof(arg[i + 1]); + } else if (strcmp(arg[i], "tau") == 0) { + tau = utils::numeric(FLERR, arg[i + 1], false, lmp); + } else if (strcmp(arg[i], "press") == 0) { + Pext = utils::numeric(FLERR, arg[i + 1], false, lmp); if (Pext < 0.0) error->universe_all(FLERR, "Invalid press value for fix pimd/langevin"); - } - - else if (strcmp(arg[i], "barostat") == 0) { + } else if (strcmp(arg[i], "barostat") == 0) { if (strcmp(arg[i + 1], "MTTK") == 0) { barostat = MTTK; } else if (strcmp(arg[i + 1], "BZP") == 0) { barostat = BZP; } else error->universe_all(FLERR, "Unknown barostat parameter for fix pimd/langevin"); - } - - else if (strcmp(arg[i], "iso") == 0) { + } else if (strcmp(arg[i], "iso") == 0) { pstyle = ISO; i--; - } - - else if (strcmp(arg[i], "aniso") == 0) { + } else if (strcmp(arg[i], "aniso") == 0) { pstyle = ANISO; i--; - } - - else if (strcmp(arg[i], "taup") == 0) { - tau_p = atof(arg[i + 1]); + } else if (strcmp(arg[i], "taup") == 0) { + tau_p = utils::numeric(FLERR, arg[i + 1], false, lmp); if (tau_p <= 0.0) error->universe_all(FLERR, "Invalid tau_p value for fix pimd/langevin"); } else if (strcmp(arg[i], "fixcom") == 0) { if (strcmp(arg[i + 1], "yes") == 0) removecomflag = 1; else if (strcmp(arg[i + 1], "no") == 0) removecomflag = 0; - } - - else if (strcmp(arg[i], "map") == 0) { + } else if (strcmp(arg[i], "map") == 0) { if (strcmp(arg[i + 1], "yes") == 0) mapflag = 1; else if (strcmp(arg[i + 1], "no") == 0) @@ -257,25 +233,11 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : // some initilizations - id_pe = new char[8]; - strcpy(id_pe, "pimd_pe"); - char **newarg = new char *[3]; - newarg[0] = id_pe; - newarg[1] = (char *) "all"; - newarg[2] = (char *) "pe"; - modify->add_compute(3, newarg); - delete[] newarg; + id_pe = utils::strdup(std::string(id) + "_pimd_pe"); + modify->add_compute(std::string(id_pe) + " all pe"); - id_press = new char[12]; - strcpy(id_press, "pimd_press"); - newarg = new char *[5]; - newarg[0] = id_press; - newarg[1] = (char *) "all"; - newarg[2] = (char *) "pressure"; - newarg[3] = (char *) "thermo_temp"; - newarg[4] = (char *) "virial"; - modify->add_compute(5, newarg); - delete[] newarg; + id_press = utils::strdup(std::string(id) + "_pimd_press"); + modify->add_compute(std::string(id_press) + " all pressure thermo_temp virial"); vol0 = domain->xprd * domain->yprd * domain->zprd; @@ -339,7 +301,14 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixPIMDLangevin::~FixPIMDLangevin() {} +FixPIMDLangevin::~FixPIMDLangevin() +{ + modify->delete_compute(id_pe); + modify->delete_compute(id_press); + delete[] id_pe; + delete[] id_press; + delete random; +} /* ---------------------------------------------------------------------- */ @@ -387,8 +356,8 @@ void FixPIMDLangevin::init() beta_np = 1.0 / force->boltz / temp * inverse_np; fbond = _fbond * force->mvv2e; - if (universe->me == 0) - printf("fix pimd/langevin -P/(beta^2 * hbar^2) = %20.7lE (kcal/mol/A^2)\n\n", fbond); + if ((universe->me == 0) && (universe->uscreen)) + fprintf(universe->uscreen, "fix pimd/langevin -P/(beta^2 * hbar^2) = %20.7lE (kcal/mol/A^2)\n\n", fbond); if (integrator == OBABO) { dtf = 0.5 * update->dt * force->ftm2v; @@ -413,15 +382,10 @@ void FixPIMDLangevin::init() Langevin_init(); if (pstat_flag) baro_init(); - int ipe = modify->find_compute(id_pe); - c_pe = modify->compute[ipe]; - - int ipress = modify->find_compute(id_press); - c_press = modify->compute[ipress]; + c_pe = modify->get_compute_by_id(id_pe); + c_press = modify->get_compute_by_id(id_press); t_prim = t_vir = t_cv = p_prim = p_vir = p_cv = p_md = 0.0; - - if (universe->me == 0) fprintf(screen, "fix pimd/langevin successfully initialized!\n"); } /* ---------------------------------------------------------------------- */ @@ -1335,8 +1299,9 @@ void FixPIMDLangevin::compute_totenthalpy() totenthalpy = tote + 0.5 * W * vw[0] * vw[0] * inverse_np + Pext * volume / force->nktv2p - Vcoeff * kBT * log(volume); } else if (pstyle == ANISO) { - totenthalpy = tote + 0.5 * W * vw[0] * vw[0] * inverse_np + 0.5 * W * vw[1] * vw[1] * inverse_np + - 0.5 * W * vw[2] * vw[2] * inverse_np + Pext * volume / force->nktv2p - Vcoeff * kBT * log(volume); + totenthalpy = tote + 0.5 * W * vw[0] * vw[0] * inverse_np + + 0.5 * W * vw[1] * vw[1] * inverse_np + 0.5 * W * vw[2] * vw[2] * inverse_np + + Pext * volume / force->nktv2p - Vcoeff * kBT * log(volume); } } else if (barostat == MTTK) totenthalpy = tote + 1.5 * W * vw[0] * vw[0] * inverse_np + Pext * (volume - vol0); @@ -1376,7 +1341,7 @@ double FixPIMDLangevin::compute_vector(int n) } else if (pstyle == ANISO) { } } - + /* if(n==7) { return p_prim; } diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index 93f4670808..e68f326ae6 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -107,14 +107,12 @@ class FixPIMDLangevin : public Fix { double dtv, dtf, dtv2, dtv3; double gamma, c1, c2, tau; double *tau_k, *c1_k, *c2_k; - double pilescale = 1.0; + double pilescale; double Lan_temp; double r1, r2, r3; double _omega_np, *_omega_k, *Lan_s, *Lan_c; // sin(omega_k*dt*0.5), cos(omega_k*dt*0.5) class RanMars *random; - int seed; - FILE *frand; int tstat_flag; // tstat_flat = 1 if thermostat if used void Langevin_init(); @@ -128,7 +126,7 @@ class FixPIMDLangevin : public Fix { double f_omega, mtk_term1; int pstat_flag; // pstat_flag = 1 if barostat is used int pstyle; // pstyle = ISO or ANISO (will support TRICLINIC in the future) - double W, tau_p, Pext, totenthalpy = 0.0, Vcoeff; + double W, tau_p, Pext, totenthalpy, Vcoeff; int p_flag[6]; double vw[6]; // barostat velocity double ke_tensor[6]; // kinetic energy tensor From 5a593f06f6f48b6bc5220a139fecc704b4193a49 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 10 Mar 2023 02:00:18 -0500 Subject: [PATCH 011/172] apply make fix-whitespace --- doc/src/fix_deposit.rst | 6 +++--- doc/src/fix_pimd.rst | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/fix_deposit.rst b/doc/src/fix_deposit.rst index 0199ae98ce..7d19e93148 100644 --- a/doc/src/fix_deposit.rst +++ b/doc/src/fix_deposit.rst @@ -221,9 +221,9 @@ options choose a z-coordinate for insertion independently. The vx, vy, and vz components of velocity for the inserted particle are set by sampling a uniform distribution between the bounds set by -the values specified for the *vx*, *vy*, and *vz* keywords. Note that -normally, new particles should be a assigned a negative vertical -velocity so that they move towards the surface. For molecules, the +the values specified for the *vx*, *vy*, and *vz* keywords. Note that +normally, new particles should be a assigned a negative vertical +velocity so that they move towards the surface. For molecules, the same velocity is given to every particle (no rotation or bond vibration). If the *target* option is used, the velocity vector of the inserted diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 4d08497928..b774a7c8df 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -17,7 +17,7 @@ Syntax * ID, group-ID are documented in :doc:`fix ` command * style = *pimd/langevin* or *pimd/nvt* = style name of this fix command * zero or more keyword/value pairs may be appended -* keywords for style *pimd/nvt* +* keywords for style *pimd/nvt* .. parsed-literal:: *keywords* = *method* or *fmass* or *sp* or *temp* or *nhc* @@ -27,7 +27,7 @@ Syntax *temp* value = temperature (temperarate units) *nhc* value = Nc = number of chains in Nose-Hoover thermostat -* keywords for style *pimd/langevin* +* keywords for style *pimd/langevin* .. parsed-literal:: *keywords* = *method* or *integrator* or *ensemble* or *fmass* or *fmmode* or *scale* or *lj* or *temp* or *thermostat* or *tau* or *press* or *barostat* or *taup* or *iso* or *aniso* @@ -183,7 +183,7 @@ quasi-beads to :doc:`binary restart files `. See the a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. -Fix *pimd/langevin* ... +Fix *pimd/langevin* ... None of the :doc:`fix_modify ` options are relevant to fix pimd/nvt. From da6d3de48ea6e5b13571339a9a40eec2d1a2574a Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 10 Mar 2023 02:06:40 -0500 Subject: [PATCH 012/172] correct planck's constant for lj units --- src/REPLICA/fix_pimd_langevin.cpp | 8 +++----- src/REPLICA/fix_pimd_langevin.h | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 24b677b141..879c546326 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -55,7 +55,6 @@ enum { BAOAB, OBABO }; enum { ISO, ANISO, TRICLINIC }; enum { PILE_L }; enum { MTTK, BZP }; -// char* Barostats[] = {"MTTK", "BZP"}; static std::map Barostats{{MTTK, "MTTK"}, {BZP, "BZP"}}; enum { NVE, NVT, NPH, NPT }; @@ -181,7 +180,8 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : lj_sigma = utils::numeric(FLERR, arg[i + 2], false, lmp); lj_mass = utils::numeric(FLERR, arg[i + 3], false, lmp); other_planck = utils::numeric(FLERR, arg[i + 4], false, lmp); - i += 3; + other_mvv2e = utils::numeric(FLERR, arg[i + 5], false, lmp); + i += 4; } else if (strcmp(arg[i], "thermostat") == 0) { if (strcmp(arg[i + 1], "PILE_L") == 0) { thermostat = PILE_L; @@ -317,7 +317,6 @@ int FixPIMDLangevin::setmask() int mask = 0; mask |= POST_FORCE; mask |= INITIAL_INTEGRATE; - // mask |= POST_NEIGHBOR; mask |= FINAL_INTEGRATE; mask |= END_OF_STEP; return mask; @@ -341,7 +340,7 @@ void FixPIMDLangevin::init() double planck; if (strcmp(update->unit_style, "lj") == 0) { - double planck_star = sqrt(lj_epsilon) * sqrt(atom->mass[0]) * lj_sigma; + double planck_star = sqrt(lj_epsilon) * sqrt(lj_mass) * lj_sigma * sqrt(other_mvv2e); planck = other_planck / planck_star; } else { planck = force->hplanck; @@ -997,7 +996,6 @@ void FixPIMDLangevin::nmpimd_transform(double **src, double **des, double *vecto void FixPIMDLangevin::comm_init() { - // if(me == 0){ if (sizeplan) { delete[] plansend; delete[] planrecv; diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index e68f326ae6..6c450210e9 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -50,6 +50,7 @@ class FixPIMDLangevin : public Fix { double hbar; // Planck's constant double lj_epsilon, lj_sigma, lj_mass; // LJ unit energy, length, and mass scales double other_planck; + double other_mvv2e; double kBT; // k_B * temp double beta, beta_np; // beta = 1./kBT beta_np = 1./kBT/np int thermostat; // NHC or PILE_L From f301c00406f6699d94f8632dc3ee6e598e89b40d Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 10 Mar 2023 02:37:15 -0500 Subject: [PATCH 013/172] delete unused nmpimd_transform --- src/REPLICA/fix_pimd_langevin.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index 6c450210e9..b491179403 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -100,7 +100,6 @@ class FixPIMDLangevin : public Fix { void reallocate(); void nmpimd_init(); - void nmpimd_transform(double **src, double **des, double **mat); void nmpimd_transform(double **, double **, double *); /* Langevin integration */ From 45da03340ab23ecb62941aad47b5f61bbd0f98d9 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 10 Mar 2023 02:56:44 -0500 Subject: [PATCH 014/172] update package info; delete unused code --- src/REPLICA/fix_pimd_langevin.cpp | 9 ++++----- src/REPLICA/fix_pimd_langevin.h | 6 +----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 879c546326..1552690a08 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -13,10 +13,10 @@ /* ---------------------------------------------------------------------- Package FixPIMDLangevin - Purpose Quantum Path Integral Algorithm for Quantum Chemistry + Purpose Path Integral Molecular Dynamics with Langevin Thermostat Yifan Li @ Princeton University (yifanl0716@gmail.com) - Added components: + Current Features: - Multi-processor parallelism for each bead - White-noise Langevin thermostat - Bussi-Zykova-Parrinello barostat (isotropic and anisotropic) @@ -557,7 +557,7 @@ void FixPIMDLangevin::post_force(int /*flag*/) } compute_vir(); - compute_vir_(); + compute_cvir(); compute_pote(); if (method == NMPIMD) { inter_replica_comm(f); @@ -1127,10 +1127,9 @@ void FixPIMDLangevin::inter_replica_comm(double **ptr) } } -/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */ -void FixPIMDLangevin::compute_vir_() +void FixPIMDLangevin::compute_cvir() { int nlocal = atom->nlocal; xf = vir_ = xcf = centroid_vir = 0.0; diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index b491179403..60eca51907 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -177,14 +177,10 @@ class FixPIMDLangevin : public Fix { void compute_spring_energy(); // 2: spring elastic energy void compute_pote(); // 3: potential energy void compute_tote(); // 4: total energy: 1+2+3 for all the beads - // void compute_t_prim(); // 5: primitive kinetic energy estimator - // void compute_p_prim(); // primitive pressure estimator void compute_stress_tensor(); - // void compute_t_vir(); // centroid-virial kinetic energy estimator void compute_p_cv(); // centroid-virial pressure estimator - // void compute_p_vir(); // centroid-virial pressure estimator void compute_vir(); - void compute_vir_(); + void compute_cvir(); void compute_totenthalpy(); }; } // namespace LAMMPS_NS From 266f8fb67e7167d0865a53caf8fe7780f55fa34f Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Mon, 13 Mar 2023 23:42:25 -0400 Subject: [PATCH 015/172] clean up fix pimd/langevin --- src/REPLICA/fix_pimd_langevin.cpp | 94 ++++++++++++++++++------------- src/REPLICA/fix_pimd_langevin.h | 19 ++----- 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 1552690a08..4436878ba4 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -49,7 +49,7 @@ using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; -enum { PIMD, NMPIMD, CMD }; +enum { NMPIMD }; enum { PHYSICAL, NORMAL }; enum { BAOAB, OBABO }; enum { ISO, ANISO, TRICLINIC }; @@ -88,7 +88,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : mass = nullptr; - method = PIMD; + method = NMPIMD; ensemble = NVT; integrator = OBABO; thermostat = PILE_L; @@ -115,15 +115,10 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : for (int i = 3; i < narg - 1; i += 2) { if (strcmp(arg[i], "method") == 0) { - if (strcmp(arg[i + 1], "pimd") == 0) - method = PIMD; - else if (strcmp(arg[i + 1], "nmpimd") == 0) - method = NMPIMD; - else if (strcmp(arg[i + 1], "cmd") == 0) - method = CMD; - else - error->universe_all(FLERR, "Unknown method parameter for fix pimd/langevin"); - } else if (strcmp(arg[i], "integrator") == 0) { + if (strcmp(arg[i + 1], "nmpimd") == 0)method = NMPIMD; + else error->universe_all(FLERR, "Unknown method parameter for fix pimd/langevin"); + } + else if (strcmp(arg[i], "integrator") == 0) { if (strcmp(arg[i + 1], "obabo") == 0) integrator = OBABO; else if (strcmp(arg[i + 1], "baoab") == 0) @@ -228,7 +223,15 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; vector_flag = 1; - size_vector = 11; + if (!pstat_flag) size_vector = 10; + else if (pstat_flag) { + if (pstyle == ISO){ + size_vector = 15; + } + else if (pstyle == ANISO){ + size_vector = 17; + } + } extvector = 1; // some initilizations @@ -391,7 +394,6 @@ void FixPIMDLangevin::init() void FixPIMDLangevin::setup(int vflag) { - if (universe->me == 0) printf("Setting up Path-Integral ...\n"); int nlocal = atom->nlocal; double **x = atom->x; double **v = atom->v; @@ -427,8 +429,6 @@ void FixPIMDLangevin::setup(int vflag) else if (cmode == MULTI_PROC) nmpimd_transform(bufbeads, v, M_x2xp[universe->iworld]); } - if (universe->me == 0 && screen) fprintf(screen, "Setting up Path-Integral ...\n"); - if (universe->me == 0) printf("Setting up Path-Integral ...\n"); post_force(vflag); compute_totke(); end_of_step(); @@ -558,6 +558,7 @@ void FixPIMDLangevin::post_force(int /*flag*/) compute_vir(); compute_cvir(); + compute_t_vir(); compute_pote(); if (method == NMPIMD) { inter_replica_comm(f); @@ -1231,6 +1232,8 @@ void FixPIMDLangevin::compute_spring_energy() (x[i][0] * x[i][0] + x[i][1] * x[i][1] + x[i][2] * x[i][2]); } MPI_Allreduce(&spring_energy, &se_bead, 1, MPI_DOUBLE, MPI_SUM, world); + se_bead /= universe->procs_per_world[universe->iworld]; + MPI_Allreduce(&se_bead, &total_spring_energy, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); } /* ---------------------------------------------------------------------- */ @@ -1243,6 +1246,7 @@ void FixPIMDLangevin::compute_pote() c_pe->compute_scalar(); pe_bead = c_pe->scalar; pot_energy_partition = pe_bead / universe->procs_per_world[universe->iworld]; + MPI_Allreduce(&pot_energy_partition, &pote, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); } /* ---------------------------------------------------------------------- */ @@ -1253,28 +1257,28 @@ void FixPIMDLangevin::compute_tote() } /* ---------------------------------------------------------------------- */ -/* + void FixPIMDLangevin::compute_t_prim() { t_prim = 1.5 * atom->natoms * np * force->boltz * temp - total_spring_energy; } -*/ + /* ---------------------------------------------------------------------- */ -/* + void FixPIMDLangevin::compute_t_vir() { t_vir = -0.5 * inverse_np * vir_; t_cv = 1.5 * atom->natoms * force->boltz * temp - 0.5 * inverse_np * centroid_vir; } -*/ + /* ---------------------------------------------------------------------- */ -/* + void FixPIMDLangevin::compute_p_prim() { p_prim = atom->natoms * np * force->boltz * temp * inv_volume - 1.0 / 1.5 * inv_volume * total_spring_energy; p_prim *= force->nktv2p; } -*/ + /* ---------------------------------------------------------------------- */ void FixPIMDLangevin::compute_p_cv() @@ -1312,30 +1316,42 @@ double FixPIMDLangevin::compute_vector(int n) if (n == 1) return se_bead; if (n == 2) return pe_bead; if (n == 3) return tote; - // if(n==3) { return W*vw[0]; } - if (!pstat_flag) { - if (n == 4) return t_prim; - if (n == 5) return t_vir; - if (n == 6) return t_cv; - } else if (pstat_flag) { - if (pstyle == ISO) { - if (barostat == BZP) { - if (n == 4) return 0.5 * W * vw[0] * vw[0]; - } else if (barostat == MTTK) { - if (n == 4) return 1.5 * W * vw[0] * vw[0]; - } - if (n == 5) { + if (n == 4) return t_prim; + if (n == 5) return t_vir; + if (n == 6) return t_cv; + if (n == 7) return p_prim; + if (n == 8) return p_md; + if (n == 9) return p_cv; + + if (pstat_flag) { volume = domain->xprd * domain->yprd * domain->zprd; + if (pstyle == ISO) { + if (n == 10) return vw[0]; + if (barostat == BZP) { + if (n == 11) return 0.5 * W * vw[0] * vw[0]; + } else if (barostat == MTTK) { + if (n == 11) return 1.5 * W * vw[0] * vw[0]; + } + if (n == 12) { return np * Pext * volume / force->nktv2p; } - if (n == 6) { + if (n == 13) { + return -Vcoeff * np * kBT * log(volume); + } + if (n == 14) return totenthalpy; + } else if (pstyle == ANISO) { + if (n == 10) return vw[0]; + if (n == 11) return vw[1]; + if (n == 12) return vw[2]; + if (n == 13) return 0.5 * W * (vw[0] * vw[0] + vw[1] * vw[1] + vw[2] * vw[2]); + if (n == 14) { + return np * Pext * volume / force->nktv2p; + } + if (n == 15) { volume = domain->xprd * domain->yprd * domain->zprd; return -Vcoeff * np * kBT * log(volume); } - if (n == 7) return totenthalpy; - if (n == 8) return p_cv; - if (n == 9) return total_spring_energy; - } else if (pstyle == ANISO) { + if (n == 16) return totenthalpy; } } diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index 60eca51907..87481b2770 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -140,34 +140,21 @@ class FixPIMDLangevin : public Fix { /* centroid-virial estimator computation */ double vol0 = 0.0; double inv_volume = 0.0; - // double inv_volume = 0.0, vol_ = 0.0, vol0 = 0.0; double volume = 0.0; double **xc, *xcall; int maxxc; - // int n_unwrap; int maxunwrap; - // int maxunwrap, nlocal_init; - // tagint *tag_init, *tag_initall; - // imageint *image_init, *image_initall; double **x_unwrap; - // double **x_unwrap, **x_unwrapsort; - // double **x_unwrapall; - // void init_x_unwrap(); void reallocate_x_unwrap(); void reallocate_xc(); void collect_xc(); - // void compute_xc(); - // void compute_fc(); double xf, vir, vir_, xcf, centroid_vir; - double t_vir, t_cv, p_prim, p_vir, p_cv, p_cv_, p_md; - // double vir_, xcf, vir2; + double t_prim, t_vir, t_cv, p_prim, p_vir, p_cv, p_md; /* Computes */ double kine, pote, tote, totke; double ke_bead, se_bead, pe_bead, pot_energy_partition; double total_spring_energy; - double t_prim; - // double p_prim; char *id_pe; char *id_press; class Compute *c_pe; @@ -178,6 +165,10 @@ class FixPIMDLangevin : public Fix { void compute_pote(); // 3: potential energy void compute_tote(); // 4: total energy: 1+2+3 for all the beads void compute_stress_tensor(); + void compute_t_prim(); + void compute_t_vir(); + void compute_t_cv(); + void compute_p_prim(); void compute_p_cv(); // centroid-virial pressure estimator void compute_vir(); void compute_cvir(); From b4dc074638080e8964708c7ac2aaab4381d8e1b6 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Tue, 14 Mar 2023 02:46:31 -0400 Subject: [PATCH 016/172] delete global variable inv_volume --- src/REPLICA/fix_pimd_langevin.cpp | 13 ++++++++++--- src/REPLICA/fix_pimd_langevin.h | 3 +-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 4436878ba4..fe1dabd551 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -411,6 +411,8 @@ void FixPIMDLangevin::setup(int vflag) } collect_xc(); compute_spring_energy(); + compute_t_prim(); + compute_p_prim(); if (method == NMPIMD) { inter_replica_comm(x); if (cmode == SINGLE_PROC) @@ -495,6 +497,8 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) } collect_xc(); compute_spring_energy(); + compute_t_prim(); + compute_p_prim(); if (method == NMPIMD) { inter_replica_comm(x); @@ -1181,7 +1185,7 @@ void FixPIMDLangevin::compute_stress_tensor() int nlocal = atom->nlocal; int *type = atom->type; if (universe->iworld == 0) { - inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); + double inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); for (int i = 0; i < 6; i++) ke_tensor[i] = 0.0; for (int i = 0; i < nlocal; i++) { ke_tensor[0] += 0.5 * mass[type[i]] * atom->v[i][0] * atom->v[i][0] * force->mvv2e; @@ -1213,6 +1217,8 @@ void FixPIMDLangevin::compute_totke() } kine *= force->mvv2e; MPI_Allreduce(&kine, &ke_bead, 1, MPI_DOUBLE, MPI_SUM, world); + MPI_Allreduce(&ke_bead, &totke, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); + totke /= universe->procs_per_world[universe->iworld]; } /* ---------------------------------------------------------------------- */ @@ -1232,8 +1238,8 @@ void FixPIMDLangevin::compute_spring_energy() (x[i][0] * x[i][0] + x[i][1] * x[i][1] + x[i][2] * x[i][2]); } MPI_Allreduce(&spring_energy, &se_bead, 1, MPI_DOUBLE, MPI_SUM, world); - se_bead /= universe->procs_per_world[universe->iworld]; MPI_Allreduce(&se_bead, &total_spring_energy, 1, MPI_DOUBLE, MPI_SUM, universe->uworld); + total_spring_energy /= universe->procs_per_world[universe->iworld]; } /* ---------------------------------------------------------------------- */ @@ -1275,6 +1281,7 @@ void FixPIMDLangevin::compute_t_vir() void FixPIMDLangevin::compute_p_prim() { + double inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); p_prim = atom->natoms * np * force->boltz * temp * inv_volume - 1.0 / 1.5 * inv_volume * total_spring_energy; p_prim *= force->nktv2p; } @@ -1283,7 +1290,7 @@ void FixPIMDLangevin::compute_p_prim() void FixPIMDLangevin::compute_p_cv() { - inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); + double inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); if (universe->iworld == 0) { p_cv = THIRD * inv_volume * ((2.0 * ke_bead - centroid_vir) * force->nktv2p + vir) / np; } diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index 87481b2770..43f6df5e84 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -139,8 +139,7 @@ class FixPIMDLangevin : public Fix { /* centroid-virial estimator computation */ double vol0 = 0.0; - double inv_volume = 0.0; - double volume = 0.0; + double volume; double **xc, *xcall; int maxxc; int maxunwrap; From 2c6fe1e8bc337a09df63ebb274b0b8c24362c818 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Wed, 15 Mar 2023 13:57:42 -0400 Subject: [PATCH 017/172] add p_md calculation --- src/REPLICA/fix_pimd_langevin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index fe1dabd551..12233f6ee0 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -585,7 +585,7 @@ void FixPIMDLangevin::end_of_step() if (pstat_flag) compute_totenthalpy(); if (update->ntimestep % 10000 == 0) { - if (universe->me == 0) printf("This is the end of step %ld.\n", update->ntimestep); + if (universe->me == 0) printf("This is the end of step %lld.\n", update->ntimestep); } } @@ -1294,6 +1294,7 @@ void FixPIMDLangevin::compute_p_cv() if (universe->iworld == 0) { p_cv = THIRD * inv_volume * ((2.0 * ke_bead - centroid_vir) * force->nktv2p + vir) / np; } + p_md = THIRD * inv_volume * (totke + vir); MPI_Bcast(&p_cv, 1, MPI_DOUBLE, 0, universe->uworld); } From 77b9fe37ba8e41b17e15118833ffb2203c162fd5 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Wed, 15 Mar 2023 14:00:56 -0400 Subject: [PATCH 018/172] delete dead code --- src/REPLICA/fix_pimd_langevin.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 12233f6ee0..2266dc5e6c 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -1363,29 +1363,5 @@ double FixPIMDLangevin::compute_vector(int n) } } - /* - - if(n==7) { return p_prim; } - if(n==8) { return p_md; } - if(n==9) { return p_cv; } - if(n==10) {return totenthalpy; - if(pstyle == ISO){ - if(n==11) { return vw[0]; } - if(n==12) { - if(barostat == BZP) { return 0.5*W*vw[0]*vw[0]; } - else if(barostat == MTTK) { return 1.5*W*vw[0]*vw[0]; } - } - if(n==13) { volume = domain->xprd * domain->yprd * domain->zprd; return np * Pext * volume / force->nktv2p; } - if(n==14) { volume = domain->xprd * domain->yprd * domain->zprd; - // printf("Vcoeff = %.6e np = %d kBT = %.6e logV = %.6e\n", Vcoeff, np, kBT, log(volume)); - return - Vcoeff * np * kBT * log(volume); } - } - else if(pstyle==ANISO){ - if(n>10 && n<=13) return vw[n-11]; - if(n==14) return 0.5*W*vw[0]*vw[0]+0.5*W*vw[1]*vw[1]+0.5*W*vw[2]*vw[2]; - if(n>14 && n<21) return stress_tensor[n-15]; - if(n==21) { volume = domain->xprd * domain->yprd * domain->zprd; return np * Pext * volume / force->nktv2p; } - if(n==22) { volume = domain->xprd * domain->yprd * domain->zprd; return - Vcoeff * np * kBT * log(volume); } - } */ return 0.0; } From f7bc270c00040ae5a2da5cbc9dda990be571f3ab Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Wed, 15 Mar 2023 14:51:04 -0400 Subject: [PATCH 019/172] Do not initialized random number generator when there is no thermostat --- src/REPLICA/fix_pimd_langevin.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 2266dc5e6c..bcd94b3beb 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -250,9 +250,11 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : // initialize Marsaglia RNG with processor-unique seed - if (integrator == BAOAB || integrator == OBABO) { - Lan_temp = temp; - random = new RanMars(lmp, seed + universe->me); + if (tstat_flag) { + if (integrator == BAOAB || integrator == OBABO) { + Lan_temp = temp; + random = new RanMars(lmp, seed + universe->me); + } } me = comm->me; From 3f965a1c337f60262585278753ca2b2e4ae3a197 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Wed, 15 Mar 2023 16:25:56 -0400 Subject: [PATCH 020/172] format the specification of external pressure --- src/REPLICA/fix_pimd_langevin.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index bcd94b3beb..949129873f 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -185,9 +185,6 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : } } else if (strcmp(arg[i], "tau") == 0) { tau = utils::numeric(FLERR, arg[i + 1], false, lmp); - } else if (strcmp(arg[i], "press") == 0) { - Pext = utils::numeric(FLERR, arg[i + 1], false, lmp); - if (Pext < 0.0) error->universe_all(FLERR, "Invalid press value for fix pimd/langevin"); } else if (strcmp(arg[i], "barostat") == 0) { if (strcmp(arg[i + 1], "MTTK") == 0) { barostat = MTTK; @@ -197,10 +194,10 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : error->universe_all(FLERR, "Unknown barostat parameter for fix pimd/langevin"); } else if (strcmp(arg[i], "iso") == 0) { pstyle = ISO; - i--; + Pext = utils::numeric(FLERR, arg[i+1], false, lmp); } else if (strcmp(arg[i], "aniso") == 0) { pstyle = ANISO; - i--; + Pext = utils::numeric(FLERR, arg[i+1], false, lmp); } else if (strcmp(arg[i], "taup") == 0) { tau_p = utils::numeric(FLERR, arg[i + 1], false, lmp); if (tau_p <= 0.0) error->universe_all(FLERR, "Invalid tau_p value for fix pimd/langevin"); From 0aca0435ef3c852343fa985879623120bb4da199 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Wed, 15 Mar 2023 16:43:44 -0400 Subject: [PATCH 021/172] delete mapflag input script interface --- src/REPLICA/fix_pimd_langevin.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 949129873f..3559fc8efe 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -206,11 +206,6 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : removecomflag = 1; else if (strcmp(arg[i + 1], "no") == 0) removecomflag = 0; - } else if (strcmp(arg[i], "map") == 0) { - if (strcmp(arg[i + 1], "yes") == 0) - mapflag = 1; - else if (strcmp(arg[i + 1], "no") == 0) - mapflag = 0; } else { error->universe_all(FLERR, fmt::format("Unknown keyword {} for fix {}", arg[i], style)); } From aa84548002d4ca690f030b6fc3bccbe167f20fbb Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Wed, 15 Mar 2023 16:45:18 -0400 Subject: [PATCH 022/172] set mapflag=0 if there is only 1 bead --- src/REPLICA/fix_pimd_langevin.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 3559fc8efe..964cca44c2 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -260,6 +260,9 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : nreplica = universe->nworlds; ireplica = universe->iworld; + if (nreplica == 1) mapflag = 0; + else mapflag = 1; + int *iroots = new int[nreplica]; MPI_Group uworldgroup, rootgroup; From 4e0af69b67d77a247a3495109219697d60e9e7c5 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Wed, 15 Mar 2023 17:06:28 -0400 Subject: [PATCH 023/172] update documentation keyword part --- doc/src/fix_pimd.rst | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index b774a7c8df..63f57f1fdf 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -30,15 +30,28 @@ Syntax * keywords for style *pimd/langevin* .. parsed-literal:: - *keywords* = *method* or *integrator* or *ensemble* or *fmass* or *fmmode* or *scale* or *lj* or *temp* or *thermostat* or *tau* or *press* or *barostat* or *taup* or *iso* or *aniso* + *keywords* = *method* or *integrator* or *ensemble* or *fmmode* or *scale* or *temp* or *thermostat* or *tau* or or *iso* or *aniso* or *barostat* or *taup* or *fixcom* or *lj* *method* value = *nmpimd* - *fmass* value = scaling factor on mass - *sp* value = scaling factor on Planck constant - *temp* value = target temperature (temperarate units) - *thermostat* values = PILE_L *seed* - *seed* = random number seed + *integrator* value = *obabo* or *baoab* + *fmmode* value = *physical* or *normal* + *temp* value = Temperature (temperarate unit) + Temperature = target temperarate of the thermostat + *thermostat* values = style seed + style value = *PILE_L* + seed = random number generator seed *tau* value = thermostat damping parameter (time unit) - *press* value = target pressure (pressure units) + *scale* value = scaling factor of the damping times of non-centroid modes of PILE_L thermostat + *iso* or *aniso* values = Pressure (pressure unit) + Pressure = scalar external pressure of the barostat + *barostat* value = *BZP* or *MTTK* + *taup* value = barostat damping parameter (time unit) + *fixcom* value = *yes* or *no* + *lj* values = epsilon sigma mass planck mvv2e + epsilon = energy scale for reduced units (energy units) + sigma = length scale for reduced units (length units) + mass = mass scale for reduced units (mass units) + planck = Planck's constant for other unit style + mvv2e = mass * velocity^2 to energy conversion factor for other unit style Examples """""""" @@ -46,6 +59,7 @@ Examples .. code-block:: LAMMPS fix 1 all pimd/nvt method nmpimd fmass 1.0 sp 2.0 temp 300.0 nhc 4 + fix 1 all pimd/langevin ensemble npt integrator obabo temp 113.15 thermostat PILE_L 1234 tau 1.0 press 1.0 barostat BZP taup 1.0 iso Description """"""""""" From 5071b2f016e591e9a4c469e9886745fb8d726633 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Wed, 15 Mar 2023 17:25:25 -0400 Subject: [PATCH 024/172] update document notes part --- doc/src/fix_pimd.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 63f57f1fdf..5c82e9c55d 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -106,7 +106,9 @@ would be 3 x N x P x Nc. Fix *pimd/nvt* implements a complete velocity-verlet integrator combined with NH massive chain thermostat, so no other time integration fix should be used. - Similarly fix *pimd/langeving* implements ... + Fix *pimd/langevin* implements a complete velocity-verlet integrator + combined with Langevin thermostat in the normal mode representation, and + also provides a barostat to sample the NPH/NPT ensembles. The *method* keyword determines what style of PIMD is performed. A value of *pimd* is standard PIMD. A value of *nmpimd* is for From ad25af56a9bccd8c5da3b1f5ca610af25f0dde08 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 17 Mar 2023 15:29:26 -0400 Subject: [PATCH 025/172] add reference in fix pimd/langevin document --- doc/src/fix_pimd.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 5c82e9c55d..1f7d406d5e 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -280,3 +280,10 @@ Path Integrals, McGraw-Hill, New York (1965). **(Herman)** M. F. Herman, E. J. Bruskin, B. J. Berne, J Chem Phys, 76, 5150 (1982). +.. _Parrinello1: + +**(Parrinello1)** G. Bussi, T. Zykova-Timan, M. Parrinello, J Chem Phys, 130, 074101 (2009). + +.. _Manolopoulos: + +**(Manolopoulos)** M. Ceriotti, M. Parrinello, T. Markland, D. Manolopoulos, J. Chem. Phys. 133, 124104 (2010). \ No newline at end of file From 0e22e36b941d26fd231cd69ce16c090382d91f97 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 17 Mar 2023 15:38:48 -0400 Subject: [PATCH 026/172] add method nmpimd note for fix pimd/langevin document --- doc/src/fix_pimd.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 1f7d406d5e..4de504e70c 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -132,6 +132,10 @@ normal-mode PIMD. A value of *cmd* is for centroid molecular dynamics overall translation of the ring-polymer and is assigned the mass of the real particle. +.. note:: + Fix pimd/langevin only supports *method* value *nmpimd*. This should be enough + for most PIMD applications for quantum thermodynamics purpose. + Motion of the centroid can be effectively uncoupled from the other normal modes by scaling the fictitious masses to achieve a partial adiabatic separation. This is called a Centroid Molecular Dynamics From 008147d1f38dd1612d1ebe0e634208e265347dda Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 17 Mar 2023 17:41:29 -0400 Subject: [PATCH 027/172] correct mass preconditioning of fix pimd/langevin --- src/REPLICA/fix_pimd_langevin.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 964cca44c2..671625afc8 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -150,7 +150,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : "Unknown ensemble parameter for fix pimd/langevin. Only nve and nvt " "ensembles are supported!"); } else if (strcmp(arg[i], "fmass") == 0) { - fmass = utils::numeric(FLERR, arg[i + 1], false, lmp); + fmass = utils::numeric(FLERR, arg[i+1], false, lmp); if (fmass < 0.0 || fmass > 1.0) error->universe_all(FLERR, "Invalid fmass value for fix pimd/langevin"); } else if (strcmp(arg[i], "fmmode") == 0) { @@ -830,13 +830,13 @@ void FixPIMDLangevin::Langevin_init() Lan_s = new double[np]; if (fmmode == PHYSICAL) { for (int i = 0; i < np; i++) { - _omega_k[i] = _omega_np * sqrt(lam[i]); + _omega_k[i] = _omega_np * sqrt(lam[i]) / sqrt(fmass); Lan_c[i] = cos(sqrt(lam[i]) * _omega_np_dt_half); Lan_s[i] = sin(sqrt(lam[i]) * _omega_np_dt_half); } } else if (fmmode == NORMAL) { for (int i = 0; i < np; i++) { - _omega_k[i] = _omega_np; + _omega_k[i] = _omega_np / sqrt(fmass); Lan_c[i] = cos(_omega_np_dt_half); Lan_s[i] = sin(_omega_np_dt_half); } @@ -947,17 +947,17 @@ void FixPIMDLangevin::nmpimd_init() for (int i = 0; i < np; i++) for (int j = 0; j < np; j++) { M_xp2x[i][j] = M_x2xp[j][i]; } - // Set up masses + // Set up fictitious masses int iworld = universe->iworld; for (int i = 1; i <= atom->ntypes; i++) { mass[i] = atom->mass[i]; + mass[i] *= fmass; if (iworld) { if (fmmode == PHYSICAL) { mass[i] *= 1.0; } else if (fmmode == NORMAL) { mass[i] *= lam[iworld]; } - mass[i] *= fmass; } } } From 76c19410c737faaeb2080b7268b31a5aed10b8d5 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 17 Mar 2023 17:44:48 -0400 Subject: [PATCH 028/172] correct fmass input of fix pimd/langevin --- src/REPLICA/fix_pimd_langevin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 671625afc8..88289f7609 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -94,6 +94,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : thermostat = PILE_L; barostat = BZP; fmass = 1.0; + np = universe->nworlds; sp = 1.0; temp = 298.15; Lan_temp = 298.15; @@ -151,7 +152,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : "ensembles are supported!"); } else if (strcmp(arg[i], "fmass") == 0) { fmass = utils::numeric(FLERR, arg[i+1], false, lmp); - if (fmass < 0.0 || fmass > 1.0) + if (fmass < 0.0 || fmass > np) error->universe_all(FLERR, "Invalid fmass value for fix pimd/langevin"); } else if (strcmp(arg[i], "fmmode") == 0) { if (strcmp(arg[i + 1], "physical") == 0) @@ -335,7 +336,6 @@ void FixPIMDLangevin::init() // prepare the constants masstotal = group->mass(igroup); - np = universe->nworlds; inverse_np = 1.0 / np; double planck; From fd21a584bf01e15639db1823d99524d23748458d Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Sat, 18 Mar 2023 10:17:01 -0400 Subject: [PATCH 029/172] update fmass part of fix pimd/langevin document --- doc/src/fix_pimd.rst | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 4de504e70c..28a5308dd7 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -30,10 +30,11 @@ Syntax * keywords for style *pimd/langevin* .. parsed-literal:: - *keywords* = *method* or *integrator* or *ensemble* or *fmmode* or *scale* or *temp* or *thermostat* or *tau* or or *iso* or *aniso* or *barostat* or *taup* or *fixcom* or *lj* + *keywords* = *method* or *integrator* or *ensemble* or *fmmode* or *fmass* or *scale* or *temp* or *thermostat* or *tau* or or *iso* or *aniso* or *barostat* or *taup* or *fixcom* or *lj* *method* value = *nmpimd* *integrator* value = *obabo* or *baoab* *fmmode* value = *physical* or *normal* + *fmass* value = scaling factor on mass *temp* value = Temperature (temperarate unit) Temperature = target temperarate of the thermostat *thermostat* values = style seed @@ -81,9 +82,11 @@ by the following equations: .. math:: Z = & \int d{\bf q} d{\bf p} \cdot \textrm{exp} [ -\beta H_{eff} ] \\ - H_{eff} = & \bigg(\sum_{i=1}^P \frac{p_i^2}{2m_i}\bigg) + V_{eff} \\ + H_{eff} = & \bigg(\sum_{i=1}^P \frac{p_i^2}{2M_i}\bigg) + V_{eff} \\ V_{eff} = & \sum_{i=1}^P \bigg[ \frac{mP}{2\beta^2 \hbar^2} (q_i - q_{i+1})^2 + \frac{1}{P} V(q_i)\bigg] +$M_i$ is the fictitious mass of the $i$-th mode, and m is the actual mass of the atoms. + The interested user is referred to any of the numerous references on this methodology, but briefly, each quantum particle in a path integral simulation is represented by a ring-polymer of P quasi-beads, labeled @@ -152,6 +155,27 @@ masses of beads, which can be used for the Partial Adiabatic CMD :ref:`(Hone) `, or to be set as P, which results in the fictitious masses to be equal to the real particle masses. +The keyword *fmmode* of *fix pimd/langevin* determines the mode of fictitious +mass preconditioning. There are two options: *physical* and *normal*. If *fmmode* is +*physical*, then the physical mass of the particles are used (and then multiplied by +*fmass*). If *fmmode* is *normal*, then the physical mass is first multiplied by the +eigenvalue of each normal mode, and then multiplied by *fmass*. More precisely, the +fictitious mass of *fix pimd/langevin* is determined by two factors: *fmmode* and *fmass*. +If *fmmode* is *physical*, then the fictitious mass is +.. math:: + $M_i = \mathrm{fmass} \times m$ + +If *fmmode* is *normal*, then the fictitious mass is +.. math:: + $M_i = \mathrm{fmass} \times \lambda_i \times m$ + +where $\lambda_i$ is the eigenvalue of the $i$-th normal mode. +.. note:: + Fictitious mass is only used in the momentum of the equation of motion + ($\bf{p}_i=M_i\bf{v}_i$), and not used in the spring elastic energy + ($\sum_{i=1}^P \frac{1}{2}m\omega_P^2(q_i - q_{i+1})^2$, $m$ is always the + actual mass of the particles). + The keyword *sp* is a scaling factor on Planck's constant, which can be useful for debugging or other purposes. The default value of 1.0 is appropriate for most situations. From 7beec96dd333601d17088b44efda65a0390cd283 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Sat, 18 Mar 2023 10:23:09 -0400 Subject: [PATCH 030/172] support sp in fix pimd/langevin --- src/REPLICA/fix_pimd_langevin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 88289f7609..7a901316f3 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -154,6 +154,9 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : fmass = utils::numeric(FLERR, arg[i+1], false, lmp); if (fmass < 0.0 || fmass > np) error->universe_all(FLERR, "Invalid fmass value for fix pimd/langevin"); + } else if (strcmp(arg[i], "sp") == 0) { + sp = utils::numeric(FLERR, arg[i+1], false, lmp); + if (sp < 0.0) error->universe_all(FLERR, "Invalid sp value for fix pimd/nvt"); } else if (strcmp(arg[i], "fmmode") == 0) { if (strcmp(arg[i + 1], "physical") == 0) fmmode = PHYSICAL; @@ -345,7 +348,7 @@ void FixPIMDLangevin::init() } else { planck = force->hplanck; } - + planck *= sp; hbar = planck / (2.0 * MY_PI); kBT = force->boltz * temp; double beta = 1.0 / (force->boltz * temp); From d8f41a9032cb6271bb63bd53d8d5231d9051eddf Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Sat, 18 Mar 2023 10:25:05 -0400 Subject: [PATCH 031/172] support sp in fix pimd/nvt --- src/REPLICA/fix_pimd_nvt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/REPLICA/fix_pimd_nvt.cpp b/src/REPLICA/fix_pimd_nvt.cpp index 1f2f29f35c..e899c75a27 100644 --- a/src/REPLICA/fix_pimd_nvt.cpp +++ b/src/REPLICA/fix_pimd_nvt.cpp @@ -219,7 +219,7 @@ void FixPIMDNVT::init() const double Boltzmann = force->boltz; const double Plank = force->hplanck; - double hbar = Plank / (2.0 * MY_PI); + double hbar = Plank / (2.0 * MY_PI) * sp; double beta = 1.0 / (Boltzmann * nhc_temp); double _fbond = 1.0 * np / (beta * beta * hbar * hbar); From be8c0b9835d68354e4f5b9925f25eb0bfc9f539b Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Mon, 20 Mar 2023 14:08:42 -0400 Subject: [PATCH 032/172] enable fixcom feature of fix pimd/langevin --- src/REPLICA/fix_pimd_langevin.cpp | 24 ++++++++++++++++++++++++ src/REPLICA/fix_pimd_langevin.h | 1 + 2 files changed, 25 insertions(+) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 7a901316f3..e1d3960a50 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -451,6 +451,7 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) if (integrator == OBABO) { if (tstat_flag) { o_step(); + if (removecomflag) remove_com_motion(); if (pstat_flag) press_o_step(); } if (pstat_flag) { @@ -488,6 +489,7 @@ void FixPIMDLangevin::initial_integrate(int /*vflag*/) a_step(); if (tstat_flag) { o_step(); + if (removecomflag) remove_com_motion(); if (pstat_flag) press_o_step(); } qc_step(); @@ -526,6 +528,7 @@ void FixPIMDLangevin::final_integrate() if (integrator == OBABO) { if (tstat_flag) { o_step(); + if (removecomflag) remove_com_motion(); if (pstat_flag) press_o_step(); } } else if (integrator == BAOAB) { @@ -1134,6 +1137,27 @@ void FixPIMDLangevin::inter_replica_comm(double **ptr) /* ---------------------------------------------------------------------- */ +void FixPIMDLangevin::remove_com_motion(){ + if(universe->iworld == 0) + { + double **v = atom->v; + int *mask = atom->mask; + int nlocal = atom->nlocal; + if (dynamic) masstotal = group->mass(igroup); + double vcm[3]; + group->vcm(igroup,masstotal,vcm); + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + v[i][0] -= vcm[0]; + v[i][1] -= vcm[1]; + v[i][2] -= vcm[2]; + } + } + } +} + +/* ---------------------------------------------------------------------- */ + void FixPIMDLangevin::compute_cvir() { int nlocal = atom->nlocal; diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index 43f6df5e84..b8bed1a10f 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -147,6 +147,7 @@ class FixPIMDLangevin : public Fix { void reallocate_x_unwrap(); void reallocate_xc(); void collect_xc(); + void remove_com_motion(); double xf, vir, vir_, xcf, centroid_vir; double t_prim, t_vir, t_cv, p_prim, p_vir, p_cv, p_md; From 7a38f49a21cacc6f0701e67c715f446f4c835df5 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Mon, 20 Mar 2023 14:10:09 -0400 Subject: [PATCH 033/172] add lj example for fix pimd/langevin --- examples/PACKAGES/pimd/lj/data.metalnpt01 | 422 ++++++++++++++++++++++ examples/PACKAGES/pimd/lj/data.metalnpt02 | 422 ++++++++++++++++++++++ examples/PACKAGES/pimd/lj/data.metalnpt03 | 422 ++++++++++++++++++++++ examples/PACKAGES/pimd/lj/data.metalnpt04 | 422 ++++++++++++++++++++++ examples/PACKAGES/pimd/lj/in.lmp | 28 ++ examples/PACKAGES/pimd/lj/run.sh | 1 + 6 files changed, 1717 insertions(+) create mode 100644 examples/PACKAGES/pimd/lj/data.metalnpt01 create mode 100644 examples/PACKAGES/pimd/lj/data.metalnpt02 create mode 100644 examples/PACKAGES/pimd/lj/data.metalnpt03 create mode 100644 examples/PACKAGES/pimd/lj/data.metalnpt04 create mode 100755 examples/PACKAGES/pimd/lj/in.lmp create mode 100644 examples/PACKAGES/pimd/lj/run.sh diff --git a/examples/PACKAGES/pimd/lj/data.metalnpt01 b/examples/PACKAGES/pimd/lj/data.metalnpt01 new file mode 100644 index 0000000000..3dc2944ed9 --- /dev/null +++ b/examples/PACKAGES/pimd/lj/data.metalnpt01 @@ -0,0 +1,422 @@ +LAMMPS data file via write_data, version 8 Feb 2023, timestep = 100000 + +200 atoms +1 atom types + +-11.876696863105703 11.876696863105703 xlo xhi +-11.876696863105703 11.876696863105703 ylo yhi +-11.876696863105703 11.876696863105703 zlo zhi + +Masses + +1 39.948 + +Pair Coeffs # lj/cut + +1 0.00965188 3.4 + +Atoms # atomic + +39 1 -10.338208372875723 -8.724519590498623 -8.445612139491281 0 -1 1 +82 1 -7.5133824622188925 -6.978636164411631 -10.191775661279799 0 0 0 +57 1 -6.093878587859262 -9.276313581141936 -7.744358551066254 1 0 0 +8 1 -7.188384493977925 -11.000743174865285 -10.566868392413127 0 1 1 +49 1 -0.45896030511450936 -8.721648062141405 -7.76988436909876 0 1 0 +54 1 4.36019737005205 -9.840722628422576 -9.652200105153977 0 -1 1 +114 1 3.904944042667676 -8.560258519206736 -6.227256449483399 -1 0 1 +128 1 1.537670815459421 11.367557646509137 -7.44113189883349 0 0 -2 +102 1 2.6467980910798623 -6.300231690446356 -10.839747469959917 1 -1 -1 +157 1 6.599214138053117 -6.278630725537236 -7.389049268829837 -1 0 1 +20 1 8.160418209241914 -11.236890922228888 -9.90427297873004 0 1 0 +147 1 10.464052914243185 -5.834517788008704 -9.403782126876184 -1 2 0 +169 1 9.355540563360105 -8.982132042608429 -6.861385656669775 0 1 1 +123 1 -6.908328795781873 -3.2942152122483694 -10.871702946953768 -1 0 -1 +130 1 -6.59789640513614 -2.559000332768779 -7.109058819418416 -1 1 0 +140 1 -9.12121182032633 -1.3228381271313019 -9.248705124201138 -1 1 0 +153 1 -4.57209419001429 -5.197951679459013 -8.806559015841044 0 1 0 +129 1 -0.17714454435176596 -5.056145756511569 -8.582370909018262 0 1 1 +148 1 -3.197585507102101 -2.0540921199407465 -9.77932871778502 0 0 0 +119 1 -3.51954842440485 -3.8478081846346726 10.678236929073831 0 -1 -1 +174 1 3.1384595215939513 -1.9078182147633918 -10.748237231758047 -1 1 -1 +134 1 -0.0032185119392025285 -0.36841629060197645 -8.631895429784365 -1 0 2 +189 1 2.892780086534627 -1.3587472579142499 -6.410113256095116 0 0 2 +28 1 6.224912481821424 -1.100900418829165 -9.316948573538184 0 0 -1 +1 1 7.533342646866252 -2.8858379557892953 -6.5588822497649195 1 -1 0 +24 1 10.891564390761006 -2.1693511431878143 -8.14872153065027 0 -1 1 +176 1 10.35065200687287 -3.6683271215630047 -4.32699396695263 0 0 0 +182 1 -10.764131367809398 0.5730937842904389 -5.180063181396292 0 1 -1 +137 1 -8.194528746006949 3.76661130396705 -8.596433076900993 -1 1 0 +89 1 -5.793296966734716 0.9591211322466908 -8.532912969707475 0 0 -1 +88 1 -3.2415549382910047 2.6063473128515433 -11.019658141847422 0 1 -1 +160 1 -0.17978720428819353 5.335367005111222 -5.961111228150678 0 0 1 +125 1 -3.2595127311899836 3.541669787125592 -7.094678802230409 0 1 0 +167 1 2.6101389699783257 2.7016950511217104 -7.510579719545417 0 1 0 +107 1 2.478905108002845 1.3710464608203452 -11.241338409619438 -1 1 1 +45 1 -0.2728444271939366 3.4472072045614333 -9.803824961885091 0 1 0 +95 1 7.005885045149228 1.8641755193621776 -11.033503201926393 0 2 -1 +111 1 11.28085723924775 1.3577973865073396 -8.404143782130012 0 1 1 +37 1 7.50412447792306 1.5806311975228182 -7.696866725729485 1 0 2 +53 1 9.464056637143884 5.181490576538966 -10.160960273108417 -1 -1 1 +122 1 -8.61454149114821 11.46923394337289 -7.097906043887797 2 -1 -1 +126 1 -8.658911027419105 9.160142379367757 -10.196432851978876 0 0 -1 +72 1 -11.223582472260205 7.275428216701358 10.836645274139237 2 0 0 +144 1 -3.0387339366126 -9.918200912273784 -9.896452956043586 0 1 1 +135 1 0.03771056281680529 7.830565362407303 -8.390686664231268 1 0 0 +183 1 2.8786138768293665 5.221499246050073 -10.100270572243783 0 0 0 +155 1 3.821499942128122 9.224610559399695 -9.359914290522674 0 0 0 +21 1 6.6299071097705 6.818271712520994 -8.197268594363944 1 0 0 +66 1 9.53812274637967 7.559409537149467 -6.194715694404919 -2 -1 0 +22 1 11.107750453110658 10.72621054512756 -6.232964722376559 -1 0 0 +42 1 9.127119842763733 9.280850325093446 -10.249747757735628 -1 1 0 +77 1 -6.840159982144716 -10.92057206639582 -3.876267638432264 1 -1 1 +47 1 -8.742923464684916 -8.023408201112765 -5.403173093100989 1 2 1 +18 1 -10.63751608820882 -11.30186343558728 -3.9206887105699195 1 0 -1 +46 1 11.298180499183054 -7.685155723666886 -4.06604680107494 1 0 -2 +14 1 -9.566429851257723 -7.447961115721825 -2.010931774940218 -1 0 2 +178 1 -4.527419254322211 -8.045910047035035 -4.819501104832851 2 1 0 +48 1 -3.2147691406929866 -10.888877164915472 -6.377437598460709 1 1 -1 +55 1 -0.9601171939836206 -6.238495322587188 -4.2762406549238605 -1 0 -1 +12 1 -1.8964494825899862 -9.405283267682947 -2.3799601015584315 -1 0 2 +15 1 6.020890846962015 -8.178330582079944 0.7240728610757863 -1 0 -1 +64 1 2.731938348082501 -10.543443272156145 -1.741916704711699 1 1 0 +44 1 8.065377899358 -6.2776681789760715 -3.599447303926354 -1 0 1 +188 1 10.02823971588665 -8.47709879900416 -0.7307124355000334 -1 0 0 +200 1 -9.394872508283228 -3.330386381489715 -5.1567351351767705 -1 0 0 +198 1 -7.21209897973175 -1.1704302343832897 -2.203950414480204 0 0 1 +76 1 -9.986350100477846 -3.0116982250661763 -1.5200938888623745 1 0 0 +194 1 -6.746550374491012 -4.972813556867408 -2.5010542319113824 0 1 -1 +68 1 -2.5395355119165752 -3.5084431511046077 -6.11089008487593 0 1 1 +96 1 -3.383034995518244 -3.996115182399876 -2.1114098179404905 -1 2 0 +91 1 3.023350222125586 -6.242259457656427 -2.3794062527217115 1 -1 -1 +154 1 -0.21966769644821582 -2.9431607814775376 -3.0023832902544516 -1 2 0 +19 1 3.1658091018639274 -2.0642468786997554 -2.307083850490244 0 1 -1 +120 1 6.655220459905831 -2.268055028492757 -2.8431810436972036 1 1 1 +138 1 9.657284951715521 -4.552145938528714 -0.6562837148986382 -1 1 -1 +9 1 7.577787647310252 -2.027383158459481 0.591256647470022 0 0 1 +150 1 -9.975709520806461 2.045189761629004 -1.3967042898865678 1 -1 1 +38 1 -5.780821497271447 4.724336446491739 -4.727424802574532 1 0 2 +172 1 -9.690365647641709 4.0528825638271995 -4.90299752668659 0 0 2 +29 1 -7.905836311144201 7.618140007848844 2.0916587803060374 1 -1 -1 +87 1 -3.2429786758343386 -0.9446923499804107 -3.602689802943157 0 -1 1 +93 1 -6.311310050813026 0.9463486890063564 -4.844328963553153 0 -1 1 +195 1 1.0294591756555889 0.17190072131794665 -3.729109843284945 1 -1 3 +149 1 -2.2517532526979984 2.837758606759653 -2.568308902690684 1 0 0 +25 1 4.622058806898725 1.1966098061131745 -0.5762266975161516 -1 0 1 +35 1 2.770724754796497 3.7811224145924633 -3.6900492736017867 1 -1 0 +116 1 5.985384722273807 5.820793889080573 -5.01963853113883 0 1 0 +5 1 5.710509981071034 1.5091333740272113 -4.1779355439452 0 -1 -1 +112 1 4.909280213802248 5.451229842365678 -0.23301351689583433 -1 0 0 +152 1 11.352756404691903 -0.5457110274170986 -1.851635893722021 -2 -1 0 +132 1 8.574718024729343 1.7846682488107686 -1.3135653711870618 0 0 0 +173 1 8.985071256603522 3.7974294357041134 -5.507410143502991 0 0 1 +73 1 -9.997675226742189 8.034933990134746 -6.6211967592334595 0 -2 1 +161 1 -11.552860384837217 7.057039822309078 -3.567109853559714 2 0 2 +78 1 -1.8080552760100446 10.151101687740656 -1.7466859905812946 1 -2 1 +11 1 4.503908677727956 -11.845112920212848 -5.000489634351112 0 2 1 +84 1 2.4816138724708487 7.425072174245171 -5.250945864454475 1 0 0 +90 1 6.134640615065156 9.297869169242624 -0.8361676575747339 0 -1 1 +36 1 1.9591052897014976 7.715785297331987 -1.741598961638701 2 -1 0 +98 1 8.55440808947692 7.573996243117245 -2.894381804652479 -1 0 0 +56 1 7.300059241947594 10.446841724098018 -6.708609001665156 -1 0 1 +109 1 9.185972290533323 11.319457447612841 -0.9199703749554402 -1 1 1 +115 1 -7.290737513756202 -8.128422064576581 2.840900089769448 1 0 0 +124 1 -11.095494798277388 -8.787146009506092 4.06143463064398 1 0 -2 +121 1 -8.269324094623837 -10.076632693187037 6.580117501920071 0 1 -1 +80 1 -4.964400090273426 -7.254460179243866 -0.2516287260948715 0 0 1 +101 1 -4.352556925935133 -8.093642941491481 4.9061967743324075 1 3 1 +4 1 1.6615068736969008 10.065280091130505 4.658196599859135 -1 -1 -1 +81 1 7.340287496174785 -8.542929146635126 6.681008128047246 -1 1 1 +6 1 8.92830710513934 -10.595453002991315 2.772878983207939 1 1 0 +166 1 -8.702005772998799 -5.0252019350878925 4.355591496028076 0 2 0 +40 1 -7.050509790391359 -4.52399648752538 1.2979104738341645 1 1 0 +127 1 -5.6981160982548635 -2.4804262914214696 3.963876974872145 0 -1 0 +104 1 -0.43889931205929145 -0.6786512342031208 -0.26982380817326046 -1 0 -1 +151 1 0.38632233704260427 -6.436575550724694 0.28827602607540115 0 1 2 +60 1 -2.3388191412291297 -2.1909895686965264 5.332358036316238 0 1 0 +168 1 3.905092056046815 -3.342842649601014 0.743162620375255 -1 1 -1 +51 1 0.30821594516237355 -3.3431888641351466 2.97421468380087 0 0 -1 +97 1 2.0959982908166124 -0.09218688876005032 2.2065126859574242 0 -1 -1 +103 1 4.032770557637615 -1.033589048853706 6.026643139338357 -1 2 0 +163 1 -10.67096111340156 -2.753792851497721 2.2777487994238297 0 -1 0 +175 1 5.732332747304902 -3.395357434547403 3.9793999602240824 -1 1 0 +158 1 8.900731939704714 -6.465614302153284 2.882524782105495 -1 0 -1 +85 1 10.256991086371421 -0.03399764580791596 5.19749850902792 1 0 1 +63 1 -8.206071489694988 -0.20777550918309284 1.1337283531787357 -1 0 1 +133 1 -10.53669133454302 2.413445898515217 3.6779422317228634 1 1 0 +67 1 -6.580427997228583 3.5308019506173483 3.249950052857889 1 0 0 +83 1 -3.837130760373457 0.5948829995405305 2.7555803207629808 0 -2 1 +162 1 0.5628056325507875 0.015590885064073646 6.104541108047491 0 0 0 +170 1 -2.741308504695489 4.278253215456882 6.467354505657028 -1 1 -2 +181 1 -5.298818879016533 0.6747551441657151 5.729306597544269 -1 1 -1 +71 1 1.6643578976841618 4.095917673198805 -0.5219437486813767 0 -1 -1 +31 1 1.0515428688465895 4.152933403466363 6.1671972298548825 0 -2 0 +139 1 3.7848906674638663 3.6854393920193473 3.29399693806094 -1 2 0 +3 1 10.981379981294642 1.2656622142958476 0.9353988521574017 0 -1 1 +108 1 6.1052451115408175 0.8636547219490183 3.620998736363435 1 1 0 +16 1 8.972094495168673 3.5728016103606848 4.03251575890399 0 -2 1 +110 1 -11.360244143589199 5.991417852211969 3.108858276372061 0 0 -2 +50 1 -7.001523002421964 11.111129854490866 4.085896982012491 0 0 0 +191 1 -8.535734954334753 7.01291974923636 5.601813919122847 1 -1 0 +187 1 -10.711068400768836 11.24759510548256 5.108018843428019 1 1 0 +180 1 -1.0115990012221623 6.198904069067613 -1.8166876549028856 1 -1 2 +30 1 -0.6366171189365808 8.860606610617594 1.2441466899617097 1 -2 -1 +2 1 -1.8186886713768473 5.401678057284073 2.675711617904522 1 -2 -1 +17 1 -2.0021887273825953 8.358120841698845 5.289337562756078 -2 0 -1 +7 1 4.074924702840786 8.78812906409422 1.7171879913627848 -1 0 1 +164 1 1.8692613585489788 6.285969009685708 2.179749632062295 -1 0 0 +69 1 4.63280772470042 6.917030747154868 5.0992927825629835 0 -2 -1 +61 1 10.180483484726627 5.102933813094147 -0.6143013682078827 -1 -2 0 +34 1 7.6753980260971115 9.289346236573914 2.385702988209246 0 0 -1 +43 1 7.122060213065371 6.027541758611427 2.434097564627603 -1 -2 1 +177 1 8.528259310530697 7.357497844279905 5.573095645895759 -1 1 -1 +179 1 11.765063377112929 -11.216117555594387 -10.520782276852188 -1 3 2 +65 1 -9.939292746165652 -8.35547457034324 11.370610161953358 0 -1 -1 +27 1 -10.951259960706151 -11.676718912293088 8.46919851147203 1 1 1 +58 1 -9.681801591871107 -6.867288275839336 8.155377252027327 -1 0 -1 +32 1 -6.131008336203429 -5.3807894145123 6.404139996945254 2 1 -2 +26 1 -5.277766259873033 -8.47443173172751 9.34226968131783 1 0 0 +142 1 -2.2300264866152233 -6.734520703453221 8.54527447884555 2 1 0 +100 1 -1.5334511532264656 -10.941538235330839 6.762850724892153 1 2 0 +184 1 7.375517404090732 -7.455937963783537 -11.443563002056962 0 1 2 +105 1 1.3322147240971494 -7.892907018083993 3.959755431262508 0 0 -1 +75 1 4.579073338589469 -6.332281766890766 5.401380400098642 0 -1 0 +99 1 1.6872589572610692 -11.008904691990601 10.790406649632594 0 0 0 +193 1 2.165378393000026 -6.907577487565213 9.269079214220964 1 1 -1 +33 1 4.415243573456659 -11.651415043860048 7.196586725345009 0 -1 0 +79 1 8.562132664810616 11.60776935837499 5.9765813232044 -1 0 0 +92 1 9.7882797687825 -9.546408677583251 11.099049944831634 0 2 -1 +165 1 -9.230629586630256 -3.286419219229394 7.361693942438226 0 0 0 +199 1 -6.865681519441191 -4.960200472270827 9.951650907912764 0 -1 1 +70 1 -5.465385410624981 -2.359017759235627 7.824489075549977 0 1 1 +146 1 -1.4128831058942808 -0.5651321764460739 11.276244400666037 2 1 1 +106 1 -1.359759429785522 -2.5612049312124596 8.66030082151058 0 0 -1 +52 1 0.6275246163307096 -3.6626685091764974 11.394079726568394 0 0 0 +86 1 5.385048800206313 -4.521509414521681 8.656605720260643 -1 0 1 +197 1 1.5960773668099044 -4.632851183052137 7.050260712413685 -1 0 -1 +185 1 2.0988154112902677 -0.6155858372057779 10.039741652805866 -2 1 -2 +190 1 7.402096413387279 -0.25029457328283883 9.918579248632192 0 0 -1 +145 1 7.12421994994077 -3.662416626939269 -11.744325877649178 -1 -2 0 +131 1 11.18002293743892 -5.284301350499634 6.202872301153104 1 0 0 +156 1 -5.458324556633278 -0.38542205585237 11.508150106421377 0 -1 -1 +10 1 -9.11455987814511 -0.7284053525098189 4.7937364242043685 0 0 2 +196 1 -9.334790977795333 0.22026194254469544 8.665774918646903 1 2 1 +143 1 -7.202065049712928 3.0671354576980563 8.711576683539384 1 0 0 +13 1 -11.827431931265373 3.351396387549464 6.969024410690874 -1 -1 1 +59 1 -3.4888315694577976 1.7945900827414363 9.37212343512276 1 -1 1 +186 1 0.1399856131518682 2.5706426278242667 9.701168522174706 1 1 0 +136 1 3.4415384834588973 2.185354911818653 7.959200431003509 0 -1 -3 +192 1 10.528638878678947 2.482587032106114 9.852249456508758 1 1 1 +113 1 7.169273245351864 2.240386648237891 6.81806834338785 -1 -1 -1 +62 1 3.8919207853480167 6.881948160439718 8.99101225575 1 0 0 +74 1 -8.178685418297237 9.818884262184877 8.930172678325137 1 -1 0 +118 1 -11.577334387980462 8.493934752303879 6.984011067983683 0 1 0 +117 1 -5.265098295144998 11.327347075770236 7.5602122003602945 -1 -1 0 +23 1 -5.150793196726769 5.778029085599102 11.296630874448987 0 0 -2 +171 1 -4.323653153250317 7.139179037030907 7.775653914779269 0 2 -2 +94 1 0.595594702317225 9.593135599654605 9.048522029833913 -1 0 0 +41 1 5.495056487999116 11.528824616719037 11.673423310901565 0 0 -1 +141 1 9.858324590689726 5.708495049079261 9.011577695177973 1 -1 -1 +159 1 9.655575431519994 9.766549249024301 9.761747234830672 0 -1 0 + +Velocities + +39 3.843901085922765 -0.7556840039136884 3.588481686862416 +82 -6.7131250110640295 0.1978517371310493 3.794615543737683 +57 -3.8444246166822666 -0.12509187511770853 -0.15016726331630528 +8 2.510198026755905 3.9393955076781997 2.1890256483333417 +49 2.3436002495676416 -3.937791517692209 -0.8678317852601907 +54 0.6032383013072746 3.3962808798459587 -4.353772407339659 +114 1.733121125021854 -5.515987819958336 5.5418081738213125 +128 0.6238341583124627 -4.373836957545107 -1.8358939583013871 +102 3.7217703111263405 -2.1130321869806172 0.3604425898099683 +157 -3.060805678543839 -4.541031970793705 2.0247670855961024 +20 0.19495210236206537 0.7445218389780817 -4.9481403197240175 +147 1.300002576089047 0.4456991718445389 -0.49416915478347523 +169 -0.4362191685321444 -3.947171092840025 -1.656461237016801 +123 -4.189637911629164 -3.3929868871757067 0.6670412748458154 +130 0.6134420085318386 2.2669355259081905 -3.459678248548238 +140 -3.017718530938869 2.2011145660870097 -0.08987220236519784 +153 1.8522800493758318 0.8156876148506785 -9.385509457300062 +129 4.422122082904887 0.7131966606636173 0.3531709089212848 +148 0.6611682907987628 -0.38909659051429185 -0.4773785971811748 +119 -1.669105812009433 -0.37002694554897725 -3.3024540150626986 +174 -6.672226703796612 4.247321732812844 1.6315053674536977 +134 -3.0608984486057835 -2.4129204610506294 -2.734745807674302 +189 -2.302704208974844 3.481037259019509 -2.794714120652709 +28 -2.75682827680027 -3.050875489215879 -4.227117245181596 +1 -2.1560141369701795 4.052819594846101 5.448339653382999 +24 -2.386079256841039 -2.8280668145030563 4.35837241466938 +176 -1.4372688768932664 -6.6415313837559875 4.129983376772735 +182 -0.4720828255607976 3.662207995039096 2.519318256725504 +137 3.2869116185302323 3.2307568609578143 -1.9509349541264633 +89 0.9583454014186878 -1.6238254590624648 1.3557912965537908 +88 1.7694593220184982 -1.036030143090322 1.9233033494166958 +160 1.008621423016506 -6.119196433851812 5.640861548269096 +125 1.8734575131064475 -1.5413231325971886 -1.3731468026454559 +167 0.5552538334188052 4.600624550198432 0.10361430748931168 +107 -3.2399064229680294 -1.8236363657903167 0.5755237816639006 +45 -0.8909937912895557 3.652128037032182 0.47945125158298724 +95 -3.55734648018246 -1.7071938037895589 -0.49307606319505376 +111 -0.5877274590969576 -1.0815552570296887 1.2264280053757328 +37 -0.4940015083502718 2.120546197357239 -6.129979680695427 +53 -0.2896516389711194 0.42515885739039166 -1.8677025658203998 +122 0.967791765282903 1.7401195129115046 1.9118554789129 +126 -2.954209751448974 2.164651827051895 2.3297982456925053 +72 3.173369384034092 -3.8176084785054245 -2.272242460318536 +144 7.811875555936 4.819434744326224 0.3359991553117815 +135 0.1395889289809734 1.0258297209323288 -3.8437628564556956 +183 3.6133240015570744 -0.6507150055387017 -3.110230107415811 +155 -1.81416144798709 -3.5659788058079758 -2.041490164886604 +21 0.6092276970785621 -4.133031653047547 -1.1692481377542574 +66 -1.2540845964267104 -3.824259504042551 3.29729030480536 +22 2.5446763351186448 -0.6513499783353496 -2.0932016159863465 +42 5.82871794909335 1.6743919751666467 0.7126718280768334 +77 -0.4040118365141223 -3.2290750702108357 1.818231240430787 +47 0.028653058178313952 -2.27141290239272 0.7388413469098802 +18 -0.3605358292652272 -2.51632133097868 -2.2152302223559324 +46 -4.956822430210972 1.7347845441659948 -0.8052402055568453 +14 1.0447813005670052 1.7950897980192044 -5.120385937069129 +178 2.8613069610645323 -1.221832900100255 4.786474400939546 +48 -1.0101057057064093 -4.108390928419403 -3.626668446988165 +55 3.380329095570148 1.9767809972549477 -0.7468971412257048 +12 0.5796037236485843 -2.968894009109519 -1.109629405353503 +15 -1.0805423425753338 -0.6224135466634316 2.517980927489596 +64 2.772129192684522 2.307682180641892 1.326944641441264 +44 -2.8172327982334355 1.083586023278567 -1.8763865737567058 +188 -3.437261818925725 1.5454398749025489 -0.16540078855271825 +200 -4.575258061249265 4.788641216932844 -0.4020526553149053 +198 2.0555443873273083 -3.895983368588817 1.158820403753976 +76 -0.43680328576927907 -2.690054938184871 -3.1926091395345697 +194 -4.927518640766644 -2.7958765254010074 2.346084579105554 +68 3.8869230882195995 -4.532127531608888 -3.709193335672372 +96 0.5541428371102486 2.469654795647139 1.3292842757665846 +91 -0.732047074282118 -2.6885559423815857 -2.1949168022734056 +154 -2.5136766428597386 3.590700279102351 -0.059374328708080126 +19 -6.161653279730477 -2.8765306398549155 2.4409492942004887 +120 3.4942280062726017 -3.9836089343560284 -3.098191865520773 +138 -1.392154916395345 -2.6054126458670575 -0.5249503554366697 +9 -1.4056559546036238 -7.532778826245055 -1.3371688664267456 +150 0.5460808983742688 1.1289965684546914 0.03903574349628039 +38 7.617629027425106 5.411105913171608 -2.660628272394109 +172 1.971077098016012 -2.934759849810778 -2.6385133345793075 +29 -0.8567705552974654 6.938534740571189 1.1877415743187205 +87 -2.465817251368031 -0.5425773738872799 -0.8367656554342691 +93 -3.238874163573574 -1.2524540618123574 0.7858441913773856 +195 0.6658739747764354 -1.3905513374439 -4.4817269197268415 +149 4.447455849494194 -3.5745477247727786 -0.5281496993793596 +25 3.022648709593685 0.43914951689799137 -0.6775610151451638 +35 1.3277674074899293 0.9468507964705938 -3.026965993493294 +116 3.907132307739244 1.560341819486881 -2.1186616218198884 +5 -3.10241641974574 6.10623002683338 -0.012215259748321432 +112 -2.863798374154691 0.5948426813836486 0.35177484162268213 +152 1.5766503044655036 -0.41730163186181074 1.996501964828515 +132 -2.0634425438904502 -6.992874517268254 -0.2451331836568511 +173 0.12455810167557121 0.14574198963840712 2.9966160518510416 +73 -0.10493988646970537 0.013265555839272553 -3.9096646776491677 +161 -0.7682600042762859 1.8026603641653332 -2.7660568636516665 +78 -4.598805320864625 -0.6966368634003359 -2.729429984123398 +11 -0.9758381654162251 0.5227854122925947 0.3448945101494703 +84 2.841479136799234 0.22602223675017963 -1.9286282882334902 +90 -1.170230656537341 -0.6922100007103397 1.00880686523509 +36 -1.555842370975647 0.5631255749042902 -1.1019837065378786 +98 2.0124676556916246 0.6570695281160257 5.910973495167498 +56 -0.022897610961461763 5.352337474059436 -7.2334429828662445 +109 -0.08981766099555996 -2.306157996649536 -0.3829489041252826 +115 -0.9773922652842171 -1.500230307176322 -3.510085314469408 +124 -1.1435154328225432 2.1646855444941977 -2.677614067537958 +121 -0.6489305438370466 -5.377205725667324 6.410392354489873 +80 -2.184720009719291 -4.6495239027996265 -0.404219915911962 +101 -1.8277373470288034 -0.16307514644975357 -4.871062878988115 +4 5.273572229084702 -6.329640548895822 -0.10537322064888095 +81 -3.237096839577087 -1.2899510482475711 -0.501749653216555 +6 -2.850185972190969 -0.9855865922331829 1.2879726986158606 +166 -0.71207408822265 -1.941276610007301 -0.46670672944069197 +40 2.5501094465369287 -4.1121537776062285 -3.7730629800493616 +127 0.9391826983400688 -0.23609028118969985 -0.8428319005564415 +104 -2.889702758235898 2.6026465825944647 1.733501739951787 +151 1.0239383010373613 4.20250515830853 -2.5188428027750676 +60 0.8768242700054026 -1.4452870366932915 4.607166615214986 +168 2.6499467008683806 0.15351519699868008 -2.4173199831848433 +51 -2.7001470663696083 2.298050292705142 -1.8727439352999022 +97 4.077411493370136 -0.49363711607361804 2.618893169202227 +103 -0.7976469434966291 -2.8296239792549494 -3.1085019733170576 +163 1.4239083858918546 -1.7152330037559187 -3.7262201886107413 +175 2.28608354457103 -5.013082617544787 1.9463144730607622 +158 2.364724804444635 -1.417965451640216 3.3110988056960116 +85 2.634049111053192 2.030183273599258 -1.1156959044778305 +63 -2.5594596368644584 6.5807348164634165 1.2216612365119401 +133 0.11496856368877509 -1.3029278864933922 0.3137832360475215 +67 3.2847742901460815 -3.509493405431694 2.207008202574443 +83 2.570557721108847 -0.3717669874940476 0.19918880069367745 +162 3.0399699011039054 1.3116112714661063 2.674382531726811 +170 -1.38109599459742 3.3822351643604485 2.3645182440787846 +181 -3.229104480841883 0.4809626947427979 -1.0038042842684436 +71 3.9132675825937917 1.4930647145750953 -2.169388439547446 +31 0.2080392077753374 -0.7175240437209078 5.244126748535574 +139 -3.2722113265821164 2.403646928095839 4.89007181946881 +3 0.23844888496446556 -1.2064671761077215 -3.765272552252597 +108 1.9533881124972572 2.2407632376201616 2.7809203919337717 +16 -2.546655497698339 -2.9475172512416052 5.679217575496501 +110 -2.0619258300646304 -2.5135908125338595 -1.9634278842507895 +50 2.7297022478135924 -1.7023753942716038 0.9305543045166054 +191 -5.08419299322051 0.0712033790584315 4.019663294315123 +187 -1.1602692653736124 0.6592040176624594 -0.9276587772961099 +180 3.9270482120535912 0.7337070019018614 -6.1521791130682715 +30 2.146405625539158 -4.470711382216746 2.4389136902743624 +2 -2.164694698633498 -3.946038803617009 -6.932908852758065 +17 -5.0136316664846525 -4.910395378878622 0.2531438520391362 +7 6.405139093241594 -0.029320522419797518 -2.4556700372713656 +164 -4.71978957162196 0.7565882723845814 -7.804804192177828 +69 0.585325244096323 -4.172549570259053 1.421305529899283 +61 -1.2969434367599055 0.21371727493194503 -5.996553017036012 +34 0.836211095631979 4.842199148306591 -0.264740483545493 +43 4.973431404758735 -3.0161637272673114 0.6585207320279483 +177 1.9972180553856484 2.8405653312769714 3.7936113983454574 +179 -1.8016662165736297 0.17922718595288942 1.675961420609039 +65 -0.3262344061357664 4.502937830108041 -1.6925046570602365 +27 3.2148912674329595 -4.265923914349978 0.20837858074619325 +58 -2.5148141053183966 -3.410776250506333 -4.126435252324821 +32 -3.9688004644027894 -4.975859333985981 -0.31037975343014773 +26 -1.8868624613436276 -0.6784023280861808 -6.9019978159434325 +142 -2.2655622806415803 5.065238482808602 -0.5612653461135326 +100 -3.1689440110918863 3.611829368506524 -5.535634657025687 +184 1.155071447769214 1.3970696009831187 5.21877428678114 +105 -1.0527289600189955 -0.359868396602688 -4.314898952688254 +75 1.1126434309490583 7.161365583137096 -6.8797286508213995 +99 -2.2511573267704605 4.325930022921806 -4.536664094156967 +193 -1.8538759123569282 -0.3771359852226918 1.3265167612281819 +33 4.043103770190031 -2.463191434468879 0.2825585567463736 +79 0.8247934215179962 -0.8593180918731026 1.8075425908507756 +92 -1.9872298962564725 4.526116206000229 5.875185828559399 +165 -0.9325271408003691 1.9234746099504088 0.09139445808177141 +199 -2.4466143796538278 -3.5392337118481905 0.07336564176962056 +70 1.6955535004916 2.7542669443749292 -2.844202030673744 +146 -2.7188074197448584 1.8546678027188679 3.404472056065058 +106 1.6207845192963544 1.2164210998710923 7.1450165172108 +52 6.210256198054289 -2.1514980948844977 -3.0246733234381606 +86 -4.166581136807711 -0.379450814784322 -2.11423926273923 +197 -2.0944322960049 2.1097024434581955 -1.5699756741420037 +185 0.496431323422778 -0.673746468047717 1.6256733179580487 +190 3.5894390751435754 -0.5232916689073732 -2.5898259464521436 +145 -5.060692392767518 -3.604348262830216 8.963086293155014 +131 -1.7493649096325448 1.9215551392824017 -5.654561521157757 +156 3.0486560090093078 0.7623397112130897 -0.6623326467666147 +10 -0.3025813929631971 3.8012367067722552 1.7944918683195408 +196 0.20779509519657535 1.1724947587327104 -3.2497684331092898 +143 0.1615216816901657 0.541965759645283 -0.3699391852573772 +13 0.3416281793998905 2.006587618812918 -4.356326172952984 +59 1.6542517855144645 1.9404536050042447 2.6385288647359855 +186 -3.4589984191612237 4.344929883747252 -2.4261876990284055 +136 -1.052237178030063 1.7981079687785935 1.5452947189881334 +192 -1.8283033036376375 -2.1460456664281984 0.4532252919540826 +113 -0.07210257811201395 0.4448121853700756 0.4002442722770919 +62 0.07671657245048122 3.988794018720988 -1.5215067553007326 +74 -6.261763851450271 6.841230877971418 0.19948931371832682 +118 -4.55843930988713 0.7045880922983706 -1.5541929923380147 +117 -1.7138030815767766 -2.2218466460669197 -2.4862510267677966 +23 3.4139900995951797 -1.2153416151189098 1.5870813641624815 +171 2.9673700826094715 -2.730113253007238 -0.013674771129509489 +94 -1.559158449433541 -4.089352807642382 -4.9936243516296415 +41 0.05830786336808787 1.0332428056957692 -1.4731928753411638 +141 2.0403501209228514 0.38114816689047215 0.2637593201666092 +159 -2.276370624127765 -5.5130320242721425 -2.201507053272948 diff --git a/examples/PACKAGES/pimd/lj/data.metalnpt02 b/examples/PACKAGES/pimd/lj/data.metalnpt02 new file mode 100644 index 0000000000..d48c9e654f --- /dev/null +++ b/examples/PACKAGES/pimd/lj/data.metalnpt02 @@ -0,0 +1,422 @@ +LAMMPS data file via write_data, version 8 Feb 2023, timestep = 100000 + +200 atoms +1 atom types + +-11.876696863105703 11.876696863105703 xlo xhi +-11.876696863105703 11.876696863105703 ylo yhi +-11.876696863105703 11.876696863105703 zlo zhi + +Masses + +1 39.948 + +Pair Coeffs # lj/cut + +1 0.00965188 3.4 + +Atoms # atomic + +39 1 -10.348412656724513 -8.709686235988883 -8.4270990310572 0 -1 1 +57 1 -6.076254771403757 -9.286388884881402 -7.702702502017148 1 0 0 +82 1 -7.550388144071918 -7.009510153923324 -10.103430125234938 0 0 0 +65 1 -10.007477542149314 -8.426774632489874 11.409858756818739 0 -1 -1 +8 1 -7.164995520412905 -11.038468804393306 -10.58636480246276 0 1 1 +49 1 -0.45959797061569213 -8.711842576893478 -7.759689256680434 0 1 0 +54 1 4.335836096446666 -9.860468354448713 -9.596810041931791 0 -1 1 +102 1 2.5723817340883883 -6.321599469181216 -10.836018784654463 1 -1 -1 +114 1 3.9633708583907534 -8.59122246718616 -6.211421303718058 -1 0 1 +128 1 1.6111319524977374 11.42178725036819 -7.424763349756333 0 0 -2 +157 1 6.676723241532642 -6.249807038476984 -7.434858543313773 -1 0 1 +20 1 8.180031746693997 -11.224906976375225 -9.914700910890055 0 1 0 +147 1 10.552595438745763 -5.846535200951102 -9.39377855844701 -1 2 0 +169 1 9.349136090221942 -8.979140149397233 -6.8265579785125965 0 1 1 +123 1 -6.855446583817184 -3.2640394531559696 -10.949254791001273 -1 0 -1 +130 1 -6.535059536526429 -2.567484128692307 -7.041716414515715 -1 1 0 +140 1 -9.06855871809178 -1.3542845787289544 -9.224892837601802 -1 1 0 +153 1 -4.569518029474378 -5.203914109037015 -8.781875667281184 0 1 0 +129 1 -0.2299073567614939 -5.077417463604178 -8.55580527821163 0 1 1 +148 1 -3.144987560803104 -2.0908434236033218 -9.879429686918634 0 0 0 +119 1 -3.5411143846194992 -3.8360561641889532 10.696563632316428 0 -1 -1 +134 1 -0.04545170129816967 -0.3594090384455699 -8.557611667254108 -1 0 2 +174 1 3.1061081743214345 -1.9799957752444968 -10.724581364205001 -1 1 -1 +189 1 2.8769937819916396 -1.3674240720053161 -6.389788220787231 0 0 2 +28 1 6.237115641177313 -1.1545998190288946 -9.272228860156012 0 0 -1 +1 1 7.549394959535029 -2.854734791893552 -6.538590887699934 1 -1 0 +24 1 10.883729099000904 -2.1271876989337706 -8.117545982704844 0 -1 1 +176 1 10.267930709995003 -3.6438442151633126 -4.343476582694092 0 0 0 +182 1 -10.786266284256198 0.5593263120798149 -5.188887623332871 0 1 -1 +137 1 -8.253864841052525 3.7298295620111226 -8.568533527553154 -1 1 0 +89 1 -5.794201120520342 0.9380076791670935 -8.557102414588634 0 0 -1 +88 1 -3.290466618666769 2.666597373561615 -10.965754432660972 0 1 -1 +160 1 -0.18201736379451042 5.440877252854083 -6.045408976448922 0 0 1 +125 1 -3.2721098231201498 3.482326329512073 -7.20800643325733 0 1 0 +167 1 2.6838478408055124 2.662941774470184 -7.446400398896404 0 1 0 +107 1 2.461769881852174 1.4723823486650787 -11.23948224456525 -1 1 1 +45 1 -0.32643148409171074 3.4132158246810462 -9.890588978502432 0 1 0 +95 1 7.12050576869771 1.8830305880227627 -11.021337217501824 0 2 -1 +111 1 11.302810293745958 1.3519264206984616 -8.432303785348612 0 1 1 +37 1 7.499987535787309 1.5957548452787924 -7.727720303674275 1 0 2 +53 1 9.440512427968931 5.294797843867766 -10.137582763727357 -1 -1 1 +122 1 -8.602536179448315 11.512272015578171 -7.106756749836173 2 -1 -1 +126 1 -8.684507097426447 9.102724910576027 -10.228076159133025 0 0 -1 +72 1 -11.212168106684132 7.24750708554837 10.879317278944692 2 0 0 +144 1 -3.026583839716779 -9.884067057114146 -9.895519067990667 0 1 1 +135 1 -0.0021296445465068814 7.861337183488864 -8.408004375424728 1 0 0 +183 1 2.8552963287326403 5.197557014594176 -10.04944592034365 0 0 0 +155 1 3.763607040992876 9.197661654352766 -9.383705258407385 0 0 0 +21 1 6.743085276662367 6.819489412060577 -8.245771575257553 1 0 0 +66 1 9.52403312105875 7.459476022143324 -6.138585785756646 -2 -1 0 +42 1 9.12856561120073 9.359598065403702 -10.255808680046007 -1 1 0 +22 1 11.084937277836246 10.7346270298744 -6.189336343510782 -1 0 0 +47 1 -8.79851480543095 -8.030651717047036 -5.3995272670275725 1 2 1 +77 1 -6.824604399212273 -10.927075660857042 -3.894519486445894 1 -1 1 +18 1 -10.638894292838417 -11.301447222259686 -3.92180055862298 1 0 -1 +46 1 11.290286356240586 -7.674430365874162 -4.055829279128204 1 0 -2 +14 1 -9.506577112536185 -7.441780453176744 -2.0080876276818103 -1 0 2 +178 1 -4.543756730558393 -8.097143654115143 -4.784790404681888 2 1 0 +48 1 -3.2444312260629573 -10.940861821243079 -6.354255167480908 1 1 -1 +55 1 -0.9464860706310958 -6.285996525353373 -4.30908825600282 -1 0 -1 +12 1 -1.856123326430506 -9.517447392023085 -2.3435724928975645 -1 0 2 +15 1 6.077305695814157 -8.166300444221115 0.7448836933119019 -1 0 -1 +64 1 2.7452944971646858 -10.558129575009149 -1.730050297615053 1 1 0 +44 1 8.116024736633927 -6.297043957734161 -3.618119081228304 -1 0 1 +188 1 9.990490631214506 -8.453825757862562 -0.7847723993749525 -1 0 0 +200 1 -9.371399961242005 -3.371895968187197 -5.193597997968697 -1 0 0 +198 1 -7.163187216472317 -1.1934858004192783 -2.2622400054633864 0 0 1 +76 1 -9.919958613706985 -3.040871792288106 -1.4149931903428534 1 0 0 +194 1 -6.743945843921815 -5.005230021567819 -2.613393963742155 0 1 -1 +68 1 -2.5671189668335317 -3.434435519320573 -6.1465461411366 0 1 1 +96 1 -3.430661147431614 -4.018545052073527 -2.021400662533695 -1 2 0 +91 1 2.9683873682514026 -6.254217834947031 -2.3589109971891737 1 -1 -1 +154 1 -0.2218228203315391 -2.902150057925404 -2.9725706529414366 -1 2 0 +19 1 3.2665435171804194 -1.9817522239515633 -2.3096363660640975 0 1 -1 +120 1 6.609146288179666 -2.2318382061287565 -2.808377349441308 1 1 1 +138 1 9.631227201052864 -4.547744518411388 -0.6709487904267171 -1 1 -1 +9 1 7.596887391638223 -2.0237588049028696 0.6051605861836649 0 0 1 +150 1 -10.044973671786467 2.0147581633676452 -1.3897952482345524 1 -1 1 +38 1 -5.7978106400822895 4.770632320137689 -4.758054319452569 1 0 2 +172 1 -9.658785222083136 4.026164557116778 -4.942402258050777 0 0 2 +152 1 11.431334273176418 -0.4623515239881826 -1.925450909701469 -2 -1 0 +29 1 -7.909238416570071 7.61624491229837 2.2042493522591258 1 -1 -1 +87 1 -3.3103551172038665 -0.94337019011639 -3.5930404382745955 0 -1 1 +93 1 -6.2863195662557 0.9404795536165196 -4.898675396085437 0 -1 1 +195 1 1.0245553543549981 0.20159488775043144 -3.679042462676364 1 -1 3 +149 1 -2.269526344184385 2.8074136653426387 -2.5814855370744945 1 0 0 +25 1 4.649154714287583 1.2394738761102164 -0.6186508337325307 -1 0 1 +35 1 2.8516234465534787 3.745844200453856 -3.7667964552544286 1 -1 0 +5 1 5.795606814798939 1.5285888723891716 -4.179888075744685 0 -1 -1 +116 1 6.001522247841404 5.755884373452364 -5.02433183427119 0 1 0 +112 1 4.844016623012077 5.465934695953432 -0.25432767294668557 -1 0 0 +132 1 8.53939720077536 1.8213558063438606 -1.3830903771567364 0 0 0 +173 1 9.062655610340409 3.8664027467280935 -5.47150892329001 0 0 1 +73 1 -9.979257287380412 7.98839910326609 -6.702836934882303 0 -2 1 +161 1 -11.50425364162053 7.022415057658153 -3.488322518144713 2 0 2 +78 1 -1.7469625877850241 10.184158454427994 -1.7648096425042503 1 -2 1 +11 1 4.444644958846757 11.851997915189173 -4.933412264679578 0 1 1 +84 1 2.459047681073617 7.373812748831801 -5.213139361825189 1 0 0 +90 1 6.1482860548874925 9.307626902509035 -0.9026751698054234 0 -1 1 +36 1 1.9695381713294537 7.78336838361963 -1.7729647147442544 2 -1 0 +98 1 8.527874795717773 7.612035599231426 -2.9325216125652 -1 0 0 +56 1 7.282783408448612 10.400831236794666 -6.728973679619628 -1 0 1 +109 1 9.156728968120607 11.308407539099598 -0.9040861597803378 -1 1 1 +115 1 -7.309621980156194 -8.117595813105002 2.8126740615279595 1 0 0 +124 1 -11.142069858043358 -8.82667541719755 4.10932707265772 1 0 -2 +121 1 -8.21003433895173 -10.089956822420406 6.660752548831763 0 1 -1 +80 1 -4.909425537698309 -7.256236799158399 -0.2747148144591023 0 0 1 +101 1 -4.312342956814611 -8.070113074572049 4.879741561255617 1 3 1 +4 1 1.5494925162428856 10.03102296069128 4.602107842780676 -1 -1 -1 +81 1 7.27113702294054 -8.472013640467047 6.625505444757195 -1 1 1 +6 1 8.885736885591768 -10.557271403060728 2.7878338185404203 1 1 0 +166 1 -8.69650192512206 -5.07362796560642 4.236148217669305 0 2 0 +40 1 -6.987849762900474 -4.511534637942379 1.3175075163680883 1 1 0 +127 1 -5.689629608203652 -2.3907227510814337 3.9463589292537864 0 -1 0 +104 1 -0.4397363632556015 -0.6165598923688651 -0.3313279093278112 -1 0 -1 +151 1 0.4300685018079994 -6.441488457556783 0.38045612640805615 0 1 2 +60 1 -2.3217820522915846 -2.1704723730197557 5.333166404467865 0 1 0 +168 1 3.9149834819211655 -3.3791911515481985 0.7567189672094479 -1 1 -1 +51 1 0.398133835057336 -3.3931578730294385 3.016370538231655 0 0 -1 +97 1 2.1573351041413034 -0.0855884286300217 2.2286851783702524 0 -1 -1 +103 1 3.9664988893980713 -1.064731427067052 6.037166605284854 -1 2 0 +163 1 -10.709566329240587 -2.7332402144894417 2.2660820588417665 0 -1 0 +175 1 5.762755562271241 -3.3856559659466114 4.002375112428048 -1 1 0 +158 1 8.862173003831924 -6.538751027751994 2.8769202677556542 -1 0 -1 +85 1 10.229250850148503 -0.01502947727190853 5.300096059690905 1 0 1 +63 1 -8.263417127255543 -0.18022873161562153 1.17510825734459 -1 0 1 +133 1 -10.480766232506394 2.392923584409271 3.720879727063737 1 1 0 +67 1 -6.544234163722191 3.501038541004621 3.191437971422375 1 0 0 +83 1 -3.849802400718045 0.6646468573486004 2.7446055069817703 0 -2 1 +162 1 0.6098193007635196 -0.05324811248282152 6.154363200071202 0 0 0 +170 1 -2.6786368359767714 4.255168732248176 6.435570102352074 -1 1 -2 +181 1 -5.252793067773865 0.7761154003139943 5.79909696611136 -1 1 -1 +71 1 1.6452911952303246 4.06622820161267 -0.5166203216146883 0 -1 -1 +31 1 1.0738987741436463 4.15303788757344 6.141061091921109 0 -2 0 +139 1 3.8104659718300624 3.693576878280304 3.384062081506274 -1 2 0 +3 1 10.9858871588246 1.2545617976234098 0.8570931258327192 0 -1 1 +108 1 6.174388178357244 0.8538858651722911 3.6472942727893374 1 1 0 +16 1 8.97282237909764 3.5943899325206274 4.02632096928566 0 -2 1 +110 1 -11.336507152318017 5.947474598331584 3.14037651741927 0 0 -2 +50 1 -7.046202899905131 11.083294806174674 4.036430331092051 0 0 0 +191 1 -8.508890702823583 6.994301261898876 5.5988324620755945 1 -1 0 +187 1 -10.749519222803974 11.280267500561628 5.071750333310352 1 1 0 +180 1 -1.0032349913124285 6.140237973021502 -1.7436540397788036 1 -1 2 +2 1 -1.7946548786825645 5.404613901091388 2.68002365908378 1 -2 -1 +30 1 -0.6282593143948212 8.881746166196663 1.2420280890418454 1 -2 -1 +17 1 -1.9971151666590217 8.252473054961822 5.30244560397972 -2 0 -1 +7 1 4.0488432159812255 8.81693522673231 1.6114995620401231 -1 0 1 +164 1 1.873438403508949 6.222826359057496 2.2533705281578316 -1 0 0 +69 1 4.6051775335846745 6.921132428828564 5.128620799236167 0 -2 -1 +61 1 10.268176907196304 5.08172043450454 -0.642274843845057 -1 -2 0 +34 1 7.601946368008498 9.256904252690223 2.406585955238384 0 0 -1 +43 1 7.165450199452092 6.0290506218302085 2.4419163969738023 -1 -2 1 +177 1 8.561622776612461 7.244917835893727 5.602147565752702 -1 1 -1 +179 1 11.750057623239174 -11.228395927014766 -10.487778908482419 -1 3 2 +27 1 -10.974224751020245 -11.635298968202441 8.509409995684443 1 1 1 +58 1 -9.692847117546727 -6.99702076150861 8.089242933510139 -1 0 -1 +32 1 -6.165044846878473 -5.3531372054847 6.419358142287187 2 1 -2 +26 1 -5.15775210282499 -8.509724647787523 9.35521475378418 1 0 0 +142 1 -2.2394120995772013 -6.757001235575803 8.53817557952535 2 1 0 +100 1 -1.562747759528225 -10.930435349230905 6.862796976881519 1 2 0 +184 1 7.329483236732028 -7.477553906204161 -11.457403276020457 0 1 2 +105 1 1.3124523565691075 -7.852976862538032 4.005035595809602 0 0 -1 +75 1 4.597924698307231 -6.283694211187047 5.476806400599068 0 -1 0 +99 1 1.716773073271929 -10.998458790026556 10.715096401091909 0 0 0 +193 1 2.1325154242736666 -6.931854968739277 9.419307764840358 1 1 -1 +33 1 4.48712925680286 -11.671378658171115 7.267170381111049 0 -1 0 +79 1 8.573107089496888 11.611228502272368 5.983087465760138 -1 0 0 +92 1 9.81601068917706 -9.527916362770739 11.159627680682005 0 2 -1 +165 1 -9.2113400341349 -3.219195257680457 7.288219778779848 0 0 0 +199 1 -6.931272020823427 -5.000130571946396 9.88597891452116 0 -1 1 +70 1 -5.507541862888313 -2.393142934597723 7.807143673901248 0 1 1 +146 1 -1.4771503758916822 -0.5410305896302106 11.279923136114263 2 1 1 +106 1 -1.3651808664767915 -2.54616781259121 8.590647351661577 0 0 -1 +52 1 0.6779843498698166 -3.7311606456725768 11.453754175953545 0 0 0 +86 1 5.4031998049641565 -4.549788149287394 8.596350093940629 -1 0 1 +197 1 1.573548668834416 -4.687213943022477 7.1278633337641 -1 0 -1 +185 1 2.1532991864501554 -0.6046775517606129 10.000779301772766 -2 1 -2 +190 1 7.401787297285096 -0.2505978640044338 9.870584022136198 0 0 -1 +145 1 7.111702440333872 -3.6540730490844453 -11.814469255040187 -1 -2 0 +131 1 11.130905707249603 -5.281990426153451 6.209567942496238 1 0 0 +156 1 -5.482768650143603 -0.4312680407464029 11.466238929392272 0 -1 -1 +10 1 -9.053182404201642 -0.711645217691651 4.8230146575990815 0 0 2 +196 1 -9.337441409320208 0.1609718702750058 8.663781619737854 1 2 1 +143 1 -7.17068301465806 3.0756929715249197 8.74321294778271 1 0 0 +13 1 -11.784452395762827 3.289072175663378 7.001527553636599 -1 -1 1 +59 1 -3.4378714190696336 1.7721863061771366 9.36771463550879 1 -1 1 +186 1 0.1662370132365254 2.5243181917810595 9.709168312215267 1 1 0 +136 1 3.4094152339708126 2.153729603693705 8.008621315534214 0 -1 -3 +192 1 10.489678729236587 2.4935818679754185 9.842929691077494 1 1 1 +113 1 7.1536296108923345 2.1797090477435894 6.8304033834765505 -1 -1 -1 +62 1 3.9169396613561496 6.861682724751661 8.976027690230366 1 0 0 +74 1 -8.118378807759774 9.793902614888827 8.932362315849124 1 -1 0 +118 1 -11.58583737453999 8.536873240765573 7.014861349235567 0 1 0 +117 1 -5.277108589074334 11.352800033973235 7.597327201748058 -1 -1 0 +23 1 -5.157626384085098 5.75340956696832 11.215724105856438 0 0 -2 +171 1 -4.306475221375887 7.1666374724202555 7.827635610104089 0 2 -2 +94 1 0.5173001347371304 9.700900025717369 9.033047100941438 -1 0 0 +41 1 5.490142462338115 11.510392579949611 11.613725539319557 0 0 -1 +141 1 9.87566572043054 5.774221219191659 9.0665289512053 1 -1 -1 +159 1 9.686865955901812 9.753371327924555 9.75057962979839 0 -1 0 + +Velocities + +39 -1.9399818993193945 -6.2245952285602995 3.5338548174142916 +57 1.5287860491005811 -2.72214429330134 2.2456706435699694 +82 4.011405667244886 1.5297461738282854 -0.00848199347765205 +65 -8.99687886174914 -3.5904944014362874 -0.24257004026483364 +8 1.3456043077490425 -2.128460026427474 0.5438548397418695 +49 3.9804563992312922 -6.033137289721198 -2.4992971438276896 +54 -0.8797092038138496 -4.4441361344158485 -1.158307352101043 +102 -1.6073661483672754 -6.3013772766305705 -0.8971841583061024 +114 4.952776653242985 1.9508143607180544 -4.637659613505405 +128 -1.269058654850369 2.9109256516813193 0.4053666332013952 +157 -1.0484348115580815 1.3302695757858152 -2.3230656835483483 +20 1.6286859684439459 0.8384182438479687 3.337320080806048 +147 1.7009416069818912 -1.6078420463299883 0.41513271531119245 +169 4.488200687237288 -6.490934602483694 0.13987631822178037 +123 -2.8913963004993426 7.445402407235762 -0.2708525381058624 +130 -1.3405859620177862 1.4399831113332697 0.048073865645907876 +140 5.071347652434061 -0.6702612789643095 4.605780995472893 +153 -3.7972143859475698 -0.514917067426214 -4.9181301157390225 +129 -0.524987732421045 -3.209340969084892 2.932495986872108 +148 -5.447057077277419 -1.4060679681657386 -5.483184347880067 +119 -2.5629223421862375 1.3882127095818109 2.83591016397441 +134 -1.3621064953428361 4.288456433365155 -1.6190478694645496 +174 1.7758446648889914 4.86331991854285 1.1265592480566544 +189 -2.1997618638118066 -5.481413979755256 -1.086026577758521 +28 0.47277982211285713 -2.417172577737755 -1.932990476216946 +1 0.6703800334847378 0.767366418061703 0.19201532965448842 +24 0.04297238333671294 5.144308305848863 0.078997482901074 +176 0.4965479246937361 -0.13321844730810892 -0.13420426694661658 +182 -0.03943631525057928 -0.4576897656157408 5.202139202652978 +137 3.3038160138315282 -2.8142339694373977 5.5902387847740025 +89 -0.7210799083306686 1.5890809944259632 -0.7203455040724582 +88 1.0693506358892855 0.004219772825099388 -0.34637529725335453 +160 2.818428049318086 3.2244292228167537 -4.494216600884747 +125 0.42818621594139183 3.1889923789665167 -0.2889418149701054 +167 -1.634028108672504 2.274964875925839 -2.5010575325085713 +107 -2.275260397982265 0.40965124117591156 3.7368455922538386 +45 -0.7001662440449031 1.119455401379465 0.23148546097076927 +95 5.262372995855103 -2.4350400461030928 4.204427583146448 +111 -2.8606969082837232 -2.7980553847036016 -5.595977877258418 +37 -2.2899225677006445 -0.8948602257995134 -0.4803200724258121 +53 3.002131309420766 2.6120771462261168 -0.9952903525863226 +122 0.8674217257039606 -7.734997952666523 0.833404061351757 +126 -1.1420613062006533 -4.550118096866477 -4.2790463933780245 +72 -1.8516741228057083 5.947761028964626 1.6102399224289305 +144 -1.1917460086100382 5.214371411898472 2.577241700331775 +135 -0.6560595442322588 -5.810339924107932 -4.318267593309593 +183 -10.386809746296331 1.1897898885572993 3.451816626760367 +155 -5.162635743080924 -0.24765733386766664 -0.9110712844247615 +21 -4.2563878171076155 -3.402344841498928 -6.759865341543254 +66 3.892260841699981 -3.872668437572034 -0.3337143786545691 +42 0.4166666127989469 6.100606589949791 -1.4397576055696024 +22 0.3608663266598049 -0.6522614903150212 1.896193166731318 +47 -5.327073086748509 -3.490472671050769 -0.07383525372930849 +77 -0.978728222397191 3.4020107799172736 1.0077489411757843 +18 -0.4650542307772494 2.9718359172432747 1.4633800163719572 +46 -3.027050149464662 4.17167624743228 -1.827230734431756 +14 -0.09677720578549692 -2.7193038262530447 1.7914199983541117 +178 3.696002315695369 1.6876713658009856 -4.672832052845037 +48 3.983692149992739 -1.1833239408832328 -4.299433489091069 +55 1.4078039475385906 2.056934505867413 3.7406982539078393 +12 -6.525348764219679 3.3122244911450394 2.6197769407714624 +15 -3.3141834562011994 0.5054069138851847 -2.97725365266652 +64 -7.771910612976191 -4.581106933347833 -0.41638292972909086 +44 1.6412238745050067 -1.8908109366759165 -0.06612343065785803 +188 -3.5844091539515395 1.8268122826497 -0.2374993089904055 +200 7.894813073634868 0.057995156825788374 -2.5771892403060033 +198 2.1286980919165597 1.0207578884216715 -2.002608806720997 +76 -4.082585877193767 -3.634723448931757 0.6497689857802457 +194 -5.141422516595061 -5.385767090831518 4.1044833771883145 +68 -1.3677719930905985 1.0604606148180302 -1.7254671966550923 +96 -2.592687583785919 -0.5546395167068001 0.38605262002135754 +91 -4.294011884932044 -4.480411411848511 4.543287343202344 +154 1.815487275814105 -0.07008532516876564 -4.441392134697374 +19 -0.24976249513756998 1.579721447829149 -1.7421975373515703 +120 1.804118819372854 0.520165481785893 -0.866356354838586 +138 0.7160603181741005 -3.5316114730742316 2.8815518324723897 +9 -4.1756988875943195 2.0672991466342374 -0.8825046873416664 +150 1.815083623557248 2.773051884794719 1.9746918971798604 +38 -1.502458122060807 2.504120522003904 3.5630087040476006 +172 2.925371783317832 -4.008067088721308 2.95272814084428 +152 -4.6300230395213555 -1.2429914909034638 -3.848634119515747 +29 2.326120452340355 2.730479927388889 -4.850062460498464 +87 -3.7757652246448092 -2.144244861787354 1.0169754355289107 +93 -2.0873983214067384 0.5358760575940038 -0.23325341995082138 +195 -1.4168233936677792 2.3959259540484603 -2.0506018284590537 +149 2.2841089396850274 0.26447423100144896 -0.8987301521306412 +25 2.8990369033774663 3.4475964151025584 0.06622887609588958 +35 -3.439056984685437 3.8288190767067634 0.5330155111995796 +5 1.1832213107046619 -0.3877998693431248 -1.369194610956917 +116 -2.0849829431786198 -1.7654561629509715 0.6633937705540919 +112 -0.5822227923488573 0.3013831835536517 -4.31387983328802 +132 -4.968232076425547 -0.6461873308157724 3.153818258163696 +173 -2.606365772909947 -3.929167709306097 -2.1504295970222675 +73 1.5595598163445097 -0.6161933298135185 6.6258235518245785 +161 5.1614226588847085 4.911303681383577 3.193451794720913 +78 2.399770604666089 -1.7368694007148553 3.13840955491289 +11 -0.1723279344217883 3.2117525787482495 -5.003125430736541 +84 -3.0246026160032238 -0.10349126829912314 -2.244471367403812 +90 2.2752472907587027 0.5192129247104318 1.739661062051631 +36 3.3131943405122586 -4.945706489020841 0.7304326039438429 +98 2.222390966846857 2.076728811998776 2.745752031197498 +56 3.2308827790046997 2.20226369176158 -0.16256864643069302 +109 -5.432919034165497 -0.6507653252627013 -2.288197504123378 +115 3.2470353212929526 -7.326498442980268 2.0848162375252226 +124 3.23326108206676 -1.3727946801269606 -2.040624527813595 +121 4.263689866797482 2.7161360736926117 -0.9353436003014414 +80 -3.183923910858363 -1.409115057483441 0.20655585479413852 +101 1.8647413072811272 -5.138741167769708 1.449442652238715 +4 -4.059920467104848 2.021712460074869 4.0296908872357 +81 -1.4496413113665318 0.22275997734715647 1.0204012050853233 +6 -2.5319674910604797 2.921972066778776 -0.5937144564354684 +166 -1.7032554189048639 0.4271452228969883 -3.929596648952609 +40 -3.2997667945300786 1.7569019147151133 0.9556994202850172 +127 -4.094479436855724 1.004173845399162 -0.957686162248562 +104 5.839775077994146 0.5614942472461542 1.3388300846640222 +151 0.03681474392662332 4.158212179208171 3.087410074045597 +60 -0.5753595098363337 -1.944185172990125 -8.542198180005448 +168 1.356831683366837 -2.3643099268420564 3.337777267437989 +51 0.594767745409305 2.5443394223058013 -0.5744844027146594 +97 -1.4592614460552826 -2.9896997140291077 4.468909988652328 +103 -1.7464552873436274 -2.725030040682925 -4.682984068370838 +163 -1.6811327453491027 1.203374785043913 -2.52756154734346 +175 -2.36073693749339 -3.2083472883959288 -2.522379591971816 +158 2.0901462213047384 -0.8790568223757592 2.862349710125339 +85 1.6955544698562546 1.329401432748634 1.339424168209504 +63 -0.9387866016534254 -4.101481886236126 2.5768942521591023 +133 -3.3950934863801323 -1.1853227351766746 -0.8938618367927571 +67 -4.93636647331341 -5.808321017441839 -1.5826220082758682 +83 -4.348910184667013 0.5721399223517865 -0.7197270365001088 +162 1.9809720767805532 -3.8356819219002203 -1.5209517397218844 +170 -4.1339290337428345 5.621618700525048 -1.5836709740423311 +181 1.1838126543084162 -1.2107904166348504 5.997389392830687 +71 -3.6322706258882382 0.4573448065249036 -3.4819929402094774 +31 1.5672965345476493 -2.5171072174405418 -5.016079150444441 +139 2.347944365043533 5.087068349207903 -1.4373175728413294 +3 -0.6897541703497496 -5.2109972760726215 -3.1967261285849102 +108 2.1632029794076 -2.3278780023196486 -2.2165896316468543 +16 0.5518752214748219 1.7443113317844785 -0.3914314868799459 +110 0.6545696772446776 -2.3972319991341955 4.869786319607602 +50 3.4589447101316337 -3.631848006300771 3.113137145447494 +191 -1.2968299225913498 0.4433703369757638 -1.5568387599668925 +187 1.9322905031758904 1.7630376183510783 -1.713007037692872 +180 6.8380544057940424 1.3883512491464782 2.155270210489675 +2 -0.9447291546303294 -0.0513923732527517 -3.0672808505869886 +30 1.6158645533289293 3.1155851081317145 -2.1710811001472363 +17 -1.543787339459575 3.1374805002054007 -4.413979305864849 +7 4.040936876599553 1.9639386370487468 3.3637852508743804 +164 1.4392327984967968 -0.8254697339648331 -0.33613984139186426 +69 4.683013019846548 -1.4001774602376138 2.7483283024733463 +61 4.859801586904617 0.3945575299928299 -0.36030106753723035 +34 2.144274218554215 0.30058665232035375 1.6815154302941946 +43 -2.262284846661947 -1.933549681130589 -1.7228919249476684 +177 -0.04379017544723046 -3.0489629385721146 0.8031465712034731 +179 0.1618165357299699 -0.15566873489305255 -1.156913000807537 +27 2.280685460437968 0.25990101487970774 2.9095092475822724 +58 -0.6292223334449243 -1.0309616093739953 -3.156937935356546 +32 -0.011281818866179849 -0.9102886141888968 3.1492471714773824 +26 0.3704942133027209 -1.9855236287495084 -1.1813125622083982 +142 -1.0547774115337973 9.781673444693524 -0.5474605098370294 +100 -2.466739505935093 -2.401234723424822 -0.9166143227115303 +184 0.998183931841219 0.5555844351868584 -0.24866844568146534 +105 -0.9091746414938665 -0.6852682268807229 -0.5049408850325867 +75 -1.2458876998256998 -3.70960636595479 -1.979594195572476 +99 4.943544682867021 -2.8438984768476887 -2.114165836507449 +193 1.6648153391738203 1.9396654116178769 -2.563892949279256 +33 -1.6878161438450656 0.40927910646954185 0.5582734801758544 +79 -3.538909021595642 3.805204310016289 2.7765516255860625 +92 -2.394452859130453 -1.9459314788883335 -4.8163793839903395 +165 5.545976326258468 -1.4902648191681507 -2.852217343260048 +199 6.057154285340822 -2.785333961235231 -3.9368802597200943 +70 4.428171740986177 -4.8728670167946255 3.9631873121213563 +146 3.789706894596731 -0.4960046634434 2.7214958472715947 +106 -0.23074985036276763 -8.713636612175375 4.005748004431039 +52 -0.7237533363087905 4.119548929665377 -2.8963629157006965 +86 -0.7790443173139772 8.632440811261022 1.3650149071424797 +197 1.0158635207501077 -0.6540677867631334 -1.9286092656946883 +185 0.14103906323580015 -1.9230099439242179 -2.9613897973588497 +190 -6.016428738140042 -1.2480913921594763 3.6835279433237065 +145 2.079579027486713 7.671127892348986 -1.2249224435341195 +131 -0.32590310182334836 -2.4757135143210527 -1.108006743304219 +156 1.5441602101522276 -4.3012365664752 2.152192470473115 +10 -1.9251615561320725 7.7941703098856605 1.152489777841718 +196 -2.5417164626144206 -2.322970333327737 6.382288207464665 +143 1.1146704068320736 2.2068798409995507 4.003296941736723 +13 0.2218873541633033 2.002339450538451 -3.9278426768807844 +59 -1.1249725039613747 -1.38236183692768 0.6273981188606278 +186 0.17954184943335427 -2.3932954696372053 -0.7313011465358523 +136 -0.6086309213506338 3.5713339511273894 -3.8080329205654193 +192 -2.4502215368224705 -4.545932925209442 -1.62934516857554 +113 -3.3214500416678074 4.555014566016373 7.353766374710929 +62 -4.358088896189819 -5.982496403026446 2.5501878477362316 +74 -0.5539329584507672 2.794170243271062 -2.161412931865338 +118 -1.979611801168517 3.0336891371182197 1.2515672466968413 +117 -2.6346443065380387 -6.52420382221947 -2.3221165776786097 +23 6.421824321311546 1.7253174765287 -9.160076509970361 +171 2.1156964930224973 3.568443790163169 -3.4488134770961105 +94 2.1701428589622624 4.886850980047828 3.260178593455835 +41 6.033712104492915 2.2785562972718627 -1.4849735175385876 +141 1.4706522295431979 -1.8195923066965298 0.019053288005804775 +159 -4.554564437682667 0.05936456417819991 -1.932073129933284 diff --git a/examples/PACKAGES/pimd/lj/data.metalnpt03 b/examples/PACKAGES/pimd/lj/data.metalnpt03 new file mode 100644 index 0000000000..ca36561e7a --- /dev/null +++ b/examples/PACKAGES/pimd/lj/data.metalnpt03 @@ -0,0 +1,422 @@ +LAMMPS data file via write_data, version 8 Feb 2023, timestep = 100000 + +200 atoms +1 atom types + +-11.876696863105703 11.876696863105703 xlo xhi +-11.876696863105703 11.876696863105703 ylo yhi +-11.876696863105703 11.876696863105703 zlo zhi + +Masses + +1 39.948 + +Pair Coeffs # lj/cut + +1 0.00965188 3.4 + +Atoms # atomic + +39 1 -10.394704135733114 -8.775565826160808 -8.397941096758792 0 -1 1 +57 1 -6.0931281896189695 -9.344348749599556 -7.681818125657076 1 0 0 +82 1 -7.510250310452092 -7.015516388660279 -10.07082880494168 0 0 0 +47 1 -8.77559664157391 -8.051556457641034 -5.414795391990417 1 2 1 +8 1 -7.186535453159322 -11.036850971616609 -10.567777816088821 0 1 1 +49 1 -0.39620530191825165 -8.622783800666731 -7.678166749572666 0 1 0 +184 1 7.393521813917142 -7.373039726272342 -11.446331826056564 0 1 2 +54 1 4.350458272629415 -9.857224313433228 -9.653286924521744 0 -1 1 +114 1 3.8685603455186985 -8.598956542283156 -6.307174409208557 -1 0 1 +128 1 1.5947628847115236 11.435941489344966 -7.415359628481937 0 0 -2 +102 1 2.581923114006006 -6.377657392511939 -10.762619336954629 1 -1 -1 +157 1 6.660414728640671 -6.277919775804619 -7.429265669038422 -1 0 1 +20 1 8.111607396483045 -11.231970200759829 -9.923403990974927 0 1 0 +147 1 10.627447337694411 -5.758860591417452 -9.410039814850826 -1 2 0 +169 1 9.360516562348877 -8.959647419481891 -6.858134439225374 0 1 1 +123 1 -6.81574278381186 -3.257465879140419 -10.90227212401971 -1 0 -1 +182 1 -10.83184823295899 0.6211210726593173 -5.225302920513499 0 1 -1 +130 1 -6.48675645240678 -2.4960330140097717 -7.149887944428669 -1 1 0 +140 1 -9.06689925915267 -1.3404094442689392 -9.265230651366284 -1 1 0 +153 1 -4.596115154274846 -5.2269288210583476 -8.762725686367764 0 1 0 +129 1 -0.18023204267520931 -5.069487595679249 -8.563855383994511 0 1 1 +148 1 -3.129776386379185 -2.132302209017619 -9.812957672584432 0 0 0 +68 1 -2.5326692981381176 -3.433323674590902 -6.08354364753642 0 1 1 +119 1 -3.563878018222407 -3.8548716132518166 10.583657201237452 0 -1 -1 +174 1 3.1103832548223167 -1.970524067942005 -10.720839500990373 -1 1 -1 +134 1 -0.0533798609747933 -0.3943397369034881 -8.568909963478589 -1 0 2 +189 1 2.8780134490012608 -1.3406833227009611 -6.386852522463116 0 0 2 +28 1 6.229563951867086 -1.1530156323854972 -9.327046250788925 0 0 -1 +1 1 7.525938759972945 -2.8198310481116913 -6.5604190503711814 1 -1 0 +24 1 10.94065283830757 -2.1209886921600436 -8.153560298060441 0 -1 1 +89 1 -5.78369558828959 0.914992281244533 -8.554571507812774 0 0 -1 +137 1 -8.18813666088715 3.7027977864495334 -8.645965827566897 -1 1 0 +88 1 -3.2799196205792844 2.576742862817614 -11.027465080959736 0 1 -1 +160 1 -0.2557418723462786 5.44151330793023 -5.976638045093324 0 0 1 +125 1 -3.2953557120100467 3.5116994482831103 -7.1553118740511215 0 1 0 +167 1 2.6725243652102173 2.638087495697569 -7.466301426847419 0 1 0 +107 1 2.5245946528561056 1.4391466346789628 -11.24156229950114 -1 1 1 +45 1 -0.29130191021650537 3.390022307884845 -9.780519849519312 0 1 0 +95 1 7.067732497970006 1.8275651232311958 -11.06782765028197 0 2 -1 +111 1 11.286054617943643 1.4415120259015062 -8.377487796984207 0 1 1 +37 1 7.567677172981714 1.512274859816151 -7.66702414977977 1 0 2 +53 1 9.41684489904846 5.317555173980882 -10.149115122842298 -1 -1 1 +122 1 -8.696560905496263 11.52907921791907 -7.072120720309414 2 -1 -1 +126 1 -8.701961655974642 9.131336810565264 -10.209192118557077 0 0 -1 +72 1 -11.181614439635823 7.328242947804642 10.873052780217858 2 0 0 +144 1 -3.063630044241759 -9.888584626042347 -9.88620302733954 0 1 1 +135 1 -0.011770197460421628 7.809248750526247 -8.433472830923051 1 0 0 +183 1 2.868185059788288 5.159526867067117 -10.074475497261854 0 0 0 +155 1 3.7046375990422384 9.18029420434672 -9.355401725486303 0 0 0 +21 1 6.6545915304717695 6.763201059850044 -8.264144019598284 1 0 0 +66 1 9.504750400993288 7.515486524178964 -6.171582593350192 -2 -1 0 +22 1 11.084351988266622 10.76412261505721 -6.106373064516015 -1 0 0 +42 1 9.142378798766934 9.296638377937079 -10.23790547780751 -1 1 0 +77 1 -6.875408369074396 -10.905367618463075 -3.8927601705390593 1 -1 1 +18 1 -10.586419483635158 -11.318597225412478 -3.865523315987396 1 0 -1 +46 1 11.248362092754824 -7.711534097612761 -3.9950725578324935 1 0 -2 +14 1 -9.503351845338017 -7.486629728113749 -2.029636008930268 -1 0 2 +178 1 -4.577490558383545 -8.077630279121967 -4.852591089043882 2 1 0 +48 1 -3.2127534742600403 -10.982725180284804 -6.34369805529311 1 1 -1 +55 1 -0.9448027936788463 -6.214616210957371 -4.309013304243614 -1 0 -1 +12 1 -1.8077376902517912 -9.51331251139922 -2.294135008818479 -1 0 2 +15 1 6.0707891099498035 -8.158735340051752 0.7389132882736256 -1 0 -1 +64 1 2.744794419170617 -10.568743032836894 -1.6560300803721786 1 1 0 +44 1 8.059994426810258 -6.349491556263628 -3.6188994660194567 -1 0 1 +188 1 10.007211181841205 -8.471311544163584 -0.7301030264655086 -1 0 0 +200 1 -9.361429934020506 -3.325582783501604 -5.251291205351098 -1 0 0 +198 1 -7.206783651218934 -1.1768543952383812 -2.2878728904921033 0 0 1 +76 1 -9.957900853453992 -2.990392708748729 -1.4836790089375538 1 0 0 +194 1 -6.720915931526202 -5.0514840317136205 -2.6178060083265535 0 1 -1 +96 1 -3.442998842345119 -4.030752937282784 -2.1099501345166054 -1 2 0 +104 1 -0.4344464897733502 -0.6370527730950448 -0.3065766310174318 -1 0 -1 +91 1 3.028414651691776 -6.371562707358944 -2.3012007885342207 1 -1 -1 +154 1 -0.18450456920986724 -2.8959245063427446 -2.9727341046372144 -1 2 0 +19 1 3.3110202139376677 -2.0069344123928587 -2.3036519362171575 0 1 -1 +176 1 10.315295502792623 -3.712962672865248 -4.262743726209571 0 0 0 +120 1 6.599910778171431 -2.290014983742207 -2.708516274908039 1 1 1 +138 1 9.70090444039391 -4.510671194156078 -0.7586380570561282 -1 1 -1 +9 1 7.581463530555666 -2.0591591013924426 0.5576192070111965 0 0 1 +150 1 -9.916366847902271 1.9274446583917424 -1.3280546499490278 1 -1 1 +38 1 -5.810864806174543 4.79569434382538 -4.7432663890343605 1 0 2 +172 1 -9.649044476681059 4.000883539130775 -4.9787866594630685 0 0 2 +87 1 -3.293106763914671 -0.9728697280200684 -3.5717383721780784 0 -1 1 +93 1 -6.290260113883048 1.000513447709075 -4.873943848533926 0 -1 1 +195 1 0.9143548729177553 0.18149461265281985 -3.719891858874817 1 -1 3 +149 1 -2.3007300445292564 2.7637958268752776 -2.589523265551314 1 0 0 +25 1 4.621842262318463 1.3043820546828728 -0.6225207492747167 -1 0 1 +35 1 2.847846769015831 3.7484794005209174 -3.7317005078406185 1 -1 0 +5 1 5.76859301522971 1.4821693744986142 -4.192625078793096 0 -1 -1 +116 1 5.980108401532309 5.771931805152196 -4.952107221267599 0 1 0 +112 1 4.9004069037624305 5.449030478588363 -0.25381811981375635 -1 0 0 +152 1 11.427575396440815 -0.5215078327180223 -1.9270850902641319 -2 -1 0 +132 1 8.550991064218966 1.8728424902700131 -1.3413841671493485 0 0 0 +173 1 8.98824885831321 3.8266779448060135 -5.54469830676447 0 0 1 +73 1 -9.970827412932536 8.006037772956901 -6.707069562638264 0 -2 1 +29 1 -7.851850658958549 7.656691482687513 2.2522623824361467 1 -1 -1 +161 1 -11.447924236091708 7.060851422709438 -3.5858559166646984 2 0 2 +78 1 -1.7537678607411138 10.085056705494843 -1.7540835643783588 1 -2 1 +11 1 4.471756401488951 11.779896969440827 -4.946674669424063 0 1 1 +84 1 2.43612195340992 7.404092397911457 -5.290554303714214 1 0 0 +90 1 6.2047805444381146 9.344776673352051 -0.9025295949725489 0 -1 1 +36 1 1.9413202066882462 7.760257880084115 -1.7928253633196454 2 -1 0 +98 1 8.489759189718113 7.59448375625753 -2.9903904190005255 -1 0 0 +56 1 7.283347233840352 10.49272575590101 -6.717344837699539 -1 0 1 +109 1 9.256731562506227 11.306927316729052 -0.9017849515922478 -1 1 1 +115 1 -7.271375340356332 -8.164250984794014 2.885007836656445 1 0 0 +124 1 -11.095529268087242 -8.923461918340646 4.126541576799873 1 0 -2 +121 1 -8.243366755262961 -10.114098944495577 6.642910506934619 0 1 -1 +80 1 -4.970941376701066 -7.256796443574398 -0.2694927115936565 0 0 1 +151 1 0.35720010482862147 -6.473326344145772 0.3145914251441795 0 1 2 +4 1 1.490868001691105 10.008505441456391 4.6538607757363515 -1 -1 -1 +6 1 9.00182583692019 -10.573496261667716 2.7405792887239087 1 1 0 +166 1 -8.709149836110669 -5.121301291304988 4.221356992297617 0 2 0 +40 1 -6.986302058442625 -4.546619094873101 1.2165687777692458 1 1 0 +127 1 -5.703890672733537 -2.4808733861641947 3.9258140668162143 0 -1 0 +60 1 -2.3900969955392997 -2.1240248283806444 5.301270425252238 0 1 0 +168 1 3.975110510651529 -3.4413029165097235 0.7867580630241555 -1 1 -1 +51 1 0.36128571956442473 -3.39012855469405 2.9987895355425387 0 0 -1 +97 1 2.1619059504545017 -0.14370659092792337 2.253550136735452 0 -1 -1 +103 1 4.021656515073349 -0.9827338117732367 6.042568640726292 -1 2 0 +163 1 -10.59690034092717 -2.73669268553396 2.3250010477277816 0 -1 0 +175 1 5.789631011184049 -3.417672117461432 3.9954654049476215 -1 1 0 +158 1 8.907482269205014 -6.491283319059688 2.9624073267859536 -1 0 -1 +85 1 10.197413661591135 -0.012917762754849087 5.257965818060175 1 0 1 +63 1 -8.188715623008076 -0.18029853692280418 1.160315648952679 -1 0 1 +133 1 -10.49518128239182 2.3754251515033395 3.670523930057962 1 1 0 +67 1 -6.57681506296786 3.490338685255813 3.2777499682226248 1 0 0 +83 1 -3.8395282904771557 0.6878472661538524 2.789698047147944 0 -2 1 +181 1 -5.242185082676098 0.757446996867543 5.798435988392239 -1 1 -1 +162 1 0.5730435311953745 0.02538554697642809 6.131446692962922 0 0 0 +71 1 1.5861291557437986 4.031923436354859 -0.5668685974116876 0 -1 -1 +31 1 1.1084648099889496 4.166735507593387 6.199029350547128 0 -2 0 +139 1 3.8934885611865404 3.644680090821751 3.3699758952172827 -1 2 0 +3 1 11.031167120250961 1.2297818113295769 0.8240448962619134 0 -1 1 +108 1 6.151774132335838 0.9127260755469919 3.630865862972541 1 1 0 +16 1 8.948393568215273 3.5697656211117277 4.019424538349256 0 -2 1 +110 1 -11.360902504880006 5.931262380786016 3.1386340545012104 0 0 -2 +50 1 -7.03855700568745 11.1587737863648 4.038018652970141 0 0 0 +191 1 -8.539592833531575 6.98957805034221 5.576163396973422 1 -1 0 +187 1 -10.749591400235348 11.27674482179097 5.078753839959464 1 1 0 +180 1 -1.0497509784332344 6.113751500784257 -1.8125940782158025 1 -1 2 +2 1 -1.7901048404834796 5.395364205758469 2.706946913090345 1 -2 -1 +30 1 -0.609763114135145 8.866708941315338 1.2567907242718874 1 -2 -1 +7 1 4.024360795442131 8.792731325824677 1.6316831819568236 -1 0 1 +164 1 1.9253904296798758 6.2539753963352425 2.2732172727821673 -1 0 0 +69 1 4.589943704480154 6.860175335740237 5.107742575629615 0 -2 -1 +61 1 10.211708813407666 5.048929362482134 -0.6556133826774401 -1 -2 0 +34 1 7.618123086186067 9.260791062852595 2.410253158978456 0 0 -1 +43 1 7.187831963553112 6.047643259558733 2.377231426556367 -1 -2 1 +177 1 8.53679514766192 7.2855280107021585 5.618179930120522 -1 1 -1 +65 1 -10.025744517789033 -8.43398132011017 11.42484399314975 0 -1 -1 +27 1 -10.94664003963282 -11.66367183635281 8.50586002909509 1 1 1 +58 1 -9.736423247717525 -6.9374057905213675 8.120131077653108 -1 0 -1 +26 1 -5.214988898132063 -8.488979255655 9.322140672840906 1 0 0 +142 1 -2.2289627568453696 -6.732212289220556 8.533930418433167 2 1 0 +101 1 -4.332868168974628 -8.046497536008985 4.908195000324994 1 3 1 +100 1 -1.5781140115056829 -10.89378955359733 6.845196027213777 1 2 0 +105 1 1.348709072973532 -7.840212526420486 3.935309569976617 0 0 -1 +75 1 4.538409842632715 -6.347596431637598 5.462073088539682 0 -1 0 +99 1 1.681804464017192 -11.02047184883833 10.743929007254543 0 0 0 +193 1 2.131527690130696 -6.895966349546285 9.427352746134135 1 1 -1 +33 1 4.441375653691135 -11.736850231117081 7.202677955581144 0 -1 0 +81 1 7.255373647519644 -8.53916396071646 6.739789624034124 -1 1 1 +92 1 9.790634573312333 -9.44185811686149 11.159147618448468 0 2 -1 +131 1 11.167512844489337 -5.2910720883824744 6.1780456625725 1 0 0 +32 1 -6.188065315477864 -5.388148534056967 6.4630859734577015 2 1 -2 +165 1 -9.199411318810375 -3.239575676768024 7.39142666230393 0 0 0 +199 1 -6.937479844200535 -4.998516463158538 9.811426478379644 0 -1 1 +70 1 -5.484149755229003 -2.3316100376807256 7.82342156113301 0 1 1 +146 1 -1.4782561675061032 -0.5332293079309558 11.298322053799005 2 1 1 +106 1 -1.299565649633866 -2.547377817344993 8.672457149378053 0 0 -1 +86 1 5.4346476876843255 -4.567525864857576 8.586496749161867 -1 0 1 +52 1 0.6258963928325112 -3.6737913184680213 11.408468473681546 0 0 0 +197 1 1.6655903827098761 -4.690360650696893 7.1487356646988935 -1 0 -1 +185 1 2.1215529597432052 -0.6042753779764993 10.00914541981377 -2 1 -2 +145 1 7.122063254971888 -3.6848122349525525 -11.806135592932787 -1 -2 0 +156 1 -5.464187808325629 -0.39192954326422935 11.38371879051662 0 -1 -1 +10 1 -9.035521158465771 -0.7757159430461369 4.809652747733452 0 0 2 +196 1 -9.335669158910619 0.22813232884729473 8.66176404595545 1 2 1 +143 1 -7.124352690053236 3.030922198080938 8.687337455424057 1 0 0 +13 1 -11.772101478818819 3.2748279418542197 6.990058907086091 -1 -1 1 +170 1 -2.6686912671072918 4.2637019013785284 6.493175161410804 -1 1 -2 +59 1 -3.414884055242947 1.7144589247064204 9.304818354414252 1 -1 1 +190 1 7.431647314963107 -0.2323681547056703 9.930387554553988 0 0 -1 +186 1 0.12403907626679356 2.5751847736553266 9.610847507588266 1 1 0 +136 1 3.4038632456152635 2.1695685652264665 7.948376142475482 0 -1 -3 +62 1 3.9322597596563718 6.930006246409542 8.985009369790514 1 0 0 +192 1 10.419594684028056 2.5035467156582776 9.806945423286493 1 1 1 +113 1 7.193391146269118 2.2362428283193516 6.875806515902987 -1 -1 -1 +179 1 11.834426610265067 -11.194697762969987 -10.475928756799647 -1 3 2 +74 1 -8.13998220698503 9.794354756748188 9.006589181804868 1 -1 0 +118 1 -11.66384578850255 8.468830152015009 7.042404750007243 0 1 0 +117 1 -5.315240522733173 11.32072783429444 7.576721087819581 -1 -1 0 +23 1 -5.138619088737474 5.725030905668137 11.239725943022542 0 0 -2 +171 1 -4.330917401708549 7.140228396638214 7.942565065680071 0 2 -2 +17 1 -2.03596415813805 8.313925455397243 5.2823718467129375 -2 0 -1 +94 1 0.5232518791432845 9.687616975679045 9.044820921363916 -1 0 0 +79 1 8.56918534055184 11.565534359174451 5.948120961320791 -1 0 0 +41 1 5.45739715811315 11.541960137674769 11.642369134799488 0 0 -1 +141 1 9.892948341443592 5.76405276568962 9.068370836458591 1 -1 -1 +159 1 9.60684214528172 9.743113663992652 9.758679903521092 0 -1 0 + +Velocities + +39 -2.179321628468343 1.1511761233721014 -0.5234785181560597 +57 -6.53120961304823 2.2544161501487334 -1.2373865721091248 +82 -1.0543302569480935 -1.2919030991113425 -2.688794866729753 +47 1.4420685217894869 -0.5747049377538087 0.6848122481945966 +8 2.36242269061923 3.5603470370323436 1.4936669774368116 +49 -0.6083156247744255 -1.170955618423765 -3.8346753413107364 +184 3.2429732085760055 -3.3821697881066015 -7.235911314720436 +54 -3.6115695852161833 0.0106170916100512 5.665158101271987 +114 6.929262289695876 4.643270489304085 -2.432510904848287 +128 3.7837119455630903 -0.5425190416852157 -0.9248832742343969 +102 -5.730330621950312 2.5925672733788283 -4.330025077474401 +157 -0.16543207126613158 -3.935307993847579 1.876153422628358 +20 -2.5674917416750285 7.261116339316168 -0.2822364811608604 +147 3.957269802164221 -0.44334252499690296 1.8428688293334772 +169 -0.43761432062493966 -2.7004091328373003 -1.9616354437812995 +123 0.4419336641195504 1.661879969268821 -0.34576656499174563 +182 -2.755633666515818 2.89026397900542 -3.3064689855078004 +130 0.4228585869964945 -2.6339270059626747 2.3472759619296717 +140 -2.5258615952943133 4.5464360654810925 -2.960299517136603 +153 2.614799199811544 -6.997005129983971 -0.4675266931999429 +129 -1.0794701392816852 -0.7999027589273617 -1.3594765973927763 +148 -2.5441459127388772 -5.738540142837333 1.2458734580393733 +68 -0.8806574381084391 3.664356747058979 4.498638804868755 +119 1.348535842985886 -1.9096618944303452 1.6705192446304495 +174 0.23536625265167066 3.432430764653958 -0.9841797613553105 +134 0.26301203065712264 2.9239481371691687 4.198089422305616 +189 -5.106229336056745 1.3598593078850199 -5.0921887654096665 +28 -0.5789581538284776 4.678352716038949 1.6083556088979694 +1 4.3168451733041335 -0.8087879863432109 -1.1510010508143134 +24 4.684129190758672 0.5864820180144825 1.3599272674223446 +89 1.2931815025110984 -1.7192563446283065 -3.2675358462468287 +137 -2.489381057507014 1.3936843668930472 -3.4953181455890334 +88 5.564916491075967 0.8520321811715912 -4.447122865446203 +160 -0.07033878109043368 2.2522705799844327 1.9030072089658323 +125 -1.5185131407725638 0.6804743431846004 -2.389477187487043 +167 -3.6035218377687275 -1.9787464624356907 1.2495634883162925 +107 -4.50061384293538 -4.128984940089246 -1.940600692273992 +45 -2.0130680589133294 1.0097638511181886 -1.9327875523898734 +95 -1.8894050626509937 -4.373548537324043 0.32709687823368594 +111 -4.9090211058158335 -4.89034728498546 -4.4838347069372535 +37 -0.7827825654937912 0.2606671310038102 1.2648209822548744 +53 -3.3248176554427693 -1.934526339006954 -2.2700456945424197 +122 2.3544797713703187 -0.1174286295452037 -1.1080357975092663 +126 -1.8232106805443349 -4.42954489421542 3.9468260248902474 +72 -0.3083487798866145 7.089424978098924 -4.065977117594069 +144 -3.209546353795563 2.7953912155418355 -1.9419952653204642 +135 2.825460830342647 -1.3242735854960683 -1.061464548303972 +183 -0.6219322132099675 4.350176294595897 -3.2016653855084876 +155 -4.16183730251878 -4.394917007094668 3.143265712814128 +21 1.042679461197399 -3.76474130433989 3.307467644481217 +66 -0.5660353999856405 -0.9094642274226821 -0.5314610131608182 +22 -1.709804393279522 2.6955272721787336 6.847933865416769 +42 1.5723865718421481 1.2482884329237185 2.4822430118654624 +77 1.0256281250413677 0.6998122284735013 2.9532003047278765 +18 -3.421972744387341 -0.5274519950694775 -4.133682641337289 +46 2.168436016686143 1.0804778012063694 -4.320033516090909 +14 -4.0164283054824255 0.49834440962343196 -0.8290451948901274 +178 -1.7412819488092 2.798973205265782 -0.479900827844132 +48 -0.555572193190021 -2.2271111327857946 -5.48753500392571 +55 -0.2945098160209474 -2.3597197684570634 -1.323571695006608 +12 2.648780275608345 -5.627798255886156 3.878499085658468 +15 5.08064047237585 10.983886551374368 -3.8614562219189974 +64 4.528407739688303 3.5669581487847277 -1.59783436247384 +44 0.6179240842533569 4.733042665051045 3.2581525303469463 +188 -7.148050937863482 -0.9829624495370496 -0.8418403492142479 +200 -2.1181786226695647 -0.7796260516164706 -2.0505857854477805 +198 -0.41864716042364125 2.296081055566785 0.29109905683884685 +76 3.589037248934578 3.9784201870774147 -0.18396191505765547 +194 3.2793423730519953 -0.6090514771278666 -3.4934826993710537 +96 -1.781539941975932 -4.363514711154816 4.864062078072237 +104 1.408163209882818 -2.2024070797001714 1.13197301326935 +91 0.7549842936282545 -1.8949946215618456 -1.0202618871629823 +154 -3.58496442590166 0.6965660533263317 -1.9948941159972786 +19 1.1538547086598117 4.352147462832853 0.5698931598819479 +176 6.6158635134989 -2.4436529370166666 -7.921148144074609 +120 1.9770896033272432 5.325440429480748 0.4321682589452387 +138 -2.434142355712014 -4.211844174503549 3.7463686848024356 +9 -7.9556317081134775 1.3611081846148716 1.1973651519179334 +150 7.132627873294173 -1.1589700932996243 -0.3531633921451265 +38 -2.373885424533282 -1.6670776794732187 7.126244784839699 +172 -4.190332426742245 1.4971407429268737 -2.1038522992559976 +87 3.8705371644824407 0.6946282376038537 -0.5718475935933448 +93 1.3514689577122314 2.2886635029067657 1.1457291529838165 +195 0.8294761589431854 6.809445622982572 -4.490681006002271 +149 4.665694837020095 -3.8971221183097815 -7.000247317496072 +25 -1.4227504585025186 2.666757793916314 -4.2485642256584795 +35 2.0433487025942068 2.1539055294115 -2.682708261193331 +5 -3.648704562720594 -0.39330823945136234 0.15528838477335327 +116 2.764952659364006 3.2308857608345534 -0.538944143891585 +112 1.7976356559372615 -1.540357698562047 -2.170928793825917 +152 -2.4572877205036923 -1.6206485240807629 -4.85936004694647 +132 4.802107956404735 -0.11013197470116909 0.6674735986355181 +173 -0.7045077946396323 0.6277364102624156 1.4282110726540087 +73 -3.4535983591604964 -1.3273163733693092 3.631166806617851 +29 -5.742750315320132 4.210335165654985 -3.183862358662845 +161 0.7207671082657183 -2.639249856838032 1.2031913703667394 +78 1.9802499580941673 3.892356471093276 -6.0300544674355 +11 0.3710597317170738 3.014897507875772 7.0674999285689495 +84 0.06314153271125988 -4.938702818012672 2.3405049696166014 +90 -3.021721770486999 0.5895782968475963 -0.883462541486843 +36 0.6115261475891951 3.326758596635819 5.305093464697983 +98 -3.289247327924386 -0.7716659861479829 -0.8061979190797803 +56 -2.484208615656381 -0.7583806019455193 2.000293738990754 +109 4.065544877208817 -0.31468790514138334 0.3860037578404895 +115 -1.5583103456503846 -4.034490286401138 0.5420000897756707 +124 2.716664944254732 1.195693130251065 -1.0534283229167152 +121 8.492299287405391 -0.8573607139000322 2.0906896396885357 +80 -4.269726737071596 1.290253084422534 1.3756246647776993 +151 0.17922239204385892 -5.243344038190157 -1.7214465623209987 +4 -1.5287457726003018 4.545253326761756 0.4075652200807629 +6 -5.5555965267113505 5.196757149002673 -2.131768740002899 +166 3.8192709965319924 8.287983828276944 -1.2203929922517287 +40 3.450300769917062 1.3679263003539135 -5.713912913407013 +127 -1.8550057408599427 0.2529213554001156 4.292787610095508 +60 -0.4570467791684108 2.1995625338737512 0.38684023826685754 +168 -1.1461639744415708 -3.7753008221986715 -0.7069362633693567 +51 4.246427854086795 2.2660286121479016 -0.17525536000106454 +97 -0.45920058079801923 2.3672214881822935 2.918793131685986 +103 2.8457407886760415 5.079818233132883 -1.6831372889932052 +163 6.588786306029201 2.961102097923318 0.12898108224833468 +175 -0.7784000842847736 0.05239163186710383 4.783927411692968 +158 1.324975092911766 5.716483065795907 -2.766582829578808 +85 1.126575470046233 1.8878210873276244 -0.3160540074040886 +63 0.26385610607819265 -1.0518690744177137 4.681584068045189 +133 -0.8004471826186864 6.474544076922776 1.4133211461125943 +67 3.6157553514613374 3.5767340310447207 0.22045279936244222 +83 -1.0062072078141164 -6.493845317833074 -5.600689394569981 +181 -1.9698774782124704 -2.4967875449198838 -1.482046688397622 +162 -2.904567214261779 4.609525946829769 -4.773883794319192 +71 4.704149679704777 3.1523586525426124 4.57547323305684 +31 -1.5901553457672002 -3.05689507101266 2.2039810687618497 +139 -2.695407001366337 2.151237461783768 -2.283708689815052 +3 -0.46766817551787454 -3.140857693103965 0.4361924390516714 +108 0.1913617703423478 -2.71581239158428 0.6724779385423365 +16 -0.5574602967458635 2.869089341747036 3.246617986586125 +110 -3.2935781644783413 -4.906537822882089 2.429950659174858 +50 1.3517081278566716 0.7979565345760338 -0.4185472621695281 +191 -6.186669509381163 1.5069910278978673 -3.122140179713244 +187 0.8559064953620825 0.3957056787517148 0.9088293844669495 +180 0.221714052316844 3.344232199120801 0.5800459730217239 +2 2.3994296631460794 -2.8375195813060388 -1.0887178593496891 +30 1.2210690766888224 3.5899619104376446 0.08151741673684687 +7 2.7726111769463913 0.687615055956059 0.37410979119832144 +164 -1.1931898641891907 -1.3539824930215878 -3.3405462160564703 +69 1.9731979197688503 -3.2571194324245205 1.6749831681024951 +61 3.1823016504442476 -3.0315743307115213 0.8747268024881065 +34 0.42940760329491323 -0.8546757769020348 0.7046464666351262 +43 -1.2834304624987016 -0.32585553857664296 0.40311374457538895 +177 -4.156106157869977 -1.1691085227558309 4.764406539360629 +65 0.7459698348800096 2.6999150256104985 -3.5548113977053744 +27 1.2331887682296838 -1.694381902758542 0.04304965560826135 +58 -6.154057979578904 -0.19938148972279413 -3.4163165607386854 +26 2.910747146350628 -2.990465499480819 -1.5258142005591657 +142 -2.6857404309480515 -0.4742647340730133 0.8619212003727141 +101 0.8564696967146533 -2.0546263222545185 5.004696469365843 +100 1.7773361390238631 3.5466656645190247 -4.741841979587642 +105 5.236015515046745 -7.745834640119119 -2.0944663177984997 +75 3.19034440896343 4.856191854526413 0.20239301909347396 +99 0.7372059827598996 0.8218000327204846 1.1962914445625328 +193 -5.54751039136509 -0.8984829893317632 -0.09804506747660646 +33 -0.9015609488918586 2.8634014710755875 -0.5142897564939601 +81 -4.226349362632615 0.4990338142221863 -3.177351469506789 +92 4.852938979419456 -0.5312580038435196 0.4444574326006344 +131 -6.780942865007681 0.2505331120455996 2.984671966978939 +32 2.043323184339133 -2.0915365663642502 0.3570674081797969 +165 1.772621337461088 5.624086428613788 -2.1958779155861525 +199 -4.655961690467214 -1.5582587292151853 -1.0372922469851396 +70 2.1009520029345854 -3.4367267457669444 0.3489118952393979 +146 1.1094627356046975 -3.7052416904893786 3.1151669468585044 +106 0.9244635796842038 -0.8697076449017062 -1.1271268628891515 +86 -2.4614440724404063 -1.1443915951868173 3.0472327038543923 +52 2.206997554373295 0.48895638167295574 7.813903343751546 +197 -4.43947099244034 0.3827402537789232 -6.114284477117655 +185 1.8450115502667273 -3.367103363338241 -2.7646657581326055 +145 -4.495233666659511 1.3255674480674051 -1.5848168476287035 +156 -1.1061826790673608 3.490100920043544 1.7425058587963753 +10 0.10888349121518726 -2.3346954910750384 0.3634642612209191 +196 -1.237862986215301 2.306399540514406 -5.426709024577362 +143 1.387043305733553 -2.3787136376519027 -0.20756141146550633 +13 2.2357687358768974 1.685714857075964 2.2457142840004356 +170 5.1889099023089535 2.9826822454922652 1.0755609101553643 +59 -1.712405925615148 -2.553137012160255 0.03926835373766702 +190 -1.7274645985224364 -0.0964601276780217 -0.8892867639051387 +186 -0.5051041743099376 2.0346977046537615 2.086897795173162 +136 1.6635288094047165 0.5254443611211371 1.8199836517530088 +62 0.7708640981248649 0.12152082573932288 1.7717141492471689 +192 -1.0422128532558474 -4.04447955732469 -1.926662726630305 +113 -4.472429838979146 -6.765621050808509 -3.003588999898843 +179 -1.7067254128417755 -7.980317775082368 -0.9140818138687279 +74 3.515578700667397 -5.09057685611017 -2.4373465493326076 +118 -3.836950473028625 -4.398228703366778 -0.9008313748045251 +117 1.2669363304661976 0.4817377004658103 -1.5641060379969072 +23 -3.023411190495862 0.4127754096885368 0.24116380806370397 +171 0.782437003849918 2.278657242176388 -1.477387925776958 +17 0.8979396881179555 -2.2139965953711083 -0.9661842759619532 +94 -2.2083649456241576 -0.3520697824173402 6.939477089019811 +79 -5.097477099334401 -1.1053765447054356 -0.5927717885602897 +41 2.717742851180541 -0.8197068618726784 -1.1670313842646072 +141 1.3223712852080913 -1.1251601779570968 2.4100632027817 +159 -3.979797713933269 1.5260607907829866 1.4624579807682239 diff --git a/examples/PACKAGES/pimd/lj/data.metalnpt04 b/examples/PACKAGES/pimd/lj/data.metalnpt04 new file mode 100644 index 0000000000..7fcb4a8bac --- /dev/null +++ b/examples/PACKAGES/pimd/lj/data.metalnpt04 @@ -0,0 +1,422 @@ +LAMMPS data file via write_data, version 8 Feb 2023, timestep = 100000 + +200 atoms +1 atom types + +-11.876696863105703 11.876696863105703 xlo xhi +-11.876696863105703 11.876696863105703 ylo yhi +-11.876696863105703 11.876696863105703 zlo zhi + +Masses + +1 39.948 + +Pair Coeffs # lj/cut + +1 0.00965188 3.4 + +Atoms # atomic + +39 1 -10.354249178970125 -8.813051919915168 -8.382969093379817 0 -1 1 +57 1 -6.095139656027609 -9.359263918713493 -7.698842353606457 1 0 0 +82 1 -7.493664607592135 -7.0059769885785474 -10.165574967227153 0 0 0 +8 1 -7.207830943811267 -11.030802786228156 -10.545758277848378 0 1 1 +49 1 -0.3707760358866739 -8.703874147846175 -7.734231800660862 0 1 0 +54 1 4.371171010756674 -9.822286390366472 -9.608608173022526 0 -1 1 +114 1 3.857478702816806 -8.583003039261015 -6.26115845444949 -1 0 1 +128 1 1.580452299690882 11.414121196534609 -7.383200117467098 0 0 -2 +102 1 2.6350731915864145 -6.397417482172074 -10.801961817246344 1 -1 -1 +157 1 6.611187455803048 -6.205022609136458 -7.392834911294685 -1 0 1 +20 1 8.102933091687992 -11.214330088075124 -9.936524774492973 0 1 0 +147 1 10.596045290286296 -5.759130098910738 -9.380762680610847 -1 2 0 +169 1 9.366630474689176 -8.921006522319503 -6.843673029579733 0 1 1 +123 1 -6.859009660270495 -3.2379537512590297 -10.864178266429683 -1 0 -1 +130 1 -6.577322046738903 -2.5106835965921164 -7.224326100490352 -1 1 0 +140 1 -9.107723436323155 -1.3229863757258506 -9.244986454221655 -1 1 0 +153 1 -4.548656766959874 -5.17967134910819 -8.787434718939945 0 1 0 +129 1 -0.17808656259561137 -5.023072792674526 -8.617493408883192 0 1 1 +148 1 -3.2601725736553027 -2.033844854035978 -9.777384129731104 0 0 0 +119 1 -3.5689822234610595 -3.8505044768944927 10.627709646886371 0 -1 -1 +174 1 3.140197534695247 -1.913882100151838 -10.76389374977719 -1 1 -1 +134 1 0.048608226174046365 -0.39555664243276595 -8.555122102444741 -1 0 2 +189 1 2.8889478385298655 -1.3768037709890826 -6.4534432907832056 0 0 2 +28 1 6.251824687614619 -1.150087307901578 -9.266876365488919 0 0 -1 +1 1 7.556173300837827 -2.8495110668506705 -6.5781416096142475 1 -1 0 +24 1 10.885498404916829 -2.163413929107282 -8.181530231530648 0 -1 1 +176 1 10.317143708012939 -3.6994503272775026 -4.285905348037859 0 0 0 +182 1 -10.866713794399553 0.5835390862478285 -5.190897922574198 0 1 -1 +137 1 -8.197336531384668 3.7710266805092836 -8.628333311872499 -1 1 0 +89 1 -5.830740775393367 0.9227024639457406 -8.56962226272939 0 0 -1 +88 1 -3.2174671278447153 2.596119117918313 -11.010039397757382 0 1 -1 +160 1 -0.16353319092958282 5.356569592952759 -6.027400461354258 0 0 1 +125 1 -3.2660565494911986 3.5402608994580014 -7.139474945270797 0 1 0 +107 1 2.5004686193441863 1.4213418016161157 -11.264390107008213 -1 1 1 +167 1 2.6306438675911963 2.7047021139073024 -7.49322777752869 0 1 0 +45 1 -0.26576210897417507 3.3660903959893673 -9.858663372020018 0 1 0 +95 1 7.02981932063029 1.8215081284089933 -11.08913793230704 0 2 -1 +111 1 11.249280516767561 1.4119125550850526 -8.355555586118154 0 1 1 +37 1 7.519477058425284 1.5490589443573544 -7.629176894794767 1 0 2 +53 1 9.42047942911636 5.244187392085703 -10.133263719784543 -1 -1 1 +122 1 -8.63992654505136 11.450404981587694 -7.075458716341785 2 -1 -1 +126 1 -8.723342916981192 9.13102883296233 -10.17466547482745 0 0 -1 +72 1 -11.206699277582317 7.297248005363309 10.79372604446887 2 0 0 +144 1 -3.0607758424636864 -9.877816322452732 -9.947243110943289 0 1 1 +135 1 -0.051808796348424835 7.83802622288054 -8.426793042584595 1 0 0 +183 1 2.8265474855254293 5.2650728973076095 -10.056888138059385 0 0 0 +155 1 3.7333346013160673 9.271985029918303 -9.380687277523048 0 0 0 +21 1 6.713007344355741 6.806136281598503 -8.223321187919673 1 0 0 +66 1 9.521874492322397 7.474069880889854 -6.18586873962963 -2 -1 0 +22 1 11.050170157856584 10.74761987425433 -6.194431008418831 -1 0 0 +42 1 9.124991617085433 9.313926068749339 -10.259091612355418 -1 1 0 +77 1 -6.847598261663958 -10.941109014822928 -3.892206492676891 1 -1 1 +47 1 -8.72137736883077 -8.020553455249186 -5.411695457067339 1 2 1 +46 1 11.333911554840483 -7.659682887184623 -4.080815689532784 1 0 -2 +18 1 -10.646224114047842 -11.295142102189118 -3.8769976756703564 1 0 -1 +14 1 -9.605745944890806 -7.401374860679573 -1.982921039201294 -1 0 2 +178 1 -4.564495057067056 -8.050510749495825 -4.8659978849512635 2 1 0 +48 1 -3.165816579392377 -10.956276319999837 -6.319173483966388 1 1 -1 +55 1 -0.9801312338979216 -6.257580408615657 -4.2669674058977485 -1 0 -1 +12 1 -1.844858616965503 -9.490670669998687 -2.2961766563429364 -1 0 2 +15 1 6.049786455655653 -8.189634166823847 0.7790760301881896 -1 0 -1 +64 1 2.7732180154018238 -10.586600242266561 -1.7220526985868578 1 1 0 +44 1 7.987685169786731 -6.317537693048875 -3.624602682973471 -1 0 1 +188 1 9.985693632064716 -8.552544016815117 -0.7260907476837022 -1 0 0 +200 1 -9.468913996814749 -3.332006112139499 -5.219156914346259 -1 0 0 +198 1 -7.176651640198091 -1.1963525306783946 -2.253714347543795 0 0 1 +76 1 -9.922127224407973 -2.9538091484944595 -1.5482866071777552 1 0 0 +194 1 -6.755129554954018 -4.9982944036574395 -2.6156955876752477 0 1 -1 +68 1 -2.4837259122195063 -3.490803572414407 -6.114089975980331 0 1 1 +96 1 -3.411864655652117 -4.073235933810771 -2.067669105620388 -1 2 0 +91 1 3.0280594613502636 -6.3376596415711255 -2.326898295867128 1 -1 -1 +154 1 -0.19811764587289105 -2.9629996027018635 -2.9145103486688195 -1 2 0 +19 1 3.201765959673939 -2.0909064907714274 -2.3150720129859153 0 1 -1 +120 1 6.666250093808799 -2.2381082538053363 -2.826357084420522 1 1 1 +138 1 9.709412364194842 -4.510669257803851 -0.7371785941816178 -1 1 -1 +9 1 7.576584804759921 -2.0173260225381977 0.5837619474494389 0 0 1 +150 1 -9.925148350003655 2.008414757334357 -1.3585989335940631 1 -1 1 +38 1 -5.774540065294694 4.703952130507923 -4.709776738882269 1 0 2 +172 1 -9.650643801070206 4.065753015545833 -4.8890536457268325 0 0 2 +152 1 11.354703841174967 -0.5574832611945055 -1.878354960063874 -2 -1 0 +29 1 -7.8756923654824735 7.618259977195223 2.1884603240114373 1 -1 -1 +87 1 -3.3182201208100697 -0.9619504843434044 -3.571516039019219 0 -1 1 +93 1 -6.22447967806385 0.9237017015404234 -4.899961705314269 0 -1 1 +195 1 0.9557760919893532 0.18190089307880442 -3.7530657563825116 1 -1 3 +149 1 -2.258211757279497 2.7869892960968605 -2.6067337721972543 1 0 0 +25 1 4.582659783463335 1.197304704789868 -0.6333382889463834 -1 0 1 +35 1 2.8340362437473665 3.775198295599683 -3.7220216498098746 1 -1 0 +5 1 5.712702262390174 1.525516395213053 -4.231454437885219 0 -1 -1 +116 1 5.993880302160488 5.819609728686341 -4.981314501727478 0 1 0 +112 1 4.993891288991353 5.44294004315121 -0.20000094912971011 -1 0 0 +132 1 8.553215140035688 1.848923908331039 -1.3929852223418029 0 0 0 +173 1 9.058614097754903 3.793989570565648 -5.529277027531151 0 0 1 +73 1 -9.97609370360327 8.001052498887105 -6.678871508542809 0 -2 1 +161 1 -11.443764897577033 7.1235053711641685 -3.5412879782897306 2 0 2 +78 1 -1.7946589875472476 10.140074782001498 -1.7188309657767924 1 -2 1 +11 1 4.48445505597226 -11.863465860429208 -4.995823112103199 0 2 1 +84 1 2.463379766571318 7.427030445050496 -5.251636426023569 1 0 0 +90 1 6.171978058160043 9.299313343642424 -0.9265676065333643 0 -1 1 +36 1 1.9133463519046003 7.719511929183511 -1.7420567765226709 2 -1 0 +56 1 7.255050752153057 10.433125182056429 -6.693622072998551 -1 0 1 +109 1 9.138840387988623 11.32849279657362 -0.9075432219499753 -1 1 1 +98 1 8.493633429672352 7.664253543281429 -2.9150549381854445 -1 0 0 +115 1 -7.310435599643078 -8.126317136056372 2.852881189844054 1 0 0 +124 1 -11.031652111608674 -8.829616358814924 4.11892916031843 1 0 -2 +121 1 -8.24719811507558 -10.102559907485395 6.644774570363861 0 1 -1 +80 1 -4.990158022745006 -7.228416620009519 -0.23616829431627906 0 0 1 +101 1 -4.425835217027135 -8.041862792922046 4.912842377205241 1 3 1 +4 1 1.6093443070111064 10.036215537003722 4.649624528139505 -1 -1 -1 +6 1 8.957102959942503 -10.648514255179037 2.7520244907338807 1 1 0 +81 1 7.208459443972924 -8.512507364143946 6.7186127098675 -1 1 1 +166 1 -8.735612761804596 -5.051940162290023 4.287135452158321 0 2 0 +40 1 -7.0154409632766175 -4.6058645552640805 1.2332349553758588 1 1 0 +127 1 -5.628166701486109 -2.4571683554307384 3.9074191001707503 0 -1 0 +104 1 -0.4346324933964958 -0.6513905925349095 -0.2958543835790408 -1 0 -1 +151 1 0.3877075536664327 -6.4007225085014845 0.24945488280004469 0 1 2 +60 1 -2.369840965541917 -2.0961144039265633 5.2852382593681435 0 1 0 +168 1 3.911007973828095 -3.389123300929967 0.7576129789066393 -1 1 -1 +51 1 0.3292384996563097 -3.420112775820937 2.935489834742583 0 0 -1 +97 1 2.1485649172664862 -0.10439592636417316 2.279403065792625 0 -1 -1 +103 1 4.042877904485135 -1.0208892892284567 6.118986931410435 -1 2 0 +163 1 -10.685207062128164 -2.805182722090798 2.2992408280776737 0 -1 0 +175 1 5.777080728790477 -3.428422767297768 3.9500489905592655 -1 1 0 +158 1 8.901770795533949 -6.449835056793116 2.8925949474189174 -1 0 -1 +85 1 10.225188926473791 0.0017773278841735195 5.209115671649155 1 0 1 +63 1 -8.213348572388885 -0.1729333455438991 1.128439638194422 -1 0 1 +133 1 -10.560391258433501 2.3871994933981604 3.6217764405881163 1 1 0 +67 1 -6.58893267726452 3.5537178434565275 3.2475644463629347 1 0 0 +83 1 -3.8515887631140515 0.6260605243857498 2.809794279660778 0 -2 1 +162 1 0.5353669870800427 0.011171969691910696 6.140615526988775 0 0 0 +170 1 -2.6982076482868784 4.239239002024167 6.5023488926564 -1 1 -2 +181 1 -5.269736706670749 0.6633143508889567 5.80856876438175 -1 1 -1 +71 1 1.6280398876142836 3.9922472717626896 -0.5550063690378906 0 -1 -1 +31 1 1.1405250667226041 4.200703300864838 6.2167435118694465 0 -2 0 +139 1 3.842562548009269 3.6547622321511497 3.2913955399115533 -1 2 0 +3 1 10.98202973743475 1.2548431833407037 0.9250033618641567 0 -1 1 +108 1 6.094576089388102 0.9247979169923504 3.624011344184912 1 1 0 +16 1 8.94421023892344 3.592040529277952 3.968834804835023 0 -2 1 +110 1 -11.386726712959288 6.012786074810452 3.1335330551037686 0 0 -2 +50 1 -7.019873322974002 11.162655244151733 4.132863440221239 0 0 0 +191 1 -8.58859990391919 7.042920679843704 5.549588183323656 1 -1 0 +187 1 -10.694945657883851 11.280545373237025 5.089277301544773 1 1 0 +180 1 -0.9832322177090624 6.17374336331137 -1.7810168677844587 1 -1 2 +30 1 -0.5786545001726999 8.92644611919124 1.2001444343316763 1 -2 -1 +2 1 -1.7987623083026563 5.385135175592104 2.641095387043805 1 -2 -1 +17 1 -1.9803131781320147 8.340104277288379 5.2339610584552005 -2 0 -1 +7 1 4.056078571838132 8.755054555667046 1.7129552906297647 -1 0 1 +164 1 1.8606879960472185 6.264401812470137 2.238048307949188 -1 0 0 +69 1 4.582260343749063 6.901308432226479 5.16724455389889 0 -2 -1 +61 1 10.203999344055715 5.098875037493535 -0.6552273031803888 -1 -2 0 +34 1 7.6452062423181015 9.296589241677342 2.4017008610787727 0 0 -1 +43 1 7.186240451053859 6.044802069738282 2.458597580290494 -1 -2 1 +177 1 8.52522272174418 7.310838340899178 5.550705478002598 -1 1 -1 +179 1 11.738401405730409 -11.171052154041227 -10.46073671167246 -1 3 2 +65 1 -9.923794257190753 -8.360277300667597 11.397343948439744 0 -1 -1 +27 1 -10.96202039046517 -11.679459496759502 8.461761452894827 1 1 1 +58 1 -9.782820449181592 -6.900116722543098 8.161461366886957 -1 0 -1 +32 1 -6.176757614808324 -5.427580338396943 6.37353314773015 2 1 -2 +26 1 -5.244950495195521 -8.48903289150118 9.276610316099598 1 0 0 +142 1 -2.2192381371286913 -6.710860567512032 8.5692633945157 2 1 0 +100 1 -1.5829434980745454 -10.919909502588283 6.783259906533759 1 2 0 +184 1 7.415704119987677 -7.40752254135457 -11.394836902247562 0 1 2 +105 1 1.324436294552863 -7.868824845245506 3.928981783067961 0 0 -1 +75 1 4.559950916659301 -6.316720857110099 5.422215632967026 0 -1 0 +99 1 1.6556187341181972 -11.042676696296036 10.823511254079808 0 0 0 +193 1 2.1147403084852634 -6.885083505075134 9.409447220216105 1 1 -1 +33 1 4.45464187128425 -11.736247949088288 7.271061852952995 0 -1 0 +79 1 8.565919655629239 11.638486198403275 5.960760377855752 -1 0 0 +92 1 9.769060714231218 -9.492631803351557 11.102372610406375 0 2 -1 +165 1 -9.212711733999253 -3.259454828813142 7.377981593005203 0 0 0 +199 1 -6.873376106851867 -4.9933518932685566 9.87422952115871 0 -1 1 +70 1 -5.445601633222862 -2.349920544152827 7.807205278865663 0 1 1 +146 1 -1.4368974006040247 -0.5526263308116413 11.329045170425331 2 1 1 +106 1 -1.320489681644758 -2.525949605897458 8.649126125808394 0 0 -1 +52 1 0.6432865601156172 -3.653577986848175 11.390625659771409 0 0 0 +86 1 5.463936380191402 -4.545155299286932 8.600558169678536 -1 0 1 +197 1 1.6297777023246702 -4.6288437196490895 7.127308915254101 -1 0 -1 +185 1 2.117376701545396 -0.6740584604995838 9.981858778655166 -2 1 -2 +190 1 7.391326441541653 -0.2420688149799064 9.912167028101104 0 0 -1 +145 1 7.1433612487852685 -3.600502105720082 -11.787138473864353 -1 -2 0 +131 1 11.237287581981867 -5.265986055819216 6.2884198947288406 1 0 0 +156 1 -5.499196268975016 -0.3842368684419455 11.47923685297254 0 -1 -1 +10 1 -9.091750969544233 -0.8101391784724588 4.798103517685853 0 0 2 +196 1 -9.331229431870144 0.22379652065858124 8.694495890506026 1 2 1 +143 1 -7.138465404537655 3.0174764853722347 8.68001066247089 1 0 0 +13 1 -11.76499693524697 3.321385859999623 6.936314787144568 -1 -1 1 +59 1 -3.4402166179497833 1.730296081472357 9.358944812035546 1 -1 1 +186 1 0.1617283142132493 2.5970365582430226 9.662083422391825 1 1 0 +136 1 3.4199513038280873 2.163828872826315 7.95543255977617 0 -1 -3 +62 1 3.963989117283031 6.890950850270743 8.983560199060738 1 0 0 +192 1 10.513433172209162 2.5350934882928264 9.78265608934408 1 1 1 +113 1 7.161285582100181 2.2124289355489886 6.79272048842973 -1 -1 -1 +74 1 -8.169335431227 9.77557136132564 9.00057456275031 1 -1 0 +118 1 -11.608821137521177 8.521503367814617 7.013321378357836 0 1 0 +117 1 -5.327579617349453 11.314505774662308 7.558097527322893 -1 -1 0 +23 1 -5.129126916477775 5.721102420605024 11.278247239081892 0 0 -2 +171 1 -4.352281149020513 7.112600115001591 7.871167109278595 0 2 -2 +94 1 0.5998107735037941 9.708724091432982 9.014903980367055 -1 0 0 +41 1 5.4449659738536695 11.522021070488632 11.662868284303414 0 0 -1 +141 1 9.872190892571076 5.7761026505659245 8.948318084922565 1 -1 -1 +159 1 9.641274357072867 9.726441601090215 9.76145240542319 0 -1 0 + +Velocities + +39 2.577793097354695 -3.3983788380629387 0.9311775479132861 +57 0.044350439903272976 -2.756321060337954 -1.0428315092461067 +82 -2.504296787676701 -3.6468474399030493 0.2541672097953289 +8 3.6367927137204146 -0.708503612114486 -3.734398328076926 +49 1.8873851156019454 -1.4752561333771483 0.44317628658177016 +54 2.0609459874818237 -3.7591063995516816 6.295629243534251 +114 5.3525465279303015 -3.959388563871946 6.9201302420483755 +128 1.2908060914043953 -2.111376197467554 -0.48873831716967264 +102 -4.571293842871747 8.300052861760934 -2.8260260042769847 +157 0.6864784580965262 2.3741938996988416 3.197851910441299 +20 4.652994650182517 -2.368616661754701 -3.6239824640674376 +147 2.3112278761829046 2.7926157746726785 0.3841905616879638 +169 3.8809056176148298 -3.783797831749185 1.5132762830383186 +123 1.2907138384495385 4.5605260997379515 6.265572889261794 +130 2.3899251274818005 0.27666961403153456 4.415473432866114 +140 1.0077403345435272 3.331618501750946 3.823686801783437 +153 -4.158360194263056 -0.05792314282326738 -0.09170129980331274 +129 -2.0924141264102167 -2.229463311149641 5.774701380963026 +148 4.419535691773222 -2.221801500903651 -1.322900377568077 +119 3.3013302732178436 1.0440417527080033 2.8019660816699443 +174 1.8865107534171663 4.984254074383621 -4.4680569390231515 +134 -3.051462360151183 0.13872483873263985 0.8334720216492622 +189 -1.575075881871396 1.8217362685289014 -2.0444979947436 +28 3.421168174684726 -5.498073809092277 -0.04014458535812704 +1 1.9883484696931384 -5.62737172391044 -0.6897496957906657 +24 -1.2667871307922316 4.30277534955836 -0.9434339008200991 +176 5.33889839399068 -0.7261935889242956 -1.0648636501642632 +182 -1.3434249574772492 -1.2612974855392476 -0.8264254407007674 +137 1.9669241314073078 1.4304166951432975 -0.7941330665668798 +89 3.0037245881229415 0.2485958612228784 0.43340084246330035 +88 -4.773290068397481 -4.145612735120506 2.9587651882723076 +160 3.2238819912540246 1.454427974780249 -0.8931785023147302 +125 -2.027584749577839 0.2846539404784728 -1.9747515011844237 +107 -0.4309962618034694 -3.6977689727188716 -1.9008509957370174 +167 1.1593622921328293 -1.8699221821464713 -0.35243227029296986 +45 3.8023301775972866 1.4226356824680009 0.7412574800338123 +95 -6.444883722807761 -0.36547146467399716 -2.3313614045704956 +111 2.654717565255864 1.4059595144409067 -0.8812624422906502 +37 2.6344865612342447 3.1241557322031097 0.21727945365726709 +53 -1.162490586497141 -1.8114743286402544 -3.3819238034771355 +122 -0.39245032082132514 6.341371204609977 0.15639083036810653 +126 -1.605697227924968 4.594486921923675 2.22444280178021 +72 5.553154164868334 -1.6002168773168566 2.986954509825138 +144 1.3403843285320132 -1.7279031413546053 1.3999311572505995 +135 2.534876793407053 -3.9801581090182863 3.1492981080983657 +183 -4.679242103632781 2.993032322724656 -1.3277928954591556 +155 2.478325342602548 0.096505570078343 0.23454435113676975 +21 -3.5229231861916004 -3.9816529561376006 0.026639755919907415 +66 -4.078355783351698 -0.12178976416838905 3.6922808103625115 +22 -3.6395126219587364 -6.832262596301959 1.5951115669463118 +42 -4.403508549300507 -1.075423056570003 -0.591849033607009 +77 -3.529890611915624 -4.75010415058562 1.6925557776838493 +47 -2.1850961781212535 0.29268584139732723 -6.145825548126078 +46 4.627258609793938 -0.35735610275796525 -4.228603145133978 +18 3.73167019444449 -0.1412650186120299 1.8269713694609548 +14 4.255528637119755 -1.6399584278487664 -2.3670010206718466 +178 -5.547816263652345 -3.2716811779531016 0.3760629173372536 +48 4.425750039051989 -1.6380895084775802 3.0834785539819825 +55 0.9664608309050373 -3.9279561872107216 3.738153737041613 +12 -0.41819517254673283 0.9367025298427245 1.548662259471958 +15 -1.5561256264944465 -1.7138464717908113 -5.214325558070718 +64 -4.340047339400262 -2.22675786620723 -1.8953705605237372 +44 1.1388904606478099 1.1952052434483869 -4.7138321817777165 +188 -0.6813174034115439 -5.349606335139992 -0.5494798369887832 +200 4.5313662932423755 -1.509632335926491 -0.7143667001741889 +198 -0.147474124917653 -4.398760900940008 -1.3829542092135303 +76 3.499335281047853 4.321577651994544 1.8422196851357424 +194 0.40702093571028386 2.536045454224767 -0.25948941675872716 +68 1.095513798887539 6.302453994563069 -0.032465133466722085 +96 -0.8025115532160563 4.133456324521671 -0.3987555142125939 +91 -1.0924701330602116 -4.134760716625712 -2.5476966892452007 +154 -0.6420195815805342 0.5441210237991451 -2.4764714848254394 +19 -6.45757006657402 -1.8917738383254377 -2.2385612755611657 +120 -2.333329676155747 -2.6263663088962446 -0.31608193981125454 +138 -4.2274347886527295 -5.149547905719161 0.18051226809116783 +9 1.9482438581325014 1.836033317169747 4.767132863545005 +150 1.9981648567087547 6.350098740087899 -2.8565846607881165 +38 0.7805411976234249 3.2336875919271204 -5.491325260091564 +172 -1.6067207370017498 -4.025457011374177 3.328473783113818 +152 1.2783569248468387 1.1836235305806408 -2.8398807957375904 +29 0.012522208655832867 -2.202968899510487 1.2653923818179775 +87 2.4301555960867915 -0.3844922649780862 2.3653616101850643 +93 -0.8167645337546143 7.0869554155527865 -0.992159930343214 +195 1.386850643478473 -2.1138124263507945 -2.6343099572277926 +149 -1.9222490388239173 -2.9269314999007365 1.9288615526733388 +25 -3.59971099165819 -1.6866464810245103 1.7143969426226588 +35 1.1068675504822845 2.9570865620910163 1.5489285873628789 +5 -0.06525583154753622 4.64663174535613 0.0051166703840210825 +116 -2.156521693342489 -1.106530196750272 -0.7392284182460408 +112 0.8256766355184204 -3.3427544054629896 2.364051175484082 +132 2.1070952059277808 -0.7636208241660348 -2.901239577070981 +173 0.9555468923097092 0.9205686685241707 -3.199573856104545 +73 1.5067078955449293 -1.4433124895723743 -1.0680684282081363 +161 2.1775187990003184 -2.0432036406877887 -2.502427749527437 +78 0.4277549814794872 0.923985061568942 -4.462582084674592 +11 -0.7883572752861073 -3.298996571191427 5.184829507433079 +84 -0.3908120720288031 0.8981771084266208 2.781123174827333 +90 0.1806374932457661 1.6703751943299625 2.7208543462130645 +36 -1.267739998375956 2.1167954160312523 -2.3987528368253503 +56 0.42755132352919767 0.3105230600944311 -0.03753157138922093 +109 1.9130458422765049 -2.4592218292820647 -3.7955776970359176 +98 2.224412680285525 2.8105570053709483 -6.007751163289515 +115 -2.8264888701698423 -6.77384783439804 -4.5128631453140455 +124 1.0115631212847158 2.197697811017366 -1.4884565302411554 +121 1.819952585372025 2.133685315101777 -0.48009196690211353 +80 3.6825834395072827 2.9369744584874624 0.7772431106319383 +101 3.8152106585296663 -0.7504695117106335 -1.3678083578602058 +4 1.1543968705285124 3.6108919626584783 1.279726012491966 +6 -2.734554328800396 0.45690265044985007 1.7653493310436426 +81 2.173385375162031 -1.545557384488483 -2.635973810143899 +166 -1.239464711076861 1.3504238003340796 -0.49024226288977 +40 1.7898346069542372 -0.4474778752941201 3.4790111502788887 +127 1.6296109635966738 0.6612604860538578 5.807821273928263 +104 -4.901664479006097 1.1052244598202794 3.4465808005881824 +151 -3.983151444075344 -3.2501191110732113 -1.2526584841338049 +60 -1.922006700361108 -0.7785585059363819 -4.390434339117124 +168 -2.788478664171041 3.923738577427861 2.49523972250301 +51 -1.6149322848467969 -3.4296394320723262 4.226459281197094 +97 -1.226730421851149 -2.392775221203476 5.070036120535187 +103 -2.9962982871055357 -2.90339448475708 -1.1348192929647936 +163 0.3128021577268095 -4.112121184421586 2.47129388197539 +175 -4.72131850682648 -1.6008946774115904 -3.6054426092000593 +158 -5.274680729271083 -0.4457302148856164 4.174272671309751 +85 2.9757034033315444 -0.5103121033627565 1.99919210117291 +63 1.600933165736236 1.4604641421860185 5.197681341346513 +133 0.3650834395918216 4.123541846312257 2.1615515366543354 +67 2.0607792864448453 2.3124375339420076 0.21959246817514527 +83 -6.156022387564482 -1.1548915743184078 -0.4948872456362283 +162 -2.1450070724040025 3.9286059442169066 2.007885747151935 +170 1.8166139807691821 -1.95234066921456 -1.8559861240898843 +181 -1.587457433365127 -3.2094890956838205 2.212401241994942 +71 1.7829689662908779 -3.6713609566551657 1.3773962271622693 +31 3.918178411733008 -0.5772484115851036 0.16726508680219976 +139 -4.560722486125075 -0.5471630166750243 5.863010868871481 +3 -3.9686726349917825 3.6173076990026054 2.5273959166862507 +108 0.3042801304200664 4.847444330423647 -0.35518169829313484 +16 -2.4685650045584717 5.98056595230015 0.9384145704518219 +110 -0.6129548866614436 1.8199747299312752 -0.6050782543434758 +50 -1.8884152067915962 -1.4877561250799833 -3.9811275374353494 +191 1.500896458072849 -1.9099553342822155 -5.024921011162899 +187 -2.013243274912701 -0.8604266013822317 -1.038480536601888 +180 1.4966822969502809 2.2104050426784707 3.732721924128324 +30 -2.3551911487538373 -1.0313809690434763 -1.4871503115129143 +2 2.4972367326603697 -1.5125466361921762 1.0762650051734106 +17 0.43112912988867413 -1.9548201848493156 -0.43017998184207773 +7 6.622180146484479 4.7673609572662725 0.19425898871224434 +164 2.301415823751322 0.4827221772498991 4.559127095693677 +69 -3.4364505629674733 -1.1594038113628669 -1.2078137888752072 +61 1.7869953777023173 0.9935547623401149 0.14745693195171444 +34 -0.027807484985171937 -3.1354780466577754 -1.036977576868685 +43 -1.3037743820903311 -5.61028065095172 -4.306710886889687 +177 2.1781720801097206 -1.516912077043328 -2.054689845757315 +179 0.4934049365569875 -4.8639422788504625 -6.225153590664796 +65 2.6970228261721383 0.19294320506195817 6.683323231860031 +27 -1.6731814501881797 0.7519385590564082 3.2183027406212203 +58 -0.7774753429967389 -0.6669437971456971 3.5183225900940927 +32 -5.389835933890947 -0.4954507654154201 0.4594525916972694 +26 0.7382474998065096 -3.102724138188651 -2.185686698723454 +142 -1.944479379421283 -1.2761486898263725 0.72348529709274 +100 -2.739025692998968 -2.6245009262596986 3.182008026346906 +184 1.4210317521782347 3.1395926369797884 5.319543188841913 +105 -1.2308708716614136 -1.2494207925918743 -3.3415190888725443 +75 -1.8835854547991517 -1.3807763884880995 3.052239941977269 +99 2.3501462152911015 -0.09098282020287418 -2.963130739502538 +193 3.2483282921859455 -6.045063326765766 -1.2297831607518321 +33 -1.5552221515820004 2.623852853566988 -0.3953508079233695 +79 2.0518370606822334 1.899510113710928 2.0859744201323727 +92 1.5026700715390955 0.9352029472761221 -5.528904283783295 +165 -2.240438523644089 -0.6103912799862421 0.40653914875448993 +199 -1.2653571662196268 3.710626862073433 1.4730516528440072 +70 1.655492430853343 0.17760859693009826 -1.650919734678463 +146 -1.4225048482747793 2.74232833480091 -3.413198079564811 +106 -1.093901348299414 0.20953760114868714 -0.7298112830112282 +52 6.647000075136453 -0.30141024565553315 1.2035752428962934 +86 0.6741589587443484 4.365068713763016 3.5677961016049315 +197 -0.666824417721529 0.7257967702216201 6.272517109849018 +185 -1.1845876194928404 2.1001111189632264 2.457366035714506 +190 -1.6517508143986053 2.271851696760304 3.7976228734124575 +145 -0.6660913411508007 -2.1887913545610314 1.427073342591097 +131 3.4923356345857024 1.8910870819349503 0.22757964871813297 +156 1.3901143776938099 -0.5912367128957199 -1.945898273856384 +10 -3.3254266550003906 2.363446512042732 -2.8505669909097167 +196 1.9772342503358795 2.9791453967072834 5.0702556945320305 +143 1.3619198656944898 -4.070780999483669 0.554762511858757 +13 -3.6607073229889986 -6.103961980753075 3.3895476442791126 +59 1.3424546798513801 -0.012418821554116527 -1.0607350515292961 +186 -0.19147109350375446 -0.14042042908600805 -5.06183250631794 +136 10.318783006250738 -0.33198398090799297 -3.1695432610471372 +62 -0.9320061937291512 -8.919718141167188 -1.0031472261072583 +192 -6.036717500669019 -0.4626110813075395 -5.283002697165421 +113 -1.9312339562598033 1.2868323831429733 -0.27836767602350954 +74 0.289298974376203 4.639184114550362 -1.3074893268836063 +118 2.3186362762712704 0.014757210175651903 -1.9096714905556824 +117 2.917320124569121 -0.927139463682407 -2.038093079844118 +23 3.445296199640721 -2.484450168397722 6.150025302403371 +171 -1.3488599922862394 -0.40015537573335275 5.541824987776105 +94 2.7016234671889183 -4.500360725821148 -0.3771036206116729 +41 0.040051409073174504 1.3144504850460685 -2.628956804481983 +141 0.8101589418958534 -0.40901282998394567 2.3777914588666906 +159 -2.168905163137191 -3.9077440516609387 3.1238186982134213 diff --git a/examples/PACKAGES/pimd/lj/in.lmp b/examples/PACKAGES/pimd/lj/in.lmp new file mode 100755 index 0000000000..9670225958 --- /dev/null +++ b/examples/PACKAGES/pimd/lj/in.lmp @@ -0,0 +1,28 @@ +variable ibead uloop 99 pad + +units metal +atom_style atomic +atom_modify map yes +boundary p p p +pair_style lj/cut 9.5251 +read_data data.metalnpt${ibead} + +pair_coeff * * 0.00965188 3.4 +pair_modify shift yes + +mass 1 39.948 + +timestep 0.001 + +velocity all create 0.0 ${ibead} + +fix 1 all pimd/langevin ensemble npt integrator obabo thermostat PILE_L 1234 tau 1.0 temp 113.15 iso 1.0 barostat BZP taup 1.0 fixcom no + +thermo_style custom step temp f_1[*] vol press +thermo 100 +thermo_modify norm no format line "%d %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f" + +dump dcd all custom 100 ${ibead}.xyz id type xu yu zu vx vy vz ix iy iz fx fy fz +dump_modify dcd sort id format line "%d %d %.16f %.16f %.16f %.16f %.16f %.16f %d %d %d %.16f %.16f %.16f" + +run 1000 diff --git a/examples/PACKAGES/pimd/lj/run.sh b/examples/PACKAGES/pimd/lj/run.sh new file mode 100644 index 0000000000..2580ef1a41 --- /dev/null +++ b/examples/PACKAGES/pimd/lj/run.sh @@ -0,0 +1 @@ +mpirun -np 4 $LMP -in in.lmp -p 4x1 -log log -screen screen From 0dd8a6aea2e9183a4b88d13cf36de3307851ae9f Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Mon, 20 Mar 2023 14:27:58 -0400 Subject: [PATCH 034/172] add document for keywords of fix pimd/langevin --- doc/src/fix_pimd.rst | 48 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 28a5308dd7..d6808add44 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -24,7 +24,7 @@ Syntax *method* value = *pimd* or *nmpimd* or *cmd* *fmass* value = scaling factor on mass *sp* value = scaling factor on Planck constant - *temp* value = temperature (temperarate units) + *temp* value = temperature (temperature units) *nhc* value = Nc = number of chains in Nose-Hoover thermostat * keywords for style *pimd/langevin* @@ -35,8 +35,8 @@ Syntax *integrator* value = *obabo* or *baoab* *fmmode* value = *physical* or *normal* *fmass* value = scaling factor on mass - *temp* value = Temperature (temperarate unit) - Temperature = target temperarate of the thermostat + *temp* value = Temperature (temperature unit) + Temperature = target temperature of the thermostat *thermostat* values = style seed style value = *PILE_L* seed = random number generator seed @@ -180,6 +180,38 @@ The keyword *sp* is a scaling factor on Planck's constant, which can be useful for debugging or other purposes. The default value of 1.0 is appropriate for most situations. +The keyword *ensemble* for fix style *pimd/langevin* determines which ensemble is it +going to sample. The value can be *nve* (microcanonical), *nvt* (canonical), *nph* (isoenthalpic), and *npt* (isothermal-isobaric). + +The keyword *temp* specifies temperature parameter for fix styles *pimd/nvt* and *pimd/langevin*. It should read a +positive floating-point number. +.. note:: + For pimd simulations, a temperature values should be specified even for nve ensemble. Temperature will make a difference + for nve pimd, since the spring elastic frequency between the beads will be affected by the temperature. + +The keyword *thermostat* reads *style* and *seed* of thermostat for fix style *pimd/langevin*. *style* can only +be *PILE_L* (path integral Langevin equation local thermostat, as described in :ref:`(Manolopoulos) `), and *seed* should a positive integer number, which serves as the seed of the pseudo random number generator. + +.. note:: + The fix style *pimd/langevin* uses the stochastic PILE_L thermostat to control temperature. This thermostat works on the normal modes + of the ring polymer. The *tau* parameter controls the centroid mode, and the *scale* parameter controls the non-centroid modes. + +The keyword *tau* specifies the thermostat damping time parameter for fix style *pimd/langevin*. It is in time unit. It only works on the centroid mode. + +The keyword *scale* specifies a scaling parameter for the damping times of the non-centroid modes for fix style *pimd/langevin*. The default +damping time of the non-centroid mode $i$ is $\frac{P}{\beta\hbar}\sqrt{\lambda_i\times\mathrm{fmass}}$ (*fmmode* is *physical*) or $\frac{P}{\beta\hbar}\sqrt{\mathrm{fmass}}$ (*fmmode* is *normal*). The damping times of all non-centroid modes are the default values divided by *scale*. + +The barostat parameters for fix style *pimd/langevin* with *npt* or *nph* ensemble is specified using one of *iso* and *aniso* +keywords. A *pressure* value should be given with pressure unit. The keyword *iso* means couple all 3 diagonal components together when pressure is computed (hydrostatic pressure), and dilate/contract the dimensions together. The keyword *aniso* means x, y, and z dimensions are controlled independently using the Pxx, Pyy, and Pzz components of the stress tensor as the driving forces, and the specified scalar external pressure. + +The keyword *barostat* reads *style* of barostat for fix style *pimd/langevin*. *style* can +be *BZP* (Bussi-Zykova-Parrinello, as described in :ref:`(Parrinello1) `) or *MTTK* (Martyna-Tuckerman-Tobias-Klein, as described in :ref:`(Tuckerman2) `). + +The keyword *taup* specifies the barostat damping time parameter for fix style *pimd/langevin*. It is in time unit. + +The keyword *fixcom* specifies whether the center-of-mass of the extended ring-polymer system is fixed during the pimd simulation. +Once *fixcom* is set te be *yes*, the center-of-mass velocity will be distracted from the centroid-mode velocities in each step. + The PIMD algorithm in LAMMPS is implemented as a hyper-parallel scheme as described in :ref:`(Calhoun) `. In LAMMPS this is done by using :doc:`multi-replica feature ` in LAMMPS, where each @@ -314,4 +346,12 @@ Path Integrals, McGraw-Hill, New York (1965). .. _Manolopoulos: -**(Manolopoulos)** M. Ceriotti, M. Parrinello, T. Markland, D. Manolopoulos, J. Chem. Phys. 133, 124104 (2010). \ No newline at end of file +**(Manolopoulos)** M. Ceriotti, M. Parrinello, T. Markland, D. Manolopoulos, J. Chem. Phys. 133, 124104 (2010). + +.. _Klein: + +**(Klein)** G. Martyna, D. Tobias, M. Klein, J. Chem. Phys. 101, 4177 (1994). + +.. _Tuckerman2: + +**(Tuckerman2)** G. Martyna, A. Hughes, M. Tuckerman, J. Chem. Phys. 110, 3275 (1999). \ No newline at end of file From 3d47c5c6f0fccaf27bf9d81a74df25d29856ab2e Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Tue, 21 Mar 2023 08:38:14 -0400 Subject: [PATCH 035/172] add x/y/z barostating options --- src/REPLICA/fix_pimd_langevin.cpp | 86 ++++++++++++++++++++++--------- src/REPLICA/fix_pimd_langevin.h | 4 +- 2 files changed, 65 insertions(+), 25 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index e1d3960a50..d64d948ecf 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -101,6 +101,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : tau = 1.0; tau_p = 1.0; Pext = 1.0; + pdim = 0; pilescale = 1.0; tstat_flag = 1; pstat_flag = 0; @@ -112,7 +113,11 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : int seed = -1; - for (int i = 0; i < 6; i++) p_flag[i] = 0; + for (int i = 0; i < 6; i++) + { + p_flag[i] = 0; + p_target[i] = 0.0; + } for (int i = 3; i < narg - 1; i += 2) { if (strcmp(arg[i], "method") == 0) { @@ -199,9 +204,29 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[i], "iso") == 0) { pstyle = ISO; Pext = utils::numeric(FLERR, arg[i+1], false, lmp); + p_target[0] = p_target[1] = p_target[2] = Pext; + pdim = 3; } else if (strcmp(arg[i], "aniso") == 0) { pstyle = ANISO; + p_flag[0] = p_flag[1] = p_flag[2] = 1; Pext = utils::numeric(FLERR, arg[i+1], false, lmp); + p_target[0] = p_target[1] = p_target[2] = Pext; + pdim = 3; + } else if (strcmp(arg[i], "x") == 0) { + pstyle = ANISO; + p_flag[0] = 1; + p_target[0] = utils::numeric(FLERR, arg[i+1], false, lmp); + pdim++; + } else if (strcmp(arg[i], "y") == 0) { + pstyle = ANISO; + p_flag[1] = 1; + p_target[1] = utils::numeric(FLERR, arg[i+1], false, lmp); + pdim++; + } else if (strcmp(arg[i], "z") == 0) { + pstyle = ANISO; + p_flag[2] = 1; + p_target[2] = utils::numeric(FLERR, arg[i+1], false, lmp); + pdim++; } else if (strcmp(arg[i], "taup") == 0) { tau_p = utils::numeric(FLERR, arg[i + 1], false, lmp); if (tau_p <= 0.0) error->universe_all(FLERR, "Invalid tau_p value for fix pimd/langevin"); @@ -243,6 +268,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : fixedpoint[0] = 0.5 * (domain->boxlo[0] + domain->boxhi[0]); fixedpoint[1] = 0.5 * (domain->boxlo[1] + domain->boxhi[1]); fixedpoint[2] = 0.5 * (domain->boxlo[2] + domain->boxhi[2]); + if (pstat_flag) { p_hydro = (p_target[0]+p_target[1]+p_target[2])/pdim; } // initialize Marsaglia RNG with processor-unique seed @@ -670,8 +696,15 @@ void FixPIMDLangevin::qc_step() if (barostat == BZP) { for (int i = 0; i < nlocal; i++) { for (int j = 0; j < 3; j++) { - x[i][j] = expq[j] * x[i][j] + (expq[j] - expp[j]) / 2. / vw[j] * v[i][j]; - v[i][j] = expp[j] * v[i][j]; + if (p_flag[j]) + { + x[i][j] = expq[j] * x[i][j] + (expq[j] - expp[j]) / 2. / vw[j] * v[i][j]; + v[i][j] = expp[j] * v[i][j]; + } + else + { + x[i][j] += dtv * v[i][j]; + } } } oldlo = domain->boxlo[0]; @@ -762,7 +795,7 @@ void FixPIMDLangevin::press_v_step() if (pstyle == ISO) { if (barostat == BZP) { - vw[0] += dtv * 3 * (volume * np * (p_cv - Pext) / force->nktv2p + Vcoeff / beta_np) / W; + vw[0] += dtv * 3 * (volume * np * (p_cv - p_hydro) / force->nktv2p + Vcoeff / beta_np) / W; if (universe->iworld == 0) { double dvw_proc = 0.0, dvw = 0.0; for (int i = 0; i < nlocal; i++) { @@ -777,22 +810,25 @@ void FixPIMDLangevin::press_v_step() MPI_Bcast(&vw[0], 1, MPI_DOUBLE, 0, universe->uworld); } else if (barostat == MTTK) { mtk_term1 = 2. / atom->natoms * totke / 3; - f_omega = (volume * np * (p_md - Pext) + mtk_term1) / W; + f_omega = (volume * np * (p_md - p_hydro) + mtk_term1) / W; vw[0] += 0.5 * dtv * f_omega; } } else if (pstyle == ANISO) { compute_stress_tensor(); for (int ii = 0; ii < 3; ii++) { - vw[ii] += - dtv * (volume * np * (stress_tensor[ii] - Pext) / force->nktv2p + Vcoeff / beta_np) / W; - if (universe->iworld == 0) { - double dvw_proc = 0.0, dvw = 0.0; - for (int i = 0; i < nlocal; i++) { - dvw_proc += - dtv2 * f[i][ii] * v[i][ii] / W + dtv3 * f[i][ii] * f[i][ii] / mass[type[i]] / W; + if (p_flag[ii]) + { + vw[ii] += + dtv * (volume * np * (stress_tensor[ii] - p_hydro) / force->nktv2p + Vcoeff / beta_np) / W; + if (universe->iworld == 0) { + double dvw_proc = 0.0, dvw = 0.0; + for (int i = 0; i < nlocal; i++) { + dvw_proc += + dtv2 * f[i][ii] * v[i][ii] / W + dtv3 * f[i][ii] * f[i][ii] / mass[type[i]] / W; + } + MPI_Allreduce(&dvw_proc, &dvw, 1, MPI_DOUBLE, MPI_SUM, world); + vw[ii] += dvw; } - MPI_Allreduce(&dvw_proc, &dvw, 1, MPI_DOUBLE, MPI_SUM, world); - vw[ii] += dvw; } } } @@ -811,12 +847,14 @@ void FixPIMDLangevin::press_o_step() MPI_Bcast(&vw[0], 1, MPI_DOUBLE, 0, universe->uworld); } else if (pstyle == ANISO) { if (universe->me == 0) { - r1 = random->gaussian(); - r2 = random->gaussian(); - r3 = random->gaussian(); - vw[0] = c1 * vw[0] + c2 * sqrt(1.0 / W / beta_np) * r1; - vw[1] = c1 * vw[1] + c2 * sqrt(1.0 / W / beta_np) * r2; - vw[2] = c1 * vw[2] + c2 * sqrt(1.0 / W / beta_np) * r3; + for (int ii=0; ii<3; ii++) + { + if (p_flag[ii]) + { + r1 = random->gaussian(); + vw[ii] = c1 * vw[ii] + c2 * sqrt(1.0 / W / beta_np) * r1; + } + } } MPI_Barrier(universe->uworld); MPI_Bcast(&vw, 3, MPI_DOUBLE, 0, universe->uworld); @@ -1145,7 +1183,7 @@ void FixPIMDLangevin::remove_com_motion(){ int nlocal = atom->nlocal; if (dynamic) masstotal = group->mass(igroup); double vcm[3]; - group->vcm(igroup,masstotal,vcm); + group->vcm(igroup,masstotal,vcm); for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { v[i][0] -= vcm[0]; @@ -1329,15 +1367,15 @@ void FixPIMDLangevin::compute_totenthalpy() volume = domain->xprd * domain->yprd * domain->zprd; if (barostat == BZP) { if (pstyle == ISO) { - totenthalpy = tote + 0.5 * W * vw[0] * vw[0] * inverse_np + Pext * volume / force->nktv2p - + totenthalpy = tote + 0.5 * W * vw[0] * vw[0] * inverse_np + p_hydro * volume / force->nktv2p - Vcoeff * kBT * log(volume); } else if (pstyle == ANISO) { totenthalpy = tote + 0.5 * W * vw[0] * vw[0] * inverse_np + 0.5 * W * vw[1] * vw[1] * inverse_np + 0.5 * W * vw[2] * vw[2] * inverse_np + - Pext * volume / force->nktv2p - Vcoeff * kBT * log(volume); + p_hydro * volume / force->nktv2p - Vcoeff * kBT * log(volume); } } else if (barostat == MTTK) - totenthalpy = tote + 1.5 * W * vw[0] * vw[0] * inverse_np + Pext * (volume - vol0); + totenthalpy = tote + 1.5 * W * vw[0] * vw[0] * inverse_np + p_hydro * (volume - vol0); } /* ---------------------------------------------------------------------- */ diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index b8bed1a10f..6d236718c7 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -126,8 +126,10 @@ class FixPIMDLangevin : public Fix { double f_omega, mtk_term1; int pstat_flag; // pstat_flag = 1 if barostat is used int pstyle; // pstyle = ISO or ANISO (will support TRICLINIC in the future) - double W, tau_p, Pext, totenthalpy, Vcoeff; + double W, tau_p, Pext, p_hydro, totenthalpy, Vcoeff; + int pdim; int p_flag[6]; + double p_target[6]; double vw[6]; // barostat velocity double ke_tensor[6]; // kinetic energy tensor double c_vir_tensor[6]; // centroid-virial tensor From f94bea8d972d1f6f7064ebf599283a2d6b89e9d7 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Tue, 21 Mar 2023 09:22:37 -0400 Subject: [PATCH 036/172] correct fix pimd/langevin example file permission --- examples/PACKAGES/pimd/lj/in.lmp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 examples/PACKAGES/pimd/lj/in.lmp diff --git a/examples/PACKAGES/pimd/lj/in.lmp b/examples/PACKAGES/pimd/lj/in.lmp old mode 100755 new mode 100644 From 2cb9d2784bd3522911a456029ad3fd7b21f8522a Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Tue, 21 Mar 2023 09:23:04 -0400 Subject: [PATCH 037/172] add false_positive for fix pimd/langevin doc --- doc/utils/sphinx-config/false_positives.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 0f18e6822f..e8544a8975 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -2017,6 +2017,7 @@ Marchetti Marchi Mariella Marinica +Markland Marrink Marroquin Marsaglia @@ -3577,6 +3578,7 @@ THz Tigran Tij Tildesley +Timan timeI timespan timestamp @@ -4071,4 +4073,5 @@ zu zx zy Zybin +Zykova zz From 32efa1a3af3462c740afd90a1c2fdbbd02ef1e91 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Tue, 21 Mar 2023 09:23:22 -0400 Subject: [PATCH 038/172] update fix pimd/langevin doc --- doc/src/fix_pimd.rst | 87 +++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 38 deletions(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index d6808add44..4d72d7232f 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -30,7 +30,8 @@ Syntax * keywords for style *pimd/langevin* .. parsed-literal:: - *keywords* = *method* or *integrator* or *ensemble* or *fmmode* or *fmass* or *scale* or *temp* or *thermostat* or *tau* or or *iso* or *aniso* or *barostat* or *taup* or *fixcom* or *lj* + *keywords* = *method* or *integrator* or *ensemble* or *fmmode* or *fmass* or *scale* or *temp* or *thermostat* or + *tau*or or *iso* or *aniso* or *barostat* or *taup* or *fixcom* or *lj* *method* value = *nmpimd* *integrator* value = *obabo* or *baoab* *fmmode* value = *physical* or *normal* @@ -43,7 +44,7 @@ Syntax *tau* value = thermostat damping parameter (time unit) *scale* value = scaling factor of the damping times of non-centroid modes of PILE_L thermostat *iso* or *aniso* values = Pressure (pressure unit) - Pressure = scalar external pressure of the barostat + Pressure = scalar external pressure of the barostat *barostat* value = *BZP* or *MTTK* *taup* value = barostat damping parameter (time unit) *fixcom* value = *yes* or *no* @@ -85,7 +86,7 @@ by the following equations: H_{eff} = & \bigg(\sum_{i=1}^P \frac{p_i^2}{2M_i}\bigg) + V_{eff} \\ V_{eff} = & \sum_{i=1}^P \bigg[ \frac{mP}{2\beta^2 \hbar^2} (q_i - q_{i+1})^2 + \frac{1}{P} V(q_i)\bigg] -$M_i$ is the fictitious mass of the $i$-th mode, and m is the actual mass of the atoms. +:math:`M_i` is the fictitious mass of the :math:`i`-th mode, and m is the actual mass of the atoms. The interested user is referred to any of the numerous references on this methodology, but briefly, each quantum particle in a path integral @@ -109,8 +110,9 @@ would be 3 x N x P x Nc. Fix *pimd/nvt* implements a complete velocity-verlet integrator combined with NH massive chain thermostat, so no other time integration fix should be used. + Fix *pimd/langevin* implements a complete velocity-verlet integrator - combined with Langevin thermostat in the normal mode representation, and + combined with Langevin thermostat in the normal mode representation, and also provides a barostat to sample the NPH/NPT ensembles. The *method* keyword determines what style of PIMD is performed. A @@ -136,7 +138,7 @@ normal-mode PIMD. A value of *cmd* is for centroid molecular dynamics the real particle. .. note:: - Fix pimd/langevin only supports *method* value *nmpimd*. This should be enough + Fix pimd/langevin only supports *method* value *nmpimd*. This should be enough for most PIMD applications for quantum thermodynamics purpose. Motion of the centroid can be effectively uncoupled from the other @@ -155,42 +157,51 @@ masses of beads, which can be used for the Partial Adiabatic CMD :ref:`(Hone) `, or to be set as P, which results in the fictitious masses to be equal to the real particle masses. -The keyword *fmmode* of *fix pimd/langevin* determines the mode of fictitious -mass preconditioning. There are two options: *physical* and *normal*. If *fmmode* is +The keyword *fmmode* of *fix pimd/langevin* determines the mode of fictitious +mass preconditioning. There are two options: *physical* and *normal*. If *fmmode* is *physical*, then the physical mass of the particles are used (and then multiplied by -*fmass*). If *fmmode* is *normal*, then the physical mass is first multiplied by the -eigenvalue of each normal mode, and then multiplied by *fmass*. More precisely, the +*fmass*). If *fmmode* is *normal*, then the physical mass is first multiplied by the +eigenvalue of each normal mode, and then multiplied by *fmass*. More precisely, the fictitious mass of *fix pimd/langevin* is determined by two factors: *fmmode* and *fmass*. If *fmmode* is *physical*, then the fictitious mass is -.. math:: - $M_i = \mathrm{fmass} \times m$ - -If *fmmode* is *normal*, then the fictitious mass is -.. math:: - $M_i = \mathrm{fmass} \times \lambda_i \times m$ -where $\lambda_i$ is the eigenvalue of the $i$-th normal mode. +.. math:: + + M_i = \mathrm{fmass} \times m + +If *fmmode* is *normal*, then the fictitious mass is + +.. math:: + + M_i = \mathrm{fmass} \times \lambda_i \times m + +where :math:`\lambda_i` is the eigenvalue of the :math:`i`-th normal mode. + .. note:: + Fictitious mass is only used in the momentum of the equation of motion - ($\bf{p}_i=M_i\bf{v}_i$), and not used in the spring elastic energy - ($\sum_{i=1}^P \frac{1}{2}m\omega_P^2(q_i - q_{i+1})^2$, $m$ is always the - actual mass of the particles). + (:math:`\mathbf{p}_i=M_i\mathbf{v}_i`), and not used in the spring elastic energy + (:math:`\sum_{i=1}^P \frac{1}{2}m\omega_P^2(q_i - q_{i+1})^2`, :math:`m` is always the + actual mass of the particles). The keyword *sp* is a scaling factor on Planck's constant, which can be useful for debugging or other purposes. The default value of 1.0 is appropriate for most situations. -The keyword *ensemble* for fix style *pimd/langevin* determines which ensemble is it -going to sample. The value can be *nve* (microcanonical), *nvt* (canonical), *nph* (isoenthalpic), and *npt* (isothermal-isobaric). +The keyword *ensemble* for fix style *pimd/langevin* determines which ensemble is it +going to sample. The value can be *nve* (microcanonical), *nvt* (canonical), *nph* (isoenthalpic), +and *npt* (isothermal-isobaric). + +The keyword *temp* specifies temperature parameter for fix styles *pimd/nvt* and *pimd/langevin*. It should read +a positive floating-point number. -The keyword *temp* specifies temperature parameter for fix styles *pimd/nvt* and *pimd/langevin*. It should read a -positive floating-point number. .. note:: + For pimd simulations, a temperature values should be specified even for nve ensemble. Temperature will make a difference for nve pimd, since the spring elastic frequency between the beads will be affected by the temperature. The keyword *thermostat* reads *style* and *seed* of thermostat for fix style *pimd/langevin*. *style* can only -be *PILE_L* (path integral Langevin equation local thermostat, as described in :ref:`(Manolopoulos) `), and *seed* should a positive integer number, which serves as the seed of the pseudo random number generator. +be *PILE_L* (path integral Langevin equation local thermostat, as described in :ref:`Ceriotti `), and *seed* should a positive integer number, which serves as the seed of the pseudo random number generator. .. note:: The fix style *pimd/langevin* uses the stochastic PILE_L thermostat to control temperature. This thermostat works on the normal modes @@ -199,21 +210,21 @@ be *PILE_L* (path integral Langevin equation local thermostat, as described in : The keyword *tau* specifies the thermostat damping time parameter for fix style *pimd/langevin*. It is in time unit. It only works on the centroid mode. The keyword *scale* specifies a scaling parameter for the damping times of the non-centroid modes for fix style *pimd/langevin*. The default -damping time of the non-centroid mode $i$ is $\frac{P}{\beta\hbar}\sqrt{\lambda_i\times\mathrm{fmass}}$ (*fmmode* is *physical*) or $\frac{P}{\beta\hbar}\sqrt{\mathrm{fmass}}$ (*fmmode* is *normal*). The damping times of all non-centroid modes are the default values divided by *scale*. +damping time of the non-centroid mode :math:`i` is :math:`\frac{P}{\beta\hbar}\sqrt{\lambda_i\times\mathrm{fmass}}` (*fmmode* is *physical*) or :math:`\frac{P}{\beta\hbar}\sqrt{\mathrm{fmass}}` (*fmmode* is *normal*). The damping times of all non-centroid modes are the default values divided by *scale*. -The barostat parameters for fix style *pimd/langevin* with *npt* or *nph* ensemble is specified using one of *iso* and *aniso* +The barostat parameters for fix style *pimd/langevin* with *npt* or *nph* ensemble is specified using one of *iso* and *aniso* keywords. A *pressure* value should be given with pressure unit. The keyword *iso* means couple all 3 diagonal components together when pressure is computed (hydrostatic pressure), and dilate/contract the dimensions together. The keyword *aniso* means x, y, and z dimensions are controlled independently using the Pxx, Pyy, and Pzz components of the stress tensor as the driving forces, and the specified scalar external pressure. The keyword *barostat* reads *style* of barostat for fix style *pimd/langevin*. *style* can -be *BZP* (Bussi-Zykova-Parrinello, as described in :ref:`(Parrinello1) `) or *MTTK* (Martyna-Tuckerman-Tobias-Klein, as described in :ref:`(Tuckerman2) `). +be *BZP* (Bussi-Zykova-Parrinello, as described in :ref:`Bussi `) or *MTTK* (Martyna-Tuckerman-Tobias-Klein, as described in :ref:`Martyna1 ` and :ref:`Martyna2 `). The keyword *taup* specifies the barostat damping time parameter for fix style *pimd/langevin*. It is in time unit. -The keyword *fixcom* specifies whether the center-of-mass of the extended ring-polymer system is fixed during the pimd simulation. -Once *fixcom* is set te be *yes*, the center-of-mass velocity will be distracted from the centroid-mode velocities in each step. +The keyword *fixcom* specifies whether the center-of-mass of the extended ring-polymer system is fixed during the pimd simulation. +Once *fixcom* is set to be *yes*, the center-of-mass velocity will be distracted from the centroid-mode velocities in each step. The PIMD algorithm in LAMMPS is implemented as a hyper-parallel scheme -as described in :ref:`(Calhoun) `. In LAMMPS this is done by using +as described in :ref:`Calhoun `. In LAMMPS this is done by using :doc:`multi-replica feature ` in LAMMPS, where each quasi-particle system is stored and simulated on a separate partition of processors. The following diagram illustrates this approach. The @@ -340,18 +351,18 @@ Path Integrals, McGraw-Hill, New York (1965). **(Herman)** M. F. Herman, E. J. Bruskin, B. J. Berne, J Chem Phys, 76, 5150 (1982). -.. _Parrinello1: +.. _Bussi: -**(Parrinello1)** G. Bussi, T. Zykova-Timan, M. Parrinello, J Chem Phys, 130, 074101 (2009). +**(Bussi)** G. Bussi, T. Zykova-Timan, M. Parrinello, J Chem Phys, 130, 074101 (2009). -.. _Manolopoulos: +.. _Ceriotti: -**(Manolopoulos)** M. Ceriotti, M. Parrinello, T. Markland, D. Manolopoulos, J. Chem. Phys. 133, 124104 (2010). +**(Ceriotti)** M. Ceriotti, M. Parrinello, T. Markland, D. Manolopoulos, J. Chem. Phys. 133, 124104 (2010). -.. _Klein: +.. _Martyna1: -**(Klein)** G. Martyna, D. Tobias, M. Klein, J. Chem. Phys. 101, 4177 (1994). +**(Martyna1)** G. Martyna, D. Tobias, M. Klein, J. Chem. Phys. 101, 4177 (1994). -.. _Tuckerman2: +.. _Martyna2: -**(Tuckerman2)** G. Martyna, A. Hughes, M. Tuckerman, J. Chem. Phys. 110, 3275 (1999). \ No newline at end of file +**(Martyna2)** G. Martyna, A. Hughes, M. Tuckerman, J. Chem. Phys. 110, 3275 (1999). From 2c0ac8299640305499f46f48b5641b8734456d9f Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Tue, 21 Mar 2023 09:54:29 -0400 Subject: [PATCH 039/172] update doc press -> iso --- doc/src/fix_pimd.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 4d72d7232f..75ba85bc96 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -61,7 +61,7 @@ Examples .. code-block:: LAMMPS fix 1 all pimd/nvt method nmpimd fmass 1.0 sp 2.0 temp 300.0 nhc 4 - fix 1 all pimd/langevin ensemble npt integrator obabo temp 113.15 thermostat PILE_L 1234 tau 1.0 press 1.0 barostat BZP taup 1.0 iso + fix 1 all pimd/langevin ensemble npt integrator obabo temp 113.15 thermostat PILE_L 1234 tau 1.0 iso 1.0 barostat BZP taup 1.0 Description """"""""""" From af8d4788b8bd4545ef88e098c6dc99a702862866 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Tue, 21 Mar 2023 10:11:37 -0400 Subject: [PATCH 040/172] fix doc errors --- doc/src/fix_pimd.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 75ba85bc96..db6700633f 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -30,21 +30,20 @@ Syntax * keywords for style *pimd/langevin* .. parsed-literal:: - *keywords* = *method* or *integrator* or *ensemble* or *fmmode* or *fmass* or *scale* or *temp* or *thermostat* or - *tau*or or *iso* or *aniso* or *barostat* or *taup* or *fixcom* or *lj* + *keywords* = *method* or *integrator* or *ensemble* or *fmmode* or *fmass* or *scale* or *temp* or *thermostat* or *tau* or *iso* or *aniso* or *barostat* or *taup* or *fixcom* or *lj* *method* value = *nmpimd* *integrator* value = *obabo* or *baoab* *fmmode* value = *physical* or *normal* *fmass* value = scaling factor on mass - *temp* value = Temperature (temperature unit) - Temperature = target temperature of the thermostat + *temp* value = temperature (temperature unit) + temperature = target temperature of the thermostat *thermostat* values = style seed style value = *PILE_L* seed = random number generator seed *tau* value = thermostat damping parameter (time unit) *scale* value = scaling factor of the damping times of non-centroid modes of PILE_L thermostat - *iso* or *aniso* values = Pressure (pressure unit) - Pressure = scalar external pressure of the barostat + *iso* or *aniso* values = pressure (pressure unit) + pressure = scalar external pressure of the barostat *barostat* value = *BZP* or *MTTK* *taup* value = barostat damping parameter (time unit) *fixcom* value = *yes* or *no* From 5c94806a1d307d5552adeecf634fb9221abb1d71 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Thu, 23 Mar 2023 01:59:38 -0400 Subject: [PATCH 041/172] update doc --- doc/src/fix_pimd.rst | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index db6700633f..eca58a409d 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -95,8 +95,10 @@ beads on the other ring-polymers with the same imaginary time index (the second term in the effective potential above). The quasi-beads also interact with the two neighboring quasi-beads through the spring potential in imaginary-time space (first term in effective potential). -To sample the canonical ensemble, a Nose-Hoover massive chain thermostat -is applied :ref:`(Tuckerman) `. With the massive chain +To sample the canonical ensemble, any thermostat can be applied. + +Fix *pimd/nvt* applies a Nose-Hoover massive chain thermostat +:ref:`(Tuckerman) `. With the massive chain algorithm, a chain of NH thermostats is coupled to each degree of freedom for each quasi-bead. The keyword *temp* sets the target temperature for the system and the keyword *nhc* sets the number *Nc* of @@ -104,16 +106,15 @@ thermostats in each chain. For example, for a simulation of N particles with P beads in each ring-polymer, the total number of NH thermostats would be 3 x N x P x Nc. +Fix *pimd/langevin* implements a Langevin thermostat in the normal mode +representation, and also provides a barostat to sample the NPH/NPT ensembles. + .. note:: - Fix *pimd/nvt* implements a complete velocity-verlet integrator - combined with NH massive chain thermostat, so no other time + Both these *fix* styles implement a complete velocity-verlet integrator + combined with a thermostat, so no other time integration fix should be used. - Fix *pimd/langevin* implements a complete velocity-verlet integrator - combined with Langevin thermostat in the normal mode representation, and - also provides a barostat to sample the NPH/NPT ensembles. - The *method* keyword determines what style of PIMD is performed. A value of *pimd* is standard PIMD. A value of *nmpimd* is for normal-mode PIMD. A value of *cmd* is for centroid molecular dynamics From 83b4e18704843c86de7cf26e91bae18851b6165a Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Thu, 23 Mar 2023 21:05:07 -0400 Subject: [PATCH 042/172] update doc --- doc/src/fix_pimd.rst | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index eca58a409d..78aa5fa107 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -112,8 +112,7 @@ representation, and also provides a barostat to sample the NPH/NPT ensembles. .. note:: Both these *fix* styles implement a complete velocity-verlet integrator - combined with a thermostat, so no other time - integration fix should be used. + combined with a thermostat, so no other time integration fix should be used. The *method* keyword determines what style of PIMD is performed. A value of *pimd* is standard PIMD. A value of *nmpimd* is for @@ -121,7 +120,7 @@ normal-mode PIMD. A value of *cmd* is for centroid molecular dynamics (CMD). The difference between the styles is as follows. In standard PIMD, the value used for a bead's fictitious mass is - arbitrary. A common choice is to use Mi = m/P, which results in the + arbitrary. A common choice is to use :math:`M_i = m/P`, which results in the mass of the entire ring-polymer being equal to the real quantum particle. But it can be difficult to efficiently integrate the equations of motion for the stiff harmonic interactions in the ring @@ -152,6 +151,10 @@ normal-mode PIMD. A value of *cmd* is for centroid molecular dynamics only the k > 0 modes are thermostatted, not the centroid degrees of freedom. +The keyword *integrator* specifies the Trotter splitting method used by *fix pimd/langevin*. +See :ref:`(Liu) ` for a discussion on the OBABO and BAOAB splitting schemes. Typically +either of the two should work fine. + The keyword *fmass* sets a further scaling factor for the fictitious masses of beads, which can be used for the Partial Adiabatic CMD :ref:`(Hone) `, or to be set as P, which results in the fictitious @@ -201,7 +204,7 @@ a positive floating-point number. for nve pimd, since the spring elastic frequency between the beads will be affected by the temperature. The keyword *thermostat* reads *style* and *seed* of thermostat for fix style *pimd/langevin*. *style* can only -be *PILE_L* (path integral Langevin equation local thermostat, as described in :ref:`Ceriotti `), and *seed* should a positive integer number, which serves as the seed of the pseudo random number generator. +be *PILE_L* (path integral Langevin equation local thermostat, as described in :ref:`Ceriotti `), and *seed* should a positive integer number, which serves as the seed of the pseudo random number generator. .. note:: The fix style *pimd/langevin* uses the stochastic PILE_L thermostat to control temperature. This thermostat works on the normal modes @@ -216,7 +219,7 @@ The barostat parameters for fix style *pimd/langevin* with *npt* or *nph* ensemb keywords. A *pressure* value should be given with pressure unit. The keyword *iso* means couple all 3 diagonal components together when pressure is computed (hydrostatic pressure), and dilate/contract the dimensions together. The keyword *aniso* means x, y, and z dimensions are controlled independently using the Pxx, Pyy, and Pzz components of the stress tensor as the driving forces, and the specified scalar external pressure. The keyword *barostat* reads *style* of barostat for fix style *pimd/langevin*. *style* can -be *BZP* (Bussi-Zykova-Parrinello, as described in :ref:`Bussi `) or *MTTK* (Martyna-Tuckerman-Tobias-Klein, as described in :ref:`Martyna1 ` and :ref:`Martyna2 `). +be *BZP* (Bussi-Zykova-Parrinello, as described in :ref:`Bussi `) or *MTTK* (Martyna-Tuckerman-Tobias-Klein, as described in :ref:`Martyna1 ` and :ref:`Martyna2 `). The keyword *taup* specifies the barostat damping time parameter for fix style *pimd/langevin*. It is in time unit. @@ -258,9 +261,18 @@ related tasks for each of the partitions, e.g. .. code-block:: LAMMPS dump dcd all dcd 10 system_${ibead}.dcd + dump 1 all custom 100 ${ibead}.xyz id type x y z vx vy vz ix iy iz fx fy fz restart 1000 system_${ibead}.restart1 system_${ibead}.restart2 read_restart system_${ibead}.restart2 +.. note:: + Fix *pimd/langevin* dumps the Catersian coordinates, but dumps the velocities and + forces in the normal mode representation. If the Catersian velocities and forces are + needed, it is easy to perform the transformation when doing post-processing. + + It is recommended to dump the image flags (*ix iy iz*) for fix *pimd/langevin*. It + will be useful if you want to calculate some estimators during post-processing. + Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -287,6 +299,10 @@ the global vector are: The vector values calculated by fix *pimd/nvt* are "extensive", except for the temperature, which is "intensive". +Fix *pimd/langevin* computes a global vector of quantities, which +can be accessed by various :doc:`output commands `. If *ensemble* +is *nve* or *nvt*, the vector has 10 values. + No parameter of fix *pimd/nvt* can be used with the *start/stop* keywords of the :doc:`run ` command. Fix *pimd/nvt* is not invoked during :doc:`energy minimization `. @@ -355,14 +371,18 @@ Path Integrals, McGraw-Hill, New York (1965). **(Bussi)** G. Bussi, T. Zykova-Timan, M. Parrinello, J Chem Phys, 130, 074101 (2009). -.. _Ceriotti: +.. _Ceriotti2: **(Ceriotti)** M. Ceriotti, M. Parrinello, T. Markland, D. Manolopoulos, J. Chem. Phys. 133, 124104 (2010). -.. _Martyna1: +.. _Martyna3: **(Martyna1)** G. Martyna, D. Tobias, M. Klein, J. Chem. Phys. 101, 4177 (1994). -.. _Martyna2: +.. _Martyna4: **(Martyna2)** G. Martyna, A. Hughes, M. Tuckerman, J. Chem. Phys. 110, 3275 (1999). + +.. _Liujian: + +**(Liu)** J. Liu, D. Li, X. Liu, J. Chem. Phys. 145, 024103 (2016). From 4e4ae34de601159ffaf8af10eacefeab57781570 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Mon, 27 Mar 2023 22:16:41 -0400 Subject: [PATCH 043/172] update doc with output info and reduced unit instructions --- doc/src/fix_pimd.rst | 66 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 78aa5fa107..e4a59b0078 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -226,6 +226,9 @@ The keyword *taup* specifies the barostat damping time parameter for fix style * The keyword *fixcom* specifies whether the center-of-mass of the extended ring-polymer system is fixed during the pimd simulation. Once *fixcom* is set to be *yes*, the center-of-mass velocity will be distracted from the centroid-mode velocities in each step. +The keyword *lj* should be used if :doc:`lj units ` is used for *fix pimd/langevin*. Typically one may want to use +reduced units to run the simulation, and then convert the results into some physical units (for example, :doc:`metal units `). In this case, the 5 quantities in the physical mass units are needed: epsilon (energy scale), sigma (length scale), mass, Planck's constant, mvv2e (mass * velocity^2 to energy conversion factor). Planck's constant and mvv2e can be found in src/update.cpp. If there is no need to convert reduced units to physical units, set all these five value to 1. + The PIMD algorithm in LAMMPS is implemented as a hyper-parallel scheme as described in :ref:`Calhoun `. In LAMMPS this is done by using :doc:`multi-replica feature ` in LAMMPS, where each @@ -300,11 +303,65 @@ The vector values calculated by fix *pimd/nvt* are "extensive", except for the temperature, which is "intensive". Fix *pimd/langevin* computes a global vector of quantities, which -can be accessed by various :doc:`output commands `. If *ensemble* -is *nve* or *nvt*, the vector has 10 values. +can be accessed by various :doc:`output commands `. Note that +it outputs multiple log files, and different log files contain information +about different beads or modes (see detailed explanations below). If *ensemble* +is *nve* or *nvt*, the vector has 10 values: -No parameter of fix *pimd/nvt* can be used with the *start/stop* keywords -of the :doc:`run ` command. Fix *pimd/nvt* is not invoked during + #. kinetic energy of the normal mode + #. spring elastic energy of the normal mode + #. potential energy of the bead + #. total energy of all beads (conserved if *ensemble* is *nve*) + #. primitive kinetic energy estimator + #. virial energy estimator + #. centroid-virial energy estimator + #. primitive pressure estimator + #. thermodynamic pressure estimator + #. centroid-virial pressure estimator + +The first 3 are different for different log files, and the others are the same for different log files. + +If *ensemble* is *nph* or *npt*, the vector stores internal variables of the barostat. If *iso* is used, +the vector has 15 values: + + #. kinetic energy of the normal mode + #. spring elastic energy of the normal mode + #. potential energy of the bead + #. total energy of all beads (conserved if *ensemble* is *nve*) + #. primitive kinetic energy estimator + #. virial energy estimator + #. centroid-virial energy estimator + #. primitive pressure estimator + #. thermodynamic pressure estimator + #. centroid-virial pressure estimator + #. barostat velocity + #. barostat kinetic energy + #. barostat potential energy + #. barostat cell Jacobian + #. enthalpy of the extended system (sum of 4, 12, 13, and 14; conserved if *ensemble* is *nph*) + +If *aniso* or *x* or *y* or *z* is used for the barostat, the vector has 17 values: + + #. kinetic energy of the normal mode + #. spring elastic energy of the normal mode + #. potential energy of the bead + #. total energy of all beads (conserved if *ensemble* is *nve*) + #. primitive kinetic energy estimator + #. virial energy estimator + #. centroid-virial energy estimator + #. primitive pressure estimator + #. thermodynamic pressure estimator + #. centroid-virial pressure estimator + #. x component of barostat velocity + #. y component of barostat velocity + #. z component of barostat velocity + #. barostat kinetic energy + #. barostat potential energy + #. barostat cell Jacobian + #. enthalpy of the extended system (sum of 4, 14, 15, and 16; conserved if *ensemble* is *nph*) + +No parameter of fix *pimd/nvt* or *pimd/langevin* can be used with the *start/stop* keywords +of the :doc:`run ` command. Fix *pimd/nvt* or *pimd/langevin* is not invoked during :doc:`energy minimization `. Restrictions @@ -315,6 +372,7 @@ LAMMPS was built with that package. See the :doc:`Build package ` page for more info. Fix *pimd/nvt* cannot be used with :doc:`lj units `. +Fix *pimd/langevin* can be used with :doc:`lj units `. See the above part for how to use it. A PIMD simulation can be initialized with a single data file read via the :doc:`read_data ` command. However, this means all From 561f80ccc731715049fcaa9c9663944089c4353a Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Mon, 27 Mar 2023 22:21:38 -0400 Subject: [PATCH 044/172] add example for fix pimd/langevin with reduced units --- .../PACKAGES/pimd/lj_reduced_units/data.lj01 | 219 ++++++++++++++++++ .../PACKAGES/pimd/lj_reduced_units/data.lj02 | 219 ++++++++++++++++++ .../PACKAGES/pimd/lj_reduced_units/in.lmp | 26 +++ .../PACKAGES/pimd/lj_reduced_units/run.sh | 1 + 4 files changed, 465 insertions(+) create mode 100644 examples/PACKAGES/pimd/lj_reduced_units/data.lj01 create mode 100644 examples/PACKAGES/pimd/lj_reduced_units/data.lj02 create mode 100644 examples/PACKAGES/pimd/lj_reduced_units/in.lmp create mode 100644 examples/PACKAGES/pimd/lj_reduced_units/run.sh diff --git a/examples/PACKAGES/pimd/lj_reduced_units/data.lj01 b/examples/PACKAGES/pimd/lj_reduced_units/data.lj01 new file mode 100644 index 0000000000..e3d6b816a3 --- /dev/null +++ b/examples/PACKAGES/pimd/lj_reduced_units/data.lj01 @@ -0,0 +1,219 @@ +LAMMPS data file via write_data, version 8 Feb 2023, timestep = 2000 + +200 atoms +1 atom types + +-3.4945130603740377 3.4945130603740377 xlo xhi +-3.4945130603740377 3.4945130603740377 ylo yhi +-3.4945130603740377 3.4945130603740377 zlo zhi + +Masses + +1 1 + +Pair Coeffs # lj/cut + +1 1 1 + +Atoms # atomic + +108 1 -2.7795690566068996 -2.0367677788080942 3.4238258338844894 2 1 -1 +102 1 -2.609481280743025 -1.8912619121268304 -2.399753092988466 1 -1 -1 +141 1 -3.140749645549514 -2.8903241627869427 -2.7071762462261537 2 0 0 +49 1 -2.3658136681990007 -3.088812044820056 3.4760124445890623 0 1 -1 +88 1 -1.6158710173914035 -2.3369020600614756 3.233517474511907 0 1 -1 +192 1 -1.2960228223928079 -3.237522585981233 -3.1506262911155765 1 1 2 +113 1 -0.5058112539671865 -2.175265580488635 -2.895948573481031 -1 0 0 +147 1 -0.22721902013037146 -3.2095321965856187 -2.5444416457809185 0 1 0 +55 1 0.6250447384071113 -2.6446349401275255 -2.959767417439857 -1 0 -1 +63 1 1.6783992808137906 -3.22203513406057 -3.1652676844989256 -1 1 1 +95 1 1.3579478870419064 -2.684729254303277 -2.052496056604152 0 2 -1 +105 1 1.4496281787006915 -1.9673030959679096 -3.332658945278261 0 0 0 +84 1 2.4045875426768606 -1.8297724699275564 -2.7874627893944544 0 0 0 +65 1 -2.68682939849047 -0.8114540186440395 -3.126687818057689 0 -1 0 +112 1 -1.7203801180145006 -0.8038481618523634 -2.0163240721427838 0 0 0 +174 1 -1.4968933339977661 -1.3290620346554367 -3.064010040861048 -1 0 -1 +189 1 -0.6249709402997541 -1.252931712435372 -1.9882716349469658 0 0 2 +9 1 -0.23886293275872486 -1.0612344376875333 -3.025432389188406 0 0 1 +146 1 -0.9802936024515303 -0.3953988402073487 -2.8364522494017708 2 1 2 +171 1 0.39730078560778914 -1.7846492070113664 -2.443607407553737 0 2 -1 +140 1 0.5573788374911133 -0.5990036144148324 -2.402963062521378 -1 0 0 +152 1 3.4379847727225346 -1.3055938268830742 -2.4905074589410936 -2 -1 0 +11 1 3.1992117767992068 -1.191883736793153 -3.4723419170834338 -1 2 1 +69 1 2.6376153053668867 -0.2845436411244765 -2.788279844473203 0 -2 0 +173 1 -1.967038944001471 0.06098718735032446 -2.58940519609616 1 0 1 +190 1 -2.8711350478349926 0.9129034739862979 -3.477848194666021 0 0 0 +164 1 -2.8409776961511124 1.1599509265598786 -2.2464830240939375 0 0 1 +161 1 -1.6469671018177567 0.9360204597700993 -3.3491365145788827 1 0 2 +74 1 -0.028453987680887038 0.3739399392930446 -2.9891764409930484 1 -1 1 +162 1 -0.9152119867762214 1.8538003710645874 -2.0787458665529313 0 0 1 +165 1 0.20472499231506947 0.41157279287578097 -1.7804952487691292 0 0 0 +28 1 0.9556568956317052 0.9070586383550882 -3.051580171737043 0 -1 -1 +107 1 0.27101548210140264 1.6697625775553313 3.256398876364515 -1 1 0 +53 1 -2.2768986954542476 1.9520208666344268 -2.905899876141582 -1 -1 1 +60 1 -2.3748565234893153 3.1415519659534046 -2.6903226937570888 1 1 0 +172 1 -1.3831407623603917 2.6439383680022495 -2.988114399273657 0 0 2 +35 1 -1.9040946957475922 2.4850230251463294 -1.8238074088896814 1 -1 0 +90 1 -0.6407155002729499 2.891205873820353 -2.184576201275668 0 -1 1 +183 1 -0.7452468270399182 1.6958511415691964 -3.2646018242495516 1 0 0 +46 1 -0.22701759376730096 2.672935498985858 -3.2296828094464414 1 -1 -1 +26 1 0.3607641531328818 1.9915770180932266 -2.4322620664253045 0 -1 1 +41 1 0.6373758855225722 3.1576967379383136 -2.2076729513672273 0 0 1 +62 1 1.2599715479139464 2.4637352645229535 -2.996655642771261 0 0 1 +114 1 0.7095094175128512 3.3529225376529834 -3.446569928809617 0 -1 1 +29 1 -3.4441516076858747 3.186682881361427 -3.164290558791177 1 -1 0 +120 1 -2.7699397214807666 -3.0679149510930377 -1.4586405778286127 2 1 1 +166 1 -2.9639598123456348 -1.8230569851379879 -1.1336421298957986 0 1 0 +19 1 -2.219481001384856 -2.718720936926987 -0.17152653954078959 1 1 -1 +143 1 -3.3367462911096637 -2.646710289319255 -0.08639804580378332 1 1 0 +14 1 -0.8080539703460301 -3.3138674801902015 -1.5513416052298858 -1 0 1 +17 1 -1.2519028473371163 -1.9834151764617522 -0.4751925051419198 -2 0 0 +7 1 -0.6422036076119758 -2.1822637849150257 -1.309964136714573 -1 0 1 +76 1 0.002896678458885543 -2.2620445897063184 -0.2330303144789453 0 0 0 +25 1 0.3195487317939559 -2.5915964162672633 -1.6847661018972104 -1 0 1 +122 1 0.9437732996524034 -3.076308154774796 -1.0301951566376644 1 0 -1 +188 1 1.3149323047475332 -2.0202232851439175 -0.9332517483120624 -1 0 0 +196 1 2.4252816482051065 -2.9991133261256717 -0.2915609413585816 0 2 1 +154 1 1.617010887740887 -2.199305270305938 0.15712874770371849 -1 2 0 +64 1 2.934967635633404 -1.92620475221537 -0.7077313528493354 0 1 0 +79 1 -2.8111804533557017 -0.5176533778232942 -2.0486672107634094 0 1 0 +80 1 -2.079807139196039 -1.2506968999173758 -0.6878784167189951 0 0 1 +12 1 -2.996784469690298 -1.494057160171672 -0.09378065633433766 0 0 1 +87 1 -1.4786937501974577 -0.24572242955022147 -1.0411298155891553 0 -1 1 +118 1 -1.5219571471797697 -0.6469152337096267 0.07790607124041445 0 1 0 +106 1 1.1039107347748043 -0.9982945968846851 -1.4358613477546331 -1 0 0 +6 1 0.2994229743009 -1.5755502164022743 -1.1025451212735877 2 0 0 +98 1 0.14422647245316755 -0.4562748967814887 -1.1288823927075846 -1 0 0 +36 1 1.117403260546369 -0.6258611972204157 -0.45746732579129296 1 -1 0 +133 1 0.859517194013173 -1.4579095853876511 0.2223121798831755 1 1 1 +1 1 1.9750704226304612 -1.2226584851722493 -0.5050391499153623 0 -1 0 +91 1 2.930212504963826 -0.8900603772487206 0.31326990070574257 0 -1 -1 +135 1 -1.8704119131145511 1.4151617424236407 -2.0299493395071555 1 0 0 +145 1 -2.5978280185456044 0.23771261564216897 -0.6973478660383656 0 -2 -1 +194 1 -0.802106175542123 1.5380363524561962 -1.0014646333327863 0 1 -1 +177 1 -0.4209642163497379 1.4081511815239465 0.048786606404428355 0 1 -1 +56 1 0.1655081354187105 0.488612868229853 -0.6685586469118172 0 0 1 +137 1 1.0403444543974962 0.29392106264506496 -1.157047853549803 -1 1 -1 +3 1 1.426791637331859 1.1994824011018168 -0.7391487398561316 0 -1 1 +125 1 0.6384933993980926 1.4087406696008793 -0.04513978672724809 0 1 0 +85 1 3.492386221258323 -0.022918569575539983 -0.18415289757087 1 0 1 +37 1 1.9446560065460998 0.32690249887078415 -1.557848909197346 1 0 1 +157 1 2.2693311785439514 1.4234672203444076 -1.3950756204319474 -1 -1 1 +81 1 2.2043144165939133 0.7734976358785483 -0.1443989261496442 -1 0 1 +193 1 -2.800913203549158 3.3913795040038752 -0.3002902442199323 1 0 0 +127 1 -1.832485514575906 -3.475177695698571 -1.0143919033965547 0 0 0 +104 1 -0.9864189902172598 -3.128510029811542 -0.3946109581791233 0 0 -1 +72 1 -1.091863924309645 2.651695772194485 -1.1525574140711645 1 -1 0 +99 1 -1.376188772302252 2.1367308970905112 -0.22414000562735564 0 -1 0 +24 1 1.0798151658945965 1.8088284522753606 -1.611839691529319 1 -1 0 +42 1 3.3099578488331143 2.7636832208891664 -0.11775790598994411 -1 1 -1 +38 1 -2.6469918571054945 -2.446265188540552 0.8006326688775777 1 0 1 +86 1 -3.3982593364606077 -1.9911707046121028 1.4129412590921573 -1 0 0 +116 1 -3.3782151164102614 3.3939134790192074 0.6418244028431277 1 0 0 +144 1 -2.152212571536467 -2.8119708535854224 1.6778364082976118 0 1 0 +179 1 -0.8263021362457004 -1.7214596406733806 0.6812305480127513 -1 3 1 +151 1 -1.5217298498042864 -2.5933593936403763 0.7963122225368328 0 1 2 +130 1 -0.41366866285633624 -2.851509016203123 0.6773665297002652 -1 1 0 +149 1 -0.8196954968551895 -2.4620140380344058 1.6681749543249536 1 1 0 +123 1 0.42149982032625755 -2.3318080821151144 1.1400194349387576 -1 1 -1 +142 1 1.7676090653529768 -2.7694388971884765 1.0411093428968425 1 1 0 +43 1 1.2651581412723922 -1.7350310325188918 1.2119129817343088 -1 -1 1 +156 1 2.796603060966876 -1.975811297437484 0.5269881248554414 0 -1 0 +30 1 -2.572197786362113 -0.5211520888332514 0.06478473226429171 1 -1 0 +200 1 -2.796037525463158 -1.2242406753887405 0.9147806710233006 -1 0 0 +75 1 -3.264195451754593 -0.2758623474229462 0.8501703715118789 1 -1 0 +199 1 -1.8606891200301348 -0.81109530705794 1.234068196576104 1 -1 1 +119 1 -1.8952925629684365 -1.6742391291961565 0.3056526633582653 0 -1 0 +153 1 -0.6179778569135823 -0.6812551828045249 0.8822634033092613 1 1 0 +31 1 0.1434804396367878 -0.5352374975985325 0.00065681711961239 0 -1 0 +8 1 0.9896949675708329 -0.5825805499366115 0.8390036708294969 0 0 0 +198 1 0.20957042666083733 -1.2300305579788615 1.1505092305231928 0 0 1 +22 1 0.11282413745771128 -0.029722367543426716 1.1299864513218787 -1 0 -1 +195 1 2.9662277270739343 -0.9097471611972223 1.378968815531931 1 0 2 +32 1 1.9176581701385829 -1.0963885598161285 0.612637989357651 1 0 -1 +139 1 2.2034635745403706 -0.09403988556633318 0.8645554281632429 -1 2 0 +77 1 1.7035877859699526 -0.8133688575022073 1.6318409740615665 0 -1 1 +111 1 -3.223221512681343 0.8515794477136406 0.5304444380887284 1 1 1 +138 1 -2.102339643808083 0.3205080511040257 0.6397061187151873 0 1 -1 +103 1 -2.8441279458234914 0.5800051690180812 1.512417106043963 -1 1 0 +184 1 -2.4512811422970944 1.4407376078485292 1.024840909070544 0 0 1 +73 1 -1.2083083753201984 0.16913042396249212 1.31830897028215 0 -2 0 +89 1 -0.622943103836138 0.15695545887374523 0.03344907944561345 0 0 -1 +93 1 -0.6871612783719626 1.4782545941619265 1.7130745398216136 0 -1 0 +94 1 -1.209899480419889 1.1419050120740204 0.768566708093127 0 0 0 +181 1 0.8338139283938067 0.2955625473112081 0.1708175991674893 -1 1 -1 +129 1 1.1355758059362249 0.3630461551808931 1.290797674214222 -1 0 0 +182 1 0.08831527814343061 0.9709201913937692 0.9217855950625892 0 1 -1 +158 1 1.4062820374169525 1.1517166598840343 0.6269036353613398 0 0 0 +100 1 2.8360458941172935 1.5280995172170748 0.62642849190607 0 1 0 +59 1 3.120666407088228 0.49773318717092796 1.2390797462592613 0 -1 1 +40 1 2.1784673001300465 0.9493086808156442 1.37690657576216 0 0 0 +110 1 3.092811420136352 1.457598231264991 1.8333488137634408 0 0 -2 +71 1 -2.704068160468349 3.198799130983575 1.5420861670955985 0 -1 -1 +187 1 -3.3809787804159894 2.339193447924602 0.9253127201661663 1 1 0 +58 1 -1.8161128905276918 3.295453805825648 0.4419286058239596 0 -1 0 +39 1 -1.9288855291902436 2.399541640622866 1.1856795461879515 0 -2 0 +115 1 -1.3188418056778684 -3.426962627878111 1.3071043811339145 1 1 0 +109 1 0.7422148102651713 1.9772692916114134 0.8946623229549697 -1 1 0 +48 1 1.212990075236676 2.7637861839630933 1.668138216427735 0 0 -1 +44 1 1.8875283020177747 2.01954806585405 0.15097670327664356 -1 -1 1 +16 1 2.5088486436667465 3.2867062332187165 0.5352876678637931 0 -2 1 +150 1 2.339993315563226 2.225227215494749 1.201791196292386 0 -1 1 +101 1 -2.7232595674410254 -2.5310321070553594 2.520173028347837 1 3 1 +121 1 -0.1371595891679715 -2.734037361783574 3.2547541081110136 -1 1 -1 +131 1 -1.616105025949218 -1.97873290984862 2.2250110182725185 1 0 0 +50 1 -0.9774458776093428 -3.080336575399165 2.647294574069851 0 1 0 +78 1 -0.6388640381972747 -1.8358994538797384 3.0793625374288474 1 -1 1 +126 1 0.2617829860592282 -3.185635897887874 2.046978007125428 0 1 -1 +185 1 0.3910180046792306 -1.7476201774885758 3.460179487049301 -2 1 -1 +27 1 0.9216706073777299 -2.620009754961919 2.980059759810019 0 0 1 +5 1 0.14805884420723833 -2.060999311749248 2.194803632818035 0 -1 -1 +10 1 1.3885697256222325 -2.5811721069430047 1.960299612344295 0 0 1 +68 1 1.2305537223759786 3.452417391198064 2.5060768204562396 0 0 1 +92 1 3.2579931163558924 -3.0623298587917547 1.8252693484803535 0 2 -1 +178 1 2.26419751848874 -1.7585846281228215 1.7123805014943867 1 1 0 +96 1 2.599921016729558 -2.6427367710738228 3.4145177684858803 -2 2 -1 +57 1 3.2402592062064213 -1.9899576048001384 2.7907002699370937 1 0 0 +155 1 2.209613988042176 -1.7162524781709796 2.7271827572979834 0 0 -1 +168 1 3.477326382335708 -3.4068959852573992 2.821891114170504 -1 1 -2 +175 1 -3.1260125076640937 -0.1261845495956751 3.231607373653429 0 0 0 +117 1 -2.5082381499858095 -1.6201356456498082 1.916360867966056 0 0 0 +4 1 -3.1142920073981517 -0.7023062901592412 1.8555906719306698 0 0 -1 +51 1 -1.9626772134484154 -1.4010881760394245 3.033958867461655 0 0 -1 +148 1 -3.011516485433896 -1.1469037793442038 2.7610753028279933 0 0 0 +197 1 -2.0048159662329326 -0.6749211621392989 2.344679442661877 0 -1 -1 +70 1 -1.8654941392471802 -0.3319695813423535 3.329224742630753 0 1 1 +23 1 -1.0720302561208543 -0.8796307974060223 2.9652586368172633 0 0 -2 +134 1 -0.9769774773292339 -1.023866537972646 1.8133872200496586 -1 0 0 +66 1 0.0812156007450339 -1.0967406204476347 2.677696992399577 -1 -1 -1 +33 1 -0.42833987516917704 0.2127920276630183 3.0504271041557827 0 -1 -1 +18 1 0.8738459806171345 -0.7301638515378504 3.451151027750579 0 -1 -2 +167 1 1.1687036142366616 -1.4517802174625138 2.5014340704062015 0 1 -1 +136 1 1.795137560517328 -0.5623222017058748 2.761148573575212 0 -1 -2 +176 1 0.8667263057428289 -0.39855552371320657 2.157386135628261 0 0 0 +132 1 2.7791570748849397 -0.1854473725861777 3.06331164881256 0 0 -1 +163 1 2.861161516036147 -0.9653887253660198 2.3742914745631665 -1 -1 0 +159 1 -1.638440405488927 1.040992844593558 1.6945368306541542 0 0 0 +34 1 -2.319980614869211 0.615010700172925 2.607891496520952 1 0 -1 +67 1 -1.8758084270870021 1.7856292006021222 2.9794597615239873 1 0 0 +82 1 3.450078342208421 0.43347862445962865 2.3965330453749276 -1 -1 -1 +20 1 -0.3345634991984191 0.4474749361055883 2.021125197093307 1 0 -1 +160 1 -1.337826167757788 0.19507650189296638 2.4559469377176044 0 0 0 +191 1 -0.9433598322448645 1.0765639185970945 2.7978676989244713 1 -1 0 +97 1 1.4995074975439164 1.4827775589636611 2.8582397165142885 0 -1 -1 +83 1 0.7440931705195399 0.28485269404070884 2.8824261695219513 0 -2 0 +186 1 0.4501325900005473 1.1817617584793225 2.171005382838285 1 1 0 +21 1 1.5799209373811796 0.5165927484280916 2.197344395644513 1 0 -1 +170 1 1.781383760665039 0.4589516263468447 3.2606047972968697 -1 1 -1 +15 1 2.5264882009659457 -0.10271458568953422 1.9429509270634897 -1 0 -1 +54 1 2.4907565610148112 1.0443458588262453 2.659572052524602 0 -1 -1 +45 1 -2.3851170089162586 2.7278135027281576 3.2923683043438063 1 0 -1 +47 1 -2.417816843075144 1.911767591397239 2.070179319067279 0 1 0 +52 1 -3.4931268842957652 2.50155605132379 2.127865658713496 0 -1 0 +180 1 -1.9509177290095516 3.309670529089689 2.349688492929276 1 -1 1 +13 1 -0.12240867021598209 3.2141258686958913 2.833411182871058 -1 -1 1 +2 1 -1.340442106022601 2.2849149851767008 2.069093746173476 1 -2 -1 +124 1 -0.41265942682553436 2.1334074442091007 2.592421577863454 1 -1 -1 +61 1 0.7799049336891462 2.500510040165389 2.633457440959517 -1 -2 0 +128 1 2.8514020342376654 2.399755896897204 3.251183881976271 0 0 -2 +169 1 2.1185477137097575 2.27540363851787 2.3296903855745934 0 0 0 diff --git a/examples/PACKAGES/pimd/lj_reduced_units/data.lj02 b/examples/PACKAGES/pimd/lj_reduced_units/data.lj02 new file mode 100644 index 0000000000..aab14fd30f --- /dev/null +++ b/examples/PACKAGES/pimd/lj_reduced_units/data.lj02 @@ -0,0 +1,219 @@ +LAMMPS data file via write_data, version 8 Feb 2023, timestep = 8000 + +200 atoms +1 atom types + +-3.4945130603740377 3.4945130603740377 xlo xhi +-3.4945130603740377 3.4945130603740377 ylo yhi +-3.4945130603740377 3.4945130603740377 zlo zhi + +Masses + +1 1 + +Pair Coeffs # lj/cut + +1 1 1 + +Atoms # atomic + +141 1 -1.763209980389579 -2.6156484242195064 -2.931843780833984 2 0 0 +152 1 -1.5928871542954757 3.3501884422702433 -1.8656866405706811 -1 -2 0 +49 1 -2.7539752553137182 -3.2181862303090325 -3.2982185001231508 0 1 0 +113 1 -0.7003027892165357 -2.1799819378730754 -2.999588953057854 -1 0 0 +147 1 -0.9066147762335637 -3.0721536393085946 -3.451497569202878 0 1 0 +25 1 -0.8348129272923334 -3.2010555139777104 -2.4342714727995403 -1 0 1 +7 1 -1.155032969500839 -2.109409697780318 -2.01960214884411 -1 0 1 +122 1 -0.11210230788570166 -2.6275713274626975 -1.900506384406081 1 0 -1 +55 1 0.23346664931542635 -2.573966195106371 -3.0437128589517024 -1 0 -1 +95 1 0.716981854784511 -1.7560064219465084 -1.6999612600924723 0 2 -1 +105 1 1.1248014998718883 -1.7403082354703703 -3.356758018801178 0 0 0 +84 1 2.225043764737794 -2.1031554472806464 -3.42558560520243 0 0 0 +65 1 -2.8977942390562763 -2.1977837904725823 -3.370623324950664 0 -1 0 +175 1 -3.151432241251456 -0.37515180280237564 3.4437485581764316 0 0 0 +173 1 -2.3157350741156972 -0.12943144237356516 -2.753320161369244 1 0 1 +174 1 -1.4393153013859372 -1.4595317956467175 -2.895392195630071 -1 0 -1 +189 1 -0.9035292808774392 -0.8049470303120404 -2.0013910310988474 0 0 2 +171 1 -0.09043747063992294 -1.5712222691835853 -2.3464524824680155 0 2 -1 +9 1 -0.38933479997274456 -0.745737254721562 -3.0928316849953847 0 0 1 +37 1 0.8181444837942082 -0.7091668788083872 -2.594933610756206 1 0 1 +170 1 1.3754078695474516 -0.09950193181623739 -3.3522400330808644 -1 1 0 +69 1 1.8294621328196188 -1.0504767914076205 -2.8686605757666803 0 -2 0 +11 1 3.053917621871791 -1.2494689141836135 -3.2389748560412586 -1 2 1 +132 1 2.7977059570311695 -0.2496088420677755 -3.341775035063612 0 0 0 +190 1 3.4919178496580034 0.673724849434539 3.4160908466980175 -1 0 -1 +146 1 -0.6231884714133011 0.14913282842463038 -2.641949381637644 2 1 2 +135 1 -1.5674517925968012 0.6290709302591437 -2.3856462153486317 1 0 0 +183 1 -0.49431360672463004 1.4890871743231773 -2.7350680810605428 1 0 0 +74 1 0.37022638217671316 0.08409992531451556 -3.033741105582725 1 -1 1 +26 1 0.4574609043057575 1.0299917975368564 -2.3172978982485737 0 -1 1 +28 1 1.1181699312197082 1.1244486490934802 -3.1866832135712855 0 -1 -1 +29 1 -2.5977690868714194 2.5288932865762908 -3.4450145823917615 1 -1 0 +60 1 -1.7983398047844672 3.3151201773371946 -2.9557747417019304 1 1 0 +35 1 -2.341675516391612 2.5752707942079995 -2.1932303039293837 1 -1 0 +172 1 -1.5906394201515217 2.0015866768978423 -2.97713376733703 0 0 2 +90 1 -0.9570316941978154 2.7341944347748575 -2.39704430602322 0 -1 1 +41 1 0.17097469683906785 3.422589740764926 -2.7250117611585174 0 0 1 +102 1 -2.1834144246935057 -1.9708341062049972 -1.651792998752301 1 -1 -1 +19 1 -2.799899482947646 -2.4762586983196475 -0.30170497621753223 1 1 -1 +193 1 -1.8524344777477728 -2.9040612754975954 -0.9352876177978476 1 1 0 +76 1 -0.14754768813509733 -2.534237145454477 -0.5903298333231304 0 0 0 +104 1 -1.4292162927828058 -1.8887180032986757 -0.7510048521253992 0 0 -1 +14 1 -0.7531800111600084 -3.202737076324235 -1.3992046647831564 -1 0 1 +188 1 1.0895178734825146 -2.3416281855941414 0.09937021752979631 -1 0 0 +157 1 1.53648073670157 -2.278353849103656 -0.9969007844888839 -1 -1 1 +64 1 3.2685116460755688 -1.7040641958682559 -0.168149877537844 0 1 0 +196 1 3.243226770875574 -2.735431073745969 -0.24543333692900807 0 2 1 +120 1 -2.7480834527815015 -1.2726347498238166 -0.7010605053509458 2 1 1 +166 1 -2.5409778907446827 -0.09698240322803402 -1.3435121782531134 0 1 0 +30 1 -2.536346720442665 -0.46539641115594493 0.008770351469747525 1 -1 0 +80 1 -1.716490207148261 -0.7528793181105096 -0.6170398381312646 0 0 1 +17 1 -0.8652064576231921 -1.1974714632304932 -0.15888843807113082 -2 0 0 +98 1 -0.5496242692202938 -0.5939149881300675 -0.9303624863402448 -1 0 0 +6 1 -0.45332547354146785 -1.6738816451677578 -1.1232699958219994 2 0 0 +140 1 0.09381666738090248 -0.533597973200848 -1.8865070415277823 -1 0 0 +106 1 0.5488648307350995 -1.2535162508826685 -0.8256886196074045 -1 0 0 +36 1 0.7889198394938511 -0.3476398702185327 -0.04547023889787161 1 -1 0 +24 1 1.3300945978662577 -0.35153772413771023 -0.9700284287655409 1 -1 0 +81 1 2.0630098337462903 -0.9138666208698583 -0.13962068859670462 -1 0 1 +91 1 -3.4535066291698033 -0.4796384079540839 -0.5221884185889151 1 -1 -1 +164 1 -1.8003776637651108 1.3095354466285742 -0.9389018844249196 0 0 1 +87 1 -1.8547858498275616 0.3065099544053662 -0.4980768850921695 0 -1 1 +145 1 -3.090772587596814 0.5837989607708169 -0.6251810283740868 0 -2 -1 +111 1 -2.534664983415859 1.34688446772606 0.11460128889340086 1 1 1 +79 1 -1.380899470765548 0.24370827853097413 -1.4854169578503262 0 1 0 +162 1 -1.1815902722068103 1.6597770188121743 -1.9852434376303232 0 0 1 +112 1 -0.32558743037491716 0.7106169572157139 -1.615285962267308 0 0 0 +56 1 -0.8283072702254036 0.4564624534306639 -0.5700689028075459 0 0 1 +182 1 0.04863074266364189 0.7978824700683131 -0.008284573593351257 0 1 -1 +177 1 -0.6481696376748467 1.7650890642565358 -0.05338043165294714 0 1 -1 +137 1 0.32639925685778487 -0.05353328668133155 -0.9586895874383917 -1 1 -1 +165 1 0.9387159980444888 0.2522291776639033 -1.8478441123660552 0 0 0 +3 1 1.0844300875316264 0.6025889724525081 -0.4582563908829376 0 -1 1 +194 1 0.8662415299163716 1.2219273986337442 -1.3857941220556813 0 1 -1 +158 1 2.0486184184859972 0.9634063040985638 -0.3354215045861158 0 0 0 +42 1 -1.5693584560601268 2.9075068816274467 -0.8387140667909673 0 1 -1 +99 1 -1.6113116181616747 2.147179220461499 0.1775215873578245 0 -1 0 +72 1 -0.6293873725016741 2.630010118252137 -0.9564776518035689 1 -1 0 +38 1 -2.8640470065198236 -2.2435586739017785 1.3910743129711478 1 0 1 +143 1 -3.0743396057883414 -3.212849746838124 0.5259359570888149 1 1 0 +58 1 -1.9981958681612715 -3.1822656548185346 0.09920225142503952 0 0 0 +144 1 -2.279979967578157 -3.0851896187054515 1.4084093697981352 0 1 0 +151 1 -2.0216078245666655 -2.2216580360079643 0.7457122321748793 0 1 2 +130 1 -0.17493166269242383 -2.4315359476317373 0.444080856211588 -1 1 0 +149 1 -1.3750250274960272 -1.974930490228725 1.5829454078902832 1 1 0 +115 1 -1.2118995350185076 -2.9035919135907267 0.8179968023020373 1 1 0 +126 1 -0.25733050703242866 -2.3407760209116555 1.6674720764378244 0 1 -1 +123 1 0.5187414713973443 -1.8755931680751559 1.2290889493691715 -1 1 -1 +92 1 3.2842270894719214 -2.336991573654636 0.7621232582722934 0 2 -1 +142 1 2.8537576665436712 -3.369110508718591 0.5560526759827451 1 1 0 +1 1 2.08557845839204 -2.010493903326111 0.46603456602394955 0 -1 0 +12 1 -2.813558556370972 -1.5225310581093578 0.39881007051362743 0 0 1 +200 1 -2.620780645842095 -0.6334500549042138 1.1697962611458572 -1 0 0 +117 1 -2.3409262065663707 -1.4262844598718953 1.577896400637549 0 0 0 +199 1 -1.6721028915736709 -0.3937836671461621 1.764496832035196 1 -1 1 +119 1 -1.3702172421751233 -0.982726844411586 0.8109159599445125 0 -1 0 +118 1 -1.22523977151256 0.049111500972962366 0.34422431168243056 0 1 0 +179 1 -0.48400468992080004 -1.5634732075160336 0.9724005879568145 -1 3 1 +153 1 -0.7754078116015299 -0.12746028844271876 1.3139844087365358 1 1 0 +31 1 -0.21960550339589976 -0.3692535839546128 0.27760883173133294 0 -1 0 +154 1 1.1892001894282327 -1.234463776085168 0.4980011557336487 -1 2 0 +198 1 0.208959161472621 -0.7925251742172552 1.1981697813594612 0 0 1 +133 1 0.2021894978277857 -1.321629803385425 0.21342138424976495 1 1 1 +8 1 1.290866486655316 -0.32315323656178685 1.238429676489808 0 0 0 +43 1 1.4755875560077207 -1.5038423322367462 1.5696783276393578 -1 -1 1 +178 1 2.5595353005590473 -1.8548623704973153 1.5265130435507075 1 1 0 +156 1 3.10009336795942 -1.1347768292920712 0.7103971454931245 0 -1 0 +195 1 3.0488535895478486 -0.3819070637556806 1.6994009663148437 1 0 2 +32 1 2.1785721999000907 -0.8868183892594861 1.0608219538420214 1 0 -1 +75 1 -3.330023312049968 -0.13053199225722137 0.5772143324801579 1 -1 0 +138 1 -2.126928513622699 0.2705982397065681 0.9031685365715656 0 1 -1 +103 1 -2.5233875332738447 1.119832203926971 1.7143082124863906 -1 1 0 +89 1 -1.5625051595744621 1.0842527403417836 0.48114251556352683 0 0 -1 +73 1 -1.3841491529474708 0.7735632155517752 1.4917172788469495 0 -2 0 +93 1 -0.8459409435273203 1.6986071717879083 1.233579181789839 0 -1 0 +22 1 0.23130054165086983 0.3973595019638049 1.136265889331469 -1 0 -1 +181 1 1.6715679048902568 0.38189497066002065 0.5813616713777726 -1 1 -1 +125 1 0.7657348058398646 1.4638634812356126 0.3595929949039634 0 1 0 +129 1 1.187621376432971 0.7432781269466477 1.4756104377419834 -1 0 0 +186 1 0.12119836338531766 1.4258158866314226 1.7139997055217806 1 1 0 +44 1 3.246466614044557 0.935266979887072 0.09504504915790167 -1 -1 1 +139 1 2.294764083473655 0.2623628592978102 1.523064327633417 -1 2 0 +85 1 2.6715078057197426 -0.13923978779568133 0.48921080221894214 1 0 1 +100 1 2.179445623029225 1.1813699866412055 0.929258254331208 0 1 0 +59 1 3.199013987449739 0.7056213255691308 1.3011789902622373 0 -1 1 +184 1 -3.3541957825280964 1.6540170153788636 1.314525393258615 0 0 1 +116 1 -2.5607854807212633 2.8662954762956563 0.2561876654735037 1 0 0 +94 1 -2.209938696472392 1.817908573668992 0.9714554983444477 0 0 0 +16 1 3.462148790854558 2.750688132987863 1.1678814516580918 0 -2 1 +127 1 -0.6724215018270191 2.910608435174655 0.1393721830184081 0 -1 0 +39 1 -1.4963936644183389 2.8490269023893804 1.0397387839630663 0 -2 0 +109 1 1.2282064333649392 2.002097356660932 1.219647219360347 -1 1 0 +13 1 -0.038761589919005045 2.283368111259498 0.6285508805046305 -1 -1 1 +68 1 1.8122507294414043 2.919628635322565 1.388388027502655 0 0 1 +187 1 2.839543107439997 1.9712312705165291 0.44701965347775696 0 1 0 +150 1 2.6350933896773805 2.228885886643039 1.6430472643318494 0 -1 1 +101 1 -2.9845915106276357 -2.643240276070094 2.6131611879137338 1 3 1 +180 1 -2.4664624391703636 3.2461534604898077 2.2991216200041777 1 -1 1 +131 1 -2.1198879143055582 -2.5254800707290985 2.2468458013290475 1 0 0 +88 1 -1.8261664412558902 -3.2761989619835945 3.0217607589697706 0 1 -1 +51 1 -1.7527244407627123 -2.1114193587023125 3.178648460302574 0 0 -1 +121 1 -0.8632847382707834 -2.364486787477818 2.5298242427842235 -1 1 -1 +50 1 -1.3127850841438964 -3.332989957578539 1.7903541140988317 0 1 0 +63 1 1.6040989853168577 -2.8917377487223326 2.9749125296584396 -1 1 0 +27 1 0.22872838010698016 -2.994984028716655 2.6653598205127595 0 0 1 +10 1 0.9362147196804173 -2.581105523755157 1.9878669654444103 0 0 1 +185 1 0.06742724446398485 -1.8726052150227481 3.179787889614259 -2 1 -1 +62 1 0.9381874848569671 3.2183812476038773 2.122950032967029 0 0 0 +108 1 3.2075816395574557 -2.6473251670969744 3.3899630726255054 1 1 -1 +168 1 -3.4886505297786643 -3.024902771510678 1.648075348189236 0 1 -2 +96 1 2.193516168781477 -3.220451114036294 2.031971070369377 -2 2 -1 +57 1 2.897670474066688 -1.7869273194590956 2.7802854592878443 1 0 0 +155 1 2.0203257801003764 -2.093908363815807 2.3651374010253265 0 0 -1 +70 1 -2.289198729241698 -1.0693505000499786 3.3341581014665116 0 1 1 +86 1 3.4317154036170927 -1.33629793948954 1.5868690985104916 -2 0 0 +4 1 -2.642034929204445 -0.5735696636076526 2.24988074624273 0 0 -1 +148 1 -2.7958435550832177 -1.6271830272245196 2.4651167378398258 0 0 0 +197 1 -1.6297637248397103 -1.2496732630952756 2.4653302717640746 0 -1 -1 +23 1 -1.4165843839294037 -0.23332219410733462 -3.3887252652014874 0 0 -1 +78 1 -0.8539129642965406 -1.4368914881460948 3.1097976169270467 1 -1 1 +134 1 -0.7681520363929484 -1.1354013495310054 1.8538106613640677 -1 0 0 +66 1 -0.23373724912576396 -0.5882558302750734 2.5656269999794135 -1 -1 -1 +160 1 -1.1132775718863501 0.16126595419727965 2.3994619853672896 0 0 0 +18 1 0.6168554097448792 -0.8675105647197154 3.3233443940314107 0 -1 -2 +5 1 0.21124689546372627 -1.527936340282886 2.128421015823146 0 -1 -1 +167 1 1.157996163161525 -1.3890474926504965 2.5930120556899743 0 1 -1 +176 1 0.7227757787132028 -0.4265054817409199 2.130677354553178 0 0 0 +77 1 2.0007502274099562 -0.6930768409753575 2.0562080526704536 0 -1 1 +136 1 2.059758900185651 -1.052357318680519 3.1194387358517117 0 -1 -2 +163 1 3.3650479388293877 -0.7812523229666395 2.7231341802578797 -1 -1 0 +53 1 -2.3141819292399695 1.20855609162257 -3.127003289906138 -1 -1 1 +34 1 -2.2520285035649175 0.34377072469492165 3.2433897655354262 1 0 -1 +82 1 -3.1361148993392707 0.2917712829104399 2.508598507937298 0 -1 -1 +47 1 -2.903472142580087 1.2996380231419302 2.6614912616951822 0 1 0 +159 1 -1.8421866316781088 1.3742261871908503 2.7832166426856038 0 0 0 +161 1 -1.2319440636738626 0.9387211724622819 -3.4892930122068617 1 0 2 +33 1 -0.4449542140900899 0.2769280403688486 3.289217283277774 0 -1 -1 +191 1 -0.8687075277531521 1.281273999295463 2.3493691514045447 1 -1 0 +20 1 -0.12835229617409075 0.4001437971686418 2.091186274425671 1 0 -1 +21 1 1.5590447736292827 0.23116165627532026 2.4331182207698356 1 0 -1 +83 1 0.6019872094726322 0.17868421219256525 2.965010196172179 0 -2 0 +107 1 -0.09314344901480053 1.8386195873289717 2.9198165047206524 -1 1 0 +97 1 0.9500008570521725 1.1147256892756756 2.5445482565685626 0 -1 -1 +15 1 2.6866827472081427 0.05611542822496954 2.621280841687164 -1 0 -1 +40 1 2.0535009935702107 1.3482348414084473 2.153119101811638 0 0 0 +110 1 3.037377950690711 1.1454318013031137 2.4602998295324308 0 0 -2 +54 1 2.1368310833242825 0.6989281938007096 3.190545712320829 0 -1 -1 +71 1 -2.6906257490825327 2.3188264822083675 1.851572369390678 0 -1 -1 +45 1 -1.8822606439217724 2.5464355632785174 2.887157746831732 1 0 -1 +2 1 -1.527738763941238 2.1784215473644295 1.8498426738676617 1 -2 -1 +67 1 -1.014923597719753 2.0522310481028465 3.091487536680741 1 0 0 +192 1 -0.8672155474955553 3.087168735274927 2.6165250257240618 1 0 1 +124 1 -0.37769468839105996 2.5506571887551175 1.8053870882842125 1 -1 -1 +46 1 -0.2092884053324724 2.562694157698328 -3.2372195292692605 1 -1 -1 +114 1 -0.2001222858286487 -3.429888000295159 1.8301280696628333 0 0 0 +61 1 0.5140644440329998 2.208326878392573 2.2153556959139413 -1 -2 0 +169 1 1.5629071468921552 2.2983930760888316 2.2366483189031316 0 0 0 +128 1 -3.438885935852406 3.376929578988928 3.002455750479755 1 0 -2 +52 1 -3.4549495641597217 2.178628786705743 2.923210719991474 0 -1 0 +48 1 2.502392696348409 2.9340155922847346 2.5991521468190113 0 0 -1 diff --git a/examples/PACKAGES/pimd/lj_reduced_units/in.lmp b/examples/PACKAGES/pimd/lj_reduced_units/in.lmp new file mode 100644 index 0000000000..012214c4b2 --- /dev/null +++ b/examples/PACKAGES/pimd/lj_reduced_units/in.lmp @@ -0,0 +1,26 @@ +variable ibead uloop 32 pad + +units lj +atom_style atomic +atom_modify map yes +boundary p p p +pair_style lj/cut 2.8015 +read_data data.lj${ibead} + +pair_coeff * * 1.0 1.0 +pair_modify shift yes + +mass 1 1.0 + +timestep 0.00044905847 + +fix 1 all pimd/langevin ensemble nvt integrator obabo temp 1.00888 lj 0.00965188 3.4 39.948 4.135667403e-3 1.03646168908e-4 thermostat PILE_L ${ibead} + +thermo_style custom step temp f_1[*] vol press +thermo 100 +thermo_modify norm no format line "%d %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f %.16f" + +dump dcd all custom 1 ${ibead}.xyz id type x y z vx vy vz ix iy iz fx fy fz +dump_modify dcd sort id format line "%d %d %.16f %.16f %.16f %.16f %.16f %.16f %d %d %d %.16f %.16f %.16f" + +run 1000 diff --git a/examples/PACKAGES/pimd/lj_reduced_units/run.sh b/examples/PACKAGES/pimd/lj_reduced_units/run.sh new file mode 100644 index 0000000000..adc7f4b955 --- /dev/null +++ b/examples/PACKAGES/pimd/lj_reduced_units/run.sh @@ -0,0 +1 @@ +mpirun -np 2 $LMP -in in.lmp -p 2x1 -log log -screen screen From f6d94a95dddc33e7407e256e79374a69044fc01f Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Mon, 27 Mar 2023 22:45:14 -0400 Subject: [PATCH 045/172] fix whitespace in fix pimd doc --- doc/src/fix_pimd.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index e4a59b0078..1767acb134 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -106,7 +106,7 @@ thermostats in each chain. For example, for a simulation of N particles with P beads in each ring-polymer, the total number of NH thermostats would be 3 x N x P x Nc. -Fix *pimd/langevin* implements a Langevin thermostat in the normal mode +Fix *pimd/langevin* implements a Langevin thermostat in the normal mode representation, and also provides a barostat to sample the NPH/NPT ensembles. .. note:: @@ -273,7 +273,7 @@ related tasks for each of the partitions, e.g. forces in the normal mode representation. If the Catersian velocities and forces are needed, it is easy to perform the transformation when doing post-processing. - It is recommended to dump the image flags (*ix iy iz*) for fix *pimd/langevin*. It + It is recommended to dump the image flags (*ix iy iz*) for fix *pimd/langevin*. It will be useful if you want to calculate some estimators during post-processing. Restart, fix_modify, output, run start/stop, minimize info From 849933a687610642ff26bf3af5ead984f8634e22 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Mon, 27 Mar 2023 23:06:05 -0400 Subject: [PATCH 046/172] add difference part in fix pimd doc --- doc/src/fix_pimd.rst | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 1767acb134..fda002484a 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -269,13 +269,25 @@ related tasks for each of the partitions, e.g. read_restart system_${ibead}.restart2 .. note:: - Fix *pimd/langevin* dumps the Catersian coordinates, but dumps the velocities and - forces in the normal mode representation. If the Catersian velocities and forces are + Fix *pimd/langevin* dumps the Cartesian coordinates, but dumps the velocities and + forces in the normal mode representation. If the Cartesian velocities and forces are needed, it is easy to perform the transformation when doing post-processing. It is recommended to dump the image flags (*ix iy iz*) for fix *pimd/langevin*. It will be useful if you want to calculate some estimators during post-processing. +Major differences of *fix pimd/nvt* and *fix pimd/langevin* are: + + #. *Fix pimd/nvt* includes Cartesian pimd, normal mode pimd, and centroid md. *Fix pimd/langevin* only intends to support normal mode pimd, as it is commonly enough for thermodynamic sampling. + #. *Fix pimd/nvt* uses Nose-Hoover chain thermostat. *Fix pimd/langevin* uses Langevin thermostat. + #. *Fix pimd/langevin* provides barostat, so the npt ensemble can be sampled. *Fix pimd/nvt* only support nvt ensemble. + #. *Fix pimd/langevin* provides several quantum estimators in output. + #. *Fix pimd/langevin* allows multiple processes for each bead. For *fix pimd/nvt*, there is a large chance that multi-process tasks for each bead may fail. + #. The dump of *fix pimd/nvt* are all Cartesian. *Fix pimd/langevin* dumps normal-mode velocities and forces, and Cartesian coordinates. + +Initially, the inter-replica communication and normal mode transformation parts of *fix pimd/langevin* are written based on +those of *fix pimd/nvt*, but are significantly revised. + Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" From 19da998932f4df73954d81bc810d96d9f3df2981 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Mon, 27 Mar 2023 23:11:24 -0400 Subject: [PATCH 047/172] add Jacobian into utils/sphinx-config/false_positives.txt --- 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 fda9fb2b08..6a29c84974 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1613,6 +1613,7 @@ Izumi Izvekov izz Izz +Jacobian Jacobsen Jadhao Jadhav From 18e4ed2e322a51734ca3250ee9aa593a15ef9864 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 31 Mar 2023 00:59:35 -0400 Subject: [PATCH 048/172] do not transform velocity to normal mode in setup --- src/REPLICA/fix_pimd_langevin.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index d64d948ecf..6c5b1a0b09 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -450,13 +450,6 @@ void FixPIMDLangevin::setup(int vflag) for (int i = 0; i < nlocal; i++) domain->unmap_inv(x[i], image[i]); } - if (method == NMPIMD) { - inter_replica_comm(v); - if (cmode == SINGLE_PROC) - nmpimd_transform(bufsortedall, v, M_x2xp[universe->iworld]); - else if (cmode == MULTI_PROC) - nmpimd_transform(bufbeads, v, M_x2xp[universe->iworld]); - } post_force(vflag); compute_totke(); end_of_step(); From 25c449df8e2b78de7e4c29c8a8ec42ba71fbc8c5 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 31 Mar 2023 03:03:17 -0400 Subject: [PATCH 049/172] enable restart in fix pimd/langevin --- src/REPLICA/fix_pimd_langevin.cpp | 53 +++++++++++++++++++++++++++++-- src/REPLICA/fix_pimd_langevin.h | 5 +++ 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 6c5b1a0b09..b4ea68d49b 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -65,6 +65,7 @@ enum { SINGLE_PROC, MULTI_PROC }; FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), random(nullptr), c_pe(nullptr), c_press(nullptr) { + restart_global = 1; time_integrate = 1; tagsend = tagrecv = nullptr; bufsend = bufrecv = nullptr; @@ -254,6 +255,8 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : } } extvector = 1; + kBT = force->boltz * temp; + if (pstat_flag) baro_init(); // some initilizations @@ -376,7 +379,6 @@ void FixPIMDLangevin::init() } planck *= sp; hbar = planck / (2.0 * MY_PI); - kBT = force->boltz * temp; double beta = 1.0 / (force->boltz * temp); double _fbond = 1.0 * np * np / (beta * beta * hbar * hbar); @@ -408,7 +410,6 @@ void FixPIMDLangevin::init() nmpimd_init(); Langevin_init(); - if (pstat_flag) baro_init(); c_pe = modify->get_compute_by_id(id_pe); c_press = modify->get_compute_by_id(id_press); @@ -1371,6 +1372,54 @@ void FixPIMDLangevin::compute_totenthalpy() totenthalpy = tote + 1.5 * W * vw[0] * vw[0] * inverse_np + p_hydro * (volume - vol0); } +/* ---------------------------------------------------------------------- + pack entire state of Fix into one write +------------------------------------------------------------------------- */ + +void FixPIMDLangevin::write_restart(FILE *fp) +{ + int nsize = size_restart_global(); + + double *list; + memory->create(list,nsize,"FixPIMDLangevin:list"); + + pack_restart_data(list); + + if (comm->me == 0) { + int size = nsize * sizeof(double); + fwrite(&size,sizeof(int),1,fp); + fwrite(list,sizeof(double),nsize,fp); + } + + memory->destroy(list); +} +/* ---------------------------------------------------------------------- */ + +int FixPIMDLangevin::size_restart_global() +{ + int nsize = 6; + + return nsize; +} + +/* ---------------------------------------------------------------------- */ + +int FixPIMDLangevin::pack_restart_data(double *list) +{ + int n = 0; + for (int i=0; i<6; i++) { list[n++] = vw[i]; } + return n; +} + +/* ---------------------------------------------------------------------- */ + +void FixPIMDLangevin::restart(char *buf) +{ + int n = 0; + auto list = (double *) buf; + for (int i=0; i<6; i++) { vw[i] = list[n++]; } +} + /* ---------------------------------------------------------------------- */ double FixPIMDLangevin::compute_vector(int n) diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index 6d236718c7..79a2ee7477 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -175,6 +175,11 @@ class FixPIMDLangevin : public Fix { void compute_vir(); void compute_cvir(); void compute_totenthalpy(); + + void write_restart(FILE *fp) override; + int size_restart_global(); + int pack_restart_data(double *list); + void restart(char *buf) override; }; } // namespace LAMMPS_NS #endif From c37247eb5a75469493b7a81008c1b2fef9aa30e6 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 31 Mar 2023 03:09:34 -0400 Subject: [PATCH 050/172] add restart info in doc --- doc/src/fix_pimd.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index fda002484a..ae325023fd 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -297,7 +297,11 @@ quasi-beads to :doc:`binary restart files `. See the a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. -Fix *pimd/langevin* ... +Fix *pimd/langevin* writes the state of the barostat overall beads to +:doc:`binary restart files `. Since it uses a stochastic thermostat, +the state of the thermostat is not written. However, the state of the system +can be restored by reading the restart file, execpt that it will re-initialize +the random number generator. None of the :doc:`fix_modify ` options are relevant to fix pimd/nvt. From f444fe8fdf0b139a44f33e4b47120dd45173dea1 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 31 Mar 2023 03:12:38 -0400 Subject: [PATCH 051/172] fix spelling error --- doc/src/fix_pimd.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index ae325023fd..7116ce526b 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -300,7 +300,7 @@ operation of the fix continues in an uninterrupted fashion. Fix *pimd/langevin* writes the state of the barostat overall beads to :doc:`binary restart files `. Since it uses a stochastic thermostat, the state of the thermostat is not written. However, the state of the system -can be restored by reading the restart file, execpt that it will re-initialize +can be restored by reading the restart file, except that it will re-initialize the random number generator. None of the :doc:`fix_modify ` options From 42758d0780835ded30631f8ed1a815f98fff6ec2 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Fri, 31 Mar 2023 03:28:09 -0400 Subject: [PATCH 052/172] delete dynamically allocated arrays in destructor --- src/REPLICA/fix_pimd_langevin.cpp | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index b4ea68d49b..4d1ca2eb62 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -341,6 +341,45 @@ FixPIMDLangevin::~FixPIMDLangevin() delete[] id_pe; delete[] id_press; delete random; + delete c_pe; + delete c_press; + delete[] mass; + delete[] _omega_k; + delete[] Lan_c; + delete[] Lan_s; + delete[] tau_k; + delete[] c1_k; + delete[] c2_k; + delete[] plansend; + delete[] planrecv; + delete[] modeindex; + memory->destroy(xcall); + if (cmode == SINGLE_PROC) { + memory->destroy(bufsorted); + memory->destroy(outsorted); + memory->destroy(bufsortedall); + memory->destroy(buftransall); + memory->destroy(counts); + memory->destroy(displacements); + } + + if (cmode == MULTI_PROC) { + memory->destroy(bufsendall); + memory->destroy(bufrecvall); + memory->destroy(tagsendall); + memory->destroy(tagrecvall); + memory->destroy(counts); + memory->destroy(displacements); + } + memory->destroy(M_x2xp); + memory->destroy(M_xp2x); + memory->destroy(xc); + memory->destroy(x_unwrap); + memory->destroy(bufsend); + memory->destroy(bufrecv); + memory->destroy(tagsend); + memory->destroy(tagrecv); + memory->destroy(bufbeads); } /* ---------------------------------------------------------------------- */ From 7c98d4dba3b56407ff2209e3249c32df9092a36c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 May 2023 10:26:33 -0400 Subject: [PATCH 053/172] avoid null pointer dereferences by allocating a buffer for at least 1 item --- src/library.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/library.cpp b/src/library.cpp index cc4e748f57..33f49a4e53 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -3159,7 +3159,8 @@ void lammps_gather_bonds(void *handle, void *data) } tagint **bonds; - lmp->memory->create(bonds, localbonds, 3, "library:gather_bonds:localbonds"); + // add 1 to localbonds, so "bonds" does not become a NULL pointer + lmp->memory->create(bonds, localbonds+1, 3, "library:gather_bonds:localbonds"); lmp->atom->avec->pack_bond(bonds); MPI_Allgatherv(&bonds[0][0], 3*localbonds, MPI_LMP_TAGINT, data, bufsizes, bufoffsets, MPI_LMP_TAGINT, lmp->world); @@ -3269,7 +3270,8 @@ void lammps_gather_angles(void *handle, void *data) } tagint **angles; - lmp->memory->create(angles, localangles, 4, "library:gather_angles:localangles"); + // add 1 to localangles, so "angles" does not become a NULL pointer + lmp->memory->create(angles, localangles+1, 4, "library:gather_angles:localangles"); lmp->atom->avec->pack_angle(angles); MPI_Allgatherv(&angles[0][0], 4*localangles, MPI_LMP_TAGINT, data, bufsizes, bufoffsets, MPI_LMP_TAGINT, lmp->world); @@ -3380,7 +3382,8 @@ void lammps_gather_dihedrals(void *handle, void *data) } tagint **dihedrals; - lmp->memory->create(dihedrals, localdihedrals, 5, "library:gather_dihedrals:localdihedrals"); + // add 1 to localdihedrals, so "dihedrals" does not become a NULL pointer + lmp->memory->create(dihedrals, localdihedrals+1, 5, "library:gather_dihedrals:localdihedrals"); lmp->atom->avec->pack_dihedral(dihedrals); MPI_Allgatherv(&dihedrals[0][0], 5*localdihedrals, MPI_LMP_TAGINT, data, bufsizes, bufoffsets, MPI_LMP_TAGINT, lmp->world); @@ -3491,7 +3494,8 @@ void lammps_gather_impropers(void *handle, void *data) } tagint **impropers; - lmp->memory->create(impropers, localimpropers, 5, "library:gather_impropers:localimpropers"); + // add 1 to localimpropers, so "impropers" does not become a NULL pointer + lmp->memory->create(impropers, localimpropers+1, 5, "library:gather_impropers:localimpropers"); lmp->atom->avec->pack_improper(impropers); MPI_Allgatherv(&impropers[0][0], 5*localimpropers, MPI_LMP_TAGINT, data, bufsizes, bufoffsets, MPI_LMP_TAGINT, lmp->world); From 8736f97792ad951e3430bd678d56de2aa3d8e303 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 May 2023 17:35:14 -0400 Subject: [PATCH 054/172] remove dead code --- src/REPLICA/fix_pimd_langevin.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 4d1ca2eb62..3760c453ab 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -462,7 +462,6 @@ void FixPIMDLangevin::setup(int vflag) { int nlocal = atom->nlocal; double **x = atom->x; - double **v = atom->v; imageint *image = atom->image; if (mapflag) { for (int i = 0; i < nlocal; i++) domain->unmap(x[i], image[i]); From 79f3eb6a4d2fc2fa3ad596ede196efecda24ee16 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 May 2023 17:35:22 -0400 Subject: [PATCH 055/172] remove debug code --- src/REPLICA/fix_pimd_langevin.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 3760c453ab..733d38e038 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -644,10 +644,6 @@ void FixPIMDLangevin::end_of_step() compute_p_cv(); compute_tote(); if (pstat_flag) compute_totenthalpy(); - - if (update->ntimestep % 10000 == 0) { - if (universe->me == 0) printf("This is the end of step %lld.\n", update->ntimestep); - } } void FixPIMDLangevin::collect_xc() From 5d66dc6659718d2e16644a7b1c43ae50af134b6d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 May 2023 17:38:16 -0400 Subject: [PATCH 056/172] apply clang-format --- src/REPLICA/fix_pimd_langevin.cpp | 123 ++++++++++++++---------------- 1 file changed, 58 insertions(+), 65 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 733d38e038..67d7cabe02 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -47,7 +47,8 @@ using namespace LAMMPS_NS; using namespace FixConst; -using namespace MathConst; +using MathConst::MY_PI; +using MathConst::THIRD; enum { NMPIMD }; enum { PHYSICAL, NORMAL }; @@ -63,7 +64,7 @@ enum { SINGLE_PROC, MULTI_PROC }; /* ---------------------------------------------------------------------- */ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), random(nullptr), c_pe(nullptr), c_press(nullptr) + Fix(lmp, narg, arg), random(nullptr), c_pe(nullptr), c_press(nullptr) { restart_global = 1; time_integrate = 1; @@ -114,18 +115,18 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : int seed = -1; - for (int i = 0; i < 6; i++) - { + for (int i = 0; i < 6; i++) { p_flag[i] = 0; p_target[i] = 0.0; } for (int i = 3; i < narg - 1; i += 2) { if (strcmp(arg[i], "method") == 0) { - if (strcmp(arg[i + 1], "nmpimd") == 0)method = NMPIMD; - else error->universe_all(FLERR, "Unknown method parameter for fix pimd/langevin"); - } - else if (strcmp(arg[i], "integrator") == 0) { + if (strcmp(arg[i + 1], "nmpimd") == 0) + method = NMPIMD; + else + error->universe_all(FLERR, "Unknown method parameter for fix pimd/langevin"); + } else if (strcmp(arg[i], "integrator") == 0) { if (strcmp(arg[i + 1], "obabo") == 0) integrator = OBABO; else if (strcmp(arg[i + 1], "baoab") == 0) @@ -157,11 +158,11 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : "Unknown ensemble parameter for fix pimd/langevin. Only nve and nvt " "ensembles are supported!"); } else if (strcmp(arg[i], "fmass") == 0) { - fmass = utils::numeric(FLERR, arg[i+1], false, lmp); + fmass = utils::numeric(FLERR, arg[i + 1], false, lmp); if (fmass < 0.0 || fmass > np) error->universe_all(FLERR, "Invalid fmass value for fix pimd/langevin"); } else if (strcmp(arg[i], "sp") == 0) { - sp = utils::numeric(FLERR, arg[i+1], false, lmp); + sp = utils::numeric(FLERR, arg[i + 1], false, lmp); if (sp < 0.0) error->universe_all(FLERR, "Invalid sp value for fix pimd/nvt"); } else if (strcmp(arg[i], "fmmode") == 0) { if (strcmp(arg[i + 1], "physical") == 0) @@ -204,29 +205,29 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : error->universe_all(FLERR, "Unknown barostat parameter for fix pimd/langevin"); } else if (strcmp(arg[i], "iso") == 0) { pstyle = ISO; - Pext = utils::numeric(FLERR, arg[i+1], false, lmp); + Pext = utils::numeric(FLERR, arg[i + 1], false, lmp); p_target[0] = p_target[1] = p_target[2] = Pext; pdim = 3; } else if (strcmp(arg[i], "aniso") == 0) { pstyle = ANISO; p_flag[0] = p_flag[1] = p_flag[2] = 1; - Pext = utils::numeric(FLERR, arg[i+1], false, lmp); + Pext = utils::numeric(FLERR, arg[i + 1], false, lmp); p_target[0] = p_target[1] = p_target[2] = Pext; pdim = 3; } else if (strcmp(arg[i], "x") == 0) { pstyle = ANISO; p_flag[0] = 1; - p_target[0] = utils::numeric(FLERR, arg[i+1], false, lmp); + p_target[0] = utils::numeric(FLERR, arg[i + 1], false, lmp); pdim++; } else if (strcmp(arg[i], "y") == 0) { pstyle = ANISO; p_flag[1] = 1; - p_target[1] = utils::numeric(FLERR, arg[i+1], false, lmp); + p_target[1] = utils::numeric(FLERR, arg[i + 1], false, lmp); pdim++; } else if (strcmp(arg[i], "z") == 0) { pstyle = ANISO; p_flag[2] = 1; - p_target[2] = utils::numeric(FLERR, arg[i+1], false, lmp); + p_target[2] = utils::numeric(FLERR, arg[i + 1], false, lmp); pdim++; } else if (strcmp(arg[i], "taup") == 0) { tau_p = utils::numeric(FLERR, arg[i + 1], false, lmp); @@ -245,12 +246,12 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; vector_flag = 1; - if (!pstat_flag) size_vector = 10; + if (!pstat_flag) + size_vector = 10; else if (pstat_flag) { - if (pstyle == ISO){ - size_vector = 15; - } - else if (pstyle == ANISO){ + if (pstyle == ISO) { + size_vector = 15; + } else if (pstyle == ANISO) { size_vector = 17; } } @@ -271,7 +272,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : fixedpoint[0] = 0.5 * (domain->boxlo[0] + domain->boxhi[0]); fixedpoint[1] = 0.5 * (domain->boxlo[1] + domain->boxhi[1]); fixedpoint[2] = 0.5 * (domain->boxlo[2] + domain->boxhi[2]); - if (pstat_flag) { p_hydro = (p_target[0]+p_target[1]+p_target[2])/pdim; } + if (pstat_flag) { p_hydro = (p_target[0] + p_target[1] + p_target[2]) / pdim; } // initialize Marsaglia RNG with processor-unique seed @@ -293,8 +294,10 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : nreplica = universe->nworlds; ireplica = universe->iworld; - if (nreplica == 1) mapflag = 0; - else mapflag = 1; + if (nreplica == 1) + mapflag = 0; + else + mapflag = 1; int *iroots = new int[nreplica]; MPI_Group uworldgroup, rootgroup; @@ -426,7 +429,8 @@ void FixPIMDLangevin::init() fbond = _fbond * force->mvv2e; if ((universe->me == 0) && (universe->uscreen)) - fprintf(universe->uscreen, "fix pimd/langevin -P/(beta^2 * hbar^2) = %20.7lE (kcal/mol/A^2)\n\n", fbond); + fprintf(universe->uscreen, + "fix pimd/langevin -P/(beta^2 * hbar^2) = %20.7lE (kcal/mol/A^2)\n\n", fbond); if (integrator == OBABO) { dtf = 0.5 * update->dt * force->ftm2v; @@ -724,13 +728,10 @@ void FixPIMDLangevin::qc_step() if (barostat == BZP) { for (int i = 0; i < nlocal; i++) { for (int j = 0; j < 3; j++) { - if (p_flag[j]) - { + if (p_flag[j]) { x[i][j] = expq[j] * x[i][j] + (expq[j] - expp[j]) / 2. / vw[j] * v[i][j]; v[i][j] = expp[j] * v[i][j]; - } - else - { + } else { x[i][j] += dtv * v[i][j]; } } @@ -844,10 +845,9 @@ void FixPIMDLangevin::press_v_step() } else if (pstyle == ANISO) { compute_stress_tensor(); for (int ii = 0; ii < 3; ii++) { - if (p_flag[ii]) - { - vw[ii] += - dtv * (volume * np * (stress_tensor[ii] - p_hydro) / force->nktv2p + Vcoeff / beta_np) / W; + if (p_flag[ii]) { + vw[ii] += dtv * + (volume * np * (stress_tensor[ii] - p_hydro) / force->nktv2p + Vcoeff / beta_np) / W; if (universe->iworld == 0) { double dvw_proc = 0.0, dvw = 0.0; for (int i = 0; i < nlocal; i++) { @@ -875,10 +875,8 @@ void FixPIMDLangevin::press_o_step() MPI_Bcast(&vw[0], 1, MPI_DOUBLE, 0, universe->uworld); } else if (pstyle == ANISO) { if (universe->me == 0) { - for (int ii=0; ii<3; ii++) - { - if (p_flag[ii]) - { + for (int ii = 0; ii < 3; ii++) { + if (p_flag[ii]) { r1 = random->gaussian(); vw[ii] = c1 * vw[ii] + c2 * sqrt(1.0 / W / beta_np) * r1; } @@ -1155,9 +1153,9 @@ void FixPIMDLangevin::inter_replica_comm(double **ptr) m++; } MPI_Allgather(&m, 1, MPI_INT, counts, 1, MPI_INT, universe->uworld); - for (i = 0; i < nreplica; i++) { counts[i] *= 3; } + for (i = 0; i < nreplica; i++) counts[i] *= 3; displacements[0] = 0; - for (i = 0; i < nreplica - 1; i++) { displacements[i + 1] = displacements[i] + counts[i]; } + for (i = 0; i < nreplica - 1; i++) displacements[i + 1] = displacements[i] + counts[i]; MPI_Allgatherv(bufsorted[0], 3 * m, MPI_DOUBLE, bufsortedall[0], counts, displacements, MPI_DOUBLE, universe->uworld); } else if (cmode == MULTI_PROC) { @@ -1171,11 +1169,11 @@ void FixPIMDLangevin::inter_replica_comm(double **ptr) } MPI_Gather(&m, 1, MPI_INT, counts, 1, MPI_INT, 0, world); displacements[0] = 0; - for (i = 0; i < nprocs - 1; i++) { displacements[i + 1] = displacements[i] + counts[i]; } + for (i = 0; i < nprocs - 1; i++) displacements[i + 1] = displacements[i] + counts[i]; MPI_Gatherv(tagsend, m, MPI_LMP_TAGINT, tagsendall, counts, displacements, MPI_LMP_TAGINT, 0, world); - for (i = 0; i < nprocs; i++) { counts[i] *= 3; } - for (i = 0; i < nprocs - 1; i++) { displacements[i + 1] = displacements[i] + counts[i]; } + for (i = 0; i < nprocs; i++) counts[i] *= 3; + for (i = 0; i < nprocs - 1; i++) displacements[i + 1] = displacements[i] + counts[i]; MPI_Gatherv(bufsend[0], 3 * m, MPI_DOUBLE, bufsendall[0], counts, displacements, MPI_DOUBLE, 0, world); for (int iplan = 0; iplan < sizeplan; iplan++) { @@ -1203,15 +1201,15 @@ void FixPIMDLangevin::inter_replica_comm(double **ptr) /* ---------------------------------------------------------------------- */ -void FixPIMDLangevin::remove_com_motion(){ - if(universe->iworld == 0) - { - double **v = atom->v; - int *mask = atom->mask; +void FixPIMDLangevin::remove_com_motion() +{ + if (universe->iworld == 0) { + double **v = atom->v; + int *mask = atom->mask; int nlocal = atom->nlocal; - if (dynamic) masstotal = group->mass(igroup); + if (dynamic) masstotal = group->mass(igroup); double vcm[3]; - group->vcm(igroup,masstotal,vcm); + group->vcm(igroup, masstotal, vcm); for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { v[i][0] -= vcm[0]; @@ -1372,7 +1370,8 @@ void FixPIMDLangevin::compute_t_vir() void FixPIMDLangevin::compute_p_prim() { double inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); - p_prim = atom->natoms * np * force->boltz * temp * inv_volume - 1.0 / 1.5 * inv_volume * total_spring_energy; + p_prim = atom->natoms * np * force->boltz * temp * inv_volume - + 1.0 / 1.5 * inv_volume * total_spring_energy; p_prim *= force->nktv2p; } @@ -1415,14 +1414,14 @@ void FixPIMDLangevin::write_restart(FILE *fp) int nsize = size_restart_global(); double *list; - memory->create(list,nsize,"FixPIMDLangevin:list"); + memory->create(list, nsize, "FixPIMDLangevin:list"); pack_restart_data(list); if (comm->me == 0) { int size = nsize * sizeof(double); - fwrite(&size,sizeof(int),1,fp); - fwrite(list,sizeof(double),nsize,fp); + fwrite(&size, sizeof(int), 1, fp); + fwrite(list, sizeof(double), nsize, fp); } memory->destroy(list); @@ -1441,7 +1440,7 @@ int FixPIMDLangevin::size_restart_global() int FixPIMDLangevin::pack_restart_data(double *list) { int n = 0; - for (int i=0; i<6; i++) { list[n++] = vw[i]; } + for (int i = 0; i < 6; i++) list[n++] = vw[i]; return n; } @@ -1451,7 +1450,7 @@ void FixPIMDLangevin::restart(char *buf) { int n = 0; auto list = (double *) buf; - for (int i=0; i<6; i++) { vw[i] = list[n++]; } + for (int i = 0; i < 6; i++) vw[i] = list[n++]; } /* ---------------------------------------------------------------------- */ @@ -1470,7 +1469,7 @@ double FixPIMDLangevin::compute_vector(int n) if (n == 9) return p_cv; if (pstat_flag) { - volume = domain->xprd * domain->yprd * domain->zprd; + volume = domain->xprd * domain->yprd * domain->zprd; if (pstyle == ISO) { if (n == 10) return vw[0]; if (barostat == BZP) { @@ -1478,21 +1477,15 @@ double FixPIMDLangevin::compute_vector(int n) } else if (barostat == MTTK) { if (n == 11) return 1.5 * W * vw[0] * vw[0]; } - if (n == 12) { - return np * Pext * volume / force->nktv2p; - } - if (n == 13) { - return -Vcoeff * np * kBT * log(volume); - } + if (n == 12) { return np * Pext * volume / force->nktv2p; } + if (n == 13) { return -Vcoeff * np * kBT * log(volume); } if (n == 14) return totenthalpy; } else if (pstyle == ANISO) { if (n == 10) return vw[0]; if (n == 11) return vw[1]; if (n == 12) return vw[2]; if (n == 13) return 0.5 * W * (vw[0] * vw[0] + vw[1] * vw[1] + vw[2] * vw[2]); - if (n == 14) { - return np * Pext * volume / force->nktv2p; - } + if (n == 14) { return np * Pext * volume / force->nktv2p; } if (n == 15) { volume = domain->xprd * domain->yprd * domain->zprd; return -Vcoeff * np * kBT * log(volume); From 81a497adcd6d1fa52ac3bf0931bec76a7c8caaf4 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Thu, 18 May 2023 21:51:53 +0800 Subject: [PATCH 057/172] add standard version of ilp_water_2dm --- src/INTERLAYER/pair_ilp_graphene_hbn.cpp | 25 +-- src/INTERLAYER/pair_ilp_graphene_hbn.h | 38 +++- src/INTERLAYER/pair_ilp_tmd.cpp | 213 +++++++++++++++++++---- src/INTERLAYER/pair_ilp_tmd.h | 2 +- src/INTERLAYER/pair_ilp_water_2dm.cpp | 80 +++++++++ src/INTERLAYER/pair_ilp_water_2dm.h | 67 +++++++ 6 files changed, 373 insertions(+), 52 deletions(-) create mode 100644 src/INTERLAYER/pair_ilp_water_2dm.cpp create mode 100644 src/INTERLAYER/pair_ilp_water_2dm.h diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp index 0ff2811339..956d7ba2be 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp @@ -1,7 +1,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - LAMMPS development team: developers@lammps.org + 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 @@ -47,11 +47,11 @@ using namespace InterLayer; static const char cite_ilp[] = "ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848\n" "@Article{Ouyang2018\n" - " author = {W. Ouyang and D. Mandelli and M. Urbakh and O. Hod},\n" + " author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod},\n" " title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials},\n" " journal = {Nano Letters},\n" " volume = 18,\n" - " pages = 6009,\n" + " pages = {6009}\n" " year = 2018,\n" "}\n\n"; @@ -59,7 +59,10 @@ static const char cite_ilp[] = static std::map variant_map = { {PairILPGrapheneHBN::ILP_GrhBN, "ilp/graphene/hbn"}, {PairILPGrapheneHBN::ILP_TMD, "ilp/tmd"}, - {PairILPGrapheneHBN::SAIP_METAL, "saip/metal"}}; + {PairILPGrapheneHBN::ILP_PHOSPHORUS, "ilp/phosphorus"}, + {PairILPGrapheneHBN::ILP_WATER_2DM, "ilp/water/2dm"}, + {PairILPGrapheneHBN::SAIP_METAL, "saip/metal"}, + {PairILPGrapheneHBN::SAIP_METAL_TMD, "saip/metal/tmd"}}; /* ---------------------------------------------------------------------- */ @@ -313,14 +316,14 @@ void PairILPGrapheneHBN::read_file(char *filename) for (int m = 0; m < nparams; m++) { if (i == params[m].ielement && j == params[m].jelement) { if (n >= 0) - error->all(FLERR, "{} potential file {} has a duplicate entry for: {} {}", - variant_map[variant], filename, elements[i], elements[j]); + error->all(FLERR, "{} potential file {} has a duplicate entry", variant_map[variant], + filename); n = m; } } if (n < 0) - error->all(FLERR, "{} potential file {} is missing an entry for: {} {}", - variant_map[variant], filename, elements[i], elements[j]); + error->all(FLERR, "{} potential file {} is missing an entry", variant_map[variant], + filename); elem2param[i][j] = n; cutILPsq[i][j] = params[n].rcut * params[n].rcut; } @@ -632,7 +635,7 @@ void PairILPGrapheneHBN::calc_FRep(int eflag, int /* vflag */) void PairILPGrapheneHBN::ILP_neigh() { - int i, j, ii, jj, n, allnum, jnum, itype, jtype; + int i, j, ii, jj, n, inum, jnum, itype, jtype; double xtmp, ytmp, ztmp, delx, dely, delz, rsq; int *ilist, *jlist, *numneigh, **firstneigh; int *neighptr; @@ -649,7 +652,7 @@ void PairILPGrapheneHBN::ILP_neigh() (int **) memory->smalloc(maxlocal * sizeof(int *), "ILPGrapheneHBN:firstneigh"); } - allnum = list->inum + list->gnum; + inum = list->inum; // + list->gnum; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; @@ -659,7 +662,7 @@ void PairILPGrapheneHBN::ILP_neigh() ipage->reset(); - for (ii = 0; ii < allnum; ii++) { + for (ii = 0; ii < inum; ii++) { i = ilist[ii]; n = 0; diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.h b/src/INTERLAYER/pair_ilp_graphene_hbn.h index 9987830b1d..6381fb8f35 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.h +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - LAMMPS development team: developers@lammps.org + 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 @@ -35,11 +35,19 @@ class PairILPGrapheneHBN : public Pair { double init_one(int, int) override; void init_style() override; void calc_FvdW(int, int); + virtual void calc_FRep(int, int); + virtual void ILP_neigh(); + virtual void calc_normal(); + void read_file(char *); + void allocate(); + double single(int, int, int, int, double, double, double, double &) override; static constexpr int NPARAMS_PER_LINE = 13; - enum { ILP_GrhBN, ILP_TMD, SAIP_METAL }; // for telling class variants apart in shared code + // for telling class variants apart in shared code + enum { ILP_GrhBN, ILP_TMD, SAIP_METAL, + ILP_WATER_2DM, SAIP_METAL_TMD, ILP_PHOSPHORUS }; protected: int me; @@ -51,6 +59,7 @@ class PairILPGrapheneHBN : public Pair { int *ILP_numneigh; // # of pair neighbors for each atom int **ILP_firstneigh; // ptr to 1st neighbor of each atom int tap_flag; // flag to turn on/off taper function + double ncf; // for ilp/phosphorus, coefficients for calcualting the normals struct Param { double z0, alpha, epsilon, C, delta, d, sR, reff, C6, S; @@ -76,15 +85,28 @@ class PairILPGrapheneHBN : public Pair { double ***dpvet1; double ***dpvet2; double ***dNave; - - virtual void ILP_neigh(); - virtual void calc_normal(); - virtual void calc_FRep(int, int); - void read_file(char *); - void allocate(); }; } // namespace LAMMPS_NS #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. + +*/ diff --git a/src/INTERLAYER/pair_ilp_tmd.cpp b/src/INTERLAYER/pair_ilp_tmd.cpp index c024e23079..d855b9423d 100644 --- a/src/INTERLAYER/pair_ilp_tmd.cpp +++ b/src/INTERLAYER/pair_ilp_tmd.cpp @@ -1,7 +1,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - LAMMPS development team: developers@lammps.org + 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 @@ -22,12 +22,14 @@ #include "atom.h" #include "citeme.h" +#include "comm.h" #include "error.h" #include "force.h" #include "interlayer_taper.h" #include "memory.h" #include "my_page.h" #include "neigh_list.h" +#include "neighbor.h" #include #include @@ -35,22 +37,20 @@ using namespace LAMMPS_NS; using namespace InterLayer; -#define MAXLINE 1024 #define DELTA 4 #define PGDELTA 1 -static const char cite_ilp_tmd[] = - "ilp/tmd potential doi:10.1021/acs.jctc.1c00782\n" - "@Article{Ouyang2021\n" - " author = {W. Ouyang and R. Sofer and X. Gao and J. Hermann and\n" - " A. Tkatchenko and L. Kronik and M. Urbakh and O. Hod},\n" - " title = {Anisotropic Interlayer Force Field for Transition\n" - " Metal Dichalcogenides: The Case of Molybdenum Disulfide},\n" - " journal = {J.~Chem.\\ Theory Comput.},\n" - " volume = 17,\n" - " pages = {7237--7245}\n" - " year = 2021,\n" - "}\n\n"; +static const char cite_ilp_tmd[] = "ilp/tmd potential doi/10.1021/acs.jctc.1c00782\n" + "@Article{Ouyang2021\n" + " author = {W. Ouyang, R. Sofer, X. Gao, J. Hermann, A. " + "Tkatchenko, L. Kronik, M. Urbakh, and O. Hod},\n" + " title = {Anisotropic Interlayer Force Field for Transition " + "Metal Dichalcogenides: The Case of Molybdenum Disulfide},\n" + " journal = {J. Chem. Theory Comput.},\n" + " volume = 17,\n" + " pages = {7237–7245}\n" + " year = 2021,\n" + "}\n\n"; /* ---------------------------------------------------------------------- */ @@ -232,7 +232,7 @@ void PairILPTMD::calc_FRep(int eflag, int /* vflag */) void PairILPTMD::ILP_neigh() { - int i, j, l, ii, jj, ll, n, allnum, jnum, itype, jtype, ltype, imol, jmol, count; + int i, j, l, ii, jj, ll, n, inum, jnum, itype, jtype, ltype, imol, jmol, count; double xtmp, ytmp, ztmp, delx, dely, delz, deljx, deljy, deljz, rsq, rsqlj; int *ilist, *jlist, *numneigh, **firstneigh; int *neighsort; @@ -249,7 +249,7 @@ void PairILPTMD::ILP_neigh() ILP_firstneigh = (int **) memory->smalloc(maxlocal * sizeof(int *), "ILPTMD:firstneigh"); } - allnum = list->inum + list->gnum; + inum = list->inum; //+ list->gnum; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; @@ -259,7 +259,7 @@ void PairILPTMD::ILP_neigh() ipage->reset(); - for (ii = 0; ii < allnum; ii++) { + for (ii = 0; ii < inum; ii++) { i = ilist[ii]; //initialize varibles @@ -288,21 +288,21 @@ void PairILPTMD::ILP_neigh() delz = ztmp - x[j][2]; rsq = delx * delx + dely * dely + delz * delz; - // check if the atom i is TMD, i.e., Mo/S/W/Se - if (strcmp(elements[itype], "Mo") == 0 || strcmp(elements[itype], "W") == 0 || - strcmp(elements[itype], "S") == 0 || strcmp(elements[itype], "Se") == 0 || + // check if the atom i is a TMD atom, i.e., Mo/S/W/Se + if (strcmp(elements[itype], "Mo") == 0 || strcmp(elements[itype], "W") == 0 || + strcmp(elements[itype], "S") == 0 || strcmp(elements[itype], "Se") == 0 || strcmp(elements[itype], "Te") == 0) { if (rsq != 0 && rsq < cutILPsq[itype][jtype] && imol == jmol && type[i] == type[j]) { neighptr[n++] = j; } - } else { // atom i is C, B, N or H. + } else { // atom i can be P, C, B, N or H. if (rsq != 0 && rsq < cutILPsq[itype][jtype] && imol == jmol) { neighptr[n++] = j; } } } // loop over jj // if atom i is Mo/W/S/Se/Te, then sorting the orders of neighbors - if (strcmp(elements[itype], "Mo") == 0 || strcmp(elements[itype], "W") == 0 || - strcmp(elements[itype], "S") == 0 || strcmp(elements[itype], "Se") == 0 || + if (strcmp(elements[itype], "Mo") == 0 || strcmp(elements[itype], "W") == 0 || + strcmp(elements[itype], "S") == 0 || strcmp(elements[itype], "Se") == 0 || strcmp(elements[itype], "Te") == 0) { // initialize neighsort for (ll = 0; ll < n; ll++) { @@ -367,11 +367,11 @@ void PairILPTMD::ILP_neigh() ll++; } } // end of sorting the order of neighbors - } else { // for B/N/C/H atoms + } else { // for P/B/N/C/H atoms if (n > 3) error->one( FLERR, - "There are too many neighbors for B/N/C/H atoms, please check your configuration"); + "There are too many neighbors for P/B/N/C/H atoms, please check your configuration"); for (ll = 0; ll < n; ll++) { neighsort[ll] = neighptr[ll]; } } @@ -390,12 +390,14 @@ void PairILPTMD::calc_normal() { int i, j, ii, jj, inum, jnum; int cont, id, ip, m, k, itype; - double nn, xtp, ytp, ztp, delx, dely, delz, nn2; int *ilist, *jlist; + int iH1,iH2,jH1,jH2; double Nave[3], dni[3], dpvdri[3][3]; + double nn, xtp, ytp, ztp, delx, dely, delz, nn2; double **x = atom->x; int *type = atom->type; + tagint *tag = atom->tag; memory->destroy(dnn); memory->destroy(vect); @@ -479,9 +481,63 @@ void PairILPTMD::calc_normal() for (m = 0; m < Nnei; m++) { dnormal[i][id][m][ip] = 0.0; } } } + // for hydrogen in water molecule + if (strcmp(elements[itype], "Hw") == 0) { + if(cont == 0) { + jH1 = atom->map(tag[i] - 1); + jH2 = atom->map(tag[i] - 2); + iH1 = map[type[jH1]]; + iH2 = map[type[jH2]]; + if (strcmp(elements[iH1], "Ow") == 0 ) { + vect[0][0] = x[jH1][0] - xtp; + vect[0][1] = x[jH1][1] - ytp; + vect[0][2] = x[jH1][2] - ztp; + } else if (strcmp(elements[iH2], "Ow") == 0 ) { + vect[0][0] = x[jH2][0] - xtp; + vect[0][1] = x[jH2][1] - ytp; + vect[0][2] = x[jH2][2] - ztp; + } else { + fprintf(screen, "jH1 jH2 = %d %d\n", jH1,jH2); + fprintf(screen, "Atom Type = %d %d\n", type[jH1],type[jH2]); + fprintf(screen, "For atom i = %d %d\n", tag[i],type[i]); + error->one(FLERR, "The order of atoms in water molecule should be O H H !"); + } + } + Nave[0] = vect[0][0]; + Nave[1] = vect[0][1]; + Nave[2] = vect[0][2]; + // the magnitude of the normal vector + nn2 = Nave[0] * Nave[0] + Nave[1] * Nave[1] + Nave[2] * Nave[2]; + nn = sqrt(nn2); + if (nn == 0) error->one(FLERR, "The magnitude of the normal vector is zero"); + // the unit normal vector + normal[i][0] = Nave[0] / nn; + normal[i][1] = Nave[1] / nn; + normal[i][2] = Nave[2] / nn; + + // Calculte dNave/dri, defined as dpvdri + for (id = 0; id < 3; id++) { + for (ip = 0; ip < 3; ip++) { + if (ip == id) { dpvdri[id][ip] = -1.0;} + else {dpvdri[id][ip] = 0.0;} + } + } + + // derivatives of nn, dnn:3x1 vector + dni[0] = (Nave[0] * dpvdri[0][0] + Nave[1] * dpvdri[1][0] + Nave[2] * dpvdri[2][0]) / nn; + dni[1] = (Nave[0] * dpvdri[0][1] + Nave[1] * dpvdri[1][1] + Nave[2] * dpvdri[2][1]) / nn; + dni[2] = (Nave[0] * dpvdri[0][2] + Nave[1] * dpvdri[1][2] + Nave[2] * dpvdri[2][2]) / nn; + // derivatives of unit vector ni respect to ri, the result is 3x3 matrix + for (id = 0; id < 3; id++) { + for (ip = 0; ip < 3; ip++) { + dnormdri[i][id][ip] = dpvdri[id][ip] / nn - Nave[id] * dni[ip] / nn2; + dnormal[i][id][0][ip] = -dnormdri[i][id][ip]; + } + } + } } //############################ For the edge atoms of TMD ################################ - else if (cont < Nnei) { + else if (cont > 1 && cont < Nnei) { if (strcmp(elements[itype], "Mo") == 0 || strcmp(elements[itype], "W") == 0 || strcmp(elements[itype], "S") == 0 || strcmp(elements[itype], "Se") == 0) { // derivatives of Ni[l] respect to the cont neighbors @@ -557,8 +613,7 @@ void PairILPTMD::calc_normal() for (m = 0; m < cont; m++) { for (id = 0; id < 3; id++) { dnn[m][id] = (Nave[0] * dNave[0][m][id] + Nave[1] * dNave[1][m][id] + - Nave[2] * dNave[2][m][id]) / - nn; + Nave[2] * dNave[2][m][id]) / nn; } } // dnormal[i][id][m][ip]: the derivative of normal[i][id] respect to r[m][ip], id,ip=0,1,2. @@ -589,12 +644,107 @@ void PairILPTMD::calc_normal() } } } // for TMD + //############################ For Oxygen in the water molecule ####################### + else if (strcmp(elements[itype], "Ow") == 0) { + if(cont == 0) { + jH1 = atom->map(tag[i] + 1); + jH2 = atom->map(tag[i] + 2); + iH1 = map[type[jH1]]; + iH2 = map[type[jH2]]; + if (strcmp(elements[iH1], "Hw") == 0 && strcmp(elements[iH2], "Hw") == 0) { + vect[0][0] = x[jH1][0] - xtp; + vect[0][1] = x[jH1][1] - ytp; + vect[0][2] = x[jH1][2] - ztp; + + vect[1][0] = x[jH2][0] - xtp; + vect[1][1] = x[jH2][1] - ytp; + vect[1][2] = x[jH2][2] - ztp; + + cont = 2; + } else { + fprintf(screen, "jH1 jH2 = %d %d\n", jH1,jH2); + fprintf(screen, "Atom Type = %d %d\n", type[jH1],type[jH2]); + fprintf(screen, "ID and type of atom i = %d %d\n", tag[i],type[i]); + error->one(FLERR, "The order of atoms in water molecule should be O H H !"); + } + } + if (cont == 2) { + Nave[0] = (vect[0][0] + vect[1][0])/cont; + Nave[1] = (vect[0][1] + vect[1][1])/cont; + Nave[2] = (vect[0][2] + vect[1][2])/cont; + // the magnitude of the normal vector + nn2 = Nave[0] * Nave[0] + Nave[1] * Nave[1] + Nave[2] * Nave[2]; + nn = sqrt(nn2); + if (nn == 0) error->one(FLERR, "The magnitude of the normal vector is zero"); + // the unit normal vector + normal[i][0] = Nave[0] / nn; + normal[i][1] = Nave[1] / nn; + normal[i][2] = Nave[2] / nn; + + // derivatives of non-normalized normal vector, dNave:3xcontx3 array + // dNave[id][m][ip]: the derivatve of the id component of Nave + // respect to the ip component of atom m + for (id = 0; id < 3; id++) { + for (ip = 0; ip < 3; ip++) { + for (m = 0; m < cont; m++) { + if (ip == id) { dNave[id][m][ip] = 0.5;} + else {dNave[id][m][ip] = 0.0;} + } + } + } + // derivatives of nn, dnn:contx3 vector + // dnn[m][id]: the derivative of nn respect to r[m][id], m=0,...Nnei-1; id=0,1,2 + // r[m][id]: the id's component of atom m + for (m = 0; m < cont; m++) { + for (id = 0; id < 3; id++) { + dnn[m][id] = (Nave[0] * dNave[0][m][id] + Nave[1] * dNave[1][m][id] + + Nave[2] * dNave[2][m][id]) / nn; + } + } + // dnormal[i][id][m][ip]: the derivative of normal[i][id] respect to r[m][ip], id,ip=0,1,2. + // for atom m, which is a neighbor atom of atom i, m = 0,...,Nnei-1 + for (m = 0; m < cont; m++) { + for (id = 0; id < 3; id++) { + for (ip = 0; ip < 3; ip++) { + dnormal[i][id][m][ip] = dNave[id][m][ip] / nn - Nave[id] * dnn[m][ip] / nn2; + } + } + } + // Calculte dNave/dri, defined as dpvdri + for (id = 0; id < 3; id++) { + for (ip = 0; ip < 3; ip++) { + dpvdri[id][ip] = 0.0; + for (k = 0; k < cont; k++) { dpvdri[id][ip] -= dNave[id][k][ip]; } + } + } + + // derivatives of nn, dnn:3x1 vector + dni[0] = (Nave[0] * dpvdri[0][0] + Nave[1] * dpvdri[1][0] + Nave[2] * dpvdri[2][0]) / nn; + dni[1] = (Nave[0] * dpvdri[0][1] + Nave[1] * dpvdri[1][1] + Nave[2] * dpvdri[2][1]) / nn; + dni[2] = (Nave[0] * dpvdri[0][2] + Nave[1] * dpvdri[1][2] + Nave[2] * dpvdri[2][2]) / nn; + // derivatives of unit vector ni respect to ri, the result is 3x3 matrix + for (id = 0; id < 3; id++) { + for (ip = 0; ip < 3; ip++) { + dnormdri[i][id][ip] = dpvdri[id][ip] / nn - Nave[id] * dni[ip] / nn2; + } + } + // printf("%4d:\t%e %e %e\n\t%e %e %e\n\t%e %e %e\n", + // i, dnormdri[i][0][0], dnormdri[i][0][1], dnormdri[i][0][2], + // dnormdri[i][1][0],dnormdri[i][1][1],dnormdri[i][1][2], + // dnormdri[i][2][0],dnormdri[i][2][1],dnormdri[i][2][2]); + // exit(0); + } + else if (cont >= 3) { + error->one(FLERR, + "There are too many neighbors for calculating normals of water molecules"); + } + } //############################ For the edge & bulk atoms of GrhBN ################################ else { if (cont == 2) { for (ip = 0; ip < 3; ip++) { pvet[0][ip] = vect[0][modulo(ip + 1, 3)] * vect[1][modulo(ip + 2, 3)] - - vect[0][modulo(ip + 2, 3)] * vect[1][modulo(ip + 1, 3)]; + vect[0][modulo(ip + 2, 3)] * vect[1][modulo(ip + 1, 3)]; } // dpvet1[k][l][ip]: the derivatve of the k (=0,...cont-1)th Nik respect to the ip component of atom l // derivatives respect to atom l @@ -657,8 +807,7 @@ void PairILPTMD::calc_normal() for (m = 0; m < cont; m++) { for (id = 0; id < 3; id++) { dnn[m][id] = (Nave[0] * dNave[0][m][id] + Nave[1] * dNave[1][m][id] + - Nave[2] * dNave[2][m][id]) / - nn; + Nave[2] * dNave[2][m][id]) / nn; } } // dnormal[i][id][m][ip]: the derivative of normal[i][id] respect to r[m][ip], id,ip=0,1,2. diff --git a/src/INTERLAYER/pair_ilp_tmd.h b/src/INTERLAYER/pair_ilp_tmd.h index 8381c2e830..8d5446d49c 100644 --- a/src/INTERLAYER/pair_ilp_tmd.h +++ b/src/INTERLAYER/pair_ilp_tmd.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - LAMMPS development team: developers@lammps.org + 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 diff --git a/src/INTERLAYER/pair_ilp_water_2dm.cpp b/src/INTERLAYER/pair_ilp_water_2dm.cpp new file mode 100644 index 0000000000..58e56894f5 --- /dev/null +++ b/src/INTERLAYER/pair_ilp_water_2dm.cpp @@ -0,0 +1,80 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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: Wengen Ouyang (Wuhan University) + e-mail: w.g.ouyang at gmail dot com + + This is a full version of the potential described in + [Feng and Ouyang et al, J. Phys. Chem. C 127, 8704-8713 (2023).] +------------------------------------------------------------------------- */ + +#include "pair_ilp_water_2dm.h" + +#include "atom.h" +#include "citeme.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "interlayer_taper.h" +#include "memory.h" +#include "my_page.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" + +#include +#include + +using namespace LAMMPS_NS; +using namespace InterLayer; + +#define MAXLINE 1024 +#define DELTA 4 +#define PGDELTA 1 + +static const char cite_ilp_water[] = "ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464\n" + "@Article{Feng2023\n" + " author = {Z. Feng, Y. Yao, J. Liu, B. Wu, Z. Liu, and W. Ouyang},\n" + " title = {Registry-Dependent Potential for Interfaces of Water with Graphene},\n" + " journal = {J. Phys. Chem. C},\n" + " volume = 127,\n" + " pages = {8704-8713}\n" + " year = 2023,\n" + "}\n\n"; + +/* ---------------------------------------------------------------------- */ + +PairILPWATER2DM::PairILPWATER2DM(LAMMPS *lmp) : PairILPGrapheneHBN(lmp), PairILPTMD(lmp) +{ + variant = ILP_WATER_2DM; + single_enable = 0; + + // for TMD, each atom have six neighbors + Nnei = 6; + + if (lmp->citeme) lmp->citeme->add(cite_ilp_water); +} + +/* ---------------------------------------------------------------------- + global settings +------------------------------------------------------------------------- */ + +void PairILPWATER2DM::settings(int narg, char **arg) +{ + if (narg < 1 || narg > 2) error->all(FLERR, "Illegal pair_style command"); + if (!utils::strmatch(force->pair_style, "^hybrid/overlay")) + error->all(FLERR, "Pair style ilp/water/2dm must be used as sub-style with hybrid/overlay"); + + cut_global = utils::numeric(FLERR, arg[0], false, lmp); + if (narg == 2) tap_flag = utils::numeric(FLERR, arg[1], false, lmp); +} diff --git a/src/INTERLAYER/pair_ilp_water_2dm.h b/src/INTERLAYER/pair_ilp_water_2dm.h new file mode 100644 index 0000000000..c35d757ea0 --- /dev/null +++ b/src/INTERLAYER/pair_ilp_water_2dm.h @@ -0,0 +1,67 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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 +// clang-format off +PairStyle(ilp/water/2dm,PairILPWATER2DM); +// clang-format on +#else + +#ifndef LMP_PAIR_ILP_WATER_2DM_H +#define LMP_PAIR_ILP_WATER_2DM_H + +#include "pair_ilp_tmd.h" + +namespace LAMMPS_NS { + +class PairILPWATER2DM : virtual public PairILPTMD { + public: + PairILPWATER2DM(class LAMMPS *); + + protected: + void settings(int, char **) override; + + /**************************************************************/ + /* modulo operation with cycling around range */ + + inline int modulo(int k, int range) + { + if (k < 0) k += range; + return k % range; + } + /**************************************************************/ +}; + +} // namespace LAMMPS_NS + +#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 cc30c4478dcfe6c73d908398437cc58909d1be5c Mon Sep 17 00:00:00 2001 From: oywg11 Date: Thu, 18 May 2023 21:58:40 +0800 Subject: [PATCH 058/172] add optmized verion of ilp_water_2dm --- src/OPT/pair_ilp_graphene_hbn_opt.cpp | 99 +++++++++++++++++++++++---- src/OPT/pair_ilp_graphene_hbn_opt.h | 12 +++- src/OPT/pair_ilp_water_2dm_opt.cpp | 73 ++++++++++++++++++++ src/OPT/pair_ilp_water_2dm_opt.h | 39 +++++++++++ 4 files changed, 207 insertions(+), 16 deletions(-) create mode 100644 src/OPT/pair_ilp_water_2dm_opt.cpp create mode 100644 src/OPT/pair_ilp_water_2dm_opt.h diff --git a/src/OPT/pair_ilp_graphene_hbn_opt.cpp b/src/OPT/pair_ilp_graphene_hbn_opt.cpp index 586c44be08..63822ad4c6 100644 --- a/src/OPT/pair_ilp_graphene_hbn_opt.cpp +++ b/src/OPT/pair_ilp_graphene_hbn_opt.cpp @@ -1,7 +1,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - LAMMPS development team: developers@lammps.org + 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 @@ -23,24 +23,27 @@ #include "atom.h" #include "citeme.h" +#include "comm.h" #include "error.h" #include "force.h" #include "interlayer_taper.h" #include "memory.h" #include "neigh_list.h" +#include "neigh_request.h" #include "neighbor.h" +#include "pointers.h" #include -#include +#include using namespace LAMMPS_NS; using namespace InterLayer; static const char cite_ilp_cur[] = - "ilp/graphene/hbn/opt potential: doi:10.1145/3458817.3476137\n" + "ilp/graphene/hbn/opt potential doi:10.1145/3458817.3476137\n" "@inproceedings{gao2021lmff\n" - " author = {Gao, Ping and Duan, Xiaohui and others},\n" - " title = {{LMFF}: Efficient and Scalable Layered Materials Force Field on Heterogeneous " + " author = {Gao, Ping and Duan, Xiaohui and Others},\n" + " title = {LMFF: Efficient and Scalable Layered Materials Force Field on Heterogeneous " "Many-Core Processors},\n" " year = {2021},\n" " isbn = {9781450384421},\n" @@ -50,14 +53,12 @@ static const char cite_ilp_cur[] = " doi = {10.1145/3458817.3476137},\n" " booktitle = {Proceedings of the International Conference for High Performance Computing, " "Networking, Storage and Analysis},\n" - " pages = {42},\n" + " articleno = {42},\n" " numpages = {14},\n" - " location = {St.~Louis, Missouri},\n" + " location = {St. Louis, Missouri},\n" " series = {SC'21},\n" "}\n\n"; -static bool check_vdw(tagint itag, tagint jtag, double *xi, double *xj); - /* ---------------------------------------------------------------------- */ PairILPGrapheneHBNOpt::PairILPGrapheneHBNOpt(LAMMPS *lmp) : @@ -168,6 +169,36 @@ void PairILPGrapheneHBNOpt::compute(int eflag, int vflag) } } } + } else if (variant == ILP_WATER_2DM) { + if (eflag_global || eflag_atom) { + if (vflag_either) { + if (tap_flag) { + eval<6, 1, 1, 1, ILP_WATER_2DM>(); + } else { + eval<6, 1, 1, 0, ILP_WATER_2DM>(); + } + } else { + if (tap_flag) { + eval<6, 1, 0, 1, ILP_WATER_2DM>(); + } else { + eval<6, 1, 0, 0, ILP_WATER_2DM>(); + } + } + } else { + if (vflag_either) { + if (tap_flag) { + eval<6, 0, 1, 1, ILP_WATER_2DM>(); + } else { + eval<6, 0, 1, 0, ILP_WATER_2DM>(); + } + } else { + if (tap_flag) { + eval<6, 0, 0, 1, ILP_WATER_2DM>(); + } else { + eval<6, 0, 0, 0, ILP_WATER_2DM>(); + } + } + } } else if (variant == SAIP_METAL) { if (eflag_global || eflag_atom) { if (vflag_either) { @@ -255,7 +286,7 @@ void PairILPGrapheneHBNOpt::eval() rsq = delx * delx + dely * dely + delz * delz; if (rsq != 0 && rsq < cutILPsq[itype_map][jtype]) { - if (VARIANT == ILP_TMD && special_type[itype] && itype != type[j]) continue; + if ((VARIANT == ILP_TMD || VARIANT == ILP_WATER_2DM) && special_type[itype] == TMD_METAL && itype != type[j]) continue; if (ILP_nneigh >= MAX_NNEIGH) { error->one(FLERR, "There are too many neighbors for calculating normals"); } @@ -269,7 +300,8 @@ void PairILPGrapheneHBNOpt::eval() dproddni[2] = 0.0; double norm[3], dnormdxi[3][3], dnormdxk[MAX_NNEIGH][3][3]; - calc_normal(i, ILP_neigh, ILP_nneigh, norm, dnormdxi, dnormdxk); + + calc_normal(i, itype, ILP_neigh, ILP_nneigh, norm, dnormdxi, dnormdxk); for (jj = 0; jj < jnum_inter; jj++) { j = jlist_inter[jj]; @@ -298,7 +330,7 @@ void PairILPGrapheneHBNOpt::eval() Tap = 1.0; dTap = 0.0; } - if (VARIANT != SAIP_METAL || !special_type[itype]) { + if (VARIANT != SAIP_METAL || special_type[itype] != SAIP_BNCH) { // Calculate the transverse distance prodnorm1 = norm[0] * delx + norm[1] * dely + norm[2] * delz; rhosq1 = rsq - prodnorm1 * prodnorm1; // rho_ij @@ -310,7 +342,7 @@ void PairILPGrapheneHBNOpt::eval() frho1 = exp1 * p.C; Erep = 0.5 * p.epsilon + frho1; - if (VARIANT == SAIP_METAL && special_type[jtype]) { Erep += 0.5 * p.epsilon + p.C; } + if (VARIANT == SAIP_METAL && special_type[jtype] == SAIP_BNCH) { Erep += 0.5 * p.epsilon + p.C; } Vilp = exp0 * Erep; // derivatives @@ -428,6 +460,19 @@ inline void deriv_normal(double dndr[3][3], double *del, double *n, double rnnor dndr[1][2] = (del[1] * n[0] * n[1] + del[0] * (n[0] * n[0] + n[2] * n[2])) * rnnorm; dndr[2][2] = (del[1] * n[0] * n[2] - del[0] * n[1] * n[2]) * rnnorm; } +inline void deriv_hat(double dnhatdn[3][3], double *n, double rnnorm, double factor){ + double cfactor = rnnorm * factor; + dnhatdn[0][0] = (n[1]*n[1]+n[2]*n[2])*cfactor; + dnhatdn[1][0] = -n[1]*n[0]*cfactor; + dnhatdn[2][0] = -n[2]*n[0]*cfactor; + dnhatdn[0][1] = -n[0]*n[1]*cfactor; + dnhatdn[1][1] = (n[0]*n[0]+n[2]*n[2])*cfactor; + dnhatdn[2][1] = -n[2]*n[1]*cfactor; + dnhatdn[0][2] = -n[0]*n[2]*cfactor; + dnhatdn[1][2] = -n[1]*n[2]*cfactor; + dnhatdn[2][2] = (n[0]*n[0]+n[1]*n[1])*cfactor; + +} inline double normalize_factor(double *n) { double nnorm = sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]); @@ -441,7 +486,7 @@ inline double normalize_factor(double *n) Yet another normal calculation method for simpiler code. */ template -void PairILPGrapheneHBNOpt::calc_normal(int i, int *ILP_neigh, int nneigh, double *n, +void PairILPGrapheneHBNOpt::calc_normal(int i, int itype, int *ILP_neigh, int nneigh, double *n, double (*dnormdri)[3], double (*dnormdrk)[3][3]) { double **x = atom->x; @@ -475,6 +520,32 @@ void PairILPGrapheneHBNOpt::calc_normal(int i, int *ILP_neigh, int nneigh, doubl vet[jj][2] = x[j][2] - x[i][2]; } + //specialize for ILP_WATER_2DM for hydrogen has special normal vector rule + if (variant == ILP_WATER_2DM && special_type[itype] == WATER) { + if (nneigh == 1){ + n[0] = vet[0][0]; + n[1] = vet[0][1]; + n[2] = vet[0][2]; + + double rnnorm = normalize_factor(n); + + deriv_hat(dnormdri, n, rnnorm, -1.0); + deriv_hat(dnormdrk[0], n, rnnorm, 1.0); + + } else if (nneigh == 2){ + n[0] = (vet[0][0] + vet[1][0])*0.5; + n[1] = (vet[0][1] + vet[1][1])*0.5; + n[2] = (vet[0][2] + vet[1][2])*0.5; + double rnnorm = normalize_factor(n); + + deriv_hat(dnormdri, n, rnnorm, -1.0); + deriv_hat(dnormdrk[0], n, rnnorm, 0.5); + deriv_hat(dnormdrk[1], n, rnnorm, 0.5); + } else { + error->one(FLERR, "malformed water"); + } + return; + } if (nneigh <= 1) { n[0] = 0.0; n[1] = 0.0; diff --git a/src/OPT/pair_ilp_graphene_hbn_opt.h b/src/OPT/pair_ilp_graphene_hbn_opt.h index 0721014e00..bc22ab22b0 100644 --- a/src/OPT/pair_ilp_graphene_hbn_opt.h +++ b/src/OPT/pair_ilp_graphene_hbn_opt.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - LAMMPS development team: developers@lammps.org + 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 @@ -35,7 +35,7 @@ class PairILPGrapheneHBNOpt : virtual public PairILPGrapheneHBN { protected: void update_internal_list(); template - void calc_normal(int i, int *ILP_neigh, int nneigh, double *normal, double (*dnormdri)[3], + void calc_normal(int i, int itype, int *ILP_neigh, int nneigh, double *normal, double (*dnormdri)[3], double (*dnormdrk)[3][3]); template void eval(); @@ -44,6 +44,14 @@ class PairILPGrapheneHBNOpt : virtual public PairILPGrapheneHBN { int *special_type; int *num_intra, *num_inter, *num_vdw; int inum_max, jnum_max; + + enum special_type_const { + NOT_SPECIAL = 0, + TMD_METAL, + SAIP_BNCH, + WATER, + }; + }; } // namespace LAMMPS_NS diff --git a/src/OPT/pair_ilp_water_2dm_opt.cpp b/src/OPT/pair_ilp_water_2dm_opt.cpp new file mode 100644 index 0000000000..6cdac00ed9 --- /dev/null +++ b/src/OPT/pair_ilp_water_2dm_opt.cpp @@ -0,0 +1,73 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + This is an optimized version of ilp/water/2dm based on the contribution of: + author: Wengen Ouyang (Wuhan University) + e-mail: w.g.ouyang at gmail dot com + + Optimizations are done by: + author1: Xiaohui Duan (National Supercomputing Center in Wuxi, China) + e-mail: sunrise_duan at 126 dot com + + author2: Ping Gao (National Supercomputing Center in Wuxi, China) + e-mail: qdgaoping at gmail dot com + + Optimizations are described in: + Gao, Ping and Duan, Xiaohui, et al: + LMFF: Efficient and Scalable Layered Materials Force Field on Heterogeneous Many-Core Processors + DOI: 10.1145/3458817.3476137 + + Potential is described by: + [Feng and Ouyang et al, J. Phys. Chem. C 127, 8704-8713 (2023).] +*/ +#include "pair_ilp_water_2dm_opt.h" + +#include "atom.h" +#include "citeme.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "interlayer_taper.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" + +#include +#include + +using namespace LAMMPS_NS; +using namespace InterLayer; + +PairILPWATER2DMOpt::PairILPWATER2DMOpt(LAMMPS *lmp) : + PairILPGrapheneHBN(lmp), PairILPTMD(lmp), PairILPWATER2DM(lmp), PairILPGrapheneHBNOpt(lmp) +{ +} + +void PairILPWATER2DMOpt::coeff(int narg, char **args) +{ + PairILPTMD::coeff(narg, args); + memory->create(special_type, atom->ntypes + 1, "PairILPWATER2DMOpt:check_sublayer"); + for (int i = 1; i <= atom->ntypes; i++) { + int itype = map[i]; + if (strcmp(elements[itype], "Mo") == 0 || strcmp(elements[itype], "W") == 0 || + strcmp(elements[itype], "S") == 0 || strcmp(elements[itype], "Se") == 0 || + strcmp(elements[itype], "Te") == 0) { + special_type[i] = TMD_METAL; + } else if (strcmp(elements[itype], "Hw") == 0 || strcmp(elements[itype], "Ow") == 0) { + special_type[i] = WATER; + } else { + special_type[i] = NOT_SPECIAL; + } + } +} diff --git a/src/OPT/pair_ilp_water_2dm_opt.h b/src/OPT/pair_ilp_water_2dm_opt.h new file mode 100644 index 0000000000..25905643af --- /dev/null +++ b/src/OPT/pair_ilp_water_2dm_opt.h @@ -0,0 +1,39 @@ + /* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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 +// clang-format off +PairStyle(ilp/water/2dm/opt,PairILPWATER2DMOpt); +// clang-format on +#else + +#ifndef LMP_PAIR_ILP_WATER_2DM_OPT_H +#define LMP_PAIR_ILP_WATER_2DM_OPT_H + +#include "pair_ilp_graphene_hbn_opt.h" +#include "pair_ilp_water_2dm.h" + +namespace LAMMPS_NS { + +class PairILPWATER2DMOpt : public PairILPWATER2DM, public PairILPGrapheneHBNOpt { + public: + PairILPWATER2DMOpt(class LAMMPS *); + void coeff(int narg, char **args) override; + + protected: +}; + +} // namespace LAMMPS_NS +#endif +#endif + From af04ecc53217f52e32bc51f626cfdabc067792ec Mon Sep 17 00:00:00 2001 From: oywg11 Date: Thu, 18 May 2023 21:59:07 +0800 Subject: [PATCH 059/172] add potential file --- potentials/COH.ILP | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 potentials/COH.ILP diff --git a/potentials/COH.ILP b/potentials/COH.ILP new file mode 100755 index 0000000000..bd815b5c00 --- /dev/null +++ b/potentials/COH.ILP @@ -0,0 +1,28 @@ +# DATE: 2023-05-18 UNITS: metal CONTRIBUTOR: Wengen Ouyang w.g.ouyang@gmail.com CITATION: Z. Feng, ..., and W. Ouyang, J. Phys. Chem. C 127, 8704 (2023). +# Interlayer Potential (ILP) for water/graphene heterojunctions +# The parameters below are fitted against the PBE + MBD-NL DFT reference data from 2.5 A to 15 A. +# +# ----------------- Repulsion Potential ------------------++++++++++++++ Vdw Potential ++++++++++++++++************ +# beta(A) alpha delta(A) epsilon(meV) C(meV) d sR reff(A) C6(meV*A^6) S rcut +# For graphene and hydrocarbons +C C 3.205843 7.511126 1.235334 1.528338E-5 37.530428 15.499947 0.7954443 3.681440 25.714535E3 1.0 2.0 +H H 3.974540 6.53799 1.080633 0.6700556 0.8333833 15.022371 0.7490632 2.767223 1.6159581E3 1.0 1.2 +C H 2.642950 12.91410 1.020257 0.9750012 25.340996 15.222927 0.8115998 3.887324 5.6874617E3 1.0 1.5 +H C 2.642950 12.91410 1.020257 0.9750012 25.340996 15.222927 0.8115998 3.887324 5.6874617E3 1.0 1.5 + +# For water-graphene +C Ow 5.45369612 6.18172364 1.25025450 3.34909245 0.68780636 9.05706482 1.23249498 2.77577173 100226.55503127 1.0 2.0 +C Hw 2.55380862 9.68664390 1.96489198 41.77617053 -16.30012807 9.01568534 0.74415463 2.41545571 7409.12856378 1.0 2.0 +Ow C 5.45369612 6.18172364 1.25025450 3.34909245 0.68780636 9.05706482 1.23249498 2.77577173 100226.55503127 1.0 1.2 +Hw C 2.55380862 9.68664390 1.96489198 41.77617053 -16.30012807 9.01568534 0.74415463 2.41545571 7409.12856378 1.0 1.2 + +# # The ILPs for other systems are set to zero +H Ow 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +H Hw 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +Ow H 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +Hw H 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 + +Ow Ow 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +Hw Hw 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +Ow Hw 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +Hw Ow 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 From 3d35d68a4bd9fc432e40239c5d0ad6c8169e75d1 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Thu, 18 May 2023 22:00:03 +0800 Subject: [PATCH 060/172] add doc file --- doc/src/pair_ilp_graphene_hbn.rst | 20 +-- doc/src/pair_ilp_tmd.rst | 4 +- doc/src/pair_ilp_water_2dm.rst | 166 ++++++++++++++++++++++++ doc/src/pair_kolmogorov_crespi_full.rst | 2 +- doc/src/pair_saip_metal.rst | 4 +- 5 files changed, 181 insertions(+), 15 deletions(-) create mode 100644 doc/src/pair_ilp_water_2dm.rst diff --git a/doc/src/pair_ilp_graphene_hbn.rst b/doc/src/pair_ilp_graphene_hbn.rst index de088f2926..36e971ef62 100644 --- a/doc/src/pair_ilp_graphene_hbn.rst +++ b/doc/src/pair_ilp_graphene_hbn.rst @@ -155,8 +155,8 @@ interactions. The BNCH.ILP potential file provided with LAMMPS (see the potentials directory) are parameterized for *metal* units. You can use this -potential with any LAMMPS units, but you would need to create your -BNCH.ILP potential file with coefficients listed in the appropriate +potential with any LAMMPS units, but you would need to create your own +custom BNCH.ILP potential file with coefficients listed in the appropriate units, if your simulation does not use *metal* units. Related commands @@ -181,6 +181,14 @@ tap_flag = 1 ---------- +.. _Ouyang1: + +**(Ouyang1)** W. Ouyang, D. Mandelli, M. Urbakh and O. Hod, Nano Lett. 18, 6009-6016 (2018). + +.. _Ouyang2: + +**(Ouyang2)** W. Ouyang et al., J. Chem. Theory Comput. 16(1), 666-676 (2020). + .. _Leven1: **(Leven1)** I. Leven, I. Azuri, L. Kronik and O. Hod, J. Chem. Phys. 140, 104106 (2014). @@ -196,11 +204,3 @@ tap_flag = 1 .. _Kolmogorov2: **(Kolmogorov)** A. N. Kolmogorov, V. H. Crespi, Phys. Rev. B 71, 235415 (2005). - -.. _Ouyang1: - -**(Ouyang1)** W. Ouyang, D. Mandelli, M. Urbakh and O. Hod, Nano Lett. 18, 6009-6016 (2018). - -.. _Ouyang2: - -**(Ouyang2)** W. Ouyang et al., J. Chem. Theory Comput. 16(1), 666-676 (2020). diff --git a/doc/src/pair_ilp_tmd.rst b/doc/src/pair_ilp_tmd.rst index 77fa8bbfd5..482d75a100 100644 --- a/doc/src/pair_ilp_tmd.rst +++ b/doc/src/pair_ilp_tmd.rst @@ -135,8 +135,8 @@ interactions. The TMD.ILP potential file provided with LAMMPS (see the potentials directory) are parameterized for *metal* units. You can use this -potential with any LAMMPS units, but you would need to create your -BNCH.ILP potential file with coefficients listed in the appropriate +potential with any LAMMPS units, but you would need to create your own +custom TMD.ILP potential file with coefficients listed in the appropriate units, if your simulation does not use *metal* units. Related commands diff --git a/doc/src/pair_ilp_water_2dm.rst b/doc/src/pair_ilp_water_2dm.rst new file mode 100644 index 0000000000..5dc287493b --- /dev/null +++ b/doc/src/pair_ilp_water_2dm.rst @@ -0,0 +1,166 @@ +.. index:: pair_style ilp/water/2dm +.. index:: pair_style ilp/water/2dm/opt + +pair_style ilp/tmd command +=================================== + +Accelerator Variant: *ilp/water/2dm/opt* + +Syntax +"""""" + +.. code-block:: LAMMPS + + pair_style [hybrid/overlay ...] ilp/tmd cutoff tap_flag + +* cutoff = global cutoff (distance units) +* tap_flag = 0/1 to turn off/on the taper function + +Examples +"""""""" + +.. code-block:: LAMMPS + + pair_style hybrid/overlay ilp/water/2dm 16.0 1 + pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw + + pair_style hybrid/overlay ilp/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 + pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O + pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H + pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H + pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw + +Description +""""""""""" + +.. versionadded:: xxxx2023 + +The *ilp/water/2dm* style computes the registry-dependent interlayer +potential (ILP) potential for interfaces of water with two-dimensinal (2D) +materials as described in :ref:`(Feng) `. + +.. math:: + + E = & \frac{1}{2} \sum_i \sum_{j \neq i} V_{ij} \\ + V_{ij} = & {\rm Tap}(r_{ij})\left \{ e^{-\alpha (r_{ij}/\beta -1)} + \left [ \epsilon + f(\rho_{ij}) + f(\rho_{ji})\right ] - + \frac{1}{1+e^{-d\left [ \left ( r_{ij}/\left (s_R \cdot r^{eff} \right ) \right )-1 \right ]}} + \cdot \frac{C_6}{r^6_{ij}} \right \}\\ + \rho_{ij}^2 = & r_{ij}^2 - ({\bf r}_{ij} \cdot {\bf n}_i)^2 \\ + \rho_{ji}^2 = & r_{ij}^2 - ({\bf r}_{ij} \cdot {\bf n}_j)^2 \\ + f(\rho) = & C e^{ -( \rho / \delta )^2 } \\ + {\rm Tap}(r_{ij}) = & 20\left ( \frac{r_{ij}}{R_{cut}} \right )^7 - + 70\left ( \frac{r_{ij}}{R_{cut}} \right )^6 + + 84\left ( \frac{r_{ij}}{R_{cut}} \right )^5 - + 35\left ( \frac{r_{ij}}{R_{cut}} \right )^4 + 1 + +Where :math:`\mathrm{Tap}(r_{ij})` is the taper function which provides +a continuous cutoff (up to third derivative) for interatomic separations +larger than :math:`r_c` :doc:`pair_style ilp_graphene_hbn `. + +It is important to include all the pairs to build the neighbor list for +calculating the normals. + +.. note:: + + Since each water molecule contains one oxygen atom and two hydrogen atoms, + a new definition is proposed (see In :ref:`(Feng) `),the atomic + normal vectors of hydrogen atoms are assumed to lie along the corresponding + oxygen-hydrogen bonds and the normal vector of the central oxygen atom + is defined as their average. + +The parameter file (e.g. COH.ILP), is intended for use with *metal* +:doc:`units `, with energies in meV. Two additional parameters, +*S*, and *rcut* are included in the parameter file. *S* is designed to +facilitate scaling of energies. *rcut* is designed to build the neighbor +list for calculating the normals for each atom pair. + +.. note:: + + The parameters presented in the parameter file (e.g. COH.ILP), + are fitted with taper function by setting the cutoff equal to 16.0 + Angstrom. Using different cutoff or taper function should be careful. + These parameters provide a good description in both short- and long-range + interaction regimes. This feature is essential for simulations in high pressure + regime (i.e., the interlayer distance is smaller than the equilibrium + distance). + +This potential must be used in combination with hybrid/overlay. +Other interactions can be set to zero using pair_style *none*\ . + +This pair style tallies a breakdown of the total interlayer potential +energy into sub-categories, which can be accessed via the :doc:`compute pair ` command as a vector of values of length 2. +The 2 values correspond to the following sub-categories: + +1. *E_vdW* = vdW (attractive) energy +2. *E_Rep* = Repulsive energy + +To print these quantities to the log file (with descriptive column +headings) the following commands could be included in an input script: + +.. code-block:: LAMMPS + + compute 0 all pair ilp/water/2dm + variable Evdw equal c_0[1] + variable Erep equal c_0[2] + thermo_style custom step temp epair v_Erep v_Evdw + +---------- + +.. include:: accel_styles.rst + +---------- + +Mixing, shift, table, tail correction, restart, rRESPA info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +This pair style does not support the pair_modify mix, shift, table, and +tail options. + +This pair style does not write their information to binary restart +files, 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. + +Restrictions +"""""""""""" + +This pair style is part of the INTERLAYER package. It is only enabled +if LAMMPS was built with that package. See the :doc:`Build package +` page for more info. + +This pair style requires the newton setting to be *on* for pair +interactions. + +The COH.ILP potential file provided with LAMMPS (see the potentials +directory) are parameterized for *metal* units. You can use this +potential with any LAMMPS units, but you would need to create your +COH.ILP potential file with coefficients listed in the appropriate +units, if your simulation does not use *metal* units. + +Related commands +"""""""""""""""" + +:doc:`pair_coeff `, +:doc:`pair_none `, +:doc:`pair_style hybrid/overlay `, +:doc:`pair_style drip `, +:doc:`pair_style ilp_tmd `, +:doc:`pair_style saip_metal `, +:doc:`pair_style ilp_graphene_hbn `, +:doc:`pair_style pair_kolmogorov_crespi_z `, +:doc:`pair_style pair_kolmogorov_crespi_full `, +:doc:`pair_style pair_lebedeva_z `, +:doc:`pair_style pair_coul_shield `. + +Default +""""""" + +tap_flag = 1 + + +---------- + +.. _Feng: + +**(Feng)** Z. Feng, W. Ouyang, J. Phys. Chem. C. accepted (2023). diff --git a/doc/src/pair_kolmogorov_crespi_full.rst b/doc/src/pair_kolmogorov_crespi_full.rst index 1a33a3f4bb..1a4706dd6f 100644 --- a/doc/src/pair_kolmogorov_crespi_full.rst +++ b/doc/src/pair_kolmogorov_crespi_full.rst @@ -129,7 +129,7 @@ interactions. The CH.KC potential file provided with LAMMPS (see the potentials folder) is parameterized for metal units. You can use this pair style with any LAMMPS units, but you would need to create your own custom -CC.KC potential file with all coefficients converted to the appropriate +CH.KC potential file with all coefficients converted to the appropriate units. Related commands diff --git a/doc/src/pair_saip_metal.rst b/doc/src/pair_saip_metal.rst index 21bfeb0aa9..ed011894c9 100644 --- a/doc/src/pair_saip_metal.rst +++ b/doc/src/pair_saip_metal.rst @@ -134,8 +134,8 @@ interactions. The CHAu.ILP potential file provided with LAMMPS (see the potentials directory) are parameterized for *metal* units. You can use this -potential with any LAMMPS units, but you would need to create your -BNCH.ILP potential file with coefficients listed in the appropriate +potential with any LAMMPS units, but you would need to create your own +custom CHAu.ILP potential file with coefficients listed in the appropriate units, if your simulation does not use *metal* units. Related commands From bbff6c25b33625a1b34ff95e581c78d59eb74e56 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Thu, 18 May 2023 22:01:19 +0800 Subject: [PATCH 061/172] add examples --- .../PACKAGES/interlayer/ilp_water_2dm/COH.ILP | 1 + .../interlayer/ilp_water_2dm/gra_water.data | 2040 +++++++++++++++++ .../interlayer/ilp_water_2dm/in.gr_water | 51 + .../interlayer/ilp_water_2dm/in.gr_water.opt | 51 + .../ilp_water_2dm/log.18May23.water.g++.1 | 234 ++ .../ilp_water_2dm/log.18May23.water.g++.4 | 234 ++ .../ilp_water_2dm/log.18May23.water.opt.g++.1 | 251 ++ .../ilp_water_2dm/log.18May23.water.opt.g++.4 | 251 ++ 8 files changed, 3113 insertions(+) create mode 120000 examples/PACKAGES/interlayer/ilp_water_2dm/COH.ILP create mode 100644 examples/PACKAGES/interlayer/ilp_water_2dm/gra_water.data create mode 100644 examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water create mode 100644 examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water.opt create mode 100644 examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.1 create mode 100644 examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.4 create mode 100644 examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.1 create mode 100644 examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.4 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/COH.ILP b/examples/PACKAGES/interlayer/ilp_water_2dm/COH.ILP new file mode 120000 index 0000000000..526995dae4 --- /dev/null +++ b/examples/PACKAGES/interlayer/ilp_water_2dm/COH.ILP @@ -0,0 +1 @@ +../../../../potentials/COH.ILP \ No newline at end of file diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/gra_water.data b/examples/PACKAGES/interlayer/ilp_water_2dm/gra_water.data new file mode 100644 index 0000000000..7e6d3925f0 --- /dev/null +++ b/examples/PACKAGES/interlayer/ilp_water_2dm/gra_water.data @@ -0,0 +1,2040 @@ +LAMMPS data file via write_data, version 23 Jun 2022, timestep = 100000 + +936 atoms +3 atom types +96 bonds +1 bond types +48 angles +1 angle types + +0 46.92336 xlo xhi +0 44.331078317370086 ylo yhi +0 200 zlo zhi + +Atoms # full + +1 1 1 0 0 0 0 0 0 0 +2 1 1 0 0.71096 1.231418842149169 0 0 0 0 +3 1 1 0 2.13288 1.231418842149169 0 0 0 0 +4 1 1 0 2.84384 0 0 0 0 0 +5 1 1 0 0 2.462837684298338 0 0 0 0 +6 1 1 0 0.71096 3.694256526447507 0 0 0 0 +7 1 1 0 2.13288 3.694256526447507 0 0 0 0 +8 1 1 0 2.84384 2.462837684298338 0 0 0 0 +9 1 1 0 0 4.925675368596676 0 0 0 0 +10 1 1 0 0.71096 6.157094210745845 0 0 0 0 +11 1 1 0 2.13288 6.157094210745845 0 0 0 0 +12 1 1 0 2.84384 4.925675368596676 0 0 0 0 +13 1 1 0 0 7.388513052895014 0 0 0 0 +14 1 1 0 0.71096 8.619931895044184 0 0 0 0 +15 1 1 0 2.13288 8.619931895044184 0 0 0 0 +16 1 1 0 2.84384 7.388513052895014 0 0 0 0 +17 1 1 0 0 9.851350737193352 0 0 0 0 +20 1 1 0 2.84384 9.851350737193352 0 0 0 0 +73 1 1 0 4.26576 0 0 0 0 0 +74 1 1 0 4.97672 1.231418842149169 0 0 0 0 +77 1 1 0 4.26576 2.462837684298338 0 0 0 0 +78 1 1 0 4.97672 3.694256526447507 0 0 0 0 +81 1 1 0 4.26576 4.925675368596676 0 0 0 0 +82 1 1 0 4.97672 6.157094210745845 0 0 0 0 +85 1 1 0 4.26576 7.388513052895014 0 0 0 0 +86 1 1 0 4.97672 8.619931895044184 0 0 0 0 +89 1 1 0 4.26576 9.851350737193352 0 0 0 0 +18 1 1 0 0.71096 11.082769579342521 0 0 0 0 +19 1 1 0 2.13288 11.082769579342521 0 0 0 0 +21 1 1 0 0 12.31418842149169 0 0 0 0 +22 1 1 0 0.71096 13.545607263640859 0 0 0 0 +23 1 1 0 2.13288 13.545607263640859 0 0 0 0 +24 1 1 0 2.84384 12.31418842149169 0 0 0 0 +25 1 1 0 0 14.777026105790029 0 0 0 0 +26 1 1 0 0.71096 16.008444947939196 0 0 0 0 +27 1 1 0 2.13288 16.008444947939196 0 0 0 0 +28 1 1 0 2.84384 14.777026105790029 0 0 0 0 +29 1 1 0 0 17.239863790088364 0 0 0 0 +30 1 1 0 0.71096 18.471282632237532 0 0 0 0 +31 1 1 0 2.13288 18.471282632237532 0 0 0 0 +32 1 1 0 2.84384 17.239863790088364 0 0 0 0 +33 1 1 0 0 19.702701474386703 0 0 0 0 +34 1 1 0 0.71096 20.93412031653587 0 0 0 0 +35 1 1 0 2.13288 20.93412031653587 0 0 0 0 +36 1 1 0 2.84384 19.702701474386703 0 0 0 0 +90 1 1 0 4.97672 11.082769579342521 0 0 0 0 +93 1 1 0 4.26576 12.31418842149169 0 0 0 0 +94 1 1 0 4.97672 13.545607263640859 0 0 0 0 +97 1 1 0 4.26576 14.777026105790029 0 0 0 0 +98 1 1 0 4.97672 16.008444947939196 0 0 0 0 +101 1 1 0 4.26576 17.239863790088364 0 0 0 0 +102 1 1 0 4.97672 18.471282632237532 0 0 0 0 +105 1 1 0 4.26576 19.702701474386703 0 0 0 0 +106 1 1 0 4.97672 20.93412031653587 0 0 0 0 +37 1 1 0 0 22.165539158685043 0 0 0 0 +38 1 1 0 0.71096 23.39695800083421 0 0 0 0 +39 1 1 0 2.13288 23.39695800083421 0 0 0 0 +40 1 1 0 2.84384 22.165539158685043 0 0 0 0 +41 1 1 0 0 24.62837684298338 0 0 0 0 +42 1 1 0 0.71096 25.859795685132546 0 0 0 0 +43 1 1 0 2.13288 25.859795685132546 0 0 0 0 +44 1 1 0 2.84384 24.62837684298338 0 0 0 0 +45 1 1 0 0 27.091214527281718 0 0 0 0 +46 1 1 0 0.71096 28.322633369430886 0 0 0 0 +47 1 1 0 2.13288 28.322633369430886 0 0 0 0 +48 1 1 0 2.84384 27.091214527281718 0 0 0 0 +49 1 1 0 0 29.554052211580057 0 0 0 0 +50 1 1 0 0.71096 30.785471053729225 0 0 0 0 +51 1 1 0 2.13288 30.785471053729225 0 0 0 0 +52 1 1 0 2.84384 29.554052211580057 0 0 0 0 +53 1 1 0 0 32.01688989587839 0 0 0 0 +56 1 1 0 2.84384 32.01688989587839 0 0 0 0 +109 1 1 0 4.26576 22.165539158685043 0 0 0 0 +110 1 1 0 4.97672 23.39695800083421 0 0 0 0 +113 1 1 0 4.26576 24.62837684298338 0 0 0 0 +114 1 1 0 4.97672 25.859795685132546 0 0 0 0 +117 1 1 0 4.26576 27.091214527281718 0 0 0 0 +118 1 1 0 4.97672 28.322633369430886 0 0 0 0 +121 1 1 0 4.26576 29.554052211580057 0 0 0 0 +122 1 1 0 4.97672 30.785471053729225 0 0 0 0 +125 1 1 0 4.26576 32.01688989587839 0 0 0 0 +54 1 1 0 0.71096 33.24830873802756 0 0 0 0 +55 1 1 0 2.13288 33.24830873802756 0 0 0 0 +57 1 1 0 0 34.47972758017673 0 0 0 0 +58 1 1 0 0.71096 35.711146422325896 0 0 0 0 +59 1 1 0 2.13288 35.711146422325896 0 0 0 0 +60 1 1 0 2.84384 34.47972758017673 0 0 0 0 +61 1 1 0 0 36.94256526447507 0 0 0 0 +62 1 1 0 0.71096 38.17398410662424 0 0 0 0 +63 1 1 0 2.13288 38.17398410662424 0 0 0 0 +64 1 1 0 2.84384 36.94256526447507 0 0 0 0 +65 1 1 0 0 39.40540294877341 0 0 0 0 +66 1 1 0 0.71096 40.636821790922575 0 0 0 0 +67 1 1 0 2.13288 40.636821790922575 0 0 0 0 +68 1 1 0 2.84384 39.40540294877341 0 0 0 0 +69 1 1 0 0 41.86824063307174 0 0 0 0 +70 1 1 0 0.71096 43.09965947522091 0 0 0 0 +71 1 1 0 2.13288 43.09965947522091 0 0 0 0 +72 1 1 0 2.84384 41.86824063307174 0 0 0 0 +126 1 1 0 4.97672 33.24830873802756 0 0 0 0 +129 1 1 0 4.26576 34.47972758017673 0 0 0 0 +130 1 1 0 4.97672 35.711146422325896 0 0 0 0 +133 1 1 0 4.26576 36.94256526447507 0 0 0 0 +134 1 1 0 4.97672 38.17398410662424 0 0 0 0 +137 1 1 0 4.26576 39.40540294877341 0 0 0 0 +138 1 1 0 4.97672 40.636821790922575 0 0 0 0 +141 1 1 0 4.26576 41.86824063307174 0 0 0 0 +142 1 1 0 4.97672 43.09965947522091 0 0 0 0 +75 1 1 0 6.39864 1.231418842149169 0 0 0 0 +76 1 1 0 7.1096 0 0 0 0 0 +79 1 1 0 6.39864 3.694256526447507 0 0 0 0 +80 1 1 0 7.1096 2.462837684298338 0 0 0 0 +83 1 1 0 6.39864 6.157094210745845 0 0 0 0 +84 1 1 0 7.1096 4.925675368596676 0 0 0 0 +87 1 1 0 6.39864 8.619931895044184 0 0 0 0 +88 1 1 0 7.1096 7.388513052895014 0 0 0 0 +92 1 1 0 7.1096 9.851350737193352 0 0 0 0 +145 1 1 0 8.53152 0 0 0 0 0 +146 1 1 0 9.24248 1.231418842149169 0 0 0 0 +147 1 1 0 10.6644 1.231418842149169 0 0 0 0 +148 1 1 0 11.37536 0 0 0 0 0 +149 1 1 0 8.53152 2.462837684298338 0 0 0 0 +150 1 1 0 9.24248 3.694256526447507 0 0 0 0 +151 1 1 0 10.6644 3.694256526447507 0 0 0 0 +152 1 1 0 11.37536 2.462837684298338 0 0 0 0 +153 1 1 0 8.53152 4.925675368596676 0 0 0 0 +154 1 1 0 9.24248 6.157094210745845 0 0 0 0 +155 1 1 0 10.6644 6.157094210745845 0 0 0 0 +156 1 1 0 11.37536 4.925675368596676 0 0 0 0 +157 1 1 0 8.53152 7.388513052895014 0 0 0 0 +158 1 1 0 9.24248 8.619931895044184 0 0 0 0 +159 1 1 0 10.6644 8.619931895044184 0 0 0 0 +160 1 1 0 11.37536 7.388513052895014 0 0 0 0 +161 1 1 0 8.53152 9.851350737193352 0 0 0 0 +164 1 1 0 11.37536 9.851350737193352 0 0 0 0 +91 1 1 0 6.39864 11.082769579342521 0 0 0 0 +95 1 1 0 6.39864 13.545607263640859 0 0 0 0 +96 1 1 0 7.1096 12.31418842149169 0 0 0 0 +99 1 1 0 6.39864 16.008444947939196 0 0 0 0 +100 1 1 0 7.1096 14.777026105790029 0 0 0 0 +103 1 1 0 6.39864 18.471282632237532 0 0 0 0 +104 1 1 0 7.1096 17.239863790088364 0 0 0 0 +107 1 1 0 6.39864 20.93412031653587 0 0 0 0 +108 1 1 0 7.1096 19.702701474386703 0 0 0 0 +162 1 1 0 9.24248 11.082769579342521 0 0 0 0 +163 1 1 0 10.6644 11.082769579342521 0 0 0 0 +165 1 1 0 8.53152 12.31418842149169 0 0 0 0 +166 1 1 0 9.24248 13.545607263640859 0 0 0 0 +167 1 1 0 10.6644 13.545607263640859 0 0 0 0 +168 1 1 0 11.37536 12.31418842149169 0 0 0 0 +169 1 1 0 8.53152 14.777026105790029 0 0 0 0 +170 1 1 0 9.24248 16.008444947939196 0 0 0 0 +171 1 1 0 10.6644 16.008444947939196 0 0 0 0 +172 1 1 0 11.37536 14.777026105790029 0 0 0 0 +173 1 1 0 8.53152 17.239863790088364 0 0 0 0 +174 1 1 0 9.24248 18.471282632237532 0 0 0 0 +175 1 1 0 10.6644 18.471282632237532 0 0 0 0 +176 1 1 0 11.37536 17.239863790088364 0 0 0 0 +177 1 1 0 8.53152 19.702701474386703 0 0 0 0 +178 1 1 0 9.24248 20.93412031653587 0 0 0 0 +179 1 1 0 10.6644 20.93412031653587 0 0 0 0 +180 1 1 0 11.37536 19.702701474386703 0 0 0 0 +111 1 1 0 6.39864 23.39695800083421 0 0 0 0 +112 1 1 0 7.1096 22.165539158685043 0 0 0 0 +115 1 1 0 6.39864 25.859795685132546 0 0 0 0 +116 1 1 0 7.1096 24.62837684298338 0 0 0 0 +119 1 1 0 6.39864 28.322633369430886 0 0 0 0 +120 1 1 0 7.1096 27.091214527281718 0 0 0 0 +123 1 1 0 6.39864 30.785471053729225 0 0 0 0 +124 1 1 0 7.1096 29.554052211580057 0 0 0 0 +128 1 1 0 7.1096 32.01688989587839 0 0 0 0 +181 1 1 0 8.53152 22.165539158685043 0 0 0 0 +182 1 1 0 9.24248 23.39695800083421 0 0 0 0 +183 1 1 0 10.6644 23.39695800083421 0 0 0 0 +184 1 1 0 11.37536 22.165539158685043 0 0 0 0 +185 1 1 0 8.53152 24.62837684298338 0 0 0 0 +186 1 1 0 9.24248 25.859795685132546 0 0 0 0 +187 1 1 0 10.6644 25.859795685132546 0 0 0 0 +188 1 1 0 11.37536 24.62837684298338 0 0 0 0 +189 1 1 0 8.53152 27.091214527281718 0 0 0 0 +190 1 1 0 9.24248 28.322633369430886 0 0 0 0 +191 1 1 0 10.6644 28.322633369430886 0 0 0 0 +192 1 1 0 11.37536 27.091214527281718 0 0 0 0 +193 1 1 0 8.53152 29.554052211580057 0 0 0 0 +194 1 1 0 9.24248 30.785471053729225 0 0 0 0 +195 1 1 0 10.6644 30.785471053729225 0 0 0 0 +196 1 1 0 11.37536 29.554052211580057 0 0 0 0 +197 1 1 0 8.53152 32.01688989587839 0 0 0 0 +200 1 1 0 11.37536 32.01688989587839 0 0 0 0 +127 1 1 0 6.39864 33.24830873802756 0 0 0 0 +131 1 1 0 6.39864 35.711146422325896 0 0 0 0 +132 1 1 0 7.1096 34.47972758017673 0 0 0 0 +135 1 1 0 6.39864 38.17398410662424 0 0 0 0 +136 1 1 0 7.1096 36.94256526447507 0 0 0 0 +139 1 1 0 6.39864 40.636821790922575 0 0 0 0 +140 1 1 0 7.1096 39.40540294877341 0 0 0 0 +143 1 1 0 6.39864 43.09965947522091 0 0 0 0 +144 1 1 0 7.1096 41.86824063307174 0 0 0 0 +198 1 1 0 9.24248 33.24830873802756 0 0 0 0 +199 1 1 0 10.6644 33.24830873802756 0 0 0 0 +201 1 1 0 8.53152 34.47972758017673 0 0 0 0 +202 1 1 0 9.24248 35.711146422325896 0 0 0 0 +203 1 1 0 10.6644 35.711146422325896 0 0 0 0 +204 1 1 0 11.37536 34.47972758017673 0 0 0 0 +205 1 1 0 8.53152 36.94256526447507 0 0 0 0 +206 1 1 0 9.24248 38.17398410662424 0 0 0 0 +207 1 1 0 10.6644 38.17398410662424 0 0 0 0 +208 1 1 0 11.37536 36.94256526447507 0 0 0 0 +209 1 1 0 8.53152 39.40540294877341 0 0 0 0 +210 1 1 0 9.24248 40.636821790922575 0 0 0 0 +211 1 1 0 10.6644 40.636821790922575 0 0 0 0 +212 1 1 0 11.37536 39.40540294877341 0 0 0 0 +213 1 1 0 8.53152 41.86824063307174 0 0 0 0 +214 1 1 0 9.24248 43.09965947522091 0 0 0 0 +215 1 1 0 10.6644 43.09965947522091 0 0 0 0 +216 1 1 0 11.37536 41.86824063307174 0 0 0 0 +217 1 1 0 12.79728 0 0 0 0 0 +218 1 1 0 13.50824 1.231418842149169 0 0 0 0 +219 1 1 0 14.93016 1.231418842149169 0 0 0 0 +220 1 1 0 15.64112 0 0 0 0 0 +221 1 1 0 12.79728 2.462837684298338 0 0 0 0 +222 1 1 0 13.50824 3.694256526447507 0 0 0 0 +223 1 1 0 14.93016 3.694256526447507 0 0 0 0 +224 1 1 0 15.64112 2.462837684298338 0 0 0 0 +225 1 1 0 12.79728 4.925675368596676 0 0 0 0 +226 1 1 0 13.50824 6.157094210745845 0 0 0 0 +227 1 1 0 14.93016 6.157094210745845 0 0 0 0 +228 1 1 0 15.64112 4.925675368596676 0 0 0 0 +229 1 1 0 12.79728 7.388513052895014 0 0 0 0 +230 1 1 0 13.50824 8.619931895044184 0 0 0 0 +231 1 1 0 14.93016 8.619931895044184 0 0 0 0 +232 1 1 0 15.64112 7.388513052895014 0 0 0 0 +233 1 1 0 12.79728 9.851350737193352 0 0 0 0 +236 1 1 0 15.64112 9.851350737193352 0 0 0 0 +289 1 1 0 17.06304 0 0 0 0 0 +293 1 1 0 17.06304 2.462837684298338 0 0 0 0 +297 1 1 0 17.06304 4.925675368596676 0 0 0 0 +301 1 1 0 17.06304 7.388513052895014 0 0 0 0 +305 1 1 0 17.06304 9.851350737193352 0 0 0 0 +234 1 1 0 13.50824 11.082769579342521 0 0 0 0 +235 1 1 0 14.93016 11.082769579342521 0 0 0 0 +237 1 1 0 12.79728 12.31418842149169 0 0 0 0 +238 1 1 0 13.50824 13.545607263640859 0 0 0 0 +239 1 1 0 14.93016 13.545607263640859 0 0 0 0 +240 1 1 0 15.64112 12.31418842149169 0 0 0 0 +241 1 1 0 12.79728 14.777026105790029 0 0 0 0 +242 1 1 0 13.50824 16.008444947939196 0 0 0 0 +243 1 1 0 14.93016 16.008444947939196 0 0 0 0 +244 1 1 0 15.64112 14.777026105790029 0 0 0 0 +245 1 1 0 12.79728 17.239863790088364 0 0 0 0 +246 1 1 0 13.50824 18.471282632237532 0 0 0 0 +247 1 1 0 14.93016 18.471282632237532 0 0 0 0 +248 1 1 0 15.64112 17.239863790088364 0 0 0 0 +249 1 1 0 12.79728 19.702701474386703 0 0 0 0 +250 1 1 0 13.50824 20.93412031653587 0 0 0 0 +251 1 1 0 14.93016 20.93412031653587 0 0 0 0 +252 1 1 0 15.64112 19.702701474386703 0 0 0 0 +309 1 1 0 17.06304 12.31418842149169 0 0 0 0 +313 1 1 0 17.06304 14.777026105790029 0 0 0 0 +317 1 1 0 17.06304 17.239863790088364 0 0 0 0 +321 1 1 0 17.06304 19.702701474386703 0 0 0 0 +253 1 1 0 12.79728 22.165539158685043 0 0 0 0 +254 1 1 0 13.50824 23.39695800083421 0 0 0 0 +255 1 1 0 14.93016 23.39695800083421 0 0 0 0 +256 1 1 0 15.64112 22.165539158685043 0 0 0 0 +257 1 1 0 12.79728 24.62837684298338 0 0 0 0 +258 1 1 0 13.50824 25.859795685132546 0 0 0 0 +259 1 1 0 14.93016 25.859795685132546 0 0 0 0 +260 1 1 0 15.64112 24.62837684298338 0 0 0 0 +261 1 1 0 12.79728 27.091214527281718 0 0 0 0 +262 1 1 0 13.50824 28.322633369430886 0 0 0 0 +263 1 1 0 14.93016 28.322633369430886 0 0 0 0 +264 1 1 0 15.64112 27.091214527281718 0 0 0 0 +265 1 1 0 12.79728 29.554052211580057 0 0 0 0 +266 1 1 0 13.50824 30.785471053729225 0 0 0 0 +267 1 1 0 14.93016 30.785471053729225 0 0 0 0 +268 1 1 0 15.64112 29.554052211580057 0 0 0 0 +269 1 1 0 12.79728 32.01688989587839 0 0 0 0 +272 1 1 0 15.64112 32.01688989587839 0 0 0 0 +325 1 1 0 17.06304 22.165539158685043 0 0 0 0 +329 1 1 0 17.06304 24.62837684298338 0 0 0 0 +333 1 1 0 17.06304 27.091214527281718 0 0 0 0 +337 1 1 0 17.06304 29.554052211580057 0 0 0 0 +341 1 1 0 17.06304 32.01688989587839 0 0 0 0 +270 1 1 0 13.50824 33.24830873802756 0 0 0 0 +271 1 1 0 14.93016 33.24830873802756 0 0 0 0 +273 1 1 0 12.79728 34.47972758017673 0 0 0 0 +274 1 1 0 13.50824 35.711146422325896 0 0 0 0 +275 1 1 0 14.93016 35.711146422325896 0 0 0 0 +276 1 1 0 15.64112 34.47972758017673 0 0 0 0 +277 1 1 0 12.79728 36.94256526447507 0 0 0 0 +278 1 1 0 13.50824 38.17398410662424 0 0 0 0 +279 1 1 0 14.93016 38.17398410662424 0 0 0 0 +280 1 1 0 15.64112 36.94256526447507 0 0 0 0 +281 1 1 0 12.79728 39.40540294877341 0 0 0 0 +282 1 1 0 13.50824 40.636821790922575 0 0 0 0 +283 1 1 0 14.93016 40.636821790922575 0 0 0 0 +284 1 1 0 15.64112 39.40540294877341 0 0 0 0 +285 1 1 0 12.79728 41.86824063307174 0 0 0 0 +286 1 1 0 13.50824 43.09965947522091 0 0 0 0 +287 1 1 0 14.93016 43.09965947522091 0 0 0 0 +288 1 1 0 15.64112 41.86824063307174 0 0 0 0 +345 1 1 0 17.06304 34.47972758017673 0 0 0 0 +349 1 1 0 17.06304 36.94256526447507 0 0 0 0 +353 1 1 0 17.06304 39.40540294877341 0 0 0 0 +357 1 1 0 17.06304 41.86824063307174 0 0 0 0 +290 1 1 0 17.774 1.231418842149169 0 0 0 0 +291 1 1 0 19.19592 1.231418842149169 0 0 0 0 +292 1 1 0 19.90688 0 0 0 0 0 +294 1 1 0 17.774 3.694256526447507 0 0 0 0 +295 1 1 0 19.19592 3.694256526447507 0 0 0 0 +296 1 1 0 19.90688 2.462837684298338 0 0 0 0 +298 1 1 0 17.774 6.157094210745845 0 0 0 0 +299 1 1 0 19.19592 6.157094210745845 0 0 0 0 +300 1 1 0 19.90688 4.925675368596676 0 0 0 0 +302 1 1 0 17.774 8.619931895044184 0 0 0 0 +303 1 1 0 19.19592 8.619931895044184 0 0 0 0 +304 1 1 0 19.90688 7.388513052895014 0 0 0 0 +308 1 1 0 19.90688 9.851350737193352 0 0 0 0 +361 1 1 0 21.3288 0 0 0 0 0 +362 1 1 0 22.03976 1.231418842149169 0 0 0 0 +365 1 1 0 21.3288 2.462837684298338 0 0 0 0 +366 1 1 0 22.03976 3.694256526447507 0 0 0 0 +369 1 1 0 21.3288 4.925675368596676 0 0 0 0 +370 1 1 0 22.03976 6.157094210745845 0 0 0 0 +373 1 1 0 21.3288 7.388513052895014 0 0 0 0 +374 1 1 0 22.03976 8.619931895044184 0 0 0 0 +377 1 1 0 21.3288 9.851350737193352 0 0 0 0 +306 1 1 0 17.774 11.082769579342521 0 0 0 0 +307 1 1 0 19.19592 11.082769579342521 0 0 0 0 +310 1 1 0 17.774 13.545607263640859 0 0 0 0 +311 1 1 0 19.19592 13.545607263640859 0 0 0 0 +312 1 1 0 19.90688 12.31418842149169 0 0 0 0 +314 1 1 0 17.774 16.008444947939196 0 0 0 0 +315 1 1 0 19.19592 16.008444947939196 0 0 0 0 +316 1 1 0 19.90688 14.777026105790029 0 0 0 0 +318 1 1 0 17.774 18.471282632237532 0 0 0 0 +319 1 1 0 19.19592 18.471282632237532 0 0 0 0 +320 1 1 0 19.90688 17.239863790088364 0 0 0 0 +322 1 1 0 17.774 20.93412031653587 0 0 0 0 +323 1 1 0 19.19592 20.93412031653587 0 0 0 0 +324 1 1 0 19.90688 19.702701474386703 0 0 0 0 +378 1 1 0 22.03976 11.082769579342521 0 0 0 0 +381 1 1 0 21.3288 12.31418842149169 0 0 0 0 +382 1 1 0 22.03976 13.545607263640859 0 0 0 0 +385 1 1 0 21.3288 14.777026105790029 0 0 0 0 +386 1 1 0 22.03976 16.008444947939196 0 0 0 0 +389 1 1 0 21.3288 17.239863790088364 0 0 0 0 +390 1 1 0 22.03976 18.471282632237532 0 0 0 0 +393 1 1 0 21.3288 19.702701474386703 0 0 0 0 +394 1 1 0 22.03976 20.93412031653587 0 0 0 0 +326 1 1 0 17.774 23.39695800083421 0 0 0 0 +327 1 1 0 19.19592 23.39695800083421 0 0 0 0 +328 1 1 0 19.90688 22.165539158685043 0 0 0 0 +330 1 1 0 17.774 25.859795685132546 0 0 0 0 +331 1 1 0 19.19592 25.859795685132546 0 0 0 0 +332 1 1 0 19.90688 24.62837684298338 0 0 0 0 +334 1 1 0 17.774 28.322633369430886 0 0 0 0 +335 1 1 0 19.19592 28.322633369430886 0 0 0 0 +336 1 1 0 19.90688 27.091214527281718 0 0 0 0 +338 1 1 0 17.774 30.785471053729225 0 0 0 0 +339 1 1 0 19.19592 30.785471053729225 0 0 0 0 +340 1 1 0 19.90688 29.554052211580057 0 0 0 0 +344 1 1 0 19.90688 32.01688989587839 0 0 0 0 +397 1 1 0 21.3288 22.165539158685043 0 0 0 0 +398 1 1 0 22.03976 23.39695800083421 0 0 0 0 +401 1 1 0 21.3288 24.62837684298338 0 0 0 0 +402 1 1 0 22.03976 25.859795685132546 0 0 0 0 +405 1 1 0 21.3288 27.091214527281718 0 0 0 0 +406 1 1 0 22.03976 28.322633369430886 0 0 0 0 +409 1 1 0 21.3288 29.554052211580057 0 0 0 0 +410 1 1 0 22.03976 30.785471053729225 0 0 0 0 +413 1 1 0 21.3288 32.01688989587839 0 0 0 0 +342 1 1 0 17.774 33.24830873802756 0 0 0 0 +343 1 1 0 19.19592 33.24830873802756 0 0 0 0 +346 1 1 0 17.774 35.711146422325896 0 0 0 0 +347 1 1 0 19.19592 35.711146422325896 0 0 0 0 +348 1 1 0 19.90688 34.47972758017673 0 0 0 0 +350 1 1 0 17.774 38.17398410662424 0 0 0 0 +351 1 1 0 19.19592 38.17398410662424 0 0 0 0 +352 1 1 0 19.90688 36.94256526447507 0 0 0 0 +354 1 1 0 17.774 40.636821790922575 0 0 0 0 +355 1 1 0 19.19592 40.636821790922575 0 0 0 0 +356 1 1 0 19.90688 39.40540294877341 0 0 0 0 +358 1 1 0 17.774 43.09965947522091 0 0 0 0 +359 1 1 0 19.19592 43.09965947522091 0 0 0 0 +360 1 1 0 19.90688 41.86824063307174 0 0 0 0 +414 1 1 0 22.03976 33.24830873802756 0 0 0 0 +417 1 1 0 21.3288 34.47972758017673 0 0 0 0 +418 1 1 0 22.03976 35.711146422325896 0 0 0 0 +421 1 1 0 21.3288 36.94256526447507 0 0 0 0 +422 1 1 0 22.03976 38.17398410662424 0 0 0 0 +425 1 1 0 21.3288 39.40540294877341 0 0 0 0 +426 1 1 0 22.03976 40.636821790922575 0 0 0 0 +429 1 1 0 21.3288 41.86824063307174 0 0 0 0 +430 1 1 0 22.03976 43.09965947522091 0 0 0 0 +363 1 1 0 23.46168 1.231418842149169 0 0 0 0 +364 1 1 0 24.17264 0 0 0 0 0 +367 1 1 0 23.46168 3.694256526447507 0 0 0 0 +368 1 1 0 24.17264 2.462837684298338 0 0 0 0 +371 1 1 0 23.46168 6.157094210745845 0 0 0 0 +372 1 1 0 24.17264 4.925675368596676 0 0 0 0 +375 1 1 0 23.46168 8.619931895044184 0 0 0 0 +376 1 1 0 24.17264 7.388513052895014 0 0 0 0 +380 1 1 0 24.17264 9.851350737193352 0 0 0 0 +433 1 1 0 25.59456 0 0 0 0 0 +434 1 1 0 26.30552 1.231418842149169 0 0 0 0 +435 1 1 0 27.72744 1.231418842149169 0 0 0 0 +436 1 1 0 28.4384 0 0 0 0 0 +437 1 1 0 25.59456 2.462837684298338 0 0 0 0 +438 1 1 0 26.30552 3.694256526447507 0 0 0 0 +439 1 1 0 27.72744 3.694256526447507 0 0 0 0 +440 1 1 0 28.4384 2.462837684298338 0 0 0 0 +441 1 1 0 25.59456 4.925675368596676 0 0 0 0 +442 1 1 0 26.30552 6.157094210745845 0 0 0 0 +443 1 1 0 27.72744 6.157094210745845 0 0 0 0 +444 1 1 0 28.4384 4.925675368596676 0 0 0 0 +445 1 1 0 25.59456 7.388513052895014 0 0 0 0 +446 1 1 0 26.30552 8.619931895044184 0 0 0 0 +447 1 1 0 27.72744 8.619931895044184 0 0 0 0 +448 1 1 0 28.4384 7.388513052895014 0 0 0 0 +449 1 1 0 25.59456 9.851350737193352 0 0 0 0 +452 1 1 0 28.4384 9.851350737193352 0 0 0 0 +824 2 3 0.5564 27.869304504728962 5.441231954072771 7.1662725516060455 0 1 0 +882 2 3 0.5564 28.591049353698207 2.8104183869168513 5.199459350263634 0 1 0 +915 2 3 0.5564 28.292441133424674 2.1988836940092424 7.463258849755662 0 1 0 +839 2 3 0.5564 26.910290112042958 6.063448035194025 5.063585745298239 0 1 0 +880 2 2 -1.1128 28.406942326033935 2.7991510311135688 4.260199050138843 0 1 0 +897 2 3 0.5564 27.747536325556545 1.2206385238286348 3.5735630764050397 0 1 0 +881 2 3 0.5564 29.245437925664305 3.008615335710485 3.848759968343325 0 1 0 +840 2 3 0.5564 27.732306784723644 4.9179177154124885 4.512269230492448 0 1 0 +823 2 2 -1.1128 27.744982568298607 4.921082089542739 7.960138430480629 0 1 0 +825 2 3 0.5564 28.164684169862443 5.433634827582471 8.651059816127074 0 1 0 +838 2 2 -1.1128 27.618723311223718 5.461577610249769 5.291862125144689 0 1 0 +918 2 3 0.5564 29.02685745449238 0.37211643590853727 5.955025086554165 0 1 0 +895 2 2 -1.1128 27.54700508575224 0.3218588761159764 3.312383533998835 0 1 0 +913 2 2 -1.1128 28.964145363419156 1.767681453892013 6.93494944041131 0 1 0 +896 2 3 0.5564 26.73803217297322 0.39396829884754553 2.8058305738430946 0 1 0 +379 1 1 0 23.46168 11.082769579342521 0 0 0 0 +383 1 1 0 23.46168 13.545607263640859 0 0 0 0 +384 1 1 0 24.17264 12.31418842149169 0 0 0 0 +387 1 1 0 23.46168 16.008444947939196 0 0 0 0 +388 1 1 0 24.17264 14.777026105790029 0 0 0 0 +391 1 1 0 23.46168 18.471282632237532 0 0 0 0 +392 1 1 0 24.17264 17.239863790088364 0 0 0 0 +395 1 1 0 23.46168 20.93412031653587 0 0 0 0 +396 1 1 0 24.17264 19.702701474386703 0 0 0 0 +450 1 1 0 26.30552 11.082769579342521 0 0 0 0 +451 1 1 0 27.72744 11.082769579342521 0 0 0 0 +453 1 1 0 25.59456 12.31418842149169 0 0 0 0 +454 1 1 0 26.30552 13.545607263640859 0 0 0 0 +455 1 1 0 27.72744 13.545607263640859 0 0 0 0 +456 1 1 0 28.4384 12.31418842149169 0 0 0 0 +457 1 1 0 25.59456 14.777026105790029 0 0 0 0 +458 1 1 0 26.30552 16.008444947939196 0 0 0 0 +459 1 1 0 27.72744 16.008444947939196 0 0 0 0 +460 1 1 0 28.4384 14.777026105790029 0 0 0 0 +461 1 1 0 25.59456 17.239863790088364 0 0 0 0 +462 1 1 0 26.30552 18.471282632237532 0 0 0 0 +463 1 1 0 27.72744 18.471282632237532 0 0 0 0 +464 1 1 0 28.4384 17.239863790088364 0 0 0 0 +465 1 1 0 25.59456 19.702701474386703 0 0 0 0 +466 1 1 0 26.30552 20.93412031653587 0 0 0 0 +467 1 1 0 27.72744 20.93412031653587 0 0 0 0 +468 1 1 0 28.4384 19.702701474386703 0 0 0 0 +399 1 1 0 23.46168 23.39695800083421 0 0 0 0 +400 1 1 0 24.17264 22.165539158685043 0 0 0 0 +403 1 1 0 23.46168 25.859795685132546 0 0 0 0 +404 1 1 0 24.17264 24.62837684298338 0 0 0 0 +407 1 1 0 23.46168 28.322633369430886 0 0 0 0 +408 1 1 0 24.17264 27.091214527281718 0 0 0 0 +411 1 1 0 23.46168 30.785471053729225 0 0 0 0 +412 1 1 0 24.17264 29.554052211580057 0 0 0 0 +416 1 1 0 24.17264 32.01688989587839 0 0 0 0 +469 1 1 0 25.59456 22.165539158685043 0 0 0 0 +470 1 1 0 26.30552 23.39695800083421 0 0 0 0 +471 1 1 0 27.72744 23.39695800083421 0 0 0 0 +472 1 1 0 28.4384 22.165539158685043 0 0 0 0 +473 1 1 0 25.59456 24.62837684298338 0 0 0 0 +474 1 1 0 26.30552 25.859795685132546 0 0 0 0 +475 1 1 0 27.72744 25.859795685132546 0 0 0 0 +476 1 1 0 28.4384 24.62837684298338 0 0 0 0 +477 1 1 0 25.59456 27.091214527281718 0 0 0 0 +478 1 1 0 26.30552 28.322633369430886 0 0 0 0 +479 1 1 0 27.72744 28.322633369430886 0 0 0 0 +480 1 1 0 28.4384 27.091214527281718 0 0 0 0 +481 1 1 0 25.59456 29.554052211580057 0 0 0 0 +482 1 1 0 26.30552 30.785471053729225 0 0 0 0 +483 1 1 0 27.72744 30.785471053729225 0 0 0 0 +484 1 1 0 28.4384 29.554052211580057 0 0 0 0 +485 1 1 0 25.59456 32.01688989587839 0 0 0 0 +488 1 1 0 28.4384 32.01688989587839 0 0 0 0 +415 1 1 0 23.46168 33.24830873802756 0 0 0 0 +419 1 1 0 23.46168 35.711146422325896 0 0 0 0 +420 1 1 0 24.17264 34.47972758017673 0 0 0 0 +423 1 1 0 23.46168 38.17398410662424 0 0 0 0 +424 1 1 0 24.17264 36.94256526447507 0 0 0 0 +427 1 1 0 23.46168 40.636821790922575 0 0 0 0 +428 1 1 0 24.17264 39.40540294877341 0 0 0 0 +431 1 1 0 23.46168 43.09965947522091 0 0 0 0 +432 1 1 0 24.17264 41.86824063307174 0 0 0 0 +486 1 1 0 26.30552 33.24830873802756 0 0 0 0 +487 1 1 0 27.72744 33.24830873802756 0 0 0 0 +489 1 1 0 25.59456 34.47972758017673 0 0 0 0 +490 1 1 0 26.30552 35.711146422325896 0 0 0 0 +491 1 1 0 27.72744 35.711146422325896 0 0 0 0 +492 1 1 0 28.4384 34.47972758017673 0 0 0 0 +493 1 1 0 25.59456 36.94256526447507 0 0 0 0 +494 1 1 0 26.30552 38.17398410662424 0 0 0 0 +495 1 1 0 27.72744 38.17398410662424 0 0 0 0 +496 1 1 0 28.4384 36.94256526447507 0 0 0 0 +497 1 1 0 25.59456 39.40540294877341 0 0 0 0 +498 1 1 0 26.30552 40.636821790922575 0 0 0 0 +499 1 1 0 27.72744 40.636821790922575 0 0 0 0 +500 1 1 0 28.4384 39.40540294877341 0 0 0 0 +501 1 1 0 25.59456 41.86824063307174 0 0 0 0 +502 1 1 0 26.30552 43.09965947522091 0 0 0 0 +503 1 1 0 27.72744 43.09965947522091 0 0 0 0 +504 1 1 0 28.4384 41.86824063307174 0 0 0 0 +916 2 2 -1.1128 29.08618298573557 43.94947838758336 5.367978087245454 0 0 0 +917 2 3 0.5564 28.386514599822995 44.08700021343198 4.729397955617813 0 0 0 +505 1 1 0 29.86032 0 0 0 0 0 +506 1 1 0 30.57128 1.231418842149169 0 0 0 0 +507 1 1 0 31.9932 1.231418842149169 0 0 0 0 +508 1 1 0 32.70416 0 0 0 0 0 +509 1 1 0 29.86032 2.462837684298338 0 0 0 0 +510 1 1 0 30.57128 3.694256526447507 0 0 0 0 +511 1 1 0 31.9932 3.694256526447507 0 0 0 0 +512 1 1 0 32.70416 2.462837684298338 0 0 0 0 +513 1 1 0 29.86032 4.925675368596676 0 0 0 0 +514 1 1 0 30.57128 6.157094210745845 0 0 0 0 +515 1 1 0 31.9932 6.157094210745845 0 0 0 0 +516 1 1 0 32.70416 4.925675368596676 0 0 0 0 +517 1 1 0 29.86032 7.388513052895014 0 0 0 0 +518 1 1 0 30.57128 8.619931895044184 0 0 0 0 +519 1 1 0 31.9932 8.619931895044184 0 0 0 0 +520 1 1 0 32.70416 7.388513052895014 0 0 0 0 +521 1 1 0 29.86032 9.851350737193352 0 0 0 0 +524 1 1 0 32.70416 9.851350737193352 0 0 0 0 +577 1 1 0 34.12608 0 0 0 0 0 +578 1 1 0 34.83704 1.231418842149169 0 0 0 0 +581 1 1 0 34.12608 2.462837684298338 0 0 0 0 +582 1 1 0 34.83704 3.694256526447507 0 0 0 0 +585 1 1 0 34.12608 4.925675368596676 0 0 0 0 +586 1 1 0 34.83704 6.157094210745845 0 0 0 0 +589 1 1 0 34.12608 7.388513052895014 0 0 0 0 +590 1 1 0 34.83704 8.619931895044184 0 0 0 0 +593 1 1 0 34.12608 9.851350737193352 0 0 0 0 +817 2 2 -1.1128 32.95909328018726 1.6637108808053531 5.668801991409098 0 1 0 +934 2 2 -1.1128 33.03662922860542 5.539750355496759 3.4106598806856026 0 1 0 +844 2 2 -1.1128 32.621956673723574 8.462510491174692 3.097685137766835 0 1 0 +865 2 2 -1.1128 33.39821533005053 4.27658110246568 8.57211051291085 0 1 0 +926 2 3 0.5564 34.92704311330822 0.3845425638438278 3.265292528280904 0 1 0 +936 2 3 0.5564 33.75132011550044 5.390752767402144 2.7915877722683704 0 1 0 +845 2 3 0.5564 32.95333393700144 7.6062659773288255 3.3683635070864155 0 1 0 +819 2 3 0.5564 32.7762889404034 1.1154582070700432 4.905758051766679 0 1 0 +884 2 3 0.5564 34.37559715270682 2.4504450164493186 4.161687719751862 0 1 0 +928 2 2 -1.1128 31.427550994207557 2.4943780016602988 7.958560374626963 0 1 0 +832 2 2 -1.1128 30.792128585762608 3.236529264630232 3.148554951507026 0 1 0 +866 2 3 0.5564 33.498279431301086 5.15245480897742 8.94502756132422 0 1 0 +879 2 3 0.5564 31.732225644992504 0.6458474538482556 8.445047264076692 0 1 0 +929 2 3 0.5564 31.77966866913706 2.4458814443480152 7.069800530214144 0 1 0 +935 2 3 0.5564 33.378544384335676 5.232733920405251 4.250343211939568 0 1 0 +909 2 3 0.5564 34.652364031673926 9.711776039203794 3.0913066271420564 0 1 0 +846 2 3 0.5564 31.81206671515871 8.574696009442315 3.595405469907686 0 1 0 +867 2 3 0.5564 34.29090448110653 3.9354082288573955 8.517893415156758 0 1 0 +914 2 3 0.5564 29.77283350609241 1.883495478021958 7.433793196056744 0 1 0 +818 2 3 0.5564 33.45847517590033 1.097384085601532 6.25712553579729 0 1 0 +793 2 2 -1.1128 31.42830690864691 0.30749748676379024 3.451602894838017 0 1 0 +833 2 3 0.5564 31.524189385665945 3.8525231665567263 3.17806031753671 0 1 0 +834 2 3 0.5564 31.198864521440843 2.3888322887806708 2.969088763806106 0 1 0 +930 2 3 0.5564 31.832512681924495 3.2758254964154077 8.334829251422462 0 1 0 +883 2 2 -1.1128 35.06386221461597 2.1652239249670107 3.56071142612891 0 1 0 +794 2 3 0.5564 31.07805011932854 0.1628051877054162 2.572616093573198 0 1 0 +795 2 3 0.5564 30.711778331953756 0.06543858818245951 4.038311517945166 0 1 0 +522 1 1 0 30.57128 11.082769579342521 0 0 0 0 +523 1 1 0 31.9932 11.082769579342521 0 0 0 0 +525 1 1 0 29.86032 12.31418842149169 0 0 0 0 +526 1 1 0 30.57128 13.545607263640859 0 0 0 0 +527 1 1 0 31.9932 13.545607263640859 0 0 0 0 +528 1 1 0 32.70416 12.31418842149169 0 0 0 0 +529 1 1 0 29.86032 14.777026105790029 0 0 0 0 +530 1 1 0 30.57128 16.008444947939196 0 0 0 0 +531 1 1 0 31.9932 16.008444947939196 0 0 0 0 +532 1 1 0 32.70416 14.777026105790029 0 0 0 0 +533 1 1 0 29.86032 17.239863790088364 0 0 0 0 +534 1 1 0 30.57128 18.471282632237532 0 0 0 0 +535 1 1 0 31.9932 18.471282632237532 0 0 0 0 +536 1 1 0 32.70416 17.239863790088364 0 0 0 0 +537 1 1 0 29.86032 19.702701474386703 0 0 0 0 +538 1 1 0 30.57128 20.93412031653587 0 0 0 0 +539 1 1 0 31.9932 20.93412031653587 0 0 0 0 +540 1 1 0 32.70416 19.702701474386703 0 0 0 0 +594 1 1 0 34.83704 11.082769579342521 0 0 0 0 +597 1 1 0 34.12608 12.31418842149169 0 0 0 0 +598 1 1 0 34.83704 13.545607263640859 0 0 0 0 +601 1 1 0 34.12608 14.777026105790029 0 0 0 0 +602 1 1 0 34.83704 16.008444947939196 0 0 0 0 +605 1 1 0 34.12608 17.239863790088364 0 0 0 0 +606 1 1 0 34.83704 18.471282632237532 0 0 0 0 +609 1 1 0 34.12608 19.702701474386703 0 0 0 0 +610 1 1 0 34.83704 20.93412031653587 0 0 0 0 +541 1 1 0 29.86032 22.165539158685043 0 0 0 0 +542 1 1 0 30.57128 23.39695800083421 0 0 0 0 +543 1 1 0 31.9932 23.39695800083421 0 0 0 0 +544 1 1 0 32.70416 22.165539158685043 0 0 0 0 +545 1 1 0 29.86032 24.62837684298338 0 0 0 0 +546 1 1 0 30.57128 25.859795685132546 0 0 0 0 +547 1 1 0 31.9932 25.859795685132546 0 0 0 0 +548 1 1 0 32.70416 24.62837684298338 0 0 0 0 +549 1 1 0 29.86032 27.091214527281718 0 0 0 0 +550 1 1 0 30.57128 28.322633369430886 0 0 0 0 +551 1 1 0 31.9932 28.322633369430886 0 0 0 0 +552 1 1 0 32.70416 27.091214527281718 0 0 0 0 +553 1 1 0 29.86032 29.554052211580057 0 0 0 0 +554 1 1 0 30.57128 30.785471053729225 0 0 0 0 +555 1 1 0 31.9932 30.785471053729225 0 0 0 0 +556 1 1 0 32.70416 29.554052211580057 0 0 0 0 +557 1 1 0 29.86032 32.01688989587839 0 0 0 0 +560 1 1 0 32.70416 32.01688989587839 0 0 0 0 +613 1 1 0 34.12608 22.165539158685043 0 0 0 0 +614 1 1 0 34.83704 23.39695800083421 0 0 0 0 +617 1 1 0 34.12608 24.62837684298338 0 0 0 0 +618 1 1 0 34.83704 25.859795685132546 0 0 0 0 +621 1 1 0 34.12608 27.091214527281718 0 0 0 0 +622 1 1 0 34.83704 28.322633369430886 0 0 0 0 +625 1 1 0 34.12608 29.554052211580057 0 0 0 0 +626 1 1 0 34.83704 30.785471053729225 0 0 0 0 +629 1 1 0 34.12608 32.01688989587839 0 0 0 0 +558 1 1 0 30.57128 33.24830873802756 0 0 0 0 +559 1 1 0 31.9932 33.24830873802756 0 0 0 0 +561 1 1 0 29.86032 34.47972758017673 0 0 0 0 +562 1 1 0 30.57128 35.711146422325896 0 0 0 0 +563 1 1 0 31.9932 35.711146422325896 0 0 0 0 +564 1 1 0 32.70416 34.47972758017673 0 0 0 0 +565 1 1 0 29.86032 36.94256526447507 0 0 0 0 +566 1 1 0 30.57128 38.17398410662424 0 0 0 0 +567 1 1 0 31.9932 38.17398410662424 0 0 0 0 +568 1 1 0 32.70416 36.94256526447507 0 0 0 0 +569 1 1 0 29.86032 39.40540294877341 0 0 0 0 +570 1 1 0 30.57128 40.636821790922575 0 0 0 0 +571 1 1 0 31.9932 40.636821790922575 0 0 0 0 +572 1 1 0 32.70416 39.40540294877341 0 0 0 0 +573 1 1 0 29.86032 41.86824063307174 0 0 0 0 +574 1 1 0 30.57128 43.09965947522091 0 0 0 0 +575 1 1 0 31.9932 43.09965947522091 0 0 0 0 +576 1 1 0 32.70416 41.86824063307174 0 0 0 0 +630 1 1 0 34.83704 33.24830873802756 0 0 0 0 +633 1 1 0 34.12608 34.47972758017673 0 0 0 0 +634 1 1 0 34.83704 35.711146422325896 0 0 0 0 +637 1 1 0 34.12608 36.94256526447507 0 0 0 0 +638 1 1 0 34.83704 38.17398410662424 0 0 0 0 +641 1 1 0 34.12608 39.40540294877341 0 0 0 0 +642 1 1 0 34.83704 40.636821790922575 0 0 0 0 +645 1 1 0 34.12608 41.86824063307174 0 0 0 0 +646 1 1 0 34.83704 43.09965947522091 0 0 0 0 +857 2 3 0.5564 31.280093348563454 40.92413736707893 6.6129915041108855 0 0 0 +856 2 2 -1.1128 31.40625202155322 40.21708321945418 7.245756851263454 0 0 0 +892 2 2 -1.1128 31.44124789790012 42.595258440016934 5.939207128004798 0 0 0 +893 2 3 0.5564 31.51332483392942 42.86716514991827 6.854141078427132 0 0 0 +886 2 2 -1.1128 34.01903467331608 42.21640858508662 5.249166944042416 0 0 0 +828 2 3 0.5564 32.936087243922984 39.01715292261755 6.258330984602254 0 0 0 +887 2 3 0.5564 33.06416149038681 42.23692223473913 5.31266208454256 0 0 0 +826 2 2 -1.1128 33.39528676861921 38.50985593645892 5.588989616608882 0 0 0 +827 2 3 0.5564 32.73225698170465 37.911697838992474 5.244270601582248 0 0 0 +894 2 3 0.5564 30.602363734473947 42.95262718865609 5.648014222802151 0 0 0 +925 2 2 -1.1128 34.84802945499661 43.76986891444704 3.140612646843307 0 0 0 +858 2 3 0.5564 30.675738345874993 40.309216087673825 7.857389270234698 0 0 0 +878 2 3 0.5564 32.99974881977633 44.200178456643876 8.15878411943684 0 0 0 +812 2 3 0.5564 34.62910581051034 43.605123868773425 6.411277828859756 0 0 0 +927 2 3 0.5564 34.27329532640793 43.48151669199635 3.849673061844464 0 0 0 +888 2 3 0.5564 34.21818732626533 41.3445338672516 4.907982839354571 0 0 0 +877 2 2 -1.1128 32.10811143071273 44.09784681673461 8.491565398531655 0 0 0 +835 2 2 -1.1128 35.185759286779124 40.039097016824876 3.8999166884707246 0 0 0 +811 2 2 -1.1128 34.72988962100261 44.30600404203223 7.05535990375944 0 0 0 +837 2 3 0.5564 34.873780058275806 39.29804634363621 4.419289163091052 0 0 0 +579 1 1 0 36.25896 1.231418842149169 0 0 0 0 +580 1 1 0 36.96992 0 0 0 0 0 +583 1 1 0 36.25896 3.694256526447507 0 0 0 0 +584 1 1 0 36.96992 2.462837684298338 0 0 0 0 +587 1 1 0 36.25896 6.157094210745845 0 0 0 0 +588 1 1 0 36.96992 4.925675368596676 0 0 0 0 +591 1 1 0 36.25896 8.619931895044184 0 0 0 0 +592 1 1 0 36.96992 7.388513052895014 0 0 0 0 +596 1 1 0 36.96992 9.851350737193352 0 0 0 0 +649 1 1 0 38.39184 0 0 0 0 0 +650 1 1 0 39.1028 1.231418842149169 0 0 0 0 +651 1 1 0 40.52472 1.231418842149169 0 0 0 0 +653 1 1 0 38.39184 2.462837684298338 0 0 0 0 +654 1 1 0 39.1028 3.694256526447507 0 0 0 0 +655 1 1 0 40.52472 3.694256526447507 0 0 0 0 +657 1 1 0 38.39184 4.925675368596676 0 0 0 0 +658 1 1 0 39.1028 6.157094210745845 0 0 0 0 +659 1 1 0 40.52472 6.157094210745845 0 0 0 0 +661 1 1 0 38.39184 7.388513052895014 0 0 0 0 +662 1 1 0 39.1028 8.619931895044184 0 0 0 0 +663 1 1 0 40.52472 8.619931895044184 0 0 0 0 +665 1 1 0 38.39184 9.851350737193352 0 0 0 0 +864 2 3 0.5564 38.72559977454883 6.453140217896254 3.9654022350817373 0 1 0 +885 2 3 0.5564 35.86457499683829 2.187926621046695 4.084712133041518 0 1 0 +891 2 3 0.5564 36.49290196320123 4.5825554857830815 2.340280303271688 0 1 0 +905 2 3 0.5564 35.6539726734068 6.533533581961909 4.2226103514317215 0 1 0 +847 2 2 -1.1128 38.31073636731568 9.297637163461909 3.018631746447206 0 1 0 +807 2 3 0.5564 39.93839438218238 3.380787594401584 8.070189977397536 0 1 0 +842 2 3 0.5564 40.4439801215969 3.4539357982168974 5.874913654515922 0 1 0 +806 2 3 0.5564 39.53388614087088 1.9224662216249124 8.030602383511098 0 1 0 +841 2 2 -1.1128 40.346631074078815 3.161275558289171 4.968764399811248 0 1 0 +848 2 3 0.5564 37.378243475312125 9.509492777618444 2.9761304825701878 0 1 0 +805 2 2 -1.1128 39.1879363509718 2.799773990143194 8.194559951043354 0 1 0 +862 2 2 -1.1128 39.527254402566676 6.871055409294266 3.6508699018474053 0 1 0 +808 2 2 -1.1128 40.9813125028353 6.491622655244695 6.1252186603712815 0 1 0 +863 2 3 0.5564 39.2982209112595 7.796620838566813 3.566577577839523 0 1 0 +906 2 3 0.5564 35.63016556188961 6.980217848903836 5.668916912294608 0 1 0 +803 2 3 0.5564 37.21046144155504 3.3547056748419672 8.44685444624274 0 1 0 +820 2 2 -1.1128 40.238058884519425 8.892908109209923 7.228256282347458 0 1 0 +813 2 3 0.5564 35.66411242895095 0.1828007460118728 7.039625445693748 0 1 0 +830 2 3 0.5564 37.461900361164744 5.761054225296827 7.339683551589981 0 1 0 +809 2 3 0.5564 40.143388183992 6.666539751684856 5.6968272273146985 0 1 0 +849 2 3 0.5564 38.545146461582334 9.064870760768706 2.1202418370825424 0 1 0 +814 2 2 -1.1128 40.748134171936435 0.7389880780512781 3.3949349561238815 0 1 0 +816 2 3 0.5564 40.34138668782936 1.5417691543993164 3.7210197692903493 0 1 0 +933 2 3 0.5564 38.42845468599284 3.199245505203782 4.980786350179616 0 1 0 +932 2 3 0.5564 37.36968971559904 3.309266240641299 6.057265875709786 0 1 0 +802 2 2 -1.1128 36.25679030038503 3.29601481677218 8.38941777770298 0 1 0 +931 2 2 -1.1128 37.542384613917065 2.9133905650069245 5.203046413341369 0 1 0 +907 2 2 -1.1128 35.578884551020806 9.573590646940167 3.2880229990945917 0 1 0 +831 2 3 0.5564 36.268287811817636 4.832138094401851 7.27407174097549 0 1 0 +804 2 3 0.5564 36.035479013673445 2.501960846901915 8.875969191698895 0 1 0 +904 2 2 -1.1128 35.40021179318659 7.265609687237741 4.784662067802107 0 1 0 +829 2 2 -1.1128 36.67463142628169 5.575159558617119 6.8279361567305 0 1 0 +890 2 3 0.5564 35.51445085753465 3.6096863189422184 2.96322151266684 0 1 0 +919 2 2 -1.1128 40.013239321978745 0.15668706717705305 7.440776242049551 0 1 0 +908 2 3 0.5564 35.58368296090604 8.875183376627756 3.9425735956748125 0 1 0 +800 2 3 0.5564 37.74677816296982 0.734680968209546 5.402507033516551 0 1 0 +859 2 2 -1.1128 40.622879392981964 10.272720036648469 4.720042613666213 0 1 0 +861 2 3 0.5564 39.78296055209543 10.382230179324548 4.274198380882334 0 1 0 +889 2 2 -1.1128 35.68276124895589 4.5449882413929235 2.8487022953494807 0 1 0 +860 2 3 0.5564 40.42792864795578 9.700111278266009 5.461896012943214 0 1 0 +822 2 3 0.5564 40.522133068490525 8.019471778966093 6.958729128356608 0 1 0 +821 2 3 0.5564 40.47731496825091 8.948235047845442 8.153419981025246 0 1 0 +595 1 1 0 36.25896 11.082769579342521 0 0 0 0 +599 1 1 0 36.25896 13.545607263640859 0 0 0 0 +600 1 1 0 36.96992 12.31418842149169 0 0 0 0 +603 1 1 0 36.25896 16.008444947939196 0 0 0 0 +604 1 1 0 36.96992 14.777026105790029 0 0 0 0 +607 1 1 0 36.25896 18.471282632237532 0 0 0 0 +608 1 1 0 36.96992 17.239863790088364 0 0 0 0 +611 1 1 0 36.25896 20.93412031653587 0 0 0 0 +612 1 1 0 36.96992 19.702701474386703 0 0 0 0 +666 1 1 0 39.1028 11.082769579342521 0 0 0 0 +667 1 1 0 40.52472 11.082769579342521 0 0 0 0 +669 1 1 0 38.39184 12.31418842149169 0 0 0 0 +670 1 1 0 39.1028 13.545607263640859 0 0 0 0 +671 1 1 0 40.52472 13.545607263640859 0 0 0 0 +673 1 1 0 38.39184 14.777026105790029 0 0 0 0 +674 1 1 0 39.1028 16.008444947939196 0 0 0 0 +675 1 1 0 40.52472 16.008444947939196 0 0 0 0 +677 1 1 0 38.39184 17.239863790088364 0 0 0 0 +678 1 1 0 39.1028 18.471282632237532 0 0 0 0 +679 1 1 0 40.52472 18.471282632237532 0 0 0 0 +681 1 1 0 38.39184 19.702701474386703 0 0 0 0 +682 1 1 0 39.1028 20.93412031653587 0 0 0 0 +683 1 1 0 40.52472 20.93412031653587 0 0 0 0 +615 1 1 0 36.25896 23.39695800083421 0 0 0 0 +616 1 1 0 36.96992 22.165539158685043 0 0 0 0 +619 1 1 0 36.25896 25.859795685132546 0 0 0 0 +620 1 1 0 36.96992 24.62837684298338 0 0 0 0 +623 1 1 0 36.25896 28.322633369430886 0 0 0 0 +624 1 1 0 36.96992 27.091214527281718 0 0 0 0 +627 1 1 0 36.25896 30.785471053729225 0 0 0 0 +628 1 1 0 36.96992 29.554052211580057 0 0 0 0 +632 1 1 0 36.96992 32.01688989587839 0 0 0 0 +685 1 1 0 38.39184 22.165539158685043 0 0 0 0 +686 1 1 0 39.1028 23.39695800083421 0 0 0 0 +687 1 1 0 40.52472 23.39695800083421 0 0 0 0 +689 1 1 0 38.39184 24.62837684298338 0 0 0 0 +690 1 1 0 39.1028 25.859795685132546 0 0 0 0 +691 1 1 0 40.52472 25.859795685132546 0 0 0 0 +693 1 1 0 38.39184 27.091214527281718 0 0 0 0 +694 1 1 0 39.1028 28.322633369430886 0 0 0 0 +695 1 1 0 40.52472 28.322633369430886 0 0 0 0 +697 1 1 0 38.39184 29.554052211580057 0 0 0 0 +698 1 1 0 39.1028 30.785471053729225 0 0 0 0 +699 1 1 0 40.52472 30.785471053729225 0 0 0 0 +701 1 1 0 38.39184 32.01688989587839 0 0 0 0 +631 1 1 0 36.25896 33.24830873802756 0 0 0 0 +635 1 1 0 36.25896 35.711146422325896 0 0 0 0 +636 1 1 0 36.96992 34.47972758017673 0 0 0 0 +639 1 1 0 36.25896 38.17398410662424 0 0 0 0 +640 1 1 0 36.96992 36.94256526447507 0 0 0 0 +643 1 1 0 36.25896 40.636821790922575 0 0 0 0 +644 1 1 0 36.96992 39.40540294877341 0 0 0 0 +647 1 1 0 36.25896 43.09965947522091 0 0 0 0 +648 1 1 0 36.96992 41.86824063307174 0 0 0 0 +702 1 1 0 39.1028 33.24830873802756 0 0 0 0 +703 1 1 0 40.52472 33.24830873802756 0 0 0 0 +705 1 1 0 38.39184 34.47972758017673 0 0 0 0 +706 1 1 0 39.1028 35.711146422325896 0 0 0 0 +707 1 1 0 40.52472 35.711146422325896 0 0 0 0 +709 1 1 0 38.39184 36.94256526447507 0 0 0 0 +710 1 1 0 39.1028 38.17398410662424 0 0 0 0 +711 1 1 0 40.52472 38.17398410662424 0 0 0 0 +713 1 1 0 38.39184 39.40540294877341 0 0 0 0 +714 1 1 0 39.1028 40.636821790922575 0 0 0 0 +715 1 1 0 40.52472 40.636821790922575 0 0 0 0 +717 1 1 0 38.39184 41.86824063307174 0 0 0 0 +718 1 1 0 39.1028 43.09965947522091 0 0 0 0 +719 1 1 0 40.52472 43.09965947522091 0 0 0 0 +801 2 3 0.5564 37.548308436970686 43.56537533039196 5.365704432988823 0 0 0 +852 2 3 0.5564 38.88919502047367 42.042424135970684 3.6087789454249384 0 0 0 +876 2 3 0.5564 36.695468476045846 41.81307318973102 4.654847654027673 0 0 0 +851 2 3 0.5564 39.88056712847529 43.079060421379005 3.124565190962247 0 0 0 +836 2 3 0.5564 35.55710562397264 39.6409654643291 3.11262603757073 0 0 0 +874 2 2 -1.1128 37.156592548770114 42.42602324299549 4.082231251420106 0 0 0 +875 2 3 0.5564 36.4628015962606 42.8541504174728 3.580640511788261 0 0 0 +850 2 2 -1.1128 39.74740412124872 42.13377480969944 3.1948153248505924 0 0 0 +920 2 3 0.5564 40.541519697736526 43.81546496276574 7.010468244614621 0 0 0 +921 2 3 0.5564 39.11034070400223 44.265151888276336 7.21395020009192 0 0 0 +799 2 2 -1.1128 37.54782393045426 44.314597322511524 5.9614390867350435 0 0 0 +652 1 1 0 41.23568 0 0 0 0 0 +656 1 1 0 41.23568 2.462837684298338 0 0 0 0 +660 1 1 0 41.23568 4.925675368596676 0 0 0 0 +664 1 1 0 41.23568 7.388513052895014 0 0 0 0 +668 1 1 0 41.23568 9.851350737193352 0 0 0 0 +721 1 1 0 42.6576 0 0 0 0 0 +722 1 1 0 43.36856 1.231418842149169 0 0 0 0 +723 1 1 0 44.79048 1.231418842149169 0 0 0 0 +724 1 1 0 45.50144 0 0 0 0 0 +725 1 1 0 42.6576 2.462837684298338 0 0 0 0 +726 1 1 0 43.36856 3.694256526447507 0 0 0 0 +727 1 1 0 44.79048 3.694256526447507 0 0 0 0 +728 1 1 0 45.50144 2.462837684298338 0 0 0 0 +729 1 1 0 42.6576 4.925675368596676 0 0 0 0 +730 1 1 0 43.36856 6.157094210745845 0 0 0 0 +731 1 1 0 44.79048 6.157094210745845 0 0 0 0 +732 1 1 0 45.50144 4.925675368596676 0 0 0 0 +733 1 1 0 42.6576 7.388513052895014 0 0 0 0 +734 1 1 0 43.36856 8.619931895044184 0 0 0 0 +735 1 1 0 44.79048 8.619931895044184 0 0 0 0 +736 1 1 0 45.50144 7.388513052895014 0 0 0 0 +737 1 1 0 42.6576 9.851350737193352 0 0 0 0 +740 1 1 0 45.50144 9.851350737193352 0 0 0 0 +855 2 3 0.5564 42.60570890502672 6.754108104519662 3.2778996089299444 0 1 0 +853 2 2 -1.1128 42.099480757637274 5.9504482420758835 3.3966273472818673 0 1 0 +924 2 3 0.5564 42.55717296882286 9.17260477834803 2.5938337966266043 0 1 0 +796 2 2 -1.1128 42.77023484300884 3.2473201847921502 3.212925112248156 0 1 0 +902 2 3 0.5564 42.12839423169956 3.7289140838154062 7.1537282390574495 0 1 0 +903 2 3 0.5564 41.53585251071065 5.1118011663682905 7.322300070785221 0 1 0 +898 2 2 -1.1128 45.445001196506084 2.452551396966245 3.028403472579563 0 1 0 +797 2 3 0.5564 42.58443206962962 4.186306057729107 3.2089115332453373 0 1 0 +798 2 3 0.5564 43.71048122279908 3.189455512069421 3.38269391940839 0 1 0 +810 2 3 0.5564 41.63040595115056 6.5777864583716426 5.427015401612798 0 1 0 +854 2 3 0.5564 41.20236665318539 6.25112336337136 3.5415926908824034 0 1 0 +923 2 3 0.5564 42.32247135813611 9.521352146245636 4.048203548805301 0 1 0 +922 2 2 -1.1128 42.80519254575484 8.918478791891543 3.4827315727519106 0 1 0 +900 2 3 0.5564 45.15285956979833 1.5485234956341212 3.145105564354613 0 1 0 +899 2 3 0.5564 46.07339231136837 2.4105339689072443 2.3075759749099993 0 1 0 +901 2 2 -1.1128 41.44718299707816 4.208196261290198 7.625398774411962 0 1 0 +815 2 3 0.5564 41.32793113560261 1.0321378043039096 2.6919903566852 0 1 0 +843 2 3 0.5564 41.07940607864339 3.567038821973523 4.505483562010162 0 1 0 +672 1 1 0 41.23568 12.31418842149169 0 0 0 0 +676 1 1 0 41.23568 14.777026105790029 0 0 0 0 +680 1 1 0 41.23568 17.239863790088364 0 0 0 0 +684 1 1 0 41.23568 19.702701474386703 0 0 0 0 +738 1 1 0 43.36856 11.082769579342521 0 0 0 0 +739 1 1 0 44.79048 11.082769579342521 0 0 0 0 +741 1 1 0 42.6576 12.31418842149169 0 0 0 0 +742 1 1 0 43.36856 13.545607263640859 0 0 0 0 +743 1 1 0 44.79048 13.545607263640859 0 0 0 0 +744 1 1 0 45.50144 12.31418842149169 0 0 0 0 +745 1 1 0 42.6576 14.777026105790029 0 0 0 0 +746 1 1 0 43.36856 16.008444947939196 0 0 0 0 +747 1 1 0 44.79048 16.008444947939196 0 0 0 0 +748 1 1 0 45.50144 14.777026105790029 0 0 0 0 +749 1 1 0 42.6576 17.239863790088364 0 0 0 0 +750 1 1 0 43.36856 18.471282632237532 0 0 0 0 +751 1 1 0 44.79048 18.471282632237532 0 0 0 0 +752 1 1 0 45.50144 17.239863790088364 0 0 0 0 +753 1 1 0 42.6576 19.702701474386703 0 0 0 0 +754 1 1 0 43.36856 20.93412031653587 0 0 0 0 +755 1 1 0 44.79048 20.93412031653587 0 0 0 0 +756 1 1 0 45.50144 19.702701474386703 0 0 0 0 +688 1 1 0 41.23568 22.165539158685043 0 0 0 0 +692 1 1 0 41.23568 24.62837684298338 0 0 0 0 +696 1 1 0 41.23568 27.091214527281718 0 0 0 0 +700 1 1 0 41.23568 29.554052211580057 0 0 0 0 +704 1 1 0 41.23568 32.01688989587839 0 0 0 0 +757 1 1 0 42.6576 22.165539158685043 0 0 0 0 +758 1 1 0 43.36856 23.39695800083421 0 0 0 0 +759 1 1 0 44.79048 23.39695800083421 0 0 0 0 +760 1 1 0 45.50144 22.165539158685043 0 0 0 0 +761 1 1 0 42.6576 24.62837684298338 0 0 0 0 +762 1 1 0 43.36856 25.859795685132546 0 0 0 0 +763 1 1 0 44.79048 25.859795685132546 0 0 0 0 +764 1 1 0 45.50144 24.62837684298338 0 0 0 0 +765 1 1 0 42.6576 27.091214527281718 0 0 0 0 +766 1 1 0 43.36856 28.322633369430886 0 0 0 0 +767 1 1 0 44.79048 28.322633369430886 0 0 0 0 +768 1 1 0 45.50144 27.091214527281718 0 0 0 0 +769 1 1 0 42.6576 29.554052211580057 0 0 0 0 +770 1 1 0 43.36856 30.785471053729225 0 0 0 0 +771 1 1 0 44.79048 30.785471053729225 0 0 0 0 +772 1 1 0 45.50144 29.554052211580057 0 0 0 0 +773 1 1 0 42.6576 32.01688989587839 0 0 0 0 +776 1 1 0 45.50144 32.01688989587839 0 0 0 0 +708 1 1 0 41.23568 34.47972758017673 0 0 0 0 +712 1 1 0 41.23568 36.94256526447507 0 0 0 0 +716 1 1 0 41.23568 39.40540294877341 0 0 0 0 +720 1 1 0 41.23568 41.86824063307174 0 0 0 0 +774 1 1 0 43.36856 33.24830873802756 0 0 0 0 +775 1 1 0 44.79048 33.24830873802756 0 0 0 0 +777 1 1 0 42.6576 34.47972758017673 0 0 0 0 +778 1 1 0 43.36856 35.711146422325896 0 0 0 0 +779 1 1 0 44.79048 35.711146422325896 0 0 0 0 +780 1 1 0 45.50144 34.47972758017673 0 0 0 0 +781 1 1 0 42.6576 36.94256526447507 0 0 0 0 +782 1 1 0 43.36856 38.17398410662424 0 0 0 0 +783 1 1 0 44.79048 38.17398410662424 0 0 0 0 +784 1 1 0 45.50144 36.94256526447507 0 0 0 0 +785 1 1 0 42.6576 39.40540294877341 0 0 0 0 +786 1 1 0 43.36856 40.636821790922575 0 0 0 0 +787 1 1 0 44.79048 40.636821790922575 0 0 0 0 +788 1 1 0 45.50144 39.40540294877341 0 0 0 0 +789 1 1 0 42.6576 41.86824063307174 0 0 0 0 +790 1 1 0 43.36856 43.09965947522091 0 0 0 0 +791 1 1 0 44.79048 43.09965947522091 0 0 0 0 +792 1 1 0 45.50144 41.86824063307174 0 0 0 0 +871 2 2 -1.1128 42.43621342090696 41.361777660606826 3.5286311215230155 0 0 0 +910 2 2 -1.1128 44.00261269418429 44.009231456650014 3.7548439135777425 0 0 0 +873 2 3 0.5564 42.81116163142683 40.8806399438352 2.7909638607684895 0 0 0 +912 2 3 0.5564 44.01512081357764 43.199784996149646 3.244083663427368 0 0 0 +872 2 3 0.5564 41.50534987825062 41.436128256982094 3.318397554899502 0 0 0 +869 2 3 0.5564 41.92696097428322 42.44540495044042 4.918533220471727 0 0 0 +868 2 2 -1.1128 41.602312218152235 43.15319449082845 5.475195560073079 0 0 0 +870 2 3 0.5564 41.17840173459901 43.7603473856229 4.8686487491511015 0 0 0 +911 2 3 0.5564 43.2397024819597 43.9207537163753 4.326134358669964 0 0 0 + +Velocities + +1 0 0 0 +2 0 0 0 +3 0 0 0 +4 0 0 0 +5 0 0 0 +6 0 0 0 +7 0 0 0 +8 0 0 0 +9 0 0 0 +10 0 0 0 +11 0 0 0 +12 0 0 0 +13 0 0 0 +14 0 0 0 +15 0 0 0 +16 0 0 0 +17 0 0 0 +20 0 0 0 +73 0 0 0 +74 0 0 0 +77 0 0 0 +78 0 0 0 +81 0 0 0 +82 0 0 0 +85 0 0 0 +86 0 0 0 +89 0 0 0 +18 0 0 0 +19 0 0 0 +21 0 0 0 +22 0 0 0 +23 0 0 0 +24 0 0 0 +25 0 0 0 +26 0 0 0 +27 0 0 0 +28 0 0 0 +29 0 0 0 +30 0 0 0 +31 0 0 0 +32 0 0 0 +33 0 0 0 +34 0 0 0 +35 0 0 0 +36 0 0 0 +90 0 0 0 +93 0 0 0 +94 0 0 0 +97 0 0 0 +98 0 0 0 +101 0 0 0 +102 0 0 0 +105 0 0 0 +106 0 0 0 +37 0 0 0 +38 0 0 0 +39 0 0 0 +40 0 0 0 +41 0 0 0 +42 0 0 0 +43 0 0 0 +44 0 0 0 +45 0 0 0 +46 0 0 0 +47 0 0 0 +48 0 0 0 +49 0 0 0 +50 0 0 0 +51 0 0 0 +52 0 0 0 +53 0 0 0 +56 0 0 0 +109 0 0 0 +110 0 0 0 +113 0 0 0 +114 0 0 0 +117 0 0 0 +118 0 0 0 +121 0 0 0 +122 0 0 0 +125 0 0 0 +54 0 0 0 +55 0 0 0 +57 0 0 0 +58 0 0 0 +59 0 0 0 +60 0 0 0 +61 0 0 0 +62 0 0 0 +63 0 0 0 +64 0 0 0 +65 0 0 0 +66 0 0 0 +67 0 0 0 +68 0 0 0 +69 0 0 0 +70 0 0 0 +71 0 0 0 +72 0 0 0 +126 0 0 0 +129 0 0 0 +130 0 0 0 +133 0 0 0 +134 0 0 0 +137 0 0 0 +138 0 0 0 +141 0 0 0 +142 0 0 0 +75 0 0 0 +76 0 0 0 +79 0 0 0 +80 0 0 0 +83 0 0 0 +84 0 0 0 +87 0 0 0 +88 0 0 0 +92 0 0 0 +145 0 0 0 +146 0 0 0 +147 0 0 0 +148 0 0 0 +149 0 0 0 +150 0 0 0 +151 0 0 0 +152 0 0 0 +153 0 0 0 +154 0 0 0 +155 0 0 0 +156 0 0 0 +157 0 0 0 +158 0 0 0 +159 0 0 0 +160 0 0 0 +161 0 0 0 +164 0 0 0 +91 0 0 0 +95 0 0 0 +96 0 0 0 +99 0 0 0 +100 0 0 0 +103 0 0 0 +104 0 0 0 +107 0 0 0 +108 0 0 0 +162 0 0 0 +163 0 0 0 +165 0 0 0 +166 0 0 0 +167 0 0 0 +168 0 0 0 +169 0 0 0 +170 0 0 0 +171 0 0 0 +172 0 0 0 +173 0 0 0 +174 0 0 0 +175 0 0 0 +176 0 0 0 +177 0 0 0 +178 0 0 0 +179 0 0 0 +180 0 0 0 +111 0 0 0 +112 0 0 0 +115 0 0 0 +116 0 0 0 +119 0 0 0 +120 0 0 0 +123 0 0 0 +124 0 0 0 +128 0 0 0 +181 0 0 0 +182 0 0 0 +183 0 0 0 +184 0 0 0 +185 0 0 0 +186 0 0 0 +187 0 0 0 +188 0 0 0 +189 0 0 0 +190 0 0 0 +191 0 0 0 +192 0 0 0 +193 0 0 0 +194 0 0 0 +195 0 0 0 +196 0 0 0 +197 0 0 0 +200 0 0 0 +127 0 0 0 +131 0 0 0 +132 0 0 0 +135 0 0 0 +136 0 0 0 +139 0 0 0 +140 0 0 0 +143 0 0 0 +144 0 0 0 +198 0 0 0 +199 0 0 0 +201 0 0 0 +202 0 0 0 +203 0 0 0 +204 0 0 0 +205 0 0 0 +206 0 0 0 +207 0 0 0 +208 0 0 0 +209 0 0 0 +210 0 0 0 +211 0 0 0 +212 0 0 0 +213 0 0 0 +214 0 0 0 +215 0 0 0 +216 0 0 0 +217 0 0 0 +218 0 0 0 +219 0 0 0 +220 0 0 0 +221 0 0 0 +222 0 0 0 +223 0 0 0 +224 0 0 0 +225 0 0 0 +226 0 0 0 +227 0 0 0 +228 0 0 0 +229 0 0 0 +230 0 0 0 +231 0 0 0 +232 0 0 0 +233 0 0 0 +236 0 0 0 +289 0 0 0 +293 0 0 0 +297 0 0 0 +301 0 0 0 +305 0 0 0 +234 0 0 0 +235 0 0 0 +237 0 0 0 +238 0 0 0 +239 0 0 0 +240 0 0 0 +241 0 0 0 +242 0 0 0 +243 0 0 0 +244 0 0 0 +245 0 0 0 +246 0 0 0 +247 0 0 0 +248 0 0 0 +249 0 0 0 +250 0 0 0 +251 0 0 0 +252 0 0 0 +309 0 0 0 +313 0 0 0 +317 0 0 0 +321 0 0 0 +253 0 0 0 +254 0 0 0 +255 0 0 0 +256 0 0 0 +257 0 0 0 +258 0 0 0 +259 0 0 0 +260 0 0 0 +261 0 0 0 +262 0 0 0 +263 0 0 0 +264 0 0 0 +265 0 0 0 +266 0 0 0 +267 0 0 0 +268 0 0 0 +269 0 0 0 +272 0 0 0 +325 0 0 0 +329 0 0 0 +333 0 0 0 +337 0 0 0 +341 0 0 0 +270 0 0 0 +271 0 0 0 +273 0 0 0 +274 0 0 0 +275 0 0 0 +276 0 0 0 +277 0 0 0 +278 0 0 0 +279 0 0 0 +280 0 0 0 +281 0 0 0 +282 0 0 0 +283 0 0 0 +284 0 0 0 +285 0 0 0 +286 0 0 0 +287 0 0 0 +288 0 0 0 +345 0 0 0 +349 0 0 0 +353 0 0 0 +357 0 0 0 +290 0 0 0 +291 0 0 0 +292 0 0 0 +294 0 0 0 +295 0 0 0 +296 0 0 0 +298 0 0 0 +299 0 0 0 +300 0 0 0 +302 0 0 0 +303 0 0 0 +304 0 0 0 +308 0 0 0 +361 0 0 0 +362 0 0 0 +365 0 0 0 +366 0 0 0 +369 0 0 0 +370 0 0 0 +373 0 0 0 +374 0 0 0 +377 0 0 0 +306 0 0 0 +307 0 0 0 +310 0 0 0 +311 0 0 0 +312 0 0 0 +314 0 0 0 +315 0 0 0 +316 0 0 0 +318 0 0 0 +319 0 0 0 +320 0 0 0 +322 0 0 0 +323 0 0 0 +324 0 0 0 +378 0 0 0 +381 0 0 0 +382 0 0 0 +385 0 0 0 +386 0 0 0 +389 0 0 0 +390 0 0 0 +393 0 0 0 +394 0 0 0 +326 0 0 0 +327 0 0 0 +328 0 0 0 +330 0 0 0 +331 0 0 0 +332 0 0 0 +334 0 0 0 +335 0 0 0 +336 0 0 0 +338 0 0 0 +339 0 0 0 +340 0 0 0 +344 0 0 0 +397 0 0 0 +398 0 0 0 +401 0 0 0 +402 0 0 0 +405 0 0 0 +406 0 0 0 +409 0 0 0 +410 0 0 0 +413 0 0 0 +342 0 0 0 +343 0 0 0 +346 0 0 0 +347 0 0 0 +348 0 0 0 +350 0 0 0 +351 0 0 0 +352 0 0 0 +354 0 0 0 +355 0 0 0 +356 0 0 0 +358 0 0 0 +359 0 0 0 +360 0 0 0 +414 0 0 0 +417 0 0 0 +418 0 0 0 +421 0 0 0 +422 0 0 0 +425 0 0 0 +426 0 0 0 +429 0 0 0 +430 0 0 0 +363 0 0 0 +364 0 0 0 +367 0 0 0 +368 0 0 0 +371 0 0 0 +372 0 0 0 +375 0 0 0 +376 0 0 0 +380 0 0 0 +433 0 0 0 +434 0 0 0 +435 0 0 0 +436 0 0 0 +437 0 0 0 +438 0 0 0 +439 0 0 0 +440 0 0 0 +441 0 0 0 +442 0 0 0 +443 0 0 0 +444 0 0 0 +445 0 0 0 +446 0 0 0 +447 0 0 0 +448 0 0 0 +449 0 0 0 +452 0 0 0 +824 23.28678663838591 -19.695178733121715 -4.712860628654516 +882 -7.0610581976405244 16.44204311186104 -4.175586130223243 +915 5.458359862786789 12.338077912032869 3.646984172142374 +839 20.392115541402525 21.839207526251702 -29.285410530315588 +880 -1.6972489953530285 5.884325737897911 -5.109687018230828 +897 -0.5612899831289091 6.907522350424367 -17.06603259626599 +881 -3.29469084908246 18.230178486719424 -2.0874433657999796 +840 0.3491624797675958 -9.4770564186721 5.993889540912456 +823 -2.4113508906287486 0.7060826232690176 4.591531586272169 +825 -9.503739029582237 10.088287372649603 1.9260324522526424 +838 -4.206308232163817 2.7689815350821445 -3.2345774478153677 +918 5.963097489077942 -5.811799881204121 -1.1246744751170932 +895 -3.6065546286281265 3.360807936038344 -2.5135837850671177 +913 -3.9429603880542876 -3.803003714965937 4.88513733901858 +896 7.160890299407335 0.32762830929124437 -20.137386051219497 +379 0 0 0 +383 0 0 0 +384 0 0 0 +387 0 0 0 +388 0 0 0 +391 0 0 0 +392 0 0 0 +395 0 0 0 +396 0 0 0 +450 0 0 0 +451 0 0 0 +453 0 0 0 +454 0 0 0 +455 0 0 0 +456 0 0 0 +457 0 0 0 +458 0 0 0 +459 0 0 0 +460 0 0 0 +461 0 0 0 +462 0 0 0 +463 0 0 0 +464 0 0 0 +465 0 0 0 +466 0 0 0 +467 0 0 0 +468 0 0 0 +399 0 0 0 +400 0 0 0 +403 0 0 0 +404 0 0 0 +407 0 0 0 +408 0 0 0 +411 0 0 0 +412 0 0 0 +416 0 0 0 +469 0 0 0 +470 0 0 0 +471 0 0 0 +472 0 0 0 +473 0 0 0 +474 0 0 0 +475 0 0 0 +476 0 0 0 +477 0 0 0 +478 0 0 0 +479 0 0 0 +480 0 0 0 +481 0 0 0 +482 0 0 0 +483 0 0 0 +484 0 0 0 +485 0 0 0 +488 0 0 0 +415 0 0 0 +419 0 0 0 +420 0 0 0 +423 0 0 0 +424 0 0 0 +427 0 0 0 +428 0 0 0 +431 0 0 0 +432 0 0 0 +486 0 0 0 +487 0 0 0 +489 0 0 0 +490 0 0 0 +491 0 0 0 +492 0 0 0 +493 0 0 0 +494 0 0 0 +495 0 0 0 +496 0 0 0 +497 0 0 0 +498 0 0 0 +499 0 0 0 +500 0 0 0 +501 0 0 0 +502 0 0 0 +503 0 0 0 +504 0 0 0 +916 2.1969507203442245 -1.4352986791463374 -7.127919603909629 +917 11.826235663356204 14.279824537641929 -14.280083496635585 +505 0 0 0 +506 0 0 0 +507 0 0 0 +508 0 0 0 +509 0 0 0 +510 0 0 0 +511 0 0 0 +512 0 0 0 +513 0 0 0 +514 0 0 0 +515 0 0 0 +516 0 0 0 +517 0 0 0 +518 0 0 0 +519 0 0 0 +520 0 0 0 +521 0 0 0 +524 0 0 0 +577 0 0 0 +578 0 0 0 +581 0 0 0 +582 0 0 0 +585 0 0 0 +586 0 0 0 +589 0 0 0 +590 0 0 0 +593 0 0 0 +817 1.6133973243890818 0.09544910649802017 -2.82837163408008 +934 -0.7137103646976727 -3.722196372187516 0.848848803609948 +844 -1.412310995403245 2.5213507567859863 -4.599202803630543 +865 8.862935798755592 -1.7466754230232333 -1.6569510007225825 +926 -4.119692818575567 8.294228711700969 -32.74811918647688 +936 -15.928953261034998 -9.92364110983116 -15.23435729552565 +845 -7.482059146842958 -2.336334839582908 -12.584395592557943 +819 19.704188351794787 13.480076284531094 -16.836845023051307 +884 -5.8411676590434105 -3.4674785948480853 3.373261182910667 +928 -0.47949465869401636 4.8766140418593915 -1.7082902202551018 +832 3.7664949439970346 -7.725237251790142 2.249127795467372 +866 8.574128387623029 11.87092357709237 -33.55660077300949 +879 2.397970035203643 -1.0067012033099316 -24.55246411236801 +929 3.276394804624606 -17.02257780299615 0.9984492433600977 +935 20.101385093495328 5.113530565709303 -4.402939514605331 +909 -4.28073098421694 -15.637815198236153 -13.025293876950634 +846 -12.564589941629468 -6.4025051268954645 -20.75775453419462 +867 8.983700225517605 -3.390103398382499 10.693415861649115 +914 -2.2270563485919563 -24.131906542363726 6.875944405629472 +818 0.2383020958130696 -5.676983900196928 -7.219651526329348 +793 5.148041806008255 2.984645492151128 3.4961269673039586 +833 -0.6438138903502075 -2.2828874172817644 -2.0720922776886743 +834 10.612584098261342 -7.3667177513881885 16.15587930450157 +930 6.00984818290816 8.246158764929453 -15.698501664737071 +883 -3.3507225248985764 -0.5583884018684485 4.849649083643576 +794 3.908344161677918 -24.184551279453736 8.492626116154728 +795 8.894549364978065 12.946246804004156 12.17949248871838 +522 0 0 0 +523 0 0 0 +525 0 0 0 +526 0 0 0 +527 0 0 0 +528 0 0 0 +529 0 0 0 +530 0 0 0 +531 0 0 0 +532 0 0 0 +533 0 0 0 +534 0 0 0 +535 0 0 0 +536 0 0 0 +537 0 0 0 +538 0 0 0 +539 0 0 0 +540 0 0 0 +594 0 0 0 +597 0 0 0 +598 0 0 0 +601 0 0 0 +602 0 0 0 +605 0 0 0 +606 0 0 0 +609 0 0 0 +610 0 0 0 +541 0 0 0 +542 0 0 0 +543 0 0 0 +544 0 0 0 +545 0 0 0 +546 0 0 0 +547 0 0 0 +548 0 0 0 +549 0 0 0 +550 0 0 0 +551 0 0 0 +552 0 0 0 +553 0 0 0 +554 0 0 0 +555 0 0 0 +556 0 0 0 +557 0 0 0 +560 0 0 0 +613 0 0 0 +614 0 0 0 +617 0 0 0 +618 0 0 0 +621 0 0 0 +622 0 0 0 +625 0 0 0 +626 0 0 0 +629 0 0 0 +558 0 0 0 +559 0 0 0 +561 0 0 0 +562 0 0 0 +563 0 0 0 +564 0 0 0 +565 0 0 0 +566 0 0 0 +567 0 0 0 +568 0 0 0 +569 0 0 0 +570 0 0 0 +571 0 0 0 +572 0 0 0 +573 0 0 0 +574 0 0 0 +575 0 0 0 +576 0 0 0 +630 0 0 0 +633 0 0 0 +634 0 0 0 +637 0 0 0 +638 0 0 0 +641 0 0 0 +642 0 0 0 +645 0 0 0 +646 0 0 0 +857 0.014723103701010352 19.617056339014884 16.55424143708416 +856 -0.643223754474494 5.776893808258414 1.1873537786475037 +892 -3.075450592140558 0.21721350023132013 -1.4569947460087087 +893 -16.397277523345814 -3.4380854612300413 0.6965615832113001 +886 -0.2961775166926003 1.3204871191677252 -6.423441607226728 +828 -5.723804354158924 -2.2689365841904983 2.5260940343682323 +887 0.8430831533311819 -13.339077650133666 15.172508195501921 +826 -4.448639032696121 -0.8915914080568843 2.3567943259561948 +827 1.718412324889533 -14.893863590144628 14.797129976414348 +894 -6.427973685028659 -12.558615271775233 -7.485451456789206 +925 8.402235075352133 3.407952177949016 -3.5053149045150525 +858 -6.427819874217524 -13.261042052865486 -2.844099672535822 +878 4.549175257644374 -9.190685290399665 7.233790964076811 +812 1.6130765364411193 6.523491914724538 -2.1666788533706773 +927 5.411595894339899 18.95778556645519 0.4163503598847362 +888 6.673800249844219 -4.147769988251276 11.562868346675096 +877 0.7642590168406848 -0.42640846170725205 -0.24362676533615443 +835 4.762512418319816 4.257619894363519 -2.633248633741173 +811 2.94897877928045 1.1358222911198308 3.501491126078737 +837 -25.574582055486644 8.173269863077355 -15.333432600063208 +579 0 0 0 +580 0 0 0 +583 0 0 0 +584 0 0 0 +587 0 0 0 +588 0 0 0 +591 0 0 0 +592 0 0 0 +596 0 0 0 +649 0 0 0 +650 0 0 0 +651 0 0 0 +653 0 0 0 +654 0 0 0 +655 0 0 0 +657 0 0 0 +658 0 0 0 +659 0 0 0 +661 0 0 0 +662 0 0 0 +663 0 0 0 +665 0 0 0 +864 18.10875991489158 -1.221818047957972 14.493518869719745 +885 -3.50759902491298 9.459430974379575 4.647666016780896 +891 1.2937876234992576 -13.218582770473045 1.8043374968280674 +905 -4.091578474774505 3.159726887798095 -1.8642051540811495 +847 13.821135507553436 3.78277650099749 -0.8935962180188131 +807 -2.855822557363695 -1.3802914256701821 1.3207757685673218 +842 -3.5610017924774 20.399114965452245 -9.059382158173541 +806 -4.05498634870798 -0.7854363713825808 -8.046995507898338 +841 2.77935600657832 0.33087027354111276 -3.276950737363777 +848 14.223073217510889 7.872740511148931 10.887767283489458 +805 -1.6775622324299977 -2.2096661714145456 4.5967537734138295 +862 5.242654019377736 5.918079707262924 -8.884230198450263 +808 -3.696957383720496 1.0048882207315841 -0.5768482173888145 +863 -1.8703493217333826 5.862886335539861 9.68692462574889 +906 18.26182603645302 7.175694562498453 -2.7522051758285015 +803 3.2862566934744275 -9.793076664879903 3.0089122195092575 +820 -6.318316424453873 -6.3876103453941235 -3.8277653578536937 +813 2.860647424855888 1.4990458438578118 3.0590515326924304 +830 17.528802909679435 -19.339237046941598 -20.741951943235076 +809 -1.7667991174728181 2.556579099847797 -3.7133211964009396 +849 -1.1901850692743416 -8.440379804790025 -1.6424701640814479 +814 1.1332861799827034 0.6093309476680691 1.6239157816953607 +816 8.576684394424559 3.76294659470765 3.1067139692854044 +933 3.343313506115779 -12.788319535305213 0.4254781025251201 +932 1.2123994730269427 3.3154650357069606 -3.334409286644367 +802 3.413872469336105 -1.1546266031788768 -7.788063759324826 +931 -1.4494894135693275 -0.007254181008071915 -2.3332218927708426 +907 -5.153001723767468 0.1363135393043927 2.075664750863472 +831 -10.004566446956199 14.6294729429816 -0.9646159688100753 +804 -7.991671584288851 -7.475452917857694 -23.323610756314213 +904 -7.100120239541285 -0.3942667752088697 1.4081501423590068 +829 1.9015007439507077 5.283166213121213 -5.6785558614538445 +890 -19.32307212346698 3.2014322404638675 -4.971981839089952 +919 -2.338652775866846 -1.6192256874434943 3.5872094229145635 +908 -4.506448801038724 7.6944348035494805 10.147202763194022 +800 0.525815621025557 0.8800480170316483 -0.20140766169559945 +859 -3.7638632187225913 -1.3301900297863984 -1.6857540996503018 +861 -1.300800867558945 -21.968770646198 -11.380968378191717 +889 -0.13291154686447318 0.408222226270759 0.5188896950022159 +860 2.8418653167563583 -10.860696318995991 -7.274081987407397 +822 18.555841947164804 1.3488795446530215 -2.57263197376979 +821 2.5914509962410404 6.1128885622856535 -6.891713022600967 +595 0 0 0 +599 0 0 0 +600 0 0 0 +603 0 0 0 +604 0 0 0 +607 0 0 0 +608 0 0 0 +611 0 0 0 +612 0 0 0 +666 0 0 0 +667 0 0 0 +669 0 0 0 +670 0 0 0 +671 0 0 0 +673 0 0 0 +674 0 0 0 +675 0 0 0 +677 0 0 0 +678 0 0 0 +679 0 0 0 +681 0 0 0 +682 0 0 0 +683 0 0 0 +615 0 0 0 +616 0 0 0 +619 0 0 0 +620 0 0 0 +623 0 0 0 +624 0 0 0 +627 0 0 0 +628 0 0 0 +632 0 0 0 +685 0 0 0 +686 0 0 0 +687 0 0 0 +689 0 0 0 +690 0 0 0 +691 0 0 0 +693 0 0 0 +694 0 0 0 +695 0 0 0 +697 0 0 0 +698 0 0 0 +699 0 0 0 +701 0 0 0 +631 0 0 0 +635 0 0 0 +636 0 0 0 +639 0 0 0 +640 0 0 0 +643 0 0 0 +644 0 0 0 +647 0 0 0 +648 0 0 0 +702 0 0 0 +703 0 0 0 +705 0 0 0 +706 0 0 0 +707 0 0 0 +709 0 0 0 +710 0 0 0 +711 0 0 0 +713 0 0 0 +714 0 0 0 +715 0 0 0 +717 0 0 0 +718 0 0 0 +719 0 0 0 +801 6.3791360737229175 -0.06294951897585185 6.275276534287049 +852 9.533204722301026 3.635358487275625 11.325241984676676 +876 -7.5288457960325195 10.343955685749071 9.174112903806698 +851 11.324630200416946 -5.3841269941632195 -4.331280522070834 +836 -18.948267184095485 3.059583577066092 -13.205211938026421 +874 0.11331962980175045 -2.6443097750575877 1.3904229166613291 +875 5.578453451251161 -1.707571521972893 -5.365721983984957 +850 3.508833846356138 -4.177464350024476 -2.929550119627118 +920 9.735651740617827 11.172654877683243 -1.520392490494708 +921 2.634342633192178 -7.473941525247307 -10.3819677968746 +799 2.480261876941381 2.6479286070540775 2.8757710276609134 +652 0 0 0 +656 0 0 0 +660 0 0 0 +664 0 0 0 +668 0 0 0 +721 0 0 0 +722 0 0 0 +723 0 0 0 +724 0 0 0 +725 0 0 0 +726 0 0 0 +727 0 0 0 +728 0 0 0 +729 0 0 0 +730 0 0 0 +731 0 0 0 +732 0 0 0 +733 0 0 0 +734 0 0 0 +735 0 0 0 +736 0 0 0 +737 0 0 0 +740 0 0 0 +855 -4.983418977664709 7.316762475632069 -4.804677515261691 +853 -0.9889242911612474 4.9363545378208835 -3.893215427287619 +924 24.809030366392236 12.938030894027968 -7.929148423342626 +796 -2.042486989230798 -1.6716889696169193 4.818040886059996 +902 -12.24631912078176 -9.296091792191639 -5.933828252367176 +903 14.861767381200762 0.646302630400826 8.128909247439392 +898 -2.268970865642067 0.19593504253976693 -1.7002095325194038 +797 13.389488449540423 1.304501878497851 -5.024765837418713 +798 -4.04938216085792 -15.534814466192707 11.193556197029825 +810 -3.4873315530660745 -26.291881956134898 -3.7360180315706857 +854 -0.050097723565420214 1.1979024312153128 9.895624196355202 +923 -20.553020845996645 -9.899327350049255 -9.819708647345967 +922 4.523293437546675 5.218998274954441 -4.49072202518129 +900 7.633861074709448 -2.2307704025903523 4.296521673635092 +899 -19.369173009793435 5.968253817215517 -16.94178229768782 +901 3.1298945853524573 1.0199579971809891 5.836464708883643 +815 12.880886365907195 -2.18582234580474 10.172206114924288 +843 3.8805061810272847 -6.900108272859447 -7.842804013717792 +672 0 0 0 +676 0 0 0 +680 0 0 0 +684 0 0 0 +738 0 0 0 +739 0 0 0 +741 0 0 0 +742 0 0 0 +743 0 0 0 +744 0 0 0 +745 0 0 0 +746 0 0 0 +747 0 0 0 +748 0 0 0 +749 0 0 0 +750 0 0 0 +751 0 0 0 +752 0 0 0 +753 0 0 0 +754 0 0 0 +755 0 0 0 +756 0 0 0 +688 0 0 0 +692 0 0 0 +696 0 0 0 +700 0 0 0 +704 0 0 0 +757 0 0 0 +758 0 0 0 +759 0 0 0 +760 0 0 0 +761 0 0 0 +762 0 0 0 +763 0 0 0 +764 0 0 0 +765 0 0 0 +766 0 0 0 +767 0 0 0 +768 0 0 0 +769 0 0 0 +770 0 0 0 +771 0 0 0 +772 0 0 0 +773 0 0 0 +776 0 0 0 +708 0 0 0 +712 0 0 0 +716 0 0 0 +720 0 0 0 +774 0 0 0 +775 0 0 0 +777 0 0 0 +778 0 0 0 +779 0 0 0 +780 0 0 0 +781 0 0 0 +782 0 0 0 +783 0 0 0 +784 0 0 0 +785 0 0 0 +786 0 0 0 +787 0 0 0 +788 0 0 0 +789 0 0 0 +790 0 0 0 +791 0 0 0 +792 0 0 0 +871 3.8388411617482983 2.1415774247586086 2.2282258014613365 +910 7.602860298670014 2.6393823107390926 0.5414737324680828 +873 20.507332409943604 5.51145846781714 8.496326839610182 +912 -3.629349712693535 23.337951853868613 -32.58198418026529 +872 4.080216979227207 -18.995820981792978 -6.328839221258122 +869 25.409329042660474 4.159096283589856 8.003159128696433 +868 -6.119380276761435 0.9901059131840709 -6.330598686020231 +870 -10.78856535095556 -17.561195466544348 -21.63165476286472 +911 14.291030359419361 -16.1359695519986 6.557863766321599 + +Bonds + +1 1 880 881 +2 1 880 882 +3 1 823 824 +4 1 823 825 +5 1 838 839 +6 1 838 840 +7 1 895 896 +8 1 895 897 +9 1 913 914 +10 1 913 915 +11 1 916 917 +12 1 916 918 +13 1 817 818 +14 1 817 819 +15 1 934 935 +16 1 934 936 +17 1 844 845 +18 1 844 846 +19 1 865 866 +20 1 865 867 +21 1 928 929 +22 1 928 930 +23 1 832 833 +24 1 832 834 +25 1 793 794 +26 1 793 795 +27 1 883 884 +28 1 883 885 +29 1 856 857 +30 1 856 858 +31 1 892 893 +32 1 892 894 +33 1 886 887 +34 1 886 888 +35 1 826 827 +36 1 826 828 +37 1 925 926 +38 1 925 927 +39 1 877 878 +40 1 877 879 +41 1 835 836 +42 1 835 837 +43 1 811 812 +44 1 811 813 +45 1 847 848 +46 1 847 849 +47 1 841 842 +48 1 841 843 +49 1 805 806 +50 1 805 807 +51 1 862 863 +52 1 862 864 +53 1 808 809 +54 1 808 810 +55 1 820 821 +56 1 820 822 +57 1 814 815 +58 1 814 816 +59 1 802 803 +60 1 802 804 +61 1 931 932 +62 1 931 933 +63 1 907 908 +64 1 907 909 +65 1 904 905 +66 1 904 906 +67 1 829 830 +68 1 829 831 +69 1 919 920 +70 1 919 921 +71 1 859 860 +72 1 859 861 +73 1 889 890 +74 1 889 891 +75 1 874 875 +76 1 874 876 +77 1 850 851 +78 1 850 852 +79 1 799 800 +80 1 799 801 +81 1 853 854 +82 1 853 855 +83 1 796 797 +84 1 796 798 +85 1 898 899 +86 1 898 900 +87 1 922 923 +88 1 922 924 +89 1 901 902 +90 1 901 903 +91 1 871 872 +92 1 871 873 +93 1 910 911 +94 1 910 912 +95 1 868 869 +96 1 868 870 + +Angles + +1 1 881 880 882 +2 1 824 823 825 +3 1 839 838 840 +4 1 896 895 897 +5 1 914 913 915 +6 1 917 916 918 +7 1 818 817 819 +8 1 935 934 936 +9 1 845 844 846 +10 1 866 865 867 +11 1 929 928 930 +12 1 833 832 834 +13 1 794 793 795 +14 1 884 883 885 +15 1 857 856 858 +16 1 893 892 894 +17 1 887 886 888 +18 1 827 826 828 +19 1 926 925 927 +20 1 878 877 879 +21 1 836 835 837 +22 1 812 811 813 +23 1 848 847 849 +24 1 842 841 843 +25 1 806 805 807 +26 1 863 862 864 +27 1 809 808 810 +28 1 821 820 822 +29 1 815 814 816 +30 1 803 802 804 +31 1 932 931 933 +32 1 908 907 909 +33 1 905 904 906 +34 1 830 829 831 +35 1 920 919 921 +36 1 860 859 861 +37 1 890 889 891 +38 1 875 874 876 +39 1 851 850 852 +40 1 800 799 801 +41 1 854 853 855 +42 1 797 796 798 +43 1 899 898 900 +44 1 923 922 924 +45 1 902 901 903 +46 1 872 871 873 +47 1 911 910 912 +48 1 869 868 870 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water b/examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water new file mode 100644 index 0000000000..9fccbf733b --- /dev/null +++ b/examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water @@ -0,0 +1,51 @@ +# Initialization +units metal +boundary p p p +atom_style full +processors * * 1 # domain decomposition over x and y +read_data ./gra_water.data +mass 1 12.0107 # carbon mass (g/mole) +mass 2 15.9994 # oxygen mass (g/mole) +mass 3 1.008 # hydrogen mass (g/mole) +# Separate atom groups +group gr molecule 1 +group water molecule 2 +######################## Potential defition ############################## +# Interlayer potential +pair_style hybrid/overlay ilp/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +#################################################################### +pair_coeff 1 1 none +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw # C-water +# bond and angle +bond_style harmonic +bond_coeff 1 0.0 0.9572 +angle_style harmonic +angle_coeff 1 0.0 104.52 +# define kspace calculation +kspace_style pppm/tip4p 1E-5 +# Neighbor update settings +neighbor 2.0 bin +neigh_modify every 1 delay 5 check yes page 1000000 one 100000 +#################################################################### +# Calculate pair energy +compute 1 all pair lj/cut/tip4p/long +compute 2 all pair ilp/water/2dm +compute wt water temp +variable TIP4P equal c_1 +variable EILP equal c_2 # total interlayer energy +variable temp_wt equal c_wt +############# Output ############## +thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt +thermo 100 +thermo_modify lost error + +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 + +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water.opt b/examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water.opt new file mode 100644 index 0000000000..1b38ab6e6e --- /dev/null +++ b/examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water.opt @@ -0,0 +1,51 @@ +# Initialization +units metal +boundary p p p +atom_style full +processors * * 1 # domain decomposition over x and y +read_data ./gra_water.data +mass 1 12.0107 # carbon mass (g/mole) +mass 2 15.9994 # oxygen mass (g/mole) +mass 3 1.008 # hydrogen mass (g/mole) +# Separate atom groups +group gr molecule 1 +group water molecule 2 +######################## Potential defition ############################## +# Interlayer potential +pair_style hybrid/overlay ilp/water/2dm/opt 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +#################################################################### +pair_coeff 1 1 none +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * ilp/water/2dm/opt COH.ILP C Ow Hw # C-water +# bond and angle +bond_style harmonic +bond_coeff 1 0.0 0.9572 +angle_style harmonic +angle_coeff 1 0.0 104.52 +# define kspace calculation +kspace_style pppm/tip4p 1E-5 +# Neighbor update settings +neighbor 2.0 bin +neigh_modify every 1 delay 5 check yes page 1000000 one 100000 +#################################################################### +# Calculate pair energy +compute 1 all pair lj/cut/tip4p/long +compute 2 all pair ilp/water/2dm/opt +compute wt water temp +variable TIP4P equal c_1 +variable EILP equal c_2 # total interlayer energy +variable temp_wt equal c_wt +############# Output ############## +thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt +thermo 100 +thermo_modify lost error + +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 + +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.1 b/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.1 new file mode 100644 index 0000000000..6e13280f70 --- /dev/null +++ b/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.1 @@ -0,0 +1,234 @@ +LAMMPS (23 Jun 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Initialization +units metal +boundary p p p +atom_style full +processors * * 1 # domain decomposition over x and y +read_data ./gra_water.data +Reading data file ... + orthogonal box = (0 0 0) to (46.92336 44.331078 200) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 936 atoms + reading velocities ... + 936 velocities + scanning bonds ... + 2 = max bonds/atom + scanning angles ... + 1 = max angles/atom + reading bonds ... + 96 bonds + reading angles ... + 48 angles +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 2 = max # of 1-2 neighbors + 1 = max # of 1-3 neighbors + 1 = max # of 1-4 neighbors + 2 = max # of special neighbors + special bonds CPU = 0.005 seconds + read_data CPU = 0.020 seconds +mass 1 12.0107 # carbon mass (g/mole) +mass 2 15.9994 # oxygen mass (g/mole) +mass 3 1.008 # hydrogen mass (g/mole) +# Separate atom groups +group gr molecule 1 +792 atoms in group gr +group water molecule 2 +144 atoms in group water +######################## Potential defition ############################## +# Interlayer potential +pair_style hybrid/overlay ilp/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +#################################################################### +pair_coeff 1 1 none +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw # C-water +Reading ilp/water/2dm potential file COH.ILP with DATE: 2023-05-17 +# bond and angle +bond_style harmonic +bond_coeff 1 0.0 0.9572 +angle_style harmonic +angle_coeff 1 0.0 104.52 +# define kspace calculation +kspace_style pppm/tip4p 1E-5 +# Neighbor update settings +neighbor 2.0 bin +neigh_modify every 1 delay 5 check yes page 1000000 one 100000 +#################################################################### +# Calculate pair energy +compute 1 all pair lj/cut/tip4p/long +compute 2 all pair ilp/water/2dm +compute wt water temp +variable TIP4P equal c_1 +variable EILP equal c_2 # total interlayer energy +variable temp_wt equal c_wt +############# Output ############## +thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt +thermo 100 +thermo_modify lost error + +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 48 = # of frozen angles + find clusters CPU = 0.001 seconds + +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848 +@Article{Ouyang2018 + author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod}, + title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials}, + journal = {Nano Letters}, + volume = 18, + pages = {6009} + year = 2018, +} + +- ilp/tmd potential doi/10.1021/acs.jctc.1c00782 +@Article{Ouyang2021 + author = {W. Ouyang, R. Sofer, X. Gao, J. Hermann, A. Tkatchenko, L. Kronik, M. Urbakh, and O. Hod}, + title = {Anisotropic Interlayer Force Field for Transition Metal Dichalcogenides: The Case of Molybdenum Disulfide}, + journal = {J. Chem. Theory Comput.}, + volume = 17, + pages = {7237–7245} + year = 2021, +} + +- ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464 +@Article{Feng2023 + author = {Z. Feng, Y. Yao, J. Liu, B. Wu, Z. Liu, and W. Ouyang}, + title = {Registry-Dependent Potential for Interfaces of Water with Graphene}, + journal = {J. Phys. Chem. C}, + volume = 127, + pages = {8704-8713} + year = 2023, +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +PPPM initialization ... + extracting TIP4P info from pair style + using 12-bit tables for long-range coulomb (../kspace.cpp:342) + G vector (1/distance) = 0.28684806 + grid = 25 24 80 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0001640931 + estimated relative force accuracy = 1.1395635e-05 + using single precision MKL FFT + 3d grid and FFT values/proc = 84320 48000 +WARNING: Using a manybody potential with bonds/angles/dihedrals and special_bond exclusions (../pair.cpp:239) +Neighbor list info ... + update every 1 steps, delay 5 steps, check yes + max neighbors/atom: 100000, page size: 1000000 + master list distance cutoff = 18 + ghost atom cutoff = 18 + binsize = 9, bins = 6 5 23 + 3 neighbor lists, perpetual/occasional/extra = 3 0 0 + (1) pair ilp/water/2dm, perpetual + attributes: full, newton on, ghost + pair build: full/bin/ghost + stencil: full/ghost/bin/3d + bin: standard + (2) pair lj/cut/tip4p/long, perpetual, skip from (3) + attributes: half, newton on + pair build: skip + stencil: none + bin: none + (3) neighbor class addition, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +SHAKE stats (type/ave/delta/count) on step 0 +Bond: 1 0.957201 2.19705e-06 96 +Angle: 1 104.52 0.000203056 48 +Per MPI rank memory allocation (min/avg/max) = 33.53 | 33.53 | 33.53 Mbytes + Step TotEng PotEng KinEng v_TIP4P v_EILP v_temp_wt + 0 -16.131263 -19.815178 3.6839141 189.37246 -1.903543 300 +SHAKE stats (type/ave/delta/count) on step 100 +Bond: 1 0.9572 9.54949e-07 96 +Angle: 1 104.52 6.01522e-05 48 + 100 -17.494868 -20.796993 3.3021253 188.4955 -1.8981262 268.90898 +SHAKE stats (type/ave/delta/count) on step 200 +Bond: 1 0.9572 9.63922e-07 96 +Angle: 1 104.52 7.7021e-05 48 + 200 -17.486271 -21.194892 3.7086213 188.14561 -1.9871708 302.01203 +SHAKE stats (type/ave/delta/count) on step 300 +Bond: 1 0.9572 1.4264e-06 96 +Angle: 1 104.52 6.48393e-05 48 + 300 -17.502844 -20.993704 3.49086 188.23268 -1.8457229 284.27861 +SHAKE stats (type/ave/delta/count) on step 400 +Bond: 1 0.9572 1.33728e-06 96 +Angle: 1 104.52 7.6239e-05 48 + 400 -17.495287 -20.828353 3.3330658 188.48002 -1.8429075 271.42862 +SHAKE stats (type/ave/delta/count) on step 500 +Bond: 1 0.9572 1.14685e-06 96 +Angle: 1 104.52 8.58621e-05 48 + 500 -17.491435 -20.443044 2.9516084 188.7589 -1.8566335 240.36459 +SHAKE stats (type/ave/delta/count) on step 600 +Bond: 1 0.9572 9.17601e-07 96 +Angle: 1 104.52 8.24516e-05 48 + 600 -17.505684 -20.608457 3.1027731 188.72078 -1.9560796 252.67471 +SHAKE stats (type/ave/delta/count) on step 700 +Bond: 1 0.9572 9.50422e-07 96 +Angle: 1 104.52 5.62423e-05 48 + 700 -17.496703 -21.072663 3.5759596 188.2777 -1.9833956 291.20871 +SHAKE stats (type/ave/delta/count) on step 800 +Bond: 1 0.9572 1.15262e-06 96 +Angle: 1 104.52 7.02157e-05 48 + 800 -17.478623 -20.819504 3.3408809 188.37868 -1.9112996 272.06505 +SHAKE stats (type/ave/delta/count) on step 900 +Bond: 1 0.9572 9.14138e-07 96 +Angle: 1 104.52 6.98742e-05 48 + 900 -17.48086 -20.728495 3.2476349 188.59022 -1.8922102 264.47155 +SHAKE stats (type/ave/delta/count) on step 1000 +Bond: 1 0.9572 1.00586e-06 96 +Angle: 1 104.52 0.000111712 48 + 1000 -17.498465 -20.331545 2.8330804 188.87473 -1.812177 230.71225 +Loop time of 20.801 on 1 procs for 1000 steps with 936 atoms + +Performance: 4.154 ns/day, 5.778 hours/ns, 48.075 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 16.429 | 16.429 | 16.429 | 0.0 | 78.98 +Bond | 0.0010991 | 0.0010991 | 0.0010991 | 0.0 | 0.01 +Kspace | 3.4769 | 3.4769 | 3.4769 | 0.0 | 16.72 +Neigh | 0.83359 | 0.83359 | 0.83359 | 0.0 | 4.01 +Comm | 0.028825 | 0.028825 | 0.028825 | 0.0 | 0.14 +Output | 0.00046349 | 0.00046349 | 0.00046349 | 0.0 | 0.00 +Modify | 0.01943 | 0.01943 | 0.01943 | 0.0 | 0.09 +Other | | 0.01154 | | | 0.06 + +Nlocal: 936 ave 936 max 936 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 5242 ave 5242 max 5242 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 431382 ave 431382 max 431382 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 431382 +Ave neighs/atom = 460.87821 +Ave special neighs/atom = 0.30769231 +Neighbor list builds = 28 +Dangerous builds = 0 +Total wall time: 0:00:21 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.4 b/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.4 new file mode 100644 index 0000000000..078ca76e2e --- /dev/null +++ b/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.4 @@ -0,0 +1,234 @@ +LAMMPS (23 Jun 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Initialization +units metal +boundary p p p +atom_style full +processors * * 1 # domain decomposition over x and y +read_data ./gra_water.data +Reading data file ... + orthogonal box = (0 0 0) to (46.92336 44.331078 200) + 2 by 2 by 1 MPI processor grid + reading atoms ... + 936 atoms + reading velocities ... + 936 velocities + scanning bonds ... + 2 = max bonds/atom + scanning angles ... + 1 = max angles/atom + reading bonds ... + 96 bonds + reading angles ... + 48 angles +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 2 = max # of 1-2 neighbors + 1 = max # of 1-3 neighbors + 1 = max # of 1-4 neighbors + 2 = max # of special neighbors + special bonds CPU = 0.003 seconds + read_data CPU = 0.018 seconds +mass 1 12.0107 # carbon mass (g/mole) +mass 2 15.9994 # oxygen mass (g/mole) +mass 3 1.008 # hydrogen mass (g/mole) +# Separate atom groups +group gr molecule 1 +792 atoms in group gr +group water molecule 2 +144 atoms in group water +######################## Potential defition ############################## +# Interlayer potential +pair_style hybrid/overlay ilp/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +#################################################################### +pair_coeff 1 1 none +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw # C-water +Reading ilp/water/2dm potential file COH.ILP with DATE: 2023-05-17 +# bond and angle +bond_style harmonic +bond_coeff 1 0.0 0.9572 +angle_style harmonic +angle_coeff 1 0.0 104.52 +# define kspace calculation +kspace_style pppm/tip4p 1E-5 +# Neighbor update settings +neighbor 2.0 bin +neigh_modify every 1 delay 5 check yes page 1000000 one 100000 +#################################################################### +# Calculate pair energy +compute 1 all pair lj/cut/tip4p/long +compute 2 all pair ilp/water/2dm +compute wt water temp +variable TIP4P equal c_1 +variable EILP equal c_2 # total interlayer energy +variable temp_wt equal c_wt +############# Output ############## +thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt +thermo 100 +thermo_modify lost error + +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 48 = # of frozen angles + find clusters CPU = 0.001 seconds + +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848 +@Article{Ouyang2018 + author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod}, + title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials}, + journal = {Nano Letters}, + volume = 18, + pages = {6009} + year = 2018, +} + +- ilp/tmd potential doi/10.1021/acs.jctc.1c00782 +@Article{Ouyang2021 + author = {W. Ouyang, R. Sofer, X. Gao, J. Hermann, A. Tkatchenko, L. Kronik, M. Urbakh, and O. Hod}, + title = {Anisotropic Interlayer Force Field for Transition Metal Dichalcogenides: The Case of Molybdenum Disulfide}, + journal = {J. Chem. Theory Comput.}, + volume = 17, + pages = {7237–7245} + year = 2021, +} + +- ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464 +@Article{Feng2023 + author = {Z. Feng, Y. Yao, J. Liu, B. Wu, Z. Liu, and W. Ouyang}, + title = {Registry-Dependent Potential for Interfaces of Water with Graphene}, + journal = {J. Phys. Chem. C}, + volume = 127, + pages = {8704-8713} + year = 2023, +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +PPPM initialization ... + extracting TIP4P info from pair style + using 12-bit tables for long-range coulomb (../kspace.cpp:342) + G vector (1/distance) = 0.28684806 + grid = 25 24 80 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0001640931 + estimated relative force accuracy = 1.1395635e-05 + using single precision MKL FFT + 3d grid and FFT values/proc = 30685 12480 +WARNING: Using a manybody potential with bonds/angles/dihedrals and special_bond exclusions (../pair.cpp:239) +Neighbor list info ... + update every 1 steps, delay 5 steps, check yes + max neighbors/atom: 100000, page size: 1000000 + master list distance cutoff = 18 + ghost atom cutoff = 18 + binsize = 9, bins = 6 5 23 + 3 neighbor lists, perpetual/occasional/extra = 3 0 0 + (1) pair ilp/water/2dm, perpetual + attributes: full, newton on, ghost + pair build: full/bin/ghost + stencil: full/ghost/bin/3d + bin: standard + (2) pair lj/cut/tip4p/long, perpetual, skip from (3) + attributes: half, newton on + pair build: skip + stencil: none + bin: none + (3) neighbor class addition, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +SHAKE stats (type/ave/delta/count) on step 0 +Bond: 1 0.957201 2.19705e-06 96 +Angle: 1 104.52 0.000203056 48 +Per MPI rank memory allocation (min/avg/max) = 25.84 | 25.88 | 25.92 Mbytes + Step TotEng PotEng KinEng v_TIP4P v_EILP v_temp_wt + 0 -16.131263 -19.815178 3.6839141 189.37246 -1.903543 300 +SHAKE stats (type/ave/delta/count) on step 100 +Bond: 1 0.9572 9.54949e-07 96 +Angle: 1 104.52 6.01522e-05 48 + 100 -17.494869 -20.796995 3.3021253 188.4955 -1.8981262 268.90898 +SHAKE stats (type/ave/delta/count) on step 200 +Bond: 1 0.9572 9.63922e-07 96 +Angle: 1 104.52 7.7021e-05 48 + 200 -17.48627 -21.194892 3.7086213 188.14561 -1.9871708 302.01203 +SHAKE stats (type/ave/delta/count) on step 300 +Bond: 1 0.9572 1.4264e-06 96 +Angle: 1 104.52 6.48393e-05 48 + 300 -17.502843 -20.993703 3.4908599 188.23268 -1.8457229 284.27861 +SHAKE stats (type/ave/delta/count) on step 400 +Bond: 1 0.9572 1.33728e-06 96 +Angle: 1 104.52 7.6239e-05 48 + 400 -17.495285 -20.82835 3.333065 188.48003 -1.8429074 271.42856 +SHAKE stats (type/ave/delta/count) on step 500 +Bond: 1 0.9572 1.14685e-06 96 +Angle: 1 104.52 8.58621e-05 48 + 500 -17.491436 -20.443043 2.9516075 188.7589 -1.8566335 240.36452 +SHAKE stats (type/ave/delta/count) on step 600 +Bond: 1 0.9572 9.17601e-07 96 +Angle: 1 104.52 8.24517e-05 48 + 600 -17.505683 -20.608456 3.1027734 188.72078 -1.9560795 252.67474 +SHAKE stats (type/ave/delta/count) on step 700 +Bond: 1 0.9572 9.50425e-07 96 +Angle: 1 104.52 5.62422e-05 48 + 700 -17.496706 -21.072664 3.575958 188.2777 -1.9833951 291.20858 +SHAKE stats (type/ave/delta/count) on step 800 +Bond: 1 0.9572 1.15256e-06 96 +Angle: 1 104.52 7.02177e-05 48 + 800 -17.478628 -20.819507 3.340879 188.37868 -1.9113009 272.06489 +SHAKE stats (type/ave/delta/count) on step 900 +Bond: 1 0.9572 9.14163e-07 96 +Angle: 1 104.52 6.98849e-05 48 + 900 -17.480865 -20.728504 3.2476386 188.5902 -1.8922108 264.47185 +SHAKE stats (type/ave/delta/count) on step 1000 +Bond: 1 0.9572 1.00568e-06 96 +Angle: 1 104.52 0.000111707 48 + 1000 -17.498474 -20.331607 2.833133 188.87466 -1.8121689 230.71654 +Loop time of 9.42273 on 4 procs for 1000 steps with 936 atoms + +Performance: 9.169 ns/day, 2.617 hours/ns, 106.126 timesteps/s +97.1% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.2328 | 4.3228 | 7.5931 | 103.1 | 45.88 +Bond | 0.00084131 | 0.00088983 | 0.00095229 | 0.0 | 0.01 +Kspace | 1.3979 | 4.6476 | 6.7252 | 98.8 | 49.32 +Neigh | 0.34367 | 0.34371 | 0.34376 | 0.0 | 3.65 +Comm | 0.042806 | 0.062908 | 0.075887 | 5.4 | 0.67 +Output | 0.00037677 | 0.00041431 | 0.0004619 | 0.0 | 0.00 +Modify | 0.028432 | 0.031138 | 0.034528 | 1.3 | 0.33 +Other | | 0.01321 | | | 0.14 + +Nlocal: 234 ave 302 max 198 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Nghost: 2876.5 ave 3122 max 2632 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 107846 ave 150684 max 82181 min +Histogram: 2 0 0 0 1 0 0 0 0 1 + +Total # of neighbors = 431382 +Ave neighs/atom = 460.87821 +Ave special neighs/atom = 0.30769231 +Neighbor list builds = 28 +Dangerous builds = 0 +Total wall time: 0:00:09 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.1 b/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.1 new file mode 100644 index 0000000000..c6a11d209d --- /dev/null +++ b/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.1 @@ -0,0 +1,251 @@ +LAMMPS (23 Jun 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Initialization +units metal +boundary p p p +atom_style full +processors * * 1 # domain decomposition over x and y +read_data ./gra_water.data +Reading data file ... + orthogonal box = (0 0 0) to (46.92336 44.331078 200) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 936 atoms + reading velocities ... + 936 velocities + scanning bonds ... + 2 = max bonds/atom + scanning angles ... + 1 = max angles/atom + reading bonds ... + 96 bonds + reading angles ... + 48 angles +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 2 = max # of 1-2 neighbors + 1 = max # of 1-3 neighbors + 1 = max # of 1-4 neighbors + 2 = max # of special neighbors + special bonds CPU = 0.005 seconds + read_data CPU = 0.020 seconds +mass 1 12.0107 # carbon mass (g/mole) +mass 2 15.9994 # oxygen mass (g/mole) +mass 3 1.008 # hydrogen mass (g/mole) +# Separate atom groups +group gr molecule 1 +792 atoms in group gr +group water molecule 2 +144 atoms in group water +######################## Potential defition ############################## +# Interlayer potential +pair_style hybrid/overlay ilp/water/2dm/opt 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +#################################################################### +pair_coeff 1 1 none +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * ilp/water/2dm/opt COH.ILP C Ow Hw # C-water +Reading ilp/water/2dm potential file COH.ILP with DATE: 2023-05-17 +# bond and angle +bond_style harmonic +bond_coeff 1 0.0 0.9572 +angle_style harmonic +angle_coeff 1 0.0 104.52 +# define kspace calculation +kspace_style pppm/tip4p 1E-5 +# Neighbor update settings +neighbor 2.0 bin +neigh_modify every 1 delay 5 check yes page 1000000 one 100000 +#################################################################### +# Calculate pair energy +compute 1 all pair lj/cut/tip4p/long +compute 2 all pair ilp/water/2dm/opt +compute wt water temp +variable TIP4P equal c_1 +variable EILP equal c_2 # total interlayer energy +variable temp_wt equal c_wt +############# Output ############## +thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt +thermo 100 +thermo_modify lost error + +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 48 = # of frozen angles + find clusters CPU = 0.001 seconds + +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848 +@Article{Ouyang2018 + author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod}, + title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials}, + journal = {Nano Letters}, + volume = 18, + pages = {6009} + year = 2018, +} + +- ilp/tmd potential doi/10.1021/acs.jctc.1c00782 +@Article{Ouyang2021 + author = {W. Ouyang, R. Sofer, X. Gao, J. Hermann, A. Tkatchenko, L. Kronik, M. Urbakh, and O. Hod}, + title = {Anisotropic Interlayer Force Field for Transition Metal Dichalcogenides: The Case of Molybdenum Disulfide}, + journal = {J. Chem. Theory Comput.}, + volume = 17, + pages = {7237–7245} + year = 2021, +} + +- ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464 +@Article{Feng2023 + author = {Z. Feng, Y. Yao, J. Liu, B. Wu, Z. Liu, and W. Ouyang}, + title = {Registry-Dependent Potential for Interfaces of Water with Graphene}, + journal = {J. Phys. Chem. C}, + volume = 127, + pages = {8704-8713} + year = 2023, +} + +- ilp/graphene/hbn/opt potential doi:10.1145/3458817.3476137 +@inproceedings{gao2021lmff + author = {Gao, Ping and Duan, Xiaohui and Others}, + title = {LMFF: Efficient and Scalable Layered Materials Force Field on Heterogeneous Many-Core Processors}, + year = {2021}, + isbn = {9781450384421}, + publisher = {Association for Computing Machinery}, + address = {New York, NY, USA}, + url = {https://doi.org/10.1145/3458817.3476137}, + doi = {10.1145/3458817.3476137}, + booktitle = {Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis}, + articleno = {42}, + numpages = {14}, + location = {St. Louis, Missouri}, + series = {SC'21}, +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +PPPM initialization ... + extracting TIP4P info from pair style + using 12-bit tables for long-range coulomb (../kspace.cpp:342) + G vector (1/distance) = 0.28684806 + grid = 25 24 80 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0001640931 + estimated relative force accuracy = 1.1395635e-05 + using single precision MKL FFT + 3d grid and FFT values/proc = 84320 48000 +WARNING: Using a manybody potential with bonds/angles/dihedrals and special_bond exclusions (../pair.cpp:239) +Neighbor list info ... + update every 1 steps, delay 5 steps, check yes + max neighbors/atom: 100000, page size: 1000000 + master list distance cutoff = 18 + ghost atom cutoff = 18 + binsize = 9, bins = 6 5 23 + 3 neighbor lists, perpetual/occasional/extra = 3 0 0 + (1) pair ilp/water/2dm/opt, perpetual + attributes: full, newton on + pair build: full/bin + stencil: full/bin/3d + bin: standard + (2) pair lj/cut/tip4p/long, perpetual, skip from (3) + attributes: half, newton on + pair build: skip + stencil: none + bin: none + (3) neighbor class addition, perpetual, half/full from (1) + attributes: half, newton on + pair build: halffull/newton + stencil: none + bin: none +SHAKE stats (type/ave/delta/count) on step 0 +Bond: 1 0.957201 2.19705e-06 96 +Angle: 1 104.52 0.000203056 48 +Per MPI rank memory allocation (min/avg/max) = 25.89 | 25.89 | 25.89 Mbytes + Step TotEng PotEng KinEng v_TIP4P v_EILP v_temp_wt + 0 -16.131263 -19.815178 3.6839141 189.37246 -1.903543 300 +SHAKE stats (type/ave/delta/count) on step 100 +Bond: 1 0.9572 9.54949e-07 96 +Angle: 1 104.52 6.01522e-05 48 + 100 -17.494868 -20.796993 3.3021253 188.4955 -1.8981262 268.90898 +SHAKE stats (type/ave/delta/count) on step 200 +Bond: 1 0.9572 9.63922e-07 96 +Angle: 1 104.52 7.7021e-05 48 + 200 -17.486271 -21.194892 3.7086213 188.14561 -1.9871708 302.01203 +SHAKE stats (type/ave/delta/count) on step 300 +Bond: 1 0.9572 1.4264e-06 96 +Angle: 1 104.52 6.48393e-05 48 + 300 -17.502844 -20.993704 3.49086 188.23268 -1.8457229 284.27861 +SHAKE stats (type/ave/delta/count) on step 400 +Bond: 1 0.9572 1.33728e-06 96 +Angle: 1 104.52 7.6239e-05 48 + 400 -17.495287 -20.828353 3.3330658 188.48002 -1.8429075 271.42862 +SHAKE stats (type/ave/delta/count) on step 500 +Bond: 1 0.9572 1.14685e-06 96 +Angle: 1 104.52 8.58621e-05 48 + 500 -17.491436 -20.443044 2.9516084 188.7589 -1.8566335 240.36459 +SHAKE stats (type/ave/delta/count) on step 600 +Bond: 1 0.9572 9.17601e-07 96 +Angle: 1 104.52 8.24516e-05 48 + 600 -17.505684 -20.608457 3.1027731 188.72078 -1.9560796 252.67471 +SHAKE stats (type/ave/delta/count) on step 700 +Bond: 1 0.9572 9.50422e-07 96 +Angle: 1 104.52 5.62423e-05 48 + 700 -17.496701 -21.07266 3.5759595 188.2777 -1.9833956 291.20871 +SHAKE stats (type/ave/delta/count) on step 800 +Bond: 1 0.9572 1.15262e-06 96 +Angle: 1 104.52 7.02158e-05 48 + 800 -17.478623 -20.819504 3.340881 188.37868 -1.9112996 272.06506 +SHAKE stats (type/ave/delta/count) on step 900 +Bond: 1 0.9572 9.14138e-07 96 +Angle: 1 104.52 6.98742e-05 48 + 900 -17.480864 -20.728498 3.2476343 188.59022 -1.8922102 264.4715 +SHAKE stats (type/ave/delta/count) on step 1000 +Bond: 1 0.9572 1.00586e-06 96 +Angle: 1 104.52 0.000111711 48 + 1000 -17.498466 -20.331547 2.8330808 188.87473 -1.8121768 230.71228 +Loop time of 8.95265 on 1 procs for 1000 steps with 936 atoms + +Performance: 9.651 ns/day, 2.487 hours/ns, 111.699 timesteps/s +100.0% 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.2127 | 5.2127 | 5.2127 | 0.0 | 58.23 +Bond | 0.00083377 | 0.00083377 | 0.00083377 | 0.0 | 0.01 +Kspace | 3.5005 | 3.5005 | 3.5005 | 0.0 | 39.10 +Neigh | 0.17946 | 0.17946 | 0.17946 | 0.0 | 2.00 +Comm | 0.028553 | 0.028553 | 0.028553 | 0.0 | 0.32 +Output | 0.00035446 | 0.00035446 | 0.00035446 | 0.0 | 0.00 +Modify | 0.01889 | 0.01889 | 0.01889 | 0.0 | 0.21 +Other | | 0.01135 | | | 0.13 + +Nlocal: 936 ave 936 max 936 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 5242 ave 5242 max 5242 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 431382 ave 431382 max 431382 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 431382 +Ave neighs/atom = 460.87821 +Ave special neighs/atom = 0.30769231 +Neighbor list builds = 28 +Dangerous builds = 0 +Total wall time: 0:00:09 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.4 b/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.4 new file mode 100644 index 0000000000..852c429323 --- /dev/null +++ b/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.4 @@ -0,0 +1,251 @@ +LAMMPS (23 Jun 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Initialization +units metal +boundary p p p +atom_style full +processors * * 1 # domain decomposition over x and y +read_data ./gra_water.data +Reading data file ... + orthogonal box = (0 0 0) to (46.92336 44.331078 200) + 2 by 2 by 1 MPI processor grid + reading atoms ... + 936 atoms + reading velocities ... + 936 velocities + scanning bonds ... + 2 = max bonds/atom + scanning angles ... + 1 = max angles/atom + reading bonds ... + 96 bonds + reading angles ... + 48 angles +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 2 = max # of 1-2 neighbors + 1 = max # of 1-3 neighbors + 1 = max # of 1-4 neighbors + 2 = max # of special neighbors + special bonds CPU = 0.003 seconds + read_data CPU = 0.017 seconds +mass 1 12.0107 # carbon mass (g/mole) +mass 2 15.9994 # oxygen mass (g/mole) +mass 3 1.008 # hydrogen mass (g/mole) +# Separate atom groups +group gr molecule 1 +792 atoms in group gr +group water molecule 2 +144 atoms in group water +######################## Potential defition ############################## +# Interlayer potential +pair_style hybrid/overlay ilp/water/2dm/opt 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +#################################################################### +pair_coeff 1 1 none +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * ilp/water/2dm/opt COH.ILP C Ow Hw # C-water +Reading ilp/water/2dm potential file COH.ILP with DATE: 2023-05-17 +# bond and angle +bond_style harmonic +bond_coeff 1 0.0 0.9572 +angle_style harmonic +angle_coeff 1 0.0 104.52 +# define kspace calculation +kspace_style pppm/tip4p 1E-5 +# Neighbor update settings +neighbor 2.0 bin +neigh_modify every 1 delay 5 check yes page 1000000 one 100000 +#################################################################### +# Calculate pair energy +compute 1 all pair lj/cut/tip4p/long +compute 2 all pair ilp/water/2dm/opt +compute wt water temp +variable TIP4P equal c_1 +variable EILP equal c_2 # total interlayer energy +variable temp_wt equal c_wt +############# Output ############## +thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt +thermo 100 +thermo_modify lost error + +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 48 = # of frozen angles + find clusters CPU = 0.001 seconds + +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848 +@Article{Ouyang2018 + author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod}, + title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials}, + journal = {Nano Letters}, + volume = 18, + pages = {6009} + year = 2018, +} + +- ilp/tmd potential doi/10.1021/acs.jctc.1c00782 +@Article{Ouyang2021 + author = {W. Ouyang, R. Sofer, X. Gao, J. Hermann, A. Tkatchenko, L. Kronik, M. Urbakh, and O. Hod}, + title = {Anisotropic Interlayer Force Field for Transition Metal Dichalcogenides: The Case of Molybdenum Disulfide}, + journal = {J. Chem. Theory Comput.}, + volume = 17, + pages = {7237–7245} + year = 2021, +} + +- ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464 +@Article{Feng2023 + author = {Z. Feng, Y. Yao, J. Liu, B. Wu, Z. Liu, and W. Ouyang}, + title = {Registry-Dependent Potential for Interfaces of Water with Graphene}, + journal = {J. Phys. Chem. C}, + volume = 127, + pages = {8704-8713} + year = 2023, +} + +- ilp/graphene/hbn/opt potential doi:10.1145/3458817.3476137 +@inproceedings{gao2021lmff + author = {Gao, Ping and Duan, Xiaohui and Others}, + title = {LMFF: Efficient and Scalable Layered Materials Force Field on Heterogeneous Many-Core Processors}, + year = {2021}, + isbn = {9781450384421}, + publisher = {Association for Computing Machinery}, + address = {New York, NY, USA}, + url = {https://doi.org/10.1145/3458817.3476137}, + doi = {10.1145/3458817.3476137}, + booktitle = {Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis}, + articleno = {42}, + numpages = {14}, + location = {St. Louis, Missouri}, + series = {SC'21}, +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +PPPM initialization ... + extracting TIP4P info from pair style + using 12-bit tables for long-range coulomb (../kspace.cpp:342) + G vector (1/distance) = 0.28684806 + grid = 25 24 80 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0001640931 + estimated relative force accuracy = 1.1395635e-05 + using single precision MKL FFT + 3d grid and FFT values/proc = 30685 12480 +WARNING: Using a manybody potential with bonds/angles/dihedrals and special_bond exclusions (../pair.cpp:239) +Neighbor list info ... + update every 1 steps, delay 5 steps, check yes + max neighbors/atom: 100000, page size: 1000000 + master list distance cutoff = 18 + ghost atom cutoff = 18 + binsize = 9, bins = 6 5 23 + 3 neighbor lists, perpetual/occasional/extra = 3 0 0 + (1) pair ilp/water/2dm/opt, perpetual + attributes: full, newton on + pair build: full/bin + stencil: full/bin/3d + bin: standard + (2) pair lj/cut/tip4p/long, perpetual, skip from (3) + attributes: half, newton on + pair build: skip + stencil: none + bin: none + (3) neighbor class addition, perpetual, half/full from (1) + attributes: half, newton on + pair build: halffull/newton + stencil: none + bin: none +SHAKE stats (type/ave/delta/count) on step 0 +Bond: 1 0.957201 2.19705e-06 96 +Angle: 1 104.52 0.000203056 48 +Per MPI rank memory allocation (min/avg/max) = 22.03 | 22.06 | 22.1 Mbytes + Step TotEng PotEng KinEng v_TIP4P v_EILP v_temp_wt + 0 -16.131263 -19.815178 3.6839141 189.37246 -1.903543 300 +SHAKE stats (type/ave/delta/count) on step 100 +Bond: 1 0.9572 9.54949e-07 96 +Angle: 1 104.52 6.01522e-05 48 + 100 -17.494869 -20.796995 3.3021253 188.4955 -1.8981262 268.90898 +SHAKE stats (type/ave/delta/count) on step 200 +Bond: 1 0.9572 9.63922e-07 96 +Angle: 1 104.52 7.7021e-05 48 + 200 -17.48627 -21.194892 3.7086213 188.14561 -1.9871708 302.01203 +SHAKE stats (type/ave/delta/count) on step 300 +Bond: 1 0.9572 1.4264e-06 96 +Angle: 1 104.52 6.48393e-05 48 + 300 -17.502843 -20.993703 3.4908599 188.23268 -1.8457229 284.27861 +SHAKE stats (type/ave/delta/count) on step 400 +Bond: 1 0.9572 1.33728e-06 96 +Angle: 1 104.52 7.6239e-05 48 + 400 -17.495285 -20.82835 3.333065 188.48003 -1.8429074 271.42856 +SHAKE stats (type/ave/delta/count) on step 500 +Bond: 1 0.9572 1.14685e-06 96 +Angle: 1 104.52 8.58621e-05 48 + 500 -17.491436 -20.443043 2.9516075 188.7589 -1.8566335 240.36452 +SHAKE stats (type/ave/delta/count) on step 600 +Bond: 1 0.9572 9.17601e-07 96 +Angle: 1 104.52 8.24517e-05 48 + 600 -17.505682 -20.608456 3.1027734 188.72078 -1.9560795 252.67474 +SHAKE stats (type/ave/delta/count) on step 700 +Bond: 1 0.9572 9.50425e-07 96 +Angle: 1 104.52 5.62423e-05 48 + 700 -17.496706 -21.072664 3.575958 188.2777 -1.9833951 291.20858 +SHAKE stats (type/ave/delta/count) on step 800 +Bond: 1 0.9572 1.15256e-06 96 +Angle: 1 104.52 7.02177e-05 48 + 800 -17.478628 -20.819507 3.340879 188.37868 -1.9113009 272.0649 +SHAKE stats (type/ave/delta/count) on step 900 +Bond: 1 0.9572 9.14163e-07 96 +Angle: 1 104.52 6.98849e-05 48 + 900 -17.480868 -20.728506 3.2476383 188.5902 -1.8922108 264.47182 +SHAKE stats (type/ave/delta/count) on step 1000 +Bond: 1 0.9572 1.00568e-06 96 +Angle: 1 104.52 0.000111707 48 + 1000 -17.498472 -20.331605 2.8331335 188.87466 -1.8121689 230.71657 +Loop time of 4.7828 on 4 procs for 1000 steps with 936 atoms + +Performance: 18.065 ns/day, 1.329 hours/ns, 209.082 timesteps/s +96.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.26735 | 1.3839 | 3.2059 | 99.7 | 28.93 +Bond | 0.00079377 | 0.00086039 | 0.00093529 | 0.0 | 0.02 +Kspace | 1.4248 | 3.2254 | 4.3332 | 64.6 | 67.44 +Neigh | 0.061885 | 0.061916 | 0.061951 | 0.0 | 1.29 +Comm | 0.044281 | 0.065185 | 0.078628 | 5.1 | 1.36 +Output | 0.0003482 | 0.0003787 | 0.00040746 | 0.0 | 0.01 +Modify | 0.028727 | 0.031529 | 0.034914 | 1.3 | 0.66 +Other | | 0.01367 | | | 0.29 + +Nlocal: 234 ave 302 max 198 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Nghost: 2876.5 ave 3122 max 2632 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 107846 ave 150684 max 82181 min +Histogram: 2 0 0 0 1 0 0 0 0 1 + +Total # of neighbors = 431382 +Ave neighs/atom = 460.87821 +Ave special neighs/atom = 0.30769231 +Neighbor list builds = 28 +Dangerous builds = 0 +Total wall time: 0:00:04 From 9da310a33e947d9e07a7b3ea4540b9aaeab61274 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 19 May 2023 00:40:45 -0400 Subject: [PATCH 062/172] spelling --- doc/src/Build_manual.rst | 2 +- doc/src/variable.rst | 2 +- doc/utils/sphinx-config/false_positives.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/Build_manual.rst b/doc/src/Build_manual.rst index e9a55134da..4b4bfa5a45 100644 --- a/doc/src/Build_manual.rst +++ b/doc/src/Build_manual.rst @@ -52,7 +52,7 @@ can be translated to different output format using the `Sphinx incorporates programmer documentation extracted from the LAMMPS C++ sources through the `Doxygen `_ program. Currently the translation to HTML, PDF (via LaTeX), ePUB (for many e-book readers) -and MOBI (for Amazon Kindle(tm) readers) are supported. For that to work a +and MOBI (for Amazon Kindle readers) are supported. For that to work a Python interpreter version 3.8 or later, the ``doxygen`` tools and internet access to download additional files and tools are required. This download is usually only required once or after the documentation diff --git a/doc/src/variable.rst b/doc/src/variable.rst index afa491e96e..1c76a2acf4 100644 --- a/doc/src/variable.rst +++ b/doc/src/variable.rst @@ -1474,7 +1474,7 @@ commands .. code-block:: LAMMPS # delete_atoms random fraction 0.5 yes all NULL 49839 - # run 0 + # run 0 post no variable t equal temp # this thermo keyword invokes a temperature compute print "Temperature of system = $t" run 1000 diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index d2d15633af..2951f7d12e 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -3736,6 +3736,7 @@ Umin un unary uncomment +uncommented uncompress uncompute underprediction From 7c14b750ef5fbf9be610aeaf122c37d6d872537e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 19 May 2023 00:40:54 -0400 Subject: [PATCH 063/172] improve error message --- src/DIFFRACTION/compute_xrd.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/DIFFRACTION/compute_xrd.cpp b/src/DIFFRACTION/compute_xrd.cpp index 010e5bcb7d..426248b31e 100644 --- a/src/DIFFRACTION/compute_xrd.cpp +++ b/src/DIFFRACTION/compute_xrd.cpp @@ -90,8 +90,7 @@ ComputeXRD::ComputeXRD(LAMMPS *lmp, int narg, char **arg) : ztype[i] = j; } } - if (ztype[i] == XRDmaxType + 1) - error->all(FLERR,"Compute XRD: Invalid ASF atom type"); + if (ztype[i] == XRDmaxType + 1) error->all(FLERR,"Compute XRD: Invalid ASF atom type {}", arg[iarg]); iarg++; } From 22d9c047f44a9417028831c981889ec8e08f2e05 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Fri, 19 May 2023 22:52:18 +0800 Subject: [PATCH 064/172] update doc file --- doc/src/pair_ilp_water_2dm.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/pair_ilp_water_2dm.rst b/doc/src/pair_ilp_water_2dm.rst index 5dc287493b..c611fb9275 100644 --- a/doc/src/pair_ilp_water_2dm.rst +++ b/doc/src/pair_ilp_water_2dm.rst @@ -163,4 +163,4 @@ tap_flag = 1 .. _Feng: -**(Feng)** Z. Feng, W. Ouyang, J. Phys. Chem. C. accepted (2023). +**(Feng)** Z. Feng and W. Ouyang et al, J. Phys. Chem. C 127, 8704-8713 (2023). From 0334ddb7c69a36b33757694b905820f56d8b90f2 Mon Sep 17 00:00:00 2001 From: Wengen Ouyang <34092370+oywg11@users.noreply.github.com> Date: Fri, 19 May 2023 22:57:45 +0800 Subject: [PATCH 065/172] Update pair_ilp_water_2dm.rst --- doc/src/pair_ilp_water_2dm.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/pair_ilp_water_2dm.rst b/doc/src/pair_ilp_water_2dm.rst index 5dc287493b..8ba75fb857 100644 --- a/doc/src/pair_ilp_water_2dm.rst +++ b/doc/src/pair_ilp_water_2dm.rst @@ -163,4 +163,4 @@ tap_flag = 1 .. _Feng: -**(Feng)** Z. Feng, W. Ouyang, J. Phys. Chem. C. accepted (2023). +**(Feng)** Z. Feng and W. Ouyang et al., J. Phys. Chem. C. 127, 8704-8713 (2023). From 7ec842d9cbcfa1f63496383f66125cdc1a9d47dd Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 19 May 2023 13:50:11 -0600 Subject: [PATCH 066/172] Adding requested feature to normalize forces --- src/BPM/bond_bpm_rotational.cpp | 28 ++++++++++++++++++++-------- src/BPM/bond_bpm_rotational.h | 2 +- src/BPM/bond_bpm_spring.cpp | 16 ++++++++++++++-- src/BPM/bond_bpm_spring.h | 2 +- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/BPM/bond_bpm_rotational.cpp b/src/BPM/bond_bpm_rotational.cpp index ac29c0e376..5c5c0218b6 100644 --- a/src/BPM/bond_bpm_rotational.cpp +++ b/src/BPM/bond_bpm_rotational.cpp @@ -50,6 +50,7 @@ BondBPMRotational::BondBPMRotational(LAMMPS *_lmp) : { partial_flag = 1; smooth_flag = 1; + normalize_flag = 0; single_extra = 7; svector = new double[7]; @@ -203,6 +204,13 @@ double BondBPMRotational::elastic_forces(int i1, int i2, int type, double r_mag, double Ts[3], Tb[3], Tt[3], Tbp[3], Ttp[3], Tsp[3], T_rot[3], Ttmp[3]; double **quat = atom->quat; + double r0_mag_inv = 1.0 / r0_mag; + double Kr_type = Kr[type]; + double Ks_type = Ks[type]; + if (normalize_flag) { + Kr_type *= r0_mag_inv; + Ks_type *= r0_mag_inv; + } q1[0] = quat[i1][0]; q1[1] = quat[i1][1]; @@ -217,26 +225,26 @@ double BondBPMRotational::elastic_forces(int i1, int i2, int type, double r_mag, // Calculate normal forces, rb = bond vector in particle 1's frame MathExtra::qconjugate(q2, q2inv); MathExtra::quatrotvec(q2inv, r, rb); - Fr = Kr[type] * (r_mag - r0_mag); + Fr = Kr_type * (r_mag - r0_mag); MathExtra::scale3(Fr * r_mag_inv, rb, F_rot); // Calculate forces due to tangential displacements (no rotation) r0_dot_rb = MathExtra::dot3(r0, rb); - c = r0_dot_rb * r_mag_inv / r0_mag; + c = r0_dot_rb * r_mag_inv * r0_mag_inv; gamma = acos_limit(c); MathExtra::cross3(rb, r0, rb_x_r0); MathExtra::cross3(rb, rb_x_r0, s); MathExtra::norm3(s); - MathExtra::scale3(Ks[type] * r_mag * gamma, s, Fs); + MathExtra::scale3(Ks_type * r_mag * gamma, s, Fs); // Calculate torque due to tangential displacements MathExtra::cross3(r0, rb, t); MathExtra::norm3(t); - MathExtra::scale3(0.5 * r_mag * Ks[type] * r_mag * gamma, t, Ts); + MathExtra::scale3(0.5 * r_mag * Ks_type * r_mag * gamma, t, Ts); // Relative rotation force/torque // Use representation of X'Y'Z' rotations from Wang, Mora 2009 @@ -316,12 +324,12 @@ double BondBPMRotational::elastic_forces(int i1, int i2, int type, double r_mag, Ttp[1] = 0.0; Ttp[2] = Kt[type] * psi; - Fsp[0] = -0.5 * Ks[type] * r_mag * theta * cos_phi; - Fsp[1] = -0.5 * Ks[type] * r_mag * theta * sin_phi; + Fsp[0] = -0.5 * Ks_type * r_mag * theta * cos_phi; + Fsp[1] = -0.5 * Ks_type * r_mag * theta * sin_phi; Fsp[2] = 0.0; - Tsp[0] = 0.25 * Ks[type] * r_mag * r_mag * theta * sin_phi; - Tsp[1] = -0.25 * Ks[type] * r_mag * r_mag * theta * cos_phi; + Tsp[0] = 0.25 * Ks_type * r_mag * r_mag * theta * sin_phi; + Tsp[1] = -0.25 * Ks_type * r_mag * r_mag * theta * cos_phi; Tsp[2] = 0.0; // Rotate forces/torques back to 1st particle's frame @@ -667,6 +675,10 @@ void BondBPMRotational::settings(int narg, char **arg) if (iarg + 1 > narg) error->all(FLERR, "Illegal bond bpm command, missing option for smooth"); smooth_flag = utils::logical(FLERR, arg[iarg + 1], false, lmp); i += 1; + } else if (strcmp(arg[iarg], "normalize") == 0) { + if (iarg + 1 > narg) error->all(FLERR, "Illegal bond bpm command, missing option for normalize"); + normalize_flag = utils::logical(FLERR, arg[iarg + 1], false, lmp); + i += 1; } else { error->all(FLERR, "Illegal bond bpm command, invalid argument {}", arg[iarg]); } diff --git a/src/BPM/bond_bpm_rotational.h b/src/BPM/bond_bpm_rotational.h index 0fb38e7343..9fdc418d2d 100644 --- a/src/BPM/bond_bpm_rotational.h +++ b/src/BPM/bond_bpm_rotational.h @@ -41,7 +41,7 @@ class BondBPMRotational : public BondBPM { protected: double *Kr, *Ks, *Kt, *Kb, *gnorm, *gslide, *groll, *gtwist; double *Fcr, *Fcs, *Tct, *Tcb; - int smooth_flag; + int smooth_flag, normalize_flag; double elastic_forces(int, int, int, double, double, double, double *, double *, double *, double *, double *, double *); diff --git a/src/BPM/bond_bpm_spring.cpp b/src/BPM/bond_bpm_spring.cpp index ed4e71daf1..37b79f93fb 100644 --- a/src/BPM/bond_bpm_spring.cpp +++ b/src/BPM/bond_bpm_spring.cpp @@ -37,6 +37,7 @@ BondBPMSpring::BondBPMSpring(LAMMPS *_lmp) : { partial_flag = 1; smooth_flag = 1; + normalize_flag = 0; single_extra = 1; svector = new double[1]; @@ -190,7 +191,10 @@ void BondBPMSpring::compute(int eflag, int vflag) } rinv = 1.0 / r; - fbond = k[type] * (r0 - r); + if (normalize_flag) + fbond = -k[type] * e; + else + fbond = k[type] * (r0 - r); delvx = v[i1][0] - v[i2][0]; delvy = v[i1][1] - v[i2][1]; @@ -302,6 +306,10 @@ void BondBPMSpring::settings(int narg, char **arg) if (iarg + 1 > narg) error->all(FLERR, "Illegal bond bpm command, missing option for smooth"); smooth_flag = utils::logical(FLERR, arg[iarg + 1], false, lmp); i += 1; + } else if (strcmp(arg[iarg], "normalize") == 0) { + if (iarg + 1 > narg) error->all(FLERR, "Illegal bond bpm command, missing option for normalize"); + normalize_flag = utils::logical(FLERR, arg[iarg + 1], false, lmp); + i += 1; } else { error->all(FLERR, "Illegal bond bpm command, invalid argument {}", arg[iarg]); } @@ -376,7 +384,11 @@ double BondBPMSpring::single(int type, double rsq, int i, int j, double &fforce) double r = sqrt(rsq); double rinv = 1.0 / r; - fforce = k[type] * (r0 - r); + + if (normalize_flag) + fforce = k[type] * (r0 - r) / r0; + else + fforce = k[type] * (r0 - r); double **x = atom->x; double **v = atom->v; diff --git a/src/BPM/bond_bpm_spring.h b/src/BPM/bond_bpm_spring.h index 409469bef3..93f4b49a26 100644 --- a/src/BPM/bond_bpm_spring.h +++ b/src/BPM/bond_bpm_spring.h @@ -40,7 +40,7 @@ class BondBPMSpring : public BondBPM { protected: double *k, *ecrit, *gamma; - int smooth_flag; + int smooth_flag, normalize_flag; void allocate(); void store_data(); From cb5934cbcdbf6ea4098451473d45126c79f99ca2 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 19 May 2023 13:51:53 -0600 Subject: [PATCH 067/172] Adding option to doc files, clarifying normal forces in compute pair/bond local --- doc/src/bond_bpm_rotational.rst | 6 ++++++ doc/src/bond_bpm_spring.rst | 8 +++++++- doc/src/compute_bond_local.rst | 5 ++++- doc/src/compute_pair_local.rst | 4 +++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/doc/src/bond_bpm_rotational.rst b/doc/src/bond_bpm_rotational.rst index ba93d679ba..0baf7e35b1 100644 --- a/doc/src/bond_bpm_rotational.rst +++ b/doc/src/bond_bpm_rotational.rst @@ -30,6 +30,9 @@ Syntax *smooth* value = *yes* or *no* smooths bond forces near the breaking point + *normalize* value = *yes* or *no* + normalizes normal and shear forces by the reference length + *break/no* indicates that bonds should not break during a run @@ -136,6 +139,9 @@ or :doc:`read_restart ` commands: * :math:`\gamma_r` (force*distance/velocity units) * :math:`\gamma_t` (force*distance/velocity units) +However, the *normalize* option will normalize the radial and shear forces +by :math:`r_0` such that :math:`k_r` and :math:`k_s` are unit less. + By default, pair forces are not calculated between bonded particles. Pair forces can alternatively be overlaid on top of bond forces using the *overlay/pair* keyword. These settings require specific diff --git a/doc/src/bond_bpm_spring.rst b/doc/src/bond_bpm_spring.rst index 5762dbe208..6da0d25a4a 100644 --- a/doc/src/bond_bpm_spring.rst +++ b/doc/src/bond_bpm_spring.rst @@ -30,6 +30,9 @@ Syntax *smooth* value = *yes* or *no* smooths bond forces near the breaking point + *normalize* value = *yes* or *no* + normalizes bond forces by their reference length + *break/no* indicates that bonds should not break during a run @@ -66,7 +69,7 @@ particles based on a model described by Clemmer and Robbins F = k (r - r_0) w -where :math:`k_r` is a stiffness, :math:`r` is the current distance +where :math:`k` is a stiffness, :math:`r` is the current distance and :math:`r_0` is the initial distance between the two particles, and :math:`w` is an optional smoothing factor discussed below. Bonds will break at a strain of :math:`\epsilon_c`. This is done by setting by @@ -102,6 +105,9 @@ the data file or restart files read by the :doc:`read_data * :math:`\epsilon_c` (unit less) * :math:`\gamma` (force/velocity units) +However, the *normalize* option will normalize the elastic bond force by +:math:`r_0` such that :math:`k` is unit less. + By default, pair forces are not calculated between bonded particles. Pair forces can alternatively be overlaid on top of bond forces using the *overlay/pair* keyword. These settings require specific diff --git a/doc/src/compute_bond_local.rst b/doc/src/compute_bond_local.rst index f3fb752ebe..10e86bbe44 100644 --- a/doc/src/compute_bond_local.rst +++ b/doc/src/compute_bond_local.rst @@ -76,7 +76,10 @@ The value *force* is the magnitude of the force acting between the pair of atoms in the bond. The values *fx*, *fy*, and *fz* are the xyz components of -*force* between the pair of atoms in the bond. +*force* between the pair of atoms in the bond. For bond styles that apply +non-central forces, such as :doc:`bond_style bpm/rotational +`, these values only include the :math:`(x,y,z)` +components of the normal force component. The remaining properties are all computed for motion of the two atoms relative to the center of mass (COM) velocity of the 2 atoms in the diff --git a/doc/src/compute_pair_local.rst b/doc/src/compute_pair_local.rst index dace280dee..31209f63f4 100644 --- a/doc/src/compute_pair_local.rst +++ b/doc/src/compute_pair_local.rst @@ -66,7 +66,9 @@ The value *eng* is the interaction energy for the pair of atoms. The value *force* is the force acting between the pair of atoms, which is positive for a repulsive force and negative for an attractive force. The values *fx*, *fy*, and *fz* are the :math:`(x,y,z)` components of -*force* on atom I. +*force* on atom I. For pair styles that apply non-central forces, +such as :doc:`granular pair styles `, these values only include +the :math:`(x,y,z)` components of the normal force component. A pair style may define additional pairwise quantities which can be accessed as *p1* to *pN*, where :math:`N` is defined by the pair style. From 0dd26189d4e8fb5b5630618687f74cd032d6ad62 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 19 May 2023 13:52:35 -0600 Subject: [PATCH 068/172] Adding missing factor in bpm/rotational single method --- src/BPM/bond_bpm_rotational.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BPM/bond_bpm_rotational.cpp b/src/BPM/bond_bpm_rotational.cpp index 5c5c0218b6..ffb0d9521d 100644 --- a/src/BPM/bond_bpm_rotational.cpp +++ b/src/BPM/bond_bpm_rotational.cpp @@ -805,7 +805,7 @@ double BondBPMRotational::single(int type, double rsq, int i, int j, double &ffo double breaking = elastic_forces(i, j, type, r_mag, r0_mag, r_mag_inv, rhat, r, r0, force1on2, torque1on2, torque2on1); damping_forces(i, j, type, rhat, r, force1on2, torque1on2, torque2on1); - fforce = MathExtra::dot3(force1on2, r); + fforce = MathExtra::dot3(force1on2, rhat); fforce *= -1; double smooth = 1.0; From 36eb11f499d2ebfa896e14bd0caa8792561788ad Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sat, 20 May 2023 12:59:34 +0300 Subject: [PATCH 069/172] Include method for bond contribution & variables to compute_stress_mop.h --- src/EXTRA-COMPUTE/compute_stress_mop.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.h b/src/EXTRA-COMPUTE/compute_stress_mop.h index 5357d36371..c9f95c1996 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.h +++ b/src/EXTRA-COMPUTE/compute_stress_mop.h @@ -38,11 +38,13 @@ class ComputeStressMop : public Compute { private: void compute_pairs(); + void compute_bonds(); int me, nvalues, dir; int *which; double *values_local, *values_global; + double *bond_local, *bond_global; double pos, pos1, dt, nktv2p, ftm2v; double area; class NeighList *list; From 5da65bbd0a158e89b06e959a17cde3af02474d71 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sat, 20 May 2023 13:06:19 +0300 Subject: [PATCH 070/172] Code for bond contribution to stress/mop --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 137 ++++++++++++++++++++++- 1 file changed, 132 insertions(+), 5 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 60f2d76e06..7900a62bef 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -19,10 +19,13 @@ #include "compute_stress_mop.h" #include "atom.h" +#include "atom_vec.h" +#include "bond.h" #include "domain.h" #include "error.h" #include "force.h" #include "memory.h" +#include "molecule.h" #include "neigh_list.h" #include "neighbor.h" #include "pair.h" @@ -118,12 +121,16 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : // Initialize some variables values_local = values_global = vector = nullptr; + bond_local = nullptr; + bond_global = nullptr; // this fix produces a global vector memory->create(vector,nvalues,"stress/mop:vector"); memory->create(values_local,nvalues,"stress/mop/spatial:values_local"); memory->create(values_global,nvalues,"stress/mop/spatial:values_global"); + memory->create(bond_local,nvalues,"stress/mop/spatial:bond_local"); + memory->create(bond_global,nvalues,"stress/mop/spatial:bond_global"); size_vector = nvalues; vector_flag = 1; @@ -140,6 +147,8 @@ ComputeStressMop::~ComputeStressMop() memory->destroy(values_local); memory->destroy(values_global); + memory->destroy(bond_local); + memory->destroy(bond_global); memory->destroy(vector); } @@ -185,8 +194,8 @@ void ComputeStressMop::init() //Compute stress/mop only accounts for pair interactions. // issue a warning if any intramolecular potential or Kspace is defined. - if (force->bond!=nullptr) - error->warning(FLERR,"compute stress/mop does not account for bond potentials"); + //if (force->bond!=nullptr) + // error->warning(FLERR,"compute stress/mop does not account for bond potentials"); if (force->angle!=nullptr) error->warning(FLERR,"compute stress/mop does not account for angle potentials"); if (force->dihedral!=nullptr) @@ -224,9 +233,14 @@ void ComputeStressMop::compute_vector() MPI_Allreduce(values_local,values_global,nvalues, MPI_DOUBLE,MPI_SUM,world); - int m; - for (m=0; mx; + tagint *tag = atom->tag; + int *num_bond = atom->num_bond; + tagint **bond_atom = atom->bond_atom; + int **bond_type = atom->bond_type; + int *mask = atom->mask; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + + int nlocal = atom->nlocal; + int newton_bond = force->newton_bond; + int molecular = atom->molecular; + + Bond *bond = force->bond; + + double dx[3] {0}; + double x_bond_1[3] {0}; + double x_bond_2[3] {0}; + double local_contribution[3] {0}; + + // initialization + for (int i {0}; i < nvalues; i++) bond_local[i] = 0.0; + + // loop over all bonded atoms in the current proc + for (atom1 = 0; atom1 < nlocal; atom1++) { + if (!(mask[atom1] & groupbit)) continue; + + if (molecular == 1) + nb = num_bond[atom1]; + else { + if (molindex[atom1] < 0) continue; + imol = molindex[atom1]; + iatom = molatom[atom1]; + nb = onemols[imol]->num_bond[iatom]; + } + + for (i = 0; i < nb; i++) { + if (molecular == 1) { + btype = bond_type[atom1][i]; + atom2 = atom->map(bond_atom[atom1][i]); + } else { + tagprev = tag[atom1] - iatom - 1; + btype = onemols[imol]->bond_type[iatom][i]; + atom2 = atom->map(onemols[imol]->bond_atom[iatom][i] + tagprev); + } + + if (atom2 < 0 || !(mask[atom2] & groupbit)) continue; + if (newton_bond == 0 && tag[atom1] > tag[atom2]) continue; + if (btype <= 0) continue; + + // minimum image of atom1 with respect to the plane of interest + dx[0] = x[atom1][0]; + dx[1] = x[atom1][1]; + dx[2] = x[atom1][2]; + dx[dir] -= pos; + domain->minimum_image(dx[0], dx[1], dx[2]); + x_bond_1[0] = dx[0]; + x_bond_1[1] = dx[1]; + x_bond_1[2] = dx[2]; + x_bond_1[dir] += pos; + + // minimum image of atom2 with respect to atom1 + dx[0] = x[atom2][0] - x_bond_1[0]; + dx[1] = x[atom2][1] - x_bond_1[1]; + dx[2] = x[atom2][2] - x_bond_1[2]; + domain->minimum_image(dx[0], dx[1], dx[2]); + x_bond_2[0] = x_bond_1[0] + dx[0]; + x_bond_2[1] = x_bond_1[1] + dx[1]; + x_bond_2[2] = x_bond_1[2] + dx[2]; + + // check if the bond vector crosses the plane of interest + double tau = (x_bond_1[dir] - pos) / (x_bond_1[dir] - x_bond_2[dir]); + if ((tau <= 1) and (tau >= 0)) + { + //std::cout << "I have found one crossing bond " << tau << std::endl; + dx[0] = x_bond_1[0] - x_bond_2[0]; + dx[1] = x_bond_1[1] - x_bond_2[1]; + dx[2] = x_bond_1[2] - x_bond_2[2]; + rsq = dx[0] * dx[0] + dx[1] * dx[1] + dx[2] * dx[2]; + bond->single(btype, rsq, atom1, atom2, fpair); + + // check the correct contribution with the + or - sign + local_contribution[0] += fpair*dx[0]/area*nktv2p; + local_contribution[1] += fpair*dx[1]/area*nktv2p; + local_contribution[2] += fpair*dx[2]/area*nktv2p; + } + } + } + + // loop over the keywords and if necessary add the bond contribution + int m {0}; + while (m Date: Sat, 20 May 2023 15:12:42 +0300 Subject: [PATCH 071/172] Update compute_stress_mop.cpp --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 7900a62bef..89ef4e8b2b 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -525,16 +525,13 @@ void ComputeStressMop::compute_bonds() // check if the bond vector crosses the plane of interest double tau = (x_bond_1[dir] - pos) / (x_bond_1[dir] - x_bond_2[dir]); - if ((tau <= 1) and (tau >= 0)) - { - //std::cout << "I have found one crossing bond " << tau << std::endl; + if ((tau <= 1) and (tau >= 0)) { dx[0] = x_bond_1[0] - x_bond_2[0]; dx[1] = x_bond_1[1] - x_bond_2[1]; dx[2] = x_bond_1[2] - x_bond_2[2]; rsq = dx[0] * dx[0] + dx[1] * dx[1] + dx[2] * dx[2]; bond->single(btype, rsq, atom1, atom2, fpair); - // check the correct contribution with the + or - sign local_contribution[0] += fpair*dx[0]/area*nktv2p; local_contribution[1] += fpair*dx[1]/area*nktv2p; local_contribution[2] += fpair*dx[2]/area*nktv2p; @@ -552,5 +549,4 @@ void ComputeStressMop::compute_bonds() } m += 3; } - return; } From 1d7a6f813bd623ba1d483da70e13d1c40ef24a43 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sat, 20 May 2023 15:14:47 +0300 Subject: [PATCH 072/172] Update compute_stress_mop.cpp --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 89ef4e8b2b..8391622242 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -525,7 +525,7 @@ void ComputeStressMop::compute_bonds() // check if the bond vector crosses the plane of interest double tau = (x_bond_1[dir] - pos) / (x_bond_1[dir] - x_bond_2[dir]); - if ((tau <= 1) and (tau >= 0)) { + if ((tau <= 1) && (tau >= 0)) { dx[0] = x_bond_1[0] - x_bond_2[0]; dx[1] = x_bond_1[1] - x_bond_2[1]; dx[2] = x_bond_1[2] - x_bond_2[2]; From 3822e6ff0f6f9eb500ed0a02d74001bb31da309c Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sun, 21 May 2023 10:29:24 +0800 Subject: [PATCH 073/172] add potential file that parameterized against with DMC reference data --- potentials/COH.DMC.ILP | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 potentials/COH.DMC.ILP diff --git a/potentials/COH.DMC.ILP b/potentials/COH.DMC.ILP new file mode 100755 index 0000000000..7235afcdab --- /dev/null +++ b/potentials/COH.DMC.ILP @@ -0,0 +1,28 @@ +# DATE: 2023-05-18 UNITS: metal CONTRIBUTOR: Wengen Ouyang w.g.ouyang@gmail.com CITATION: Z. Feng, ..., and W. Ouyang, J. Phys. Chem. C 127, 8704 (2023). +# Interlayer Potential (ILP) for water/graphene heterojunctions +# The parameters below are fitted against the DMC reference data that rescaled from PBE+MBD-NL. +# +# ----------------- Repulsion Potential ------------------++++++++++++++ Vdw Potential ++++++++++++++++************ +# beta(A) alpha delta(A) epsilon(meV) C(meV) d sR reff(A) C6(meV*A^6) S rcut +# For graphene and hydrocarbons +C C 3.205843 7.511126 1.235334 1.528338E-5 37.530428 15.499947 0.7954443 3.681440 25.714535E3 1.0 2.0 +H H 3.974540 6.53799 1.080633 0.6700556 0.8333833 15.022371 0.7490632 2.767223 1.6159581E3 1.0 1.2 +C H 2.642950 12.91410 1.020257 0.9750012 25.340996 15.222927 0.8115998 3.887324 5.6874617E3 1.0 1.5 +H C 2.642950 12.91410 1.020257 0.9750012 25.340996 15.222927 0.8115998 3.887324 5.6874617E3 1.0 1.5 + +# For water-graphene +C Ow 4.03686677 15.09817069 1.00000323 1.03838111 0.16372013 9.00010553 1.12057182 2.96484087 21887.14173222 1.0 2.0 +C Hw 3.08246994 6.412090180 1.00000265 2.89390420 -1.85748759 9.00009101 1.04574423 2.21642099 4652.78021666 1.0 2.0 +Ow C 4.03686677 15.09817069 1.00000323 1.03838111 0.16372013 9.00010553 1.12057182 2.96484087 21887.14173222 1.0 1.2 +Hw C 3.08246994 6.412090180 1.00000265 2.89390420 -1.85748759 9.00009101 1.04574423 2.21642099 4652.78021666 1.0 1.2 + +# # The ILPs for other systems are set to zero +H Ow 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +H Hw 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +Ow H 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +Hw H 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 + +Ow Ow 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +Hw Hw 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +Ow Hw 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 +Hw Ow 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 \ No newline at end of file From 91ac9ef3fc4c88ddcb7b1356a62c3c927535fb2c Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sun, 21 May 2023 11:29:28 +0800 Subject: [PATCH 074/172] update doc file --- doc/src/pair_ilp_water_2dm.rst | 170 +++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 doc/src/pair_ilp_water_2dm.rst diff --git a/doc/src/pair_ilp_water_2dm.rst b/doc/src/pair_ilp_water_2dm.rst new file mode 100644 index 0000000000..82cf1a6580 --- /dev/null +++ b/doc/src/pair_ilp_water_2dm.rst @@ -0,0 +1,170 @@ +.. index:: pair_style ilp/water/2dm +.. index:: pair_style ilp/water/2dm/opt + +pair_style ilp/tmd command +=================================== + +Accelerator Variant: *ilp/water/2dm/opt* + +Syntax +"""""" + +.. code-block:: LAMMPS + + pair_style [hybrid/overlay ...] ilp/tmd cutoff tap_flag + +* cutoff = global cutoff (distance units) +* tap_flag = 0/1 to turn off/on the taper function + +Examples +"""""""" + +.. code-block:: LAMMPS + + pair_style hybrid/overlay ilp/water/2dm 16.0 1 + pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw + + pair_style hybrid/overlay ilp/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 + pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O + pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H + pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H + pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw + +Description +""""""""""" + +.. versionadded:: xxxx2023 + +The *ilp/water/2dm* style computes the registry-dependent interlayer +potential (ILP) potential for interfaces of water with two-dimensinal (2D) +materials as described in :ref:`(Feng) `. + +.. math:: + + E = & \frac{1}{2} \sum_i \sum_{j \neq i} V_{ij} \\ + V_{ij} = & {\rm Tap}(r_{ij})\left \{ e^{-\alpha (r_{ij}/\beta -1)} + \left [ \epsilon + f(\rho_{ij}) + f(\rho_{ji})\right ] - + \frac{1}{1+e^{-d\left [ \left ( r_{ij}/\left (s_R \cdot r^{eff} \right ) \right )-1 \right ]}} + \cdot \frac{C_6}{r^6_{ij}} \right \}\\ + \rho_{ij}^2 = & r_{ij}^2 - ({\bf r}_{ij} \cdot {\bf n}_i)^2 \\ + \rho_{ji}^2 = & r_{ij}^2 - ({\bf r}_{ij} \cdot {\bf n}_j)^2 \\ + f(\rho) = & C e^{ -( \rho / \delta )^2 } \\ + {\rm Tap}(r_{ij}) = & 20\left ( \frac{r_{ij}}{R_{cut}} \right )^7 - + 70\left ( \frac{r_{ij}}{R_{cut}} \right )^6 + + 84\left ( \frac{r_{ij}}{R_{cut}} \right )^5 - + 35\left ( \frac{r_{ij}}{R_{cut}} \right )^4 + 1 + +Where :math:`\mathrm{Tap}(r_{ij})` is the taper function which provides +a continuous cutoff (up to third derivative) for interatomic separations +larger than :math:`r_c` :doc:`pair_style ilp_graphene_hbn `. + +It is important to include all the pairs to build the neighbor list for +calculating the normals. + +.. note:: + + Since each water molecule contains one oxygen atom and two hydrogen atoms, + a new definition is proposed (see In :ref:`(Feng) `),the atomic + normal vectors of hydrogen atoms are assumed to lie along the corresponding + oxygen-hydrogen bonds and the normal vector of the central oxygen atom + is defined as their average. + +The parameter file (e.g. COH.ILP), is intended for use with *metal* +:doc:`units `, with energies in meV. Two additional parameters, +*S*, and *rcut* are included in the parameter file. *S* is designed to +facilitate scaling of energies. *rcut* is designed to build the neighbor +list for calculating the normals for each atom pair. + +.. note:: + + The parameters presented in the parameter file (e.g. COH.ILP), + are fitted with taper function by setting the cutoff equal to 16.0 + Angstrom. Using different cutoff or taper function should be careful. + These parameters provide a good description in both short- and long-range + interaction regimes. This feature is essential for simulations in high pressure + regime (i.e., the interlayer distance is smaller than the equilibrium + distance). + +This potential must be used in combination with hybrid/overlay. +Other interactions can be set to zero using pair_style *none*\ . + +This pair style tallies a breakdown of the total interlayer potential +energy into sub-categories, which can be accessed via the :doc:`compute pair ` command as a vector of values of length 2. +The 2 values correspond to the following sub-categories: + +1. *E_vdW* = vdW (attractive) energy +2. *E_Rep* = Repulsive energy + +To print these quantities to the log file (with descriptive column +headings) the following commands could be included in an input script: + +.. code-block:: LAMMPS + + compute 0 all pair ilp/water/2dm + variable Evdw equal c_0[1] + variable Erep equal c_0[2] + thermo_style custom step temp epair v_Erep v_Evdw + +---------- + +.. include:: accel_styles.rst + +---------- + +Mixing, shift, table, tail correction, restart, rRESPA info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +This pair style does not support the pair_modify mix, shift, table, and +tail options. + +This pair style does not write their information to binary restart +files, 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. + +Restrictions +"""""""""""" + +This pair style is part of the INTERLAYER package. It is only enabled +if LAMMPS was built with that package. See the :doc:`Build package +` page for more info. + +This pair style requires the newton setting to be *on* for pair +interactions. + +The COH.ILP potential file provided with LAMMPS (see the potentials +directory) are parameterized for *metal* units. You can use this +potential with any LAMMPS units, but you would need to create your +COH.ILP potential file with coefficients listed in the appropriate +units, if your simulation does not use *metal* units. + +Related commands +"""""""""""""""" + +:doc:`pair_coeff `, +:doc:`pair_none `, +:doc:`pair_style hybrid/overlay `, +:doc:`pair_style drip `, +:doc:`pair_style ilp_tmd `, +:doc:`pair_style saip_metal `, +:doc:`pair_style ilp_graphene_hbn `, +:doc:`pair_style pair_kolmogorov_crespi_z `, +:doc:`pair_style pair_kolmogorov_crespi_full `, +:doc:`pair_style pair_lebedeva_z `, +:doc:`pair_style pair_coul_shield `. + +Default +""""""" + +tap_flag = 1 + + +---------- + +.. _Feng: + +<<<<<<< HEAD +**(Feng)** Z. Feng and W. Ouyang et al, J. Phys. Chem. C 127, 8704-8713 (2023). +======= +**(Feng)** Z. Feng and W. Ouyang et al., J. Phys. Chem. C. 127, 8704-8713 (2023). +>>>>>>> 0334ddb7c69a36b33757694b905820f56d8b90f2 From 685255083efaed1049724351fdfc33193ee493a5 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sun, 21 May 2023 11:43:39 +0800 Subject: [PATCH 075/172] clean the duplicate info --- doc/src/pair_ilp_water_2dm.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/doc/src/pair_ilp_water_2dm.rst b/doc/src/pair_ilp_water_2dm.rst index 82cf1a6580..6a364f38ed 100644 --- a/doc/src/pair_ilp_water_2dm.rst +++ b/doc/src/pair_ilp_water_2dm.rst @@ -162,9 +162,4 @@ tap_flag = 1 ---------- .. _Feng: - -<<<<<<< HEAD -**(Feng)** Z. Feng and W. Ouyang et al, J. Phys. Chem. C 127, 8704-8713 (2023). -======= **(Feng)** Z. Feng and W. Ouyang et al., J. Phys. Chem. C. 127, 8704-8713 (2023). ->>>>>>> 0334ddb7c69a36b33757694b905820f56d8b90f2 From 0692ed3bd72bfbd9f0524baa8ea45dadefb08407 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Wed, 24 May 2023 11:47:15 +0300 Subject: [PATCH 076/172] @evoyiatzis Include method for angle contribution & variables to compute_stress_mop.h --- src/EXTRA-COMPUTE/compute_stress_mop.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.h b/src/EXTRA-COMPUTE/compute_stress_mop.h index c9f95c1996..d1074e002a 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.h +++ b/src/EXTRA-COMPUTE/compute_stress_mop.h @@ -39,12 +39,14 @@ class ComputeStressMop : public Compute { private: void compute_pairs(); void compute_bonds(); + void compute_angles(); int me, nvalues, dir; int *which; double *values_local, *values_global; double *bond_local, *bond_global; + double *angle_local, *angle_global; double pos, pos1, dt, nktv2p, ftm2v; double area; class NeighList *list; From df708a67a5f56f6ac64bd03ac2f6b8f3033f1cb4 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Wed, 24 May 2023 11:55:08 +0300 Subject: [PATCH 077/172] Code for angle contribution to stress/mop --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 186 ++++++++++++++++++++++- 1 file changed, 184 insertions(+), 2 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 8391622242..139c5b5903 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -18,6 +18,7 @@ #include "compute_stress_mop.h" +#include "angle.h" #include "atom.h" #include "atom_vec.h" #include "bond.h" @@ -123,6 +124,8 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : values_local = values_global = vector = nullptr; bond_local = nullptr; bond_global = nullptr; + angle_local = nullptr; + angle_global = nullptr; // this fix produces a global vector @@ -131,6 +134,8 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : memory->create(values_global,nvalues,"stress/mop/spatial:values_global"); memory->create(bond_local,nvalues,"stress/mop/spatial:bond_local"); memory->create(bond_global,nvalues,"stress/mop/spatial:bond_global"); + memory->create(angle_local,nvalues,"stress/mop/spatial:angle_local"); + memory->create(angle_global,nvalues,"stress/mop/spatial:angle_global"); size_vector = nvalues; vector_flag = 1; @@ -149,6 +154,8 @@ ComputeStressMop::~ComputeStressMop() memory->destroy(values_global); memory->destroy(bond_local); memory->destroy(bond_global); + memory->destroy(angle_local); + memory->destroy(angle_global); memory->destroy(vector); } @@ -197,7 +204,8 @@ void ComputeStressMop::init() //if (force->bond!=nullptr) // error->warning(FLERR,"compute stress/mop does not account for bond potentials"); if (force->angle!=nullptr) - error->warning(FLERR,"compute stress/mop does not account for angle potentials"); + if (force->angle->born_matrix_enable == 0) + error->warning(FLERR,"compute stress/mop does not account for angle potentials"); if (force->dihedral!=nullptr) error->warning(FLERR,"compute stress/mop does not account for dihedral potentials"); if (force->improper!=nullptr) @@ -239,8 +247,14 @@ void ComputeStressMop::compute_vector() // sum bond contribution over all procs MPI_Allreduce(bond_local,bond_global,nvalues,MPI_DOUBLE,MPI_SUM,world); + //Compute angle contribution on separate procs + compute_angles(); + + // sum angle contribution over all procs + MPI_Allreduce(angle_local,angle_global,nvalues,MPI_DOUBLE,MPI_SUM,world); + for (int m=0; mx; + tagint *tag = atom->tag; + int *num_angle = atom->num_angle; + tagint **angle_atom1 = atom->angle_atom1; + tagint **angle_atom2 = atom->angle_atom2; + tagint **angle_atom3 = atom->angle_atom3; + int **angle_type = atom->angle_type; + int *mask = atom->mask; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + + int nlocal = atom->nlocal; + int molecular = atom->molecular; + + // loop over all atoms and their angles + + Angle *angle = force->angle; + + double duang, du2ang; + double dx[3] {0}; + double dx_left[3] {0}; + double dx_right[3] {0}; + double x_angle_left[3] {0}; + double x_angle_middle[3] {0}; + double x_angle_right[3] {0}; + double dcos_theta[3] {0}; + double local_contribution[3] {0}; + + // initialization + for (int i {0}; i < nvalues; i++) angle_local[i] = 0.0; + + for (atom2 = 0; atom2 < nlocal; atom2++) { + if (!(mask[atom2] & groupbit)) continue; + + if (molecular == 1) + na = num_angle[atom2]; + else { + if (molindex[atom2] < 0) continue; + imol = molindex[atom2]; + iatom = molatom[atom2]; + na = onemols[imol]->num_angle[iatom]; + } + + for (int i = 0; i < na; i++) { + if (molecular == 1) { + if (tag[atom2] != angle_atom2[atom2][i]) continue; + atype = angle_type[atom2][i]; + atom1 = atom->map(angle_atom1[atom2][i]); + atom3 = atom->map(angle_atom3[atom2][i]); + } else { + if (tag[atom2] != onemols[imol]->angle_atom2[atom2][i]) continue; + atype = onemols[imol]->angle_type[atom2][i]; + tagprev = tag[atom2] - iatom - 1; + atom1 = atom->map(onemols[imol]->angle_atom1[atom2][i] + tagprev); + atom3 = atom->map(onemols[imol]->angle_atom3[atom2][i] + tagprev); + } + + if (atom1 < 0 || !(mask[atom1] & groupbit)) continue; + if (atom3 < 0 || !(mask[atom3] & groupbit)) continue; + if (atype <= 0) continue; + + // minimum image of atom1 with respect to the plane of interest + dx[0] = x[atom1][0]; + dx[1] = x[atom1][1]; + dx[2] = x[atom1][2]; + dx[dir] -= pos; + domain->minimum_image(dx[0], dx[1], dx[2]); + x_angle_left[0] = dx[0]; + x_angle_left[1] = dx[1]; + x_angle_left[2] = dx[2]; + x_angle_left[dir] += pos; + // minimum image of atom2 with respect to atom1 + dx_left[0] = x[atom2][0] - x_angle_left[0]; + dx_left[1] = x[atom2][1] - x_angle_left[1]; + dx_left[2] = x[atom2][2] - x_angle_left[2]; + domain->minimum_image(dx_left[0], dx_left[1], dx_left[2]); + x_angle_middle[0] = x_angle_left[0] + dx_left[0]; + x_angle_middle[1] = x_angle_left[1] + dx_left[1]; + x_angle_middle[2] = x_angle_left[2] + dx_left[2]; + + // minimum image of atom3 with respect to atom2 + dx_right[0] = x[atom3][0] - x_angle_middle[0]; + dx_right[1] = x[atom3][1] - x_angle_middle[1]; + dx_right[2] = x[atom3][2] - x_angle_middle[2]; + domain->minimum_image(dx_right[0], dx_right[1], dx_right[2]); + x_angle_right[0] = x_angle_middle[0] + dx_right[0]; + x_angle_right[1] = x_angle_middle[1] + dx_right[1]; + x_angle_right[2] = x_angle_middle[2] + dx_right[2]; + + // check if any bond vector crosses the plane of interest + double tau_right = (x_angle_right[dir] - pos) / (x_angle_right[dir] - x_angle_middle[dir]); + double tau_left = (x_angle_middle[dir] - pos) / (x_angle_middle[dir] - x_angle_left[dir]); + bool right_cross = ((tau_right >=0) && (tau_right <= 1)); + bool left_cross = ((tau_left >=0) && (tau_left <= 1)); + + // no bonds crossing the plane + if (!right_cross && !left_cross) continue; + + // compute the cos(theta) of the angle + r1 = sqrt(dx_left[0]*dx_left[0] + dx_left[1]*dx_left[1] + dx_left[2]*dx_left[2]); + r2 = sqrt(dx_right[0]*dx_right[0] + dx_right[1]*dx_right[1] + dx_right[2]*dx_right[2]); + cos_theta = (dx_right[0]*dx_left[0] + dx_right[1]*dx_left[1] + dx_right[2]*dx_left[2])/(r1*r2); + + if (cos_theta > 1.0) cos_theta = 1.0; + if (cos_theta < -1.0) cos_theta = -1.0; + + // The method returns derivative with regards to cos(theta) + angle->born_matrix(atype, atom1, atom2, atom3, duang, du2ang); + // only right bond crossing the plane + if (right_cross && !left_cross) + { + dcos_theta[0] = (dx_right[0]*cos_theta/r2 - dx_left[0]/r1)/r2; + dcos_theta[1] = (dx_right[1]*cos_theta/r2 - dx_left[1]/r1)/r2; + dcos_theta[2] = (dx_right[1]*cos_theta/r2 - dx_left[2]/r1)/r2; + } + + // only left bond crossing the plane + if (!right_cross && left_cross) + { + dcos_theta[0] = -(dx_left[0]*cos_theta/r1 - dx_right[0]/r2)/r1; + dcos_theta[1] = -(dx_left[1]*cos_theta/r1 - dx_right[1]/r2)/r1; + dcos_theta[2] = -(dx_left[2]*cos_theta/r1 - dx_right[2]/r2)/r1; + } + + // both bonds crossing the plane + if (right_cross && left_cross) + { + // due to right bond + dcos_theta[0] = -(dx_right[0]*cos_theta/r2 - dx_left[0]/r1)/r2; + dcos_theta[1] = -(dx_right[1]*cos_theta/r2 - dx_left[1]/r1)/r2; + dcos_theta[2] = -(dx_right[1]*cos_theta/r2 - dx_left[2]/r1)/r2; + + // due to left bond + dcos_theta[0] += (dx_left[0]*cos_theta/r1 - dx_right[0]/r2)/r1; + dcos_theta[1] += (dx_left[1]*cos_theta/r1 - dx_right[1]/r2)/r1; + dcos_theta[2] += (dx_left[2]*cos_theta/r1 - dx_right[2]/r2)/r1; + } + + // final contribution of the given angle term + local_contribution[0] += duang*dcos_theta[0]/area*nktv2p; + local_contribution[1] += duang*dcos_theta[1]/area*nktv2p; + local_contribution[2] += duang*dcos_theta[2]/area*nktv2p; + } + } + // loop over the keywords and if necessary add the angle contribution + int m {0}; + while (m Date: Wed, 24 May 2023 16:24:33 +0300 Subject: [PATCH 078/172] fixing bug with sign for angle contribution in compute_stress_mop.cpp --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 139c5b5903..ff7c6d9e1b 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -705,14 +705,14 @@ void ComputeStressMop::compute_angles() if (right_cross && left_cross) { // due to right bond - dcos_theta[0] = -(dx_right[0]*cos_theta/r2 - dx_left[0]/r1)/r2; - dcos_theta[1] = -(dx_right[1]*cos_theta/r2 - dx_left[1]/r1)/r2; - dcos_theta[2] = -(dx_right[1]*cos_theta/r2 - dx_left[2]/r1)/r2; + dcos_theta[0] = (dx_right[0]*cos_theta/r2 - dx_left[0]/r1)/r2; + dcos_theta[1] = (dx_right[1]*cos_theta/r2 - dx_left[1]/r1)/r2; + dcos_theta[2] = (dx_right[1]*cos_theta/r2 - dx_left[2]/r1)/r2; // due to left bond - dcos_theta[0] += (dx_left[0]*cos_theta/r1 - dx_right[0]/r2)/r1; - dcos_theta[1] += (dx_left[1]*cos_theta/r1 - dx_right[1]/r2)/r1; - dcos_theta[2] += (dx_left[2]*cos_theta/r1 - dx_right[2]/r2)/r1; + dcos_theta[0] -= (dx_left[0]*cos_theta/r1 - dx_right[0]/r2)/r1; + dcos_theta[1] -= (dx_left[1]*cos_theta/r1 - dx_right[1]/r2)/r1; + dcos_theta[2] -= (dx_left[2]*cos_theta/r1 - dx_right[2]/r2)/r1; } // final contribution of the given angle term From c7c8b065a259979e7fcd3b6ccc777d3068a68d52 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Wed, 24 May 2023 16:49:35 +0300 Subject: [PATCH 079/172] fixing bug with sign issue for bond contribution in compute_stress_mop.cpp --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index ff7c6d9e1b..2454f93b7a 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -546,9 +546,10 @@ void ComputeStressMop::compute_bonds() rsq = dx[0] * dx[0] + dx[1] * dx[1] + dx[2] * dx[2]; bond->single(btype, rsq, atom1, atom2, fpair); - local_contribution[0] += fpair*dx[0]/area*nktv2p; - local_contribution[1] += fpair*dx[1]/area*nktv2p; - local_contribution[2] += fpair*dx[2]/area*nktv2p; + double sgn = copysign(1.0, x_bond_1[dir] - pos); + local_contribution[0] += sgn*fpair*dx[0]/area*nktv2p; + local_contribution[1] += sgn*fpair*dx[1]/area*nktv2p; + local_contribution[2] += sgn*fpair*dx[2]/area*nktv2p; } } } From 9ee40cceef79043d8c6c8c41e41093e227f97ff6 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Wed, 24 May 2023 17:01:13 +0300 Subject: [PATCH 080/172] fixing indexing issue and more sign problems for angle contributions --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 27 +++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 2454f93b7a..63d671eee7 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -689,31 +689,34 @@ void ComputeStressMop::compute_angles() // only right bond crossing the plane if (right_cross && !left_cross) { - dcos_theta[0] = (dx_right[0]*cos_theta/r2 - dx_left[0]/r1)/r2; - dcos_theta[1] = (dx_right[1]*cos_theta/r2 - dx_left[1]/r1)/r2; - dcos_theta[2] = (dx_right[1]*cos_theta/r2 - dx_left[2]/r1)/r2; + double sgn = copysign(1.0, x_angle_right[dir] - pos); + dcos_theta[0] = sgn*(dx_right[0]*cos_theta/r2 - dx_left[0]/r1)/r2; + dcos_theta[1] = sgn*(dx_right[1]*cos_theta/r2 - dx_left[1]/r1)/r2; + dcos_theta[2] = sgn*(dx_right[2]*cos_theta/r2 - dx_left[2]/r1)/r2; } // only left bond crossing the plane if (!right_cross && left_cross) { - dcos_theta[0] = -(dx_left[0]*cos_theta/r1 - dx_right[0]/r2)/r1; - dcos_theta[1] = -(dx_left[1]*cos_theta/r1 - dx_right[1]/r2)/r1; - dcos_theta[2] = -(dx_left[2]*cos_theta/r1 - dx_right[2]/r2)/r1; + double sgn = copysign(1.0, x_angle_left[dir] - pos); + dcos_theta[0] = -sgn*(dx_left[0]*cos_theta/r1 - dx_right[0]/r2)/r1; + dcos_theta[1] = -sgn*(dx_left[1]*cos_theta/r1 - dx_right[1]/r2)/r1; + dcos_theta[2] = -sgn*(dx_left[2]*cos_theta/r1 - dx_right[2]/r2)/r1; } // both bonds crossing the plane if (right_cross && left_cross) { // due to right bond - dcos_theta[0] = (dx_right[0]*cos_theta/r2 - dx_left[0]/r1)/r2; - dcos_theta[1] = (dx_right[1]*cos_theta/r2 - dx_left[1]/r1)/r2; - dcos_theta[2] = (dx_right[1]*cos_theta/r2 - dx_left[2]/r1)/r2; + double sgn = copysign(1.0, x_angle_middle[dir] - pos); + dcos_theta[0] = -sgn*(dx_right[0]*cos_theta/r2 - dx_left[0]/r1)/r2; + dcos_theta[1] = -sgn*(dx_right[1]*cos_theta/r2 - dx_left[1]/r1)/r2; + dcos_theta[2] = -sgn*(dx_right[2]*cos_theta/r2 - dx_left[2]/r1)/r2; // due to left bond - dcos_theta[0] -= (dx_left[0]*cos_theta/r1 - dx_right[0]/r2)/r1; - dcos_theta[1] -= (dx_left[1]*cos_theta/r1 - dx_right[1]/r2)/r1; - dcos_theta[2] -= (dx_left[2]*cos_theta/r1 - dx_right[2]/r2)/r1; + dcos_theta[0] += sgn*(dx_left[0]*cos_theta/r1 - dx_right[0]/r2)/r1; + dcos_theta[1] += sgn*(dx_left[1]*cos_theta/r1 - dx_right[1]/r2)/r1; + dcos_theta[2] += sgn*(dx_left[2]*cos_theta/r1 - dx_right[2]/r2)/r1; } // final contribution of the given angle term From 8e6615918b0c7414664e17cea86378921d132069 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Thu, 25 May 2023 14:39:03 +0300 Subject: [PATCH 081/172] avoid crashing when no bonds or no angles exist --- src/EXTRA-COMPUTE/compute_stress_mop.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.h b/src/EXTRA-COMPUTE/compute_stress_mop.h index d1074e002a..791e18d624 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.h +++ b/src/EXTRA-COMPUTE/compute_stress_mop.h @@ -44,6 +44,8 @@ class ComputeStressMop : public Compute { int me, nvalues, dir; int *which; + int bondflag, angleflag; + double *values_local, *values_global; double *bond_local, *bond_global; double *angle_local, *angle_global; From f26f397e087c183facd9e1cb108fe7f1b777a221 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Thu, 25 May 2023 14:47:20 +0300 Subject: [PATCH 082/172] avoid crashing when there are no bonds or no angles --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 27 ++++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 63d671eee7..e7a602e583 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -51,6 +51,9 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); + bondflag = 0; + angleflag = 0; + // set compute mode and direction of plane(s) for pressure calculation if (strcmp(arg[3],"x")==0) { @@ -201,11 +204,13 @@ void ComputeStressMop::init() //Compute stress/mop only accounts for pair interactions. // issue a warning if any intramolecular potential or Kspace is defined. - //if (force->bond!=nullptr) - // error->warning(FLERR,"compute stress/mop does not account for bond potentials"); + if (force->bond!=nullptr) bondflag = 1; if (force->angle!=nullptr) - if (force->angle->born_matrix_enable == 0) + if (force->angle->born_matrix_enable == 0) { error->warning(FLERR,"compute stress/mop does not account for angle potentials"); + } else { + angleflag = 1; + } if (force->dihedral!=nullptr) error->warning(FLERR,"compute stress/mop does not account for dihedral potentials"); if (force->improper!=nullptr) @@ -241,14 +246,22 @@ void ComputeStressMop::compute_vector() MPI_Allreduce(values_local,values_global,nvalues, MPI_DOUBLE,MPI_SUM,world); - //Compute bond contribution on separate procs - compute_bonds(); + if (bondflag) { + //Compute bond contribution on separate procs + compute_bonds(); + } else { + for (int i=0; i Date: Thu, 25 May 2023 12:58:57 -0600 Subject: [PATCH 083/172] Fixing mistakes in doc pages --- doc/src/compute_fabric.rst | 12 ++++++------ doc/src/pair_granular.rst | 2 +- src/GRANULAR/gran_sub_mod_normal.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/src/compute_fabric.rst b/doc/src/compute_fabric.rst index f1a5d3d7f9..b38ffafa48 100644 --- a/doc/src/compute_fabric.rst +++ b/doc/src/compute_fabric.rst @@ -146,13 +146,13 @@ m to :math:`M` (inclusive). A middle asterisk means all types from m to n Output info """"""""""" -This compute calculates a local vector of doubles and a scalar. The vector -stores the unique components of the first requested tensor in the order -:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz` -followed by the same components for all subsequent tensors. +This compute calculates a global vector of doubles and a global scalar. The +vector stores the unique components of the first requested tensor in the +order :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`, +:math:`yz` followed by the same components for all subsequent tensors. The length of the vector is therefore six times the number of requested -tensors. The scalar output is the number of pairwise interactions included in -the calculation of the fabric tensor. +tensors. The scalar output is the number of pairwise interactions included +in the calculation of the fabric tensor. Restrictions """""""""""" diff --git a/doc/src/pair_granular.rst b/doc/src/pair_granular.rst index 0911a3486a..8a4d44fbf7 100644 --- a/doc/src/pair_granular.rst +++ b/doc/src/pair_granular.rst @@ -736,7 +736,7 @@ or .. math:: - E_{eff,ij} = \frac{E_{ij}}{2(1-\nu_{ij})} + E_{eff,ij} = \frac{E_{ij}}{2(1-\nu_{ij}^2)} These pair styles write their information to :doc:`binary restart files `, so a pair_style command does not need to be specified in an input script that reads a restart file. diff --git a/src/GRANULAR/gran_sub_mod_normal.cpp b/src/GRANULAR/gran_sub_mod_normal.cpp index 05639feb9d..f08892d6f2 100644 --- a/src/GRANULAR/gran_sub_mod_normal.cpp +++ b/src/GRANULAR/gran_sub_mod_normal.cpp @@ -167,7 +167,7 @@ void GranSubModNormalHertzMaterial::coeffs_to_local() void GranSubModNormalHertzMaterial::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); + coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0], icoeffs[2], jcoeffs[2]); coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); coeffs_to_local(); From edfb8cf10021ec15509a3cb04e306496222eeff4 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Thu, 25 May 2023 13:54:12 -0600 Subject: [PATCH 084/172] Fixing double mixing of normal coeffs --- src/GRANULAR/gran_sub_mod_normal.cpp | 50 ++++++++++++++++++++-------- src/GRANULAR/gran_sub_mod_normal.h | 4 +++ 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/GRANULAR/gran_sub_mod_normal.cpp b/src/GRANULAR/gran_sub_mod_normal.cpp index f08892d6f2..9e19cab1f4 100644 --- a/src/GRANULAR/gran_sub_mod_normal.cpp +++ b/src/GRANULAR/gran_sub_mod_normal.cpp @@ -145,6 +145,7 @@ GranSubModNormalHertzMaterial::GranSubModNormalHertzMaterial(GranularModel *gm, material_properties = 1; num_coeffs = 3; contact_radius_flag = 1; + mixed_coefficients = 0; } /* ---------------------------------------------------------------------- */ @@ -154,10 +155,12 @@ void GranSubModNormalHertzMaterial::coeffs_to_local() Emod = coeffs[0]; damp = coeffs[1]; poiss = coeffs[2]; - if (gm->contact_type == PAIR) { - k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); - } else { - k = FOURTHIRDS * mix_stiffnessE_wall(Emod, poiss); + if (!mixed_coefficients) { + if (gm->contact_type == PAIR) { + k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); + } else { + k = FOURTHIRDS * mix_stiffnessE_wall(Emod, poiss); + } } if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal Hertz material normal model"); @@ -170,6 +173,10 @@ void GranSubModNormalHertzMaterial::mix_coeffs(double* icoeffs, double* jcoeffs) coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0], icoeffs[2], jcoeffs[2]); coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); + + k = FOURTHIRDS * coeffs[0]; + mixed_coefficients = 1; + coeffs_to_local(); } @@ -183,6 +190,7 @@ GranSubModNormalDMT::GranSubModNormalDMT(GranularModel *gm, LAMMPS *lmp) : GranS cohesive_flag = 1; num_coeffs = 4; contact_radius_flag = 1; + mixed_coefficients = 0; } /* ---------------------------------------------------------------------- */ @@ -193,10 +201,13 @@ void GranSubModNormalDMT::coeffs_to_local() damp = coeffs[1]; poiss = coeffs[2]; cohesion = coeffs[3]; - if (gm->contact_type == PAIR) { - k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); - } else { - k = FOURTHIRDS * mix_stiffnessE_wall(Emod, poiss); + + if (!mixed_coefficients) { + if (gm->contact_type == PAIR) { + k = FOURTHIRDS * mix_stiffnessE(Emod, Emod, poiss, poiss); + } else { + k = FOURTHIRDS * mix_stiffnessE_wall(Emod, poiss); + } } if (Emod < 0.0 || damp < 0.0) error->all(FLERR, "Illegal DMT normal model"); @@ -206,10 +217,14 @@ void GranSubModNormalDMT::coeffs_to_local() void GranSubModNormalDMT::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); + coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0], icoeffs[2], jcoeffs[2]); coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); coeffs[3] = mix_geom(icoeffs[3], jcoeffs[3]); + + k = FOURTHIRDS * coeffs[0]; + mixed_coefficients = 1; + coeffs_to_local(); } @@ -241,6 +256,7 @@ GranSubModNormalJKR::GranSubModNormalJKR(GranularModel *gm, LAMMPS *lmp) : GranS beyond_contact = 1; num_coeffs = 4; contact_radius_flag = 1; + mixed_coefficients = 0; } /* ---------------------------------------------------------------------- */ @@ -252,10 +268,12 @@ void GranSubModNormalJKR::coeffs_to_local() poiss = coeffs[2]; cohesion = coeffs[3]; - if (gm->contact_type == PAIR) { - Emix = mix_stiffnessE(Emod, Emod, poiss, poiss); - } else { - Emix = mix_stiffnessE_wall(Emod, poiss); + if (!mixed_coefficients) { + if (gm->contact_type == PAIR) { + Emix = mix_stiffnessE(Emod, Emod, poiss, poiss); + } else { + Emix = mix_stiffnessE_wall(Emod, poiss); + } } k = FOURTHIRDS * Emix; @@ -267,10 +285,14 @@ void GranSubModNormalJKR::coeffs_to_local() void GranSubModNormalJKR::mix_coeffs(double* icoeffs, double* jcoeffs) { - coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0],icoeffs[2], jcoeffs[2]); + coeffs[0] = mix_stiffnessE(icoeffs[0], jcoeffs[0], icoeffs[2], jcoeffs[2]); coeffs[1] = mix_geom(icoeffs[1], jcoeffs[1]); coeffs[2] = mix_geom(icoeffs[2], jcoeffs[2]); coeffs[3] = mix_geom(icoeffs[3], jcoeffs[3]); + + Emix = coeffs[0]; + mixed_coefficients = 1; + coeffs_to_local(); } diff --git a/src/GRANULAR/gran_sub_mod_normal.h b/src/GRANULAR/gran_sub_mod_normal.h index ef022f864f..15e4c28701 100644 --- a/src/GRANULAR/gran_sub_mod_normal.h +++ b/src/GRANULAR/gran_sub_mod_normal.h @@ -99,6 +99,8 @@ class GranSubModNormalHertzMaterial : public GranSubModNormalHertz { GranSubModNormalHertzMaterial(class GranularModel *, class LAMMPS *); void coeffs_to_local() override; void mix_coeffs(double*, double*) override; + private: + int mixed_coefficients; }; /* ---------------------------------------------------------------------- */ @@ -113,6 +115,7 @@ class GranSubModNormalDMT : public GranSubModNormal { protected: double k, cohesion; double F_pulloff, Fne; + int mixed_coefficients; }; /* ---------------------------------------------------------------------- */ @@ -130,6 +133,7 @@ class GranSubModNormalJKR : public GranSubModNormal { protected: double k, cohesion; double Emix, F_pulloff, Fne; + int mixed_coefficients; }; } // namespace Granular_NS From 3d8df660c350b256bb6759f7c5783a5cf8af77f1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 25 May 2023 18:08:42 -0400 Subject: [PATCH 085/172] make rigid water examples more realistic and consistent. avoid warnings. --- doc/src/Howto_spc.rst | 6 ++---- doc/src/Howto_tip3p.rst | 4 ++-- doc/src/Howto_tip4p.rst | 13 +++++++------ doc/src/Howto_tip5p.rst | 5 +++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/src/Howto_spc.rst b/doc/src/Howto_spc.rst index 6414d3b846..6dedfe40c4 100644 --- a/doc/src/Howto_spc.rst +++ b/doc/src/Howto_spc.rst @@ -69,15 +69,13 @@ SPC/E with rigid bonds. timestep 1.0 fix rigid all shake 0.0001 10 10000 b 1 a 1 minimize 0.0 0.0 1000 10000 - run 0 post no - reset_timestep 0 velocity all create 300.0 5463576 - fix integrate all nvt temp 300.0 300.0 1.0 + fix integrate all nvt temp 300.0 300.0 100.0 thermo_style custom step temp press etotal density pe ke thermo 1000 run 20000 upto - write_data tip4p.data nocoeff + write_data spce.data nocoeff .. _spce_molecule: .. code-block:: diff --git a/doc/src/Howto_tip3p.rst b/doc/src/Howto_tip3p.rst index 682c7f2640..5419b9ba1b 100644 --- a/doc/src/Howto_tip3p.rst +++ b/doc/src/Howto_tip3p.rst @@ -128,11 +128,11 @@ TIP3P with rigid bonds. fix rigid all shake 0.001 10 10000 b 1 a 1 minimize 0.0 0.0 1000 10000 - run 0 post no reset_timestep 0 + timestep 1.0 velocity all create 300.0 5463576 - fix integrate all nvt temp 300 300 1.0 + fix integrate all nvt temp 300 300 100.0 thermo_style custom step temp press etotal pe diff --git a/doc/src/Howto_tip4p.rst b/doc/src/Howto_tip4p.rst index 7775d43e76..4d9b514e0d 100644 --- a/doc/src/Howto_tip4p.rst +++ b/doc/src/Howto_tip4p.rst @@ -180,17 +180,17 @@ file changed): fix rigid all shake 0.001 10 10000 b 1 a 1 minimize 0.0 0.0 1000 10000 - run 0 post no reset_timestep 0 + timestep 1.0 velocity all create 300.0 5463576 - fix integrate all nvt temp 300 300 1.0 + fix integrate all nvt temp 300 300 100.0 thermo_style custom step temp press etotal pe thermo 1000 run 20000 - write_data tip3p.data nocoeff + write_data tip4p-implicit.data nocoeff Below is the code for a LAMMPS input file using the explicit method and a TIP4P molecule file. Because of using :doc:`fix rigid/nvt/small @@ -203,6 +203,7 @@ rigid/nvt/small can identify rigid bodies by their molecule ID: units real atom_style charge + atom_modify map array region box block -5 5 -5 5 -5 5 create_box 3 box @@ -219,14 +220,14 @@ rigid/nvt/small can identify rigid bodies by their molecule ID: molecule water tip4p.mol create_atoms 0 random 33 34564 NULL mol water 25367 overlap 1.33 - timestep 0.1 - fix integrate all rigid/nvt/small molecule temp 300.0 300.0 1.0 + timestep 0.5 + fix integrate all rigid/nvt/small molecule temp 300.0 300.0 100.0 velocity all create 300.0 5463576 thermo_style custom step temp press etotal density pe ke thermo 1000 run 20000 - write_data tip4p.data nocoeff + write_data tip4p-explicit.data nocoeff .. _tip4p_molecule: .. code-block:: diff --git a/doc/src/Howto_tip5p.rst b/doc/src/Howto_tip5p.rst index 21cc78a684..10674a04b6 100644 --- a/doc/src/Howto_tip5p.rst +++ b/doc/src/Howto_tip5p.rst @@ -91,6 +91,7 @@ ID: units real atom_style charge + atom_modify map array region box block -5 5 -5 5 -5 5 create_box 3 box @@ -107,8 +108,8 @@ ID: molecule water tip5p.mol create_atoms 0 random 33 34564 NULL mol water 25367 overlap 1.33 - timestep 0.20 - fix integrate all rigid/nvt/small molecule temp 300.0 300.0 1.0 + timestep 0.5 + fix integrate all rigid/nvt/small molecule temp 300.0 300.0 100.0 reset_timestep 0 velocity all create 300.0 5463576 From 458cce76999318fa4dd990aa57f5506d782d6b40 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sat, 27 May 2023 14:33:46 +0300 Subject: [PATCH 086/172] Updating unit test for mop to reflect the contribution from bonds --- unittest/commands/test_compute_global.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unittest/commands/test_compute_global.cpp b/unittest/commands/test_compute_global.cpp index 6c365c8c2b..66a24f049f 100644 --- a/unittest/commands/test_compute_global.cpp +++ b/unittest/commands/test_compute_global.cpp @@ -225,9 +225,9 @@ TEST_F(ComputeGlobalTest, Geometry) EXPECT_DOUBLE_EQ(mom2[0], -0.022332069630161717); EXPECT_DOUBLE_EQ(mom2[1], -0.056896553865696115); EXPECT_DOUBLE_EQ(mom2[2], 0.069179891052881484); - EXPECT_DOUBLE_EQ(mop1[0], 3522311.3572200728); - EXPECT_DOUBLE_EQ(mop1[1], 2871104.9055934539); - EXPECT_DOUBLE_EQ(mop1[2], -4136077.5224247416); + EXPECT_DOUBLE_EQ(mop1[0], 3536584.0880458541); + EXPECT_DOUBLE_EQ(mop1[1], 2887485.033995091); + EXPECT_DOUBLE_EQ(mop1[2], -4154145.8952306858); EXPECT_DOUBLE_EQ(mop2[0][0], -8.0869239999999998); EXPECT_DOUBLE_EQ(mop2[0][1], 0.0); EXPECT_DOUBLE_EQ(mop2[0][2], 0.0); From b28ee36f000af8e90a70390b72f6d132312de43c Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sat, 27 May 2023 14:50:31 +0300 Subject: [PATCH 087/172] update documentation for compute stress/mop --- doc/src/compute_stress_mop.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/src/compute_stress_mop.rst b/doc/src/compute_stress_mop.rst index 4ad2261bb0..a8a3bc5660 100644 --- a/doc/src/compute_stress_mop.rst +++ b/doc/src/compute_stress_mop.rst @@ -117,8 +117,13 @@ size does not change in time, and axis-aligned planes. The method only works with two-body pair interactions, because it requires the class method pair->single() to be implemented. In -particular, it does not work with more than two-body pair interactions, -intra-molecular interactions, and long range (kspace) interactions. +particular, compute *stress/mop/profile* does not work with more than +two-body pair interactions, intra-molecular interactions, and long range +(kspace) interactions. Similarly, compute *stress/mop* does not work with more than +two-body pair interactions, long range (kspace) interactions and dihedral/improper +intramolecular interactions but works with all bond interactions with the class method +single() implemented and all angle interactions with the class method born_matrix() +implemented. Related commands """""""""""""""" From 4c4eb6ee1e00fcb0b7efefa8a6e47459e7dc5c33 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 28 May 2023 00:49:52 -0400 Subject: [PATCH 088/172] improve error message --- src/EXTRA-FIX/fix_electron_stopping.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EXTRA-FIX/fix_electron_stopping.cpp b/src/EXTRA-FIX/fix_electron_stopping.cpp index 4a9421be6c..37f33f4ea0 100644 --- a/src/EXTRA-FIX/fix_electron_stopping.cpp +++ b/src/EXTRA-FIX/fix_electron_stopping.cpp @@ -175,7 +175,8 @@ void FixElectronStopping::post_force(int /*vflag*/) if (energy < Ecut) continue; if (energy < elstop_ranges[0][0]) continue; if (energy > elstop_ranges[0][table_entries - 1]) - error->one(FLERR, "Atom kinetic energy too high for fix electron/stopping"); + error->one(FLERR, "Fix electron/stopping: kinetic energy too high for atom {}: {} vs {}", + atom->tag[i], energy, elstop_ranges[0][table_entries - 1]); if (region) { // Only apply in the given region From f69b50408d98bc49ff0a6787e9ae59caea4d1a82 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 28 May 2023 11:47:32 -0400 Subject: [PATCH 089/172] improve error messages --- src/output.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/output.cpp b/src/output.cpp index 6282b85b76..ed8fa48831 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -276,7 +276,8 @@ void Output::setup(int memflag) auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_single)); if (nextrestart <= ntimestep) - error->all(FLERR,"Restart variable returned a bad timestep"); + error->all(FLERR,"Restart variable returned a bad next timestep: {} vs {}", + nextrestart, ntimestep); next_restart_single = nextrestart; } } else next_restart_single = update->laststep + 1; @@ -289,7 +290,8 @@ void Output::setup(int memflag) auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_double)); if (nextrestart <= ntimestep) - error->all(FLERR,"Restart variable returned a bad timestep"); + error->all(FLERR,"Restart variable returned a bad next timestep: {} vs {}", + nextrestart, ntimestep); next_restart_double = nextrestart; } } else next_restart_double = update->laststep + 1; @@ -401,7 +403,8 @@ void Output::write(bigint ntimestep) auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_single)); if (nextrestart <= ntimestep) - error->all(FLERR,"Restart variable returned a bad timestep"); + error->all(FLERR,"Restart variable returned a bad next timestep: {} vs {}", + nextrestart, ntimestep); next_restart_single = nextrestart; modify->addstep_compute(next_restart_single); } @@ -424,7 +427,8 @@ void Output::write(bigint ntimestep) auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_double)); if (nextrestart <= ntimestep) - error->all(FLERR,"Restart variable returned a bad timestep"); + error->all(FLERR,"Restart variable returned a bad next timestep: {} <= {}", + nextrestart, ntimestep); next_restart_double = nextrestart; modify->addstep_compute(next_restart_double); } @@ -647,7 +651,8 @@ void Output::reset_timestep(bigint ntimestep) auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_single)); if (nextrestart < ntimestep) - error->all(FLERR,"Restart variable returned a bad timestep"); + error->all(FLERR,"Restart variable returned a bad next timestep: {} <= {}", + nextrestart, ntimestep); update->ntimestep++; next_restart_single = nextrestart; modify->addstep_compute(next_restart_single); @@ -666,7 +671,8 @@ void Output::reset_timestep(bigint ntimestep) auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_double)); if (nextrestart < ntimestep) - error->all(FLERR,"Restart variable returned a bad timestep"); + error->all(FLERR,"Restart variable returned a bad next timestep: {} <= {}", + nextrestart, ntimestep); update->ntimestep++; next_restart_double = nextrestart; modify->addstep_compute(next_restart_double); From f9ee2ad42b991ed221da79f217e7f71d544427b0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 28 May 2023 11:49:02 -0400 Subject: [PATCH 090/172] reorder thermo and dump output so dump styles include correct thermo data --- src/output.cpp | 90 +++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/src/output.cpp b/src/output.cpp index ed8fa48831..6e57122ffe 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -190,6 +190,32 @@ void Output::setup(int memflag) { bigint ntimestep = update->ntimestep; + // print memory usage unless being called between multiple runs + + if (memflag) memory_usage(); + + // set next_thermo to multiple of every or variable eval if var defined + // ensure thermo output on last step of run + // thermo may invoke computes so wrap with clear/add + + modify->clearstep_compute(); + + thermo->header(); + thermo->compute(0); + last_thermo = ntimestep; + + if (var_thermo) { + next_thermo = static_cast + (input->variable->compute_equal(ivar_thermo)); + if (next_thermo <= ntimestep) + error->all(FLERR,"Thermo every variable returned a bad timestep"); + } else if (thermo_every) { + next_thermo = (ntimestep/thermo_every)*thermo_every + thermo_every; + next_thermo = MIN(next_thermo,update->laststep); + } else next_thermo = update->laststep; + + modify->addstep_compute(next_thermo); + // consider all dumps // decide whether to write snapshot and/or calculate next step for dump @@ -257,7 +283,7 @@ void Output::setup(int memflag) next_dump_any = MIN(next_dump_any,next_dump[idump]); } - // if no dumps, set next_dump_any to last+1 so will not influence next + // if no dumps, set next_dump_any to last+1 so will not influence next } else next_dump_any = update->laststep + 1; @@ -298,32 +324,6 @@ void Output::setup(int memflag) next_restart = MIN(next_restart_single,next_restart_double); } else next_restart = update->laststep + 1; - // print memory usage unless being called between multiple runs - - if (memflag) memory_usage(); - - // set next_thermo to multiple of every or variable eval if var defined - // ensure thermo output on last step of run - // thermo may invoke computes so wrap with clear/add - - modify->clearstep_compute(); - - thermo->header(); - thermo->compute(0); - last_thermo = ntimestep; - - if (var_thermo) { - next_thermo = static_cast - (input->variable->compute_equal(ivar_thermo)); - if (next_thermo <= ntimestep) - error->all(FLERR,"Thermo every variable returned a bad timestep"); - } else if (thermo_every) { - next_thermo = (ntimestep/thermo_every)*thermo_every + thermo_every; - next_thermo = MIN(next_thermo,update->laststep); - } else next_thermo = update->laststep; - - modify->addstep_compute(next_thermo); - // next = next timestep any output will be done next = MIN(next_dump_any,next_restart); @@ -338,6 +338,24 @@ void Output::setup(int memflag) void Output::write(bigint ntimestep) { + // ensure next_thermo forces output on last step of run + // thermo may invoke computes so wrap with clear/add + + if (next_thermo == ntimestep) { + modify->clearstep_compute(); + if (last_thermo != ntimestep) thermo->compute(1); + last_thermo = ntimestep; + if (var_thermo) { + next_thermo = static_cast + (input->variable->compute_equal(ivar_thermo)); + if (next_thermo <= ntimestep) + error->all(FLERR,"Thermo every variable returned a bad timestep"); + } else if (thermo_every) next_thermo += thermo_every; + else next_thermo = update->laststep; + next_thermo = MIN(next_thermo,update->laststep); + modify->addstep_compute(next_thermo); + } + // perform dump if its next_dump = current ntimestep // but not if it was already written on this step // set next_dump and also next_time_dump for mode_dump = 1 @@ -437,24 +455,6 @@ void Output::write(bigint ntimestep) next_restart = MIN(next_restart_single,next_restart_double); } - // ensure next_thermo forces output on last step of run - // thermo may invoke computes so wrap with clear/add - - if (next_thermo == ntimestep) { - modify->clearstep_compute(); - if (last_thermo != ntimestep) thermo->compute(1); - last_thermo = ntimestep; - if (var_thermo) { - next_thermo = static_cast - (input->variable->compute_equal(ivar_thermo)); - if (next_thermo <= ntimestep) - error->all(FLERR,"Thermo every variable returned a bad timestep"); - } else if (thermo_every) next_thermo += thermo_every; - else next_thermo = update->laststep; - next_thermo = MIN(next_thermo,update->laststep); - modify->addstep_compute(next_thermo); - } - // next = next timestep any output will be done next = MIN(next_dump_any,next_restart); From 86743bc0a6fa09ffd630d4d9220c76f60823d18d Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Mon, 29 May 2023 10:59:18 +0300 Subject: [PATCH 091/172] Update compute_stress_mop.cpp The angle was computed using the dot product of the vectors x[atom2] - x[atom1] and x[atom3] - x[atom2]. This is not consistent with the lammps convention where the angle is computed using the dot product between x[atom1]-x[atom2] and x[atom3]-x[atom2]. --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index e7a602e583..d512ce4810 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -692,7 +692,7 @@ void ComputeStressMop::compute_angles() // compute the cos(theta) of the angle r1 = sqrt(dx_left[0]*dx_left[0] + dx_left[1]*dx_left[1] + dx_left[2]*dx_left[2]); r2 = sqrt(dx_right[0]*dx_right[0] + dx_right[1]*dx_right[1] + dx_right[2]*dx_right[2]); - cos_theta = (dx_right[0]*dx_left[0] + dx_right[1]*dx_left[1] + dx_right[2]*dx_left[2])/(r1*r2); + cos_theta = -(dx_right[0]*dx_left[0] + dx_right[1]*dx_left[1] + dx_right[2]*dx_left[2])/(r1*r2); if (cos_theta > 1.0) cos_theta = 1.0; if (cos_theta < -1.0) cos_theta = -1.0; From 3b38145d91b130b72a6770992efa35b282f0cfee Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Mon, 29 May 2023 16:34:44 +0300 Subject: [PATCH 092/172] Update compute_stress_mop.cpp Fixing sign issues because I was considering the theta angle to be formed by vectors x[atom2] - x[atom1] & x[atom3] - x[atom2] instead of x[atom1] - x[atom2] & x[atom3] - x[atom2] as done in lammps --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index d512ce4810..a5f5969317 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -703,18 +703,18 @@ void ComputeStressMop::compute_angles() if (right_cross && !left_cross) { double sgn = copysign(1.0, x_angle_right[dir] - pos); - dcos_theta[0] = sgn*(dx_right[0]*cos_theta/r2 - dx_left[0]/r1)/r2; - dcos_theta[1] = sgn*(dx_right[1]*cos_theta/r2 - dx_left[1]/r1)/r2; - dcos_theta[2] = sgn*(dx_right[2]*cos_theta/r2 - dx_left[2]/r1)/r2; + dcos_theta[0] = sgn*(dx_right[0]*cos_theta/r2 + dx_left[0]/r1)/r2; + dcos_theta[1] = sgn*(dx_right[1]*cos_theta/r2 + dx_left[1]/r1)/r2; + dcos_theta[2] = sgn*(dx_right[2]*cos_theta/r2 + dx_left[2]/r1)/r2; } // only left bond crossing the plane if (!right_cross && left_cross) { double sgn = copysign(1.0, x_angle_left[dir] - pos); - dcos_theta[0] = -sgn*(dx_left[0]*cos_theta/r1 - dx_right[0]/r2)/r1; - dcos_theta[1] = -sgn*(dx_left[1]*cos_theta/r1 - dx_right[1]/r2)/r1; - dcos_theta[2] = -sgn*(dx_left[2]*cos_theta/r1 - dx_right[2]/r2)/r1; + dcos_theta[0] = -sgn*(dx_left[0]*cos_theta/r1 + dx_right[0]/r2)/r1; + dcos_theta[1] = -sgn*(dx_left[1]*cos_theta/r1 + dx_right[1]/r2)/r1; + dcos_theta[2] = -sgn*(dx_left[2]*cos_theta/r1 + dx_right[2]/r2)/r1; } // both bonds crossing the plane @@ -722,14 +722,14 @@ void ComputeStressMop::compute_angles() { // due to right bond double sgn = copysign(1.0, x_angle_middle[dir] - pos); - dcos_theta[0] = -sgn*(dx_right[0]*cos_theta/r2 - dx_left[0]/r1)/r2; - dcos_theta[1] = -sgn*(dx_right[1]*cos_theta/r2 - dx_left[1]/r1)/r2; - dcos_theta[2] = -sgn*(dx_right[2]*cos_theta/r2 - dx_left[2]/r1)/r2; + dcos_theta[0] = -sgn*(dx_right[0]*cos_theta/r2 + dx_left[0]/r1)/r2; + dcos_theta[1] = -sgn*(dx_right[1]*cos_theta/r2 + dx_left[1]/r1)/r2; + dcos_theta[2] = -sgn*(dx_right[2]*cos_theta/r2 + dx_left[2]/r1)/r2; // due to left bond - dcos_theta[0] += sgn*(dx_left[0]*cos_theta/r1 - dx_right[0]/r2)/r1; - dcos_theta[1] += sgn*(dx_left[1]*cos_theta/r1 - dx_right[1]/r2)/r1; - dcos_theta[2] += sgn*(dx_left[2]*cos_theta/r1 - dx_right[2]/r2)/r1; + dcos_theta[0] += sgn*(dx_left[0]*cos_theta/r1 + dx_right[0]/r2)/r1; + dcos_theta[1] += sgn*(dx_left[1]*cos_theta/r1 + dx_right[1]/r2)/r1; + dcos_theta[2] += sgn*(dx_left[2]*cos_theta/r1 + dx_right[2]/r2)/r1; } // final contribution of the given angle term From b3e9efcb50ded57acff46cc52305c59a0adb04a8 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Mon, 29 May 2023 17:55:24 +0300 Subject: [PATCH 093/172] Use system periodicity to find an equivalent position of the plane --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index a5f5969317..9249e4ce2d 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -74,6 +74,18 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : pos = 0.5*(domain->boxlo[dir]+domain->boxhi[dir]); } else pos = utils::numeric(FLERR,arg[4],false,lmp); + // plane inside the box + if (pos >domain->boxhi[dir] || pos boxlo[dir]) { + error->warning(FLERR,"The specified initial plane lies outside of the simulation box"); + double dx[3] {0}; + dx[dir] = pos - 0.5*(domain->boxhi[dir] + domain->boxlo[dir]); + domain->minimum_image(dx[0], dx[1], dx[2]); + pos = 0.5*(domain->boxhi[dir] + domain->boxlo[dir]) + dx[dir]; + + if (pos >domain->boxhi[dir] || pos boxlo[dir]) + error->all(FLERR, "Plane for compute stress/mop is out of bounds"); + } + if (pos < (domain->boxlo[dir]+domain->prd_half[dir])) { pos1 = pos + domain->prd[dir]; } else { @@ -117,10 +129,6 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : // orthogonal simulation box if (domain->triclinic != 0) error->all(FLERR, "Compute stress/mop incompatible with triclinic simulation box"); - // plane inside the box - if (pos >domain->boxhi[dir] || pos boxlo[dir]) - error->all(FLERR, "Plane for compute stress/mop is out of bounds"); - // Initialize some variables From 69c549363171fb98524e49b09ac2461ff079f2eb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 31 May 2023 09:09:35 -0400 Subject: [PATCH 094/172] silence compiler warning --- src/variable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/variable.cpp b/src/variable.cpp index 783ceab832..81f0bdcfd6 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -1052,7 +1052,7 @@ char *Variable::retrieve(const char *name) if (vecs[ivar].dynamic || vecs[ivar].currentstep != update->ntimestep) { eval_in_progress[ivar] = 0; double *result; - int nvec = compute_vector(ivar,&result); + compute_vector(ivar,&result); delete[] data[ivar][1]; std::vector vectmp(vecs[ivar].values,vecs[ivar].values + vecs[ivar].n); std::string str = fmt::format("[{}]", fmt::join(vectmp,",")); From 6138b2b1f78e223c5e0d00d614d5399c3849a8ed Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 31 May 2023 13:31:45 -0400 Subject: [PATCH 095/172] fix grammar --- src/variable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/variable.cpp b/src/variable.cpp index 81f0bdcfd6..437e4ac917 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -224,7 +224,7 @@ void Variable::set(int narg, char **arg) if (narg == 5 && strcmp(arg[4],"pad") == 0) { pad[nvar] = fmt::format("{}",nlast).size(); } else pad[nvar] = 0; - } else error->all(FLERR,"Illegal variable loop command: too much arguments"); + } else error->all(FLERR,"Illegal variable loop command: too many arguments"); num[nvar] = nlast; which[nvar] = nfirst-1; data[nvar] = new char*[1]; From ea6ece510edc25cc8f381d7d67e546f62bbd8058 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Thu, 1 Jun 2023 10:22:01 +0300 Subject: [PATCH 096/172] turning warning into errors for unsupported styles --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 9249e4ce2d..0199a49c01 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -205,26 +205,25 @@ void ComputeStressMop::init() if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute stress/mop"); - // Warnings + // Errors if (me==0) { - //Compute stress/mop only accounts for pair interactions. - // issue a warning if any intramolecular potential or Kspace is defined. + // issue an error for unimplemented intramolecular potentials or Kspace. if (force->bond!=nullptr) bondflag = 1; if (force->angle!=nullptr) if (force->angle->born_matrix_enable == 0) { - error->warning(FLERR,"compute stress/mop does not account for angle potentials"); + error->all(FLERR,"compute stress/mop does not account for angle potentials"); } else { angleflag = 1; } if (force->dihedral!=nullptr) - error->warning(FLERR,"compute stress/mop does not account for dihedral potentials"); + error->all(FLERR,"compute stress/mop does not account for dihedral potentials"); if (force->improper!=nullptr) - error->warning(FLERR,"compute stress/mop does not account for improper potentials"); + error->all(FLERR,"compute stress/mop does not account for improper potentials"); if (force->kspace!=nullptr) - error->warning(FLERR,"compute stress/mop does not account for kspace contributions"); + error->all(FLERR,"compute stress/mop does not account for kspace contributions"); } // need an occasional half neighbor list From b01db47b2d83a5d4656ef279c318c717cfefe192 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Thu, 1 Jun 2023 10:33:50 +0300 Subject: [PATCH 097/172] consistency in issuing errors between mop and mop/profile --- src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp index 709f109cb1..ffcc712548 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp @@ -178,23 +178,23 @@ void ComputeStressMopProfile::init() if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute stress/mop/profile"); - // Warnings + // Errors if (me==0) { //Compute stress/mop/profile only accounts for pair interactions. - // issue a warning if any intramolecular potential or Kspace is defined. + // issue an error if any intramolecular potential or Kspace is defined. if (force->bond!=nullptr) - error->warning(FLERR,"compute stress/mop/profile does not account for bond potentials"); + error->all(FLERR,"compute stress/mop/profile does not account for bond potentials"); if (force->angle!=nullptr) - error->warning(FLERR,"compute stress/mop/profile does not account for angle potentials"); + error->all(FLERR,"compute stress/mop/profile does not account for angle potentials"); if (force->dihedral!=nullptr) - error->warning(FLERR,"compute stress/mop/profile does not account for dihedral potentials"); + error->all(FLERR,"compute stress/mop/profile does not account for dihedral potentials"); if (force->improper!=nullptr) - error->warning(FLERR,"compute stress/mop/profile does not account for improper potentials"); + error->all(FLERR,"compute stress/mop/profile does not account for improper potentials"); if (force->kspace!=nullptr) - error->warning(FLERR,"compute stress/mop/profile does not account for kspace contributions"); + error->all(FLERR,"compute stress/mop/profile does not account for kspace contributions"); } // need an occasional half neighbor list From 6bc27db58c2829dab6f13b8cb5e69702a2cd2b36 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Thu, 1 Jun 2023 06:17:11 -0400 Subject: [PATCH 098/172] do not delete c_pe and c_press in destructor --- src/REPLICA/fix_pimd_langevin.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 67d7cabe02..f9c7772d63 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -344,8 +344,6 @@ FixPIMDLangevin::~FixPIMDLangevin() delete[] id_pe; delete[] id_press; delete random; - delete c_pe; - delete c_press; delete[] mass; delete[] _omega_k; delete[] Lan_c; From f3bf20be8b15a9d82028934f27f33af019ae469e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yifan=20Li=E6=9D=8E=E4=B8=80=E5=B8=86?= Date: Thu, 1 Jun 2023 08:26:02 -0400 Subject: [PATCH 099/172] The first three p_flags for iso should be 1. --- src/REPLICA/fix_pimd_langevin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index f9c7772d63..2e4b1c17b8 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -205,6 +205,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : error->universe_all(FLERR, "Unknown barostat parameter for fix pimd/langevin"); } else if (strcmp(arg[i], "iso") == 0) { pstyle = ISO; + p_flag[0] = p_flag[1] = p_flag[2] = 1; Pext = utils::numeric(FLERR, arg[i + 1], false, lmp); p_target[0] = p_target[1] = p_target[2] = Pext; pdim = 3; From c1cec4565250c5a1b28c850badae0785b140c60d Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Thu, 1 Jun 2023 15:26:43 +0300 Subject: [PATCH 100/172] add keywords to specify contributions to stress/mop --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 0199a49c01..071bdf31ee 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -38,7 +38,7 @@ using namespace LAMMPS_NS; enum{X,Y,Z}; -enum{TOTAL,CONF,KIN}; +enum{TOTAL,CONF,KIN,PAIR,BOND,ANGLE}; #define BIG 1000000000 @@ -115,6 +115,21 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : which[nvalues] = TOTAL; nvalues++; } + } else if (strcmp(arg[iarg],"pair") == 0) { + for (i=0; i<3; i++) { + which[nvalues] = PAIR; + nvalues++; + } + } else if (strcmp(arg[iarg],"bond") == 0) { + for (i=0; i<3; i++) { + which[nvalues] = BOND; + nvalues++; + } + } else if (strcmp(arg[iarg],"angle") == 0) { + for (i=0; i<3; i++) { + which[nvalues] = ANGLE; + nvalues++; + } } else error->all(FLERR, "Illegal compute stress/mop command"); //break; iarg++; @@ -329,7 +344,7 @@ void ComputeStressMop::compute_pairs() m = 0; while (m Date: Thu, 1 Jun 2023 15:34:41 +0300 Subject: [PATCH 101/172] Update compute_stress_mop.rst to reflect the added keywords --- doc/src/compute_stress_mop.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/src/compute_stress_mop.rst b/doc/src/compute_stress_mop.rst index a8a3bc5660..b4c15257af 100644 --- a/doc/src/compute_stress_mop.rst +++ b/doc/src/compute_stress_mop.rst @@ -18,7 +18,7 @@ Syntax * style = *stress/mop* or *stress/mop/profile* * dir = *x* or *y* or *z* is the direction normal to the plane * args = argument specific to the compute style -* keywords = *kin* or *conf* or *total* (one of more can be specified) +* keywords = *kin* or *conf* or *total* or *pair* or *bond* or *angle* (one or more can be specified) .. parsed-literal:: @@ -64,9 +64,11 @@ atoms have crossed the plane if their positions at times :math:`t-\Delta t` and :math:`t` are one on either side of the plane, and uses the velocity at time :math:`t-\Delta t/2` given by the velocity Verlet algorithm. -Between one and three keywords can be used to indicate which -contributions to the stress must be computed: kinetic stress (kin), -configurational stress (conf), and/or total stress (total). +Between one and six keywords can be used to indicate which +contributions to the stress must be computed: total stress (total), kinetic stress (kin), +configurational stress (conf), stress due to bond stretching (bond), +stress due to angle bending (angle) and/or due to pairwise non-bonded interactions (pair). +The last three keywords are currently available only for the stress/mop command and not the stress/mop/profile. NOTE 1: The configurational stress is computed considering all pairs of atoms where at least one atom belongs to group group-ID. From 1189661edc3fa2fe0ecfb54c8fc048bdf0d42b3c Mon Sep 17 00:00:00 2001 From: oywg11 Date: Thu, 1 Jun 2023 21:00:16 +0800 Subject: [PATCH 102/172] revise the code files of standard version based on latest version of LAMMPS --- src/INTERLAYER/pair_ilp_graphene_hbn.cpp | 21 ++++++------- src/INTERLAYER/pair_ilp_graphene_hbn.h | 38 +++++------------------- src/INTERLAYER/pair_ilp_tmd.cpp | 30 +++++++++---------- src/INTERLAYER/pair_ilp_tmd.h | 2 +- src/INTERLAYER/pair_ilp_water_2dm.cpp | 23 +++++++------- src/INTERLAYER/pair_ilp_water_2dm.h | 21 +------------ 6 files changed, 45 insertions(+), 90 deletions(-) diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp index 956d7ba2be..401d7f7b12 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp @@ -1,7 +1,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -47,11 +47,11 @@ using namespace InterLayer; static const char cite_ilp[] = "ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848\n" "@Article{Ouyang2018\n" - " author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod},\n" + " author = {W. Ouyang and D. Mandelli and M. Urbakh and O. Hod},\n" " title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials},\n" " journal = {Nano Letters},\n" " volume = 18,\n" - " pages = {6009}\n" + " pages = 6009,\n" " year = 2018,\n" "}\n\n"; @@ -59,10 +59,7 @@ static const char cite_ilp[] = static std::map variant_map = { {PairILPGrapheneHBN::ILP_GrhBN, "ilp/graphene/hbn"}, {PairILPGrapheneHBN::ILP_TMD, "ilp/tmd"}, - {PairILPGrapheneHBN::ILP_PHOSPHORUS, "ilp/phosphorus"}, - {PairILPGrapheneHBN::ILP_WATER_2DM, "ilp/water/2dm"}, - {PairILPGrapheneHBN::SAIP_METAL, "saip/metal"}, - {PairILPGrapheneHBN::SAIP_METAL_TMD, "saip/metal/tmd"}}; + {PairILPGrapheneHBN::SAIP_METAL, "saip/metal"}}; /* ---------------------------------------------------------------------- */ @@ -316,14 +313,14 @@ void PairILPGrapheneHBN::read_file(char *filename) for (int m = 0; m < nparams; m++) { if (i == params[m].ielement && j == params[m].jelement) { if (n >= 0) - error->all(FLERR, "{} potential file {} has a duplicate entry", variant_map[variant], - filename); + error->all(FLERR, "{} potential file {} has a duplicate entry for: {} {}", + variant_map[variant], filename, elements[i], elements[j]); n = m; } } if (n < 0) - error->all(FLERR, "{} potential file {} is missing an entry", variant_map[variant], - filename); + error->all(FLERR, "{} potential file {} is missing an entry for: {} {}", + variant_map[variant], filename, elements[i], elements[j]); elem2param[i][j] = n; cutILPsq[i][j] = params[n].rcut * params[n].rcut; } @@ -652,7 +649,7 @@ void PairILPGrapheneHBN::ILP_neigh() (int **) memory->smalloc(maxlocal * sizeof(int *), "ILPGrapheneHBN:firstneigh"); } - inum = list->inum; // + list->gnum; + inum = list->inum; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.h b/src/INTERLAYER/pair_ilp_graphene_hbn.h index 6381fb8f35..9987830b1d 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.h +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -35,19 +35,11 @@ class PairILPGrapheneHBN : public Pair { double init_one(int, int) override; void init_style() override; void calc_FvdW(int, int); - virtual void calc_FRep(int, int); - virtual void ILP_neigh(); - virtual void calc_normal(); - void read_file(char *); - void allocate(); - double single(int, int, int, int, double, double, double, double &) override; static constexpr int NPARAMS_PER_LINE = 13; - // for telling class variants apart in shared code - enum { ILP_GrhBN, ILP_TMD, SAIP_METAL, - ILP_WATER_2DM, SAIP_METAL_TMD, ILP_PHOSPHORUS }; + enum { ILP_GrhBN, ILP_TMD, SAIP_METAL }; // for telling class variants apart in shared code protected: int me; @@ -59,7 +51,6 @@ class PairILPGrapheneHBN : public Pair { int *ILP_numneigh; // # of pair neighbors for each atom int **ILP_firstneigh; // ptr to 1st neighbor of each atom int tap_flag; // flag to turn on/off taper function - double ncf; // for ilp/phosphorus, coefficients for calcualting the normals struct Param { double z0, alpha, epsilon, C, delta, d, sR, reff, C6, S; @@ -85,28 +76,15 @@ class PairILPGrapheneHBN : public Pair { double ***dpvet1; double ***dpvet2; double ***dNave; + + virtual void ILP_neigh(); + virtual void calc_normal(); + virtual void calc_FRep(int, int); + void read_file(char *); + void allocate(); }; } // namespace LAMMPS_NS #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. - -*/ diff --git a/src/INTERLAYER/pair_ilp_tmd.cpp b/src/INTERLAYER/pair_ilp_tmd.cpp index d855b9423d..f5636ce3fa 100644 --- a/src/INTERLAYER/pair_ilp_tmd.cpp +++ b/src/INTERLAYER/pair_ilp_tmd.cpp @@ -1,7 +1,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -22,14 +22,12 @@ #include "atom.h" #include "citeme.h" -#include "comm.h" #include "error.h" #include "force.h" #include "interlayer_taper.h" #include "memory.h" #include "my_page.h" #include "neigh_list.h" -#include "neighbor.h" #include #include @@ -37,20 +35,22 @@ using namespace LAMMPS_NS; using namespace InterLayer; +#define MAXLINE 1024 #define DELTA 4 #define PGDELTA 1 -static const char cite_ilp_tmd[] = "ilp/tmd potential doi/10.1021/acs.jctc.1c00782\n" - "@Article{Ouyang2021\n" - " author = {W. Ouyang, R. Sofer, X. Gao, J. Hermann, A. " - "Tkatchenko, L. Kronik, M. Urbakh, and O. Hod},\n" - " title = {Anisotropic Interlayer Force Field for Transition " - "Metal Dichalcogenides: The Case of Molybdenum Disulfide},\n" - " journal = {J. Chem. Theory Comput.},\n" - " volume = 17,\n" - " pages = {7237–7245}\n" - " year = 2021,\n" - "}\n\n"; +static const char cite_ilp_tmd[] = + "ilp/tmd potential doi:10.1021/acs.jctc.1c00782\n" + "@Article{Ouyang2021\n" + " author = {W. Ouyang and R. Sofer and X. Gao and J. Hermann and\n" + " A. Tkatchenko and L. Kronik and M. Urbakh and O. Hod},\n" + " title = {Anisotropic Interlayer Force Field for Transition\n" + " Metal Dichalcogenides: The Case of Molybdenum Disulfide},\n" + " journal = {J.~Chem.\\ Theory Comput.},\n" + " volume = 17,\n" + " pages = {7237--7245}\n" + " year = 2021,\n" + "}\n\n"; /* ---------------------------------------------------------------------- */ @@ -249,7 +249,7 @@ void PairILPTMD::ILP_neigh() ILP_firstneigh = (int **) memory->smalloc(maxlocal * sizeof(int *), "ILPTMD:firstneigh"); } - inum = list->inum; //+ list->gnum; + inum = list->inum; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; diff --git a/src/INTERLAYER/pair_ilp_tmd.h b/src/INTERLAYER/pair_ilp_tmd.h index 8d5446d49c..8381c2e830 100644 --- a/src/INTERLAYER/pair_ilp_tmd.h +++ b/src/INTERLAYER/pair_ilp_tmd.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/INTERLAYER/pair_ilp_water_2dm.cpp b/src/INTERLAYER/pair_ilp_water_2dm.cpp index 58e56894f5..2eb50305cc 100644 --- a/src/INTERLAYER/pair_ilp_water_2dm.cpp +++ b/src/INTERLAYER/pair_ilp_water_2dm.cpp @@ -1,7 +1,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -22,7 +22,6 @@ #include "atom.h" #include "citeme.h" -#include "comm.h" #include "error.h" #include "force.h" #include "interlayer_taper.h" @@ -30,7 +29,6 @@ #include "my_page.h" #include "neigh_list.h" #include "neigh_request.h" -#include "neighbor.h" #include #include @@ -42,15 +40,16 @@ using namespace InterLayer; #define DELTA 4 #define PGDELTA 1 -static const char cite_ilp_water[] = "ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464\n" - "@Article{Feng2023\n" - " author = {Z. Feng, Y. Yao, J. Liu, B. Wu, Z. Liu, and W. Ouyang},\n" - " title = {Registry-Dependent Potential for Interfaces of Water with Graphene},\n" - " journal = {J. Phys. Chem. C},\n" - " volume = 127,\n" - " pages = {8704-8713}\n" - " year = 2023,\n" - "}\n\n"; +static const char cite_ilp_water[] = + "ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464\n" + "@Article{Feng2023\n" + " author = {Z. Feng, Y. Yao, J. Liu, B. Wu, Z. Liu, and W. Ouyang},\n" + " title = {Registry-Dependent Potential for Interfaces of Water with Graphene},\n" + " journal = {J. Phys. Chem. C},\n" + " volume = 127,\n" + " pages = {8704-8713}\n" + " year = 2023,\n" + "}\n\n"; /* ---------------------------------------------------------------------- */ diff --git a/src/INTERLAYER/pair_ilp_water_2dm.h b/src/INTERLAYER/pair_ilp_water_2dm.h index c35d757ea0..fad9f99ff1 100644 --- a/src/INTERLAYER/pair_ilp_water_2dm.h +++ b/src/INTERLAYER/pair_ilp_water_2dm.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -46,22 +46,3 @@ class PairILPWATER2DM : virtual public PairILPTMD { #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 887534fd0211695a2086905ed568d6d0a4da3840 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Thu, 1 Jun 2023 21:12:11 +0800 Subject: [PATCH 103/172] fix checkstyle --- src/INTERLAYER/pair_ilp_tmd.cpp | 10 +++++----- src/INTERLAYER/pair_ilp_water_2dm.cpp | 2 +- src/OPT/pair_ilp_graphene_hbn_opt.cpp | 3 +-- src/OPT/pair_ilp_graphene_hbn_opt.h | 2 +- src/OPT/pair_ilp_water_2dm_opt.cpp | 2 +- src/OPT/pair_ilp_water_2dm_opt.h | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/INTERLAYER/pair_ilp_tmd.cpp b/src/INTERLAYER/pair_ilp_tmd.cpp index f5636ce3fa..c1af7098cd 100644 --- a/src/INTERLAYER/pair_ilp_tmd.cpp +++ b/src/INTERLAYER/pair_ilp_tmd.cpp @@ -488,11 +488,11 @@ void PairILPTMD::calc_normal() jH2 = atom->map(tag[i] - 2); iH1 = map[type[jH1]]; iH2 = map[type[jH2]]; - if (strcmp(elements[iH1], "Ow") == 0 ) { + if (strcmp(elements[iH1], "Ow") == 0 ) { vect[0][0] = x[jH1][0] - xtp; vect[0][1] = x[jH1][1] - ytp; vect[0][2] = x[jH1][2] - ztp; - } else if (strcmp(elements[iH2], "Ow") == 0 ) { + } else if (strcmp(elements[iH2], "Ow") == 0 ) { vect[0][0] = x[jH2][0] - xtp; vect[0][1] = x[jH2][1] - ytp; vect[0][2] = x[jH2][2] - ztp; @@ -518,7 +518,7 @@ void PairILPTMD::calc_normal() // Calculte dNave/dri, defined as dpvdri for (id = 0; id < 3; id++) { for (ip = 0; ip < 3; ip++) { - if (ip == id) { dpvdri[id][ip] = -1.0;} + if (ip == id) { dpvdri[id][ip] = -1.0;} else {dpvdri[id][ip] = 0.0;} } } @@ -682,12 +682,12 @@ void PairILPTMD::calc_normal() normal[i][2] = Nave[2] / nn; // derivatives of non-normalized normal vector, dNave:3xcontx3 array - // dNave[id][m][ip]: the derivatve of the id component of Nave + // dNave[id][m][ip]: the derivatve of the id component of Nave // respect to the ip component of atom m for (id = 0; id < 3; id++) { for (ip = 0; ip < 3; ip++) { for (m = 0; m < cont; m++) { - if (ip == id) { dNave[id][m][ip] = 0.5;} + if (ip == id) { dNave[id][m][ip] = 0.5;} else {dNave[id][m][ip] = 0.0;} } } diff --git a/src/INTERLAYER/pair_ilp_water_2dm.cpp b/src/INTERLAYER/pair_ilp_water_2dm.cpp index 2eb50305cc..3747d249de 100644 --- a/src/INTERLAYER/pair_ilp_water_2dm.cpp +++ b/src/INTERLAYER/pair_ilp_water_2dm.cpp @@ -40,7 +40,7 @@ using namespace InterLayer; #define DELTA 4 #define PGDELTA 1 -static const char cite_ilp_water[] = +static const char cite_ilp_water[] = "ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464\n" "@Article{Feng2023\n" " author = {Z. Feng, Y. Yao, J. Liu, B. Wu, Z. Liu, and W. Ouyang},\n" diff --git a/src/OPT/pair_ilp_graphene_hbn_opt.cpp b/src/OPT/pair_ilp_graphene_hbn_opt.cpp index 63822ad4c6..e8cb205a52 100644 --- a/src/OPT/pair_ilp_graphene_hbn_opt.cpp +++ b/src/OPT/pair_ilp_graphene_hbn_opt.cpp @@ -1,7 +1,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains @@ -471,7 +471,6 @@ inline void deriv_hat(double dnhatdn[3][3], double *n, double rnnorm, double fac dnhatdn[0][2] = -n[0]*n[2]*cfactor; dnhatdn[1][2] = -n[1]*n[2]*cfactor; dnhatdn[2][2] = (n[0]*n[0]+n[1]*n[1])*cfactor; - } inline double normalize_factor(double *n) { diff --git a/src/OPT/pair_ilp_graphene_hbn_opt.h b/src/OPT/pair_ilp_graphene_hbn_opt.h index bc22ab22b0..41d2178092 100644 --- a/src/OPT/pair_ilp_graphene_hbn_opt.h +++ b/src/OPT/pair_ilp_graphene_hbn_opt.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/OPT/pair_ilp_water_2dm_opt.cpp b/src/OPT/pair_ilp_water_2dm_opt.cpp index 6cdac00ed9..316551c345 100644 --- a/src/OPT/pair_ilp_water_2dm_opt.cpp +++ b/src/OPT/pair_ilp_water_2dm_opt.cpp @@ -1,7 +1,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains diff --git a/src/OPT/pair_ilp_water_2dm_opt.h b/src/OPT/pair_ilp_water_2dm_opt.h index 25905643af..8062de880a 100644 --- a/src/OPT/pair_ilp_water_2dm_opt.h +++ b/src/OPT/pair_ilp_water_2dm_opt.h @@ -1,7 +1,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov + LAMMPS development team: developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains From a4f4f965e3f1688d0e7da135c8809081a4e6083a Mon Sep 17 00:00:00 2001 From: oywg11 Date: Thu, 1 Jun 2023 21:45:52 +0800 Subject: [PATCH 104/172] fix a bug in the codes --- src/INTERLAYER/pair_ilp_graphene_hbn.cpp | 1 + src/INTERLAYER/pair_ilp_graphene_hbn.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp index 401d7f7b12..6d7526e3dd 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp @@ -59,6 +59,7 @@ static const char cite_ilp[] = static std::map variant_map = { {PairILPGrapheneHBN::ILP_GrhBN, "ilp/graphene/hbn"}, {PairILPGrapheneHBN::ILP_TMD, "ilp/tmd"}, + {PairILPGrapheneHBN::ILP_WATER_2DM, "ilp/water/2dm"}, {PairILPGrapheneHBN::SAIP_METAL, "saip/metal"}}; /* ---------------------------------------------------------------------- */ diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.h b/src/INTERLAYER/pair_ilp_graphene_hbn.h index 9987830b1d..e27fce420a 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.h +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.h @@ -39,7 +39,7 @@ class PairILPGrapheneHBN : public Pair { static constexpr int NPARAMS_PER_LINE = 13; - enum { ILP_GrhBN, ILP_TMD, SAIP_METAL }; // for telling class variants apart in shared code + enum { ILP_GrhBN, ILP_TMD, SAIP_METAL, ILP_WATER_2DM }; // for telling class variants apart in shared code protected: int me; From 08ffd268bff9734217ea14be6d223810fd983991 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Fri, 2 Jun 2023 09:43:58 +0300 Subject: [PATCH 105/172] remove unused symbolic constant --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 071bdf31ee..3ae758b875 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -40,8 +40,6 @@ using namespace LAMMPS_NS; enum{X,Y,Z}; enum{TOTAL,CONF,KIN,PAIR,BOND,ANGLE}; -#define BIG 1000000000 - /* ---------------------------------------------------------------------- */ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : From 8ef4e933b25610a841a8107412cdb7a69cbb50da Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Fri, 2 Jun 2023 10:17:38 -0600 Subject: [PATCH 106/172] Fix bug when Kokkos border comm is on host --- src/KOKKOS/comm_kokkos.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KOKKOS/comm_kokkos.cpp b/src/KOKKOS/comm_kokkos.cpp index 7d007a666c..b0394821fc 100644 --- a/src/KOKKOS/comm_kokkos.cpp +++ b/src/KOKKOS/comm_kokkos.cpp @@ -980,9 +980,9 @@ void CommKokkos::borders() } else { atomKK->sync(Host,ALL_MASK); k_sendlist.sync(); - CommBrick::borders(); k_sendlist.modify(); - atomKK->modified(Host,ALL_MASK); + atomKK->modified(Host,ALL_MASK); // needed here for atom map + CommBrick::borders(); } if (comm->nprocs == 1 && !ghost_velocity && !forward_comm_classic) From 70507462e9e04e8466e9e7c48a56f065235f871d Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Fri, 2 Jun 2023 19:22:28 +0300 Subject: [PATCH 107/172] Include method for bond contribution & variables to compute_stress_mop_profile.h --- src/EXTRA-COMPUTE/compute_stress_mop_profile.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop_profile.h b/src/EXTRA-COMPUTE/compute_stress_mop_profile.h index b58f762c12..7bb87fa4c6 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop_profile.h +++ b/src/EXTRA-COMPUTE/compute_stress_mop_profile.h @@ -38,16 +38,20 @@ class ComputeStressMopProfile : public Compute { private: void compute_pairs(); + void compute_bonds(); void setup_bins(); int me, nvalues, dir; int *which; + int bondflag; + int originflag; double origin, delta, offset, invdelta; int nbins; double **coord, **coordp; double **values_local, **values_global; + double **bond_local, **bond_global; double dt, nktv2p, ftm2v; double area; From e7ae02dd2a53b12f8b6de5eabea4d9750d98b085 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Fri, 2 Jun 2023 19:33:15 +0300 Subject: [PATCH 108/172] Code for bond contribution to stress/mop/profile --- .../compute_stress_mop_profile.cpp | 169 +++++++++++++++++- 1 file changed, 162 insertions(+), 7 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp index ffcc712548..d15067a266 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp @@ -19,8 +19,11 @@ #include "compute_stress_mop_profile.h" #include "atom.h" +#include "atom_vec.h" +#include "bond.h" #include "update.h" #include "domain.h" +#include "molecule.h" #include "neighbor.h" #include "force.h" #include "pair.h" @@ -35,9 +38,7 @@ using namespace LAMMPS_NS; enum{X,Y,Z}; enum{LOWER,CENTER,UPPER,COORD}; -enum{TOTAL,CONF,KIN}; - -#define BIG 1000000000 +enum{TOTAL,CONF,KIN,PAIR,BOND}; /* ---------------------------------------------------------------------- */ @@ -48,6 +49,8 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a MPI_Comm_rank(world,&me); + bondflag = 0; + // set compute mode and direction of plane(s) for pressure calculation if (strcmp(arg[3],"x")==0) { @@ -92,6 +95,16 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a which[nvalues] = TOTAL; nvalues++; } + } else if (strcmp(arg[iarg],"pair") == 0) { + for (i=0; i<3; i++) { + which[nvalues] = PAIR; + nvalues++; + } + } else if (strcmp(arg[iarg],"bond") == 0) { + for (i=0; i<3; i++) { + which[nvalues] = PAIR; + nvalues++; + } } else error->all(FLERR, "Illegal compute stress/mop/profile command"); //break; iarg++; @@ -114,6 +127,8 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a nbins = 0; coord = coordp = nullptr; values_local = values_global = array = nullptr; + bond_local = nullptr; + bond_global = nullptr; // bin setup @@ -140,6 +155,8 @@ ComputeStressMopProfile::~ComputeStressMopProfile() memory->destroy(coordp); memory->destroy(values_local); memory->destroy(values_global); + memory->destroy(bond_local); + memory->destroy(bond_global); memory->destroy(array); } @@ -185,8 +202,8 @@ void ComputeStressMopProfile::init() //Compute stress/mop/profile only accounts for pair interactions. // issue an error if any intramolecular potential or Kspace is defined. - if (force->bond!=nullptr) - error->all(FLERR,"compute stress/mop/profile does not account for bond potentials"); + if (force->bond!=nullptr) bondflag = 1; + if (force->angle!=nullptr) error->all(FLERR,"compute stress/mop/profile does not account for angle potentials"); if (force->dihedral!=nullptr) @@ -225,6 +242,21 @@ void ComputeStressMopProfile::compute_array() MPI_Allreduce(&values_local[0][0],&values_global[0][0],nbins*nvalues, MPI_DOUBLE,MPI_SUM,world); + if (bondflag) { + //Compute bond contribution on separate procs + compute_bonds(); + } else { + for (int m = 0; m < nbins; m++) { + for (int i = 0; i < nvalues; i++) { + bond_local[m][i] = 0.0; + } + } + } + + // sum bond contribution over all procs + MPI_Allreduce(&bond_local[0][0],&bond_global[0][0],nbins*nvalues, + MPI_DOUBLE,MPI_SUM,world); + int ibin,m,mo; for (ibin=0; ibinx; + tagint *tag = atom->tag; + int *num_bond = atom->num_bond; + tagint **bond_atom = atom->bond_atom; + int **bond_type = atom->bond_type; + int *mask = atom->mask; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + + int nlocal = atom->nlocal; + int newton_bond = force->newton_bond; + int molecular = atom->molecular; + + Bond *bond = force->bond; + + double dx[3] {0}; + double x_bond_1[3] {0}; + double x_bond_2[3] {0}; + double local_contribution[nbins][3] {0}; + + // initialization + for (int m {0}; m < nbins; m++) { + for (int i {0}; i < nvalues; i++) { + bond_local[m][i] = 0.0; + } + } + + // loop over all bonded atoms in the current proc + for (atom1 = 0; atom1 < nlocal; atom1++) { + if (!(mask[atom1] & groupbit)) continue; + + if (molecular == 1) + nb = num_bond[atom1]; + else { + if (molindex[atom1] < 0) continue; + imol = molindex[atom1]; + iatom = molatom[atom1]; + nb = onemols[imol]->num_bond[iatom]; + } + + for (i = 0; i < nb; i++) { + if (molecular == 1) { + btype = bond_type[atom1][i]; + atom2 = atom->map(bond_atom[atom1][i]); + } else { + tagprev = tag[atom1] - iatom - 1; + btype = onemols[imol]->bond_type[iatom][i]; + atom2 = atom->map(onemols[imol]->bond_atom[iatom][i] + tagprev); + } + + if (atom2 < 0 || !(mask[atom2] & groupbit)) continue; + if (newton_bond == 0 && tag[atom1] > tag[atom2]) continue; + if (btype <= 0) continue; + + for (int ibin {0}; ibinminimum_image(dx[0], dx[1], dx[2]); + x_bond_1[0] = dx[0]; + x_bond_1[1] = dx[1]; + x_bond_1[2] = dx[2]; + x_bond_1[dir] += pos; + + // minimum image of atom2 with respect to atom1 + dx[0] = x[atom2][0] - x_bond_1[0]; + dx[1] = x[atom2][1] - x_bond_1[1]; + dx[2] = x[atom2][2] - x_bond_1[2]; + domain->minimum_image(dx[0], dx[1], dx[2]); + x_bond_2[0] = x_bond_1[0] + dx[0]; + x_bond_2[1] = x_bond_1[1] + dx[1]; + x_bond_2[2] = x_bond_1[2] + dx[2]; + + // check if the bond vector crosses the plane of interest + double tau = (x_bond_1[dir] - pos) / (x_bond_1[dir] - x_bond_2[dir]); + if ((tau <= 1) && (tau >= 0)) { + dx[0] = x_bond_1[0] - x_bond_2[0]; + dx[1] = x_bond_1[1] - x_bond_2[1]; + dx[2] = x_bond_1[2] - x_bond_2[2]; + rsq = dx[0] * dx[0] + dx[1] * dx[1] + dx[2] * dx[2]; + bond->single(btype, rsq, atom1, atom2, fpair); + + double sgn = copysign(1.0, x_bond_1[dir] - pos); + local_contribution[ibin][0] += sgn*fpair*dx[0]/area*nktv2p; + local_contribution[ibin][1] += sgn*fpair*dx[1]/area*nktv2p; + local_contribution[ibin][2] += sgn*fpair*dx[2]/area*nktv2p; + } + } + } + } + + // loop over the keywords and if necessary add the bond contribution + int m {0}; + while (mcreate(coordp,nbins,1,"stress/mop/profile:coordp"); memory->create(values_local,nbins,nvalues,"stress/mop/profile:values_local"); memory->create(values_global,nbins,nvalues,"stress/mop/profile:values_global"); + memory->create(bond_local,nbins,nvalues,"stress/mop/profile:bond_local"); + memory->create(bond_global,nbins,nvalues,"stress/mop/profile:bond_global"); // set bin coordinates for (i = 0; i < nbins; i++) { From c30762ca8bfd35bb8554e2024ea57462298fa2e5 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Fri, 2 Jun 2023 19:44:37 +0300 Subject: [PATCH 109/172] Update documentation for compute stress/mop/profile --- doc/src/compute_stress_mop.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/compute_stress_mop.rst b/doc/src/compute_stress_mop.rst index b4c15257af..e1b151ebbd 100644 --- a/doc/src/compute_stress_mop.rst +++ b/doc/src/compute_stress_mop.rst @@ -68,7 +68,7 @@ Between one and six keywords can be used to indicate which contributions to the stress must be computed: total stress (total), kinetic stress (kin), configurational stress (conf), stress due to bond stretching (bond), stress due to angle bending (angle) and/or due to pairwise non-bonded interactions (pair). -The last three keywords are currently available only for the stress/mop command and not the stress/mop/profile. +The angle keyword is currently available only for the stress/mop command and not the stress/mop/profile. NOTE 1: The configurational stress is computed considering all pairs of atoms where at least one atom belongs to group group-ID. @@ -120,8 +120,8 @@ size does not change in time, and axis-aligned planes. The method only works with two-body pair interactions, because it requires the class method pair->single() to be implemented. In particular, compute *stress/mop/profile* does not work with more than -two-body pair interactions, intra-molecular interactions, and long range -(kspace) interactions. Similarly, compute *stress/mop* does not work with more than +two-body pair interactions, long range (kspace) interactions and angle/dihedral/improper +intramolecular interactions. Similarly, compute *stress/mop* does not work with more than two-body pair interactions, long range (kspace) interactions and dihedral/improper intramolecular interactions but works with all bond interactions with the class method single() implemented and all angle interactions with the class method born_matrix() From 28e3a741a8e84d7512e10c34364ac198cf456266 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Fri, 2 Jun 2023 20:02:52 +0300 Subject: [PATCH 110/172] declare local_contribution as pointer in compute_stress_mop_profile.h --- src/EXTRA-COMPUTE/compute_stress_mop_profile.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop_profile.h b/src/EXTRA-COMPUTE/compute_stress_mop_profile.h index 7bb87fa4c6..1015d6e3eb 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop_profile.h +++ b/src/EXTRA-COMPUTE/compute_stress_mop_profile.h @@ -52,6 +52,7 @@ class ComputeStressMopProfile : public Compute { double **coord, **coordp; double **values_local, **values_global; double **bond_local, **bond_global; + double **local_contribution; double dt, nktv2p, ftm2v; double area; From 9dc1f45e1e7df4915740479fb29bd1944c99aecf Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Fri, 2 Jun 2023 20:08:59 +0300 Subject: [PATCH 111/172] Create/destroy local_contribution --- src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp index d15067a266..3a60342887 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp @@ -129,6 +129,7 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a values_local = values_global = array = nullptr; bond_local = nullptr; bond_global = nullptr; + local_contribution = nullptr; // bin setup @@ -157,6 +158,7 @@ ComputeStressMopProfile::~ComputeStressMopProfile() memory->destroy(values_global); memory->destroy(bond_local); memory->destroy(bond_global); + memory->destroy(local_contribution); memory->destroy(array); } @@ -514,13 +516,15 @@ void ComputeStressMopProfile::compute_bonds() double dx[3] {0}; double x_bond_1[3] {0}; double x_bond_2[3] {0}; - double local_contribution[nbins][3] {0}; // initialization for (int m {0}; m < nbins; m++) { for (int i {0}; i < nvalues; i++) { bond_local[m][i] = 0.0; } + local_contribution[m][0] = 0.0; + local_contribution[m][1] = 0.0; + local_contribution[m][2] = 0.0; } // loop over all bonded atoms in the current proc @@ -647,6 +651,7 @@ void ComputeStressMopProfile::setup_bins() memory->create(values_global,nbins,nvalues,"stress/mop/profile:values_global"); memory->create(bond_local,nbins,nvalues,"stress/mop/profile:bond_local"); memory->create(bond_global,nbins,nvalues,"stress/mop/profile:bond_global"); + memory->create(local_contribution,nbins,3,"stress/mop/profile:local_contribution"); // set bin coordinates for (i = 0; i < nbins; i++) { From 390888179fa2282ac9cd60f5eb5745260708d1a3 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Fri, 2 Jun 2023 20:24:32 +0300 Subject: [PATCH 112/172] Update compute_stress_mop_profile.cpp --- src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp index 3a60342887..d299633731 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp @@ -102,7 +102,7 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a } } else if (strcmp(arg[iarg],"bond") == 0) { for (i=0; i<3; i++) { - which[nvalues] = PAIR; + which[nvalues] = BOND; nvalues++; } } else error->all(FLERR, "Illegal compute stress/mop/profile command"); //break; From 40cd3bbdc4f976790f484fdb1b560179cfb9096b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 2 Jun 2023 16:29:10 -0400 Subject: [PATCH 113/172] add cache line size padding to avoid false sharing with OPENMP package --- src/my_page.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/my_page.h b/src/my_page.h index 6c06abd71e..ea19dc8e74 100644 --- a/src/my_page.h +++ b/src/my_page.h @@ -104,6 +104,9 @@ template class MyPage { int errorflag; // flag > 0 if error has occurred // 1 = chunk size exceeded maxchunk // 2 = memory allocation error +#if defined(_OPENMP) + char pad[64]; // to avoid false sharing with multi-threading +#endif void allocate(); void deallocate(); }; From 241f3b751e38df598b5d32c6f9bf9812e05c24d2 Mon Sep 17 00:00:00 2001 From: jtclemm Date: Fri, 2 Jun 2023 15:45:53 -0600 Subject: [PATCH 114/172] Unifying syntax for BPM bond options --- doc/src/bond_bpm_rotational.rst | 12 ++++++------ doc/src/bond_bpm_spring.rst | 14 +++++++------- src/BPM/bond_bpm.cpp | 8 +++++--- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/doc/src/bond_bpm_rotational.rst b/doc/src/bond_bpm_rotational.rst index 0baf7e35b1..ca12d86ccc 100644 --- a/doc/src/bond_bpm_rotational.rst +++ b/doc/src/bond_bpm_rotational.rst @@ -24,7 +24,7 @@ Syntax *x, y, z* = the center of mass position of the 2 atoms when the bond broke (distance units) *x/ref, y/ref, z/ref* = the initial center of mass position of the 2 atoms (distance units) - *overlay/pair* value = none + *overlay/pair* value = *yes* or *no* bonded particles will still interact with pair forces *smooth* value = *yes* or *no* @@ -33,8 +33,8 @@ Syntax *normalize* value = *yes* or *no* normalizes normal and shear forces by the reference length - *break/no* - indicates that bonds should not break during a run + *break* value = *yes* or *no* + indicates whether bonds break during a run Examples """""""" @@ -144,14 +144,14 @@ by :math:`r_0` such that :math:`k_r` and :math:`k_s` are unit less. By default, pair forces are not calculated between bonded particles. Pair forces can alternatively be overlaid on top of bond forces using -the *overlay/pair* keyword. These settings require specific +the *overlay/pair* option. These settings require specific :doc:`special_bonds ` settings described in the restrictions. Further details can be found in the `:doc: how to ` page on BPMs. .. versionadded:: 28Mar2023 -If the *break/no* keyword is used, then LAMMPS assumes bonds should not break +If the *break* option is used, then LAMMPS assumes bonds should not break during a simulation run. This will prevent some unnecessary calculation. However, if a bond does break, it will trigger an error. @@ -257,7 +257,7 @@ Related commands Default """"""" -The option defaults are *smooth* = *yes* +The option defaults are *overlay/pair* = *no*, *smooth* = *yes*, *normalize* = *no*, and *break* = *yes* ---------- diff --git a/doc/src/bond_bpm_spring.rst b/doc/src/bond_bpm_spring.rst index 6da0d25a4a..d89035dcad 100644 --- a/doc/src/bond_bpm_spring.rst +++ b/doc/src/bond_bpm_spring.rst @@ -24,17 +24,17 @@ Syntax *x, y, z* = the center of mass position of the 2 atoms when the bond broke (distance units) *x/ref, y/ref, z/ref* = the initial center of mass position of the 2 atoms (distance units) - *overlay/pair* value = none + *overlay/pair* value = *yes* or *no* bonded particles will still interact with pair forces *smooth* value = *yes* or *no* smooths bond forces near the breaking point *normalize* value = *yes* or *no* - normalizes bond forces by their reference length + normalizes bond forces by the reference length - *break/no* - indicates that bonds should not break during a run + *break* value = *yes* or *no* + indicates whether bonds break during a run Examples """""""" @@ -110,14 +110,14 @@ However, the *normalize* option will normalize the elastic bond force by By default, pair forces are not calculated between bonded particles. Pair forces can alternatively be overlaid on top of bond forces using -the *overlay/pair* keyword. These settings require specific +the *overlay/pair* option. These settings require specific :doc:`special_bonds ` settings described in the restrictions. Further details can be found in the `:doc: how to ` page on BPMs. .. versionadded:: 28Mar2023 -If the *break/no* keyword is used, then LAMMPS assumes bonds should not break +If the *break* option is used, then LAMMPS assumes bonds should not break during a simulation run. This will prevent some unnecessary calculation. However, if a bond does break, it will trigger an error. @@ -212,7 +212,7 @@ Related commands Default """"""" -The option defaults are *smooth* = *yes* +The option defaults are *overlay/pair* = *no*, *smooth* = *yes*, *normalize* = *no*, and *break* = *yes* ---------- diff --git a/src/BPM/bond_bpm.cpp b/src/BPM/bond_bpm.cpp index a68aea3e68..da189ccaf5 100644 --- a/src/BPM/bond_bpm.cpp +++ b/src/BPM/bond_bpm.cpp @@ -187,10 +187,12 @@ void BondBPM::settings(int narg, char **arg) iarg++; } } else if (strcmp(arg[iarg], "overlay/pair") == 0) { - overlay_flag = 1; + if (iarg + 1 > narg) error->all(FLERR, "Illegal bond bpm command, missing option for overlay/pair"); + overlay_flag = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg++; - } else if (strcmp(arg[iarg], "break/no") == 0) { - break_flag = 0; + } else if (strcmp(arg[iarg], "break") == 0) { + if (iarg + 1 > narg) error->all(FLERR, "Illegal bond bpm command, missing option for break"); + break_flag = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg++; } else { leftover_iarg.push_back(iarg); From 2e7ca5f65cc8fd421a04b324a6815953e1641d37 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sat, 3 Jun 2023 18:14:45 +0800 Subject: [PATCH 115/172] rename the pair style --- .../{pair_ilp_water_2dm.cpp => pair_aip_water_2dm.cpp} | 0 src/INTERLAYER/{pair_ilp_water_2dm.h => pair_aip_water_2dm.h} | 0 src/INTERLAYER/pair_ilp_graphene_hbn.cpp | 2 +- src/INTERLAYER/pair_ilp_graphene_hbn.h | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename src/INTERLAYER/{pair_ilp_water_2dm.cpp => pair_aip_water_2dm.cpp} (100%) rename src/INTERLAYER/{pair_ilp_water_2dm.h => pair_aip_water_2dm.h} (100%) diff --git a/src/INTERLAYER/pair_ilp_water_2dm.cpp b/src/INTERLAYER/pair_aip_water_2dm.cpp similarity index 100% rename from src/INTERLAYER/pair_ilp_water_2dm.cpp rename to src/INTERLAYER/pair_aip_water_2dm.cpp diff --git a/src/INTERLAYER/pair_ilp_water_2dm.h b/src/INTERLAYER/pair_aip_water_2dm.h similarity index 100% rename from src/INTERLAYER/pair_ilp_water_2dm.h rename to src/INTERLAYER/pair_aip_water_2dm.h diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp index 6d7526e3dd..e6711d0f19 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp @@ -59,7 +59,7 @@ static const char cite_ilp[] = static std::map variant_map = { {PairILPGrapheneHBN::ILP_GrhBN, "ilp/graphene/hbn"}, {PairILPGrapheneHBN::ILP_TMD, "ilp/tmd"}, - {PairILPGrapheneHBN::ILP_WATER_2DM, "ilp/water/2dm"}, + {PairILPGrapheneHBN::AIP_WATER_2DM, "aip/water/2dm"}, {PairILPGrapheneHBN::SAIP_METAL, "saip/metal"}}; /* ---------------------------------------------------------------------- */ diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.h b/src/INTERLAYER/pair_ilp_graphene_hbn.h index e27fce420a..e151ecc801 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.h +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.h @@ -39,7 +39,7 @@ class PairILPGrapheneHBN : public Pair { static constexpr int NPARAMS_PER_LINE = 13; - enum { ILP_GrhBN, ILP_TMD, SAIP_METAL, ILP_WATER_2DM }; // for telling class variants apart in shared code + enum { ILP_GrhBN, ILP_TMD, SAIP_METAL, AIP_WATER_2DM }; // for telling class variants apart in shared code protected: int me; From 8c6e2ca000b7ad201c3c2676582832066343fc00 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sat, 3 Jun 2023 20:34:42 +0800 Subject: [PATCH 116/172] rename the opt pair style --- ...2dm_opt.cpp => pair_aip_water_2dm_opt.cpp} | 0 ...ter_2dm_opt.h => pair_aip_water_2dm_opt.h} | 0 src/OPT/pair_ilp_graphene_hbn_opt.cpp | 24 +++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) rename src/OPT/{pair_ilp_water_2dm_opt.cpp => pair_aip_water_2dm_opt.cpp} (100%) rename src/OPT/{pair_ilp_water_2dm_opt.h => pair_aip_water_2dm_opt.h} (100%) diff --git a/src/OPT/pair_ilp_water_2dm_opt.cpp b/src/OPT/pair_aip_water_2dm_opt.cpp similarity index 100% rename from src/OPT/pair_ilp_water_2dm_opt.cpp rename to src/OPT/pair_aip_water_2dm_opt.cpp diff --git a/src/OPT/pair_ilp_water_2dm_opt.h b/src/OPT/pair_aip_water_2dm_opt.h similarity index 100% rename from src/OPT/pair_ilp_water_2dm_opt.h rename to src/OPT/pair_aip_water_2dm_opt.h diff --git a/src/OPT/pair_ilp_graphene_hbn_opt.cpp b/src/OPT/pair_ilp_graphene_hbn_opt.cpp index e8cb205a52..b2abcec7be 100644 --- a/src/OPT/pair_ilp_graphene_hbn_opt.cpp +++ b/src/OPT/pair_ilp_graphene_hbn_opt.cpp @@ -169,33 +169,33 @@ void PairILPGrapheneHBNOpt::compute(int eflag, int vflag) } } } - } else if (variant == ILP_WATER_2DM) { + } else if (variant == AIP_WATER_2DM) { if (eflag_global || eflag_atom) { if (vflag_either) { if (tap_flag) { - eval<6, 1, 1, 1, ILP_WATER_2DM>(); + eval<6, 1, 1, 1, AIP_WATER_2DM>(); } else { - eval<6, 1, 1, 0, ILP_WATER_2DM>(); + eval<6, 1, 1, 0, AIP_WATER_2DM>(); } } else { if (tap_flag) { - eval<6, 1, 0, 1, ILP_WATER_2DM>(); + eval<6, 1, 0, 1, AIP_WATER_2DM>(); } else { - eval<6, 1, 0, 0, ILP_WATER_2DM>(); + eval<6, 1, 0, 0, AIP_WATER_2DM>(); } } } else { if (vflag_either) { if (tap_flag) { - eval<6, 0, 1, 1, ILP_WATER_2DM>(); + eval<6, 0, 1, 1, AIP_WATER_2DM>(); } else { - eval<6, 0, 1, 0, ILP_WATER_2DM>(); + eval<6, 0, 1, 0, AIP_WATER_2DM>(); } } else { if (tap_flag) { - eval<6, 0, 0, 1, ILP_WATER_2DM>(); + eval<6, 0, 0, 1, AIP_WATER_2DM>(); } else { - eval<6, 0, 0, 0, ILP_WATER_2DM>(); + eval<6, 0, 0, 0, AIP_WATER_2DM>(); } } } @@ -286,7 +286,7 @@ void PairILPGrapheneHBNOpt::eval() rsq = delx * delx + dely * dely + delz * delz; if (rsq != 0 && rsq < cutILPsq[itype_map][jtype]) { - if ((VARIANT == ILP_TMD || VARIANT == ILP_WATER_2DM) && special_type[itype] == TMD_METAL && itype != type[j]) continue; + if ((VARIANT == ILP_TMD || VARIANT == AIP_WATER_2DM) && special_type[itype] == TMD_METAL && itype != type[j]) continue; if (ILP_nneigh >= MAX_NNEIGH) { error->one(FLERR, "There are too many neighbors for calculating normals"); } @@ -519,8 +519,8 @@ void PairILPGrapheneHBNOpt::calc_normal(int i, int itype, int *ILP_neigh, int nn vet[jj][2] = x[j][2] - x[i][2]; } - //specialize for ILP_WATER_2DM for hydrogen has special normal vector rule - if (variant == ILP_WATER_2DM && special_type[itype] == WATER) { + //specialize for AIP_WATER_2DM for hydrogen has special normal vector rule + if (variant == AIP_WATER_2DM && special_type[itype] == WATER) { if (nneigh == 1){ n[0] = vet[0][0]; n[1] = vet[0][1]; From a25100120bf59ac93f772b4ae158d9f1a8508304 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sat, 3 Jun 2023 20:36:12 +0800 Subject: [PATCH 117/172] update the doc file --- doc/src/{pair_ilp_water_2dm.rst => pair_aip_water_2dm.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/src/{pair_ilp_water_2dm.rst => pair_aip_water_2dm.rst} (100%) diff --git a/doc/src/pair_ilp_water_2dm.rst b/doc/src/pair_aip_water_2dm.rst similarity index 100% rename from doc/src/pair_ilp_water_2dm.rst rename to doc/src/pair_aip_water_2dm.rst From d85342cd6da16eded485da0e544bc35eddf35b94 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sat, 3 Jun 2023 16:04:40 +0300 Subject: [PATCH 118/172] Update test_compute_global.cpp --- unittest/commands/test_compute_global.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittest/commands/test_compute_global.cpp b/unittest/commands/test_compute_global.cpp index 66a24f049f..04913f51b5 100644 --- a/unittest/commands/test_compute_global.cpp +++ b/unittest/commands/test_compute_global.cpp @@ -169,7 +169,7 @@ TEST_F(ComputeGlobalTest, Geometry) command("compute mom1 all momentum"); command("compute mom2 allwater momentum"); command("compute mop1 all stress/mop x 0.0 total"); - command("compute mop2 all stress/mop/profile z lower 0.5 kin conf"); + command("compute mop2 all stress/mop/profile z lower 0.5 kin pair"); thermo_style += " c_mu1 c_mu2 c_mop1[*] c_mop2[1][1]"; } From 738a955c4012397c0fadcbac740a6f48ad3d8909 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sat, 3 Jun 2023 22:37:57 +0800 Subject: [PATCH 119/172] fix checkstyle issues --- src/INTERLAYER/pair_aip_water_2dm.cpp | 14 +++++++------- src/INTERLAYER/pair_aip_water_2dm.h | 19 +++++-------------- src/OPT/pair_aip_water_2dm_opt.cpp | 12 ++++++------ src/OPT/pair_aip_water_2dm_opt.h | 12 ++++++------ 4 files changed, 24 insertions(+), 33 deletions(-) diff --git a/src/INTERLAYER/pair_aip_water_2dm.cpp b/src/INTERLAYER/pair_aip_water_2dm.cpp index 3747d249de..d88676a6e2 100644 --- a/src/INTERLAYER/pair_aip_water_2dm.cpp +++ b/src/INTERLAYER/pair_aip_water_2dm.cpp @@ -18,7 +18,7 @@ [Feng and Ouyang et al, J. Phys. Chem. C 127, 8704-8713 (2023).] ------------------------------------------------------------------------- */ -#include "pair_ilp_water_2dm.h" +#include "pair_aip_water_2dm.h" #include "atom.h" #include "citeme.h" @@ -40,7 +40,7 @@ using namespace InterLayer; #define DELTA 4 #define PGDELTA 1 -static const char cite_ilp_water[] = +static const char cite_aip_water[] = "ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464\n" "@Article{Feng2023\n" " author = {Z. Feng, Y. Yao, J. Liu, B. Wu, Z. Liu, and W. Ouyang},\n" @@ -53,26 +53,26 @@ static const char cite_ilp_water[] = /* ---------------------------------------------------------------------- */ -PairILPWATER2DM::PairILPWATER2DM(LAMMPS *lmp) : PairILPGrapheneHBN(lmp), PairILPTMD(lmp) +PairAIPWATER2DM::PairAIPWATER2DM(LAMMPS *lmp) : PairILPGrapheneHBN(lmp), PairILPTMD(lmp) { - variant = ILP_WATER_2DM; + variant = AIP_WATER_2DM; single_enable = 0; // for TMD, each atom have six neighbors Nnei = 6; - if (lmp->citeme) lmp->citeme->add(cite_ilp_water); + if (lmp->citeme) lmp->citeme->add(cite_aip_water); } /* ---------------------------------------------------------------------- global settings ------------------------------------------------------------------------- */ -void PairILPWATER2DM::settings(int narg, char **arg) +void PairAIPWATER2DM::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR, "Illegal pair_style command"); if (!utils::strmatch(force->pair_style, "^hybrid/overlay")) - error->all(FLERR, "Pair style ilp/water/2dm must be used as sub-style with hybrid/overlay"); + error->all(FLERR, "Pair style aip/water/2dm must be used as sub-style with hybrid/overlay"); cut_global = utils::numeric(FLERR, arg[0], false, lmp); if (narg == 2) tap_flag = utils::numeric(FLERR, arg[1], false, lmp); diff --git a/src/INTERLAYER/pair_aip_water_2dm.h b/src/INTERLAYER/pair_aip_water_2dm.h index fad9f99ff1..295cdfffb9 100644 --- a/src/INTERLAYER/pair_aip_water_2dm.h +++ b/src/INTERLAYER/pair_aip_water_2dm.h @@ -13,33 +13,24 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(ilp/water/2dm,PairILPWATER2DM); +PairStyle(aip/water/2dm,PairAIPWATER2DM); // clang-format on #else -#ifndef LMP_PAIR_ILP_WATER_2DM_H -#define LMP_PAIR_ILP_WATER_2DM_H +#ifndef LMP_PAIR_AIP_WATER_2DM_H +#define LMP_PAIR_AIP_WATER_2DM_H #include "pair_ilp_tmd.h" namespace LAMMPS_NS { -class PairILPWATER2DM : virtual public PairILPTMD { +class PairAIPWATER2DM : virtual public PairILPTMD { public: - PairILPWATER2DM(class LAMMPS *); + PairAIPWATER2DM(class LAMMPS *); protected: void settings(int, char **) override; - /**************************************************************/ - /* modulo operation with cycling around range */ - - inline int modulo(int k, int range) - { - if (k < 0) k += range; - return k % range; - } - /**************************************************************/ }; } // namespace LAMMPS_NS diff --git a/src/OPT/pair_aip_water_2dm_opt.cpp b/src/OPT/pair_aip_water_2dm_opt.cpp index 316551c345..17e981e479 100644 --- a/src/OPT/pair_aip_water_2dm_opt.cpp +++ b/src/OPT/pair_aip_water_2dm_opt.cpp @@ -11,7 +11,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - This is an optimized version of ilp/water/2dm based on the contribution of: + This is an optimized version of aip/water/2dm based on the contribution of: author: Wengen Ouyang (Wuhan University) e-mail: w.g.ouyang at gmail dot com @@ -30,7 +30,7 @@ Potential is described by: [Feng and Ouyang et al, J. Phys. Chem. C 127, 8704-8713 (2023).] */ -#include "pair_ilp_water_2dm_opt.h" +#include "pair_aip_water_2dm_opt.h" #include "atom.h" #include "citeme.h" @@ -49,15 +49,15 @@ using namespace LAMMPS_NS; using namespace InterLayer; -PairILPWATER2DMOpt::PairILPWATER2DMOpt(LAMMPS *lmp) : - PairILPGrapheneHBN(lmp), PairILPTMD(lmp), PairILPWATER2DM(lmp), PairILPGrapheneHBNOpt(lmp) +PairAIPWATER2DMOpt::PairAIPWATER2DMOpt(LAMMPS *lmp) : + PairILPGrapheneHBN(lmp), PairILPTMD(lmp), PairAIPWATER2DM(lmp), PairILPGrapheneHBNOpt(lmp) { } -void PairILPWATER2DMOpt::coeff(int narg, char **args) +void PairAIPWATER2DMOpt::coeff(int narg, char **args) { PairILPTMD::coeff(narg, args); - memory->create(special_type, atom->ntypes + 1, "PairILPWATER2DMOpt:check_sublayer"); + memory->create(special_type, atom->ntypes + 1, "PairAIPWATER2DMOpt:check_sublayer"); for (int i = 1; i <= atom->ntypes; i++) { int itype = map[i]; if (strcmp(elements[itype], "Mo") == 0 || strcmp(elements[itype], "W") == 0 || diff --git a/src/OPT/pair_aip_water_2dm_opt.h b/src/OPT/pair_aip_water_2dm_opt.h index 8062de880a..46280c2b82 100644 --- a/src/OPT/pair_aip_water_2dm_opt.h +++ b/src/OPT/pair_aip_water_2dm_opt.h @@ -13,21 +13,21 @@ #ifdef PAIR_CLASS // clang-format off -PairStyle(ilp/water/2dm/opt,PairILPWATER2DMOpt); +PairStyle(aip/water/2dm/opt,PairAIPWATER2DMOpt); // clang-format on #else -#ifndef LMP_PAIR_ILP_WATER_2DM_OPT_H -#define LMP_PAIR_ILP_WATER_2DM_OPT_H +#ifndef LMP_PAIR_AIP_WATER_2DM_OPT_H +#define LMP_PAIR_AIP_WATER_2DM_OPT_H #include "pair_ilp_graphene_hbn_opt.h" -#include "pair_ilp_water_2dm.h" +#include "pair_aip_water_2dm.h" namespace LAMMPS_NS { -class PairILPWATER2DMOpt : public PairILPWATER2DM, public PairILPGrapheneHBNOpt { +class PairAIPWATER2DMOpt : public PairAIPWATER2DM, public PairILPGrapheneHBNOpt { public: - PairILPWATER2DMOpt(class LAMMPS *); + PairAIPWATER2DMOpt(class LAMMPS *); void coeff(int narg, char **args) override; protected: From a40b87b05c1e278b2c836c5d131d8b2a1603cd67 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sat, 3 Jun 2023 22:46:33 +0800 Subject: [PATCH 120/172] rename potential files --- potentials/{COH.DMC.ILP => COH.DMC.aip.water.2dm} | 6 +++--- potentials/{COH.ILP => COH.aip.water.2dm} | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename potentials/{COH.DMC.ILP => COH.DMC.aip.water.2dm} (91%) mode change 100755 => 100644 rename potentials/{COH.ILP => COH.aip.water.2dm} (94%) mode change 100755 => 100644 diff --git a/potentials/COH.DMC.ILP b/potentials/COH.DMC.aip.water.2dm old mode 100755 new mode 100644 similarity index 91% rename from potentials/COH.DMC.ILP rename to potentials/COH.DMC.aip.water.2dm index 7235afcdab..f3619dd3f1 --- a/potentials/COH.DMC.ILP +++ b/potentials/COH.DMC.aip.water.2dm @@ -1,5 +1,5 @@ -# DATE: 2023-05-18 UNITS: metal CONTRIBUTOR: Wengen Ouyang w.g.ouyang@gmail.com CITATION: Z. Feng, ..., and W. Ouyang, J. Phys. Chem. C 127, 8704 (2023). -# Interlayer Potential (ILP) for water/graphene heterojunctions +# DATE: 2022-12-02 UNITS: metal CONTRIBUTOR: Wengen Ouyang w.g.ouyang@gmail.com CITATION: Z. Feng, ..., and W. Ouyang, J. Phys. Chem. C 127, 8704 (2023). +# Anisotropic Interfacial Potential (AIP) parameters for water/graphene heterojunctions # The parameters below are fitted against the DMC reference data that rescaled from PBE+MBD-NL. # # ----------------- Repulsion Potential ------------------++++++++++++++ Vdw Potential ++++++++++++++++************ @@ -25,4 +25,4 @@ Hw H 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.232494 Ow Ow 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 Hw Hw 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 Ow Hw 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 -Hw Ow 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 \ No newline at end of file +Hw Ow 5.45369612 6.18172364 1.25025450 0.00000000 0.00000000 9.05706482 1.23249498 2.77577173 0.00000000 1.0 1.2 diff --git a/potentials/COH.ILP b/potentials/COH.aip.water.2dm old mode 100755 new mode 100644 similarity index 94% rename from potentials/COH.ILP rename to potentials/COH.aip.water.2dm index bd815b5c00..5325399abe --- a/potentials/COH.ILP +++ b/potentials/COH.aip.water.2dm @@ -1,5 +1,5 @@ -# DATE: 2023-05-18 UNITS: metal CONTRIBUTOR: Wengen Ouyang w.g.ouyang@gmail.com CITATION: Z. Feng, ..., and W. Ouyang, J. Phys. Chem. C 127, 8704 (2023). -# Interlayer Potential (ILP) for water/graphene heterojunctions +# DATE: 2022-12-02 UNITS: metal CONTRIBUTOR: Wengen Ouyang w.g.ouyang@gmail.com CITATION: Z. Feng, ..., and W. Ouyang, J. Phys. Chem. C 127, 8704 (2023). +# Anisotropic Interfacial Potential (AIP) parameters for water/graphene heterojunctions # The parameters below are fitted against the PBE + MBD-NL DFT reference data from 2.5 A to 15 A. # # ----------------- Repulsion Potential ------------------++++++++++++++ Vdw Potential ++++++++++++++++************ From f507e30d3698a44103b6acc404d20aa484a977ea Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sat, 3 Jun 2023 22:52:45 +0800 Subject: [PATCH 121/172] update input files of examples --- .../aip_water_2dm/COH.aip.water.2dm | 1 + .../gra_water.data | 0 .../in.gr_water | 22 +++++++++---------- .../in.gr_water.opt | 22 +++++++++---------- .../log.18May23.water.g++.1 | 0 .../log.18May23.water.g++.4 | 0 .../log.18May23.water.opt.g++.1 | 0 .../log.18May23.water.opt.g++.4 | 0 .../PACKAGES/interlayer/ilp_water_2dm/COH.ILP | 1 - 9 files changed, 23 insertions(+), 23 deletions(-) create mode 120000 examples/PACKAGES/interlayer/aip_water_2dm/COH.aip.water.2dm rename examples/PACKAGES/interlayer/{ilp_water_2dm => aip_water_2dm}/gra_water.data (100%) rename examples/PACKAGES/interlayer/{ilp_water_2dm => aip_water_2dm}/in.gr_water (73%) rename examples/PACKAGES/interlayer/{ilp_water_2dm => aip_water_2dm}/in.gr_water.opt (73%) rename examples/PACKAGES/interlayer/{ilp_water_2dm => aip_water_2dm}/log.18May23.water.g++.1 (100%) rename examples/PACKAGES/interlayer/{ilp_water_2dm => aip_water_2dm}/log.18May23.water.g++.4 (100%) rename examples/PACKAGES/interlayer/{ilp_water_2dm => aip_water_2dm}/log.18May23.water.opt.g++.1 (100%) rename examples/PACKAGES/interlayer/{ilp_water_2dm => aip_water_2dm}/log.18May23.water.opt.g++.4 (100%) delete mode 120000 examples/PACKAGES/interlayer/ilp_water_2dm/COH.ILP diff --git a/examples/PACKAGES/interlayer/aip_water_2dm/COH.aip.water.2dm b/examples/PACKAGES/interlayer/aip_water_2dm/COH.aip.water.2dm new file mode 120000 index 0000000000..fe5cccfcd2 --- /dev/null +++ b/examples/PACKAGES/interlayer/aip_water_2dm/COH.aip.water.2dm @@ -0,0 +1 @@ +../../../../potentials/COH.aip.water.2dm \ No newline at end of file diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/gra_water.data b/examples/PACKAGES/interlayer/aip_water_2dm/gra_water.data similarity index 100% rename from examples/PACKAGES/interlayer/ilp_water_2dm/gra_water.data rename to examples/PACKAGES/interlayer/aip_water_2dm/gra_water.data diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water b/examples/PACKAGES/interlayer/aip_water_2dm/in.gr_water similarity index 73% rename from examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water rename to examples/PACKAGES/interlayer/aip_water_2dm/in.gr_water index 9fccbf733b..9f8e717a7e 100644 --- a/examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water +++ b/examples/PACKAGES/interlayer/aip_water_2dm/in.gr_water @@ -12,13 +12,13 @@ group gr molecule 1 group water molecule 2 ######################## Potential defition ############################## # Interlayer potential -pair_style hybrid/overlay ilp/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +pair_style hybrid/overlay aip/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 #################################################################### pair_coeff 1 1 none -pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H -pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H -pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw # C-water +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * aip/water/2dm COH.aip.water.2dm C Ow Hw # C-H2O # bond and angle bond_style harmonic bond_coeff 1 0.0 0.9572 @@ -32,7 +32,7 @@ neigh_modify every 1 delay 5 check yes page 1000000 one 100000 #################################################################### # Calculate pair energy compute 1 all pair lj/cut/tip4p/long -compute 2 all pair ilp/water/2dm +compute 2 all pair aip/water/2dm compute wt water temp variable TIP4P equal c_1 variable EILP equal c_2 # total interlayer energy @@ -42,10 +42,10 @@ thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt thermo 100 thermo_modify lost error -fix subf gr setforce 0.0 0.0 0.0 -fix 1 water shake 0.0001 20 100 b 1 a 1 +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 -timestep 1e-3 -velocity water create 300.0 12345 dist gaussian mom yes rot yes -fix 2 water nve -run 1000 +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water.opt b/examples/PACKAGES/interlayer/aip_water_2dm/in.gr_water.opt similarity index 73% rename from examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water.opt rename to examples/PACKAGES/interlayer/aip_water_2dm/in.gr_water.opt index 1b38ab6e6e..8494bfcb3e 100644 --- a/examples/PACKAGES/interlayer/ilp_water_2dm/in.gr_water.opt +++ b/examples/PACKAGES/interlayer/aip_water_2dm/in.gr_water.opt @@ -12,13 +12,13 @@ group gr molecule 1 group water molecule 2 ######################## Potential defition ############################## # Interlayer potential -pair_style hybrid/overlay ilp/water/2dm/opt 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +pair_style hybrid/overlay aip/water/2dm/opt 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 #################################################################### pair_coeff 1 1 none -pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H -pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H -pair_coeff * * ilp/water/2dm/opt COH.ILP C Ow Hw # C-water +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * aip/water/2dm/opt COH.aip.water.2dm C Ow Hw # C-H2O # bond and angle bond_style harmonic bond_coeff 1 0.0 0.9572 @@ -32,7 +32,7 @@ neigh_modify every 1 delay 5 check yes page 1000000 one 100000 #################################################################### # Calculate pair energy compute 1 all pair lj/cut/tip4p/long -compute 2 all pair ilp/water/2dm/opt +compute 2 all pair aip/water/2dm/opt compute wt water temp variable TIP4P equal c_1 variable EILP equal c_2 # total interlayer energy @@ -42,10 +42,10 @@ thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt thermo 100 thermo_modify lost error -fix subf gr setforce 0.0 0.0 0.0 -fix 1 water shake 0.0001 20 100 b 1 a 1 +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 -timestep 1e-3 -velocity water create 300.0 12345 dist gaussian mom yes rot yes -fix 2 water nve -run 1000 +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.1 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.g++.1 similarity index 100% rename from examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.1 rename to examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.g++.1 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.4 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.g++.4 similarity index 100% rename from examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.g++.4 rename to examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.g++.4 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.1 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.opt.g++.1 similarity index 100% rename from examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.1 rename to examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.opt.g++.1 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.4 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.opt.g++.4 similarity index 100% rename from examples/PACKAGES/interlayer/ilp_water_2dm/log.18May23.water.opt.g++.4 rename to examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.opt.g++.4 diff --git a/examples/PACKAGES/interlayer/ilp_water_2dm/COH.ILP b/examples/PACKAGES/interlayer/ilp_water_2dm/COH.ILP deleted file mode 120000 index 526995dae4..0000000000 --- a/examples/PACKAGES/interlayer/ilp_water_2dm/COH.ILP +++ /dev/null @@ -1 +0,0 @@ -../../../../potentials/COH.ILP \ No newline at end of file From 63f3d183fe57cd035e8989c1df9f28f56d414c1e Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sat, 3 Jun 2023 23:02:45 +0800 Subject: [PATCH 122/172] rename log files of examples --- .../{log.18May23.water.g++.1 => log.18May23.gr_water.g++.1} | 0 .../{log.18May23.water.g++.4 => log.18May23.gr_water.g++.4} | 0 ...log.18May23.water.opt.g++.1 => log.18May23.gr_water.opt.g++.1} | 0 ...log.18May23.water.opt.g++.4 => log.18May23.gr_water.opt.g++.4} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename examples/PACKAGES/interlayer/aip_water_2dm/{log.18May23.water.g++.1 => log.18May23.gr_water.g++.1} (100%) rename examples/PACKAGES/interlayer/aip_water_2dm/{log.18May23.water.g++.4 => log.18May23.gr_water.g++.4} (100%) rename examples/PACKAGES/interlayer/aip_water_2dm/{log.18May23.water.opt.g++.1 => log.18May23.gr_water.opt.g++.1} (100%) rename examples/PACKAGES/interlayer/aip_water_2dm/{log.18May23.water.opt.g++.4 => log.18May23.gr_water.opt.g++.4} (100%) diff --git a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.g++.1 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.1 similarity index 100% rename from examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.g++.1 rename to examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.1 diff --git a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.g++.4 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.4 similarity index 100% rename from examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.g++.4 rename to examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.4 diff --git a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.opt.g++.1 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.1 similarity index 100% rename from examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.opt.g++.1 rename to examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.1 diff --git a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.opt.g++.4 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.4 similarity index 100% rename from examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.water.opt.g++.4 rename to examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.4 From b5ab173763f7c6941c6f6b994f541ef3e9750017 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sat, 3 Jun 2023 23:03:12 +0800 Subject: [PATCH 123/172] update the doc file --- doc/src/pair_aip_water_2dm.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/src/pair_aip_water_2dm.rst b/doc/src/pair_aip_water_2dm.rst index 6a364f38ed..517cc00f4b 100644 --- a/doc/src/pair_aip_water_2dm.rst +++ b/doc/src/pair_aip_water_2dm.rst @@ -1,17 +1,17 @@ -.. index:: pair_style ilp/water/2dm -.. index:: pair_style ilp/water/2dm/opt +.. index:: pair_style aip/water/2dm +.. index:: pair_style aip/water/2dm/opt pair_style ilp/tmd command =================================== -Accelerator Variant: *ilp/water/2dm/opt* +Accelerator Variant: *aip/water/2dm/opt* Syntax """""" .. code-block:: LAMMPS - pair_style [hybrid/overlay ...] ilp/tmd cutoff tap_flag + pair_style [hybrid/overlay ...] aip/water/2dm cutoff tap_flag * cutoff = global cutoff (distance units) * tap_flag = 0/1 to turn off/on the taper function @@ -21,22 +21,22 @@ Examples .. code-block:: LAMMPS - pair_style hybrid/overlay ilp/water/2dm 16.0 1 - pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw + pair_style hybrid/overlay aip/water/2dm 16.0 1 + pair_coeff * * aip/water/2dm COH.aip.water.2dm C Ow Hw - pair_style hybrid/overlay ilp/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 + pair_style hybrid/overlay aip/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H - pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw + pair_coeff * * aip/water/2dm COH.aip.water.2dm C Ow Hw Description """"""""""" .. versionadded:: xxxx2023 -The *ilp/water/2dm* style computes the registry-dependent interlayer -potential (ILP) potential for interfaces of water with two-dimensinal (2D) +The *aip/water/2dm* style computes the anisotropic interfacial +potential (AIP) potential for interfaces of water with two-dimensinal (2D) materials as described in :ref:`(Feng) `. .. math:: @@ -69,7 +69,7 @@ calculating the normals. oxygen-hydrogen bonds and the normal vector of the central oxygen atom is defined as their average. -The parameter file (e.g. COH.ILP), is intended for use with *metal* +The parameter file (e.g. COH.aip.water.2dm), is intended for use with *metal* :doc:`units `, with energies in meV. Two additional parameters, *S*, and *rcut* are included in the parameter file. *S* is designed to facilitate scaling of energies. *rcut* is designed to build the neighbor @@ -77,7 +77,7 @@ list for calculating the normals for each atom pair. .. note:: - The parameters presented in the parameter file (e.g. COH.ILP), + The parameters presented in the parameter file (e.g. COH.aip.water.2dm), are fitted with taper function by setting the cutoff equal to 16.0 Angstrom. Using different cutoff or taper function should be careful. These parameters provide a good description in both short- and long-range @@ -100,7 +100,7 @@ headings) the following commands could be included in an input script: .. code-block:: LAMMPS - compute 0 all pair ilp/water/2dm + compute 0 all pair aip/water/2dm variable Evdw equal c_0[1] variable Erep equal c_0[2] thermo_style custom step temp epair v_Erep v_Evdw @@ -132,10 +132,10 @@ if LAMMPS was built with that package. See the :doc:`Build package This pair style requires the newton setting to be *on* for pair interactions. -The COH.ILP potential file provided with LAMMPS (see the potentials +The COH.aip.water.2dm potential file provided with LAMMPS (see the potentials directory) are parameterized for *metal* units. You can use this potential with any LAMMPS units, but you would need to create your -COH.ILP potential file with coefficients listed in the appropriate +COH.aip.water.2dm potential file with coefficients listed in the appropriate units, if your simulation does not use *metal* units. Related commands From 196641927f6973ac76eca00b78b718a0f67cc925 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sat, 3 Jun 2023 23:07:55 +0800 Subject: [PATCH 124/172] correct a typo in the doc file --- doc/src/pair_aip_water_2dm.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/pair_aip_water_2dm.rst b/doc/src/pair_aip_water_2dm.rst index 517cc00f4b..3ae63e1e45 100644 --- a/doc/src/pair_aip_water_2dm.rst +++ b/doc/src/pair_aip_water_2dm.rst @@ -1,7 +1,7 @@ .. index:: pair_style aip/water/2dm .. index:: pair_style aip/water/2dm/opt -pair_style ilp/tmd command +pair_style aip/water/2dm command =================================== Accelerator Variant: *aip/water/2dm/opt* From bf8a4402cef5d2b9da6c0ffcc0c93e4f03ec0932 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sun, 4 Jun 2023 10:17:21 +0800 Subject: [PATCH 125/172] update log files in the examples --- .../aip_water_2dm/log.18May23.gr_water.g++.1 | 83 ++++++++++--------- .../aip_water_2dm/log.18May23.gr_water.g++.4 | 81 +++++++++--------- .../log.18May23.gr_water.opt.g++.1 | 83 ++++++++++--------- .../log.18May23.gr_water.opt.g++.4 | 81 +++++++++--------- 4 files changed, 174 insertions(+), 154 deletions(-) diff --git a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.1 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.1 index 6e13280f70..c8268c72f6 100644 --- a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.1 +++ b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.1 @@ -1,4 +1,4 @@ -LAMMPS (23 Jun 2022) +LAMMPS (23 Jun 2022 - Update 4) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:98) using 1 OpenMP thread(s) per MPI task # Initialization @@ -29,8 +29,8 @@ Finding 1-2 1-3 1-4 neighbors ... 1 = max # of 1-3 neighbors 1 = max # of 1-4 neighbors 2 = max # of special neighbors - special bonds CPU = 0.005 seconds - read_data CPU = 0.020 seconds + special bonds CPU = 0.000 seconds + read_data CPU = 0.012 seconds mass 1 12.0107 # carbon mass (g/mole) mass 2 15.9994 # oxygen mass (g/mole) mass 3 1.008 # hydrogen mass (g/mole) @@ -41,14 +41,14 @@ group water molecule 2 144 atoms in group water ######################## Potential defition ############################## # Interlayer potential -pair_style hybrid/overlay ilp/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +pair_style hybrid/overlay aip/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 #################################################################### pair_coeff 1 1 none -pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H -pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H -pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw # C-water -Reading ilp/water/2dm potential file COH.ILP with DATE: 2023-05-17 +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * aip/water/2dm COH.aip.water.2dm C Ow Hw # C-H2O +Reading aip/water/2dm potential file COH.aip.water.2dm with DATE: 2022-12-02 # bond and angle bond_style harmonic bond_coeff 1 0.0 0.9572 @@ -62,7 +62,7 @@ neigh_modify every 1 delay 5 check yes page 1000000 one 100000 #################################################################### # Calculate pair energy compute 1 all pair lj/cut/tip4p/long -compute 2 all pair ilp/water/2dm +compute 2 all pair aip/water/2dm compute wt water temp variable TIP4P equal c_1 variable EILP equal c_2 # total interlayer energy @@ -72,18 +72,18 @@ thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt thermo 100 thermo_modify lost error -fix subf gr setforce 0.0 0.0 0.0 -fix 1 water shake 0.0001 20 100 b 1 a 1 +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 0 = # of size 2 clusters 0 = # of size 3 clusters 0 = # of size 4 clusters 48 = # of frozen angles - find clusters CPU = 0.001 seconds + find clusters CPU = 0.000 seconds -timestep 1e-3 -velocity water create 300.0 12345 dist gaussian mom yes rot yes -fix 2 water nve -run 1000 +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE @@ -91,22 +91,24 @@ Your simulation uses code contributions which should be cited: - ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848 @Article{Ouyang2018 - author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod}, + author = {W. Ouyang and D. Mandelli and M. Urbakh and O. Hod}, title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials}, journal = {Nano Letters}, volume = 18, - pages = {6009} + pages = 6009, year = 2018, } -- ilp/tmd potential doi/10.1021/acs.jctc.1c00782 +- ilp/tmd potential doi:10.1021/acs.jctc.1c00782 @Article{Ouyang2021 - author = {W. Ouyang, R. Sofer, X. Gao, J. Hermann, A. Tkatchenko, L. Kronik, M. Urbakh, and O. Hod}, - title = {Anisotropic Interlayer Force Field for Transition Metal Dichalcogenides: The Case of Molybdenum Disulfide}, - journal = {J. Chem. Theory Comput.}, - volume = 17, - pages = {7237–7245} - year = 2021, + author = {W. Ouyang and R. Sofer and X. Gao and J. Hermann and + A. Tkatchenko and L. Kronik and M. Urbakh and O. Hod}, + title = {Anisotropic Interlayer Force Field for Transition + Metal Dichalcogenides: The Case of Molybdenum Disulfide}, + journal = {J.~Chem.\ Theory Comput.}, + volume = 17, + pages = {7237--7245} + year = 2021, } - ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464 @@ -132,6 +134,8 @@ PPPM initialization ... using single precision MKL FFT 3d grid and FFT values/proc = 84320 48000 WARNING: Using a manybody potential with bonds/angles/dihedrals and special_bond exclusions (../pair.cpp:239) +WARNING: Communication cutoff 0 is shorter than a bond length based estimate of 3.4358. This may lead to errors. (../comm.cpp:727) +WARNING: Increasing communication cutoff to 11.6118 for TIP4P pair style (../pair_lj_cut_tip4p_long.cpp:484) Neighbor list info ... update every 1 steps, delay 5 steps, check yes max neighbors/atom: 100000, page size: 1000000 @@ -139,7 +143,7 @@ Neighbor list info ... ghost atom cutoff = 18 binsize = 9, bins = 6 5 23 3 neighbor lists, perpetual/occasional/extra = 3 0 0 - (1) pair ilp/water/2dm, perpetual + (1) pair aip/water/2dm, perpetual attributes: full, newton on, ghost pair build: full/bin/ghost stencil: full/ghost/bin/3d @@ -154,10 +158,11 @@ Neighbor list info ... pair build: half/bin/newton stencil: half/bin/3d bin: standard +WARNING: Communication cutoff adjusted to 18 (../comm.cpp:736) SHAKE stats (type/ave/delta/count) on step 0 Bond: 1 0.957201 2.19705e-06 96 Angle: 1 104.52 0.000203056 48 -Per MPI rank memory allocation (min/avg/max) = 33.53 | 33.53 | 33.53 Mbytes +Per MPI rank memory allocation (min/avg/max) = 32.9 | 32.9 | 32.9 Mbytes Step TotEng PotEng KinEng v_TIP4P v_EILP v_temp_wt 0 -16.131263 -19.815178 3.6839141 189.37246 -1.903543 300 SHAKE stats (type/ave/delta/count) on step 100 @@ -200,22 +205,22 @@ SHAKE stats (type/ave/delta/count) on step 1000 Bond: 1 0.9572 1.00586e-06 96 Angle: 1 104.52 0.000111712 48 1000 -17.498465 -20.331545 2.8330804 188.87473 -1.812177 230.71225 -Loop time of 20.801 on 1 procs for 1000 steps with 936 atoms +Loop time of 20.3334 on 1 procs for 1000 steps with 936 atoms -Performance: 4.154 ns/day, 5.778 hours/ns, 48.075 timesteps/s -99.9% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 4.249 ns/day, 5.648 hours/ns, 49.180 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 | 16.429 | 16.429 | 16.429 | 0.0 | 78.98 -Bond | 0.0010991 | 0.0010991 | 0.0010991 | 0.0 | 0.01 -Kspace | 3.4769 | 3.4769 | 3.4769 | 0.0 | 16.72 -Neigh | 0.83359 | 0.83359 | 0.83359 | 0.0 | 4.01 -Comm | 0.028825 | 0.028825 | 0.028825 | 0.0 | 0.14 -Output | 0.00046349 | 0.00046349 | 0.00046349 | 0.0 | 0.00 -Modify | 0.01943 | 0.01943 | 0.01943 | 0.0 | 0.09 -Other | | 0.01154 | | | 0.06 +Pair | 16.179 | 16.179 | 16.179 | 0.0 | 79.57 +Bond | 0.00021103 | 0.00021103 | 0.00021103 | 0.0 | 0.00 +Kspace | 3.3118 | 3.3118 | 3.3118 | 0.0 | 16.29 +Neigh | 0.79017 | 0.79017 | 0.79017 | 0.0 | 3.89 +Comm | 0.026379 | 0.026379 | 0.026379 | 0.0 | 0.13 +Output | 0.00046496 | 0.00046496 | 0.00046496 | 0.0 | 0.00 +Modify | 0.017013 | 0.017013 | 0.017013 | 0.0 | 0.08 +Other | | 0.008835 | | | 0.04 Nlocal: 936 ave 936 max 936 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -231,4 +236,4 @@ Ave neighs/atom = 460.87821 Ave special neighs/atom = 0.30769231 Neighbor list builds = 28 Dangerous builds = 0 -Total wall time: 0:00:21 +Total wall time: 0:00:20 diff --git a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.4 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.4 index 078ca76e2e..ab28c96657 100644 --- a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.4 +++ b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.g++.4 @@ -1,4 +1,4 @@ -LAMMPS (23 Jun 2022) +LAMMPS (23 Jun 2022 - Update 4) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:98) using 1 OpenMP thread(s) per MPI task # Initialization @@ -29,8 +29,8 @@ Finding 1-2 1-3 1-4 neighbors ... 1 = max # of 1-3 neighbors 1 = max # of 1-4 neighbors 2 = max # of special neighbors - special bonds CPU = 0.003 seconds - read_data CPU = 0.018 seconds + special bonds CPU = 0.001 seconds + read_data CPU = 0.017 seconds mass 1 12.0107 # carbon mass (g/mole) mass 2 15.9994 # oxygen mass (g/mole) mass 3 1.008 # hydrogen mass (g/mole) @@ -41,14 +41,14 @@ group water molecule 2 144 atoms in group water ######################## Potential defition ############################## # Interlayer potential -pair_style hybrid/overlay ilp/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +pair_style hybrid/overlay aip/water/2dm 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 #################################################################### pair_coeff 1 1 none -pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H -pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H -pair_coeff * * ilp/water/2dm COH.ILP C Ow Hw # C-water -Reading ilp/water/2dm potential file COH.ILP with DATE: 2023-05-17 +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * aip/water/2dm COH.aip.water.2dm C Ow Hw # C-H2O +Reading aip/water/2dm potential file COH.aip.water.2dm with DATE: 2022-12-02 # bond and angle bond_style harmonic bond_coeff 1 0.0 0.9572 @@ -62,7 +62,7 @@ neigh_modify every 1 delay 5 check yes page 1000000 one 100000 #################################################################### # Calculate pair energy compute 1 all pair lj/cut/tip4p/long -compute 2 all pair ilp/water/2dm +compute 2 all pair aip/water/2dm compute wt water temp variable TIP4P equal c_1 variable EILP equal c_2 # total interlayer energy @@ -72,18 +72,18 @@ thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt thermo 100 thermo_modify lost error -fix subf gr setforce 0.0 0.0 0.0 -fix 1 water shake 0.0001 20 100 b 1 a 1 +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 0 = # of size 2 clusters 0 = # of size 3 clusters 0 = # of size 4 clusters 48 = # of frozen angles - find clusters CPU = 0.001 seconds + find clusters CPU = 0.000 seconds -timestep 1e-3 -velocity water create 300.0 12345 dist gaussian mom yes rot yes -fix 2 water nve -run 1000 +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE @@ -91,22 +91,24 @@ Your simulation uses code contributions which should be cited: - ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848 @Article{Ouyang2018 - author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod}, + author = {W. Ouyang and D. Mandelli and M. Urbakh and O. Hod}, title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials}, journal = {Nano Letters}, volume = 18, - pages = {6009} + pages = 6009, year = 2018, } -- ilp/tmd potential doi/10.1021/acs.jctc.1c00782 +- ilp/tmd potential doi:10.1021/acs.jctc.1c00782 @Article{Ouyang2021 - author = {W. Ouyang, R. Sofer, X. Gao, J. Hermann, A. Tkatchenko, L. Kronik, M. Urbakh, and O. Hod}, - title = {Anisotropic Interlayer Force Field for Transition Metal Dichalcogenides: The Case of Molybdenum Disulfide}, - journal = {J. Chem. Theory Comput.}, - volume = 17, - pages = {7237–7245} - year = 2021, + author = {W. Ouyang and R. Sofer and X. Gao and J. Hermann and + A. Tkatchenko and L. Kronik and M. Urbakh and O. Hod}, + title = {Anisotropic Interlayer Force Field for Transition + Metal Dichalcogenides: The Case of Molybdenum Disulfide}, + journal = {J.~Chem.\ Theory Comput.}, + volume = 17, + pages = {7237--7245} + year = 2021, } - ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464 @@ -132,6 +134,8 @@ PPPM initialization ... using single precision MKL FFT 3d grid and FFT values/proc = 30685 12480 WARNING: Using a manybody potential with bonds/angles/dihedrals and special_bond exclusions (../pair.cpp:239) +WARNING: Communication cutoff 0 is shorter than a bond length based estimate of 3.4358. This may lead to errors. (../comm.cpp:727) +WARNING: Increasing communication cutoff to 11.6118 for TIP4P pair style (../pair_lj_cut_tip4p_long.cpp:484) Neighbor list info ... update every 1 steps, delay 5 steps, check yes max neighbors/atom: 100000, page size: 1000000 @@ -139,7 +143,7 @@ Neighbor list info ... ghost atom cutoff = 18 binsize = 9, bins = 6 5 23 3 neighbor lists, perpetual/occasional/extra = 3 0 0 - (1) pair ilp/water/2dm, perpetual + (1) pair aip/water/2dm, perpetual attributes: full, newton on, ghost pair build: full/bin/ghost stencil: full/ghost/bin/3d @@ -154,10 +158,11 @@ Neighbor list info ... pair build: half/bin/newton stencil: half/bin/3d bin: standard +WARNING: Communication cutoff adjusted to 18 (../comm.cpp:736) SHAKE stats (type/ave/delta/count) on step 0 Bond: 1 0.957201 2.19705e-06 96 Angle: 1 104.52 0.000203056 48 -Per MPI rank memory allocation (min/avg/max) = 25.84 | 25.88 | 25.92 Mbytes +Per MPI rank memory allocation (min/avg/max) = 25.22 | 25.25 | 25.29 Mbytes Step TotEng PotEng KinEng v_TIP4P v_EILP v_temp_wt 0 -16.131263 -19.815178 3.6839141 189.37246 -1.903543 300 SHAKE stats (type/ave/delta/count) on step 100 @@ -200,22 +205,22 @@ SHAKE stats (type/ave/delta/count) on step 1000 Bond: 1 0.9572 1.00568e-06 96 Angle: 1 104.52 0.000111707 48 1000 -17.498474 -20.331607 2.833133 188.87466 -1.8121689 230.71654 -Loop time of 9.42273 on 4 procs for 1000 steps with 936 atoms +Loop time of 9.05361 on 4 procs for 1000 steps with 936 atoms -Performance: 9.169 ns/day, 2.617 hours/ns, 106.126 timesteps/s -97.1% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 9.543 ns/day, 2.515 hours/ns, 110.453 timesteps/s +99.6% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.2328 | 4.3228 | 7.5931 | 103.1 | 45.88 -Bond | 0.00084131 | 0.00088983 | 0.00095229 | 0.0 | 0.01 -Kspace | 1.3979 | 4.6476 | 6.7252 | 98.8 | 49.32 -Neigh | 0.34367 | 0.34371 | 0.34376 | 0.0 | 3.65 -Comm | 0.042806 | 0.062908 | 0.075887 | 5.4 | 0.67 -Output | 0.00037677 | 0.00041431 | 0.0004619 | 0.0 | 0.00 -Modify | 0.028432 | 0.031138 | 0.034528 | 1.3 | 0.33 -Other | | 0.01321 | | | 0.14 +Pair | 2.462 | 4.2266 | 7.1075 | 89.3 | 46.68 +Bond | 0.00018424 | 0.00019878 | 0.00022125 | 0.0 | 0.00 +Kspace | 1.4698 | 4.338 | 6.1001 | 87.8 | 47.91 +Neigh | 0.39462 | 0.39489 | 0.39518 | 0.0 | 4.36 +Comm | 0.043753 | 0.055826 | 0.062746 | 3.1 | 0.62 +Output | 0.00048755 | 0.00053971 | 0.00062785 | 0.0 | 0.01 +Modify | 0.027255 | 0.028664 | 0.030278 | 0.7 | 0.32 +Other | | 0.008904 | | | 0.10 Nlocal: 234 ave 302 max 198 min Histogram: 2 0 0 1 0 0 0 0 0 1 diff --git a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.1 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.1 index c6a11d209d..c795e85d56 100644 --- a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.1 +++ b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.1 @@ -1,4 +1,4 @@ -LAMMPS (23 Jun 2022) +LAMMPS (23 Jun 2022 - Update 4) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:98) using 1 OpenMP thread(s) per MPI task # Initialization @@ -29,8 +29,8 @@ Finding 1-2 1-3 1-4 neighbors ... 1 = max # of 1-3 neighbors 1 = max # of 1-4 neighbors 2 = max # of special neighbors - special bonds CPU = 0.005 seconds - read_data CPU = 0.020 seconds + special bonds CPU = 0.000 seconds + read_data CPU = 0.012 seconds mass 1 12.0107 # carbon mass (g/mole) mass 2 15.9994 # oxygen mass (g/mole) mass 3 1.008 # hydrogen mass (g/mole) @@ -41,14 +41,14 @@ group water molecule 2 144 atoms in group water ######################## Potential defition ############################## # Interlayer potential -pair_style hybrid/overlay ilp/water/2dm/opt 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +pair_style hybrid/overlay aip/water/2dm/opt 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 #################################################################### pair_coeff 1 1 none -pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H -pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H -pair_coeff * * ilp/water/2dm/opt COH.ILP C Ow Hw # C-water -Reading ilp/water/2dm potential file COH.ILP with DATE: 2023-05-17 +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * aip/water/2dm/opt COH.aip.water.2dm C Ow Hw # C-H2O +Reading aip/water/2dm potential file COH.aip.water.2dm with DATE: 2022-12-02 # bond and angle bond_style harmonic bond_coeff 1 0.0 0.9572 @@ -62,7 +62,7 @@ neigh_modify every 1 delay 5 check yes page 1000000 one 100000 #################################################################### # Calculate pair energy compute 1 all pair lj/cut/tip4p/long -compute 2 all pair ilp/water/2dm/opt +compute 2 all pair aip/water/2dm/opt compute wt water temp variable TIP4P equal c_1 variable EILP equal c_2 # total interlayer energy @@ -72,18 +72,18 @@ thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt thermo 100 thermo_modify lost error -fix subf gr setforce 0.0 0.0 0.0 -fix 1 water shake 0.0001 20 100 b 1 a 1 +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 0 = # of size 2 clusters 0 = # of size 3 clusters 0 = # of size 4 clusters 48 = # of frozen angles - find clusters CPU = 0.001 seconds + find clusters CPU = 0.000 seconds -timestep 1e-3 -velocity water create 300.0 12345 dist gaussian mom yes rot yes -fix 2 water nve -run 1000 +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE @@ -91,22 +91,24 @@ Your simulation uses code contributions which should be cited: - ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848 @Article{Ouyang2018 - author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod}, + author = {W. Ouyang and D. Mandelli and M. Urbakh and O. Hod}, title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials}, journal = {Nano Letters}, volume = 18, - pages = {6009} + pages = 6009, year = 2018, } -- ilp/tmd potential doi/10.1021/acs.jctc.1c00782 +- ilp/tmd potential doi:10.1021/acs.jctc.1c00782 @Article{Ouyang2021 - author = {W. Ouyang, R. Sofer, X. Gao, J. Hermann, A. Tkatchenko, L. Kronik, M. Urbakh, and O. Hod}, - title = {Anisotropic Interlayer Force Field for Transition Metal Dichalcogenides: The Case of Molybdenum Disulfide}, - journal = {J. Chem. Theory Comput.}, - volume = 17, - pages = {7237–7245} - year = 2021, + author = {W. Ouyang and R. Sofer and X. Gao and J. Hermann and + A. Tkatchenko and L. Kronik and M. Urbakh and O. Hod}, + title = {Anisotropic Interlayer Force Field for Transition + Metal Dichalcogenides: The Case of Molybdenum Disulfide}, + journal = {J.~Chem.\ Theory Comput.}, + volume = 17, + pages = {7237--7245} + year = 2021, } - ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464 @@ -149,6 +151,8 @@ PPPM initialization ... using single precision MKL FFT 3d grid and FFT values/proc = 84320 48000 WARNING: Using a manybody potential with bonds/angles/dihedrals and special_bond exclusions (../pair.cpp:239) +WARNING: Communication cutoff 0 is shorter than a bond length based estimate of 3.4358. This may lead to errors. (../comm.cpp:727) +WARNING: Increasing communication cutoff to 11.6118 for TIP4P pair style (../pair_lj_cut_tip4p_long.cpp:484) Neighbor list info ... update every 1 steps, delay 5 steps, check yes max neighbors/atom: 100000, page size: 1000000 @@ -156,7 +160,7 @@ Neighbor list info ... ghost atom cutoff = 18 binsize = 9, bins = 6 5 23 3 neighbor lists, perpetual/occasional/extra = 3 0 0 - (1) pair ilp/water/2dm/opt, perpetual + (1) pair aip/water/2dm/opt, perpetual attributes: full, newton on pair build: full/bin stencil: full/bin/3d @@ -171,10 +175,11 @@ Neighbor list info ... pair build: halffull/newton stencil: none bin: none +WARNING: Communication cutoff adjusted to 18 (../comm.cpp:736) SHAKE stats (type/ave/delta/count) on step 0 Bond: 1 0.957201 2.19705e-06 96 Angle: 1 104.52 0.000203056 48 -Per MPI rank memory allocation (min/avg/max) = 25.89 | 25.89 | 25.89 Mbytes +Per MPI rank memory allocation (min/avg/max) = 25.27 | 25.27 | 25.27 Mbytes Step TotEng PotEng KinEng v_TIP4P v_EILP v_temp_wt 0 -16.131263 -19.815178 3.6839141 189.37246 -1.903543 300 SHAKE stats (type/ave/delta/count) on step 100 @@ -217,22 +222,22 @@ SHAKE stats (type/ave/delta/count) on step 1000 Bond: 1 0.9572 1.00586e-06 96 Angle: 1 104.52 0.000111711 48 1000 -17.498466 -20.331547 2.8330808 188.87473 -1.8121768 230.71228 -Loop time of 8.95265 on 1 procs for 1000 steps with 936 atoms +Loop time of 8.11929 on 1 procs for 1000 steps with 936 atoms -Performance: 9.651 ns/day, 2.487 hours/ns, 111.699 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 10.641 ns/day, 2.255 hours/ns, 123.163 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 | 5.2127 | 5.2127 | 5.2127 | 0.0 | 58.23 -Bond | 0.00083377 | 0.00083377 | 0.00083377 | 0.0 | 0.01 -Kspace | 3.5005 | 3.5005 | 3.5005 | 0.0 | 39.10 -Neigh | 0.17946 | 0.17946 | 0.17946 | 0.0 | 2.00 -Comm | 0.028553 | 0.028553 | 0.028553 | 0.0 | 0.32 -Output | 0.00035446 | 0.00035446 | 0.00035446 | 0.0 | 0.00 -Modify | 0.01889 | 0.01889 | 0.01889 | 0.0 | 0.21 -Other | | 0.01135 | | | 0.13 +Pair | 4.6849 | 4.6849 | 4.6849 | 0.0 | 57.70 +Bond | 0.00017678 | 0.00017678 | 0.00017678 | 0.0 | 0.00 +Kspace | 3.2098 | 3.2098 | 3.2098 | 0.0 | 39.53 +Neigh | 0.17546 | 0.17546 | 0.17546 | 0.0 | 2.16 +Comm | 0.024693 | 0.024693 | 0.024693 | 0.0 | 0.30 +Output | 0.00037798 | 0.00037798 | 0.00037798 | 0.0 | 0.00 +Modify | 0.015853 | 0.015853 | 0.015853 | 0.0 | 0.20 +Other | | 0.007983 | | | 0.10 Nlocal: 936 ave 936 max 936 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -248,4 +253,4 @@ Ave neighs/atom = 460.87821 Ave special neighs/atom = 0.30769231 Neighbor list builds = 28 Dangerous builds = 0 -Total wall time: 0:00:09 +Total wall time: 0:00:08 diff --git a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.4 b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.4 index 852c429323..f885c5708d 100644 --- a/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.4 +++ b/examples/PACKAGES/interlayer/aip_water_2dm/log.18May23.gr_water.opt.g++.4 @@ -1,4 +1,4 @@ -LAMMPS (23 Jun 2022) +LAMMPS (23 Jun 2022 - Update 4) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:98) using 1 OpenMP thread(s) per MPI task # Initialization @@ -29,8 +29,8 @@ Finding 1-2 1-3 1-4 neighbors ... 1 = max # of 1-3 neighbors 1 = max # of 1-4 neighbors 2 = max # of special neighbors - special bonds CPU = 0.003 seconds - read_data CPU = 0.017 seconds + special bonds CPU = 0.001 seconds + read_data CPU = 0.014 seconds mass 1 12.0107 # carbon mass (g/mole) mass 2 15.9994 # oxygen mass (g/mole) mass 3 1.008 # hydrogen mass (g/mole) @@ -41,14 +41,14 @@ group water molecule 2 144 atoms in group water ######################## Potential defition ############################## # Interlayer potential -pair_style hybrid/overlay ilp/water/2dm/opt 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 +pair_style hybrid/overlay aip/water/2dm/opt 16.0 lj/cut/tip4p/long 2 3 1 1 0.1546 10 8.5 #################################################################### pair_coeff 1 1 none -pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O +pair_coeff 2 2 lj/cut/tip4p/long 8.0313e-3 3.1589 # O-O pair_coeff 2 3 lj/cut/tip4p/long 0.0 0.0 # O-H -pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H -pair_coeff * * ilp/water/2dm/opt COH.ILP C Ow Hw # C-water -Reading ilp/water/2dm potential file COH.ILP with DATE: 2023-05-17 +pair_coeff 3 3 lj/cut/tip4p/long 0.0 0.0 # H-H +pair_coeff * * aip/water/2dm/opt COH.aip.water.2dm C Ow Hw # C-H2O +Reading aip/water/2dm potential file COH.aip.water.2dm with DATE: 2022-12-02 # bond and angle bond_style harmonic bond_coeff 1 0.0 0.9572 @@ -62,7 +62,7 @@ neigh_modify every 1 delay 5 check yes page 1000000 one 100000 #################################################################### # Calculate pair energy compute 1 all pair lj/cut/tip4p/long -compute 2 all pair ilp/water/2dm/opt +compute 2 all pair aip/water/2dm/opt compute wt water temp variable TIP4P equal c_1 variable EILP equal c_2 # total interlayer energy @@ -72,18 +72,18 @@ thermo_style custom step etotal pe ke v_TIP4P v_EILP v_temp_wt thermo 100 thermo_modify lost error -fix subf gr setforce 0.0 0.0 0.0 -fix 1 water shake 0.0001 20 100 b 1 a 1 +fix subf gr setforce 0.0 0.0 0.0 +fix 1 water shake 0.0001 20 100 b 1 a 1 0 = # of size 2 clusters 0 = # of size 3 clusters 0 = # of size 4 clusters 48 = # of frozen angles - find clusters CPU = 0.001 seconds + find clusters CPU = 0.000 seconds -timestep 1e-3 -velocity water create 300.0 12345 dist gaussian mom yes rot yes -fix 2 water nve -run 1000 +timestep 1e-3 +velocity water create 300.0 12345 dist gaussian mom yes rot yes +fix 2 water nve +run 1000 CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE @@ -91,22 +91,24 @@ Your simulation uses code contributions which should be cited: - ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848 @Article{Ouyang2018 - author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod}, + author = {W. Ouyang and D. Mandelli and M. Urbakh and O. Hod}, title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials}, journal = {Nano Letters}, volume = 18, - pages = {6009} + pages = 6009, year = 2018, } -- ilp/tmd potential doi/10.1021/acs.jctc.1c00782 +- ilp/tmd potential doi:10.1021/acs.jctc.1c00782 @Article{Ouyang2021 - author = {W. Ouyang, R. Sofer, X. Gao, J. Hermann, A. Tkatchenko, L. Kronik, M. Urbakh, and O. Hod}, - title = {Anisotropic Interlayer Force Field for Transition Metal Dichalcogenides: The Case of Molybdenum Disulfide}, - journal = {J. Chem. Theory Comput.}, - volume = 17, - pages = {7237–7245} - year = 2021, + author = {W. Ouyang and R. Sofer and X. Gao and J. Hermann and + A. Tkatchenko and L. Kronik and M. Urbakh and O. Hod}, + title = {Anisotropic Interlayer Force Field for Transition + Metal Dichalcogenides: The Case of Molybdenum Disulfide}, + journal = {J.~Chem.\ Theory Comput.}, + volume = 17, + pages = {7237--7245} + year = 2021, } - ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464 @@ -149,6 +151,8 @@ PPPM initialization ... using single precision MKL FFT 3d grid and FFT values/proc = 30685 12480 WARNING: Using a manybody potential with bonds/angles/dihedrals and special_bond exclusions (../pair.cpp:239) +WARNING: Communication cutoff 0 is shorter than a bond length based estimate of 3.4358. This may lead to errors. (../comm.cpp:727) +WARNING: Increasing communication cutoff to 11.6118 for TIP4P pair style (../pair_lj_cut_tip4p_long.cpp:484) Neighbor list info ... update every 1 steps, delay 5 steps, check yes max neighbors/atom: 100000, page size: 1000000 @@ -156,7 +160,7 @@ Neighbor list info ... ghost atom cutoff = 18 binsize = 9, bins = 6 5 23 3 neighbor lists, perpetual/occasional/extra = 3 0 0 - (1) pair ilp/water/2dm/opt, perpetual + (1) pair aip/water/2dm/opt, perpetual attributes: full, newton on pair build: full/bin stencil: full/bin/3d @@ -171,10 +175,11 @@ Neighbor list info ... pair build: halffull/newton stencil: none bin: none +WARNING: Communication cutoff adjusted to 18 (../comm.cpp:736) SHAKE stats (type/ave/delta/count) on step 0 Bond: 1 0.957201 2.19705e-06 96 Angle: 1 104.52 0.000203056 48 -Per MPI rank memory allocation (min/avg/max) = 22.03 | 22.06 | 22.1 Mbytes +Per MPI rank memory allocation (min/avg/max) = 21.4 | 21.44 | 21.48 Mbytes Step TotEng PotEng KinEng v_TIP4P v_EILP v_temp_wt 0 -16.131263 -19.815178 3.6839141 189.37246 -1.903543 300 SHAKE stats (type/ave/delta/count) on step 100 @@ -217,22 +222,22 @@ SHAKE stats (type/ave/delta/count) on step 1000 Bond: 1 0.9572 1.00568e-06 96 Angle: 1 104.52 0.000111707 48 1000 -17.498472 -20.331605 2.8331335 188.87466 -1.8121689 230.71657 -Loop time of 4.7828 on 4 procs for 1000 steps with 936 atoms +Loop time of 4.24862 on 4 procs for 1000 steps with 936 atoms -Performance: 18.065 ns/day, 1.329 hours/ns, 209.082 timesteps/s -96.3% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 20.336 ns/day, 1.180 hours/ns, 235.370 timesteps/s +99.6% 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.26735 | 1.3839 | 3.2059 | 99.7 | 28.93 -Bond | 0.00079377 | 0.00086039 | 0.00093529 | 0.0 | 0.02 -Kspace | 1.4248 | 3.2254 | 4.3332 | 64.6 | 67.44 -Neigh | 0.061885 | 0.061916 | 0.061951 | 0.0 | 1.29 -Comm | 0.044281 | 0.065185 | 0.078628 | 5.1 | 1.36 -Output | 0.0003482 | 0.0003787 | 0.00040746 | 0.0 | 0.01 -Modify | 0.028727 | 0.031529 | 0.034914 | 1.3 | 0.66 -Other | | 0.01367 | | | 0.29 +Pair | 0.25749 | 1.1806 | 2.6872 | 89.0 | 27.79 +Bond | 0.00018656 | 0.00020786 | 0.00025377 | 0.0 | 0.00 +Kspace | 1.4259 | 2.9204 | 3.8414 | 56.3 | 68.74 +Neigh | 0.057504 | 0.057852 | 0.05818 | 0.1 | 1.36 +Comm | 0.041952 | 0.053593 | 0.05876 | 3.0 | 1.26 +Output | 0.0004296 | 0.00046809 | 0.00055317 | 0.0 | 0.01 +Modify | 0.026204 | 0.027251 | 0.028382 | 0.6 | 0.64 +Other | | 0.008209 | | | 0.19 Nlocal: 234 ave 302 max 198 min Histogram: 2 0 0 1 0 0 0 0 0 1 From 3282470cf5b56ae62a0ede29aa8c1519b691d4d3 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Sun, 4 Jun 2023 10:19:13 +0800 Subject: [PATCH 126/172] update the citation information --- src/INTERLAYER/pair_aip_water_2dm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/INTERLAYER/pair_aip_water_2dm.cpp b/src/INTERLAYER/pair_aip_water_2dm.cpp index d88676a6e2..f2d68f448b 100644 --- a/src/INTERLAYER/pair_aip_water_2dm.cpp +++ b/src/INTERLAYER/pair_aip_water_2dm.cpp @@ -41,7 +41,7 @@ using namespace InterLayer; #define PGDELTA 1 static const char cite_aip_water[] = - "ilp/water/2dm potential doi/10.1021/acs.jpcc.2c08464\n" + "aip/water/2dm potential doi/10.1021/acs.jpcc.2c08464\n" "@Article{Feng2023\n" " author = {Z. Feng, Y. Yao, J. Liu, B. Wu, Z. Liu, and W. Ouyang},\n" " title = {Registry-Dependent Potential for Interfaces of Water with Graphene},\n" From a0057d674ff2ef0c7f9e99fb713852f7c1d3ab49 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 4 Jun 2023 13:40:31 +0300 Subject: [PATCH 127/172] Update compute_stress_mop_profile.cpp --- src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp index d299633731..99f522096c 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp @@ -207,9 +207,11 @@ void ComputeStressMopProfile::init() if (force->bond!=nullptr) bondflag = 1; if (force->angle!=nullptr) - error->all(FLERR,"compute stress/mop/profile does not account for angle potentials"); + if ((strcmp(force->angle_style, "zero") != 0) && (strcmp(force->angle_style, "none") != 0)) + error->all(FLERR,"compute stress/mop/profile does not account for angle potentials"); if (force->dihedral!=nullptr) - error->all(FLERR,"compute stress/mop/profile does not account for dihedral potentials"); + if ((strcmp(force->dihedral_style, "zero") != 0) && (strcmp(force->dihedral_style, "none") != 0)) + error->all(FLERR,"compute stress/mop/profile does not account for dihedral potentials"); if (force->improper!=nullptr) error->all(FLERR,"compute stress/mop/profile does not account for improper potentials"); if (force->kspace!=nullptr) From d8fad4db1516f2a9a3d5a2ee1e9fda7b6959089c Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 4 Jun 2023 13:45:00 +0300 Subject: [PATCH 128/172] remove white space from compute_stress_mop.cpp --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 3ae758b875..c9557a7ef3 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -83,7 +83,7 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : if (pos >domain->boxhi[dir] || pos boxlo[dir]) error->all(FLERR, "Plane for compute stress/mop is out of bounds"); } - + if (pos < (domain->boxlo[dir]+domain->prd_half[dir])) { pos1 = pos + domain->prd[dir]; } else { @@ -285,7 +285,7 @@ void ComputeStressMop::compute_vector() // sum angle contribution over all procs MPI_Allreduce(angle_local,angle_global,nvalues,MPI_DOUBLE,MPI_SUM,world); - + for (int m=0; m Date: Sun, 4 Jun 2023 13:45:52 +0300 Subject: [PATCH 129/172] remove whitespace from compute_stress_mop_profile.cpp --- src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp index 99f522096c..4f91f8f7fb 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp @@ -609,7 +609,7 @@ void ComputeStressMopProfile::compute_bonds() } m += 3; } -} +} /* ---------------------------------------------------------------------- setup 1d bins and their extent and coordinates From 3782eeee2b2bca5435ef51f13082e96a1e0151df Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 4 Jun 2023 13:47:54 +0300 Subject: [PATCH 130/172] remove whitespace from compute_stress_mop.rst --- doc/src/compute_stress_mop.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/compute_stress_mop.rst b/doc/src/compute_stress_mop.rst index e1b151ebbd..7ab8c58a76 100644 --- a/doc/src/compute_stress_mop.rst +++ b/doc/src/compute_stress_mop.rst @@ -68,7 +68,7 @@ Between one and six keywords can be used to indicate which contributions to the stress must be computed: total stress (total), kinetic stress (kin), configurational stress (conf), stress due to bond stretching (bond), stress due to angle bending (angle) and/or due to pairwise non-bonded interactions (pair). -The angle keyword is currently available only for the stress/mop command and not the stress/mop/profile. +The angle keyword is currently available only for the stress/mop command and not the stress/mop/profile. NOTE 1: The configurational stress is computed considering all pairs of atoms where at least one atom belongs to group group-ID. @@ -119,12 +119,12 @@ size does not change in time, and axis-aligned planes. The method only works with two-body pair interactions, because it requires the class method pair->single() to be implemented. In -particular, compute *stress/mop/profile* does not work with more than +particular, compute *stress/mop/profile* does not work with more than two-body pair interactions, long range (kspace) interactions and angle/dihedral/improper -intramolecular interactions. Similarly, compute *stress/mop* does not work with more than +intramolecular interactions. Similarly, compute *stress/mop* does not work with more than two-body pair interactions, long range (kspace) interactions and dihedral/improper intramolecular interactions but works with all bond interactions with the class method -single() implemented and all angle interactions with the class method born_matrix() +single() implemented and all angle interactions with the class method born_matrix() implemented. Related commands From c25999d2087c6b79b71ab1d0f6934a7c4598087a Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 4 Jun 2023 16:08:33 +0300 Subject: [PATCH 131/172] Update compute_stress_mop_profile.cpp --- src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp index 4f91f8f7fb..2c2260d22c 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp @@ -213,7 +213,8 @@ void ComputeStressMopProfile::init() if ((strcmp(force->dihedral_style, "zero") != 0) && (strcmp(force->dihedral_style, "none") != 0)) error->all(FLERR,"compute stress/mop/profile does not account for dihedral potentials"); if (force->improper!=nullptr) - error->all(FLERR,"compute stress/mop/profile does not account for improper potentials"); + if ((strcmp(force->improper_style, "zero") != 0) && (strcmp(force->improper_style, "none") != 0)) + error->all(FLERR,"compute stress/mop/profile does not account for improper potentials"); if (force->kspace!=nullptr) error->all(FLERR,"compute stress/mop/profile does not account for kspace contributions"); } From 0cff31060b5342f69d0b8d382fab423f29677fb4 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Sun, 4 Jun 2023 16:10:24 +0300 Subject: [PATCH 132/172] Update compute_stress_mop.cpp --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index c9557a7ef3..50eb3425f8 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -232,9 +232,11 @@ void ComputeStressMop::init() angleflag = 1; } if (force->dihedral!=nullptr) - error->all(FLERR,"compute stress/mop does not account for dihedral potentials"); + if ((strcmp(force->dihedral_style, "zero") != 0) && (strcmp(force->dihedral_style, "none") != 0)) + error->all(FLERR,"compute stress/mop does not account for dihedral potentials"); if (force->improper!=nullptr) - error->all(FLERR,"compute stress/mop does not account for improper potentials"); + if ((strcmp(force->improper_style, "zero") != 0) && (strcmp(force->improper_style, "none") != 0)) + error->all(FLERR,"compute stress/mop does not account for improper potentials"); if (force->kspace!=nullptr) error->all(FLERR,"compute stress/mop does not account for kspace contributions"); } From ead5a28d354297f20ea40b090aa19f87968a9ce6 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Mon, 5 Jun 2023 18:53:45 +0300 Subject: [PATCH 133/172] Update compute_stress_mop.cpp --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index 50eb3425f8..e5d0e2ed13 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -227,7 +227,8 @@ void ComputeStressMop::init() if (force->bond!=nullptr) bondflag = 1; if (force->angle!=nullptr) if (force->angle->born_matrix_enable == 0) { - error->all(FLERR,"compute stress/mop does not account for angle potentials"); + if ((strcmp(force->angle_style, "zero") != 0) && (strcmp(force->angle_style, "none") != 0)) + error->all(FLERR,"compute stress/mop does not account for angle potentials"); } else { angleflag = 1; } @@ -238,7 +239,7 @@ void ComputeStressMop::init() if ((strcmp(force->improper_style, "zero") != 0) && (strcmp(force->improper_style, "none") != 0)) error->all(FLERR,"compute stress/mop does not account for improper potentials"); if (force->kspace!=nullptr) - error->all(FLERR,"compute stress/mop does not account for kspace contributions"); + error->warning(FLERR,"compute stress/mop does not account for kspace contributions"); } // need an occasional half neighbor list From 8eed55b56c8330e46fd3715fca962140a0691b52 Mon Sep 17 00:00:00 2001 From: Evangelos Voyiatzis Date: Mon, 5 Jun 2023 18:54:26 +0300 Subject: [PATCH 134/172] Update compute_stress_mop_profile.cpp --- src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp index 2c2260d22c..807092b37e 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop_profile.cpp @@ -216,7 +216,7 @@ void ComputeStressMopProfile::init() if ((strcmp(force->improper_style, "zero") != 0) && (strcmp(force->improper_style, "none") != 0)) error->all(FLERR,"compute stress/mop/profile does not account for improper potentials"); if (force->kspace!=nullptr) - error->all(FLERR,"compute stress/mop/profile does not account for kspace contributions"); + error->warning(FLERR,"compute stress/mop/profile does not account for kspace contributions"); } // need an occasional half neighbor list From c558de3ce003e2f77744d82f30d3f967df7be81d Mon Sep 17 00:00:00 2001 From: oywg11 Date: Tue, 6 Jun 2023 08:27:14 +0800 Subject: [PATCH 135/172] remove the fprintf debug outputs --- src/INTERLAYER/pair_ilp_tmd.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/INTERLAYER/pair_ilp_tmd.cpp b/src/INTERLAYER/pair_ilp_tmd.cpp index c1af7098cd..f0d618687a 100644 --- a/src/INTERLAYER/pair_ilp_tmd.cpp +++ b/src/INTERLAYER/pair_ilp_tmd.cpp @@ -336,9 +336,6 @@ void PairILPTMD::ILP_neigh() } } // end of idenfying the first neighbor } else if (n > Nnei) { - fprintf(screen, "Molecule ID = %d\n", imol); - fprintf(screen, "Atom Type = %d\n", type[i]); - fprintf(screen, "Neinum = %d\n", n); error->one(FLERR, "There are too many neighbors for TMD atoms, please check your configuration"); } @@ -497,9 +494,6 @@ void PairILPTMD::calc_normal() vect[0][1] = x[jH2][1] - ytp; vect[0][2] = x[jH2][2] - ztp; } else { - fprintf(screen, "jH1 jH2 = %d %d\n", jH1,jH2); - fprintf(screen, "Atom Type = %d %d\n", type[jH1],type[jH2]); - fprintf(screen, "For atom i = %d %d\n", tag[i],type[i]); error->one(FLERR, "The order of atoms in water molecule should be O H H !"); } } @@ -662,9 +656,6 @@ void PairILPTMD::calc_normal() cont = 2; } else { - fprintf(screen, "jH1 jH2 = %d %d\n", jH1,jH2); - fprintf(screen, "Atom Type = %d %d\n", type[jH1],type[jH2]); - fprintf(screen, "ID and type of atom i = %d %d\n", tag[i],type[i]); error->one(FLERR, "The order of atoms in water molecule should be O H H !"); } } @@ -728,11 +719,6 @@ void PairILPTMD::calc_normal() dnormdri[i][id][ip] = dpvdri[id][ip] / nn - Nave[id] * dni[ip] / nn2; } } - // printf("%4d:\t%e %e %e\n\t%e %e %e\n\t%e %e %e\n", - // i, dnormdri[i][0][0], dnormdri[i][0][1], dnormdri[i][0][2], - // dnormdri[i][1][0],dnormdri[i][1][1],dnormdri[i][1][2], - // dnormdri[i][2][0],dnormdri[i][2][1],dnormdri[i][2][2]); - // exit(0); } else if (cont >= 3) { error->one(FLERR, From 409bced5fd74e2c9b75a1e153ee126a5507605ca Mon Sep 17 00:00:00 2001 From: oywg11 Date: Tue, 6 Jun 2023 08:35:42 +0800 Subject: [PATCH 136/172] update affiliations --- src/INTERLAYER/pair_coul_shield.cpp | 2 +- src/INTERLAYER/pair_ilp_graphene_hbn.cpp | 4 ++-- src/INTERLAYER/pair_kolmogorov_crespi_full.cpp | 2 +- src/MANYBODY/pair_tersoff.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/INTERLAYER/pair_coul_shield.cpp b/src/INTERLAYER/pair_coul_shield.cpp index e647e1ea91..a5e3e63442 100644 --- a/src/INTERLAYER/pair_coul_shield.cpp +++ b/src/INTERLAYER/pair_coul_shield.cpp @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Wengen Ouyang (Tel Aviv University) + Contributing author: Wengen Ouyang (Wuhan University) e-mail: w.g.ouyang at gmail dot com This is a Coulomb potential described in diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp index e6711d0f19..eb37b39864 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp @@ -11,11 +11,11 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Wengen Ouyang (Tel Aviv University) + Contributing author: Wengen Ouyang (Wuhan University) e-mail: w.g.ouyang at gmail dot com This is a full version of the potential described in - [Maaravi et al, J. Phys. Chem. C 121, 22826-22835 (2017)] + [Ouyang et al., J. Chem. Theory Comput. 16(1), 666-676 (2020)] The definition of normals are the same as that in [Kolmogorov & Crespi, Phys. Rev. B 71, 235415 (2005)] ------------------------------------------------------------------------- */ diff --git a/src/INTERLAYER/pair_kolmogorov_crespi_full.cpp b/src/INTERLAYER/pair_kolmogorov_crespi_full.cpp index b2eba787b1..b497ae3568 100644 --- a/src/INTERLAYER/pair_kolmogorov_crespi_full.cpp +++ b/src/INTERLAYER/pair_kolmogorov_crespi_full.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Wengen Ouyang (Tel Aviv University) + Contributing author: Wengen Ouyang (Wuhan University) e-mail: w.g.ouyang at gmail dot com based on previous versions by Jaap Kroes diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp index f38ba00861..c7c45bc865 100644 --- a/src/MANYBODY/pair_tersoff.cpp +++ b/src/MANYBODY/pair_tersoff.cpp @@ -14,7 +14,7 @@ /* ---------------------------------------------------------------------- Contributing author: Aidan Thompson (SNL) - original Tersoff implementation - Wengen Ouyang (TAU) - Shift addition + Wengen Ouyang (WHU) - Shift addition ------------------------------------------------------------------------- */ #include "pair_tersoff.h" From 0ef0419a98adb1d804c17efc0c3d78cb2d549275 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Tue, 6 Jun 2023 21:45:51 +0800 Subject: [PATCH 137/172] rename function names in opt version --- src/OPT/pair_aip_water_2dm_opt.cpp | 2 +- src/OPT/pair_ilp_graphene_hbn_opt.cpp | 51 +++++++++++++++++---------- src/OPT/pair_ilp_graphene_hbn_opt.h | 2 +- src/OPT/pair_ilp_tmd_opt.cpp | 2 +- 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/OPT/pair_aip_water_2dm_opt.cpp b/src/OPT/pair_aip_water_2dm_opt.cpp index 17e981e479..3aba5b9dbd 100644 --- a/src/OPT/pair_aip_water_2dm_opt.cpp +++ b/src/OPT/pair_aip_water_2dm_opt.cpp @@ -23,7 +23,7 @@ e-mail: qdgaoping at gmail dot com Optimizations are described in: - Gao, Ping and Duan, Xiaohui, et al: + Gao, Ping and Duan, Xiaohui, et al.: LMFF: Efficient and Scalable Layered Materials Force Field on Heterogeneous Many-Core Processors DOI: 10.1145/3458817.3476137 diff --git a/src/OPT/pair_ilp_graphene_hbn_opt.cpp b/src/OPT/pair_ilp_graphene_hbn_opt.cpp index b2abcec7be..5bf21e5c24 100644 --- a/src/OPT/pair_ilp_graphene_hbn_opt.cpp +++ b/src/OPT/pair_ilp_graphene_hbn_opt.cpp @@ -11,12 +11,24 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Optimization author1: Ping Gao (National Supercomputing Center in Wuxi, China) - e-mail: qdgaoping at gmail dot com - Optimization author2: Xiaohui Duan (National Supercomputing Center in Wuxi, China) - e-mail: sunrise_duan at 126 dot com + This is an optimized version of ilp/graphene/hbn based on the contribution of: + author: Wengen Ouyang (Wuhan University) + e-mail: w.g.ouyang at gmail dot com - Provides some bugfixes and performance optimizations in this potential. + Optimizations are done by: + author1: Ping Gao (National Supercomputing Center in Wuxi, China) + e-mail: qdgaoping at gmail dot com + + author2: Xiaohui Duan (National Supercomputing Center in Wuxi, China) + e-mail: sunrise_duan at 126 dot com + + Optimizations are described in: + Gao, Ping and Duan, Xiaohui, et al.: + LMFF: Efficient and Scalable Layered Materials Force Field on Heterogeneous Many-Core Processors + DOI: 10.1145/3458817.3476137 + + Potential is described by: + [Ouyang et al., J. Chem. Theory Comput. 16(1), 666-676 (2020)] */ #include "pair_ilp_graphene_hbn_opt.h" @@ -169,33 +181,33 @@ void PairILPGrapheneHBNOpt::compute(int eflag, int vflag) } } } - } else if (variant == AIP_WATER_2DM) { + } else if (variant == ILP_WATER_2DM) { if (eflag_global || eflag_atom) { if (vflag_either) { if (tap_flag) { - eval<6, 1, 1, 1, AIP_WATER_2DM>(); + eval<6, 1, 1, 1, ILP_WATER_2DM>(); } else { - eval<6, 1, 1, 0, AIP_WATER_2DM>(); + eval<6, 1, 1, 0, ILP_WATER_2DM>(); } } else { if (tap_flag) { - eval<6, 1, 0, 1, AIP_WATER_2DM>(); + eval<6, 1, 0, 1, ILP_WATER_2DM>(); } else { - eval<6, 1, 0, 0, AIP_WATER_2DM>(); + eval<6, 1, 0, 0, ILP_WATER_2DM>(); } } } else { if (vflag_either) { if (tap_flag) { - eval<6, 0, 1, 1, AIP_WATER_2DM>(); + eval<6, 0, 1, 1, ILP_WATER_2DM>(); } else { - eval<6, 0, 1, 0, AIP_WATER_2DM>(); + eval<6, 0, 1, 0, ILP_WATER_2DM>(); } } else { if (tap_flag) { - eval<6, 0, 0, 1, AIP_WATER_2DM>(); + eval<6, 0, 0, 1, ILP_WATER_2DM>(); } else { - eval<6, 0, 0, 0, AIP_WATER_2DM>(); + eval<6, 0, 0, 0, ILP_WATER_2DM>(); } } } @@ -286,7 +298,7 @@ void PairILPGrapheneHBNOpt::eval() rsq = delx * delx + dely * dely + delz * delz; if (rsq != 0 && rsq < cutILPsq[itype_map][jtype]) { - if ((VARIANT == ILP_TMD || VARIANT == AIP_WATER_2DM) && special_type[itype] == TMD_METAL && itype != type[j]) continue; + if ((VARIANT == ILP_TMD || VARIANT == ILP_WATER_2DM) && special_type[itype] == TMD_METAL && itype != type[j]) continue; if (ILP_nneigh >= MAX_NNEIGH) { error->one(FLERR, "There are too many neighbors for calculating normals"); } @@ -301,7 +313,7 @@ void PairILPGrapheneHBNOpt::eval() double norm[3], dnormdxi[3][3], dnormdxk[MAX_NNEIGH][3][3]; - calc_normal(i, itype, ILP_neigh, ILP_nneigh, norm, dnormdxi, dnormdxk); + calc_atom_normal(i, itype, ILP_neigh, ILP_nneigh, norm, dnormdxi, dnormdxk); for (jj = 0; jj < jnum_inter; jj++) { j = jlist_inter[jj]; @@ -471,6 +483,7 @@ inline void deriv_hat(double dnhatdn[3][3], double *n, double rnnorm, double fac dnhatdn[0][2] = -n[0]*n[2]*cfactor; dnhatdn[1][2] = -n[1]*n[2]*cfactor; dnhatdn[2][2] = (n[0]*n[0]+n[1]*n[1])*cfactor; + } inline double normalize_factor(double *n) { @@ -485,7 +498,7 @@ inline double normalize_factor(double *n) Yet another normal calculation method for simpiler code. */ template -void PairILPGrapheneHBNOpt::calc_normal(int i, int itype, int *ILP_neigh, int nneigh, double *n, +void PairILPGrapheneHBNOpt::calc_atom_normal(int i, int itype, int *ILP_neigh, int nneigh, double *n, double (*dnormdri)[3], double (*dnormdrk)[3][3]) { double **x = atom->x; @@ -519,8 +532,8 @@ void PairILPGrapheneHBNOpt::calc_normal(int i, int itype, int *ILP_neigh, int nn vet[jj][2] = x[j][2] - x[i][2]; } - //specialize for AIP_WATER_2DM for hydrogen has special normal vector rule - if (variant == AIP_WATER_2DM && special_type[itype] == WATER) { + //specialize for ILP_WATER_2DM for hydrogen has special normal vector rule + if (variant == ILP_WATER_2DM && special_type[itype] == WATER) { if (nneigh == 1){ n[0] = vet[0][0]; n[1] = vet[0][1]; diff --git a/src/OPT/pair_ilp_graphene_hbn_opt.h b/src/OPT/pair_ilp_graphene_hbn_opt.h index 41d2178092..01b66bb2fa 100644 --- a/src/OPT/pair_ilp_graphene_hbn_opt.h +++ b/src/OPT/pair_ilp_graphene_hbn_opt.h @@ -35,7 +35,7 @@ class PairILPGrapheneHBNOpt : virtual public PairILPGrapheneHBN { protected: void update_internal_list(); template - void calc_normal(int i, int itype, int *ILP_neigh, int nneigh, double *normal, double (*dnormdri)[3], + void calc_atom_normal(int i, int itype, int *ILP_neigh, int nneigh, double *normal, double (*dnormdri)[3], double (*dnormdrk)[3][3]); template void eval(); diff --git a/src/OPT/pair_ilp_tmd_opt.cpp b/src/OPT/pair_ilp_tmd_opt.cpp index 834f2a0c9f..3fa95b7e10 100644 --- a/src/OPT/pair_ilp_tmd_opt.cpp +++ b/src/OPT/pair_ilp_tmd_opt.cpp @@ -23,7 +23,7 @@ e-mail: qdgaoping at gmail dot com Optimizations are described in: - Gao, Ping and Duan, Xiaohui, et al: + Gao, Ping and Duan, Xiaohui, et al.: LMFF: Efficient and Scalable Layered Materials Force Field on Heterogeneous Many-Core Processors DOI: 10.1145/3458817.3476137 From f85474c9ecc64532c5197b96ba0d38c80547a729 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Tue, 6 Jun 2023 22:03:33 +0800 Subject: [PATCH 138/172] fix a typo --- src/OPT/pair_aip_water_2dm_opt.h | 1 - src/OPT/pair_ilp_graphene_hbn_opt.cpp | 48 +++++++++++++-------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/OPT/pair_aip_water_2dm_opt.h b/src/OPT/pair_aip_water_2dm_opt.h index 46280c2b82..50b5043360 100644 --- a/src/OPT/pair_aip_water_2dm_opt.h +++ b/src/OPT/pair_aip_water_2dm_opt.h @@ -36,4 +36,3 @@ class PairAIPWATER2DMOpt : public PairAIPWATER2DM, public PairILPGrapheneHBNOpt } // namespace LAMMPS_NS #endif #endif - diff --git a/src/OPT/pair_ilp_graphene_hbn_opt.cpp b/src/OPT/pair_ilp_graphene_hbn_opt.cpp index 5bf21e5c24..5cb896223e 100644 --- a/src/OPT/pair_ilp_graphene_hbn_opt.cpp +++ b/src/OPT/pair_ilp_graphene_hbn_opt.cpp @@ -11,31 +11,30 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - This is an optimized version of ilp/graphene/hbn based on the contribution of: - author: Wengen Ouyang (Wuhan University) - e-mail: w.g.ouyang at gmail dot com + This is an optimized version of ilp/graphene/hbn based on the contirubtion of: + author: Wengen Ouyang (Wuhan University, China) + e-mail: w.g.ouyang at gmail dot com Optimizations are done by: - author1: Ping Gao (National Supercomputing Center in Wuxi, China) - e-mail: qdgaoping at gmail dot com + author1: Ping Gao (National Supercomputing Center in Wuxi, China) implements the base ILP potential. + e-mail: qdgaoping at gmail dot com - author2: Xiaohui Duan (National Supercomputing Center in Wuxi, China) - e-mail: sunrise_duan at 126 dot com + author2: Xiaohui Duan (Shandong University, China) adjusts the framework to adopt SAIP, TMD, WATER2DM, etc. + e-mail: sunrise_duan at 126 dot com Optimizations are described in: - Gao, Ping and Duan, Xiaohui, et al.: - LMFF: Efficient and Scalable Layered Materials Force Field on Heterogeneous Many-Core Processors - DOI: 10.1145/3458817.3476137 + Gao, Ping and Duan, Xiaohui, et al: + LMFF: Efficient and Scalable Layered Materials Force Field on Heterogeneous Many-Core Processors + DOI: 10.1145/3458817.3476137 Potential is described by: - [Ouyang et al., J. Chem. Theory Comput. 16(1), 666-676 (2020)] + [Ouyang et al., J. Chem. Theory Comput. 16(1), 666-676 (2020)] */ #include "pair_ilp_graphene_hbn_opt.h" #include "atom.h" #include "citeme.h" -#include "comm.h" #include "error.h" #include "force.h" #include "interlayer_taper.h" @@ -181,33 +180,33 @@ void PairILPGrapheneHBNOpt::compute(int eflag, int vflag) } } } - } else if (variant == ILP_WATER_2DM) { + } else if (variant == AIP_WATER_2DM) { if (eflag_global || eflag_atom) { if (vflag_either) { if (tap_flag) { - eval<6, 1, 1, 1, ILP_WATER_2DM>(); + eval<6, 1, 1, 1, AIP_WATER_2DM>(); } else { - eval<6, 1, 1, 0, ILP_WATER_2DM>(); + eval<6, 1, 1, 0, AIP_WATER_2DM>(); } } else { if (tap_flag) { - eval<6, 1, 0, 1, ILP_WATER_2DM>(); + eval<6, 1, 0, 1, AIP_WATER_2DM>(); } else { - eval<6, 1, 0, 0, ILP_WATER_2DM>(); + eval<6, 1, 0, 0, AIP_WATER_2DM>(); } } } else { if (vflag_either) { if (tap_flag) { - eval<6, 0, 1, 1, ILP_WATER_2DM>(); + eval<6, 0, 1, 1, AIP_WATER_2DM>(); } else { - eval<6, 0, 1, 0, ILP_WATER_2DM>(); + eval<6, 0, 1, 0, AIP_WATER_2DM>(); } } else { if (tap_flag) { - eval<6, 0, 0, 1, ILP_WATER_2DM>(); + eval<6, 0, 0, 1, AIP_WATER_2DM>(); } else { - eval<6, 0, 0, 0, ILP_WATER_2DM>(); + eval<6, 0, 0, 0, AIP_WATER_2DM>(); } } } @@ -298,7 +297,7 @@ void PairILPGrapheneHBNOpt::eval() rsq = delx * delx + dely * dely + delz * delz; if (rsq != 0 && rsq < cutILPsq[itype_map][jtype]) { - if ((VARIANT == ILP_TMD || VARIANT == ILP_WATER_2DM) && special_type[itype] == TMD_METAL && itype != type[j]) continue; + if ((VARIANT == ILP_TMD || VARIANT == AIP_WATER_2DM) && special_type[itype] == TMD_METAL && itype != type[j]) continue; if (ILP_nneigh >= MAX_NNEIGH) { error->one(FLERR, "There are too many neighbors for calculating normals"); } @@ -483,7 +482,6 @@ inline void deriv_hat(double dnhatdn[3][3], double *n, double rnnorm, double fac dnhatdn[0][2] = -n[0]*n[2]*cfactor; dnhatdn[1][2] = -n[1]*n[2]*cfactor; dnhatdn[2][2] = (n[0]*n[0]+n[1]*n[1])*cfactor; - } inline double normalize_factor(double *n) { @@ -532,8 +530,8 @@ void PairILPGrapheneHBNOpt::calc_atom_normal(int i, int itype, int *ILP_neigh, i vet[jj][2] = x[j][2] - x[i][2]; } - //specialize for ILP_WATER_2DM for hydrogen has special normal vector rule - if (variant == ILP_WATER_2DM && special_type[itype] == WATER) { + //specialize for AIP_WATER_2DM for hydrogen has special normal vector rule + if (variant == AIP_WATER_2DM && special_type[itype] == WATER) { if (nneigh == 1){ n[0] = vet[0][0]; n[1] = vet[0][1]; From 51b45d683071f1985d59a9a25b1ebc8f29739017 Mon Sep 17 00:00:00 2001 From: oywg11 Date: Tue, 6 Jun 2023 22:16:41 +0800 Subject: [PATCH 139/172] fix small format issues --- src/INTERLAYER/pair_ilp_graphene_hbn.cpp | 2 -- src/INTERLAYER/pair_ilp_tmd.cpp | 2 +- src/INTERLAYER/pair_saip_metal.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp index eb37b39864..69896d7c0b 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.cpp +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.cpp @@ -16,8 +16,6 @@ This is a full version of the potential described in [Ouyang et al., J. Chem. Theory Comput. 16(1), 666-676 (2020)] - The definition of normals are the same as that in - [Kolmogorov & Crespi, Phys. Rev. B 71, 235415 (2005)] ------------------------------------------------------------------------- */ #include "pair_ilp_graphene_hbn.h" diff --git a/src/INTERLAYER/pair_ilp_tmd.cpp b/src/INTERLAYER/pair_ilp_tmd.cpp index f0d618687a..f29ee34180 100644 --- a/src/INTERLAYER/pair_ilp_tmd.cpp +++ b/src/INTERLAYER/pair_ilp_tmd.cpp @@ -15,7 +15,7 @@ e-mail: w.g.ouyang at gmail dot com This is a full version of the potential described in - [Ouyang et al, J. Chem. Theory Comput. 17, 7237 (2021).] + [Ouyang et al., J. Chem. Theory Comput. 17, 7237 (2021).] ------------------------------------------------------------------------- */ #include "pair_ilp_tmd.h" diff --git a/src/INTERLAYER/pair_saip_metal.cpp b/src/INTERLAYER/pair_saip_metal.cpp index 05fbfbf7f4..bd327391a4 100644 --- a/src/INTERLAYER/pair_saip_metal.cpp +++ b/src/INTERLAYER/pair_saip_metal.cpp @@ -15,7 +15,7 @@ e-mail: w.g.ouyang at gmail dot com This is a full version of the potential described in - [Ouyang et al, J. Chem. Theory Comput. 17, 7215-7223 (2021)] + [Ouyang et al., J. Chem. Theory Comput. 17, 7215-7223 (2021)] ------------------------------------------------------------------------- */ #include "pair_saip_metal.h" From c4d49324b52f708d9e0d8fc6ef123cee84f68845 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 6 Jun 2023 16:08:50 -0400 Subject: [PATCH 140/172] various documentation updates - spelling fixes - formatting conventions - grammar fixes and clarifications - full integration into manual build procedure --- doc/src/Commands_pair.rst | 1 + doc/src/pair_aip_water_2dm.rst | 64 +++++++++++---------- doc/src/pair_style.rst | 1 + doc/utils/sphinx-config/false_positives.txt | 3 + 4 files changed, 39 insertions(+), 30 deletions(-) diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index 5f79015aaf..87d3129880 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -37,6 +37,7 @@ OPT. * * :doc:`adp (ko) ` * :doc:`agni (o) ` + * :doc:`aip/water/2dm (o) ` * :doc:`airebo (io) ` * :doc:`airebo/morse (io) ` * :doc:`amoeba (g) ` diff --git a/doc/src/pair_aip_water_2dm.rst b/doc/src/pair_aip_water_2dm.rst index 3ae63e1e45..5218db9c37 100644 --- a/doc/src/pair_aip_water_2dm.rst +++ b/doc/src/pair_aip_water_2dm.rst @@ -35,8 +35,8 @@ Description .. versionadded:: xxxx2023 -The *aip/water/2dm* style computes the anisotropic interfacial -potential (AIP) potential for interfaces of water with two-dimensinal (2D) +The *aip/water/2dm* style computes the anisotropic interfacial potential +(AIP) potential for interfaces of water with two-dimensional (2D) materials as described in :ref:`(Feng) `. .. math:: @@ -56,41 +56,45 @@ materials as described in :ref:`(Feng) `. Where :math:`\mathrm{Tap}(r_{ij})` is the taper function which provides a continuous cutoff (up to third derivative) for interatomic separations -larger than :math:`r_c` :doc:`pair_style ilp_graphene_hbn `. +larger than :math:`r_c` :doc:`pair_style ilp_graphene_hbn +`. It is important to include all the pairs to build the neighbor list for calculating the normals. .. note:: - Since each water molecule contains one oxygen atom and two hydrogen atoms, - a new definition is proposed (see In :ref:`(Feng) `),the atomic - normal vectors of hydrogen atoms are assumed to lie along the corresponding - oxygen-hydrogen bonds and the normal vector of the central oxygen atom - is defined as their average. + Since each water molecule contains one oxygen atom and two hydrogen + atoms, a new definition is proposed (see In :ref:`(Feng) `),the + atomic normal vectors of hydrogen atoms are assumed to lie along the + corresponding oxygen-hydrogen bonds and the normal vector of the + central oxygen atom is defined as their average. -The parameter file (e.g. COH.aip.water.2dm), is intended for use with *metal* -:doc:`units `, with energies in meV. Two additional parameters, -*S*, and *rcut* are included in the parameter file. *S* is designed to -facilitate scaling of energies. *rcut* is designed to build the neighbor -list for calculating the normals for each atom pair. +The provided parameter file, ``COH.aip.water.2dm``, is intended for use +with *metal* :doc:`units `, with energies in meV. Two additional +parameters, *S*, and *rcut* are included in the parameter file. *S* is +designed to facilitate scaling of energies; *rcut* is designed to build +the neighbor list for calculating the normals for each atom pair. .. note:: - The parameters presented in the parameter file (e.g. COH.aip.water.2dm), - are fitted with taper function by setting the cutoff equal to 16.0 - Angstrom. Using different cutoff or taper function should be careful. - These parameters provide a good description in both short- and long-range - interaction regimes. This feature is essential for simulations in high pressure - regime (i.e., the interlayer distance is smaller than the equilibrium - distance). + The parameters presented in the provided parameter file, + ``COH.aip.water.2dm``, are fitted with the taper function enabled by + setting the cutoff equal to 16.0 Angstrom. Using a different cutoff + or taper function setting should be carefully checked as they can + lead to significant errors. These parameters provide a good + description in both short- and long-range interaction regimes. This + feature is essential for simulations in high pressure regime (i.e., + the interlayer distance is smaller than the equilibrium distance). -This potential must be used in combination with hybrid/overlay. -Other interactions can be set to zero using pair_style *none*\ . +This potential must be used in combination with hybrid/overlay. Other +interactions can be set to zero using :doc:`pair_coeff settings +` with the pair style set to *none*\ . This pair style tallies a breakdown of the total interlayer potential -energy into sub-categories, which can be accessed via the :doc:`compute pair ` command as a vector of values of length 2. -The 2 values correspond to the following sub-categories: +energy into sub-categories, which can be accessed via the :doc:`compute +pair ` command as a vector of values of length 2. The 2 +values correspond to the following sub-categories: 1. *E_vdW* = vdW (attractive) energy 2. *E_Rep* = Repulsive energy @@ -132,11 +136,11 @@ if LAMMPS was built with that package. See the :doc:`Build package This pair style requires the newton setting to be *on* for pair interactions. -The COH.aip.water.2dm potential file provided with LAMMPS (see the potentials -directory) are parameterized for *metal* units. You can use this -potential with any LAMMPS units, but you would need to create your -COH.aip.water.2dm potential file with coefficients listed in the appropriate -units, if your simulation does not use *metal* units. +The ``COH.aip.water.2dm`` potential file provided with LAMMPS is +parameterized for *metal* units. You can use this pair style with any +LAMMPS units, but you would need to create your own potential file with +parameters in the appropriate units, if your simulation does not use +*metal* units. Related commands """""""""""""""" @@ -158,8 +162,8 @@ Default tap_flag = 1 - ---------- .. _Feng: + **(Feng)** Z. Feng and W. Ouyang et al., J. Phys. Chem. C. 127, 8704-8713 (2023). diff --git a/doc/src/pair_style.rst b/doc/src/pair_style.rst index 441313b0b8..494a26aacf 100644 --- a/doc/src/pair_style.rst +++ b/doc/src/pair_style.rst @@ -114,6 +114,7 @@ accelerated styles exist. * :doc:`adp ` - angular dependent potential (ADP) of Mishin * :doc:`agni ` - AGNI machine-learning potential +* :doc:`aip/water/2dm ` - anisotropic interfacial potential for water in 2d geometries * :doc:`airebo ` - AIREBO potential of Stuart * :doc:`airebo/morse ` - AIREBO with Morse instead of LJ * :doc:`amoeba ` - diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index d2d15633af..ad2a255447 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -55,6 +55,7 @@ Ai Aidan aij aimd +aip airebo Aj ajaramil @@ -528,6 +529,7 @@ collisional Columic colvars Colvars +COH COLVARS comID Commun @@ -1090,6 +1092,7 @@ Fellinger femtosecond femtoseconds fene +Feng Fennell fep FEP From eafabf0fb1d0818b675953a7e5a56f044044491b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 6 Jun 2023 16:10:11 -0400 Subject: [PATCH 141/172] update .gitignore --- src/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/.gitignore b/src/.gitignore index 204eec5e0b..2db7bb4663 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1058,6 +1058,10 @@ /pair_adp.h /pair_agni.cpp /pair_agni.h +/pair_aip_water_2dm.cpp +/pair_aip_water_2dm.h +/pair_aip_water_2dm_opt.cpp +/pair_aip_water_2dm_opt.h /pair_airebo.cpp /pair_airebo.h /pair_airebo_morse.cpp From e954d8f0507bc31869f083777e412e5b1ed1aaed Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 6 Jun 2023 16:11:03 -0400 Subject: [PATCH 142/172] correctly indicate OPT package version of pair style --- doc/src/Commands_pair.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index 87d3129880..c45a1d778c 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -37,7 +37,7 @@ OPT. * * :doc:`adp (ko) ` * :doc:`agni (o) ` - * :doc:`aip/water/2dm (o) ` + * :doc:`aip/water/2dm (t) ` * :doc:`airebo (io) ` * :doc:`airebo/morse (io) ` * :doc:`amoeba (g) ` From ee6b12ee300c8adb1c8cd62ba6f703b4a6bb73b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yifan=20Li=E6=9D=8E=E4=B8=80=E5=B8=86?= Date: Tue, 6 Jun 2023 18:04:26 -0400 Subject: [PATCH 143/172] Correct reference info --- doc/src/fix_pimd.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/fix_pimd.rst b/doc/src/fix_pimd.rst index 22c064b60b..c08a4005f5 100644 --- a/doc/src/fix_pimd.rst +++ b/doc/src/fix_pimd.rst @@ -445,7 +445,7 @@ Path Integrals, McGraw-Hill, New York (1965). **(Bussi)** G. Bussi, T. Zykova-Timan, M. Parrinello, J Chem Phys, 130, 074101 (2009). -.. _Ceriotti2: +.. _Ceriotti3: **(Ceriotti)** M. Ceriotti, M. Parrinello, T. Markland, D. Manolopoulos, J. Chem. Phys. 133, 124104 (2010). From a415d732fc354ba7af12c438ad869f5f9f5484c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yifan=20Li=E6=9D=8E=E4=B8=80=E5=B8=86?= Date: Tue, 6 Jun 2023 18:11:01 -0400 Subject: [PATCH 144/172] rename Langevin init --- src/REPLICA/fix_pimd_langevin.cpp | 4 ++-- src/REPLICA/fix_pimd_langevin.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 2e4b1c17b8..17ea07c845 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -451,7 +451,7 @@ void FixPIMDLangevin::init() nmpimd_init(); - Langevin_init(); + langevin_init(); c_pe = modify->get_compute_by_id(id_pe); c_press = modify->get_compute_by_id(id_press); @@ -888,7 +888,7 @@ void FixPIMDLangevin::press_o_step() /* ---------------------------------------------------------------------- */ -void FixPIMDLangevin::Langevin_init() +void FixPIMDLangevin::langevin_init() { double beta = 1.0 / kBT; _omega_np = np / beta / hbar; diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index 79a2ee7477..1ef1dfae52 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -115,7 +115,7 @@ class FixPIMDLangevin : public Fix { class RanMars *random; int tstat_flag; // tstat_flat = 1 if thermostat if used - void Langevin_init(); + void langevin_init(); void b_step(); // integrate for dt/2 according to B part (v <- v + f * dt/2) void a_step(); // integrate for dt/2 according to A part (non-centroid mode, harmonic force between replicas) void qc_step(); // integrate for dt/2 for the centroid mode (x <- x + v * dt/2) From 5ff6fd9aad41084521a1a48381c6ebba6f584426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yifan=20Li=E6=9D=8E=E4=B8=80=E5=B8=86?= Date: Tue, 6 Jun 2023 18:14:28 -0400 Subject: [PATCH 145/172] rename kBT to kt --- src/REPLICA/fix_pimd_langevin.cpp | 16 ++++++++-------- src/REPLICA/fix_pimd_langevin.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index 17ea07c845..c85edc99f9 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -257,7 +257,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : } } extvector = 1; - kBT = force->boltz * temp; + kt = force->boltz * temp; if (pstat_flag) baro_init(); // some initilizations @@ -800,10 +800,10 @@ void FixPIMDLangevin::baro_init() { vw[0] = vw[1] = vw[2] = vw[3] = vw[4] = vw[5] = 0.0; if (pstyle == ISO) { - W = 3 * (atom->natoms) * tau_p * tau_p * np * kBT; + W = 3 * (atom->natoms) * tau_p * tau_p * np * kt; } // consistent with the definition in i-Pi else if (pstyle == ANISO) { - W = atom->natoms * tau_p * tau_p * np * kBT; + W = atom->natoms * tau_p * tau_p * np * kt; } Vcoeff = 1.0; std::string out = fmt::format("\nInitializing PIMD {:s} barostat...\n", Barostats[barostat]); @@ -890,7 +890,7 @@ void FixPIMDLangevin::press_o_step() void FixPIMDLangevin::langevin_init() { - double beta = 1.0 / kBT; + double beta = 1.0 / kt; _omega_np = np / beta / hbar; double _omega_np_dt_half = _omega_np * update->dt * 0.5; @@ -1394,11 +1394,11 @@ void FixPIMDLangevin::compute_totenthalpy() if (barostat == BZP) { if (pstyle == ISO) { totenthalpy = tote + 0.5 * W * vw[0] * vw[0] * inverse_np + p_hydro * volume / force->nktv2p - - Vcoeff * kBT * log(volume); + Vcoeff * kt * log(volume); } else if (pstyle == ANISO) { totenthalpy = tote + 0.5 * W * vw[0] * vw[0] * inverse_np + 0.5 * W * vw[1] * vw[1] * inverse_np + 0.5 * W * vw[2] * vw[2] * inverse_np + - p_hydro * volume / force->nktv2p - Vcoeff * kBT * log(volume); + p_hydro * volume / force->nktv2p - Vcoeff * kt * log(volume); } } else if (barostat == MTTK) totenthalpy = tote + 1.5 * W * vw[0] * vw[0] * inverse_np + p_hydro * (volume - vol0); @@ -1477,7 +1477,7 @@ double FixPIMDLangevin::compute_vector(int n) if (n == 11) return 1.5 * W * vw[0] * vw[0]; } if (n == 12) { return np * Pext * volume / force->nktv2p; } - if (n == 13) { return -Vcoeff * np * kBT * log(volume); } + if (n == 13) { return -Vcoeff * np * kt * log(volume); } if (n == 14) return totenthalpy; } else if (pstyle == ANISO) { if (n == 10) return vw[0]; @@ -1487,7 +1487,7 @@ double FixPIMDLangevin::compute_vector(int n) if (n == 14) { return np * Pext * volume / force->nktv2p; } if (n == 15) { volume = domain->xprd * domain->yprd * domain->zprd; - return -Vcoeff * np * kBT * log(volume); + return -Vcoeff * np * kt * log(volume); } if (n == 16) return totenthalpy; } diff --git a/src/REPLICA/fix_pimd_langevin.h b/src/REPLICA/fix_pimd_langevin.h index 1ef1dfae52..dc48832855 100644 --- a/src/REPLICA/fix_pimd_langevin.h +++ b/src/REPLICA/fix_pimd_langevin.h @@ -51,7 +51,7 @@ class FixPIMDLangevin : public Fix { double lj_epsilon, lj_sigma, lj_mass; // LJ unit energy, length, and mass scales double other_planck; double other_mvv2e; - double kBT; // k_B * temp + double kt; // k_B * temp double beta, beta_np; // beta = 1./kBT beta_np = 1./kBT/np int thermostat; // NHC or PILE_L int barostat; // BZP From f83867787c6eb7ed8b509a54be25b3ee46e7290d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yifan=20Li=E6=9D=8E=E4=B8=80=E5=B8=86?= Date: Tue, 6 Jun 2023 18:17:39 -0400 Subject: [PATCH 146/172] update error message --- src/REPLICA/fix_pimd_langevin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/REPLICA/fix_pimd_langevin.cpp b/src/REPLICA/fix_pimd_langevin.cpp index c85edc99f9..0af08b43b3 100644 --- a/src/REPLICA/fix_pimd_langevin.cpp +++ b/src/REPLICA/fix_pimd_langevin.cpp @@ -155,7 +155,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) : pstat_flag = 1; } else error->universe_all(FLERR, - "Unknown ensemble parameter for fix pimd/langevin. Only nve and nvt " + "Unknown ensemble parameter for fix pimd/langevin. Only nve, nvt, nph, and npt " "ensembles are supported!"); } else if (strcmp(arg[i], "fmass") == 0) { fmass = utils::numeric(FLERR, arg[i + 1], false, lmp); From 14acb3e0ca5aa77662fbe4d96fc6463909e52be5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 6 Jun 2023 20:38:15 -0400 Subject: [PATCH 147/172] add multitype data type and unittest (including tests for ubuf) --- src/lmptype.h | 82 +++++++++++++++++++++++++++++++- unittest/utils/CMakeLists.txt | 4 ++ unittest/utils/test_lmptype.cpp | 84 +++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+), 2 deletions(-) create mode 100644 unittest/utils/test_lmptype.cpp diff --git a/src/lmptype.h b/src/lmptype.h index ecd6ee5761..6e0b54d988 100644 --- a/src/lmptype.h +++ b/src/lmptype.h @@ -95,7 +95,7 @@ typedef int64_t bigint; #define MAXSMALLINT INT_MAX #define MAXTAGINT INT_MAX #define MAXBIGINT INT64_MAX -#define MAXDOUBLEINT 9007199254740992 // 2^53 +#define MAXDOUBLEINT 9007199254740992 // 2^53 #define MPI_LMP_TAGINT MPI_INT #define MPI_LMP_IMAGEINT MPI_INT @@ -133,7 +133,7 @@ typedef int64_t bigint; #define MAXSMALLINT INT_MAX #define MAXTAGINT INT64_MAX #define MAXBIGINT INT64_MAX -#define MAXDOUBLEINT 9007199254740992 // 2^53 +#define MAXDOUBLEINT 9007199254740992 // 2^53 #define MPI_LMP_TAGINT MPI_LL #define MPI_LMP_IMAGEINT MPI_LL @@ -232,6 +232,84 @@ union ubuf { ubuf(const int64_t &arg) : i(arg) {} ubuf(const int &arg) : i(arg) {} }; + +/** Data structure for dynamic typing of int, bigint, and double + * + * Using this union allows to store any of the supported data types + * in the same container and allows to "see" its current type. +\verbatim embed:rst + +**Usage:** + +.. code-block:: c++ + :caption: To store data in multitype array: + + multitype m[5]; + int foo = 1; + double bar = 2.5; + bigint baz = 1<<40 - 1; + m[0] = foo; + m[1] = bar; + m[2] = -1; + m[3] = 2.0; + m[4] = baz; + +.. code-block:: c++ + :caption: To format data from multitype array into a space separated string: + + std::string str; + for (int i = 0; i < 5; ++i) { + switch (m[i].type) { + case multitype::DOUBLE: + str += std::to_string(m[i].data.d) + ' '; + break; + case multitype::INT: + str += std::to_string(m[i].data.i) + ' '; + break; + case multitype::BIGINT: + str += std::to_string(m[i].data.b) + ' '; + break; + default: + break; + } + } +\endverbatim + */ +struct multitype { + enum { NONE, DOUBLE, INT, BIGINT }; + + int type; + union { + double d; + int i; + int64_t b; + } data; + + multitype() : type(NONE) { data.d = 0.0; } + multitype(const multitype &) = default; + multitype(multitype &&) = default; + ~multitype() = default; + + multitype &operator=(const double &_d) + { + type = DOUBLE; + data.d = _d; + return *this; + } + multitype &operator=(const int &_i) + { + type = INT; + data.i = _i; + return *this; + } + multitype &operator=(const int64_t &_b) + { + type = BIGINT; + data.b = _b; + return *this; + } +}; + } // namespace LAMMPS_NS // preprocessor macros for compiler specific settings diff --git a/unittest/utils/CMakeLists.txt b/unittest/utils/CMakeLists.txt index a6d5545873..8c1a5a3f6a 100644 --- a/unittest/utils/CMakeLists.txt +++ b/unittest/utils/CMakeLists.txt @@ -7,6 +7,10 @@ add_executable(test_mempool test_mempool.cpp) target_link_libraries(test_mempool PRIVATE lammps GTest::GMockMain) add_test(NAME MemPool COMMAND test_mempool) +add_executable(test_lmptype test_lmptype.cpp) +target_link_libraries(test_lmptype PRIVATE lammps GTest::GMockMain) +add_test(NAME LmpType COMMAND test_lmptype) + add_executable(test_argutils test_argutils.cpp) target_link_libraries(test_argutils PRIVATE lammps GTest::GMockMain) add_test(NAME ArgUtils COMMAND test_argutils) diff --git a/unittest/utils/test_lmptype.cpp b/unittest/utils/test_lmptype.cpp new file mode 100644 index 0000000000..6db340fddf --- /dev/null +++ b/unittest/utils/test_lmptype.cpp @@ -0,0 +1,84 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + LAMMPS Development team: developers@lammps.org + + 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 "lmptype.h" + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +#include + +using namespace LAMMPS_NS; + +TEST(Types, ubuf) +{ + double buf[3]; + double d1 = 0.1; + int i1 = -10; +#if defined(LAMMPS_SMALLSMALL) + bigint b1 = 2048; +#else + bigint b1 = (1L << 58) + (1L << 50); +#endif + buf[0] = d1; + buf[1] = ubuf(i1).d; + buf[2] = ubuf(b1).d; + + EXPECT_EQ(d1, buf[0]); + EXPECT_EQ(i1, (int)ubuf(buf[1]).i); + EXPECT_EQ(b1, (bigint)ubuf(buf[2]).i); +} + +TEST(Types, multitype) +{ + multitype m[6]; + int64_t b1 = (3L << 48) - 1; + int i1 = 20; + double d1 = 0.1; + + m[0] = b1; + m[1] = i1; + m[2] = d1; + +#if !defined(LAMMPS_SMALLSMALL) + m[3] = -((1L << 40) + (1L << 50)); +#endif + m[4] = -1023; + m[5] = -2.225; + +#if defined(LAMMPS_SMALLSMALL) + EXPECT_EQ(m[0].type, multitype::INT); +#else + EXPECT_EQ(m[0].type, multitype::BIGINT); +#endif + EXPECT_EQ(m[1].type, multitype::INT); + EXPECT_EQ(m[2].type, multitype::DOUBLE); + +#if defined(LAMMPS_SMALLSMALL) + EXPECT_EQ(m[3].type, multitype::NONE); +#else + EXPECT_EQ(m[3].type, multitype::BIGINT); +#endif + EXPECT_EQ(m[4].type, multitype::INT); + EXPECT_EQ(m[5].type, multitype::DOUBLE); + + EXPECT_EQ(m[0].data.b, b1); + EXPECT_EQ(m[1].data.i, i1); + EXPECT_EQ(m[2].data.d, d1); + +#if !defined(LAMMPS_SMALLSMALL) + EXPECT_EQ(m[3].data.b, -((1L << 40) + (1L << 50))); +#endif + EXPECT_EQ(m[4].data.i, -1023); + EXPECT_EQ(m[5].data.d, -2.225); +} From b81b1f5ecc587289538ee24160c6b23e45b92d8e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 6 Jun 2023 22:40:13 -0400 Subject: [PATCH 148/172] switch dump yaml/netcdf thermo output to use new caching API. remove old API. --- doc/src/dump_modify.rst | 9 +++-- src/EXTRA-DUMP/dump_yaml.cpp | 31 ++++++++++------- src/NETCDF/dump_netcdf.cpp | 58 ++++++++++++++------------------ src/NETCDF/dump_netcdf_mpiio.cpp | 54 ++++++++++++++--------------- src/thermo.cpp | 17 ++++------ src/thermo.h | 11 +++--- 6 files changed, 87 insertions(+), 93 deletions(-) diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index f00cc339cc..89b3766083 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -753,9 +753,12 @@ run, this option is ignored since the output is already balanced. ---------- The *thermo* keyword only applies the dump styles *netcdf* and *yaml*. -It triggers writing of :doc:`thermo ` information to the dump file -alongside per-atom data. The values included in the dump file are -identical to the values specified by :doc:`thermo_style `. +It triggers writing of :doc:`thermo ` information to the dump +file alongside per-atom data. The values included in the dump file are +cached values from the last thermo output and include the exact same the +values as specified by the :doc:`thermo_style ` command. +Because these are cached values, they are only up-to-date when dump +output is on a timestep that also has thermo output. ---------- diff --git a/src/EXTRA-DUMP/dump_yaml.cpp b/src/EXTRA-DUMP/dump_yaml.cpp index 3c35ec43ba..029415164f 100644 --- a/src/EXTRA-DUMP/dump_yaml.cpp +++ b/src/EXTRA-DUMP/dump_yaml.cpp @@ -60,21 +60,26 @@ void DumpYAML::write_header(bigint ndump) std::string thermo_data; if (thermo) { Thermo *th = output->thermo; - thermo_data += "thermo:\n - keywords: [ "; - for (int i = 0; i < th->nfield; ++i) thermo_data += fmt::format("{}, ", th->keyword[i]); - thermo_data += "]\n - data: [ "; + // output thermo data only on timesteps where it was computed + if (update->ntimestep == th->get_timestep()) { - for (int i = 0; i < th->nfield; ++i) { - th->call_vfunc(i); - if (th->vtype[i] == Thermo::FLOAT) - thermo_data += fmt::format("{}, ", th->dvalue); - else if (th->vtype[i] == Thermo::INT) - thermo_data += fmt::format("{}, ", th->ivalue); - else if (th->vtype[i] == Thermo::BIGINT) - thermo_data += fmt::format("{}, ", th->bivalue); + thermo_data += "thermo:\n - keywords: [ "; + for (auto key : th->get_keywords()) thermo_data += fmt::format("{}, ", key); + thermo_data += "]\n - data: [ "; + + for (auto val : th->get_fields()) { + if (val.type == multitype::DOUBLE) + thermo_data += fmt::format("{}, ", val.data.d); + else if (val.type == multitype::INT) + thermo_data += fmt::format("{}, ", val.data.i); + else if (val.type == multitype::BIGINT) + thermo_data += fmt::format("{}, ", val.data.b); + else + thermo_data += ", "; + } + thermo_data += "]\n"; + MPI_Barrier(world); } - thermo_data += "]\n"; - MPI_Barrier(world); } if (comm->me == 0) { diff --git a/src/NETCDF/dump_netcdf.cpp b/src/NETCDF/dump_netcdf.cpp index 6fecf7f41b..cb6aea16cf 100644 --- a/src/NETCDF/dump_netcdf.cpp +++ b/src/NETCDF/dump_netcdf.cpp @@ -223,7 +223,7 @@ void DumpNetCDF::openfile() if (thermo && !singlefile_opened) { delete[] thermovar; - thermovar = new int[output->thermo->nfield]; + thermovar = new int[output->thermo->get_keywords().size()]; } // now the computes and fixes have been initialized, so we can query @@ -320,9 +320,10 @@ void DumpNetCDF::openfile() // perframe variables if (thermo) { - Thermo *th = output->thermo; - for (int i = 0; i < th->nfield; i++) { - NCERRX( nc_inq_varid(ncid, th->keyword[i].c_str(), &thermovar[i]), th->keyword[i].c_str() ); + auto keywords = output->thermo->get_keywords(); + int nfield = keywords.size(); + for (int i = 0; i < nfield; i++) { + NCERRX( nc_inq_varid(ncid, keywords[i].c_str(), &thermovar[i]), keywords[i].c_str() ); } } @@ -432,22 +433,16 @@ void DumpNetCDF::openfile() // perframe variables if (thermo) { - Thermo *th = output->thermo; - for (int i = 0; i < th->nfield; i++) { - if (th->vtype[i] == Thermo::FLOAT) { - NCERRX( nc_def_var(ncid, th->keyword[i].c_str(), type_nc_real, 1, dims, - &thermovar[i]), th->keyword[i].c_str() ); - } else if (th->vtype[i] == Thermo::INT) { - NCERRX( nc_def_var(ncid, th->keyword[i].c_str(), NC_INT, 1, dims, - &thermovar[i]), th->keyword[i].c_str() ); - } else if (th->vtype[i] == Thermo::BIGINT) { -#if defined(LAMMPS_SMALLBIG) || defined(LAMMPS_BIGBIG) - NCERRX( nc_def_var(ncid, th->keyword[i].c_str(), NC_INT64, 1, dims, - &thermovar[i]), th->keyword[i].c_str() ); -#else - NCERRX( nc_def_var(ncid, th->keyword[i].c_str(), NC_LONG, 1, dims, - &thermovar[i]), th->keyword[i].c_str() ); -#endif + auto fields = output->thermo->get_fields(); + auto keywords = output->thermo->get_keywords(); + int nfield = fields.size(); + for (int i = 0; i < nfield; i++) { + if (fields[i].type == multitype::DOUBLE) { + NCERRX( nc_def_var(ncid, keywords[i].c_str(), type_nc_real, 1, dims, &thermovar[i]), keywords[i].c_str() ); + } else if (fields[i].type == multitype::INT) { + NCERRX( nc_def_var(ncid, keywords[i].c_str(), NC_INT, 1, dims, &thermovar[i]), keywords[i].c_str() ); + } else if (fields[i].type == multitype::BIGINT) { + NCERRX( nc_def_var(ncid, keywords[i].c_str(), NC_INT64, 1, dims, &thermovar[i]), keywords[i].c_str() ); } } } @@ -605,20 +600,17 @@ void DumpNetCDF::write() start[1] = 0; if (thermo) { - Thermo *th = output->thermo; - for (int i = 0; i < th->nfield; i++) { - th->call_vfunc(i); + auto keywords = output->thermo->get_keywords(); + auto fields = output->thermo->get_fields(); + int nfield = fields.size(); + for (int i = 0; i < nfield; i++) { if (filewriter) { - if (th->vtype[i] == Thermo::FLOAT) { - NCERRX( nc_put_var1_double(ncid, thermovar[i], start, - &th->dvalue), - th->keyword[i].c_str() ); - } else if (th->vtype[i] == Thermo::INT) { - NCERRX( nc_put_var1_int(ncid, thermovar[i], start, &th->ivalue), - th->keyword[i].c_str() ); - } else if (th->vtype[i] == Thermo::BIGINT) { - NCERRX( nc_put_var1_bigint(ncid, thermovar[i], start, &th->bivalue), - th->keyword[i].c_str() ); + if (fields[i].type == multitype::DOUBLE) { + NCERRX( nc_put_var1_double(ncid, thermovar[i], start, &fields[i].data.d), keywords[i].c_str() ); + } else if (fields[i].type == multitype::INT) { + NCERRX( nc_put_var1_int(ncid, thermovar[i], start, &fields[i].data.i), keywords[i].c_str() ); + } else if (fields[i].type == multitype::BIGINT) { + NCERRX( nc_put_var1_bigint(ncid, thermovar[i], start, &fields[i].data.b), keywords[i].c_str() ); } } } diff --git a/src/NETCDF/dump_netcdf_mpiio.cpp b/src/NETCDF/dump_netcdf_mpiio.cpp index 0282903d77..fdcd03470e 100644 --- a/src/NETCDF/dump_netcdf_mpiio.cpp +++ b/src/NETCDF/dump_netcdf_mpiio.cpp @@ -220,7 +220,7 @@ void DumpNetCDFMPIIO::openfile() if (thermo && !singlefile_opened) { delete[] thermovar; - thermovar = new int[output->thermo->nfield]; + thermovar = new int[output->thermo->get_keywords().size()]; } // now the computes and fixes have been initialized, so we can query @@ -318,9 +318,10 @@ void DumpNetCDFMPIIO::openfile() // perframe variables if (thermo) { - Thermo *th = output->thermo; - for (int i = 0; i < th->nfield; i++) { - NCERRX( ncmpi_inq_varid(ncid, th->keyword[i].c_str(), &thermovar[i]), th->keyword[i].c_str() ); + auto keywords = output->thermo->get_keywords(); + int nfield = keywords.size(); + for (int i = 0; i < nfield; i++) { + NCERRX( ncmpi_inq_varid(ncid, keywords[i].c_str(), &thermovar[i]), keywords[i].c_str() ); } } @@ -422,18 +423,16 @@ void DumpNetCDFMPIIO::openfile() // perframe variables if (thermo) { - Thermo *th = output->thermo; - for (int i = 0; i < th->nfield; i++) { - if (th->vtype[i] == Thermo::FLOAT) { - NCERRX( ncmpi_def_var(ncid, th->keyword[i].c_str(), type_nc_real, 1, dims, &thermovar[i]), th->keyword[i].c_str() ); - } else if (th->vtype[i] == Thermo::INT) { - NCERRX( ncmpi_def_var(ncid, th->keyword[i].c_str(), NC_INT, 1, dims, &thermovar[i]), th->keyword[i].c_str() ); - } else if (th->vtype[i] == Thermo::BIGINT) { -#if defined(LAMMPS_SMALLBIG) || defined(LAMMPS_BIGBIG) - NCERRX( ncmpi_def_var(ncid, th->keyword[i].c_str(), NC_INT64, 1, dims, &thermovar[i]), th->keyword[i].c_str() ); -#else - NCERRX( ncmpi_def_var(ncid, th->keyword[i].c_str(), NC_LONG, 1, dims, &thermovar[i]), th->keyword[i].c_str() ); -#endif + auto fields = output->thermo->get_fields(); + auto keywords = output->thermo->get_keywords(); + int nfield = fields.size(); + for (int i = 0; i < nfield; i++) { + if (fields[i].type == multitype::DOUBLE) { + NCERRX( ncmpi_def_var(ncid, keywords[i].c_str(), type_nc_real, 1, dims, &thermovar[i]), keywords[i].c_str() ); + } else if (fields[i].type == multitype::INT) { + NCERRX( ncmpi_def_var(ncid, keywords[i].c_str(), NC_INT, 1, dims, &thermovar[i]), keywords[i].c_str() ); + } else if (fields[i].type == multitype::BIGINT) { + NCERRX( ncmpi_def_var(ncid, keywords[i].c_str(), NC_INT64, 1, dims, &thermovar[i]), keywords[i].c_str() ); } } } @@ -594,20 +593,17 @@ void DumpNetCDFMPIIO::write() NCERR( ncmpi_begin_indep_data(ncid) ); if (thermo) { - Thermo *th = output->thermo; - for (int i = 0; i < th->nfield; i++) { - th->call_vfunc(i); + auto keywords = output->thermo->get_keywords(); + auto fields = output->thermo->get_fields(); + int nfield = fields.size(); + for (int i = 0; i < nfield; i++) { if (filewriter) { - if (th->vtype[i] == Thermo::FLOAT) { - NCERRX( ncmpi_put_var1_double(ncid, thermovar[i], start, - &th->dvalue), - th->keyword[i].c_str() ); - } else if (th->vtype[i] == Thermo::INT) { - NCERRX( ncmpi_put_var1_int(ncid, thermovar[i], start, &th->ivalue), - th->keyword[i].c_str() ); - } else if (th->vtype[i] == Thermo::BIGINT) { - NCERRX( ncmpi_put_var1_bigint(ncid, thermovar[i], start, &th->bivalue), - th->keyword[i].c_str() ); + if (fields[i].type == multitype::DOUBLE) { + NCERRX( ncmpi_put_var1_double(ncid, thermovar[i], start, &fields[i].data.d), keywords[i].c_str() ); + } else if (fields[i].type == multitype::INT) { + NCERRX( ncmpi_put_var1_int(ncid, thermovar[i], start, &fields[i].data.i), keywords[i].c_str() ); + } else if (fields[i].type == multitype::BIGINT) { + NCERRX( ncmpi_put_var1_bigint(ncid, thermovar[i], start, &fields[i].data.b), keywords[i].c_str() ); } } } diff --git a/src/thermo.cpp b/src/thermo.cpp index 0503018a3a..31c19fbdc2 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -361,7 +361,7 @@ void Thermo::compute(int flag) int i; firststep = flag; - bigint ntimestep = update->ntimestep; + ntimestep = update->ntimestep; // check for lost atoms // turn off normflag if natoms = 0 to avoid divide by 0 @@ -405,18 +405,23 @@ void Thermo::compute(int flag) } // add each thermo value to line with its specific format + field_data.clear(); + field_data.resize(nfield); for (ifield = 0; ifield < nfield; ifield++) { (this->*vfunc[ifield])(); if (vtype[ifield] == FLOAT) { snprintf(fmtbuf, sizeof(fmtbuf), format[ifield].c_str(), dvalue); line += fmtbuf; + field_data[ifield] = dvalue; } else if (vtype[ifield] == INT) { snprintf(fmtbuf, sizeof(fmtbuf), format[ifield].c_str(), ivalue); line += fmtbuf; + field_data[ifield] = ivalue; } else if (vtype[ifield] == BIGINT) { snprintf(fmtbuf, sizeof(fmtbuf), format[ifield].c_str(), bivalue); line += fmtbuf; + field_data[ifield] = bivalue; } } @@ -433,16 +438,6 @@ void Thermo::compute(int flag) firststep = 1; } -/* ---------------------------------------------------------------------- - call function to compute property -------------------------------------------------------------------------- */ - -void Thermo::call_vfunc(int ifield_in) -{ - ifield = ifield_in; - (this->*vfunc[ifield])(); -} - /* ---------------------------------------------------------------------- check for lost atoms, return current number of atoms also could number of warnings across MPI ranks and update total diff --git a/src/thermo.h b/src/thermo.h index eaec3eb9f8..8a5cba29d7 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -21,9 +21,6 @@ namespace LAMMPS_NS { class Thermo : protected Pointers { friend class MinCG; // accesses compute_pe - friend class DumpNetCDF; // accesses thermo properties - friend class DumpNetCDFMPIIO; // accesses thermo properties - friend class DumpYAML; // accesses thermo properties public: char *style; @@ -45,6 +42,11 @@ class Thermo : protected Pointers { void compute(int); int evaluate_keyword(const std::string &, double *); + // for accessing cached thermo data + bigint get_timestep() const { return ntimestep; } + const std::vector &get_fields() const { return field_data; } + const std::vector &get_keywords() const { return keyword; } + private: int nfield, nfield_initial; int *vtype; @@ -52,6 +54,7 @@ class Thermo : protected Pointers { std::vector keyword, format, format_column_user, keyword_user; std::string format_line_user, format_float_user, format_int_user, format_bigint_user; std::map key2col; + std::vector field_data; int normvalue; // use this for normflag unless natoms = 0 int normuserflag; // 0 if user has not set, 1 if has @@ -66,6 +69,7 @@ class Thermo : protected Pointers { bigint last_step; bigint natoms; + bigint ntimestep; // data used by routines that compute single values int ivalue; // integer value to print @@ -114,7 +118,6 @@ class Thermo : protected Pointers { typedef void (Thermo::*FnPtr)(); void addfield(const char *, FnPtr, int); FnPtr *vfunc; // list of ptrs to functions - void call_vfunc(int ifield); void compute_compute(); // functions that compute a single value void compute_fix(); // via calls to Compute,Fix,Variable classes From 0f925f7a39ea4fccd20e5bd35cf81dc56dd00296 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Jun 2023 04:33:08 -0400 Subject: [PATCH 149/172] reformat, add versionadded marker --- doc/src/compute_stress_mop.rst | 123 ++++++++++++++++++--------------- 1 file changed, 69 insertions(+), 54 deletions(-) diff --git a/doc/src/compute_stress_mop.rst b/doc/src/compute_stress_mop.rst index 7ab8c58a76..5662fc76d4 100644 --- a/doc/src/compute_stress_mop.rst +++ b/doc/src/compute_stress_mop.rst @@ -45,92 +45,107 @@ Examples Description """"""""""" -Compute *stress/mop* and compute *stress/mop/profile* define computations that -calculate components of the local stress tensor using the method of -planes :ref:`(Todd) `. Specifically in compute *stress/mop* calculates 3 -components are computed in directions *dir*,\ *x*\ ; *dir*,\ *y*\ ; and -*dir*,\ *z*\ ; where *dir* is the direction normal to the plane, while -in compute *stress/mop/profile* the profile of the stress is computed. +Compute *stress/mop* and compute *stress/mop/profile* define +computations that calculate components of the local stress tensor using +the method of planes :ref:`(Todd) `. Specifically in compute +*stress/mop* calculates 3 components are computed in directions *dir*,\ +*x*\ ; *dir*,\ *y*\ ; and *dir*,\ *z*\ ; where *dir* is the direction +normal to the plane, while in compute *stress/mop/profile* the profile +of the stress is computed. Contrary to methods based on histograms of atomic stress (i.e., using -:doc:`compute stress/atom `), the method of planes is -compatible with mechanical balance in heterogeneous systems and at +:doc:`compute stress/atom `), the method of planes +is compatible with mechanical balance in heterogeneous systems and at interfaces :ref:`(Todd) `. The stress tensor is the sum of a kinetic term and a configurational term, which are given respectively by Eq. (21) and Eq. (16) in -:ref:`(Todd) `. For the kinetic part, the algorithm considers that -atoms have crossed the plane if their positions at times :math:`t-\Delta t` -and :math:`t` are one on either side of the plane, and uses the velocity at -time :math:`t-\Delta t/2` given by the velocity Verlet algorithm. +:ref:`(Todd) `. For the kinetic part, the algorithm considers +that atoms have crossed the plane if their positions at times +:math:`t-\Delta t` and :math:`t` are one on either side of the plane, +and uses the velocity at time :math:`t-\Delta t/2` given by the velocity +Verlet algorithm. -Between one and six keywords can be used to indicate which -contributions to the stress must be computed: total stress (total), kinetic stress (kin), -configurational stress (conf), stress due to bond stretching (bond), -stress due to angle bending (angle) and/or due to pairwise non-bonded interactions (pair). -The angle keyword is currently available only for the stress/mop command and not the stress/mop/profile. +.. versionadded:: TBD -NOTE 1: The configurational stress is computed considering all pairs of atoms where at least one atom belongs to group group-ID. + contributions from bond and angle potentials + +Between one and six keywords can be used to indicate which contributions +to the stress must be computed: total stress (total), kinetic stress +(kin), configurational stress (conf), stress due to bond stretching +(bond), stress due to angle bending (angle) and/or due to pairwise +non-bonded interactions (pair). The angle keyword is currently +available only for the *stress/mop* command and **not** the +*stress/mop/profile* command. + +NOTE 1: The configurational stress is computed considering all pairs of +atoms where at least one atom belongs to group group-ID. NOTE 2: The local stress does not include any Lennard-Jones tail -corrections to the stress added by the :doc:`pair_modify tail yes ` -command, since those are contributions to the global system pressure. +corrections to the stress added by the :doc:`pair_modify tail yes +` command, since those are contributions to the global +system pressure. -NOTE 3: The local stress profile generated by compute *stress/mop/profile* -is similar to that obtained by compute -:doc:`stress/cartesian `. -A key difference is that compute *stress/mop/profile* considers particles -crossing a set of planes, while compute *stress/cartesian* computes averages -for a set of small volumes. More information -on the similarities and differences can be found in -:ref:`(Ikeshoji)`. +NOTE 3: The local stress profile generated by compute +*stress/mop/profile* is similar to that obtained by compute +:doc:`stress/cartesian `. A key difference is +that compute *stress/mop/profile* considers particles crossing a set of +planes, while compute *stress/cartesian* computes averages for a set of +small volumes. More information on the similarities and differences can +be found in :ref:`(Ikeshoji)`. Output info """"""""""" -Compute *stress/mop* calculates a global vector (indices starting at 1), with 3 -values for each declared keyword (in the order the keywords have been -declared). For each keyword, the stress tensor components are ordered as -follows: stress_dir,x, stress_dir,y, and stress_dir,z. +Compute *stress/mop* calculates a global vector (indices starting at 1), +with 3 values for each declared keyword (in the order the keywords have +been declared). For each keyword, the stress tensor components are +ordered as follows: stress_dir,x, stress_dir,y, and stress_dir,z. -Compute *stress/mop/profile* instead calculates a global array, with 1 column -giving the position of the planes where the stress tensor was computed, -and with 3 columns of values for each declared keyword (in the order the -keywords have been declared). For each keyword, the profiles of stress -tensor components are ordered as follows: stress_dir,x; stress_dir,y; -and stress_dir,z. +Compute *stress/mop/profile* instead calculates a global array, with 1 +column giving the position of the planes where the stress tensor was +computed, and with 3 columns of values for each declared keyword (in the +order the keywords have been declared). For each keyword, the profiles +of stress tensor components are ordered as follows: stress_dir,x; +stress_dir,y; and stress_dir,z. The values are in pressure :doc:`units `. -The values produced by this compute can be accessed by various :doc:`output commands `. -For instance, the results can be written to a file using the -:doc:`fix ave/time ` command. Please see the example -in the examples/PACKAGES/mop folder. +The values produced by this compute can be accessed by various +:doc:`output commands `. For instance, the results can be +written to a file using the :doc:`fix ave/time ` +command. Please see the example in the examples/PACKAGES/mop folder. Restrictions """""""""""" -These styles are part of the EXTRA-COMPUTE package. They are only enabled if -LAMMPS is built with that package. See the :doc:`Build package ` -doc page on for more info. +These styles are part of the EXTRA-COMPUTE package. They are only +enabled if LAMMPS is built with that package. See the :doc:`Build +package ` doc page on for more info. The method is only implemented for 3d orthogonal simulation boxes whose size does not change in time, and axis-aligned planes. The method only works with two-body pair interactions, because it -requires the class method pair->single() to be implemented. In -particular, compute *stress/mop/profile* does not work with more than -two-body pair interactions, long range (kspace) interactions and angle/dihedral/improper -intramolecular interactions. Similarly, compute *stress/mop* does not work with more than -two-body pair interactions, long range (kspace) interactions and dihedral/improper -intramolecular interactions but works with all bond interactions with the class method -single() implemented and all angle interactions with the class method born_matrix() -implemented. +requires the class method ``Pair::single()`` to be implemented, which is +not possible for manybody potentials. In particular, compute +*stress/mop/profile* does not work with more than two-body pair +interactions, long range (kspace) interactions and +angle/dihedral/improper intramolecular interactions. Similarly, compute +*stress/mop* does not work with more than two-body pair interactions, +long range (kspace) interactions and dihedral/improper intramolecular +interactions but works with all bond interactions with the class method +single() implemented and all angle interactions with the class method +born_matrix() implemented. Related commands """""""""""""""" -:doc:`compute stress/atom `, :doc:`compute pressure `, :doc:`compute stress/cartesian `, :doc:`compute stress/cylinder `, :doc:`compute stress/spherical ` +:doc:`compute stress/atom `, +:doc:`compute pressure `, +:doc:`compute stress/cartesian `, +:doc:`compute stress/cylinder `, +:doc:`compute stress/spherical ` Default """"""" From 53b1af7720c9246eec9cbadf6ef0cb39bcc30fad Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Jun 2023 05:11:53 -0400 Subject: [PATCH 150/172] LAMMPS programming style/conventions updates --- src/EXTRA-COMPUTE/compute_stress_mop.cpp | 171 ++++++++---------- src/EXTRA-COMPUTE/compute_stress_mop.h | 2 +- .../compute_stress_mop_profile.cpp | 96 +++++----- .../compute_stress_mop_profile.h | 2 +- 4 files changed, 126 insertions(+), 145 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.cpp b/src/EXTRA-COMPUTE/compute_stress_mop.cpp index e5d0e2ed13..98e3bf7043 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_mop.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -14,6 +13,7 @@ /*------------------------------------------------------------------------ Contributing Authors : Romain Vermorel (LFCR), Laurent Joly (ULyon) + Support for bonds and angles added by : Evangelos Voyiatzis (NovaMechanics) --------------------------------------------------------------------------*/ #include "compute_stress_mop.h" @@ -22,6 +22,7 @@ #include "atom.h" #include "atom_vec.h" #include "bond.h" +#include "comm.h" #include "domain.h" #include "error.h" #include "force.h" @@ -37,50 +38,49 @@ using namespace LAMMPS_NS; -enum{X,Y,Z}; -enum{TOTAL,CONF,KIN,PAIR,BOND,ANGLE}; +enum { X, Y, Z }; +enum { TOTAL, CONF, KIN, PAIR, BOND, ANGLE }; +// clang-format off /* ---------------------------------------------------------------------- */ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) { - if (narg < 6) error->all(FLERR,"Illegal compute stress/mop command"); - - MPI_Comm_rank(world,&me); + if (narg < 6) utils::missing_cmd_args(FLERR, "compute stress/mop", error); bondflag = 0; angleflag = 0; // set compute mode and direction of plane(s) for pressure calculation - if (strcmp(arg[3],"x")==0) { + if (strcmp(arg[3],"x") == 0) { dir = X; - } else if (strcmp(arg[3],"y")==0) { + } else if (strcmp(arg[3],"y") == 0) { dir = Y; - } else if (strcmp(arg[3],"z")==0) { + } else if (strcmp(arg[3],"z") == 0) { dir = Z; } else error->all(FLERR,"Illegal compute stress/mop command"); // Position of the plane - if (strcmp(arg[4],"lower")==0) { + if (strcmp(arg[4],"lower") == 0) { pos = domain->boxlo[dir]; - } else if (strcmp(arg[4],"upper")==0) { + } else if (strcmp(arg[4],"upper") == 0) { pos = domain->boxhi[dir]; - } else if (strcmp(arg[4],"center")==0) { + } else if (strcmp(arg[4],"center") == 0) { pos = 0.5*(domain->boxlo[dir]+domain->boxhi[dir]); } else pos = utils::numeric(FLERR,arg[4],false,lmp); // plane inside the box - if (pos >domain->boxhi[dir] || pos boxlo[dir]) { - error->warning(FLERR,"The specified initial plane lies outside of the simulation box"); - double dx[3] {0}; + if ((pos > domain->boxhi[dir]) || (pos < domain->boxlo[dir])) { + error->warning(FLERR, "The specified initial plane lies outside of the simulation box"); + double dx[3] = {0.0, 0.0, 0.0}; dx[dir] = pos - 0.5*(domain->boxhi[dir] + domain->boxlo[dir]); domain->minimum_image(dx[0], dx[1], dx[2]); pos = 0.5*(domain->boxhi[dir] + domain->boxlo[dir]) + dx[dir]; - if (pos >domain->boxhi[dir] || pos boxlo[dir]) + if ((pos > domain->boxhi[dir]) || (pos < domain->boxlo[dir])) error->all(FLERR, "Plane for compute stress/mop is out of bounds"); } @@ -133,15 +133,15 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : iarg++; } - // Error check + // Error checks // 3D only - if (domain->dimension < 3) - error->all(FLERR, "Compute stress/mop incompatible with simulation dimension"); + if (domain->dimension != 3) + error->all(FLERR, "Compute stress/mop requires a 3d system"); // orthogonal simulation box if (domain->triclinic != 0) - error->all(FLERR, "Compute stress/mop incompatible with triclinic simulation box"); + error->all(FLERR, "Compute stress/mop is incompatible with triclinic simulation box"); // Initialize some variables @@ -154,12 +154,12 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : // this fix produces a global vector memory->create(vector,nvalues,"stress/mop:vector"); - memory->create(values_local,nvalues,"stress/mop/spatial:values_local"); - memory->create(values_global,nvalues,"stress/mop/spatial:values_global"); - memory->create(bond_local,nvalues,"stress/mop/spatial:bond_local"); - memory->create(bond_global,nvalues,"stress/mop/spatial:bond_global"); - memory->create(angle_local,nvalues,"stress/mop/spatial:angle_local"); - memory->create(angle_global,nvalues,"stress/mop/spatial:angle_global"); + memory->create(values_local,nvalues,"stress/mop:values_local"); + memory->create(values_global,nvalues,"stress/mop:values_global"); + memory->create(bond_local,nvalues,"stress/mop:bond_local"); + memory->create(bond_global,nvalues,"stress/mop:bond_global"); + memory->create(angle_local,nvalues,"stress/mop:angle_local"); + memory->create(angle_global,nvalues,"stress/mop:angle_global"); size_vector = nvalues; vector_flag = 1; @@ -171,8 +171,7 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : ComputeStressMop::~ComputeStressMop() { - - delete [] which; + delete[] which; memory->destroy(values_local); memory->destroy(values_global); @@ -209,36 +208,39 @@ void ComputeStressMop::init() // Compute stress/mop requires fixed simulation box if (domain->box_change_size || domain->box_change_shape || domain->deform_flag) - error->all(FLERR, "Compute stress/mop requires a fixed simulation box"); + error->all(FLERR, "Compute stress/mop requires a fixed size simulation box"); // This compute requires a pair style with pair_single method implemented - if (force->pair == nullptr) + if (!force->pair) error->all(FLERR,"No pair style is defined for compute stress/mop"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute stress/mop"); // Errors - if (me==0) { + if (comm->me == 0) { // issue an error for unimplemented intramolecular potentials or Kspace. - if (force->bond!=nullptr) bondflag = 1; - if (force->angle!=nullptr) + if (force->bond) bondflag = 1; + if (force->angle) { if (force->angle->born_matrix_enable == 0) { if ((strcmp(force->angle_style, "zero") != 0) && (strcmp(force->angle_style, "none") != 0)) error->all(FLERR,"compute stress/mop does not account for angle potentials"); } else { angleflag = 1; } - if (force->dihedral!=nullptr) + } + if (force->dihedral) { if ((strcmp(force->dihedral_style, "zero") != 0) && (strcmp(force->dihedral_style, "none") != 0)) error->all(FLERR,"compute stress/mop does not account for dihedral potentials"); - if (force->improper!=nullptr) + } + if (force->improper) { if ((strcmp(force->improper_style, "zero") != 0) && (strcmp(force->improper_style, "none") != 0)) error->all(FLERR,"compute stress/mop does not account for improper potentials"); - if (force->kspace!=nullptr) + } + if (force->kspace) error->warning(FLERR,"compute stress/mop does not account for kspace contributions"); } @@ -266,8 +268,7 @@ void ComputeStressMop::compute_vector() compute_pairs(); // sum pressure contributions over all procs - MPI_Allreduce(values_local,values_global,nvalues, - MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(values_local,values_global,nvalues,MPI_DOUBLE,MPI_SUM,world); if (bondflag) { //Compute bond contribution on separate procs @@ -292,7 +293,6 @@ void ComputeStressMop::compute_vector() for (int m=0; mpos) && (xj[dir]pos1) && (xj[dir] pos) && (xj[dir] < pos)) || ((xi[dir] > pos1) && (xj[dir] < pos1))) { pair->single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fpair); - values_local[m] += fpair*(xi[0]-xj[0])/area*nktv2p; values_local[m+1] += fpair*(xi[1]-xj[1])/area*nktv2p; values_local[m+2] += fpair*(xi[2]-xj[2])/area*nktv2p; - } - else if (((xi[dir]pos)) || ((xi[dir]pos1))) { - + } else if (((xi[dir] < pos) && (xj[dir] > pos)) || ((xi[dir] < pos1) && (xj[dir] > pos1))) { pair->single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fpair); - values_local[m] -= fpair*(xi[0]-xj[0])/area*nktv2p; values_local[m+1] -= fpair*(xi[1]-xj[1])/area*nktv2p; values_local[m+2] -= fpair*(xi[2]-xj[2])/area*nktv2p; } - } else { - - if (((xi[dir]>pos) && (xj[dir]pos1) && (xj[dir] pos) && (xj[dir] < pos)) || ((xi[dir] > pos1) && (xj[dir] < pos1))) { pair->single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fpair); - values_local[m] += fpair*(xi[0]-xj[0])/area*nktv2p; values_local[m+1] += fpair*(xi[1]-xj[1])/area*nktv2p; values_local[m+2] += fpair*(xi[2]-xj[2])/area*nktv2p; } - } - } - } - } // Compute kinetic contribution to pressure // counts local particles transfers across the plane - if (which[m] == KIN || which[m] == TOTAL) { + if ((which[m] == KIN) || (which[m] == TOTAL)) { double sgn; for (int i = 0; i < nlocal; i++) { @@ -447,13 +434,13 @@ void ComputeStressMop::compute_pairs() //coordinates at t-dt (based on Velocity-Verlet alg.) if (rmass) { - xj[0] = xi[0]-vi[0]*dt+fi[0]/2/rmass[i]*dt*dt*ftm2v; - xj[1] = xi[1]-vi[1]*dt+fi[1]/2/rmass[i]*dt*dt*ftm2v; - xj[2] = xi[2]-vi[2]*dt+fi[2]/2/rmass[i]*dt*dt*ftm2v; + xj[0] = xi[0]-vi[0]*dt+fi[0]/2.0/rmass[i]*dt*dt*ftm2v; + xj[1] = xi[1]-vi[1]*dt+fi[1]/2.0/rmass[i]*dt*dt*ftm2v; + xj[2] = xi[2]-vi[2]*dt+fi[2]/2.0/rmass[i]*dt*dt*ftm2v; } else { - xj[0] = xi[0]-vi[0]*dt+fi[0]/2/mass[itype]*dt*dt*ftm2v; - xj[1] = xi[1]-vi[1]*dt+fi[1]/2/mass[itype]*dt*dt*ftm2v; - xj[2] = xi[2]-vi[2]*dt+fi[2]/2/mass[itype]*dt*dt*ftm2v; + xj[0] = xi[0]-vi[0]*dt+fi[0]/2.0/mass[itype]*dt*dt*ftm2v; + xj[1] = xi[1]-vi[1]*dt+fi[1]/2.0/mass[itype]*dt*dt*ftm2v; + xj[2] = xi[2]-vi[2]*dt+fi[2]/2.0/mass[itype]*dt*dt*ftm2v; } // because LAMMPS does not put atoms back in the box @@ -463,21 +450,21 @@ void ComputeStressMop::compute_pairs() double pos_temp = pos+copysign(1.0,domain->prd_half[dir]-pos)*domain->prd[dir]; if (fabs(xi[dir]-pos)bond; - double dx[3] {0}; - double x_bond_1[3] {0}; - double x_bond_2[3] {0}; - double local_contribution[3] {0}; + double dx[3] = {0.0, 0.0, 0.0}; + double x_bond_1[3] = {0.0, 0.0, 0.0}; + double x_bond_2[3] = {0.0, 0.0, 0.0}; + double local_contribution[3] = {0.0, 0.0, 0.0}; // initialization - for (int i {0}; i < nvalues; i++) bond_local[i] = 0.0; + for (int i = 0; i < nvalues; i++) bond_local[i] = 0.0; // loop over all bonded atoms in the current proc for (atom1 = 0; atom1 < nlocal; atom1++) { @@ -591,7 +578,7 @@ void ComputeStressMop::compute_bonds() } // loop over the keywords and if necessary add the bond contribution - int m {0}; + int m = 0; while (mangle; double duang, du2ang; - double dx[3] {0}; - double dx_left[3] {0}; - double dx_right[3] {0}; - double x_angle_left[3] {0}; - double x_angle_middle[3] {0}; - double x_angle_right[3] {0}; - double dcos_theta[3] {0}; - double local_contribution[3] {0}; + double dx[3] = {0.0, 0.0, 0.0}; + double dx_left[3] = {0.0, 0.0, 0.0}; + double dx_right[3] = {0.0, 0.0, 0.0}; + double x_angle_left[3] = {0.0, 0.0, 0.0}; + double x_angle_middle[3] = {0.0, 0.0, 0.0}; + double x_angle_right[3] = {0.0, 0.0, 0.0}; + double dcos_theta[3] = {0.0, 0.0, 0.0}; + double local_contribution[3] = {0.0, 0.0, 0.0}; // initialization - for (int i {0}; i < nvalues; i++) angle_local[i] = 0.0; + for (int i = 0; i < nvalues; i++) angle_local[i] = 0.0; for (atom2 = 0; atom2 < nlocal; atom2++) { if (!(mask[atom2] & groupbit)) continue; @@ -762,8 +749,8 @@ void ComputeStressMop::compute_angles() } } // loop over the keywords and if necessary add the angle contribution - int m {0}; - while (m #include using namespace LAMMPS_NS; -enum{X,Y,Z}; -enum{LOWER,CENTER,UPPER,COORD}; -enum{TOTAL,CONF,KIN,PAIR,BOND}; +enum { X, Y, Z }; +enum { LOWER, CENTER, UPPER, COORD }; +enum { TOTAL, CONF, KIN, PAIR, BOND }; +// clang-format off /* ---------------------------------------------------------------------- */ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) { - if (narg < 7) error->all(FLERR,"Illegal compute stress/mop/profile command"); - - MPI_Comm_rank(world,&me); + if (narg < 7) utils::missing_cmd_args(FLERR, "compute stress/mop/profile", error); bondflag = 0; // set compute mode and direction of plane(s) for pressure calculation - if (strcmp(arg[3],"x")==0) { + if (strcmp(arg[3],"x") == 0) { dir = X; - } else if (strcmp(arg[3],"y")==0) { + } else if (strcmp(arg[3],"y") == 0) { dir = Y; - } else if (strcmp(arg[3],"z")==0) { + } else if (strcmp(arg[3],"z") == 0) { dir = Z; } else error->all(FLERR,"Illegal compute stress/mop/profile command"); @@ -67,8 +67,7 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a else if (strcmp(arg[4],"center") == 0) originflag = CENTER; else if (strcmp(arg[4],"upper") == 0) originflag = UPPER; else originflag = COORD; - if (originflag == COORD) - origin = utils::numeric(FLERR,arg[4],false,lmp); + if (originflag == COORD) origin = utils::numeric(FLERR,arg[4],false,lmp); delta = utils::numeric(FLERR,arg[5],false,lmp); invdelta = 1.0/delta; @@ -149,8 +148,7 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a ComputeStressMopProfile::~ComputeStressMopProfile() { - - delete [] which; + delete[] which; memory->destroy(coord); memory->destroy(coordp); @@ -166,7 +164,6 @@ ComputeStressMopProfile::~ComputeStressMopProfile() void ComputeStressMopProfile::init() { - // conversion constants nktv2p = force->nktv2p; @@ -192,30 +189,30 @@ void ComputeStressMopProfile::init() //This compute requires a pair style with pair_single method implemented - if (force->pair == nullptr) + if (!force->pair) error->all(FLERR,"No pair style is defined for compute stress/mop/profile"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute stress/mop/profile"); // Errors - if (me==0) { + if (comm->me == 0) { //Compute stress/mop/profile only accounts for pair interactions. // issue an error if any intramolecular potential or Kspace is defined. - if (force->bond!=nullptr) bondflag = 1; + if (force->bond) bondflag = 1; - if (force->angle!=nullptr) + if (force->angle) if ((strcmp(force->angle_style, "zero") != 0) && (strcmp(force->angle_style, "none") != 0)) error->all(FLERR,"compute stress/mop/profile does not account for angle potentials"); - if (force->dihedral!=nullptr) + if (force->dihedral) if ((strcmp(force->dihedral_style, "zero") != 0) && (strcmp(force->dihedral_style, "none") != 0)) error->all(FLERR,"compute stress/mop/profile does not account for dihedral potentials"); - if (force->improper!=nullptr) + if (force->improper) if ((strcmp(force->improper_style, "zero") != 0) && (strcmp(force->improper_style, "none") != 0)) error->all(FLERR,"compute stress/mop/profile does not account for improper potentials"); - if (force->kspace!=nullptr) + if (force->kspace) error->warning(FLERR,"compute stress/mop/profile does not account for kspace contributions"); } @@ -244,8 +241,7 @@ void ComputeStressMopProfile::compute_array() compute_pairs(); // sum pressure contributions over all procs - MPI_Allreduce(&values_local[0][0],&values_global[0][0],nbins*nvalues, - MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(&values_local[0][0],&values_global[0][0],nbins*nvalues,MPI_DOUBLE,MPI_SUM,world); if (bondflag) { //Compute bond contribution on separate procs @@ -259,16 +255,14 @@ void ComputeStressMopProfile::compute_array() } // sum bond contribution over all procs - MPI_Allreduce(&bond_local[0][0],&bond_global[0][0],nbins*nvalues, - MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(&bond_local[0][0],&bond_global[0][0],nbins*nvalues,MPI_DOUBLE,MPI_SUM,world); - int ibin,m,mo; - for (ibin=0; ibinbond; - double dx[3] {0}; - double x_bond_1[3] {0}; - double x_bond_2[3] {0}; + double dx[3] = {0.0, 0.0, 0.0}; + double x_bond_1[3] = {0.0, 0.0, 0.0}; + double x_bond_2[3] = {0.0, 0.0, 0.0}; // initialization - for (int m {0}; m < nbins; m++) { - for (int i {0}; i < nvalues; i++) { + for (int m = 0; m < nbins; m++) { + for (int i = 0; i < nvalues; i++) { bond_local[m][i] = 0.0; } local_contribution[m][0] = 0.0; @@ -557,7 +551,7 @@ void ComputeStressMopProfile::compute_bonds() if (newton_bond == 0 && tag[atom1] > tag[atom2]) continue; if (btype <= 0) continue; - for (int ibin {0}; ibin Date: Wed, 7 Jun 2023 06:20:24 -0400 Subject: [PATCH 151/172] remove unused include and related statements --- src/INTERLAYER/pair_aip_water_2dm.cpp | 7 ------- src/INTERLAYER/pair_ilp_tmd.cpp | 4 ---- src/OPT/pair_aip_water_2dm_opt.cpp | 10 ---------- 3 files changed, 21 deletions(-) diff --git a/src/INTERLAYER/pair_aip_water_2dm.cpp b/src/INTERLAYER/pair_aip_water_2dm.cpp index f2d68f448b..6e2bf7228d 100644 --- a/src/INTERLAYER/pair_aip_water_2dm.cpp +++ b/src/INTERLAYER/pair_aip_water_2dm.cpp @@ -20,21 +20,14 @@ #include "pair_aip_water_2dm.h" -#include "atom.h" #include "citeme.h" #include "error.h" #include "force.h" -#include "interlayer_taper.h" -#include "memory.h" -#include "my_page.h" -#include "neigh_list.h" -#include "neigh_request.h" #include #include using namespace LAMMPS_NS; -using namespace InterLayer; #define MAXLINE 1024 #define DELTA 4 diff --git a/src/INTERLAYER/pair_ilp_tmd.cpp b/src/INTERLAYER/pair_ilp_tmd.cpp index f29ee34180..fd3a2f8c6f 100644 --- a/src/INTERLAYER/pair_ilp_tmd.cpp +++ b/src/INTERLAYER/pair_ilp_tmd.cpp @@ -35,10 +35,6 @@ using namespace LAMMPS_NS; using namespace InterLayer; -#define MAXLINE 1024 -#define DELTA 4 -#define PGDELTA 1 - static const char cite_ilp_tmd[] = "ilp/tmd potential doi:10.1021/acs.jctc.1c00782\n" "@Article{Ouyang2021\n" diff --git a/src/OPT/pair_aip_water_2dm_opt.cpp b/src/OPT/pair_aip_water_2dm_opt.cpp index 3aba5b9dbd..47c8c395db 100644 --- a/src/OPT/pair_aip_water_2dm_opt.cpp +++ b/src/OPT/pair_aip_water_2dm_opt.cpp @@ -33,21 +33,11 @@ #include "pair_aip_water_2dm_opt.h" #include "atom.h" -#include "citeme.h" -#include "comm.h" -#include "error.h" -#include "force.h" -#include "interlayer_taper.h" #include "memory.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "neighbor.h" -#include #include using namespace LAMMPS_NS; -using namespace InterLayer; PairAIPWATER2DMOpt::PairAIPWATER2DMOpt(LAMMPS *lmp) : PairILPGrapheneHBN(lmp), PairILPTMD(lmp), PairAIPWATER2DM(lmp), PairILPGrapheneHBNOpt(lmp) From 37d894db51074724b20ff1e6befe8c4f7099320f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Jun 2023 06:30:07 -0400 Subject: [PATCH 152/172] update/clarify docs --- doc/src/pair_aip_water_2dm.rst | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/doc/src/pair_aip_water_2dm.rst b/doc/src/pair_aip_water_2dm.rst index 5218db9c37..f57e4b33fb 100644 --- a/doc/src/pair_aip_water_2dm.rst +++ b/doc/src/pair_aip_water_2dm.rst @@ -59,22 +59,20 @@ a continuous cutoff (up to third derivative) for interatomic separations larger than :math:`r_c` :doc:`pair_style ilp_graphene_hbn `. -It is important to include all the pairs to build the neighbor list for -calculating the normals. - .. note:: - Since each water molecule contains one oxygen atom and two hydrogen - atoms, a new definition is proposed (see In :ref:`(Feng) `),the - atomic normal vectors of hydrogen atoms are assumed to lie along the - corresponding oxygen-hydrogen bonds and the normal vector of the - central oxygen atom is defined as their average. + This pair style uses the atomic normal vector definition from + :ref:`(Feng) `), where the atomic normal vectors of the + hydrogen atoms are assumed to lie along the corresponding + oxygen-hydrogen bonds and the normal vector of the central oxygen + atom is defined as their average. The provided parameter file, ``COH.aip.water.2dm``, is intended for use with *metal* :doc:`units `, with energies in meV. Two additional parameters, *S*, and *rcut* are included in the parameter file. *S* is -designed to facilitate scaling of energies; *rcut* is designed to build -the neighbor list for calculating the normals for each atom pair. +designed to facilitate scaling of energies; *rcut* is the cutoff for an +internal, short distance neighbor list that is generated for speeding up +the calculation of the normals for all atom pairs. .. note:: @@ -83,9 +81,9 @@ the neighbor list for calculating the normals for each atom pair. setting the cutoff equal to 16.0 Angstrom. Using a different cutoff or taper function setting should be carefully checked as they can lead to significant errors. These parameters provide a good - description in both short- and long-range interaction regimes. This - feature is essential for simulations in high pressure regime (i.e., - the interlayer distance is smaller than the equilibrium distance). + description in both short- and long-range interaction regimes. This + is essential for simulations in high pressure regime (i.e., the + interlayer distance is smaller than the equilibrium distance). This potential must be used in combination with hybrid/overlay. Other interactions can be set to zero using :doc:`pair_coeff settings From 57f166670f08fe7a683306172ca4d5527e6564cb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Jun 2023 06:38:52 -0400 Subject: [PATCH 153/172] fix versionadded macro so it is detected when actual version is added --- doc/src/pair_aip_water_2dm.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/pair_aip_water_2dm.rst b/doc/src/pair_aip_water_2dm.rst index f57e4b33fb..532ee8f8f6 100644 --- a/doc/src/pair_aip_water_2dm.rst +++ b/doc/src/pair_aip_water_2dm.rst @@ -33,7 +33,7 @@ Examples Description """"""""""" -.. versionadded:: xxxx2023 +.. versionadded:: TBD The *aip/water/2dm* style computes the anisotropic interfacial potential (AIP) potential for interfaces of water with two-dimensional (2D) From 6360c02daaa882c73770aaebd3a11f1239b398f6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Jun 2023 14:04:41 -0400 Subject: [PATCH 154/172] use explicit const references --- src/EXTRA-DUMP/dump_yaml.cpp | 6 +++--- src/NETCDF/dump_netcdf.cpp | 10 +++++----- src/NETCDF/dump_netcdf_mpiio.cpp | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/EXTRA-DUMP/dump_yaml.cpp b/src/EXTRA-DUMP/dump_yaml.cpp index 029415164f..ec7d26af31 100644 --- a/src/EXTRA-DUMP/dump_yaml.cpp +++ b/src/EXTRA-DUMP/dump_yaml.cpp @@ -64,10 +64,10 @@ void DumpYAML::write_header(bigint ndump) if (update->ntimestep == th->get_timestep()) { thermo_data += "thermo:\n - keywords: [ "; - for (auto key : th->get_keywords()) thermo_data += fmt::format("{}, ", key); + for (const auto &key : th->get_keywords()) thermo_data += fmt::format("{}, ", key); thermo_data += "]\n - data: [ "; - for (auto val : th->get_fields()) { + for (const auto &val : th->get_fields()) { if (val.type == multitype::DOUBLE) thermo_data += fmt::format("{}, ", val.data.d); else if (val.type == multitype::INT) @@ -90,7 +90,7 @@ void DumpYAML::write_header(bigint ndump) fmt::print(fp, "natoms: {}\n", ndump); fputs("boundary: [ ", fp); - for (const auto bflag : boundary) { + for (const auto &bflag : boundary) { if (bflag == ' ') continue; fmt::print(fp, "{}, ", bflag); } diff --git a/src/NETCDF/dump_netcdf.cpp b/src/NETCDF/dump_netcdf.cpp index cb6aea16cf..8c99ff1f70 100644 --- a/src/NETCDF/dump_netcdf.cpp +++ b/src/NETCDF/dump_netcdf.cpp @@ -320,7 +320,7 @@ void DumpNetCDF::openfile() // perframe variables if (thermo) { - auto keywords = output->thermo->get_keywords(); + const auto &keywords = output->thermo->get_keywords(); int nfield = keywords.size(); for (int i = 0; i < nfield; i++) { NCERRX( nc_inq_varid(ncid, keywords[i].c_str(), &thermovar[i]), keywords[i].c_str() ); @@ -433,8 +433,8 @@ void DumpNetCDF::openfile() // perframe variables if (thermo) { - auto fields = output->thermo->get_fields(); - auto keywords = output->thermo->get_keywords(); + const auto &fields = output->thermo->get_fields(); + const auto &keywords = output->thermo->get_keywords(); int nfield = fields.size(); for (int i = 0; i < nfield; i++) { if (fields[i].type == multitype::DOUBLE) { @@ -600,8 +600,8 @@ void DumpNetCDF::write() start[1] = 0; if (thermo) { - auto keywords = output->thermo->get_keywords(); - auto fields = output->thermo->get_fields(); + const auto &keywords = output->thermo->get_keywords(); + const auto &fields = output->thermo->get_fields(); int nfield = fields.size(); for (int i = 0; i < nfield; i++) { if (filewriter) { diff --git a/src/NETCDF/dump_netcdf_mpiio.cpp b/src/NETCDF/dump_netcdf_mpiio.cpp index fdcd03470e..3aec34dd40 100644 --- a/src/NETCDF/dump_netcdf_mpiio.cpp +++ b/src/NETCDF/dump_netcdf_mpiio.cpp @@ -318,7 +318,7 @@ void DumpNetCDFMPIIO::openfile() // perframe variables if (thermo) { - auto keywords = output->thermo->get_keywords(); + const auto &keywords = output->thermo->get_keywords(); int nfield = keywords.size(); for (int i = 0; i < nfield; i++) { NCERRX( ncmpi_inq_varid(ncid, keywords[i].c_str(), &thermovar[i]), keywords[i].c_str() ); @@ -423,8 +423,8 @@ void DumpNetCDFMPIIO::openfile() // perframe variables if (thermo) { - auto fields = output->thermo->get_fields(); - auto keywords = output->thermo->get_keywords(); + const auto &fields = output->thermo->get_fields(); + const auto &keywords = output->thermo->get_keywords(); int nfield = fields.size(); for (int i = 0; i < nfield; i++) { if (fields[i].type == multitype::DOUBLE) { @@ -593,8 +593,8 @@ void DumpNetCDFMPIIO::write() NCERR( ncmpi_begin_indep_data(ncid) ); if (thermo) { - auto keywords = output->thermo->get_keywords(); - auto fields = output->thermo->get_fields(); + const auto &keywords = output->thermo->get_keywords(); + const auto &fields = output->thermo->get_fields(); int nfield = fields.size(); for (int i = 0; i < nfield; i++) { if (filewriter) { From b7afe412dc939876b0165eaa7325c8bed9e0e56c Mon Sep 17 00:00:00 2001 From: jtclemm Date: Wed, 7 Jun 2023 13:08:46 -0600 Subject: [PATCH 155/172] Updating SDPD examples --- .../2d-diffusion-in-shear-flow/in.lammps | 6 +- ...g.24Oct18.2d-diffusion-in-shear-flow.g++.1 | 247 ----------------- ...g.24Oct18.2d-diffusion-in-shear-flow.g++.4 | 247 ----------------- ...g.28Mar23.2d-diffusion-in-shear-flow.g++.1 | 253 ++++++++++++++++++ ...g.28Mar23.2d-diffusion-in-shear-flow.g++.4 | 253 ++++++++++++++++++ .../dpd-smooth/2d-diffusion/in.lammps | 6 +- .../log.24Oct18.2d-diffusion.g++.1 | 226 ---------------- .../log.24Oct18.2d-diffusion.g++.4 | 226 ---------------- .../log.28Mar23.2d-diffusion.g++.1 | 230 ++++++++++++++++ .../log.28Mar23.2d-diffusion.g++.4 | 230 ++++++++++++++++ .../equipartition-verification/in.lammps | 6 +- ....g++.1 => log.28Mar23.equipartition.g++.1} | 91 ++++--- ....g++.4 => log.28Mar23.equipartition.g++.4} | 91 ++++--- 13 files changed, 1069 insertions(+), 1043 deletions(-) delete mode 100644 examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.24Oct18.2d-diffusion-in-shear-flow.g++.1 delete mode 100644 examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.24Oct18.2d-diffusion-in-shear-flow.g++.4 create mode 100644 examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.28Mar23.2d-diffusion-in-shear-flow.g++.1 create mode 100644 examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.28Mar23.2d-diffusion-in-shear-flow.g++.4 delete mode 100644 examples/PACKAGES/dpd-smooth/2d-diffusion/log.24Oct18.2d-diffusion.g++.1 delete mode 100644 examples/PACKAGES/dpd-smooth/2d-diffusion/log.24Oct18.2d-diffusion.g++.4 create mode 100644 examples/PACKAGES/dpd-smooth/2d-diffusion/log.28Mar23.2d-diffusion.g++.1 create mode 100644 examples/PACKAGES/dpd-smooth/2d-diffusion/log.28Mar23.2d-diffusion.g++.4 rename examples/PACKAGES/dpd-smooth/equipartition-verification/{log.24Oct18.equipartition.g++.1 => log.28Mar23.equipartition.g++.1} (58%) rename examples/PACKAGES/dpd-smooth/equipartition-verification/{log.24Oct18.equipartition.g++.4 => log.28Mar23.equipartition.g++.4} (58%) diff --git a/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/in.lammps b/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/in.lammps index 138f7b5338..dd50a5e69f 100644 --- a/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/in.lammps +++ b/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/in.lammps @@ -1,6 +1,6 @@ dimension 2 units micro -atom_style meso +atom_style sph variable R equal 0.5 # radius of sphere micrometers variable a equal $R/5 # lattice spacing micrometers @@ -37,12 +37,12 @@ group upper_wall type 3 group lower_wall type 4 mass * ${mass} -set group all meso/rho ${rho_0} +set group all sph/rho ${rho_0} pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed pair_coeff * * ${rho_0} ${c_0} ${h} -fix 1 fluid meso +fix 1 fluid sph fix 2 sphere rigid/meso single fix 3 upper_wall meso/move linear +${wall_velocity} 0 0 units box fix 4 lower_wall meso/move linear -${wall_velocity} 0 0 units box diff --git a/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.24Oct18.2d-diffusion-in-shear-flow.g++.1 b/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.24Oct18.2d-diffusion-in-shear-flow.g++.1 deleted file mode 100644 index cd01601292..0000000000 --- a/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.24Oct18.2d-diffusion-in-shear-flow.g++.1 +++ /dev/null @@ -1,247 +0,0 @@ -LAMMPS (24 Oct 2018) -dimension 2 -units micro -atom_style meso - -variable R equal 0.5 # radius of sphere micrometers -variable a equal $R/5 # lattice spacing micrometers -variable a equal 0.5/5 -variable Lf equal $R*3 -variable Lf equal 0.5*3 -variable Lb equal $R*4 -variable Lb equal 0.5*4 -variable wall_velocity equal 0.01 # micrometers/microsecond -variable T equal 300. -variable rho_0 equal 1. # density picograms/micrometer^3 -variable c_0 equal 100. # speed of sound micrometers/microsecond -variable mu equal 1. # dynamic viscosity picogram/(micrometer-microsecond) -variable h equal $a*4.5 # kernel function cutoff micrometers -variable h equal 0.1*4.5 -variable mass equal $a*$a*$a*${rho_0} -variable mass equal 0.1*$a*$a*${rho_0} -variable mass equal 0.1*0.1*$a*${rho_0} -variable mass equal 0.1*0.1*0.1*${rho_0} -variable mass equal 0.1*0.1*0.1*1 -variable dt equal 1e-3 # timestep microseconds -variable skin equal 0.2*$h -variable skin equal 0.2*0.45 - -region box block -${Lb} ${Lb} -${Lb} ${Lb} 0 ${a} units box -region box block -2 ${Lb} -${Lb} ${Lb} 0 ${a} units box -region box block -2 2 -${Lb} ${Lb} 0 ${a} units box -region box block -2 2 -2 ${Lb} 0 ${a} units box -region box block -2 2 -2 2 0 ${a} units box -region box block -2 2 -2 2 0 0.1 units box -create_box 4 box -Created orthogonal box = (-2 -2 0) to (2 2 0.1) - 1 by 1 by 1 MPI processor grid -lattice sq $a -lattice sq 0.1 -Lattice spacing in x,y,z = 0.1 0.1 0.1 - -create_atoms 1 box -Created 1600 atoms - Time spent = 0.00169706 secs - -region sphere sphere 0 0 0 $R units box -region sphere sphere 0 0 0 0.5 units box -set region sphere type 2 - 81 settings made for type - -region upper_wall block INF INF +${Lf} INF INF INF units box -region upper_wall block INF INF +1.5 INF INF INF units box -set region upper_wall type 3 - 200 settings made for type - -region lower_wall block INF INF INF -${Lf} INF INF units box -region lower_wall block INF INF INF -1.5 INF INF units box -set region lower_wall type 4 - 240 settings made for type - -group fluid type 1 -1079 atoms in group fluid -group sphere type 2 -81 atoms in group sphere -group upper_wall type 3 -200 atoms in group upper_wall -group lower_wall type 4 -240 atoms in group lower_wall - -mass * ${mass} -mass * 0.001 -set group all meso/rho ${rho_0} -set group all meso/rho 1 - 1600 settings made for meso/rho - -pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed -pair_style sdpd/taitwater/isothermal 300 ${mu} 76787 -pair_style sdpd/taitwater/isothermal 300 1 76787 -pair_coeff * * ${rho_0} ${c_0} ${h} -pair_coeff * * 1 ${c_0} ${h} -pair_coeff * * 1 100 ${h} -pair_coeff * * 1 100 0.45 - -fix 1 fluid meso -fix 2 sphere rigid/meso single -1 rigid bodies with 81 atoms -fix 3 upper_wall meso/move linear +${wall_velocity} 0 0 units box -fix 3 upper_wall meso/move linear +0.01 0 0 units box -fix 4 lower_wall meso/move linear -${wall_velocity} 0 0 units box -fix 4 lower_wall meso/move linear -0.01 0 0 units box - -fix 2d all enforce2d - -neighbor ${skin} bin -neighbor 0.09 bin -neigh_modify delay 0 every 1 check yes -timestep ${dt} -timestep 0.001 - -dump dump_id all atom 100 dump.lammpstrj - -thermo 100 -thermo_style custom step time nbuild ndanger - -run 10000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0.54 - ghost atom cutoff = 0.54 - binsize = 0.27, bins = 15 15 1 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair sdpd/taitwater/isothermal, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/2d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 6.937 | 6.937 | 6.937 Mbytes -Step Time Nbuild Ndanger - 0 0 0 0 - 100 0.1 0 0 - 200 0.2 0 0 - 300 0.3 0 0 - 400 0.4 0 0 - 500 0.5 1 0 - 600 0.6 1 0 - 700 0.7 2 0 - 800 0.8 2 0 - 900 0.9 2 0 - 1000 1 3 0 - 1100 1.1 3 0 - 1200 1.2 3 0 - 1300 1.3 4 0 - 1400 1.4 4 0 - 1500 1.5 4 0 - 1600 1.6 5 0 - 1700 1.7 5 0 - 1800 1.8 5 0 - 1900 1.9 6 0 - 2000 2 6 0 - 2100 2.1 6 0 - 2200 2.2 7 0 - 2300 2.3 7 0 - 2400 2.4 7 0 - 2500 2.5 8 0 - 2600 2.6 8 0 - 2700 2.7 8 0 - 2800 2.8 9 0 - 2900 2.9 9 0 - 3000 3 9 0 - 3100 3.1 10 0 - 3200 3.2 10 0 - 3300 3.3 10 0 - 3400 3.4 11 0 - 3500 3.5 11 0 - 3600 3.6 11 0 - 3700 3.7 12 0 - 3800 3.8 12 0 - 3900 3.9 12 0 - 4000 4 13 0 - 4100 4.1 13 0 - 4200 4.2 14 0 - 4300 4.3 14 0 - 4400 4.4 14 0 - 4500 4.5 15 0 - 4600 4.6 15 0 - 4700 4.7 15 0 - 4800 4.8 16 0 - 4900 4.9 16 0 - 5000 5 16 0 - 5100 5.1 17 0 - 5200 5.2 17 0 - 5300 5.3 17 0 - 5400 5.4 17 0 - 5500 5.5 18 0 - 5600 5.6 18 0 - 5700 5.7 19 0 - 5800 5.8 19 0 - 5900 5.9 19 0 - 6000 6 20 0 - 6100 6.1 20 0 - 6200 6.2 21 0 - 6300 6.3 21 0 - 6400 6.4 21 0 - 6500 6.5 22 0 - 6600 6.6 22 0 - 6700 6.7 22 0 - 6800 6.8 23 0 - 6900 6.9 23 0 - 7000 7 23 0 - 7100 7.1 24 0 - 7200 7.2 24 0 - 7300 7.3 25 0 - 7400 7.4 25 0 - 7500 7.5 25 0 - 7600 7.6 26 0 - 7700 7.7 26 0 - 7800 7.8 26 0 - 7900 7.9 27 0 - 8000 8 27 0 - 8100 8.1 27 0 - 8200 8.2 28 0 - 8300 8.3 28 0 - 8400 8.4 28 0 - 8500 8.5 29 0 - 8600 8.6 29 0 - 8700 8.7 30 0 - 8800 8.8 30 0 - 8900 8.9 30 0 - 9000 9 31 0 - 9100 9.1 31 0 - 9200 9.2 31 0 - 9300 9.3 32 0 - 9400 9.4 32 0 - 9500 9.5 32 0 - 9600 9.6 33 0 - 9700 9.7 33 0 - 9800 9.8 33 0 - 9900 9.9 34 0 - 10000 10 34 0 -Loop time of 144.208 on 1 procs for 10000 steps with 1600 atoms - -Performance: 5991348.580 ns/day, 0.000 hours/ns, 69.344 timesteps/s -99.7% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 143.08 | 143.08 | 143.08 | 0.0 | 99.22 -Neigh | 0.033195 | 0.033195 | 0.033195 | 0.0 | 0.02 -Comm | 0.24139 | 0.24139 | 0.24139 | 0.0 | 0.17 -Output | 0.11687 | 0.11687 | 0.11687 | 0.0 | 0.08 -Modify | 0.61566 | 0.61566 | 0.61566 | 0.0 | 0.43 -Other | | 0.117 | | | 0.08 - -Nlocal: 1600 ave 1600 max 1600 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 993 ave 993 max 993 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 73236 ave 73236 max 73236 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 73236 -Ave neighs/atom = 45.7725 -Neighbor list builds = 34 -Dangerous builds = 0 -Total wall time: 0:02:24 diff --git a/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.24Oct18.2d-diffusion-in-shear-flow.g++.4 b/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.24Oct18.2d-diffusion-in-shear-flow.g++.4 deleted file mode 100644 index 77823e00fc..0000000000 --- a/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.24Oct18.2d-diffusion-in-shear-flow.g++.4 +++ /dev/null @@ -1,247 +0,0 @@ -LAMMPS (24 Oct 2018) -dimension 2 -units micro -atom_style meso - -variable R equal 0.5 # radius of sphere micrometers -variable a equal $R/5 # lattice spacing micrometers -variable a equal 0.5/5 -variable Lf equal $R*3 -variable Lf equal 0.5*3 -variable Lb equal $R*4 -variable Lb equal 0.5*4 -variable wall_velocity equal 0.01 # micrometers/microsecond -variable T equal 300. -variable rho_0 equal 1. # density picograms/micrometer^3 -variable c_0 equal 100. # speed of sound micrometers/microsecond -variable mu equal 1. # dynamic viscosity picogram/(micrometer-microsecond) -variable h equal $a*4.5 # kernel function cutoff micrometers -variable h equal 0.1*4.5 -variable mass equal $a*$a*$a*${rho_0} -variable mass equal 0.1*$a*$a*${rho_0} -variable mass equal 0.1*0.1*$a*${rho_0} -variable mass equal 0.1*0.1*0.1*${rho_0} -variable mass equal 0.1*0.1*0.1*1 -variable dt equal 1e-3 # timestep microseconds -variable skin equal 0.2*$h -variable skin equal 0.2*0.45 - -region box block -${Lb} ${Lb} -${Lb} ${Lb} 0 ${a} units box -region box block -2 ${Lb} -${Lb} ${Lb} 0 ${a} units box -region box block -2 2 -${Lb} ${Lb} 0 ${a} units box -region box block -2 2 -2 ${Lb} 0 ${a} units box -region box block -2 2 -2 2 0 ${a} units box -region box block -2 2 -2 2 0 0.1 units box -create_box 4 box -Created orthogonal box = (-2 -2 0) to (2 2 0.1) - 2 by 2 by 1 MPI processor grid -lattice sq $a -lattice sq 0.1 -Lattice spacing in x,y,z = 0.1 0.1 0.1 - -create_atoms 1 box -Created 1600 atoms - Time spent = 0.000589566 secs - -region sphere sphere 0 0 0 $R units box -region sphere sphere 0 0 0 0.5 units box -set region sphere type 2 - 81 settings made for type - -region upper_wall block INF INF +${Lf} INF INF INF units box -region upper_wall block INF INF +1.5 INF INF INF units box -set region upper_wall type 3 - 200 settings made for type - -region lower_wall block INF INF INF -${Lf} INF INF units box -region lower_wall block INF INF INF -1.5 INF INF units box -set region lower_wall type 4 - 240 settings made for type - -group fluid type 1 -1079 atoms in group fluid -group sphere type 2 -81 atoms in group sphere -group upper_wall type 3 -200 atoms in group upper_wall -group lower_wall type 4 -240 atoms in group lower_wall - -mass * ${mass} -mass * 0.001 -set group all meso/rho ${rho_0} -set group all meso/rho 1 - 1600 settings made for meso/rho - -pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed -pair_style sdpd/taitwater/isothermal 300 ${mu} 76787 -pair_style sdpd/taitwater/isothermal 300 1 76787 -pair_coeff * * ${rho_0} ${c_0} ${h} -pair_coeff * * 1 ${c_0} ${h} -pair_coeff * * 1 100 ${h} -pair_coeff * * 1 100 0.45 - -fix 1 fluid meso -fix 2 sphere rigid/meso single -1 rigid bodies with 81 atoms -fix 3 upper_wall meso/move linear +${wall_velocity} 0 0 units box -fix 3 upper_wall meso/move linear +0.01 0 0 units box -fix 4 lower_wall meso/move linear -${wall_velocity} 0 0 units box -fix 4 lower_wall meso/move linear -0.01 0 0 units box - -fix 2d all enforce2d - -neighbor ${skin} bin -neighbor 0.09 bin -neigh_modify delay 0 every 1 check yes -timestep ${dt} -timestep 0.001 - -dump dump_id all atom 100 dump.lammpstrj - -thermo 100 -thermo_style custom step time nbuild ndanger - -run 10000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0.54 - ghost atom cutoff = 0.54 - binsize = 0.27, bins = 15 15 1 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair sdpd/taitwater/isothermal, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/2d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 6.854 | 6.854 | 6.854 Mbytes -Step Time Nbuild Ndanger - 0 0 0 0 - 100 0.1 0 0 - 200 0.2 0 0 - 300 0.3 0 0 - 400 0.4 1 0 - 500 0.5 1 0 - 600 0.6 1 0 - 700 0.7 2 0 - 800 0.8 2 0 - 900 0.9 2 0 - 1000 1 3 0 - 1100 1.1 3 0 - 1200 1.2 4 0 - 1300 1.3 4 0 - 1400 1.4 4 0 - 1500 1.5 4 0 - 1600 1.6 5 0 - 1700 1.7 5 0 - 1800 1.8 5 0 - 1900 1.9 6 0 - 2000 2 6 0 - 2100 2.1 6 0 - 2200 2.2 6 0 - 2300 2.3 7 0 - 2400 2.4 7 0 - 2500 2.5 7 0 - 2600 2.6 8 0 - 2700 2.7 8 0 - 2800 2.8 8 0 - 2900 2.9 9 0 - 3000 3 9 0 - 3100 3.1 9 0 - 3200 3.2 10 0 - 3300 3.3 10 0 - 3400 3.4 10 0 - 3500 3.5 11 0 - 3600 3.6 11 0 - 3700 3.7 11 0 - 3800 3.8 12 0 - 3900 3.9 12 0 - 4000 4 12 0 - 4100 4.1 13 0 - 4200 4.2 13 0 - 4300 4.3 13 0 - 4400 4.4 14 0 - 4500 4.5 14 0 - 4600 4.6 15 0 - 4700 4.7 15 0 - 4800 4.8 15 0 - 4900 4.9 16 0 - 5000 5 16 0 - 5100 5.1 17 0 - 5200 5.2 17 0 - 5300 5.3 17 0 - 5400 5.4 17 0 - 5500 5.5 18 0 - 5600 5.6 18 0 - 5700 5.7 18 0 - 5800 5.8 19 0 - 5900 5.9 19 0 - 6000 6 20 0 - 6100 6.1 20 0 - 6200 6.2 20 0 - 6300 6.3 21 0 - 6400 6.4 21 0 - 6500 6.5 21 0 - 6600 6.6 22 0 - 6700 6.7 22 0 - 6800 6.8 22 0 - 6900 6.9 23 0 - 7000 7 23 0 - 7100 7.1 23 0 - 7200 7.2 24 0 - 7300 7.3 24 0 - 7400 7.4 25 0 - 7500 7.5 25 0 - 7600 7.6 25 0 - 7700 7.7 25 0 - 7800 7.8 26 0 - 7900 7.9 26 0 - 8000 8 26 0 - 8100 8.1 27 0 - 8200 8.2 27 0 - 8300 8.3 27 0 - 8400 8.4 28 0 - 8500 8.5 28 0 - 8600 8.6 28 0 - 8700 8.7 29 0 - 8800 8.8 29 0 - 8900 8.9 29 0 - 9000 9 30 0 - 9100 9.1 30 0 - 9200 9.2 31 0 - 9300 9.3 31 0 - 9400 9.4 31 0 - 9500 9.5 32 0 - 9600 9.6 32 0 - 9700 9.7 32 0 - 9800 9.8 32 0 - 9900 9.9 33 0 - 10000 10 33 0 -Loop time of 63.2372 on 4 procs for 10000 steps with 1600 atoms - -Performance: 13662841.706 ns/day, 0.000 hours/ns, 158.135 timesteps/s -94.3% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 51.576 | 53.662 | 55.484 | 23.9 | 84.86 -Neigh | 0.011519 | 0.012395 | 0.013405 | 0.7 | 0.02 -Comm | 6.8389 | 8.5423 | 10.517 | 56.1 | 13.51 -Output | 0.12342 | 0.12513 | 0.1302 | 0.8 | 0.20 -Modify | 0.58708 | 0.69128 | 0.78806 | 11.3 | 1.09 -Other | | 0.2038 | | | 0.32 - -Nlocal: 400 ave 411 max 388 min -Histogram: 1 1 0 0 0 0 0 0 0 2 -Nghost: 552.25 ave 567 max 539 min -Histogram: 2 0 0 0 0 0 0 0 1 1 -Neighs: 18298.8 ave 18781 max 17829 min -Histogram: 2 0 0 0 0 0 0 0 0 2 - -Total # of neighbors = 73195 -Ave neighs/atom = 45.7469 -Neighbor list builds = 33 -Dangerous builds = 0 -Total wall time: 0:01:03 diff --git a/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.28Mar23.2d-diffusion-in-shear-flow.g++.1 b/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.28Mar23.2d-diffusion-in-shear-flow.g++.1 new file mode 100644 index 0000000000..c4c11205e1 --- /dev/null +++ b/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.28Mar23.2d-diffusion-in-shear-flow.g++.1 @@ -0,0 +1,253 @@ +LAMMPS (28 Mar 2023 - Development) +dimension 2 +units micro +atom_style sph + +variable R equal 0.5 # radius of sphere micrometers +variable a equal $R/5 # lattice spacing micrometers +variable a equal 0.5/5 +variable Lf equal $R*3 +variable Lf equal 0.5*3 +variable Lb equal $R*4 +variable Lb equal 0.5*4 +variable wall_velocity equal 0.01 # micrometers/microsecond +variable T equal 300. +variable rho_0 equal 1. # density picograms/micrometer^3 +variable c_0 equal 100. # speed of sound micrometers/microsecond +variable mu equal 1. # dynamic viscosity picogram/(micrometer-microsecond) +variable h equal $a*4.5 # kernel function cutoff micrometers +variable h equal 0.1*4.5 +variable mass equal $a*$a*$a*${rho_0} +variable mass equal 0.1*$a*$a*${rho_0} +variable mass equal 0.1*0.1*$a*${rho_0} +variable mass equal 0.1*0.1*0.1*${rho_0} +variable mass equal 0.1*0.1*0.1*1 +variable dt equal 1e-3 # timestep microseconds +variable skin equal 0.2*$h +variable skin equal 0.2*0.45 + +region box block -${Lb} ${Lb} -${Lb} ${Lb} 0 ${a} units box +region box block -2 ${Lb} -${Lb} ${Lb} 0 ${a} units box +region box block -2 2 -${Lb} ${Lb} 0 ${a} units box +region box block -2 2 -2 ${Lb} 0 ${a} units box +region box block -2 2 -2 2 0 ${a} units box +region box block -2 2 -2 2 0 0.1 units box +create_box 4 box +Created orthogonal box = (-2 -2 0) to (2 2 0.1) + 1 by 1 by 1 MPI processor grid +lattice sq $a +lattice sq 0.1 +Lattice spacing in x,y,z = 0.1 0.1 0.1 + +create_atoms 1 box +Created 1600 atoms + using lattice units in orthogonal box = (-2 -2 0) to (2 2 0.1) + create_atoms CPU = 0.001 seconds + +region sphere sphere 0 0 0 $R units box +region sphere sphere 0 0 0 0.5 units box +set region sphere type 2 +Setting atom values ... + 81 settings made for type + +region upper_wall block INF INF +${Lf} INF INF INF units box +region upper_wall block INF INF +1.5 INF INF INF units box +set region upper_wall type 3 +Setting atom values ... + 200 settings made for type + +region lower_wall block INF INF INF -${Lf} INF INF units box +region lower_wall block INF INF INF -1.5 INF INF units box +set region lower_wall type 4 +Setting atom values ... + 240 settings made for type + +group fluid type 1 +1079 atoms in group fluid +group sphere type 2 +81 atoms in group sphere +group upper_wall type 3 +200 atoms in group upper_wall +group lower_wall type 4 +240 atoms in group lower_wall + +mass * ${mass} +mass * 0.001 +set group all sph/rho ${rho_0} +set group all sph/rho 1 +Setting atom values ... + 1600 settings made for sph/rho + +pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed +pair_style sdpd/taitwater/isothermal 300 ${mu} 76787 +pair_style sdpd/taitwater/isothermal 300 1 76787 +pair_coeff * * ${rho_0} ${c_0} ${h} +pair_coeff * * 1 ${c_0} ${h} +pair_coeff * * 1 100 ${h} +pair_coeff * * 1 100 0.45 + +fix 1 fluid sph +fix 2 sphere rigid/meso single + 1 rigid bodies with 81 atoms +fix 3 upper_wall meso/move linear +${wall_velocity} 0 0 units box +fix 3 upper_wall meso/move linear +0.01 0 0 units box +fix 4 lower_wall meso/move linear -${wall_velocity} 0 0 units box +fix 4 lower_wall meso/move linear -0.01 0 0 units box + +fix 2d all enforce2d + +neighbor ${skin} bin +neighbor 0.09 bin +neigh_modify delay 0 every 1 check yes +timestep ${dt} +timestep 0.001 + +dump dump_id all atom 100 dump.lammpstrj + +thermo 100 +thermo_style custom step time nbuild ndanger + +run 10000 +Generated 0 of 6 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0.54 + ghost atom cutoff = 0.54 + binsize = 0.27, bins = 15 15 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair sdpd/taitwater/isothermal, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/2d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 7.313 | 7.313 | 7.313 Mbytes + Step Time Nbuild Ndanger + 0 0 0 0 + 100 0.1 0 0 + 200 0.2 0 0 + 300 0.3 0 0 + 400 0.4 0 0 + 500 0.5 1 0 + 600 0.6 1 0 + 700 0.7 2 0 + 800 0.8 2 0 + 900 0.9 2 0 + 1000 1 3 0 + 1100 1.1 3 0 + 1200 1.2 3 0 + 1300 1.3 4 0 + 1400 1.4 4 0 + 1500 1.5 4 0 + 1600 1.6 5 0 + 1700 1.7 5 0 + 1800 1.8 5 0 + 1900 1.9 6 0 + 2000 2 6 0 + 2100 2.1 6 0 + 2200 2.2 7 0 + 2300 2.3 7 0 + 2400 2.4 7 0 + 2500 2.5 8 0 + 2600 2.6 8 0 + 2700 2.7 8 0 + 2800 2.8 9 0 + 2900 2.9 9 0 + 3000 3 9 0 + 3100 3.1 10 0 + 3200 3.2 10 0 + 3300 3.3 10 0 + 3400 3.4 11 0 + 3500 3.5 11 0 + 3600 3.6 11 0 + 3700 3.7 12 0 + 3800 3.8 12 0 + 3900 3.9 12 0 + 4000 4 13 0 + 4100 4.1 13 0 + 4200 4.2 14 0 + 4300 4.3 14 0 + 4400 4.4 14 0 + 4500 4.5 15 0 + 4600 4.6 15 0 + 4700 4.7 15 0 + 4800 4.8 16 0 + 4900 4.9 16 0 + 5000 5 16 0 + 5100 5.1 17 0 + 5200 5.2 17 0 + 5300 5.3 17 0 + 5400 5.4 17 0 + 5500 5.5 18 0 + 5600 5.6 18 0 + 5700 5.7 19 0 + 5800 5.8 19 0 + 5900 5.9 19 0 + 6000 6 20 0 + 6100 6.1 20 0 + 6200 6.2 21 0 + 6300 6.3 21 0 + 6400 6.4 21 0 + 6500 6.5 22 0 + 6600 6.6 22 0 + 6700 6.7 22 0 + 6800 6.8 23 0 + 6900 6.9 23 0 + 7000 7 23 0 + 7100 7.1 24 0 + 7200 7.2 24 0 + 7300 7.3 25 0 + 7400 7.4 25 0 + 7500 7.5 25 0 + 7600 7.6 26 0 + 7700 7.7 26 0 + 7800 7.8 26 0 + 7900 7.9 27 0 + 8000 8 27 0 + 8100 8.1 27 0 + 8200 8.2 28 0 + 8300 8.3 28 0 + 8400 8.4 28 0 + 8500 8.5 29 0 + 8600 8.6 29 0 + 8700 8.7 30 0 + 8800 8.8 30 0 + 8900 8.9 30 0 + 9000 9 31 0 + 9100 9.1 31 0 + 9200 9.2 31 0 + 9300 9.3 32 0 + 9400 9.4 32 0 + 9500 9.5 32 0 + 9600 9.6 33 0 + 9700 9.7 33 0 + 9800 9.8 33 0 + 9900 9.9 34 0 + 10000 10 34 0 +Loop time of 131.724 on 1 procs for 10000 steps with 1600 atoms + +Performance: 6559168.339 ns/day, 0.000 hours/ns, 75.916 timesteps/s, 121.466 katom-step/s +99.7% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 130.89 | 130.89 | 130.89 | 0.0 | 99.37 +Neigh | 0.02884 | 0.02884 | 0.02884 | 0.0 | 0.02 +Comm | 0.17863 | 0.17863 | 0.17863 | 0.0 | 0.14 +Output | 0.095497 | 0.095497 | 0.095497 | 0.0 | 0.07 +Modify | 0.42063 | 0.42063 | 0.42063 | 0.0 | 0.32 +Other | | 0.1069 | | | 0.08 + +Nlocal: 1600 ave 1600 max 1600 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 993 ave 993 max 993 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 73236 ave 73236 max 73236 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 73236 +Ave neighs/atom = 45.7725 +Neighbor list builds = 34 +Dangerous builds = 0 +Total wall time: 0:02:11 diff --git a/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.28Mar23.2d-diffusion-in-shear-flow.g++.4 b/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.28Mar23.2d-diffusion-in-shear-flow.g++.4 new file mode 100644 index 0000000000..6cb58bc233 --- /dev/null +++ b/examples/PACKAGES/dpd-smooth/2d-diffusion-in-shear-flow/log.28Mar23.2d-diffusion-in-shear-flow.g++.4 @@ -0,0 +1,253 @@ +LAMMPS (28 Mar 2023 - Development) +dimension 2 +units micro +atom_style sph + +variable R equal 0.5 # radius of sphere micrometers +variable a equal $R/5 # lattice spacing micrometers +variable a equal 0.5/5 +variable Lf equal $R*3 +variable Lf equal 0.5*3 +variable Lb equal $R*4 +variable Lb equal 0.5*4 +variable wall_velocity equal 0.01 # micrometers/microsecond +variable T equal 300. +variable rho_0 equal 1. # density picograms/micrometer^3 +variable c_0 equal 100. # speed of sound micrometers/microsecond +variable mu equal 1. # dynamic viscosity picogram/(micrometer-microsecond) +variable h equal $a*4.5 # kernel function cutoff micrometers +variable h equal 0.1*4.5 +variable mass equal $a*$a*$a*${rho_0} +variable mass equal 0.1*$a*$a*${rho_0} +variable mass equal 0.1*0.1*$a*${rho_0} +variable mass equal 0.1*0.1*0.1*${rho_0} +variable mass equal 0.1*0.1*0.1*1 +variable dt equal 1e-3 # timestep microseconds +variable skin equal 0.2*$h +variable skin equal 0.2*0.45 + +region box block -${Lb} ${Lb} -${Lb} ${Lb} 0 ${a} units box +region box block -2 ${Lb} -${Lb} ${Lb} 0 ${a} units box +region box block -2 2 -${Lb} ${Lb} 0 ${a} units box +region box block -2 2 -2 ${Lb} 0 ${a} units box +region box block -2 2 -2 2 0 ${a} units box +region box block -2 2 -2 2 0 0.1 units box +create_box 4 box +Created orthogonal box = (-2 -2 0) to (2 2 0.1) + 2 by 2 by 1 MPI processor grid +lattice sq $a +lattice sq 0.1 +Lattice spacing in x,y,z = 0.1 0.1 0.1 + +create_atoms 1 box +Created 1600 atoms + using lattice units in orthogonal box = (-2 -2 0) to (2 2 0.1) + create_atoms CPU = 0.001 seconds + +region sphere sphere 0 0 0 $R units box +region sphere sphere 0 0 0 0.5 units box +set region sphere type 2 +Setting atom values ... + 81 settings made for type + +region upper_wall block INF INF +${Lf} INF INF INF units box +region upper_wall block INF INF +1.5 INF INF INF units box +set region upper_wall type 3 +Setting atom values ... + 200 settings made for type + +region lower_wall block INF INF INF -${Lf} INF INF units box +region lower_wall block INF INF INF -1.5 INF INF units box +set region lower_wall type 4 +Setting atom values ... + 240 settings made for type + +group fluid type 1 +1079 atoms in group fluid +group sphere type 2 +81 atoms in group sphere +group upper_wall type 3 +200 atoms in group upper_wall +group lower_wall type 4 +240 atoms in group lower_wall + +mass * ${mass} +mass * 0.001 +set group all sph/rho ${rho_0} +set group all sph/rho 1 +Setting atom values ... + 1600 settings made for sph/rho + +pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed +pair_style sdpd/taitwater/isothermal 300 ${mu} 76787 +pair_style sdpd/taitwater/isothermal 300 1 76787 +pair_coeff * * ${rho_0} ${c_0} ${h} +pair_coeff * * 1 ${c_0} ${h} +pair_coeff * * 1 100 ${h} +pair_coeff * * 1 100 0.45 + +fix 1 fluid sph +fix 2 sphere rigid/meso single + 1 rigid bodies with 81 atoms +fix 3 upper_wall meso/move linear +${wall_velocity} 0 0 units box +fix 3 upper_wall meso/move linear +0.01 0 0 units box +fix 4 lower_wall meso/move linear -${wall_velocity} 0 0 units box +fix 4 lower_wall meso/move linear -0.01 0 0 units box + +fix 2d all enforce2d + +neighbor ${skin} bin +neighbor 0.09 bin +neigh_modify delay 0 every 1 check yes +timestep ${dt} +timestep 0.001 + +dump dump_id all atom 100 dump.lammpstrj + +thermo 100 +thermo_style custom step time nbuild ndanger + +run 10000 +Generated 0 of 6 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0.54 + ghost atom cutoff = 0.54 + binsize = 0.27, bins = 15 15 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair sdpd/taitwater/isothermal, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/2d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 7.23 | 7.23 | 7.23 Mbytes + Step Time Nbuild Ndanger + 0 0 0 0 + 100 0.1 0 0 + 200 0.2 0 0 + 300 0.3 0 0 + 400 0.4 1 0 + 500 0.5 1 0 + 600 0.6 1 0 + 700 0.7 2 0 + 800 0.8 2 0 + 900 0.9 2 0 + 1000 1 3 0 + 1100 1.1 3 0 + 1200 1.2 3 0 + 1300 1.3 4 0 + 1400 1.4 4 0 + 1500 1.5 4 0 + 1600 1.6 5 0 + 1700 1.7 5 0 + 1800 1.8 5 0 + 1900 1.9 6 0 + 2000 2 6 0 + 2100 2.1 6 0 + 2200 2.2 7 0 + 2300 2.3 7 0 + 2400 2.4 7 0 + 2500 2.5 8 0 + 2600 2.6 8 0 + 2700 2.7 8 0 + 2800 2.8 9 0 + 2900 2.9 9 0 + 3000 3 9 0 + 3100 3.1 10 0 + 3200 3.2 10 0 + 3300 3.3 10 0 + 3400 3.4 11 0 + 3500 3.5 11 0 + 3600 3.6 11 0 + 3700 3.7 12 0 + 3800 3.8 12 0 + 3900 3.9 12 0 + 4000 4 13 0 + 4100 4.1 13 0 + 4200 4.2 13 0 + 4300 4.3 14 0 + 4400 4.4 14 0 + 4500 4.5 14 0 + 4600 4.6 14 0 + 4700 4.7 15 0 + 4800 4.8 15 0 + 4900 4.9 16 0 + 5000 5 16 0 + 5100 5.1 16 0 + 5200 5.2 17 0 + 5300 5.3 17 0 + 5400 5.4 17 0 + 5500 5.5 18 0 + 5600 5.6 18 0 + 5700 5.7 18 0 + 5800 5.8 19 0 + 5900 5.9 19 0 + 6000 6 20 0 + 6100 6.1 20 0 + 6200 6.2 20 0 + 6300 6.3 21 0 + 6400 6.4 21 0 + 6500 6.5 21 0 + 6600 6.6 22 0 + 6700 6.7 22 0 + 6800 6.8 22 0 + 6900 6.9 23 0 + 7000 7 23 0 + 7100 7.1 23 0 + 7200 7.2 24 0 + 7300 7.3 24 0 + 7400 7.4 24 0 + 7500 7.5 25 0 + 7600 7.6 25 0 + 7700 7.7 25 0 + 7800 7.8 25 0 + 7900 7.9 26 0 + 8000 8 26 0 + 8100 8.1 26 0 + 8200 8.2 27 0 + 8300 8.3 27 0 + 8400 8.4 28 0 + 8500 8.5 28 0 + 8600 8.6 28 0 + 8700 8.7 29 0 + 8800 8.8 29 0 + 8900 8.9 29 0 + 9000 9 30 0 + 9100 9.1 30 0 + 9200 9.2 30 0 + 9300 9.3 31 0 + 9400 9.4 31 0 + 9500 9.5 31 0 + 9600 9.6 32 0 + 9700 9.7 32 0 + 9800 9.8 32 0 + 9900 9.9 32 0 + 10000 10 33 0 +Loop time of 24.8261 on 4 procs for 10000 steps with 1600 atoms + +Performance: 34802055.618 ns/day, 0.000 hours/ns, 402.802 timesteps/s, 644.483 katom-step/s +99.1% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 21.84 | 22.879 | 23.944 | 21.4 | 92.16 +Neigh | 0.007446 | 0.0079435 | 0.0084435 | 0.6 | 0.03 +Comm | 0.5271 | 1.5894 | 2.6259 | 80.9 | 6.40 +Output | 0.034799 | 0.035302 | 0.036437 | 0.4 | 0.14 +Modify | 0.20079 | 0.21033 | 0.2202 | 1.7 | 0.85 +Other | | 0.1041 | | | 0.42 + +Nlocal: 400 ave 414 max 390 min +Histogram: 2 0 0 0 0 1 0 0 0 1 +Nghost: 555.5 ave 564 max 543 min +Histogram: 1 0 0 0 1 0 0 0 0 2 +Neighs: 18299.2 ave 18820 max 17906 min +Histogram: 1 1 0 0 0 0 1 0 0 1 + +Total # of neighbors = 73197 +Ave neighs/atom = 45.748125 +Neighbor list builds = 33 +Dangerous builds = 0 +Total wall time: 0:00:24 diff --git a/examples/PACKAGES/dpd-smooth/2d-diffusion/in.lammps b/examples/PACKAGES/dpd-smooth/2d-diffusion/in.lammps index 6ef36a0cf6..2e0e821480 100644 --- a/examples/PACKAGES/dpd-smooth/2d-diffusion/in.lammps +++ b/examples/PACKAGES/dpd-smooth/2d-diffusion/in.lammps @@ -1,6 +1,6 @@ dimension 2 units micro -atom_style meso +atom_style sph variable R equal 0.5 # radius of sphere micrometers variable a equal $R/5 # lattice spacing micrometers @@ -27,12 +27,12 @@ group fluid type 1 group sphere type 2 mass * ${mass} -set group all meso/rho ${rho_0} +set group all sph/rho ${rho_0} pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed pair_coeff * * ${rho_0} ${c_0} ${h} -fix 1 fluid meso +fix 1 fluid sph fix 2 sphere rigid/meso single fix 2d all enforce2d diff --git a/examples/PACKAGES/dpd-smooth/2d-diffusion/log.24Oct18.2d-diffusion.g++.1 b/examples/PACKAGES/dpd-smooth/2d-diffusion/log.24Oct18.2d-diffusion.g++.1 deleted file mode 100644 index d44c0fd6f4..0000000000 --- a/examples/PACKAGES/dpd-smooth/2d-diffusion/log.24Oct18.2d-diffusion.g++.1 +++ /dev/null @@ -1,226 +0,0 @@ -LAMMPS (24 Oct 2018) -dimension 2 -units micro -atom_style meso - -variable R equal 0.5 # radius of sphere micrometers -variable a equal $R/5 # lattice spacing micrometers -variable a equal 0.5/5 -variable L equal $R*3 -variable L equal 0.5*3 -variable T equal 300. -variable rho_0 equal 1. # density picograms/micrometer^3 -variable c_0 equal 100. # speed of sound micrometers/microsecond -variable mu equal 1. # dynamic viscosity picogram/(micrometer-microsecond) -variable h equal $a*4.5 # kernel function cutoff micrometers -variable h equal 0.1*4.5 -variable mass equal $a*$a*$a*${rho_0} -variable mass equal 0.1*$a*$a*${rho_0} -variable mass equal 0.1*0.1*$a*${rho_0} -variable mass equal 0.1*0.1*0.1*${rho_0} -variable mass equal 0.1*0.1*0.1*1 -variable dt equal 1e-3 # timestep microseconds -variable skin equal 0.2*$h -variable skin equal 0.2*0.45 - -region box block -$L $L -$L $L 0 $a units box -region box block -1.5 $L -$L $L 0 $a units box -region box block -1.5 1.5 -$L $L 0 $a units box -region box block -1.5 1.5 -1.5 $L 0 $a units box -region box block -1.5 1.5 -1.5 1.5 0 $a units box -region box block -1.5 1.5 -1.5 1.5 0 0.1 units box -create_box 2 box -Created orthogonal box = (-1.5 -1.5 0) to (1.5 1.5 0.1) - 1 by 1 by 1 MPI processor grid -lattice sq $a -lattice sq 0.1 -Lattice spacing in x,y,z = 0.1 0.1 0.1 - -create_atoms 1 box -Created 900 atoms - Time spent = 0.0015769 secs - -region sphere sphere 0 0 0 $R units box -region sphere sphere 0 0 0 0.5 units box -set region sphere type 2 - 81 settings made for type - -group fluid type 1 -819 atoms in group fluid -group sphere type 2 -81 atoms in group sphere - -mass * ${mass} -mass * 0.001 -set group all meso/rho ${rho_0} -set group all meso/rho 1 - 900 settings made for meso/rho - -pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed -pair_style sdpd/taitwater/isothermal 300 ${mu} 76787 -pair_style sdpd/taitwater/isothermal 300 1 76787 -pair_coeff * * ${rho_0} ${c_0} ${h} -pair_coeff * * 1 ${c_0} ${h} -pair_coeff * * 1 100 ${h} -pair_coeff * * 1 100 0.45 - -fix 1 fluid meso -fix 2 sphere rigid/meso single -1 rigid bodies with 81 atoms - -fix 2d all enforce2d - -neighbor ${skin} bin -neighbor 0.09 bin -neigh_modify delay 0 every 1 check yes -timestep ${dt} -timestep 0.001 - -dump dump_id all atom 100 dump.lammpstrj - -thermo 100 -thermo_style custom step time nbuild ndanger - -run 10000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0.54 - ghost atom cutoff = 0.54 - binsize = 0.27, bins = 12 12 1 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair sdpd/taitwater/isothermal, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/2d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 6.137 | 6.137 | 6.137 Mbytes -Step Time Nbuild Ndanger - 0 0 0 0 - 100 0.1 0 0 - 200 0.2 0 0 - 300 0.3 0 0 - 400 0.4 1 0 - 500 0.5 1 0 - 600 0.6 1 0 - 700 0.7 2 0 - 800 0.8 2 0 - 900 0.9 2 0 - 1000 1 3 0 - 1100 1.1 3 0 - 1200 1.2 3 0 - 1300 1.3 4 0 - 1400 1.4 4 0 - 1500 1.5 4 0 - 1600 1.6 5 0 - 1700 1.7 5 0 - 1800 1.8 6 0 - 1900 1.9 6 0 - 2000 2 6 0 - 2100 2.1 7 0 - 2200 2.2 7 0 - 2300 2.3 7 0 - 2400 2.4 7 0 - 2500 2.5 8 0 - 2600 2.6 8 0 - 2700 2.7 8 0 - 2800 2.8 9 0 - 2900 2.9 9 0 - 3000 3 10 0 - 3100 3.1 10 0 - 3200 3.2 10 0 - 3300 3.3 11 0 - 3400 3.4 11 0 - 3500 3.5 11 0 - 3600 3.6 12 0 - 3700 3.7 12 0 - 3800 3.8 12 0 - 3900 3.9 13 0 - 4000 4 13 0 - 4100 4.1 13 0 - 4200 4.2 14 0 - 4300 4.3 14 0 - 4400 4.4 14 0 - 4500 4.5 15 0 - 4600 4.6 15 0 - 4700 4.7 15 0 - 4800 4.8 16 0 - 4900 4.9 16 0 - 5000 5 17 0 - 5100 5.1 17 0 - 5200 5.2 17 0 - 5300 5.3 17 0 - 5400 5.4 18 0 - 5500 5.5 18 0 - 5600 5.6 18 0 - 5700 5.7 19 0 - 5800 5.8 19 0 - 5900 5.9 19 0 - 6000 6 19 0 - 6100 6.1 20 0 - 6200 6.2 20 0 - 6300 6.3 20 0 - 6400 6.4 21 0 - 6500 6.5 21 0 - 6600 6.6 21 0 - 6700 6.7 21 0 - 6800 6.8 22 0 - 6900 6.9 22 0 - 7000 7 22 0 - 7100 7.1 23 0 - 7200 7.2 23 0 - 7300 7.3 23 0 - 7400 7.4 24 0 - 7500 7.5 24 0 - 7600 7.6 24 0 - 7700 7.7 25 0 - 7800 7.8 25 0 - 7900 7.9 26 0 - 8000 8 26 0 - 8100 8.1 26 0 - 8200 8.2 26 0 - 8300 8.3 27 0 - 8400 8.4 27 0 - 8500 8.5 27 0 - 8600 8.6 28 0 - 8700 8.7 28 0 - 8800 8.8 28 0 - 8900 8.9 29 0 - 9000 9 29 0 - 9100 9.1 29 0 - 9200 9.2 30 0 - 9300 9.3 30 0 - 9400 9.4 30 0 - 9500 9.5 30 0 - 9600 9.6 31 0 - 9700 9.7 31 0 - 9800 9.8 32 0 - 9900 9.9 32 0 - 10000 10 32 0 -Loop time of 80.9456 on 1 procs for 10000 steps with 900 atoms - -Performance: 10673829.855 ns/day, 0.000 hours/ns, 123.540 timesteps/s -99.8% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 80.306 | 80.306 | 80.306 | 0.0 | 99.21 -Neigh | 0.017418 | 0.017418 | 0.017418 | 0.0 | 0.02 -Comm | 0.16939 | 0.16939 | 0.16939 | 0.0 | 0.21 -Output | 0.070281 | 0.070281 | 0.070281 | 0.0 | 0.09 -Modify | 0.3154 | 0.3154 | 0.3154 | 0.0 | 0.39 -Other | | 0.067 | | | 0.08 - -Nlocal: 900 ave 900 max 900 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 762 ave 762 max 762 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 40697 ave 40697 max 40697 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 40697 -Ave neighs/atom = 45.2189 -Neighbor list builds = 32 -Dangerous builds = 0 -Total wall time: 0:01:20 diff --git a/examples/PACKAGES/dpd-smooth/2d-diffusion/log.24Oct18.2d-diffusion.g++.4 b/examples/PACKAGES/dpd-smooth/2d-diffusion/log.24Oct18.2d-diffusion.g++.4 deleted file mode 100644 index f904b78ab4..0000000000 --- a/examples/PACKAGES/dpd-smooth/2d-diffusion/log.24Oct18.2d-diffusion.g++.4 +++ /dev/null @@ -1,226 +0,0 @@ -LAMMPS (24 Oct 2018) -dimension 2 -units micro -atom_style meso - -variable R equal 0.5 # radius of sphere micrometers -variable a equal $R/5 # lattice spacing micrometers -variable a equal 0.5/5 -variable L equal $R*3 -variable L equal 0.5*3 -variable T equal 300. -variable rho_0 equal 1. # density picograms/micrometer^3 -variable c_0 equal 100. # speed of sound micrometers/microsecond -variable mu equal 1. # dynamic viscosity picogram/(micrometer-microsecond) -variable h equal $a*4.5 # kernel function cutoff micrometers -variable h equal 0.1*4.5 -variable mass equal $a*$a*$a*${rho_0} -variable mass equal 0.1*$a*$a*${rho_0} -variable mass equal 0.1*0.1*$a*${rho_0} -variable mass equal 0.1*0.1*0.1*${rho_0} -variable mass equal 0.1*0.1*0.1*1 -variable dt equal 1e-3 # timestep microseconds -variable skin equal 0.2*$h -variable skin equal 0.2*0.45 - -region box block -$L $L -$L $L 0 $a units box -region box block -1.5 $L -$L $L 0 $a units box -region box block -1.5 1.5 -$L $L 0 $a units box -region box block -1.5 1.5 -1.5 $L 0 $a units box -region box block -1.5 1.5 -1.5 1.5 0 $a units box -region box block -1.5 1.5 -1.5 1.5 0 0.1 units box -create_box 2 box -Created orthogonal box = (-1.5 -1.5 0) to (1.5 1.5 0.1) - 2 by 2 by 1 MPI processor grid -lattice sq $a -lattice sq 0.1 -Lattice spacing in x,y,z = 0.1 0.1 0.1 - -create_atoms 1 box -Created 900 atoms - Time spent = 0.0010246 secs - -region sphere sphere 0 0 0 $R units box -region sphere sphere 0 0 0 0.5 units box -set region sphere type 2 - 81 settings made for type - -group fluid type 1 -819 atoms in group fluid -group sphere type 2 -81 atoms in group sphere - -mass * ${mass} -mass * 0.001 -set group all meso/rho ${rho_0} -set group all meso/rho 1 - 900 settings made for meso/rho - -pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed -pair_style sdpd/taitwater/isothermal 300 ${mu} 76787 -pair_style sdpd/taitwater/isothermal 300 1 76787 -pair_coeff * * ${rho_0} ${c_0} ${h} -pair_coeff * * 1 ${c_0} ${h} -pair_coeff * * 1 100 ${h} -pair_coeff * * 1 100 0.45 - -fix 1 fluid meso -fix 2 sphere rigid/meso single -1 rigid bodies with 81 atoms - -fix 2d all enforce2d - -neighbor ${skin} bin -neighbor 0.09 bin -neigh_modify delay 0 every 1 check yes -timestep ${dt} -timestep 0.001 - -dump dump_id all atom 100 dump.lammpstrj - -thermo 100 -thermo_style custom step time nbuild ndanger - -run 10000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0.54 - ghost atom cutoff = 0.54 - binsize = 0.27, bins = 12 12 1 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair sdpd/taitwater/isothermal, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/2d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 6.087 | 6.087 | 6.087 Mbytes -Step Time Nbuild Ndanger - 0 0 0 0 - 100 0.1 0 0 - 200 0.2 0 0 - 300 0.3 0 0 - 400 0.4 1 0 - 500 0.5 1 0 - 600 0.6 1 0 - 700 0.7 2 0 - 800 0.8 2 0 - 900 0.9 2 0 - 1000 1 3 0 - 1100 1.1 3 0 - 1200 1.2 3 0 - 1300 1.3 4 0 - 1400 1.4 4 0 - 1500 1.5 5 0 - 1600 1.6 5 0 - 1700 1.7 5 0 - 1800 1.8 6 0 - 1900 1.9 6 0 - 2000 2 6 0 - 2100 2.1 7 0 - 2200 2.2 7 0 - 2300 2.3 7 0 - 2400 2.4 8 0 - 2500 2.5 8 0 - 2600 2.6 8 0 - 2700 2.7 9 0 - 2800 2.8 9 0 - 2900 2.9 9 0 - 3000 3 9 0 - 3100 3.1 10 0 - 3200 3.2 10 0 - 3300 3.3 10 0 - 3400 3.4 11 0 - 3500 3.5 11 0 - 3600 3.6 11 0 - 3700 3.7 12 0 - 3800 3.8 12 0 - 3900 3.9 12 0 - 4000 4 13 0 - 4100 4.1 13 0 - 4200 4.2 13 0 - 4300 4.3 14 0 - 4400 4.4 14 0 - 4500 4.5 15 0 - 4600 4.6 15 0 - 4700 4.7 15 0 - 4800 4.8 16 0 - 4900 4.9 16 0 - 5000 5 16 0 - 5100 5.1 16 0 - 5200 5.2 17 0 - 5300 5.3 17 0 - 5400 5.4 18 0 - 5500 5.5 18 0 - 5600 5.6 19 0 - 5700 5.7 19 0 - 5800 5.8 19 0 - 5900 5.9 20 0 - 6000 6 20 0 - 6100 6.1 20 0 - 6200 6.2 21 0 - 6300 6.3 21 0 - 6400 6.4 21 0 - 6500 6.5 22 0 - 6600 6.6 22 0 - 6700 6.7 22 0 - 6800 6.8 23 0 - 6900 6.9 23 0 - 7000 7 23 0 - 7100 7.1 24 0 - 7200 7.2 24 0 - 7300 7.3 24 0 - 7400 7.4 25 0 - 7500 7.5 25 0 - 7600 7.6 25 0 - 7700 7.7 26 0 - 7800 7.8 26 0 - 7900 7.9 26 0 - 8000 8 27 0 - 8100 8.1 27 0 - 8200 8.2 27 0 - 8300 8.3 28 0 - 8400 8.4 28 0 - 8500 8.5 28 0 - 8600 8.6 28 0 - 8700 8.7 29 0 - 8800 8.8 29 0 - 8900 8.9 29 0 - 9000 9 30 0 - 9100 9.1 30 0 - 9200 9.2 31 0 - 9300 9.3 31 0 - 9400 9.4 31 0 - 9500 9.5 31 0 - 9600 9.6 32 0 - 9700 9.7 32 0 - 9800 9.8 32 0 - 9900 9.9 33 0 - 10000 10 33 0 -Loop time of 69.01 on 4 procs for 10000 steps with 900 atoms - -Performance: 12519931.275 ns/day, 0.000 hours/ns, 144.907 timesteps/s -48.7% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 56.528 | 57.936 | 58.729 | 11.0 | 83.95 -Neigh | 0.013157 | 0.013382 | 0.013551 | 0.1 | 0.02 -Comm | 8.9594 | 9.7555 | 11.113 | 26.7 | 14.14 -Output | 0.14644 | 0.15009 | 0.15809 | 1.2 | 0.22 -Modify | 0.72913 | 0.91574 | 1.0524 | 12.4 | 1.33 -Other | | 0.2389 | | | 0.35 - -Nlocal: 225 ave 229 max 223 min -Histogram: 1 2 0 0 0 0 0 0 0 1 -Nghost: 442 ave 444 max 439 min -Histogram: 1 0 0 0 1 0 0 0 0 2 -Neighs: 10188.8 ave 10437 max 9932 min -Histogram: 1 0 0 1 0 0 0 1 0 1 - -Total # of neighbors = 40755 -Ave neighs/atom = 45.2833 -Neighbor list builds = 33 -Dangerous builds = 0 -Total wall time: 0:01:09 diff --git a/examples/PACKAGES/dpd-smooth/2d-diffusion/log.28Mar23.2d-diffusion.g++.1 b/examples/PACKAGES/dpd-smooth/2d-diffusion/log.28Mar23.2d-diffusion.g++.1 new file mode 100644 index 0000000000..30bf43dcf6 --- /dev/null +++ b/examples/PACKAGES/dpd-smooth/2d-diffusion/log.28Mar23.2d-diffusion.g++.1 @@ -0,0 +1,230 @@ +LAMMPS (28 Mar 2023 - Development) +dimension 2 +units micro +atom_style sph + +variable R equal 0.5 # radius of sphere micrometers +variable a equal $R/5 # lattice spacing micrometers +variable a equal 0.5/5 +variable L equal $R*3 +variable L equal 0.5*3 +variable T equal 300. +variable rho_0 equal 1. # density picograms/micrometer^3 +variable c_0 equal 100. # speed of sound micrometers/microsecond +variable mu equal 1. # dynamic viscosity picogram/(micrometer-microsecond) +variable h equal $a*4.5 # kernel function cutoff micrometers +variable h equal 0.1*4.5 +variable mass equal $a*$a*$a*${rho_0} +variable mass equal 0.1*$a*$a*${rho_0} +variable mass equal 0.1*0.1*$a*${rho_0} +variable mass equal 0.1*0.1*0.1*${rho_0} +variable mass equal 0.1*0.1*0.1*1 +variable dt equal 1e-3 # timestep microseconds +variable skin equal 0.2*$h +variable skin equal 0.2*0.45 + +region box block -$L $L -$L $L 0 $a units box +region box block -1.5 $L -$L $L 0 $a units box +region box block -1.5 1.5 -$L $L 0 $a units box +region box block -1.5 1.5 -1.5 $L 0 $a units box +region box block -1.5 1.5 -1.5 1.5 0 $a units box +region box block -1.5 1.5 -1.5 1.5 0 0.1 units box +create_box 2 box +Created orthogonal box = (-1.5 -1.5 0) to (1.5 1.5 0.1) + 1 by 1 by 1 MPI processor grid +lattice sq $a +lattice sq 0.1 +Lattice spacing in x,y,z = 0.1 0.1 0.1 + +create_atoms 1 box +Created 900 atoms + using lattice units in orthogonal box = (-1.5 -1.5 0) to (1.5 1.5 0.1) + create_atoms CPU = 0.001 seconds + +region sphere sphere 0 0 0 $R units box +region sphere sphere 0 0 0 0.5 units box +set region sphere type 2 +Setting atom values ... + 81 settings made for type + +group fluid type 1 +819 atoms in group fluid +group sphere type 2 +81 atoms in group sphere + +mass * ${mass} +mass * 0.001 +set group all sph/rho ${rho_0} +set group all sph/rho 1 +Setting atom values ... + 900 settings made for sph/rho + +pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed +pair_style sdpd/taitwater/isothermal 300 ${mu} 76787 +pair_style sdpd/taitwater/isothermal 300 1 76787 +pair_coeff * * ${rho_0} ${c_0} ${h} +pair_coeff * * 1 ${c_0} ${h} +pair_coeff * * 1 100 ${h} +pair_coeff * * 1 100 0.45 + +fix 1 fluid sph +fix 2 sphere rigid/meso single + 1 rigid bodies with 81 atoms + +fix 2d all enforce2d + +neighbor ${skin} bin +neighbor 0.09 bin +neigh_modify delay 0 every 1 check yes +timestep ${dt} +timestep 0.001 + +dump dump_id all atom 100 dump.lammpstrj + +thermo 100 +thermo_style custom step time nbuild ndanger + +run 10000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0.54 + ghost atom cutoff = 0.54 + binsize = 0.27, bins = 12 12 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair sdpd/taitwater/isothermal, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/2d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 6.512 | 6.512 | 6.512 Mbytes + Step Time Nbuild Ndanger + 0 0 0 0 + 100 0.1 0 0 + 200 0.2 0 0 + 300 0.3 0 0 + 400 0.4 1 0 + 500 0.5 1 0 + 600 0.6 1 0 + 700 0.7 2 0 + 800 0.8 2 0 + 900 0.9 2 0 + 1000 1 3 0 + 1100 1.1 3 0 + 1200 1.2 3 0 + 1300 1.3 4 0 + 1400 1.4 4 0 + 1500 1.5 4 0 + 1600 1.6 5 0 + 1700 1.7 5 0 + 1800 1.8 6 0 + 1900 1.9 6 0 + 2000 2 6 0 + 2100 2.1 7 0 + 2200 2.2 7 0 + 2300 2.3 7 0 + 2400 2.4 7 0 + 2500 2.5 8 0 + 2600 2.6 8 0 + 2700 2.7 8 0 + 2800 2.8 9 0 + 2900 2.9 9 0 + 3000 3 10 0 + 3100 3.1 10 0 + 3200 3.2 10 0 + 3300 3.3 11 0 + 3400 3.4 11 0 + 3500 3.5 11 0 + 3600 3.6 12 0 + 3700 3.7 12 0 + 3800 3.8 12 0 + 3900 3.9 13 0 + 4000 4 13 0 + 4100 4.1 13 0 + 4200 4.2 14 0 + 4300 4.3 14 0 + 4400 4.4 14 0 + 4500 4.5 15 0 + 4600 4.6 15 0 + 4700 4.7 15 0 + 4800 4.8 16 0 + 4900 4.9 16 0 + 5000 5 17 0 + 5100 5.1 17 0 + 5200 5.2 17 0 + 5300 5.3 17 0 + 5400 5.4 18 0 + 5500 5.5 18 0 + 5600 5.6 18 0 + 5700 5.7 19 0 + 5800 5.8 19 0 + 5900 5.9 19 0 + 6000 6 19 0 + 6100 6.1 20 0 + 6200 6.2 20 0 + 6300 6.3 20 0 + 6400 6.4 21 0 + 6500 6.5 21 0 + 6600 6.6 21 0 + 6700 6.7 21 0 + 6800 6.8 22 0 + 6900 6.9 22 0 + 7000 7 22 0 + 7100 7.1 23 0 + 7200 7.2 23 0 + 7300 7.3 23 0 + 7400 7.4 24 0 + 7500 7.5 24 0 + 7600 7.6 24 0 + 7700 7.7 25 0 + 7800 7.8 25 0 + 7900 7.9 26 0 + 8000 8 26 0 + 8100 8.1 26 0 + 8200 8.2 26 0 + 8300 8.3 27 0 + 8400 8.4 27 0 + 8500 8.5 27 0 + 8600 8.6 28 0 + 8700 8.7 28 0 + 8800 8.8 28 0 + 8900 8.9 29 0 + 9000 9 29 0 + 9100 9.1 29 0 + 9200 9.2 30 0 + 9300 9.3 30 0 + 9400 9.4 30 0 + 9500 9.5 30 0 + 9600 9.6 31 0 + 9700 9.7 31 0 + 9800 9.8 32 0 + 9900 9.9 32 0 + 10000 10 32 0 +Loop time of 78.0094 on 1 procs for 10000 steps with 900 atoms + +Performance: 11075589.479 ns/day, 0.000 hours/ns, 128.190 timesteps/s, 115.371 katom-step/s +99.5% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 77.441 | 77.441 | 77.441 | 0.0 | 99.27 +Neigh | 0.016471 | 0.016471 | 0.016471 | 0.0 | 0.02 +Comm | 0.14821 | 0.14821 | 0.14821 | 0.0 | 0.19 +Output | 0.062415 | 0.062415 | 0.062415 | 0.0 | 0.08 +Modify | 0.25323 | 0.25323 | 0.25323 | 0.0 | 0.32 +Other | | 0.0877 | | | 0.11 + +Nlocal: 900 ave 900 max 900 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 762 ave 762 max 762 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 40697 ave 40697 max 40697 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 40697 +Ave neighs/atom = 45.218889 +Neighbor list builds = 32 +Dangerous builds = 0 +Total wall time: 0:01:18 diff --git a/examples/PACKAGES/dpd-smooth/2d-diffusion/log.28Mar23.2d-diffusion.g++.4 b/examples/PACKAGES/dpd-smooth/2d-diffusion/log.28Mar23.2d-diffusion.g++.4 new file mode 100644 index 0000000000..03f5ed01bb --- /dev/null +++ b/examples/PACKAGES/dpd-smooth/2d-diffusion/log.28Mar23.2d-diffusion.g++.4 @@ -0,0 +1,230 @@ +LAMMPS (28 Mar 2023 - Development) +dimension 2 +units micro +atom_style sph + +variable R equal 0.5 # radius of sphere micrometers +variable a equal $R/5 # lattice spacing micrometers +variable a equal 0.5/5 +variable L equal $R*3 +variable L equal 0.5*3 +variable T equal 300. +variable rho_0 equal 1. # density picograms/micrometer^3 +variable c_0 equal 100. # speed of sound micrometers/microsecond +variable mu equal 1. # dynamic viscosity picogram/(micrometer-microsecond) +variable h equal $a*4.5 # kernel function cutoff micrometers +variable h equal 0.1*4.5 +variable mass equal $a*$a*$a*${rho_0} +variable mass equal 0.1*$a*$a*${rho_0} +variable mass equal 0.1*0.1*$a*${rho_0} +variable mass equal 0.1*0.1*0.1*${rho_0} +variable mass equal 0.1*0.1*0.1*1 +variable dt equal 1e-3 # timestep microseconds +variable skin equal 0.2*$h +variable skin equal 0.2*0.45 + +region box block -$L $L -$L $L 0 $a units box +region box block -1.5 $L -$L $L 0 $a units box +region box block -1.5 1.5 -$L $L 0 $a units box +region box block -1.5 1.5 -1.5 $L 0 $a units box +region box block -1.5 1.5 -1.5 1.5 0 $a units box +region box block -1.5 1.5 -1.5 1.5 0 0.1 units box +create_box 2 box +Created orthogonal box = (-1.5 -1.5 0) to (1.5 1.5 0.1) + 2 by 2 by 1 MPI processor grid +lattice sq $a +lattice sq 0.1 +Lattice spacing in x,y,z = 0.1 0.1 0.1 + +create_atoms 1 box +Created 900 atoms + using lattice units in orthogonal box = (-1.5 -1.5 0) to (1.5 1.5 0.1) + create_atoms CPU = 0.001 seconds + +region sphere sphere 0 0 0 $R units box +region sphere sphere 0 0 0 0.5 units box +set region sphere type 2 +Setting atom values ... + 81 settings made for type + +group fluid type 1 +819 atoms in group fluid +group sphere type 2 +81 atoms in group sphere + +mass * ${mass} +mass * 0.001 +set group all sph/rho ${rho_0} +set group all sph/rho 1 +Setting atom values ... + 900 settings made for sph/rho + +pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed +pair_style sdpd/taitwater/isothermal 300 ${mu} 76787 +pair_style sdpd/taitwater/isothermal 300 1 76787 +pair_coeff * * ${rho_0} ${c_0} ${h} +pair_coeff * * 1 ${c_0} ${h} +pair_coeff * * 1 100 ${h} +pair_coeff * * 1 100 0.45 + +fix 1 fluid sph +fix 2 sphere rigid/meso single + 1 rigid bodies with 81 atoms + +fix 2d all enforce2d + +neighbor ${skin} bin +neighbor 0.09 bin +neigh_modify delay 0 every 1 check yes +timestep ${dt} +timestep 0.001 + +dump dump_id all atom 100 dump.lammpstrj + +thermo 100 +thermo_style custom step time nbuild ndanger + +run 10000 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 0.54 + ghost atom cutoff = 0.54 + binsize = 0.27, bins = 12 12 1 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair sdpd/taitwater/isothermal, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/2d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 6.463 | 6.463 | 6.463 Mbytes + Step Time Nbuild Ndanger + 0 0 0 0 + 100 0.1 0 0 + 200 0.2 0 0 + 300 0.3 0 0 + 400 0.4 1 0 + 500 0.5 1 0 + 600 0.6 1 0 + 700 0.7 2 0 + 800 0.8 2 0 + 900 0.9 2 0 + 1000 1 3 0 + 1100 1.1 3 0 + 1200 1.2 3 0 + 1300 1.3 4 0 + 1400 1.4 4 0 + 1500 1.5 4 0 + 1600 1.6 5 0 + 1700 1.7 5 0 + 1800 1.8 5 0 + 1900 1.9 6 0 + 2000 2 6 0 + 2100 2.1 6 0 + 2200 2.2 7 0 + 2300 2.3 7 0 + 2400 2.4 7 0 + 2500 2.5 8 0 + 2600 2.6 8 0 + 2700 2.7 8 0 + 2800 2.8 9 0 + 2900 2.9 9 0 + 3000 3 9 0 + 3100 3.1 10 0 + 3200 3.2 10 0 + 3300 3.3 11 0 + 3400 3.4 11 0 + 3500 3.5 11 0 + 3600 3.6 12 0 + 3700 3.7 12 0 + 3800 3.8 12 0 + 3900 3.9 12 0 + 4000 4 13 0 + 4100 4.1 13 0 + 4200 4.2 14 0 + 4300 4.3 14 0 + 4400 4.4 14 0 + 4500 4.5 15 0 + 4600 4.6 15 0 + 4700 4.7 15 0 + 4800 4.8 16 0 + 4900 4.9 16 0 + 5000 5 16 0 + 5100 5.1 17 0 + 5200 5.2 17 0 + 5300 5.3 17 0 + 5400 5.4 17 0 + 5500 5.5 18 0 + 5600 5.6 18 0 + 5700 5.7 18 0 + 5800 5.8 19 0 + 5900 5.9 19 0 + 6000 6 19 0 + 6100 6.1 20 0 + 6200 6.2 20 0 + 6300 6.3 20 0 + 6400 6.4 21 0 + 6500 6.5 21 0 + 6600 6.6 21 0 + 6700 6.7 22 0 + 6800 6.8 22 0 + 6900 6.9 22 0 + 7000 7 23 0 + 7100 7.1 23 0 + 7200 7.2 23 0 + 7300 7.3 24 0 + 7400 7.4 24 0 + 7500 7.5 24 0 + 7600 7.6 25 0 + 7700 7.7 25 0 + 7800 7.8 26 0 + 7900 7.9 26 0 + 8000 8 26 0 + 8100 8.1 26 0 + 8200 8.2 27 0 + 8300 8.3 27 0 + 8400 8.4 28 0 + 8500 8.5 28 0 + 8600 8.6 28 0 + 8700 8.7 29 0 + 8800 8.8 29 0 + 8900 8.9 29 0 + 9000 9 30 0 + 9100 9.1 30 0 + 9200 9.2 30 0 + 9300 9.3 30 0 + 9400 9.4 31 0 + 9500 9.5 31 0 + 9600 9.6 31 0 + 9700 9.7 32 0 + 9800 9.8 32 0 + 9900 9.9 32 0 + 10000 10 33 0 +Loop time of 13.5306 on 4 procs for 10000 steps with 900 atoms + +Performance: 63855371.888 ns/day, 0.000 hours/ns, 739.067 timesteps/s, 665.160 katom-step/s +98.8% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 12.327 | 12.56 | 12.738 | 4.3 | 92.83 +Neigh | 0.0043391 | 0.0044297 | 0.0045381 | 0.1 | 0.03 +Comm | 0.53746 | 0.71463 | 0.94685 | 18.1 | 5.28 +Output | 0.021884 | 0.02228 | 0.023428 | 0.4 | 0.16 +Modify | 0.14457 | 0.14548 | 0.14643 | 0.2 | 1.08 +Other | | 0.08351 | | | 0.62 + +Nlocal: 225 ave 228 max 222 min +Histogram: 1 0 0 1 0 0 1 0 0 1 +Nghost: 438.25 ave 442 max 434 min +Histogram: 1 0 0 0 0 1 1 0 0 1 +Neighs: 10152.2 ave 10328 max 9853 min +Histogram: 1 0 0 0 0 0 0 1 1 1 + +Total # of neighbors = 40609 +Ave neighs/atom = 45.121111 +Neighbor list builds = 33 +Dangerous builds = 0 +Total wall time: 0:00:13 diff --git a/examples/PACKAGES/dpd-smooth/equipartition-verification/in.lammps b/examples/PACKAGES/dpd-smooth/equipartition-verification/in.lammps index 0d06723f59..59359d4b38 100644 --- a/examples/PACKAGES/dpd-smooth/equipartition-verification/in.lammps +++ b/examples/PACKAGES/dpd-smooth/equipartition-verification/in.lammps @@ -1,6 +1,6 @@ dimension 3 units micro -atom_style meso +atom_style sph variable a equal 0.1 # lattice spacing micrometers variable L equal $a*10 @@ -21,7 +21,7 @@ lattice sc $a create_atoms 1 box mass * ${mass} -set group all meso/rho ${rho_0} +set group all sph/rho ${rho_0} pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed pair_coeff * * ${rho_0} ${c_0} ${h} @@ -34,7 +34,7 @@ variable vx_sq_check equal c_v_sq[1]*${mass}/${kB}/$T variable vy_sq_check equal c_v_sq[2]*${mass}/${kB}/$T variable vz_sq_check equal c_v_sq[3]*${mass}/${kB}/$T -fix 1 all meso +fix 1 all sph neighbor ${skin} bin timestep ${dt} diff --git a/examples/PACKAGES/dpd-smooth/equipartition-verification/log.24Oct18.equipartition.g++.1 b/examples/PACKAGES/dpd-smooth/equipartition-verification/log.28Mar23.equipartition.g++.1 similarity index 58% rename from examples/PACKAGES/dpd-smooth/equipartition-verification/log.24Oct18.equipartition.g++.1 rename to examples/PACKAGES/dpd-smooth/equipartition-verification/log.28Mar23.equipartition.g++.1 index 06ffd699bc..2fa4771a74 100644 --- a/examples/PACKAGES/dpd-smooth/equipartition-verification/log.24Oct18.equipartition.g++.1 +++ b/examples/PACKAGES/dpd-smooth/equipartition-verification/log.28Mar23.equipartition.g++.1 @@ -1,7 +1,7 @@ -LAMMPS (24 Oct 2018) +LAMMPS (28 Mar 2023 - Development) dimension 3 units micro -atom_style meso +atom_style sph variable a equal 0.1 # lattice spacing micrometers variable L equal $a*10 @@ -38,13 +38,15 @@ Lattice spacing in x,y,z = 0.1 0.1 0.1 create_atoms 1 box Created 8000 atoms - Time spent = 0.00285411 secs + using lattice units in orthogonal box = (-1 -1 -1) to (1 1 1) + create_atoms CPU = 0.002 seconds mass * ${mass} mass * 0.001 -set group all meso/rho ${rho_0} -set group all meso/rho 1 - 8000 settings made for meso/rho +set group all sph/rho ${rho_0} +set group all sph/rho 1 +Setting atom values ... + 8000 settings made for sph/rho pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed pair_style sdpd/taitwater/isothermal 300 ${mu} 76787 @@ -71,7 +73,7 @@ variable vz_sq_check equal c_v_sq[3]*0.001/${kB}/$T variable vz_sq_check equal c_v_sq[3]*0.001/1.3806504e-08/$T variable vz_sq_check equal c_v_sq[3]*0.001/1.3806504e-08/300 -fix 1 all meso +fix 1 all sph neighbor ${skin} bin neighbor 0.04 bin @@ -82,8 +84,9 @@ thermo 10 thermo_style custom step time v_vx_sq_check v_vy_sq_check v_vz_sq_check run 200 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule Neighbor list info ... - update every 1 steps, delay 10 steps, check yes + update: every = 1 steps, delay = 0 steps, check = yes max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 0.44 ghost atom cutoff = 0.44 @@ -92,55 +95,55 @@ Neighbor list info ... (1) pair sdpd/taitwater/isothermal, perpetual attributes: half, newton on pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton + stencil: half/bin/3d bin: standard -Per MPI rank memory allocation (min/avg/max) = 13.54 | 13.54 | 13.54 Mbytes -Step Time v_vx_sq_check v_vy_sq_check v_vz_sq_check - 0 0 0 0 0 - 10 0.005 0.70973271 0.71495693 0.71910087 - 20 0.01 0.90418096 0.88845437 0.89659567 - 30 0.015 0.9590736 0.97880338 0.9619016 - 40 0.02 0.98533774 0.96057682 0.95600448 - 50 0.025 0.96433662 0.96650071 0.95509683 - 60 0.03 0.96598029 0.96373656 0.96734888 - 70 0.035 0.95433045 0.98004764 0.96255924 - 80 0.04 0.97872906 0.95987289 0.96623598 - 90 0.045 0.99913888 0.99255731 0.95616142 - 100 0.05 0.98872675 0.97141018 0.95338841 - 110 0.055 0.97794592 0.97389258 0.98473719 - 120 0.06 0.98389266 0.96716284 0.95504862 - 130 0.065 0.98572886 0.96680923 0.95599065 - 140 0.07 0.97602684 0.97580081 0.9886878 - 150 0.075 0.99172003 0.95027467 0.96028033 - 160 0.08 0.96793247 0.94590928 0.95644301 - 170 0.085 0.94167619 0.98048861 0.93439426 - 180 0.09 0.97277934 0.97383622 0.96900866 - 190 0.095 0.96647288 1.0027643 0.96230782 - 200 0.1 0.94864291 0.95902585 0.96398175 -Loop time of 60.1095 on 1 procs for 200 steps with 8000 atoms +Per MPI rank memory allocation (min/avg/max) = 14.29 | 14.29 | 14.29 Mbytes + Step Time v_vx_sq_check v_vy_sq_check v_vz_sq_check + 0 0 0 0 0 + 10 0.005 0.70973271 0.71495693 0.71910087 + 20 0.01 0.90418096 0.88845437 0.89659567 + 30 0.015 0.9590736 0.97880338 0.9619016 + 40 0.02 0.98533774 0.96057682 0.95600448 + 50 0.025 0.96433662 0.96650071 0.95509683 + 60 0.03 0.96598029 0.96373656 0.96734888 + 70 0.035 0.95433045 0.98004764 0.96255924 + 80 0.04 0.97872906 0.95987289 0.96623598 + 90 0.045 0.99913888 0.99255731 0.95616142 + 100 0.05 0.98872675 0.97141018 0.95338841 + 110 0.055 0.97794592 0.97389258 0.98473719 + 120 0.06 0.98389266 0.96716284 0.95504862 + 130 0.065 0.98572886 0.96680923 0.95599065 + 140 0.07 0.97602684 0.97580081 0.9886878 + 150 0.075 0.99172003 0.95027467 0.96028033 + 160 0.08 0.96793247 0.94590928 0.95644301 + 170 0.085 0.94167619 0.98048861 0.93439426 + 180 0.09 0.97277934 0.97383622 0.96900866 + 190 0.095 0.96647288 1.0027643 0.96230782 + 200 0.1 0.94864291 0.95902585 0.96398175 +Loop time of 55.7542 on 1 procs for 200 steps with 8000 atoms -Performance: 143737.595 ns/day, 0.000 hours/ns, 3.327 timesteps/s -99.7% CPU use with 1 MPI tasks x no OpenMP threads +Performance: 154965.922 ns/day, 0.000 hours/ns, 3.587 timesteps/s, 28.697 katom-step/s +99.6% CPU use with 1 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 59.92 | 59.92 | 59.92 | 0.0 | 99.68 +Pair | 55.642 | 55.642 | 55.642 | 0.0 | 99.80 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.11154 | 0.11154 | 0.11154 | 0.0 | 0.19 -Output | 0.0063498 | 0.0063498 | 0.0063498 | 0.0 | 0.01 -Modify | 0.043546 | 0.043546 | 0.043546 | 0.0 | 0.07 -Other | | 0.02811 | | | 0.05 +Comm | 0.060977 | 0.060977 | 0.060977 | 0.0 | 0.11 +Output | 0.0066393 | 0.0066393 | 0.0066393 | 0.0 | 0.01 +Modify | 0.028354 | 0.028354 | 0.028354 | 0.0 | 0.05 +Other | | 0.01623 | | | 0.03 -Nlocal: 8000 ave 8000 max 8000 min +Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 16389 ave 16389 max 16389 min +Nghost: 16389 ave 16389 max 16389 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 1.456e+06 ave 1.456e+06 max 1.456e+06 min +Neighs: 1.456e+06 ave 1.456e+06 max 1.456e+06 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 1456000 Ave neighs/atom = 182 Neighbor list builds = 0 Dangerous builds = 0 -Total wall time: 0:01:00 +Total wall time: 0:00:56 diff --git a/examples/PACKAGES/dpd-smooth/equipartition-verification/log.24Oct18.equipartition.g++.4 b/examples/PACKAGES/dpd-smooth/equipartition-verification/log.28Mar23.equipartition.g++.4 similarity index 58% rename from examples/PACKAGES/dpd-smooth/equipartition-verification/log.24Oct18.equipartition.g++.4 rename to examples/PACKAGES/dpd-smooth/equipartition-verification/log.28Mar23.equipartition.g++.4 index 88509f0fd1..e4f11d305e 100644 --- a/examples/PACKAGES/dpd-smooth/equipartition-verification/log.24Oct18.equipartition.g++.4 +++ b/examples/PACKAGES/dpd-smooth/equipartition-verification/log.28Mar23.equipartition.g++.4 @@ -1,7 +1,7 @@ -LAMMPS (24 Oct 2018) +LAMMPS (28 Mar 2023 - Development) dimension 3 units micro -atom_style meso +atom_style sph variable a equal 0.1 # lattice spacing micrometers variable L equal $a*10 @@ -38,13 +38,15 @@ Lattice spacing in x,y,z = 0.1 0.1 0.1 create_atoms 1 box Created 8000 atoms - Time spent = 0.00252754 secs + using lattice units in orthogonal box = (-1 -1 -1) to (1 1 1) + create_atoms CPU = 0.001 seconds mass * ${mass} mass * 0.001 -set group all meso/rho ${rho_0} -set group all meso/rho 1 - 8000 settings made for meso/rho +set group all sph/rho ${rho_0} +set group all sph/rho 1 +Setting atom values ... + 8000 settings made for sph/rho pair_style sdpd/taitwater/isothermal $T ${mu} 76787 # temperature viscosity random_seed pair_style sdpd/taitwater/isothermal 300 ${mu} 76787 @@ -71,7 +73,7 @@ variable vz_sq_check equal c_v_sq[3]*0.001/${kB}/$T variable vz_sq_check equal c_v_sq[3]*0.001/1.3806504e-08/$T variable vz_sq_check equal c_v_sq[3]*0.001/1.3806504e-08/300 -fix 1 all meso +fix 1 all sph neighbor ${skin} bin neighbor 0.04 bin @@ -82,8 +84,9 @@ thermo 10 thermo_style custom step time v_vx_sq_check v_vy_sq_check v_vz_sq_check run 200 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule Neighbor list info ... - update every 1 steps, delay 10 steps, check yes + update: every = 1 steps, delay = 0 steps, check = yes max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 0.44 ghost atom cutoff = 0.44 @@ -92,55 +95,55 @@ Neighbor list info ... (1) pair sdpd/taitwater/isothermal, perpetual attributes: half, newton on pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton + stencil: half/bin/3d bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.795 | 5.795 | 5.795 Mbytes -Step Time v_vx_sq_check v_vy_sq_check v_vz_sq_check - 0 0 0 0 0 - 10 0.005 0.71224819 0.71470372 0.7008956 - 20 0.01 0.90627589 0.90683966 0.90116506 - 30 0.015 0.938505 0.95884272 0.93337542 - 40 0.02 0.94394649 0.93668038 0.96468004 - 50 0.025 0.97152309 0.97546161 0.95107762 - 60 0.03 0.94710871 0.95678322 0.97285504 - 70 0.035 0.96253148 0.95838642 0.95450883 - 80 0.04 0.97581495 0.95278681 0.95099478 - 90 0.045 0.96251614 0.9740684 0.96081505 - 100 0.05 0.94191275 0.97137523 0.94084858 - 110 0.055 0.953406 0.95739684 0.98574522 - 120 0.06 0.99001614 0.99608287 0.9839996 - 130 0.065 0.96575225 0.94309655 0.92847798 - 140 0.07 0.97642687 0.97458638 0.94696406 - 150 0.075 0.99316381 0.96876814 0.95440106 - 160 0.08 0.94589744 0.95264791 0.95495169 - 170 0.085 0.97599092 0.95336014 0.97687718 - 180 0.09 0.97214242 0.9726305 0.9726035 - 190 0.095 0.97577583 0.96523645 0.9756968 - 200 0.1 0.96386053 0.97268854 0.94582436 -Loop time of 32.5247 on 4 procs for 200 steps with 8000 atoms +Per MPI rank memory allocation (min/avg/max) = 6.172 | 6.172 | 6.172 Mbytes + Step Time v_vx_sq_check v_vy_sq_check v_vz_sq_check + 0 0 0 0 0 + 10 0.005 0.71224819 0.71470372 0.7008956 + 20 0.01 0.90627589 0.90683966 0.90116506 + 30 0.015 0.938505 0.95884272 0.93337542 + 40 0.02 0.94394649 0.93668038 0.96468004 + 50 0.025 0.97152309 0.97546161 0.95107762 + 60 0.03 0.94710871 0.95678322 0.97285504 + 70 0.035 0.96253148 0.95838642 0.95450883 + 80 0.04 0.97581495 0.95278681 0.95099478 + 90 0.045 0.96251614 0.9740684 0.96081505 + 100 0.05 0.94191275 0.97137523 0.94084858 + 110 0.055 0.953406 0.95739684 0.98574522 + 120 0.06 0.99001614 0.99608287 0.9839996 + 130 0.065 0.96575225 0.94309655 0.92847798 + 140 0.07 0.97642687 0.97458638 0.94696406 + 150 0.075 0.99316381 0.96876814 0.95440106 + 160 0.08 0.94589744 0.95264791 0.95495169 + 170 0.085 0.97599092 0.95336014 0.97687718 + 180 0.09 0.97214242 0.9726305 0.9726035 + 190 0.095 0.97577583 0.96523645 0.9756968 + 200 0.1 0.96386053 0.97268854 0.94582436 +Loop time of 9.59181 on 4 procs for 200 steps with 8000 atoms -Performance: 265644.515 ns/day, 0.000 hours/ns, 6.149 timesteps/s -73.9% CPU use with 4 MPI tasks x no OpenMP threads +Performance: 900768.333 ns/day, 0.000 hours/ns, 20.851 timesteps/s, 166.809 katom-step/s +98.1% CPU use with 4 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 27.385 | 28.409 | 28.761 | 11.1 | 87.34 +Pair | 8.9729 | 9.2147 | 9.4383 | 5.5 | 96.07 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 3.582 | 3.9343 | 4.9531 | 29.7 | 12.10 -Output | 0.022267 | 0.026073 | 0.033141 | 2.7 | 0.08 -Modify | 0.031714 | 0.033134 | 0.034367 | 0.6 | 0.10 -Other | | 0.1226 | | | 0.38 +Comm | 0.13739 | 0.36068 | 0.60216 | 27.6 | 3.76 +Output | 0.0022724 | 0.002394 | 0.0026506 | 0.3 | 0.02 +Modify | 0.0068559 | 0.0069926 | 0.0070974 | 0.1 | 0.07 +Other | | 0.007004 | | | 0.07 -Nlocal: 2000 ave 2000 max 2000 min +Nlocal: 2000 ave 2000 max 2000 min Histogram: 4 0 0 0 0 0 0 0 0 0 -Nghost: 8469 ave 8469 max 8469 min +Nghost: 8469 ave 8469 max 8469 min Histogram: 4 0 0 0 0 0 0 0 0 0 -Neighs: 364000 ave 376628 max 351184 min +Neighs: 364000 ave 376628 max 351184 min Histogram: 1 0 1 0 0 0 0 1 0 1 Total # of neighbors = 1456000 Ave neighs/atom = 182 Neighbor list builds = 0 Dangerous builds = 0 -Total wall time: 0:00:32 +Total wall time: 0:00:09 From 620cca34d4f840722fefaeca35c3548200dadce0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Jun 2023 15:19:13 -0400 Subject: [PATCH 156/172] add accessor to nfield, make certain field types are initialized early --- src/thermo.cpp | 10 ++++++++++ src/thermo.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/thermo.cpp b/src/thermo.cpp index 31c19fbdc2..1c07da695f 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -201,6 +201,8 @@ void Thermo::init() ValueTokenizer *format_line = nullptr; if (format_line_user.size()) format_line = new ValueTokenizer(format_line_user); + field_data.clear(); + field_data.resize(nfield); std::string format_this, format_line_user_def; for (int i = 0; i < nfield; i++) { @@ -208,6 +210,14 @@ void Thermo::init() format_this.clear(); format_line_user_def.clear(); + if (vtype[i] == FLOAT) { + field_data[i] = (double) 0.0; + } else if (vtype[i] == INT) { + field_data[i] = (int) 0; + } else if (vtype[i] == BIGINT) { + field_data[i] = (bigint) 0; + } + if ((lineflag == MULTILINE) && ((i % 3) == 0)) format[i] += "\n"; if ((lineflag == YAMLLINE) && (i == 0)) format[i] += " - ["; if (format_line) format_line_user_def = format_line->next_string(); diff --git a/src/thermo.h b/src/thermo.h index 8a5cba29d7..f22f3103b0 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -43,6 +43,7 @@ class Thermo : protected Pointers { int evaluate_keyword(const std::string &, double *); // for accessing cached thermo data + int get_nfield() const { return nfield; } bigint get_timestep() const { return ntimestep; } const std::vector &get_fields() const { return field_data; } const std::vector &get_keywords() const { return keyword; } From 30e6b8b9b6405cd979b87d4abb951ae5ca4e0a46 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Jun 2023 15:19:58 -0400 Subject: [PATCH 157/172] make more reliable with explicit loops using exported nfield value --- src/EXTRA-DUMP/dump_yaml.cpp | 19 +++++++++------- src/NETCDF/dump_netcdf.cpp | 37 ++++++++++++++++++++++-------- src/NETCDF/dump_netcdf.h | 1 + src/NETCDF/dump_netcdf_mpiio.cpp | 39 ++++++++++++++++++++++++-------- src/NETCDF/dump_netcdf_mpiio.h | 1 + 5 files changed, 70 insertions(+), 27 deletions(-) diff --git a/src/EXTRA-DUMP/dump_yaml.cpp b/src/EXTRA-DUMP/dump_yaml.cpp index ec7d26af31..f8d2fb2264 100644 --- a/src/EXTRA-DUMP/dump_yaml.cpp +++ b/src/EXTRA-DUMP/dump_yaml.cpp @@ -62,18 +62,21 @@ void DumpYAML::write_header(bigint ndump) Thermo *th = output->thermo; // output thermo data only on timesteps where it was computed if (update->ntimestep == th->get_timestep()) { + int nfield = th->get_nfield(); + const auto &keywords = th->get_keywords(); + const auto &fields = th->get_fields(); thermo_data += "thermo:\n - keywords: [ "; - for (const auto &key : th->get_keywords()) thermo_data += fmt::format("{}, ", key); + for (int i = 0; i < nfield; ++i) thermo_data += fmt::format("{}, ", keywords[i]); thermo_data += "]\n - data: [ "; - for (const auto &val : th->get_fields()) { - if (val.type == multitype::DOUBLE) - thermo_data += fmt::format("{}, ", val.data.d); - else if (val.type == multitype::INT) - thermo_data += fmt::format("{}, ", val.data.i); - else if (val.type == multitype::BIGINT) - thermo_data += fmt::format("{}, ", val.data.b); + for (int i = 0; i < nfield; ++i) { + if (fields[i].type == multitype::DOUBLE) + thermo_data += fmt::format("{}, ", fields[i].data.d); + else if (fields[i].type == multitype::INT) + thermo_data += fmt::format("{}, ", fields[i].data.i); + else if (fields[i].type == multitype::BIGINT) + thermo_data += fmt::format("{}, ", fields[i].data.b); else thermo_data += ", "; } diff --git a/src/NETCDF/dump_netcdf.cpp b/src/NETCDF/dump_netcdf.cpp index 8c99ff1f70..2b064edeae 100644 --- a/src/NETCDF/dump_netcdf.cpp +++ b/src/NETCDF/dump_netcdf.cpp @@ -195,6 +195,7 @@ DumpNetCDF::DumpNetCDF(LAMMPS *lmp, int narg, char **arg) : type_nc_real = NC_FLOAT; thermo = false; + thermo_warn = true; thermovar = nullptr; framei = 0; @@ -223,7 +224,7 @@ void DumpNetCDF::openfile() if (thermo && !singlefile_opened) { delete[] thermovar; - thermovar = new int[output->thermo->get_keywords().size()]; + thermovar = new int[output->thermo->get_nfield()]; } // now the computes and fixes have been initialized, so we can query @@ -320,8 +321,10 @@ void DumpNetCDF::openfile() // perframe variables if (thermo) { - const auto &keywords = output->thermo->get_keywords(); - int nfield = keywords.size(); + Thermo *th = output->thermo; + const auto &keywords = th->get_keywords(); + const int nfield = th->get_nfield(); + for (int i = 0; i < nfield; i++) { NCERRX( nc_inq_varid(ncid, keywords[i].c_str(), &thermovar[i]), keywords[i].c_str() ); } @@ -433,9 +436,11 @@ void DumpNetCDF::openfile() // perframe variables if (thermo) { - const auto &fields = output->thermo->get_fields(); - const auto &keywords = output->thermo->get_keywords(); - int nfield = fields.size(); + Thermo *th = output->thermo; + const auto &fields = th->get_fields(); + const auto &keywords = th->get_keywords(); + const int nfield = th->get_nfield(); + for (int i = 0; i < nfield; i++) { if (fields[i].type == multitype::DOUBLE) { NCERRX( nc_def_var(ncid, keywords[i].c_str(), type_nc_real, 1, dims, &thermovar[i]), keywords[i].c_str() ); @@ -600,9 +605,23 @@ void DumpNetCDF::write() start[1] = 0; if (thermo) { - const auto &keywords = output->thermo->get_keywords(); - const auto &fields = output->thermo->get_fields(); - int nfield = fields.size(); + Thermo *th = output->thermo; + + // will output current thermo data only on timesteps where it was computed. + // warn (once) about using cached copy from old timestep. + + if (thermo_warn && (update->ntimestep != th->get_timestep())) { + thermo_warn = false; + if (comm->me == 0) { + error->warning(FLERR, "Dump {} output on incompatible timestep with thermo output: {} vs {} \n" + " Dump netcdf always stores thermo data from last thermo output", + id, th->get_timestep(), update->ntimestep); + } + } + + const auto &keywords = th->get_keywords(); + const auto &fields = th->get_fields(); + int nfield = th->get_nfield(); for (int i = 0; i < nfield; i++) { if (filewriter) { if (fields[i].type == multitype::DOUBLE) { diff --git a/src/NETCDF/dump_netcdf.h b/src/NETCDF/dump_netcdf.h index 20c60ef104..982cd99fb5 100644 --- a/src/NETCDF/dump_netcdf.h +++ b/src/NETCDF/dump_netcdf.h @@ -65,6 +65,7 @@ class DumpNetCDF : public DumpCustom { int type_nc_real; // netcdf type to use for real variables: float or double bool thermo; // write thermo output to netcdf file + bool thermo_warn; // warn (once) that thermo output is on incompatible step bigint n_buffer; // size of buffer bigint *int_buffer; // buffer for passing data to netcdf diff --git a/src/NETCDF/dump_netcdf_mpiio.cpp b/src/NETCDF/dump_netcdf_mpiio.cpp index 3aec34dd40..4a34f11ab4 100644 --- a/src/NETCDF/dump_netcdf_mpiio.cpp +++ b/src/NETCDF/dump_netcdf_mpiio.cpp @@ -192,6 +192,7 @@ DumpNetCDFMPIIO::DumpNetCDFMPIIO(LAMMPS *lmp, int narg, char **arg) : type_nc_real = NC_FLOAT; thermo = false; + thermo_warn = true; thermovar = nullptr; framei = 0; @@ -220,7 +221,7 @@ void DumpNetCDFMPIIO::openfile() if (thermo && !singlefile_opened) { delete[] thermovar; - thermovar = new int[output->thermo->get_keywords().size()]; + thermovar = new int[output->thermo->get_nfield()]; } // now the computes and fixes have been initialized, so we can query @@ -318,8 +319,10 @@ void DumpNetCDFMPIIO::openfile() // perframe variables if (thermo) { - const auto &keywords = output->thermo->get_keywords(); - int nfield = keywords.size(); + Thermo *th = output->thermo; + const auto &keywords = th->get_keywords(); + const int nfield = th->get_nfield(); + for (int i = 0; i < nfield; i++) { NCERRX( ncmpi_inq_varid(ncid, keywords[i].c_str(), &thermovar[i]), keywords[i].c_str() ); } @@ -423,9 +426,11 @@ void DumpNetCDFMPIIO::openfile() // perframe variables if (thermo) { - const auto &fields = output->thermo->get_fields(); - const auto &keywords = output->thermo->get_keywords(); - int nfield = fields.size(); + Thermo *th = output->thermo; + const auto &fields = th->get_fields(); + const auto &keywords = th->get_keywords(); + const int nfield = th->get_nfield(); + for (int i = 0; i < nfield; i++) { if (fields[i].type == multitype::DOUBLE) { NCERRX( ncmpi_def_var(ncid, keywords[i].c_str(), type_nc_real, 1, dims, &thermovar[i]), keywords[i].c_str() ); @@ -593,9 +598,23 @@ void DumpNetCDFMPIIO::write() NCERR( ncmpi_begin_indep_data(ncid) ); if (thermo) { - const auto &keywords = output->thermo->get_keywords(); - const auto &fields = output->thermo->get_fields(); - int nfield = fields.size(); + Thermo *th = output->thermo; + + // will output current thermo data only on timesteps where it was computed. + // warn (once) about using cached copy from old timestep. + + if (thermo_warn && (update->ntimestep != th->get_timestep())) { + thermo_warn = false; + if (comm->me == 0) { + error->warning(FLERR, "Dump {} output on incompatible timestep with thermo output: {} vs {} \n" + " Dump netcdf/mpiio always stores thermo data from last thermo output", + id, th->get_timestep(), update->ntimestep); + } + } + + const auto &keywords = th->get_keywords(); + const auto &fields = th->get_fields(); + int nfield = th->get_nfield(); for (int i = 0; i < nfield; i++) { if (filewriter) { if (fields[i].type == multitype::DOUBLE) { @@ -609,7 +628,7 @@ void DumpNetCDFMPIIO::write() } } - // write timestep header + // write timestep header write_time_and_cell(); diff --git a/src/NETCDF/dump_netcdf_mpiio.h b/src/NETCDF/dump_netcdf_mpiio.h index 5948dc272b..14ee930e26 100644 --- a/src/NETCDF/dump_netcdf_mpiio.h +++ b/src/NETCDF/dump_netcdf_mpiio.h @@ -62,6 +62,7 @@ class DumpNetCDFMPIIO : public DumpCustom { int type_nc_real; // netcdf type to use for real variables: float or double bool thermo; // write thermo output to netcdf file + bool thermo_warn; // warn (once) that thermo output is on incompatible step bigint n_buffer; // size of buffer bigint *int_buffer; // buffer for passing data to netcdf From de561737a3be4a0c3554b544273110c7be46e16e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Jun 2023 15:28:35 -0400 Subject: [PATCH 158/172] update docs --- doc/src/dump_modify.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index 89b3766083..0ac2afbeee 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -758,7 +758,8 @@ file alongside per-atom data. The values included in the dump file are cached values from the last thermo output and include the exact same the values as specified by the :doc:`thermo_style ` command. Because these are cached values, they are only up-to-date when dump -output is on a timestep that also has thermo output. +output is on a timestep that also has thermo output. Dump style *yaml* +will skip thermo output on incompatible steps. ---------- From 491e152289e3abf267f4ebee6cddda7ba797591f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Jun 2023 16:21:01 -0400 Subject: [PATCH 159/172] add API to library interface to access last thermo data --- src/EXTRA-DUMP/dump_yaml.cpp | 4 +- src/NETCDF/dump_netcdf.cpp | 12 ++-- src/NETCDF/dump_netcdf_mpiio.cpp | 12 ++-- src/library.cpp | 99 +++++++++++++++++++++++++++++++- src/library.h | 1 + src/thermo.cpp | 1 + src/thermo.h | 4 +- 7 files changed, 116 insertions(+), 17 deletions(-) diff --git a/src/EXTRA-DUMP/dump_yaml.cpp b/src/EXTRA-DUMP/dump_yaml.cpp index f8d2fb2264..47cab1ee02 100644 --- a/src/EXTRA-DUMP/dump_yaml.cpp +++ b/src/EXTRA-DUMP/dump_yaml.cpp @@ -61,8 +61,8 @@ void DumpYAML::write_header(bigint ndump) if (thermo) { Thermo *th = output->thermo; // output thermo data only on timesteps where it was computed - if (update->ntimestep == th->get_timestep()) { - int nfield = th->get_nfield(); + if (update->ntimestep == *th->get_timestep()) { + int nfield = *th->get_nfield(); const auto &keywords = th->get_keywords(); const auto &fields = th->get_fields(); diff --git a/src/NETCDF/dump_netcdf.cpp b/src/NETCDF/dump_netcdf.cpp index 2b064edeae..0115c0bbe9 100644 --- a/src/NETCDF/dump_netcdf.cpp +++ b/src/NETCDF/dump_netcdf.cpp @@ -224,7 +224,7 @@ void DumpNetCDF::openfile() if (thermo && !singlefile_opened) { delete[] thermovar; - thermovar = new int[output->thermo->get_nfield()]; + thermovar = new int[*output->thermo->get_nfield()]; } // now the computes and fixes have been initialized, so we can query @@ -323,7 +323,7 @@ void DumpNetCDF::openfile() if (thermo) { Thermo *th = output->thermo; const auto &keywords = th->get_keywords(); - const int nfield = th->get_nfield(); + const int nfield = *th->get_nfield(); for (int i = 0; i < nfield; i++) { NCERRX( nc_inq_varid(ncid, keywords[i].c_str(), &thermovar[i]), keywords[i].c_str() ); @@ -439,7 +439,7 @@ void DumpNetCDF::openfile() Thermo *th = output->thermo; const auto &fields = th->get_fields(); const auto &keywords = th->get_keywords(); - const int nfield = th->get_nfield(); + const int nfield = *th->get_nfield(); for (int i = 0; i < nfield; i++) { if (fields[i].type == multitype::DOUBLE) { @@ -610,18 +610,18 @@ void DumpNetCDF::write() // will output current thermo data only on timesteps where it was computed. // warn (once) about using cached copy from old timestep. - if (thermo_warn && (update->ntimestep != th->get_timestep())) { + if (thermo_warn && (update->ntimestep != *th->get_timestep())) { thermo_warn = false; if (comm->me == 0) { error->warning(FLERR, "Dump {} output on incompatible timestep with thermo output: {} vs {} \n" " Dump netcdf always stores thermo data from last thermo output", - id, th->get_timestep(), update->ntimestep); + id, *th->get_timestep(), update->ntimestep); } } const auto &keywords = th->get_keywords(); const auto &fields = th->get_fields(); - int nfield = th->get_nfield(); + int nfield = *th->get_nfield(); for (int i = 0; i < nfield; i++) { if (filewriter) { if (fields[i].type == multitype::DOUBLE) { diff --git a/src/NETCDF/dump_netcdf_mpiio.cpp b/src/NETCDF/dump_netcdf_mpiio.cpp index 4a34f11ab4..f9382dacef 100644 --- a/src/NETCDF/dump_netcdf_mpiio.cpp +++ b/src/NETCDF/dump_netcdf_mpiio.cpp @@ -221,7 +221,7 @@ void DumpNetCDFMPIIO::openfile() if (thermo && !singlefile_opened) { delete[] thermovar; - thermovar = new int[output->thermo->get_nfield()]; + thermovar = new int[*output->thermo->get_nfield()]; } // now the computes and fixes have been initialized, so we can query @@ -321,7 +321,7 @@ void DumpNetCDFMPIIO::openfile() if (thermo) { Thermo *th = output->thermo; const auto &keywords = th->get_keywords(); - const int nfield = th->get_nfield(); + const int nfield = *th->get_nfield(); for (int i = 0; i < nfield; i++) { NCERRX( ncmpi_inq_varid(ncid, keywords[i].c_str(), &thermovar[i]), keywords[i].c_str() ); @@ -429,7 +429,7 @@ void DumpNetCDFMPIIO::openfile() Thermo *th = output->thermo; const auto &fields = th->get_fields(); const auto &keywords = th->get_keywords(); - const int nfield = th->get_nfield(); + const int nfield = *th->get_nfield(); for (int i = 0; i < nfield; i++) { if (fields[i].type == multitype::DOUBLE) { @@ -603,18 +603,18 @@ void DumpNetCDFMPIIO::write() // will output current thermo data only on timesteps where it was computed. // warn (once) about using cached copy from old timestep. - if (thermo_warn && (update->ntimestep != th->get_timestep())) { + if (thermo_warn && (update->ntimestep != *th->get_timestep())) { thermo_warn = false; if (comm->me == 0) { error->warning(FLERR, "Dump {} output on incompatible timestep with thermo output: {} vs {} \n" " Dump netcdf/mpiio always stores thermo data from last thermo output", - id, th->get_timestep(), update->ntimestep); + id, *th->get_timestep(), update->ntimestep); } } const auto &keywords = th->get_keywords(); const auto &fields = th->get_fields(); - int nfield = th->get_nfield(); + int nfield = *th->get_nfield(); for (int i = 0; i < nfield; i++) { if (filewriter) { if (fields[i].type == multitype::DOUBLE) { diff --git a/src/library.cpp b/src/library.cpp index 33f49a4e53..6b079b4a93 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -719,7 +719,7 @@ double lammps_get_natoms(void *handle) /* ---------------------------------------------------------------------- */ -/** Get current value of a thermo keyword. +/** Evaluate a thermo keyword. * \verbatim embed:rst @@ -750,6 +750,103 @@ double lammps_get_thermo(void *handle, const char *keyword) /* ---------------------------------------------------------------------- */ +/** Access cached data from last thermo output + * +\verbatim embed:rst + +This function provides access to cached data from the last thermo +output. This differs from :cpp:func:`lammps_get_thermo` in that it does +not trigger an evaluation. It provides direct access to a a read-only +location of the last thermo output data and the corresponding keyword +strings. The output depends on the value of the *what* argument string. + +.. list-table:: + :header-rows: 1 + :widths: auto + + * - Value of *what + - Description of return value + - Data type + - Uses index + * - step + - timestep when the last thermo output was generated or -1 when no data available + - pointer to bigint cast to void pointer + - no + * - num + - number of fields in thermo output + - pointer to int cast to void pointer + - no + * - keyword + - column keyword for thermo output + - const char pointer cast to void pointer + - yes + * - type + - data type of thermo output column. LAMMPS_INT, LAMMPS_DOUBLE, or LAMMPS_INT64 + - const int cast to void pointer + - yes + * - data + - actual field data for column + - pointer to either int, int64_t or double cast to void pointer + - yes + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param what string with the kind of data requested + * \param idx integer with index into data arrays, ignored for scalar data + * \return pointer to location of requested data cast to void or NULL */ + +void *lammps_last_thermo(void *handle, const char *what, int idx) +{ + auto lmp = (LAMMPS *) handle; + void *val = nullptr; + Thermo *th = lmp->output->thermo; + if (!th) return nullptr; + const int nfield = *th->get_nfield(); + + BEGIN_CAPTURE + { + if (strcmp(what, "step") == 0) { + val = (void *) th->get_timestep(); + + } else if (strcmp(what, "num") == 0) { + val = (void *) th->get_nfield(); + + } else if (strcmp(what, "keyword") == 0) { + if ((idx < 0) || (idx >= nfield)) return nullptr; + const auto &keywords = th->get_keywords(); + val = (void *) keywords[idx].c_str(); + + } else if (strcmp(what, "type") == 0) { + if ((idx < 0) || (idx >= nfield)) return nullptr; + const auto &field = th->get_fields()[idx]; + if (field.type == multitype::INT) { + val = (void *) LAMMPS_INT; + } else if (field.type == multitype::BIGINT) { + val = (void *) LAMMPS_INT64; + } else if (field.type == multitype::DOUBLE) { + val = (void *) LAMMPS_DOUBLE; + } + + } else if (strcmp(what, "data") == 0) { + if ((idx < 0) || (idx >= nfield)) return nullptr; + const auto &field = th->get_fields()[idx]; + if (field.type == multitype::INT) { + val = (void *) &field.data.i; + } else if (field.type == multitype::BIGINT) { + val = (void *) &field.data.b; + } else if (field.type == multitype::DOUBLE) { + val = (void *) &field.data.d; + } + + } else val = nullptr; + } + END_CAPTURE + return val; +} + +/* ---------------------------------------------------------------------- */ + /** Extract simulation box parameters. * \verbatim embed:rst diff --git a/src/library.h b/src/library.h index 340b0edb7b..4c2530210c 100644 --- a/src/library.h +++ b/src/library.h @@ -148,6 +148,7 @@ void lammps_commands_string(void *handle, const char *str); double lammps_get_natoms(void *handle); double lammps_get_thermo(void *handle, const char *keyword); +void *lammps_last_thermo(void *handle, const char *what, int idx); void lammps_extract_box(void *handle, double *boxlo, double *boxhi, double *xy, double *yz, double *xz, int *pflags, int *boxflag); diff --git a/src/thermo.cpp b/src/thermo.cpp index 1c07da695f..c6e71354ff 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -111,6 +111,7 @@ Thermo::Thermo(LAMMPS *_lmp, int narg, char **arg) : lostflag = lostbond = Thermo::ERROR; lostbefore = warnbefore = 0; flushflag = 0; + ntimestep = -1; // set style and corresponding lineflag // custom style builds its own line of keywords, including wildcard expansion diff --git a/src/thermo.h b/src/thermo.h index f22f3103b0..333a282ca0 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -43,8 +43,8 @@ class Thermo : protected Pointers { int evaluate_keyword(const std::string &, double *); // for accessing cached thermo data - int get_nfield() const { return nfield; } - bigint get_timestep() const { return ntimestep; } + const int *get_nfield() const { return &nfield; } + const bigint *get_timestep() const { return &ntimestep; } const std::vector &get_fields() const { return field_data; } const std::vector &get_keywords() const { return keyword; } From 7551219d81c368e9b1879a3224377693beac306f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Jun 2023 20:16:26 -0400 Subject: [PATCH 160/172] correct multitype unittest for -DLAMMPS_SMALLSMALL --- unittest/utils/test_lmptype.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/unittest/utils/test_lmptype.cpp b/unittest/utils/test_lmptype.cpp index 6db340fddf..e5dc871953 100644 --- a/unittest/utils/test_lmptype.cpp +++ b/unittest/utils/test_lmptype.cpp @@ -41,7 +41,7 @@ TEST(Types, ubuf) TEST(Types, multitype) { - multitype m[6]; + multitype m[7]; int64_t b1 = (3L << 48) - 1; int i1 = 20; double d1 = 0.1; @@ -50,27 +50,22 @@ TEST(Types, multitype) m[1] = i1; m[2] = d1; -#if !defined(LAMMPS_SMALLSMALL) - m[3] = -((1L << 40) + (1L << 50)); -#endif + m[3] = (bigint) -((1L << 40) + (1L << 50)); m[4] = -1023; m[5] = -2.225; -#if defined(LAMMPS_SMALLSMALL) - EXPECT_EQ(m[0].type, multitype::INT); -#else EXPECT_EQ(m[0].type, multitype::BIGINT); -#endif EXPECT_EQ(m[1].type, multitype::INT); EXPECT_EQ(m[2].type, multitype::DOUBLE); #if defined(LAMMPS_SMALLSMALL) - EXPECT_EQ(m[3].type, multitype::NONE); + EXPECT_EQ(m[3].type, multitype::INT); #else EXPECT_EQ(m[3].type, multitype::BIGINT); #endif EXPECT_EQ(m[4].type, multitype::INT); EXPECT_EQ(m[5].type, multitype::DOUBLE); + EXPECT_EQ(m[6].type, multitype::NONE); EXPECT_EQ(m[0].data.b, b1); EXPECT_EQ(m[1].data.i, i1); From dd0bba6ac7a62f4e321f62c6105a7f736d3fd3bb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Jun 2023 20:37:53 -0400 Subject: [PATCH 161/172] whitespace --- src/GRANULAR/gran_sub_mod_normal.h | 6 +++--- src/library.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/GRANULAR/gran_sub_mod_normal.h b/src/GRANULAR/gran_sub_mod_normal.h index c1511fdfa5..6f2f3aabbe 100644 --- a/src/GRANULAR/gran_sub_mod_normal.h +++ b/src/GRANULAR/gran_sub_mod_normal.h @@ -94,7 +94,7 @@ namespace Granular_NS { void coeffs_to_local() override; void mix_coeffs(double *, double *) override; private: - int mixed_coefficients; + int mixed_coefficients; }; /* ---------------------------------------------------------------------- */ @@ -110,7 +110,7 @@ namespace Granular_NS { protected: double k, cohesion; double F_pulloff, Fne; - int mixed_coefficients; + int mixed_coefficients; }; /* ---------------------------------------------------------------------- */ @@ -129,7 +129,7 @@ namespace Granular_NS { protected: double k, cohesion; double Emix, F_pulloff, Fne; - int mixed_coefficients; + int mixed_coefficients; }; } // namespace Granular_NS diff --git a/src/library.cpp b/src/library.cpp index 6b079b4a93..62d029f625 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -788,7 +788,7 @@ strings. The output depends on the value of the *what* argument string. - actual field data for column - pointer to either int, int64_t or double cast to void pointer - yes - + \endverbatim * * \param handle pointer to a previously created LAMMPS instance From 2272d8dd205c99cf91c202e3961723719b7f673d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2023 09:45:12 -0400 Subject: [PATCH 162/172] add new library interface function to documentation --- doc/src/Library_properties.rst | 6 ++++ src/library.cpp | 53 ++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/doc/src/Library_properties.rst b/doc/src/Library_properties.rst index 21e5609fc0..005bfaeea5 100644 --- a/doc/src/Library_properties.rst +++ b/doc/src/Library_properties.rst @@ -5,6 +5,7 @@ This section documents the following functions: - :cpp:func:`lammps_get_natoms` - :cpp:func:`lammps_get_thermo` +- :cpp:func:`lammps_last_thermo` - :cpp:func:`lammps_extract_box` - :cpp:func:`lammps_reset_box` - :cpp:func:`lammps_memory_usage` @@ -81,6 +82,11 @@ subdomains and processors. ----------------------- +.. doxygenfunction:: lammps_last_thermo + :project: progguide + +----------------------- + .. doxygenfunction:: lammps_extract_box :project: progguide diff --git a/src/library.cpp b/src/library.cpp index 62d029f625..36d53c3e6c 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -723,10 +723,12 @@ double lammps_get_natoms(void *handle) * \verbatim embed:rst -This function returns the current value of a :doc:`thermo keyword -`. Unlike :cpp:func:`lammps_extract_global` it does not -give access to the storage of the desired data but returns its value as -a ``double``, so it can also return information that is computed on-the-fly. +This function returns the current value of a :doc:`thermo keyword `. +Unlike :cpp:func:`lammps_extract_global` it does not give access to the +storage of the desired data but returns its value as a ``double``, so it +can also return information that is computed on-the-fly. +Use :cpp:func:`lammps_last_thermo` to get access to the cached data from +the last thermo output. \endverbatim * @@ -754,49 +756,50 @@ double lammps_get_thermo(void *handle, const char *keyword) * \verbatim embed:rst -This function provides access to cached data from the last thermo -output. This differs from :cpp:func:`lammps_get_thermo` in that it does -not trigger an evaluation. It provides direct access to a a read-only -location of the last thermo output data and the corresponding keyword -strings. The output depends on the value of the *what* argument string. +This function provides access to cached data from the last thermo output. +This differs from :cpp:func:`lammps_get_thermo` in that it does not trigger +an evaluation. Instead it provides direct access to a read-only location +of the last thermo output data and the corresponding keyword strings. +The how to handle the return value depends on the value of the *what* +argument string. .. list-table:: :header-rows: 1 :widths: auto - * - Value of *what + * - Value of *what* - Description of return value - Data type - Uses index * - step - - timestep when the last thermo output was generated or -1 when no data available - - pointer to bigint cast to void pointer + - timestep when the last thermo output was generated or -1 + - pointer to bigint - no * - num - number of fields in thermo output - - pointer to int cast to void pointer + - pointer to int - no * - keyword - column keyword for thermo output - - const char pointer cast to void pointer + - const char pointer - yes * - type - - data type of thermo output column. LAMMPS_INT, LAMMPS_DOUBLE, or LAMMPS_INT64 - - const int cast to void pointer + - data type of thermo output column; see :cpp:enum:`_LMP_DATATYPE_CONST` + - const int - yes * - data - actual field data for column - - pointer to either int, int64_t or double cast to void pointer + - pointer to either int, int64_t or double - yes \endverbatim * * \param handle pointer to a previously created LAMMPS instance * \param what string with the kind of data requested - * \param idx integer with index into data arrays, ignored for scalar data + * \param index integer with index into data arrays, ignored for scalar data * \return pointer to location of requested data cast to void or NULL */ -void *lammps_last_thermo(void *handle, const char *what, int idx) +void *lammps_last_thermo(void *handle, const char *what, int index) { auto lmp = (LAMMPS *) handle; void *val = nullptr; @@ -813,13 +816,13 @@ void *lammps_last_thermo(void *handle, const char *what, int idx) val = (void *) th->get_nfield(); } else if (strcmp(what, "keyword") == 0) { - if ((idx < 0) || (idx >= nfield)) return nullptr; + if ((index < 0) || (index >= nfield)) return nullptr; const auto &keywords = th->get_keywords(); - val = (void *) keywords[idx].c_str(); + val = (void *) keywords[index].c_str(); } else if (strcmp(what, "type") == 0) { - if ((idx < 0) || (idx >= nfield)) return nullptr; - const auto &field = th->get_fields()[idx]; + if ((index < 0) || (index >= nfield)) return nullptr; + const auto &field = th->get_fields()[index]; if (field.type == multitype::INT) { val = (void *) LAMMPS_INT; } else if (field.type == multitype::BIGINT) { @@ -829,8 +832,8 @@ void *lammps_last_thermo(void *handle, const char *what, int idx) } } else if (strcmp(what, "data") == 0) { - if ((idx < 0) || (idx >= nfield)) return nullptr; - const auto &field = th->get_fields()[idx]; + if ((index < 0) || (index >= nfield)) return nullptr; + const auto &field = th->get_fields()[index]; if (field.type == multitype::INT) { val = (void *) &field.data.i; } else if (field.type == multitype::BIGINT) { From d6ad52ea6604cbf031076dd583c07d154bfdcca7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2023 09:46:33 -0400 Subject: [PATCH 163/172] allow wildcards with "cutoff" keyword to fix reaxff/species this also switched to using fmtlib for column aligned output formatting and re-applies clang-format. --- doc/src/fix_reaxff_species.rst | 23 +++++-- src/REAXFF/fix_reaxff_species.cpp | 106 +++++++++++++++--------------- src/REAXFF/fix_reaxff_species.h | 2 - 3 files changed, 71 insertions(+), 60 deletions(-) diff --git a/doc/src/fix_reaxff_species.rst b/doc/src/fix_reaxff_species.rst index f57132f08b..c22c9d7b9f 100644 --- a/doc/src/fix_reaxff_species.rst +++ b/doc/src/fix_reaxff_species.rst @@ -25,7 +25,7 @@ Syntax .. parsed-literal:: *cutoff* value = I J Cutoff - I, J = atom types + I, J = atom types (see asterisk form below) Cutoff = Bond-order cutoff value for this pair of atom types *element* value = Element1, Element2, ... *position* value = posfreq filepos @@ -49,7 +49,7 @@ Examples .. code-block:: LAMMPS fix 1 all reaxff/species 10 10 100 species.out - fix 1 all reaxff/species 1 2 20 species.out cutoff 1 1 0.40 cutoff 1 2 0.55 + fix 1 all reaxff/species 1 2 20 species.out cutoff 1 1 0.40 cutoff 1 2*3 0.55 fix 1 all reaxff/species 1 100 100 species.out element Au O H position 1000 AuOH.pos fix 1 all reaxff/species 1 100 100 species.out delete species.del masslimit 0 50 @@ -88,13 +88,24 @@ If the filename ends with ".gz", the output file is written in gzipped format. A gzipped dump file will be about 3x smaller than the text version, but will also take longer to write. +.. versionadded:: TBD + + Support for wildcards added + Optional keyword *cutoff* can be assigned to change the minimum bond-order values used in identifying chemical bonds between pairs of atoms. Bond-order cutoffs should be carefully chosen, as bond-order -cutoffs that are too small may include too many bonds (which will -result in an error), while cutoffs that are too large will result in -fragmented molecules. The default cutoff of 0.3 usually gives good -results. +cutoffs that are too small may include too many bonds (which will result +in an error), while cutoffs that are too large will result in fragmented +molecules. The default cutoff of 0.3 usually gives good results. A +wildcard asterisk can be used in place of or in conjunction with the I,J +arguments to set the bond-order cutoff for multiple pairs of atom types. +This takes the form "\*" or "\*n" or "n\*" or "m\*n". If :math:`N` is +the number of atom types, then an asterisk with no numeric values means +all types from 1 to :math:`N`. A leading asterisk means all types from +1 to n (inclusive). A trailing asterisk means all types from n to +:math:`N` (inclusive). A middle asterisk means all types from m to n +(inclusive). The optional keyword *element* can be used to specify the chemical symbol printed for each LAMMPS atom type. The number of symbols must diff --git a/src/REAXFF/fix_reaxff_species.cpp b/src/REAXFF/fix_reaxff_species.cpp index 92bca99ae0..8fa06cafb3 100644 --- a/src/REAXFF/fix_reaxff_species.cpp +++ b/src/REAXFF/fix_reaxff_species.cpp @@ -48,15 +48,16 @@ using namespace LAMMPS_NS; using namespace FixConst; static const char cite_reaxff_species_delete[] = - "fix reaxff/species, 'delete' keyword: https://doi.org/10.1016/j.carbon.2022.11.002\n\n" - "@Article{Gissinger23,\n" - " author = {J. R. Gissinger, S. R. Zavada, J. G. Smith, J. Kemppainen, I. Gallegos, G. M. Odegard, E. J. Siochi, K. E. Wise},\n" - " title = {Predicting char yield of high-temperature resins},\n" - " journal = {Carbon},\n" - " year = 2023,\n" - " volume = 202,\n" - " pages = {336-347}\n" - "}\n\n"; + "fix reaxff/species, 'delete' keyword: https://doi.org/10.1016/j.carbon.2022.11.002\n\n" + "@Article{Gissinger23,\n" + " author = {J. R. Gissinger, S. R. Zavada, J. G. Smith, J. Kemppainen, I. Gallegos, G. M. " + "Odegard, E. J. Siochi, K. E. Wise},\n" + " title = {Predicting char yield of high-temperature resins},\n" + " journal = {Carbon},\n" + " year = 2023,\n" + " volume = 202,\n" + " pages = {336-347}\n" + "}\n\n"; /* ---------------------------------------------------------------------- */ @@ -148,13 +149,11 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : setupflag = 0; // set default bond order cutoff - int itype, jtype; - double bo_cut; - bg_cut = 0.30; + double bo_cut = 0.30; int np1 = ntypes + 1; memory->create(BOCut, np1, np1, "reaxff/species:BOCut"); for (int i = 1; i < np1; i++) - for (int j = 1; j < np1; j++) BOCut[i][j] = bg_cut; + for (int j = 1; j < np1; j++) BOCut[i][j] = bo_cut; // optional args eletype = nullptr; @@ -172,16 +171,19 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : // set BO cutoff if (strcmp(arg[iarg], "cutoff") == 0) { if (iarg + 4 > narg) utils::missing_cmd_args(FLERR, "fix reaxff/species cutoff", error); - itype = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); - jtype = utils::inumeric(FLERR, arg[iarg + 2], false, lmp); + int ilo, ihi, jlo, jhi; + utils::bounds(FLERR, arg[iarg + 1], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR, arg[iarg + 2], 1, atom->ntypes, jlo, jhi, error); bo_cut = utils::numeric(FLERR, arg[iarg + 3], false, lmp); - if ((itype <= 0) || (jtype <= 0) || (itype > ntypes) || (jtype > ntypes)) - error->all(FLERR, "Fix reaxff/species cutoff atom type(s) out of range"); if ((bo_cut > 1.0) || (bo_cut < 0.0)) error->all(FLERR, "Fix reaxff/species invalid cutoff value: {}", bo_cut); - BOCut[itype][jtype] = bo_cut; - BOCut[jtype][itype] = bo_cut; + for (int i = ilo; i <= ihi; ++i) { + for (int j = MAX(jlo, i); j <= jhi; ++j) { + BOCut[i][j] = bo_cut; + BOCut[j][i] = bo_cut; + } + } iarg += 4; // modify element type names @@ -240,17 +242,21 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Unknown fix reaxff/species delete option: {}", arg[iarg]); // rate limit when deleting molecules } else if (strcmp(arg[iarg], "delete_rate_limit") == 0) { - if (iarg + 3 > narg) utils::missing_cmd_args(FLERR, "fix reaxff/species delete_rate_limit", error); + if (iarg + 3 > narg) + utils::missing_cmd_args(FLERR, "fix reaxff/species delete_rate_limit", error); delete_Nlimit_varid = -1; - if (strncmp(arg[iarg+1],"v_",2) == 0) { - delete_Nlimit_varname = &arg[iarg+1][2]; + if (strncmp(arg[iarg + 1], "v_", 2) == 0) { + delete_Nlimit_varname = &arg[iarg + 1][2]; delete_Nlimit_varid = input->variable->find(delete_Nlimit_varname.c_str()); if (delete_Nlimit_varid < 0) - error->all(FLERR,"Fix reaxff/species: Variable name {} does not exist",delete_Nlimit_varname); + error->all(FLERR, "Fix reaxff/species: Variable name {} does not exist", + delete_Nlimit_varname); if (!input->variable->equalstyle(delete_Nlimit_varid)) - error->all(FLERR,"Fix reaxff/species: Variable {} is not equal-style",delete_Nlimit_varname); - } else delete_Nlimit = utils::numeric(FLERR, arg[iarg+1], false, lmp); - delete_Nsteps = utils::numeric(FLERR, arg[iarg+2], false, lmp); + error->all(FLERR, "Fix reaxff/species: Variable {} is not equal-style", + delete_Nlimit_varname); + } else + delete_Nlimit = utils::numeric(FLERR, arg[iarg + 1], false, lmp); + delete_Nsteps = utils::numeric(FLERR, arg[iarg + 2], false, lmp); iarg += 3; // position of molecules } else if (strcmp(arg[iarg], "position") == 0) { @@ -292,10 +298,9 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : if (delete_Nsteps > 0) { if (lmp->citeme) lmp->citeme->add(cite_reaxff_species_delete); - memory->create(delete_Tcount,delete_Nsteps,"reaxff/species:delete_Tcount"); + memory->create(delete_Tcount, delete_Nsteps, "reaxff/species:delete_Tcount"); - for (int i = 0; i < delete_Nsteps; i++) - delete_Tcount[i] = -1; + for (int i = 0; i < delete_Nsteps; i++) delete_Tcount[i] = -1; delete_Tcount[0] = 0; } @@ -393,9 +398,11 @@ void FixReaxFFSpecies::init() if (delete_Nsteps > 0) { delete_Nlimit_varid = input->variable->find(delete_Nlimit_varname.c_str()); if (delete_Nlimit_varid < 0) - error->all(FLERR,"Fix reaxff/species: Variable name {} does not exist",delete_Nlimit_varname); + error->all(FLERR, "Fix reaxff/species: Variable name {} does not exist", + delete_Nlimit_varname); if (!input->variable->equalstyle(delete_Nlimit_varid)) - error->all(FLERR,"Fix reaxff/species: Variable {} is not equal-style",delete_Nlimit_varname); + error->all(FLERR, "Fix reaxff/species: Variable {} is not equal-style", + delete_Nlimit_varname); } } @@ -427,8 +434,7 @@ void FixReaxFFSpecies::Output_ReaxFF_Bonds(bigint ntimestep, FILE * /*fp*/) if (ntimestep != nvalid) { // push back delete_Tcount on every step if (delete_Nsteps > 0) - for (int i = delete_Nsteps-1; i > 0; i--) - delete_Tcount[i] = delete_Tcount[i-1]; + for (int i = delete_Nsteps - 1; i > 0; i--) delete_Tcount[i] = delete_Tcount[i - 1]; return; } @@ -732,31 +738,31 @@ void FixReaxFFSpecies::WriteFormulas(int Nmole, int Nspec) int i, j, itemp; bigint ntimestep = update->ntimestep; - fprintf(fp, "# Timestep No_Moles No_Specs "); + fprintf(fp, "# Timestep No_Moles No_Specs"); Nmoltype = 0; for (i = 0; i < Nspec; i++) nd[i] = CheckExistence(i, ntypes); for (i = 0; i < Nmoltype; i++) { + std::string molname; for (j = 0; j < ntypes; j++) { itemp = MolType[ntypes * i + j]; if (itemp != 0) { if (eletype) - fprintf(fp, "%s", eletype[j]); + molname += eletype[j]; else - fprintf(fp, "%c", ele[j]); - if (itemp != 1) fprintf(fp, "%d", itemp); + molname += ele[j]; + if (itemp != 1) molname += std::to_string(itemp); } } - fputs("\t", fp); + fmt::print(fp, " {:>11}", molname); } fputs("\n", fp); - fmt::print(fp, "{} {:11} {:11}\t", ntimestep, Nmole, Nspec); - - for (i = 0; i < Nmoltype; i++) fprintf(fp, " %d\t", NMol[i]); - fprintf(fp, "\n"); + fmt::print(fp, "{:>11} {:>11} {:>11}", ntimestep, Nmole, Nspec); + for (i = 0; i < Nmoltype; i++) fmt::print(fp, " {:>11}", NMol[i]); + fputs("\n", fp); } /* ---------------------------------------------------------------------- */ @@ -884,8 +890,8 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec) int ndeletions; int headroom = -1; if (delete_Nsteps > 0) { - if (delete_Tcount[delete_Nsteps-1] == -1) return; - ndeletions = delete_Tcount[0] - delete_Tcount[delete_Nsteps-1]; + if (delete_Tcount[delete_Nsteps - 1] == -1) return; + ndeletions = delete_Tcount[0] - delete_Tcount[delete_Nsteps - 1]; if (delete_Nlimit_varid > -1) delete_Nlimit = input->variable->compute_equal(delete_Nlimit_varid); headroom = MAX(0, delete_Nlimit - ndeletions); @@ -925,13 +931,11 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec) std::random_device rnd; std::minstd_rand park_rng(rnd()); int *molrange; - memory->create(molrange,Nmole,"reaxff/species:molrange"); - for (m = 0; m < Nmole; m++) - molrange[m] = m + 1; + memory->create(molrange, Nmole, "reaxff/species:molrange"); + for (m = 0; m < Nmole; m++) molrange[m] = m + 1; if (delete_Nsteps > 0) { // shuffle index when using rate_limit, in case order is biased - if (comm->me == 0) - std::shuffle(&molrange[0],&molrange[Nmole], park_rng); + if (comm->me == 0) std::shuffle(&molrange[0], &molrange[Nmole], park_rng); MPI_Bcast(&molrange[0], Nmole, MPI_INT, 0, world); } @@ -1060,11 +1064,9 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec) } } - // push back delete_Tcount on every step if (delete_Nsteps > 0) { - for (i = delete_Nsteps-1; i > 0; i--) - delete_Tcount[i] = delete_Tcount[i-1]; + for (i = delete_Nsteps - 1; i > 0; i--) delete_Tcount[i] = delete_Tcount[i - 1]; delete_Tcount[0] += this_delete_Tcount; } diff --git a/src/REAXFF/fix_reaxff_species.h b/src/REAXFF/fix_reaxff_species.h index 27efa0f915..f711cdeb11 100644 --- a/src/REAXFF/fix_reaxff_species.h +++ b/src/REAXFF/fix_reaxff_species.h @@ -51,8 +51,6 @@ class FixReaxFFSpecies : public Fix { int *Mol2Spec; double *clusterID; AtomCoord *x0; - - double bg_cut; double **BOCut; std::vector del_species; From 36cac1e83deba7aa03f6122128f6fdf5244ff1bc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2023 12:45:41 -0400 Subject: [PATCH 164/172] make sure the field_data vector size always matches the size of the keywords vector --- src/thermo.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/thermo.cpp b/src/thermo.cpp index c6e71354ff..6122edec83 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -1068,6 +1068,8 @@ void Thermo::parse_fields(const std::string &str) } } } + field_data.clear(); + field_data.resize(nfield); } /* ---------------------------------------------------------------------- From a2c968386ed31621e288b63b954243d5ae8a9c4e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2023 12:46:00 -0400 Subject: [PATCH 165/172] include versionadded tag --- src/library.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/library.cpp b/src/library.cpp index 36d53c3e6c..02758abcda 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -756,6 +756,8 @@ double lammps_get_thermo(void *handle, const char *keyword) * \verbatim embed:rst +.. versionadded:: TBD + This function provides access to cached data from the last thermo output. This differs from :cpp:func:`lammps_get_thermo` in that it does not trigger an evaluation. Instead it provides direct access to a read-only location From 8ddac8cf0229212b046f6eca6b29c4829d319df0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2023 12:46:41 -0400 Subject: [PATCH 166/172] search through the python folders recursive to detect all pending version tags --- tools/coding_standard/versiontags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/coding_standard/versiontags.py b/tools/coding_standard/versiontags.py index 0b4597046f..ec512a3fad 100644 --- a/tools/coding_standard/versiontags.py +++ b/tools/coding_standard/versiontags.py @@ -21,7 +21,7 @@ DEFAULT_CONFIG = """ recursive: true include: - doc/src/** - - python + - python/** - src/** exclude: - src/Make.sh From 3f6032e80d05039f538aac19f7916102520e08ee Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2023 13:03:28 -0400 Subject: [PATCH 167/172] add python module interface to lammps_last_thermo, small consistency fixes --- python/lammps/core.py | 54 +++++++++++++++++++++++++++++++++++++++++++ src/library.cpp | 6 ++--- src/library.h | 2 +- 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/python/lammps/core.py b/python/lammps/core.py index 80961186f3..932d4b863c 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -272,6 +272,9 @@ class lammps(object): self.lib.lammps_get_thermo.argtypes = [c_void_p, c_char_p] self.lib.lammps_get_thermo.restype = c_double + self.lib.lammps_last_thermo.argtypes = [c_void_p, c_char_p, c_int] + self.lib.lammps_last_thermo.restype = c_void_p + self.lib.lammps_encode_image_flags.restype = self.c_imageint self.lib.lammps_config_has_package.argtypes = [c_char_p] @@ -744,6 +747,57 @@ class lammps(object): # ------------------------------------------------------------------------- + def last_thermo(self): + """Get a dictionary of the last thermodynamic output + + This is a wrapper around the :cpp:func:`lammps_last_thermo` + function of the C-library interface. It collects the cached thermo + data from the last timestep into a dictionary. The return value + is None, if there has not been any thermo output yet. + + :return: value of thermo keyword + :rtype: dict or None + """ + + rv = dict() + with ExceptionCheck(self): + ptr = self.lib.lammps_last_thermo(self.lmp, c_char_p("step".encode()), 0) + mystep = cast(ptr, POINTER(self.c_bigint)).contents.value + if mystep < 0: + return None + + with ExceptionCheck(self): + ptr = self.lib.lammps_last_thermo(self.lmp, c_char_p("num".encode()), 0) + nfield = cast(ptr, POINTER(c_int)).contents.value + + for i in range(nfield): + with ExceptionCheck(self): + ptr = self.lib.lammps_last_thermo(self.lmp, c_char_p("keyword".encode()), i) + kw = cast(ptr, c_char_p).value.decode() + + # temporarily switch return type since this stores an int in a pointer + self.lib.lammps_last_thermo.restype = c_int + with ExceptionCheck(self): + typ = self.lib.lammps_last_thermo(self.lmp, c_char_p("type".encode()), i) + self.lib.lammps_last_thermo.restype = c_void_p + with ExceptionCheck(self): + ptr = self.lib.lammps_last_thermo(self.lmp, c_char_p("data".encode()), i) + + if typ == LAMMPS_DOUBLE: + val = cast(ptr, POINTER(c_double)).contents.value + elif typ == LAMMPS_INT: + val = cast(ptr, POINTER(c_int)).contents.value + elif typ == LAMMPS_INT64: + val = cast(ptr, POINTER(c_int64)).contents.value + else: + # we should not get here + raise TypeError("Unknown LAMMPS data type " + str(typ)) + rv[kw] = val + + return rv + + # ------------------------------------------------------------------------- + def extract_setting(self, name): """Query LAMMPS about global settings that can be expressed as an integer. diff --git a/src/library.cpp b/src/library.cpp index 02758abcda..cf5d131ba6 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -783,15 +783,15 @@ argument string. - no * - keyword - column keyword for thermo output - - const char pointer + - pointer to 0-terminated const char array - yes * - type - data type of thermo output column; see :cpp:enum:`_LMP_DATATYPE_CONST` - - const int + - const int (**not** a pointer) - yes * - data - actual field data for column - - pointer to either int, int64_t or double + - pointer to int, int64_t or double - yes \endverbatim diff --git a/src/library.h b/src/library.h index 4c2530210c..5f46e36ccf 100644 --- a/src/library.h +++ b/src/library.h @@ -148,7 +148,7 @@ void lammps_commands_string(void *handle, const char *str); double lammps_get_natoms(void *handle); double lammps_get_thermo(void *handle, const char *keyword); -void *lammps_last_thermo(void *handle, const char *what, int idx); +void *lammps_last_thermo(void *handle, const char *what, int index); void lammps_extract_box(void *handle, double *boxlo, double *boxhi, double *xy, double *yz, double *xz, int *pflags, int *boxflag); From b093f1aac19f056e0decfccef23f95d24cd6d44f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2023 13:11:19 -0400 Subject: [PATCH 168/172] move versionadded tags to the top, replace some missed TBD with version info --- python/lammps/core.py | 71 ++++++++-------- python/lammps/numpy_wrapper.py | 28 +++---- src/library.cpp | 144 +++++++++++++++++---------------- 3 files changed, 125 insertions(+), 118 deletions(-) diff --git a/python/lammps/core.py b/python/lammps/core.py index 932d4b863c..b15ddf9302 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -506,9 +506,9 @@ class lammps(object): def error(self, error_type, error_text): """Forward error to the LAMMPS Error class. - This is a wrapper around the :cpp:func:`lammps_error` function of the C-library interface. + .. versionadded:: 3Nov2022 - .. versionadded:: TBD + This is a wrapper around the :cpp:func:`lammps_error` function of the C-library interface. :param error_type: :type error_type: int @@ -1343,6 +1343,8 @@ class lammps(object): def gather_bonds(self): """Retrieve global list of bonds + .. versionadded:: 28Jul2021 + This is a wrapper around the :cpp:func:`lammps_gather_bonds` function of the C-library interface. @@ -1350,8 +1352,6 @@ class lammps(object): flat list of ctypes integer values with the bond type, bond atom1, bond atom2 for each bond. - .. versionadded:: 28Jul2021 - :return: a tuple with the number of bonds and a list of c_int or c_long :rtype: (int, 3*nbonds*c_tagint) """ @@ -1366,6 +1366,8 @@ class lammps(object): def gather_angles(self): """Retrieve global list of angles + .. versionadded:: 8Feb2023 + This is a wrapper around the :cpp:func:`lammps_gather_angles` function of the C-library interface. @@ -1373,8 +1375,6 @@ class lammps(object): flat list of ctypes integer values with the angle type, angle atom1, angle atom2, angle atom3 for each angle. - .. versionadded:: TBD - :return: a tuple with the number of angles and a list of c_int or c_long :rtype: (int, 4*nangles*c_tagint) """ @@ -1389,6 +1389,8 @@ class lammps(object): def gather_dihedrals(self): """Retrieve global list of dihedrals + .. versionadded:: 8Feb2023 + This is a wrapper around the :cpp:func:`lammps_gather_dihedrals` function of the C-library interface. @@ -1396,8 +1398,6 @@ class lammps(object): flat list of ctypes integer values with the dihedral type, dihedral atom1, dihedral atom2, dihedral atom3, dihedral atom4 for each dihedral. - .. versionadded:: TBD - :return: a tuple with the number of dihedrals and a list of c_int or c_long :rtype: (int, 5*ndihedrals*c_tagint) """ @@ -1412,6 +1412,8 @@ class lammps(object): def gather_impropers(self): """Retrieve global list of impropers + .. versionadded:: 8Feb2023 + This is a wrapper around the :cpp:func:`lammps_gather_impropers` function of the C-library interface. @@ -1419,8 +1421,6 @@ class lammps(object): flat list of ctypes integer values with the improper type, improper atom1, improper atom2, improper atom3, improper atom4 for each improper. - .. versionadded:: TBD - :return: a tuple with the number of impropers and a list of c_int or c_long :rtype: (int, 5*nimpropers*c_tagint) """ @@ -1659,13 +1659,13 @@ class lammps(object): def is_running(self): """ Report whether being called from a function during a run or a minimization + .. versionadded:: 9Oct2020 + Various LAMMPS commands must not be called during an ongoing run or minimization. This property allows to check for that. This is a wrapper around the :cpp:func:`lammps_is_running` function of the library interface. - .. versionadded:: 9Oct2020 - :return: True when called during a run otherwise false :rtype: bool """ @@ -1676,12 +1676,13 @@ class lammps(object): def force_timeout(self): """ Trigger an immediate timeout, i.e. a "soft stop" of a run. + .. versionadded:: 9Oct2020 + This function allows to cleanly stop an ongoing run or minimization at the next loop iteration. This is a wrapper around the :cpp:func:`lammps_force_timeout` function of the library interface. - .. versionadded:: 9Oct2020 """ self.lib.lammps_force_timeout(self.lmp) @@ -1764,11 +1765,11 @@ class lammps(object): def has_package(self, name): """ Report if the named package has been enabled in the LAMMPS shared library. + .. versionadded:: 3Nov2022 + This is a wrapper around the :cpp:func:`lammps_config_has_package` function of the library interface. - .. versionadded:: TBD - :param name: name of the package :type name: string @@ -1908,11 +1909,11 @@ class lammps(object): def has_id(self, category, name): """Returns whether a given ID name is available in a given category + .. versionadded:: 9Oct2020 + This is a wrapper around the function :cpp:func:`lammps_has_id` of the library interface. - .. versionadded:: 9Oct2020 - :param category: name of category :type category: string :param name: name of the ID @@ -1928,11 +1929,11 @@ class lammps(object): def available_ids(self, category): """Returns a list of IDs available for a given category + .. versionadded:: 9Oct2020 + This is a wrapper around the functions :cpp:func:`lammps_id_count()` and :cpp:func:`lammps_id_name()` of the library interface. - .. versionadded:: 9Oct2020 - :param category: name of category :type category: string @@ -1955,11 +1956,11 @@ class lammps(object): def available_plugins(self, category): """Returns a list of plugins available for a given category + .. versionadded:: 10Mar2021 + This is a wrapper around the functions :cpp:func:`lammps_plugin_count()` and :cpp:func:`lammps_plugin_name()` of the library interface. - .. versionadded:: 10Mar2021 - :return: list of style/name pairs of loaded plugins :rtype: list """ @@ -2024,11 +2025,11 @@ class lammps(object): def fix_external_get_force(self, fix_id): """Get access to the array with per-atom forces of a fix external instance with a given fix ID. + .. versionadded:: 28Jul2021 + This is a wrapper around the :cpp:func:`lammps_fix_external_get_force` function of the C-library interface. - .. versionadded:: 28Jul2021 - :param fix_id: Fix-ID of a fix external instance :type: string :return: requested data @@ -2043,11 +2044,11 @@ class lammps(object): def fix_external_set_energy_global(self, fix_id, eng): """Set the global energy contribution for a fix external instance with the given ID. + .. versionadded:: 28Jul2021 + This is a wrapper around the :cpp:func:`lammps_fix_external_set_energy_global` function of the C-library interface. - .. versionadded:: 28Jul2021 - :param fix_id: Fix-ID of a fix external instance :type: string :param eng: potential energy value to be added by fix external @@ -2062,11 +2063,11 @@ class lammps(object): def fix_external_set_virial_global(self, fix_id, virial): """Set the global virial contribution for a fix external instance with the given ID. + .. versionadded:: 28Jul2021 + This is a wrapper around the :cpp:func:`lammps_fix_external_set_virial_global` function of the C-library interface. - .. versionadded:: 28Jul2021 - :param fix_id: Fix-ID of a fix external instance :type: string :param eng: list of 6 floating point numbers with the virial to be added by fix external @@ -2082,11 +2083,11 @@ class lammps(object): def fix_external_set_energy_peratom(self, fix_id, eatom): """Set the per-atom energy contribution for a fix external instance with the given ID. + .. versionadded:: 28Jul2021 + This is a wrapper around the :cpp:func:`lammps_fix_external_set_energy_peratom` function of the C-library interface. - .. versionadded:: 28Jul2021 - :param fix_id: Fix-ID of a fix external instance :type: string :param eatom: list of potential energy values for local atoms to be added by fix external @@ -2105,11 +2106,11 @@ class lammps(object): def fix_external_set_virial_peratom(self, fix_id, vatom): """Set the per-atom virial contribution for a fix external instance with the given ID. + .. versionadded:: 28Jul2021 + This is a wrapper around the :cpp:func:`lammps_fix_external_set_virial_peratom` function of the C-library interface. - .. versionadded:: 28Jul2021 - :param fix_id: Fix-ID of a fix external instance :type: string :param vatom: list of natoms lists with 6 floating point numbers to be added by fix external @@ -2137,11 +2138,11 @@ class lammps(object): def fix_external_set_vector_length(self, fix_id, length): """Set the vector length for a global vector stored with fix external for analysis + .. versionadded:: 28Jul2021 + This is a wrapper around the :cpp:func:`lammps_fix_external_set_vector_length` function of the C-library interface. - .. versionadded:: 28Jul2021 - :param fix_id: Fix-ID of a fix external instance :type: string :param length: length of the global vector @@ -2155,11 +2156,11 @@ class lammps(object): def fix_external_set_vector(self, fix_id, idx, val): """Store a global vector value for a fix external instance with the given ID. + .. versionadded:: 28Jul2021 + This is a wrapper around the :cpp:func:`lammps_fix_external_set_vector` function of the C-library interface. - .. versionadded:: 28Jul2021 - :param fix_id: Fix-ID of a fix external instance :type: string :param idx: 1-based index of the value in the global vector diff --git a/python/lammps/numpy_wrapper.py b/python/lammps/numpy_wrapper.py index 8286fb9a5c..f3ea0fdf8e 100644 --- a/python/lammps/numpy_wrapper.py +++ b/python/lammps/numpy_wrapper.py @@ -262,12 +262,12 @@ class numpy_wrapper: def gather_bonds(self): """Retrieve global list of bonds as NumPy array + .. versionadded:: 28Jul2021 + This is a wrapper around :py:meth:`lammps.gather_bonds() ` It behaves the same as the original method, but returns a NumPy array instead of a ``ctypes`` list. - .. versionadded:: 28Jul2021 - :return: the requested data as a 2d-integer numpy array :rtype: numpy.array(nbonds,3) """ @@ -280,12 +280,12 @@ class numpy_wrapper: def gather_angles(self): """ Retrieve global list of angles as NumPy array + .. versionadded:: 8Feb2023 + This is a wrapper around :py:meth:`lammps.gather_angles() ` It behaves the same as the original method, but returns a NumPy array instead of a ``ctypes`` list. - .. versionadded:: TBD - :return: the requested data as a 2d-integer numpy array :rtype: numpy.array(nangles,4) """ @@ -298,12 +298,12 @@ class numpy_wrapper: def gather_dihedrals(self): """ Retrieve global list of dihedrals as NumPy array + .. versionadded:: 8Feb2023 + This is a wrapper around :py:meth:`lammps.gather_dihedrals() ` It behaves the same as the original method, but returns a NumPy array instead of a ``ctypes`` list. - .. versionadded:: TBD - :return: the requested data as a 2d-integer numpy array :rtype: numpy.array(ndihedrals,5) """ @@ -316,12 +316,12 @@ class numpy_wrapper: def gather_impropers(self): """ Retrieve global list of impropers as NumPy array + .. versionadded:: 8Feb2023 + This is a wrapper around :py:meth:`lammps.gather_impropers() ` It behaves the same as the original method, but returns a NumPy array instead of a ``ctypes`` list. - .. versionadded:: TBD - :return: the requested data as a 2d-integer numpy array :rtype: numpy.array(nimpropers,5) """ @@ -334,13 +334,13 @@ class numpy_wrapper: def fix_external_get_force(self, fix_id): """Get access to the array with per-atom forces of a fix external instance with a given fix ID. + .. versionchanged:: 28Jul2021 + This function is a wrapper around the :py:meth:`lammps.fix_external_get_force() ` method. It behaves the same as the original method, but returns a NumPy array instead of a ``ctypes`` pointer. - .. versionchanged:: 28Jul2021 - :param fix_id: Fix-ID of a fix external instance :type: string :return: requested data @@ -356,13 +356,13 @@ class numpy_wrapper: def fix_external_set_energy_peratom(self, fix_id, eatom): """Set the per-atom energy contribution for a fix external instance with the given ID. + .. versionadded:: 28Jul2021 + This function is an alternative to :py:meth:`lammps.fix_external_set_energy_peratom() ` method. It behaves the same as the original method, but accepts a NumPy array instead of a list as argument. - .. versionadded:: 28Jul2021 - :param fix_id: Fix-ID of a fix external instance :type: string :param eatom: per-atom potential energy @@ -383,13 +383,13 @@ class numpy_wrapper: def fix_external_set_virial_peratom(self, fix_id, vatom): """Set the per-atom virial contribution for a fix external instance with the given ID. + .. versionadded:: 28Jul2021 + This function is an alternative to :py:meth:`lammps.fix_external_set_virial_peratom() ` method. It behaves the same as the original method, but accepts a NumPy array instead of a list as argument. - .. versionadded:: 28Jul2021 - :param fix_id: Fix-ID of a fix external instance :type: string :param eatom: per-atom potential energy diff --git a/src/library.cpp b/src/library.cpp index cf5d131ba6..24a8afa7c7 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -247,6 +247,8 @@ void *lammps_open_no_mpi(int argc, char **argv, void **ptr) * \verbatim embed:rst +.. versionadded:: 18Sep2020 + This function is a version of :cpp:func:`lammps_open`, that uses an integer for the MPI communicator as the MPI Fortran interface does. It is used in the :f:func:`lammps` constructor of the LAMMPS Fortran @@ -257,8 +259,6 @@ communicator with ``MPI_Comm_f2c()`` and then calls If for some reason the creation or initialization of the LAMMPS instance fails a null pointer is returned. -.. versionadded:: 18Sep2020 - *See also* :cpp:func:`lammps_open_fortran`, :cpp:func:`lammps_open_no_mpi` @@ -304,13 +304,13 @@ void lammps_close(void *handle) * \verbatim embed:rst +.. versionadded:: 18Sep2020 + The MPI standard requires that any MPI application must call ``MPI_Init()`` exactly once before performing any other MPI function calls. This function checks, whether MPI is already initialized and calls ``MPI_Init()`` in case it is not. -.. versionadded:: 18Sep2020 - \endverbatim */ void lammps_mpi_init() @@ -333,6 +333,8 @@ void lammps_mpi_init() * \verbatim embed:rst +.. versionadded:: 18Sep2020 + The MPI standard requires that any MPI application calls ``MPI_Finalize()`` before exiting. Even if a calling program does not do any MPI calls, MPI is still initialized internally to avoid errors @@ -341,8 +343,6 @@ before exiting the program to wait until all (parallel) tasks are completed and then MPI is cleanly shut down. After calling this function no more MPI calls may be made. -.. versionadded:: 18Sep2020 - *See also* :cpp:func:`lammps_kokkos_finalize`, :cpp:func:`lammps_python_finalize` \endverbatim */ @@ -366,6 +366,8 @@ void lammps_mpi_finalize() * \verbatim embed:rst +.. versionadded:: 2Jul2021 + The Kokkos library may only be initialized once during the execution of a process. This is done automatically the first time Kokkos functionality is used. This requires that the Kokkos environment @@ -373,8 +375,6 @@ must be explicitly shut down after any LAMMPS instance using it is closed (to release associated resources). After calling this function no Kokkos functionality may be used. -.. versionadded:: 2Jul2021 - *See also* :cpp:func:`lammps_mpi_finalize`, :cpp:func:`lammps_python_finalize` \endverbatim */ @@ -390,6 +390,8 @@ void lammps_kokkos_finalize() * \verbatim embed:rst +.. versionadded:: 20Sep2021 + This function resets and clears an embedded Python environment by calling the `Py_Finalize() function `_ @@ -409,8 +411,6 @@ after calling Py_Finalize(). This function can be called to explicitly clear the Python environment in case it is safe to do so. -.. versionadded:: 20Sep2021 - *See also* :cpp:func:`lammps_mpi_finalize`, :cpp:func:`lammps_kokkos_finalize` \endverbatim */ @@ -427,6 +427,8 @@ void lammps_python_finalize() * \verbatim embed:rst +.. versionadded:: 3Nov2022 + This function is a wrapper around functions in the ``Error`` to print an error message and then stop LAMMPS. @@ -435,8 +437,6 @@ of constants from :cpp:enum:`_LMP_ERROR_CONST`. If the value does not match any valid combination of constants a warning is printed and the function returns. -.. versionadded:: 3Nov2022 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance @@ -979,6 +979,8 @@ void lammps_reset_box(void *handle, double *boxlo, double *boxhi, * \verbatim embed:rst +.. versionadded:: 18Sep2020 + This function will retrieve memory usage information for the current LAMMPS instance or process. The *meminfo* buffer will be filled with 3 different numbers (if supported by the operating system). The first @@ -991,8 +993,6 @@ third number is the maximum amount of RAM (not swap) used by the process so far. If any of the two latter parameters is not supported by the operating system it will be set to zero. -.. versionadded:: 18Sep2020 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance @@ -1012,6 +1012,8 @@ void lammps_memory_usage(void *handle, double *meminfo) * \verbatim embed:rst +.. versionadded:: 18Sep2020 + This will take the LAMMPS "world" communicator and convert it to an integer using ``MPI_Comm_c2f()``, so it is equivalent to the corresponding MPI communicator in Fortran. This way it can be safely @@ -1020,8 +1022,6 @@ to the C language representation use ``MPI_Comm_f2c()``. If LAMMPS was compiled with MPI_STUBS, this function returns -1. -.. versionadded:: 18Sep2020 - *See also* :cpp:func:`lammps_open_fortran` @@ -1284,13 +1284,13 @@ int lammps_extract_setting(void *handle, const char *keyword) * \verbatim embed:rst +.. versionadded:: 18Sep2020 + This function returns an integer that encodes the data type of the global property with the specified name. See :cpp:enum:`_LMP_DATATYPE_CONST` for valid values. Callers of :cpp:func:`lammps_extract_global` can use this information to then decide how to cast the ``void *`` pointer and access the data. -.. versionadded:: 18Sep2020 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance (unused) @@ -1773,13 +1773,13 @@ void *lammps_extract_global(void *handle, const char *name) * \verbatim embed:rst +.. versionadded:: 18Sep2020 + This function returns an integer that encodes the data type of the per-atom property with the specified name. See :cpp:enum:`_LMP_DATATYPE_CONST` for valid values. Callers of :cpp:func:`lammps_extract_atom` can use this information to then decide how to cast the ``void *`` pointer and access the data. -.. versionadded:: 18Sep2020 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance @@ -2308,13 +2308,13 @@ void *lammps_extract_variable(void *handle, const char *name, const char *group) * \verbatim embed:rst +.. versionadded:: 3Nov2022 + This function returns an integer that encodes the data type of the variable with the specified name. See :cpp:enum:`_LMP_VAR_CONST` for valid values. Callers of :cpp:func:`lammps_extract_variable` can use this information to decide how to cast the ``void *`` pointer and access the data. -.. versionadded:: 3Nov2022 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance @@ -3166,6 +3166,8 @@ void lammps_scatter_atoms_subset(void *handle, const char *name, int type, * \verbatim embed:rst +.. versionadded:: 28Jul2021 + This function copies the list of all bonds into a buffer provided by the calling code. The buffer will be filled with bond type, bond atom 1, bond atom 2 for each bond. Thus the buffer has to be allocated to the @@ -3180,8 +3182,6 @@ When running in parallel, the data buffer must be allocated on **all** MPI ranks and will be filled with the information for **all** bonds in the system. -.. versionadded:: 28Jul2021 - Below is a brief C code demonstrating accessing this collected bond information. .. code-block:: c @@ -3277,6 +3277,8 @@ void lammps_gather_bonds(void *handle, void *data) * \verbatim embed:rst +.. versionadded:: 8Feb2023 + This function copies the list of all angles into a buffer provided by the calling code. The buffer will be filled with angle type, angle atom 1, angle atom 2, angle atom 3 for each angle. Thus the buffer has to be allocated to the @@ -3291,8 +3293,6 @@ When running in parallel, the data buffer must be allocated on **all** MPI ranks and will be filled with the information for **all** angles in the system. -.. versionadded:: 8Feb2023 - Below is a brief C code demonstrating accessing this collected angle information. .. code-block:: c @@ -3388,6 +3388,8 @@ void lammps_gather_angles(void *handle, void *data) * \verbatim embed:rst +.. versionadded:: 8Feb2023 + This function copies the list of all dihedrals into a buffer provided by the calling code. The buffer will be filled with dihedral type, dihedral atom 1, dihedral atom 2, dihedral atom 3, dihedral atom 4 for each dihedral. @@ -3403,8 +3405,6 @@ When running in parallel, the data buffer must be allocated on **all** MPI ranks and will be filled with the information for **all** dihedrals in the system. -.. versionadded:: 8Feb2023 - Below is a brief C code demonstrating accessing this collected dihedral information. .. code-block:: c @@ -3500,6 +3500,8 @@ void lammps_gather_dihedrals(void *handle, void *data) * \verbatim embed:rst +.. versionadded:: 8Feb2023 + This function copies the list of all impropers into a buffer provided by the calling code. The buffer will be filled with improper type, improper atom 1, improper atom 2, improper atom 3, improper atom 4 for each improper. @@ -3515,8 +3517,6 @@ When running in parallel, the data buffer must be allocated on **all** MPI ranks and will be filled with the information for **all** impropers in the system. -.. versionadded:: 8Feb2023 - Below is a brief C code demonstrating accessing this collected improper information. .. code-block:: c @@ -5310,6 +5310,8 @@ int lammps_version(void *handle) * \verbatim embed:rst +.. versionadded:: 9Oct2020 + The :cpp:func:`lammps_get_os_info` function can be used to retrieve detailed information about the hosting operating system and compiler/runtime. @@ -5318,8 +5320,6 @@ A suitable buffer for a C-style string has to be provided and its length. The assembled text will be truncated to not overflow this buffer. The string is typically a few hundred bytes long. -.. versionadded:: 9Oct2020 - \endverbatim * * \param buffer string buffer to copy the information to @@ -5548,6 +5548,8 @@ int lammps_config_accelerator(const char *package, * \verbatim embed:rst +.. versionadded:: 14May2021 + The :cpp:func:`lammps_has_gpu_device` function checks at runtime if an accelerator device is present that can be used with the :doc:`GPU package `. If at least one suitable device is @@ -5557,8 +5559,6 @@ More detailed information about the available device or devices can be obtained by calling the :cpp:func:`lammps_get_gpu_device_info` function. -.. versionadded:: 14May2021 - \endverbatim * * \return 1 if viable device is available, 0 if not. */ @@ -5572,6 +5572,8 @@ int lammps_has_gpu_device() * \verbatim embed:rst +.. versionadded:: 14May2021 + The :cpp:func:`lammps_get_gpu_device_info` function can be used to retrieve detailed information about any accelerator devices that are viable for use with the :doc:`GPU package `. It will produce a string that is @@ -5583,8 +5585,6 @@ A suitable buffer for a C-style string has to be provided and its length. The assembled text will be truncated to not overflow this buffer. This string can be several kilobytes long, if multiple devices are present. -.. versionadded:: 14May2021 - \endverbatim * * \param buffer string buffer to copy the information to @@ -5681,12 +5681,13 @@ int lammps_style_name(void *handle, const char *category, int idx, /** Check if a specific ID exists in the current LAMMPS instance * \verbatim embed:rst + +.. versionadded:: 9Oct2020 + This function checks if the current LAMMPS instance a *category* ID of the given *name* exists. Valid categories are: *compute*\ , *dump*\ , *fix*\ , *group*\ , *molecule*\ , *region*\ , and *variable*\ . -.. versionadded:: 9Oct2020 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. @@ -5720,13 +5721,14 @@ int lammps_has_id(void *handle, const char *category, const char *name) { /** Count the number of IDs of a category. * \verbatim embed:rst + +.. versionadded:: 9Oct2020 + This function counts how many IDs in the provided *category* are defined in the current LAMMPS instance. Please see :cpp:func:`lammps_has_id` for a list of valid categories. -.. versionadded:: 9Oct2020 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. @@ -5758,6 +5760,9 @@ int lammps_id_count(void *handle, const char *category) { /** Look up the name of an ID by index in the list of IDs of a given category. * \verbatim embed:rst + +.. versionadded:: 9Oct2020 + This function copies the name of the *category* ID with the index *idx* into the provided C-style string buffer. The length of the buffer must be provided as *buf_size* argument. If the name of the style @@ -5765,8 +5770,6 @@ exceeds the length of the buffer, it will be truncated accordingly. If the index is out of range, the function returns 0 and *buffer* is set to an empty string, otherwise 1. -.. versionadded:: 9Oct2020 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. @@ -5829,10 +5832,11 @@ int lammps_id_name(void *handle, const char *category, int idx, char *buffer, in /** Count the number of loaded plugins * \verbatim embed:rst -This function counts how many plugins are currently loaded. .. versionadded:: 10Mar2021 +This function counts how many plugins are currently loaded. + \endverbatim * * \return number of loaded plugins @@ -5851,6 +5855,9 @@ int lammps_plugin_count() /** Look up the info of a loaded plugin by its index in the list of plugins * \verbatim embed:rst + +.. versionadded:: 10Mar2021 + This function copies the name of the *style* plugin with the index *idx* into the provided C-style string buffer. The length of the buffer must be provided as *buf_size* argument. If the name of the style @@ -5858,8 +5865,6 @@ exceeds the length of the buffer, it will be truncated accordingly. If the index is out of range, the function returns 0 and *buffer* is set to an empty string, otherwise 1. -.. versionadded:: 10Mar2021 - \endverbatim * * \param idx index of the plugin in the list all or *style* plugins @@ -6018,9 +6023,11 @@ void lammps_set_fix_external_callback(void *handle, const char *id, FixExternalF \verbatim embed:rst -Fix :doc:`external ` allows programs that are running LAMMPS through -its library interface to add or modify certain LAMMPS properties on specific -timesteps, similar to the way other fixes do. +.. versionadded:: 28Jul2021 + +Fix :doc:`external ` allows programs that are running +LAMMPS through its library interface to add or modify certain LAMMPS +properties on specific timesteps, similar to the way other fixes do. This function provides access to the per-atom force storage in a fix external instance with the given fix-ID to be added to the individual @@ -6033,12 +6040,12 @@ data structures can change as well as the order of atom as they migrate between MPI processes because of the domain decomposition parallelization, this function should be always called immediately before the forces are going to be set to get an up-to-date pointer. -You can use, for example, :cpp:func:`lammps_extract_setting` to obtain the -number of local atoms `nlocal` and then assume the dimensions of the returned -force array as ``double force[nlocal][3]``. +You can use, for example, :cpp:func:`lammps_extract_setting` to obtain +the number of local atoms `nlocal` and then assume the dimensions of +the returned force array as ``double force[nlocal][3]``. -This is an alternative to the callback mechanism in fix external set up by -:cpp:func:`lammps_set_fix_external_callback`. The main difference is +This is an alternative to the callback mechanism in fix external set up +by :cpp:func:`lammps_set_fix_external_callback`. The main difference is that this mechanism can be used when forces are be pre-computed and the control alternates between LAMMPS and the external code, while the callback mechanism can call the external code to compute the force when @@ -6048,8 +6055,6 @@ Please see the documentation for :doc:`fix external ` for more information about how to use the fix and how to couple it with an external code. -.. versionadded:: 28Jul2021 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. @@ -6080,6 +6085,8 @@ double **lammps_fix_external_get_force(void *handle, const char *id) \verbatim embed:rst +.. versionadded:: 28Jul2021 + This is a companion function to :cpp:func:`lammps_set_fix_external_callback` and :cpp:func:`lammps_fix_external_get_force` to also set the contribution to the global energy from the external code. The value of the *eng* @@ -6096,8 +6103,6 @@ Please see the documentation for :doc:`fix external ` for more information about how to use the fix and how to couple it with an external code. -.. versionadded:: 28Jul2021 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. @@ -6126,6 +6131,8 @@ void lammps_fix_external_set_energy_global(void *handle, const char *id, double \verbatim embed:rst +.. versionadded:: 28Jul2021 + This is a companion function to :cpp:func:`lammps_set_fix_external_callback` and :cpp:func:`lammps_fix_external_get_force` to set the contribution to the global virial from the external code. @@ -6144,8 +6151,6 @@ Please see the documentation for :doc:`fix external ` for more information about how to use the fix and how to couple it with an external code. -.. versionadded:: 28Jul2021 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. @@ -6174,6 +6179,8 @@ void lammps_fix_external_set_virial_global(void *handle, const char *id, double \verbatim embed:rst +.. versionadded:: 28Jul2021 + This is a companion function to :cpp:func:`lammps_set_fix_external_callback` to set the per-atom energy contribution due to the fix from the external code as part of the callback function. For this to work, the handle to the @@ -6192,8 +6199,6 @@ Please see the documentation for :doc:`fix external ` for more information about how to use the fix and how to couple it with an external code. -.. versionadded:: 28Jul2021 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. @@ -6222,6 +6227,8 @@ void lammps_fix_external_set_energy_peratom(void *handle, const char *id, double \verbatim embed:rst +.. versionadded:: 28Jul2021 + This is a companion function to :cpp:func:`lammps_set_fix_external_callback` to set the per-atom virial contribution due to the fix from the external code as part of the callback function. For this to work, the handle to the @@ -6243,8 +6250,6 @@ Please see the documentation for :doc:`fix external ` for more information about how to use the fix and how to couple it with an external code. -.. versionadded:: 28Jul2021 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. @@ -6273,6 +6278,8 @@ void lammps_fix_external_set_virial_peratom(void *handle, const char *id, double \verbatim embed:rst +.. versionadded:: 28Jul2021 + This is a companion function to :cpp:func:`lammps_set_fix_external_callback` and :cpp:func:`lammps_fix_external_get_force` to set the length of a global vector of properties that will be stored with the fix via @@ -6287,8 +6294,6 @@ Please see the documentation for :doc:`fix external ` for more information about how to use the fix and how to couple it with an external code. -.. versionadded:: 28Jul2021 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. @@ -6317,6 +6322,8 @@ void lammps_fix_external_set_vector_length(void *handle, const char *id, int len \verbatim embed:rst +.. versionadded:: 28Jul2021 + This is a companion function to :cpp:func:`lammps_set_fix_external_callback` and :cpp:func:`lammps_fix_external_get_force` to set the values of a global vector of properties that will be stored with the fix. And can be accessed from @@ -6340,8 +6347,6 @@ Please see the documentation for :doc:`fix external ` for more information about how to use the fix and how to couple it with an external code. -.. versionadded:: 28Jul2021 - \endverbatim * * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. @@ -6513,12 +6518,13 @@ int lammps_get_last_error_message(void *handle, char *buffer, int buf_size) { /** Return API version of embedded Python interpreter \verbatim embed:rst + +.. versionadded:: 3Nov2022 + This function is used by the ML-IAP python code (mliappy) to verify the API version of the embedded python interpreter of the PYTHON package. It returns -1 if the PYTHON package is not enabled. -.. versionadded:: 3Nov2022 - \endverbatim * * \return PYTHON_API_VERSION constant of the python interpreter or -1 */ From 81854cd03e1903e6fc545f1e27028e65d1864385 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2023 14:55:45 -0400 Subject: [PATCH 169/172] change type keyword to return a pointer to static location for better portability --- python/lammps/core.py | 7 +++---- src/library.cpp | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/python/lammps/core.py b/python/lammps/core.py index b15ddf9302..d34d5de4d4 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -775,11 +775,10 @@ class lammps(object): ptr = self.lib.lammps_last_thermo(self.lmp, c_char_p("keyword".encode()), i) kw = cast(ptr, c_char_p).value.decode() - # temporarily switch return type since this stores an int in a pointer - self.lib.lammps_last_thermo.restype = c_int with ExceptionCheck(self): - typ = self.lib.lammps_last_thermo(self.lmp, c_char_p("type".encode()), i) - self.lib.lammps_last_thermo.restype = c_void_p + ptr = self.lib.lammps_last_thermo(self.lmp, c_char_p("type".encode()), i) + typ = cast(ptr, POINTER(c_int)).contents.value + with ExceptionCheck(self): ptr = self.lib.lammps_last_thermo(self.lmp, c_char_p("data".encode()), i) diff --git a/src/library.cpp b/src/library.cpp index 24a8afa7c7..0fcedfc20b 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -765,6 +765,13 @@ of the last thermo output data and the corresponding keyword strings. The how to handle the return value depends on the value of the *what* argument string. +.. note:: + + The *type* property points to a static location that is reassigned + with every call, so the returned pointer should be recast, + dereferenced, and assigned immediately. Otherwise, its value may be + changed with the next invocation of the function. + .. list-table:: :header-rows: 1 :widths: auto @@ -787,7 +794,7 @@ argument string. - yes * - type - data type of thermo output column; see :cpp:enum:`_LMP_DATATYPE_CONST` - - const int (**not** a pointer) + - pointer to static int - yes * - data - actual field data for column @@ -808,6 +815,7 @@ void *lammps_last_thermo(void *handle, const char *what, int index) Thermo *th = lmp->output->thermo; if (!th) return nullptr; const int nfield = *th->get_nfield(); + static int datatype; BEGIN_CAPTURE { @@ -826,11 +834,14 @@ void *lammps_last_thermo(void *handle, const char *what, int index) if ((index < 0) || (index >= nfield)) return nullptr; const auto &field = th->get_fields()[index]; if (field.type == multitype::INT) { - val = (void *) LAMMPS_INT; + datatype = LAMMPS_INT; + val = (void *) &datatype; } else if (field.type == multitype::BIGINT) { - val = (void *) LAMMPS_INT64; + datatype = LAMMPS_INT64; + val = (void *) &datatype; } else if (field.type == multitype::DOUBLE) { - val = (void *) LAMMPS_DOUBLE; + datatype = LAMMPS_DOUBLE; + val = (void *) &datatype; } } else if (strcmp(what, "data") == 0) { From 5d4f9abf5b6604414e8f82537e49b21fbbfb65bc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2023 15:15:28 -0400 Subject: [PATCH 170/172] add unit tests for c-library interface and plain python module --- .../c-library/test_library_properties.cpp | 61 ++++++++++++++++++- unittest/python/python-commands.py | 27 ++++++++ 2 files changed, 86 insertions(+), 2 deletions(-) diff --git a/unittest/c-library/test_library_properties.cpp b/unittest/c-library/test_library_properties.cpp index d6dd55f75e..14eab06213 100644 --- a/unittest/c-library/test_library_properties.cpp +++ b/unittest/c-library/test_library_properties.cpp @@ -14,6 +14,7 @@ #define STRINGIFY(val) XSTR(val) #define XSTR(val) #val +using ::LAMMPS_NS::bigint; using ::LAMMPS_NS::tagint; using ::LAMMPS_NS::platform::path_join; using ::testing::HasSubstr; @@ -93,6 +94,9 @@ TEST_F(LibraryProperties, natoms) TEST_F(LibraryProperties, thermo) { + bigint bval = *(bigint *)lammps_last_thermo(lmp, "step", 0); + EXPECT_EQ(bval, -1); + if (!lammps_has_style(lmp, "atom", "full")) GTEST_SKIP(); std::string input = path_join(INPUT_DIR, "in.fourmol"); ::testing::internal::CaptureStdout(); @@ -105,6 +109,59 @@ TEST_F(LibraryProperties, thermo) EXPECT_DOUBLE_EQ(lammps_get_thermo(lmp, "vol"), 3375.0); EXPECT_DOUBLE_EQ(lammps_get_thermo(lmp, "density"), 0.12211250945013695); EXPECT_DOUBLE_EQ(lammps_get_thermo(lmp, "cellalpha"), 90.0); + + bval = *(bigint *)lammps_last_thermo(lmp, "step", 0); + EXPECT_EQ(bval, 2); + int ival = *(int *)lammps_last_thermo(lmp, "num", 0); + EXPECT_EQ(ival, 6); + + const char *key = (const char *)lammps_last_thermo(lmp, "keyword", 0); + EXPECT_THAT(key, StrEq("Step")); + ival = *(int *)lammps_last_thermo(lmp, "type", 0); +#if defined(LAMMPS_SMALLSMALL) + EXPECT_EQ(ival, LAMMPS_INT); + ival = *(int *)lammps_last_thermo(lmp, "data", 0); + EXPECT_EQ(ival, 2); +#else + EXPECT_EQ(ival, LAMMPS_INT64); + bval = *(bigint *)lammps_last_thermo(lmp, "data", 0); + EXPECT_EQ(bval, 2); +#endif + + key = (const char *)lammps_last_thermo(lmp, "keyword", 1); + EXPECT_THAT(key, StrEq("Temp")); + ival = *(int *)lammps_last_thermo(lmp, "type", 1); + EXPECT_EQ(ival, LAMMPS_DOUBLE); + double dval = *(double *)lammps_last_thermo(lmp, "data", 1); + EXPECT_DOUBLE_EQ(dval, 28.042780385852982); + + key = (const char *)lammps_last_thermo(lmp, "keyword", 2); + EXPECT_THAT(key, StrEq("E_pair")); + ival = *(int *)lammps_last_thermo(lmp, "type", 2); + EXPECT_EQ(ival, LAMMPS_DOUBLE); + dval = *(double *)lammps_last_thermo(lmp, "data", 2); + EXPECT_DOUBLE_EQ(dval, 0.0); + + key = (const char *)lammps_last_thermo(lmp, "keyword", 3); + EXPECT_THAT(key, StrEq("E_mol")); + ival = *(int *)lammps_last_thermo(lmp, "type", 3); + EXPECT_EQ(ival, LAMMPS_DOUBLE); + dval = *(double *)lammps_last_thermo(lmp, "data", 3); + EXPECT_DOUBLE_EQ(dval, 0.0); + + key = (const char *)lammps_last_thermo(lmp, "keyword", 4); + EXPECT_THAT(key, StrEq("TotEng")); + ival = *(int *)lammps_last_thermo(lmp, "type", 4); + EXPECT_EQ(ival, LAMMPS_DOUBLE); + dval = *(double *)lammps_last_thermo(lmp, "data", 4); + EXPECT_DOUBLE_EQ(dval, 2.3405256449146163); + + key = (const char *)lammps_last_thermo(lmp, "keyword", 5); + EXPECT_THAT(key, StrEq("Press")); + ival = *(int *)lammps_last_thermo(lmp, "type", 5); + EXPECT_EQ(ival, LAMMPS_DOUBLE); + dval = *(double *)lammps_last_thermo(lmp, "data", 5); + EXPECT_DOUBLE_EQ(dval, 31.700964689115658); }; TEST_F(LibraryProperties, box) @@ -325,8 +382,8 @@ TEST_F(LibraryProperties, global) EXPECT_EQ(lammps_extract_global_datatype(lmp, "special_lj"), LAMMPS_DOUBLE); EXPECT_EQ(lammps_extract_global_datatype(lmp, "special_coul"), LAMMPS_DOUBLE); - double *special_lj = (double *)lammps_extract_global(lmp, "special_lj"); - double *special_coul= (double *)lammps_extract_global(lmp, "special_coul"); + double *special_lj = (double *)lammps_extract_global(lmp, "special_lj"); + double *special_coul = (double *)lammps_extract_global(lmp, "special_coul"); EXPECT_DOUBLE_EQ(special_lj[0], 1.0); EXPECT_DOUBLE_EQ(special_lj[1], 0.0); EXPECT_DOUBLE_EQ(special_lj[2], 0.5); diff --git a/unittest/python/python-commands.py b/unittest/python/python-commands.py index 33b19ba4f0..1c25751191 100644 --- a/unittest/python/python-commands.py +++ b/unittest/python/python-commands.py @@ -533,6 +533,33 @@ create_atoms 1 single & result = self.lmp.get_thermo(key) self.assertEqual(value, result, key) + + def test_last_thermo(self): + self.lmp.command("units lj") + self.lmp.command("atom_style atomic") + self.lmp.command("atom_modify map array") + self.lmp.command("boundary f f f") + self.lmp.command("region box block 0 2 0 2 0 2") + self.lmp.command("create_box 1 box") + self.lmp.command("mass * 1") + + x = [ + 0.5, 0.5, 0.5, + 1.5, 1.5, 1.5 + ] + types = [1, 1] + self.lmp.create_atoms(2, id=None, type=types, x=x) + + self.assertEqual(self.lmp.last_thermo(), None) + self.lmp.command("run 2 post no") + ref = { "Step" : 2, + "Temp" : 0.0, + "E_pair" : 0.0, + "E_mol" : 0.0, + "TotEng" : 0.0, + "Press" : 0.0} + self.assertDictEqual(self.lmp.last_thermo(), ref) + def test_extract_global(self): self.lmp.command("region box block -1 1 -2 2 -3 3") self.lmp.command("create_box 1 box") From ce38bb988d67f1b82f9093bf1d1563198795cda8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2023 19:12:59 -0400 Subject: [PATCH 171/172] add lammps_last_thermo support to swig, plugin and fortran interface --- examples/COUPLE/plugin/liblammpsplugin.c | 1 + examples/COUPLE/plugin/liblammpsplugin.h | 1 + fortran/lammps.f90 | 80 +++++++++++++++++++++++- tools/swig/lammps.i | 2 + 4 files changed, 83 insertions(+), 1 deletion(-) diff --git a/examples/COUPLE/plugin/liblammpsplugin.c b/examples/COUPLE/plugin/liblammpsplugin.c index d446f9cd2f..0cf9bea512 100644 --- a/examples/COUPLE/plugin/liblammpsplugin.c +++ b/examples/COUPLE/plugin/liblammpsplugin.c @@ -90,6 +90,7 @@ liblammpsplugin_t *liblammpsplugin_load(const char *lib) ADDSYM(get_natoms); ADDSYM(get_thermo); + ADDSYM(last_thermo); ADDSYM(extract_box); ADDSYM(reset_box); diff --git a/examples/COUPLE/plugin/liblammpsplugin.h b/examples/COUPLE/plugin/liblammpsplugin.h index c6ec03e498..40fba6b9e3 100644 --- a/examples/COUPLE/plugin/liblammpsplugin.h +++ b/examples/COUPLE/plugin/liblammpsplugin.h @@ -133,6 +133,7 @@ struct _liblammpsplugin { double (*get_natoms)(void *); double (*get_thermo)(void *, const char *); + void *(*last_thermo)(void *, const char *, int); void (*extract_box)(void *, double *, double *, double *, double *, double *, int *, int *); diff --git a/fortran/lammps.f90 b/fortran/lammps.f90 index cb7adfd34b..f511e6bb60 100644 --- a/fortran/lammps.f90 +++ b/fortran/lammps.f90 @@ -87,10 +87,15 @@ MODULE LIBLAMMPS INTEGER(c_int) :: scalar, vector, array END TYPE lammps_type + TYPE lammps_dtype + INTEGER(c_int) :: i32, i64, r64, str + END TYPE lammps_dtype + TYPE lammps TYPE(c_ptr) :: handle = c_null_ptr TYPE(lammps_style) :: style TYPE(lammps_type) :: type + TYPE(lammps_dtype) :: dtype CONTAINS PROCEDURE :: close => lmp_close PROCEDURE :: error => lmp_error @@ -100,6 +105,7 @@ MODULE LIBLAMMPS PROCEDURE :: commands_string => lmp_commands_string PROCEDURE :: get_natoms => lmp_get_natoms PROCEDURE :: get_thermo => lmp_get_thermo + PROCEDURE :: last_thermo => lmp_last_thermo PROCEDURE :: extract_box => lmp_extract_box PROCEDURE :: reset_box => lmp_reset_box PROCEDURE :: memory_usage => lmp_memory_usage @@ -243,7 +249,7 @@ MODULE LIBLAMMPS END TYPE lammps_data_baseclass ! Derived type for receiving LAMMPS data (in lieu of the ability to type cast - ! pointers). Used for extract_compute, extract_atom + ! pointers). Used for extract_compute, extract_atom, last_thermo TYPE, EXTENDS(lammps_data_baseclass) :: lammps_data INTEGER(c_int), POINTER :: i32 => NULL() INTEGER(c_int), DIMENSION(:), POINTER :: i32_vec => NULL() @@ -439,6 +445,15 @@ MODULE LIBLAMMPS TYPE(c_ptr), INTENT(IN), VALUE :: name END FUNCTION lammps_get_thermo + FUNCTION lammps_last_thermo(handle,what,index) BIND(C) + IMPORT :: c_ptr, c_int + IMPLICIT NONE + TYPE(c_ptr) :: lammps_last_thermo + TYPE(c_ptr), INTENT(IN), VALUE :: handle + TYPE(c_ptr), INTENT(IN), VALUE :: what + INTEGER(c_int), INTENT(IN), VALUE :: index + END FUNCTION lammps_last_thermo + SUBROUTINE lammps_extract_box(handle,boxlo,boxhi,xy,yz,xz,pflags, & boxflag) BIND(C) IMPORT :: c_ptr, c_double, c_int @@ -995,6 +1010,10 @@ CONTAINS lmp_open%type%scalar = LMP_TYPE_SCALAR lmp_open%type%vector = LMP_TYPE_VECTOR lmp_open%type%array = LMP_TYPE_ARRAY + lmp_open%dtype%i32 = LAMMPS_INT + lmp_open%dtype%i64 = LAMMPS_INT64 + lmp_open%dtype%r64 = LAMMPS_DOUBLE + lmp_open%dtype%str = LAMMPS_STRING ! Assign constants for bigint and tagint for use elsewhere SIZE_TAGINT = lmp_extract_setting(lmp_open, 'tagint') @@ -1103,6 +1122,65 @@ CONTAINS CALL lammps_free(Cname) END FUNCTION lmp_get_thermo + ! equivalent function to lammps_last_thermo + FUNCTION lmp_last_thermo(self,what,index) RESULT(thermo_data) + CLASS(lammps), INTENT(IN), TARGET :: self + CHARACTER(LEN=*), INTENT(IN) :: what + INTEGER(c_int) :: index + TYPE(lammps_data) :: thermo_data, type_data + INTEGER(c_int) :: datatype + TYPE(c_ptr) :: Cname, Cptr + + ! set data type for known cases + SELECT CASE (what) + CASE ('step') + IF (SIZE_BIGINT == 4_c_int) THEN + datatype = LAMMPS_INT + ELSE + datatype = LAMMPS_INT64 + END IF + CASE ('num') + datatype = LAMMPS_INT + CASE ('type') + datatype = LAMMPS_INT + CASE ('keyword') + datatype = LAMMPS_STRING + CASE ('data') + Cname = f2c_string('type') + Cptr = lammps_last_thermo(self%handle,Cname,index-1) + type_data%lammps_instance => self + type_data%datatype = DATA_INT + CALL C_F_POINTER(Cptr, type_data%i32) + datatype = type_data%i32 + CALL lammps_free(Cname) + CASE DEFAULT + datatype = -1 + END SELECT + + Cname = f2c_string(what) + Cptr = lammps_last_thermo(self%handle,Cname,index-1) + CALL lammps_free(Cname) + + thermo_data%lammps_instance => self + SELECT CASE (datatype) + CASE (LAMMPS_INT) + thermo_data%datatype = DATA_INT + CALL C_F_POINTER(Cptr, thermo_data%i32) + CASE (LAMMPS_INT64) + thermo_data%datatype = DATA_INT64 + CALL C_F_POINTER(Cptr, thermo_data%i64) + CASE (LAMMPS_DOUBLE) + thermo_data%datatype = DATA_DOUBLE + CALL C_F_POINTER(Cptr, thermo_data%r64) + CASE (LAMMPS_STRING) + thermo_data%datatype = DATA_STRING + thermo_data%str = c2f_string(Cptr) + CASE DEFAULT + CALL lmp_error(self, LMP_ERROR_ALL + LMP_ERROR_WORLD, & + 'Unknown pointer type in last_thermo') + END SELECT + END FUNCTION lmp_last_thermo + ! equivalent subroutine to lammps_extract_box SUBROUTINE lmp_extract_box(self, boxlo, boxhi, xy, yz, xz, pflags, boxflag) CLASS(lammps), INTENT(IN) :: self diff --git a/tools/swig/lammps.i b/tools/swig/lammps.i index b7414573ba..c4ef0a7109 100644 --- a/tools/swig/lammps.i +++ b/tools/swig/lammps.i @@ -113,6 +113,7 @@ extern void lammps_commands_string(void *handle, const char *str); extern double lammps_get_natoms(void *handle); extern double lammps_get_thermo(void *handle, const char *keyword); +extern void *lammps_last_thermo(void *handle, const char *what, int index); extern void lammps_extract_box(void *handle, double *boxlo, double *boxhi, double *xy, double *yz, double *xz, int *pflags, int *boxflag); @@ -295,6 +296,7 @@ extern void lammps_commands_string(void *handle, const char *str); extern double lammps_get_natoms(void *handle); extern double lammps_get_thermo(void *handle, const char *keyword); +extern void *lammps_last_thermo(void *handle, const char *what, int index); extern void lammps_extract_box(void *handle, double *boxlo, double *boxhi, double *xy, double *yz, double *xz, int *pflags, int *boxflag); From 4cad18a057ea81b92ebb119af520fc517dba3fe2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2023 19:59:47 -0400 Subject: [PATCH 172/172] document Fortran version of lammps_last_thermo --- doc/src/Fortran.rst | 191 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 154 insertions(+), 37 deletions(-) diff --git a/doc/src/Fortran.rst b/doc/src/Fortran.rst index 92a42997b8..a0e4da56b5 100644 --- a/doc/src/Fortran.rst +++ b/doc/src/Fortran.rst @@ -203,40 +203,62 @@ Below is an example demonstrating some of the possible uses. .. code-block:: fortran - PROGRAM testprop - USE LIBLAMMPS - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_double, c_int64_t - USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : OUTPUT_UNIT - TYPE(lammps) :: lmp - INTEGER(KIND=c_int64_t), POINTER :: natoms - REAL(KIND=c_double), POINTER :: dt - INTEGER(KIND=c_int64_t), POINTER :: ntimestep - REAL(KIND=c_double) :: pe, ke + PROGRAM testprop + USE LIBLAMMPS + USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_double, c_int64_t, c_int + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : OUTPUT_UNIT + TYPE(lammps) :: lmp + INTEGER(KIND=c_int64_t), POINTER :: natoms, ntimestep, bval + REAL(KIND=c_double), POINTER :: dt, dval + INTEGER(KIND=c_int), POINTER :: nfield, typ, ival + INTEGER(KIND=c_int) :: i + CHARACTER(LEN=11) :: key + REAL(KIND=c_double) :: pe, ke - lmp = lammps() - CALL lmp%file('in.sysinit') - natoms = lmp%extract_global('natoms') - WRITE(OUTPUT_UNIT,'(A,I0,A)') 'Running a simulation with ', natoms, ' atoms' - WRITE(OUTPUT_UNIT,'(I0,A,I0,A,I0,A)') lmp%extract_setting('nlocal'), & - ' local and ', lmp%extract_setting('nghost'), ' ghost atoms. ', & - lmp%extract_setting('ntypes'), ' atom types' + lmp = lammps() + CALL lmp%file('in.sysinit') + natoms = lmp%extract_global('natoms') + WRITE(OUTPUT_UNIT,'(A,I0,A)') 'Running a simulation with ', natoms, ' atoms' + WRITE(OUTPUT_UNIT,'(I0,A,I0,A,I0,A)') lmp%extract_setting('nlocal'), & + ' local and ', lmp%extract_setting('nghost'), ' ghost atoms. ', & + lmp%extract_setting('ntypes'), ' atom types' - CALL lmp%command('run 2 post no') - dt = lmp%extract_global('dt') - ntimestep = lmp%extract_global('ntimestep') - WRITE(OUTPUT_UNIT,'(A,I0,A,F4.1,A)') 'At step: ', ntimestep, & - ' Changing timestep from', dt, ' to 0.5' - dt = 0.5_c_double - CALL lmp%command('run 2 post no') + CALL lmp%command('run 2 post no') - WRITE(OUTPUT_UNIT,'(A,I0)') 'At step: ', ntimestep - pe = lmp%get_thermo('pe') - ke = lmp%get_thermo('ke') - PRINT*, 'PE = ', pe - PRINT*, 'KE = ', ke + ntimestep = lmp%last_thermo('step', 0) + nfield = lmp%last_thermo('num', 0) + WRITE(OUTPUT_UNIT,'(A,I0,A,I0)') 'Last thermo output on step: ', ntimestep, & + ', number of fields: ', nfield + DO i=1, nfield + key = lmp%last_thermo('keyword',i) + typ = lmp%last_thermo('type',i) + IF (typ == lmp%dtype%i32) THEN + ival = lmp%last_thermo('data',i) + WRITE(OUTPUT_UNIT,*) key, ':', ival + ELSE IF (typ == lmp%dtype%i64) THEN + bval = lmp%last_thermo('data',i) + WRITE(OUTPUT_UNIT,*) key, ':', bval + ELSE IF (typ == lmp%dtype%r64) THEN + dval = lmp%last_thermo('data',i) + WRITE(OUTPUT_UNIT,*) key, ':', dval + END IF + END DO - CALL lmp%close(.TRUE.) - END PROGRAM testprop + dt = lmp%extract_global('dt') + ntimestep = lmp%extract_global('ntimestep') + WRITE(OUTPUT_UNIT,'(A,I0,A,F4.1,A)') 'At step: ', ntimestep, & + ' Changing timestep from', dt, ' to 0.5' + dt = 0.5_c_double + CALL lmp%command('run 2 post no') + + WRITE(OUTPUT_UNIT,'(A,I0)') 'At step: ', ntimestep + pe = lmp%get_thermo('pe') + ke = lmp%get_thermo('ke') + WRITE(OUTPUT_UNIT,*) 'PE = ', pe + WRITE(OUTPUT_UNIT,*) 'KE = ', ke + + CALL lmp%close(.TRUE.) + END PROGRAM testprop --------------- @@ -262,6 +284,8 @@ of the contents of the :f:mod:`LIBLAMMPS` Fortran interface to LAMMPS. :ftype style: type(lammps_style) :f type: derived type to access lammps type constants :ftype type: type(lammps_type) + :f dtype: derived type to access lammps data type constants + :ftype dtype: type(lammps_dtype) :f close: :f:subr:`close` :ftype close: subroutine :f subroutine error: :f:subr:`error` @@ -278,6 +302,8 @@ of the contents of the :f:mod:`LIBLAMMPS` Fortran interface to LAMMPS. :ftype get_natoms: function :f get_thermo: :f:func:`get_thermo` :ftype get_thermo: function + :f last_thermo: :f:func:`last_thermo` + :ftype last_thermo: function :f extract_box: :f:subr:`extract_box` :ftype extract_box: subroutine :f reset_box: :f:subr:`reset_box` @@ -587,6 +613,96 @@ Procedures Bound to the :f:type:`lammps` Derived Type -------- +.. f:function:: last_thermo(what, index) + + This function will call :cpp:func:`lammps_last_thermo` and returns + either a string or a pointer to a cached copy of LAMMPS last thermodynamic + output, depending on the data requested through *what*. Note that *index* + uses 1-based indexing to access thermo output columns. + + .. versionadded:: TBD + + Note that this function actually does not return a value, but rather + associates the pointer on the left side of the assignment to point to + internal LAMMPS data (with the exception of string data, which are + copied and returned as ordinary Fortran strings). Pointers must be + of the correct data type to point to said data (typically + ``INTEGER(c_int)``, ``INTEGER(c_int64_t)``, or ``REAL(c_double)``). + The pointer being associated with LAMMPS data is type-checked at + run-time via an overloaded assignment operator. The pointers + returned by this function point to temporary, read-only data that may + be overwritten at any time, so their target values need to be copied + to local storage if they are supposed to persist. + + For example, + + .. code-block:: fortran + + PROGRAM thermo + USE LIBLAMMPS + USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_double, c_int64_t, c_int + TYPE(lammps) :: lmp + INTEGER(KIND=c_int64_t), POINTER :: ntimestep, bval + REAL(KIND=c_double), POINTER :: dval + INTEGER(KIND=c_int), POINTER :: nfield, typ, ival + INTEGER(KIND=c_int) :: i + CHARACTER(LEN=11) :: key + + lmp = lammps() + CALL lmp%file('in.sysinit') + + ntimestep = lmp%last_thermo('step', 0) + nfield = lmp%last_thermo('num', 0) + PRINT*, 'Last thermo output on step: ', ntimestep, ' Number of fields: ', nfield + DO i=1, nfield + key = lmp%last_thermo('keyword',i) + typ = lmp%last_thermo('type',i) + IF (typ == lmp%dtype%i32) THEN + ival = lmp%last_thermo('data',i) + PRINT*, key, ':', ival + ELSE IF (typ == lmp%dtype%i64) THEN + bval = lmp%last_thermo('data',i) + PRINT*, key, ':', bval + ELSE IF (typ == lmp%dtype%r64) THEN + dval = lmp%last_thermo('data',i) + PRINT*, key, ':', dval + END IF + END DO + CALL lmp%close(.TRUE.) + END PROGRAM thermo + + would extract the last timestep where thermo output was done and the number + of columns it printed. Then it loops over the columns to print out column + header keywords and the corresponding data. + + .. note:: + + If :f:func:`last_thermo` returns a string, the string must have a length + greater than or equal to the length of the string (not including the + terminal ``NULL`` character) that LAMMPS returns. If the variable's + length is too short, the string will be truncated. As usual in Fortran, + strings are padded with spaces at the end. If you use an allocatable + string, the string **must be allocated** prior to calling this function. + + :p character(len=\*) what: string with the name of the thermo keyword + :p integer(c_int) index: 1-based column index + :to: :cpp:func:`lammps_last_thermo` + :r pointer [polymorphic]: pointer to LAMMPS data. The left-hand side of the + assignment should be either a string (if expecting string data) or a + C-compatible pointer (e.g., ``INTEGER(c_int), POINTER :: nlocal``) to the + extracted property. + + .. warning:: + + Modifying the data in the location pointed to by the returned pointer + may lead to inconsistent internal data and thus may cause failures, + crashes, or bogus simulations. In general, it is much better + to use a LAMMPS input command that sets or changes these parameters. + Using an input command will take care of all side effects and necessary + updates of settings derived from such settings. + +-------- + .. f:subroutine:: extract_box([boxlo][, boxhi][, xy][, yz][, xz][, pflags][, boxflag]) This subroutine will call :cpp:func:`lammps_extract_box`. All @@ -764,13 +880,14 @@ Procedures Bound to the :f:type:`lammps` Derived Type .. note:: - If :f:func:`extract_global` returns a string, the string must have length - greater than or equal to the length of the string (not including the - terminal ``NULL`` character) that LAMMPS returns. If the variable's - length is too short, the string will be truncated. As usual in Fortran, - strings are padded with spaces at the end. If you use an allocatable - string, the string **must be allocated** prior to calling this function, - but you can automatically reallocate it to the correct length after the + If :f:func:`extract_global` returns a string, the string must have + a length greater than or equal to the length of the string (not + including the terminal ``NULL`` character) that LAMMPS returns. If + the variable's length is too short, the string will be + truncated. As usual in Fortran, strings are padded with spaces at + the end. If you use an allocatable string, the string **must be + allocated** prior to calling this function, but you can + automatically reallocate it to the correct length after the function returns, viz., .. code-block :: fortran