From 41d7038c1edb27ffedad2ea9fca482fb2420a130 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 27 May 2021 17:24:29 -0600 Subject: [PATCH 001/130] trial versions of new mdi_engine and fix_mdi_engine --- src/USER-MDI/fix_mdi_engine2.cpp | 80 ++ src/USER-MDI/fix_mdi_engine2.h | 81 ++ src/USER-MDI/library_mdi.cpp | 4 + src/USER-MDI/mdi_engine2.cpp | 1216 ++++++++++++++++++++++++++++++ src/USER-MDI/mdi_engine2.h | 98 +++ 5 files changed, 1479 insertions(+) create mode 100644 src/USER-MDI/fix_mdi_engine2.cpp create mode 100644 src/USER-MDI/fix_mdi_engine2.h create mode 100644 src/USER-MDI/mdi_engine2.cpp create mode 100644 src/USER-MDI/mdi_engine2.h diff --git a/src/USER-MDI/fix_mdi_engine2.cpp b/src/USER-MDI/fix_mdi_engine2.cpp new file mode 100644 index 0000000000..6d390af16b --- /dev/null +++ b/src/USER-MDI/fix_mdi_engine2.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: Taylor Barnes (MolSSI) + MolSSI Driver Interface (MDI) support for LAMMPS +------------------------------------------------------------------------- */ + +#include "error.h" +#include "fix_mdi_engine2.h" +#include "mdi_engine2.h" + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixMDIEngine2::FixMDIEngine2(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + if (narg != 3) error->all(FLERR, "Illegal fix mdi/engine command"); +} + +/* ---------------------------------------------------------------------- */ + +int FixMDIEngine2::setmask() +{ + int mask = 0; + mask |= POST_INTEGRATE; + mask |= POST_FORCE; + mask |= MIN_PRE_FORCE; + mask |= MIN_POST_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine2::min_setup(int vflag) +{ + mdi_engine->engine_node("@FORCES"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine2::post_integrate() +{ + mdi_engine->engine_node("@COORDS"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine2::min_pre_force(int vflag) +{ + mdi_engine->engine_node("@COORDS"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine2::min_post_force(int vflag) +{ + mdi_engine->engine_node("@FORCES"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine2::post_force(int vflag) +{ + mdi_engine->engine_node("@FORCES"); +} + diff --git a/src/USER-MDI/fix_mdi_engine2.h b/src/USER-MDI/fix_mdi_engine2.h new file mode 100644 index 0000000000..43c39f382b --- /dev/null +++ b/src/USER-MDI/fix_mdi_engine2.h @@ -0,0 +1,81 @@ +/* -*- 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 FIX_CLASS +// clang-format off +FixStyle(mdi/engine2, FixMDIEngine2); +// clang-format on +#else + +#ifndef LMP_FIX_MDI_ENGINE2_H +#define LMP_FIX_MDI_ENGINE2_H + +#include "fix.h" + +namespace LAMMPS_NS { + +class FixMDIEngine2 : public Fix { + public: + class MDIEngine2 *mdi_engine; + + FixMDIEngine2(class LAMMPS *, int, char **); + ~FixMDIEngine2() {} + int setmask(); + void init() {} + + void min_setup(int); + void post_integrate(); + void post_force(int); + void min_pre_force(int); + void min_post_force(int); +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. + +E: Potential energy ID for fix mdi does not exist + +Self-explanatory. + +E: Cannot use MDI command without atom IDs + +Self-explanatory. + +E: MDI command requires consecutive atom IDs + +Self-explanatory. + +E: Unable to connect to driver + +Self-explanatory. + +E: Unable to ... driver + +Self-explanatory. + +E: Unknown command from driver + +The driver sent a command that is not supported by the LAMMPS +interface. In some cases this might be because a nonsensical +command was sent (i.e. "SCF"). In other cases, the LAMMPS +interface might benefit from being expanded. + +*/ diff --git a/src/USER-MDI/library_mdi.cpp b/src/USER-MDI/library_mdi.cpp index 0e6bd05ead..53afb6cf5a 100644 --- a/src/USER-MDI/library_mdi.cpp +++ b/src/USER-MDI/library_mdi.cpp @@ -106,8 +106,12 @@ The function executes a single command from an external MDI driver. * \param comm MDI communicator that can be used to communicated with the driver. * \param class_obj pointer to an instance of an mdi/engine fix cast to ``void *``. * \return 0 on no error, 1 on error. */ + int lammps_execute_mdi_command(const char *command, MDI_Comm comm, void *class_obj) { FixMDIEngine *mdi_fix = (FixMDIEngine *) class_obj; return mdi_fix->execute_command(command, comm); + + // MDIEngine2 *mdi_engine = (MDIEngine2 *) class_obj; + // return mdi_engine->execute_command(command, comm); } diff --git a/src/USER-MDI/mdi_engine2.cpp b/src/USER-MDI/mdi_engine2.cpp new file mode 100644 index 0000000000..b4c74e0bbb --- /dev/null +++ b/src/USER-MDI/mdi_engine2.cpp @@ -0,0 +1,1216 @@ +/* ---------------------------------------------------------------------- + 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: Taylor Barnes (MolSSI) + MolSSI Driver Interface (MDI) support for LAMMPS +------------------------------------------------------------------------- */ + +#include "mdi_engine2.h" +#include "library_mdi.h" + +#include +#include +#include "atom.h" +#include "comm.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "fix_mdi_engine2.h" +#include "force.h" +#include "group.h" +#include "irregular.h" +#include "library.h" +#include "mdi.h" +#include "memory.h" +#include "min.h" +#include "minimize.h" +#include "modify.h" +#include "output.h" +#include "timer.h" +#include "update.h" +#include "verlet.h" + +using namespace LAMMPS_NS; + +enum {NONE, REAL, METAL}; // LAMMPS units which MDI supports +enum {DEFAULT, MD, OPT}; // MDI engine mode + +/* ---------------------------------------------------------------------- + trigger LAMMPS to start acting as an MDI engine + either as a standalone code or as a plugin + MDI_Init() for standalone code is in main.cpp + MDI_Init() for plugin is in library_mdi.cpp::MDI_Plugin_init_lammps() + endlessly loop over receiving commands from driver and responding + when EXIT command is received, mdi/engine command exits +---------------------------------------------------------------------- */ + +void MDIEngine2::command(int narg, char **arg) +{ + // args to choose what nodes LAMMPS will act with + // also whether a fix mdi/engine is needed + // NOTE: add args + + if (narg > 0) error->all(FLERR, "Illegal mdi/engine command"); + + // check that LAMMPS defines what an MDI engine needs + + if (atom->tag_enable == 0) error->all(FLERR, "Cannot use mdi/engine without atom IDs"); + + if (atom->tag_consecutive() == 0) error->all(FLERR, "mdi/engine requires consecutive atom IDs"); + + // must use real or metal units with MDI (atomic scale) + // real: coords = Ang, eng = Kcal/mole, force = Kcal/mole/Ang + // metal: coords = Ang, eng = eV, force = eV/Ang + + lmpunits = NONE; + if (strcmp(update->unit_style, "real") == 0) lmpunits = REAL; + if (strcmp(update->unit_style, "metal") == 0) lmpunits = METAL; + if (lmpunits == NONE) error->all(FLERR, "MDI requires real or metal units"); + + // confirm LAMMPS is being run as an engine + + int role; + MDI_Get_role(&role); + if (role != MDI_ENGINE) + error->all(FLERR, + "Must invoke LAMMPS as an MDI engine to use mdi/engine command"); + + // if the mdi/engine fix is not already present, add it now + // NOTE: make this optional above + + //int ifix = modify->find_fix_by_style("mdi/engine"); + //bool added_mdi_engine_fix = false; + //if (ifix < 0) { + // modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine"); + // added_mdi_engine_fix = true; + // } + + // identify the mdi_engine fix + + //ifix = modify->find_fix_by_style("mdi/engine"); + //mdi_fix = static_cast(modify->fix[ifix]); + //mdi_fix->mdi_engine = this; + + // root = 1 for proc 0, otherwise 0 + + root = (comm->me == 0) ? 1 : 0; + + // MDI setup + + mode = DEFAULT; + exit_flag = false; + local_exit_flag = false; + + cmd = new char[MDI_COMMAND_LENGTH]; + node_driver = new char[MDI_COMMAND_LENGTH]; + node_engine = new char[MDI_COMMAND_LENGTH]; + strncpy(node_driver, "\0", MDI_COMMAND_LENGTH); + strncpy(node_engine, "@DEFAULT", MDI_COMMAND_LENGTH); + + // create computes for KE and PE + + //id_pe = utils::strdup(std::string("MDI_ENGINE") + "_pe"); + //modify->add_compute(fmt::format("{} all pe", id_pe)); + + //id_ke = utils::strdup(std::string("MDI_ENGINE") + "_ke"); + //modify->add_compute(fmt::format("{} all ke", id_ke)); + + // confirm that two required computes are still available + + //int icompute_pe = modify->find_compute(id_pe); + //if (icompute_pe < 0) error->all(FLERR, "Potential energy ID for fix mdi/engine does not exist"); + //int icompute_ke = modify->find_compute(id_ke); + //if (icompute_pe < 0) error->all(FLERR, "Kinetic energy ID for fix mdi/engine does not exist"); + + //pe = modify->compute[icompute_pe]; + //ke = modify->compute[icompute_ke]; + + // irregular class and data structs used by MDI + + irregular = new Irregular(lmp); + add_force = nullptr; + + // define MDI commands that LAMMPS engine recognizes + + mdi_commands(); + + // one-time operation to establish a connection with the driver + + MDI_Accept_communicator(&mdicomm); + if (mdicomm <= 0) error->all(FLERR, "Unable to connect to MDI driver"); + + // endless engine loop, responding to driver commands + + while (1) { + + // mdi/engine command only recognizes three nodes + // DEFAULT, INIT_MD, INIT_OPTG + + engine_node("@DEFAULT"); + + // MDI commands for dynamics or minimization + + if (strcmp(cmd, "@INIT_MD") == 0) { + mdi_md(); + if (strcmp(cmd, "EXIT")) break; + + } else if (strcmp(cmd, "@INIT_OPTG") == 0) { + mdi_optg(); + if (strcmp(cmd, "EXIT")) break; + + } else if (strcmp(cmd, "EXIT") == 0) { + break; + + } else + error->all(FLERR,fmt::format("MDI node exited with invalid command: {}", cmd)); + } + + // clean up + + delete [] cmd; + delete [] node_driver; + delete [] node_engine; + + //modify->delete_compute(id_pe); + //modify->delete_compute(id_ke); + delete irregular; + memory->destroy(add_force); + + // remove mdi/engine fix that mdi/engine instantiated + // NOTE: make this optional + + //if (added_mdi_engine_fix) modify->delete_fix("MDI_ENGINE_INTERNAL"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::engine_node(const char *node) +{ + int ierr; + + // do not process commands if engine and driver are not at same node + + strncpy(node_engine, node, MDI_COMMAND_LENGTH); + if (strcmp(node_driver, "\0") != 0 && strcmp(node_driver, node_engine) != 0) + local_exit_flag = true; + + // respond to commands from the driver + + while (not exit_flag and not local_exit_flag) { + + // read the next command from the driver + // all procs call this, but only proc 0 receives the command + + ierr = MDI_Recv_command(cmd, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to receive command from driver"); + + // broadcast command to the other MPI tasks + + MPI_Bcast(cmd, MDI_COMMAND_LENGTH, MPI_CHAR, 0, world); + + // execute the command + + execute_command(cmd,mdicomm); + + // check if driver node is now something other than engine node + + if (strcmp(node_driver, "\0") != 0 && strcmp(node_driver, node_engine) != 0) + local_exit_flag = true; + } + + // local exit occured so turn off local exit flag + + local_exit_flag = false; +} + + +/* ---------------------------------------------------------------------- + process a single driver command +---------------------------------------------------------------------- */ + +int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) +{ + int ierr; + + // confirm this command is supported at this node + // NOTE: logic with ierr and command exists is faulty + + int command_exists = 1; + if (root) { + ierr = MDI_Check_command_exists(node_engine, command, MDI_COMM_NULL, &command_exists); + if (ierr) + error->all(FLERR, "MDI: Unable to check whether current command is supported"); + } + if (!command_exists) + error->all(FLERR, "MDI: Received a command unsupported at engine node"); + + // respond to each possible driver command + + if (strcmp(command, ">NATOMS") == 0) { + // NOTE: needs to be 64-bit value or copied into 64-bit value + ierr = MDI_Recv((char *) &atom->natoms, 1, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to receive number of atoms from driver"); + MPI_Bcast(&atom->natoms, 1, MPI_INT, 0, world); + + } else if (strcmp(command, "natoms; + ierr = MDI_Send((char *) &mdi_natoms, 1, MDI_INT64_T, mdicomm); + if (ierr != 0) error->all(FLERR, "MDI: Unable to send number of atoms to driver"); + + } else if (strcmp(command, "ntypes, 1, MDI_INT, mdicomm); + if (ierr != 0) error->all(FLERR, "MDI: Unable to send number of atom types to driver"); + + } else if (strcmp(command, "CELL") == 0) { + receive_cell(error); + + } else if (strcmp(command, "CELL_DISPL") == 0) { + receive_celldispl(error); + + } else if (strcmp(command, ">COORDS") == 0) { + receive_coordinates(error); + + } else if (strcmp(command, "FORCES") == 0) { + receive_forces(error, 0); + + } else if (strcmp(command, ">+FORCES") == 0) { + receive_forces(error, 1); + + } else if (strcmp(command, "@INIT_MD") == 0) { + if (mode != DEFAULT) error->all(FLERR, "MDI: MDI is already performing a simulation"); + mode = MD; + local_exit_flag = true; + + } else if (strcmp(command, "@INIT_OPTG") == 0) { + if (mode != DEFAULT) error->all(FLERR, "MDI: MDI is already performing a simulation"); + mode = OPT; + local_exit_flag = true; + + } else if (strcmp(command, "@") == 0) { + strncpy(node_driver, "\0", MDI_COMMAND_LENGTH); + local_exit_flag = true; + + } else if (strcmp(command, "<@") == 0) { + ierr = MDI_Send(node_engine, MDI_NAME_LENGTH, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send node to driver"); + + } else if (strcmp(command, "etol = std::numeric_limits::max(); + update->ftol = std::numeric_limits::max(); + + // set the maximum number of force evaluations to 0 + update->max_eval = 0; + } + + } else if (strcmp(command, "@COORDS") == 0) { + strncpy(node_driver, "@COORDS", MDI_COMMAND_LENGTH); + local_exit_flag = true; + + } else if (strcmp(command, "@FORCES") == 0) { + strncpy(node_driver, "@FORCES", MDI_COMMAND_LENGTH); + local_exit_flag = true; + + } else if (strcmp(command, "EXIT") == 0) { + // exit the driver code + exit_flag = true; + + // are we in the middle of a geometry optimization? + if (mode == OPT) { + // ensure that the energy and force tolerances are met + update->etol = std::numeric_limits::max(); + update->ftol = std::numeric_limits::max(); + + // set the maximum number of force evaluations to 0 + update->max_eval = 0; + } + + } else { + error->all(FLERR, "MDI: Unknown command from driver"); + } + + return 0; +} + +/* ---------------------------------------------------------------------- + define which MDI commands the LAMMPS engine recognizes + standard MDI commands and custom LAMMPS commands +---------------------------------------------------------------------- */ + +void MDIEngine2::mdi_commands() +{ + // NOTE: define which commands are allowed at which node + + // ------------------------------------ + // list of nodes and commands that an MDI-compliant MD code supports + // ------------------------------------ + + // default node and its commands + + MDI_Register_node("@DEFAULT"); + MDI_Register_command("@DEFAULT", "<@"); + MDI_Register_command("@DEFAULT", "CELL"); + MDI_Register_command("@DEFAULT", ">CELL_DISPL"); + MDI_Register_command("@DEFAULT", ">COORDS"); + MDI_Register_command("@DEFAULT", "@INIT_MD"); + MDI_Register_command("@DEFAULT", "@INIT_OPTG"); + MDI_Register_command("@DEFAULT", "EXIT"); + + // node for setting up and running a dynamics simulation + // NOTE: remove some of these in various nodes below + + MDI_Register_node("@INIT_MD"); + MDI_Register_command("@INIT_MD", "<@"); + MDI_Register_command("@INIT_MD", "CELL"); + MDI_Register_command("@INIT_MD", ">CELL_DISPL"); + MDI_Register_command("@INIT_MD", ">COORDS"); + MDI_Register_command("@INIT_MD", ">FORCES"); + MDI_Register_command("@INIT_MD", ">+FORCES"); + MDI_Register_command("@INIT_MD", "@"); + MDI_Register_command("@INIT_MD", "@COORDS"); + MDI_Register_command("@INIT_MD", "@DEFAULT"); + MDI_Register_command("@INIT_MD", "@FORCES"); + MDI_Register_command("@INIT_MD", "EXIT"); + + // node for setting up and running a minimization + + MDI_Register_node("@INIT_OPTG"); + MDI_Register_command("@INIT_OPTG", "<@"); + MDI_Register_command("@INIT_OPTG", "CELL"); + MDI_Register_command("@INIT_OPTG", ">CELL_DISPL"); + MDI_Register_command("@INIT_OPTG", ">COORDS"); + MDI_Register_command("@INIT_OPTG", ">FORCES"); + MDI_Register_command("@INIT_OPTG", ">+FORCES"); + MDI_Register_command("@INIT_OPTG", "@"); + MDI_Register_command("@INIT_OPTG", "@COORDS"); + MDI_Register_command("@INIT_OPTG", "@DEFAULT"); + MDI_Register_command("@INIT_OPTG", "@FORCES"); + MDI_Register_command("@INIT_OPTG", "EXIT"); + + // node at POST_FORCE location in timestep + + MDI_Register_node("@FORCES"); + MDI_Register_callback("@FORCES", ">FORCES"); + MDI_Register_callback("@FORCES", ">+FORCES"); + MDI_Register_command("@FORCES", "<@"); + MDI_Register_command("@FORCES", "CELL"); + MDI_Register_command("@FORCES", ">CELL_DISPL"); + MDI_Register_command("@FORCES", ">COORDS"); + MDI_Register_command("@FORCES", ">FORCES"); + MDI_Register_command("@FORCES", ">+FORCES"); + MDI_Register_command("@FORCES", "@"); + MDI_Register_command("@FORCES", "@COORDS"); + MDI_Register_command("@FORCES", "@DEFAULT"); + MDI_Register_command("@FORCES", "@FORCES"); + MDI_Register_command("@FORCES", "EXIT"); + + // node at POST_INTEGRATE location in timestep + + MDI_Register_node("@COORDS"); + MDI_Register_command("@COORDS", "<@"); + MDI_Register_command("@COORDS", "CELL"); + MDI_Register_command("@COORDS", ">CELL_DISPL"); + MDI_Register_command("@COORDS", ">COORDS"); + MDI_Register_command("@COORDS", ">FORCES"); + MDI_Register_command("@COORDS", ">+FORCES"); + MDI_Register_command("@COORDS", "@"); + MDI_Register_command("@COORDS", "@COORDS"); + MDI_Register_command("@COORDS", "@DEFAULT"); + MDI_Register_command("@COORDS", "@FORCES"); + MDI_Register_command("@COORDS", "EXIT"); + + // ------------------------------------ + // list of custom MDI nodes and commands which LAMMPS adds support for + // ------------------------------------ +} + +/* ---------------------------------------------------------------------- + run an MD simulation under control of driver +---------------------------------------------------------------------- */ + +void MDIEngine2::mdi_md() +{ + // initialize an MD simulation + + update->whichflag = 1; + timer->init_timeout(); + update->nsteps = 1; + update->ntimestep = 0; + update->firststep = update->ntimestep; + update->laststep = update->ntimestep + update->nsteps; + update->beginstep = update->firststep; + update->endstep = update->laststep; + + lmp->init(); + + // engine is now at @INIT_MD node + + engine_node("@INIT_MD"); + if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; + + // setup the MD simulation + + update->integrate->setup(1); + + engine_node("@FORCES"); + if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; + + // run MD one step at a time + + while (1) { + update->whichflag = 1; + timer->init_timeout(); + update->nsteps += 1; + update->laststep += 1; + update->endstep = update->laststep; + output->next = update->ntimestep + 1; + + // single MD timestep + + update->integrate->run(1); + + // done with MD if driver sends @DEFAULT or EXIT + + if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; + } +} + +/* ---------------------------------------------------------------------- + perform minimization under control of driver +---------------------------------------------------------------------- */ + +void MDIEngine2::mdi_optg() +{ + // initialize an energy minization + + Minimize *minimizer = new Minimize(lmp); + + // setup the minimizer in a way that ensures optimization + // will continue until MDI driver exits + + update->etol = std::numeric_limits::min(); + update->ftol = std::numeric_limits::min(); + update->nsteps = std::numeric_limits::max(); + update->max_eval = std::numeric_limits::max(); + + update->whichflag = 2; + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->firststep + update->nsteps; + + lmp->init(); + + // engine is now at @INIT_OPTG node + + engine_node("@INIT_OPTG"); + + if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; + + // setup the minimization + + update->minimize->setup(); + + if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; + + // Start a minimization, which is configured to run (essentially) + // infinite steps. When the driver sends the EXIT command, + // the minimizer's energy and force tolerances are set to + // extremely large values, causing the minimization to end. + + update->minimize->iterate(update->nsteps); + + // return if driver sends @DEFAULT or EXIT + + if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; + + error->all(FLERR, + fmt::format("MDI reached end of OPTG simulation " + "with invalid command: {}", + cmd)); +} + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// response to individual MDI driver commands +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + +void MDIEngine2::receive_coordinates(Error *error) +{ + // get conversion factor to atomic units + double posconv; + + // real: coords = Ang, eng = Kcal/mole, force = Kcal/mole/Ang + // metal: coords = Ang, eng = eV, force = eV/Ang + + if (lmpunits == REAL) { + double angstrom_to_bohr; + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + posconv = force->angstrom / angstrom_to_bohr; + } else if (lmpunits == METAL) { + double angstrom_to_bohr; + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + posconv = force->angstrom / angstrom_to_bohr; + } + + // create buffer to hold all coords + + double *buffer; + buffer = new double[3 * atom->natoms]; + + int ierr = MDI_Recv((char *) buffer, 3 * atom->natoms, MDI_DOUBLE, mdicomm); + if (ierr != 0) error->all(FLERR, "MDI: Unable to receive coordinates from driver"); + MPI_Bcast(buffer, 3 * atom->natoms, MPI_DOUBLE, 0, world); + + // pick local atoms from the buffer + + double **x = atom->x; + int *mask = atom->mask; + int nlocal = atom->nlocal; + for (int i = 0; i < nlocal; i++) { + x[i][0] = buffer[3 * (atom->tag[i] - 1) + 0] * posconv; + x[i][1] = buffer[3 * (atom->tag[i] - 1) + 1] * posconv; + x[i][2] = buffer[3 * (atom->tag[i] - 1) + 2] * posconv; + } + + // ensure atoms are in current box & update box via shrink-wrap + // has to be be done before invoking Irregular::migrate_atoms() + // since it requires atoms be inside simulation box + + if (domain->triclinic) domain->x2lamda(atom->nlocal); + domain->pbc(); + domain->reset_box(); + if (domain->triclinic) domain->lamda2x(atom->nlocal); + + // move atoms to new processors via irregular() only needed if + // migrate_check() says an atom moves too far + + if (domain->triclinic) domain->x2lamda(atom->nlocal); + if (irregular->migrate_check()) irregular->migrate_atoms(); + if (domain->triclinic) domain->lamda2x(atom->nlocal); + + delete[] buffer; +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_coordinates(Error *error) +{ + // get conversion factor to atomic units + double posconv; + if (lmpunits == REAL) { + double angstrom_to_bohr; + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + posconv = force->angstrom / angstrom_to_bohr; + } else if (lmpunits == METAL) { + double angstrom_to_bohr; + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + posconv = force->angstrom / angstrom_to_bohr; + } + + int64_t ncoords = 3 * atom->natoms; + double *coords; + double *coords_reduced; + memory->create(coords, ncoords, "mdi/engine:coords"); + memory->create(coords_reduced, ncoords, "mdi/engine:coords_reduced"); + + // zero coords + + for (int64_t icoord = 0; icoord < ncoords; icoord++) coords[icoord] = 0.0; + + // copy local atoms into buffer at correct locations + + double **x = atom->x; + int *mask = atom->mask; + int nlocal = atom->nlocal; + for (int i = 0; i < nlocal; i++) { + coords[3 * (atom->tag[i] - 1) + 0] = x[i][0] / posconv; + coords[3 * (atom->tag[i] - 1) + 1] = x[i][1] / posconv; + coords[3 * (atom->tag[i] - 1) + 2] = x[i][2] / posconv; + } + + MPI_Reduce(coords, coords_reduced, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); + + int ierr = MDI_Send((char *) coords_reduced, 3 * atom->natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send coordinates to driver"); + + memory->destroy(coords); + memory->destroy(coords_reduced); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_charges(Error *error) +{ + double *charges; + double *charges_reduced; + + memory->create(charges, atom->natoms, "mdi/engine:charges"); + memory->create(charges_reduced, atom->natoms, "mdi/engine:charges_reduced"); + + // zero the charges array + + for (int icharge = 0; icharge < atom->natoms; icharge++) charges[icharge] = 0.0; + + // pick local atoms from the buffer + + double *charge = atom->q; + int *mask = atom->mask; + int nlocal = atom->nlocal; + for (int i = 0; i < nlocal; i++) { charges[atom->tag[i] - 1] = charge[i]; } + + MPI_Reduce(charges, charges_reduced, atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); + + int ierr = MDI_Send((char *) charges_reduced, atom->natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send charges to driver"); + + memory->destroy(charges); + memory->destroy(charges_reduced); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_energy(Error *error) +{ + // get conversion factor to atomic units + double energy_conv; + if (lmpunits == REAL) { + double kelvin_to_hartree; + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + energy_conv = kelvin_to_hartree / force->boltz; + } else if (lmpunits == METAL) { + double ev_to_hartree; + MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); + energy_conv = ev_to_hartree; + } + + double kelvin_to_hartree; + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + + double potential_energy = pe->compute_scalar(); + double kinetic_energy = ke->compute_scalar(); + double total_energy; + double *send_energy = &total_energy; + + // convert the energy to atomic units + potential_energy *= energy_conv; + kinetic_energy *= energy_conv; + total_energy = potential_energy + kinetic_energy; + + int ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send potential energy to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_pe(Error *error) +{ + // get conversion factor to atomic units + double energy_conv; + if (lmpunits == REAL) { + double kelvin_to_hartree; + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + energy_conv = kelvin_to_hartree / force->boltz; + } else if (lmpunits == METAL) { + double ev_to_hartree; + MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); + energy_conv = ev_to_hartree; + } + + double potential_energy = pe->compute_scalar(); + double *send_energy = &potential_energy; + + // convert the energy to atomic units + potential_energy *= energy_conv; + + int ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send potential energy to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_ke(Error *error) +{ + // get conversion factor to atomic units + double energy_conv; + if (lmpunits == REAL) { + double kelvin_to_hartree; + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + energy_conv = kelvin_to_hartree / force->boltz; + } else if (lmpunits == METAL) { + double ev_to_hartree; + MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); + energy_conv = ev_to_hartree; + } + + double kinetic_energy = ke->compute_scalar(); + double *send_energy = &kinetic_energy; + + // convert the energy to atomic units + kinetic_energy *= energy_conv; + + int ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send potential energy to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_types(Error *error) +{ + int *const type = atom->type; + + int ierr = MDI_Send((char *) type, atom->natoms, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send atom types to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_labels(Error *error) +{ + char *labels = new char[atom->natoms * MDI_LABEL_LENGTH]; + memset(labels, ' ', atom->natoms * MDI_LABEL_LENGTH); + + for (int iatom = 0; iatom < atom->natoms; iatom++) { + std::string label = std::to_string(atom->type[iatom]); + int label_len = std::min(int(label.length()), MDI_LABEL_LENGTH); + strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); + } + + int ierr = MDI_Send(labels, atom->natoms * MDI_LABEL_LENGTH, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send atom types to driver"); + + delete[] labels; +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_masses(Error *error) +{ + double *const rmass = atom->rmass; + double *const mass = atom->mass; + int *const type = atom->type; + int nlocal = atom->nlocal; + + double *mass_by_atom; + double *mass_by_atom_reduced; + memory->create(mass_by_atom, atom->natoms, "mdi/engine:mass_by_atom"); + memory->create(mass_by_atom_reduced, atom->natoms, "mdi/engine:mass_by_atom_reduced"); + for (int iatom = 0; iatom < atom->natoms; iatom++) { mass_by_atom[iatom] = 0.0; } + + // determine the atomic masses + + if (rmass) { + for (int iatom = 0; iatom < nlocal; iatom++) { + mass_by_atom[atom->tag[iatom] - 1] = rmass[iatom]; + } + } else { + for (int iatom = 0; iatom < nlocal; iatom++) { + mass_by_atom[atom->tag[iatom] - 1] = mass[type[iatom]]; + } + } + + MPI_Reduce(mass_by_atom, mass_by_atom_reduced, atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); + + // send the atomic masses to the driver + + int ierr = MDI_Send((char *) mass_by_atom_reduced, atom->natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send atom masses to driver"); + + memory->destroy(mass_by_atom); + memory->destroy(mass_by_atom_reduced); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_forces(Error *error) +{ + // get conversion factor to atomic units + double force_conv; + if (lmpunits == REAL) { + double kelvin_to_hartree; + double angstrom_to_bohr; + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + force_conv = (kelvin_to_hartree / force->boltz) * (force->angstrom / angstrom_to_bohr); + } else if (lmpunits == METAL) { + double ev_to_hartree; + double angstrom_to_bohr; + MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + force_conv = ev_to_hartree / angstrom_to_bohr; + } + + double *forces; + double *forces_reduced; + double *x_buf; + + int *mask = atom->mask; + int nlocal = atom->nlocal; + int64_t ncoords = 3 * atom->natoms; + + memory->create(forces, ncoords, "mdi/engine:forces"); + memory->create(forces_reduced, ncoords, "mdi/engine:forces_reduced"); + x_buf = new double[3 * nlocal]; + + // zero the forces array + + for (int iforce = 0; iforce < 3 * atom->natoms; iforce++) forces[iforce] = 0.0; + + // if not at a node, calculate the forces + + if (strcmp(node_engine, "@DEFAULT") == 0) { + // certain fixes, such as shake, move the coordinates + // to ensure that the coordinates do not change, store a copy + double **x = atom->x; + for (int i = 0; i < nlocal; i++) { + x_buf[3 * i + 0] = x[i][0]; + x_buf[3 * i + 1] = x[i][1]; + x_buf[3 * i + 2] = x[i][2]; + } + + // calculate the forces + update->whichflag = 1; // 1 for dynamics + update->nsteps = 1; + lmp->init(); + update->integrate->setup_minimal(1); + + if (strcmp(node_engine, "@DEFAULT") == 0) { + // restore the original set of coordinates + double **x_new = atom->x; + for (int i = 0; i < nlocal; i++) { + x_new[i][0] = x_buf[3 * i + 0]; + x_new[i][1] = x_buf[3 * i + 1]; + x_new[i][2] = x_buf[3 * i + 2]; + } + } + } + + // pick local atoms from the buffer + double **f = atom->f; + for (int i = 0; i < nlocal; i++) { + forces[3 * (atom->tag[i] - 1) + 0] = f[i][0] * force_conv; + forces[3 * (atom->tag[i] - 1) + 1] = f[i][1] * force_conv; + forces[3 * (atom->tag[i] - 1) + 2] = f[i][2] * force_conv; + } + + // reduce the forces onto rank 0 + + MPI_Reduce(forces, forces_reduced, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); + + // send the forces through MDI + + int ierr = MDI_Send((char *) forces_reduced, 3 * atom->natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send atom forces to driver"); + + memory->destroy(forces); + memory->destroy(forces_reduced); + delete[] x_buf; +} + +/* ---------------------------------------------------------------------- */ + +// Receive forces from the driver +// mode = 0: replace current forces with forces from driver +// mode = 1: add forces from driver to current forces + +void MDIEngine2::receive_forces(Error *error, int mode) +{ + // get conversion factor to atomic units + double force_conv; + if (lmpunits == REAL) { + double kelvin_to_hartree; + double angstrom_to_bohr; + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + force_conv = (kelvin_to_hartree / force->boltz) * (force->angstrom / angstrom_to_bohr); + } else if (lmpunits == METAL) { + double ev_to_hartree; + double angstrom_to_bohr; + MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + force_conv = ev_to_hartree / angstrom_to_bohr; + } + + int64_t ncoords = 3 * atom->natoms; + double *forces; + memory->create(forces, ncoords, "mdi/engine:forces"); + + int ierr = MDI_Recv((char *) forces, 3 * atom->natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to receive atom forces to driver"); + MPI_Bcast(forces, 3 * atom->natoms, MPI_DOUBLE, 0, world); + + // pick local atoms from the buffer + double **f = atom->f; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + if (mode == 0) { // Replace + for (int i = 0; i < nlocal; i++) { + f[i][0] = forces[3 * (atom->tag[i] - 1) + 0] / force_conv; + f[i][1] = forces[3 * (atom->tag[i] - 1) + 1] / force_conv; + f[i][2] = forces[3 * (atom->tag[i] - 1) + 2] / force_conv; + } + } else { + for (int i = 0; i < nlocal; i++) { + f[i][0] += forces[3 * (atom->tag[i] - 1) + 0] / force_conv; + f[i][1] += forces[3 * (atom->tag[i] - 1) + 1] / force_conv; + f[i][2] += forces[3 * (atom->tag[i] - 1) + 2] / force_conv; + } + } + + memory->destroy(forces); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_cell(Error *error) +{ + double angstrom_to_bohr; + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + + double celldata[9]; + + celldata[0] = domain->boxhi[0] - domain->boxlo[0]; + celldata[1] = 0.0; + celldata[2] = 0.0; + celldata[3] = domain->xy; + celldata[4] = domain->boxhi[1] - domain->boxlo[1]; + celldata[5] = 0.0; + celldata[6] = domain->xz; + celldata[7] = domain->yz; + celldata[8] = domain->boxhi[2] - domain->boxlo[2]; + + // convert the units to bohr + + double unit_conv = force->angstrom * angstrom_to_bohr; + for (int icell = 0; icell < 9; icell++) { celldata[icell] *= unit_conv; } + + int ierr = MDI_Send((char *) celldata, 9, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send cell dimensions to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::receive_cell(Error *error) +{ + double celldata[9]; + + // receive the new cell vector from the driver + + int ierr = MDI_Recv((char *) celldata, 9, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send cell dimensions to driver"); + MPI_Bcast(&celldata[0], 9, MPI_DOUBLE, 0, world); + + double angstrom_to_bohr; + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + double unit_conv = force->angstrom * angstrom_to_bohr; + for (int icell = 0; icell < 9; icell++) { celldata[icell] /= unit_conv; } + + // ensure that the new cell vector is orthogonal + + double small = std::numeric_limits::min(); + if (abs(celldata[1]) > small or abs(celldata[2]) > small or abs(celldata[3]) > small or + abs(celldata[5]) > small or abs(celldata[6]) > small or abs(celldata[7]) > small) { + error->all(FLERR, + "MDI: LAMMPS currently only supports the >CELL command for orthogonal cell vectors"); + } + + // set the new LAMMPS cell dimensions + // This only works for orthogonal cell vectors. + // Supporting the more general case would be possible, + // but considerably more complex. + + domain->boxhi[0] = celldata[0] + domain->boxlo[0]; + domain->boxhi[1] = celldata[4] + domain->boxlo[1]; + domain->boxhi[2] = celldata[8] + domain->boxlo[2]; + domain->xy = 0.0; + domain->xz = 0.0; + domain->yz = 0.0; +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_celldispl(Error *error) +{ + double angstrom_to_bohr; + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + + double celldata[3]; + + celldata[0] = domain->boxlo[0]; + celldata[1] = domain->boxlo[1]; + celldata[2] = domain->boxlo[2]; + + // convert the units to bohr + + double unit_conv = force->angstrom * angstrom_to_bohr; + for (int icell = 0; icell < 3; icell++) { celldata[icell] *= unit_conv; } + + int ierr = MDI_Send((char *) celldata, 3, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send cell displacement to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::receive_celldispl(Error *error) +{ + // receive the cell displacement from the driver + + double celldata[3]; + int ierr = MDI_Recv((char *) celldata, 3, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to receive cell displacement from driver"); + MPI_Bcast(&celldata[0], 3, MPI_DOUBLE, 0, world); + + double angstrom_to_bohr; + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + double unit_conv = force->angstrom * angstrom_to_bohr; + + double old_boxlo[3]; + old_boxlo[0] = domain->boxlo[0]; + old_boxlo[1] = domain->boxlo[1]; + old_boxlo[2] = domain->boxlo[2]; + + // adjust the values of boxlo and boxhi for the new cell displacement vector + domain->boxlo[0] = celldata[0] / unit_conv; + domain->boxlo[1] = celldata[1] / unit_conv; + domain->boxlo[2] = celldata[2] / unit_conv; + domain->boxhi[0] += domain->boxlo[0] - old_boxlo[0]; + domain->boxhi[1] += domain->boxlo[1] - old_boxlo[1]; + domain->boxhi[2] += domain->boxlo[2] - old_boxlo[2]; +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::exchange_forces() +{ + // one-time allocation of add_force array + + if (!add_force) { + int64_t ncoords = 3 * atom->natoms; + memory->create(add_force, ncoords, "mdi/engine:add_force"); + for (int64_t i = 0; i < ncoords; i++) add_force[i] = 0.0; + } + + double **f = atom->f; + const int *const mask = atom->mask; + const int nlocal = atom->nlocal; + + // add forces from the driver + // NOTE: how is group for fix invoked now + int groupbit; + + for (int i = 0; i < nlocal; ++i) { + if (mask[i] & groupbit) { + f[i][0] += add_force[3 * (atom->tag[i] - 1) + 0]; + f[i][1] += add_force[3 * (atom->tag[i] - 1) + 1]; + f[i][2] += add_force[3 * (atom->tag[i] - 1) + 2]; + } + } +} diff --git a/src/USER-MDI/mdi_engine2.h b/src/USER-MDI/mdi_engine2.h new file mode 100644 index 0000000000..9c1d948ad4 --- /dev/null +++ b/src/USER-MDI/mdi_engine2.h @@ -0,0 +1,98 @@ +/* -*- 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 COMMAND_CLASS +// clang-format off +CommandStyle(mdi/engine2, MDIEngine2); +// clang-format on +#else + +#ifndef LMP_MDI_ENGINE2_H +#define LMP_MDI_ENGINE2_H + +#include "command.h" +#include "mdi.h" + +namespace LAMMPS_NS { + +class MDIEngine2 : public Command { + public: + MDIEngine2(LAMMPS *lmp) : Command(lmp) {} + virtual ~MDIEngine2() {} + void command(int, char **); + + int execute_command(const char *command, MDI_Comm mdicomm); + void engine_node(const char *node); + + private: + int lmpunits; // REAL or METAL + int root; // 1 for procs 0, otherwise 0 + int mode; // which mode engine is in (DEFAULT,MD,OPTG,etc) + char *cmd; + char *node_driver; // which node driver is at + char *node_engine; // which node engine is at + + MDI_Comm mdicomm; + class FixMDIEngine2 *mdi_fix; + + bool exit_flag; + bool local_exit_flag; + + // command to be executed at the target node + + char *target_command; + + char *id_pe; + char *id_ke; + class Irregular *irregular; + class Minimize *minimizer; + class Compute *pe; + class Compute *ke; + double *add_force; + + void mdi_commands(); + void mdi_md(); + void mdi_optg(); + + void send_types(Error *); + void send_labels(Error *); + void send_masses(Error *); + void receive_coordinates(Error *); + void send_coordinates(Error *); + void send_charges(Error *); + void send_energy(Error *); + void send_forces(Error *); + void send_pe(Error *); + void send_ke(Error *); + void receive_forces(Error *, int); + void send_cell(Error *); + void receive_cell(Error *); + void send_celldispl(Error *); + void receive_celldispl(Error *); + void exchange_forces(); +}; + +} + +#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. + +*/ From f8ebcff07870e75119ff1f33d9469abb2796c92e Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Tue, 22 Jun 2021 09:36:40 -0600 Subject: [PATCH 002/130] changes to mdi_engine --- src/USER-MDI/mdi_engine2.cpp | 351 +++++++++++++++++++++++++++++------ src/USER-MDI/mdi_engine2.h | 44 +++-- 2 files changed, 324 insertions(+), 71 deletions(-) diff --git a/src/USER-MDI/mdi_engine2.cpp b/src/USER-MDI/mdi_engine2.cpp index b4c74e0bbb..60a8ca107f 100644 --- a/src/USER-MDI/mdi_engine2.cpp +++ b/src/USER-MDI/mdi_engine2.cpp @@ -29,6 +29,7 @@ #include "fix_mdi_engine2.h" #include "force.h" #include "group.h" +#include "input.h" #include "irregular.h" #include "library.h" #include "mdi.h" @@ -65,9 +66,11 @@ void MDIEngine2::command(int narg, char **arg) // check that LAMMPS defines what an MDI engine needs - if (atom->tag_enable == 0) error->all(FLERR, "Cannot use mdi/engine without atom IDs"); + if (atom->tag_enable == 0) + error->all(FLERR, "Cannot use mdi/engine without atom IDs"); - if (atom->tag_consecutive() == 0) error->all(FLERR, "mdi/engine requires consecutive atom IDs"); + if (atom->natoms && atom->tag_consecutive() == 0) + error->all(FLERR, "mdi/engine requires consecutive atom IDs"); // must use real or metal units with MDI (atomic scale) // real: coords = Ang, eng = Kcal/mole, force = Kcal/mole/Ang @@ -118,23 +121,26 @@ void MDIEngine2::command(int narg, char **arg) strncpy(node_driver, "\0", MDI_COMMAND_LENGTH); strncpy(node_engine, "@DEFAULT", MDI_COMMAND_LENGTH); - // create computes for KE and PE + // create computes for KE. PE, pressure + + id_ke = utils::strdup(std::string("MDI_ENGINE") + "_ke"); + modify->add_compute(fmt::format("{} all ke", id_ke)); - //id_pe = utils::strdup(std::string("MDI_ENGINE") + "_pe"); - //modify->add_compute(fmt::format("{} all pe", id_pe)); + id_pe = utils::strdup(std::string("MDI_ENGINE") + "_pe"); + modify->add_compute(fmt::format("{} all pe", id_pe)); - //id_ke = utils::strdup(std::string("MDI_ENGINE") + "_ke"); - //modify->add_compute(fmt::format("{} all ke", id_ke)); + id_press = utils::strdup(std::string("MDI_ENGINE") + "_press"); + modify->add_compute(fmt::format("{} all pressure thermo_temp", id_press)); - // confirm that two required computes are still available + // store pointers to the new computes - //int icompute_pe = modify->find_compute(id_pe); - //if (icompute_pe < 0) error->all(FLERR, "Potential energy ID for fix mdi/engine does not exist"); - //int icompute_ke = modify->find_compute(id_ke); - //if (icompute_pe < 0) error->all(FLERR, "Kinetic energy ID for fix mdi/engine does not exist"); + int icompute_ke = modify->find_compute(id_ke); + int icompute_pe = modify->find_compute(id_pe); + int icompute_press = modify->find_compute(id_press); - //pe = modify->compute[icompute_pe]; - //ke = modify->compute[icompute_ke]; + ke = modify->compute[icompute_ke]; + pe = modify->compute[icompute_pe]; + press = modify->compute[icompute_press]; // irregular class and data structs used by MDI @@ -274,54 +280,56 @@ int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) if (ierr != 0) error->all(FLERR, "MDI: Unable to send number of atom types to driver"); } else if (strcmp(command, "CELL") == 0) { - receive_cell(error); + receive_cell(); } else if (strcmp(command, "CELL_DISPL") == 0) { - receive_celldispl(error); + receive_celldispl(); } else if (strcmp(command, ">COORDS") == 0) { - receive_coordinates(error); + receive_coordinates(); } else if (strcmp(command, "FORCES") == 0) { - receive_forces(error, 0); + receive_forces(0); } else if (strcmp(command, ">+FORCES") == 0) { - receive_forces(error, 1); + receive_forces(1); } else if (strcmp(command, "@INIT_MD") == 0) { - if (mode != DEFAULT) error->all(FLERR, "MDI: MDI is already performing a simulation"); + if (mode != DEFAULT) + error->all(FLERR, "MDI: MDI is already performing a simulation"); mode = MD; local_exit_flag = true; } else if (strcmp(command, "@INIT_OPTG") == 0) { - if (mode != DEFAULT) error->all(FLERR, "MDI: MDI is already performing a simulation"); + if (mode != DEFAULT) + error->all(FLERR, "MDI: MDI is already performing a simulation"); mode = OPT; local_exit_flag = true; @@ -334,10 +342,10 @@ int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) if (ierr) error->all(FLERR, "MDI: Unable to send node to driver"); } else if (strcmp(command, "max_eval = 0; } + // ------------------------------------------------------- + // LAMMPS specific commands + // ------------------------------------------------------- + + } else if (strcmp(command, "COMMAND") == 0) { + single_command(); + } else if (strcmp(command, "COMMANDS") == 0) { + many_commands(); + } else if (strcmp(command, "INFILE") == 0) { + infile(); + } else if (strcmp(command, "RESET_BOX") == 0) { + reset_box(); + } else if (strcmp(command, "CREATE_ATOM") == 0) { + create_atoms(); + } else if (strcmp(command, "all(FLERR, "MDI: Unknown command from driver"); } @@ -408,6 +439,8 @@ void MDIEngine2::mdi_commands() MDI_Register_command("@DEFAULT", "CELL"); MDI_Register_command("@DEFAULT", ">CELL_DISPL"); @@ -530,6 +563,14 @@ void MDIEngine2::mdi_commands() // ------------------------------------ // list of custom MDI nodes and commands which LAMMPS adds support for // ------------------------------------ + + MDI_Register_command("@DEFAULT", "COMMAND"); + MDI_Register_command("@DEFAULT", "COMMANDS"); + MDI_Register_command("@DEFAULT", "INFILE"); + MDI_Register_command("@DEFAULT", "RESET_BOX"); + MDI_Register_command("@DEFAULT", "CREATE_ATOM"); + MDI_Register_command("@DEFAULT", "compute_scalar(); - double *send_energy = &potential_energy; // convert the energy to atomic units + potential_energy *= energy_conv; - int ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, mdicomm); + int ierr = MDI_Send((char *) &potential_energy, 1, MDI_DOUBLE, mdicomm); if (ierr) error->all(FLERR, "MDI: Unable to send potential energy to driver"); } /* ---------------------------------------------------------------------- */ -void MDIEngine2::send_ke(Error *error) +void MDIEngine2::send_ke() { // get conversion factor to atomic units double energy_conv; @@ -851,18 +895,18 @@ void MDIEngine2::send_ke(Error *error) } double kinetic_energy = ke->compute_scalar(); - double *send_energy = &kinetic_energy; // convert the energy to atomic units + kinetic_energy *= energy_conv; - int ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, mdicomm); + int ierr = MDI_Send((char *) &kinetic_energy, 1, MDI_DOUBLE, mdicomm); if (ierr) error->all(FLERR, "MDI: Unable to send potential energy to driver"); } /* ---------------------------------------------------------------------- */ -void MDIEngine2::send_types(Error *error) +void MDIEngine2::send_types() { int *const type = atom->type; @@ -872,7 +916,7 @@ void MDIEngine2::send_types(Error *error) /* ---------------------------------------------------------------------- */ -void MDIEngine2::send_labels(Error *error) +void MDIEngine2::send_labels() { char *labels = new char[atom->natoms * MDI_LABEL_LENGTH]; memset(labels, ' ', atom->natoms * MDI_LABEL_LENGTH); @@ -891,7 +935,7 @@ void MDIEngine2::send_labels(Error *error) /* ---------------------------------------------------------------------- */ -void MDIEngine2::send_masses(Error *error) +void MDIEngine2::send_masses() { double *const rmass = atom->rmass; double *const mass = atom->mass; @@ -929,7 +973,7 @@ void MDIEngine2::send_masses(Error *error) /* ---------------------------------------------------------------------- */ -void MDIEngine2::send_forces(Error *error) +void MDIEngine2::send_forces() { // get conversion factor to atomic units double force_conv; @@ -1020,7 +1064,7 @@ void MDIEngine2::send_forces(Error *error) // mode = 0: replace current forces with forces from driver // mode = 1: add forces from driver to current forces -void MDIEngine2::receive_forces(Error *error, int mode) +void MDIEngine2::receive_forces(int mode) { // get conversion factor to atomic units double force_conv; @@ -1070,7 +1114,7 @@ void MDIEngine2::receive_forces(Error *error, int mode) /* ---------------------------------------------------------------------- */ -void MDIEngine2::send_cell(Error *error) +void MDIEngine2::send_cell() { double angstrom_to_bohr; MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); @@ -1098,7 +1142,7 @@ void MDIEngine2::send_cell(Error *error) /* ---------------------------------------------------------------------- */ -void MDIEngine2::receive_cell(Error *error) +void MDIEngine2::receive_cell() { double celldata[9]; @@ -1137,7 +1181,7 @@ void MDIEngine2::receive_cell(Error *error) /* ---------------------------------------------------------------------- */ -void MDIEngine2::send_celldispl(Error *error) +void MDIEngine2::send_celldispl() { double angstrom_to_bohr; MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); @@ -1159,7 +1203,7 @@ void MDIEngine2::send_celldispl(Error *error) /* ---------------------------------------------------------------------- */ -void MDIEngine2::receive_celldispl(Error *error) +void MDIEngine2::receive_celldispl() { // receive the cell displacement from the driver @@ -1214,3 +1258,206 @@ void MDIEngine2::exchange_forces() } } } + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::single_command() +{ + int length; + int ierr = MDI_Recv(&length, 1, MDI_INT, mdicomm); + if (ierr) + error->all(FLERR, "MDI single_command: no length"); + MPI_Bcast(&length, 1, MPI_INT, 0, world); + + char *cmd = new char[length+1]; + ierr = MDI_Recv(cmd, length, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI single_command: did not receive command"); + MPI_Bcast(cmd, length, MPI_CHAR, 0, world); + cmd[length] = '\0'; + + lammps_command(lmp,cmd); + + delete [] cmd; +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::many_commands() +{ + int length; + int ierr = MDI_Recv(&length, 1, MDI_INT, mdicomm); + if (ierr) + error->all(FLERR, "MDI many_commands: no length"); + MPI_Bcast(&length, 1, MPI_INT, 0, world); + + char *cmds = new char[length+1]; + ierr = MDI_Recv(cmds, length, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI many_commands: did not receive commands"); + MPI_Bcast(cmds, length, MPI_CHAR, 0, world); + cmds[length] = '\0'; + + char *ptr; + char *cmd = cmds; + + while (*cmd) { + ptr = strchr(cmd,'\n'); + if (ptr) *ptr = '\0'; + lammps_command(lmp,cmd); + if (!ptr) break; + cmd = ptr+1; + } + + delete [] cmds; +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::infile() +{ + int length; + int ierr = MDI_Recv(&length, 1, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI infile: no length"); + MPI_Bcast(&length, 1, MPI_INT, 0, world); + + char *infile = new char[length+1]; + ierr = MDI_Recv(infile, length, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI infile: did not receive filename"); + MPI_Bcast(infile, length, MPI_CHAR, 0, world); + cmd[length] = '\0'; + + lammps_file(lmp,infile); + + delete [] infile; +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::reset_box() +{ + int ierr; + double boxlo[3],boxhi[3],tilts[3]; + ierr = MDI_Recv(boxlo, 3, MDI_DOUBLE, mdicomm); + ierr = MDI_Recv(boxhi, 3, MDI_DOUBLE, mdicomm); + ierr = MDI_Recv(tilts, 3, MDI_DOUBLE, mdicomm); + // ierr check? + MPI_Bcast(boxlo, 3, MPI_DOUBLE, 0, world); + MPI_Bcast(boxhi, 3, MPI_DOUBLE, 0, world); + MPI_Bcast(tilts, 3, MPI_DOUBLE, 0, world); + + lammps_reset_box(lmp,boxlo,boxhi,tilts[0],tilts[1],tilts[2]); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::create_atoms() +{ + int ierr; + int natoms; + ierr = MDI_Recv(&natoms, 1, MDI_INT, mdicomm); + // ierr checks everywhere? + MPI_Bcast(&natoms, 1, MPI_INT, 0, world); + + tagint *id = nullptr; + int *type = nullptr; + double *x = nullptr; + double *v = nullptr; + imageint *image = nullptr; + + while (1) { + char label; + ierr = MDI_Recv(&label, 1, MDI_CHAR, mdicomm); + MPI_Bcast(&label, 1, MPI_CHAR, 0, world); + + if (label == '0') break; + + if (label == 'i') { + id = new tagint[natoms]; + ierr = MDI_Recv(id, natoms, MDI_INT, mdicomm); + MPI_Bcast(id, natoms, MPI_INT, 0, world); + } else if (label == 't') { + type = new int[natoms]; + ierr = MDI_Recv(type, natoms, MDI_INT, mdicomm); + MPI_Bcast(type, natoms, MPI_INT, 0, world); + } else if (label == 'x') { + x = new double[3*natoms]; + ierr = MDI_Recv(x, 3*natoms, MDI_DOUBLE, mdicomm); + MPI_Bcast(x, 3*natoms, MPI_DOUBLE, 0, world); + } else if (label == 'v') { + v = new double[3*natoms]; + ierr = MDI_Recv(v, 3*natoms, MDI_DOUBLE, mdicomm); + MPI_Bcast(v, 3*natoms, MPI_DOUBLE, 0, world); + } else if (label == 'i') { + image = new imageint[natoms]; + ierr = MDI_Recv(image, natoms, MDI_INT, mdicomm); + MPI_Bcast(image, natoms, MPI_INT, 0, world); + } + } + + if (!x || !type) + error->all(FLERR,"MDI create_atoms: did not receive atom coords or types"); + + int ncreate = lammps_create_atoms(lmp,natoms,id,type,x,v,image,1); + + if (ncreate != natoms) + error->all(FLERR, "MDI create_atoms: created atoms != sent atoms"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_pressure() +{ + // get conversion factor to atomic units + + double pressure_conv = 1.0; + + /* + if (lmpunits == REAL) { + double kelvin_to_hartree; + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + pressure_conv = kelvin_to_hartree / force->boltz; + } else if (lmpunits == METAL) { + double ev_to_hartree; + MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); + pressure_conv = ev_to_hartree; + } + */ + + double pressure = press->compute_scalar(); + + // convert the pressure to atomic units + + pressure *= pressure_conv; + + int ierr = MDI_Send(&pressure, 1, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send pressure to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_virial() +{ + // get conversion factor to atomic units + + double pressure_conv = 1.0; + + /* + if (lmpunits == REAL) { + double kelvin_to_hartree; + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + pressure_conv = kelvin_to_hartree / force->boltz; + } else if (lmpunits == METAL) { + double ev_to_hartree; + MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); + pressure_conv = ev_to_hartree; + } + */ + + press->compute_vector(); + + // convert the pressure to atomic units + + //pressure *= pressure_conv; + + int ierr = MDI_Send(press->vector, 6, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send pressure to driver"); +} diff --git a/src/USER-MDI/mdi_engine2.h b/src/USER-MDI/mdi_engine2.h index 9c1d948ad4..39c168139c 100644 --- a/src/USER-MDI/mdi_engine2.h +++ b/src/USER-MDI/mdi_engine2.h @@ -52,34 +52,40 @@ class MDIEngine2 : public Command { char *target_command; - char *id_pe; - char *id_ke; + char *id_ke,*id_pe,*id_press; class Irregular *irregular; class Minimize *minimizer; - class Compute *pe; - class Compute *ke; + class Compute *ke,*pe,*press; double *add_force; void mdi_commands(); void mdi_md(); void mdi_optg(); - void send_types(Error *); - void send_labels(Error *); - void send_masses(Error *); - void receive_coordinates(Error *); - void send_coordinates(Error *); - void send_charges(Error *); - void send_energy(Error *); - void send_forces(Error *); - void send_pe(Error *); - void send_ke(Error *); - void receive_forces(Error *, int); - void send_cell(Error *); - void receive_cell(Error *); - void send_celldispl(Error *); - void receive_celldispl(Error *); + void send_types(); + void send_labels(); + void send_masses(); + void receive_coordinates(); + void send_coordinates(); + void send_charges(); + void send_energy(); + void send_forces(); + void send_pe(); + void send_ke(); + void receive_forces(int); + void send_cell(); + void receive_cell(); + void send_celldispl(); + void receive_celldispl(); void exchange_forces(); + + void single_command(); + void many_commands(); + void infile(); + void reset_box(); + void create_atoms(); + void send_pressure(); + void send_virial(); }; } From 75cb6fc51b484bb03dd21bac975e5d65257735df Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 2 Sep 2021 17:52:10 -0600 Subject: [PATCH 003/130] added support for LAMMPS as MDI AIMD driver --- src/MDI/fix_mdi_aimd.cpp | 143 ++++ src/MDI/fix_mdi_aimd.h | 55 ++ src/MDI/fix_mdi_engine.cpp | 7 + src/MDI/fix_mdi_engine2.cpp | 79 ++ src/MDI/fix_mdi_engine2.h | 81 ++ src/MDI/library_mdi.cpp | 17 +- src/MDI/mdi_engine2.cpp | 1426 +++++++++++++++++++++++++++++++++++ src/MDI/mdi_engine2.h | 128 ++++ src/comm.cpp | 3 +- 9 files changed, 1936 insertions(+), 3 deletions(-) create mode 100644 src/MDI/fix_mdi_aimd.cpp create mode 100644 src/MDI/fix_mdi_aimd.h create mode 100644 src/MDI/fix_mdi_engine2.cpp create mode 100644 src/MDI/fix_mdi_engine2.h create mode 100644 src/MDI/mdi_engine2.cpp create mode 100644 src/MDI/mdi_engine2.h diff --git a/src/MDI/fix_mdi_aimd.cpp b/src/MDI/fix_mdi_aimd.cpp new file mode 100644 index 0000000000..f8ebcaac85 --- /dev/null +++ b/src/MDI/fix_mdi_aimd.cpp @@ -0,0 +1,143 @@ +/* ---------------------------------------------------------------------- + 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. +------------------------------------------------------------------------- */ + +#include "error.h" +#include "fix_mdi_aimd.h" +#include "atom.h" +#include "comm.h" +#include "domain.h" +#include "force.h" + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + if (narg != 3) error->all(FLERR, "Illegal fix mdi/aimd command"); + + scalar_flag = 1; + global_freq = 1; + extscalar = 1; + energy_global_flag = 1; + virial_global_flag = 1; + thermo_energy = thermo_virial = 1; + + // connect to MDI engine + + MDI_Accept_communicator(&engine); +} + +/* ---------------------------------------------------------------------- */ + +FixMDIAimd::~FixMDIAimd() +{ + // send exit command to engine + + MDI_Send_command("EXIT",engine); +} + +/* ---------------------------------------------------------------------- */ + +int FixMDIAimd::setmask() +{ + int mask = 0; + mask |= PRE_REVERSE; + mask |= POST_FORCE; + mask |= MIN_POST_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIAimd::setup(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIAimd::setup_pre_reverse(int eflag, int vflag) +{ + pre_reverse(eflag,vflag); +} + +/* ---------------------------------------------------------------------- + store eflag, so can use it in post_force to request energy +------------------------------------------------------------------------- */ + +void FixMDIAimd::pre_reverse(int eflag, int /*vflag*/) +{ + eflag_caller = eflag; +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIAimd::post_force(int vflag) +{ + int eflag = eflag_caller; + ev_init(eflag,vflag); + + // send current coords to MDI engine + // NOTE: need to gather them to proc 0 + + MDI_Send_command(">COORDS",engine); + MDI_Send(&atom->x[0][0],3*atom->nlocal,MDI_DOUBLE,engine); + + // trigger engine to evaluate forces,energy,pressure for current system + + MDI_Send_command("EVAL",engine); + + // request energy from MDI engine + + if (eflag_global) { + MDI_Send_command("xprd * domain->yprd * domain->zprd; + for (int i = 0; i < 6; i++) + virial[i] = ptensor[i] * volume / force->nktv2p; + } + + // request forces from MDI engine + // NOTE: need to scatter to procs, then add to my local forces + + MDI_Send_command("f[0][0],3*atom->nlocal,MDI_DOUBLE,engine); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIAimd::min_post_force(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- + energy from MDI engine +------------------------------------------------------------------------- */ + +double FixMDIAimd::compute_scalar() +{ + return engine_energy; +} diff --git a/src/MDI/fix_mdi_aimd.h b/src/MDI/fix_mdi_aimd.h new file mode 100644 index 0000000000..8ea62e1f1e --- /dev/null +++ b/src/MDI/fix_mdi_aimd.h @@ -0,0 +1,55 @@ +/* -*- 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 FIX_CLASS +// clang-format off +FixStyle(mdi/aimd,FixMDIAimd); +// clang-format on +#else + +#ifndef LMP_FIX_MDI_AIMD_H +#define LMP_FIX_MDI_AIMD_H + +#include "fix.h" +#include + +namespace LAMMPS_NS { + +class FixMDIAimd : public Fix { + public: + FixMDIAimd(class LAMMPS *, int, char **); + ~FixMDIAimd(); + int setmask(); + + void setup(int); + void setup_pre_reverse(int, int); + void pre_reverse(int, int); + void post_force(int); + void min_post_force(int); + double compute_scalar(); + + private: + int eflag_caller; + double engine_energy; + + MDI_Comm engine; +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +*/ diff --git a/src/MDI/fix_mdi_engine.cpp b/src/MDI/fix_mdi_engine.cpp index a898647563..f79f3b9980 100644 --- a/src/MDI/fix_mdi_engine.cpp +++ b/src/MDI/fix_mdi_engine.cpp @@ -378,6 +378,9 @@ char *FixMDIEngine::engine_mode(const char *node) fprintf(logfile,"MDI ENGINE MODE: %i\n",node); */ + printf("ENG NODE ENTRY eng/driver %s %s %d %d\n", + node,target_node,strlen(node),strlen(target_node)); + // do not process commands if engine and driver are not at same node // target_node = node that driver has set via a @ command // current_node = node that engine (LAMMPS) has set @@ -402,10 +405,14 @@ char *FixMDIEngine::engine_mode(const char *node) // execute the command + printf("RECV CMD %s\n",command); this->execute_command(command, driver_socket); // check if the target node is something other than the current node + printf("ENG NODES eng/driver %s %s %d %d\n", + node,target_node,strlen(node),strlen(target_node)); + if (strcmp(target_node, "\0") != 0 && strcmp(target_node, current_node) != 0) local_exit_flag = true; } diff --git a/src/MDI/fix_mdi_engine2.cpp b/src/MDI/fix_mdi_engine2.cpp new file mode 100644 index 0000000000..420940bb41 --- /dev/null +++ b/src/MDI/fix_mdi_engine2.cpp @@ -0,0 +1,79 @@ +/* ---------------------------------------------------------------------- + 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: Taylor Barnes (MolSSI) + MolSSI Driver Interface (MDI) support for LAMMPS +------------------------------------------------------------------------- */ + +#include "error.h" +#include "fix_mdi_engine2.h" +#include "mdi_engine2.h" + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixMDIEngine2::FixMDIEngine2(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + if (narg != 3) error->all(FLERR, "Illegal fix mdi/engine command"); +} + +/* ---------------------------------------------------------------------- */ + +int FixMDIEngine2::setmask() +{ + int mask = 0; + mask |= POST_INTEGRATE; + mask |= POST_FORCE; + mask |= MIN_PRE_FORCE; + mask |= MIN_POST_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine2::min_setup(int vflag) +{ + mdi_engine->engine_node("@FORCES"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine2::post_integrate() +{ + mdi_engine->engine_node("@COORDS"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine2::min_pre_force(int vflag) +{ + mdi_engine->engine_node("@COORDS"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine2::min_post_force(int vflag) +{ + mdi_engine->engine_node("@FORCES"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine2::post_force(int vflag) +{ + mdi_engine->engine_node("@FORCES"); +} diff --git a/src/MDI/fix_mdi_engine2.h b/src/MDI/fix_mdi_engine2.h new file mode 100644 index 0000000000..43c39f382b --- /dev/null +++ b/src/MDI/fix_mdi_engine2.h @@ -0,0 +1,81 @@ +/* -*- 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 FIX_CLASS +// clang-format off +FixStyle(mdi/engine2, FixMDIEngine2); +// clang-format on +#else + +#ifndef LMP_FIX_MDI_ENGINE2_H +#define LMP_FIX_MDI_ENGINE2_H + +#include "fix.h" + +namespace LAMMPS_NS { + +class FixMDIEngine2 : public Fix { + public: + class MDIEngine2 *mdi_engine; + + FixMDIEngine2(class LAMMPS *, int, char **); + ~FixMDIEngine2() {} + int setmask(); + void init() {} + + void min_setup(int); + void post_integrate(); + void post_force(int); + void min_pre_force(int); + void min_post_force(int); +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. + +E: Potential energy ID for fix mdi does not exist + +Self-explanatory. + +E: Cannot use MDI command without atom IDs + +Self-explanatory. + +E: MDI command requires consecutive atom IDs + +Self-explanatory. + +E: Unable to connect to driver + +Self-explanatory. + +E: Unable to ... driver + +Self-explanatory. + +E: Unknown command from driver + +The driver sent a command that is not supported by the LAMMPS +interface. In some cases this might be because a nonsensical +command was sent (i.e. "SCF"). In other cases, the LAMMPS +interface might benefit from being expanded. + +*/ diff --git a/src/MDI/library_mdi.cpp b/src/MDI/library_mdi.cpp index 53afb6cf5a..5d4992e2b6 100644 --- a/src/MDI/library_mdi.cpp +++ b/src/MDI/library_mdi.cpp @@ -13,11 +13,13 @@ // ---------------------------------------------------------------------- // MolSSI Driver Interface functions +// these are added to LAMMPS library interface when MDI package is included // ---------------------------------------------------------------------- #include "library_mdi.h" // needed to enable MPI support + #define LAMMPS_LIB_MPI 1 #include "library.h" @@ -27,6 +29,8 @@ using namespace LAMMPS_NS; +/* ---------------------------------------------------------------------- */ + /** Initialize an instance of LAMMPS as an MDI plugin * \verbatim embed:rst @@ -51,6 +55,7 @@ command-line argument, which must be provided by the MDI driver. int MDI_Plugin_init_lammps() { // initialize MDI + int mdi_argc; char **mdi_argv; if (MDI_Plugin_get_argc(&mdi_argc)) MPI_Abort(MPI_COMM_WORLD, 1); @@ -58,30 +63,36 @@ int MDI_Plugin_init_lammps() if (MDI_Init(&mdi_argc, &mdi_argv)) MPI_Abort(MPI_COMM_WORLD, 1); // get the MPI intra-communicator for this code + MPI_Comm mpi_world_comm = MPI_COMM_WORLD; if (MDI_MPI_get_world_comm(&mpi_world_comm)) MPI_Abort(MPI_COMM_WORLD, 1); // find the -in argument + int iarg = 0; char *filename; bool found_filename = false; while (iarg < mdi_argc && !found_filename) { - if ((strcmp(mdi_argv[iarg], "-in") == 0) || (strcmp(mdi_argv[iarg], "-i") == 0)) { + if ((strcmp(mdi_argv[iarg], "-in") == 0) || + (strcmp(mdi_argv[iarg], "-i") == 0)) { if (iarg + 2 > mdi_argc) MPI_Abort(MPI_COMM_WORLD, 1); filename = mdi_argv[iarg + 1]; found_filename = true; // remove -in argument from the command list + mdi_argc -= 2; - for (int jarg = iarg; jarg < mdi_argc; jarg++) mdi_argv[jarg] = mdi_argv[jarg + 2]; + for (int jarg = iarg; jarg < mdi_argc; jarg++) + mdi_argv[jarg] = mdi_argv[jarg + 2]; } iarg++; } if (!found_filename) MPI_Abort(MPI_COMM_WORLD, 1); // create and run a LAMMPS instance + void *lmp = nullptr; if (lammps_config_has_mpi_support() > 0) lmp = lammps_open(mdi_argc, mdi_argv, mpi_world_comm, nullptr); @@ -93,6 +104,8 @@ int MDI_Plugin_init_lammps() return 0; } +/* ---------------------------------------------------------------------- */ + /** Execute an MDI command * \verbatim embed:rst diff --git a/src/MDI/mdi_engine2.cpp b/src/MDI/mdi_engine2.cpp new file mode 100644 index 0000000000..df5aba7fa3 --- /dev/null +++ b/src/MDI/mdi_engine2.cpp @@ -0,0 +1,1426 @@ +/* ---------------------------------------------------------------------- + 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: Taylor Barnes (MolSSI) + MolSSI Driver Interface (MDI) support for LAMMPS +------------------------------------------------------------------------- */ + +#include "mdi_engine2.h" + +#include +#include +#include "atom.h" +#include "comm.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "fix_mdi_engine2.h" +#include "force.h" +#include "group.h" +#include "input.h" +#include "irregular.h" +#include "library.h" +#include "memory.h" +#include "min.h" +#include "minimize.h" +#include "modify.h" +#include "neighbor.h" +#include "output.h" +#include "timer.h" +#include "update.h" +#include "verlet.h" + +#include + +using namespace LAMMPS_NS; + +enum{NATIVE,REAL,METAL}; // LAMMPS units which MDI supports +enum{DEFAULT,MD,OPT}; // top-level MDI engine mode +enum{TYPE,CHARGE,MASS,COORD,VELOCITY,FORCE}; + +/* ---------------------------------------------------------------------- + mdi command: quit or engine +---------------------------------------------------------------------- */ + +void MDIEngine2::command(int narg, char **arg) +{ + if (narg < 1) error->all(FLERR, "Illegal mdi command"); + + if (strcmp(arg[0],"engine") == 0) mdi_engine(narg-1,&arg[1]); + else error->all(FLERR, "Illegal mdi command"); +} + +/* ---------------------------------------------------------------------- + trigger LAMMPS to start acting as an MDI engine + either in standalone mode or plugin mode + MDI_Init() for standalone mode is in main.cpp + MDI_Init() for plugin mode is in library_mdi.cpp::MDI_Plugin_init_lammps() + endlessly loop over receiving commands from driver and responding + when EXIT command is received, mdi engine command exits +---------------------------------------------------------------------- */ + +void MDIEngine2::mdi_engine(int narg, char **arg) +{ + // args to choose what MDI nodes LAMMPS will interact with + // also whether a fix mdi/engine is needed + // NOTE: add args + + if (narg > 0) error->all(FLERR, "Illegal mdi engine command"); + + // check requirements for LAMMPS to work with MDI as an engine + + if (atom->tag_enable == 0) + error->all(FLERR, "Cannot use mdi engined without atom IDs"); + + if (atom->natoms && atom->tag_consecutive() == 0) + error->all(FLERR, "mdi engine requires consecutive atom IDs"); + + if (strcmp(update->unit_style, "real") == 0) lmpunits = REAL; + else if (strcmp(update->unit_style, "metal") == 0) lmpunits = METAL; + else lmpunits = NATIVE; + + // confirm LAMMPS is being run as an engine + + int role; + MDI_Get_role(&role); + if (role != MDI_ENGINE) + error->all(FLERR, + "Must invoke LAMMPS as an MDI engine to use mdi/engine command"); + + // if the mdi/engine fix is not already present, add it now + // NOTE: make this optional above + + //int ifix = modify->find_fix_by_style("mdi/engine"); + //bool added_mdi_engine_fix = false; + //if (ifix < 0) { + // modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine"); + // added_mdi_engine_fix = true; + // } + + // identify the mdi_engine fix + + //ifix = modify->find_fix_by_style("mdi/engine"); + //mdi_fix = static_cast(modify->fix[ifix]); + //mdi_fix->mdi_engine = this; + + // root = 1 for proc 0, otherwise 0 + + root = (comm->me == 0) ? 1 : 0; + + // MDI setup + + mode = DEFAULT; + node_match = true; + exit_command = false; + + mdicmd = new char[MDI_COMMAND_LENGTH]; + node_engine = new char[MDI_COMMAND_LENGTH]; + strncpy(node_engine,"@DEFAULT",MDI_COMMAND_LENGTH); + node_driver = new char[MDI_COMMAND_LENGTH]; + strncpy(node_driver,"\0",MDI_COMMAND_LENGTH); + + // create computes for KE. PE, pressure + + id_ke = utils::strdup(std::string("MDI_ENGINE") + "_ke"); + modify->add_compute(fmt::format("{} all ke", id_ke)); + + id_pe = utils::strdup(std::string("MDI_ENGINE") + "_pe"); + modify->add_compute(fmt::format("{} all pe", id_pe)); + + id_press = utils::strdup(std::string("MDI_ENGINE") + "_press"); + modify->add_compute(fmt::format("{} all pressure thermo_temp", id_press)); + + // set unit conversion factors + + unit_conversions(); + + // store pointers to the new computes + + int icompute_ke = modify->find_compute(id_ke); + int icompute_pe = modify->find_compute(id_pe); + int icompute_press = modify->find_compute(id_press); + + ke = modify->compute[icompute_ke]; + pe = modify->compute[icompute_pe]; + press = modify->compute[icompute_press]; + + // irregular class and data structs used by MDI + + irregular = new Irregular(lmp); + + buf1 = nullptr; + buf3 = nullptr; + ibuf1 = nullptr; + maxbuf = 0; + + // define MDI commands that LAMMPS engine recognizes + + mdi_commands(); + + // one-time operation to establish a connection with the driver + + MDI_Accept_communicator(&mdicomm); + if (mdicomm <= 0) error->all(FLERR, "Unable to connect to MDI driver"); + + // endless engine loop, responding to driver commands + + while (1) { + + // top-level mdi engine only recognizes three nodes + // DEFAULT, INIT_MD, INIT_OPTG + + engine_node("@DEFAULT"); + + // MDI commands for dynamics or minimization + + if (strcmp(mdicmd,"@INIT_MD") == 0) { + mdi_md(); + if (strcmp(mdicmd,"EXIT")) break; + + } else if (strcmp(mdicmd,"@INIT_OPTG") == 0) { + mdi_optg(); + if (strcmp(mdicmd,"EXIT")) break; + + } else if (strcmp(mdicmd,"EXIT") == 0) { + break; + + } else + error->all(FLERR,fmt::format("MDI node exited with invalid command: {}" + ,mdicmd)); + } + + // clean up + + delete [] mdicmd; + delete [] node_engine; + delete [] node_driver; + + modify->delete_compute(id_pe); + modify->delete_compute(id_ke); + modify->delete_compute(id_press); + delete irregular; + + memory->destroy(buf3); + memory->destroy(buf1); + memory->destroy(ibuf1); + + // remove mdi/engine fix that mdi/engine instantiated + // NOTE: make this optional + + //if (added_mdi_engine_fix) modify->delete_fix("MDI_ENGINE_INTERNAL"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::engine_node(const char *node) +{ + int ierr; + + // do not process commands if engine and driver are not at same node + + strncpy(node_engine,node,MDI_COMMAND_LENGTH); + if (strcmp(node_driver,"\0") != 0 && strcmp(node_driver,node_engine) != 0) + node_match = false; + + // respond to commands from the driver + + while (!exit_command && node_match) { + + // read the next command from the driver + // all procs call this, but only proc 0 receives the command + + ierr = MDI_Recv_command(mdicmd,mdicomm); + if (ierr) error->all(FLERR,"MDI: Unable to receive command from driver"); + + // broadcast command to the other MPI tasks + + MPI_Bcast(mdicmd,MDI_COMMAND_LENGTH,MPI_CHAR,0,world); + + // execute the command + + execute_command(mdicmd,mdicomm); + + // check if driver node is now something other than engine node + + if (strcmp(node_driver,"\0") != 0 && strcmp(node_driver,node_engine) != 0) + node_match = false; + } + + // node exit was triggered so reset node exit flag + + node_match = true; +} + +/* ---------------------------------------------------------------------- + process a single driver command + called by engine_node() in loop + also called by MDI itself via lib::lammps_execute_mdi_command() + when LAMMPS is running as a plugin +---------------------------------------------------------------------- */ + +int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) +{ + int ierr; + + // confirm this command is supported at this node + + int command_exists = 1; + if (root) { + ierr = MDI_Check_command_exists(node_engine,command,MDI_COMM_NULL, + &command_exists); + if (ierr) + error->one(FLERR, + "MDI: Unable to check whether current command is supported"); + } + + MPI_Bcast(&command_exists,1,MPI_INT,0,world); + if (!command_exists) + error->all(FLERR, "MDI: Received a command unsupported by engine node"); + + // respond to each possible driver command + + if (strcmp(command, ">NATOMS") == 0) { + // NOTE: needs to be 64-bit value or copied into 64-bit value + ierr = MDI_Recv((char *) &atom->natoms,1,MDI_INT,mdicomm); + if (ierr) + error->all(FLERR, "MDI: Unable to receive number of atoms from driver"); + MPI_Bcast(&atom->natoms, 1, MPI_INT, 0, world); + + } else if (strcmp(command, "natoms; + ierr = MDI_Send((char *) &mdi_natoms, 1, MDI_INT64_T, mdicomm); + if (ierr != 0) + error->all(FLERR, "MDI: Unable to send number of atoms to driver"); + + } else if (strcmp(command, "ntypes, 1, MDI_INT, mdicomm); + if (ierr != 0) + error->all(FLERR, "MDI: Unable to send number of atom types to driver"); + + } else if (strcmp(command, "CELL") == 0) { + receive_cell(); + + } else if (strcmp(command, "CELL_DISPL") == 0) { + receive_celldispl(); + + } else if (strcmp(command, ">COORDS") == 0) { + receive_double3(COORD,0); + + } else if (strcmp(command, "FORCES") == 0) { + receive_double3(FORCE,0); + + } else if (strcmp(command, ">+FORCES") == 0) { + receive_double3(FORCE,1); + + } else if (strcmp(command, "all(FLERR, "MDI: MDI engine is already performing a simulation"); + mode = MD; + node_match = false; + + } else if (strcmp(command,"@INIT_OPTG") == 0) { + if (mode != DEFAULT) + error->all(FLERR, "MDI: MDI engine is already performing a simulation"); + mode = OPT; + node_match = false; + + } else if (strcmp(command,"@") == 0) { + strncpy(node_driver,"\0",MDI_COMMAND_LENGTH); + node_match = false; + + } else if (strcmp(command,"<@") == 0) { + ierr = MDI_Send(node_engine,MDI_NAME_LENGTH,MDI_CHAR,mdicomm); + if (ierr) error->all(FLERR,"MDI: Unable to send node to driver"); + + } else if (strcmp(command,"@DEFAULT") == 0) { + mode = DEFAULT; + + strncpy(node_driver,"@DEFAULT",MDI_COMMAND_LENGTH); + node_match = false; + + // are we in the middle of a geometry optimization? + if (mode == OPT) { + // ensure that the energy and force tolerances are met + update->etol = std::numeric_limits::max(); + update->ftol = std::numeric_limits::max(); + + // set the maximum number of force evaluations to 0 + update->max_eval = 0; + } + + } else if (strcmp(command,"@COORDS") == 0) { + strncpy(node_driver,"@COORDS",MDI_COMMAND_LENGTH); + node_match = false; + + } else if (strcmp(command,"@FORCES") == 0) { + strncpy(node_driver,"@FORCES",MDI_COMMAND_LENGTH); + node_match = false; + + // exit command + + } else if (strcmp(command, "EXIT") == 0) { + exit_command = true; + + // are we in the middle of a geometry optimization? + // if so, ensure energy and force tolerances are met + // set the maximum number of force evaluations to 0 + + if (mode == OPT) { + update->etol = std::numeric_limits::max(); + update->ftol = std::numeric_limits::max(); + update->max_eval = 0; + } + + // ------------------------------------------------------- + // custom LAMMPS commands + // ------------------------------------------------------- + + } else if (strcmp(command, "LENGTH") == 0) { + length_command(); + } else if (strcmp(command, "COMMAND") == 0) { + single_command(); + } else if (strcmp(command, "COMMANDS") == 0) { + many_commands(); + } else if (strcmp(command, "INFILE") == 0) { + infile(); + } else if (strcmp(command, "EVAL") == 0) { + evaluate(); + } else if (strcmp(command, "RESET_BOX") == 0) { + reset_box(); + } else if (strcmp(command, "CREATE_ATOM") == 0) { + create_atoms(); + } else if (strcmp(command, "all(FLERR, "MDI: Unknown command from driver"); + } + + return 0; +} + +/* ---------------------------------------------------------------------- + define which MDI commands the LAMMPS engine recognizes at which node + standard MDI commands and custom LAMMPS commands +---------------------------------------------------------------------- */ + +void MDIEngine2::mdi_commands() +{ + // ------------------------------------ + // commands and nodes that an MDI-compliant MD code supports + // ------------------------------------ + + // default node and its commands + + MDI_Register_node("@DEFAULT"); + MDI_Register_command("@DEFAULT", "<@"); + MDI_Register_command("@DEFAULT", "CELL"); + MDI_Register_command("@DEFAULT", ">CELL_DISPL"); + MDI_Register_command("@DEFAULT", ">COORDS"); + MDI_Register_command("@DEFAULT", "@INIT_MD"); + MDI_Register_command("@DEFAULT", "@INIT_OPTG"); + MDI_Register_command("@DEFAULT", "EXIT"); + + // node for setting up and running a dynamics simulation + + MDI_Register_node("@INIT_MD"); + MDI_Register_command("@INIT_MD", "<@"); + MDI_Register_command("@INIT_MD", "CELL"); + MDI_Register_command("@INIT_MD", ">CELL_DISPL"); + MDI_Register_command("@INIT_MD", ">COORDS"); + MDI_Register_command("@INIT_MD", ">FORCES"); + MDI_Register_command("@INIT_MD", ">+FORCES"); + MDI_Register_command("@INIT_MD", "@"); + MDI_Register_command("@INIT_MD", "@COORDS"); + MDI_Register_command("@INIT_MD", "@DEFAULT"); + MDI_Register_command("@INIT_MD", "@FORCES"); + MDI_Register_command("@INIT_MD", "EXIT"); + + // node for setting up and running a minimization + + MDI_Register_node("@INIT_OPTG"); + MDI_Register_command("@INIT_OPTG", "<@"); + MDI_Register_command("@INIT_OPTG", "CELL"); + MDI_Register_command("@INIT_OPTG", ">CELL_DISPL"); + MDI_Register_command("@INIT_OPTG", ">COORDS"); + MDI_Register_command("@INIT_OPTG", ">FORCES"); + MDI_Register_command("@INIT_OPTG", ">+FORCES"); + MDI_Register_command("@INIT_OPTG", "@"); + MDI_Register_command("@INIT_OPTG", "@COORDS"); + MDI_Register_command("@INIT_OPTG", "@DEFAULT"); + MDI_Register_command("@INIT_OPTG", "@FORCES"); + MDI_Register_command("@INIT_OPTG", "EXIT"); + + // node at POST_FORCE location in timestep + + MDI_Register_node("@FORCES"); + MDI_Register_callback("@FORCES", ">FORCES"); + MDI_Register_callback("@FORCES", ">+FORCES"); + MDI_Register_command("@FORCES", "<@"); + MDI_Register_command("@FORCES", "CELL"); + MDI_Register_command("@FORCES", ">CELL_DISPL"); + MDI_Register_command("@FORCES", ">COORDS"); + MDI_Register_command("@FORCES", ">FORCES"); + MDI_Register_command("@FORCES", ">+FORCES"); + MDI_Register_command("@FORCES", "@"); + MDI_Register_command("@FORCES", "@COORDS"); + MDI_Register_command("@FORCES", "@DEFAULT"); + MDI_Register_command("@FORCES", "@FORCES"); + MDI_Register_command("@FORCES", "EXIT"); + + // node at POST_INTEGRATE location in timestep + + MDI_Register_node("@COORDS"); + MDI_Register_command("@COORDS", "<@"); + MDI_Register_command("@COORDS", "CELL"); + MDI_Register_command("@COORDS", ">CELL_DISPL"); + MDI_Register_command("@COORDS", ">COORDS"); + MDI_Register_command("@COORDS", ">FORCES"); + MDI_Register_command("@COORDS", ">+FORCES"); + MDI_Register_command("@COORDS", "@"); + MDI_Register_command("@COORDS", "@COORDS"); + MDI_Register_command("@COORDS", "@DEFAULT"); + MDI_Register_command("@COORDS", "@FORCES"); + MDI_Register_command("@COORDS", "EXIT"); + + // ------------------------------------ + // custom commands and nodes which LAMMPS adds support for + // max length for a command is current 11 chars in MDI + // ------------------------------------ + + MDI_Register_command("@DEFAULT", "LENGTH"); + MDI_Register_command("@DEFAULT", "COMMAND"); + MDI_Register_command("@DEFAULT", "COMMANDS"); + MDI_Register_command("@DEFAULT", "INFILE"); + MDI_Register_command("@DEFAULT", "EVAL"); + MDI_Register_command("@DEFAULT", "RESET_BOX"); + MDI_Register_command("@DEFAULT", "CREATE_ATOM"); + MDI_Register_command("@DEFAULT", "whichflag = 1; + timer->init_timeout(); + update->nsteps = 1; + update->ntimestep = 0; + update->firststep = update->ntimestep; + update->laststep = update->ntimestep + update->nsteps; + update->beginstep = update->firststep; + update->endstep = update->laststep; + + lmp->init(); + + // engine is now at @INIT_MD node + + engine_node("@INIT_MD"); + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + + // setup the MD simulation + + update->integrate->setup(1); + engine_node("@FORCES"); + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + + // run MD one step at a time + + while (1) { + update->whichflag = 1; + timer->init_timeout(); + update->nsteps += 1; + update->laststep += 1; + update->endstep = update->laststep; + output->next = update->ntimestep + 1; + + // single MD timestep + + update->integrate->run(1); + + // done with MD if driver sends @DEFAULT or EXIT + + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + } +} + +/* ---------------------------------------------------------------------- + perform minimization under control of driver +---------------------------------------------------------------------- */ + +void MDIEngine2::mdi_optg() +{ + // initialize an energy minization + + Minimize *minimizer = new Minimize(lmp); + + // setup the minimizer in a way that ensures optimization + // will continue until MDI driver exits + + update->etol = std::numeric_limits::min(); + update->ftol = std::numeric_limits::min(); + update->nsteps = std::numeric_limits::max(); + update->max_eval = std::numeric_limits::max(); + + update->whichflag = 2; + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->firststep + update->nsteps; + + lmp->init(); + + // engine is now at @INIT_OPTG node + + engine_node("@INIT_OPTG"); + + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + + // setup the minimization + + update->minimize->setup(); + + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + + // Start a minimization, which is configured to run (essentially) + // infinite steps. When the driver sends the EXIT command, + // the minimizer's energy and force tolerances are set to + // extremely large values, causing the minimization to end. + + update->minimize->iterate(update->nsteps); + + // return if driver sends @DEFAULT or EXIT + + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + + error->all(FLERR, + fmt::format("MDI reached end of OPTG simulation " + "with invalid command: {}",mdicmd)); +} + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// responses to standard MDI driver commands +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + +/* ---------------------------------------------------------------------- + receive vector of 1 double for all atoms + atoms are ordered by atomID, 1 to Natoms + assumes all atoms already exist +---------------------------------------------------------------------- */ + +void MDIEngine2::receive_double1(int which) +{ + reallocate(); + + int ierr = MDI_Recv((char *) buf1,atom->natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: Unable to receive double1 data from driver"); + MPI_Bcast(buf1,atom->natoms,MPI_DOUBLE,0,world); + + // extract onwed atom value + // use atomID to index into ordered buf3 + + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + if (which == CHARGE) { + double *q = atom->q; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + q[i] = buf1[ilocal]; + } + } +} + +/* ---------------------------------------------------------------------- + receive vector of 1 int for all atoms + atoms are ordered by atomID, 1 to Natoms + assumes all atoms already exist +---------------------------------------------------------------------- */ + +void MDIEngine2::receive_int1(int which) +{ + reallocate(); + + int ierr = MDI_Recv((char *) ibuf1,atom->natoms,MDI_INT,mdicomm); + if (ierr) error->all(FLERR,"MDI: Unable to receive double1 data from driver"); + MPI_Bcast(ibuf1,atom->natoms,MPI_INT,0,world); + + // extract onwed atom value + // use atomID to index into ordered buf3 + + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + if (which == TYPE) { + int *type = atom->type; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + type[i] = ibuf1[ilocal]; + } + } +} + +/* ---------------------------------------------------------------------- + receive vector of 3 doubles for all atoms + atoms are ordered by atomID, 1 to Natoms + assumes all atoms already exist + for which = COORD, assumes atom displacement is small +---------------------------------------------------------------------- */ + +void MDIEngine2::receive_double3(int which, int addflag) +{ + reallocate(); + + int ierr = MDI_Recv((char *) buf3,3*atom->natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: Unable to receive double3 data from driver"); + MPI_Bcast(buf3,3*atom->natoms,MPI_DOUBLE,0,world); + + // extract owned atom values + // use atomID to index into ordered buf3 + + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + if (which == COORD) { + double **x = atom->x; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + x[i][0] = buf3[3*ilocal+0] * mdi2lmp_length; + x[i][1] = buf3[3*ilocal+1] * mdi2lmp_length; + x[i][2] = buf3[3*ilocal+2] * mdi2lmp_length; + } + } else if (which == FORCE) { + if (!addflag) { + double **f = atom->f; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + f[i][0] = buf3[3*ilocal+0] * mdi2lmp_force; + f[i][1] = buf3[3*ilocal+1] * mdi2lmp_force; + f[i][2] = buf3[3*ilocal+2] * mdi2lmp_force; + } + } else { + double **f = atom->f; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + f[i][0] += buf3[3*ilocal+0] * mdi2lmp_force; + f[i][1] += buf3[3*ilocal+1] * mdi2lmp_force; + f[i][2] += buf3[3*ilocal+2] * mdi2lmp_force; + } + } + } else if (which == VELOCITY) { + double **v = atom->v; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + v[i][0] = buf3[3*ilocal+0] * mdi2lmp_velocity; + v[i][1] = buf3[3*ilocal+1] * mdi2lmp_velocity; + v[i][2] = buf3[3*ilocal+2] * mdi2lmp_velocity; + } + } + + /* + // ensure atoms are in current box & update box via shrink-wrap + // has to be be done before invoking Irregular::migrate_atoms() + // since it requires atoms be inside simulation box + + if (domain->triclinic) domain->x2lamda(atom->nlocal); + domain->pbc(); + domain->reset_box(); + if (domain->triclinic) domain->lamda2x(atom->nlocal); + + // move atoms to new processors via irregular() only needed if + // migrate_check() says an atom moves too far + + if (domain->triclinic) domain->x2lamda(atom->nlocal); + if (irregular->migrate_check()) irregular->migrate_atoms(); + if (domain->triclinic) domain->lamda2x(atom->nlocal); + */ +} + +/* ---------------------------------------------------------------------- + send vector of 1 double for all atoms + atoms are ordered by atomID, 1 to Natoms +---------------------------------------------------------------------- */ + +void MDIEngine2::send_double1(int which) +{ + reallocate(); + memset(buf1,0,atom->natoms*sizeof(double)); + + // use atomID to index into ordered buf1 + + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + if (which == CHARGE) { + double *q = atom->q; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + buf1[ilocal] = q[i]; + } + } else if (which == MASS) { + double *mass = atom->mass; + double *rmass = atom->rmass; + if (rmass) { + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + buf1[ilocal] = rmass[i]; + } + } else { + int *type = atom->type; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + buf1[ilocal] = mass[type[i]]; + } + } + } + + MPI_Reduce(buf1,buf1all,atom->natoms,MPI_DOUBLE,MPI_SUM,0,world); + + int ierr = MDI_Send((char *) buf1all,atom->natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send double1 data to driver"); +} + +/* ---------------------------------------------------------------------- + send vector of 1 int for all atoms + atoms are ordered by atomID, 1 to Natoms +---------------------------------------------------------------------- */ + +void MDIEngine2::send_int1(int which) +{ + reallocate(); + memset(ibuf1,0,atom->natoms*sizeof(int)); + + // use atomID to index into ordered buf1 + + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + if (which == TYPE) { + int *type = atom->type; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + ibuf1[ilocal] = type[i]; + } + } + + MPI_Reduce(ibuf1,ibuf1all,atom->natoms,MPI_INT,MPI_SUM,0,world); + + int ierr = MDI_Send((char *) ibuf1all,atom->natoms,MDI_INT,mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send int1 data to driver"); +} + +/* ---------------------------------------------------------------------- + send vector of 3 doubles for all atoms + atoms are ordered by atomID, 1 to Natoms +---------------------------------------------------------------------- */ + +void MDIEngine2::send_double3(int which) +{ + reallocate(); + memset(buf3,0,3*atom->natoms*sizeof(double)); + + // use atomID to index into ordered buf3 + + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + if (which == COORD) { + double **x = atom->x; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + buf3[3*ilocal+0] = x[i][0] * lmp2mdi_length; + buf3[3*ilocal+1] = x[i][1] * lmp2mdi_length; + buf3[3*ilocal+2] = x[i][2] * lmp2mdi_length; + } + } else if (which == FORCE) { + double **f = atom->f; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + buf3[3*ilocal+0] = f[i][0] * lmp2mdi_force; + buf3[3*ilocal+1] = f[i][1] * lmp2mdi_force; + buf3[3*ilocal+2] = f[i][2] * lmp2mdi_force; + } + } else if (which == VELOCITY) { + double **f = atom->f; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + buf3[3*ilocal+0] = f[i][0] * lmp2mdi_velocity; + buf3[3*ilocal+1] = f[i][1] * lmp2mdi_velocity; + buf3[3*ilocal+2] = f[i][2] * lmp2mdi_velocity; + } + } + + MPI_Reduce(buf3,buf3all,3*atom->natoms,MPI_DOUBLE,MPI_SUM,0,world); + + int ierr = MDI_Send((char *) buf3all,3*atom->natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send double3 data to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_labels() +{ + char *labels = new char[atom->natoms * MDI_LABEL_LENGTH]; + memset(labels, ' ', atom->natoms * MDI_LABEL_LENGTH); + + for (int iatom = 0; iatom < atom->natoms; iatom++) { + std::string label = std::to_string(atom->type[iatom]); + int label_len = std::min(int(label.length()), MDI_LABEL_LENGTH); + strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); + } + + int ierr = MDI_Send(labels, atom->natoms * MDI_LABEL_LENGTH, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send atom labels to driver"); + + delete[] labels; +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_energy() +{ + double convert = 1.0; + + double potential_energy = pe->compute_scalar(); + double kinetic_energy = ke->compute_scalar(); + double total_energy = potential_energy + kinetic_energy; + total_energy *= lmp2mdi_energy; + + int ierr = MDI_Send((char *) &total_energy,1,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send total energy to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_pe() +{ + double potential_energy = pe->compute_scalar(); + potential_energy *= lmp2mdi_energy; + + int ierr = MDI_Send((char *) &potential_energy,1,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send potential energy to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_ke() +{ + double kinetic_energy = ke->compute_scalar(); + kinetic_energy *= lmp2mdi_energy; + + int ierr = MDI_Send((char *) &kinetic_energy,1,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: Unable to send kinetic energy to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_cell() +{ + double celldata[9]; + + celldata[0] = domain->boxhi[0] - domain->boxlo[0]; + celldata[1] = 0.0; + celldata[2] = 0.0; + celldata[3] = domain->xy; + celldata[4] = domain->boxhi[1] - domain->boxlo[1]; + celldata[5] = 0.0; + celldata[6] = domain->xz; + celldata[7] = domain->yz; + celldata[8] = domain->boxhi[2] - domain->boxlo[2]; + + for (int icell = 0; icell < 9; icell++) + celldata[icell] *= lmp2mdi_length; + + int ierr = MDI_Send((char *) celldata,9,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send cell dimensions to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::receive_cell() +{ + double celldata[9]; + + int ierr = MDI_Recv((char *) celldata,9,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send cell dimensions to driver"); + MPI_Bcast(&celldata[0],9,MPI_DOUBLE,0,world); + + for (int icell = 0; icell < 9; icell++) + celldata[icell] /= mdi2lmp_length; + + // require the new cell vector be orthogonal (for now) + + double small = std::numeric_limits::min(); + if (abs(celldata[1]) > small or abs(celldata[2]) > small or + abs(celldata[3]) > small or + abs(celldata[5]) > small or abs(celldata[6]) > small or + abs(celldata[7]) > small) { + error->all(FLERR, + "MDI: LAMMPS currently only supports the >CELL command " + "for orthogonal cell vectors"); + } + + domain->boxhi[0] = celldata[0] + domain->boxlo[0]; + domain->boxhi[1] = celldata[4] + domain->boxlo[1]; + domain->boxhi[2] = celldata[8] + domain->boxlo[2]; + domain->xy = 0.0; + domain->xz = 0.0; + domain->yz = 0.0; +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_celldispl() +{ + double celldata[3]; + + celldata[0] = domain->boxlo[0]; + celldata[1] = domain->boxlo[1]; + celldata[2] = domain->boxlo[2]; + + for (int icell = 0; icell < 3; icell++) + celldata[icell] *= lmp2mdi_length; + + int ierr = MDI_Send((char *) celldata,3,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send cell displacement to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::receive_celldispl() +{ + double celldata[3]; + int ierr = MDI_Recv((char *) celldata,3,MDI_DOUBLE,mdicomm); + if (ierr) + error->all(FLERR, "MDI: Unable to receive cell displacement from driver"); + MPI_Bcast(&celldata[0],3,MPI_DOUBLE,0,world); + + for (int icell = 0; icell < 3; icell++) + celldata[icell] *= mdi2lmp_length; + + double old_boxlo[3]; + old_boxlo[0] = domain->boxlo[0]; + old_boxlo[1] = domain->boxlo[1]; + old_boxlo[2] = domain->boxlo[2]; + + // adjust the values of boxlo and boxhi for the new cell displacement vector + + domain->boxlo[0] = celldata[0]; + domain->boxlo[1] = celldata[1]; + domain->boxlo[2] = celldata[2]; + domain->boxhi[0] += domain->boxlo[0] - old_boxlo[0]; + domain->boxhi[1] += domain->boxlo[1] - old_boxlo[1]; + domain->boxhi[2] += domain->boxlo[2] - old_boxlo[2]; +} + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// responses to custom LAMMPS MDI commands +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + +/* ---------------------------------------------------------------------- + LENGTH command + store received value in length_param + for use by other commands, e.g. that send strings +---------------------------------------------------------------------- */ + +void MDIEngine2::length_command() +{ + int ierr = MDI_Recv(&length_param,1,MDI_INT,mdicomm); + if (ierr) error->all(FLERR, "MDI LENGTH error"); + MPI_Bcast(&length_param,1,MPI_INT,0,world); +} + +/* ---------------------------------------------------------------------- + COMMAND command + store received value as string of length length_param + invoke as a LAMMPS command +---------------------------------------------------------------------- */ + +void MDIEngine2::single_command() +{ + char *cmd = new char[length_param+1]; + int ierr = MDI_Recv(cmd,length_param+1,MDI_CHAR,mdicomm); + if (ierr) error->all(FLERR,"MDI COMMAND error"); + MPI_Bcast(cmd,length_param+1,MPI_CHAR,0,world); + cmd[length_param+1] = '\0'; + + lammps_command(lmp,cmd); + + delete [] cmd; +} + +/* ---------------------------------------------------------------------- + COMMANDS command + store received value as multi-line string of length length_param + invoke as multiple LAMMPS commands +---------------------------------------------------------------------- */ + +void MDIEngine2::many_commands() +{ + char *cmds = new char[length_param+1]; + int ierr = MDI_Recv(cmds, length_param+1, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI COMMANDS error"); + MPI_Bcast(cmds,length_param+1,MPI_CHAR,0,world); + cmds[length_param+1] = '\0'; + + lammps_commands_string(lmp,cmds); + + delete [] cmds; +} + +/* ---------------------------------------------------------------------- + INFILE command + store received value as infile of length length_param + invoke as a LAMMPS input script +---------------------------------------------------------------------- */ + +void MDIEngine2::infile() +{ + char *infile = new char[length_param+1]; + int ierr = MDI_Recv(infile,length_param+1,MDI_CHAR,mdicomm); + if (ierr) error->all(FLERR, "MDI INFILE error"); + MPI_Bcast(infile,length_param+1,MPI_CHAR,0,world); + infile[length_param+1] = '\0'; + + lammps_file(lmp,infile); + + delete [] infile; +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::evaluate() +{ + if (neighbor->ago < 0) { + update->whichflag = 1; + lmp->init(); + update->integrate->setup(0); + + } else { + pe->addstep(update->ntimestep); + press->addstep(update->ntimestep); + + int nflag = neighbor->decide(); + if (nflag == 0) { + comm->forward_comm(); + update->integrate->setup_minimal(0); + } else { + update->integrate->setup_minimal(1); + } + } +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::reset_box() +{ + int ierr; + double boxlo[3],boxhi[3],tilts[3]; + ierr = MDI_Recv(boxlo, 3, MDI_DOUBLE, mdicomm); + ierr = MDI_Recv(boxhi, 3, MDI_DOUBLE, mdicomm); + ierr = MDI_Recv(tilts, 3, MDI_DOUBLE, mdicomm); + // ierr check? + MPI_Bcast(boxlo, 3, MPI_DOUBLE, 0, world); + MPI_Bcast(boxhi, 3, MPI_DOUBLE, 0, world); + MPI_Bcast(tilts, 3, MPI_DOUBLE, 0, world); + + lammps_reset_box(lmp,boxlo,boxhi,tilts[0],tilts[1],tilts[2]); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::create_atoms() +{ + int ierr; + int natoms; + ierr = MDI_Recv(&natoms, 1, MDI_INT, mdicomm); + // ierr checks everywhere? + MPI_Bcast(&natoms, 1, MPI_INT, 0, world); + + tagint *id = nullptr; + int *type = nullptr; + double *x = nullptr; + double *v = nullptr; + imageint *image = nullptr; + + while (1) { + char label; + ierr = MDI_Recv(&label, 1, MDI_CHAR, mdicomm); + MPI_Bcast(&label, 1, MPI_CHAR, 0, world); + + if (label == '0') break; + + if (label == 'i') { + id = new tagint[natoms]; + ierr = MDI_Recv(id, natoms, MDI_INT, mdicomm); + MPI_Bcast(id, natoms, MPI_INT, 0, world); + } else if (label == 't') { + type = new int[natoms]; + ierr = MDI_Recv(type, natoms, MDI_INT, mdicomm); + MPI_Bcast(type, natoms, MPI_INT, 0, world); + } else if (label == 'x') { + x = new double[3*natoms]; + ierr = MDI_Recv(x, 3*natoms, MDI_DOUBLE, mdicomm); + MPI_Bcast(x, 3*natoms, MPI_DOUBLE, 0, world); + } else if (label == 'v') { + v = new double[3*natoms]; + ierr = MDI_Recv(v, 3*natoms, MDI_DOUBLE, mdicomm); + MPI_Bcast(v, 3*natoms, MPI_DOUBLE, 0, world); + } else if (label == 'i') { + image = new imageint[natoms]; + ierr = MDI_Recv(image, natoms, MDI_INT, mdicomm); + MPI_Bcast(image, natoms, MPI_INT, 0, world); + } + } + + if (!x || !type) + error->all(FLERR,"MDI create_atoms: did not receive atom coords or types"); + + int ncreate = lammps_create_atoms(lmp,natoms,id,type,x,v,image,1); + + if (ncreate != natoms) + error->all(FLERR, "MDI create_atoms: created atoms != sent atoms"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_pressure() +{ + double pressure = press->compute_scalar(); + pressure *= lmp2mdi_pressure; + + int ierr = MDI_Send(&pressure, 1, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send pressure to driver"); +} + +/* ---------------------------------------------------------------------- */ + +void MDIEngine2::send_ptensor() +{ + double pvector[6]; + press->compute_vector(); + for (int i = 0; i < 6; i++) + pvector[i] = press->vector[i] * lmp2mdi_pressure; + + int ierr = MDI_Send(pvector,6,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to send ptensor to driver"); +} + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// utility methods +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + +void MDIEngine2::reallocate() +{ + if (maxbuf > atom->natoms) return; + + if (3*atom->natoms > MAXSMALLINT) + error->all(FLERR,"Natoms is too large to use with mdi engine"); + + maxbuf = atom->natoms; + + memory->destroy(ibuf1); + memory->destroy(buf1); + memory->destroy(buf3); + + memory->destroy(ibuf1all); + memory->destroy(buf1all); + memory->destroy(buf3all); + + memory->create(ibuf1,maxbuf,"mdi:ibuf1"); + memory->create(buf1,maxbuf,"mdi:buf1"); + memory->create(buf3,3*maxbuf,"mdi:buf3"); + + memory->create(ibuf1all,maxbuf,"mdi:ibuf1all"); + memory->create(buf1all,maxbuf,"mdi:buf1all"); + memory->create(buf3all,3*maxbuf,"mdi:buf3all"); +} + + +void MDIEngine2::unit_conversions() +{ + double angstrom_to_bohr,kelvin_to_hartree,ev_to_hartree; + + MDI_Conversion_factor("angstrom","bohr",&angstrom_to_bohr); + MDI_Conversion_factor("kelvin_energy","hartree",&kelvin_to_hartree); + MDI_Conversion_factor("electron_volt","hartree",&ev_to_hartree); + + // length units + + mdi2lmp_length = 1.0; + lmp2mdi_length = 1.0; + + if (lmpunits == REAL || lmpunits == METAL) { + lmp2mdi_length = angstrom_to_bohr; + mdi2lmp_length = 1.0 / angstrom_to_bohr; + } + + // energy units + + mdi2lmp_energy = 1.0; + lmp2mdi_energy = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_energy = kelvin_to_hartree / force->boltz; + mdi2lmp_energy = force->boltz / kelvin_to_hartree; + } else if (lmpunits == METAL) { + lmp2mdi_energy = ev_to_hartree; + mdi2lmp_energy = 1.0 / ev_to_hartree; + } + + // force units + + mdi2lmp_force = 1.0; + lmp2mdi_force = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_force = (kelvin_to_hartree / force->boltz) / angstrom_to_bohr; + mdi2lmp_force = 1.0 / lmp2mdi_force; + } else if (lmpunits == METAL) { + lmp2mdi_force = ev_to_hartree / angstrom_to_bohr; + mdi2lmp_force = angstrom_to_bohr / ev_to_hartree; + } + + // pressure units + + mdi2lmp_pressure = 1.0; + lmp2mdi_pressure = 1.0; + + // velocity units + + mdi2lmp_velocity = 1.0; + lmp2mdi_velocity = 1.0; +} diff --git a/src/MDI/mdi_engine2.h b/src/MDI/mdi_engine2.h new file mode 100644 index 0000000000..aeda3f823c --- /dev/null +++ b/src/MDI/mdi_engine2.h @@ -0,0 +1,128 @@ +/* -*- 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 COMMAND_CLASS +// clang-format off +CommandStyle(mdi,MDIEngine2); +// clang-format on +#else + +#ifndef LMP_MDI_ENGINE2_H +#define LMP_MDI_ENGINE2_H + +#include "command.h" +#include "mdi.h" + +namespace LAMMPS_NS { + +class MDIEngine2 : public Command { + public: + MDIEngine2(LAMMPS *lmp) : Command(lmp) {} + virtual ~MDIEngine2() {} + void command(int, char **); + + int execute_command(const char *command, MDI_Comm mdicomm); + void engine_node(const char *node); + + private: + int lmpunits; // REAL or METAL or NATIVE + int root; // 1 for proc 0, otherwise 0 + + // state of MDI engine + + int mode; // which mode engine is in (DEFAULT,MD,OPTG,etc) + char *mdicmd; // current MDI command being processed + char *node_engine; // which node engine is at + char *node_driver; // which node driver has requested + bool node_match; // true if driver and engine node currently match + bool exit_command; // true if EXIT command received from driver + + MDI_Comm mdicomm; + class FixMDIEngine2 *mdi_fix; + + char *id_ke,*id_pe,*id_press; + class Irregular *irregular; + class Minimize *minimizer; + class Compute *ke,*pe,*press; + + int length_param; // LENGTH command value used by other commands + + // unit conversion factors; + + double lmp2mdi_length,mdi2lmp_length; + double lmp2mdi_energy,mdi2lmp_energy; + double lmp2mdi_velocity,mdi2lmp_velocity; + double lmp2mdi_force,mdi2lmp_force; + double lmp2mdi_pressure,mdi2lmp_pressure; + double lmp2mdi_virial,mdi2lmp_virial; + + // buffers for MDI comm + + int maxbuf; + double *buf1,*buf1all; + double *buf3,*buf3all; + int *ibuf1,*ibuf1all; + + // class methods + + void mdi_engine(int, char **); + + void mdi_commands(); + void mdi_md(); + void mdi_optg(); + + void receive_double1(int); + void receive_int1(int); + void receive_double3(int, int); + void send_double1(int); + void send_int1(int); + void send_double3(int); + + void send_labels(); + + void send_energy(); + void send_pe(); + void send_ke(); + void send_cell(); + void receive_cell(); + void send_celldispl(); + void receive_celldispl(); + + void length_command(); + void single_command(); + void many_commands(); + void infile(); + void evaluate(); + void reset_box(); + void create_atoms(); + void send_pressure(); + void send_ptensor(); + + void unit_conversions(); + void reallocate(); +}; + +} + +#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. + +*/ diff --git a/src/comm.cpp b/src/comm.cpp index 17175f9517..1ec64c51c5 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -739,7 +739,8 @@ double Comm::get_comm_cutoff() error->warning(FLERR,"Communication cutoff adjusted to {}",maxcommcutoff); } - // Check maximum interval size for neighbor multi + // check maximum interval size for neighbor multi + if (neighbor->interval_collection_flag) { for (int i = 0; i < neighbor->ncollections; i++){ maxcommcutoff = MAX(maxcommcutoff, neighbor->collection2cut[i]); From a8a97962d2e207d4a5d1faa8a018fa320d2670fe Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 3 Sep 2021 15:50:17 -0600 Subject: [PATCH 004/130] more changes for AIMD testing --- src/MDI/fix_mdi_aimd.cpp | 233 +++++++++++++++++++-- src/MDI/fix_mdi_aimd.h | 25 ++- src/MDI/mdi_engine2.cpp | 436 ++++++++++++++++++++++++--------------- src/MDI/mdi_engine2.h | 6 +- 4 files changed, 507 insertions(+), 193 deletions(-) diff --git a/src/MDI/fix_mdi_aimd.cpp b/src/MDI/fix_mdi_aimd.cpp index f8ebcaac85..c2acc44c94 100644 --- a/src/MDI/fix_mdi_aimd.cpp +++ b/src/MDI/fix_mdi_aimd.cpp @@ -17,10 +17,14 @@ #include "comm.h" #include "domain.h" #include "force.h" +#include "memory.h" +#include "update.h" using namespace LAMMPS_NS; using namespace FixConst; +enum{NATIVE,REAL,METAL}; // LAMMPS units which MDI supports + /* ---------------------------------------------------------------------- */ FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : @@ -35,9 +39,40 @@ FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : virial_global_flag = 1; thermo_energy = thermo_virial = 1; + // check requirements for LAMMPS to work with MDI as an engine + + if (atom->tag_enable == 0) + error->all(FLERR, "Cannot use mdi engined without atom IDs"); + + if (atom->natoms && atom->tag_consecutive() == 0) + error->all(FLERR, "mdi engine requires consecutive atom IDs"); + + // confirm LAMMPS is being run as a driver + + int role; + MDI_Get_role(&role); + if (role != MDI_DRIVER) + error->all(FLERR,"Must invoke LAMMPS as an MDI driver to use fix mdi/aimd"); + + // storage for all atoms + + buf3 = buf3all = nullptr; + maxbuf = 0; + + // set unit conversion factors + + if (strcmp(update->unit_style, "real") == 0) lmpunits = REAL; + else if (strcmp(update->unit_style, "metal") == 0) lmpunits = METAL; + else lmpunits = NATIVE; + + unit_conversions(); + // connect to MDI engine - MDI_Accept_communicator(&engine); + MDI_Accept_communicator(&mdicomm); + if (mdicomm <= 0) error->all(FLERR, "Unable to connect to MDI engine"); + + nprocs = comm->nprocs; } /* ---------------------------------------------------------------------- */ @@ -46,7 +81,13 @@ FixMDIAimd::~FixMDIAimd() { // send exit command to engine - MDI_Send_command("EXIT",engine); + int ierr = MDI_Send_command("EXIT",mdicomm); + if (ierr) error->all(FLERR,"MDI: EXIT command"); + + // clean up + + memory->destroy(buf3); + memory->destroy(buf3all); } /* ---------------------------------------------------------------------- */ @@ -87,43 +128,117 @@ void FixMDIAimd::pre_reverse(int eflag, int /*vflag*/) void FixMDIAimd::post_force(int vflag) { + int ilocal,ierr; + double cell[9]; + int eflag = eflag_caller; ev_init(eflag,vflag); - // send current coords to MDI engine - // NOTE: need to gather them to proc 0 + // if simulation box dynamically changes, send current box to MDI engine - MDI_Send_command(">COORDS",engine); - MDI_Send(&atom->x[0][0],3*atom->nlocal,MDI_DOUBLE,engine); + if (domain->box_change_size || domain->box_change_shape) { + ierr = MDI_Send_command(">CELL_DISPL",mdicomm); + if (ierr) error->all(FLERR,"MDI: >CELL_DISPL command"); + cell[0] = domain->boxlo[0] * lmp2mdi_length; + cell[1] = domain->boxlo[1] * lmp2mdi_length; + cell[2] = domain->boxlo[2] * lmp2mdi_length; + ierr = MDI_Send(cell,3,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: >CELL_DISPL data"); + + ierr = MDI_Send_command(">CELL",mdicomm); + if (ierr) error->all(FLERR,"MDI: >CELL command"); + cell[0] = domain->boxhi[0] - domain->boxlo[0]; + cell[1] = 0.0; + cell[2] = 0.0; + cell[3] = domain->xy; + cell[4] = domain->boxhi[1] - domain->boxlo[1]; + cell[5] = 0.0; + cell[6] = domain->xz; + cell[7] = domain->yz; + cell[8] = domain->boxhi[2] - domain->boxlo[2]; + ierr = MDI_Send(cell,9,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: >CELL data"); + } + + // gather all coords, ordered by atomID + + reallocate(); + memset(buf3,0,3*atom->natoms*sizeof(double)); + + double **x = atom->x; + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + buf3[3*ilocal+0] = x[i][0] * lmp2mdi_length; + buf3[3*ilocal+1] = x[i][1] * lmp2mdi_length; + buf3[3*ilocal+2] = x[i][2] * lmp2mdi_length; + } + + MPI_Reduce(buf3,buf3all,3*atom->natoms,MPI_DOUBLE,MPI_SUM,0,world); + + // send current coords to MDI engine + + ierr = MDI_Send_command(">COORDS",mdicomm); + if (ierr) error->all(FLERR,"MDI: >COORDS command"); + ierr = MDI_Send(buf3all,3*atom->natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: >COORDS data"); // trigger engine to evaluate forces,energy,pressure for current system - MDI_Send_command("EVAL",engine); + ierr = MDI_Send_command("EVAL",mdicomm); + if (ierr) error->all(FLERR,"MDI: EVAL command"); - // request energy from MDI engine + // request forces from MDI engine - if (eflag_global) { - MDI_Send_command("all(FLERR,"MDI: natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: natoms,MPI_DOUBLE,0,world); + + // add forces to owned atoms + // use atomID to index into ordered buf3 + + double **f = atom->f; + + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + f[i][0] += buf3[3*ilocal+0] * mdi2lmp_force; + f[i][1] += buf3[3*ilocal+1] * mdi2lmp_force; + f[i][2] += buf3[3*ilocal+2] * mdi2lmp_force; } - // request pressure tensor from MDI engine, convert to virial + // optionally request energy from MDI engine + // divide by nprocs so each proc stores a portion + + if (eflag_global) { + ierr = MDI_Send_command("all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR,"MDI: xprd * domain->yprd * domain->zprd; - for (int i = 0; i < 6; i++) - virial[i] = ptensor[i] * volume / force->nktv2p; + for (int i = 0; i < 6; i++) { + ptensor[i] *= mdi2lmp_pressure; + virial[i] = ptensor[i] * volume / force->nktv2p / nprocs; + } } - - // request forces from MDI engine - // NOTE: need to scatter to procs, then add to my local forces - - MDI_Send_command("f[0][0],3*atom->nlocal,MDI_DOUBLE,engine); } /* ---------------------------------------------------------------------- */ @@ -141,3 +256,77 @@ double FixMDIAimd::compute_scalar() { return engine_energy; } + +/* ---------------------------------------------------------------------- + reallocate storage for all atoms if necessary +------------------------------------------------------------------------- */ + +void FixMDIAimd::reallocate() +{ + if (atom->natoms <= maxbuf) return; + + if (3*atom->natoms > MAXSMALLINT) + error->all(FLERR,"Natoms too large to use with fix mdi/aimd"); + + maxbuf = atom->natoms; + + memory->destroy(buf3); + memory->destroy(buf3all); + + memory->create(buf3,3*maxbuf,"mdi:buf3"); + memory->create(buf3all,3*maxbuf,"mdi:buf3all"); +} + +/* ---------------------------------------------------------------------- + MDI to/from LAMMPS conversion factors +------------------------------------------------------------------------- */ + +void FixMDIAimd::unit_conversions() +{ + double angstrom_to_bohr,kelvin_to_hartree,ev_to_hartree; + + MDI_Conversion_factor("angstrom","bohr",&angstrom_to_bohr); + MDI_Conversion_factor("kelvin_energy","hartree",&kelvin_to_hartree); + MDI_Conversion_factor("electron_volt","hartree",&ev_to_hartree); + + // length units + + mdi2lmp_length = 1.0; + lmp2mdi_length = 1.0; + + if (lmpunits == REAL || lmpunits == METAL) { + lmp2mdi_length = angstrom_to_bohr; + mdi2lmp_length = 1.0 / angstrom_to_bohr; + } + + // energy units + + mdi2lmp_energy = 1.0; + lmp2mdi_energy = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_energy = kelvin_to_hartree / force->boltz; + mdi2lmp_energy = force->boltz / kelvin_to_hartree; + } else if (lmpunits == METAL) { + lmp2mdi_energy = ev_to_hartree; + mdi2lmp_energy = 1.0 / ev_to_hartree; + } + + // force units + + mdi2lmp_force = 1.0; + lmp2mdi_force = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_force = (kelvin_to_hartree / force->boltz) / angstrom_to_bohr; + mdi2lmp_force = 1.0 / lmp2mdi_force; + } else if (lmpunits == METAL) { + lmp2mdi_force = ev_to_hartree / angstrom_to_bohr; + mdi2lmp_force = angstrom_to_bohr / ev_to_hartree; + } + + // pressure units + + mdi2lmp_pressure = 1.0; + lmp2mdi_pressure = 1.0; +} diff --git a/src/MDI/fix_mdi_aimd.h b/src/MDI/fix_mdi_aimd.h index 8ea62e1f1e..63db7266cf 100644 --- a/src/MDI/fix_mdi_aimd.h +++ b/src/MDI/fix_mdi_aimd.h @@ -39,10 +39,33 @@ class FixMDIAimd : public Fix { double compute_scalar(); private: + int nprocs; int eflag_caller; double engine_energy; + int lmpunits; + + // MDI communicator + + MDI_Comm mdicomm; + + // unit conversion factors + + double lmp2mdi_length,mdi2lmp_length; + double lmp2mdi_energy,mdi2lmp_energy; + double lmp2mdi_force,mdi2lmp_force; + double lmp2mdi_pressure,mdi2lmp_pressure; + double lmp2mdi_virial,mdi2lmp_virial; + + // buffers for MDI comm + + int maxbuf; + double *buf3,*buf3all; + + // methods + + void reallocate(); + void unit_conversions(); - MDI_Comm engine; }; } diff --git a/src/MDI/mdi_engine2.cpp b/src/MDI/mdi_engine2.cpp index df5aba7fa3..e55a7b44a0 100644 --- a/src/MDI/mdi_engine2.cpp +++ b/src/MDI/mdi_engine2.cpp @@ -29,7 +29,7 @@ #include "force.h" #include "group.h" #include "input.h" -#include "irregular.h" +//#include "irregular.h" #include "library.h" #include "memory.h" #include "min.h" @@ -45,20 +45,24 @@ using namespace LAMMPS_NS; -enum{NATIVE,REAL,METAL}; // LAMMPS units which MDI supports -enum{DEFAULT,MD,OPT}; // top-level MDI engine mode -enum{TYPE,CHARGE,MASS,COORD,VELOCITY,FORCE}; +enum{NATIVE,REAL,METAL}; // LAMMPS units which MDI supports +enum{DEFAULT,MD,OPT}; // top-level MDI engine mode + +// per-atom data which engine commands access + +enum{TYPE,CHARGE,MASS,COORD,VELOCITY,FORCE}; /* ---------------------------------------------------------------------- - mdi command: quit or engine + mdi command: engine + NOTE: may later have other MDI command variants? ---------------------------------------------------------------------- */ void MDIEngine2::command(int narg, char **arg) { - if (narg < 1) error->all(FLERR, "Illegal mdi command"); + if (narg < 1) error->all(FLERR,"Illegal mdi command"); if (strcmp(arg[0],"engine") == 0) mdi_engine(narg-1,&arg[1]); - else error->all(FLERR, "Illegal mdi command"); + else error->all(FLERR,"Illegal mdi command"); } /* ---------------------------------------------------------------------- @@ -72,34 +76,27 @@ void MDIEngine2::command(int narg, char **arg) void MDIEngine2::mdi_engine(int narg, char **arg) { - // args to choose what MDI nodes LAMMPS will interact with - // also whether a fix mdi/engine is needed - // NOTE: add args - - if (narg > 0) error->all(FLERR, "Illegal mdi engine command"); + if (narg > 0) error->all(FLERR,"Illegal mdi engine command"); // check requirements for LAMMPS to work with MDI as an engine if (atom->tag_enable == 0) - error->all(FLERR, "Cannot use mdi engined without atom IDs"); + error->all(FLERR,"Cannot use MDI engine without atom IDs"); if (atom->natoms && atom->tag_consecutive() == 0) - error->all(FLERR, "mdi engine requires consecutive atom IDs"); - - if (strcmp(update->unit_style, "real") == 0) lmpunits = REAL; - else if (strcmp(update->unit_style, "metal") == 0) lmpunits = METAL; - else lmpunits = NATIVE; + error->all(FLERR,"MDI engine requires consecutive atom IDs"); // confirm LAMMPS is being run as an engine int role; MDI_Get_role(&role); if (role != MDI_ENGINE) - error->all(FLERR, - "Must invoke LAMMPS as an MDI engine to use mdi/engine command"); + error->all(FLERR,"Must invoke LAMMPS as an MDI engine to use mdi engine"); - // if the mdi/engine fix is not already present, add it now - // NOTE: make this optional above + // NOTE: create this fix only when @INIT_MD is triggered? + // if not needed, I dont think it should be defined, + // otherwise it will be be invoked in other use cases + // and switch engine out of DEFAULT node ? //int ifix = modify->find_fix_by_style("mdi/engine"); //bool added_mdi_engine_fix = false; @@ -141,12 +138,6 @@ void MDIEngine2::mdi_engine(int narg, char **arg) id_press = utils::strdup(std::string("MDI_ENGINE") + "_press"); modify->add_compute(fmt::format("{} all pressure thermo_temp", id_press)); - // set unit conversion factors - - unit_conversions(); - - // store pointers to the new computes - int icompute_ke = modify->find_compute(id_ke); int icompute_pe = modify->find_compute(id_pe); int icompute_press = modify->find_compute(id_press); @@ -155,13 +146,22 @@ void MDIEngine2::mdi_engine(int narg, char **arg) pe = modify->compute[icompute_pe]; press = modify->compute[icompute_press]; + // set unit conversion factors + + if (strcmp(update->unit_style, "real") == 0) lmpunits = REAL; + else if (strcmp(update->unit_style, "metal") == 0) lmpunits = METAL; + else lmpunits = NATIVE; + + unit_conversions(); + // irregular class and data structs used by MDI + // NOTE: not clear if irregular comm is ever needed - irregular = new Irregular(lmp); + //irregular = new Irregular(lmp); - buf1 = nullptr; - buf3 = nullptr; - ibuf1 = nullptr; + buf1 = buf1all = nullptr; + buf3 = buf3all = nullptr; + ibuf1 = ibuf1all = nullptr; maxbuf = 0; // define MDI commands that LAMMPS engine recognizes @@ -171,7 +171,7 @@ void MDIEngine2::mdi_engine(int narg, char **arg) // one-time operation to establish a connection with the driver MDI_Accept_communicator(&mdicomm); - if (mdicomm <= 0) error->all(FLERR, "Unable to connect to MDI driver"); + if (mdicomm <= 0) error->all(FLERR,"Unable to connect to MDI driver"); // endless engine loop, responding to driver commands @@ -196,8 +196,8 @@ void MDIEngine2::mdi_engine(int narg, char **arg) break; } else - error->all(FLERR,fmt::format("MDI node exited with invalid command: {}" - ,mdicmd)); + error->all(FLERR, + fmt::format("MDI node exited with invalid command: {}",mdicmd)); } // clean up @@ -206,22 +206,35 @@ void MDIEngine2::mdi_engine(int narg, char **arg) delete [] node_engine; delete [] node_driver; - modify->delete_compute(id_pe); modify->delete_compute(id_ke); + modify->delete_compute(id_pe); modify->delete_compute(id_press); - delete irregular; - memory->destroy(buf3); - memory->destroy(buf1); + delete [] id_ke; + delete [] id_pe; + delete [] id_press; + + //delete irregular; + memory->destroy(ibuf1); + memory->destroy(buf1); + memory->destroy(buf3); - // remove mdi/engine fix that mdi/engine instantiated - // NOTE: make this optional + memory->destroy(ibuf1all); + memory->destroy(buf1all); + memory->destroy(buf3all); + + // remove mdi/engine fix that mdi engine instantiated + // NOTE: decide whether to make this optional, see above //if (added_mdi_engine_fix) modify->delete_fix("MDI_ENGINE_INTERNAL"); } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + engine is now at this MDI node + loop over received commands so long as driver also at this node + return when not the case or EXIT command received +---------------------------------------------------------------------- */ void MDIEngine2::engine_node(const char *node) { @@ -251,7 +264,7 @@ void MDIEngine2::engine_node(const char *node) execute_command(mdicmd,mdicomm); - // check if driver node is now something other than engine node + // check if driver node is now somewhere other than engine node if (strcmp(node_driver,"\0") != 0 && strcmp(node_driver,node_engine) != 0) node_match = false; @@ -274,6 +287,7 @@ int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) int ierr; // confirm this command is supported at this node + // otherwise is an error int command_exists = 1; if (root) { @@ -286,38 +300,44 @@ int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) MPI_Bcast(&command_exists,1,MPI_INT,0,world); if (!command_exists) - error->all(FLERR, "MDI: Received a command unsupported by engine node"); + error->all(FLERR,"MDI: Received a command unsupported by engine node"); + // --------------------------------------- // respond to each possible driver command + // --------------------------------------- - if (strcmp(command, ">NATOMS") == 0) { - // NOTE: needs to be 64-bit value or copied into 64-bit value - ierr = MDI_Recv((char *) &atom->natoms,1,MDI_INT,mdicomm); - if (ierr) - error->all(FLERR, "MDI: Unable to receive number of atoms from driver"); - MPI_Bcast(&atom->natoms, 1, MPI_INT, 0, world); + if (strcmp(command,">NATOMS") == 0) { - } else if (strcmp(command, "natoms; - ierr = MDI_Send((char *) &mdi_natoms, 1, MDI_INT64_T, mdicomm); - if (ierr != 0) - error->all(FLERR, "MDI: Unable to send number of atoms to driver"); + // natoms cannot exceed 32-bit int for use with MDI + + int natoms; + ierr = MDI_Recv(&natoms,1,MDI_INT,mdicomm); + if (ierr) error->all(FLERR,"MDI: >NATOMS data"); + MPI_Bcast(&natoms,1,MPI_INT,0,world); + if (natoms < 0) error->all(FLERR,"MDI received natoms < 0"); + atom->natoms = natoms; + + } else if (strcmp(command," (atom->natoms); + ierr = MDI_Send(&natoms,1,MDI_INT,mdicomm); + if (ierr != 0) error->all(FLERR,"MDI: ntypes, 1, MDI_INT, mdicomm); - if (ierr != 0) - error->all(FLERR, "MDI: Unable to send number of atom types to driver"); + ierr = MDI_Send(&atom->ntypes,1,MDI_INT,mdicomm); + if (ierr != 0) error->all(FLERR, "MDI: +FORCES") == 0) { receive_double3(FORCE,1); - } else if (strcmp(command, "all(FLERR, "MDI: MDI engine is already performing a simulation"); + error->all(FLERR,"MDI: MDI engine is already performing a simulation"); mode = MD; node_match = false; } else if (strcmp(command,"@INIT_OPTG") == 0) { if (mode != DEFAULT) - error->all(FLERR, "MDI: MDI engine is already performing a simulation"); + error->all(FLERR,"MDI: MDI engine is already performing a simulation"); mode = OPT; node_match = false; @@ -377,7 +397,7 @@ int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) } else if (strcmp(command,"<@") == 0) { ierr = MDI_Send(node_engine,MDI_NAME_LENGTH,MDI_CHAR,mdicomm); - if (ierr) error->all(FLERR,"MDI: Unable to send node to driver"); + if (ierr) error->all(FLERR,"MDI: <@ data"); } else if (strcmp(command,"@DEFAULT") == 0) { mode = DEFAULT; @@ -446,7 +466,7 @@ int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) // ------------------------------------------------------- } else { - error->all(FLERR, "MDI: Unknown command from driver"); + error->all(FLERR,"MDI: Unknown command received from driver"); } return 0; @@ -461,6 +481,7 @@ void MDIEngine2::mdi_commands() { // ------------------------------------ // commands and nodes that an MDI-compliant MD code supports + // NOTE: is all of this correct? // ------------------------------------ // default node and its commands @@ -593,7 +614,7 @@ void MDIEngine2::mdi_commands() MDI_Register_command("@COORDS", "EXIT"); // ------------------------------------ - // custom commands and nodes which LAMMPS adds support for + // custom commands and nodes which LAMMPS supports // max length for a command is current 11 chars in MDI // ------------------------------------ @@ -617,7 +638,7 @@ void MDIEngine2::mdi_commands() void MDIEngine2::mdi_md() { - // initialize an MD simulation + // initialize a new MD simulation update->whichflag = 1; timer->init_timeout(); @@ -638,6 +659,7 @@ void MDIEngine2::mdi_md() // setup the MD simulation update->integrate->setup(1); + engine_node("@FORCES"); if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; @@ -720,6 +742,7 @@ void MDIEngine2::mdi_optg() // ---------------------------------------------------------------------- /* ---------------------------------------------------------------------- + >CHARGES command receive vector of 1 double for all atoms atoms are ordered by atomID, 1 to Natoms assumes all atoms already exist @@ -729,8 +752,8 @@ void MDIEngine2::receive_double1(int which) { reallocate(); - int ierr = MDI_Recv((char *) buf1,atom->natoms,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: Unable to receive double1 data from driver"); + int ierr = MDI_Recv(buf1,atom->natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: >double1 data"); MPI_Bcast(buf1,atom->natoms,MPI_DOUBLE,0,world); // extract onwed atom value @@ -751,6 +774,7 @@ void MDIEngine2::receive_double1(int which) } /* ---------------------------------------------------------------------- + >TYPES command receive vector of 1 int for all atoms atoms are ordered by atomID, 1 to Natoms assumes all atoms already exist @@ -760,8 +784,8 @@ void MDIEngine2::receive_int1(int which) { reallocate(); - int ierr = MDI_Recv((char *) ibuf1,atom->natoms,MDI_INT,mdicomm); - if (ierr) error->all(FLERR,"MDI: Unable to receive double1 data from driver"); + int ierr = MDI_Recv(ibuf1,atom->natoms,MDI_INT,mdicomm); + if (ierr) error->all(FLERR,"MDI: >int1 data"); MPI_Bcast(ibuf1,atom->natoms,MPI_INT,0,world); // extract onwed atom value @@ -782,6 +806,7 @@ void MDIEngine2::receive_int1(int which) } /* ---------------------------------------------------------------------- + >COORDS, >FORCES commands receive vector of 3 doubles for all atoms atoms are ordered by atomID, 1 to Natoms assumes all atoms already exist @@ -792,8 +817,8 @@ void MDIEngine2::receive_double3(int which, int addflag) { reallocate(); - int ierr = MDI_Recv((char *) buf3,3*atom->natoms,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: Unable to receive double3 data from driver"); + int ierr = MDI_Recv(buf3,3*atom->natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: >double3 data"); MPI_Bcast(buf3,3*atom->natoms,MPI_DOUBLE,0,world); // extract owned atom values @@ -830,16 +855,11 @@ void MDIEngine2::receive_double3(int which, int addflag) f[i][2] += buf3[3*ilocal+2] * mdi2lmp_force; } } - } else if (which == VELOCITY) { - double **v = atom->v; - for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - v[i][0] = buf3[3*ilocal+0] * mdi2lmp_velocity; - v[i][1] = buf3[3*ilocal+1] * mdi2lmp_velocity; - v[i][2] = buf3[3*ilocal+2] * mdi2lmp_velocity; - } } + // NOTE: these operations cannot be done in the middle + // of an arbitrary timestep, only when reneighboring is done + /* // ensure atoms are in current box & update box via shrink-wrap // has to be be done before invoking Irregular::migrate_atoms() @@ -860,6 +880,7 @@ void MDIEngine2::receive_double3(int which, int addflag) } /* ---------------------------------------------------------------------- + natoms,MPI_DOUBLE,MPI_SUM,0,world); - int ierr = MDI_Send((char *) buf1all,atom->natoms,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send double1 data to driver"); + int ierr = MDI_Send(buf1all,atom->natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: natoms,MPI_INT,MPI_SUM,0,world); - int ierr = MDI_Send((char *) ibuf1all,atom->natoms,MDI_INT,mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send int1 data to driver"); + int ierr = MDI_Send(ibuf1all,atom->natoms,MDI_INT,mdicomm); + if (ierr) error->all(FLERR,"MDI: f; - for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - buf3[3*ilocal+0] = f[i][0] * lmp2mdi_velocity; - buf3[3*ilocal+1] = f[i][1] * lmp2mdi_velocity; - buf3[3*ilocal+2] = f[i][2] * lmp2mdi_velocity; - } } MPI_Reduce(buf3,buf3all,3*atom->natoms,MPI_DOUBLE,MPI_SUM,0,world); - int ierr = MDI_Send((char *) buf3all,3*atom->natoms,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send double3 data to driver"); + int ierr = MDI_Send(buf3all,3*atom->natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: natoms * MDI_LABEL_LENGTH]; - memset(labels, ' ', atom->natoms * MDI_LABEL_LENGTH); + memset(labels,' ',atom->natoms * MDI_LABEL_LENGTH); + + // NOTE: this loop will not work in parallel for (int iatom = 0; iatom < atom->natoms; iatom++) { std::string label = std::to_string(atom->type[iatom]); @@ -998,15 +1019,18 @@ void MDIEngine2::send_labels() strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); } - int ierr = MDI_Send(labels, atom->natoms * MDI_LABEL_LENGTH, MDI_CHAR, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send atom labels to driver"); + int ierr = MDI_Send(labels,atom->natoms*MDI_LABEL_LENGTH,MDI_CHAR,mdicomm); + if (ierr) error->all(FLERR,"MDI: all(FLERR, "MDI: Unable to send total energy to driver"); + int ierr = MDI_Send(&total_energy,1,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: compute_scalar(); potential_energy *= lmp2mdi_energy; - int ierr = MDI_Send((char *) &potential_energy,1,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send potential energy to driver"); + int ierr = MDI_Send(&potential_energy,1,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: compute_scalar(); kinetic_energy *= lmp2mdi_energy; - int ierr = MDI_Send((char *) &kinetic_energy,1,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: Unable to send kinetic energy to driver"); + int ierr = MDI_Send(&kinetic_energy,1,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: all(FLERR, "MDI: Unable to send cell dimensions to driver"); + int ierr = MDI_Send(celldata,9,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: CELL command + reset the simulation box edge vectors + in conjunction with >CELL_DISPL this can adjust box arbitrarily +---------------------------------------------------------------------- */ void MDIEngine2::receive_cell() { double celldata[9]; - int ierr = MDI_Recv((char *) celldata,9,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send cell dimensions to driver"); - MPI_Bcast(&celldata[0],9,MPI_DOUBLE,0,world); + int ierr = MDI_Recv(celldata,9,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL data"); + MPI_Bcast(celldata,9,MPI_DOUBLE,0,world); for (int icell = 0; icell < 9; icell++) - celldata[icell] /= mdi2lmp_length; + celldata[icell] *= mdi2lmp_length; - // require the new cell vector be orthogonal (for now) + // error check that edge vectors match LAMMPS triclinic requirement - double small = std::numeric_limits::min(); - if (abs(celldata[1]) > small or abs(celldata[2]) > small or - abs(celldata[3]) > small or - abs(celldata[5]) > small or abs(celldata[6]) > small or - abs(celldata[7]) > small) { - error->all(FLERR, - "MDI: LAMMPS currently only supports the >CELL command " - "for orthogonal cell vectors"); - } + if (celldata[1] != 0.0 || celldata[2] != 0.0 || celldata[5] != 0.0) + error->all(FLERR,"MDI: Received cell edges are not LAMMPS compatible"); + + // convert atoms to lamda coords before changing box + + domain->x2lamda(atom->nlocal); + + // convert celldata to new boxlo, boxhi, and tilt factors domain->boxhi[0] = celldata[0] + domain->boxlo[0]; domain->boxhi[1] = celldata[4] + domain->boxlo[1]; domain->boxhi[2] = celldata[8] + domain->boxlo[2]; - domain->xy = 0.0; - domain->xz = 0.0; - domain->yz = 0.0; + + domain->xy = celldata[3]; + domain->xz = celldata[6]; + domain->yz = celldata[7]; + + // reset all Domain variables that depend on box size/shape + // convert atoms coords back to new box coords + + domain->set_global_box(); + domain->set_local_box(); + domain->lamda2x(atom->nlocal); } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + all(FLERR, "MDI: Unable to send cell displacement to driver"); + int ierr = MDI_Send(celldata,3,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: CELL_DISPL command + reset simulation box origin = lower-left corner +---------------------------------------------------------------------- */ void MDIEngine2::receive_celldispl() { double celldata[3]; - int ierr = MDI_Recv((char *) celldata,3,MDI_DOUBLE,mdicomm); + int ierr = MDI_Recv(celldata,3,MDI_DOUBLE,mdicomm); if (ierr) - error->all(FLERR, "MDI: Unable to receive cell displacement from driver"); - MPI_Bcast(&celldata[0],3,MPI_DOUBLE,0,world); + error->all(FLERR,"MDI: >CELL_DISPLS data"); + MPI_Bcast(celldata,3,MPI_DOUBLE,0,world); for (int icell = 0; icell < 3; icell++) celldata[icell] *= mdi2lmp_length; + // convert atoms to lamda coords before changing box + + domain->x2lamda(atom->nlocal); + + // convert celldata to new boxlo and boxhi + double old_boxlo[3]; old_boxlo[0] = domain->boxlo[0]; old_boxlo[1] = domain->boxlo[1]; old_boxlo[2] = domain->boxlo[2]; - // adjust the values of boxlo and boxhi for the new cell displacement vector - domain->boxlo[0] = celldata[0]; domain->boxlo[1] = celldata[1]; domain->boxlo[2] = celldata[2]; + domain->boxhi[0] += domain->boxlo[0] - old_boxlo[0]; domain->boxhi[1] += domain->boxlo[1] - old_boxlo[1]; domain->boxhi[2] += domain->boxlo[2] - old_boxlo[2]; + + // reset all Domain variables that depend on box origin + // convert atoms coords back to new box coords + + domain->set_global_box(); + domain->set_local_box(); + domain->lamda2x(atom->nlocal); } // ---------------------------------------------------------------------- @@ -1151,13 +1213,13 @@ void MDIEngine2::receive_celldispl() /* ---------------------------------------------------------------------- LENGTH command store received value in length_param - for use by other commands, e.g. that send strings + for use by a subsequent command, e.g. ones that send strings ---------------------------------------------------------------------- */ void MDIEngine2::length_command() { int ierr = MDI_Recv(&length_param,1,MDI_INT,mdicomm); - if (ierr) error->all(FLERR, "MDI LENGTH error"); + if (ierr) error->all(FLERR,"MDI: LENGTH data"); MPI_Bcast(&length_param,1,MPI_INT,0,world); } @@ -1171,7 +1233,7 @@ void MDIEngine2::single_command() { char *cmd = new char[length_param+1]; int ierr = MDI_Recv(cmd,length_param+1,MDI_CHAR,mdicomm); - if (ierr) error->all(FLERR,"MDI COMMAND error"); + if (ierr) error->all(FLERR,"MDI: COMMAND data"); MPI_Bcast(cmd,length_param+1,MPI_CHAR,0,world); cmd[length_param+1] = '\0'; @@ -1190,7 +1252,7 @@ void MDIEngine2::many_commands() { char *cmds = new char[length_param+1]; int ierr = MDI_Recv(cmds, length_param+1, MDI_CHAR, mdicomm); - if (ierr) error->all(FLERR, "MDI COMMANDS error"); + if (ierr) error->all(FLERR,"MDI: COMMANDS data"); MPI_Bcast(cmds,length_param+1,MPI_CHAR,0,world); cmds[length_param+1] = '\0'; @@ -1209,7 +1271,7 @@ void MDIEngine2::infile() { char *infile = new char[length_param+1]; int ierr = MDI_Recv(infile,length_param+1,MDI_CHAR,mdicomm); - if (ierr) error->all(FLERR, "MDI INFILE error"); + if (ierr) error->all(FLERR,"MDI: INFILE data"); MPI_Bcast(infile,length_param+1,MPI_CHAR,0,world); infile[length_param+1] = '\0'; @@ -1218,7 +1280,15 @@ void MDIEngine2::infile() delete [] infile; } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + EVAL command + compute forces, energy, pressure of current system + can be called multiple times by driver + for a system that is continuously evolving + distinguishes between first-time call vs + system needs reneighboring vs system does not need reneighboring + does not increment timestep +---------------------------------------------------------------------- */ void MDIEngine2::evaluate() { @@ -1228,6 +1298,9 @@ void MDIEngine2::evaluate() update->integrate->setup(0); } else { + + // insure potential energy and virial are tallied on this step + pe->addstep(update->ntimestep); press->addstep(update->ntimestep); @@ -1241,7 +1314,14 @@ void MDIEngine2::evaluate() } } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + RESET_BOX command + wrapper on library reset_box() method + requires no atoms exist + allows caller to define a new simulation box + NOTE: this will not work in plugin mode, b/c of 3 MDI_Recv() calls + how to effectively do this? +---------------------------------------------------------------------- */ void MDIEngine2::reset_box() { @@ -1258,7 +1338,16 @@ void MDIEngine2::reset_box() lammps_reset_box(lmp,boxlo,boxhi,tilts[0],tilts[1],tilts[2]); } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + CREATE_ATOM command + wrapper on library create_atoms() method + requires simulation box be defined + allows caller to define a new set of atoms + with their IDs, types, coords, velocities, image flags + NOTE: this will not work in plugin mode, b/c of multiple MDI_Recv() calls + how to effectively do this? + NOTE: also the memory here is not yet allocated correctly +---------------------------------------------------------------------- */ void MDIEngine2::create_atoms() { @@ -1305,15 +1394,18 @@ void MDIEngine2::create_atoms() } if (!x || !type) - error->all(FLERR,"MDI create_atoms: did not receive atom coords or types"); + error->all(FLERR,"MDI: CREATE_ATOM did not receive atom coords or types"); int ncreate = lammps_create_atoms(lmp,natoms,id,type,x,v,image,1); if (ncreate != natoms) - error->all(FLERR, "MDI create_atoms: created atoms != sent atoms"); + error->all(FLERR, "MDI: CREATE ATOM created atoms != sent atoms"); } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + all(FLERR, "MDI: Unable to send pressure to driver"); + if (ierr) error->all(FLERR,"MDI: compute_vector(); for (int i = 0; i < 6; i++) - pvector[i] = press->vector[i] * lmp2mdi_pressure; + ptensor[i] = press->vector[i] * lmp2mdi_pressure; - int ierr = MDI_Send(pvector,6,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send ptensor to driver"); + int ierr = MDI_Send(ptensor,6,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: atom->natoms) return; + if (atom->natoms <= maxbuf) return; if (3*atom->natoms > MAXSMALLINT) - error->all(FLERR,"Natoms is too large to use with mdi engine"); + error->all(FLERR,"Natoms too large to use with mdi engine"); maxbuf = atom->natoms; @@ -1369,6 +1468,9 @@ void MDIEngine2::reallocate() memory->create(buf3all,3*maxbuf,"mdi:buf3all"); } +/* ---------------------------------------------------------------------- + MDI to/from LAMMPS conversion factors +------------------------------------------------------------------------- */ void MDIEngine2::unit_conversions() { diff --git a/src/MDI/mdi_engine2.h b/src/MDI/mdi_engine2.h index aeda3f823c..4ef487ad06 100644 --- a/src/MDI/mdi_engine2.h +++ b/src/MDI/mdi_engine2.h @@ -57,7 +57,7 @@ class MDIEngine2 : public Command { int length_param; // LENGTH command value used by other commands - // unit conversion factors; + // unit conversion factors double lmp2mdi_length,mdi2lmp_length; double lmp2mdi_energy,mdi2lmp_energy; @@ -87,12 +87,12 @@ class MDIEngine2 : public Command { void send_double1(int); void send_int1(int); void send_double3(int); - void send_labels(); - void send_energy(); + void send_total_energy(); void send_pe(); void send_ke(); + void send_cell(); void receive_cell(); void send_celldispl(); From 6193ebaba7fbc6930c5e9b54810d74e65d2d3b66 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 3 Sep 2021 16:01:16 -0600 Subject: [PATCH 005/130] remove earlier USER-MDI files --- src/USER-MDI/fix_mdi_engine2.cpp | 80 -- src/USER-MDI/fix_mdi_engine2.h | 81 -- src/USER-MDI/mdi_engine2.cpp | 1463 ------------------------------ src/USER-MDI/mdi_engine2.h | 104 --- 4 files changed, 1728 deletions(-) delete mode 100644 src/USER-MDI/fix_mdi_engine2.cpp delete mode 100644 src/USER-MDI/fix_mdi_engine2.h delete mode 100644 src/USER-MDI/mdi_engine2.cpp delete mode 100644 src/USER-MDI/mdi_engine2.h diff --git a/src/USER-MDI/fix_mdi_engine2.cpp b/src/USER-MDI/fix_mdi_engine2.cpp deleted file mode 100644 index 6d390af16b..0000000000 --- a/src/USER-MDI/fix_mdi_engine2.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* ---------------------------------------------------------------------- - 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: Taylor Barnes (MolSSI) - MolSSI Driver Interface (MDI) support for LAMMPS -------------------------------------------------------------------------- */ - -#include "error.h" -#include "fix_mdi_engine2.h" -#include "mdi_engine2.h" - -using namespace LAMMPS_NS; -using namespace FixConst; - -/* ---------------------------------------------------------------------- */ - -FixMDIEngine2::FixMDIEngine2(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) -{ - if (narg != 3) error->all(FLERR, "Illegal fix mdi/engine command"); -} - -/* ---------------------------------------------------------------------- */ - -int FixMDIEngine2::setmask() -{ - int mask = 0; - mask |= POST_INTEGRATE; - mask |= POST_FORCE; - mask |= MIN_PRE_FORCE; - mask |= MIN_POST_FORCE; - return mask; -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine2::min_setup(int vflag) -{ - mdi_engine->engine_node("@FORCES"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine2::post_integrate() -{ - mdi_engine->engine_node("@COORDS"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine2::min_pre_force(int vflag) -{ - mdi_engine->engine_node("@COORDS"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine2::min_post_force(int vflag) -{ - mdi_engine->engine_node("@FORCES"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine2::post_force(int vflag) -{ - mdi_engine->engine_node("@FORCES"); -} - diff --git a/src/USER-MDI/fix_mdi_engine2.h b/src/USER-MDI/fix_mdi_engine2.h deleted file mode 100644 index 43c39f382b..0000000000 --- a/src/USER-MDI/fix_mdi_engine2.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- 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 FIX_CLASS -// clang-format off -FixStyle(mdi/engine2, FixMDIEngine2); -// clang-format on -#else - -#ifndef LMP_FIX_MDI_ENGINE2_H -#define LMP_FIX_MDI_ENGINE2_H - -#include "fix.h" - -namespace LAMMPS_NS { - -class FixMDIEngine2 : public Fix { - public: - class MDIEngine2 *mdi_engine; - - FixMDIEngine2(class LAMMPS *, int, char **); - ~FixMDIEngine2() {} - int setmask(); - void init() {} - - void min_setup(int); - void post_integrate(); - void post_force(int); - void min_pre_force(int); - void min_post_force(int); -}; - -} // namespace LAMMPS_NS - -#endif -#endif - -/* ERROR/WARNING messages: - -E: Illegal ... command - -Self-explanatory. - -E: Potential energy ID for fix mdi does not exist - -Self-explanatory. - -E: Cannot use MDI command without atom IDs - -Self-explanatory. - -E: MDI command requires consecutive atom IDs - -Self-explanatory. - -E: Unable to connect to driver - -Self-explanatory. - -E: Unable to ... driver - -Self-explanatory. - -E: Unknown command from driver - -The driver sent a command that is not supported by the LAMMPS -interface. In some cases this might be because a nonsensical -command was sent (i.e. "SCF"). In other cases, the LAMMPS -interface might benefit from being expanded. - -*/ diff --git a/src/USER-MDI/mdi_engine2.cpp b/src/USER-MDI/mdi_engine2.cpp deleted file mode 100644 index 60a8ca107f..0000000000 --- a/src/USER-MDI/mdi_engine2.cpp +++ /dev/null @@ -1,1463 +0,0 @@ -/* ---------------------------------------------------------------------- - 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: Taylor Barnes (MolSSI) - MolSSI Driver Interface (MDI) support for LAMMPS -------------------------------------------------------------------------- */ - -#include "mdi_engine2.h" -#include "library_mdi.h" - -#include -#include -#include "atom.h" -#include "comm.h" -#include "compute.h" -#include "domain.h" -#include "error.h" -#include "fix_mdi_engine2.h" -#include "force.h" -#include "group.h" -#include "input.h" -#include "irregular.h" -#include "library.h" -#include "mdi.h" -#include "memory.h" -#include "min.h" -#include "minimize.h" -#include "modify.h" -#include "output.h" -#include "timer.h" -#include "update.h" -#include "verlet.h" - -using namespace LAMMPS_NS; - -enum {NONE, REAL, METAL}; // LAMMPS units which MDI supports -enum {DEFAULT, MD, OPT}; // MDI engine mode - -/* ---------------------------------------------------------------------- - trigger LAMMPS to start acting as an MDI engine - either as a standalone code or as a plugin - MDI_Init() for standalone code is in main.cpp - MDI_Init() for plugin is in library_mdi.cpp::MDI_Plugin_init_lammps() - endlessly loop over receiving commands from driver and responding - when EXIT command is received, mdi/engine command exits ----------------------------------------------------------------------- */ - -void MDIEngine2::command(int narg, char **arg) -{ - // args to choose what nodes LAMMPS will act with - // also whether a fix mdi/engine is needed - // NOTE: add args - - if (narg > 0) error->all(FLERR, "Illegal mdi/engine command"); - - // check that LAMMPS defines what an MDI engine needs - - if (atom->tag_enable == 0) - error->all(FLERR, "Cannot use mdi/engine without atom IDs"); - - if (atom->natoms && atom->tag_consecutive() == 0) - error->all(FLERR, "mdi/engine requires consecutive atom IDs"); - - // must use real or metal units with MDI (atomic scale) - // real: coords = Ang, eng = Kcal/mole, force = Kcal/mole/Ang - // metal: coords = Ang, eng = eV, force = eV/Ang - - lmpunits = NONE; - if (strcmp(update->unit_style, "real") == 0) lmpunits = REAL; - if (strcmp(update->unit_style, "metal") == 0) lmpunits = METAL; - if (lmpunits == NONE) error->all(FLERR, "MDI requires real or metal units"); - - // confirm LAMMPS is being run as an engine - - int role; - MDI_Get_role(&role); - if (role != MDI_ENGINE) - error->all(FLERR, - "Must invoke LAMMPS as an MDI engine to use mdi/engine command"); - - // if the mdi/engine fix is not already present, add it now - // NOTE: make this optional above - - //int ifix = modify->find_fix_by_style("mdi/engine"); - //bool added_mdi_engine_fix = false; - //if (ifix < 0) { - // modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine"); - // added_mdi_engine_fix = true; - // } - - // identify the mdi_engine fix - - //ifix = modify->find_fix_by_style("mdi/engine"); - //mdi_fix = static_cast(modify->fix[ifix]); - //mdi_fix->mdi_engine = this; - - // root = 1 for proc 0, otherwise 0 - - root = (comm->me == 0) ? 1 : 0; - - // MDI setup - - mode = DEFAULT; - exit_flag = false; - local_exit_flag = false; - - cmd = new char[MDI_COMMAND_LENGTH]; - node_driver = new char[MDI_COMMAND_LENGTH]; - node_engine = new char[MDI_COMMAND_LENGTH]; - strncpy(node_driver, "\0", MDI_COMMAND_LENGTH); - strncpy(node_engine, "@DEFAULT", MDI_COMMAND_LENGTH); - - // create computes for KE. PE, pressure - - id_ke = utils::strdup(std::string("MDI_ENGINE") + "_ke"); - modify->add_compute(fmt::format("{} all ke", id_ke)); - - id_pe = utils::strdup(std::string("MDI_ENGINE") + "_pe"); - modify->add_compute(fmt::format("{} all pe", id_pe)); - - id_press = utils::strdup(std::string("MDI_ENGINE") + "_press"); - modify->add_compute(fmt::format("{} all pressure thermo_temp", id_press)); - - // store pointers to the new computes - - int icompute_ke = modify->find_compute(id_ke); - int icompute_pe = modify->find_compute(id_pe); - int icompute_press = modify->find_compute(id_press); - - ke = modify->compute[icompute_ke]; - pe = modify->compute[icompute_pe]; - press = modify->compute[icompute_press]; - - // irregular class and data structs used by MDI - - irregular = new Irregular(lmp); - add_force = nullptr; - - // define MDI commands that LAMMPS engine recognizes - - mdi_commands(); - - // one-time operation to establish a connection with the driver - - MDI_Accept_communicator(&mdicomm); - if (mdicomm <= 0) error->all(FLERR, "Unable to connect to MDI driver"); - - // endless engine loop, responding to driver commands - - while (1) { - - // mdi/engine command only recognizes three nodes - // DEFAULT, INIT_MD, INIT_OPTG - - engine_node("@DEFAULT"); - - // MDI commands for dynamics or minimization - - if (strcmp(cmd, "@INIT_MD") == 0) { - mdi_md(); - if (strcmp(cmd, "EXIT")) break; - - } else if (strcmp(cmd, "@INIT_OPTG") == 0) { - mdi_optg(); - if (strcmp(cmd, "EXIT")) break; - - } else if (strcmp(cmd, "EXIT") == 0) { - break; - - } else - error->all(FLERR,fmt::format("MDI node exited with invalid command: {}", cmd)); - } - - // clean up - - delete [] cmd; - delete [] node_driver; - delete [] node_engine; - - //modify->delete_compute(id_pe); - //modify->delete_compute(id_ke); - delete irregular; - memory->destroy(add_force); - - // remove mdi/engine fix that mdi/engine instantiated - // NOTE: make this optional - - //if (added_mdi_engine_fix) modify->delete_fix("MDI_ENGINE_INTERNAL"); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::engine_node(const char *node) -{ - int ierr; - - // do not process commands if engine and driver are not at same node - - strncpy(node_engine, node, MDI_COMMAND_LENGTH); - if (strcmp(node_driver, "\0") != 0 && strcmp(node_driver, node_engine) != 0) - local_exit_flag = true; - - // respond to commands from the driver - - while (not exit_flag and not local_exit_flag) { - - // read the next command from the driver - // all procs call this, but only proc 0 receives the command - - ierr = MDI_Recv_command(cmd, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to receive command from driver"); - - // broadcast command to the other MPI tasks - - MPI_Bcast(cmd, MDI_COMMAND_LENGTH, MPI_CHAR, 0, world); - - // execute the command - - execute_command(cmd,mdicomm); - - // check if driver node is now something other than engine node - - if (strcmp(node_driver, "\0") != 0 && strcmp(node_driver, node_engine) != 0) - local_exit_flag = true; - } - - // local exit occured so turn off local exit flag - - local_exit_flag = false; -} - - -/* ---------------------------------------------------------------------- - process a single driver command ----------------------------------------------------------------------- */ - -int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) -{ - int ierr; - - // confirm this command is supported at this node - // NOTE: logic with ierr and command exists is faulty - - int command_exists = 1; - if (root) { - ierr = MDI_Check_command_exists(node_engine, command, MDI_COMM_NULL, &command_exists); - if (ierr) - error->all(FLERR, "MDI: Unable to check whether current command is supported"); - } - if (!command_exists) - error->all(FLERR, "MDI: Received a command unsupported at engine node"); - - // respond to each possible driver command - - if (strcmp(command, ">NATOMS") == 0) { - // NOTE: needs to be 64-bit value or copied into 64-bit value - ierr = MDI_Recv((char *) &atom->natoms, 1, MDI_INT, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to receive number of atoms from driver"); - MPI_Bcast(&atom->natoms, 1, MPI_INT, 0, world); - - } else if (strcmp(command, "natoms; - ierr = MDI_Send((char *) &mdi_natoms, 1, MDI_INT64_T, mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send number of atoms to driver"); - - } else if (strcmp(command, "ntypes, 1, MDI_INT, mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send number of atom types to driver"); - - } else if (strcmp(command, "CELL") == 0) { - receive_cell(); - - } else if (strcmp(command, "CELL_DISPL") == 0) { - receive_celldispl(); - - } else if (strcmp(command, ">COORDS") == 0) { - receive_coordinates(); - - } else if (strcmp(command, "FORCES") == 0) { - receive_forces(0); - - } else if (strcmp(command, ">+FORCES") == 0) { - receive_forces(1); - - } else if (strcmp(command, "@INIT_MD") == 0) { - if (mode != DEFAULT) - error->all(FLERR, "MDI: MDI is already performing a simulation"); - mode = MD; - local_exit_flag = true; - - } else if (strcmp(command, "@INIT_OPTG") == 0) { - if (mode != DEFAULT) - error->all(FLERR, "MDI: MDI is already performing a simulation"); - mode = OPT; - local_exit_flag = true; - - } else if (strcmp(command, "@") == 0) { - strncpy(node_driver, "\0", MDI_COMMAND_LENGTH); - local_exit_flag = true; - - } else if (strcmp(command, "<@") == 0) { - ierr = MDI_Send(node_engine, MDI_NAME_LENGTH, MDI_CHAR, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send node to driver"); - - } else if (strcmp(command, "etol = std::numeric_limits::max(); - update->ftol = std::numeric_limits::max(); - - // set the maximum number of force evaluations to 0 - update->max_eval = 0; - } - - } else if (strcmp(command, "@COORDS") == 0) { - strncpy(node_driver, "@COORDS", MDI_COMMAND_LENGTH); - local_exit_flag = true; - - } else if (strcmp(command, "@FORCES") == 0) { - strncpy(node_driver, "@FORCES", MDI_COMMAND_LENGTH); - local_exit_flag = true; - - } else if (strcmp(command, "EXIT") == 0) { - // exit the driver code - exit_flag = true; - - // are we in the middle of a geometry optimization? - if (mode == OPT) { - // ensure that the energy and force tolerances are met - update->etol = std::numeric_limits::max(); - update->ftol = std::numeric_limits::max(); - - // set the maximum number of force evaluations to 0 - update->max_eval = 0; - } - - // ------------------------------------------------------- - // LAMMPS specific commands - // ------------------------------------------------------- - - } else if (strcmp(command, "COMMAND") == 0) { - single_command(); - } else if (strcmp(command, "COMMANDS") == 0) { - many_commands(); - } else if (strcmp(command, "INFILE") == 0) { - infile(); - } else if (strcmp(command, "RESET_BOX") == 0) { - reset_box(); - } else if (strcmp(command, "CREATE_ATOM") == 0) { - create_atoms(); - } else if (strcmp(command, "all(FLERR, "MDI: Unknown command from driver"); - } - - return 0; -} - -/* ---------------------------------------------------------------------- - define which MDI commands the LAMMPS engine recognizes - standard MDI commands and custom LAMMPS commands ----------------------------------------------------------------------- */ - -void MDIEngine2::mdi_commands() -{ - // NOTE: define which commands are allowed at which node - - // ------------------------------------ - // list of nodes and commands that an MDI-compliant MD code supports - // ------------------------------------ - - // default node and its commands - - MDI_Register_node("@DEFAULT"); - MDI_Register_command("@DEFAULT", "<@"); - MDI_Register_command("@DEFAULT", "CELL"); - MDI_Register_command("@DEFAULT", ">CELL_DISPL"); - MDI_Register_command("@DEFAULT", ">COORDS"); - MDI_Register_command("@DEFAULT", "@INIT_MD"); - MDI_Register_command("@DEFAULT", "@INIT_OPTG"); - MDI_Register_command("@DEFAULT", "EXIT"); - - // node for setting up and running a dynamics simulation - // NOTE: remove some of these in various nodes below - - MDI_Register_node("@INIT_MD"); - MDI_Register_command("@INIT_MD", "<@"); - MDI_Register_command("@INIT_MD", "CELL"); - MDI_Register_command("@INIT_MD", ">CELL_DISPL"); - MDI_Register_command("@INIT_MD", ">COORDS"); - MDI_Register_command("@INIT_MD", ">FORCES"); - MDI_Register_command("@INIT_MD", ">+FORCES"); - MDI_Register_command("@INIT_MD", "@"); - MDI_Register_command("@INIT_MD", "@COORDS"); - MDI_Register_command("@INIT_MD", "@DEFAULT"); - MDI_Register_command("@INIT_MD", "@FORCES"); - MDI_Register_command("@INIT_MD", "EXIT"); - - // node for setting up and running a minimization - - MDI_Register_node("@INIT_OPTG"); - MDI_Register_command("@INIT_OPTG", "<@"); - MDI_Register_command("@INIT_OPTG", "CELL"); - MDI_Register_command("@INIT_OPTG", ">CELL_DISPL"); - MDI_Register_command("@INIT_OPTG", ">COORDS"); - MDI_Register_command("@INIT_OPTG", ">FORCES"); - MDI_Register_command("@INIT_OPTG", ">+FORCES"); - MDI_Register_command("@INIT_OPTG", "@"); - MDI_Register_command("@INIT_OPTG", "@COORDS"); - MDI_Register_command("@INIT_OPTG", "@DEFAULT"); - MDI_Register_command("@INIT_OPTG", "@FORCES"); - MDI_Register_command("@INIT_OPTG", "EXIT"); - - // node at POST_FORCE location in timestep - - MDI_Register_node("@FORCES"); - MDI_Register_callback("@FORCES", ">FORCES"); - MDI_Register_callback("@FORCES", ">+FORCES"); - MDI_Register_command("@FORCES", "<@"); - MDI_Register_command("@FORCES", "CELL"); - MDI_Register_command("@FORCES", ">CELL_DISPL"); - MDI_Register_command("@FORCES", ">COORDS"); - MDI_Register_command("@FORCES", ">FORCES"); - MDI_Register_command("@FORCES", ">+FORCES"); - MDI_Register_command("@FORCES", "@"); - MDI_Register_command("@FORCES", "@COORDS"); - MDI_Register_command("@FORCES", "@DEFAULT"); - MDI_Register_command("@FORCES", "@FORCES"); - MDI_Register_command("@FORCES", "EXIT"); - - // node at POST_INTEGRATE location in timestep - - MDI_Register_node("@COORDS"); - MDI_Register_command("@COORDS", "<@"); - MDI_Register_command("@COORDS", "CELL"); - MDI_Register_command("@COORDS", ">CELL_DISPL"); - MDI_Register_command("@COORDS", ">COORDS"); - MDI_Register_command("@COORDS", ">FORCES"); - MDI_Register_command("@COORDS", ">+FORCES"); - MDI_Register_command("@COORDS", "@"); - MDI_Register_command("@COORDS", "@COORDS"); - MDI_Register_command("@COORDS", "@DEFAULT"); - MDI_Register_command("@COORDS", "@FORCES"); - MDI_Register_command("@COORDS", "EXIT"); - - // ------------------------------------ - // list of custom MDI nodes and commands which LAMMPS adds support for - // ------------------------------------ - - MDI_Register_command("@DEFAULT", "COMMAND"); - MDI_Register_command("@DEFAULT", "COMMANDS"); - MDI_Register_command("@DEFAULT", "INFILE"); - MDI_Register_command("@DEFAULT", "RESET_BOX"); - MDI_Register_command("@DEFAULT", "CREATE_ATOM"); - MDI_Register_command("@DEFAULT", "whichflag = 1; - timer->init_timeout(); - update->nsteps = 1; - update->ntimestep = 0; - update->firststep = update->ntimestep; - update->laststep = update->ntimestep + update->nsteps; - update->beginstep = update->firststep; - update->endstep = update->laststep; - - lmp->init(); - - // engine is now at @INIT_MD node - - engine_node("@INIT_MD"); - if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; - - // setup the MD simulation - - update->integrate->setup(1); - - engine_node("@FORCES"); - if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; - - // run MD one step at a time - - while (1) { - update->whichflag = 1; - timer->init_timeout(); - update->nsteps += 1; - update->laststep += 1; - update->endstep = update->laststep; - output->next = update->ntimestep + 1; - - // single MD timestep - - update->integrate->run(1); - - // done with MD if driver sends @DEFAULT or EXIT - - if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; - } -} - -/* ---------------------------------------------------------------------- - perform minimization under control of driver ----------------------------------------------------------------------- */ - -void MDIEngine2::mdi_optg() -{ - // initialize an energy minization - - Minimize *minimizer = new Minimize(lmp); - - // setup the minimizer in a way that ensures optimization - // will continue until MDI driver exits - - update->etol = std::numeric_limits::min(); - update->ftol = std::numeric_limits::min(); - update->nsteps = std::numeric_limits::max(); - update->max_eval = std::numeric_limits::max(); - - update->whichflag = 2; - update->beginstep = update->firststep = update->ntimestep; - update->endstep = update->laststep = update->firststep + update->nsteps; - - lmp->init(); - - // engine is now at @INIT_OPTG node - - engine_node("@INIT_OPTG"); - - if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; - - // setup the minimization - - update->minimize->setup(); - - if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; - - // Start a minimization, which is configured to run (essentially) - // infinite steps. When the driver sends the EXIT command, - // the minimizer's energy and force tolerances are set to - // extremely large values, causing the minimization to end. - - update->minimize->iterate(update->nsteps); - - // return if driver sends @DEFAULT or EXIT - - if (strcmp(cmd, "@DEFAULT") == 0 || strcmp(cmd, "EXIT") == 0) return; - - error->all(FLERR, - fmt::format("MDI reached end of OPTG simulation " - "with invalid command: {}", - cmd)); -} - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// response to individual MDI driver commands -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- - -void MDIEngine2::receive_coordinates() -{ - // get conversion factor to atomic units - double posconv; - - // real: coords = Ang, eng = Kcal/mole, force = Kcal/mole/Ang - // metal: coords = Ang, eng = eV, force = eV/Ang - - if (lmpunits == REAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } else if (lmpunits == METAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } - - // create buffer to hold all coords - - double *buffer; - buffer = new double[3 * atom->natoms]; - - int ierr = MDI_Recv((char *) buffer, 3 * atom->natoms, MDI_DOUBLE, mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: Unable to receive coordinates from driver"); - MPI_Bcast(buffer, 3 * atom->natoms, MPI_DOUBLE, 0, world); - - // pick local atoms from the buffer - - double **x = atom->x; - int *mask = atom->mask; - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { - x[i][0] = buffer[3 * (atom->tag[i] - 1) + 0] * posconv; - x[i][1] = buffer[3 * (atom->tag[i] - 1) + 1] * posconv; - x[i][2] = buffer[3 * (atom->tag[i] - 1) + 2] * posconv; - } - - // ensure atoms are in current box & update box via shrink-wrap - // has to be be done before invoking Irregular::migrate_atoms() - // since it requires atoms be inside simulation box - - if (domain->triclinic) domain->x2lamda(atom->nlocal); - domain->pbc(); - domain->reset_box(); - if (domain->triclinic) domain->lamda2x(atom->nlocal); - - // move atoms to new processors via irregular() only needed if - // migrate_check() says an atom moves too far - - if (domain->triclinic) domain->x2lamda(atom->nlocal); - if (irregular->migrate_check()) irregular->migrate_atoms(); - if (domain->triclinic) domain->lamda2x(atom->nlocal); - - delete[] buffer; -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_coordinates() -{ - // get conversion factor to atomic units - double posconv; - if (lmpunits == REAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } else if (lmpunits == METAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } - - int64_t ncoords = 3 * atom->natoms; - double *coords; - double *coords_reduced; - memory->create(coords, ncoords, "mdi/engine:coords"); - memory->create(coords_reduced, ncoords, "mdi/engine:coords_reduced"); - - // zero coords - - for (int64_t icoord = 0; icoord < ncoords; icoord++) coords[icoord] = 0.0; - - // copy local atoms into buffer at correct locations - - double **x = atom->x; - int *mask = atom->mask; - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { - coords[3 * (atom->tag[i] - 1) + 0] = x[i][0] / posconv; - coords[3 * (atom->tag[i] - 1) + 1] = x[i][1] / posconv; - coords[3 * (atom->tag[i] - 1) + 2] = x[i][2] / posconv; - } - - MPI_Reduce(coords, coords_reduced, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - int ierr = MDI_Send((char *) coords_reduced, 3 * atom->natoms, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send coordinates to driver"); - - memory->destroy(coords); - memory->destroy(coords_reduced); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_charges() -{ - double *charges; - double *charges_reduced; - - memory->create(charges, atom->natoms, "mdi/engine:charges"); - memory->create(charges_reduced, atom->natoms, "mdi/engine:charges_reduced"); - - // zero the charges array - - for (int icharge = 0; icharge < atom->natoms; icharge++) charges[icharge] = 0.0; - - // pick local atoms from the buffer - - double *charge = atom->q; - int *mask = atom->mask; - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { charges[atom->tag[i] - 1] = charge[i]; } - - MPI_Reduce(charges, charges_reduced, atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - int ierr = MDI_Send((char *) charges_reduced, atom->natoms, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send charges to driver"); - - memory->destroy(charges); - memory->destroy(charges_reduced); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_energy() -{ - // get conversion factor to atomic units - double energy_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - energy_conv = kelvin_to_hartree / force->boltz; - } else if (lmpunits == METAL) { - double ev_to_hartree; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - energy_conv = ev_to_hartree; - } - - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - - double potential_energy = pe->compute_scalar(); - double kinetic_energy = ke->compute_scalar(); - double total_energy; - double *send_energy = &total_energy; - - // convert the energy to atomic units - potential_energy *= energy_conv; - kinetic_energy *= energy_conv; - total_energy = potential_energy + kinetic_energy; - - int ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send potential energy to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_pe() -{ - // get conversion factor to atomic units - - double energy_conv = 1.0; - /* - if (lmpunits == REAL) { - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - energy_conv = kelvin_to_hartree / force->boltz; - } else if (lmpunits == METAL) { - double ev_to_hartree; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - energy_conv = ev_to_hartree; - } - */ - - double potential_energy = pe->compute_scalar(); - - // convert the energy to atomic units - - potential_energy *= energy_conv; - - int ierr = MDI_Send((char *) &potential_energy, 1, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send potential energy to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_ke() -{ - // get conversion factor to atomic units - double energy_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - energy_conv = kelvin_to_hartree / force->boltz; - } else if (lmpunits == METAL) { - double ev_to_hartree; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - energy_conv = ev_to_hartree; - } - - double kinetic_energy = ke->compute_scalar(); - - // convert the energy to atomic units - - kinetic_energy *= energy_conv; - - int ierr = MDI_Send((char *) &kinetic_energy, 1, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send potential energy to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_types() -{ - int *const type = atom->type; - - int ierr = MDI_Send((char *) type, atom->natoms, MDI_INT, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send atom types to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_labels() -{ - char *labels = new char[atom->natoms * MDI_LABEL_LENGTH]; - memset(labels, ' ', atom->natoms * MDI_LABEL_LENGTH); - - for (int iatom = 0; iatom < atom->natoms; iatom++) { - std::string label = std::to_string(atom->type[iatom]); - int label_len = std::min(int(label.length()), MDI_LABEL_LENGTH); - strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); - } - - int ierr = MDI_Send(labels, atom->natoms * MDI_LABEL_LENGTH, MDI_CHAR, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send atom types to driver"); - - delete[] labels; -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_masses() -{ - double *const rmass = atom->rmass; - double *const mass = atom->mass; - int *const type = atom->type; - int nlocal = atom->nlocal; - - double *mass_by_atom; - double *mass_by_atom_reduced; - memory->create(mass_by_atom, atom->natoms, "mdi/engine:mass_by_atom"); - memory->create(mass_by_atom_reduced, atom->natoms, "mdi/engine:mass_by_atom_reduced"); - for (int iatom = 0; iatom < atom->natoms; iatom++) { mass_by_atom[iatom] = 0.0; } - - // determine the atomic masses - - if (rmass) { - for (int iatom = 0; iatom < nlocal; iatom++) { - mass_by_atom[atom->tag[iatom] - 1] = rmass[iatom]; - } - } else { - for (int iatom = 0; iatom < nlocal; iatom++) { - mass_by_atom[atom->tag[iatom] - 1] = mass[type[iatom]]; - } - } - - MPI_Reduce(mass_by_atom, mass_by_atom_reduced, atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - // send the atomic masses to the driver - - int ierr = MDI_Send((char *) mass_by_atom_reduced, atom->natoms, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send atom masses to driver"); - - memory->destroy(mass_by_atom); - memory->destroy(mass_by_atom_reduced); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_forces() -{ - // get conversion factor to atomic units - double force_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = (kelvin_to_hartree / force->boltz) * (force->angstrom / angstrom_to_bohr); - } else if (lmpunits == METAL) { - double ev_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = ev_to_hartree / angstrom_to_bohr; - } - - double *forces; - double *forces_reduced; - double *x_buf; - - int *mask = atom->mask; - int nlocal = atom->nlocal; - int64_t ncoords = 3 * atom->natoms; - - memory->create(forces, ncoords, "mdi/engine:forces"); - memory->create(forces_reduced, ncoords, "mdi/engine:forces_reduced"); - x_buf = new double[3 * nlocal]; - - // zero the forces array - - for (int iforce = 0; iforce < 3 * atom->natoms; iforce++) forces[iforce] = 0.0; - - // if not at a node, calculate the forces - - if (strcmp(node_engine, "@DEFAULT") == 0) { - // certain fixes, such as shake, move the coordinates - // to ensure that the coordinates do not change, store a copy - double **x = atom->x; - for (int i = 0; i < nlocal; i++) { - x_buf[3 * i + 0] = x[i][0]; - x_buf[3 * i + 1] = x[i][1]; - x_buf[3 * i + 2] = x[i][2]; - } - - // calculate the forces - update->whichflag = 1; // 1 for dynamics - update->nsteps = 1; - lmp->init(); - update->integrate->setup_minimal(1); - - if (strcmp(node_engine, "@DEFAULT") == 0) { - // restore the original set of coordinates - double **x_new = atom->x; - for (int i = 0; i < nlocal; i++) { - x_new[i][0] = x_buf[3 * i + 0]; - x_new[i][1] = x_buf[3 * i + 1]; - x_new[i][2] = x_buf[3 * i + 2]; - } - } - } - - // pick local atoms from the buffer - double **f = atom->f; - for (int i = 0; i < nlocal; i++) { - forces[3 * (atom->tag[i] - 1) + 0] = f[i][0] * force_conv; - forces[3 * (atom->tag[i] - 1) + 1] = f[i][1] * force_conv; - forces[3 * (atom->tag[i] - 1) + 2] = f[i][2] * force_conv; - } - - // reduce the forces onto rank 0 - - MPI_Reduce(forces, forces_reduced, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - // send the forces through MDI - - int ierr = MDI_Send((char *) forces_reduced, 3 * atom->natoms, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send atom forces to driver"); - - memory->destroy(forces); - memory->destroy(forces_reduced); - delete[] x_buf; -} - -/* ---------------------------------------------------------------------- */ - -// Receive forces from the driver -// mode = 0: replace current forces with forces from driver -// mode = 1: add forces from driver to current forces - -void MDIEngine2::receive_forces(int mode) -{ - // get conversion factor to atomic units - double force_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = (kelvin_to_hartree / force->boltz) * (force->angstrom / angstrom_to_bohr); - } else if (lmpunits == METAL) { - double ev_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = ev_to_hartree / angstrom_to_bohr; - } - - int64_t ncoords = 3 * atom->natoms; - double *forces; - memory->create(forces, ncoords, "mdi/engine:forces"); - - int ierr = MDI_Recv((char *) forces, 3 * atom->natoms, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to receive atom forces to driver"); - MPI_Bcast(forces, 3 * atom->natoms, MPI_DOUBLE, 0, world); - - // pick local atoms from the buffer - double **f = atom->f; - int *mask = atom->mask; - int nlocal = atom->nlocal; - - if (mode == 0) { // Replace - for (int i = 0; i < nlocal; i++) { - f[i][0] = forces[3 * (atom->tag[i] - 1) + 0] / force_conv; - f[i][1] = forces[3 * (atom->tag[i] - 1) + 1] / force_conv; - f[i][2] = forces[3 * (atom->tag[i] - 1) + 2] / force_conv; - } - } else { - for (int i = 0; i < nlocal; i++) { - f[i][0] += forces[3 * (atom->tag[i] - 1) + 0] / force_conv; - f[i][1] += forces[3 * (atom->tag[i] - 1) + 1] / force_conv; - f[i][2] += forces[3 * (atom->tag[i] - 1) + 2] / force_conv; - } - } - - memory->destroy(forces); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_cell() -{ - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - - double celldata[9]; - - celldata[0] = domain->boxhi[0] - domain->boxlo[0]; - celldata[1] = 0.0; - celldata[2] = 0.0; - celldata[3] = domain->xy; - celldata[4] = domain->boxhi[1] - domain->boxlo[1]; - celldata[5] = 0.0; - celldata[6] = domain->xz; - celldata[7] = domain->yz; - celldata[8] = domain->boxhi[2] - domain->boxlo[2]; - - // convert the units to bohr - - double unit_conv = force->angstrom * angstrom_to_bohr; - for (int icell = 0; icell < 9; icell++) { celldata[icell] *= unit_conv; } - - int ierr = MDI_Send((char *) celldata, 9, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send cell dimensions to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::receive_cell() -{ - double celldata[9]; - - // receive the new cell vector from the driver - - int ierr = MDI_Recv((char *) celldata, 9, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send cell dimensions to driver"); - MPI_Bcast(&celldata[0], 9, MPI_DOUBLE, 0, world); - - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - double unit_conv = force->angstrom * angstrom_to_bohr; - for (int icell = 0; icell < 9; icell++) { celldata[icell] /= unit_conv; } - - // ensure that the new cell vector is orthogonal - - double small = std::numeric_limits::min(); - if (abs(celldata[1]) > small or abs(celldata[2]) > small or abs(celldata[3]) > small or - abs(celldata[5]) > small or abs(celldata[6]) > small or abs(celldata[7]) > small) { - error->all(FLERR, - "MDI: LAMMPS currently only supports the >CELL command for orthogonal cell vectors"); - } - - // set the new LAMMPS cell dimensions - // This only works for orthogonal cell vectors. - // Supporting the more general case would be possible, - // but considerably more complex. - - domain->boxhi[0] = celldata[0] + domain->boxlo[0]; - domain->boxhi[1] = celldata[4] + domain->boxlo[1]; - domain->boxhi[2] = celldata[8] + domain->boxlo[2]; - domain->xy = 0.0; - domain->xz = 0.0; - domain->yz = 0.0; -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_celldispl() -{ - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - - double celldata[3]; - - celldata[0] = domain->boxlo[0]; - celldata[1] = domain->boxlo[1]; - celldata[2] = domain->boxlo[2]; - - // convert the units to bohr - - double unit_conv = force->angstrom * angstrom_to_bohr; - for (int icell = 0; icell < 3; icell++) { celldata[icell] *= unit_conv; } - - int ierr = MDI_Send((char *) celldata, 3, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send cell displacement to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::receive_celldispl() -{ - // receive the cell displacement from the driver - - double celldata[3]; - int ierr = MDI_Recv((char *) celldata, 3, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to receive cell displacement from driver"); - MPI_Bcast(&celldata[0], 3, MPI_DOUBLE, 0, world); - - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - double unit_conv = force->angstrom * angstrom_to_bohr; - - double old_boxlo[3]; - old_boxlo[0] = domain->boxlo[0]; - old_boxlo[1] = domain->boxlo[1]; - old_boxlo[2] = domain->boxlo[2]; - - // adjust the values of boxlo and boxhi for the new cell displacement vector - domain->boxlo[0] = celldata[0] / unit_conv; - domain->boxlo[1] = celldata[1] / unit_conv; - domain->boxlo[2] = celldata[2] / unit_conv; - domain->boxhi[0] += domain->boxlo[0] - old_boxlo[0]; - domain->boxhi[1] += domain->boxlo[1] - old_boxlo[1]; - domain->boxhi[2] += domain->boxlo[2] - old_boxlo[2]; -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::exchange_forces() -{ - // one-time allocation of add_force array - - if (!add_force) { - int64_t ncoords = 3 * atom->natoms; - memory->create(add_force, ncoords, "mdi/engine:add_force"); - for (int64_t i = 0; i < ncoords; i++) add_force[i] = 0.0; - } - - double **f = atom->f; - const int *const mask = atom->mask; - const int nlocal = atom->nlocal; - - // add forces from the driver - // NOTE: how is group for fix invoked now - int groupbit; - - for (int i = 0; i < nlocal; ++i) { - if (mask[i] & groupbit) { - f[i][0] += add_force[3 * (atom->tag[i] - 1) + 0]; - f[i][1] += add_force[3 * (atom->tag[i] - 1) + 1]; - f[i][2] += add_force[3 * (atom->tag[i] - 1) + 2]; - } - } -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::single_command() -{ - int length; - int ierr = MDI_Recv(&length, 1, MDI_INT, mdicomm); - if (ierr) - error->all(FLERR, "MDI single_command: no length"); - MPI_Bcast(&length, 1, MPI_INT, 0, world); - - char *cmd = new char[length+1]; - ierr = MDI_Recv(cmd, length, MDI_CHAR, mdicomm); - if (ierr) error->all(FLERR, "MDI single_command: did not receive command"); - MPI_Bcast(cmd, length, MPI_CHAR, 0, world); - cmd[length] = '\0'; - - lammps_command(lmp,cmd); - - delete [] cmd; -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::many_commands() -{ - int length; - int ierr = MDI_Recv(&length, 1, MDI_INT, mdicomm); - if (ierr) - error->all(FLERR, "MDI many_commands: no length"); - MPI_Bcast(&length, 1, MPI_INT, 0, world); - - char *cmds = new char[length+1]; - ierr = MDI_Recv(cmds, length, MDI_CHAR, mdicomm); - if (ierr) error->all(FLERR, "MDI many_commands: did not receive commands"); - MPI_Bcast(cmds, length, MPI_CHAR, 0, world); - cmds[length] = '\0'; - - char *ptr; - char *cmd = cmds; - - while (*cmd) { - ptr = strchr(cmd,'\n'); - if (ptr) *ptr = '\0'; - lammps_command(lmp,cmd); - if (!ptr) break; - cmd = ptr+1; - } - - delete [] cmds; -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::infile() -{ - int length; - int ierr = MDI_Recv(&length, 1, MDI_INT, mdicomm); - if (ierr) error->all(FLERR, "MDI infile: no length"); - MPI_Bcast(&length, 1, MPI_INT, 0, world); - - char *infile = new char[length+1]; - ierr = MDI_Recv(infile, length, MDI_CHAR, mdicomm); - if (ierr) error->all(FLERR, "MDI infile: did not receive filename"); - MPI_Bcast(infile, length, MPI_CHAR, 0, world); - cmd[length] = '\0'; - - lammps_file(lmp,infile); - - delete [] infile; -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::reset_box() -{ - int ierr; - double boxlo[3],boxhi[3],tilts[3]; - ierr = MDI_Recv(boxlo, 3, MDI_DOUBLE, mdicomm); - ierr = MDI_Recv(boxhi, 3, MDI_DOUBLE, mdicomm); - ierr = MDI_Recv(tilts, 3, MDI_DOUBLE, mdicomm); - // ierr check? - MPI_Bcast(boxlo, 3, MPI_DOUBLE, 0, world); - MPI_Bcast(boxhi, 3, MPI_DOUBLE, 0, world); - MPI_Bcast(tilts, 3, MPI_DOUBLE, 0, world); - - lammps_reset_box(lmp,boxlo,boxhi,tilts[0],tilts[1],tilts[2]); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::create_atoms() -{ - int ierr; - int natoms; - ierr = MDI_Recv(&natoms, 1, MDI_INT, mdicomm); - // ierr checks everywhere? - MPI_Bcast(&natoms, 1, MPI_INT, 0, world); - - tagint *id = nullptr; - int *type = nullptr; - double *x = nullptr; - double *v = nullptr; - imageint *image = nullptr; - - while (1) { - char label; - ierr = MDI_Recv(&label, 1, MDI_CHAR, mdicomm); - MPI_Bcast(&label, 1, MPI_CHAR, 0, world); - - if (label == '0') break; - - if (label == 'i') { - id = new tagint[natoms]; - ierr = MDI_Recv(id, natoms, MDI_INT, mdicomm); - MPI_Bcast(id, natoms, MPI_INT, 0, world); - } else if (label == 't') { - type = new int[natoms]; - ierr = MDI_Recv(type, natoms, MDI_INT, mdicomm); - MPI_Bcast(type, natoms, MPI_INT, 0, world); - } else if (label == 'x') { - x = new double[3*natoms]; - ierr = MDI_Recv(x, 3*natoms, MDI_DOUBLE, mdicomm); - MPI_Bcast(x, 3*natoms, MPI_DOUBLE, 0, world); - } else if (label == 'v') { - v = new double[3*natoms]; - ierr = MDI_Recv(v, 3*natoms, MDI_DOUBLE, mdicomm); - MPI_Bcast(v, 3*natoms, MPI_DOUBLE, 0, world); - } else if (label == 'i') { - image = new imageint[natoms]; - ierr = MDI_Recv(image, natoms, MDI_INT, mdicomm); - MPI_Bcast(image, natoms, MPI_INT, 0, world); - } - } - - if (!x || !type) - error->all(FLERR,"MDI create_atoms: did not receive atom coords or types"); - - int ncreate = lammps_create_atoms(lmp,natoms,id,type,x,v,image,1); - - if (ncreate != natoms) - error->all(FLERR, "MDI create_atoms: created atoms != sent atoms"); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_pressure() -{ - // get conversion factor to atomic units - - double pressure_conv = 1.0; - - /* - if (lmpunits == REAL) { - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - pressure_conv = kelvin_to_hartree / force->boltz; - } else if (lmpunits == METAL) { - double ev_to_hartree; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - pressure_conv = ev_to_hartree; - } - */ - - double pressure = press->compute_scalar(); - - // convert the pressure to atomic units - - pressure *= pressure_conv; - - int ierr = MDI_Send(&pressure, 1, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send pressure to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void MDIEngine2::send_virial() -{ - // get conversion factor to atomic units - - double pressure_conv = 1.0; - - /* - if (lmpunits == REAL) { - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - pressure_conv = kelvin_to_hartree / force->boltz; - } else if (lmpunits == METAL) { - double ev_to_hartree; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - pressure_conv = ev_to_hartree; - } - */ - - press->compute_vector(); - - // convert the pressure to atomic units - - //pressure *= pressure_conv; - - int ierr = MDI_Send(press->vector, 6, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR, "MDI: Unable to send pressure to driver"); -} diff --git a/src/USER-MDI/mdi_engine2.h b/src/USER-MDI/mdi_engine2.h deleted file mode 100644 index 39c168139c..0000000000 --- a/src/USER-MDI/mdi_engine2.h +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- 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 COMMAND_CLASS -// clang-format off -CommandStyle(mdi/engine2, MDIEngine2); -// clang-format on -#else - -#ifndef LMP_MDI_ENGINE2_H -#define LMP_MDI_ENGINE2_H - -#include "command.h" -#include "mdi.h" - -namespace LAMMPS_NS { - -class MDIEngine2 : public Command { - public: - MDIEngine2(LAMMPS *lmp) : Command(lmp) {} - virtual ~MDIEngine2() {} - void command(int, char **); - - int execute_command(const char *command, MDI_Comm mdicomm); - void engine_node(const char *node); - - private: - int lmpunits; // REAL or METAL - int root; // 1 for procs 0, otherwise 0 - int mode; // which mode engine is in (DEFAULT,MD,OPTG,etc) - char *cmd; - char *node_driver; // which node driver is at - char *node_engine; // which node engine is at - - MDI_Comm mdicomm; - class FixMDIEngine2 *mdi_fix; - - bool exit_flag; - bool local_exit_flag; - - // command to be executed at the target node - - char *target_command; - - char *id_ke,*id_pe,*id_press; - class Irregular *irregular; - class Minimize *minimizer; - class Compute *ke,*pe,*press; - double *add_force; - - void mdi_commands(); - void mdi_md(); - void mdi_optg(); - - void send_types(); - void send_labels(); - void send_masses(); - void receive_coordinates(); - void send_coordinates(); - void send_charges(); - void send_energy(); - void send_forces(); - void send_pe(); - void send_ke(); - void receive_forces(int); - void send_cell(); - void receive_cell(); - void send_celldispl(); - void receive_celldispl(); - void exchange_forces(); - - void single_command(); - void many_commands(); - void infile(); - void reset_box(); - void create_atoms(); - void send_pressure(); - void send_virial(); -}; - -} - -#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. - -*/ From 1e26fe2d6f7b6273a135f78935f7de25ef17c269 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 9 Sep 2021 17:16:33 -0600 Subject: [PATCH 006/130] support for reset_box and create_atom commands --- src/MDI/mdi_engine2.cpp | 236 ++++++++++++++++++++++++++-------------- src/MDI/mdi_engine2.h | 14 ++- 2 files changed, 165 insertions(+), 85 deletions(-) diff --git a/src/MDI/mdi_engine2.cpp b/src/MDI/mdi_engine2.cpp index e55a7b44a0..7c27aadd1e 100644 --- a/src/MDI/mdi_engine2.cpp +++ b/src/MDI/mdi_engine2.cpp @@ -52,6 +52,10 @@ enum{DEFAULT,MD,OPT}; // top-level MDI engine mode enum{TYPE,CHARGE,MASS,COORD,VELOCITY,FORCE}; +// stages of CREATE_ATOM commands + +enum{CREATE_ATOM,CREATE_ID,CREATE_TYPE,CREATE_X,CREATE_V,CREATE_IMAGE,CREATE_GO}; + /* ---------------------------------------------------------------------- mdi command: engine NOTE: may later have other MDI command variants? @@ -164,6 +168,9 @@ void MDIEngine2::mdi_engine(int narg, char **arg) ibuf1 = ibuf1all = nullptr; maxbuf = 0; + nbytes = -1; + create_atoms_flag = 0; + // define MDI commands that LAMMPS engine recognizes mdi_commands(); @@ -442,8 +449,8 @@ int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) // custom LAMMPS commands // ------------------------------------------------------- - } else if (strcmp(command, "LENGTH") == 0) { - length_command(); + } else if (strcmp(command, "NBYTES") == 0) { + nbytes_command(); } else if (strcmp(command, "COMMAND") == 0) { single_command(); } else if (strcmp(command, "COMMANDS") == 0) { @@ -455,7 +462,19 @@ int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) } else if (strcmp(command, "RESET_BOX") == 0) { reset_box(); } else if (strcmp(command, "CREATE_ATOM") == 0) { - create_atoms(); + create_atoms(CREATE_ATOM); + } else if (strcmp(command, "CREATE_ID") == 0) { + create_atoms(CREATE_ID); + } else if (strcmp(command, "CREATE_TYPE") == 0) { + create_atoms(CREATE_TYPE); + } else if (strcmp(command, "CREATE_X") == 0) { + create_atoms(CREATE_X); + } else if (strcmp(command, "CREATE_V") == 0) { + create_atoms(CREATE_V); + } else if (strcmp(command, "CREATE_IMG") == 0) { + create_atoms(CREATE_IMAGE); + } else if (strcmp(command, "CREATE_GO") == 0) { + create_atoms(CREATE_GO); } else if (strcmp(command, "all(FLERR,"MDI: LENGTH data"); - MPI_Bcast(&length_param,1,MPI_INT,0,world); + int ierr = MDI_Recv(&nbytes,1,MDI_INT,mdicomm); + if (ierr) error->all(FLERR,"MDI: NBYTES data"); + MPI_Bcast(&nbytes,1,MPI_INT,0,world); } /* ---------------------------------------------------------------------- COMMAND command - store received value as string of length length_param + store received value as string of length nbytes invoke as a LAMMPS command ---------------------------------------------------------------------- */ void MDIEngine2::single_command() { - char *cmd = new char[length_param+1]; - int ierr = MDI_Recv(cmd,length_param+1,MDI_CHAR,mdicomm); + if (nbytes < 0) error->all(FLERR,"MDI: COMMAND nbytes has not been set"); + + char *cmd = new char[nbytes+1]; + int ierr = MDI_Recv(cmd,nbytes+1,MDI_CHAR,mdicomm); if (ierr) error->all(FLERR,"MDI: COMMAND data"); - MPI_Bcast(cmd,length_param+1,MPI_CHAR,0,world); - cmd[length_param+1] = '\0'; + MPI_Bcast(cmd,nbytes+1,MPI_CHAR,0,world); + cmd[nbytes+1] = '\0'; lammps_command(lmp,cmd); @@ -1244,17 +1271,19 @@ void MDIEngine2::single_command() /* ---------------------------------------------------------------------- COMMANDS command - store received value as multi-line string of length length_param + store received value as multi-line string of length nbytes invoke as multiple LAMMPS commands ---------------------------------------------------------------------- */ void MDIEngine2::many_commands() { - char *cmds = new char[length_param+1]; - int ierr = MDI_Recv(cmds, length_param+1, MDI_CHAR, mdicomm); + if (nbytes < 0) error->all(FLERR,"MDI: COMMANDS nbytes has not been set"); + + char *cmds = new char[nbytes+1]; + int ierr = MDI_Recv(cmds, nbytes+1, MDI_CHAR, mdicomm); if (ierr) error->all(FLERR,"MDI: COMMANDS data"); - MPI_Bcast(cmds,length_param+1,MPI_CHAR,0,world); - cmds[length_param+1] = '\0'; + MPI_Bcast(cmds,nbytes+1,MPI_CHAR,0,world); + cmds[nbytes+1] = '\0'; lammps_commands_string(lmp,cmds); @@ -1269,11 +1298,13 @@ void MDIEngine2::many_commands() void MDIEngine2::infile() { - char *infile = new char[length_param+1]; - int ierr = MDI_Recv(infile,length_param+1,MDI_CHAR,mdicomm); + if (nbytes < 0) error->all(FLERR,"MDI: INFILE nbytes has not been set"); + + char *infile = new char[nbytes+1]; + int ierr = MDI_Recv(infile,nbytes+1,MDI_CHAR,mdicomm); if (ierr) error->all(FLERR,"MDI: INFILE data"); - MPI_Bcast(infile,length_param+1,MPI_CHAR,0,world); - infile[length_param+1] = '\0'; + MPI_Bcast(infile,nbytes+1,MPI_CHAR,0,world); + infile[nbytes+1] = '\0'; lammps_file(lmp,infile); @@ -1316,26 +1347,24 @@ void MDIEngine2::evaluate() /* ---------------------------------------------------------------------- RESET_BOX command + 9 values = boxlo, boxhi, xy, yz, xz wrapper on library reset_box() method requires no atoms exist allows caller to define a new simulation box - NOTE: this will not work in plugin mode, b/c of 3 MDI_Recv() calls - how to effectively do this? ---------------------------------------------------------------------- */ void MDIEngine2::reset_box() { int ierr; - double boxlo[3],boxhi[3],tilts[3]; - ierr = MDI_Recv(boxlo, 3, MDI_DOUBLE, mdicomm); - ierr = MDI_Recv(boxhi, 3, MDI_DOUBLE, mdicomm); - ierr = MDI_Recv(tilts, 3, MDI_DOUBLE, mdicomm); - // ierr check? - MPI_Bcast(boxlo, 3, MPI_DOUBLE, 0, world); - MPI_Bcast(boxhi, 3, MPI_DOUBLE, 0, world); - MPI_Bcast(tilts, 3, MPI_DOUBLE, 0, world); + double values[9]; - lammps_reset_box(lmp,boxlo,boxhi,tilts[0],tilts[1],tilts[2]); + if (atom->natoms > 0) + error->all(FLERR,"MDI RESET_BOX cannot be used when atoms exist"); + + ierr = MDI_Recv(values,9,MDI_DOUBLE,mdicomm); + MPI_Bcast(values,9,MPI_DOUBLE,0,world); + + lammps_reset_box(lmp,&values[0],&values[3],values[6],values[7],values[8]); } /* ---------------------------------------------------------------------- @@ -1344,62 +1373,105 @@ void MDIEngine2::reset_box() requires simulation box be defined allows caller to define a new set of atoms with their IDs, types, coords, velocities, image flags - NOTE: this will not work in plugin mode, b/c of multiple MDI_Recv() calls - how to effectively do this? - NOTE: also the memory here is not yet allocated correctly + called in stages via flag + since MDI plugin mode only allows 1 MDI Send/Recv per MDI command + assumes current atom->natoms set by >NATOMS command is correct ---------------------------------------------------------------------- */ -void MDIEngine2::create_atoms() +void MDIEngine2::create_atoms(int flag) { int ierr; - int natoms; - ierr = MDI_Recv(&natoms, 1, MDI_INT, mdicomm); - // ierr checks everywhere? - MPI_Bcast(&natoms, 1, MPI_INT, 0, world); - tagint *id = nullptr; - int *type = nullptr; - double *x = nullptr; - double *v = nullptr; - imageint *image = nullptr; + // NOTE: error check on imageint = INT - while (1) { - char label; - ierr = MDI_Recv(&label, 1, MDI_CHAR, mdicomm); - MPI_Bcast(&label, 1, MPI_CHAR, 0, world); + if (flag == CREATE_ATOM) { - if (label == '0') break; + if (create_atoms_flag) + error->all(FLERR,"MDI CREATE_ATOM already in progress"); - if (label == 'i') { - id = new tagint[natoms]; - ierr = MDI_Recv(id, natoms, MDI_INT, mdicomm); - MPI_Bcast(id, natoms, MPI_INT, 0, world); - } else if (label == 't') { - type = new int[natoms]; - ierr = MDI_Recv(type, natoms, MDI_INT, mdicomm); - MPI_Bcast(type, natoms, MPI_INT, 0, world); - } else if (label == 'x') { - x = new double[3*natoms]; - ierr = MDI_Recv(x, 3*natoms, MDI_DOUBLE, mdicomm); - MPI_Bcast(x, 3*natoms, MPI_DOUBLE, 0, world); - } else if (label == 'v') { - v = new double[3*natoms]; - ierr = MDI_Recv(v, 3*natoms, MDI_DOUBLE, mdicomm); - MPI_Bcast(v, 3*natoms, MPI_DOUBLE, 0, world); - } else if (label == 'i') { - image = new imageint[natoms]; - ierr = MDI_Recv(image, natoms, MDI_INT, mdicomm); - MPI_Bcast(image, natoms, MPI_INT, 0, world); - } + create_atoms_flag = 1; + create_id = nullptr; + create_type = nullptr; + create_x = nullptr; + create_v = nullptr; + create_image = nullptr; + + } else if (flag == CREATE_ID) { + + if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); + if (create_id) error->all(FLERR,"MDI CREATE_ATOM already in progress"); + + int natoms = atom->natoms; + memory->create(create_id,natoms,"mdi:create_id"); + ierr = MDI_Recv(create_id,natoms,MDI_INT,mdicomm); + MPI_Bcast(create_id,natoms,MPI_INT,0,world); + + } else if (flag == CREATE_TYPE) { + + if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); + if (create_type) error->all(FLERR,"MDI CREATE_ATOM already in progress"); + + int natoms = atom->natoms; + if (create_type) error->all(FLERR,"MDI CREATE_ATOM already in progress"); + memory->create(create_type,natoms,"mdi:create_type"); + ierr = MDI_Recv(create_type,natoms,MDI_INT,mdicomm); + MPI_Bcast(create_type,natoms,MPI_INT,0,world); + + } else if (flag == CREATE_X) { + + if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); + if (create_x) error->all(FLERR,"MDI CREATE_ATOM already in progress"); + + int natoms = atom->natoms; + if (create_x) error->all(FLERR,"MDI CREATE_ATOM already in progress"); + memory->create(create_x,3*natoms,"mdi:create_x"); + ierr = MDI_Recv(create_x,3*natoms,MDI_DOUBLE,mdicomm); + MPI_Bcast(create_x,3*natoms,MPI_DOUBLE,0,world); + + } else if (flag == CREATE_V) { + + if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); + if (create_v) error->all(FLERR,"MDI CREATE_ATOM already in progress"); + + int natoms = atom->natoms; + if (create_v) error->all(FLERR,"MDI CREATE_ATOM already in progress"); + memory->create(create_v,3*natoms,"mdi:create_x"); + ierr = MDI_Recv(create_v,3*natoms,MDI_DOUBLE,mdicomm); + MPI_Bcast(create_v,3*natoms,MPI_DOUBLE,0,world); + + } else if (flag == CREATE_IMAGE) { + + if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); + if (create_image) error->all(FLERR,"MDI CREATE_ATOM already in progress"); + + int natoms = atom->natoms; + if (create_image) error->all(FLERR,"MDI CREATE_ATOM already in progress"); + memory->create(create_image,natoms,"mdi:create_image"); + ierr = MDI_Recv(create_image,natoms,MDI_INT,mdicomm); + MPI_Bcast(create_image,natoms,MPI_INT,0,world); + + } else if (flag == CREATE_GO) { + + if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); + if (!create_type || !create_x) + error->all(FLERR,"MDI: CREATE_ATOM requires types and coords"); + + int natom = atom->natoms; + int ncreate = lammps_create_atoms(lmp,natom,create_id,create_type, + create_x,create_v,create_image,1); + + if (ncreate != natom) + error->all(FLERR, "MDI: CREATE ATOM created atoms != sent atoms"); + + // clean up create_atoms state + + create_atoms_flag = 0; + memory->destroy(create_id); + memory->destroy(create_type); + memory->destroy(create_x); + memory->destroy(create_v); + memory->destroy(create_image); } - - if (!x || !type) - error->all(FLERR,"MDI: CREATE_ATOM did not receive atom coords or types"); - - int ncreate = lammps_create_atoms(lmp,natoms,id,type,x,v,image,1); - - if (ncreate != natoms) - error->all(FLERR, "MDI: CREATE ATOM created atoms != sent atoms"); } /* ---------------------------------------------------------------------- diff --git a/src/MDI/mdi_engine2.h b/src/MDI/mdi_engine2.h index 4ef487ad06..edf6be7cfb 100644 --- a/src/MDI/mdi_engine2.h +++ b/src/MDI/mdi_engine2.h @@ -55,7 +55,15 @@ class MDIEngine2 : public Command { class Minimize *minimizer; class Compute *ke,*pe,*press; - int length_param; // LENGTH command value used by other commands + int nbytes; // NBYTES command value used by other commands + + // create_atoms state + + int create_atoms_flag; + tagint *create_id; + int *create_type; + double *create_x,*create_v; + imageint *create_image; // unit conversion factors @@ -98,13 +106,13 @@ class MDIEngine2 : public Command { void send_celldispl(); void receive_celldispl(); - void length_command(); + void nbytes_command(); void single_command(); void many_commands(); void infile(); void evaluate(); void reset_box(); - void create_atoms(); + void create_atoms(int); void send_pressure(); void send_ptensor(); From 0029ed106b832ef6d9a1d6475553ec3b32a7b69c Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 10 Sep 2021 17:59:19 -0600 Subject: [PATCH 007/130] more adjustments to MDI engine code --- src/MDI/mdi_engine2.cpp | 54 ++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/MDI/mdi_engine2.cpp b/src/MDI/mdi_engine2.cpp index 7c27aadd1e..254a87289a 100644 --- a/src/MDI/mdi_engine2.cpp +++ b/src/MDI/mdi_engine2.cpp @@ -97,24 +97,6 @@ void MDIEngine2::mdi_engine(int narg, char **arg) if (role != MDI_ENGINE) error->all(FLERR,"Must invoke LAMMPS as an MDI engine to use mdi engine"); - // NOTE: create this fix only when @INIT_MD is triggered? - // if not needed, I dont think it should be defined, - // otherwise it will be be invoked in other use cases - // and switch engine out of DEFAULT node ? - - //int ifix = modify->find_fix_by_style("mdi/engine"); - //bool added_mdi_engine_fix = false; - //if (ifix < 0) { - // modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine"); - // added_mdi_engine_fix = true; - // } - - // identify the mdi_engine fix - - //ifix = modify->find_fix_by_style("mdi/engine"); - //mdi_fix = static_cast(modify->fix[ifix]); - //mdi_fix->mdi_engine = this; - // root = 1 for proc 0, otherwise 0 root = (comm->me == 0) ? 1 : 0; @@ -230,11 +212,6 @@ void MDIEngine2::mdi_engine(int narg, char **arg) memory->destroy(ibuf1all); memory->destroy(buf1all); memory->destroy(buf3all); - - // remove mdi/engine fix that mdi engine instantiated - // NOTE: decide whether to make this optional, see above - - //if (added_mdi_engine_fix) modify->delete_fix("MDI_ENGINE_INTERNAL"); } /* ---------------------------------------------------------------------- @@ -250,6 +227,7 @@ void MDIEngine2::engine_node(const char *node) // do not process commands if engine and driver are not at same node strncpy(node_engine,node,MDI_COMMAND_LENGTH); + if (strcmp(node_driver,"\0") != 0 && strcmp(node_driver,node_engine) != 0) node_match = false; @@ -511,6 +489,8 @@ void MDIEngine2::mdi_commands() MDI_Register_command("@DEFAULT", "find_fix_by_style("mdi/engine2"); + //bool added_mdi_engine_fix = false; + //if (ifix < 0) { + + modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine2"); + int ifix = modify->find_fix_by_style("mdi/engine2"); + mdi_fix = static_cast(modify->fix[ifix]); + mdi_fix->mdi_engine = this; + // initialize a new MD simulation update->whichflag = 1; @@ -706,6 +699,10 @@ void MDIEngine2::mdi_md() if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; } + + // remove mdi/engine fix this method instantiated + + modify->delete_fix("MDI_ENGINE_INTERNAL"); } /* ---------------------------------------------------------------------- @@ -1316,14 +1313,17 @@ void MDIEngine2::infile() compute forces, energy, pressure of current system can be called multiple times by driver for a system that is continuously evolving - distinguishes between first-time call vs - system needs reneighboring vs system does not need reneighboring - does not increment timestep + distinguishes between: + (1) first-time call + (2) system needs reneighboring + (3) system does not need reneighboring + this method does NOT increment timestep ---------------------------------------------------------------------- */ void MDIEngine2::evaluate() { if (neighbor->ago < 0) { + update->whichflag = 1; lmp->init(); update->integrate->setup(0); From dcfdddf83f2a1c172b5506e26f0c7578e8a90205 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 23 Sep 2021 12:39:11 -0600 Subject: [PATCH 008/130] more bug fixes for new MDI classs --- src/MDI/fix_mdi_engine2.cpp | 19 ++--- src/MDI/fix_mdi_engine2.h | 5 +- src/MDI/mdi_engine2.cpp | 140 ++++++++++++++++++++---------------- 3 files changed, 91 insertions(+), 73 deletions(-) diff --git a/src/MDI/fix_mdi_engine2.cpp b/src/MDI/fix_mdi_engine2.cpp index 420940bb41..27d0ed3785 100644 --- a/src/MDI/fix_mdi_engine2.cpp +++ b/src/MDI/fix_mdi_engine2.cpp @@ -40,18 +40,12 @@ int FixMDIEngine2::setmask() mask |= POST_FORCE; mask |= MIN_PRE_FORCE; mask |= MIN_POST_FORCE; + mask |= END_OF_STEP; return mask; } /* ---------------------------------------------------------------------- */ -void FixMDIEngine2::min_setup(int vflag) -{ - mdi_engine->engine_node("@FORCES"); -} - -/* ---------------------------------------------------------------------- */ - void FixMDIEngine2::post_integrate() { mdi_engine->engine_node("@COORDS"); @@ -66,6 +60,13 @@ void FixMDIEngine2::min_pre_force(int vflag) /* ---------------------------------------------------------------------- */ +void FixMDIEngine2::post_force(int vflag) +{ + mdi_engine->engine_node("@FORCES"); +} + +/* ---------------------------------------------------------------------- */ + void FixMDIEngine2::min_post_force(int vflag) { mdi_engine->engine_node("@FORCES"); @@ -73,7 +74,7 @@ void FixMDIEngine2::min_post_force(int vflag) /* ---------------------------------------------------------------------- */ -void FixMDIEngine2::post_force(int vflag) +void FixMDIEngine2::end_of_step() { - mdi_engine->engine_node("@FORCES"); + mdi_engine->engine_node("@ENDSTEP"); } diff --git a/src/MDI/fix_mdi_engine2.h b/src/MDI/fix_mdi_engine2.h index 43c39f382b..2a9cabb7fc 100644 --- a/src/MDI/fix_mdi_engine2.h +++ b/src/MDI/fix_mdi_engine2.h @@ -32,12 +32,11 @@ class FixMDIEngine2 : public Fix { ~FixMDIEngine2() {} int setmask(); void init() {} - - void min_setup(int); void post_integrate(); - void post_force(int); void min_pre_force(int); + void post_force(int); void min_post_force(int); + void end_of_step(); }; } // namespace LAMMPS_NS diff --git a/src/MDI/mdi_engine2.cpp b/src/MDI/mdi_engine2.cpp index 254a87289a..b486dfe52f 100644 --- a/src/MDI/mdi_engine2.cpp +++ b/src/MDI/mdi_engine2.cpp @@ -37,6 +37,7 @@ #include "modify.h" #include "neighbor.h" #include "output.h" +#include "thermo.h" #include "timer.h" #include "update.h" #include "verlet.h" @@ -408,6 +409,10 @@ int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) strncpy(node_driver,"@FORCES",MDI_COMMAND_LENGTH); node_match = false; + } else if (strcmp(command,"@ENDSTEP") == 0) { + strncpy(node_driver,"@ENDSTEP",MDI_COMMAND_LENGTH); + node_match = false; + // exit command } else if (strcmp(command, "EXIT") == 0) { @@ -427,35 +432,35 @@ int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) // custom LAMMPS commands // ------------------------------------------------------- - } else if (strcmp(command, "NBYTES") == 0) { + } else if (strcmp(command,"NBYTES") == 0) { nbytes_command(); - } else if (strcmp(command, "COMMAND") == 0) { + } else if (strcmp(command,"COMMAND") == 0) { single_command(); - } else if (strcmp(command, "COMMANDS") == 0) { + } else if (strcmp(command,"COMMANDS") == 0) { many_commands(); - } else if (strcmp(command, "INFILE") == 0) { + } else if (strcmp(command,"INFILE") == 0) { infile(); - } else if (strcmp(command, "EVAL") == 0) { + } else if (strcmp(command,"EVAL") == 0) { evaluate(); - } else if (strcmp(command, "RESET_BOX") == 0) { + } else if (strcmp(command,"RESET_BOX") == 0) { reset_box(); - } else if (strcmp(command, "CREATE_ATOM") == 0) { + } else if (strcmp(command,"CREATE_ATOM") == 0) { create_atoms(CREATE_ATOM); - } else if (strcmp(command, "CREATE_ID") == 0) { + } else if (strcmp(command,"CREATE_ID") == 0) { create_atoms(CREATE_ID); - } else if (strcmp(command, "CREATE_TYPE") == 0) { + } else if (strcmp(command,"CREATE_TYPE") == 0) { create_atoms(CREATE_TYPE); - } else if (strcmp(command, "CREATE_X") == 0) { + } else if (strcmp(command,"CREATE_X") == 0) { create_atoms(CREATE_X); - } else if (strcmp(command, "CREATE_V") == 0) { + } else if (strcmp(command,"CREATE_V") == 0) { create_atoms(CREATE_V); - } else if (strcmp(command, "CREATE_IMG") == 0) { + } else if (strcmp(command,"CREATE_IMG") == 0) { create_atoms(CREATE_IMAGE); - } else if (strcmp(command, "CREATE_GO") == 0) { + } else if (strcmp(command,"CREATE_GO") == 0) { create_atoms(CREATE_GO); - } else if (strcmp(command, "FORCES"); MDI_Register_command("@INIT_MD", ">+FORCES"); MDI_Register_command("@INIT_MD", "@"); - MDI_Register_command("@INIT_MD", "@COORDS"); MDI_Register_command("@INIT_MD", "@DEFAULT"); + MDI_Register_command("@INIT_MD", "@COORDS"); MDI_Register_command("@INIT_MD", "@FORCES"); + MDI_Register_command("@INIT_MD", "@ENDSTEP"); MDI_Register_command("@INIT_MD", "EXIT"); // node for setting up and running a minimization @@ -551,11 +557,40 @@ void MDIEngine2::mdi_commands() MDI_Register_command("@INIT_OPTG", ">FORCES"); MDI_Register_command("@INIT_OPTG", ">+FORCES"); MDI_Register_command("@INIT_OPTG", "@"); - MDI_Register_command("@INIT_OPTG", "@COORDS"); MDI_Register_command("@INIT_OPTG", "@DEFAULT"); + MDI_Register_command("@INIT_OPTG", "@COORDS"); MDI_Register_command("@INIT_OPTG", "@FORCES"); + MDI_Register_command("@INIT_OPTG", "@ENDSTEP"); MDI_Register_command("@INIT_OPTG", "EXIT"); + // node at POST_INTEGRATE location in timestep + + MDI_Register_node("@COORDS"); + MDI_Register_command("@COORDS", "<@"); + MDI_Register_command("@COORDS", "CELL"); + MDI_Register_command("@COORDS", ">CELL_DISPL"); + MDI_Register_command("@COORDS", ">COORDS"); + MDI_Register_command("@COORDS", ">FORCES"); + MDI_Register_command("@COORDS", ">+FORCES"); + MDI_Register_command("@COORDS", "@"); + MDI_Register_command("@COORDS", "@DEFAULT"); + MDI_Register_command("@COORDS", "@COORDS"); + MDI_Register_command("@COORDS", "@FORCES"); + MDI_Register_command("@COORDS", "@ENDSTEP"); + MDI_Register_command("@COORDS", "EXIT"); + // node at POST_FORCE location in timestep MDI_Register_node("@FORCES"); @@ -580,37 +615,23 @@ void MDIEngine2::mdi_commands() MDI_Register_command("@FORCES", ">FORCES"); MDI_Register_command("@FORCES", ">+FORCES"); MDI_Register_command("@FORCES", "@"); - MDI_Register_command("@FORCES", "@COORDS"); MDI_Register_command("@FORCES", "@DEFAULT"); + MDI_Register_command("@FORCES", "@COORDS"); MDI_Register_command("@FORCES", "@FORCES"); + MDI_Register_command("@FORCES", "@ENDSTEP"); MDI_Register_command("@FORCES", "EXIT"); - // node at POST_INTEGRATE location in timestep + // node at END_OF_STEP location in timestep - MDI_Register_node("@COORDS"); - MDI_Register_command("@COORDS", "<@"); - MDI_Register_command("@COORDS", "CELL"); - MDI_Register_command("@COORDS", ">CELL_DISPL"); - MDI_Register_command("@COORDS", ">COORDS"); - MDI_Register_command("@COORDS", ">FORCES"); - MDI_Register_command("@COORDS", ">+FORCES"); - MDI_Register_command("@COORDS", "@"); - MDI_Register_command("@COORDS", "@COORDS"); - MDI_Register_command("@COORDS", "@DEFAULT"); - MDI_Register_command("@COORDS", "@FORCES"); - MDI_Register_command("@COORDS", "EXIT"); + MDI_Register_node("@ENDSTEP"); + MDI_Register_command("@ENDSTEP", "<@"); + MDI_Register_command("@ENDSTEP", "find_fix_by_style("mdi/engine2"); //bool added_mdi_engine_fix = false; //if (ifix < 0) { + // NOTE: delete fix if already defined ? + // also delete in destructor if defined + // remove mdi/engine fix this method instantiated + //modify->delete_fix("MDI_ENGINE_INTERNAL"); + modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine2"); int ifix = modify->find_fix_by_style("mdi/engine2"); mdi_fix = static_cast(modify->fix[ifix]); @@ -670,6 +691,7 @@ void MDIEngine2::mdi_md() lmp->init(); // engine is now at @INIT_MD node + // receive any commands driver may wish to send engine_node("@INIT_MD"); if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; @@ -678,10 +700,9 @@ void MDIEngine2::mdi_md() update->integrate->setup(1); - engine_node("@FORCES"); - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; - - // run MD one step at a time + // run MD one step at a time until driver sends @DEFAULT or EXIT + // driver can communicate with LAMMPS within each timestep + // by sending a node command which matches a method in FixMDIEngine while (1) { update->whichflag = 1; @@ -695,14 +716,10 @@ void MDIEngine2::mdi_md() update->integrate->run(1); - // done with MD if driver sends @DEFAULT or EXIT + // driver triggers end of MD loop by senging @DEFAULT or EXIT if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; } - - // remove mdi/engine fix this method instantiated - - modify->delete_fix("MDI_ENGINE_INTERNAL"); } /* ---------------------------------------------------------------------- @@ -1054,8 +1071,6 @@ void MDIEngine2::send_labels() void MDIEngine2::send_total_energy() { - double convert = 1.0; - double potential_energy = pe->compute_scalar(); double kinetic_energy = ke->compute_scalar(); double total_energy = potential_energy + kinetic_energy; @@ -1326,12 +1341,13 @@ void MDIEngine2::evaluate() update->whichflag = 1; lmp->init(); - update->integrate->setup(0); + update->integrate->setup(1); } else { // insure potential energy and virial are tallied on this step + update->ntimestep++; pe->addstep(update->ntimestep); press->addstep(update->ntimestep); @@ -1339,8 +1355,10 @@ void MDIEngine2::evaluate() if (nflag == 0) { comm->forward_comm(); update->integrate->setup_minimal(0); + output->thermo->compute(1); } else { update->integrate->setup_minimal(1); + output->thermo->compute(1); } } } From 8b69b232a8c8c8f581817cf1ea6b86d2991af318 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 23 Sep 2021 12:48:43 -0600 Subject: [PATCH 009/130] rename old version to old in filename --- ..._mdi_engine.cpp => fix_mdi_engine_old.cpp} | 56 +++++++++---------- ...{fix_mdi_engine.h => fix_mdi_engine_old.h} | 12 ++-- src/MDI/library_mdi.cpp | 8 +-- .../{mdi_engine.cpp => mdi_engine_old.cpp} | 18 +++--- src/MDI/{mdi_engine.h => mdi_engine_old.h} | 14 ++--- 5 files changed, 54 insertions(+), 54 deletions(-) rename src/MDI/{fix_mdi_engine.cpp => fix_mdi_engine_old.cpp} (95%) rename src/MDI/{fix_mdi_engine.h => fix_mdi_engine_old.h} (94%) rename src/MDI/{mdi_engine.cpp => mdi_engine_old.cpp} (96%) rename src/MDI/{mdi_engine.h => mdi_engine_old.h} (82%) diff --git a/src/MDI/fix_mdi_engine.cpp b/src/MDI/fix_mdi_engine_old.cpp similarity index 95% rename from src/MDI/fix_mdi_engine.cpp rename to src/MDI/fix_mdi_engine_old.cpp index f79f3b9980..55ca7893e5 100644 --- a/src/MDI/fix_mdi_engine.cpp +++ b/src/MDI/fix_mdi_engine_old.cpp @@ -16,7 +16,7 @@ MolSSI Driver Interface (MDI) support for LAMMPS ------------------------------------------------------------------------- */ -#include "fix_mdi_engine.h" +#include "fix_mdi_engine_old.h" #include "library_mdi.h" #include "atom.h" @@ -42,7 +42,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixMDIEngine::FixMDIEngine(LAMMPS *lmp, int narg, char **arg) : +FixMDIEngineOld::FixMDIEngineOld(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), id_pe(nullptr), id_ke(nullptr), pe(nullptr), ke(nullptr) { if (narg != 3) error->all(FLERR, "Illegal fix mdi command"); @@ -96,7 +96,7 @@ FixMDIEngine::FixMDIEngine(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixMDIEngine::~FixMDIEngine() +FixMDIEngineOld::~FixMDIEngineOld() { delete[] target_command; delete[] command; @@ -111,7 +111,7 @@ FixMDIEngine::~FixMDIEngine() /* ---------------------------------------------------------------------- */ -int FixMDIEngine::setmask() +int FixMDIEngineOld::setmask() { int mask = 0; @@ -125,7 +125,7 @@ int FixMDIEngine::setmask() /* ---------------------------------------------------------------------- */ -void FixMDIEngine::exchange_forces() +void FixMDIEngineOld::exchange_forces() { double **f = atom->f; const int *const mask = atom->mask; @@ -144,7 +144,7 @@ void FixMDIEngine::exchange_forces() /* ---------------------------------------------------------------------- */ -void FixMDIEngine::init() +void FixMDIEngineOld::init() { // confirm that two required computes are still available @@ -167,35 +167,35 @@ void FixMDIEngine::init() /* ---------------------------------------------------------------------- */ -void FixMDIEngine::min_setup(int /* vflag */) +void FixMDIEngineOld::min_setup(int /* vflag */) { engine_mode("@FORCES"); } /* ---------------------------------------------------------------------- */ -void FixMDIEngine::post_integrate() +void FixMDIEngineOld::post_integrate() { engine_mode("@COORDS"); } /* ---------------------------------------------------------------------- */ -void FixMDIEngine::min_pre_force(int /* vflag */) +void FixMDIEngineOld::min_pre_force(int /* vflag */) { engine_mode("@COORDS"); } /* ---------------------------------------------------------------------- */ -void FixMDIEngine::min_post_force(int /* vflag */) +void FixMDIEngineOld::min_post_force(int /* vflag */) { engine_mode("@FORCES"); } /* ---------------------------------------------------------------------- */ -void FixMDIEngine::post_force(int /* vflag */) +void FixMDIEngineOld::post_force(int /* vflag */) { if (most_recent_init == 1) engine_mode("@FORCES"); @@ -213,7 +213,7 @@ void FixMDIEngine::post_force(int /* vflag */) process a single command from driver ---------------------------------------------------------------------- */ -int FixMDIEngine::execute_command(const char *command, MDI_Comm mdicomm) +int FixMDIEngineOld::execute_command(const char *command, MDI_Comm mdicomm) { // confirm this command is supported at this node @@ -369,7 +369,7 @@ int FixMDIEngine::execute_command(const char *command, MDI_Comm mdicomm) /* ---------------------------------------------------------------------- */ -char *FixMDIEngine::engine_mode(const char *node) +char *FixMDIEngineOld::engine_mode(const char *node) { /* if (screen) @@ -426,7 +426,7 @@ char *FixMDIEngine::engine_mode(const char *node) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::receive_coordinates(Error *error) +void FixMDIEngineOld::receive_coordinates(Error *error) { // get conversion factor to atomic units double posconv; @@ -484,7 +484,7 @@ void FixMDIEngine::receive_coordinates(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::send_coordinates(Error *error) +void FixMDIEngineOld::send_coordinates(Error *error) { // get conversion factor to atomic units double posconv; @@ -529,7 +529,7 @@ void FixMDIEngine::send_coordinates(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::send_charges(Error *error) +void FixMDIEngineOld::send_charges(Error *error) { double *charges; double *charges_reduced; @@ -558,7 +558,7 @@ void FixMDIEngine::send_charges(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::send_energy(Error *error) +void FixMDIEngineOld::send_energy(Error *error) { // get conversion factor to atomic units double energy_conv = 1.0; @@ -591,7 +591,7 @@ void FixMDIEngine::send_energy(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::send_pe(Error *error) +void FixMDIEngineOld::send_pe(Error *error) { // get conversion factor to atomic units double energy_conv; @@ -617,7 +617,7 @@ void FixMDIEngine::send_pe(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::send_ke(Error *error) +void FixMDIEngineOld::send_ke(Error *error) { // get conversion factor to atomic units double energy_conv; @@ -643,7 +643,7 @@ void FixMDIEngine::send_ke(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::send_types(Error *error) +void FixMDIEngineOld::send_types(Error *error) { int *const type = atom->type; @@ -653,7 +653,7 @@ void FixMDIEngine::send_types(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::send_labels(Error *error) +void FixMDIEngineOld::send_labels(Error *error) { char *labels = new char[atom->natoms * MDI_LABEL_LENGTH]; memset(labels, ' ', atom->natoms * MDI_LABEL_LENGTH); @@ -672,7 +672,7 @@ void FixMDIEngine::send_labels(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::send_masses(Error *error) +void FixMDIEngineOld::send_masses(Error *error) { double *const rmass = atom->rmass; double *const mass = atom->mass; @@ -710,7 +710,7 @@ void FixMDIEngine::send_masses(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::send_forces(Error *error) +void FixMDIEngineOld::send_forces(Error *error) { // get conversion factor to atomic units double force_conv; @@ -798,7 +798,7 @@ void FixMDIEngine::send_forces(Error *error) // mode = 0: replace current forces with forces from driver // mode = 1: add forces from driver to current forces -void FixMDIEngine::receive_forces(Error *error, int mode) +void FixMDIEngineOld::receive_forces(Error *error, int mode) { // get conversion factor to atomic units double force_conv; @@ -847,7 +847,7 @@ void FixMDIEngine::receive_forces(Error *error, int mode) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::send_cell(Error *error) +void FixMDIEngineOld::send_cell(Error *error) { double angstrom_to_bohr; MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); @@ -875,7 +875,7 @@ void FixMDIEngine::send_cell(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::receive_cell(Error *error) +void FixMDIEngineOld::receive_cell(Error *error) { double celldata[9]; @@ -911,7 +911,7 @@ void FixMDIEngine::receive_cell(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::send_celldispl(Error *error) +void FixMDIEngineOld::send_celldispl(Error *error) { double angstrom_to_bohr; MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); @@ -933,7 +933,7 @@ void FixMDIEngine::send_celldispl(Error *error) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::receive_celldispl(Error *error) +void FixMDIEngineOld::receive_celldispl(Error *error) { // receive the cell displacement from the driver double celldata[3]; diff --git a/src/MDI/fix_mdi_engine.h b/src/MDI/fix_mdi_engine_old.h similarity index 94% rename from src/MDI/fix_mdi_engine.h rename to src/MDI/fix_mdi_engine_old.h index e3d6b37772..4fc87999a0 100644 --- a/src/MDI/fix_mdi_engine.h +++ b/src/MDI/fix_mdi_engine_old.h @@ -13,22 +13,22 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(mdi/engine, FixMDIEngine); +FixStyle(mdi/engine/old, FixMDIEngineOld); // clang-format on #else -#ifndef LMP_FIX_MDI_ENGINE_H -#define LMP_FIX_MDI_ENGINE_H +#ifndef LMP_FIX_MDI_ENGINE_OLD_H +#define LMP_FIX_MDI_ENGINE_OLD_H #include "fix.h" #include "mdi.h" namespace LAMMPS_NS { -class FixMDIEngine : public Fix { +class FixMDIEngineOld : public Fix { public: - FixMDIEngine(class LAMMPS *, int, char **); - ~FixMDIEngine(); + FixMDIEngineOld(class LAMMPS *, int, char **); + ~FixMDIEngineOld(); int setmask(); void init(); diff --git a/src/MDI/library_mdi.cpp b/src/MDI/library_mdi.cpp index 5d4992e2b6..d5489207a4 100644 --- a/src/MDI/library_mdi.cpp +++ b/src/MDI/library_mdi.cpp @@ -23,7 +23,7 @@ #define LAMMPS_LIB_MPI 1 #include "library.h" -#include "fix_mdi_engine.h" +#include "fix_mdi_engine_old.h" #include @@ -122,9 +122,9 @@ The function executes a single command from an external MDI driver. int lammps_execute_mdi_command(const char *command, MDI_Comm comm, void *class_obj) { - FixMDIEngine *mdi_fix = (FixMDIEngine *) class_obj; + FixMDIEngineOld *mdi_fix = (FixMDIEngineOld *) class_obj; return mdi_fix->execute_command(command, comm); - // MDIEngine2 *mdi_engine = (MDIEngine2 *) class_obj; - // return mdi_engine->execute_command(command, comm); + //MDIEngine2 *mdi_engine = (MDIEngine2 *) class_obj; + //return mdi_engine->execute_command(command, comm); } diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine_old.cpp similarity index 96% rename from src/MDI/mdi_engine.cpp rename to src/MDI/mdi_engine_old.cpp index 9bd9258dfc..2c60830b6a 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine_old.cpp @@ -16,11 +16,11 @@ MolSSI Driver Interface (MDI) support for LAMMPS ------------------------------------------------------------------------- */ -#include "mdi_engine.h" +#include "mdi_engine_old.h" #include "atom.h" #include "error.h" -#include "fix_mdi_engine.h" +#include "fix_mdi_engine_old.h" #include "force.h" #include "mdi.h" #include "min.h" @@ -43,7 +43,7 @@ using namespace LAMMPS_NS; when EXIT command is received, mdi/engine command exits ---------------------------------------------------------------------- */ -void MDIEngine::command(int narg, char ** /*arg*/) +void MDIEngineOld::command(int narg, char ** /*arg*/) { // list of nodes and commands that a MDI-compliant MD code should support @@ -178,17 +178,17 @@ void MDIEngine::command(int narg, char ** /*arg*/) // if the mdi/engine fix is not already present, add it now - int ifix = modify->find_fix_by_style("mdi/engine"); + int ifix = modify->find_fix_by_style("mdi/engine/old"); bool added_mdi_engine_fix = false; if (ifix < 0) { - modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine"); + modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine/old"); added_mdi_engine_fix = true; } // identify the mdi_engine fix - ifix = modify->find_fix_by_style("mdi/engine"); - mdi_fix = static_cast(modify->fix[ifix]); + ifix = modify->find_fix_by_style("mdi/engine/old"); + mdi_fix = static_cast(modify->fix[ifix]); // check that LAMMPS is setup as a compatible MDI engine @@ -235,7 +235,7 @@ void MDIEngine::command(int narg, char ** /*arg*/) run an MD simulation under control of driver ---------------------------------------------------------------------- */ -char *MDIEngine::mdi_md() +char *MDIEngineOld::mdi_md() { // initialize an MD simulation @@ -293,7 +293,7 @@ char *MDIEngine::mdi_md() perform minimization under control of driver ---------------------------------------------------------------------- */ -char *MDIEngine::mdi_optg() +char *MDIEngineOld::mdi_optg() { // setup the minimizer in a way that ensures optimization diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine_old.h similarity index 82% rename from src/MDI/mdi_engine.h rename to src/MDI/mdi_engine_old.h index f282714097..bea4574e61 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine_old.h @@ -13,25 +13,25 @@ #ifdef COMMAND_CLASS // clang-format off -CommandStyle(mdi/engine, MDIEngine); +CommandStyle(mdi/engine, MDIEngineOld); // clang-format on #else -#ifndef LMP_MDI_ENGINE_H -#define LMP_MDI_ENGINE_H +#ifndef LMP_MDI_ENGINE_OLD_H +#define LMP_MDI_ENGINE_OLD_H #include "command.h" namespace LAMMPS_NS { -class MDIEngine : public Command { +class MDIEngineOld : public Command { public: - MDIEngine(LAMMPS *lmp) : Command(lmp) {} - virtual ~MDIEngine() {} + MDIEngineOld(LAMMPS *lmp) : Command(lmp) {} + virtual ~MDIEngineOld() {} void command(int, char **); private: - class FixMDIEngine *mdi_fix; + class FixMDIEngineOld *mdi_fix; char *mdi_md(); char *mdi_optg(); From c855c6f0abd08cb16383d75ff964a11869611b9e Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 23 Sep 2021 12:55:28 -0600 Subject: [PATCH 010/130] rename 2 version to regular version --- ...fix_mdi_engine2.cpp => fix_mdi_engine.cpp} | 18 ++--- .../{fix_mdi_engine2.h => fix_mdi_engine.h} | 14 ++-- src/MDI/library_mdi.cpp | 10 +-- src/MDI/{mdi_engine2.cpp => mdi_engine.cpp} | 74 +++++++++---------- src/MDI/{mdi_engine2.h => mdi_engine.h} | 14 ++-- 5 files changed, 65 insertions(+), 65 deletions(-) rename src/MDI/{fix_mdi_engine2.cpp => fix_mdi_engine.cpp} (84%) rename src/MDI/{fix_mdi_engine2.h => fix_mdi_engine.h} (87%) rename src/MDI/{mdi_engine2.cpp => mdi_engine.cpp} (97%) rename src/MDI/{mdi_engine2.h => mdi_engine.h} (93%) diff --git a/src/MDI/fix_mdi_engine2.cpp b/src/MDI/fix_mdi_engine.cpp similarity index 84% rename from src/MDI/fix_mdi_engine2.cpp rename to src/MDI/fix_mdi_engine.cpp index 27d0ed3785..21df468c40 100644 --- a/src/MDI/fix_mdi_engine2.cpp +++ b/src/MDI/fix_mdi_engine.cpp @@ -17,15 +17,15 @@ ------------------------------------------------------------------------- */ #include "error.h" -#include "fix_mdi_engine2.h" -#include "mdi_engine2.h" +#include "fix_mdi_engine.h" +#include "mdi_engine.h" using namespace LAMMPS_NS; using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixMDIEngine2::FixMDIEngine2(LAMMPS *lmp, int narg, char **arg) : +FixMDIEngine::FixMDIEngine(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg != 3) error->all(FLERR, "Illegal fix mdi/engine command"); @@ -33,7 +33,7 @@ FixMDIEngine2::FixMDIEngine2(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -int FixMDIEngine2::setmask() +int FixMDIEngine::setmask() { int mask = 0; mask |= POST_INTEGRATE; @@ -46,35 +46,35 @@ int FixMDIEngine2::setmask() /* ---------------------------------------------------------------------- */ -void FixMDIEngine2::post_integrate() +void FixMDIEngine::post_integrate() { mdi_engine->engine_node("@COORDS"); } /* ---------------------------------------------------------------------- */ -void FixMDIEngine2::min_pre_force(int vflag) +void FixMDIEngine::min_pre_force(int vflag) { mdi_engine->engine_node("@COORDS"); } /* ---------------------------------------------------------------------- */ -void FixMDIEngine2::post_force(int vflag) +void FixMDIEngine::post_force(int vflag) { mdi_engine->engine_node("@FORCES"); } /* ---------------------------------------------------------------------- */ -void FixMDIEngine2::min_post_force(int vflag) +void FixMDIEngine::min_post_force(int vflag) { mdi_engine->engine_node("@FORCES"); } /* ---------------------------------------------------------------------- */ -void FixMDIEngine2::end_of_step() +void FixMDIEngine::end_of_step() { mdi_engine->engine_node("@ENDSTEP"); } diff --git a/src/MDI/fix_mdi_engine2.h b/src/MDI/fix_mdi_engine.h similarity index 87% rename from src/MDI/fix_mdi_engine2.h rename to src/MDI/fix_mdi_engine.h index 2a9cabb7fc..c8a2ca7cdf 100644 --- a/src/MDI/fix_mdi_engine2.h +++ b/src/MDI/fix_mdi_engine.h @@ -13,23 +13,23 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(mdi/engine2, FixMDIEngine2); +FixStyle(mdi/engine, FixMDIEngine); // clang-format on #else -#ifndef LMP_FIX_MDI_ENGINE2_H -#define LMP_FIX_MDI_ENGINE2_H +#ifndef LMP_FIX_MDI_ENGINE_H +#define LMP_FIX_MDI_ENGINE_H #include "fix.h" namespace LAMMPS_NS { -class FixMDIEngine2 : public Fix { +class FixMDIEngine : public Fix { public: - class MDIEngine2 *mdi_engine; + class MDIEngine *mdi_engine; - FixMDIEngine2(class LAMMPS *, int, char **); - ~FixMDIEngine2() {} + FixMDIEngine(class LAMMPS *, int, char **); + ~FixMDIEngine() {} int setmask(); void init() {} void post_integrate(); diff --git a/src/MDI/library_mdi.cpp b/src/MDI/library_mdi.cpp index d5489207a4..70bb825767 100644 --- a/src/MDI/library_mdi.cpp +++ b/src/MDI/library_mdi.cpp @@ -23,7 +23,7 @@ #define LAMMPS_LIB_MPI 1 #include "library.h" -#include "fix_mdi_engine_old.h" +#include "mdi_engine.h" #include @@ -122,9 +122,9 @@ The function executes a single command from an external MDI driver. int lammps_execute_mdi_command(const char *command, MDI_Comm comm, void *class_obj) { - FixMDIEngineOld *mdi_fix = (FixMDIEngineOld *) class_obj; - return mdi_fix->execute_command(command, comm); + //FixMDIEngineOld *mdi_fix = (FixMDIEngineOld *) class_obj; + //return mdi_fix->execute_command(command, comm); - //MDIEngine2 *mdi_engine = (MDIEngine2 *) class_obj; - //return mdi_engine->execute_command(command, comm); + MDIEngine *mdi_engine = (MDIEngine *) class_obj; + return mdi_engine->execute_command(command,comm); } diff --git a/src/MDI/mdi_engine2.cpp b/src/MDI/mdi_engine.cpp similarity index 97% rename from src/MDI/mdi_engine2.cpp rename to src/MDI/mdi_engine.cpp index b486dfe52f..f9a9fd5747 100644 --- a/src/MDI/mdi_engine2.cpp +++ b/src/MDI/mdi_engine.cpp @@ -16,7 +16,7 @@ MolSSI Driver Interface (MDI) support for LAMMPS ------------------------------------------------------------------------- */ -#include "mdi_engine2.h" +#include "mdi_engine.h" #include #include @@ -25,7 +25,7 @@ #include "compute.h" #include "domain.h" #include "error.h" -#include "fix_mdi_engine2.h" +#include "fix_mdi_engine.h" #include "force.h" #include "group.h" #include "input.h" @@ -62,7 +62,7 @@ enum{CREATE_ATOM,CREATE_ID,CREATE_TYPE,CREATE_X,CREATE_V,CREATE_IMAGE,CREATE_GO} NOTE: may later have other MDI command variants? ---------------------------------------------------------------------- */ -void MDIEngine2::command(int narg, char **arg) +void MDIEngine::command(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal mdi command"); @@ -79,7 +79,7 @@ void MDIEngine2::command(int narg, char **arg) when EXIT command is received, mdi engine command exits ---------------------------------------------------------------------- */ -void MDIEngine2::mdi_engine(int narg, char **arg) +void MDIEngine::mdi_engine(int narg, char **arg) { if (narg > 0) error->all(FLERR,"Illegal mdi engine command"); @@ -221,7 +221,7 @@ void MDIEngine2::mdi_engine(int narg, char **arg) return when not the case or EXIT command received ---------------------------------------------------------------------- */ -void MDIEngine2::engine_node(const char *node) +void MDIEngine::engine_node(const char *node) { int ierr; @@ -268,7 +268,7 @@ void MDIEngine2::engine_node(const char *node) when LAMMPS is running as a plugin ---------------------------------------------------------------------- */ -int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) +int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) { int ierr; @@ -479,7 +479,7 @@ int MDIEngine2::execute_command(const char *command, MDI_Comm mdicomm) standard MDI commands and custom LAMMPS commands ---------------------------------------------------------------------- */ -void MDIEngine2::mdi_commands() +void MDIEngine::mdi_commands() { // ------------------------------------ // commands and nodes that an MDI-compliant MD code supports @@ -661,7 +661,7 @@ void MDIEngine2::mdi_commands() run MD simulation under control of driver one step at a time ---------------------------------------------------------------------- */ -void MDIEngine2::mdi_md() +void MDIEngine::mdi_md() { //int ifix = modify->find_fix_by_style("mdi/engine2"); //bool added_mdi_engine_fix = false; @@ -672,9 +672,9 @@ void MDIEngine2::mdi_md() // remove mdi/engine fix this method instantiated //modify->delete_fix("MDI_ENGINE_INTERNAL"); - modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine2"); - int ifix = modify->find_fix_by_style("mdi/engine2"); - mdi_fix = static_cast(modify->fix[ifix]); + modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine"); + int ifix = modify->find_fix_by_style("mdi/engine"); + mdi_fix = static_cast(modify->fix[ifix]); mdi_fix->mdi_engine = this; // initialize a new MD simulation @@ -726,7 +726,7 @@ void MDIEngine2::mdi_md() perform minimization under control of driver ---------------------------------------------------------------------- */ -void MDIEngine2::mdi_optg() +void MDIEngine::mdi_optg() { // initialize an energy minization @@ -787,7 +787,7 @@ void MDIEngine2::mdi_optg() assumes all atoms already exist ---------------------------------------------------------------------- */ -void MDIEngine2::receive_double1(int which) +void MDIEngine::receive_double1(int which) { reallocate(); @@ -819,7 +819,7 @@ void MDIEngine2::receive_double1(int which) assumes all atoms already exist ---------------------------------------------------------------------- */ -void MDIEngine2::receive_int1(int which) +void MDIEngine::receive_int1(int which) { reallocate(); @@ -852,7 +852,7 @@ void MDIEngine2::receive_int1(int which) for which = COORD, assumes atom displacement is small ---------------------------------------------------------------------- */ -void MDIEngine2::receive_double3(int which, int addflag) +void MDIEngine::receive_double3(int which, int addflag) { reallocate(); @@ -924,7 +924,7 @@ void MDIEngine2::receive_double3(int which, int addflag) atoms are ordered by atomID, 1 to Natoms ---------------------------------------------------------------------- */ -void MDIEngine2::send_double1(int which) +void MDIEngine::send_double1(int which) { reallocate(); memset(buf1,0,atom->natoms*sizeof(double)); @@ -971,7 +971,7 @@ void MDIEngine2::send_double1(int which) atoms are ordered by atomID, 1 to Natoms ---------------------------------------------------------------------- */ -void MDIEngine2::send_int1(int which) +void MDIEngine::send_int1(int which) { reallocate(); memset(ibuf1,0,atom->natoms*sizeof(int)); @@ -1003,7 +1003,7 @@ void MDIEngine2::send_int1(int which) atoms are ordered by atomID, 1 to Natoms ---------------------------------------------------------------------- */ -void MDIEngine2::send_double3(int which) +void MDIEngine::send_double3(int which) { reallocate(); memset(buf3,0,3*atom->natoms*sizeof(double)); @@ -1045,7 +1045,7 @@ void MDIEngine2::send_double3(int which) atoms are ordered by atomID, 1 to Natoms ---------------------------------------------------------------------- */ -void MDIEngine2::send_labels() +void MDIEngine::send_labels() { char *labels = new char[atom->natoms * MDI_LABEL_LENGTH]; memset(labels,' ',atom->natoms * MDI_LABEL_LENGTH); @@ -1069,7 +1069,7 @@ void MDIEngine2::send_labels() send total energy = PE + KE ---------------------------------------------------------------------- */ -void MDIEngine2::send_total_energy() +void MDIEngine::send_total_energy() { double potential_energy = pe->compute_scalar(); double kinetic_energy = ke->compute_scalar(); @@ -1085,7 +1085,7 @@ void MDIEngine2::send_total_energy() send potential energy ---------------------------------------------------------------------- */ -void MDIEngine2::send_pe() +void MDIEngine::send_pe() { double potential_energy = pe->compute_scalar(); potential_energy *= lmp2mdi_energy; @@ -1099,7 +1099,7 @@ void MDIEngine2::send_pe() send kinetic energy ---------------------------------------------------------------------- */ -void MDIEngine2::send_ke() +void MDIEngine::send_ke() { double kinetic_energy = ke->compute_scalar(); kinetic_energy *= lmp2mdi_energy; @@ -1113,7 +1113,7 @@ void MDIEngine2::send_ke() send simulation box edge vectors ---------------------------------------------------------------------- */ -void MDIEngine2::send_cell() +void MDIEngine::send_cell() { double celldata[9]; @@ -1140,7 +1140,7 @@ void MDIEngine2::send_cell() in conjunction with >CELL_DISPL this can adjust box arbitrarily ---------------------------------------------------------------------- */ -void MDIEngine2::receive_cell() +void MDIEngine::receive_cell() { double celldata[9]; @@ -1183,7 +1183,7 @@ void MDIEngine2::receive_cell() send simulation box origin = lower-left corner ---------------------------------------------------------------------- */ -void MDIEngine2::send_celldispl() +void MDIEngine::send_celldispl() { double celldata[3]; @@ -1203,7 +1203,7 @@ void MDIEngine2::send_celldispl() reset simulation box origin = lower-left corner ---------------------------------------------------------------------- */ -void MDIEngine2::receive_celldispl() +void MDIEngine::receive_celldispl() { double celldata[3]; int ierr = MDI_Recv(celldata,3,MDI_DOUBLE,mdicomm); @@ -1253,7 +1253,7 @@ void MDIEngine2::receive_celldispl() for use by a subsequent command, e.g. ones that send strings ---------------------------------------------------------------------- */ -void MDIEngine2::nbytes_command() +void MDIEngine::nbytes_command() { int ierr = MDI_Recv(&nbytes,1,MDI_INT,mdicomm); if (ierr) error->all(FLERR,"MDI: NBYTES data"); @@ -1266,7 +1266,7 @@ void MDIEngine2::nbytes_command() invoke as a LAMMPS command ---------------------------------------------------------------------- */ -void MDIEngine2::single_command() +void MDIEngine::single_command() { if (nbytes < 0) error->all(FLERR,"MDI: COMMAND nbytes has not been set"); @@ -1287,7 +1287,7 @@ void MDIEngine2::single_command() invoke as multiple LAMMPS commands ---------------------------------------------------------------------- */ -void MDIEngine2::many_commands() +void MDIEngine::many_commands() { if (nbytes < 0) error->all(FLERR,"MDI: COMMANDS nbytes has not been set"); @@ -1308,7 +1308,7 @@ void MDIEngine2::many_commands() invoke as a LAMMPS input script ---------------------------------------------------------------------- */ -void MDIEngine2::infile() +void MDIEngine::infile() { if (nbytes < 0) error->all(FLERR,"MDI: INFILE nbytes has not been set"); @@ -1335,7 +1335,7 @@ void MDIEngine2::infile() this method does NOT increment timestep ---------------------------------------------------------------------- */ -void MDIEngine2::evaluate() +void MDIEngine::evaluate() { if (neighbor->ago < 0) { @@ -1371,7 +1371,7 @@ void MDIEngine2::evaluate() allows caller to define a new simulation box ---------------------------------------------------------------------- */ -void MDIEngine2::reset_box() +void MDIEngine::reset_box() { int ierr; double values[9]; @@ -1396,7 +1396,7 @@ void MDIEngine2::reset_box() assumes current atom->natoms set by >NATOMS command is correct ---------------------------------------------------------------------- */ -void MDIEngine2::create_atoms(int flag) +void MDIEngine::create_atoms(int flag) { int ierr; @@ -1497,7 +1497,7 @@ void MDIEngine2::create_atoms(int flag) send scalar pressure value ---------------------------------------------------------------------- */ -void MDIEngine2::send_pressure() +void MDIEngine::send_pressure() { double pressure = press->compute_scalar(); pressure *= lmp2mdi_pressure; @@ -1511,7 +1511,7 @@ void MDIEngine2::send_pressure() send 6-component pressure tensor ---------------------------------------------------------------------- */ -void MDIEngine2::send_ptensor() +void MDIEngine::send_ptensor() { double ptensor[6]; press->compute_vector(); @@ -1532,7 +1532,7 @@ void MDIEngine2::send_ptensor() reallocate storage for all atoms if necessary ------------------------------------------------------------------------- */ -void MDIEngine2::reallocate() +void MDIEngine::reallocate() { if (atom->natoms <= maxbuf) return; @@ -1562,7 +1562,7 @@ void MDIEngine2::reallocate() MDI to/from LAMMPS conversion factors ------------------------------------------------------------------------- */ -void MDIEngine2::unit_conversions() +void MDIEngine::unit_conversions() { double angstrom_to_bohr,kelvin_to_hartree,ev_to_hartree; diff --git a/src/MDI/mdi_engine2.h b/src/MDI/mdi_engine.h similarity index 93% rename from src/MDI/mdi_engine2.h rename to src/MDI/mdi_engine.h index edf6be7cfb..b99db49107 100644 --- a/src/MDI/mdi_engine2.h +++ b/src/MDI/mdi_engine.h @@ -13,22 +13,22 @@ #ifdef COMMAND_CLASS // clang-format off -CommandStyle(mdi,MDIEngine2); +CommandStyle(mdi,MDIEngine); // clang-format on #else -#ifndef LMP_MDI_ENGINE2_H -#define LMP_MDI_ENGINE2_H +#ifndef LMP_MDI_ENGINE_H +#define LMP_MDI_ENGINE_H #include "command.h" #include "mdi.h" namespace LAMMPS_NS { -class MDIEngine2 : public Command { +class MDIEngine : public Command { public: - MDIEngine2(LAMMPS *lmp) : Command(lmp) {} - virtual ~MDIEngine2() {} + MDIEngine(LAMMPS *lmp) : Command(lmp) {} + virtual ~MDIEngine() {} void command(int, char **); int execute_command(const char *command, MDI_Comm mdicomm); @@ -48,7 +48,7 @@ class MDIEngine2 : public Command { bool exit_command; // true if EXIT command received from driver MDI_Comm mdicomm; - class FixMDIEngine2 *mdi_fix; + class FixMDIEngine *mdi_fix; char *id_ke,*id_pe,*id_press; class Irregular *irregular; From be17d775e061af7d5c3b4138880708e915d1c96f Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 23 Sep 2021 15:12:07 -0600 Subject: [PATCH 011/130] more debugging --- src/MDI/fix_mdi_engine.cpp | 9 +++++++++ src/MDI/fix_mdi_engine.h | 1 + src/MDI/mdi_engine.cpp | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/src/MDI/fix_mdi_engine.cpp b/src/MDI/fix_mdi_engine.cpp index 21df468c40..a6ca042ad4 100644 --- a/src/MDI/fix_mdi_engine.cpp +++ b/src/MDI/fix_mdi_engine.cpp @@ -20,6 +20,8 @@ #include "fix_mdi_engine.h" #include "mdi_engine.h" +#include "update.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -46,6 +48,13 @@ int FixMDIEngine::setmask() /* ---------------------------------------------------------------------- */ +void FixMDIEngine::setup(int vflag) +{ + mdi_engine->engine_node("@FORCES"); +} + +/* ---------------------------------------------------------------------- */ + void FixMDIEngine::post_integrate() { mdi_engine->engine_node("@COORDS"); diff --git a/src/MDI/fix_mdi_engine.h b/src/MDI/fix_mdi_engine.h index c8a2ca7cdf..bab3a64591 100644 --- a/src/MDI/fix_mdi_engine.h +++ b/src/MDI/fix_mdi_engine.h @@ -32,6 +32,7 @@ class FixMDIEngine : public Fix { ~FixMDIEngine() {} int setmask(); void init() {} + void setup(int); void post_integrate(); void min_pre_force(int); void post_force(int); diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index f9a9fd5747..43ec152010 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -1337,6 +1337,8 @@ void MDIEngine::infile() void MDIEngine::evaluate() { + // NOTE: ago is not a good test + if (neighbor->ago < 0) { update->whichflag = 1; @@ -1355,10 +1357,14 @@ void MDIEngine::evaluate() if (nflag == 0) { comm->forward_comm(); update->integrate->setup_minimal(0); + modify->clearstep_compute(); output->thermo->compute(1); + modify->addstep_compute(update->ntimestep+1); } else { update->integrate->setup_minimal(1); + modify->clearstep_compute(); output->thermo->compute(1); + modify->addstep_compute(update->ntimestep+1); } } } From faf9c1532aee559866a9361e38536613230af9d6 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 24 Sep 2021 16:26:57 -0600 Subject: [PATCH 012/130] issue with EVAL command --- src/MDI/mdi_engine.cpp | 66 +++++++++++++++++++++++------------------- src/MDI/mdi_engine.h | 1 + 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 43ec152010..c720fa2198 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -651,6 +651,7 @@ void MDIEngine::mdi_commands() MDI_Register_command("@DEFAULT", "CREATE_V"); MDI_Register_command("@DEFAULT", "CREATE_IMG"); MDI_Register_command("@DEFAULT", "CREATE_GO"); + MDI_Register_command("@DEFAULT", ">NATOMS"); MDI_Register_command("@DEFAULT", "all(FLERR,"MDI: COMMAND data"); MPI_Bcast(cmd,nbytes+1,MPI_CHAR,0,world); - cmd[nbytes+1] = '\0'; + cmd[nbytes] = '\0'; lammps_command(lmp,cmd); @@ -1295,7 +1296,7 @@ void MDIEngine::many_commands() int ierr = MDI_Recv(cmds, nbytes+1, MDI_CHAR, mdicomm); if (ierr) error->all(FLERR,"MDI: COMMANDS data"); MPI_Bcast(cmds,nbytes+1,MPI_CHAR,0,world); - cmds[nbytes+1] = '\0'; + cmds[nbytes] = '\0'; lammps_commands_string(lmp,cmds); @@ -1316,7 +1317,7 @@ void MDIEngine::infile() int ierr = MDI_Recv(infile,nbytes+1,MDI_CHAR,mdicomm); if (ierr) error->all(FLERR,"MDI: INFILE data"); MPI_Bcast(infile,nbytes+1,MPI_CHAR,0,world); - infile[nbytes+1] = '\0'; + infile[nbytes] = '\0'; lammps_file(lmp,infile); @@ -1338,12 +1339,17 @@ void MDIEngine::infile() void MDIEngine::evaluate() { // NOTE: ago is not a good test + // caller needs to distinguish + // currently cannot call it interspersed with "delete atoms" calls + // b/c whichflag stays set + // separate issue, need to unset whichflag when done if (neighbor->ago < 0) { update->whichflag = 1; - lmp->init(); + lmp->init(); update->integrate->setup(1); + update->whichflag = 0; } else { @@ -1413,6 +1419,9 @@ void MDIEngine::create_atoms(int flag) if (create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM already in progress"); + ierr = MDI_Recv(&create_natoms,1,MDI_INT,mdicomm); + MPI_Bcast(&create_natoms,1,MPI_INT,0,world); + create_atoms_flag = 1; create_id = nullptr; create_type = nullptr; @@ -1425,66 +1434,65 @@ void MDIEngine::create_atoms(int flag) if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); if (create_id) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - int natoms = atom->natoms; - memory->create(create_id,natoms,"mdi:create_id"); - ierr = MDI_Recv(create_id,natoms,MDI_INT,mdicomm); - MPI_Bcast(create_id,natoms,MPI_INT,0,world); + int natom = create_natoms; + memory->create(create_id,natom,"mdi:create_id"); + ierr = MDI_Recv(create_id,natom,MDI_INT,mdicomm); + MPI_Bcast(create_id,natom,MPI_INT,0,world); } else if (flag == CREATE_TYPE) { if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); if (create_type) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - int natoms = atom->natoms; + int natom = create_natoms; if (create_type) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - memory->create(create_type,natoms,"mdi:create_type"); - ierr = MDI_Recv(create_type,natoms,MDI_INT,mdicomm); - MPI_Bcast(create_type,natoms,MPI_INT,0,world); + memory->create(create_type,natom,"mdi:create_type"); + ierr = MDI_Recv(create_type,natom,MDI_INT,mdicomm); + MPI_Bcast(create_type,natom,MPI_INT,0,world); } else if (flag == CREATE_X) { if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); if (create_x) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - int natoms = atom->natoms; + int natom = create_natoms; if (create_x) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - memory->create(create_x,3*natoms,"mdi:create_x"); - ierr = MDI_Recv(create_x,3*natoms,MDI_DOUBLE,mdicomm); - MPI_Bcast(create_x,3*natoms,MPI_DOUBLE,0,world); + memory->create(create_x,3*natom,"mdi:create_x"); + ierr = MDI_Recv(create_x,3*natom,MDI_DOUBLE,mdicomm); + MPI_Bcast(create_x,3*natom,MPI_DOUBLE,0,world); } else if (flag == CREATE_V) { if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); if (create_v) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - int natoms = atom->natoms; + int natom = create_natoms; if (create_v) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - memory->create(create_v,3*natoms,"mdi:create_x"); - ierr = MDI_Recv(create_v,3*natoms,MDI_DOUBLE,mdicomm); - MPI_Bcast(create_v,3*natoms,MPI_DOUBLE,0,world); + memory->create(create_v,3*natom,"mdi:create_x"); + ierr = MDI_Recv(create_v,3*natom,MDI_DOUBLE,mdicomm); + MPI_Bcast(create_v,3*natom,MPI_DOUBLE,0,world); } else if (flag == CREATE_IMAGE) { if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); if (create_image) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - int natoms = atom->natoms; + int natom = create_natoms; if (create_image) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - memory->create(create_image,natoms,"mdi:create_image"); - ierr = MDI_Recv(create_image,natoms,MDI_INT,mdicomm); - MPI_Bcast(create_image,natoms,MPI_INT,0,world); + memory->create(create_image,natom,"mdi:create_image"); + ierr = MDI_Recv(create_image,natom,MDI_INT,mdicomm); + MPI_Bcast(create_image,natom,MPI_INT,0,world); } else if (flag == CREATE_GO) { if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); if (!create_type || !create_x) error->all(FLERR,"MDI: CREATE_ATOM requires types and coords"); - - int natom = atom->natoms; - int ncreate = lammps_create_atoms(lmp,natom,create_id,create_type, + + int ncreate = lammps_create_atoms(lmp,create_natoms,create_id,create_type, create_x,create_v,create_image,1); - - if (ncreate != natom) + + if (ncreate != create_natoms) error->all(FLERR, "MDI: CREATE ATOM created atoms != sent atoms"); // clean up create_atoms state diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index b99db49107..88cdd55f74 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -60,6 +60,7 @@ class MDIEngine : public Command { // create_atoms state int create_atoms_flag; + int create_natoms; tagint *create_id; int *create_type; double *create_x,*create_v; From 8ba4e7e8978c6a85112dce8bea1795feadb968d9 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 11 Mar 2022 09:33:34 -0700 Subject: [PATCH 013/130] tweaks to src files, added examples dir --- examples/README | 1 + examples/mdi/README | 113 +++++++++++++++ examples/mdi/in.aimd.alone | 32 ++++ examples/mdi/in.aimd.driver | 32 ++++ examples/mdi/in.aimd.engine | 22 +++ examples/mdi/in.series | 21 +++ examples/mdi/series_driver.py | 266 ++++++++++++++++++++++++++++++++++ src/MDI/fix_mdi_aimd.cpp | 4 +- src/MDI/mdi_engine.cpp | 4 +- 9 files changed, 491 insertions(+), 4 deletions(-) create mode 100644 examples/mdi/README create mode 100644 examples/mdi/in.aimd.alone create mode 100644 examples/mdi/in.aimd.driver create mode 100644 examples/mdi/in.aimd.engine create mode 100644 examples/mdi/in.series create mode 100644 examples/mdi/series_driver.py diff --git a/examples/README b/examples/README index 76ddf77498..5310ad5f15 100644 --- a/examples/README +++ b/examples/README @@ -83,6 +83,7 @@ hyper: global and local hyperdynamics of diffusion on Pt surface indent: spherical indenter into a 2d solid kim: use of potentials in Knowledge Base for Interatomic Models (KIM) latte: use of LATTE density-functional tight-binding quantum code +mdi: use of the MDI package and MolSSI MDI code coupling library meam: MEAM test for SiC and shear (same as shear examples) melt: rapid melt of 3d LJ system message: client/server coupling of 2 codes diff --git a/examples/mdi/README b/examples/mdi/README new file mode 100644 index 0000000000..0c4c931519 --- /dev/null +++ b/examples/mdi/README @@ -0,0 +1,113 @@ +These are examples that work the MDI package in LAMMPS which uses the +MolSSI MDI library for coupling codes together and communicating +between them with MDI messages. + +To use the serial_drive.py example you will need Python 3 with Numpy +and mpi4py available in your Python. Make sure LAMMPS and Python are +using same the same version of MPI. + +In MDI lingo, one code is the driver and another code is the engine. +The 2 codes can be written in any language; C++ (LAMMPS) and Python +are illustrated here. The 2 codes can be run on different numbers of +processors. + +The 2 codes can communicate either via TCP (sockets) or via MPI. For +the TCP case, the driver and engine need to be launched separately, +e.g. in 2 windows on your desktop machine. For the MPI case, a single +mpirun command launches both codes. + +The example run commands below have variants for these options. + +------------------------------------------------- +------------------------------------------------- + +* Example #1 = AIMD with LAMMPS as both a driver and engine + As an engine, LAMMPS is acting as a surrogate for a quantum code. + +Note that the 2 input scripts in.aimd.alone and in.aimd.driver +have an option for running in NVE vs NPT mode. Comment in/out +the appropriate line to change modes. Nothing needs to be +changed in the 3rd input script in.aimd.engine. + +--- + +Run the entire calculation with a single instance of LAMMPS by itself + results should be identical to running in driver/engine mode + +% lmp_mpi < in.aimd.alone + +--- + +Run with TCP: 1 proc each + +% lmp_mpi -mdi "-name driver -role DRIVER -method TCP -port 8021" -log log.aimd.driver -in in.aimd.driver + +% lmp_mpi -mdi "-name LAMMPS -role ENGINE -method TCP -port 8021 -hostname localhost" -log log.aimd.engine -in in.aimd.engine + +--- + +Run with TCP: 3 procs + 4 procs + +% mpirun -np 3 lmp_mpi -mdi "-name driver -role DRIVER -method TCP -port 8021" -log log.aimd.driver -in in.aimd.driver + +% mpirun -np 4 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method TCP -port 8021 -hostname localhost" -log log.aimd.engine -in in.aimd.engine + +--- + +Run with MPI: 1 proc each + +% mpirun -np 1 lmp_mpi -mdi "-name driver -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 1 ../lammps/git/src/lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine + +--- + +Run with MPI: 3 procs + 4 procs + +% mpirun -np 3 lmp_mpi -mdi "-name driver -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 4 ../lammps/git/src/lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine + +------------------------------------------------- +------------------------------------------------- + +* Example #2 = Use a Python driver code to run a series of independent + LAMMPS calculations + +Note that the series_driver.py code allows for optional arguments in +addition to -mdi (required). The example run commands below just +using the default values. The options are explained the top of the file; +the info is copied here: + +# -n 10 +# number of calculations to perform, default = 1 +# -mode eval/run/min +# style of calculations: single snapshot evals, dynamics, minimization +# default = eval +# -size Nx Ny Nz +# cubic lattice, default = 2 2 2 +# -rho 0.75 0.1 +# reduced density and random variation thereof, default = 0.75 0.1 +# -delta 0.1 +# randomly perturb atoms initially by this distance, default 0.0 +# -nsteps 100 +# number of timesteps in dynamics runs, default = 100 +# -temp 1.0 +# initial temperature in dynamics runs, default = 1.0 +# -tol 0.001 +# tolerance for minimizations, default = 0.001 +# -seed 12345 +# random number seed > 0, default = 12345 + +--- + +Run with TCP: 1 proc each + +% python3 series_driver.py -mdi "-role DRIVER -name aimd -method TCP -port 8021" + +% lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.series -in in.series + +--- + +Run with TCP: 1 proc + 4 procs + +% python3 series_driver.py -mdi "-role DRIVER -name aimd -method TCP -port 8021" + +% mpirun -np 4 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.series -in in.series + diff --git a/examples/mdi/in.aimd.alone b/examples/mdi/in.aimd.alone new file mode 100644 index 0000000000..e2857c5704 --- /dev/null +++ b/examples/mdi/in.aimd.alone @@ -0,0 +1,32 @@ +# 3d Lennard-Jones melt - MDI driver script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +region box block 0 $x 0 $y 0 $z +create_box 1 box +create_atoms 1 box +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +# NVE +fix 1 all nve +# NPT +#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0 + +thermo_style custom step temp pe etotal press vol +thermo 1 + +run 5 diff --git a/examples/mdi/in.aimd.driver b/examples/mdi/in.aimd.driver new file mode 100644 index 0000000000..5ee23ebe8d --- /dev/null +++ b/examples/mdi/in.aimd.driver @@ -0,0 +1,32 @@ +# 3d Lennard-Jones melt - MDI driver script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +region box block 0 $x 0 $y 0 $z +create_box 1 box +create_atoms 1 box +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +# NVE +fix 1 all nve +# NPT +#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0 + +fix 2 all mdi/aimd +fix_modify 2 energy yes virial yes + +thermo_style custom step temp pe etotal press vol +thermo 1 + +run 5 diff --git a/examples/mdi/in.aimd.engine b/examples/mdi/in.aimd.engine new file mode 100644 index 0000000000..11d22c750e --- /dev/null +++ b/examples/mdi/in.aimd.engine @@ -0,0 +1,22 @@ +# 3d Lennard-Jones melt - MDI engine script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +region box block 0 $x 0 $y 0 $z +create_box 1 box +create_atoms 1 box +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +mdi engine diff --git a/examples/mdi/in.series b/examples/mdi/in.series new file mode 100644 index 0000000000..c094326ae7 --- /dev/null +++ b/examples/mdi/in.series @@ -0,0 +1,21 @@ +# MDI engine script to process a series of evaulate, run, minimize commands + +units lj +atom_style atomic + +lattice fcc 0.8442 +region box block 0 1 0 1 0 1 +create_box 1 box +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +thermo 10 + +mdi engine diff --git a/examples/mdi/series_driver.py b/examples/mdi/series_driver.py new file mode 100644 index 0000000000..682a6365ec --- /dev/null +++ b/examples/mdi/series_driver.py @@ -0,0 +1,266 @@ +# MDI driver to perform a series of independent calculations +# using LAMMPS as an engine + +# Syntax: python3 series_driver.py switch arg switch arg ... +# possible switches: +# -mdi "-role DRIVER ..." +# required switch +# -n 10 +# number of calculations to perform, default = 1 +# -mode eval/run/min +# style of calculations: single snapshot evals, dynamics, minimization +# default = eval +# -size Nx Ny Nz +# cubic lattice, default = 2 2 2 +# -rho 0.75 0.1 +# reduced density and random variation thereof, default = 0.75 0.1 +# -delta 0.1 +# randomly perturb atoms initially by this distance, default 0.0 +# -nsteps 100 +# number of timesteps in dynamics runs, default = 100 +# -temp 1.0 +# initial temperature in dynamics runs, default = 1.0 +# -tol 0.001 +# tolerance for minimizations, default = 0.001 +# -seed 12345 +# random number seed > 0, default = 12345 + +import sys,math,random +import mdi +import numpy as np +from mpi4py import MPI + +# error message + +def error(txt=None): + if txt: raise Exception(txt) + raise Exception("Syntax: python3 series_driver.py switch arg switch arg ...") + +# send a LAMMPS input script command to MDI engine + +def send_command(cmd): + mdi.MDI_Send_Command("NBYTES",mdicomm) + mdi.MDI_Send(len(cmd),1,mdi.MDI_INT,mdicomm) + mdi.MDI_Send_Command("COMMAND",mdicomm) + mdi.MDI_Send(cmd,len(cmd)+1,mdi.MDI_CHAR,mdicomm) + +# parse command-line args + +args = sys.argv[1:] +narg = len(args) + +mdiarg = 0 +ncalc = 1 +mode = "eval" +nx = ny = nz = 2 +rho = 0.75 +rhodelta = 0.1 +delta = 0.0 +nsteps = 100 +tinitial = 1.0 +tol = 0.001 +seed = 12345 + +iarg = 0 +while iarg < narg: + if args[iarg] == "-mdi": + if iarg+2 > narg: error() + mdiarg = iarg + 1 + iarg += 2 + elif args[iarg] == "-n": + if iarg+2 > narg: error() + ncalc = int(args[iarg+1]) + iarg += 2 + elif args[iarg] == "-mode": + if iarg+2 > narg: error() + mode = args[iarg+1] + if mode != "eval" and mode != "run" and mode != "min": error() + iarg += 2 + elif args[iarg] == "-size": + if iarg+4 > narg: error() + nx = int(args[iarg+1]) + ny = int(args[iarg+2]) + nz = int(args[iarg+3]) + if nx <= 0 or ny <= 0 or nz <= 0: error() + iarg += 4 + elif args[iarg] == "-rho": + if iarg+3 > narg: error() + rho = float(args[iarg+1]) + rhodelta = float(args[iarg+2]) + if rho-rhodelta <= 0.0: error() + iarg += 4 + elif args[iarg] == "-delta": + if iarg+2 > narg: error() + delta = float(args[iarg+1]) + if delta < 0.0: error() + iarg += 2 + elif args[iarg] == "-nsteps": + if iarg+2 > narg: error() + nsteps = int(args[iarg+1]) + if nsteps < 0: error() + iarg += 2 + elif args[iarg] == "-temp": + if iarg+2 > narg: error() + tinitial = float(args[iarg+1]) + if tinitial < 0.0: error() + iarg += 2 + elif args[iarg] == "-tol": + if iarg+2 > narg: error() + tol = float(args[iarg+1]) + if tol < 0.0: error() + iarg += 2 + elif args[iarg] == "-seed": + if iarg+2 > narg: error() + seed = int(args[iarg+1]) + if seed <= 0: error() + iarg += 2 + else: error() + +if not mdiarg: error() + +# initialize MDI Library + +mdi.MDI_Init(args[mdiarg]) + +# MPI communicator for just the driver + +world = mdi.MDI_MPI_get_world_comm() +me = world.Get_rank() +nprocs = world.Get_size() + +# connect to engine + +mdicomm = mdi.MDI_Accept_Communicator() + +# allocate vectors for per-atom types, coords, vels, forces + +natoms = nx * ny * nz +atypes = np.zeros(natoms,dtype=np.int) +coords = np.zeros(3*natoms,dtype=np.float64) +vels = np.zeros(3*natoms,dtype=np.float64) +forces = np.zeros(3*natoms,dtype=np.float64) + +atypes[:] = 1 + +# initialize RN generator + +random.seed(seed) + +# loop over sequence of calculations + +for icalc in range(ncalc): + + # delete all atoms so can run a new calculation + + send_command("delete_atoms group all") + + # define simulation box + + onerho = rho + (random.random()-0.5)*rhodelta; + sigma = pow(1.0/onerho,1.0/3.0) + + xlo = ylo = zlo = 0.0 + xhi = nx * sigma + yhi = ny * sigma + zhi = nz * sigma + + # send simulation box to engine + + vec = [xlo,ylo,zlo,xhi,yhi,zhi,0.0,0.0,0.0] + mdi.MDI_Send_command("RESET_BOX",mdicomm) + mdi.MDI_Send(vec,9,mdi.MDI_DOUBLE,mdicomm) + + # create atoms on perfect lattice + + m = 0 + for k in range(nz): + for j in range(ny): + for i in range(nx): + coords[m] = i * sigma + coords[m+1] = j * sigma + coords[m+2] = k * sigma + m += 3 + + # perturb lattice + + for m in range(3*natoms): + coords[m] += 2.0*random.random()*delta - delta + + # define initial velocities + + for m in range(3*natoms): + vels[m] = random.random() - 0.5 + + tcurrent = 0.0 + for m in range(3*natoms): + tcurrent += vels[m]*vels[m] + tcurrent /= 3*(natoms-1) + + factor = math.sqrt(tinitial/tcurrent) + + for m in range(3*natoms): + vels[m] *= factor + + # send atoms and their properties to engine + + mdi.MDI_Send_command("CREATE_ATOM",mdicomm) + mdi.MDI_Send(natoms,1,mdi.MDI_INT,mdicomm) + mdi.MDI_Send_command("CREATE_TYPE",mdicomm) + mdi.MDI_Send(atypes,natoms,mdi.MDI_INT,mdicomm) + mdi.MDI_Send_command("CREATE_X",mdicomm) + mdi.MDI_Send(coords,3*natoms,mdi.MDI_DOUBLE,mdicomm) + mdi.MDI_Send_command("CREATE_V",mdicomm) + mdi.MDI_Send(vels,3*natoms,mdi.MDI_DOUBLE,mdicomm) + mdi.MDI_Send_command("CREATE_GO",mdicomm) + + # eval or run or minimize + + if mode == "eval": + mdi.MDI_Send_command("EVAL",mdicomm) + elif mode == "run": + send_command("run %d" % nsteps) + elif mode == "min": + send_command("minimize %g %g 1000 1000" % (tol,tol)) + + # request energy + + mdi.MDI_Send_command("tag_enable == 0) - error->all(FLERR, "Cannot use mdi engined without atom IDs"); + error->all(FLERR, "Cannot use MDI engine without atom IDs"); if (atom->natoms && atom->tag_consecutive() == 0) - error->all(FLERR, "mdi engine requires consecutive atom IDs"); + error->all(FLERR, "MDI engine requires consecutive atom IDs"); // confirm LAMMPS is being run as a driver diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index c720fa2198..5a02a36e4b 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -635,7 +635,7 @@ void MDIEngine::mdi_commands() // ------------------------------------ // custom commands and nodes which LAMMPS supports - // max length for a command is current 11 chars in MDI + // max length for a command is currently 11 chars in MDI // ------------------------------------ MDI_Register_command("@DEFAULT", "NBYTES"); @@ -1377,8 +1377,8 @@ void MDIEngine::evaluate() /* ---------------------------------------------------------------------- RESET_BOX command - 9 values = boxlo, boxhi, xy, yz, xz wrapper on library reset_box() method + 9 values = boxlo, boxhi, xy, yz, xz requires no atoms exist allows caller to define a new simulation box ---------------------------------------------------------------------- */ From 636f00276e0ec2677f16c084c3eea97811cdba86 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Tue, 15 Mar 2022 14:12:23 -0600 Subject: [PATCH 014/130] sync with current Modify methods for fix lookup --- src/MDI/fix_mdi_engine.h | 2 +- src/MDI/mdi_engine.cpp | 27 +++++++++------------------ src/MDI/mdi_engine_old.cpp | 8 ++++---- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/src/MDI/fix_mdi_engine.h b/src/MDI/fix_mdi_engine.h index bab3a64591..f594341c24 100644 --- a/src/MDI/fix_mdi_engine.h +++ b/src/MDI/fix_mdi_engine.h @@ -13,7 +13,7 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(mdi/engine, FixMDIEngine); +FixStyle(MDI/ENGINE, FixMDIEngine); // clang-format on #else diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index f9d0259cbf..e459c547c5 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -30,6 +30,7 @@ #include "group.h" #include "input.h" //#include "irregular.h" +#include "integrate.h" #include "library.h" #include "memory.h" #include "min.h" @@ -202,7 +203,7 @@ void MDIEngine::mdi_engine(int narg, char **arg) delete [] id_pe; delete [] id_press; - //delete irregular; + // delete irregular; memory->destroy(ibuf1); memory->destroy(buf1); @@ -662,18 +663,8 @@ void MDIEngine::mdi_commands() void MDIEngine::mdi_md() { - //int ifix = modify->find_fix_by_style("mdi/engine2"); - //bool added_mdi_engine_fix = false; - //if (ifix < 0) { - - // NOTE: delete fix if already defined ? - // also delete in destructor if defined - // remove mdi/engine fix this method instantiated - //modify->delete_fix("MDI_ENGINE_INTERNAL"); - - modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine"); - int ifix = modify->find_fix_by_style("mdi/engine"); - mdi_fix = static_cast(modify->fix[ifix]); + modify->add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); + mdi_fix = (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); mdi_fix->mdi_engine = this; // initialize a new MD simulation @@ -716,8 +707,12 @@ void MDIEngine::mdi_md() update->integrate->run(1); // driver triggers end of MD loop by senging @DEFAULT or EXIT + // delete fix with ID = MDI_ENGINE_INTERNAL - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) { + modify->delete_fix("MDI_ENGINE_INTERNAL"); + return; + } } } @@ -727,10 +722,6 @@ void MDIEngine::mdi_md() void MDIEngine::mdi_optg() { - // initialize an energy minization - - Minimize *minimizer = new Minimize(lmp); - // setup the minimizer in a way that ensures optimization // will continue until MDI driver exits diff --git a/src/MDI/mdi_engine_old.cpp b/src/MDI/mdi_engine_old.cpp index 2c60830b6a..cb711c2780 100644 --- a/src/MDI/mdi_engine_old.cpp +++ b/src/MDI/mdi_engine_old.cpp @@ -178,17 +178,17 @@ void MDIEngineOld::command(int narg, char ** /*arg*/) // if the mdi/engine fix is not already present, add it now - int ifix = modify->find_fix_by_style("mdi/engine/old"); + std::vector matches = modify->get_fix_by_style("mdi/engine/old"); bool added_mdi_engine_fix = false; - if (ifix < 0) { + if (matches.size() == 0) { modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine/old"); added_mdi_engine_fix = true; } // identify the mdi_engine fix - ifix = modify->find_fix_by_style("mdi/engine/old"); - mdi_fix = static_cast(modify->fix[ifix]); + matches = modify->get_fix_by_style("mdi/engine/old"); + mdi_fix = (FixMDIEngineOld *) matches[0]; // check that LAMMPS is setup as a compatible MDI engine From 2a171cf2a2acd59556b9acb2d1e5b8c60424c46b Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Tue, 15 Mar 2022 16:10:54 -0600 Subject: [PATCH 015/130] sync new and old versions with current LAMMPS --- src/MDI/mdi_engine.cpp | 318 ++++++++++++++++++++++++----------------- src/MDI/mdi_engine.h | 3 +- 2 files changed, 184 insertions(+), 137 deletions(-) diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index e459c547c5..7981485607 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -113,7 +113,7 @@ void MDIEngine::mdi_engine(int narg, char **arg) node_driver = new char[MDI_COMMAND_LENGTH]; strncpy(node_driver,"\0",MDI_COMMAND_LENGTH); - // create computes for KE. PE, pressure + // create computes for KE. PE, stress id_ke = utils::strdup(std::string("MDI_ENGINE") + "_ke"); modify->add_compute(fmt::format("{} all ke", id_ke)); @@ -122,7 +122,7 @@ void MDIEngine::mdi_engine(int narg, char **arg) modify->add_compute(fmt::format("{} all pe", id_pe)); id_press = utils::strdup(std::string("MDI_ENGINE") + "_press"); - modify->add_compute(fmt::format("{} all pressure thermo_temp", id_press)); + modify->add_compute(fmt::format("{} all pressure NULL virial", id_press)); int icompute_ke = modify->find_compute(id_ke); int icompute_pe = modify->find_compute(id_pe); @@ -288,80 +288,78 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) error->all(FLERR,"MDI: Received a command unsupported by engine node"); // --------------------------------------- - // respond to each possible driver command + // respond to MDI standard commands + // listed in alphabetic order: receives first, sends second // --------------------------------------- - if (strcmp(command,">NATOMS") == 0) { - - // natoms cannot exceed 32-bit int for use with MDI - - int natoms; - ierr = MDI_Recv(&natoms,1,MDI_INT,mdicomm); - if (ierr) error->all(FLERR,"MDI: >NATOMS data"); - MPI_Bcast(&natoms,1,MPI_INT,0,world); - if (natoms < 0) error->all(FLERR,"MDI received natoms < 0"); - atom->natoms = natoms; - - } else if (strcmp(command," (atom->natoms); - ierr = MDI_Send(&natoms,1,MDI_INT,mdicomm); - if (ierr != 0) error->all(FLERR,"MDI: ntypes,1,MDI_INT,mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: CELL") == 0) { + if (strcmp(command,">CELL") == 0) { receive_cell(); - } else if (strcmp(command, "CELL_DISPL") == 0) { + } else if (strcmp(command,">CELL_DISPL") == 0) { receive_celldispl(); - } else if (strcmp(command, ">COORDS") == 0) { + } else if (strcmp(command,">COORDS") == 0) { receive_double3(COORD,0); - } else if (strcmp(command, "FORCES") == 0) { + } else if (strcmp(command,">FORCES") == 0) { receive_double3(FORCE,0); - } else if (strcmp(command, ">+FORCES") == 0) { + } else if (strcmp(command,">+FORCES") == 0) { receive_double3(FORCE,1); - } else if (strcmp(command, "NATOMS") == 0) { + receive_natoms(); - } else if (strcmp(command, "VELOCITIES") == 0) { + receive_double3(VELOCITY,0); + + // ----------------------------------------------- + + } else if (strcmp(command,"etol = std::numeric_limits::max(); update->ftol = std::numeric_limits::max(); - - // set the maximum number of force evaluations to 0 update->max_eval = 0; } @@ -439,8 +437,6 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) many_commands(); } else if (strcmp(command,"INFILE") == 0) { infile(); - } else if (strcmp(command,"EVAL") == 0) { - evaluate(); } else if (strcmp(command,"RESET_BOX") == 0) { reset_box(); } else if (strcmp(command,"CREATE_ATOM") == 0) { @@ -457,10 +453,6 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) create_atoms(CREATE_IMAGE); } else if (strcmp(command,"CREATE_GO") == 0) { create_atoms(CREATE_GO); - } else if (strcmp(command,"CELL"); MDI_Register_command("@DEFAULT", ">CELL_DISPL"); MDI_Register_command("@DEFAULT", ">COORDS"); + MDI_Register_command("@DEFAULT", ">VELOCITIES"); MDI_Register_command("@DEFAULT", "@INIT_MD"); MDI_Register_command("@DEFAULT", "@INIT_OPTG"); MDI_Register_command("@DEFAULT", "EXIT"); + // default node, custom commands added by LAMMPS + // max length for a command is currently 11 chars + + MDI_Register_command("@DEFAULT", "NBYTES"); + MDI_Register_command("@DEFAULT", "COMMAND"); + MDI_Register_command("@DEFAULT", "COMMANDS"); + MDI_Register_command("@DEFAULT", "INFILE"); + MDI_Register_command("@DEFAULT", "RESET_BOX"); + MDI_Register_command("@DEFAULT", "CREATE_ATOM"); + MDI_Register_command("@DEFAULT", "CREATE_ID"); + MDI_Register_command("@DEFAULT", "CREATE_TYPE"); + MDI_Register_command("@DEFAULT", "CREATE_X"); + MDI_Register_command("@DEFAULT", "CREATE_V"); + MDI_Register_command("@DEFAULT", "CREATE_IMG"); + MDI_Register_command("@DEFAULT", "CREATE_GO"); + MDI_Register_command("@DEFAULT", ">NATOMS"); + MDI_Register_command("@DEFAULT", "NATOMS"); - MDI_Register_command("@DEFAULT", "CHARGES command + >NATOMS command + natoms cannot exceed 32-bit int for use with MDI +---------------------------------------------------------------------- */ + +void MDIEngine::receive_natoms() +{ + int natoms; + ierr = MDI_Recv(&natoms,1,MDI_INT,mdicomm); + if (ierr) error->all(FLERR,"MDI: >NATOMS data"); + MPI_Bcast(&natoms,1,MPI_INT,0,world); + if (natoms < 0) error->all(FLERR,"MDI received natoms < 0"); + atom->natoms = natoms; +} + +/* ---------------------------------------------------------------------- + (atom->natoms); + ierr = MDI_Send(&natoms,1,MDI_INT,mdicomm); + if (ierr != 0) error->all(FLERR,"MDI: ntypes,1,MDI_INT,mdicomm); + if (ierr != 0) error->all(FLERR, "MDI: CHARGES command ---------------------------------------------------------------------- */ void MDIEngine::receive_double1(int which) @@ -785,8 +812,8 @@ void MDIEngine::receive_double1(int which) if (ierr) error->all(FLERR,"MDI: >double1 data"); MPI_Bcast(buf1,atom->natoms,MPI_DOUBLE,0,world); - // extract onwed atom value - // use atomID to index into ordered buf3 + // extract onwed atom values + // use atomID to index into ordered buf tagint *tag = atom->tag; int nlocal = atom->nlocal; @@ -803,10 +830,10 @@ void MDIEngine::receive_double1(int which) } /* ---------------------------------------------------------------------- - >TYPES command receive vector of 1 int for all atoms atoms are ordered by atomID, 1 to Natoms assumes all atoms already exist + used by >TYPES command ---------------------------------------------------------------------- */ void MDIEngine::receive_int1(int which) @@ -817,8 +844,8 @@ void MDIEngine::receive_int1(int which) if (ierr) error->all(FLERR,"MDI: >int1 data"); MPI_Bcast(ibuf1,atom->natoms,MPI_INT,0,world); - // extract onwed atom value - // use atomID to index into ordered buf3 + // extract onwed atom values + // use atomID to index into ordered buf tagint *tag = atom->tag; int nlocal = atom->nlocal; @@ -835,11 +862,11 @@ void MDIEngine::receive_int1(int which) } /* ---------------------------------------------------------------------- - >COORDS, >FORCES commands receive vector of 3 doubles for all atoms atoms are ordered by atomID, 1 to Natoms assumes all atoms already exist - for which = COORD, assumes atom displacement is small + used by >COORDS, >FORCES, >VELOCITIES commands + for COORD, assumes atom displacement is small ---------------------------------------------------------------------- */ void MDIEngine::receive_double3(int which, int addflag) @@ -851,7 +878,7 @@ void MDIEngine::receive_double3(int which, int addflag) MPI_Bcast(buf3,3*atom->natoms,MPI_DOUBLE,0,world); // extract owned atom values - // use atomID to index into ordered buf3 + // use atomID to index into ordered buf tagint *tag = atom->tag; int nlocal = atom->nlocal; @@ -884,6 +911,14 @@ void MDIEngine::receive_double3(int which, int addflag) f[i][2] += buf3[3*ilocal+2] * mdi2lmp_force; } } + } else if (which == VELOCITY) { + double **v = atom->v; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + v[i][0] = buf3[3*ilocal+0] * mdi2lmp_velocity; + v[i][1] = buf3[3*ilocal+1] * mdi2lmp_velocity; + v[i][2] = buf3[3*ilocal+2] * mdi2lmp_velocity; + } } // NOTE: these operations cannot be done in the middle @@ -899,8 +934,8 @@ void MDIEngine::receive_double3(int which, int addflag) domain->reset_box(); if (domain->triclinic) domain->lamda2x(atom->nlocal); - // move atoms to new processors via irregular() only needed if - // migrate_check() says an atom moves too far + // move atoms to new processors via irregular() + // only needed if migrate_check() says an atom moves too far if (domain->triclinic) domain->x2lamda(atom->nlocal); if (irregular->migrate_check()) irregular->migrate_atoms(); @@ -909,9 +944,9 @@ void MDIEngine::receive_double3(int which, int addflag) } /* ---------------------------------------------------------------------- - v; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + buf3[3*ilocal+0] = v[i][0] * lmp2mdi_velocity; + buf3[3*ilocal+1] = v[i][1] * lmp2mdi_velocity; + buf3[3*ilocal+2] = v[i][2] * lmp2mdi_velocity; + } } MPI_Reduce(buf3,buf3all,3*atom->natoms,MPI_DOUBLE,MPI_SUM,0,world); @@ -1496,33 +1539,19 @@ void MDIEngine::create_atoms(int flag) } /* ---------------------------------------------------------------------- - compute_scalar(); - pressure *= lmp2mdi_pressure; - - int ierr = MDI_Send(&pressure, 1, MDI_DOUBLE, mdicomm); - if (ierr) error->all(FLERR,"MDI: compute_vector(); for (int i = 0; i < 6; i++) - ptensor[i] = press->vector[i] * lmp2mdi_pressure; + vtensor[i] = press->vector[i] * lmp2mdi_pressure; - int ierr = MDI_Send(ptensor,6,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: all(FLERR,"MDI: boltz) / + (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; + } else if (lmpunits == METAL) { + lmp2mdi_pressure = ev_to_hartree / + (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; + } + + // velocity units = distance/time mdi2lmp_velocity = 1.0; lmp2mdi_velocity = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_velocity = angstrom_to_bohr / (1.0e-15 * second_to_aut); + mdi2lmp_velocity = 1.0 / lmp2mdi_velocity; + } else if (lmpunits == METAL) { + lmp2mdi_velocity = angstrom_to_bohr / (1.0e-12 * second_to_aut); + mdi2lmp_velocity = 1.0 / lmp2mdi_velocity; + } } diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index ed855388ca..7ced216df2 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -114,8 +114,7 @@ class MDIEngine : public Command { void evaluate(); void reset_box(); void create_atoms(int); - void send_pressure(); - void send_ptensor(); + void send_stress(); void unit_conversions(); void reallocate(); From 99fa7698007f54838ee0aafa7fea7848cf9ee806 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Tue, 15 Mar 2022 16:15:57 -0600 Subject: [PATCH 016/130] more syncing --- src/MDI/mdi_engine.cpp | 12 ++++++------ src/MDI/mdi_engine.h | 6 +++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 7981485607..d089421612 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -329,10 +329,10 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) } else if (strcmp(command,"all(FLERR,"MDI: >NATOMS data"); MPI_Bcast(&natoms,1,MPI_INT,0,world); if (natoms < 0) error->all(FLERR,"MDI received natoms < 0"); @@ -783,7 +783,7 @@ void MDIEngine::receive_natoms() void MDIEngine::send_natoms() { int natoms = static_cast (atom->natoms); - ierr = MDI_Send(&natoms,1,MDI_INT,mdicomm); + int ierr = MDI_Send(&natoms,1,MDI_INT,mdicomm); if (ierr != 0) error->all(FLERR,"MDI: ntypes,1,MDI_INT,mdicomm); + int ierr = MDI_Send(&atom->ntypes,1,MDI_INT,mdicomm); if (ierr != 0) error->all(FLERR, "MDI: compute_scalar(); potential_energy *= lmp2mdi_energy; diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index 7ced216df2..36a6fbbf8c 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -90,6 +90,10 @@ class MDIEngine : public Command { void mdi_md(); void mdi_optg(); + void receive_natoms(); + void send_natoms(); + void send_ntypes(); + void receive_double1(int); void receive_int1(int); void receive_double3(int, int); @@ -99,7 +103,7 @@ class MDIEngine : public Command { void send_labels(); void send_total_energy(); - void send_pe(); + void send_energy(); void send_ke(); void send_cell(); From 8d341e07141009daa31eb66ecf5fbc1f9759f6f1 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Tue, 15 Mar 2022 17:13:15 -0600 Subject: [PATCH 017/130] remove EVAL command --- examples/mdi/README | 4 +- src/MDI/fix_mdi_aimd.cpp | 48 +++++++++++----- src/MDI/fix_mdi_aimd.h | 2 +- src/MDI/mdi_engine.cpp | 119 +++++++++++++++++++++------------------ src/MDI/mdi_engine.h | 5 +- 5 files changed, 106 insertions(+), 72 deletions(-) diff --git a/examples/mdi/README b/examples/mdi/README index 0c4c931519..2dd5f2375e 100644 --- a/examples/mdi/README +++ b/examples/mdi/README @@ -56,13 +56,13 @@ Run with TCP: 3 procs + 4 procs Run with MPI: 1 proc each -% mpirun -np 1 lmp_mpi -mdi "-name driver -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 1 ../lammps/git/src/lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine +% mpirun -np 1 lmp_mpi -mdi "-name driver -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 1 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine --- Run with MPI: 3 procs + 4 procs -% mpirun -np 3 lmp_mpi -mdi "-name driver -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 4 ../lammps/git/src/lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine +% mpirun -np 3 lmp_mpi -mdi "-name driver -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 4 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine ------------------------------------------------- ------------------------------------------------- diff --git a/src/MDI/fix_mdi_aimd.cpp b/src/MDI/fix_mdi_aimd.cpp index a998844af7..42b06b31bd 100644 --- a/src/MDI/fix_mdi_aimd.cpp +++ b/src/MDI/fix_mdi_aimd.cpp @@ -185,12 +185,8 @@ void FixMDIAimd::post_force(int vflag) ierr = MDI_Send(buf3all,3*atom->natoms,MDI_DOUBLE,mdicomm); if (ierr) error->all(FLERR,"MDI: >COORDS data"); - // trigger engine to evaluate forces,energy,pressure for current system - - ierr = MDI_Send_command("EVAL",mdicomm); - if (ierr) error->all(FLERR,"MDI: EVAL command"); - // request forces from MDI engine + // this triggers engine to evaluate forces,energy,stress for current system ierr = MDI_Send_command("all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR,"MDI: xprd * domain->yprd * domain->zprd; @@ -283,11 +279,12 @@ void FixMDIAimd::reallocate() void FixMDIAimd::unit_conversions() { - double angstrom_to_bohr,kelvin_to_hartree,ev_to_hartree; + double angstrom_to_bohr,kelvin_to_hartree,ev_to_hartree,second_to_aut; MDI_Conversion_factor("angstrom","bohr",&angstrom_to_bohr); MDI_Conversion_factor("kelvin_energy","hartree",&kelvin_to_hartree); MDI_Conversion_factor("electron_volt","hartree",&ev_to_hartree); + MDI_Conversion_Factor("second","atomic_unit_of_time",&second_to_aut); // length units @@ -312,7 +309,7 @@ void FixMDIAimd::unit_conversions() mdi2lmp_energy = 1.0 / ev_to_hartree; } - // force units + // force units = energy/length mdi2lmp_force = 1.0; lmp2mdi_force = 1.0; @@ -325,8 +322,31 @@ void FixMDIAimd::unit_conversions() mdi2lmp_force = angstrom_to_bohr / ev_to_hartree; } - // pressure units + // pressure or stress units = force/area = energy/volume mdi2lmp_pressure = 1.0; lmp2mdi_pressure = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_pressure = (kelvin_to_hartree / force->boltz) / + (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; + } else if (lmpunits == METAL) { + lmp2mdi_pressure = ev_to_hartree / + (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; + } + + // velocity units = distance/time + + mdi2lmp_velocity = 1.0; + lmp2mdi_velocity = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_velocity = angstrom_to_bohr / (1.0e-15 * second_to_aut); + mdi2lmp_velocity = 1.0 / lmp2mdi_velocity; + } else if (lmpunits == METAL) { + lmp2mdi_velocity = angstrom_to_bohr / (1.0e-12 * second_to_aut); + mdi2lmp_velocity = 1.0 / lmp2mdi_velocity; + } } diff --git a/src/MDI/fix_mdi_aimd.h b/src/MDI/fix_mdi_aimd.h index 63db7266cf..4cf2b536b0 100644 --- a/src/MDI/fix_mdi_aimd.h +++ b/src/MDI/fix_mdi_aimd.h @@ -54,7 +54,7 @@ class FixMDIAimd : public Fix { double lmp2mdi_energy,mdi2lmp_energy; double lmp2mdi_force,mdi2lmp_force; double lmp2mdi_pressure,mdi2lmp_pressure; - double lmp2mdi_virial,mdi2lmp_virial; + double lmp2mdi_velocity,mdi2lmp_velocity; // buffers for MDI comm diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index d089421612..db0636b33f 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -150,6 +150,7 @@ void MDIEngine::mdi_engine(int narg, char **arg) ibuf1 = ibuf1all = nullptr; maxbuf = 0; + need_evaluation = 1; nbytes = -1; create_atoms_flag = 0; @@ -300,6 +301,7 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) } else if (strcmp(command,">COORDS") == 0) { receive_double3(COORD,0); + need_evaluation = 1; } else if (strcmp(command,">FORCES") == 0) { receive_double3(FORCE,0); @@ -328,11 +330,17 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) send_double3(COORD); } else if (strcmp(command,"ago < 0) { + + update->whichflag = 1; + lmp->init(); + update->integrate->setup(1); + update->whichflag = 0; + + } else { + + // insure potential energy and virial are tallied on this step + + update->ntimestep++; + pe->addstep(update->ntimestep); + press->addstep(update->ntimestep); + + int nflag = neighbor->decide(); + if (nflag == 0) { + comm->forward_comm(); + update->integrate->setup_minimal(0); + modify->clearstep_compute(); + output->thermo->compute(1); + modify->addstep_compute(update->ntimestep+1); + } else { + update->integrate->setup_minimal(1); + modify->clearstep_compute(); + output->thermo->compute(1); + modify->addstep_compute(update->ntimestep+1); + } + } +} + // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // responses to standard MDI driver commands @@ -1356,57 +1418,6 @@ void MDIEngine::infile() delete [] infile; } -/* ---------------------------------------------------------------------- - EVAL command - compute forces, energy, pressure of current system - can be called multiple times by driver - for a system that is continuously evolving - distinguishes between: - (1) first-time call - (2) system needs reneighboring - (3) system does not need reneighboring - this method does NOT increment timestep ----------------------------------------------------------------------- */ - -void MDIEngine::evaluate() -{ - // NOTE: ago is not a good test - // caller needs to distinguish - // currently cannot call it interspersed with "delete atoms" calls - // b/c whichflag stays set - // separate issue, need to unset whichflag when done - - if (neighbor->ago < 0) { - - update->whichflag = 1; - lmp->init(); - update->integrate->setup(1); - update->whichflag = 0; - - } else { - - // insure potential energy and virial are tallied on this step - - update->ntimestep++; - pe->addstep(update->ntimestep); - press->addstep(update->ntimestep); - - int nflag = neighbor->decide(); - if (nflag == 0) { - comm->forward_comm(); - update->integrate->setup_minimal(0); - modify->clearstep_compute(); - output->thermo->compute(1); - modify->addstep_compute(update->ntimestep+1); - } else { - update->integrate->setup_minimal(1); - modify->clearstep_compute(); - output->thermo->compute(1); - modify->addstep_compute(update->ntimestep+1); - } - } -} - /* ---------------------------------------------------------------------- RESET_BOX command wrapper on library reset_box() method diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index 36a6fbbf8c..25ed98bb5b 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -55,6 +55,8 @@ class MDIEngine : public Command { class Minimize *minimizer; class Compute *ke,*pe,*press; + int need_evaluation; // 1 if system has changed, else 0 + int nbytes; // NBYTES command value used by other commands // create_atoms state @@ -90,6 +92,8 @@ class MDIEngine : public Command { void mdi_md(); void mdi_optg(); + void evaluate(); + void receive_natoms(); void send_natoms(); void send_ntypes(); @@ -115,7 +119,6 @@ class MDIEngine : public Command { void single_command(); void many_commands(); void infile(); - void evaluate(); void reset_box(); void create_atoms(int); void send_stress(); From cf06f71514e29966f908522b58cdd7d3e3f8f05b Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Wed, 16 Mar 2022 17:46:01 -0600 Subject: [PATCH 018/130] more refactoring of MDI engine --- src/MDI/fix_mdi_aimd.cpp | 8 +- src/MDI/fix_mdi_engine.cpp | 12 + src/MDI/library_mdi.cpp | 7 + src/MDI/mdi_engine.cpp | 798 ++++++++++++++++++++++--------------- src/MDI/mdi_engine.h | 49 ++- 5 files changed, 542 insertions(+), 332 deletions(-) diff --git a/src/MDI/fix_mdi_aimd.cpp b/src/MDI/fix_mdi_aimd.cpp index 42b06b31bd..1cf659c3c0 100644 --- a/src/MDI/fix_mdi_aimd.cpp +++ b/src/MDI/fix_mdi_aimd.cpp @@ -206,14 +206,14 @@ void FixMDIAimd::post_force(int vflag) f[i][2] += buf3[3*ilocal+2] * mdi2lmp_force; } - // optionally request energy from MDI engine + // optionally request potential energy from MDI engine // divide by nprocs so each proc stores a portion if (eflag_global) { - ierr = MDI_Send_command("all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR,"MDI: engine_node("@FORCES"); } @@ -56,6 +58,8 @@ void FixMDIEngine::setup(int vflag) void FixMDIEngine::post_integrate() { + // engine is now at COORDS node for MD + mdi_engine->engine_node("@COORDS"); } @@ -63,6 +67,8 @@ void FixMDIEngine::post_integrate() void FixMDIEngine::min_pre_force(int vflag) { + // engine is now at COORDS node for minimizer + mdi_engine->engine_node("@COORDS"); } @@ -70,6 +76,8 @@ void FixMDIEngine::min_pre_force(int vflag) void FixMDIEngine::post_force(int vflag) { + // engine is now at FORCES node for MD + mdi_engine->engine_node("@FORCES"); } @@ -77,6 +85,8 @@ void FixMDIEngine::post_force(int vflag) void FixMDIEngine::min_post_force(int vflag) { + // engine is now at FORCES node for minimizer + mdi_engine->engine_node("@FORCES"); } @@ -84,5 +94,7 @@ void FixMDIEngine::min_post_force(int vflag) void FixMDIEngine::end_of_step() { + // engine is now at ENDSTEP node for MD + mdi_engine->engine_node("@ENDSTEP"); } diff --git a/src/MDI/library_mdi.cpp b/src/MDI/library_mdi.cpp index 70bb825767..927f299271 100644 --- a/src/MDI/library_mdi.cpp +++ b/src/MDI/library_mdi.cpp @@ -98,7 +98,14 @@ int MDI_Plugin_init_lammps() lmp = lammps_open(mdi_argc, mdi_argv, mpi_world_comm, nullptr); else lmp = lammps_open_no_mpi(mdi_argc, mdi_argv, nullptr); + + // process the specified input script + // must contain "mdi engine" command + lammps_file(lmp, filename); + + // shut down the plugin + lammps_close(lmp); return 0; diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index db0636b33f..a2789baf68 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -46,7 +46,7 @@ using namespace LAMMPS_NS; enum{NATIVE,REAL,METAL}; // LAMMPS units which MDI supports -enum{DEFAULT,MD,OPT}; // top-level MDI engine mode +enum{DEFAULT,MD,OPT,SYS}; // top-level MDI engine mode // per-atom data which engine commands access @@ -80,7 +80,19 @@ void MDIEngine::command(int narg, char **arg) void MDIEngine::mdi_engine(int narg, char **arg) { - if (narg > 0) error->all(FLERR,"Illegal mdi engine command"); + // process args + + enable_fix = 0; + + int iarg = 0; + while (iarg < narg) { + if (strcmp(arg[iarg],"nodes") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal mdi engine command"); + if (strcmp(arg[iarg+1],"yes") == 0) enable_fix = 1; + else if (strcmp(arg[iarg+1],"no") == 0) enable_fix = 0; + iarg += 2; + } else error->all(FLERR,"Illegal mdi engine command"); + } // check requirements for LAMMPS to work with MDI as an engine @@ -103,17 +115,14 @@ void MDIEngine::mdi_engine(int narg, char **arg) // MDI setup - mode = DEFAULT; - node_match = true; - exit_command = false; - mdicmd = new char[MDI_COMMAND_LENGTH]; node_engine = new char[MDI_COMMAND_LENGTH]; strncpy(node_engine,"@DEFAULT",MDI_COMMAND_LENGTH); node_driver = new char[MDI_COMMAND_LENGTH]; strncpy(node_driver,"\0",MDI_COMMAND_LENGTH); - // create computes for KE. PE, stress + // create computes for KE. PE, pressure + // pressure compute only calculates virial, no kinetic term id_ke = utils::strdup(std::string("MDI_ENGINE") + "_ke"); modify->add_compute(fmt::format("{} all ke", id_ke)); @@ -141,17 +150,16 @@ void MDIEngine::mdi_engine(int narg, char **arg) unit_conversions(); // irregular class and data structs used by MDI - // NOTE: not clear if irregular comm is ever needed - - //irregular = new Irregular(lmp); buf1 = buf1all = nullptr; buf3 = buf3all = nullptr; ibuf1 = ibuf1all = nullptr; maxbuf = 0; - need_evaluation = 1; + // internal state of engine + nbytes = -1; + need_evaluation = 1; create_atoms_flag = 0; // define MDI commands that LAMMPS engine recognizes @@ -165,10 +173,14 @@ void MDIEngine::mdi_engine(int narg, char **arg) // endless engine loop, responding to driver commands + mode = DEFAULT; + node_match = true; + exit_command = false; + while (1) { // top-level mdi engine only recognizes three nodes - // DEFAULT, INIT_MD, INIT_OPTG + // DEFAULT, INIT_MD, INIT_OPTG, INIT_SYS engine_node("@DEFAULT"); @@ -176,18 +188,23 @@ void MDIEngine::mdi_engine(int narg, char **arg) if (strcmp(mdicmd,"@INIT_MD") == 0) { mdi_md(); - if (strcmp(mdicmd,"EXIT")) break; + if (exit_command) break; } else if (strcmp(mdicmd,"@INIT_OPTG") == 0) { mdi_optg(); - if (strcmp(mdicmd,"EXIT")) break; + if (exit_command) break; - } else if (strcmp(mdicmd,"EXIT") == 0) { + } else if (strcmp(mdicmd,"@INIT_SYS") == 0) { + mdi_sys(); + if (exit_command) break; + + } else if (exit_command) { break; } else error->all(FLERR, - fmt::format("MDI node exited with invalid command: {}",mdicmd)); + fmt::format("MDI engine exited with invalid command: {}", + mdicmd)); } // clean up @@ -217,7 +234,7 @@ void MDIEngine::mdi_engine(int narg, char **arg) /* ---------------------------------------------------------------------- engine is now at this MDI node - loop over received commands so long as driver also at this node + loop over received commands so long as driver is also at this node return when not the case or EXIT command received ---------------------------------------------------------------------- */ @@ -225,7 +242,7 @@ void MDIEngine::engine_node(const char *node) { int ierr; - // do not process commands if engine and driver are not at same node + // do not process commands if engine and driver request are not the same strncpy(node_engine,node,MDI_COMMAND_LENGTH); @@ -250,13 +267,13 @@ void MDIEngine::engine_node(const char *node) execute_command(mdicmd,mdicomm); - // check if driver node is now somewhere other than engine node + // check if driver request is now different than engine node if (strcmp(node_driver,"\0") != 0 && strcmp(node_driver,node_engine) != 0) node_match = false; } - // node exit was triggered so reset node exit flag + // node exit was triggered so reset node_match node_match = true; } @@ -273,9 +290,9 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) int ierr; // confirm this command is supported at this node - // otherwise is an error + // otherwise is error - int command_exists = 1; + int command_exists; if (root) { ierr = MDI_Check_command_exists(node_engine,command,MDI_COMM_NULL, &command_exists); @@ -290,38 +307,42 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) // --------------------------------------- // respond to MDI standard commands - // listed in alphabetic order: receives first, sends second + // receives first, sends second, node commands third // --------------------------------------- if (strcmp(command,">CELL") == 0) { receive_cell(); } else if (strcmp(command,">CELL_DISPL") == 0) { - receive_celldispl(); + receive_cell_displ(); + + } else if (strcmp(command,">CHARGES") == 0) { + receive_charges(); } else if (strcmp(command,">COORDS") == 0) { - receive_double3(COORD,0); + receive_coords(); need_evaluation = 1; - } else if (strcmp(command,">FORCES") == 0) { - receive_double3(FORCE,0); - - } else if (strcmp(command,">+FORCES") == 0) { - receive_double3(FORCE,1); - } else if (strcmp(command,">NATOMS") == 0) { receive_natoms(); + } else if (strcmp(command,">TYPES") == 0) { + receive_types(); + } else if (strcmp(command,">VELOCITIES") == 0) { - receive_double3(VELOCITY,0); + receive_velocities(); // ----------------------------------------------- + } else if (strcmp(command,"<@") == 0) { + ierr = MDI_Send(node_engine,MDI_NAME_LENGTH,MDI_CHAR,mdicomm); + if (ierr) error->all(FLERR,"MDI: <@ data"); + } else if (strcmp(command,"all(FLERR,"MDI: <@ data"); - } else if (strcmp(command,"@DEFAULT") == 0) { mode = DEFAULT; - strncpy(node_driver,"@DEFAULT",MDI_COMMAND_LENGTH); node_match = false; - // are we in the middle of a geometry optimization? - // ensure that the energy and force tolerances are met - // set the maximum number of force evaluations to 0 + // if minimization in progress, force it to quit if (mode == OPT) { update->etol = std::numeric_limits::max(); @@ -423,12 +438,10 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) // exit command - } else if (strcmp(command, "EXIT") == 0) { + } else if (strcmp(command,"EXIT") == 0) { exit_command = true; - // are we in the middle of a geometry optimization? - // if so, ensure energy and force tolerances are met - // set the maximum number of force evaluations to 0 + // if minimization in progress, force it to quit if (mode == OPT) { update->etol = std::numeric_limits::max(); @@ -440,6 +453,12 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) // custom LAMMPS commands // ------------------------------------------------------- + } else if (strcmp(command,"@INIT_SYS") == 0) { + if (mode != DEFAULT) + error->all(FLERR,"MDI: MDI engine is already performing a simulation"); + mode = SYS; + node_match = false; + } else if (strcmp(command,"NBYTES") == 0) { nbytes_command(); } else if (strcmp(command,"COMMAND") == 0) { @@ -448,22 +467,8 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) many_commands(); } else if (strcmp(command,"INFILE") == 0) { infile(); - } else if (strcmp(command,"RESET_BOX") == 0) { - reset_box(); - } else if (strcmp(command,"CREATE_ATOM") == 0) { - create_atoms(CREATE_ATOM); - } else if (strcmp(command,"CREATE_ID") == 0) { - create_atoms(CREATE_ID); - } else if (strcmp(command,"CREATE_TYPE") == 0) { - create_atoms(CREATE_TYPE); - } else if (strcmp(command,"CREATE_X") == 0) { - create_atoms(CREATE_X); - } else if (strcmp(command,"CREATE_V") == 0) { - create_atoms(CREATE_V); - } else if (strcmp(command,"CREATE_IMG") == 0) { - create_atoms(CREATE_IMAGE); - } else if (strcmp(command,"CREATE_GO") == 0) { - create_atoms(CREATE_GO); + } else if (strcmp(command,"CELL"); MDI_Register_command("@DEFAULT", ">CELL_DISPL"); + MDI_Register_command("@DEFAULT", ">CHARGES"); MDI_Register_command("@DEFAULT", ">COORDS"); + MDI_Register_command("@DEFAULT", ">NATOMS"); + MDI_Register_command("@DEFAULT", ">TYPES"); MDI_Register_command("@DEFAULT", ">VELOCITIES"); MDI_Register_command("@DEFAULT", "@INIT_MD"); MDI_Register_command("@DEFAULT", "@INIT_OPTG"); MDI_Register_command("@DEFAULT", "EXIT"); // default node, custom commands added by LAMMPS - // max length for a command is currently 11 chars MDI_Register_command("@DEFAULT", "NBYTES"); MDI_Register_command("@DEFAULT", "COMMAND"); MDI_Register_command("@DEFAULT", "COMMANDS"); MDI_Register_command("@DEFAULT", "INFILE"); - MDI_Register_command("@DEFAULT", "RESET_BOX"); - MDI_Register_command("@DEFAULT", "CREATE_ATOM"); - MDI_Register_command("@DEFAULT", "CREATE_ID"); - MDI_Register_command("@DEFAULT", "CREATE_TYPE"); - MDI_Register_command("@DEFAULT", "CREATE_X"); - MDI_Register_command("@DEFAULT", "CREATE_V"); - MDI_Register_command("@DEFAULT", "CREATE_IMG"); - MDI_Register_command("@DEFAULT", "CREATE_GO"); - MDI_Register_command("@DEFAULT", ">NATOMS"); MDI_Register_command("@DEFAULT", "CELL"); + MDI_Register_command("@INIT_SYS", ">CELL_DISPL"); + MDI_Register_command("@INIT_SYS", ">CHARGES"); + MDI_Register_command("@INIT_SYS", ">COORDS"); + MDI_Register_command("@INIT_SYS", ">NATOMS"); + MDI_Register_command("@INIT_SYS", ">TYPES"); + MDI_Register_command("@INIT_SYS", ">VELOCITIES"); + MDI_Register_command("@INIT_SYS", "EXIT"); // node for setting up and running a dynamics simulation MDI_Register_node("@INIT_MD"); MDI_Register_command("@INIT_MD", "<@"); - MDI_Register_command("@INIT_MD", "CELL"); - MDI_Register_command("@INIT_MD", ">CELL_DISPL"); - MDI_Register_command("@INIT_MD", ">COORDS"); - MDI_Register_command("@INIT_MD", ">FORCES"); - MDI_Register_command("@INIT_MD", ">+FORCES"); MDI_Register_command("@INIT_MD", "@"); MDI_Register_command("@INIT_MD", "@DEFAULT"); MDI_Register_command("@INIT_MD", "@COORDS"); @@ -563,23 +554,7 @@ void MDIEngine::mdi_commands() MDI_Register_node("@INIT_OPTG"); MDI_Register_command("@INIT_OPTG", "<@"); - MDI_Register_command("@INIT_OPTG", "CELL"); - MDI_Register_command("@INIT_OPTG", ">CELL_DISPL"); - MDI_Register_command("@INIT_OPTG", ">COORDS"); - MDI_Register_command("@INIT_OPTG", ">FORCES"); - MDI_Register_command("@INIT_OPTG", ">+FORCES"); MDI_Register_command("@INIT_OPTG", "@"); MDI_Register_command("@INIT_OPTG", "@DEFAULT"); MDI_Register_command("@INIT_OPTG", "@COORDS"); @@ -588,82 +563,74 @@ void MDIEngine::mdi_commands() MDI_Register_command("@INIT_OPTG", "EXIT"); // node at POST_INTEGRATE location in timestep + // only if fix MDI/ENGINE is instantiated - MDI_Register_node("@COORDS"); - MDI_Register_command("@COORDS", "<@"); - MDI_Register_command("@COORDS", "CELL"); - MDI_Register_command("@COORDS", ">CELL_DISPL"); - MDI_Register_command("@COORDS", ">COORDS"); - MDI_Register_command("@COORDS", ">FORCES"); - MDI_Register_command("@COORDS", ">+FORCES"); - MDI_Register_command("@COORDS", "@"); - MDI_Register_command("@COORDS", "@DEFAULT"); - MDI_Register_command("@COORDS", "@COORDS"); - MDI_Register_command("@COORDS", "@FORCES"); - MDI_Register_command("@COORDS", "@ENDSTEP"); - MDI_Register_command("@COORDS", "EXIT"); + if (enable_fix) { + MDI_Register_node("@COORDS"); + MDI_Register_command("@COORDS", "<@"); + MDI_Register_command("@COORDS", "COORDS"); + MDI_Register_command("@COORDS", "@"); + MDI_Register_command("@COORDS", "@DEFAULT"); + MDI_Register_command("@COORDS", "@COORDS"); + MDI_Register_command("@COORDS", "@FORCES"); + MDI_Register_command("@COORDS", "@ENDSTEP"); + MDI_Register_command("@COORDS", "EXIT"); + } // node at POST_FORCE location in timestep + // only if fix MDI/ENGINE is instantiated - MDI_Register_node("@FORCES"); - MDI_Register_callback("@FORCES", ">FORCES"); - MDI_Register_callback("@FORCES", ">+FORCES"); - MDI_Register_command("@FORCES", "<@"); - MDI_Register_command("@FORCES", "CELL"); - MDI_Register_command("@FORCES", ">CELL_DISPL"); - MDI_Register_command("@FORCES", ">COORDS"); - MDI_Register_command("@FORCES", ">FORCES"); - MDI_Register_command("@FORCES", ">+FORCES"); - MDI_Register_command("@FORCES", "@"); - MDI_Register_command("@FORCES", "@DEFAULT"); - MDI_Register_command("@FORCES", "@COORDS"); - MDI_Register_command("@FORCES", "@FORCES"); - MDI_Register_command("@FORCES", "@ENDSTEP"); - MDI_Register_command("@FORCES", "EXIT"); + if (enable_fix) { + MDI_Register_node("@FORCES"); + MDI_Register_command("@FORCES", "<@"); + MDI_Register_command("@FORCES", "FORCES"); + MDI_Register_callback("@FORCES", ">+FORCES"); + MDI_Register_command("@FORCES", "all(FLERR,"MDI engine command did not enable @INIT_MD support"); + modify->add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); mdi_fix = (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); mdi_fix->mdi_engine = this; @@ -682,10 +649,14 @@ void MDIEngine::mdi_md() lmp->init(); // engine is now at @INIT_MD node - // receive any commands driver may wish to send + // receive any commands driver wishes to send engine_node("@INIT_MD"); - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) { + modify->delete_fix("MDI_ENGINE_INTERNAL"); + return; + } // setup the MD simulation @@ -707,8 +678,7 @@ void MDIEngine::mdi_md() update->integrate->run(1); - // driver triggers end of MD loop by senging @DEFAULT or EXIT - // delete fix with ID = MDI_ENGINE_INTERNAL + // driver triggers end of MD loop by sending @DEFAULT or EXIT if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) { modify->delete_fix("MDI_ENGINE_INTERNAL"); @@ -718,13 +688,24 @@ void MDIEngine::mdi_md() } /* ---------------------------------------------------------------------- - perform minimization under control of driver + perform minimization under control of driver one iteration at a time + use of fix MDI/ENGINE allows MDI comm within iteration ---------------------------------------------------------------------- */ void MDIEngine::mdi_optg() { - // setup the minimizer in a way that ensures optimization - // will continue until MDI driver exits + // add an instance of fix MDI/ENGINE + // delete the instance before this method returns + + if (!enable_fix) + error->all(FLERR,"MDI engine command did not enable @INIT_OPTG support"); + + modify->add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); + mdi_fix = (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); + mdi_fix->mdi_engine = this; + + // set tolerances to epsilon and iteration limits huge + // allows MDI driver to force an exit update->etol = std::numeric_limits::min(); update->ftol = std::numeric_limits::min(); @@ -738,10 +719,14 @@ void MDIEngine::mdi_optg() lmp->init(); // engine is now at @INIT_OPTG node + // receive any commands driver wishes to send engine_node("@INIT_OPTG"); - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) { + modify->delete_fix("MDI_ENGINE_INTERNAL"); + return; + } // setup the minimization @@ -749,20 +734,87 @@ void MDIEngine::mdi_optg() if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; - // Start a minimization, which is configured to run (essentially) - // infinite steps. When the driver sends the EXIT command, - // the minimizer's energy and force tolerances are set to - // extremely large values, causing the minimization to end. + // start minimization + // when the driver sends @DEFAULT or EXIT minimizer tolerances are + // set to large values to force it to exit update->minimize->iterate(update->nsteps); // return if driver sends @DEFAULT or EXIT + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) { + modify->delete_fix("MDI_ENGINE_INTERNAL"); + return; + } +} + +/* ---------------------------------------------------------------------- + initialize a new simulation for single-point calc or dynamics or min +---------------------------------------------------------------------- */ + +void MDIEngine::mdi_sys() +{ + // engine is now at @INIT_SYS node + // receive commands driver sends to define the system + // GO command will force return from INIT_SYS + + engine_node("@INIT_SYS"); + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; - error->all(FLERR, - fmt::format("MDI reached end of OPTG simulation " - "with invalid command: {}",mdicmd)); + // clear system via delete_atoms command + // lib->reset_box() + // lib->create_atoms() + // then init LAMMPS for new system for MD or min + + //lmp->input->command(); + + // initialize a new simulation + + update->whichflag = 1; + timer->init_timeout(); + update->nsteps = 1; + update->ntimestep = 0; + update->firststep = update->ntimestep; + update->laststep = update->ntimestep + update->nsteps; + update->beginstep = update->firststep; + update->endstep = update->laststep; + + lmp->init(); + + // setup the MD simulation + + update->integrate->setup(1); + + // run MD one step at a time until driver sends @DEFAULT or EXIT + // driver can communicate with LAMMPS within each timestep + // by sending a node command which matches a method in FixMDIEngine + + while (true) { + update->whichflag = 1; + timer->init_timeout(); + update->nsteps += 1; + update->laststep += 1; + update->endstep = update->laststep; + output->next = update->ntimestep + 1; + + // single MD timestep + + update->integrate->run(1); + + // driver triggers end of MD loop by sending @DEFAULT or EXIT + + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) { + modify->delete_fix("MDI_ENGINE_INTERNAL"); + return; + } + } + + // check that return is NOT GO + + engine_node("@INIT_SYS"); + + if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; } /* ---------------------------------------------------------------------- @@ -818,16 +870,180 @@ void MDIEngine::evaluate() // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- -// responses to standard MDI driver commands +// responses to ">" MDI driver commands that send data // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- +/* ---------------------------------------------------------------------- + >CELL command + reset the simulation box edge vectors + in conjunction with >CELL_DISPL this can adjust box arbitrarily +---------------------------------------------------------------------- */ + +void MDIEngine::receive_cell() +{ + if (mode == DEFAULT) receive_cell_default(); + else if (mode == SYS) receive_cell_sys(); +} + +void MDIEngine::receive_cell_default() +{ + double cell[9]; + + int ierr = MDI_Recv(cell,9,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL data"); + MPI_Bcast(cell,9,MPI_DOUBLE,0,world); + + for (int icell = 0; icell < 9; icell++) + cell[icell] *= mdi2lmp_length; + + // error check that edge vectors match LAMMPS triclinic requirement + + if (cell[1] != 0.0 || cell[2] != 0.0 || cell[5] != 0.0) + error->all(FLERR,"MDI: Received cell edges are not LAMMPS compatible"); + + // convert atoms to lamda coords before changing box + + domain->x2lamda(atom->nlocal); + + // convert celldata to new boxlo, boxhi, and tilt factors + + domain->boxhi[0] = cell[0] + domain->boxlo[0]; + domain->boxhi[1] = cell[4] + domain->boxlo[1]; + domain->boxhi[2] = cell[8] + domain->boxlo[2]; + + domain->xy = cell[3]; + domain->xz = cell[6]; + domain->yz = cell[7]; + + // reset all Domain variables that depend on box size/shape + // convert atoms coords back to new box coords + + domain->set_global_box(); + domain->set_local_box(); + domain->lamda2x(atom->nlocal); +} + +void MDIEngine::receive_cell_sys() +{ + int ierr = MDI_Recv(sys_cell,9,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL data"); + MPI_Bcast(sys_cell,9,MPI_DOUBLE,0,world); + + for (int icell = 0; icell < 9; icell++) + sys_cell[icell] *= mdi2lmp_length; + + // error check that edge vectors match LAMMPS triclinic requirement + + if (sys_cell[1] != 0.0 || sys_cell[2] != 0.0 || sys_cell[5] != 0.0) + error->all(FLERR,"MDI: Received cell edges are not LAMMPS compatible"); +} + +/* ---------------------------------------------------------------------- + >CELL_DISPL command + reset simulation box origin = lower-left corner +---------------------------------------------------------------------- */ + +void MDIEngine::receive_cell_displ() +{ + if (mode == DEFAULT) receive_cell_displ_default(); + else if (mode == SYS) receive_cell_displ_sys(); +} + +void MDIEngine::receive_cell_displ_default() +{ + double cell_displ[3]; + int ierr = MDI_Recv(cell_displ,3,MDI_DOUBLE,mdicomm); + if (ierr) + error->all(FLERR,"MDI: >CELL_DISPLS data"); + MPI_Bcast(cell_displ,3,MPI_DOUBLE,0,world); + + for (int icell = 0; icell < 3; icell++) + cell_displ[icell] *= mdi2lmp_length; + + // convert atoms to lamda coords before changing box + + domain->x2lamda(atom->nlocal); + + // convert cell_displ to new boxlo and boxhi + + double old_boxlo[3]; + old_boxlo[0] = domain->boxlo[0]; + old_boxlo[1] = domain->boxlo[1]; + old_boxlo[2] = domain->boxlo[2]; + + domain->boxlo[0] = cell_displ[0]; + domain->boxlo[1] = cell_displ[1]; + domain->boxlo[2] = cell_displ[2]; + + domain->boxhi[0] += domain->boxlo[0] - old_boxlo[0]; + domain->boxhi[1] += domain->boxlo[1] - old_boxlo[1]; + domain->boxhi[2] += domain->boxlo[2] - old_boxlo[2]; + + // reset all Domain variables that depend on box origin + // convert atoms coords back to new box coords + + domain->set_global_box(); + domain->set_local_box(); + domain->lamda2x(atom->nlocal); +} + +void MDIEngine::receive_cell_displ_sys() +{ + int ierr = MDI_Recv(sys_cell_displ,3,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: >CELL_DISPLS data"); + MPI_Bcast(sys_cell_displ,3,MPI_DOUBLE,0,world); + + for (int icell = 0; icell < 3; icell++) + sys_cell_displ[icell] *= mdi2lmp_length; +} + +/* ---------------------------------------------------------------------- + >CHARGES command +---------------------------------------------------------------------- */ + +void MDIEngine::receive_charges() +{ + if (mode == DEFAULT) receive_double1(CHARGE); + else if (mode == SYS) receive_charges_sys(); +} + +void MDIEngine::receive_charges_sys() +{ + int ierr = MDI_Recv(sys_charges,sys_natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: >CHARGES data"); + MPI_Bcast(sys_charges,sys_natoms,MPI_DOUBLE,0,world); +} + +/* ---------------------------------------------------------------------- + >COORDS command +---------------------------------------------------------------------- */ + +void MDIEngine::receive_coords() +{ + if (mode == DEFAULT) receive_double3(COORD,0); + else if (mode == SYS) receive_coords_sys(); +} + +void MDIEngine::receive_coords_sys() +{ + int ierr = MDI_Recv(sys_coords,3*sys_natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: >COORDS data"); + MPI_Bcast(sys_coords,3*sys_natoms,MPI_DOUBLE,0,world); +} + /* ---------------------------------------------------------------------- >NATOMS command natoms cannot exceed 32-bit int for use with MDI ---------------------------------------------------------------------- */ void MDIEngine::receive_natoms() +{ + if (mode == DEFAULT) receive_natoms_default(); + else if (mode == SYS) receive_natoms_sys(); +} + +void MDIEngine::receive_natoms_default() { int natoms; int ierr = MDI_Recv(&natoms,1,MDI_INT,mdicomm); @@ -837,26 +1053,46 @@ void MDIEngine::receive_natoms() atom->natoms = natoms; } -/* ---------------------------------------------------------------------- - (atom->natoms); - int ierr = MDI_Send(&natoms,1,MDI_INT,mdicomm); - if (ierr != 0) error->all(FLERR,"MDI: all(FLERR,"MDI: >NATOMS data"); + MPI_Bcast(&sys_natoms,1,MPI_INT,0,world); + if (sys_natoms < 0) error->all(FLERR,"MDI received natoms < 0"); } /* ---------------------------------------------------------------------- - TYPES command ---------------------------------------------------------------------- */ -void MDIEngine::send_ntypes() +void MDIEngine::receive_types() { - int ierr = MDI_Send(&atom->ntypes,1,MDI_INT,mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: all(FLERR,"MDI: >TYPES data"); + MPI_Bcast(sys_types,sys_natoms,MPI_INT,0,world); +} + +/* ---------------------------------------------------------------------- + >VELOCITIES command +---------------------------------------------------------------------- */ + +void MDIEngine::receive_velocities() +{ + if (mode == DEFAULT) receive_double3(VELOCITY,0); + else if (mode == SYS) receive_velocities_sys(); +} + +void MDIEngine::receive_velocities_sys() +{ + int ierr = MDI_Recv(sys_velocities,3*sys_natoms,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: >VELOCITIES data"); + MPI_Bcast(sys_velocities,3*sys_natoms,MPI_DOUBLE,0,world); } /* ---------------------------------------------------------------------- @@ -874,7 +1110,7 @@ void MDIEngine::receive_double1(int which) if (ierr) error->all(FLERR,"MDI: >double1 data"); MPI_Bcast(buf1,atom->natoms,MPI_DOUBLE,0,world); - // extract onwed atom values + // extract owned atom values // use atomID to index into ordered buf tagint *tag = atom->tag; @@ -906,7 +1142,7 @@ void MDIEngine::receive_int1(int which) if (ierr) error->all(FLERR,"MDI: >int1 data"); MPI_Bcast(ibuf1,atom->natoms,MPI_INT,0,world); - // extract onwed atom values + // extract owned atom values // use atomID to index into ordered buf tagint *tag = atom->tag; @@ -982,29 +1218,38 @@ void MDIEngine::receive_double3(int which, int addflag) v[i][2] = buf3[3*ilocal+2] * mdi2lmp_velocity; } } - - // NOTE: these operations cannot be done in the middle - // of an arbitrary timestep, only when reneighboring is done - - /* - // ensure atoms are in current box & update box via shrink-wrap - // has to be be done before invoking Irregular::migrate_atoms() - // since it requires atoms be inside simulation box - - if (domain->triclinic) domain->x2lamda(atom->nlocal); - domain->pbc(); - domain->reset_box(); - if (domain->triclinic) domain->lamda2x(atom->nlocal); - - // move atoms to new processors via irregular() - // only needed if migrate_check() says an atom moves too far - - if (domain->triclinic) domain->x2lamda(atom->nlocal); - if (irregular->migrate_check()) irregular->migrate_atoms(); - if (domain->triclinic) domain->lamda2x(atom->nlocal); - */ } +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// responses to "<" MDI driver commands that request data +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + +/* ---------------------------------------------------------------------- + (atom->natoms); + int ierr = MDI_Send(&natoms,1,MDI_INT,mdicomm); + if (ierr != 0) error->all(FLERR,"MDI: compute_scalar(); potential_energy *= lmp2mdi_energy; @@ -1229,56 +1474,12 @@ void MDIEngine::send_cell() if (ierr) error->all(FLERR,"MDI: CELL command - reset the simulation box edge vectors - in conjunction with >CELL_DISPL this can adjust box arbitrarily ----------------------------------------------------------------------- */ - -void MDIEngine::receive_cell() -{ - double celldata[9]; - - int ierr = MDI_Recv(celldata,9,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR, "MDI: >CELL data"); - MPI_Bcast(celldata,9,MPI_DOUBLE,0,world); - - for (int icell = 0; icell < 9; icell++) - celldata[icell] *= mdi2lmp_length; - - // error check that edge vectors match LAMMPS triclinic requirement - - if (celldata[1] != 0.0 || celldata[2] != 0.0 || celldata[5] != 0.0) - error->all(FLERR,"MDI: Received cell edges are not LAMMPS compatible"); - - // convert atoms to lamda coords before changing box - - domain->x2lamda(atom->nlocal); - - // convert celldata to new boxlo, boxhi, and tilt factors - - domain->boxhi[0] = celldata[0] + domain->boxlo[0]; - domain->boxhi[1] = celldata[4] + domain->boxlo[1]; - domain->boxhi[2] = celldata[8] + domain->boxlo[2]; - - domain->xy = celldata[3]; - domain->xz = celldata[6]; - domain->yz = celldata[7]; - - // reset all Domain variables that depend on box size/shape - // convert atoms coords back to new box coords - - domain->set_global_box(); - domain->set_local_box(); - domain->lamda2x(atom->nlocal); -} - /* ---------------------------------------------------------------------- all(FLERR,"MDI: CELL_DISPL command - reset simulation box origin = lower-left corner ----------------------------------------------------------------------- */ - -void MDIEngine::receive_celldispl() -{ - double celldata[3]; - int ierr = MDI_Recv(celldata,3,MDI_DOUBLE,mdicomm); - if (ierr) - error->all(FLERR,"MDI: >CELL_DISPLS data"); - MPI_Bcast(celldata,3,MPI_DOUBLE,0,world); - - for (int icell = 0; icell < 3; icell++) - celldata[icell] *= mdi2lmp_length; - - // convert atoms to lamda coords before changing box - - domain->x2lamda(atom->nlocal); - - // convert celldata to new boxlo and boxhi - - double old_boxlo[3]; - old_boxlo[0] = domain->boxlo[0]; - old_boxlo[1] = domain->boxlo[1]; - old_boxlo[2] = domain->boxlo[2]; - - domain->boxlo[0] = celldata[0]; - domain->boxlo[1] = celldata[1]; - domain->boxlo[2] = celldata[2]; - - domain->boxhi[0] += domain->boxlo[0] - old_boxlo[0]; - domain->boxhi[1] += domain->boxlo[1] - old_boxlo[1]; - domain->boxhi[2] += domain->boxlo[2] - old_boxlo[2]; - - // reset all Domain variables that depend on box origin - // convert atoms coords back to new box coords - - domain->set_global_box(); - domain->set_local_box(); - domain->lamda2x(atom->nlocal); -} - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // responses to custom LAMMPS MDI commands diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index 25ed98bb5b..c23325c443 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -35,8 +35,10 @@ class MDIEngine : public Command { void engine_node(const char *node); private: - int lmpunits; // REAL or METAL or NATIVE - int root; // 1 for proc 0, otherwise 0 + int lmpunits; // REAL or METAL or NATIVE + int root; // 1 for proc 0, otherwise 0 + + int enable_fix; // 1 if mdi engine command asked for node support // state of MDI engine @@ -59,8 +61,16 @@ class MDIEngine : public Command { int nbytes; // NBYTES command value used by other commands + // @INIT_SYS state + + int sys_natoms; + int *sys_types; + double *sys_charges,*sys_coords,*sys_velocities; + double *sys_cell,*sys_cell_displ; + // create_atoms state + int create_atoms_flag; int create_natoms; tagint *create_id; @@ -91,29 +101,52 @@ class MDIEngine : public Command { void mdi_commands(); void mdi_md(); void mdi_optg(); + void mdi_sys(); void evaluate(); + void receive_cell(); + void receive_cell_default(); + void receive_cell_sys(); + + void receive_cell_displ(); + void receive_cell_displ_default(); + void receive_cell_displ_sys(); + + void receive_charges(); + void receive_charges_sys(); + + void receive_coords(); + void receive_coords_sys(); + void receive_natoms(); - void send_natoms(); - void send_ntypes(); + void receive_natoms_default(); + void receive_natoms_sys(); + + void receive_types(); + void receive_types_sys(); + + void receive_velocities(); + void receive_velocities_sys(); void receive_double1(int); void receive_int1(int); void receive_double3(int, int); + + void send_natoms(); + void send_ntypes(); + void send_double1(int); void send_int1(int); void send_double3(int); void send_labels(); void send_total_energy(); - void send_energy(); + void send_pe(); void send_ke(); void send_cell(); - void receive_cell(); - void send_celldispl(); - void receive_celldispl(); + void send_cell_displ(); void nbytes_command(); void single_command(); From e12e06198cbfaedd1fcf2803f6a72edf4d8c17aa Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 17 Mar 2022 17:58:26 -0600 Subject: [PATCH 019/130] enable long md and min runs --- examples/mdi/series_driver.py | 56 ++-- src/MDI/mdi_engine.cpp | 561 +++++++++++++++------------------- src/MDI/mdi_engine.h | 14 +- 3 files changed, 281 insertions(+), 350 deletions(-) diff --git a/examples/mdi/series_driver.py b/examples/mdi/series_driver.py index 682a6365ec..6addedcb71 100644 --- a/examples/mdi/series_driver.py +++ b/examples/mdi/series_driver.py @@ -150,9 +150,9 @@ random.seed(seed) for icalc in range(ncalc): - # delete all atoms so can run a new calculation + # define a new system - send_command("delete_atoms group all") + mdi.MDI_Send_command("@INIT_SYS",mdicomm) # define simulation box @@ -166,8 +166,8 @@ for icalc in range(ncalc): # send simulation box to engine - vec = [xlo,ylo,zlo,xhi,yhi,zhi,0.0,0.0,0.0] - mdi.MDI_Send_command("RESET_BOX",mdicomm) + vec = [xhi-xlo,0.0,0.0] + [0.0,yhi-ylo,0.0] + [0.0,0.0,zhi-zlo] + mdi.MDI_Send_command(">CELL",mdicomm) mdi.MDI_Send(vec,9,mdi.MDI_DOUBLE,mdicomm) # create atoms on perfect lattice @@ -203,36 +203,43 @@ for icalc in range(ncalc): # send atoms and their properties to engine - mdi.MDI_Send_command("CREATE_ATOM",mdicomm) + mdi.MDI_Send_command(">NATOMS",mdicomm) mdi.MDI_Send(natoms,1,mdi.MDI_INT,mdicomm) - mdi.MDI_Send_command("CREATE_TYPE",mdicomm) + mdi.MDI_Send_command(">TYPES",mdicomm) mdi.MDI_Send(atypes,natoms,mdi.MDI_INT,mdicomm) - mdi.MDI_Send_command("CREATE_X",mdicomm) + mdi.MDI_Send_command(">COORDS",mdicomm) mdi.MDI_Send(coords,3*natoms,mdi.MDI_DOUBLE,mdicomm) - mdi.MDI_Send_command("CREATE_V",mdicomm) + mdi.MDI_Send_command(">VELOCITIES",mdicomm) mdi.MDI_Send(vels,3*natoms,mdi.MDI_DOUBLE,mdicomm) - mdi.MDI_Send_command("CREATE_GO",mdicomm) # eval or run or minimize + mdi.MDI_Send_command("@EVAL",mdicomm) + if mode == "eval": - mdi.MDI_Send_command("EVAL",mdicomm) + mdi.MDI_Send_command(">STEPS",mdicomm) + mdi.MDI_Send(0,1,mdi.MDI_INT,mdicomm) elif mode == "run": - send_command("run %d" % nsteps) + mdi.MDI_Send_command(">STEPS",mdicomm) + mdi.MDI_Send(steps,1,mdi.MDI_INT,mdicomm) elif mode == "min": - send_command("minimize %g %g 1000 1000" % (tol,tol)) + mdi.MDI_Send_command(">TOLERANCE",mdicomm) + params = [1.0e-4,1.0e-4,1000.0,1000.0] + mdi.MDI_Send(params,4,mdi.MDI_DOUBLE,mdicomm) - # request energy + mdi.MDI_Send_command("@DEFAULT",mdicomm) - mdi.MDI_Send_command("all(FLERR,"MDI: MDI engine is already performing a simulation"); mode = SYS; node_match = false; + } else if (strcmp(command,"@EVAL") == 0) { + if (mode != DEFAULT) + error->all(FLERR,"MDI: MDI engine is already performing a simulation"); + mode = EVAL; + node_match = false; } else if (strcmp(command,"NBYTES") == 0) { nbytes_command(); @@ -466,7 +470,11 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) } else if (strcmp(command,"COMMANDS") == 0) { many_commands(); } else if (strcmp(command,"INFILE") == 0) { - infile(); + infile();w + } else if (strcmp(command,">STEPS") == 0) { + send_steps(); + } else if (strcmp(command,">TOLERANCE") == 0) { + send_tolerance(); } else if (strcmp(command,"NATOMS"); MDI_Register_command("@INIT_SYS", ">TYPES"); MDI_Register_command("@INIT_SYS", ">VELOCITIES"); + MDI_Register_command("@INIT_SYS", "@DEFAULT"); MDI_Register_command("@INIT_SYS", "EXIT"); + // custom nodes added by LAMMPS + + MDI_Register_node("@EVAL"); + MDI_Register_command("@EVAL", ">STEPS"); + MDI_Register_command("@EVAL", ">TOLERANC"); + // node for setting up and running a dynamics simulation MDI_Register_node("@INIT_MD"); @@ -749,72 +764,129 @@ void MDIEngine::mdi_optg() } /* ---------------------------------------------------------------------- - initialize a new simulation for single-point calc or dynamics or min + initialize a new simulation ---------------------------------------------------------------------- */ void MDIEngine::mdi_sys() { // engine is now at @INIT_SYS node // receive commands driver sends to define the system - // GO command will force return from INIT_SYS + // another @ command will trigger setup of the system + + sys_natoms_flag = sys_types_flag = sys_charges_flag = 0; + sys_coords_flag = sys_velocities_flag = 0; + sys_cell_flag = sys_cell_displ_flag = 0; engine_node("@INIT_SYS"); - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + if (strcmp(mdicmd,"EXIT") == 0) return; + + // >CELL, >NATOMS, >TYPES, >COORDS commands must have been issued + + if (sys_cell_flag == 0 || sys_natoms_flag == 0) + error->all(FLERR,"@INIT_SYS requires >NATOMS and >CELL MDI commands"); + if (sys_types_flag == 0 || sys_coords_flag == 0) + error->all(FLERR,"@INIT_SYS requires >TYPES and >COORDS MDI commands"); // clear system via delete_atoms command + + lmp->input->one("delete_atoms group all"); + // lib->reset_box() - // lib->create_atoms() - // then init LAMMPS for new system for MD or min - //lmp->input->command(); + double boxlo[3],boxhi[3]; + double xy,yz,xz; - // initialize a new simulation - - update->whichflag = 1; - timer->init_timeout(); - update->nsteps = 1; - update->ntimestep = 0; - update->firststep = update->ntimestep; - update->laststep = update->ntimestep + update->nsteps; - update->beginstep = update->firststep; - update->endstep = update->laststep; - - lmp->init(); - - // setup the MD simulation - - update->integrate->setup(1); - - // run MD one step at a time until driver sends @DEFAULT or EXIT - // driver can communicate with LAMMPS within each timestep - // by sending a node command which matches a method in FixMDIEngine - - while (true) { - update->whichflag = 1; - timer->init_timeout(); - update->nsteps += 1; - update->laststep += 1; - update->endstep = update->laststep; - output->next = update->ntimestep + 1; - - // single MD timestep - - update->integrate->run(1); - - // driver triggers end of MD loop by sending @DEFAULT or EXIT - - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) { - modify->delete_fix("MDI_ENGINE_INTERNAL"); - return; - } + if (sys_cell_displ_flag) { + boxlo[0] = sys_cell_displ[0]; + boxlo[1] = sys_cell_displ[1]; + boxlo[2] = sys_cell_displ[2]; + } else { + boxlo[0] = boxlo[1] = boxlo[2] = 0.0; } - // check that return is NOT GO + boxhi[0] = boxlo[0] + sys_cell[0]; + boxhi[1] = boxlo[1] + sys_cell[4]; + boxhi[2] = boxlo[2] + sys_cell[8]; + + xy = sys_cell[3]; + yz = sys_cell[7]; + xz = sys_cell[6]; - engine_node("@INIT_SYS"); + lammps_reset_box(lmp,boxlo,boxhi,xy,yz,xz); - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + // lib->create_atoms() + // optionally set charges if specified by ">CHARGES" + + if (sys_velocities_flag) + int natoms = lammps_create_atoms(lmp,sys_natoms,NULL,sys_types, + sys_coords,sys_velocities,NULL,1); + else + int natoms = lammps_create_atoms(lmp,sys_natoms,NULL,sys_types, + sys_coords,NULL,NULL,1); + + if (sys_charges_flag) lammps_scatter_atoms(lmp,(char *) "q",1,1,sys_charges); + + // new system + + update->ntimestep = 0; +} + +/* ---------------------------------------------------------------------- + perform a single-point calc or dynamics or min +---------------------------------------------------------------------- */ + +void MDIEngine::mdi_eval() +{ + // engine is now at @EVAL node + // receive commands driver sends to define the evaluation + // another @ command will trigger the calculation to be performed + + engine_node("@EVAL"); + + if (strcmp(mdicmd,"EXIT") == 0) return; + + if (evalmode == POINT or evalmode == MD) { + update->whichflag = 1; + timer->init_timeout(); + + update->nsteps = nsteps; + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->ntimestep + update->nsteps; + + lmp->init(); + update->integrate->setup(1); + + timer->init(); + timer->barrier_start(); + update->integrate->run(nsteps); + timer->barrier_stop(); + + update->integrate->cleanup(); + } + + if (evalmode == MINIMIZE) { + update->etol = etol[0]; + update->ftol = ftol[1]; + update->nsteps = nsteps; + update->max_eval = max_eval; + + update->whichflag = 2; + timer->init_timeout(); + + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->firststep + update->nsteps; + + lmp->init(); + update->minimize->setup(); + + timer->init(); + timer->barrier_start(); + update->minimize->run(update->nsteps); + timer->barrier_stop(); + + update->minimize->cleanup(); + } } /* ---------------------------------------------------------------------- @@ -1226,6 +1298,93 @@ void MDIEngine::receive_double3(int which, int addflag) // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- +/* ---------------------------------------------------------------------- + boxhi[0] - domain->boxlo[0]; + celldata[1] = 0.0; + celldata[2] = 0.0; + celldata[3] = domain->xy; + celldata[4] = domain->boxhi[1] - domain->boxlo[1]; + celldata[5] = 0.0; + celldata[6] = domain->xz; + celldata[7] = domain->yz; + celldata[8] = domain->boxhi[2] - domain->boxlo[2]; + + for (int icell = 0; icell < 9; icell++) + celldata[icell] *= lmp2mdi_length; + + int ierr = MDI_Send(celldata,9,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: boxlo[0]; + celldata[1] = domain->boxlo[1]; + celldata[2] = domain->boxlo[2]; + + for (int icell = 0; icell < 3; icell++) + celldata[icell] *= lmp2mdi_length; + + int ierr = MDI_Send(celldata,3,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: compute_scalar(); + double kinetic_energy = ke->compute_scalar(); + double total_energy = potential_energy + kinetic_energy; + total_energy *= lmp2mdi_energy; + + int ierr = MDI_Send(&total_energy,1,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: natoms * MDI_LABEL_LENGTH]; + memset(labels,' ',atom->natoms * MDI_LABEL_LENGTH); + + // NOTE: this loop will not work in parallel + + for (int iatom = 0; iatom < atom->natoms; iatom++) { + std::string label = std::to_string(atom->type[iatom]); + int label_len = std::min(int(label.length()), MDI_LABEL_LENGTH); + strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); + } + + int ierr = MDI_Send(labels,atom->natoms*MDI_LABEL_LENGTH,MDI_CHAR,mdicomm); + if (ierr) error->all(FLERR,"MDI: all(FLERR,"MDI: compute_scalar(); + potential_energy *= lmp2mdi_energy; + int ierr = MDI_Send(&potential_energy,1,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: compute_vector(); + for (int i = 0; i < 6; i++) + vtensor[i] = press->vector[i] * lmp2mdi_pressure; - - - - - - + int ierr = MDI_Send(vtensor,6,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: all(FLERR,"MDI: natoms * MDI_LABEL_LENGTH]; - memset(labels,' ',atom->natoms * MDI_LABEL_LENGTH); - - // NOTE: this loop will not work in parallel - - for (int iatom = 0; iatom < atom->natoms; iatom++) { - std::string label = std::to_string(atom->type[iatom]); - int label_len = std::min(int(label.length()), MDI_LABEL_LENGTH); - strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); - } - - int ierr = MDI_Send(labels,atom->natoms*MDI_LABEL_LENGTH,MDI_CHAR,mdicomm); - if (ierr) error->all(FLERR,"MDI: compute_scalar(); - double kinetic_energy = ke->compute_scalar(); - double total_energy = potential_energy + kinetic_energy; - total_energy *= lmp2mdi_energy; - - int ierr = MDI_Send(&total_energy,1,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: compute_scalar(); - potential_energy *= lmp2mdi_energy; - - int ierr = MDI_Send(&potential_energy,1,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: compute_scalar(); - kinetic_energy *= lmp2mdi_energy; - - int ierr = MDI_Send(&kinetic_energy,1,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: boxhi[0] - domain->boxlo[0]; - celldata[1] = 0.0; - celldata[2] = 0.0; - celldata[3] = domain->xy; - celldata[4] = domain->boxhi[1] - domain->boxlo[1]; - celldata[5] = 0.0; - celldata[6] = domain->xz; - celldata[7] = domain->yz; - celldata[8] = domain->boxhi[2] - domain->boxlo[2]; - - for (int icell = 0; icell < 9; icell++) - celldata[icell] *= lmp2mdi_length; - - int ierr = MDI_Send(celldata,9,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: boxlo[0]; - celldata[1] = domain->boxlo[1]; - celldata[2] = domain->boxlo[2]; - - for (int icell = 0; icell < 3; icell++) - celldata[icell] *= lmp2mdi_length; - - int ierr = MDI_Send(celldata,3,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: compute_scalar(); + kinetic_energy *= lmp2mdi_energy; - if (atom->natoms > 0) - error->all(FLERR,"MDI RESET_BOX cannot be used when atoms exist"); - - ierr = MDI_Recv(values,9,MDI_DOUBLE,mdicomm); - MPI_Bcast(values,9,MPI_DOUBLE,0,world); - - lammps_reset_box(lmp,&values[0],&values[3],values[6],values[7],values[8]); -} - -/* ---------------------------------------------------------------------- - CREATE_ATOM command - wrapper on library create_atoms() method - requires simulation box be defined - allows caller to define a new set of atoms - with their IDs, types, coords, velocities, image flags - called in stages via flag - since MDI plugin mode only allows 1 MDI Send/Recv per MDI command - assumes current atom->natoms set by >NATOMS command is correct ----------------------------------------------------------------------- */ - -void MDIEngine::create_atoms(int flag) -{ - int ierr; - - // NOTE: error check on imageint = INT - - if (flag == CREATE_ATOM) { - - if (create_atoms_flag) - error->all(FLERR,"MDI CREATE_ATOM already in progress"); - - ierr = MDI_Recv(&create_natoms,1,MDI_INT,mdicomm); - MPI_Bcast(&create_natoms,1,MPI_INT,0,world); - - create_atoms_flag = 1; - create_id = nullptr; - create_type = nullptr; - create_x = nullptr; - create_v = nullptr; - create_image = nullptr; - - } else if (flag == CREATE_ID) { - - if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); - if (create_id) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - - int natom = create_natoms; - memory->create(create_id,natom,"mdi:create_id"); - ierr = MDI_Recv(create_id,natom,MDI_INT,mdicomm); - MPI_Bcast(create_id,natom,MPI_INT,0,world); - - } else if (flag == CREATE_TYPE) { - - if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); - if (create_type) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - - int natom = create_natoms; - if (create_type) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - memory->create(create_type,natom,"mdi:create_type"); - ierr = MDI_Recv(create_type,natom,MDI_INT,mdicomm); - MPI_Bcast(create_type,natom,MPI_INT,0,world); - - } else if (flag == CREATE_X) { - - if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); - if (create_x) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - - int natom = create_natoms; - if (create_x) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - memory->create(create_x,3*natom,"mdi:create_x"); - ierr = MDI_Recv(create_x,3*natom,MDI_DOUBLE,mdicomm); - MPI_Bcast(create_x,3*natom,MPI_DOUBLE,0,world); - - } else if (flag == CREATE_V) { - - if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); - if (create_v) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - - int natom = create_natoms; - if (create_v) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - memory->create(create_v,3*natom,"mdi:create_x"); - ierr = MDI_Recv(create_v,3*natom,MDI_DOUBLE,mdicomm); - MPI_Bcast(create_v,3*natom,MPI_DOUBLE,0,world); - - } else if (flag == CREATE_IMAGE) { - - if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); - if (create_image) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - - int natom = create_natoms; - if (create_image) error->all(FLERR,"MDI CREATE_ATOM already in progress"); - memory->create(create_image,natom,"mdi:create_image"); - ierr = MDI_Recv(create_image,natom,MDI_INT,mdicomm); - MPI_Bcast(create_image,natom,MPI_INT,0,world); - - } else if (flag == CREATE_GO) { - - if (!create_atoms_flag) error->all(FLERR,"MDI CREATE_ATOM not in progress"); - if (!create_type || !create_x) - error->all(FLERR,"MDI: CREATE_ATOM requires types and coords"); - - int ncreate = lammps_create_atoms(lmp,create_natoms,create_id,create_type, - create_x,create_v,create_image,1); - - if (ncreate != create_natoms) - error->all(FLERR, "MDI: CREATE ATOM created atoms != sent atoms"); - - // clean up create_atoms state - - create_atoms_flag = 0; - memory->destroy(create_id); - memory->destroy(create_type); - memory->destroy(create_x); - memory->destroy(create_v); - memory->destroy(create_image); - } -} - -/* ---------------------------------------------------------------------- - compute_vector(); - for (int i = 0; i < 6; i++) - vtensor[i] = press->vector[i] * lmp2mdi_pressure; - - int ierr = MDI_Send(vtensor,6,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: all(FLERR,"MDI: Date: Tue, 22 Mar 2022 08:38:39 -0600 Subject: [PATCH 020/130] debugging for series of calcs --- examples/mdi/README | 13 + examples/mdi/series_driver.py | 23 +- src/MDI/mdi_engine.cpp | 794 +++++++++++++++------------------- src/MDI/mdi_engine.h | 69 +-- 4 files changed, 407 insertions(+), 492 deletions(-) diff --git a/examples/mdi/README b/examples/mdi/README index 2dd5f2375e..849f98f9ce 100644 --- a/examples/mdi/README +++ b/examples/mdi/README @@ -111,3 +111,16 @@ Run with TCP: 1 proc + 4 procs % mpirun -np 4 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.series -in in.series +--- + +Run with MPI: 1 proc each + +% mpirun -np 1 python3 series_driver.py -mdi "-role DRIVER -name aimd -method MPI" : -np 1 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.series -in in.series + +--- + +Run with MPI: 2 procs + 3 procs + +% mpirun -np 2 python3 series_driver.py -mdi "-role DRIVER -name aimd -method MPI" : -np 3 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.series -in in.series + + diff --git a/examples/mdi/series_driver.py b/examples/mdi/series_driver.py index 6addedcb71..bbb8e375d3 100644 --- a/examples/mdi/series_driver.py +++ b/examples/mdi/series_driver.py @@ -150,10 +150,6 @@ random.seed(seed) for icalc in range(ncalc): - # define a new system - - mdi.MDI_Send_command("@INIT_SYS",mdicomm) - # define simulation box onerho = rho + (random.random()-0.5)*rhodelta; @@ -211,26 +207,27 @@ for icalc in range(ncalc): mdi.MDI_Send(coords,3*natoms,mdi.MDI_DOUBLE,mdicomm) mdi.MDI_Send_command(">VELOCITIES",mdicomm) mdi.MDI_Send(vels,3*natoms,mdi.MDI_DOUBLE,mdicomm) - + # eval or run or minimize - mdi.MDI_Send_command("@EVAL",mdicomm) - if mode == "eval": - mdi.MDI_Send_command(">STEPS",mdicomm) - mdi.MDI_Send(0,1,mdi.MDI_INT,mdicomm) + pass elif mode == "run": - mdi.MDI_Send_command(">STEPS",mdicomm) - mdi.MDI_Send(steps,1,mdi.MDI_INT,mdicomm) + print("PRE MD") + mdi.MDI_Send_command("@INIT_MD",mdicomm) + mdi.MDI_Send_command(">NITERATE",mdicomm) + mdi.MDI_Send(nsteps,1,mdi.MDI_INT,mdicomm) + mdi.MDI_Send_command("@DEFAULT",mdicomm) + print("POST MD") elif mode == "min": mdi.MDI_Send_command(">TOLERANCE",mdicomm) params = [1.0e-4,1.0e-4,1000.0,1000.0] mdi.MDI_Send(params,4,mdi.MDI_DOUBLE,mdicomm) - mdi.MDI_Send_command("@DEFAULT",mdicomm) - # request potential energy + print("PRE PE") + mdi.MDI_Send_command("natoms; + reallocate(); nbytes = -1; - need_evaluation = 1; // define MDI commands that LAMMPS engine recognizes @@ -189,14 +197,6 @@ void MDIEngine::mdi_engine(int narg, char **arg) mdi_optg(); if (exit_command) break; - } else if (strcmp(mdicmd,"@INIT_SYS") == 0) { - mdi_sys(); - if (exit_command) break; - - } else if (strcmp(mdicmd,"@EVAL") == 0) { - mdi_eval(); - if (exit_command) break; - } else if (exit_command) { break; @@ -220,15 +220,9 @@ void MDIEngine::mdi_engine(int narg, char **arg) delete [] id_pe; delete [] id_press; - // delete irregular; + // delete buffers - memory->destroy(ibuf1); - memory->destroy(buf1); - memory->destroy(buf3); - - memory->destroy(ibuf1all); - memory->destroy(buf1all); - memory->destroy(buf3all); + deallocate(); } /* ---------------------------------------------------------------------- @@ -291,6 +285,8 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) // confirm this command is supported at this node // otherwise is error + printf("MDI COMMAND %s NE %s\n",command,node_engine); + int command_exists; if (root) { ierr = MDI_Check_command_exists(node_engine,command,MDI_COMM_NULL, @@ -320,7 +316,6 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) } else if (strcmp(command,">COORDS") == 0) { receive_coords(); - need_evaluation = 1; } else if (strcmp(command,">NATOMS") == 0) { receive_natoms(); @@ -350,17 +345,11 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) send_double3(COORD); } else if (strcmp(command,"all(FLERR,"MDI: MDI engine is already performing a simulation"); - mode = SYS; - node_match = false; - } else if (strcmp(command,"@EVAL") == 0) { - if (mode != DEFAULT) - error->all(FLERR,"MDI: MDI engine is already performing a simulation"); - mode = EVAL; - node_match = false; - } else if (strcmp(command,"NBYTES") == 0) { nbytes_command(); } else if (strcmp(command,"COMMAND") == 0) { @@ -470,11 +442,11 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) } else if (strcmp(command,"COMMANDS") == 0) { many_commands(); } else if (strcmp(command,"INFILE") == 0) { - infile();w - } else if (strcmp(command,">STEPS") == 0) { - send_steps(); + infile(); + } else if (strcmp(command,">NITERATE") == 0) { + receive_niterate(); } else if (strcmp(command,">TOLERANCE") == 0) { - send_tolerance(); + receive_tolerance(); } else if (strcmp(command,"TOLERANCE"); MDI_Register_command("@DEFAULT", "CELL"); - MDI_Register_command("@INIT_SYS", ">CELL_DISPL"); - MDI_Register_command("@INIT_SYS", ">CHARGES"); - MDI_Register_command("@INIT_SYS", ">COORDS"); - MDI_Register_command("@INIT_SYS", ">NATOMS"); - MDI_Register_command("@INIT_SYS", ">TYPES"); - MDI_Register_command("@INIT_SYS", ">VELOCITIES"); - MDI_Register_command("@INIT_SYS", "@DEFAULT"); - MDI_Register_command("@INIT_SYS", "EXIT"); - - // custom nodes added by LAMMPS - - MDI_Register_node("@EVAL"); - MDI_Register_command("@EVAL", ">STEPS"); - MDI_Register_command("@EVAL", ">TOLERANC"); // node for setting up and running a dynamics simulation MDI_Register_node("@INIT_MD"); MDI_Register_command("@INIT_MD", "<@"); MDI_Register_command("@INIT_MD", "CELL"); + MDI_Register_command("@INIT_MD", ">CELL_DISPL"); + MDI_Register_command("@INIT_MD", ">CHARGES"); + MDI_Register_command("@INIT_MD", ">COORDS"); + MDI_Register_command("@INIT_MD", ">NATOMS"); + MDI_Register_command("@INIT_MD", ">NITERATE"); + MDI_Register_command("@INIT_MD", ">TYPES"); + MDI_Register_command("@INIT_MD", ">VELOCITIES"); MDI_Register_command("@INIT_MD", "@"); MDI_Register_command("@INIT_MD", "@DEFAULT"); MDI_Register_command("@INIT_MD", "@COORDS"); @@ -633,12 +594,66 @@ void MDIEngine::mdi_commands() } } +/* ---------------------------------------------------------------------- + run MD simulation for Niterate steps +---------------------------------------------------------------------- */ + +void MDIEngine::mdi_md() +{ + printf("MDI_MD %d %d %d\n",flag_natoms,flag_types,flag_cell); + + // engine is now at @INIT_MD node + // receive NITERATE or other commands driver wishes to send + + engine_node("@INIT_MD"); + + if (strcmp(mdicmd,"EXIT") == 0) return; + + // create and update system if requested + + int flag_create = flag_natoms | flag_types; + if (flag_create) create_system(); + else { + int flag_any = flag_cell | flag_cell_displ | flag_charges | + flag_coords | flag_velocities; + if (!flag_any) return; + if (flag_cell || flag_cell_displ) adjust_box(); + if (flag_charges) adjust_charges(); + if (flag_coords) adjust_coords(); + if (flag_velocities) adjust_velocities(); + } + + // perform the MD simulation + + update->whichflag = 1; + timer->init_timeout(); + + update->nsteps = niterate; + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->ntimestep + update->nsteps; + + lmp->init(); + update->integrate->setup(1); + + timer->init(); + timer->barrier_start(); + update->integrate->run(niterate); + timer->barrier_stop(); + + update->integrate->cleanup(); + + // clear flags + + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; +} + /* ---------------------------------------------------------------------- run MD simulation under control of driver one step at a time use of fix MDI/ENGINE allows MDI comm within timesteps ---------------------------------------------------------------------- */ -void MDIEngine::mdi_md() +void MDIEngine::mdi_md_old() { // add an instance of fix MDI/ENGINE // delete the instance before this method returns @@ -709,6 +724,27 @@ void MDIEngine::mdi_md() void MDIEngine::mdi_optg() { + update->etol = etol; + update->ftol = ftol; + update->nsteps = niterate; + update->max_eval = max_eval; + + update->whichflag = 2; + timer->init_timeout(); + + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->firststep + update->nsteps; + + lmp->init(); + update->minimize->setup(); + + timer->init(); + timer->barrier_start(); + update->minimize->run(update->nsteps); + timer->barrier_stop(); + + update->minimize->cleanup(); + // add an instance of fix MDI/ENGINE // delete the instance before this method returns @@ -764,29 +800,91 @@ void MDIEngine::mdi_optg() } /* ---------------------------------------------------------------------- - initialize a new simulation + evaluate() invoked by ago < 0) { + update->whichflag = 1; + lmp->init(); + update->integrate->setup(1); + update->whichflag = 0; - // >CELL, >NATOMS, >TYPES, >COORDS commands must have been issued + } else { + update->ntimestep++; + pe->addstep(update->ntimestep); + press->addstep(update->ntimestep); - if (sys_cell_flag == 0 || sys_natoms_flag == 0) - error->all(FLERR,"@INIT_SYS requires >NATOMS and >CELL MDI commands"); - if (sys_types_flag == 0 || sys_coords_flag == 0) - error->all(FLERR,"@INIT_SYS requires >TYPES and >COORDS MDI commands"); + int nflag = neighbor->decide(); + if (nflag == 0) { + comm->forward_comm(); + update->integrate->setup_minimal(0); + modify->clearstep_compute(); + output->thermo->compute(1); + modify->addstep_compute(update->ntimestep+1); + } else { + update->integrate->setup_minimal(1); + modify->clearstep_compute(); + output->thermo->compute(1); + modify->addstep_compute(update->ntimestep+1); + } + } + + // clear flags + + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; +} + +/* ---------------------------------------------------------------------- + create a new system +---------------------------------------------------------------------- */ + +void MDIEngine::create_system() +{ + // >CELL, >NATOMS, >TYPES, >COORDS commands are required + // >CELL_DISPL, >CHARGES, >VELOCITIES commands are optional + + if (flag_cell == 0 || flag_natoms == 0 || + flag_types == 0 || flag_coords == 0) + error->all(FLERR, + "@INIT_SYS requires >CELL, >NATOMS, >TYPES, >COORDS MDI commands"); // clear system via delete_atoms command @@ -797,7 +895,7 @@ void MDIEngine::mdi_sys() double boxlo[3],boxhi[3]; double xy,yz,xz; - if (sys_cell_displ_flag) { + if (flag_cell_displ) { boxlo[0] = sys_cell_displ[0]; boxlo[1] = sys_cell_displ[1]; boxlo[2] = sys_cell_displ[2]; @@ -818,14 +916,14 @@ void MDIEngine::mdi_sys() // lib->create_atoms() // optionally set charges if specified by ">CHARGES" - if (sys_velocities_flag) + if (flag_velocities) int natoms = lammps_create_atoms(lmp,sys_natoms,NULL,sys_types, sys_coords,sys_velocities,NULL,1); else int natoms = lammps_create_atoms(lmp,sys_natoms,NULL,sys_types, sys_coords,NULL,NULL,1); - if (sys_charges_flag) lammps_scatter_atoms(lmp,(char *) "q",1,1,sys_charges); + if (flag_charges) lammps_scatter_atoms(lmp,(char *) "q",1,1,sys_charges); // new system @@ -833,110 +931,100 @@ void MDIEngine::mdi_sys() } /* ---------------------------------------------------------------------- - perform a single-point calc or dynamics or min + adjust simulation box ---------------------------------------------------------------------- */ -void MDIEngine::mdi_eval() +void MDIEngine::adjust_box() { - // engine is now at @EVAL node - // receive commands driver sends to define the evaluation - // another @ command will trigger the calculation to be performed + // convert atoms to lamda coords before changing box - engine_node("@EVAL"); + domain->x2lamda(atom->nlocal); - if (strcmp(mdicmd,"EXIT") == 0) return; + // if >CELL command received, + // convert celldata to new boxlo, boxhi, and tilt factors - if (evalmode == POINT or evalmode == MD) { - update->whichflag = 1; - timer->init_timeout(); - - update->nsteps = nsteps; - update->beginstep = update->firststep = update->ntimestep; - update->endstep = update->laststep = update->ntimestep + update->nsteps; - - lmp->init(); - update->integrate->setup(1); - - timer->init(); - timer->barrier_start(); - update->integrate->run(nsteps); - timer->barrier_stop(); - - update->integrate->cleanup(); + if (flag_cell) { + domain->boxhi[0] = sys_cell[0] + domain->boxlo[0]; + domain->boxhi[1] = sys_cell[4] + domain->boxlo[1]; + domain->boxhi[2] = sys_cell[8] + domain->boxlo[2]; + domain->xy = sys_cell[3]; + domain->xz = sys_cell[6]; + domain->yz = sys_cell[7]; } - if (evalmode == MINIMIZE) { - update->etol = etol[0]; - update->ftol = ftol[1]; - update->nsteps = nsteps; - update->max_eval = max_eval; + // if >CELL_DISPL command received, + // convert cell_displ to new boxlo and boxhi - update->whichflag = 2; - timer->init_timeout(); - - update->beginstep = update->firststep = update->ntimestep; - update->endstep = update->laststep = update->firststep + update->nsteps; + if (flag_cell_displ) { + double old_boxlo[3]; + old_boxlo[0] = domain->boxlo[0]; + old_boxlo[1] = domain->boxlo[1]; + old_boxlo[2] = domain->boxlo[2]; - lmp->init(); - update->minimize->setup(); + domain->boxlo[0] = sys_cell_displ[0]; + domain->boxlo[1] = sys_cell_displ[1]; + domain->boxlo[2] = sys_cell_displ[2]; - timer->init(); - timer->barrier_start(); - update->minimize->run(update->nsteps); - timer->barrier_stop(); - - update->minimize->cleanup(); + domain->boxhi[0] += domain->boxlo[0] - old_boxlo[0]; + domain->boxhi[1] += domain->boxlo[1] - old_boxlo[1]; + domain->boxhi[2] += domain->boxlo[2] - old_boxlo[2]; } + + // reset all Domain variables that depend on box size/shape + // convert lamda atoms coords back to new box coords + + domain->set_global_box(); + domain->set_local_box(); + domain->lamda2x(atom->nlocal); } /* ---------------------------------------------------------------------- - evaluate() = compute forces, energy, pressure of current system - usage modes: - (1) called many times by a driver for system that is continuously evolving - (2) called once per system by a driver that is passing in many systems - distinguishes between: - (a) first-time call - (b) system needs reneighboring - (c) system does not need reneighboring - for (b) and (c), timestep is advanced + adjust charges, coods, velocities ---------------------------------------------------------------------- */ -void MDIEngine::evaluate() +void MDIEngine::adjust_charges() { - // NOTE: ago is not a good test - // caller should decide which verion of evaluate() is needed? - // currently cannot call it interspersed with "delete atoms" calls - // b/c whichflag stays set - // separate issue, need to unset whichflag when done + double *q = atom->q; + tagint *tag = atom->tag; + int nlocal = atom->nlocal; - if (neighbor->ago < 0) { + int ilocal; - update->whichflag = 1; - lmp->init(); - update->integrate->setup(1); - update->whichflag = 0; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + q[i] = sys_charges[ilocal]; + } +} - } else { +void MDIEngine::adjust_coords() +{ + double **x = atom->x; + tagint *tag = atom->tag; + int nlocal = atom->nlocal; - // insure potential energy and virial are tallied on this step + int ilocal; - update->ntimestep++; - pe->addstep(update->ntimestep); - press->addstep(update->ntimestep); + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + x[i][0] = sys_coords[3*ilocal+0]; + x[i][1] = sys_coords[3*ilocal+1]; + x[i][2] = sys_coords[3*ilocal+2]; + } +} - int nflag = neighbor->decide(); - if (nflag == 0) { - comm->forward_comm(); - update->integrate->setup_minimal(0); - modify->clearstep_compute(); - output->thermo->compute(1); - modify->addstep_compute(update->ntimestep+1); - } else { - update->integrate->setup_minimal(1); - modify->clearstep_compute(); - output->thermo->compute(1); - modify->addstep_compute(update->ntimestep+1); - } +void MDIEngine::adjust_velocities() +{ + double **v = atom->v; + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + v[i][0] = sys_velocities[3*ilocal+0]; + v[i][1] = sys_velocities[3*ilocal+1]; + v[i][2] = sys_velocities[3*ilocal+2]; } } @@ -948,56 +1036,15 @@ void MDIEngine::evaluate() /* ---------------------------------------------------------------------- >CELL command - reset the simulation box edge vectors - in conjunction with >CELL_DISPL this can adjust box arbitrarily + reset simulation box edge vectors + in conjunction with >CELL_DISPL this can change box arbitrarily + can be done to create a new box + can be done incrementally during MD or OPTG ---------------------------------------------------------------------- */ void MDIEngine::receive_cell() { - if (mode == DEFAULT) receive_cell_default(); - else if (mode == SYS) receive_cell_sys(); -} - -void MDIEngine::receive_cell_default() -{ - double cell[9]; - - int ierr = MDI_Recv(cell,9,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR, "MDI: >CELL data"); - MPI_Bcast(cell,9,MPI_DOUBLE,0,world); - - for (int icell = 0; icell < 9; icell++) - cell[icell] *= mdi2lmp_length; - - // error check that edge vectors match LAMMPS triclinic requirement - - if (cell[1] != 0.0 || cell[2] != 0.0 || cell[5] != 0.0) - error->all(FLERR,"MDI: Received cell edges are not LAMMPS compatible"); - - // convert atoms to lamda coords before changing box - - domain->x2lamda(atom->nlocal); - - // convert celldata to new boxlo, boxhi, and tilt factors - - domain->boxhi[0] = cell[0] + domain->boxlo[0]; - domain->boxhi[1] = cell[4] + domain->boxlo[1]; - domain->boxhi[2] = cell[8] + domain->boxlo[2]; - - domain->xy = cell[3]; - domain->xz = cell[6]; - domain->yz = cell[7]; - - // reset all Domain variables that depend on box size/shape - // convert atoms coords back to new box coords - - domain->set_global_box(); - domain->set_local_box(); - domain->lamda2x(atom->nlocal); -} - -void MDIEngine::receive_cell_sys() -{ + flag_cell = 1; int ierr = MDI_Recv(sys_cell,9,MDI_DOUBLE,mdicomm); if (ierr) error->all(FLERR, "MDI: >CELL data"); MPI_Bcast(sys_cell,9,MPI_DOUBLE,0,world); @@ -1013,55 +1060,15 @@ void MDIEngine::receive_cell_sys() /* ---------------------------------------------------------------------- >CELL_DISPL command - reset simulation box origin = lower-left corner + reset simulation box lower left corner + in conjunction with >CELL this can change box arbitrarily + can be done to create a new box + can be done incrementally during MD or OPTG ---------------------------------------------------------------------- */ void MDIEngine::receive_cell_displ() { - if (mode == DEFAULT) receive_cell_displ_default(); - else if (mode == SYS) receive_cell_displ_sys(); -} - -void MDIEngine::receive_cell_displ_default() -{ - double cell_displ[3]; - int ierr = MDI_Recv(cell_displ,3,MDI_DOUBLE,mdicomm); - if (ierr) - error->all(FLERR,"MDI: >CELL_DISPLS data"); - MPI_Bcast(cell_displ,3,MPI_DOUBLE,0,world); - - for (int icell = 0; icell < 3; icell++) - cell_displ[icell] *= mdi2lmp_length; - - // convert atoms to lamda coords before changing box - - domain->x2lamda(atom->nlocal); - - // convert cell_displ to new boxlo and boxhi - - double old_boxlo[3]; - old_boxlo[0] = domain->boxlo[0]; - old_boxlo[1] = domain->boxlo[1]; - old_boxlo[2] = domain->boxlo[2]; - - domain->boxlo[0] = cell_displ[0]; - domain->boxlo[1] = cell_displ[1]; - domain->boxlo[2] = cell_displ[2]; - - domain->boxhi[0] += domain->boxlo[0] - old_boxlo[0]; - domain->boxhi[1] += domain->boxlo[1] - old_boxlo[1]; - domain->boxhi[2] += domain->boxlo[2] - old_boxlo[2]; - - // reset all Domain variables that depend on box origin - // convert atoms coords back to new box coords - - domain->set_global_box(); - domain->set_local_box(); - domain->lamda2x(atom->nlocal); -} - -void MDIEngine::receive_cell_displ_sys() -{ + flag_cell_displ = 1; int ierr = MDI_Recv(sys_cell_displ,3,MDI_DOUBLE,mdicomm); if (ierr) error->all(FLERR,"MDI: >CELL_DISPLS data"); MPI_Bcast(sys_cell_displ,3,MPI_DOUBLE,0,world); @@ -1076,12 +1083,7 @@ void MDIEngine::receive_cell_displ_sys() void MDIEngine::receive_charges() { - if (mode == DEFAULT) receive_double1(CHARGE); - else if (mode == SYS) receive_charges_sys(); -} - -void MDIEngine::receive_charges_sys() -{ + flag_charges = 1; int ierr = MDI_Recv(sys_charges,sys_natoms,MDI_DOUBLE,mdicomm); if (ierr) error->all(FLERR,"MDI: >CHARGES data"); MPI_Bcast(sys_charges,sys_natoms,MPI_DOUBLE,0,world); @@ -1093,15 +1095,13 @@ void MDIEngine::receive_charges_sys() void MDIEngine::receive_coords() { - if (mode == DEFAULT) receive_double3(COORD,0); - else if (mode == SYS) receive_coords_sys(); -} - -void MDIEngine::receive_coords_sys() -{ - int ierr = MDI_Recv(sys_coords,3*sys_natoms,MDI_DOUBLE,mdicomm); + flag_coords = 1; + int n = 3*sys_natoms; + int ierr = MDI_Recv(sys_coords,n,MDI_DOUBLE,mdicomm); if (ierr) error->all(FLERR,"MDI: >COORDS data"); - MPI_Bcast(sys_coords,3*sys_natoms,MPI_DOUBLE,0,world); + MPI_Bcast(sys_coords,n,MPI_DOUBLE,0,world); + for (int i = 0; i < n; i++) + sys_coords[i] * mdi2lmp_length; } /* ---------------------------------------------------------------------- @@ -1111,26 +1111,12 @@ void MDIEngine::receive_coords_sys() void MDIEngine::receive_natoms() { - if (mode == DEFAULT) receive_natoms_default(); - else if (mode == SYS) receive_natoms_sys(); -} - -void MDIEngine::receive_natoms_default() -{ - int natoms; - int ierr = MDI_Recv(&natoms,1,MDI_INT,mdicomm); - if (ierr) error->all(FLERR,"MDI: >NATOMS data"); - MPI_Bcast(&natoms,1,MPI_INT,0,world); - if (natoms < 0) error->all(FLERR,"MDI received natoms < 0"); - atom->natoms = natoms; -} - -void MDIEngine::receive_natoms_sys() -{ + flag_natoms = 1; int ierr = MDI_Recv(&sys_natoms,1,MDI_INT,mdicomm); if (ierr) error->all(FLERR,"MDI: >NATOMS data"); MPI_Bcast(&sys_natoms,1,MPI_INT,0,world); if (sys_natoms < 0) error->all(FLERR,"MDI received natoms < 0"); + reallocate(); } /* ---------------------------------------------------------------------- @@ -1139,12 +1125,7 @@ void MDIEngine::receive_natoms_sys() void MDIEngine::receive_types() { - if (mode == DEFAULT) receive_int1(TYPE); - else if (mode == SYS) receive_types_sys(); -} - -void MDIEngine::receive_types_sys() -{ + flag_types = 1; int ierr = MDI_Recv(sys_types,sys_natoms,MDI_INT,mdicomm); if (ierr) error->all(FLERR,"MDI: >TYPES data"); MPI_Bcast(sys_types,sys_natoms,MPI_INT,0,world); @@ -1156,140 +1137,13 @@ void MDIEngine::receive_types_sys() void MDIEngine::receive_velocities() { - if (mode == DEFAULT) receive_double3(VELOCITY,0); - else if (mode == SYS) receive_velocities_sys(); -} - -void MDIEngine::receive_velocities_sys() -{ - int ierr = MDI_Recv(sys_velocities,3*sys_natoms,MDI_DOUBLE,mdicomm); + flag_velocities = 1; + int n = 3*sys_natoms; + int ierr = MDI_Recv(sys_velocities,n,MDI_DOUBLE,mdicomm); if (ierr) error->all(FLERR,"MDI: >VELOCITIES data"); - MPI_Bcast(sys_velocities,3*sys_natoms,MPI_DOUBLE,0,world); -} - -/* ---------------------------------------------------------------------- - receive vector of 1 double for all atoms - atoms are ordered by atomID, 1 to Natoms - assumes all atoms already exist - used by >CHARGES command ----------------------------------------------------------------------- */ - -void MDIEngine::receive_double1(int which) -{ - reallocate(); - - int ierr = MDI_Recv(buf1,atom->natoms,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: >double1 data"); - MPI_Bcast(buf1,atom->natoms,MPI_DOUBLE,0,world); - - // extract owned atom values - // use atomID to index into ordered buf - - tagint *tag = atom->tag; - int nlocal = atom->nlocal; - - int ilocal; - - if (which == CHARGE) { - double *q = atom->q; - for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - q[i] = buf1[ilocal]; - } - } -} - -/* ---------------------------------------------------------------------- - receive vector of 1 int for all atoms - atoms are ordered by atomID, 1 to Natoms - assumes all atoms already exist - used by >TYPES command ----------------------------------------------------------------------- */ - -void MDIEngine::receive_int1(int which) -{ - reallocate(); - - int ierr = MDI_Recv(ibuf1,atom->natoms,MDI_INT,mdicomm); - if (ierr) error->all(FLERR,"MDI: >int1 data"); - MPI_Bcast(ibuf1,atom->natoms,MPI_INT,0,world); - - // extract owned atom values - // use atomID to index into ordered buf - - tagint *tag = atom->tag; - int nlocal = atom->nlocal; - - int ilocal; - - if (which == TYPE) { - int *type = atom->type; - for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - type[i] = ibuf1[ilocal]; - } - } -} - -/* ---------------------------------------------------------------------- - receive vector of 3 doubles for all atoms - atoms are ordered by atomID, 1 to Natoms - assumes all atoms already exist - used by >COORDS, >FORCES, >VELOCITIES commands - for COORD, assumes atom displacement is small ----------------------------------------------------------------------- */ - -void MDIEngine::receive_double3(int which, int addflag) -{ - reallocate(); - - int ierr = MDI_Recv(buf3,3*atom->natoms,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: >double3 data"); - MPI_Bcast(buf3,3*atom->natoms,MPI_DOUBLE,0,world); - - // extract owned atom values - // use atomID to index into ordered buf - - tagint *tag = atom->tag; - int nlocal = atom->nlocal; - - int ilocal; - - if (which == COORD) { - double **x = atom->x; - for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - x[i][0] = buf3[3*ilocal+0] * mdi2lmp_length; - x[i][1] = buf3[3*ilocal+1] * mdi2lmp_length; - x[i][2] = buf3[3*ilocal+2] * mdi2lmp_length; - } - } else if (which == FORCE) { - if (!addflag) { - double **f = atom->f; - for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - f[i][0] = buf3[3*ilocal+0] * mdi2lmp_force; - f[i][1] = buf3[3*ilocal+1] * mdi2lmp_force; - f[i][2] = buf3[3*ilocal+2] * mdi2lmp_force; - } - } else { - double **f = atom->f; - for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - f[i][0] += buf3[3*ilocal+0] * mdi2lmp_force; - f[i][1] += buf3[3*ilocal+1] * mdi2lmp_force; - f[i][2] += buf3[3*ilocal+2] * mdi2lmp_force; - } - } - } else if (which == VELOCITY) { - double **v = atom->v; - for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - v[i][0] = buf3[3*ilocal+0] * mdi2lmp_velocity; - v[i][1] = buf3[3*ilocal+1] * mdi2lmp_velocity; - v[i][2] = buf3[3*ilocal+2] * mdi2lmp_velocity; - } - } + MPI_Bcast(sys_velocities,n,MPI_DOUBLE,0,world); + for (int i = 0; i < n; i++) + sys_coords[i] * mdi2lmp_velocity; } // ---------------------------------------------------------------------- @@ -1435,7 +1289,6 @@ void MDIEngine::send_stress() void MDIEngine::send_double1(int which) { - reallocate(); memset(buf1,0,atom->natoms*sizeof(double)); // use atomID to index into ordered buf1 @@ -1482,7 +1335,6 @@ void MDIEngine::send_double1(int which) void MDIEngine::send_int1(int which) { - reallocate(); memset(ibuf1,0,atom->natoms*sizeof(int)); // use atomID to index into ordered buf1 @@ -1514,7 +1366,6 @@ void MDIEngine::send_int1(int which) void MDIEngine::send_double3(int which) { - reallocate(); memset(buf3,0,3*atom->natoms*sizeof(double)); // use atomID to index into ordered buf3 @@ -1638,6 +1489,36 @@ void MDIEngine::infile() delete [] infile; } +/* ---------------------------------------------------------------------- + >STEPS command + send number of tiemsteps +---------------------------------------------------------------------- */ + +void MDIEngine::receive_niterate() +{ + int ierr = MDI_Recv(&niterate,1,MDI_INT,mdicomm); + if (ierr) error->all(FLERR,"MDI: >NITERATE data"); + MPI_Bcast(&niterate,1,MPI_INT,0,world); +} + +/* ---------------------------------------------------------------------- + >TOLERANCE command + send 2 minimization tolerance params +---------------------------------------------------------------------- */ + +void MDIEngine::receive_tolerance() +{ + double params[4]; + int ierr = MDI_Recv(params,4,MDI_INT,mdicomm); + if (ierr) error->all(FLERR,"MDI: >TOLERANCE data"); + MPI_Bcast(params,4,MPI_INT,0,world); + + etol = params[0]; + ftol = params[1]; + niterate = static_cast (params[2]); + max_eval = static_cast (params[3]); +} + /* ---------------------------------------------------------------------- natoms <= maxbuf) return; + if (sys_natoms <= maxatom) return; - if (3*atom->natoms > MAXSMALLINT) + if (3*sys_natoms > MAXSMALLINT) error->all(FLERR,"Natoms too large to use with mdi engine"); - maxbuf = atom->natoms; + maxatom = sys_natoms; + + deallocate(); + allocate(); +} + +void MDIEngine::deallocate() +{ + memory->destroy(sys_types); + memory->destroy(sys_coords); + memory->destroy(sys_velocities); + memory->destroy(sys_charges); memory->destroy(ibuf1); memory->destroy(buf1); @@ -1678,14 +1570,22 @@ void MDIEngine::reallocate() memory->destroy(ibuf1all); memory->destroy(buf1all); memory->destroy(buf3all); +} - memory->create(ibuf1,maxbuf,"mdi:ibuf1"); - memory->create(buf1,maxbuf,"mdi:buf1"); - memory->create(buf3,3*maxbuf,"mdi:buf3"); +void MDIEngine::allocate() +{ + memory->create(sys_types,maxatom,"mdi:sys_types"); + memory->create(sys_coords,3*maxatom,"mdi:sys_coords"); + memory->create(sys_velocities,3*maxatom,"mdi:sys_velocities"); + memory->create(sys_charges,maxatom,"mdi:sys_charges"); - memory->create(ibuf1all,maxbuf,"mdi:ibuf1all"); - memory->create(buf1all,maxbuf,"mdi:buf1all"); - memory->create(buf3all,3*maxbuf,"mdi:buf3all"); + memory->create(ibuf1,maxatom,"mdi:ibuf1"); + memory->create(buf1,maxatom,"mdi:buf1"); + memory->create(buf3,3*maxatom,"mdi:buf3"); + + memory->create(ibuf1all,maxatom,"mdi:ibuf1all"); + memory->create(buf1all,maxatom,"mdi:buf1all"); + memory->create(buf3all,3*maxatom,"mdi:buf3all"); } /* ---------------------------------------------------------------------- diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index c408754bf3..52f610ca79 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -57,21 +57,7 @@ class MDIEngine : public Command { class Minimize *minimizer; class Compute *ke,*pe,*press; - int need_evaluation; // 1 if system has changed, else 0 - int nbytes; // NBYTES command value used by other commands - - // @INIT_SYS state - - int sys_natoms_flag,sys_types_flag,sys_charges_flag; - int sys_coords_flag,sys_velocities_flag; - int sys_cell_flag,sys_cell_displ_flag; - - int sys_natoms; - int *sys_types; - double *sys_charges,*sys_coords,*sys_velocities; - double *sys_cell,*sys_cell_displ; - // unit conversion factors double lmp2mdi_length,mdi2lmp_length; @@ -81,9 +67,26 @@ class MDIEngine : public Command { double lmp2mdi_pressure,mdi2lmp_pressure; double lmp2mdi_virial,mdi2lmp_virial; + // system state for MDI + + int flag_natoms,flag_types; + int flag_cell,flag_cell_displ; + int flag_charges,flag_coords,flag_velocities; + + int sys_natoms; + int *sys_types; + double *sys_charges,*sys_coords,*sys_velocities; + double sys_cell[9],sys_cell_displ[3]; + + int niterate; + int max_eval; + double etol,ftol; + + int nbytes; // NBYTES command value used by other commands + // buffers for MDI comm - int maxbuf; + int maxatom; double *buf1,*buf1all; double *buf3,*buf3all; int *ibuf1,*ibuf1all; @@ -91,13 +94,18 @@ class MDIEngine : public Command { // class methods void mdi_engine(int, char **); - void mdi_commands(); + void mdi_md(); + void mdi_md_old(); void mdi_optg(); - void mdi_sys(); void evaluate(); + void create_system(); + void adjust_box(); + void adjust_charges(); + void adjust_coords(); + void adjust_velocities(); void receive_cell(); void receive_cell_default(); @@ -123,35 +131,32 @@ class MDIEngine : public Command { void receive_velocities(); void receive_velocities_sys(); - void receive_double1(int); - void receive_int1(int); - void receive_double3(int, int); + void send_cell(); + void send_cell_displ(); + void send_total_energy(); + void send_labels(); void send_natoms(); - void send_ntypes(); + + void send_pe(); + void send_stress(); void send_double1(int); void send_int1(int); void send_double3(int); - void send_labels(); - - void send_total_energy(); - void send_pe(); - void send_ke(); - - void send_cell(); - void send_cell_displ(); void nbytes_command(); void single_command(); void many_commands(); void infile(); - void reset_box(); - void create_atoms(int); - void send_stress(); + void receive_niterate(); + void receive_tolerance(); + void send_ke(); void unit_conversions(); void reallocate(); + void deallocate(); + void allocate(); }; } From 194751e8000d3873ac2a76840c11ef7abadb176d Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Tue, 22 Mar 2022 09:32:31 -0600 Subject: [PATCH 021/130] add support for full minimizations --- examples/mdi/series_driver.py | 9 ++- src/MDI/mdi_engine.cpp | 128 +++++++++++++++++++++------------- src/MDI/mdi_engine.h | 2 +- 3 files changed, 86 insertions(+), 53 deletions(-) diff --git a/examples/mdi/series_driver.py b/examples/mdi/series_driver.py index bbb8e375d3..4ee2c33a26 100644 --- a/examples/mdi/series_driver.py +++ b/examples/mdi/series_driver.py @@ -88,7 +88,7 @@ while iarg < narg: rho = float(args[iarg+1]) rhodelta = float(args[iarg+2]) if rho-rhodelta <= 0.0: error() - iarg += 4 + iarg += 3 elif args[iarg] == "-delta": if iarg+2 > narg: error() delta = float(args[iarg+1]) @@ -213,20 +213,19 @@ for icalc in range(ncalc): if mode == "eval": pass elif mode == "run": - print("PRE MD") mdi.MDI_Send_command("@INIT_MD",mdicomm) mdi.MDI_Send_command(">NITERATE",mdicomm) mdi.MDI_Send(nsteps,1,mdi.MDI_INT,mdicomm) mdi.MDI_Send_command("@DEFAULT",mdicomm) - print("POST MD") elif mode == "min": + mdi.MDI_Send_command("@INIT_OPTG",mdicomm) mdi.MDI_Send_command(">TOLERANCE",mdicomm) - params = [1.0e-4,1.0e-4,1000.0,1000.0] + params = [1.0e-4,1.0e-4,100.0,100.0] mdi.MDI_Send(params,4,mdi.MDI_DOUBLE,mdicomm) + mdi.MDI_Send_command("@DEFAULT",mdicomm) # request potential energy - print("PRE PE") mdi.MDI_Send_command("all(FLERR,"MDI: MDI engine is already performing a simulation"); mode = MD; + strncpy(node_driver,command,MDI_COMMAND_LENGTH); node_match = false; } else if (strcmp(command,"@INIT_OPTG") == 0) { if (mode != DEFAULT) error->all(FLERR,"MDI: MDI engine is already performing a simulation"); mode = OPT; + strncpy(node_driver,command,MDI_COMMAND_LENGTH); node_match = false; } else if (strcmp(command,"@") == 0) { @@ -395,7 +395,7 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) } else if (strcmp(command,"@DEFAULT") == 0) { mode = DEFAULT; - strncpy(node_driver,"@DEFAULT",MDI_COMMAND_LENGTH); + strncpy(node_driver,command,MDI_COMMAND_LENGTH); node_match = false; // if minimization in progress, force it to quit @@ -407,15 +407,15 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) } } else if (strcmp(command,"@COORDS") == 0) { - strncpy(node_driver,"@COORDS",MDI_COMMAND_LENGTH); + strncpy(node_driver,command,MDI_COMMAND_LENGTH); node_match = false; } else if (strcmp(command,"@FORCES") == 0) { - strncpy(node_driver,"@FORCES",MDI_COMMAND_LENGTH); + strncpy(node_driver,command,MDI_COMMAND_LENGTH); node_match = false; } else if (strcmp(command,"@ENDSTEP") == 0) { - strncpy(node_driver,"@ENDSTEP",MDI_COMMAND_LENGTH); + strncpy(node_driver,command,MDI_COMMAND_LENGTH); node_match = false; // exit command @@ -531,6 +531,14 @@ void MDIEngine::mdi_commands() MDI_Register_node("@INIT_OPTG"); MDI_Register_command("@INIT_OPTG", "<@"); MDI_Register_command("@INIT_OPTG", "CELL"); + MDI_Register_command("@INIT_OPTG", ">CELL_DISPL"); + MDI_Register_command("@INIT_OPTG", ">CHARGES"); + MDI_Register_command("@INIT_OPTG", ">COORDS"); + MDI_Register_command("@INIT_OPTG", ">NATOMS"); + MDI_Register_command("@INIT_OPTG", ">TOLERANCE"); + MDI_Register_command("@INIT_OPTG", ">TYPES"); + MDI_Register_command("@INIT_OPTG", ">VELOCITIES"); MDI_Register_command("@INIT_OPTG", "@"); MDI_Register_command("@INIT_OPTG", "@DEFAULT"); MDI_Register_command("@INIT_OPTG", "@COORDS"); @@ -595,28 +603,27 @@ void MDIEngine::mdi_commands() } /* ---------------------------------------------------------------------- - run MD simulation for Niterate steps + run MD simulation + >NITERATE command sets # of timesteps ---------------------------------------------------------------------- */ void MDIEngine::mdi_md() { - printf("MDI_MD %d %d %d\n",flag_natoms,flag_types,flag_cell); - // engine is now at @INIT_MD node - // receive NITERATE or other commands driver wishes to send + // receive >NITERATE or other commands driver wishes to send + // @DEFAULT command from driver will trigger the simulation + + niterate = 0; engine_node("@INIT_MD"); if (strcmp(mdicmd,"EXIT") == 0) return; - // create and update system if requested + // create or update system if requested int flag_create = flag_natoms | flag_types; if (flag_create) create_system(); else { - int flag_any = flag_cell | flag_cell_displ | flag_charges | - flag_coords | flag_velocities; - if (!flag_any) return; if (flag_cell || flag_cell_displ) adjust_box(); if (flag_charges) adjust_charges(); if (flag_coords) adjust_coords(); @@ -718,33 +725,70 @@ void MDIEngine::mdi_md_old() } /* ---------------------------------------------------------------------- - perform minimization under control of driver one iteration at a time - use of fix MDI/ENGINE allows MDI comm within iteration + perform minimization for at most Niterate steps + >TOLERANCE command sets tolerances ---------------------------------------------------------------------- */ void MDIEngine::mdi_optg() { - update->etol = etol; - update->ftol = ftol; - update->nsteps = niterate; - update->max_eval = max_eval; + // engine is now at @INIT_OPTG node + // receive >TOLERANCE or other commands driver wishes to send + // @DEFAULT command from driver will trigger the minimization - update->whichflag = 2; - timer->init_timeout(); + etol = ftol = 1.0e-6; + niterate = max_eval = 1000; - update->beginstep = update->firststep = update->ntimestep; - update->endstep = update->laststep = update->firststep + update->nsteps; - - lmp->init(); - update->minimize->setup(); + engine_node("@INIT_OPTG"); - timer->init(); - timer->barrier_start(); - update->minimize->run(update->nsteps); - timer->barrier_stop(); + if (strcmp(mdicmd,"EXIT") == 0) return; - update->minimize->cleanup(); + // create or update system if requested + int flag_create = flag_natoms | flag_types; + if (flag_create) create_system(); + else { + if (flag_cell || flag_cell_displ) adjust_box(); + if (flag_charges) adjust_charges(); + if (flag_coords) adjust_coords(); + if (flag_velocities) adjust_velocities(); + } + + // perform the minmization + + update->etol = etol; + update->ftol = ftol; + update->nsteps = niterate; + update->max_eval = max_eval; + + update->whichflag = 2; + timer->init_timeout(); + + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->firststep + update->nsteps; + + lmp->init(); + update->minimize->setup(); + + timer->init(); + timer->barrier_start(); + update->minimize->run(update->nsteps); + timer->barrier_stop(); + + update->minimize->cleanup(); + + // clear flags + + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; +} + +/* ---------------------------------------------------------------------- + perform minimization under control of driver one iteration at a time + use of fix MDI/ENGINE allows MDI comm within iteration +---------------------------------------------------------------------- */ + +void MDIEngine::mdi_optg_old() +{ // add an instance of fix MDI/ENGINE // delete the instance before this method returns @@ -803,21 +847,11 @@ void MDIEngine::mdi_optg() evaluate() invoked by all(FLERR,"MDI: >TOLERANCE data"); MPI_Bcast(params,4,MPI_INT,0,world); diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index 52f610ca79..99a768271c 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -57,7 +57,6 @@ class MDIEngine : public Command { class Minimize *minimizer; class Compute *ke,*pe,*press; - // unit conversion factors double lmp2mdi_length,mdi2lmp_length; @@ -99,6 +98,7 @@ class MDIEngine : public Command { void mdi_md(); void mdi_md_old(); void mdi_optg(); + void mdi_optg_old(); void evaluate(); void create_system(); From 1ee40f8f8fa3753b24118cb10a733466b247e651 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Tue, 22 Mar 2022 11:11:43 -0600 Subject: [PATCH 022/130] change to tests --- examples/mdi/README | 6 +++--- examples/mdi/series_driver.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/mdi/README b/examples/mdi/README index 849f98f9ce..5983c0f95e 100644 --- a/examples/mdi/README +++ b/examples/mdi/README @@ -85,7 +85,7 @@ the info is copied here: # -rho 0.75 0.1 # reduced density and random variation thereof, default = 0.75 0.1 # -delta 0.1 -# randomly perturb atoms initially by this distance, default 0.0 +# randomly perturb atoms initially by this distance, default 0.1 # -nsteps 100 # number of timesteps in dynamics runs, default = 100 # -temp 1.0 @@ -105,9 +105,9 @@ Run with TCP: 1 proc each --- -Run with TCP: 1 proc + 4 procs +Run with TCP: 2 proc + 4 procs -% python3 series_driver.py -mdi "-role DRIVER -name aimd -method TCP -port 8021" +% mpirun -np 2 python3 series_driver.py -mdi "-role DRIVER -name aimd -method TCP -port 8021" % mpirun -np 4 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.series -in in.series diff --git a/examples/mdi/series_driver.py b/examples/mdi/series_driver.py index 4ee2c33a26..f8ee41b03f 100644 --- a/examples/mdi/series_driver.py +++ b/examples/mdi/series_driver.py @@ -55,7 +55,7 @@ mode = "eval" nx = ny = nz = 2 rho = 0.75 rhodelta = 0.1 -delta = 0.0 +delta = 0.1 nsteps = 100 tinitial = 1.0 tol = 0.001 From ace6c67697f9ac77d5a45cf8c9415fd153bd5f1e Mon Sep 17 00:00:00 2001 From: davidfir3 <491197586@qq.com> Date: Wed, 23 Mar 2022 22:26:44 +0800 Subject: [PATCH 023/130] Copy .h & .cpp from compute_fep for comparison --- src/FEP/compute_fep_ta.cpp | 655 +++++++++++++++++++++++++++++++++++++ src/FEP/compute_fep_ta.h | 112 +++++++ 2 files changed, 767 insertions(+) create mode 100644 src/FEP/compute_fep_ta.cpp create mode 100644 src/FEP/compute_fep_ta.h diff --git a/src/FEP/compute_fep_ta.cpp b/src/FEP/compute_fep_ta.cpp new file mode 100644 index 0000000000..787c8a29e6 --- /dev/null +++ b/src/FEP/compute_fep_ta.cpp @@ -0,0 +1,655 @@ +// clang-format off +/* ---------------------------------------------------------------------- + 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: Agilio Padua (ENS de Lyon & CNRS) +------------------------------------------------------------------------- */ + +#include "compute_fep.h" + +#include "atom.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "fix.h" +#include "force.h" +#include "input.h" +#include "kspace.h" +#include "memory.h" +#include "modify.h" +#include "pair.h" +#include "pair_hybrid.h" +#include "timer.h" +#include "update.h" +#include "variable.h" + +#include +#include + +using namespace LAMMPS_NS; + +enum{PAIR,ATOM}; +enum{CHARGE}; + +/* ---------------------------------------------------------------------- */ + +ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : + Compute(lmp, narg, arg) +{ + if (narg < 5) error->all(FLERR,"Illegal number of arguments in compute fep"); + + scalar_flag = 0; + vector_flag = 1; + size_vector = 3; + extvector = 0; + + vector = new double[size_vector]; + + fepinitflag = 0; // avoid init to run entirely when called by write_data + + temp_fep = utils::numeric(FLERR,arg[3],false,lmp); + + // count # of perturbations + + npert = 0; + int iarg = 4; + while (iarg < narg) { + if (strcmp(arg[iarg],"pair") == 0) { + if (iarg+6 > narg) error->all(FLERR, + "Illegal pair attribute in compute fep"); + npert++; + iarg += 6; + } else if (strcmp(arg[iarg],"atom") == 0) { + if (iarg+4 > narg) error->all(FLERR, + "Illegal atom attribute in compute fep"); + npert++; + iarg += 4; + } else break; + } + + if (npert == 0) error->all(FLERR,"Illegal syntax in compute fep"); + perturb = new Perturb[npert]; + + // parse keywords + + npert = 0; + chgflag = 0; + + iarg = 4; + while (iarg < narg) { + if (strcmp(arg[iarg],"pair") == 0) { + perturb[npert].which = PAIR; + perturb[npert].pstyle = utils::strdup(arg[iarg+1]); + perturb[npert].pparam = utils::strdup(arg[iarg+2]); + utils::bounds(FLERR,arg[iarg+3],1,atom->ntypes, + perturb[npert].ilo,perturb[npert].ihi,error); + utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, + perturb[npert].jlo,perturb[npert].jhi,error); + if (utils::strmatch(arg[iarg+5],"^v_")) { + perturb[npert].var = utils::strdup(arg[iarg+5]+2); + } else error->all(FLERR,"Illegal variable in compute fep"); + npert++; + iarg += 6; + } else if (strcmp(arg[iarg],"atom") == 0) { + perturb[npert].which = ATOM; + if (strcmp(arg[iarg+1],"charge") == 0) { + perturb[npert].aparam = CHARGE; + chgflag = 1; + } else error->all(FLERR,"Illegal atom argument in compute fep"); + utils::bounds(FLERR,arg[iarg+2],1,atom->ntypes, + perturb[npert].ilo,perturb[npert].ihi,error); + if (utils::strmatch(arg[iarg+3],"^v_")) { + perturb[npert].var = utils::strdup(arg[iarg+3]+2); + } else error->all(FLERR,"Illegal variable in compute fep"); + npert++; + iarg += 4; + } else break; + } + + // optional keywords + + tailflag = 0; + volumeflag = 0; + + while (iarg < narg) { + if (strcmp(arg[iarg],"tail") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword in compute fep"); + tailflag = utils::logical(FLERR,arg[iarg+1],false,lmp); + iarg += 2; + } else if (strcmp(arg[iarg],"volume") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword in compute fep"); + volumeflag = utils::logical(FLERR,arg[iarg+1],false,lmp); + iarg += 2; + } else + error->all(FLERR,"Illegal optional keyword in compute fep"); + } + + // allocate pair style arrays + + int ntype = atom->ntypes; + for (int m = 0; m < npert; m++) { + if (perturb[m].which == PAIR) + memory->create(perturb[m].array_orig,ntype+1,ntype+1,"fep:array_orig"); + } + + // allocate space for charge, force, energy, virial arrays + + f_orig = nullptr; + q_orig = nullptr; + peatom_orig = keatom_orig = nullptr; + pvatom_orig = kvatom_orig = nullptr; + + allocate_storage(); + + fixgpu = nullptr; +} + +/* ---------------------------------------------------------------------- */ + +ComputeFEP::~ComputeFEP() +{ + delete [] vector; + + for (int m = 0; m < npert; m++) { + delete [] perturb[m].var; + if (perturb[m].which == PAIR) { + delete [] perturb[m].pstyle; + delete [] perturb[m].pparam; + memory->destroy(perturb[m].array_orig); + } + } + delete [] perturb; + + deallocate_storage(); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeFEP::init() +{ + int i,j; + + if (!fepinitflag) // avoid init to run entirely when called by write_data + fepinitflag = 1; + else return; + + // setup and error checks + + pairflag = 0; + + for (int m = 0; m < npert; m++) { + Perturb *pert = &perturb[m]; + + pert->ivar = input->variable->find(pert->var); + if (pert->ivar < 0) + error->all(FLERR,"Variable name for compute fep does not exist"); + if (!input->variable->equalstyle(pert->ivar)) + error->all(FLERR,"Variable for compute fep is of invalid style"); + + if (force->pair == nullptr) + error->all(FLERR,"compute fep pair requires pair interactions"); + + if (pert->which == PAIR) { + pairflag = 1; + + Pair *pair = force->pair_match(pert->pstyle,1); + if (pair == nullptr) error->all(FLERR,"compute fep pair style " + "does not exist"); + void *ptr = pair->extract(pert->pparam,pert->pdim); + if (ptr == nullptr) + error->all(FLERR,"compute fep pair style param not supported"); + + pert->array = (double **) ptr; + + // if pair hybrid, test that ilo,ihi,jlo,jhi are valid for sub-style + + if ((strcmp(force->pair_style,"hybrid") == 0 || + strcmp(force->pair_style,"hybrid/overlay") == 0)) { + PairHybrid *pair = (PairHybrid *) force->pair; + for (i = pert->ilo; i <= pert->ihi; i++) + for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) + if (!pair->check_ijtype(i,j,pert->pstyle)) + error->all(FLERR,"compute fep type pair range is not valid for " + "pair hybrid sub-style"); + } + + } else if (pert->which == ATOM) { + if (pert->aparam == CHARGE) { + if (!atom->q_flag) + error->all(FLERR,"compute fep requires atom attribute charge"); + } + } + } + + if (tailflag) { + if (force->pair->tail_flag == 0) + error->all(FLERR,"Compute fep tail when pair style does not " + "compute tail corrections"); + } + + // detect if package gpu is present + + int ifixgpu = modify->find_fix("package_gpu"); + if (ifixgpu >= 0) fixgpu = modify->fix[ifixgpu]; + + if (comm->me == 0) { + if (screen) { + fprintf(screen, "FEP settings ...\n"); + fprintf(screen, " temperature = %f\n", temp_fep); + fprintf(screen, " tail %s\n", (tailflag ? "yes":"no")); + for (int m = 0; m < npert; m++) { + Perturb *pert = &perturb[m]; + if (pert->which == PAIR) + fprintf(screen, " pair %s %s %d-%d %d-%d\n", pert->pstyle, + pert->pparam, + pert->ilo, pert->ihi, pert->jlo, pert->jhi); + else if (pert->which == ATOM) + fprintf(screen, " atom charge %d-%d\n", pert->ilo, pert->ihi); + } + } + if (logfile) { + fprintf(logfile, "FEP settings ...\n"); + fprintf(logfile, " temperature = %f\n", temp_fep); + fprintf(logfile, " tail %s\n", (tailflag ? "yes":"no")); + for (int m = 0; m < npert; m++) { + Perturb *pert = &perturb[m]; + if (pert->which == PAIR) + fprintf(logfile, " pair %s %s %d-%d %d-%d\n", pert->pstyle, + pert->pparam, + pert->ilo, pert->ihi, pert->jlo, pert->jhi); + else if (pert->which == ATOM) + fprintf(logfile, " atom charge %d-%d\n", pert->ilo, pert->ihi); + } + } + } + +} + +/* ---------------------------------------------------------------------- */ + + +void ComputeFEP::compute_vector() +{ + double pe0,pe1; + + eflag = 1; + vflag = 0; + + invoked_vector = update->ntimestep; + + if (atom->nmax > nmax) { // reallocate working arrays if necessary + deallocate_storage(); + allocate_storage(); + } + + backup_qfev(); // backup charge, force, energy, virial array values + backup_params(); // backup pair parameters + + timer->stamp(); + if (force->pair && force->pair->compute_flag) { + force->pair->compute(eflag,vflag); + timer->stamp(Timer::PAIR); + } + if (chgflag && force->kspace && force->kspace->compute_flag) { + force->kspace->compute(eflag,vflag); + timer->stamp(Timer::KSPACE); + } + + // accumulate force/energy/virial from /gpu pair styles + if (fixgpu) fixgpu->post_force(vflag); + + pe0 = compute_epair(); + + perturb_params(); + + timer->stamp(); + if (force->pair && force->pair->compute_flag) { + force->pair->compute(eflag,vflag); + timer->stamp(Timer::PAIR); + } + if (chgflag && force->kspace && force->kspace->compute_flag) { + force->kspace->compute(eflag,vflag); + timer->stamp(Timer::KSPACE); + } + + // accumulate force/energy/virial from /gpu pair styles + // this is required as to empty the answer queue, + // otherwise the force compute on the GPU in the next step would be incorrect + if (fixgpu) fixgpu->post_force(vflag); + + pe1 = compute_epair(); + + restore_qfev(); // restore charge, force, energy, virial array values + restore_params(); // restore pair parameters + + vector[0] = pe1-pe0; + vector[1] = exp(-(pe1-pe0)/(force->boltz*temp_fep)); + vector[2] = domain->xprd * domain->yprd * domain->zprd; + if (volumeflag) + vector[1] *= vector[2]; +} + + +/* ---------------------------------------------------------------------- + obtain pair energy from lammps accumulators +------------------------------------------------------------------------- */ + +double ComputeFEP::compute_epair() +{ + double eng, eng_pair; + + eng = 0.0; + if (force->pair) + eng = force->pair->eng_vdwl + force->pair->eng_coul; + MPI_Allreduce(&eng,&eng_pair,1,MPI_DOUBLE,MPI_SUM,world); + + if (tailflag) { + double volume = domain->xprd * domain->yprd * domain->zprd; + eng_pair += force->pair->etail / volume; + } + + if (chgflag && force->kspace) eng_pair += force->kspace->energy; + + return eng_pair; +} + + +/* ---------------------------------------------------------------------- + apply perturbation to pair, atom parameters based on variable evaluation +------------------------------------------------------------------------- */ + +void ComputeFEP::perturb_params() +{ + int i,j; + + for (int m = 0; m < npert; m++) { + Perturb *pert = &perturb[m]; + + double delta = input->variable->compute_equal(pert->ivar); + + if (pert->which == PAIR) { // modify pair parameters + for (i = pert->ilo; i <= pert->ihi; i++) + for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) + pert->array[i][j] = pert->array_orig[i][j] + delta; + + } else if (pert->which == ATOM) { + + if (pert->aparam == CHARGE) { // modify charges + int *atype = atom->type; + double *q = atom->q; + int *mask = atom->mask; + int natom = atom->nlocal + atom->nghost; + + for (i = 0; i < natom; i++) + if (atype[i] >= pert->ilo && atype[i] <= pert->ihi) + if (mask[i] & groupbit) + q[i] += delta; + + } + } + } + + // re-initialize pair styles if any PAIR settings were changed + // this resets other coeffs that may depend on changed values, + // and also offset and tail corrections + + if (pairflag) force->pair->reinit(); + + // reset KSpace charges if charges have changed + + if (chgflag && force->kspace) force->kspace->qsum_qsq(); +} + + +/* ---------------------------------------------------------------------- + backup pair parameters +------------------------------------------------------------------------- */ + +void ComputeFEP::backup_params() +{ + int i,j; + + for (int m = 0; m < npert; m++) { + Perturb *pert = &perturb[m]; + if (pert->which == PAIR) { + for (i = pert->ilo; i <= pert->ihi; i++) + for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) + pert->array_orig[i][j] = pert->array[i][j]; + } + } +} + + +/* ---------------------------------------------------------------------- + restore pair parameters to original values +------------------------------------------------------------------------- */ + +void ComputeFEP::restore_params() +{ + int i,j; + + for (int m = 0; m < npert; m++) { + Perturb *pert = &perturb[m]; + if (pert->which == PAIR) { + for (i = pert->ilo; i <= pert->ihi; i++) + for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) + pert->array[i][j] = pert->array_orig[i][j]; + } + } + + if (pairflag) force->pair->reinit(); + + // reset KSpace charges if charges have changed + + if (chgflag && force->kspace) force->kspace->qsum_qsq(); +} + + +/* ---------------------------------------------------------------------- + manage storage for charge, force, energy, virial arrays +------------------------------------------------------------------------- */ + +void ComputeFEP::allocate_storage() +{ + nmax = atom->nmax; + memory->create(f_orig,nmax,3,"fep:f_orig"); + memory->create(peatom_orig,nmax,"fep:peatom_orig"); + memory->create(pvatom_orig,nmax,6,"fep:pvatom_orig"); + if (chgflag) { + memory->create(q_orig,nmax,"fep:q_orig"); + if (force->kspace) { + memory->create(keatom_orig,nmax,"fep:keatom_orig"); + memory->create(kvatom_orig,nmax,6,"fep:kvatom_orig"); + } + } +} + +/* ---------------------------------------------------------------------- */ + +void ComputeFEP::deallocate_storage() +{ + memory->destroy(f_orig); + memory->destroy(peatom_orig); + memory->destroy(pvatom_orig); + memory->destroy(q_orig); + memory->destroy(keatom_orig); + memory->destroy(kvatom_orig); + + f_orig = nullptr; + q_orig = nullptr; + peatom_orig = keatom_orig = nullptr; + pvatom_orig = kvatom_orig = nullptr; +} + + +/* ---------------------------------------------------------------------- + backup and restore arrays with charge, force, energy, virial +------------------------------------------------------------------------- */ + +void ComputeFEP::backup_qfev() +{ + int i; + + int nall = atom->nlocal + atom->nghost; + int natom = atom->nlocal; + if (force->newton || force->kspace->tip4pflag) + natom += atom->nghost; + + double **f = atom->f; + for (i = 0; i < natom; i++) { + f_orig[i][0] = f[i][0]; + f_orig[i][1] = f[i][1]; + f_orig[i][2] = f[i][2]; + } + + eng_vdwl_orig = force->pair->eng_vdwl; + eng_coul_orig = force->pair->eng_coul; + + pvirial_orig[0] = force->pair->virial[0]; + pvirial_orig[1] = force->pair->virial[1]; + pvirial_orig[2] = force->pair->virial[2]; + pvirial_orig[3] = force->pair->virial[3]; + pvirial_orig[4] = force->pair->virial[4]; + pvirial_orig[5] = force->pair->virial[5]; + + if (update->eflag_atom) { + double *peatom = force->pair->eatom; + for (i = 0; i < natom; i++) + peatom_orig[i] = peatom[i]; + } + if (update->vflag_atom) { + double **pvatom = force->pair->vatom; + for (i = 0; i < natom; i++) { + pvatom_orig[i][0] = pvatom[i][0]; + pvatom_orig[i][1] = pvatom[i][1]; + pvatom_orig[i][2] = pvatom[i][2]; + pvatom_orig[i][3] = pvatom[i][3]; + pvatom_orig[i][4] = pvatom[i][4]; + pvatom_orig[i][5] = pvatom[i][5]; + } + } + + if (chgflag) { + double *q = atom->q; + for (i = 0; i < nall; i++) + q_orig[i] = q[i]; + + if (force->kspace) { + energy_orig = force->kspace->energy; + kvirial_orig[0] = force->kspace->virial[0]; + kvirial_orig[1] = force->kspace->virial[1]; + kvirial_orig[2] = force->kspace->virial[2]; + kvirial_orig[3] = force->kspace->virial[3]; + kvirial_orig[4] = force->kspace->virial[4]; + kvirial_orig[5] = force->kspace->virial[5]; + + if (update->eflag_atom) { + double *keatom = force->kspace->eatom; + for (i = 0; i < natom; i++) + keatom_orig[i] = keatom[i]; + } + if (update->vflag_atom) { + double **kvatom = force->kspace->vatom; + for (i = 0; i < natom; i++) { + kvatom_orig[i][0] = kvatom[i][0]; + kvatom_orig[i][1] = kvatom[i][1]; + kvatom_orig[i][2] = kvatom[i][2]; + kvatom_orig[i][3] = kvatom[i][3]; + kvatom_orig[i][4] = kvatom[i][4]; + kvatom_orig[i][5] = kvatom[i][5]; + } + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +void ComputeFEP::restore_qfev() +{ + int i; + + int nall = atom->nlocal + atom->nghost; + int natom = atom->nlocal; + if (force->newton || force->kspace->tip4pflag) + natom += atom->nghost; + + double **f = atom->f; + for (i = 0; i < natom; i++) { + f[i][0] = f_orig[i][0]; + f[i][1] = f_orig[i][1]; + f[i][2] = f_orig[i][2]; + } + + force->pair->eng_vdwl = eng_vdwl_orig; + force->pair->eng_coul = eng_coul_orig; + + force->pair->virial[0] = pvirial_orig[0]; + force->pair->virial[1] = pvirial_orig[1]; + force->pair->virial[2] = pvirial_orig[2]; + force->pair->virial[3] = pvirial_orig[3]; + force->pair->virial[4] = pvirial_orig[4]; + force->pair->virial[5] = pvirial_orig[5]; + + if (update->eflag_atom) { + double *peatom = force->pair->eatom; + for (i = 0; i < natom; i++) + peatom[i] = peatom_orig[i]; + } + if (update->vflag_atom) { + double **pvatom = force->pair->vatom; + for (i = 0; i < natom; i++) { + pvatom[i][0] = pvatom_orig[i][0]; + pvatom[i][1] = pvatom_orig[i][1]; + pvatom[i][2] = pvatom_orig[i][2]; + pvatom[i][3] = pvatom_orig[i][3]; + pvatom[i][4] = pvatom_orig[i][4]; + pvatom[i][5] = pvatom_orig[i][5]; + } + } + + if (chgflag) { + double *q = atom->q; + for (i = 0; i < nall; i++) + q[i] = q_orig[i]; + + if (force->kspace) { + force->kspace->energy = energy_orig; + force->kspace->virial[0] = kvirial_orig[0]; + force->kspace->virial[1] = kvirial_orig[1]; + force->kspace->virial[2] = kvirial_orig[2]; + force->kspace->virial[3] = kvirial_orig[3]; + force->kspace->virial[4] = kvirial_orig[4]; + force->kspace->virial[5] = kvirial_orig[5]; + + if (update->eflag_atom) { + double *keatom = force->kspace->eatom; + for (i = 0; i < natom; i++) + keatom[i] = keatom_orig[i]; + } + if (update->vflag_atom) { + double **kvatom = force->kspace->vatom; + for (i = 0; i < natom; i++) { + kvatom[i][0] = kvatom_orig[i][0]; + kvatom[i][1] = kvatom_orig[i][1]; + kvatom[i][2] = kvatom_orig[i][2]; + kvatom[i][3] = kvatom_orig[i][3]; + kvatom[i][4] = kvatom_orig[i][4]; + kvatom[i][5] = kvatom_orig[i][5]; + } + } + } + } +} + diff --git a/src/FEP/compute_fep_ta.h b/src/FEP/compute_fep_ta.h new file mode 100644 index 0000000000..8f576124e0 --- /dev/null +++ b/src/FEP/compute_fep_ta.h @@ -0,0 +1,112 @@ +/* -*- 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. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Agilio Padua (ENS de Lyon & CNRS) +------------------------------------------------------------------------- */ + +#ifdef COMPUTE_CLASS +// clang-format off +ComputeStyle(fep,ComputeFEP); +// clang-format on +#else + +#ifndef COMPUTE_FEP_H +#define COMPUTE_FEP_H + +#include "compute.h" + +namespace LAMMPS_NS { + +class ComputeFEP : public Compute { + public: + ComputeFEP(class LAMMPS *, int, char **); + ~ComputeFEP() override; + void init() override; + void compute_vector() override; + + private: + int npert; + int pairflag; + int chgflag; + int tailflag, volumeflag; + int fepinitflag; + int eflag, vflag; + double temp_fep; + + int nmax; + double *q_orig; + double **f_orig; + double eng_vdwl_orig, eng_coul_orig; + double pvirial_orig[6]; + double *peatom_orig, **pvatom_orig; + double energy_orig; + double kvirial_orig[6]; + double *keatom_orig, **kvatom_orig; + + class Fix *fixgpu; + + struct Perturb { + int which, ivar; + char *var; + char *pstyle, *pparam; + int ilo, ihi, jlo, jhi; + int pdim; + double **array, **array_orig; + int aparam; + }; + + Perturb *perturb; + + double compute_epair(); + void perturb_params(); + void backup_params(); + void restore_params(); + void allocate_storage(); + void deallocate_storage(); + void backup_qfev(); + void restore_qfev(); +}; + +} // 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: Variable name for compute fep does not exist + +Self-explanatory. + +E: Variable for compute fep is invalid style + +Self-explanatory. + +E: Compute fep pair style does not exist + +Self-explanatory. + +E: Energy was not tallied on needed timestep + +You are using a thermo keyword that requires potentials to +have tallied energy, but they didn't on this timestep. See the +variable doc page for ideas on how to make this work. + +*/ From c4425a1b0ebee13f036e2a76c1766eadb07d491c Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Wed, 23 Mar 2022 11:17:51 -0600 Subject: [PATCH 024/130] debugging plugin mode --- examples/mdi/README | 15 +- examples/mdi/series_driver.py | 360 +++++++++++++++++++--------------- lib/mdi/Install.py | 2 +- src/MDI/library_mdi.cpp | 6 + src/MDI/mdi_engine.cpp | 8 + 5 files changed, 232 insertions(+), 159 deletions(-) diff --git a/examples/mdi/README b/examples/mdi/README index 5983c0f95e..f1afb46491 100644 --- a/examples/mdi/README +++ b/examples/mdi/README @@ -99,7 +99,7 @@ the info is copied here: Run with TCP: 1 proc each -% python3 series_driver.py -mdi "-role DRIVER -name aimd -method TCP -port 8021" +% python3 series_driver.py -mdi "-role DRIVER -name series -method TCP -port 8021" % lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.series -in in.series @@ -107,7 +107,7 @@ Run with TCP: 1 proc each Run with TCP: 2 proc + 4 procs -% mpirun -np 2 python3 series_driver.py -mdi "-role DRIVER -name aimd -method TCP -port 8021" +% mpirun -np 2 python3 series_driver.py -mdi "-role DRIVER -name series -method TCP -port 8021" % mpirun -np 4 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.series -in in.series @@ -115,12 +115,19 @@ Run with TCP: 2 proc + 4 procs Run with MPI: 1 proc each -% mpirun -np 1 python3 series_driver.py -mdi "-role DRIVER -name aimd -method MPI" : -np 1 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.series -in in.series +% mpirun -np 1 python3 series_driver.py -mdi "-role DRIVER -name series -method MPI" : -np 1 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.series -in in.series --- Run with MPI: 2 procs + 3 procs -% mpirun -np 2 python3 series_driver.py -mdi "-role DRIVER -name aimd -method MPI" : -np 3 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.series -in in.series +% mpirun -np 2 python3 series_driver.py -mdi "-role DRIVER -name series -method MPI" : -np 3 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.series -in in.series + +--- + +Run in plugin mode: 1 proc + +% python3 series_driver.py -plugin lammps -mdi "-role DRIVER -name series -method LINK -plugin_path /home/sjplimp/lammps/git/src" -plugin_args "-log log.series -in in.series" +mpiexec -n 1 python3 plugin_driver.py --plugin_name "lammps" --mdi "-role DRIVER -name driver -method LINK -plugin_path /home/sjplimp/lammps/git/src" --plugin_command_line "foo -in in.series" diff --git a/examples/mdi/series_driver.py b/examples/mdi/series_driver.py index f8ee41b03f..5ced1b7375 100644 --- a/examples/mdi/series_driver.py +++ b/examples/mdi/series_driver.py @@ -1,10 +1,20 @@ # MDI driver to perform a series of independent calculations -# using LAMMPS as an engine +# using LAMMPS as a standalone engine # Syntax: python3 series_driver.py switch arg switch arg ... # possible switches: # -mdi "-role DRIVER ..." # required switch +# example for stand-alone mode: +# -mdi "-role DRIVER -name sequence -method TCP -port 8021" +# example for plugin mode: +# -mdi "-role DRIVER -name sequemce -method LINK +# -plugin_path /home/sjplimp/lammps/src/" +# -plugin name +# name of plugin library, only when using plugin mode +# -plugin_args arglist +# args to add when launching plugin library, only when using plugin mode +# enclose arglist in quotes if multiple words # -n 10 # number of calculations to perform, default = 1 # -mode eval/run/min @@ -15,7 +25,7 @@ # -rho 0.75 0.1 # reduced density and random variation thereof, default = 0.75 0.1 # -delta 0.1 -# randomly perturb atoms initially by this distance, default 0.0 +# randomly perturb atoms initially by this distance, default 0.1 # -nsteps 100 # number of timesteps in dynamics runs, default = 100 # -temp 1.0 @@ -36,20 +46,176 @@ def error(txt=None): if txt: raise Exception(txt) raise Exception("Syntax: python3 series_driver.py switch arg switch arg ...") -# send a LAMMPS input script command to MDI engine +# loop over all the tasks to exchange MDI Sends/Receives with the engine +# for standalone mode, this is called by main program below +# for plugin mode, this is a callback function invoked by MDI -def send_command(cmd): - mdi.MDI_Send_Command("NBYTES",mdicomm) - mdi.MDI_Send(len(cmd),1,mdi.MDI_INT,mdicomm) - mdi.MDI_Send_Command("COMMAND",mdicomm) - mdi.MDI_Send(cmd,len(cmd)+1,mdi.MDI_CHAR,mdicomm) +def perform_tasks(world,mdicomm,dummy): -# parse command-line args + print("PT start",world,mdicomm,dummy) + + me = world.Get_rank() + nprocs = world.Get_size() + + # allocate vectors for per-atom types, coords, vels, forces + + natoms = nx * ny * nz + atypes = np.zeros(natoms,dtype=np.int) + coords = np.zeros(3*natoms,dtype=np.float64) + vels = np.zeros(3*natoms,dtype=np.float64) + forces = np.zeros(3*natoms,dtype=np.float64) + + atypes[:] = 1 + + # initialize RN generator + + random.seed(seed) + + # loop over sequence of calculations + + for icalc in range(ncalc): + + # define simulation box + + onerho = rho + (random.random()-0.5)*rhodelta; + sigma = pow(1.0/onerho,1.0/3.0) + + xlo = ylo = zlo = 0.0 + xhi = nx * sigma + yhi = ny * sigma + zhi = nz * sigma + + # send simulation box to engine + + vec = [xhi-xlo,0.0,0.0] + [0.0,yhi-ylo,0.0] + [0.0,0.0,zhi-zlo] + print("PRE-CELL",mdicomm) + mdi.MDI_Send_command(">CELL",mdicomm) + mdi.MDI_Send(vec,9,mdi.MDI_DOUBLE,mdicomm) + print("POST-CELL") + + # create atoms on perfect lattice + + m = 0 + for k in range(nz): + for j in range(ny): + for i in range(nx): + coords[m] = i * sigma + coords[m+1] = j * sigma + coords[m+2] = k * sigma + m += 3 + + # perturb lattice + + for m in range(3*natoms): + coords[m] += 2.0*random.random()*delta - delta + + # define initial velocities + + for m in range(3*natoms): + vels[m] = random.random() - 0.5 + + tcurrent = 0.0 + for m in range(3*natoms): + tcurrent += vels[m]*vels[m] + tcurrent /= 3*(natoms-1) + + factor = math.sqrt(tinitial/tcurrent) + + for m in range(3*natoms): + vels[m] *= factor + + # send atoms and their properties to engine + + mdi.MDI_Send_command(">NATOMS",mdicomm) + mdi.MDI_Send(natoms,1,mdi.MDI_INT,mdicomm) + mdi.MDI_Send_command(">TYPES",mdicomm) + mdi.MDI_Send(atypes,natoms,mdi.MDI_INT,mdicomm) + mdi.MDI_Send_command(">COORDS",mdicomm) + mdi.MDI_Send(coords,3*natoms,mdi.MDI_DOUBLE,mdicomm) + mdi.MDI_Send_command(">VELOCITIES",mdicomm) + mdi.MDI_Send(vels,3*natoms,mdi.MDI_DOUBLE,mdicomm) + + # eval or run or minimize + + if mode == "eval": + pass + elif mode == "run": + mdi.MDI_Send_command("@INIT_MD",mdicomm) + mdi.MDI_Send_command(">NITERATE",mdicomm) + mdi.MDI_Send(nsteps,1,mdi.MDI_INT,mdicomm) + mdi.MDI_Send_command("@DEFAULT",mdicomm) + elif mode == "min": + mdi.MDI_Send_command("@INIT_OPTG",mdicomm) + mdi.MDI_Send_command(">TOLERANCE",mdicomm) + params = [1.0e-4,1.0e-4,100.0,100.0] + mdi.MDI_Send(params,4,mdi.MDI_DOUBLE,mdicomm) + mdi.MDI_Send_command("@DEFAULT",mdicomm) + + # request potential energy + + print("PRE-PE") + + mdi.MDI_Send_command(" narg: error() - mdiarg = iarg + 1 + mdiarg = args[iarg+1] + iarg += 2 + elif args[iarg] == "-plugin": + if iarg+2 > narg: error() + plugin = args[iarg+1] + iarg += 2 + elif args[iarg] == "-plugin_args": + if iarg+2 > narg: error() + plugin_args = args[iarg+1] iarg += 2 elif args[iarg] == "-n": if iarg+2 > narg: error() @@ -118,153 +294,29 @@ while iarg < narg: if not mdiarg: error() -# initialize MDI Library +# LAMMPS engine is a stand-alone code +# world = MPI communicator for just this driver +# invoke perform_tasks() directly -mdi.MDI_Init(args[mdiarg]) +if not plugin: + mdi.MDI_Init(mdiarg) + world = mdi.MDI_MPI_get_world_comm() -# MPI communicator for just the driver + # connect to engine -world = mdi.MDI_MPI_get_world_comm() -me = world.Get_rank() -nprocs = world.Get_size() + mdicomm = mdi.MDI_Accept_Communicator() -# connect to engine + perform_tasks(world,mdicomm,None) -mdicomm = mdi.MDI_Accept_Communicator() +# LAMMPS engine is a plugin library +# launch plugin +# MDI will call back to perform_tasks() -# allocate vectors for per-atom types, coords, vels, forces +print("PRE PLUGIN"); -natoms = nx * ny * nz -atypes = np.zeros(natoms,dtype=np.int) -coords = np.zeros(3*natoms,dtype=np.float64) -vels = np.zeros(3*natoms,dtype=np.float64) -forces = np.zeros(3*natoms,dtype=np.float64) - -atypes[:] = 1 - -# initialize RN generator - -random.seed(seed) - -# loop over sequence of calculations - -for icalc in range(ncalc): - - # define simulation box - - onerho = rho + (random.random()-0.5)*rhodelta; - sigma = pow(1.0/onerho,1.0/3.0) - - xlo = ylo = zlo = 0.0 - xhi = nx * sigma - yhi = ny * sigma - zhi = nz * sigma - - # send simulation box to engine - - vec = [xhi-xlo,0.0,0.0] + [0.0,yhi-ylo,0.0] + [0.0,0.0,zhi-zlo] - mdi.MDI_Send_command(">CELL",mdicomm) - mdi.MDI_Send(vec,9,mdi.MDI_DOUBLE,mdicomm) - - # create atoms on perfect lattice - - m = 0 - for k in range(nz): - for j in range(ny): - for i in range(nx): - coords[m] = i * sigma - coords[m+1] = j * sigma - coords[m+2] = k * sigma - m += 3 - - # perturb lattice - - for m in range(3*natoms): - coords[m] += 2.0*random.random()*delta - delta - - # define initial velocities - - for m in range(3*natoms): - vels[m] = random.random() - 0.5 - - tcurrent = 0.0 - for m in range(3*natoms): - tcurrent += vels[m]*vels[m] - tcurrent /= 3*(natoms-1) - - factor = math.sqrt(tinitial/tcurrent) - - for m in range(3*natoms): - vels[m] *= factor - - # send atoms and their properties to engine - - mdi.MDI_Send_command(">NATOMS",mdicomm) - mdi.MDI_Send(natoms,1,mdi.MDI_INT,mdicomm) - mdi.MDI_Send_command(">TYPES",mdicomm) - mdi.MDI_Send(atypes,natoms,mdi.MDI_INT,mdicomm) - mdi.MDI_Send_command(">COORDS",mdicomm) - mdi.MDI_Send(coords,3*natoms,mdi.MDI_DOUBLE,mdicomm) - mdi.MDI_Send_command(">VELOCITIES",mdicomm) - mdi.MDI_Send(vels,3*natoms,mdi.MDI_DOUBLE,mdicomm) - - # eval or run or minimize - - if mode == "eval": - pass - elif mode == "run": - mdi.MDI_Send_command("@INIT_MD",mdicomm) - mdi.MDI_Send_command(">NITERATE",mdicomm) - mdi.MDI_Send(nsteps,1,mdi.MDI_INT,mdicomm) - mdi.MDI_Send_command("@DEFAULT",mdicomm) - elif mode == "min": - mdi.MDI_Send_command("@INIT_OPTG",mdicomm) - mdi.MDI_Send_command(">TOLERANCE",mdicomm) - params = [1.0e-4,1.0e-4,100.0,100.0] - mdi.MDI_Send(params,4,mdi.MDI_DOUBLE,mdicomm) - mdi.MDI_Send_command("@DEFAULT",mdicomm) - - # request potential energy - - - mdi.MDI_Send_command(" 0) lmp = lammps_open(mdi_argc, mdi_argv, mpi_world_comm, nullptr); diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 913c24ad99..bbef471951 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -174,6 +174,8 @@ void MDIEngine::mdi_engine(int narg, char **arg) MDI_Accept_communicator(&mdicomm); if (mdicomm <= 0) error->all(FLERR,"Unable to connect to MDI driver"); + printf("ENG post accept MDI comm\n"); + // endless engine loop, responding to driver commands mode = DEFAULT; @@ -235,6 +237,8 @@ void MDIEngine::engine_node(const char *node) { int ierr; + printf("ENG ENODE %s\n",node); + // do not process commands if engine and driver request are not the same strncpy(node_engine,node,MDI_COMMAND_LENGTH); @@ -249,9 +253,13 @@ void MDIEngine::engine_node(const char *node) // read the next command from the driver // all procs call this, but only proc 0 receives the command + printf("ENG PRE-RECV %d\n",mdicomm); + ierr = MDI_Recv_command(mdicmd,mdicomm); if (ierr) error->all(FLERR,"MDI: Unable to receive command from driver"); + printf("ENG POST-RECV %s\n",mdicmd); + // broadcast command to the other MPI tasks MPI_Bcast(mdicmd,MDI_COMMAND_LENGTH,MPI_CHAR,0,world); From 42dd77245541d04c8ac3fa664cc6cf0aa2d4bd17 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Wed, 23 Mar 2022 13:45:20 -0600 Subject: [PATCH 025/130] more work on plugin mode --- examples/mdi/README | 42 +++++++++++-------- examples/mdi/{in.series => in.sequence} | 0 .../{series_driver.py => sequence_driver.py} | 0 src/MDI/library_mdi.cpp | 15 ++----- src/MDI/mdi_engine.cpp | 6 +-- 5 files changed, 32 insertions(+), 31 deletions(-) rename examples/mdi/{in.series => in.sequence} (100%) rename examples/mdi/{series_driver.py => sequence_driver.py} (100%) diff --git a/examples/mdi/README b/examples/mdi/README index f1afb46491..81999ae9f7 100644 --- a/examples/mdi/README +++ b/examples/mdi/README @@ -40,7 +40,7 @@ Run the entire calculation with a single instance of LAMMPS by itself Run with TCP: 1 proc each -% lmp_mpi -mdi "-name driver -role DRIVER -method TCP -port 8021" -log log.aimd.driver -in in.aimd.driver +% lmp_mpi -mdi "-name aimd -role DRIVER -method TCP -port 8021" -log log.aimd.driver -in in.aimd.driver % lmp_mpi -mdi "-name LAMMPS -role ENGINE -method TCP -port 8021 -hostname localhost" -log log.aimd.engine -in in.aimd.engine @@ -48,7 +48,7 @@ Run with TCP: 1 proc each Run with TCP: 3 procs + 4 procs -% mpirun -np 3 lmp_mpi -mdi "-name driver -role DRIVER -method TCP -port 8021" -log log.aimd.driver -in in.aimd.driver +% mpirun -np 3 lmp_mpi -mdi "-name aimd -role DRIVER -method TCP -port 8021" -log log.aimd.driver -in in.aimd.driver % mpirun -np 4 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method TCP -port 8021 -hostname localhost" -log log.aimd.engine -in in.aimd.engine @@ -56,24 +56,26 @@ Run with TCP: 3 procs + 4 procs Run with MPI: 1 proc each -% mpirun -np 1 lmp_mpi -mdi "-name driver -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 1 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine +% mpirun -np 1 lmp_mpi -mdi "-name aimd -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 1 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine --- Run with MPI: 3 procs + 4 procs -% mpirun -np 3 lmp_mpi -mdi "-name driver -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 4 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine +% mpirun -np 3 lmp_mpi -mdi "-name aimd -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 4 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine ------------------------------------------------- ------------------------------------------------- -* Example #2 = Use a Python driver code to run a series of independent +* Example #2 = Use a Python driver code to run a sequence of independent LAMMPS calculations -Note that the series_driver.py code allows for optional arguments in -addition to -mdi (required). The example run commands below just -using the default values. The options are explained the top of the file; -the info is copied here: +Note that the sequence_driver.py code allows for optional switches in +addition to -mdi (required) and the -plugin and -plugin_args swithces +which are used to link to an engine as a plugin library. The example +run commands below just usu the default values fo rhte optional +switches. They are also explained the top of the file; the info is +copied here: # -n 10 # number of calculations to perform, default = 1 @@ -99,35 +101,41 @@ the info is copied here: Run with TCP: 1 proc each -% python3 series_driver.py -mdi "-role DRIVER -name series -method TCP -port 8021" +% python3 sequence_driver.py -mdi "-role DRIVER -name sequence -method TCP -port 8021" -% lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.series -in in.series +% lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.sequence -in in.sequence --- Run with TCP: 2 proc + 4 procs -% mpirun -np 2 python3 series_driver.py -mdi "-role DRIVER -name series -method TCP -port 8021" +% mpirun -np 2 python3 sequence_driver.py -mdi "-role DRIVER -name sequence -method TCP -port 8021" -% mpirun -np 4 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.series -in in.series +% mpirun -np 4 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.sequence -in in.sequence --- Run with MPI: 1 proc each -% mpirun -np 1 python3 series_driver.py -mdi "-role DRIVER -name series -method MPI" : -np 1 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.series -in in.series +% mpirun -np 1 python3 sequence_driver.py -mdi "-role DRIVER -name sequence -method MPI" : -np 1 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.sequence -in in.sequence --- Run with MPI: 2 procs + 3 procs -% mpirun -np 2 python3 series_driver.py -mdi "-role DRIVER -name series -method MPI" : -np 3 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.series -in in.series +% mpirun -np 2 python3 sequence_driver.py -mdi "-role DRIVER -name sequence -method MPI" : -np 3 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.sequence -in in.sequence --- Run in plugin mode: 1 proc -% python3 series_driver.py -plugin lammps -mdi "-role DRIVER -name series -method LINK -plugin_path /home/sjplimp/lammps/git/src" -plugin_args "-log log.series -in in.series" +% python3 sequence_driver.py -plugin lammps -mdi "-role DRIVER -name sequence -method LINK -plugin_path /home/sjplimp/lammps/git/src" -plugin_args "-log log.sequence -in in.sequence" +DEBUG: +mpiexec -n 1 python3 plugin_driver.py --plugin_name "lammps" --mdi "-role DRIVER -name driver -method LINK -plugin_path /home/sjplimp/lammps/git/src" --plugin_command_line "-in in.sequence -log log.sequence" -mpiexec -n 1 python3 plugin_driver.py --plugin_name "lammps" --mdi "-role DRIVER -name driver -method LINK -plugin_path /home/sjplimp/lammps/git/src" --plugin_command_line "foo -in in.series" +--- + +Run in plugin mode: 3 procs + +% mpirun -np 3 python3 sequence_driver.py -plugin lammps -mdi "-role DRIVER -name sequence -method LINK -plugin_path /home/sjplimp/lammps/git/src" -plugin_args "-log log.sequence -in in.sequence" diff --git a/examples/mdi/in.series b/examples/mdi/in.sequence similarity index 100% rename from examples/mdi/in.series rename to examples/mdi/in.sequence diff --git a/examples/mdi/series_driver.py b/examples/mdi/sequence_driver.py similarity index 100% rename from examples/mdi/series_driver.py rename to examples/mdi/sequence_driver.py diff --git a/src/MDI/library_mdi.cpp b/src/MDI/library_mdi.cpp index accf9e2579..0aba2dace0 100644 --- a/src/MDI/library_mdi.cpp +++ b/src/MDI/library_mdi.cpp @@ -54,8 +54,6 @@ command-line argument, which must be provided by the MDI driver. int MDI_Plugin_init_lammps() { - printf("LMP PLUGIN init\n"); - // initialize MDI int mdi_argc; @@ -71,8 +69,6 @@ int MDI_Plugin_init_lammps() // find the -in argument - printf("LMP PLUGIN init %d %s %s\n",mdi_argc,mdi_argv[0],mdi_argv[1]); - int iarg = 0; char *filename; bool found_filename = false; @@ -96,14 +92,14 @@ int MDI_Plugin_init_lammps() if (!found_filename) MPI_Abort(MPI_COMM_WORLD, 1); // create and run a LAMMPS instance - - printf("LMP PLUGIN init %d %s %s\n",mdi_argc,mdi_argv[0],mdi_argv[1]); + // lammps_open() expects a first arg (not used) which is executable name + // same as if called from main.cpp void *lmp = nullptr; if (lammps_config_has_mpi_support() > 0) - lmp = lammps_open(mdi_argc, mdi_argv, mpi_world_comm, nullptr); + lmp = lammps_open(mdi_argc+1, &mdi_argv[-1], mpi_world_comm, nullptr); else - lmp = lammps_open_no_mpi(mdi_argc, mdi_argv, nullptr); + lmp = lammps_open_no_mpi(mdi_argc+1, &mdi_argv[-1], nullptr); // process the specified input script // must contain "mdi engine" command @@ -135,9 +131,6 @@ The function executes a single command from an external MDI driver. int lammps_execute_mdi_command(const char *command, MDI_Comm comm, void *class_obj) { - //FixMDIEngineOld *mdi_fix = (FixMDIEngineOld *) class_obj; - //return mdi_fix->execute_command(command, comm); - MDIEngine *mdi_engine = (MDIEngine *) class_obj; return mdi_engine->execute_command(command,comm); } diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index bbef471951..86c06ab4af 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -1532,8 +1532,8 @@ void MDIEngine::infile() } /* ---------------------------------------------------------------------- - >STEPS command - send number of tiemsteps + >NITERATE command + receive number of iterations for timestepping ---------------------------------------------------------------------- */ void MDIEngine::receive_niterate() @@ -1545,7 +1545,7 @@ void MDIEngine::receive_niterate() /* ---------------------------------------------------------------------- >TOLERANCE command - send 2 minimization tolerance params + receive 4 minimization tolerance params ---------------------------------------------------------------------- */ void MDIEngine::receive_tolerance() From a4018dbb4bb9f4968b5e8a6b6e882dc97f74790e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 23 Mar 2022 17:18:19 -0400 Subject: [PATCH 026/130] update MDI library to version 1.3.0 --- cmake/Modules/Packages/MDI.cmake | 4 ++-- lib/mdi/Install.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/Packages/MDI.cmake b/cmake/Modules/Packages/MDI.cmake index 047c30c603..c7ef6130b8 100644 --- a/cmake/Modules/Packages/MDI.cmake +++ b/cmake/Modules/Packages/MDI.cmake @@ -8,8 +8,8 @@ option(DOWNLOAD_MDI "Download and compile the MDI library instead of using an al if(DOWNLOAD_MDI) message(STATUS "MDI download requested - we will build our own") - set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.2.9.tar.gz" CACHE STRING "URL for MDI tarball") - set(MDI_MD5 "ddfa46d6ee15b4e59cfd527ec7212184" CACHE STRING "MD5 checksum for MDI tarball") + set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.3.0.tar.gz" CACHE STRING "URL for MDI tarball") + set(MDI_MD5 "8a8da217148bd9b700083b67d795af5e" CACHE STRING "MD5 checksum for MDI tarball") mark_as_advanced(MDI_URL) mark_as_advanced(MDI_MD5) enable_language(C) diff --git a/lib/mdi/Install.py b/lib/mdi/Install.py index c4d8725e4c..2921bdf9b8 100644 --- a/lib/mdi/Install.py +++ b/lib/mdi/Install.py @@ -41,6 +41,7 @@ url = "https://github.com/MolSSI-MDI/MDI_Library/archive/v%s.tar.gz" % version checksums = { \ '1.2.7' : '2f3177b30ccdbd6ae28ea3bdd5fed0db', \ '1.2.9' : 'ddfa46d6ee15b4e59cfd527ec7212184', \ + '1.3.0' : '8a8da217148bd9b700083b67d795af5e', \ } # print error message or help From 66f97ef6bcf356e21888c6fec058a3fa3e30b5a2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 23 Mar 2022 17:22:46 -0400 Subject: [PATCH 027/130] whitespace --- src/MDI/fix_mdi_aimd.cpp | 10 +++--- src/MDI/library_mdi.cpp | 4 +-- src/MDI/mdi_engine.cpp | 70 ++++++++++++++++++++-------------------- src/MDI/mdi_engine.h | 2 +- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/MDI/fix_mdi_aimd.cpp b/src/MDI/fix_mdi_aimd.cpp index 1cf659c3c0..52a9c3c94a 100644 --- a/src/MDI/fix_mdi_aimd.cpp +++ b/src/MDI/fix_mdi_aimd.cpp @@ -41,17 +41,17 @@ FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : // check requirements for LAMMPS to work with MDI as an engine - if (atom->tag_enable == 0) + if (atom->tag_enable == 0) error->all(FLERR, "Cannot use MDI engine without atom IDs"); - if (atom->natoms && atom->tag_consecutive() == 0) + if (atom->natoms && atom->tag_consecutive() == 0) error->all(FLERR, "MDI engine requires consecutive atom IDs"); // confirm LAMMPS is being run as a driver - + int role; MDI_Get_role(&role); - if (role != MDI_DRIVER) + if (role != MDI_DRIVER) error->all(FLERR,"Must invoke LAMMPS as an MDI driver to use fix mdi/aimd"); // storage for all atoms @@ -328,7 +328,7 @@ void FixMDIAimd::unit_conversions() lmp2mdi_pressure = 1.0; if (lmpunits == REAL) { - lmp2mdi_pressure = (kelvin_to_hartree / force->boltz) / + lmp2mdi_pressure = (kelvin_to_hartree / force->boltz) / (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; } else if (lmpunits == METAL) { diff --git a/src/MDI/library_mdi.cpp b/src/MDI/library_mdi.cpp index accf9e2579..4edd70445b 100644 --- a/src/MDI/library_mdi.cpp +++ b/src/MDI/library_mdi.cpp @@ -78,7 +78,7 @@ int MDI_Plugin_init_lammps() bool found_filename = false; while (iarg < mdi_argc && !found_filename) { - if ((strcmp(mdi_argv[iarg], "-in") == 0) || + if ((strcmp(mdi_argv[iarg], "-in") == 0) || (strcmp(mdi_argv[iarg], "-i") == 0)) { if (iarg + 2 > mdi_argc) MPI_Abort(MPI_COMM_WORLD, 1); @@ -88,7 +88,7 @@ int MDI_Plugin_init_lammps() // remove -in argument from the command list mdi_argc -= 2; - for (int jarg = iarg; jarg < mdi_argc; jarg++) + for (int jarg = iarg; jarg < mdi_argc; jarg++) mdi_argv[jarg] = mdi_argv[jarg + 2]; } iarg++; diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index bbef471951..d022b2c9a2 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -50,7 +50,7 @@ enum{EVALPOINT,EVALMD,EVALOPT}; // EVAL mode // per-atom data which engine commands access -enum{TYPE,CHARGE,MASS,COORD,VELOCITY,FORCE}; +enum{TYPE,CHARGE,MASS,COORD,VELOCITY,FORCE}; /* ---------------------------------------------------------------------- mdi command: engine @@ -92,17 +92,17 @@ void MDIEngine::mdi_engine(int narg, char **arg) // check requirements for LAMMPS to work with MDI as an engine - if (atom->tag_enable == 0) + if (atom->tag_enable == 0) error->all(FLERR,"Cannot use MDI engine without atom IDs"); - if (atom->natoms && atom->tag_consecutive() == 0) + if (atom->natoms && atom->tag_consecutive() == 0) error->all(FLERR,"MDI engine requires consecutive atom IDs"); // confirm LAMMPS is being run as an engine - + int role; MDI_Get_role(&role); - if (role != MDI_ENGINE) + if (role != MDI_ENGINE) error->all(FLERR,"Must invoke LAMMPS as an MDI engine to use mdi engine"); // root = 1 for proc 0, otherwise 0 @@ -119,7 +119,7 @@ void MDIEngine::mdi_engine(int narg, char **arg) // create computes for KE. PE, pressure // pressure compute only calculates virial, no kinetic term - + id_ke = utils::strdup(std::string("MDI_ENGINE") + "_ke"); modify->add_compute(fmt::format("{} all ke", id_ke)); @@ -158,7 +158,7 @@ void MDIEngine::mdi_engine(int narg, char **arg) buf1 = buf1all = nullptr; buf3 = buf3all = nullptr; ibuf1 = ibuf1all = nullptr; - + maxatom = 0; sys_natoms = atom->natoms; reallocate(); @@ -170,7 +170,7 @@ void MDIEngine::mdi_engine(int narg, char **arg) mdi_commands(); // one-time operation to establish a connection with the driver - + MDI_Accept_communicator(&mdicomm); if (mdicomm <= 0) error->all(FLERR,"Unable to connect to MDI driver"); @@ -209,7 +209,7 @@ void MDIEngine::mdi_engine(int narg, char **arg) } // clean up - + delete [] mdicmd; delete [] node_engine; delete [] node_driver; @@ -297,8 +297,8 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) if (root) { ierr = MDI_Check_command_exists(node_engine,command,MDI_COMM_NULL, &command_exists); - if (ierr) - error->one(FLERR, + if (ierr) + error->one(FLERR, "MDI: Unable to check whether current command is supported"); } @@ -384,14 +384,14 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) // MDI node commands } else if (strcmp(command,"@INIT_MD") == 0) { - if (mode != DEFAULT) + if (mode != DEFAULT) error->all(FLERR,"MDI: MDI engine is already performing a simulation"); mode = MD; strncpy(node_driver,command,MDI_COMMAND_LENGTH); node_match = false; } else if (strcmp(command,"@INIT_OPTG") == 0) { - if (mode != DEFAULT) + if (mode != DEFAULT) error->all(FLERR,"MDI: MDI engine is already performing a simulation"); mode = OPT; strncpy(node_driver,command,MDI_COMMAND_LENGTH); @@ -575,7 +575,7 @@ void MDIEngine::mdi_commands() if (enable_fix) { MDI_Register_node("@FORCES"); - MDI_Register_command("@FORCES", "<@"); + MDI_Register_command("@FORCES", "<@"); MDI_Register_command("@FORCES", "nsteps = niterate; update->beginstep = update->firststep = update->ntimestep; update->endstep = update->laststep = update->ntimestep + update->nsteps; - + lmp->init(); update->integrate->setup(1); - + timer->init(); timer->barrier_start(); update->integrate->run(niterate); timer->barrier_stop(); - + update->integrate->cleanup(); // clear flags @@ -673,7 +673,7 @@ void MDIEngine::mdi_md_old() // add an instance of fix MDI/ENGINE // delete the instance before this method returns - if (!enable_fix) + if (!enable_fix) error->all(FLERR,"MDI engine command did not enable @INIT_MD support"); modify->add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); @@ -708,7 +708,7 @@ void MDIEngine::mdi_md_old() update->integrate->setup(1); // run MD one step at a time until driver sends @DEFAULT or EXIT - // driver can communicate with LAMMPS within each timestep + // driver can communicate with LAMMPS within each timestep // by sending a node command which matches a method in FixMDIEngine while (true) { @@ -773,15 +773,15 @@ void MDIEngine::mdi_optg() update->beginstep = update->firststep = update->ntimestep; update->endstep = update->laststep = update->firststep + update->nsteps; - + lmp->init(); update->minimize->setup(); - + timer->init(); timer->barrier_start(); update->minimize->run(update->nsteps); timer->barrier_stop(); - + update->minimize->cleanup(); // clear flags @@ -800,7 +800,7 @@ void MDIEngine::mdi_optg_old() // add an instance of fix MDI/ENGINE // delete the instance before this method returns - if (!enable_fix) + if (!enable_fix) error->all(FLERR,"MDI engine command did not enable @INIT_OPTG support"); modify->add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); @@ -838,7 +838,7 @@ void MDIEngine::mdi_optg_old() if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; // start minimization - // when the driver sends @DEFAULT or EXIT minimizer tolerances are + // when the driver sends @DEFAULT or EXIT minimizer tolerances are // set to large values to force it to exit update->minimize->iterate(update->nsteps); @@ -864,7 +864,7 @@ void MDIEngine::evaluate() int flag_create = flag_natoms | flag_types; if (flag_create) create_system(); else { - int flag_any = flag_cell | flag_cell_displ | flag_charges | + int flag_any = flag_cell | flag_cell_displ | flag_charges | flag_coords | flag_velocities; if (!flag_any) return; if (flag_cell || flag_cell_displ) adjust_box(); @@ -884,7 +884,7 @@ void MDIEngine::evaluate() if (flag_create || neighbor->ago < 0) { update->whichflag = 1; - lmp->init(); + lmp->init(); update->integrate->setup(1); update->whichflag = 0; @@ -948,7 +948,7 @@ void MDIEngine::create_system() boxhi[0] = boxlo[0] + sys_cell[0]; boxhi[1] = boxlo[1] + sys_cell[4]; boxhi[2] = boxlo[2] + sys_cell[8]; - + xy = sys_cell[3]; yz = sys_cell[7]; xz = sys_cell[6]; @@ -1002,7 +1002,7 @@ void MDIEngine::adjust_box() old_boxlo[0] = domain->boxlo[0]; old_boxlo[1] = domain->boxlo[1]; old_boxlo[2] = domain->boxlo[2]; - + domain->boxlo[0] = sys_cell_displ[0]; domain->boxlo[1] = sys_cell_displ[1]; domain->boxlo[2] = sys_cell_displ[2]; @@ -1091,7 +1091,7 @@ void MDIEngine::receive_cell() if (ierr) error->all(FLERR, "MDI: >CELL data"); MPI_Bcast(sys_cell,9,MPI_DOUBLE,0,world); - for (int icell = 0; icell < 9; icell++) + for (int icell = 0; icell < 9; icell++) sys_cell[icell] *= mdi2lmp_length; // error check that edge vectors match LAMMPS triclinic requirement @@ -1142,7 +1142,7 @@ void MDIEngine::receive_coords() int ierr = MDI_Recv(sys_coords,n,MDI_DOUBLE,mdicomm); if (ierr) error->all(FLERR,"MDI: >COORDS data"); MPI_Bcast(sys_coords,n,MPI_DOUBLE,0,world); - for (int i = 0; i < n; i++) + for (int i = 0; i < n; i++) sys_coords[i] * mdi2lmp_length; } @@ -1184,7 +1184,7 @@ void MDIEngine::receive_velocities() int ierr = MDI_Recv(sys_velocities,n,MDI_DOUBLE,mdicomm); if (ierr) error->all(FLERR,"MDI: >VELOCITIES data"); MPI_Bcast(sys_velocities,n,MPI_DOUBLE,0,world); - for (int i = 0; i < n; i++) + for (int i = 0; i < n; i++) sys_coords[i] * mdi2lmp_velocity; } @@ -1213,7 +1213,7 @@ void MDIEngine::send_cell() celldata[7] = domain->yz; celldata[8] = domain->boxhi[2] - domain->boxlo[2]; - for (int icell = 0; icell < 9; icell++) + for (int icell = 0; icell < 9; icell++) celldata[icell] *= lmp2mdi_length; int ierr = MDI_Send(celldata,9,MDI_DOUBLE,mdicomm); @@ -1504,9 +1504,9 @@ void MDIEngine::many_commands() if (ierr) error->all(FLERR,"MDI: COMMANDS data"); MPI_Bcast(cmds,nbytes+1,MPI_CHAR,0,world); cmds[nbytes] = '\0'; - + lammps_commands_string(lmp,cmds); - + delete [] cmds; } @@ -1685,7 +1685,7 @@ void MDIEngine::unit_conversions() lmp2mdi_pressure = 1.0; if (lmpunits == REAL) { - lmp2mdi_pressure = (kelvin_to_hartree / force->boltz) / + lmp2mdi_pressure = (kelvin_to_hartree / force->boltz) / (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; } else if (lmpunits == METAL) { diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index 99a768271c..0f7d41d96f 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -76,7 +76,7 @@ class MDIEngine : public Command { int *sys_types; double *sys_charges,*sys_coords,*sys_velocities; double sys_cell[9],sys_cell_displ[3]; - + int niterate; int max_eval; double etol,ftol; From 6e959b6f43adce1a8ad5ea20db67e2fe553c675c Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Wed, 23 Mar 2022 17:21:00 -0600 Subject: [PATCH 028/130] more robust response to >COORDS command --- src/MDI/mdi_engine.cpp | 212 ++++++++++++++++++++++++----------------- src/MDI/mdi_engine.h | 6 +- 2 files changed, 123 insertions(+), 95 deletions(-) diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 86c06ab4af..6dd2d21296 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -30,6 +30,7 @@ #include "group.h" #include "input.h" #include "integrate.h" +#include "irregular.h" #include "library.h" #include "memory.h" #include "min.h" @@ -54,7 +55,7 @@ enum{TYPE,CHARGE,MASS,COORD,VELOCITY,FORCE}; /* ---------------------------------------------------------------------- mdi command: engine - NOTE: may later have other MDI command variants? + may later have other MDI command variants ---------------------------------------------------------------------- */ void MDIEngine::command(int narg, char **arg) @@ -75,20 +76,8 @@ void MDIEngine::command(int narg, char **arg) ---------------------------------------------------------------------- */ void MDIEngine::mdi_engine(int narg, char **arg) -{ - // process args - - enable_fix = 0; - - int iarg = 0; - while (iarg < narg) { - if (strcmp(arg[iarg],"nodes") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal mdi engine command"); - if (strcmp(arg[iarg+1],"yes") == 0) enable_fix = 1; - else if (strcmp(arg[iarg+1],"no") == 0) enable_fix = 0; - iarg += 2; - } else error->all(FLERR,"Illegal mdi engine command"); - } +{ + if (narg) error->all(FLERR,"Illegal mdi engine command"); // check requirements for LAMMPS to work with MDI as an engine @@ -137,6 +126,10 @@ void MDIEngine::mdi_engine(int narg, char **arg) pe = modify->compute[icompute_pe]; press = modify->compute[icompute_press]; + // irregular class used if >COORDS change dramatically + + irregular = new Irregular(lmp); + // set unit conversion factors if (strcmp(update->unit_style, "real") == 0) lmpunits = REAL; @@ -222,6 +215,8 @@ void MDIEngine::mdi_engine(int narg, char **arg) delete [] id_pe; delete [] id_press; + delete irregular; + // delete buffers deallocate(); @@ -557,57 +552,51 @@ void MDIEngine::mdi_commands() // node at POST_INTEGRATE location in timestep // only if fix MDI/ENGINE is instantiated - if (enable_fix) { - MDI_Register_node("@COORDS"); - MDI_Register_command("@COORDS", "<@"); - MDI_Register_command("@COORDS", "COORDS"); - MDI_Register_command("@COORDS", "@"); - MDI_Register_command("@COORDS", "@DEFAULT"); - MDI_Register_command("@COORDS", "@COORDS"); - MDI_Register_command("@COORDS", "@FORCES"); - MDI_Register_command("@COORDS", "@ENDSTEP"); - MDI_Register_command("@COORDS", "EXIT"); - } + MDI_Register_node("@COORDS"); + MDI_Register_command("@COORDS", "<@"); + MDI_Register_command("@COORDS", "COORDS"); + MDI_Register_command("@COORDS", "@"); + MDI_Register_command("@COORDS", "@DEFAULT"); + MDI_Register_command("@COORDS", "@COORDS"); + MDI_Register_command("@COORDS", "@FORCES"); + MDI_Register_command("@COORDS", "@ENDSTEP"); + MDI_Register_command("@COORDS", "EXIT"); // node at POST_FORCE location in timestep // only if fix MDI/ENGINE is instantiated - if (enable_fix) { - MDI_Register_node("@FORCES"); - MDI_Register_command("@FORCES", "<@"); - MDI_Register_command("@FORCES", "FORCES"); - MDI_Register_callback("@FORCES", ">+FORCES"); - MDI_Register_command("@FORCES", "FORCES"); + MDI_Register_callback("@FORCES", ">+FORCES"); + MDI_Register_command("@FORCES", "NITERATE or other commands driver wishes to send - // @DEFAULT command from driver will trigger the simulation + // @RUN_MD or @DEFAULT command from driver will trigger the simulation niterate = 0; @@ -628,6 +617,7 @@ void MDIEngine::mdi_md() if (strcmp(mdicmd,"EXIT") == 0) return; // create or update system if requested + // assume only incremental changes in atom coords int flag_create = flag_natoms | flag_types; if (flag_create) create_system(); @@ -657,6 +647,8 @@ void MDIEngine::mdi_md() update->integrate->cleanup(); + engine_node("@RUN_MD"); + // clear flags flag_natoms = flag_types = 0; @@ -673,11 +665,9 @@ void MDIEngine::mdi_md_old() // add an instance of fix MDI/ENGINE // delete the instance before this method returns - if (!enable_fix) - error->all(FLERR,"MDI engine command did not enable @INIT_MD support"); - modify->add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); - mdi_fix = (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); + FixMDIEngine *mdi_fix = + (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); mdi_fix->mdi_engine = this; // initialize a new MD simulation @@ -800,11 +790,9 @@ void MDIEngine::mdi_optg_old() // add an instance of fix MDI/ENGINE // delete the instance before this method returns - if (!enable_fix) - error->all(FLERR,"MDI engine command did not enable @INIT_OPTG support"); - modify->add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); - mdi_fix = (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); + FixMDIEngine *mdi_fix = + (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); mdi_fix->mdi_engine = this; // set tolerances to epsilon and iteration limits huge @@ -876,11 +864,19 @@ void MDIEngine::evaluate() // if new system created or first-time eval: // init LAMMPS and eval eng/force/virial via setup(1) // else: - // assume system has been updated incrementally - // advance system by single timestep via setup(0/1) + // atom coords may or may not be updated incrementally + // incremental: timstepping an MD simulation + // non-incremental: e.g. processing snapshots from a dump file + // advance system by single step // insure potential energy and virial are tallied on new step - // decide if new neighbor list needed - // eval eng/force/virial via setup_minimal(0/1) + // check if reneighboing needed + // if no, just invoke setup_minimal(0) + // if yes, do an irregular->migrate_check() and migrate_atoms() if needed + // this can only be done if comm->style is not tiled + // also requires atoms be in box and lamda coords (for triclinic) + // finally invoke setup_minimal(1) to trigger exchange() & reneigh() + // NOTE: what this logic still lacks is invoking migrate_atoms() + // if necessary for comm->style tiled, not easy to detect if (flag_create || neighbor->ago < 0) { update->whichflag = 1; @@ -894,18 +890,28 @@ void MDIEngine::evaluate() press->addstep(update->ntimestep); int nflag = neighbor->decide(); + if (nflag == 0) { comm->forward_comm(); update->integrate->setup_minimal(0); modify->clearstep_compute(); output->thermo->compute(1); - modify->addstep_compute(update->ntimestep+1); + } else { + if (!comm->style) { + if (domain->triclinic) domain->x2lamda(atom->nlocal); + domain->pbc(); + domain->reset_box(); + if (irregular->migrate_check()) irregular->migrate_atoms(); + if (domain->triclinic) domain->lamda2x(atom->nlocal); + } + update->integrate->setup_minimal(1); modify->clearstep_compute(); output->thermo->compute(1); - modify->addstep_compute(update->ntimestep+1); } + + modify->addstep_compute(update->ntimestep+1); } // clear flags that trigger next eval @@ -916,23 +922,24 @@ void MDIEngine::evaluate() /* ---------------------------------------------------------------------- create a new system + >CELL, >NATOMS, >TYPES, >COORDS commands are required + >CELL_DISPL, >CHARGES, >VELOCITIES commands are optional ---------------------------------------------------------------------- */ void MDIEngine::create_system() { - // >CELL, >NATOMS, >TYPES, >COORDS commands are required - // >CELL_DISPL, >CHARGES, >VELOCITIES commands are optional + // check requirements if (flag_cell == 0 || flag_natoms == 0 || flag_types == 0 || flag_coords == 0) error->all(FLERR, "@INIT_SYS requires >CELL, >NATOMS, >TYPES, >COORDS MDI commands"); - // clear system via delete_atoms command + // remove all existing atoms via delete_atoms command lmp->input->one("delete_atoms group all"); - // lib->reset_box() + // invoke lib->reset_box() double boxlo[3],boxhi[3]; double xy,yz,xz; @@ -955,7 +962,7 @@ void MDIEngine::create_system() lammps_reset_box(lmp,boxlo,boxhi,xy,yz,xz); - // lib->create_atoms() + // invoke lib->create_atoms() // optionally set charges if specified by ">CHARGES" if (flag_velocities) @@ -1013,7 +1020,7 @@ void MDIEngine::adjust_box() } // reset all Domain variables that depend on box size/shape - // convert lamda atoms coords back to new box coords + // convert atoms from lamda coords back to new box coords domain->set_global_box(); domain->set_local_box(); @@ -1021,7 +1028,7 @@ void MDIEngine::adjust_box() } /* ---------------------------------------------------------------------- - adjust charges, coods, velocities + overwrite charges ---------------------------------------------------------------------- */ void MDIEngine::adjust_charges() @@ -1038,6 +1045,10 @@ void MDIEngine::adjust_charges() } } +/* ---------------------------------------------------------------------- + overwrite coords +---------------------------------------------------------------------- */ + void MDIEngine::adjust_coords() { double **x = atom->x; @@ -1054,6 +1065,10 @@ void MDIEngine::adjust_coords() } } +/* ---------------------------------------------------------------------- + overwrite velocities +---------------------------------------------------------------------- */ + void MDIEngine::adjust_velocities() { double **v = atom->v; @@ -1071,8 +1086,8 @@ void MDIEngine::adjust_velocities() } // ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// responses to ">" MDI driver commands that send data +// ----------------------------------------------------------------------/ +// MDI ">" driver commands that send data // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- @@ -1190,7 +1205,7 @@ void MDIEngine::receive_velocities() // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- -// responses to "<" MDI driver commands that request data +// MDI "<" driver commands that request data // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- @@ -1258,7 +1273,7 @@ void MDIEngine::send_total_energy() /* ---------------------------------------------------------------------- natoms * MDI_LABEL_LENGTH]; memset(labels,' ',atom->natoms * MDI_LABEL_LENGTH); - // NOTE: this loop will not work in parallel + memset(ibuf1,0,atom->natoms*sizeof(int)); - for (int iatom = 0; iatom < atom->natoms; iatom++) { - std::string label = std::to_string(atom->type[iatom]); - int label_len = std::min(int(label.length()), MDI_LABEL_LENGTH); - strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); + // use atomID to index into ordered ibuf1 + + tagint *tag = atom->tag; + int *type = atom->type; + int nlocal = atom->nlocal; + + int ilocal; + + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + ibuf1[ilocal] = type[i]; + } + + MPI_Reduce(ibuf1,ibuf1all,atom->natoms,MPI_INT,MPI_SUM,0,world); + + if (comm->me == 0) { + for (int iatom = 0; iatom < atom->natoms; iatom++) { + std::string label = std::to_string(ibuf1all[iatom]); + int label_len = std::min(int(label.length()), MDI_LABEL_LENGTH); + strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); + } } int ierr = MDI_Send(labels,atom->natoms*MDI_LABEL_LENGTH,MDI_CHAR,mdicomm); @@ -1379,7 +1411,7 @@ void MDIEngine::send_int1(int which) { memset(ibuf1,0,atom->natoms*sizeof(int)); - // use atomID to index into ordered buf1 + // use atomID to index into ordered ibuf1 tagint *tag = atom->tag; int nlocal = atom->nlocal; diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index 99a768271c..41dfa61bf3 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -38,8 +38,6 @@ class MDIEngine : public Command { int lmpunits; // REAL or METAL or NATIVE int root; // 1 for proc 0, otherwise 0 - int enable_fix; // 1 if mdi engine command asked for node support - // state of MDI engine int mode; // which mode engine is in (DEFAULT,MD,OPTG,etc) @@ -50,12 +48,10 @@ class MDIEngine : public Command { bool exit_command; // true if EXIT command received from driver MDI_Comm mdicomm; - class FixMDIEngine *mdi_fix; char *id_ke,*id_pe,*id_press; - class Irregular *irregular; - class Minimize *minimizer; class Compute *ke,*pe,*press; + class Irregular *irregular; // unit conversion factors From 274db39aa55af2fc39f8d13f5c0ae91b3e421d7a Mon Sep 17 00:00:00 2001 From: davidfir3 <491197586@qq.com> Date: Fri, 25 Mar 2022 22:41:39 +0800 Subject: [PATCH 029/130] demo of new compute style fep/ta --- src/FEP/compute_fep_ta.cpp | 465 +++++++++++++------------------------ src/FEP/compute_fep_ta.h | 59 ++--- 2 files changed, 180 insertions(+), 344 deletions(-) diff --git a/src/FEP/compute_fep_ta.cpp b/src/FEP/compute_fep_ta.cpp index 787c8a29e6..cc301a0ac5 100644 --- a/src/FEP/compute_fep_ta.cpp +++ b/src/FEP/compute_fep_ta.cpp @@ -13,10 +13,10 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Agilio Padua (ENS de Lyon & CNRS) + Contributing author: Shifeng Ke (Zhejiang University) ------------------------------------------------------------------------- */ -#include "compute_fep.h" +#include "compute_fep_ta.h" #include "atom.h" #include "comm.h" @@ -24,34 +24,31 @@ #include "error.h" #include "fix.h" #include "force.h" -#include "input.h" #include "kspace.h" #include "memory.h" #include "modify.h" +#include "neighbor.h" #include "pair.h" -#include "pair_hybrid.h" #include "timer.h" #include "update.h" -#include "variable.h" #include #include using namespace LAMMPS_NS; -enum{PAIR,ATOM}; -enum{CHARGE}; +enum{X,Y,Z}; /* ---------------------------------------------------------------------- */ -ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : +ComputeFEPTA::ComputeFEPTA(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) { - if (narg < 5) error->all(FLERR,"Illegal number of arguments in compute fep"); + if (narg < 6) error->all(FLERR,"Illegal number of arguments in compute fep/ta"); scalar_flag = 0; vector_flag = 1; - size_vector = 3; + size_vector = 2; extvector = 0; vector = new double[size_vector]; @@ -60,93 +57,39 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : temp_fep = utils::numeric(FLERR,arg[3],false,lmp); - // count # of perturbations + if (strcmp(arg[4],"xy") == 0) { + tan_axis1 = X; + tan_axis2 = Y; + norm_axis = Z; + } else if (strcmp(arg[4],"xz") == 0) { + tan_axis1 = X; + tan_axis2 = Z; + norm_axis = Y; + } else if (strcmp(arg[4],"yz") == 0) { + tan_axis1 = Y; + tan_axis2 = Z; + norm_axis = X; + } else error->all(FLERR,"Illegal arguments in compute fep/ta"); - npert = 0; - int iarg = 4; - while (iarg < narg) { - if (strcmp(arg[iarg],"pair") == 0) { - if (iarg+6 > narg) error->all(FLERR, - "Illegal pair attribute in compute fep"); - npert++; - iarg += 6; - } else if (strcmp(arg[iarg],"atom") == 0) { - if (iarg+4 > narg) error->all(FLERR, - "Illegal atom attribute in compute fep"); - npert++; - iarg += 4; - } else break; - } - - if (npert == 0) error->all(FLERR,"Illegal syntax in compute fep"); - perturb = new Perturb[npert]; - - // parse keywords - - npert = 0; - chgflag = 0; - - iarg = 4; - while (iarg < narg) { - if (strcmp(arg[iarg],"pair") == 0) { - perturb[npert].which = PAIR; - perturb[npert].pstyle = utils::strdup(arg[iarg+1]); - perturb[npert].pparam = utils::strdup(arg[iarg+2]); - utils::bounds(FLERR,arg[iarg+3],1,atom->ntypes, - perturb[npert].ilo,perturb[npert].ihi,error); - utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, - perturb[npert].jlo,perturb[npert].jhi,error); - if (utils::strmatch(arg[iarg+5],"^v_")) { - perturb[npert].var = utils::strdup(arg[iarg+5]+2); - } else error->all(FLERR,"Illegal variable in compute fep"); - npert++; - iarg += 6; - } else if (strcmp(arg[iarg],"atom") == 0) { - perturb[npert].which = ATOM; - if (strcmp(arg[iarg+1],"charge") == 0) { - perturb[npert].aparam = CHARGE; - chgflag = 1; - } else error->all(FLERR,"Illegal atom argument in compute fep"); - utils::bounds(FLERR,arg[iarg+2],1,atom->ntypes, - perturb[npert].ilo,perturb[npert].ihi,error); - if (utils::strmatch(arg[iarg+3],"^v_")) { - perturb[npert].var = utils::strdup(arg[iarg+3]+2); - } else error->all(FLERR,"Illegal variable in compute fep"); - npert++; - iarg += 4; - } else break; - } + scale_factor = utils::numeric(FLERR,arg[5],false,lmp); // optional keywords tailflag = 0; - volumeflag = 0; + int iarg = 6; while (iarg < narg) { if (strcmp(arg[iarg],"tail") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword in compute fep"); + if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword in compute fep/ta"); tailflag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; - } else if (strcmp(arg[iarg],"volume") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword in compute fep"); - volumeflag = utils::logical(FLERR,arg[iarg+1],false,lmp); - iarg += 2; - } else - error->all(FLERR,"Illegal optional keyword in compute fep"); + } else error->all(FLERR,"Illegal optional keyword in compute fep/ta"); } - // allocate pair style arrays - - int ntype = atom->ntypes; - for (int m = 0; m < npert; m++) { - if (perturb[m].which == PAIR) - memory->create(perturb[m].array_orig,ntype+1,ntype+1,"fep:array_orig"); - } - - // allocate space for charge, force, energy, virial arrays + // allocate space for position, charge, force, energy, virial arrays + x_orig = nullptr; f_orig = nullptr; - q_orig = nullptr; peatom_orig = keatom_orig = nullptr; pvatom_orig = kvatom_orig = nullptr; @@ -157,26 +100,16 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -ComputeFEP::~ComputeFEP() +ComputeFEPTA::~ComputeFEPTA() { delete [] vector; - for (int m = 0; m < npert; m++) { - delete [] perturb[m].var; - if (perturb[m].which == PAIR) { - delete [] perturb[m].pstyle; - delete [] perturb[m].pparam; - memory->destroy(perturb[m].array_orig); - } - } - delete [] perturb; - deallocate_storage(); } /* ---------------------------------------------------------------------- */ -void ComputeFEP::init() +void ComputeFEPTA::init() { int i,j; @@ -188,53 +121,9 @@ void ComputeFEP::init() pairflag = 0; - for (int m = 0; m < npert; m++) { - Perturb *pert = &perturb[m]; - - pert->ivar = input->variable->find(pert->var); - if (pert->ivar < 0) - error->all(FLERR,"Variable name for compute fep does not exist"); - if (!input->variable->equalstyle(pert->ivar)) - error->all(FLERR,"Variable for compute fep is of invalid style"); - - if (force->pair == nullptr) - error->all(FLERR,"compute fep pair requires pair interactions"); - - if (pert->which == PAIR) { - pairflag = 1; - - Pair *pair = force->pair_match(pert->pstyle,1); - if (pair == nullptr) error->all(FLERR,"compute fep pair style " - "does not exist"); - void *ptr = pair->extract(pert->pparam,pert->pdim); - if (ptr == nullptr) - error->all(FLERR,"compute fep pair style param not supported"); - - pert->array = (double **) ptr; - - // if pair hybrid, test that ilo,ihi,jlo,jhi are valid for sub-style - - if ((strcmp(force->pair_style,"hybrid") == 0 || - strcmp(force->pair_style,"hybrid/overlay") == 0)) { - PairHybrid *pair = (PairHybrid *) force->pair; - for (i = pert->ilo; i <= pert->ihi; i++) - for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) - if (!pair->check_ijtype(i,j,pert->pstyle)) - error->all(FLERR,"compute fep type pair range is not valid for " - "pair hybrid sub-style"); - } - - } else if (pert->which == ATOM) { - if (pert->aparam == CHARGE) { - if (!atom->q_flag) - error->all(FLERR,"compute fep requires atom attribute charge"); - } - } - } - if (tailflag) { if (force->pair->tail_flag == 0) - error->all(FLERR,"Compute fep tail when pair style does not " + error->all(FLERR,"Compute fep/ta tail when pair style does not " "compute tail corrections"); } @@ -245,32 +134,16 @@ void ComputeFEP::init() if (comm->me == 0) { if (screen) { - fprintf(screen, "FEP settings ...\n"); + fprintf(screen, "FEP/TA settings ...\n"); fprintf(screen, " temperature = %f\n", temp_fep); + fprintf(screen, " scale factor = %f\n", scale_factor); fprintf(screen, " tail %s\n", (tailflag ? "yes":"no")); - for (int m = 0; m < npert; m++) { - Perturb *pert = &perturb[m]; - if (pert->which == PAIR) - fprintf(screen, " pair %s %s %d-%d %d-%d\n", pert->pstyle, - pert->pparam, - pert->ilo, pert->ihi, pert->jlo, pert->jhi); - else if (pert->which == ATOM) - fprintf(screen, " atom charge %d-%d\n", pert->ilo, pert->ihi); - } } if (logfile) { - fprintf(logfile, "FEP settings ...\n"); + fprintf(logfile, "FEP/TA settings ...\n"); fprintf(logfile, " temperature = %f\n", temp_fep); + fprintf(screen, " scale factor = %f\n", scale_factor); fprintf(logfile, " tail %s\n", (tailflag ? "yes":"no")); - for (int m = 0; m < npert; m++) { - Perturb *pert = &perturb[m]; - if (pert->which == PAIR) - fprintf(logfile, " pair %s %s %d-%d %d-%d\n", pert->pstyle, - pert->pparam, - pert->ilo, pert->ihi, pert->jlo, pert->jhi); - else if (pert->which == ATOM) - fprintf(logfile, " atom charge %d-%d\n", pert->ilo, pert->ihi); - } } } @@ -279,7 +152,7 @@ void ComputeFEP::init() /* ---------------------------------------------------------------------- */ -void ComputeFEP::compute_vector() +void ComputeFEPTA::compute_vector() { double pe0,pe1; @@ -293,15 +166,15 @@ void ComputeFEP::compute_vector() allocate_storage(); } - backup_qfev(); // backup charge, force, energy, virial array values - backup_params(); // backup pair parameters + backup_xfev(); // backup position, force, energy, virial array values + backup_box(); // backup box size timer->stamp(); if (force->pair && force->pair->compute_flag) { force->pair->compute(eflag,vflag); timer->stamp(Timer::PAIR); } - if (chgflag && force->kspace && force->kspace->compute_flag) { + if (force->kspace && force->kspace->compute_flag) { force->kspace->compute(eflag,vflag); timer->stamp(Timer::KSPACE); } @@ -311,14 +184,14 @@ void ComputeFEP::compute_vector() pe0 = compute_epair(); - perturb_params(); + change_box(); timer->stamp(); if (force->pair && force->pair->compute_flag) { force->pair->compute(eflag,vflag); timer->stamp(Timer::PAIR); } - if (chgflag && force->kspace && force->kspace->compute_flag) { + if (force->kspace && force->kspace->compute_flag) { force->kspace->compute(eflag,vflag); timer->stamp(Timer::KSPACE); } @@ -330,14 +203,11 @@ void ComputeFEP::compute_vector() pe1 = compute_epair(); - restore_qfev(); // restore charge, force, energy, virial array values - restore_params(); // restore pair parameters + restore_xfev(); // restore position, force, energy, virial array values + restore_box(); // restore box size vector[0] = pe1-pe0; vector[1] = exp(-(pe1-pe0)/(force->boltz*temp_fep)); - vector[2] = domain->xprd * domain->yprd * domain->zprd; - if (volumeflag) - vector[1] *= vector[2]; } @@ -345,7 +215,7 @@ void ComputeFEP::compute_vector() obtain pair energy from lammps accumulators ------------------------------------------------------------------------- */ -double ComputeFEP::compute_epair() +double ComputeFEPTA::compute_epair() { double eng, eng_pair; @@ -359,145 +229,130 @@ double ComputeFEP::compute_epair() eng_pair += force->pair->etail / volume; } - if (chgflag && force->kspace) eng_pair += force->kspace->energy; + if (force->kspace) eng_pair += force->kspace->energy; return eng_pair; } /* ---------------------------------------------------------------------- - apply perturbation to pair, atom parameters based on variable evaluation + apply changes to box ------------------------------------------------------------------------- */ -void ComputeFEP::perturb_params() +void ComputeFEPTA::change_box() { - int i,j; + // insure atoms are in current box + domain->pbc(); - for (int m = 0; m < npert; m++) { - Perturb *pert = &perturb[m]; + int i; + double **x = atom->x; + int nlocal = atom->nlocal; + for (i = 0; i < nlocal; i++) + domain->x2lamda(x[i],x[i]); - double delta = input->variable->compute_equal(pert->ivar); + domain->boxhi[tan_axis1] *= sqrt(scale_factor); + domain->boxlo[tan_axis1] *= sqrt(scale_factor); + domain->boxhi[tan_axis2] *= sqrt(scale_factor); + domain->boxlo[tan_axis2] *= sqrt(scale_factor); + domain->boxhi[norm_axis] /= scale_factor; + domain->boxlo[norm_axis] /= scale_factor; + + domain->set_global_box(); + domain->set_local_box(); - if (pert->which == PAIR) { // modify pair parameters - for (i = pert->ilo; i <= pert->ihi; i++) - for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) - pert->array[i][j] = pert->array_orig[i][j] + delta; + // remap atom position + for (i = 0; i < nlocal; i++) + domain->lamda2x(x[i],x[i]); - } else if (pert->which == ATOM) { + comm->setup(); + neighbor->setup_bins(); + if (modify->n_pre_neighbor) modify->setup_pre_neighbor(); + neighbor->build(1); + if (modify->n_post_neighbor) modify->setup_post_neighbor(); - if (pert->aparam == CHARGE) { // modify charges - int *atype = atom->type; - double *q = atom->q; - int *mask = atom->mask; - int natom = atom->nlocal + atom->nghost; - - for (i = 0; i < natom; i++) - if (atype[i] >= pert->ilo && atype[i] <= pert->ihi) - if (mask[i] & groupbit) - q[i] += delta; - - } - } - } - - // re-initialize pair styles if any PAIR settings were changed - // this resets other coeffs that may depend on changed values, - // and also offset and tail corrections - - if (pairflag) force->pair->reinit(); - - // reset KSpace charges if charges have changed - - if (chgflag && force->kspace) force->kspace->qsum_qsq(); + if (force->kspace) force->kspace->setup(); } /* ---------------------------------------------------------------------- - backup pair parameters + backup box size ------------------------------------------------------------------------- */ -void ComputeFEP::backup_params() +void ComputeFEPTA::backup_box() { - int i,j; - - for (int m = 0; m < npert; m++) { - Perturb *pert = &perturb[m]; - if (pert->which == PAIR) { - for (i = pert->ilo; i <= pert->ihi; i++) - for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) - pert->array_orig[i][j] = pert->array[i][j]; - } + for (int i=0; i < domain->dimension; i++) { + boxhi_orig[i] = domain->boxhi[i]; + boxlo_orig[i] = domain->boxlo[i]; } + + area_orig = domain->prd[tan_axis1]*domain->prd[tan_axis2]; } /* ---------------------------------------------------------------------- - restore pair parameters to original values + restore box size to original values ------------------------------------------------------------------------- */ -void ComputeFEP::restore_params() +void ComputeFEPTA::restore_box() { - int i,j; - - for (int m = 0; m < npert; m++) { - Perturb *pert = &perturb[m]; - if (pert->which == PAIR) { - for (i = pert->ilo; i <= pert->ihi; i++) - for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) - pert->array[i][j] = pert->array_orig[i][j]; - } + for (int i=0; i < domain->dimension; i++) { + domain->boxhi[i] = boxhi_orig[i]; + domain->boxlo[i] = boxlo_orig[i]; } + + domain->set_global_box(); + domain->set_local_box(); - if (pairflag) force->pair->reinit(); + comm->setup(); + neighbor->setup_bins(); + if (modify->n_pre_neighbor) modify->setup_pre_neighbor(); + neighbor->build(1); + if (modify->n_post_neighbor) modify->setup_post_neighbor(); - // reset KSpace charges if charges have changed - - if (chgflag && force->kspace) force->kspace->qsum_qsq(); + if (force->kspace) force->kspace->setup(); } /* ---------------------------------------------------------------------- - manage storage for charge, force, energy, virial arrays + manage storage for position, force, energy, virial arrays ------------------------------------------------------------------------- */ -void ComputeFEP::allocate_storage() +void ComputeFEPTA::allocate_storage() { nmax = atom->nmax; + memory->create(x_orig,nmax,3,"fep:x_orig"); memory->create(f_orig,nmax,3,"fep:f_orig"); memory->create(peatom_orig,nmax,"fep:peatom_orig"); memory->create(pvatom_orig,nmax,6,"fep:pvatom_orig"); - if (chgflag) { - memory->create(q_orig,nmax,"fep:q_orig"); - if (force->kspace) { - memory->create(keatom_orig,nmax,"fep:keatom_orig"); - memory->create(kvatom_orig,nmax,6,"fep:kvatom_orig"); - } + if (force->kspace) { + memory->create(keatom_orig,nmax,"fep:keatom_orig"); + memory->create(kvatom_orig,nmax,6,"fep:kvatom_orig"); } } /* ---------------------------------------------------------------------- */ -void ComputeFEP::deallocate_storage() +void ComputeFEPTA::deallocate_storage() { + memory->destroy(x_orig); memory->destroy(f_orig); memory->destroy(peatom_orig); memory->destroy(pvatom_orig); - memory->destroy(q_orig); memory->destroy(keatom_orig); memory->destroy(kvatom_orig); + x_orig = nullptr; f_orig = nullptr; - q_orig = nullptr; peatom_orig = keatom_orig = nullptr; pvatom_orig = kvatom_orig = nullptr; } /* ---------------------------------------------------------------------- - backup and restore arrays with charge, force, energy, virial + backup and restore arrays with position, force, energy, virial ------------------------------------------------------------------------- */ -void ComputeFEP::backup_qfev() +void ComputeFEPTA::backup_xfev() { int i; @@ -506,6 +361,13 @@ void ComputeFEP::backup_qfev() if (force->newton || force->kspace->tip4pflag) natom += atom->nghost; + double **x = atom->x; + for (i = 0; i < natom; i++) { + x_orig[i][0] = x[i][0]; + x_orig[i][1] = x[i][1]; + x_orig[i][2] = x[i][2]; + } + double **f = atom->f; for (i = 0; i < natom; i++) { f_orig[i][0] = f[i][0]; @@ -540,35 +402,29 @@ void ComputeFEP::backup_qfev() } } - if (chgflag) { - double *q = atom->q; - for (i = 0; i < nall; i++) - q_orig[i] = q[i]; + if (force->kspace) { + energy_orig = force->kspace->energy; + kvirial_orig[0] = force->kspace->virial[0]; + kvirial_orig[1] = force->kspace->virial[1]; + kvirial_orig[2] = force->kspace->virial[2]; + kvirial_orig[3] = force->kspace->virial[3]; + kvirial_orig[4] = force->kspace->virial[4]; + kvirial_orig[5] = force->kspace->virial[5]; - if (force->kspace) { - energy_orig = force->kspace->energy; - kvirial_orig[0] = force->kspace->virial[0]; - kvirial_orig[1] = force->kspace->virial[1]; - kvirial_orig[2] = force->kspace->virial[2]; - kvirial_orig[3] = force->kspace->virial[3]; - kvirial_orig[4] = force->kspace->virial[4]; - kvirial_orig[5] = force->kspace->virial[5]; - - if (update->eflag_atom) { - double *keatom = force->kspace->eatom; - for (i = 0; i < natom; i++) - keatom_orig[i] = keatom[i]; - } - if (update->vflag_atom) { - double **kvatom = force->kspace->vatom; - for (i = 0; i < natom; i++) { - kvatom_orig[i][0] = kvatom[i][0]; - kvatom_orig[i][1] = kvatom[i][1]; - kvatom_orig[i][2] = kvatom[i][2]; - kvatom_orig[i][3] = kvatom[i][3]; - kvatom_orig[i][4] = kvatom[i][4]; - kvatom_orig[i][5] = kvatom[i][5]; - } + if (update->eflag_atom) { + double *keatom = force->kspace->eatom; + for (i = 0; i < natom; i++) + keatom_orig[i] = keatom[i]; + } + if (update->vflag_atom) { + double **kvatom = force->kspace->vatom; + for (i = 0; i < natom; i++) { + kvatom_orig[i][0] = kvatom[i][0]; + kvatom_orig[i][1] = kvatom[i][1]; + kvatom_orig[i][2] = kvatom[i][2]; + kvatom_orig[i][3] = kvatom[i][3]; + kvatom_orig[i][4] = kvatom[i][4]; + kvatom_orig[i][5] = kvatom[i][5]; } } } @@ -576,7 +432,7 @@ void ComputeFEP::backup_qfev() /* ---------------------------------------------------------------------- */ -void ComputeFEP::restore_qfev() +void ComputeFEPTA::restore_xfev() { int i; @@ -585,6 +441,13 @@ void ComputeFEP::restore_qfev() if (force->newton || force->kspace->tip4pflag) natom += atom->nghost; + double **x = atom->x; + for (i = 0; i < natom; i++) { + x[i][0] = x_orig[i][0]; + x[i][1] = x_orig[i][1]; + x[i][2] = x_orig[i][2]; + } + double **f = atom->f; for (i = 0; i < natom; i++) { f[i][0] = f_orig[i][0]; @@ -619,35 +482,29 @@ void ComputeFEP::restore_qfev() } } - if (chgflag) { - double *q = atom->q; - for (i = 0; i < nall; i++) - q[i] = q_orig[i]; + if (force->kspace) { + force->kspace->energy = energy_orig; + force->kspace->virial[0] = kvirial_orig[0]; + force->kspace->virial[1] = kvirial_orig[1]; + force->kspace->virial[2] = kvirial_orig[2]; + force->kspace->virial[3] = kvirial_orig[3]; + force->kspace->virial[4] = kvirial_orig[4]; + force->kspace->virial[5] = kvirial_orig[5]; - if (force->kspace) { - force->kspace->energy = energy_orig; - force->kspace->virial[0] = kvirial_orig[0]; - force->kspace->virial[1] = kvirial_orig[1]; - force->kspace->virial[2] = kvirial_orig[2]; - force->kspace->virial[3] = kvirial_orig[3]; - force->kspace->virial[4] = kvirial_orig[4]; - force->kspace->virial[5] = kvirial_orig[5]; - - if (update->eflag_atom) { - double *keatom = force->kspace->eatom; - for (i = 0; i < natom; i++) - keatom[i] = keatom_orig[i]; - } - if (update->vflag_atom) { - double **kvatom = force->kspace->vatom; - for (i = 0; i < natom; i++) { - kvatom[i][0] = kvatom_orig[i][0]; - kvatom[i][1] = kvatom_orig[i][1]; - kvatom[i][2] = kvatom_orig[i][2]; - kvatom[i][3] = kvatom_orig[i][3]; - kvatom[i][4] = kvatom_orig[i][4]; - kvatom[i][5] = kvatom_orig[i][5]; - } + if (update->eflag_atom) { + double *keatom = force->kspace->eatom; + for (i = 0; i < natom; i++) + keatom[i] = keatom_orig[i]; + } + if (update->vflag_atom) { + double **kvatom = force->kspace->vatom; + for (i = 0; i < natom; i++) { + kvatom[i][0] = kvatom_orig[i][0]; + kvatom[i][1] = kvatom_orig[i][1]; + kvatom[i][2] = kvatom_orig[i][2]; + kvatom[i][3] = kvatom_orig[i][3]; + kvatom[i][4] = kvatom_orig[i][4]; + kvatom[i][5] = kvatom_orig[i][5]; } } } diff --git a/src/FEP/compute_fep_ta.h b/src/FEP/compute_fep_ta.h index 8f576124e0..04bcf23bb3 100644 --- a/src/FEP/compute_fep_ta.h +++ b/src/FEP/compute_fep_ta.h @@ -12,40 +12,43 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Agilio Padua (ENS de Lyon & CNRS) + Contributing author: Shifeng Ke (Zhejiang University) ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS // clang-format off -ComputeStyle(fep,ComputeFEP); +ComputeStyle(fep/ta,ComputeFEPTA); // clang-format on #else -#ifndef COMPUTE_FEP_H -#define COMPUTE_FEP_H +#ifndef COMPUTE_FEP_TA_H +#define COMPUTE_FEP_TA_H #include "compute.h" namespace LAMMPS_NS { -class ComputeFEP : public Compute { +class ComputeFEPTA : public Compute { public: - ComputeFEP(class LAMMPS *, int, char **); - ~ComputeFEP() override; + ComputeFEPTA(class LAMMPS *, int, char **); // compute ID groupID fep/ta temp xy/xz/yz scale_factor + ~ComputeFEPTA() override; void init() override; void compute_vector() override; private: - int npert; int pairflag; - int chgflag; - int tailflag, volumeflag; + int tailflag; int fepinitflag; int eflag, vflag; double temp_fep; + double scale_factor; + int tan_axis1, tan_axis2, norm_axis; + + double boxlo_orig[3], boxhi_orig[3]; + double area_orig; int nmax; - double *q_orig; + double **x_orig; double **f_orig; double eng_vdwl_orig, eng_coul_orig; double pvirial_orig[6]; @@ -56,26 +59,14 @@ class ComputeFEP : public Compute { class Fix *fixgpu; - struct Perturb { - int which, ivar; - char *var; - char *pstyle, *pparam; - int ilo, ihi, jlo, jhi; - int pdim; - double **array, **array_orig; - int aparam; - }; - - Perturb *perturb; - double compute_epair(); - void perturb_params(); - void backup_params(); - void restore_params(); + void change_box(); + void backup_box(); + void restore_box(); void allocate_storage(); void deallocate_storage(); - void backup_qfev(); - void restore_qfev(); + void backup_xfev(); + void restore_xfev(); }; } // namespace LAMMPS_NS @@ -91,18 +82,6 @@ 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: Variable name for compute fep does not exist - -Self-explanatory. - -E: Variable for compute fep is invalid style - -Self-explanatory. - -E: Compute fep pair style does not exist - -Self-explanatory. - E: Energy was not tallied on needed timestep You are using a thermo keyword that requires potentials to From 055fefc54220da59f301cdd15ab593465947cedb Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 25 Mar 2022 15:07:38 -0600 Subject: [PATCH 030/130] finished MDI engine and test script debugging --- examples/mdi/README | 82 ++++++- examples/mdi/aimd_driver.py | 255 ++++++++++++++++++++ examples/mdi/in.aimd.mm | 23 ++ examples/mdi/in.aimd.qm | 22 ++ examples/mdi/sequence_driver.py | 19 +- src/MDI/fix_mdi_aimd.cpp | 3 +- src/MDI/mdi_engine.cpp | 397 ++++++++++++++------------------ src/MDI/mdi_engine.h | 51 ++-- 8 files changed, 564 insertions(+), 288 deletions(-) create mode 100644 examples/mdi/aimd_driver.py create mode 100644 examples/mdi/in.aimd.mm create mode 100644 examples/mdi/in.aimd.qm diff --git a/examples/mdi/README b/examples/mdi/README index 81999ae9f7..0b67d50217 100644 --- a/examples/mdi/README +++ b/examples/mdi/README @@ -21,8 +21,8 @@ The example run commands below have variants for these options. ------------------------------------------------- ------------------------------------------------- -* Example #1 = AIMD with LAMMPS as both a driver and engine - As an engine, LAMMPS is acting as a surrogate for a quantum code. +* Example #1 = run AIMD with 2 instances of LAMMPS as driver and engine + as an engine, LAMMPS is a surrogate for a quantum code Note that the 2 input scripts in.aimd.alone and in.aimd.driver have an option for running in NVE vs NPT mode. Comment in/out @@ -32,10 +32,13 @@ changed in the 3rd input script in.aimd.engine. --- Run the entire calculation with a single instance of LAMMPS by itself - results should be identical to running in driver/engine mode + results should be identical to running this example with MDI % lmp_mpi < in.aimd.alone +With MDI, the thermo output of the driver should match the thermo +output of the in.aimd.alone script. + --- Run with TCP: 1 proc each @@ -67,14 +70,14 @@ Run with MPI: 3 procs + 4 procs ------------------------------------------------- ------------------------------------------------- -* Example #2 = Use a Python driver code to run a sequence of independent - LAMMPS calculations +* Example #2 = Python driver runs sequence of unrelated LAMMPS calculations + calcs can be single-point, MD runs, or minimizations -Note that the sequence_driver.py code allows for optional switches in -addition to -mdi (required) and the -plugin and -plugin_args swithces -which are used to link to an engine as a plugin library. The example -run commands below just usu the default values fo rhte optional -switches. They are also explained the top of the file; the info is +The sequence_driver.py code allows for optional switches in addition +to -mdi (required) and the -plugin and -plugin_args switches which are +used to link to an engine as a plugin library. The example run +commands below just use the default values of the optional switches. +The switches are also explained the top of the file; the info is copied here: # -n 10 @@ -139,3 +142,62 @@ mpiexec -n 1 python3 plugin_driver.py --plugin_name "lammps" --mdi "-role DRIVER Run in plugin mode: 3 procs % mpirun -np 3 python3 sequence_driver.py -plugin lammps -mdi "-role DRIVER -name sequence -method LINK -plugin_path /home/sjplimp/lammps/git/src" -plugin_args "-log log.sequence -in in.sequence" + +------------------------------------------------- +------------------------------------------------- + +* Example #3 = run AIMD with Python driver code and 2 LAMMPS instances + first LAMMPS instance is MM = performs MD timesteps + second LAMMPS instance is surrogate QM = computes forces + +The aimd_driver.py code allows for an optional switch in addition to +-mdi (required) and the -plugin and -plugin_args swiches which are +used to link to the 2 engines as a plugin libraries. The example run +commands below use the default values of the optional switch. The +switches are also explained the top of the file; the info is copied +here: + +# -nsteps 5 +# number of timesteps in dynamics runs, default = 5 + +--- + +Run the entire calculation with a single instance of LAMMPS by itself + results should be identical to running this example with MDI + +% lmp_mpi < in.aimd.alone + +With MDI, the driver prints the QM and Total energies. These should +match the PotEng and TotEng output of the in.aimd.alone script. + +--- + +Run with TCP: 1 proc each + +% python3 aimd_driver.py -mdi "-role DRIVER -name aimd -method TCP -port 8021" + +% lmp_mpi -mdi "-role ENGINE -name MM -method TCP -port 8021 -hostname localhost" -log log.aimd.mm -in in.aimd.mm + +% lmp_mpi -mdi "-role ENGINE -name QM -method TCP -port 8021 -hostname localhost" -log log.aimd.qm -in in.aimd.qm + +--- + +Run with TCP: 2 procs + 2 procs + 3 procs + +% mpirun -np 2 python3 aimd_driver.py -mdi "-role DRIVER -name aimd -method TCP -port 8021" + +% mpirun -np 2 lmp_mpi -mdi "-role ENGINE -name MM -method TCP -port 8021 -hostname localhost" -log log.aimd.mm -in in.aimd.mm + +% mpirun -np 3 lmp_mpi -mdi "-role ENGINE -name QM -method TCP -port 8021 -hostname localhost" -log log.aimd.qm -in in.aimd.qm + +--- + +Run with MPI: 1 proc each + +% mpirun -np 1 python3 aimd_driver.py -mdi "-role DRIVER -name aimd -method MPI" : -np 1 lmp_mpi -mdi "-role ENGINE -name MM -method MPI" -log log.aimd.mm -in in.aimd.mm : -np 1 lmp_mpi -mdi "-role ENGINE -name QM -method MPI" -log log.aimd.qm -in in.aimd.qm + +--- + +Run with MPI: 2 procs + 2 procs + 3 procs + +% mpirun -np 2 python3 aimd_driver.py -mdi "-role DRIVER -name aimd -method MPI" : -np 2 lmp_mpi -mdi "-role ENGINE -name MM -method MPI" -log log.aimd.mm -in in.aimd.mm : -np 3 lmp_mpi -mdi "-role ENGINE -name QM -method MPI" -log log.aimd.qm -in in.aimd.qm diff --git a/examples/mdi/aimd_driver.py b/examples/mdi/aimd_driver.py new file mode 100644 index 0000000000..2d8fe10c1a --- /dev/null +++ b/examples/mdi/aimd_driver.py @@ -0,0 +1,255 @@ +# MDI driver to perform an AIMD simulation +# using one instance of LAMMPS as the MD timestepper +# using second instance of LAMMPS as a QM surrogate to compute forces + +# NOTE: this script is derived from the MDI_AIMD_Driver.cpp code +# included in the MDI distribution +# it alters the timestepping to match a velocity Verlet algorithm +# forces are computed once before timestepping beings +# both the @COORDS and @FORCES nodes are triggered in the MM code +# as the appropriate places to extract COORDS and provide FORCES + +# Syntax: python3 aimd_driver.py switch arg switch arg ... +# possible switches: +# -mdi "-role DRIVER ..." +# required switch +# example for stand-alone mode: +# -mdi "-role DRIVER -name sequence -method TCP -port 8021" +# example for plugin mode: +# -mdi "-role DRIVER -name sequemce -method LINK +# -plugin_path /home/sjplimp/lammps/src/" +# -plugin name +# name of plugin library, only when using plugin mode +# -plugin_args arglist +# args to add when launching plugin library, only when using plugin mode +# enclose arglist in quotes if multiple words +# -nsteps 5 +# number of timesteps, default = 5 + +import sys,math,random +import mdi +import numpy as np +from mpi4py import MPI + +# error message + +def error(txt=None): + if txt: raise Exception(txt) + raise Exception("Syntax: python3 aimd_driver.py switch arg switch arg ...") + +# run an AIMD simulation + +def perform_aimd(world,mm_comm,qm_comm): + + me = world.Get_rank() + nprocs = world.Get_size() + + # receive number of atoms from the MM engine + + mdi.MDI_Send_command("COORDS",qm_comm) + mdi.MDI_Send(coords,3*natoms,mdi.MDI_DOUBLE,qm_comm) + + # get QM potential energy + + mdi.MDI_Send_command("FORCES",mm_comm) + mdi.MDI_Send(forces,3*natoms,mdi.MDI_DOUBLE,mm_comm) + + # get MM kinetic energy + + mdi.MDI_Send_command("COORDS",qm_comm) + mdi.MDI_Send(coords,3*natoms,mdi.MDI_DOUBLE,qm_comm) + + # get QM potential energy + + mdi.MDI_Send_command("FORCES",mm_comm) + mdi.MDI_Send(forces,3*natoms,mdi.MDI_DOUBLE,mm_comm) + + # MM engine proceeds to @ENDSTEP node + # so that KE will be for fully updated velocity + + mdi.MDI_Send_command("@ENDSTEP",mm_comm) + + # get MM kinetic energy + + mdi.MDI_Send_command(" narg: error() + mdiarg = args[iarg+1] + iarg += 2 + elif args[iarg] == "-plugin": + if iarg+2 > narg: error() + plugin = args[iarg+1] + iarg += 2 + elif args[iarg] == "-plugin_args": + if iarg+2 > narg: error() + plugin_args = args[iarg+1] + iarg += 2 + elif args[iarg] == "-nsteps": + if iarg+2 > narg: error() + nsteps = int(args[iarg+1]) + if nsteps < 0: error() + iarg += 2 + else: error() + +if not mdiarg: error() + +# LAMMPS engines are stand-alone codes +# world = MPI communicator for just this driver +# invoke perform_tasks() directly + +if not plugin: + mdi.MDI_Init(mdiarg) + world = mdi.MDI_MPI_get_world_comm() + + # connect to 2 engines, determine which is MM vs QM + + mdicomm1 = mdi.MDI_Accept_Communicator() + mdicomm2 = mdi.MDI_Accept_Communicator() + + mdi.MDI_Send_command("CELL",mdicomm) mdi.MDI_Send(vec,9,mdi.MDI_DOUBLE,mdicomm) - print("POST-CELL") # create atoms on perfect lattice @@ -147,16 +143,13 @@ def perform_tasks(world,mdicomm,dummy): elif mode == "min": mdi.MDI_Send_command("@INIT_OPTG",mdicomm) mdi.MDI_Send_command(">TOLERANCE",mdicomm) - params = [1.0e-4,1.0e-4,100.0,100.0] + params = [tol,tol,1000.0,1000.0] mdi.MDI_Send(params,4,mdi.MDI_DOUBLE,mdicomm) mdi.MDI_Send_command("@DEFAULT",mdicomm) # request potential energy - print("PRE-PE") - mdi.MDI_Send_command("all(FLERR,"MDI: compute[icompute_pe]; press = modify->compute[icompute_press]; + //pe = modify->get_compute_by_id("thermo_pe"); + //press = modify->get_compute_by_id("thermo_press"); + // irregular class used if >COORDS change dramatically irregular = new Irregular(lmp); @@ -167,8 +169,6 @@ void MDIEngine::mdi_engine(int narg, char **arg) MDI_Accept_communicator(&mdicomm); if (mdicomm <= 0) error->all(FLERR,"Unable to connect to MDI driver"); - printf("ENG post accept MDI comm\n"); - // endless engine loop, responding to driver commands mode = DEFAULT; @@ -178,7 +178,7 @@ void MDIEngine::mdi_engine(int narg, char **arg) while (1) { // top-level mdi engine only recognizes three nodes - // DEFAULT, INIT_MD, INIT_OPTG, INIT_SYS, EVAL + // DEFAULT, INIT_MD, INIT_OPTG engine_node("@DEFAULT"); @@ -207,7 +207,6 @@ void MDIEngine::mdi_engine(int narg, char **arg) delete [] node_engine; delete [] node_driver; - modify->delete_compute(id_ke); modify->delete_compute(id_pe); modify->delete_compute(id_press); @@ -232,8 +231,6 @@ void MDIEngine::engine_node(const char *node) { int ierr; - printf("ENG ENODE %s\n",node); - // do not process commands if engine and driver request are not the same strncpy(node_engine,node,MDI_COMMAND_LENGTH); @@ -248,13 +245,9 @@ void MDIEngine::engine_node(const char *node) // read the next command from the driver // all procs call this, but only proc 0 receives the command - printf("ENG PRE-RECV %d\n",mdicomm); - ierr = MDI_Recv_command(mdicmd,mdicomm); if (ierr) error->all(FLERR,"MDI: Unable to receive command from driver"); - printf("ENG POST-RECV %s\n",mdicmd); - // broadcast command to the other MPI tasks MPI_Bcast(mdicmd,MDI_COMMAND_LENGTH,MPI_CHAR,0,world); @@ -299,7 +292,8 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) MPI_Bcast(&command_exists,1,MPI_INT,0,world); if (!command_exists) - error->all(FLERR,"MDI: Received a command unsupported by engine node"); + error->all(FLERR,"MDI: Received command {} unsupported by engine node {}", + command,node_engine); // --------------------------------------- // respond to MDI standard commands @@ -318,6 +312,9 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) } else if (strcmp(command,">COORDS") == 0) { receive_coords(); + } else if (strcmp(command,">FORCES") == 0) { + receive_double3(FORCE); + } else if (strcmp(command,">NATOMS") == 0) { receive_natoms(); @@ -346,11 +343,11 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) send_double3(COORD); } else if (strcmp(command,"etol = std::numeric_limits::max(); - update->ftol = std::numeric_limits::max(); - update->max_eval = 0; - } - } else if (strcmp(command,"@COORDS") == 0) { strncpy(node_driver,command,MDI_COMMAND_LENGTH); node_match = false; @@ -426,14 +415,6 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) } else if (strcmp(command,"EXIT") == 0) { exit_command = true; - // if minimization in progress, force it to quit - - if (mode == OPT) { - update->etol = std::numeric_limits::max(); - update->ftol = std::numeric_limits::max(); - update->max_eval = 0; - } - // ------------------------------------------------------- // custom LAMMPS commands // ------------------------------------------------------- @@ -458,7 +439,7 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) // ------------------------------------------------------- } else { - error->all(FLERR,"MDI: Unknown command received from driver"); + error->all(FLERR,"MDI: Unknown command {} received from driver",command); } return 0; @@ -506,22 +487,13 @@ void MDIEngine::mdi_commands() MDI_Register_command("@DEFAULT", "COMMAND"); MDI_Register_command("@DEFAULT", "COMMANDS"); MDI_Register_command("@DEFAULT", "INFILE"); - MDI_Register_command("@DEFAULT", ">TOLERANCE"); MDI_Register_command("@DEFAULT", "CELL"); - MDI_Register_command("@INIT_MD", ">CELL_DISPL"); - MDI_Register_command("@INIT_MD", ">CHARGES"); - MDI_Register_command("@INIT_MD", ">COORDS"); - MDI_Register_command("@INIT_MD", ">NATOMS"); MDI_Register_command("@INIT_MD", ">NITERATE"); - MDI_Register_command("@INIT_MD", ">TYPES"); - MDI_Register_command("@INIT_MD", ">VELOCITIES"); MDI_Register_command("@INIT_MD", "@"); MDI_Register_command("@INIT_MD", "@DEFAULT"); MDI_Register_command("@INIT_MD", "@COORDS"); @@ -533,24 +505,15 @@ void MDIEngine::mdi_commands() MDI_Register_node("@INIT_OPTG"); MDI_Register_command("@INIT_OPTG", "<@"); - MDI_Register_command("@INIT_OPTG", "CELL"); - MDI_Register_command("@INIT_OPTG", ">CELL_DISPL"); - MDI_Register_command("@INIT_OPTG", ">CHARGES"); - MDI_Register_command("@INIT_OPTG", ">COORDS"); - MDI_Register_command("@INIT_OPTG", ">NATOMS"); MDI_Register_command("@INIT_OPTG", ">TOLERANCE"); - MDI_Register_command("@INIT_OPTG", ">TYPES"); - MDI_Register_command("@INIT_OPTG", ">VELOCITIES"); MDI_Register_command("@INIT_OPTG", "@"); MDI_Register_command("@INIT_OPTG", "@DEFAULT"); MDI_Register_command("@INIT_OPTG", "@COORDS"); MDI_Register_command("@INIT_OPTG", "@FORCES"); - MDI_Register_command("@INIT_OPTG", "@ENDSTEP"); MDI_Register_command("@INIT_OPTG", "EXIT"); // node at POST_INTEGRATE location in timestep - // only if fix MDI/ENGINE is instantiated + // only used if fix MDI/ENGINE is instantiated MDI_Register_node("@COORDS"); MDI_Register_command("@COORDS", "<@"); @@ -564,17 +527,19 @@ void MDIEngine::mdi_commands() MDI_Register_command("@COORDS", "EXIT"); // node at POST_FORCE location in timestep - // only if fix MDI/ENGINE is instantiated + // only used if fix MDI/ENGINE is instantiated MDI_Register_node("@FORCES"); - MDI_Register_command("@FORCES", "<@"); - MDI_Register_command("@FORCES", "FORCES"); MDI_Register_callback("@FORCES", ">+FORCES"); + MDI_Register_command("@FORCES", "<@"); + MDI_Register_command("@FORCES", "FORCES"); MDI_Register_command("@FORCES", "@"); MDI_Register_command("@FORCES", "@DEFAULT"); MDI_Register_command("@FORCES", "@COORDS"); @@ -583,14 +548,15 @@ void MDIEngine::mdi_commands() MDI_Register_command("@FORCES", "EXIT"); // node at END_OF_STEP location in timestep - // only if fix MDI/ENGINE is instantiated + // only used if fix MDI/ENGINE is instantiated MDI_Register_node("@ENDSTEP"); MDI_Register_command("@ENDSTEP", "<@"); - MDI_Register_command("@FORCES", "NITERATE command sets # of timesteps + either for NITERATE steps or one step at a time + latter is controlled by driver ---------------------------------------------------------------------- */ void MDIEngine::mdi_md() { - // engine is now at @INIT_MD node - // receive >NITERATE or other commands driver wishes to send - // @RUN_MD or @DEFAULT command from driver will trigger the simulation - - niterate = 0; - - engine_node("@INIT_MD"); - - if (strcmp(mdicmd,"EXIT") == 0) return; - - // create or update system if requested - // assume only incremental changes in atom coords + // create or update system if requested prior to @INIT_MD int flag_create = flag_natoms | flag_types; if (flag_create) create_system(); @@ -628,40 +584,15 @@ void MDIEngine::mdi_md() if (flag_velocities) adjust_velocities(); } - // perform the MD simulation + // engine is now at @INIT_MD node + // receive >NITERATE command if driver sends, else niterate = -1 + // any @ command from driver will start the simulation - update->whichflag = 1; - timer->init_timeout(); + niterate = -1; - update->nsteps = niterate; - update->beginstep = update->firststep = update->ntimestep; - update->endstep = update->laststep = update->ntimestep + update->nsteps; - - lmp->init(); - update->integrate->setup(1); - - timer->init(); - timer->barrier_start(); - update->integrate->run(niterate); - timer->barrier_stop(); - - update->integrate->cleanup(); + engine_node("@INIT_MD"); + if (strcmp(mdicmd,"EXIT") == 0) return; - engine_node("@RUN_MD"); - - // clear flags - - flag_natoms = flag_types = 0; - flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; -} - -/* ---------------------------------------------------------------------- - run MD simulation under control of driver one step at a time - use of fix MDI/ENGINE allows MDI comm within timesteps ----------------------------------------------------------------------- */ - -void MDIEngine::mdi_md_old() -{ // add an instance of fix MDI/ENGINE // delete the instance before this method returns @@ -670,77 +601,65 @@ void MDIEngine::mdi_md_old() (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); mdi_fix->mdi_engine = this; - // initialize a new MD simulation + // initialize LAMMPS and setup() the simulation + // set nsteps to niterate if >= 0, else set to 1 update->whichflag = 1; timer->init_timeout(); - update->nsteps = 1; - update->ntimestep = 0; - update->firststep = update->ntimestep; - update->laststep = update->ntimestep + update->nsteps; - update->beginstep = update->firststep; - update->endstep = update->laststep; + + update->nsteps = (niterate >= 0) ? niterate : 1; + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->ntimestep + update->nsteps; lmp->init(); - - // engine is now at @INIT_MD node - // receive any commands driver wishes to send - - engine_node("@INIT_MD"); - - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) { - modify->delete_fix("MDI_ENGINE_INTERNAL"); - return; - } - - // setup the MD simulation - update->integrate->setup(1); - // run MD one step at a time until driver sends @DEFAULT or EXIT - // driver can communicate with LAMMPS within each timestep - // by sending a node command which matches a method in FixMDIEngine + timer->init(); + timer->barrier_start(); - while (true) { - update->whichflag = 1; - timer->init_timeout(); - update->nsteps += 1; - update->laststep += 1; - update->endstep = update->laststep; - output->next = update->ntimestep + 1; + // if niterate >= 0, run for niterate steps + // else if niterate < 0: + // run one step at a time forever + // driver triggers exit with @ command other than @COORDS,@FORCES,@ENDSTEP - // single MD timestep + if (niterate >= 0) { + update->integrate->run(niterate); - update->integrate->run(1); + } else { - // driver triggers end of MD loop by sending @DEFAULT or EXIT + while (true) { + update->nsteps += 1; + update->laststep += 1; + update->endstep = update->laststep; + output->next = update->ntimestep + 1; - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) { - modify->delete_fix("MDI_ENGINE_INTERNAL"); - return; + update->integrate->run(1); + + if (strcmp(mdicmd,"@COORDS") != 0 && + strcmp(mdicmd,"@FORCES") != 0 && + strcmp(mdicmd,"@ENDSTEP") != 0) break; } } + + timer->barrier_stop(); + update->integrate->cleanup(); + modify->delete_fix("MDI_ENGINE_INTERNAL"); + + // clear flags + + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; } /* ---------------------------------------------------------------------- - perform minimization for at most Niterate steps - >TOLERANCE command sets tolerances + perform minimization + either to convergence using >TOLERANCE settings or one iteration at a time + latter is controlled by driver ---------------------------------------------------------------------- */ void MDIEngine::mdi_optg() { - // engine is now at @INIT_OPTG node - // receive >TOLERANCE or other commands driver wishes to send - // @DEFAULT command from driver will trigger the minimization - - etol = ftol = 1.0e-6; - niterate = max_eval = 1000; - - engine_node("@INIT_OPTG"); - - if (strcmp(mdicmd,"EXIT") == 0) return; - - // create or update system if requested + // create or update system if requested prior to @INIT_OPTG int flag_create = flag_natoms | flag_types; if (flag_create) create_system(); @@ -751,42 +670,16 @@ void MDIEngine::mdi_optg() if (flag_velocities) adjust_velocities(); } - // perform the minmization + // engine is now at @INIT_OPTG node + // receive >TOLERANCE if driver sends - update->etol = etol; - update->ftol = ftol; - update->nsteps = niterate; - update->max_eval = max_eval; + etol = ftol = 1.0e-6; + niterate = -1; + max_eval = std::numeric_limits::max(); - update->whichflag = 2; - timer->init_timeout(); + engine_node("@INIT_OPTG"); + if (strcmp(mdicmd,"EXIT") == 0) return; - update->beginstep = update->firststep = update->ntimestep; - update->endstep = update->laststep = update->firststep + update->nsteps; - - lmp->init(); - update->minimize->setup(); - - timer->init(); - timer->barrier_start(); - update->minimize->run(update->nsteps); - timer->barrier_stop(); - - update->minimize->cleanup(); - - // clear flags - - flag_natoms = flag_types = 0; - flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; -} - -/* ---------------------------------------------------------------------- - perform minimization under control of driver one iteration at a time - use of fix MDI/ENGINE allows MDI comm within iteration ----------------------------------------------------------------------- */ - -void MDIEngine::mdi_optg_old() -{ // add an instance of fix MDI/ENGINE // delete the instance before this method returns @@ -795,48 +688,60 @@ void MDIEngine::mdi_optg_old() (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); mdi_fix->mdi_engine = this; - // set tolerances to epsilon and iteration limits huge - // allows MDI driver to force an exit - - update->etol = std::numeric_limits::min(); - update->ftol = std::numeric_limits::min(); - update->nsteps = std::numeric_limits::max(); - update->max_eval = std::numeric_limits::max(); + // initialize LAMMPS and setup() the simulation + // set nsteps to niterate if >= 0 via >TOLERANCE, else set to huge value update->whichflag = 2; + timer->init_timeout(); + + update->nsteps = (niterate >= 0) ? niterate : max_eval; update->beginstep = update->firststep = update->ntimestep; update->endstep = update->laststep = update->firststep + update->nsteps; + update->etol = etol; + update->ftol = ftol; + update->max_eval = max_eval; + lmp->init(); - - // engine is now at @INIT_OPTG node - // receive any commands driver wishes to send - - engine_node("@INIT_OPTG"); - - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) { - modify->delete_fix("MDI_ENGINE_INTERNAL"); - return; - } - - // setup the minimization - update->minimize->setup(); - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) return; + timer->init(); + timer->barrier_start(); - // start minimization - // when the driver sends @DEFAULT or EXIT minimizer tolerances are - // set to large values to force it to exit + // if niterate >= 0, minimize for at most niterate iterations + // else if niterate < 0: + // run one iteration at a time forever + // driver triggers exit with @ command other than @COORDS,@FORCES + // two issues with running in this mode: + // @COORDS and @FORCES are not triggered per min iteration + // but also for line search evals + // if driver triggers exit on step that is not multiple of thermo output + // then energy/virial not computed, and minimize->iterate(update->nsteps); + if (niterate >= 0) { + update->minimize->run(niterate); - // return if driver sends @DEFAULT or EXIT + } else { + niterate = std::numeric_limits::max(); + update->etol = 0.0; + update->ftol = 0.0; - if (strcmp(mdicmd,"@DEFAULT") == 0 || strcmp(mdicmd,"EXIT") == 0) { - modify->delete_fix("MDI_ENGINE_INTERNAL"); - return; + while (1) { + update->minimize->run(1); + + if (strcmp(mdicmd,"@COORDS") != 0 && + strcmp(mdicmd,"@FORCES") != 0) break; + } } + + timer->barrier_stop(); + update->minimize->cleanup(); + modify->delete_fix("MDI_ENGINE_INTERNAL"); + + // clear flags + + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; } /* ---------------------------------------------------------------------- @@ -847,14 +752,14 @@ void MDIEngine::mdi_optg_old() void MDIEngine::evaluate() { - // create or update system if requested - int flag_create = flag_natoms | flag_types; + int flag_other = flag_cell | flag_cell_displ | flag_charges | + flag_coords | flag_velocities; + + // create or update system if requested + if (flag_create) create_system(); - else { - int flag_any = flag_cell | flag_cell_displ | flag_charges | - flag_coords | flag_velocities; - if (!flag_any) return; + else if (flag_other) { if (flag_cell || flag_cell_displ) adjust_box(); if (flag_charges) adjust_charges(); if (flag_coords) adjust_coords(); @@ -875,8 +780,8 @@ void MDIEngine::evaluate() // this can only be done if comm->style is not tiled // also requires atoms be in box and lamda coords (for triclinic) // finally invoke setup_minimal(1) to trigger exchange() & reneigh() - // NOTE: what this logic still lacks is invoking migrate_atoms() - // if necessary for comm->style tiled, not easy to detect + // NOTE: what this logic still lacks for comm->style tiled, + // is when to invoke migrate_atoms() if necessary, not easy to detect if (flag_create || neighbor->ago < 0) { update->whichflag = 1; @@ -884,7 +789,7 @@ void MDIEngine::evaluate() update->integrate->setup(1); update->whichflag = 0; - } else { + } else if (flag_other) { update->ntimestep++; pe->addstep(update->ntimestep); press->addstep(update->ntimestep); @@ -933,7 +838,8 @@ void MDIEngine::create_system() if (flag_cell == 0 || flag_natoms == 0 || flag_types == 0 || flag_coords == 0) error->all(FLERR, - "@INIT_SYS requires >CELL, >NATOMS, >TYPES, >COORDS MDI commands"); + "MDI create_system requires >CELL, >NATOMS, >TYPES, >COORDS " + "MDI commands"); // remove all existing atoms via delete_atoms command @@ -1203,6 +1109,37 @@ void MDIEngine::receive_velocities() sys_coords[i] * mdi2lmp_velocity; } +/* ---------------------------------------------------------------------- + >FORCES command + receive vector of 3 doubles for all atoms + atoms are ordered by atomID, 1 to Natoms +---------------------------------------------------------------------- */ + +void MDIEngine::receive_double3(int which) +{ + int n = 3*atom->natoms; + int ierr = MDI_Recv(buf3,n,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: tag; + int nlocal = atom->nlocal; + + int ilocal; + + if (which == FORCE) { + double **f = atom->f; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + f[i][0] = buf3[3*ilocal+0] * mdi2lmp_force; + f[i][1] = buf3[3*ilocal+1] * mdi2lmp_force; + f[i][2] = buf3[3*ilocal+2] * mdi2lmp_force; + } + } +} + // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // MDI "<" driver commands that request data diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index 41dfa61bf3..2e0a619d59 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -35,24 +35,20 @@ class MDIEngine : public Command { void engine_node(const char *node); private: - int lmpunits; // REAL or METAL or NATIVE - int root; // 1 for proc 0, otherwise 0 + int lmpunits; // REAL or METAL or NATIVE + int root; // 1 for proc 0, otherwise 0 + + MDI_Comm mdicomm; // MDI communicator // state of MDI engine - int mode; // which mode engine is in (DEFAULT,MD,OPTG,etc) + int mode; // which mode engine is in (DEFAULT,MD,OPTG) char *mdicmd; // current MDI command being processed char *node_engine; // which node engine is at char *node_driver; // which node driver has requested bool node_match; // true if driver and engine node currently match bool exit_command; // true if EXIT command received from driver - MDI_Comm mdicomm; - - char *id_ke,*id_pe,*id_press; - class Compute *ke,*pe,*press; - class Irregular *irregular; - // unit conversion factors double lmp2mdi_length,mdi2lmp_length; @@ -62,7 +58,8 @@ class MDIEngine : public Command { double lmp2mdi_pressure,mdi2lmp_pressure; double lmp2mdi_virial,mdi2lmp_virial; - // system state for MDI + // flags for data received by engine + // not acted on until a request to send Date: Fri, 25 Mar 2022 16:10:43 -0600 Subject: [PATCH 031/130] doc info in sequence_driver.py --- examples/mdi/sequence_driver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/mdi/sequence_driver.py b/examples/mdi/sequence_driver.py index 55fa2f8daa..c7527cb6d4 100644 --- a/examples/mdi/sequence_driver.py +++ b/examples/mdi/sequence_driver.py @@ -1,5 +1,6 @@ # MDI driver to perform a series of independent calculations -# using LAMMPS as a standalone engine +# using LAMMPS (or a QM code with MDI support) as an MDI engine, +# the engine can be either a standalone code or a plugin library # Syntax: python3 series_driver.py switch arg switch arg ... # possible switches: From dc668ed0df46f44aaff10acc4a9a8e701c6ee50f Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 25 Mar 2022 16:11:17 -0600 Subject: [PATCH 032/130] update to README instructions --- examples/mdi/README | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/mdi/README b/examples/mdi/README index 0b67d50217..4be15c77fc 100644 --- a/examples/mdi/README +++ b/examples/mdi/README @@ -134,9 +134,6 @@ Run in plugin mode: 1 proc % python3 sequence_driver.py -plugin lammps -mdi "-role DRIVER -name sequence -method LINK -plugin_path /home/sjplimp/lammps/git/src" -plugin_args "-log log.sequence -in in.sequence" -DEBUG: -mpiexec -n 1 python3 plugin_driver.py --plugin_name "lammps" --mdi "-role DRIVER -name driver -method LINK -plugin_path /home/sjplimp/lammps/git/src" --plugin_command_line "-in in.sequence -log log.sequence" - --- Run in plugin mode: 3 procs From 2e8470022404a42549f72588efbb622d2aeee026 Mon Sep 17 00:00:00 2001 From: davidfir3 <491197586@qq.com> Date: Sat, 26 Mar 2022 13:55:22 +0800 Subject: [PATCH 033/130] delete unused variable "pairflag" --- src/FEP/compute_fep_ta.cpp | 2 -- src/FEP/compute_fep_ta.h | 1 - 2 files changed, 3 deletions(-) diff --git a/src/FEP/compute_fep_ta.cpp b/src/FEP/compute_fep_ta.cpp index cc301a0ac5..7183d48378 100644 --- a/src/FEP/compute_fep_ta.cpp +++ b/src/FEP/compute_fep_ta.cpp @@ -119,8 +119,6 @@ void ComputeFEPTA::init() // setup and error checks - pairflag = 0; - if (tailflag) { if (force->pair->tail_flag == 0) error->all(FLERR,"Compute fep/ta tail when pair style does not " diff --git a/src/FEP/compute_fep_ta.h b/src/FEP/compute_fep_ta.h index 04bcf23bb3..a1eeb28347 100644 --- a/src/FEP/compute_fep_ta.h +++ b/src/FEP/compute_fep_ta.h @@ -36,7 +36,6 @@ class ComputeFEPTA : public Compute { void compute_vector() override; private: - int pairflag; int tailflag; int fepinitflag; int eflag, vflag; From 7c333b8e07178cbaa3b85dc87da481067232e64d Mon Sep 17 00:00:00 2001 From: davidfir3 <491197586@qq.com> Date: Sun, 27 Mar 2022 20:22:16 +0800 Subject: [PATCH 034/130] include bonded eng, cancel neigh build & fix bugs --- src/FEP/compute_fep_ta.cpp | 67 +++++++++++++++++++++----------------- src/FEP/compute_fep_ta.h | 1 + 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/src/FEP/compute_fep_ta.cpp b/src/FEP/compute_fep_ta.cpp index 7183d48378..55209f696a 100644 --- a/src/FEP/compute_fep_ta.cpp +++ b/src/FEP/compute_fep_ta.cpp @@ -18,12 +18,16 @@ #include "compute_fep_ta.h" +#include "angle.h" #include "atom.h" +#include "bond.h" #include "comm.h" +#include "dihedral.h" #include "domain.h" #include "error.h" #include "fix.h" #include "force.h" +#include "improper.h" #include "kspace.h" #include "memory.h" #include "modify.h" @@ -140,7 +144,7 @@ void ComputeFEPTA::init() if (logfile) { fprintf(logfile, "FEP/TA settings ...\n"); fprintf(logfile, " temperature = %f\n", temp_fep); - fprintf(screen, " scale factor = %f\n", scale_factor); + fprintf(logfile, " scale factor = %f\n", scale_factor); fprintf(logfile, " tail %s\n", (tailflag ? "yes":"no")); } } @@ -167,28 +171,25 @@ void ComputeFEPTA::compute_vector() backup_xfev(); // backup position, force, energy, virial array values backup_box(); // backup box size - timer->stamp(); - if (force->pair && force->pair->compute_flag) { - force->pair->compute(eflag,vflag); - timer->stamp(Timer::PAIR); - } - if (force->kspace && force->kspace->compute_flag) { - force->kspace->compute(eflag,vflag); - timer->stamp(Timer::KSPACE); - } - - // accumulate force/energy/virial from /gpu pair styles - if (fixgpu) fixgpu->post_force(vflag); - pe0 = compute_epair(); change_box(); + comm->forward_comm(); timer->stamp(); if (force->pair && force->pair->compute_flag) { force->pair->compute(eflag,vflag); timer->stamp(Timer::PAIR); } + + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) force->bond->compute(eflag,vflag); + if (force->angle) force->angle->compute(eflag,vflag); + if (force->dihedral) force->dihedral->compute(eflag,vflag); + if (force->improper) force->improper->compute(eflag,vflag); + timer->stamp(Timer::BOND); + } + if (force->kspace && force->kspace->compute_flag) { force->kspace->compute(eflag,vflag); timer->stamp(Timer::KSPACE); @@ -203,6 +204,7 @@ void ComputeFEPTA::compute_vector() restore_xfev(); // restore position, force, energy, virial array values restore_box(); // restore box size + comm->forward_comm(); vector[0] = pe1-pe0; vector[1] = exp(-(pe1-pe0)/(force->boltz*temp_fep)); @@ -220,6 +222,14 @@ double ComputeFEPTA::compute_epair() eng = 0.0; if (force->pair) eng = force->pair->eng_vdwl + force->pair->eng_coul; + + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) eng += force->bond->energy; + if (force->angle) eng += force->angle->energy; + if (force->dihedral) eng += force->dihedral->energy; + if (force->improper) eng += force->improper->energy; + } + MPI_Allreduce(&eng,&eng_pair,1,MPI_DOUBLE,MPI_SUM,world); if (tailflag) { @@ -239,9 +249,6 @@ double ComputeFEPTA::compute_epair() void ComputeFEPTA::change_box() { - // insure atoms are in current box - domain->pbc(); - int i; double **x = atom->x; int nlocal = atom->nlocal; @@ -262,12 +269,6 @@ void ComputeFEPTA::change_box() for (i = 0; i < nlocal; i++) domain->lamda2x(x[i],x[i]); - comm->setup(); - neighbor->setup_bins(); - if (modify->n_pre_neighbor) modify->setup_pre_neighbor(); - neighbor->build(1); - if (modify->n_post_neighbor) modify->setup_post_neighbor(); - if (force->kspace) force->kspace->setup(); } @@ -301,12 +302,6 @@ void ComputeFEPTA::restore_box() domain->set_global_box(); domain->set_local_box(); - comm->setup(); - neighbor->setup_bins(); - if (modify->n_pre_neighbor) modify->setup_pre_neighbor(); - neighbor->build(1); - if (modify->n_post_neighbor) modify->setup_post_neighbor(); - if (force->kspace) force->kspace->setup(); } @@ -376,6 +371,13 @@ void ComputeFEPTA::backup_xfev() eng_vdwl_orig = force->pair->eng_vdwl; eng_coul_orig = force->pair->eng_coul; + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) eng_bond_orig = force->bond->energy; + if (force->angle) eng_angle_orig = force->angle->energy; + if (force->dihedral) eng_dihedral_orig = force->dihedral->energy; + if (force->improper) eng_improper_orig = force->improper->energy; + } + pvirial_orig[0] = force->pair->virial[0]; pvirial_orig[1] = force->pair->virial[1]; pvirial_orig[2] = force->pair->virial[2]; @@ -456,6 +458,13 @@ void ComputeFEPTA::restore_xfev() force->pair->eng_vdwl = eng_vdwl_orig; force->pair->eng_coul = eng_coul_orig; + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) force->bond->energy = eng_bond_orig; + if (force->angle) force->angle->energy = eng_angle_orig; + if (force->dihedral) force->dihedral->energy = eng_dihedral_orig; + if (force->improper) force->improper->energy = eng_improper_orig; + } + force->pair->virial[0] = pvirial_orig[0]; force->pair->virial[1] = pvirial_orig[1]; force->pair->virial[2] = pvirial_orig[2]; diff --git a/src/FEP/compute_fep_ta.h b/src/FEP/compute_fep_ta.h index a1eeb28347..67b09f5a2b 100644 --- a/src/FEP/compute_fep_ta.h +++ b/src/FEP/compute_fep_ta.h @@ -50,6 +50,7 @@ class ComputeFEPTA : public Compute { double **x_orig; double **f_orig; double eng_vdwl_orig, eng_coul_orig; + double eng_bond_orig, eng_angle_orig, eng_dihedral_orig, eng_improper_orig; double pvirial_orig[6]; double *peatom_orig, **pvatom_orig; double energy_orig; From 603136a93b0dd27e07253c4ce0a922d84755d263 Mon Sep 17 00:00:00 2001 From: davidfir3 <491197586@qq.com> Date: Sun, 27 Mar 2022 20:52:00 +0800 Subject: [PATCH 035/130] rename some function & variable, output delta area --- src/FEP/compute_fep_ta.cpp | 23 ++++++++++++----------- src/FEP/compute_fep_ta.h | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/FEP/compute_fep_ta.cpp b/src/FEP/compute_fep_ta.cpp index 55209f696a..592d752190 100644 --- a/src/FEP/compute_fep_ta.cpp +++ b/src/FEP/compute_fep_ta.cpp @@ -52,7 +52,7 @@ ComputeFEPTA::ComputeFEPTA(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 0; vector_flag = 1; - size_vector = 2; + size_vector = 3; extvector = 0; vector = new double[size_vector]; @@ -90,7 +90,7 @@ ComputeFEPTA::ComputeFEPTA(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal optional keyword in compute fep/ta"); } - // allocate space for position, charge, force, energy, virial arrays + // allocate space for position, force, energy, virial arrays x_orig = nullptr; f_orig = nullptr; @@ -171,7 +171,7 @@ void ComputeFEPTA::compute_vector() backup_xfev(); // backup position, force, energy, virial array values backup_box(); // backup box size - pe0 = compute_epair(); + pe0 = compute_pe(); change_box(); comm->forward_comm(); @@ -200,7 +200,7 @@ void ComputeFEPTA::compute_vector() // otherwise the force compute on the GPU in the next step would be incorrect if (fixgpu) fixgpu->post_force(vflag); - pe1 = compute_epair(); + pe1 = compute_pe(); restore_xfev(); // restore position, force, energy, virial array values restore_box(); // restore box size @@ -208,16 +208,17 @@ void ComputeFEPTA::compute_vector() vector[0] = pe1-pe0; vector[1] = exp(-(pe1-pe0)/(force->boltz*temp_fep)); + vector[2] = area_orig*(scale_factor-1.0); } /* ---------------------------------------------------------------------- - obtain pair energy from lammps accumulators + obtain potential energy from lammps accumulators ------------------------------------------------------------------------- */ -double ComputeFEPTA::compute_epair() +double ComputeFEPTA::compute_pe() { - double eng, eng_pair; + double eng, eng_potential; eng = 0.0; if (force->pair) @@ -230,16 +231,16 @@ double ComputeFEPTA::compute_epair() if (force->improper) eng += force->improper->energy; } - MPI_Allreduce(&eng,&eng_pair,1,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(&eng,&eng_potential,1,MPI_DOUBLE,MPI_SUM,world); if (tailflag) { double volume = domain->xprd * domain->yprd * domain->zprd; - eng_pair += force->pair->etail / volume; + eng_potential += force->pair->etail / volume; } - if (force->kspace) eng_pair += force->kspace->energy; + if (force->kspace) eng_potential += force->kspace->energy; - return eng_pair; + return eng_potential; } diff --git a/src/FEP/compute_fep_ta.h b/src/FEP/compute_fep_ta.h index 67b09f5a2b..76f9f5e526 100644 --- a/src/FEP/compute_fep_ta.h +++ b/src/FEP/compute_fep_ta.h @@ -59,7 +59,7 @@ class ComputeFEPTA : public Compute { class Fix *fixgpu; - double compute_epair(); + double compute_pe(); void change_box(); void backup_box(); void restore_box(); From cf17fd2306b2404cc0e4daefb20d7ac9e5b91482 Mon Sep 17 00:00:00 2001 From: davidfir3 <491197586@qq.com> Date: Sun, 27 Mar 2022 21:49:51 +0800 Subject: [PATCH 036/130] remap ghost atoms, no need to forward_comm() --- src/FEP/compute_fep_ta.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/FEP/compute_fep_ta.cpp b/src/FEP/compute_fep_ta.cpp index 592d752190..71856abcdc 100644 --- a/src/FEP/compute_fep_ta.cpp +++ b/src/FEP/compute_fep_ta.cpp @@ -174,7 +174,6 @@ void ComputeFEPTA::compute_vector() pe0 = compute_pe(); change_box(); - comm->forward_comm(); timer->stamp(); if (force->pair && force->pair->compute_flag) { @@ -204,7 +203,6 @@ void ComputeFEPTA::compute_vector() restore_xfev(); // restore position, force, energy, virial array values restore_box(); // restore box size - comm->forward_comm(); vector[0] = pe1-pe0; vector[1] = exp(-(pe1-pe0)/(force->boltz*temp_fep)); @@ -252,8 +250,9 @@ void ComputeFEPTA::change_box() { int i; double **x = atom->x; - int nlocal = atom->nlocal; - for (i = 0; i < nlocal; i++) + int natom = atom->nlocal + atom->nghost; + + for (i = 0; i < natom; i++) domain->x2lamda(x[i],x[i]); domain->boxhi[tan_axis1] *= sqrt(scale_factor); @@ -267,7 +266,7 @@ void ComputeFEPTA::change_box() domain->set_local_box(); // remap atom position - for (i = 0; i < nlocal; i++) + for (i = 0; i < natom; i++) domain->lamda2x(x[i],x[i]); if (force->kspace) force->kspace->setup(); @@ -350,10 +349,7 @@ void ComputeFEPTA::backup_xfev() { int i; - int nall = atom->nlocal + atom->nghost; - int natom = atom->nlocal; - if (force->newton || force->kspace->tip4pflag) - natom += atom->nghost; + int natom = atom->nlocal + atom->nghost; double **x = atom->x; for (i = 0; i < natom; i++) { @@ -437,10 +433,7 @@ void ComputeFEPTA::restore_xfev() { int i; - int nall = atom->nlocal + atom->nghost; - int natom = atom->nlocal; - if (force->newton || force->kspace->tip4pflag) - natom += atom->nghost; + int natom = atom->nlocal + atom->nghost; double **x = atom->x; for (i = 0; i < natom; i++) { From 13228ca29a0ffabebdda4b58ba7773320fa9b7b9 Mon Sep 17 00:00:00 2001 From: davidfir3 <491197586@qq.com> Date: Mon, 28 Mar 2022 13:34:36 +0800 Subject: [PATCH 037/130] add dimension check --- src/FEP/compute_fep_ta.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/FEP/compute_fep_ta.cpp b/src/FEP/compute_fep_ta.cpp index 71856abcdc..0045119f85 100644 --- a/src/FEP/compute_fep_ta.cpp +++ b/src/FEP/compute_fep_ta.cpp @@ -123,6 +123,10 @@ void ComputeFEPTA::init() // setup and error checks + if (domain->dimension == 2) { + error->all(FLERR,"Cannot compute fep/ta in 2d simulation"); + } + if (tailflag) { if (force->pair->tail_flag == 0) error->all(FLERR,"Compute fep/ta tail when pair style does not " From ebf2b1e7064864942f889ed3ec658a73267218aa Mon Sep 17 00:00:00 2001 From: davidfir3 <491197586@qq.com> Date: Mon, 28 Mar 2022 20:01:59 +0800 Subject: [PATCH 038/130] add doc for compute fep/ta --- doc/src/compute_fep_ta.rst | 93 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 doc/src/compute_fep_ta.rst diff --git a/doc/src/compute_fep_ta.rst b/doc/src/compute_fep_ta.rst new file mode 100644 index 0000000000..55f8fcfe09 --- /dev/null +++ b/doc/src/compute_fep_ta.rst @@ -0,0 +1,93 @@ +.. index:: compute fep/ta + +compute fep/ta command +====================== + +Syntax +"""""" + +.. parsed-literal:: + + compute ID group-ID fep/ta temp plane scale_factor keyword value ... + +* ID, group-ID are documented in the :doc:`compute ` command +* fep/ta = name of this compute command +* temp = external temperature (as specified for constant-temperature run) +* plane = *xy* or *xz* or *yz* +* scale_factor = multiplicative factor for change in plane area +* zero or more keyword/value pairs may be appended +* keyword = *tail* + + .. parsed-literal:: + + *tail* value = *no* or *yes* + *no* = ignore tail correction to pair energies (usually small in fep) + *yes* = include tail correction to pair energies + +Examples +"""""""" + +.. code-block:: LAMMPS + + compute 1 all fep/ta 298 xy 1.0005 + +Description +""""""""""" +Define a computation that calculates the change in the free energy due +to a test-area (TA) perturbation :ref:`(Gloor) `. The test-area +approach can be used to determine the interfacial tension of the system +in a single simulation: + +.. math:: + + \gamma = \lim_{\Delta \mathcal{A} \to 0} \left( \frac{\Delta A_{0 \to 1 }}{\Delta \mathcal{A}}\right)_{N,V,T} + = - \frac{kT}{\Delta \mathcal{A}} \ln \left< \exp(-(U_1 - U_0)/kT) \right>_0 + +During the perturbation, both axes of *plane* are scaled by multiplying :math:`\sqrt{scale\_factor}`, +while the other axis divided by *scale_factor* such that the overall +volume of the system is maintained. + +The *tail* keyword controls the calculation of the tail correction to +"van der Waals" pair energies beyond the cutoff, if this has been +activated via the :doc:`pair_modify ` command. If the +perturbation is small, the tail contribution to the energy difference +between the reference and perturbed systems should be negligible. + +---------- + +Output info +""""""""""" + +This compute calculates a global vector of length 3 which contains the +energy difference ( :math:`U_1-U_0` ) as c_ID[1], the +Boltzmann factor :math:`\exp(-(U_1-U_0)/kT)`, as c_ID[2] and the +change in the *plane* area :math:`\Delta \mathcal{A}` as c_ID[3]. :math:`U_1` is the +potential energy of the perturbed state and +:math:`U_0` is the potential energy of the reference state. +The energies include kspace terms if these are used in the simulation. + +These output results can be used by any command that uses a global +scalar or vector from a compute as input. See the :doc:`Howto output ` page for an overview of LAMMPS output +options. For example, the computed values can be averaged using :doc:`fix ave/time `. + +Restrictions +"""""""""""" + +This compute is distributed as the FEP package. It is only +enabled if LAMMPS was built with that package. See the :doc:`Build package ` page for more info. + +Related commands +"""""""""""""""" + +:doc:`compute fep ` + +Default +""""""" + +The option defaults are *tail* = *no*\ . + +---------- + +.. _Gloor: + +**(Gloor)** Gloor, J Chem Phys, 123, 134703 (2005) From af4afb7e0332e6b084e456b0b0b16cd8181eb862 Mon Sep 17 00:00:00 2001 From: davidfir3 <491197586@qq.com> Date: Mon, 28 Mar 2022 21:14:13 +0800 Subject: [PATCH 039/130] modify error/warning message --- src/FEP/compute_fep_ta.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/FEP/compute_fep_ta.h b/src/FEP/compute_fep_ta.h index 76f9f5e526..b95266eb1a 100644 --- a/src/FEP/compute_fep_ta.h +++ b/src/FEP/compute_fep_ta.h @@ -82,10 +82,8 @@ 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: Energy was not tallied on needed timestep +E: Cannot compute fep/ta in 2d simulation -You are using a thermo keyword that requires potentials to -have tallied energy, but they didn't on this timestep. See the -variable doc page for ideas on how to make this work. +Self-explanatory. */ From 94645ae7202a5829956f9297322bf846a0a9cde9 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Mon, 28 Mar 2022 13:56:16 -0600 Subject: [PATCH 040/130] update of doc pages to match new version of MDI support --- doc/src/Commands_all.rst | 2 +- doc/src/Commands_fix.rst | 2 +- doc/src/Howto_client_server.rst | 5 + doc/src/Howto_couple.rst | 28 ++-- doc/src/Howto_mdi.rst | 208 ++++++++++++++-------------- doc/src/Packages_details.rst | 13 +- doc/src/Packages_list.rst | 2 +- doc/src/fix.rst | 2 +- doc/src/fix_mdi_aimd.rst | 87 ++++++++++++ doc/src/fix_mdi_engine.rst | 59 -------- doc/src/mdi.rst | 234 ++++++++++++++++++++++++++++++++ doc/src/mdi_engine.rst | 88 ------------ 12 files changed, 466 insertions(+), 264 deletions(-) create mode 100644 doc/src/fix_mdi_aimd.rst delete mode 100644 doc/src/fix_mdi_engine.rst create mode 100644 doc/src/mdi.rst delete mode 100644 doc/src/mdi_engine.rst diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index 8995ffdcc4..fd68c51399 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -67,7 +67,7 @@ An alphabetic list of all general LAMMPS commands. * :doc:`lattice ` * :doc:`log ` * :doc:`mass ` - * :doc:`mdi/engine ` + * :doc:`mdi ` * :doc:`message ` * :doc:`minimize ` * :doc:`min_modify ` diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 1b3dd8b246..68d90a8741 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -100,7 +100,7 @@ OPT. * :doc:`lb/viscous ` * :doc:`lineforce ` * :doc:`manifoldforce ` - * :doc:`mdi/engine ` + * :doc:`mdi/aimd ` * :doc:`meso/move ` * :doc:`mol/swap ` * :doc:`momentum (k) ` diff --git a/doc/src/Howto_client_server.rst b/doc/src/Howto_client_server.rst index 7e21b78dfd..58e6224b2a 100644 --- a/doc/src/Howto_client_server.rst +++ b/doc/src/Howto_client_server.rst @@ -1,6 +1,11 @@ Using LAMMPS in client/server mode ================================== +.. note:: + + As of March 2022, this Howto page will soon be deprecated in favor + of the :doc:`Howto mdi ` doc page. + Client/server coupling of two codes is where one code is the "client" and sends request messages to a "server" code. The server responds to each request with a reply message. This enables the two codes to work diff --git a/doc/src/Howto_couple.rst b/doc/src/Howto_couple.rst index 31cafd1f94..2f24fa93f8 100644 --- a/doc/src/Howto_couple.rst +++ b/doc/src/Howto_couple.rst @@ -12,16 +12,16 @@ LAMMPS can be coupled to other codes in at least 4 ways. Each has advantages and disadvantages, which you will have to think about in the context of your application. -1. Define a new :doc:`fix ` command that calls the other code. In - this scenario, LAMMPS is the driver code. During timestepping, +1. Define a new :doc:`fix ` command that calls the other code. + In this scenario, LAMMPS is the driver code. During timestepping, the fix is invoked, and can make library calls to the other code, - which has been linked to LAMMPS as a library. This is the way how the + which has been linked to LAMMPS as a library. This is the way the :ref:`LATTE ` package, which performs density-functional - tight-binding calculations using the `LATTE software `_ - to compute forces, is hooked to LAMMPS. - See the :doc:`fix latte ` command for more details. - Also see the :doc:`Modify ` doc pages for info on how to - add a new fix to LAMMPS. + tight-binding calculations using the `LATTE software + `_ to compute forces, is hooked to + LAMMPS. See the :doc:`fix latte ` command for more + details. Also see the :doc:`Modify ` doc pages for info on + how to add a new fix to LAMMPS. .. spacer @@ -58,6 +58,12 @@ context of your application. .. spacer -4. Couple LAMMPS with another code in a client/server mode. This is - described on the :doc:`Howto client/server ` doc - page. +4. Couple LAMMPS with another code in a client/server fashion, using + using the `MDI Library + `_ + developed by the `Molecular Sciences Software Institute (MolSSI) + `_ to run LAMMPS as either an MDI driver + (client) or an MDI engine (server). The MDI driver issues commands + to the MDI server to exchange data between them. See the + :doc:`Howto mdi ` page for more information about how + LAMMPS can operate in either of these modes. diff --git a/doc/src/Howto_mdi.rst b/doc/src/Howto_mdi.rst index 12c4cfa527..c46b740a5c 100644 --- a/doc/src/Howto_mdi.rst +++ b/doc/src/Howto_mdi.rst @@ -3,130 +3,140 @@ Using LAMMPS with the MDI library for code coupling .. note:: - This Howto page will eventually replace the - :doc:`Howto client/server ` doc page. + As of March 2022, this Howto page will soon replace the :doc:`Howto + client/server ` doc page. -Client/server coupling of two codes is where one code is the "client" -and sends request messages (data) to a "server" code. The server -responds to each request with a reply message. This enables the two -codes to work in tandem to perform a simulation. LAMMPS can act as -either a client or server code; it does this by using the `MolSSI -Driver Interface (MDI) library +Client/server coupling of two (or more) codes is where one code is the +"client" and sends request messages (data) to one (or more) "server" +code(s). A server responds to each request with a reply message +(data). This enables two (or more) codes to work in tandem to perform +a simulation. LAMMPS can act as either a client or server code; it +does this by using the `MolSSI Driver Interface (MDI) library `_, developed by the `Molecular Sciences Software Institute (MolSSI) -`_. +`_, which is supported by the :ref:`MDI ` +package. Alternate methods for code coupling with LAMMPS are described on the :doc:`Howto couple ` doc page. -Some advantages of client/server coupling are that the two codes can run +Some advantages of client/server coupling are that the codes can run as stand-alone executables; they need not be linked together. Thus -neither code needs to have a library interface. This also makes it easy -to run the two codes on different numbers of processors. If a message -protocol (format and content) is defined for a particular kind of -simulation, then in principle any code which implements the client-side -protocol can be used in tandem with any code which implements the -server-side protocol. Neither code needs to know what specific other -code it is working with. +neither code needs to have a library interface. This also makes it +easy to run the two codes on different numbers of processors. If a +message protocol (format and content) is defined for a particular kind +of simulation, then in principle any code which implements the +client-side protocol can be used in tandem with any code which +implements the server-side protocol. Neither code needs to know what +specific other code it is working with. In MDI nomenclature, a client code is the "driver", and a server code is an "engine". One driver code can communicate with one or more instances of one or more engine codes. Driver and engine codes can be written in any language: C, C++, Fortran, Python, etc. -In addition to allowing driver and engine(s) running to run as -stand-alone executables, MDI also enables a server code to be a -"plugin" to the client code. In this scenario, server code(s) are -compiled as shared libraries, and one (or more) instances of the -server are instantiated by the driver code. If the driver code runs -in parallel, it can split its MPI communicator into multiple -sub-communicators, and launch each plugin engine instance on a -sub-communicator. Driver processors in that sub-communicator exchange -messages with that engine instance, and can also send MPI messages to -other processors in the driver. The driver code can also destroy -engine instances and re-instantiate them. +In addition to allowing driver and engine(s) to run as stand-alone +executables, MDI also enables a server code to be a "plugin" to the +client code. In this scenario, server code(s) are compiled as shared +libraries, and one (or more) instances of the server are instantiated +by the driver code. If the driver code runs in parallel, it can split +its MPI communicator into multiple sub-communicators, and launch each +plugin engine instance on a sub-communicator. Driver processors +within that sub-communicator exchange messages with the corresponding +engine instance, and can also send MPI messages to other processors in +the driver. The driver code can also destroy engine instances and +re-instantiate them. LAMMPS can operate as either a stand-alone or +plugin MDI engine. -The way that a driver communicates with an engine is by making -MDI_Send() and MDI_Recv() calls, which are conceptually similar to -MPI_Send() and MPI_Recv() calls. Each send or receive has a string -which identifies the command name, and optionally some data, which can -be a single value or vector of values of any data type. Inside the -MDI library, data is exchanged between the driver and engine via MPI -calls or sockets. This a run-time choice by the user. +The way in which an MDI driver communicates with an MDI engine is by +making MDI_Send() and MDI_Recv() calls, which are conceptually similar +to MPI_Send() and MPI_Recv() calls. Each send or receive operation +uses a string to identify the command name, and optionally some data, +which can be a single value or vector of values of any data type. +Inside the MDI library, data is exchanged between the driver and +engine via MPI calls or sockets. This a run-time choice by the user. + +---------- + +The :ref:`MDI ` package provides a :doc:`mdi/engine +` command which enables LAMMPS to operate as an MDI +engine. Its doc page explains the variety of standard and custom MDI +commands which the LAMMPS engine recognizes and can respond to. + +The :ref:`MDI ` package also has a `fix mdi/aimd +` command in which LAMMPS operates as an MDI driver to +peform *ab initio* MD simulations in conjunction with a quantum +mechanics code. It's post_force() method illustrates how a driver +issues MDI commands to another code. + +---------- + +The examples/mdi directory contains Python scripts and LAMMPS input +script which use LAMMPS as either an MDI driver or engine. Three +example use cases are provided: + +* Run ab intitio MD (AIMD) with 2 instances of LAMMPS as driver and + engine. As an engine, LAMMPS is a surrogate for a quantum code. + +* A python driver invokes a sequence of unrelated LAMMPS calculations. + Calculations can be single-point energy/force evaluations, full MD + runs, or full minimizations. + +* Run AIMD with a Python driver code and 2 LAMMPS instances as + engines. The first LAMMPS instance performs MD timesteps. The + second LAMMPS instance acts as a surrogate QM code to compute + forces. The aimd_driver.py code allows for the two engines + to be used in either stand-alone or plugin mode. + +Note that in any of these example where LAMMPS is used as an engine, +an actual QM code (which supports MDI) could be used in its place, +without modifying any of the other scripts or code. + +The examples/mdi/README file explains how to launch both driver and +engine codes so that they communicate using the MDI library via either +MPI or sockets. ------------- -As an example, LAMMPS and the ``pw.x`` command from Quantum Espresso (a -suite of quantum DFT codes), can work together via the MDI library to -perform an ab initio MD (AIMD) simulation, where LAMMPS runs an MD -simulation and sends a message each timestep to ``pw.x`` asking it to -compute quantum forces on the current configuration of atoms. Here is -how the 2 codes are launched to communicate by MPI: +Currently there are two quantum DFT codes which have direct MDI +support, `Quantum ESPRESSO (QE) `_ +and `INQ `_. There are also +several QM codes which have indirect support through QCEngine or i-PI. +The former means they require a wrapper program (QCEngine) with MDI +support which writes/read files to pass data to the quantum code +itself. The list of QCEngine-supported and i-PI-supported quantum +codes is on the `MDI webpage +`_. + +Here is how to build QE as a stand-alond ``pw.x`` file which can be +used in stand-alone mode: .. code-block:: bash - % mpirun -np 2 lmp_mpi -mdi "-role DRIVER -name d -method MPI" \ - -in in.aimd : -np 16 pw.x -in qe.in -mdi "-role ENGINE -name e -method MPI" + % git clone --branch mdi_plugin https://github.com/MolSSI-MDI/q-e.git /q-e + % build the executable pw.x, following the `QE build guide `_ -In this case LAMMPS runs on 2 processors (MPI tasks), ``pw.x`` runs on 16 -processors. - -Here is how the 2 codes are launched to communicate by sockets: +Here is how to build QE as a shared library which can be used in plugin mode, +which results in a libqemdi.so file in /q-e/MDI/src: .. code-block:: bash - % mpirun -np 2 lmp_mpi -mdi "-role DRIVER -name d -method TCP -port 8021" -in in.aimd - % mpirun -np 16 pw.x -in qe.in -mdi "-role ENGINE -name e -method TCP -port 8021 -hostname localhost" + % git clone --branch mdi_plugin https://github.com/MolSSI-MDI/q-e.git /q-e + % cd /q-e + % ./configure --enable-parallel --enable-openmp --enable-shared FFLAGS="-fPIC" FCFLAGS="-fPIC" CFLAGS="-fPIC" foxflags="-fPIC" try_foxflags="-fPIC" + % make -j 4 mdi -These commands could be issued in different windows on a desktop -machine. Or in the same window, if the first command is ended with -"&" so as to run in the background. If "localhost" is replaced by an -IP address, ``pw.x`` could be run on another machine on the same network, or -even on another machine across the country. +INQ cannot be built as a stand-alone code; it is by design a library. +Here is how to build INQ as a shared library which can be used in +plugin mode, which results in a libinqmdi.so file in +/inq/build/examples: -After both codes initialize themselves to model the same system, this is -what occurs each timestep: +.. code-block:: bash -* LAMMPS send a ">COORDS" message to ``pw.x`` with a 3*N vector of current atom coords -* ``pw.x`` receives the message/coords and computes quantum forces on all the atoms -* LAMMPS send a "` command. This will put LAMMPS into -"engine mode" where it waits for messages and data from the driver. -When the driver sends an "EXIT" command, LAMMPS will exit engine mode -and the input script will continue. - -If LAMMPS is used as a plugin engine it operates the same way, except -that the driver will pass LAMMPS an input script to initialize itself. -Upon receiving the "EXIT" command, LAMMPS will exit engine mode and the -input script will continue. After finishing execution of the input -script, the instance of LAMMPS will be destroyed. - -LAMMPS supports the full set of MD-appropriate engine commands defined -by the MDI library. See the :doc:`mdi/engine ` page for -a list of these. - -If those commands are not sufficient for a user-developed driver to use -LAMMPS as an engine, then new commands can be easily added. See these -two files which implement the definition of MDI commands and the logic -for responding to them: - -* src/MDI/mdi_engine.cpp -* src/MDI/fix_mdi_engine.cpp + % git clone --branch mdi --recurse-submodules https://gitlab.com/taylor-a-barnes/inq.git /inq + % cd /inq + % mkdir -p build + % cd build + % ../configure --prefix=/install + % make -j 4 + % make install diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 5876d82cc5..606bc04afa 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -1396,17 +1396,24 @@ MDI package **Contents:** -A LAMMPS command and fix to allow client-server coupling of LAMMPS to -other atomic or molecular simulation codes via the `MolSSI Driver Interface +A LAMMPS command and fixes to allow client-server coupling of LAMMPS +to other atomic or molecular simulation codes or materials modeling +workflows via the `MolSSI Driver Interface (MDI) library `_. **Author:** Taylor Barnes - MolSSI, taylor.a.barnes at gmail.com +**Install:** + +This package has :ref:`specific installation instructions ` on the :doc:`Build extras ` page. + **Supporting info:** * src/MDI/README +* lib/mdi/README +* :doc:`Howto MDI ` * :doc:`mdi/engine ` -* :doc:`fix mdi/engine ` +* :doc:`fix mdi/aimd ` * examples/PACKAGES/mdi ---------- diff --git a/doc/src/Packages_list.rst b/doc/src/Packages_list.rst index 22dfa2c69e..3fa984fc7b 100644 --- a/doc/src/Packages_list.rst +++ b/doc/src/Packages_list.rst @@ -244,7 +244,7 @@ whether an extra library is needed to build and use the package: - n/a - no * - :ref:`MDI ` - - client-server coupling + - client-server code coupling - :doc:`MDI Howto ` - PACKAGES/mdi - ext diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 4a858ef7eb..cd89586614 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -243,7 +243,7 @@ accelerated styles exist. * :doc:`lb/viscous ` - * :doc:`lineforce ` - constrain atoms to move in a line * :doc:`manifoldforce ` - restrain atoms to a manifold during minimization -* :doc:`mdi/engine ` - connect LAMMPS to external programs via the MolSSI Driver Interface (MDI) +* :doc:`mdi/aimd ` - LAMMPS operates as driver for ab initio MD (AIMD) via the MolSSI Driver Interface (MDI) * :doc:`meso/move ` - move mesoscopic SPH/SDPD particles in a prescribed fashion * :doc:`mol/swap ` - Monte Carlo atom type swapping with a molecule * :doc:`momentum ` - zero the linear and/or angular momentum of a group of atoms diff --git a/doc/src/fix_mdi_aimd.rst b/doc/src/fix_mdi_aimd.rst new file mode 100644 index 0000000000..b63e85daf6 --- /dev/null +++ b/doc/src/fix_mdi_aimd.rst @@ -0,0 +1,87 @@ +.. index:: fix mdi/aimd + +fix mdi/aimd command +====================== + +Syntax +"""""" + +.. parsed-literal:: + + fix ID group-ID mdi/aimd + +* ID, group-ID are documented in :doc:`fix ` command +* mdi/aimd = style name of this fix command + +Examples +"""""""" + +.. code-block:: LAMMPS + + fix 1 all mdi/aimd + +Description +""""""""""" + +This command enables LAMMPS to act as a client with another server +code to couple the two codes together to perform ab initio MD (AIMD) +simulations. + +More specifically, this command causes LAMMPS to begin using the `MDI +Library `_ +to run as an MDI driver (client), whicn sends MDI commands to an +external MDI engine code (server) which in the case of AIMD is a +quantum mechanics (QM) code, or could be LAMMPS itself, asking as a +surrogate for a QM code. See the :doc:`Howto mdi ` page +for more information about how LAMMPS can operate as either an MDI +driver or engine. + +The examples/mdi directory contains input scripts perfoming AIMD in +this manner with LAMMPS acting as both a driver and an engine +(surrogate for a QM code). The examples/README file explains how to +launch both client and server codes so that they communicate using the +MDI library via either MPI or sockets. Any QM code that supports MDI +could be used in place of LAMMPS acting as a QM surrogate. See the +:doc:`Howto mdi ` page for a current list (March 2022) of +such QM codes. + +---------- + +This fix performs the timestepping portion of an AIMD simulation. +Both LAMMPS and the engine code (QM or LAMMPS) should define the same +system (simulation box, atoms and their types) in their respective +input scripts. LAMMPS then begins its timestepping. + +At the point in each timestep when LAMMPS needs the force on each +atom, it communicates with the engine code. It sends the current +simulation box size and shape (if they change dynamicaly, e.g. during +an NPT simulation), and the current atom coordinates. The engine code +computes quantum forces on each atom and returns them to LAMMPS. If +LAMMPS also needs the system energy and/or virial, it requests those +values from the engine code as well. + +Restrictions +"""""""""""" + +This command is part of the MDI package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package +` page for more info. + +To use LAMMPS as an MDI driver in conjunction with other MDI-enabled +atomistic codes, the :doc:`units ` command should be used to +specify *real* or *metal* units. This will ensure the correct unit +conversions between LAMMPS and MDI units, which the other codes will +also perform in their preferred units. + +LAMMPS can also be used as an MDI driver in other unit choices it +supports, e.g. *lj*, but then no unit conversion is performed. + +Related commands +"""""""""""""""" + +:doc:`mdi engine ` + +Default +""""""" + +none diff --git a/doc/src/fix_mdi_engine.rst b/doc/src/fix_mdi_engine.rst deleted file mode 100644 index 51a4545fd8..0000000000 --- a/doc/src/fix_mdi_engine.rst +++ /dev/null @@ -1,59 +0,0 @@ -.. index:: fix mdi/engine - -fix mdi/engine command -====================== - -Syntax -"""""" - -.. parsed-literal:: - - fix ID group-ID mdi/engine - -* ID, group-ID are documented in :doc:`fix ` command -* mdi/engine = style name of this fix command - -Examples -"""""""" - -.. code-block:: LAMMPS - - fix 1 all mdi/engine - -Description -""""""""""" - -This fix is used along with the :doc:`mdi/engine ` command -to enable LAMMPS to use the `MDI Library -`_ to run as -an MDI engine. The fix provides hooks that enable MDI driver codes to -communicate with LAMMPS at various points within a LAMMPS timestep. - -It is not generally necessary to add this fix to a LAMMPS input file, -even when using the :doc:`mdi/engine ` command. If the -:doc:`mdi/engine ` command is executed and this fix is not -present, it will automatically be added and applied as a new fix for -all atoms for the duration of the command. Thus it is only necessary -to add this fix to an input file when you want to modify the group-ID -or the ordering of this fix relative to other fixes in the input script. - -For more information about running LAMMPS as an MDI engine, see the -:doc:`mdi/engine ` command and the :doc:`Howto mdi -` doc page. - -Restrictions -"""""""""""" - -This command is part of the MDI package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package -` page for more info. - -Related commands -"""""""""""""""" - -:doc:`mdi/engine ` - -Default -""""""" - -none diff --git a/doc/src/mdi.rst b/doc/src/mdi.rst new file mode 100644 index 0000000000..ee8196e37c --- /dev/null +++ b/doc/src/mdi.rst @@ -0,0 +1,234 @@ +.. index:: mdi + +mdi command +================== + +Syntax +"""""" + +.. parsed-literal:: + + mdi engine + +* engine = start operating as an MDI engine + + +Examples +"""""""" + +.. code-block:: LAMMPS + + mdi engine + +Description +""""""""""" + +This command enables LAMMPS act as a server with another client code +to effectively couple the two codes together in client/server mode. + +More specifically, this command causes LAMMPS to begin using the `MDI +Library `_ +to run as an MDI engine (server), responding to MDI commands issued by +an external MDI driver code (client). See the :doc:`Howto mdi +` page for more information about how LAMMPS can operate as +either an MDI driver or engine. + +The examples/mdi directory contains input scripts for LAMMPS acting as +an MDI engine to operate as a surrogate quantum mechanics (QM) code +for running ab initio MD (AIMD) or within a materials modeling +workflow to perform various MD tasks. It likewise has example scripts +for LAMMPS acting as an MDI driver for AIMD simulations, which could +use real QM codes which support MDI. The examples/mdi/README file +explains how to launch both driver and engine codes so that they +communicate using the MDI library via either MPI or sockets. + +---------- + +The mdi engine command should typically be used in an input script +after LAMMPS has setup the system it is going to model in +collaboration with the driver code. Depending on how the driver code +tells the LAMMPS engine to exit, other commands can be executed after +this command, but typically it should be used at the end of the LAMMPS +input script. + +To act as a MD-based MDI engine, this is the list of standard MDI +commands issued by a driver code which LAMMPS currently recognizes. +Using standard commands defined by the MDI library means that a driver +code can work interchangeably with LAMMPS or other MD codes which +support the MDI standard. See more details about these commands in +the `MDI library documentation +`_ + +These commands are valid at the @DEFAULT node defined by MDI. +Commands that start with ">" mean the driver is sending information to +the engine (LAMMMPS). Commands that start with "<" are requests by +the driver for LAMMPS to send it information. Command that start with +"@" are MDI "node" commands, which are described further below. + +.. list-table:: + :widths: 20 80 + :header-rows: 1 + + * - Command name + - Action + * - >CELL or CELL_DISPL or CHARGES or COORDS or FORCES or NATOMS or TYPES or VELOCITIES or COORDS + command), then LAMMPS will do a more expensive operation to migrate + atoms to new processors as needed and re-neighbor. If the >NATOMS + or >TYPES commands have been sent (since the previous >COORDS + command), then LAMMPS assumes the system is new and re-initializes + an entirely new simulation. + +The mdi engine command also implements the following custom MDI +commands which are LAMMPS-specific. These commands are also valid at +the @DEFAULT node defined by MDI: + + * - Command name + - Action + * - >NBYTES + - Send # of datums in a subsequent command (1 value) + * - >COMMAND + - Send a LAMMPS input script command as a string (Nbytes in length) + * - >COMMANDS + - Send multiple LAMMPS input script commands as a newline-separated string (Nbytes in length) + * - >INFILE + - Send filename of an input script to execute (Nbytes in length) + * - NITERATE command is a custom +command added by LAMMPS: + + * - Command name + - Action + * - >NITERATE + - Send # of timesteps for the MD simulation (1 value) + * - @COORDS + - Proceed to next @COORDS node = post-integrate location in LAMMPS timestep + * - @FORCES + - Proceed to next @FORCES node = post-force location in LAMMPS timestep + * - @ENDSTEP + - Proceed to next @ENDSTEP node = end-of-step location in LAMMPS timestep + * - @DEFAULT + - Exit MD simulation, return to @DEFAULT node + * - EXIT + - Driver tells LAMMPS to exit the MD simulation and engine mode + +To tell LAMMPS to run an energy minimization, the driver sends as +@INIT_OPTG command followed by these commands. The >TOLERANCE command +is a custom command added by LAMMPS: + + * - Command name + - Action + * - >TOLERANCE + - Send tolerance parameters for the minimization (4 values) + * - @COORDS + - Proceed to next @COORDS node = min-pre-force location in LAMMPS min iteration + * - @FORCES + - Proceed to next @FORCES node = min-post-force location in LAMMPS min iteration + * - @DEFAULT + - Exit minimization, return to @DEFAULT node + * - EXIT + - Driver tells LAMMPS to exit the minimization and engine mode + +The 4 tolerance parameters are those used by the :doc:`minimize +` command in LAMMPS: etol, ftol, maxiter, and maxeval. + +While LAMMPS is at its @COORDS node, the following standard MDI +commands are supported, as documented above: >COORDS or FORCES +or >+FORCES or +FORCES command sends per-atom forces from the driver to LAMMPS +which it adds to current forces (instead of replacing them). + +While LAMMPS is at its @ENDSTEP node, the following standard MDI +commands are supported, as documented above: ` page for more info. + +To use LAMMPS as an MDI engine in conjunction with other MDI-enabled +atomistic codes, the :doc:`units ` command should be used to +specify *real* or *metal* units. This will ensure the correct unit +conversions between LAMMPS and MDI units, which the other codes will +also perform in their preferred units. + +LAMMPS can also be used as an MDI engine in other unit choices it +supports, e.g. *lj*, but then no unit conversion is performed. + +Related commands +"""""""""""""""" + +:doc:`fix mdi/aimd ` + +Default +""""""" + +None diff --git a/doc/src/mdi_engine.rst b/doc/src/mdi_engine.rst deleted file mode 100644 index e06f571922..0000000000 --- a/doc/src/mdi_engine.rst +++ /dev/null @@ -1,88 +0,0 @@ -.. index:: mdi/engine - -mdi_engine command -================== - -Syntax -"""""" - -.. parsed-literal:: - - mdi_engine - -Description -""""""""""" - -This command is used to have LAMMPS act as a server with another -client code to effectively couple the two codes together in -client/server mode. - -More specifically, this command causes LAMMPS to begin using the `MDI -Library `_ -to run as an MDI engine (server), responding to commands made by an -external MDI driver code (client). See the :doc:`Howto mdi -` page for more information about how LAMMPS can work -as both an MDI driver or engine. - -General information about launching codes that communicate using the -MDI Library can be found in the `corresponding page -`_ -of the MDI Library's documentation. - ----------- - -This command should typically be used in an input script after LAMMPS -has setup the system it is going to model in collaboration with the -driver code. Depending on how the driver code tells the LAMMPS engine -to exit, other commands can be executed after this command, but -typically it should be used at the end of the LAMMPS input script. - -To act as a MD-based MDI engine, this is the list of MDI commands from -a driver code which LAMMPS currently recognizes. See more details -about these commands in the `MDI library documentation -`_ -.. NOTE: Taylor - is this the best link for this info? Can we flesh this -.. out with the full list of supported commands? Maybe the distinction -.. of what "node" the commands refer to is not needed in this table? - -.. list-table:: - :widths: 20 80 - :header-rows: 1 - - * - Command name - - Action - * - >NATOMS - - Driver sends the number of atoms in the system - * - FORCES - - Driver sends 3*N double-precision atom forces - * - ` page for more info. - -Related commands -"""""""""""""""" - -:doc:`fix mdi/engine ` - -Default -""""""" - -None From 1a3c6d3dbce833aa253befce0aeb6092674d6198 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Mon, 28 Mar 2022 14:33:17 -0600 Subject: [PATCH 041/130] tweak to one MDI doc file --- doc/src/fix_mdi_aimd.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/fix_mdi_aimd.rst b/doc/src/fix_mdi_aimd.rst index b63e85daf6..1e81fd5fa2 100644 --- a/doc/src/fix_mdi_aimd.rst +++ b/doc/src/fix_mdi_aimd.rst @@ -39,7 +39,7 @@ driver or engine. The examples/mdi directory contains input scripts perfoming AIMD in this manner with LAMMPS acting as both a driver and an engine (surrogate for a QM code). The examples/README file explains how to -launch both client and server codes so that they communicate using the +launch both driver and engine codes so that they communicate using the MDI library via either MPI or sockets. Any QM code that supports MDI could be used in place of LAMMPS acting as a QM surrogate. See the :doc:`Howto mdi ` page for a current list (March 2022) of From a60e1546b26981a98701f08f2f1ef379f9cb04ff Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 28 Mar 2022 16:47:57 -0400 Subject: [PATCH 042/130] properly integrate into build system and docs --- doc/src/Commands_compute.rst | 1 + doc/src/compute.rst | 3 ++- doc/src/compute_fep_ta.rst | 30 ++++++++++++--------- doc/utils/sphinx-config/false_positives.txt | 2 ++ src/.gitignore | 2 ++ src/FEP/Install.sh | 2 ++ 6 files changed, 26 insertions(+), 14 deletions(-) diff --git a/doc/src/Commands_compute.rst b/doc/src/Commands_compute.rst index 6ad5ed4435..6309fe83e2 100644 --- a/doc/src/Commands_compute.rst +++ b/doc/src/Commands_compute.rst @@ -63,6 +63,7 @@ KOKKOS, o = OPENMP, t = OPT. * :doc:`event/displace ` * :doc:`fabric ` * :doc:`fep ` + * :doc:`fep/ta ` * :doc:`force/tally ` * :doc:`fragment/atom ` * :doc:`global/atom ` diff --git a/doc/src/compute.rst b/doc/src/compute.rst index 2768543179..a149a752b0 100644 --- a/doc/src/compute.rst +++ b/doc/src/compute.rst @@ -208,7 +208,8 @@ The individual style names on the :doc:`Commands compute ` pag * :doc:`erotate/sphere/atom ` - rotational energy for each spherical particle * :doc:`event/displace ` - detect event on atom displacement * :doc:`fabric ` - calculates fabric tensors from pair interactions -* :doc:`fep ` - +* :doc:`fep ` - compute free energies for alchemical transformation from perturbation theory +* :doc:`fep/ta ` - compute free energies for a test area perturbation * :doc:`force/tally ` - force between two groups of atoms via the tally callback mechanism * :doc:`fragment/atom ` - fragment ID for each atom * :doc:`global/atom ` - diff --git a/doc/src/compute_fep_ta.rst b/doc/src/compute_fep_ta.rst index 55f8fcfe09..ad6b1ede82 100644 --- a/doc/src/compute_fep_ta.rst +++ b/doc/src/compute_fep_ta.rst @@ -33,6 +33,7 @@ Examples Description """"""""""" + Define a computation that calculates the change in the free energy due to a test-area (TA) perturbation :ref:`(Gloor) `. The test-area approach can be used to determine the interfacial tension of the system @@ -43,9 +44,9 @@ in a single simulation: \gamma = \lim_{\Delta \mathcal{A} \to 0} \left( \frac{\Delta A_{0 \to 1 }}{\Delta \mathcal{A}}\right)_{N,V,T} = - \frac{kT}{\Delta \mathcal{A}} \ln \left< \exp(-(U_1 - U_0)/kT) \right>_0 -During the perturbation, both axes of *plane* are scaled by multiplying :math:`\sqrt{scale\_factor}`, -while the other axis divided by *scale_factor* such that the overall -volume of the system is maintained. +During the perturbation, both axes of *plane* are scaled by multiplying +:math:`\sqrt{scale\_factor}`, while the other axis divided by +*scale_factor* such that the overall volume of the system is maintained. The *tail* keyword controls the calculation of the tail correction to "van der Waals" pair energies beyond the cutoff, if this has been @@ -59,22 +60,25 @@ Output info """"""""""" This compute calculates a global vector of length 3 which contains the -energy difference ( :math:`U_1-U_0` ) as c_ID[1], the -Boltzmann factor :math:`\exp(-(U_1-U_0)/kT)`, as c_ID[2] and the -change in the *plane* area :math:`\Delta \mathcal{A}` as c_ID[3]. :math:`U_1` is the -potential energy of the perturbed state and -:math:`U_0` is the potential energy of the reference state. -The energies include kspace terms if these are used in the simulation. +energy difference ( :math:`U_1-U_0` ) as c_ID[1], the Boltzmann factor +:math:`\exp(-(U_1-U_0)/kT)`, as c_ID[2] and the change in the *plane* +area :math:`\Delta \mathcal{A}` as c_ID[3]. :math:`U_1` is the potential +energy of the perturbed state and :math:`U_0` is the potential energy of +the reference state. The energies include kspace terms if these are +used in the simulation. These output results can be used by any command that uses a global -scalar or vector from a compute as input. See the :doc:`Howto output ` page for an overview of LAMMPS output -options. For example, the computed values can be averaged using :doc:`fix ave/time `. +scalar or vector from a compute as input. See the :doc:`Howto output +` page for an overview of LAMMPS output options. For +example, the computed values can be averaged using :doc:`fix ave/time +`. Restrictions """""""""""" -This compute is distributed as the FEP package. It is only -enabled if LAMMPS was built with that package. See the :doc:`Build package ` page for more info. +This compute is distributed as the FEP package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package +` page for more info. Related commands """""""""""""""" diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 6799e62d24..3947e8a071 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1177,6 +1177,7 @@ Gladky gld gle globbing +Gloor Glosli Glotzer gmail @@ -1425,6 +1426,7 @@ interal interatomic Interatomic interconvert +interfacial interial interlayer intermolecular diff --git a/src/.gitignore b/src/.gitignore index 8803d8a7e3..3305ec9e73 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -460,6 +460,8 @@ /compute_fabric.h /compute_fep.cpp /compute_fep.h +/compute_fep_ta.cpp +/compute_fep_ta.h /compute_force_tally.cpp /compute_force_tally.h /compute_gyration_shape.cpp diff --git a/src/FEP/Install.sh b/src/FEP/Install.sh index c6e7a53aa1..1d7a1c7a48 100755 --- a/src/FEP/Install.sh +++ b/src/FEP/Install.sh @@ -30,6 +30,8 @@ action () { action compute_fep.cpp action compute_fep.h +action compute_fep_ta.cpp +action compute_fep_ta.h action fix_adapt_fep.cpp action fix_adapt_fep.h action pair_coul_cut_soft.cpp From 64077457817969fee9da49d7ab11232d21c81c6f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 28 Mar 2022 16:49:11 -0400 Subject: [PATCH 043/130] update programming style and enable/apply clang-format --- src/FEP/compute_fep_ta.cpp | 158 ++++++++++++++++--------------------- 1 file changed, 67 insertions(+), 91 deletions(-) diff --git a/src/FEP/compute_fep_ta.cpp b/src/FEP/compute_fep_ta.cpp index 0045119f85..24e5b21959 100644 --- a/src/FEP/compute_fep_ta.cpp +++ b/src/FEP/compute_fep_ta.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -36,19 +35,18 @@ #include "timer.h" #include "update.h" -#include #include +#include using namespace LAMMPS_NS; -enum{X,Y,Z}; +enum { X, Y, Z }; /* ---------------------------------------------------------------------- */ -ComputeFEPTA::ComputeFEPTA(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) +ComputeFEPTA::ComputeFEPTA(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) { - if (narg < 6) error->all(FLERR,"Illegal number of arguments in compute fep/ta"); + if (narg < 6) error->all(FLERR, "Illegal number of arguments in compute fep/ta"); scalar_flag = 0; vector_flag = 1; @@ -59,23 +57,24 @@ ComputeFEPTA::ComputeFEPTA(LAMMPS *lmp, int narg, char **arg) : fepinitflag = 0; // avoid init to run entirely when called by write_data - temp_fep = utils::numeric(FLERR,arg[3],false,lmp); + temp_fep = utils::numeric(FLERR, arg[3], false, lmp); - if (strcmp(arg[4],"xy") == 0) { + if (strcmp(arg[4], "xy") == 0) { tan_axis1 = X; tan_axis2 = Y; norm_axis = Z; - } else if (strcmp(arg[4],"xz") == 0) { + } else if (strcmp(arg[4], "xz") == 0) { tan_axis1 = X; tan_axis2 = Z; norm_axis = Y; - } else if (strcmp(arg[4],"yz") == 0) { + } else if (strcmp(arg[4], "yz") == 0) { tan_axis1 = Y; tan_axis2 = Z; norm_axis = X; - } else error->all(FLERR,"Illegal arguments in compute fep/ta"); + } else + error->all(FLERR, "Illegal arguments in compute fep/ta"); - scale_factor = utils::numeric(FLERR,arg[5],false,lmp); + scale_factor = utils::numeric(FLERR, arg[5], false, lmp); // optional keywords @@ -83,11 +82,12 @@ ComputeFEPTA::ComputeFEPTA(LAMMPS *lmp, int narg, char **arg) : int iarg = 6; while (iarg < narg) { - if (strcmp(arg[iarg],"tail") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword in compute fep/ta"); - tailflag = utils::logical(FLERR,arg[iarg+1],false,lmp); + if (strcmp(arg[iarg], "tail") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal optional keyword in compute fep/ta"); + tailflag = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else error->all(FLERR,"Illegal optional keyword in compute fep/ta"); + } else + error->all(FLERR, "Illegal optional keyword in compute fep/ta"); } // allocate space for position, force, energy, virial arrays @@ -106,7 +106,7 @@ ComputeFEPTA::ComputeFEPTA(LAMMPS *lmp, int narg, char **arg) : ComputeFEPTA::~ComputeFEPTA() { - delete [] vector; + delete[] vector; deallocate_storage(); } @@ -115,21 +115,21 @@ ComputeFEPTA::~ComputeFEPTA() void ComputeFEPTA::init() { - int i,j; + int i, j; if (!fepinitflag) // avoid init to run entirely when called by write_data - fepinitflag = 1; - else return; + fepinitflag = 1; + else + return; // setup and error checks - if (domain->dimension == 2) { - error->all(FLERR,"Cannot compute fep/ta in 2d simulation"); - } + if (domain->dimension == 2) { error->all(FLERR, "Cannot compute fep/ta in 2d simulation"); } if (tailflag) { if (force->pair->tail_flag == 0) - error->all(FLERR,"Compute fep/ta tail when pair style does not " + error->all(FLERR, + "Compute fep/ta tail when pair style does not " "compute tail corrections"); } @@ -139,41 +139,31 @@ void ComputeFEPTA::init() if (ifixgpu >= 0) fixgpu = modify->fix[ifixgpu]; if (comm->me == 0) { - if (screen) { - fprintf(screen, "FEP/TA settings ...\n"); - fprintf(screen, " temperature = %f\n", temp_fep); - fprintf(screen, " scale factor = %f\n", scale_factor); - fprintf(screen, " tail %s\n", (tailflag ? "yes":"no")); - } - if (logfile) { - fprintf(logfile, "FEP/TA settings ...\n"); - fprintf(logfile, " temperature = %f\n", temp_fep); - fprintf(logfile, " scale factor = %f\n", scale_factor); - fprintf(logfile, " tail %s\n", (tailflag ? "yes":"no")); - } + auto mesg = fmt::format("FEP/TA settings ...\n temperature = {:f}\n", temp_fep); + mesg += fmt::format(" scale factor = {:f}\n", scale_factor); + mesg += fmt::format(" tail {}\n", (tailflag ? "yes" : "no")); + utils::logmesg(lmp, mesg); } - } /* ---------------------------------------------------------------------- */ - void ComputeFEPTA::compute_vector() { - double pe0,pe1; + double pe0, pe1; eflag = 1; vflag = 0; invoked_vector = update->ntimestep; - if (atom->nmax > nmax) { // reallocate working arrays if necessary + if (atom->nmax > nmax) { // reallocate working arrays if necessary deallocate_storage(); allocate_storage(); } - backup_xfev(); // backup position, force, energy, virial array values - backup_box(); // backup box size + backup_xfev(); // backup position, force, energy, virial array values + backup_box(); // backup box size pe0 = compute_pe(); @@ -181,20 +171,20 @@ void ComputeFEPTA::compute_vector() timer->stamp(); if (force->pair && force->pair->compute_flag) { - force->pair->compute(eflag,vflag); + force->pair->compute(eflag, vflag); timer->stamp(Timer::PAIR); } if (atom->molecular != Atom::ATOMIC) { - if (force->bond) force->bond->compute(eflag,vflag); - if (force->angle) force->angle->compute(eflag,vflag); - if (force->dihedral) force->dihedral->compute(eflag,vflag); - if (force->improper) force->improper->compute(eflag,vflag); + if (force->bond) force->bond->compute(eflag, vflag); + if (force->angle) force->angle->compute(eflag, vflag); + if (force->dihedral) force->dihedral->compute(eflag, vflag); + if (force->improper) force->improper->compute(eflag, vflag); timer->stamp(Timer::BOND); } if (force->kspace && force->kspace->compute_flag) { - force->kspace->compute(eflag,vflag); + force->kspace->compute(eflag, vflag); timer->stamp(Timer::KSPACE); } @@ -205,15 +195,14 @@ void ComputeFEPTA::compute_vector() pe1 = compute_pe(); - restore_xfev(); // restore position, force, energy, virial array values - restore_box(); // restore box size + restore_xfev(); // restore position, force, energy, virial array values + restore_box(); // restore box size - vector[0] = pe1-pe0; - vector[1] = exp(-(pe1-pe0)/(force->boltz*temp_fep)); - vector[2] = area_orig*(scale_factor-1.0); + vector[0] = pe1 - pe0; + vector[1] = exp(-(pe1 - pe0) / (force->boltz * temp_fep)); + vector[2] = area_orig * (scale_factor - 1.0); } - /* ---------------------------------------------------------------------- obtain potential energy from lammps accumulators ------------------------------------------------------------------------- */ @@ -223,8 +212,7 @@ double ComputeFEPTA::compute_pe() double eng, eng_potential; eng = 0.0; - if (force->pair) - eng = force->pair->eng_vdwl + force->pair->eng_coul; + if (force->pair) eng = force->pair->eng_vdwl + force->pair->eng_coul; if (atom->molecular != Atom::ATOMIC) { if (force->bond) eng += force->bond->energy; @@ -233,7 +221,7 @@ double ComputeFEPTA::compute_pe() if (force->improper) eng += force->improper->energy; } - MPI_Allreduce(&eng,&eng_potential,1,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(&eng, &eng_potential, 1, MPI_DOUBLE, MPI_SUM, world); if (tailflag) { double volume = domain->xprd * domain->yprd * domain->zprd; @@ -245,7 +233,6 @@ double ComputeFEPTA::compute_pe() return eng_potential; } - /* ---------------------------------------------------------------------- apply changes to box ------------------------------------------------------------------------- */ @@ -256,8 +243,7 @@ void ComputeFEPTA::change_box() double **x = atom->x; int natom = atom->nlocal + atom->nghost; - for (i = 0; i < natom; i++) - domain->x2lamda(x[i],x[i]); + for (i = 0; i < natom; i++) domain->x2lamda(x[i], x[i]); domain->boxhi[tan_axis1] *= sqrt(scale_factor); domain->boxlo[tan_axis1] *= sqrt(scale_factor); @@ -265,51 +251,47 @@ void ComputeFEPTA::change_box() domain->boxlo[tan_axis2] *= sqrt(scale_factor); domain->boxhi[norm_axis] /= scale_factor; domain->boxlo[norm_axis] /= scale_factor; - + domain->set_global_box(); domain->set_local_box(); // remap atom position - for (i = 0; i < natom; i++) - domain->lamda2x(x[i],x[i]); + for (i = 0; i < natom; i++) domain->lamda2x(x[i], x[i]); if (force->kspace) force->kspace->setup(); } - /* ---------------------------------------------------------------------- backup box size ------------------------------------------------------------------------- */ void ComputeFEPTA::backup_box() { - for (int i=0; i < domain->dimension; i++) { + for (int i = 0; i < domain->dimension; i++) { boxhi_orig[i] = domain->boxhi[i]; boxlo_orig[i] = domain->boxlo[i]; } - area_orig = domain->prd[tan_axis1]*domain->prd[tan_axis2]; + area_orig = domain->prd[tan_axis1] * domain->prd[tan_axis2]; } - /* ---------------------------------------------------------------------- restore box size to original values ------------------------------------------------------------------------- */ void ComputeFEPTA::restore_box() { - for (int i=0; i < domain->dimension; i++) { + for (int i = 0; i < domain->dimension; i++) { domain->boxhi[i] = boxhi_orig[i]; domain->boxlo[i] = boxlo_orig[i]; } - + domain->set_global_box(); domain->set_local_box(); if (force->kspace) force->kspace->setup(); } - /* ---------------------------------------------------------------------- manage storage for position, force, energy, virial arrays ------------------------------------------------------------------------- */ @@ -317,13 +299,13 @@ void ComputeFEPTA::restore_box() void ComputeFEPTA::allocate_storage() { nmax = atom->nmax; - memory->create(x_orig,nmax,3,"fep:x_orig"); - memory->create(f_orig,nmax,3,"fep:f_orig"); - memory->create(peatom_orig,nmax,"fep:peatom_orig"); - memory->create(pvatom_orig,nmax,6,"fep:pvatom_orig"); + memory->create(x_orig, nmax, 3, "fep:x_orig"); + memory->create(f_orig, nmax, 3, "fep:f_orig"); + memory->create(peatom_orig, nmax, "fep:peatom_orig"); + memory->create(pvatom_orig, nmax, 6, "fep:pvatom_orig"); if (force->kspace) { - memory->create(keatom_orig,nmax,"fep:keatom_orig"); - memory->create(kvatom_orig,nmax,6,"fep:kvatom_orig"); + memory->create(keatom_orig, nmax, "fep:keatom_orig"); + memory->create(kvatom_orig, nmax, 6, "fep:kvatom_orig"); } } @@ -344,7 +326,6 @@ void ComputeFEPTA::deallocate_storage() pvatom_orig = kvatom_orig = nullptr; } - /* ---------------------------------------------------------------------- backup and restore arrays with position, force, energy, virial ------------------------------------------------------------------------- */ @@ -361,7 +342,7 @@ void ComputeFEPTA::backup_xfev() x_orig[i][1] = x[i][1]; x_orig[i][2] = x[i][2]; } - + double **f = atom->f; for (i = 0; i < natom; i++) { f_orig[i][0] = f[i][0]; @@ -373,10 +354,10 @@ void ComputeFEPTA::backup_xfev() eng_coul_orig = force->pair->eng_coul; if (atom->molecular != Atom::ATOMIC) { - if (force->bond) eng_bond_orig = force->bond->energy; - if (force->angle) eng_angle_orig = force->angle->energy; - if (force->dihedral) eng_dihedral_orig = force->dihedral->energy; - if (force->improper) eng_improper_orig = force->improper->energy; + if (force->bond) eng_bond_orig = force->bond->energy; + if (force->angle) eng_angle_orig = force->angle->energy; + if (force->dihedral) eng_dihedral_orig = force->dihedral->energy; + if (force->improper) eng_improper_orig = force->improper->energy; } pvirial_orig[0] = force->pair->virial[0]; @@ -388,8 +369,7 @@ void ComputeFEPTA::backup_xfev() if (update->eflag_atom) { double *peatom = force->pair->eatom; - for (i = 0; i < natom; i++) - peatom_orig[i] = peatom[i]; + for (i = 0; i < natom; i++) peatom_orig[i] = peatom[i]; } if (update->vflag_atom) { double **pvatom = force->pair->vatom; @@ -414,8 +394,7 @@ void ComputeFEPTA::backup_xfev() if (update->eflag_atom) { double *keatom = force->kspace->eatom; - for (i = 0; i < natom; i++) - keatom_orig[i] = keatom[i]; + for (i = 0; i < natom; i++) keatom_orig[i] = keatom[i]; } if (update->vflag_atom) { double **kvatom = force->kspace->vatom; @@ -472,8 +451,7 @@ void ComputeFEPTA::restore_xfev() if (update->eflag_atom) { double *peatom = force->pair->eatom; - for (i = 0; i < natom; i++) - peatom[i] = peatom_orig[i]; + for (i = 0; i < natom; i++) peatom[i] = peatom_orig[i]; } if (update->vflag_atom) { double **pvatom = force->pair->vatom; @@ -498,8 +476,7 @@ void ComputeFEPTA::restore_xfev() if (update->eflag_atom) { double *keatom = force->kspace->eatom; - for (i = 0; i < natom; i++) - keatom[i] = keatom_orig[i]; + for (i = 0; i < natom; i++) keatom[i] = keatom_orig[i]; } if (update->vflag_atom) { double **kvatom = force->kspace->vatom; @@ -514,4 +491,3 @@ void ComputeFEPTA::restore_xfev() } } } - From 82d0a55862413cbe272be6ba3a8c0a8d25455793 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Mon, 28 Mar 2022 15:26:20 -0600 Subject: [PATCH 044/130] remove merge conflict message --- src/MDI/mdi_engine.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 9846112f90..81f5176932 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -584,7 +584,6 @@ void MDIEngine::mdi_md() if (flag_velocities) adjust_velocities(); } -<<<<<<< HEAD // engine is now at @INIT_MD node // receive >NITERATE command if driver sends, else niterate = -1 // any @ command from driver will start the simulation From db5e4e05a8e1053ae3f60c049dd37f9d407af1ee Mon Sep 17 00:00:00 2001 From: davidfir3 <491197586@qq.com> Date: Tue, 29 Mar 2022 15:35:23 +0800 Subject: [PATCH 045/130] fix bug that happens when fix ave/time Nfreq < thermo freq --- src/FEP/compute_fep_ta.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/FEP/compute_fep_ta.cpp b/src/FEP/compute_fep_ta.cpp index 24e5b21959..70fdb5c0b0 100644 --- a/src/FEP/compute_fep_ta.cpp +++ b/src/FEP/compute_fep_ta.cpp @@ -165,6 +165,30 @@ void ComputeFEPTA::compute_vector() backup_xfev(); // backup position, force, energy, virial array values backup_box(); // backup box size + timer->stamp(); + if (force->pair && force->pair->compute_flag) { + force->pair->compute(eflag, vflag); + timer->stamp(Timer::PAIR); + } + + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) force->bond->compute(eflag, vflag); + if (force->angle) force->angle->compute(eflag, vflag); + if (force->dihedral) force->dihedral->compute(eflag, vflag); + if (force->improper) force->improper->compute(eflag, vflag); + timer->stamp(Timer::BOND); + } + + if (force->kspace && force->kspace->compute_flag) { + force->kspace->compute(eflag, vflag); + timer->stamp(Timer::KSPACE); + } + + // accumulate force/energy/virial from /gpu pair styles + // this is required as to empty the answer queue, + // otherwise the force compute on the GPU in the next step would be incorrect + if (fixgpu) fixgpu->post_force(vflag); + pe0 = compute_pe(); change_box(); From faacf575b55e32010af4a7c9b0a637c328d372c4 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Tue, 29 Mar 2022 14:20:44 -0600 Subject: [PATCH 046/130] add support for >+FORCES command --- doc/src/mdi.rst | 7 +- src/MDI/mdi_engine.cpp | 176 ++++++++++++++++++++++------------------- 2 files changed, 97 insertions(+), 86 deletions(-) diff --git a/doc/src/mdi.rst b/doc/src/mdi.rst index ee8196e37c..9ba3ba82dd 100644 --- a/doc/src/mdi.rst +++ b/doc/src/mdi.rst @@ -82,7 +82,9 @@ the driver for LAMMPS to send it information. Command that start with * - FORCES or +FORCES + - Send forces to add to each atom (3N values) * - FORCES or >+FORCES or +FORCES command sends per-atom forces from the driver to LAMMPS -which it adds to current forces (instead of replacing them). - While LAMMPS is at its @ENDSTEP node, the following standard MDI commands are supported, as documented above: FORCES") == 0) { receive_double3(FORCE); + } else if (strcmp(command,">+FORCES") == 0) { + receive_double3(ADDFORCE); + } else if (strcmp(command,">NATOMS") == 0) { receive_natoms(); @@ -456,113 +459,114 @@ void MDIEngine::mdi_commands() // default node, MDI standard commands MDI_Register_node("@DEFAULT"); - MDI_Register_command("@DEFAULT", "<@"); - MDI_Register_command("@DEFAULT", "CELL"); - MDI_Register_command("@DEFAULT", ">CELL_DISPL"); - MDI_Register_command("@DEFAULT", ">CHARGES"); - MDI_Register_command("@DEFAULT", ">COORDS"); - MDI_Register_command("@DEFAULT", ">NATOMS"); - MDI_Register_command("@DEFAULT", ">TYPES"); - MDI_Register_command("@DEFAULT", ">VELOCITIES"); - MDI_Register_command("@DEFAULT", "@INIT_MD"); - MDI_Register_command("@DEFAULT", "@INIT_OPTG"); - MDI_Register_command("@DEFAULT", "EXIT"); + MDI_Register_command("@DEFAULT","<@"); + MDI_Register_command("@DEFAULT","CELL"); + MDI_Register_command("@DEFAULT",">CELL_DISPL"); + MDI_Register_command("@DEFAULT",">CHARGES"); + MDI_Register_command("@DEFAULT",">COORDS"); + MDI_Register_command("@DEFAULT",">NATOMS"); + MDI_Register_command("@DEFAULT",">TYPES"); + MDI_Register_command("@DEFAULT",">VELOCITIES"); + MDI_Register_command("@DEFAULT","@INIT_MD"); + MDI_Register_command("@DEFAULT","@INIT_OPTG"); + MDI_Register_command("@DEFAULT","EXIT"); // default node, custom commands added by LAMMPS - MDI_Register_command("@DEFAULT", "NBYTES"); - MDI_Register_command("@DEFAULT", "COMMAND"); - MDI_Register_command("@DEFAULT", "COMMANDS"); - MDI_Register_command("@DEFAULT", "INFILE"); - MDI_Register_command("@DEFAULT", "NITERATE"); - MDI_Register_command("@INIT_MD", "@"); - MDI_Register_command("@INIT_MD", "@DEFAULT"); - MDI_Register_command("@INIT_MD", "@COORDS"); - MDI_Register_command("@INIT_MD", "@FORCES"); - MDI_Register_command("@INIT_MD", "@ENDSTEP"); - MDI_Register_command("@INIT_MD", "EXIT"); + MDI_Register_command("@INIT_MD","<@"); + MDI_Register_command("@INIT_MD",">NITERATE"); + MDI_Register_command("@INIT_MD","@"); + MDI_Register_command("@INIT_MD","@DEFAULT"); + MDI_Register_command("@INIT_MD","@COORDS"); + MDI_Register_command("@INIT_MD","@FORCES"); + MDI_Register_command("@INIT_MD","@ENDSTEP"); + MDI_Register_command("@INIT_MD","EXIT"); // node for setting up and running a minimization MDI_Register_node("@INIT_OPTG"); - MDI_Register_command("@INIT_OPTG", "<@"); - MDI_Register_command("@INIT_OPTG", ">TOLERANCE"); - MDI_Register_command("@INIT_OPTG", "@"); - MDI_Register_command("@INIT_OPTG", "@DEFAULT"); - MDI_Register_command("@INIT_OPTG", "@COORDS"); - MDI_Register_command("@INIT_OPTG", "@FORCES"); - MDI_Register_command("@INIT_OPTG", "EXIT"); + MDI_Register_command("@INIT_OPTG","<@"); + MDI_Register_command("@INIT_OPTG",">TOLERANCE"); + MDI_Register_command("@INIT_OPTG","@"); + MDI_Register_command("@INIT_OPTG","@DEFAULT"); + MDI_Register_command("@INIT_OPTG","@COORDS"); + MDI_Register_command("@INIT_OPTG","@FORCES"); + MDI_Register_command("@INIT_OPTG","EXIT"); // node at POST_INTEGRATE location in timestep // only used if fix MDI/ENGINE is instantiated MDI_Register_node("@COORDS"); - MDI_Register_command("@COORDS", "<@"); - MDI_Register_command("@COORDS", "COORDS"); - MDI_Register_command("@COORDS", "@"); - MDI_Register_command("@COORDS", "@DEFAULT"); - MDI_Register_command("@COORDS", "@COORDS"); - MDI_Register_command("@COORDS", "@FORCES"); - MDI_Register_command("@COORDS", "@ENDSTEP"); - MDI_Register_command("@COORDS", "EXIT"); + MDI_Register_command("@COORDS","<@"); + MDI_Register_command("@COORDS","COORDS"); + MDI_Register_command("@COORDS","@"); + MDI_Register_command("@COORDS","@DEFAULT"); + MDI_Register_command("@COORDS","@COORDS"); + MDI_Register_command("@COORDS","@FORCES"); + MDI_Register_command("@COORDS","@ENDSTEP"); + MDI_Register_command("@COORDS","EXIT"); // node at POST_FORCE location in timestep // only used if fix MDI/ENGINE is instantiated MDI_Register_node("@FORCES"); - MDI_Register_callback("@FORCES", ">FORCES"); - MDI_Register_callback("@FORCES", ">+FORCES"); - MDI_Register_command("@FORCES", "<@"); - MDI_Register_command("@FORCES", "FORCES"); - MDI_Register_command("@FORCES", "@"); - MDI_Register_command("@FORCES", "@DEFAULT"); - MDI_Register_command("@FORCES", "@COORDS"); - MDI_Register_command("@FORCES", "@FORCES"); - MDI_Register_command("@FORCES", "@ENDSTEP"); - MDI_Register_command("@FORCES", "EXIT"); + MDI_Register_callback("@FORCES",">FORCES"); + MDI_Register_callback("@FORCES",">+FORCES"); + MDI_Register_command("@FORCES","<@"); + MDI_Register_command("@FORCES","FORCES"); + MDI_Register_command("@FORCES",">+FORCES"); + MDI_Register_command("@FORCES","@"); + MDI_Register_command("@FORCES","@DEFAULT"); + MDI_Register_command("@FORCES","@COORDS"); + MDI_Register_command("@FORCES","@FORCES"); + MDI_Register_command("@FORCES","@ENDSTEP"); + MDI_Register_command("@FORCES","EXIT"); // node at END_OF_STEP location in timestep // only used if fix MDI/ENGINE is instantiated MDI_Register_node("@ENDSTEP"); - MDI_Register_command("@ENDSTEP", "<@"); - MDI_Register_command("@ENDSTEP", "f; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + f[i][0] += buf3[3*ilocal+0] * mdi2lmp_force; + f[i][1] += buf3[3*ilocal+1] * mdi2lmp_force; + f[i][2] += buf3[3*ilocal+2] * mdi2lmp_force; + } } } From ff3ac64b7e377a49275c6e47663b43c89d8e957c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 30 Mar 2022 03:32:26 -0400 Subject: [PATCH 047/130] spelling --- doc/src/package.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/package.rst b/doc/src/package.rst index a037c91999..7f32534a25 100644 --- a/doc/src/package.rst +++ b/doc/src/package.rst @@ -473,8 +473,8 @@ will use a different (transposed) memory layout to build the neigh list on GPUs. This can be faster in some cases (e.g. ReaxFF HNS benchmark) but slower in others (e.g. Lennard Jones benchmark). The copy between different memory layouts is done out of place and -therefore doubles the memory overhead of the neigh list, which can be -signicant. +therefore doubles the memory overhead of the neigh list, which can +be significant. The *newton* keyword sets the Newton flags for pairwise and bonded interactions to *off* or *on*, the same as the :doc:`newton ` From 999c880dfd1b2ca4d06e055d0ec08e252dcc9510 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 30 Mar 2022 07:12:25 -0400 Subject: [PATCH 048/130] simplify parsing numbers and reduce usage of BIGINT_FORMAT --- src/read_data.cpp | 112 ++++++++++++++---------------------------- src/reader_native.cpp | 10 ++-- 2 files changed, 40 insertions(+), 82 deletions(-) diff --git a/src/read_data.cpp b/src/read_data.cpp index a46602d84a..9ec63bddf9 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -1013,114 +1013,80 @@ void ReadData::header(int firstpass) // search line for header keyword and set corresponding variable // customize for new header lines - // check for triangles before angles so "triangles" not matched as "angles" + int extra_flag_value = 0; - int rv; + auto words = utils::split_words(line); if (utils::strmatch(line,"^\\s*\\d+\\s+atoms\\s")) { - rv = sscanf(line,BIGINT_FORMAT,&natoms); - if (rv != 1) - error->all(FLERR,"Could not parse 'atoms' line in data file header"); + natoms = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->natoms = natoms; else if (firstpass) atom->natoms += natoms; } else if (utils::strmatch(line,"^\\s*\\d+\\s+ellipsoids\\s")) { - if (!avec_ellipsoid) - error->all(FLERR,"No ellipsoids allowed with this atom style"); - rv = sscanf(line,BIGINT_FORMAT,&nellipsoids); - if (rv != 1) - error->all(FLERR,"Could not parse 'ellipsoids' line in data file header"); + if (!avec_ellipsoid) error->all(FLERR,"No ellipsoids allowed with this atom style"); + nellipsoids = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nellipsoids = nellipsoids; else if (firstpass) atom->nellipsoids += nellipsoids; } else if (utils::strmatch(line,"^\\s*\\d+\\s+lines\\s")) { - if (!avec_line) - error->all(FLERR,"No lines allowed with this atom style"); - rv = sscanf(line,BIGINT_FORMAT,&nlines); - if (rv != 1) - error->all(FLERR,"Could not parse 'lines' line in data file header"); + if (!avec_line) error->all(FLERR,"No lines allowed with this atom style"); + nlines = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nlines = nlines; else if (firstpass) atom->nlines += nlines; } else if (utils::strmatch(line,"^\\s*\\d+\\s+triangles\\s")) { - if (!avec_tri) - error->all(FLERR,"No triangles allowed with this atom style"); - rv = sscanf(line,BIGINT_FORMAT,&ntris); - if (rv != 1) - error->all(FLERR,"Could not parse 'triangles' line in data file header"); + if (!avec_tri) error->all(FLERR,"No triangles allowed with this atom style"); + ntris = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->ntris = ntris; else if (firstpass) atom->ntris += ntris; } else if (utils::strmatch(line,"^\\s*\\d+\\s+bodies\\s")) { - if (!avec_body) - error->all(FLERR,"No bodies allowed with this atom style"); - rv = sscanf(line,BIGINT_FORMAT,&nbodies); - if (rv != 1) - error->all(FLERR,"Could not parse 'bodies' line in data file header"); + if (!avec_body) error->all(FLERR,"No bodies allowed with this atom style"); + nbodies = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nbodies = nbodies; else if (firstpass) atom->nbodies += nbodies; } else if (utils::strmatch(line,"^\\s*\\d+\\s+bonds\\s")) { - rv = sscanf(line,BIGINT_FORMAT,&nbonds); - if (rv != 1) - error->all(FLERR,"Could not parse 'bonds' line in data file header"); + nbonds = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nbonds = nbonds; else if (firstpass) atom->nbonds += nbonds; } else if (utils::strmatch(line,"^\\s*\\d+\\s+angles\\s")) { - rv = sscanf(line,BIGINT_FORMAT,&nangles); - if (rv != 1) - error->all(FLERR,"Could not parse 'angles' line in data file header"); + nangles = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nangles = nangles; else if (firstpass) atom->nangles += nangles; } else if (utils::strmatch(line,"^\\s*\\d+\\s+dihedrals\\s")) { - rv = sscanf(line,BIGINT_FORMAT,&ndihedrals); - if (rv != 1) - error->all(FLERR,"Could not parse 'dihedrals' line in data file header"); + ndihedrals = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->ndihedrals = ndihedrals; else if (firstpass) atom->ndihedrals += ndihedrals; } else if (utils::strmatch(line,"^\\s*\\d+\\s+impropers\\s")) { - rv = sscanf(line,BIGINT_FORMAT,&nimpropers); - if (rv != 1) - error->all(FLERR,"Could not parse 'impropers' line in data file header"); + nimpropers = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nimpropers = nimpropers; else if (firstpass) atom->nimpropers += nimpropers; // Atom class type settings are only set by first data file } else if (utils::strmatch(line,"^\\s*\\d+\\s+atom\\s+types\\s")) { - rv = sscanf(line,"%d",&ntypes); - if (rv != 1) - error->all(FLERR,"Could not parse 'atom types' line in data file header"); + ntypes = utils::inumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->ntypes = ntypes + extra_atom_types; } else if (utils::strmatch(line,"\\s*\\d+\\s+bond\\s+types\\s")) { - rv = sscanf(line,"%d",&nbondtypes); - if (rv != 1) - error->all(FLERR,"Could not parse 'bond types' line in data file header"); + nbondtypes = utils::inumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nbondtypes = nbondtypes + extra_bond_types; } else if (utils::strmatch(line,"^\\s*\\d+\\s+angle\\s+types\\s")) { - rv = sscanf(line,"%d",&nangletypes); - if (rv != 1) - error->all(FLERR,"Could not parse 'angle types' line in data file header"); + nangletypes = utils::inumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nangletypes = nangletypes + extra_angle_types; } else if (utils::strmatch(line,"^\\s*\\d+\\s+dihedral\\s+types\\s")) { - rv = sscanf(line,"%d",&ndihedraltypes); - if (rv != 1) - error->all(FLERR,"Could not parse 'dihedral types' line in data file header"); - if (addflag == NONE) - atom->ndihedraltypes = ndihedraltypes + extra_dihedral_types; + ndihedraltypes = utils::inumeric(FLERR, words[0], false, lmp); + if (addflag == NONE) atom->ndihedraltypes = ndihedraltypes + extra_dihedral_types; } else if (utils::strmatch(line,"^\\s*\\d+\\s+improper\\s+types\\s")) { - rv = sscanf(line,"%d",&nimpropertypes); - if (rv != 1) - error->all(FLERR,"Could not parse 'improper types' line in data file header"); - if (addflag == NONE) - atom->nimpropertypes = nimpropertypes + extra_improper_types; + nimpropertypes = utils::inumeric(FLERR, words[0], false, lmp); + if (addflag == NONE) atom->nimpropertypes = nimpropertypes + extra_improper_types; // these settings only used by first data file // also, these are obsolescent. we parse them to maintain backward @@ -1129,45 +1095,41 @@ void ReadData::header(int firstpass) // the input and the data file, we use the larger of the two. } else if (strstr(line,"extra bond per atom")) { - if (addflag == NONE) sscanf(line,"%d",&extra_flag_value); + if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp); atom->extra_bond_per_atom = MAX(atom->extra_bond_per_atom,extra_flag_value); } else if (strstr(line,"extra angle per atom")) { - if (addflag == NONE) sscanf(line,"%d",&extra_flag_value); + if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp); atom->extra_angle_per_atom = MAX(atom->extra_angle_per_atom,extra_flag_value); } else if (strstr(line,"extra dihedral per atom")) { - if (addflag == NONE) sscanf(line,"%d",&extra_flag_value); + if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp); atom->extra_dihedral_per_atom = MAX(atom->extra_dihedral_per_atom,extra_flag_value); } else if (strstr(line,"extra improper per atom")) { - if (addflag == NONE) sscanf(line,"%d",&extra_flag_value); + if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp); atom->extra_improper_per_atom = MAX(atom->extra_improper_per_atom,extra_flag_value); } else if (strstr(line,"extra special per atom")) { - if (addflag == NONE) sscanf(line,"%d",&extra_flag_value); + if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp); force->special_extra = MAX(force->special_extra,extra_flag_value); // local copy of box info // so can treat differently for first vs subsequent data files } else if (utils::strmatch(line,"^\\s*\\f+\\s+\\f+\\s+xlo\\s+xhi\\s")) { - rv = sscanf(line,"%lg %lg",&boxlo[0],&boxhi[0]); - if (rv != 2) - error->all(FLERR,"Could not parse 'xlo xhi' line in data file header"); + boxlo[0] = utils::numeric(FLERR, words[0], false, lmp); + boxhi[0] = utils::numeric(FLERR, words[1], false, lmp); } else if (utils::strmatch(line,"^\\s*\\f+\\s+\\f+\\s+ylo\\s+yhi\\s")) { - rv = sscanf(line,"%lg %lg",&boxlo[1],&boxhi[1]); - if (rv != 2) - error->all(FLERR,"Could not parse 'ylo yhi' line in data file header"); + boxlo[1] = utils::numeric(FLERR, words[0], false, lmp); + boxhi[1] = utils::numeric(FLERR, words[1], false, lmp); } else if (utils::strmatch(line,"^\\s*\\f+\\s+\\f+\\s+zlo\\s+zhi\\s")) { - rv = sscanf(line,"%lg %lg",&boxlo[2],&boxhi[2]); - if (rv != 2) - error->all(FLERR,"Could not parse 'zlo zhi' line in data file header"); + boxlo[2] = utils::numeric(FLERR, words[0], false, lmp); + boxhi[2] = utils::numeric(FLERR, words[1], false, lmp); - } else if (utils::strmatch(line,"^\\s*\\f+\\s+\\f+\\s+\\f+" - "\\s+xy\\s+xz\\s+yz\\s")) { + } else if (utils::strmatch(line,"^\\s*\\f+\\s+\\f+\\s+\\f+\\s+xy\\s+xz\\s+yz\\s")) { triclinic = 1; - rv = sscanf(line,"%lg %lg %lg",&xy,&xz,&yz); - if (rv != 3) - error->all(FLERR,"Could not parse 'xy xz yz' line in data file header"); + xy = utils::numeric(FLERR, words[0], false, lmp); + xz = utils::numeric(FLERR, words[0], false, lmp); + yz = utils::numeric(FLERR, words[0], false, lmp); } else break; } diff --git a/src/reader_native.cpp b/src/reader_native.cpp index 32b2279a60..efa9709942 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -101,9 +101,7 @@ int ReaderNative::read_time(bigint &ntimestep) error->one(FLERR,"Dump file is incorrectly formatted"); read_lines(1); - int rv = sscanf(line,BIGINT_FORMAT,&ntimestep); - if (rv != 1) - error->one(FLERR,"Dump file is incorrectly formatted"); + ntimestep = utils::bnumeric(FLERR, utils::trim(line), true, lmp); } return 0; } @@ -140,10 +138,8 @@ void ReaderNative::skip() } else { read_lines(2); - bigint natoms; - int rv = sscanf(line,BIGINT_FORMAT,&natoms); - if (rv != 1) error->one(FLERR,"Dump file is incorrectly formatted"); - + // parse natoms value so we error out on incorrectly formatted dumps + utils::bnumeric(FLERR, utils::trim(line), true, lmp); read_lines(5); // invoke read_lines() in chunks no larger than MAXSMALLINT From 9aad583c7d0d75d78363f79e657afe42954dc665 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 30 Mar 2022 07:38:33 -0400 Subject: [PATCH 049/130] more parsing updates --- src/reader_native.cpp | 49 +++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/src/reader_native.cpp b/src/reader_native.cpp index efa9709942..911de417eb 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -138,14 +138,12 @@ void ReaderNative::skip() } else { read_lines(2); - // parse natoms value so we error out on incorrectly formatted dumps - utils::bnumeric(FLERR, utils::trim(line), true, lmp); + bigint nremain = utils::bnumeric(FLERR, utils::trim(line), true, lmp); read_lines(5); // invoke read_lines() in chunks no larger than MAXSMALLINT int nchunk; - bigint nremain = natoms; while (nremain) { nchunk = MIN(nremain,MAXSMALLINT); read_lines(nchunk); @@ -226,16 +224,13 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, return natoms; } - if (is_known_magic_str() && revision > 0x0001) { // newer format includes units string, columns string // and time read_buf(&len, sizeof(int), 1); - if (len > 0) { - // has units - unit_style = read_binary_str(len); - } + // has units + if (len > 0) unit_style = read_binary_str(len); char flag = 0; read_buf(&flag, sizeof(char), 1); @@ -255,12 +250,9 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, ichunk = 0; iatom_chunk = 0; } else { - int rv; read_lines(2); - rv = sscanf(line,BIGINT_FORMAT,&natoms); - if (rv != 1) - error->one(FLERR,"Dump file is incorrectly formatted"); + natoms = utils::bnumeric(FLERR, utils::trim(line), true, lmp); boxinfo = 1; triclinic = 0; @@ -268,20 +260,27 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, read_lines(1); if (line[strlen("ITEM: BOX BOUNDS ")] == 'x') triclinic = 1; - read_lines(1); - if (!triclinic) rv = 2 - sscanf(line,"%lg %lg",&box[0][0],&box[0][1]); - else rv = 3 - sscanf(line,"%lg %lg %lg",&box[0][0],&box[0][1],&box[0][2]); - if (rv != 0) error->one(FLERR,"Dump file is incorrectly formatted"); + try { + read_lines(1); + ValueTokenizer values(line); + box[0][0] = values.next_double(); + box[0][1] = values.next_double(); + if (triclinic) box[0][2] = values.next_double(); - read_lines(1); - if (!triclinic) rv = 2 - sscanf(line,"%lg %lg",&box[1][0],&box[1][1]); - else rv = 3 - sscanf(line,"%lg %lg %lg",&box[1][0],&box[1][1],&box[1][2]); - if (rv != 0) error->one(FLERR,"Dump file is incorrectly formatted"); + read_lines(1); + values = ValueTokenizer(line); + box[1][0] = values.next_double(); + box[1][1] = values.next_double(); + if (triclinic) box[1][2] = values.next_double(); - read_lines(1); - if (!triclinic) rv = 2 - sscanf(line,"%lg %lg",&box[2][0],&box[2][1]); - else rv = 3 - sscanf(line,"%lg %lg %lg",&box[2][0],&box[2][1],&box[2][2]); - if (rv != 0) error->one(FLERR,"Dump file is incorrectly formatted"); + read_lines(1); + values = ValueTokenizer(line); + box[2][0] = values.next_double(); + box[2][1] = values.next_double(); + if (triclinic) box[2][2] = values.next_double(); + } catch (std::exception &e) { + error->one(FLERR, "Dump file is incorrectly formatted: {}", e.what()); + } read_lines(1); @@ -291,7 +290,7 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, // extract column labels and match to requested fields - labelline = &line[strlen("ITEM: ATOMS ")]; + labelline = line + strlen("ITEM: ATOMS "); } Tokenizer tokens(labelline); From 2517d1fb559ed260aea56badaea38231a88cd32f Mon Sep 17 00:00:00 2001 From: Matt Bettencourt Date: Fri, 4 Feb 2022 05:26:33 -0800 Subject: [PATCH 050/130] Converted DPD-BASIC-EXT to use Kokkos --- src/DPD-BASIC/pair_dpd_ext.cpp | 2 + src/DPD-BASIC/pair_dpd_ext.h | 8 +- src/KOKKOS/Install.sh | 2 + src/KOKKOS/pair_dpd_ext_kokkos.cpp | 497 +++++++++++++++++++++++++++++ src/KOKKOS/pair_dpd_ext_kokkos.h | 126 ++++++++ 5 files changed, 631 insertions(+), 4 deletions(-) create mode 100644 src/KOKKOS/pair_dpd_ext_kokkos.cpp create mode 100644 src/KOKKOS/pair_dpd_ext_kokkos.h diff --git a/src/DPD-BASIC/pair_dpd_ext.cpp b/src/DPD-BASIC/pair_dpd_ext.cpp index 5e45790913..19cce06d5e 100644 --- a/src/DPD-BASIC/pair_dpd_ext.cpp +++ b/src/DPD-BASIC/pair_dpd_ext.cpp @@ -47,6 +47,8 @@ PairDPDExt::PairDPDExt(LAMMPS *lmp) : Pair(lmp) PairDPDExt::~PairDPDExt() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); diff --git a/src/DPD-BASIC/pair_dpd_ext.h b/src/DPD-BASIC/pair_dpd_ext.h index 66df395406..920c805696 100644 --- a/src/DPD-BASIC/pair_dpd_ext.h +++ b/src/DPD-BASIC/pair_dpd_ext.h @@ -28,11 +28,11 @@ class PairDPDExt : public Pair { public: PairDPDExt(class LAMMPS *); ~PairDPDExt() override; - void compute(int, int) override; + virtual void compute(int, int) override; void settings(int, char **) override; void coeff(int, char **) override; - void init_style() override; - double init_one(int, int) override; + virtual void init_style() override; + virtual double init_one(int, int) override; void write_restart(FILE *) override; void read_restart(FILE *) override; void write_restart_settings(FILE *) override; @@ -50,7 +50,7 @@ class PairDPDExt : public Pair { double **ws, **wsT; class RanMars *random; - void allocate(); + virtual void allocate(); }; } // namespace LAMMPS_NS diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index f56ab45914..da6bd8f1e3 100755 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -230,6 +230,8 @@ action pair_coul_long_kokkos.cpp pair_coul_long.cpp action pair_coul_long_kokkos.h pair_coul_long.h action pair_coul_wolf_kokkos.cpp action pair_coul_wolf_kokkos.h +action pair_dpd_ext_kokkos.cpp pair_dpd_ext.cpp +action pair_dpd_ext_kokkos.h pair_dpd_ext.h action pair_dpd_fdt_energy_kokkos.cpp pair_dpd_fdt_energy.cpp action pair_dpd_fdt_energy_kokkos.h pair_dpd_fdt_energy.h action pair_eam_kokkos.cpp pair_eam.cpp diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp new file mode 100644 index 0000000000..9e743f6514 --- /dev/null +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -0,0 +1,497 @@ +// clang-format off +/* ---------------------------------------------------------------------- + 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: Stan Moore (Sandia) +------------------------------------------------------------------------- */ + +#include "pair_dpd_ext_kokkos.h" + +#include "atom.h" +#include "atom_kokkos.h" +#include "memory_kokkos.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "random_mars.h" +#include "update.h" +#include "atom_masks.h" +#include "kokkos.h" + +#include + +namespace LAMMPS_NS { + +#define EPSILON 1.0e-10 + + +template +PairDPDExtKokkos::PairDPDExtKokkos(class LAMMPS *lmp) : + PairDPDExt(lmp) , +#ifdef DPD_USE_RAN_MARS + rand_pool(0 /* unused */, lmp) +#else + rand_pool() +#endif + +{ + kokkosable = 1; + atomKK = (AtomKokkos *) atom; + execution_space = ExecutionSpaceFromDevice::space; + + datamask_read = X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; + +} + +/* ---------------------------------------------------------------------- */ +template +PairDPDExtKokkos::~PairDPDExtKokkos() { + if (copymode) return; + + +#ifdef DPD_USE_RAN_MARS + rand_pool.destroy(); +#endif + + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + + memoryKK->destroy_kokkos(k_cutsq,cutsq); + +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtKokkos::init_style() +{ + PairDPDExt::init_style(); + +#ifdef DPD_USE_RAN_MARS + rand_pool.init(random,seed); +#else + typedef Kokkos::Experimental::UniqueToken< + DeviceType, Kokkos::Experimental::UniqueTokenScope::Global> unique_token_type; + unique_token_type unique_token; + rand_pool.init(seed + comm->me,unique_token.size()); +#endif + + neighflag = lmp->kokkos->neighflag; + + if (force->newton_pair == 0 || neighflag == FULL ) + error->all(FLERR,"Must use half neighbor list style and newton on with pair dpd/ext/kk"); + + + auto request = neighbor->find_request(this); + request->set_kokkos_host(std::is_same::value && + !std::is_same::value); + request->set_kokkos_device(std::is_same::value); + + if (neighflag == FULL) + request->enable_full(); +} +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtKokkos::compute(int eflagin, int vflagin) +{ + eflag=eflagin;vflag=vflagin; + if (neighflag == FULL) no_virial_fdotr_compute = 1; + + ev_init(eflag,vflag); + + if (eflag_atom) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + d_eatom = k_eatom.template view(); + } + if (vflag_atom) { + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"pair:vatom"); + d_vatom = k_vatom.template view(); + } + + atomKK->sync(execution_space,X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK); + if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); + else atomKK->modified(execution_space,F_MASK); + + x = atomKK->k_x.view(); + v = atomKK->k_v.view(); + f = atomKK->k_f.view(); + type = atomKK->k_type.view(); + + k_cutsq.template sync(); + k_params.template sync(); + + special_lj[0] = force->special_lj[0]; + special_lj[1] = force->special_lj[1]; + special_lj[2] = force->special_lj[2]; + special_lj[3] = force->special_lj[3]; + + nlocal = atom->nlocal; + newton_pair = force->newton_pair; + dtinvsqrt = 1.0/sqrt(update->dt); + + NeighListKokkos* k_list = static_cast*>(list); + d_numneigh = k_list->d_numneigh; + d_neighbors = k_list->d_neighbors; + d_ilist = k_list->d_ilist; + // loop over neighbors of my atoms + + int inum=list->inum; + EV_FLOAT ev; + copymode = 1; + if (neighflag == HALF) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } else if (neighflag == HALFTHREAD) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } else if (neighflag == FULL) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } + + if (eflag_global) eng_vdwl += ev.evdwl; + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (vflag_fdotr) pair_virial_fdotr_compute(this); + + if (eflag_atom) { + k_eatom.template modify(); + k_eatom.template sync(); + } + + if (vflag_atom) { + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; +} +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtKokkos::operator() (TagDPDExtKokkos, const int &ii) const { + EV_FLOAT ev; + this->template operator()(TagDPDExtKokkos(), ii, ev); +} +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtKokkos::operator() (TagDPDExtKokkos, const int &ii, EV_FLOAT &ev) const { + + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_f = f; + + + int i,j,jj,jnum,itype,jtype; + double xtmp,ytmp,ztmp,delx,dely,delz,fpairx,fpairy,fpairz,fpair; + double vxtmp,vytmp,vztmp,delvx,delvy,delvz; + double rsq,r,rinv,dot,wd,wdPar,wdPerp,randnum,randnumx,randnumy,randnumz,factor_dpd; + double fx=0,fy=0,fz=0; + double evdwl=0; + i = d_ilist[ii]; + xtmp = x(i,0); + ytmp = x(i,1); + ztmp = x(i,2); + vxtmp = v(i,0); + vytmp = v(i,1); + vztmp = v(i,2); + itype = type(i); + jnum = d_numneigh[i]; +// printf("JNUM %d\n",jnum); + rand_type rand_gen = rand_pool.get_state(); + for (jj = 0; jj < jnum; jj++) { + double P[3][3]; + j = d_neighbors(i,jj); + factor_dpd = special_lj[sbmask(j)]; + j &= NEIGHMASK; + + delx = xtmp - x(j,0); + dely = ytmp - x(j,1); + delz = ztmp - x(j,2); + rsq = delx*delx + dely*dely + delz*delz; + jtype = type(j); + if (rsq < d_cutsq(itype,jtype)) { + r = sqrt(rsq); + if (r < EPSILON) continue; // r can be 0.0 in DPD systems + rinv = 1.0/r; + delvx = vxtmp - v(j,0); + delvy = vytmp - v(j,1); + delvz = vztmp - v(j,2); + dot = delx*delvx + dely*delvy + delz*delvz; + + P[0][0] = 1.0 - delx*delx*rinv*rinv; + P[0][1] = - delx*dely*rinv*rinv; + P[0][2] = - delx*delz*rinv*rinv; + + P[1][0] = P[0][1]; + P[1][1] = 1.0 - dely*dely*rinv*rinv; + P[1][2] = - dely*delz*rinv*rinv; + + P[2][0] = P[0][2]; + P[2][1] = P[1][2]; + P[2][2] = 1.0 - delz*delz*rinv*rinv; + + wd = 1.0 - r/params(itype,jtype).cut; + wdPar = pow(wd,params(itype,jtype).ws); + wdPerp = pow(wd,params(itype,jtype).wsT); + + randnum = rand_gen.normal(); + randnumx = rand_gen.normal(); + randnumy = rand_gen.normal(); + randnumz = rand_gen.normal(); + // conservative force + fpair = params(itype,jtype).a0*wd; + + // drag force - parallel + fpair -= params(itype,jtype).gamma*wdPar*wdPar*dot*rinv; + + // random force - parallel + fpair += params(itype,jtype).sigma*wdPar*randnum*dtinvsqrt; + + fpairx = fpair*rinv*delx; + fpairy = fpair*rinv*dely; + fpairz = fpair*rinv*delz; + + // drag force - perpendicular + fpairx -= params(itype,jtype).gammaT*wdPerp*wdPerp* + (P[0][0]*delvx + P[0][1]*delvy + P[0][2]*delvz); + fpairy -= params(itype,jtype).gammaT*wdPerp*wdPerp* + (P[1][0]*delvx + P[1][1]*delvy + P[1][2]*delvz); + fpairz -= params(itype,jtype).gammaT*wdPerp*wdPerp* + (P[2][0]*delvx + P[2][1]*delvy + P[2][2]*delvz); + + // random force - perpendicular + fpairx += params(itype,jtype).sigmaT*wdPerp* + (P[0][0]*randnumx + P[0][1]*randnumy + P[0][2]*randnumz)*dtinvsqrt; + fpairy += params(itype,jtype).sigmaT*wdPerp* + (P[1][0]*randnumx + P[1][1]*randnumy + P[1][2]*randnumz)*dtinvsqrt; + fpairz += params(itype,jtype).sigmaT*wdPerp* + (P[2][0]*randnumx + P[2][1]*randnumy + P[2][2]*randnumz)*dtinvsqrt; + + fpairx *= factor_dpd; + fpairy *= factor_dpd; + fpairz *= factor_dpd; + + fx += fpairx; + fy += fpairy; + fz += fpairz; + if ((neighflag==HALF || neighflag==HALFTHREAD) && (NEWTON_PAIR || j < nlocal) ) { + a_f(j,0) -= fpairx; + a_f(j,1) -= fpairy; + a_f(j,2) -= fpairz; + } + + if (eflag) { + // unshifted eng of conservative term: + // evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]); + // eng shifted to 0.0 at cutoff + evdwl = 0.5*params(itype,jtype).a0*params(itype,jtype).cut* wd*wd; + evdwl *= factor_dpd; + if (EVFLAG) + ev.evdwl += (((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR||(jtemplate ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); + } + } + a_f(i,0) += fx; + a_f(i,1) += fy; + a_f(i,2) += fz; + rand_pool.free_state(rand_gen); +} + + + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const +{ + const int EFLAG = eflag; + const int VFLAG = vflag_either; + + + // The eatom and vatom arrays are atomic for Half/Thread neighbor style + Kokkos::View::value,Kokkos::MemoryTraits::value> > v_eatom = k_eatom.view(); + Kokkos::View::value,Kokkos::MemoryTraits::value> > v_vatom = k_vatom.view(); + + if (EFLAG) { + if (eflag_atom) { + const E_FLOAT epairhalf = 0.5 * epair; + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) v_eatom[i] += epairhalf; + if (NEWTON_PAIR || j < nlocal) v_eatom[j] += epairhalf; + } else { + v_eatom[i] += epairhalf; + } + } + } + + if (VFLAG) { + const E_FLOAT v0 = delx*delx*fpair; + const E_FLOAT v1 = dely*dely*fpair; + const E_FLOAT v2 = delz*delz*fpair; + const E_FLOAT v3 = delx*dely*fpair; + const E_FLOAT v4 = delx*delz*fpair; + const E_FLOAT v5 = dely*delz*fpair; + + if (vflag_global) { + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + if (NEWTON_PAIR || j < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + } else { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + } + + if (vflag_atom) { + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) { + v_vatom(i,0) += 0.5*v0; + v_vatom(i,1) += 0.5*v1; + v_vatom(i,2) += 0.5*v2; + v_vatom(i,3) += 0.5*v3; + v_vatom(i,4) += 0.5*v4; + v_vatom(i,5) += 0.5*v5; + } + if (NEWTON_PAIR || j < nlocal) { + v_vatom(j,0) += 0.5*v0; + v_vatom(j,1) += 0.5*v1; + v_vatom(j,2) += 0.5*v2; + v_vatom(j,3) += 0.5*v3; + v_vatom(j,4) += 0.5*v4; + v_vatom(j,5) += 0.5*v5; + } + } else { + v_vatom(i,0) += 0.5*v0; + v_vatom(i,1) += 0.5*v1; + v_vatom(i,2) += 0.5*v2; + v_vatom(i,3) += 0.5*v3; + v_vatom(i,4) += 0.5*v4; + v_vatom(i,5) += 0.5*v5; + } + } + + } +} +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtKokkos::allocate() +{ + + PairDPDExt::allocate(); + int n = atom->ntypes; + + memory->destroy(cutsq); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + d_cutsq = k_cutsq.template view(); + + k_params = Kokkos::DualView("PairDPDExt::params",n+1,n+1); + params = k_params.template view(); + +} +template +KOKKOS_INLINE_FUNCTION +int PairDPDExtKokkos::sbmask(const int& j) const { + return j >> SBBITS & 3; +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +template +double PairDPDExtKokkos::init_one(int i, int j) +{ + double cutone = PairDPDExt::init_one(i,j); + + k_params.h_view(i,j).cut = cut[i][j]; + k_params.h_view(i,j).ws = ws[i][j]; + k_params.h_view(i,j).wsT = wsT[i][j]; + k_params.h_view(i,j).a0 = a0[i][j]; + k_params.h_view(i,j).gamma = gamma[i][j]; + k_params.h_view(i,j).sigma = sigma[i][j]; + k_params.h_view(i,j).gammaT = gammaT[i][j]; + k_params.h_view(i,j).sigmaT = sigmaT[i][j]; + k_params.h_view(j,i) = k_params.h_view(i,j); + + k_params.template modify(); + + k_cutsq.h_view(i,j) = cutone*cutone; + k_cutsq.h_view(j,i) = k_cutsq.h_view(i,j); + k_cutsq.template modify(); + + return cutone; +} +}//namespace + +namespace LAMMPS_NS { +template class PairDPDExtKokkos; +#ifdef LMP_KOKKOS_GPU +template class PairDPDExtKokkos; +#endif +} diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.h b/src/KOKKOS/pair_dpd_ext_kokkos.h new file mode 100644 index 0000000000..499bece5ed --- /dev/null +++ b/src/KOKKOS/pair_dpd_ext_kokkos.h @@ -0,0 +1,126 @@ +/* -*- 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(dpd/ext/kk,PairDPDExtKokkos); +PairStyle(dpd/ext/kk/device,PairDPDExtKokkos); +PairStyle(dpd/ext/kk/host,PairDPDExtKokkos); +// clang-format on +#else + +#ifndef LMP_PAIR_DPD_EXT_KOKKOS_H +#define LMP_PAIR_DPD_EXT_KOKKOS_H + +#include "pair_dpd_ext.h" +#include "pair_kokkos.h" +#include "kokkos_type.h" + +#if !defined(DPD_USE_RAN_MARS) && !defined(DPD_USE_Random_XorShift64) && !defined(Random_XorShift1024) +#define DPD_USE_Random_XorShift64 +#endif + +#ifdef DPD_USE_RAN_MARS +#include "rand_pool_wrap_kokkos.h" +#else +#include "Kokkos_Random.hpp" +#endif + +namespace LAMMPS_NS { + +template +class PairDPDExtKokkos : public PairDPDExt { + public: + typedef DeviceType device_type; + typedef ArrayTypes AT; + typedef EV_FLOAT value_type; + + PairDPDExtKokkos(class LAMMPS*); + ~PairDPDExtKokkos() override; + + virtual void allocate(); + + virtual void init_style(); + virtual double init_one(int i, int j); + virtual void compute(int, int); + + struct params_dpd { + KOKKOS_INLINE_FUNCTION + params_dpd() {cut=ws=wsT=a0=gamma=sigma=gammaT=sigmaT=0;} + KOKKOS_INLINE_FUNCTION + params_dpd(int /*i*/) {cut=ws=wsT=a0=gamma=sigma=gammaT=sigmaT=0;} + F_FLOAT cutsq,cut,ws,wsT,a0,gamma,sigma,gammaT,sigmaT; + }; + + template + struct TagDPDExtKokkos{}; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDExtKokkos, const int &i) const; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDExtKokkos, const int &i, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void ev_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const; +protected: + + double special_lj[4]; + int eflag,vflag; + int neighflag, nlocal,newton_pair; + double dtinvsqrt; + +#ifdef DPD_USE_RAN_MARS + RandPoolWrap rand_pool; + typedef RandWrap rand_type; +#elif defined(DPD_USE_Random_XorShift64) + Kokkos::Random_XorShift64_Pool rand_pool; + typedef typename Kokkos::Random_XorShift64_Pool::generator_type rand_type; +#elif defined(DPD_USE_Random_XorShift1024) + Kokkos::Random_XorShift1024_Pool rand_pool; + typedef typename Kokkos::Random_XorShift1024_Pool::generator_type rand_type; +#endif + typename AT::t_x_array_randomread x; + typename AT::t_x_array_randomread v; + typename AT::t_f_array f; + typename AT::t_int_1d_randomread type; + + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d_randomread d_ilist; + typename AT::t_int_1d_randomread d_numneigh; + + typename AT::tdual_ffloat_2d k_cutsq; + typename AT::t_ffloat_2d d_cutsq; + + Kokkos::DualView k_params; + typename Kokkos::DualView::t_dev_const_um params; + + DAT::tdual_efloat_1d k_eatom; + DAT::tdual_virial_array k_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; + + KOKKOS_INLINE_FUNCTION + int sbmask(const int& j) const; + friend void pair_virial_fdotr_compute(PairDPDExtKokkos*); + +}; +} +#endif +#endif From 69d32f286b2fcc6d5e22eb2c8450c266429a8bad Mon Sep 17 00:00:00 2001 From: Matt Bettencourt Date: Wed, 30 Mar 2022 08:40:46 +0200 Subject: [PATCH 051/130] Stan's patch --- src/Depend.sh | 1 + src/KOKKOS/pair_dpd_ext_kokkos.cpp | 97 +++++++++++++++--------------- src/KOKKOS/pair_dpd_ext_kokkos.h | 18 +++--- 3 files changed, 57 insertions(+), 59 deletions(-) diff --git a/src/Depend.sh b/src/Depend.sh index 5123354b1c..1de6edbb63 100755 --- a/src/Depend.sh +++ b/src/Depend.sh @@ -73,6 +73,7 @@ fi if (test $1 = "DPD-BASIC") then depend GPU + depend KOKKOS depend OPENMP depend INTEL fi diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp index 9e743f6514..2fde5e8095 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -13,7 +13,7 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Stan Moore (Sandia) + Contributing author: Matt Bettencourt (NVIDIA) ------------------------------------------------------------------------- */ #include "pair_dpd_ext_kokkos.h" @@ -35,7 +35,7 @@ #include -namespace LAMMPS_NS { +using namespace LAMMPS_NS; #define EPSILON 1.0e-10 @@ -48,7 +48,6 @@ PairDPDExtKokkos::PairDPDExtKokkos(class LAMMPS *lmp) : #else rand_pool() #endif - { kokkosable = 1; atomKK = (AtomKokkos *) atom; @@ -56,15 +55,14 @@ PairDPDExtKokkos::PairDPDExtKokkos(class LAMMPS *lmp) : datamask_read = X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - } /* ---------------------------------------------------------------------- */ + template PairDPDExtKokkos::~PairDPDExtKokkos() { if (copymode) return; - #ifdef DPD_USE_RAN_MARS rand_pool.destroy(); #endif @@ -73,11 +71,10 @@ PairDPDExtKokkos::~PairDPDExtKokkos() { memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->destroy_kokkos(k_cutsq,cutsq); - } /* ---------------------------------------------------------------------- */ - + template void PairDPDExtKokkos::init_style() { @@ -97,23 +94,23 @@ void PairDPDExtKokkos::init_style() if (force->newton_pair == 0 || neighflag == FULL ) error->all(FLERR,"Must use half neighbor list style and newton on with pair dpd/ext/kk"); - auto request = neighbor->find_request(this); request->set_kokkos_host(std::is_same::value && !std::is_same::value); request->set_kokkos_device(std::is_same::value); - if (neighflag == FULL) + if (neighflag == FULL) request->enable_full(); } + /* ---------------------------------------------------------------------- */ - + template void PairDPDExtKokkos::compute(int eflagin, int vflagin) { - eflag=eflagin;vflag=vflagin; + eflag = eflagin; vflag = vflagin; if (neighflag == FULL) no_virial_fdotr_compute = 1; - + ev_init(eflag,vflag); if (eflag_atom) { @@ -128,9 +125,7 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) } atomKK->sync(execution_space,X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK); - if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); - else atomKK->modified(execution_space,F_MASK); - + x = atomKK->k_x.view(); v = atomKK->k_v.view(); f = atomKK->k_f.view(); @@ -152,9 +147,10 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) d_numneigh = k_list->d_numneigh; d_neighbors = k_list->d_neighbors; d_ilist = k_list->d_ilist; + // loop over neighbors of my atoms - int inum=list->inum; + int inum = list->inum; EV_FLOAT ev; copymode = 1; if (neighflag == HALF) { @@ -204,9 +200,13 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) k_vatom.template modify(); k_vatom.template sync(); } - + copymode = 0; + + if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); + else atomKK->modified(execution_space,F_MASK); } + /* ---------------------------------------------------------------------- */ template @@ -223,13 +223,12 @@ void PairDPDExtKokkos::operator() (TagDPDExtKokkos::value,Kokkos::MemoryTraits::value> > a_f = f; - int i,j,jj,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,fpairx,fpairy,fpairz,fpair; double vxtmp,vytmp,vztmp,delvx,delvy,delvz; double rsq,r,rinv,dot,wd,wdPar,wdPerp,randnum,randnumx,randnumy,randnumz,factor_dpd; - double fx=0,fy=0,fz=0; - double evdwl=0; + double fx = 0,fy = 0,fz = 0; + double evdwl = 0; i = d_ilist[ii]; xtmp = x(i,0); ytmp = x(i,1); @@ -239,7 +238,6 @@ void PairDPDExtKokkos::operator() (TagDPDExtKokkos::operator() (TagDPDExtKokkos template @@ -354,19 +352,18 @@ void PairDPDExtKokkos::ev_tally(EV_FLOAT &ev, const int &i, const in const int EFLAG = eflag; const int VFLAG = vflag_either; - // The eatom and vatom arrays are atomic for Half/Thread neighbor style - Kokkos::View::value,Kokkos::MemoryTraits::value> > v_eatom = k_eatom.view(); - Kokkos::View::value,Kokkos::MemoryTraits::value> > v_vatom = k_vatom.view(); + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_eatom = k_eatom.view(); + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_vatom = k_vatom.view(); if (EFLAG) { if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) v_eatom[i] += epairhalf; - if (NEWTON_PAIR || j < nlocal) v_eatom[j] += epairhalf; + if (NEWTON_PAIR || i < nlocal) a_eatom[i] += epairhalf; + if (NEWTON_PAIR || j < nlocal) a_eatom[j] += epairhalf; } else { - v_eatom[i] += epairhalf; + a_eatom[i] += epairhalf; } } } @@ -410,39 +407,38 @@ void PairDPDExtKokkos::ev_tally(EV_FLOAT &ev, const int &i, const in if (vflag_atom) { if (NEIGHFLAG!=FULL) { if (NEWTON_PAIR || i < nlocal) { - v_vatom(i,0) += 0.5*v0; - v_vatom(i,1) += 0.5*v1; - v_vatom(i,2) += 0.5*v2; - v_vatom(i,3) += 0.5*v3; - v_vatom(i,4) += 0.5*v4; - v_vatom(i,5) += 0.5*v5; + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; } if (NEWTON_PAIR || j < nlocal) { - v_vatom(j,0) += 0.5*v0; - v_vatom(j,1) += 0.5*v1; - v_vatom(j,2) += 0.5*v2; - v_vatom(j,3) += 0.5*v3; - v_vatom(j,4) += 0.5*v4; - v_vatom(j,5) += 0.5*v5; + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; } } else { - v_vatom(i,0) += 0.5*v0; - v_vatom(i,1) += 0.5*v1; - v_vatom(i,2) += 0.5*v2; - v_vatom(i,3) += 0.5*v3; - v_vatom(i,4) += 0.5*v4; - v_vatom(i,5) += 0.5*v5; + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; } } - } } + /* ---------------------------------------------------------------------- */ template void PairDPDExtKokkos::allocate() { - PairDPDExt::allocate(); int n = atom->ntypes; @@ -452,8 +448,10 @@ void PairDPDExtKokkos::allocate() k_params = Kokkos::DualView("PairDPDExt::params",n+1,n+1); params = k_params.template view(); - } + +/* ---------------------------------------------------------------------- */ + template KOKKOS_INLINE_FUNCTION int PairDPDExtKokkos::sbmask(const int& j) const { @@ -487,7 +485,6 @@ double PairDPDExtKokkos::init_one(int i, int j) return cutone; } -}//namespace namespace LAMMPS_NS { template class PairDPDExtKokkos; diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.h b/src/KOKKOS/pair_dpd_ext_kokkos.h index 499bece5ed..886f9525f9 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.h +++ b/src/KOKKOS/pair_dpd_ext_kokkos.h @@ -44,15 +44,15 @@ class PairDPDExtKokkos : public PairDPDExt { typedef DeviceType device_type; typedef ArrayTypes AT; typedef EV_FLOAT value_type; - + PairDPDExtKokkos(class LAMMPS*); ~PairDPDExtKokkos() override; - virtual void allocate(); + void allocate() override; - virtual void init_style(); - virtual double init_one(int i, int j); - virtual void compute(int, int); + void init_style() override; + double init_one(int i, int j) override; + void compute(int, int) override; struct params_dpd { KOKKOS_INLINE_FUNCTION @@ -64,7 +64,7 @@ class PairDPDExtKokkos : public PairDPDExt { template struct TagDPDExtKokkos{}; - + template KOKKOS_INLINE_FUNCTION void operator () (TagDPDExtKokkos, const int &i) const; @@ -78,7 +78,7 @@ class PairDPDExtKokkos : public PairDPDExt { void ev_tally(EV_FLOAT &ev, const int &i, const int &j, const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; -protected: + private: double special_lj[4]; int eflag,vflag; @@ -103,7 +103,7 @@ protected: typename AT::t_neighbors_2d d_neighbors; typename AT::t_int_1d_randomread d_ilist; typename AT::t_int_1d_randomread d_numneigh; - + typename AT::tdual_ffloat_2d k_cutsq; typename AT::t_ffloat_2d d_cutsq; @@ -115,7 +115,7 @@ protected: DAT::tdual_virial_array k_vatom; typename AT::t_efloat_1d d_eatom; typename AT::t_virial_array d_vatom; - + KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const; friend void pair_virial_fdotr_compute(PairDPDExtKokkos*); From ddf93eb7baa0d98c13b4e84d26ff6951e4f8a0b3 Mon Sep 17 00:00:00 2001 From: Matt Bettencourt Date: Wed, 30 Mar 2022 15:42:09 +0200 Subject: [PATCH 052/130] removed unused var --- src/DPD-BASIC/pair_dpd_ext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DPD-BASIC/pair_dpd_ext.h b/src/DPD-BASIC/pair_dpd_ext.h index 920c805696..f01af7b34b 100644 --- a/src/DPD-BASIC/pair_dpd_ext.h +++ b/src/DPD-BASIC/pair_dpd_ext.h @@ -45,7 +45,7 @@ class PairDPDExt : public Pair { double cut_global, temperature; int seed; double **cut; - double **a0, **gamma, **gammaII, **gammaT; + double **a0, **gamma, **gammaT; double **sigma, **sigmaT; double **ws, **wsT; class RanMars *random; From 5003c359637c94f81c1ea36caba9777c2aba7d5f Mon Sep 17 00:00:00 2001 From: Matt Bettencourt Date: Wed, 30 Mar 2022 16:22:26 +0200 Subject: [PATCH 053/130] have first cut of just pair-dpd --- src/DPD-BASIC/pair_dpd.cpp | 2 + src/DPD-BASIC/pair_dpd.h | 8 +- src/KOKKOS/Install.sh | 2 + src/KOKKOS/pair_dpd_kokkos.cpp | 451 +++++++++++++++++++++++++++++++++ src/KOKKOS/pair_dpd_kokkos.h | 126 +++++++++ 5 files changed, 585 insertions(+), 4 deletions(-) create mode 100644 src/KOKKOS/pair_dpd_kokkos.cpp create mode 100644 src/KOKKOS/pair_dpd_kokkos.h diff --git a/src/DPD-BASIC/pair_dpd.cpp b/src/DPD-BASIC/pair_dpd.cpp index caa8161573..e988f1521e 100644 --- a/src/DPD-BASIC/pair_dpd.cpp +++ b/src/DPD-BASIC/pair_dpd.cpp @@ -46,6 +46,8 @@ PairDPD::PairDPD(LAMMPS *lmp) : Pair(lmp) PairDPD::~PairDPD() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); diff --git a/src/DPD-BASIC/pair_dpd.h b/src/DPD-BASIC/pair_dpd.h index 796228878c..7a5f6708d7 100644 --- a/src/DPD-BASIC/pair_dpd.h +++ b/src/DPD-BASIC/pair_dpd.h @@ -28,11 +28,11 @@ class PairDPD : public Pair { public: PairDPD(class LAMMPS *); ~PairDPD() override; - void compute(int, int) override; + virtual void compute(int, int) override; void settings(int, char **) override; void coeff(int, char **) override; - void init_style() override; - double init_one(int, int) override; + virtual void init_style() override; + virtual double init_one(int, int) override; void write_restart(FILE *) override; void read_restart(FILE *) override; void write_restart_settings(FILE *) override; @@ -49,7 +49,7 @@ class PairDPD : public Pair { double **sigma; class RanMars *random; - void allocate(); + virtual void allocate(); }; } // namespace LAMMPS_NS diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index da6bd8f1e3..8c4a3ea9ae 100755 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -231,6 +231,8 @@ action pair_coul_long_kokkos.h pair_coul_long.h action pair_coul_wolf_kokkos.cpp action pair_coul_wolf_kokkos.h action pair_dpd_ext_kokkos.cpp pair_dpd_ext.cpp +action pair_dpd_kokkos.h pair_dpd.h +action pair_dpd_kokkos.cpp pair_dpd.cpp action pair_dpd_ext_kokkos.h pair_dpd_ext.h action pair_dpd_fdt_energy_kokkos.cpp pair_dpd_fdt_energy.cpp action pair_dpd_fdt_energy_kokkos.h pair_dpd_fdt_energy.h diff --git a/src/KOKKOS/pair_dpd_kokkos.cpp b/src/KOKKOS/pair_dpd_kokkos.cpp new file mode 100644 index 0000000000..190acac98e --- /dev/null +++ b/src/KOKKOS/pair_dpd_kokkos.cpp @@ -0,0 +1,451 @@ +// clang-format off +/* ---------------------------------------------------------------------- + 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: Matt Bettencourt (NVIDIA) +------------------------------------------------------------------------- */ + +#include "pair_dpd_kokkos.h" + +#include "atom.h" +#include "atom_kokkos.h" +#include "memory_kokkos.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "random_mars.h" +#include "update.h" +#include "atom_masks.h" +#include "kokkos.h" + +#include + +using namespace LAMMPS_NS; + +#define EPSILON 1.0e-10 + + +template +PairDPDKokkos::PairDPDKokkos(class LAMMPS *lmp) : + PairDPD(lmp) , +#ifdef DPD_USE_RAN_MARS + rand_pool(0 /* unused */, lmp) +#else + rand_pool() +#endif +{ + kokkosable = 1; + atomKK = (AtomKokkos *) atom; + execution_space = ExecutionSpaceFromDevice::space; + + datamask_read = X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; +} + +/* ---------------------------------------------------------------------- */ + +template +PairDPDKokkos::~PairDPDKokkos() { + if (copymode) return; + +#ifdef DPD_USE_RAN_MARS + rand_pool.destroy(); +#endif + + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + + memoryKK->destroy_kokkos(k_cutsq,cutsq); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDKokkos::init_style() +{ + PairDPD::init_style(); + +#ifdef DPD_USE_RAN_MARS + rand_pool.init(random,seed); +#else + typedef Kokkos::Experimental::UniqueToken< + DeviceType, Kokkos::Experimental::UniqueTokenScope::Global> unique_token_type; + unique_token_type unique_token; + rand_pool.init(seed + comm->me,unique_token.size()); +#endif + + neighflag = lmp->kokkos->neighflag; + + if (force->newton_pair == 0 || neighflag == FULL ) + error->all(FLERR,"Must use half neighbor list style and newton on with pair dpd/kk"); + + auto request = neighbor->find_request(this); + request->set_kokkos_host(std::is_same::value && + !std::is_same::value); + request->set_kokkos_device(std::is_same::value); + + if (neighflag == FULL) + request->enable_full(); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDKokkos::compute(int eflagin, int vflagin) +{ + eflag = eflagin; vflag = vflagin; + if (neighflag == FULL) no_virial_fdotr_compute = 1; + + ev_init(eflag,vflag); + + if (eflag_atom) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + d_eatom = k_eatom.template view(); + } + if (vflag_atom) { + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"pair:vatom"); + d_vatom = k_vatom.template view(); + } + + atomKK->sync(execution_space,X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK); + + x = atomKK->k_x.view(); + v = atomKK->k_v.view(); + f = atomKK->k_f.view(); + type = atomKK->k_type.view(); + + k_cutsq.template sync(); + k_params.template sync(); + + special_lj[0] = force->special_lj[0]; + special_lj[1] = force->special_lj[1]; + special_lj[2] = force->special_lj[2]; + special_lj[3] = force->special_lj[3]; + + nlocal = atom->nlocal; + newton_pair = force->newton_pair; + dtinvsqrt = 1.0/sqrt(update->dt); + + NeighListKokkos* k_list = static_cast*>(list); + d_numneigh = k_list->d_numneigh; + d_neighbors = k_list->d_neighbors; + d_ilist = k_list->d_ilist; + + // loop over neighbors of my atoms + + int inum = list->inum; + EV_FLOAT ev; + copymode = 1; + if (neighflag == HALF) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } else if (neighflag == HALFTHREAD) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } else if (neighflag == FULL) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } + + if (eflag_global) eng_vdwl += ev.evdwl; + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (vflag_fdotr) pair_virial_fdotr_compute(this); + + if (eflag_atom) { + k_eatom.template modify(); + k_eatom.template sync(); + } + + if (vflag_atom) { + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; + + if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); + else atomKK->modified(execution_space,F_MASK); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDKokkos::operator() (TagDPDKokkos, const int &ii) const { + EV_FLOAT ev; + this->template operator()(TagDPDKokkos(), ii, ev); +} +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDKokkos::operator() (TagDPDKokkos, const int &ii, EV_FLOAT &ev) const { + + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_f = f; + + int i,j,jj,jnum,itype,jtype; + double xtmp,ytmp,ztmp,delx,dely,delz,fpair; + double vxtmp,vytmp,vztmp,delvx,delvy,delvz; + double rsq,r,rinv,dot,wd,randnum,factor_dpd; + double fx = 0,fy = 0,fz = 0; + double evdwl = 0; + i = d_ilist[ii]; + xtmp = x(i,0); + ytmp = x(i,1); + ztmp = x(i,2); + vxtmp = v(i,0); + vytmp = v(i,1); + vztmp = v(i,2); + itype = type(i); + jnum = d_numneigh[i]; + rand_type rand_gen = rand_pool.get_state(); + for (jj = 0; jj < jnum; jj++) { + j = d_neighbors(i,jj); + factor_dpd = special_lj[sbmask(j)]; + j &= NEIGHMASK; + + delx = xtmp - x(j,0); + dely = ytmp - x(j,1); + delz = ztmp - x(j,2); + rsq = delx*delx + dely*dely + delz*delz; + jtype = type(j); + if (rsq < d_cutsq(itype,jtype)) { + r = sqrt(rsq); + if (r < EPSILON) continue; // r can be 0.0 in DPD systems + rinv = 1.0/r; + delvx = vxtmp - v(j,0); + delvy = vytmp - v(j,1); + delvz = vztmp - v(j,2); + dot = delx*delvx + dely*delvy + delz*delvz; + + wd = 1.0 - r/params(itype,jtype).cut; + + randnum = rand_gen.normal(); + + // conservative force + fpair = params(itype,jtype).a0*wd; + + // drag force - parallel + fpair -= params(itype,jtype).gamma*wd*wd*dot*rinv; + + // random force - parallel + fpair += params(itype,jtype).sigma*wd*randnum*dtinvsqrt; + fpair *= factor_dpd*rinv; + + fx += fpair*delx; + fy += fpair*dely; + fz += fpair*delz; + + if ((neighflag==HALF || neighflag==HALFTHREAD) && (NEWTON_PAIR || j < nlocal) ) { + a_f(j,0) -= fpair*delx; + a_f(j,1) -= fpair*dely; + a_f(j,2) -= fpair*delz; + } + + if (eflag) { + // unshifted eng of conservative term: + // evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]); + // eng shifted to 0.0 at cutoff + evdwl = 0.5*params(itype,jtype).a0*params(itype,jtype).cut* wd*wd; + evdwl *= factor_dpd; + if (EVFLAG) + ev.evdwl += (((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR||(jtemplate ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); + } + } + a_f(i,0) += fx; + a_f(i,1) += fy; + a_f(i,2) += fz; + rand_pool.free_state(rand_gen); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const +{ + const int EFLAG = eflag; + const int VFLAG = vflag_either; + + // The eatom and vatom arrays are atomic for Half/Thread neighbor style + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_eatom = k_eatom.view(); + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_vatom = k_vatom.view(); + + if (EFLAG) { + if (eflag_atom) { + const E_FLOAT epairhalf = 0.5 * epair; + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) a_eatom[i] += epairhalf; + if (NEWTON_PAIR || j < nlocal) a_eatom[j] += epairhalf; + } else { + a_eatom[i] += epairhalf; + } + } + } + + if (VFLAG) { + const E_FLOAT v0 = delx*delx*fpair; + const E_FLOAT v1 = dely*dely*fpair; + const E_FLOAT v2 = delz*delz*fpair; + const E_FLOAT v3 = delx*dely*fpair; + const E_FLOAT v4 = delx*delz*fpair; + const E_FLOAT v5 = dely*delz*fpair; + + if (vflag_global) { + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + if (NEWTON_PAIR || j < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + } else { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + } + + if (vflag_atom) { + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + } + if (NEWTON_PAIR || j < nlocal) { + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; + } + } else { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDKokkos::allocate() +{ + PairDPD::allocate(); + int n = atom->ntypes; + + memory->destroy(cutsq); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + d_cutsq = k_cutsq.template view(); + + k_params = Kokkos::DualView("PairDPD::params",n+1,n+1); + params = k_params.template view(); +} + +/* ---------------------------------------------------------------------- */ + +template +KOKKOS_INLINE_FUNCTION +int PairDPDKokkos::sbmask(const int& j) const { + return j >> SBBITS & 3; +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +template +double PairDPDKokkos::init_one(int i, int j) +{ + double cutone = PairDPD::init_one(i,j); + + k_params.h_view(i,j).cut = cut[i][j]; + k_params.h_view(i,j).a0 = a0[i][j]; + k_params.h_view(i,j).gamma = gamma[i][j]; + k_params.h_view(i,j).sigma = sigma[i][j]; + k_params.h_view(j,i) = k_params.h_view(i,j); + + k_params.template modify(); + + k_cutsq.h_view(i,j) = cutone*cutone; + k_cutsq.h_view(j,i) = k_cutsq.h_view(i,j); + k_cutsq.template modify(); + + return cutone; +} + +namespace LAMMPS_NS { +template class PairDPDKokkos; +#ifdef LMP_KOKKOS_GPU +template class PairDPDKokkos; +#endif +} diff --git a/src/KOKKOS/pair_dpd_kokkos.h b/src/KOKKOS/pair_dpd_kokkos.h new file mode 100644 index 0000000000..da2558a6fb --- /dev/null +++ b/src/KOKKOS/pair_dpd_kokkos.h @@ -0,0 +1,126 @@ +/* -*- 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(dpd/kk,PairDPDKokkos); +PairStyle(dpd/kk/device,PairDPDKokkos); +PairStyle(dpd/kk/host,PairDPDKokkos); +// clang-format on +#else + +#ifndef LMP_PAIR_DPD_KOKKOS_H +#define LMP_PAIR_DPD_KOKKOS_H + +#include "pair_dpd.h" +#include "pair_kokkos.h" +#include "kokkos_type.h" + +#if !defined(DPD_USE_RAN_MARS) && !defined(DPD_USE_Random_XorShift64) && !defined(Random_XorShift1024) +#define DPD_USE_Random_XorShift64 +#endif + +#ifdef DPD_USE_RAN_MARS +#include "rand_pool_wrap_kokkos.h" +#else +#include "Kokkos_Random.hpp" +#endif + +namespace LAMMPS_NS { + +template +class PairDPDKokkos : public PairDPD { + public: + typedef DeviceType device_type; + typedef ArrayTypes AT; + typedef EV_FLOAT value_type; + + PairDPDKokkos(class LAMMPS*); + ~PairDPDKokkos() override; + + void allocate() override; + + void init_style() override; + double init_one(int i, int j) override; + void compute(int, int) override; + + struct params_dpd { + KOKKOS_INLINE_FUNCTION + params_dpd() {cut=a0=gamma=sigma=0;} + KOKKOS_INLINE_FUNCTION + params_dpd(int /*i*/) {cut=a0=gamma=sigma=0;} + F_FLOAT cutsq,cut,a0,gamma,sigma; + }; + + template + struct TagDPDKokkos{}; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDKokkos, const int &i) const; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDKokkos, const int &i, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void ev_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const; + private: + + double special_lj[4]; + int eflag,vflag; + int neighflag, nlocal,newton_pair; + double dtinvsqrt; + +#ifdef DPD_USE_RAN_MARS + RandPoolWrap rand_pool; + typedef RandWrap rand_type; +#elif defined(DPD_USE_Random_XorShift64) + Kokkos::Random_XorShift64_Pool rand_pool; + typedef typename Kokkos::Random_XorShift64_Pool::generator_type rand_type; +#elif defined(DPD_USE_Random_XorShift1024) + Kokkos::Random_XorShift1024_Pool rand_pool; + typedef typename Kokkos::Random_XorShift1024_Pool::generator_type rand_type; +#endif + typename AT::t_x_array_randomread x; + typename AT::t_x_array_randomread v; + typename AT::t_f_array f; + typename AT::t_int_1d_randomread type; + + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d_randomread d_ilist; + typename AT::t_int_1d_randomread d_numneigh; + + typename AT::tdual_ffloat_2d k_cutsq; + typename AT::t_ffloat_2d d_cutsq; + + Kokkos::DualView k_params; + typename Kokkos::DualView::t_dev_const_um params; + + DAT::tdual_efloat_1d k_eatom; + DAT::tdual_virial_array k_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; + + KOKKOS_INLINE_FUNCTION + int sbmask(const int& j) const; + friend void pair_virial_fdotr_compute(PairDPDKokkos*); + +}; +} +#endif +#endif From c4729b39b4e76deb094903ff01bfe2ac12dbc8ea Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 30 Mar 2022 13:53:25 -0400 Subject: [PATCH 054/130] replace more uses of XXXINT_FORMAT with fmtlib --- src/dump_atom.cpp | 48 +++++++++++++++++++----------------- src/dump_cfg.cpp | 2 +- src/dump_custom.cpp | 48 +++++++++++++++++++----------------- src/dump_local.cpp | 36 ++++++++++++++------------- src/fix_ave_chunk.cpp | 2 +- src/fix_ave_correlate.cpp | 2 +- src/fix_ave_histo.cpp | 2 +- src/fix_ave_histo_weight.cpp | 2 +- src/fix_ave_time.cpp | 7 +++--- src/fix_property_atom.cpp | 19 +++++++------- 10 files changed, 89 insertions(+), 79 deletions(-) diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp index 0dbd3b3278..dd2ea7ee13 100644 --- a/src/dump_atom.cpp +++ b/src/dump_atom.cpp @@ -289,19 +289,21 @@ void DumpAtom::header_item(bigint ndump) { if (unit_flag && !unit_count) { ++unit_count; - fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style); + fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style); } - if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time()); + if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time()); - fprintf(fp,"ITEM: TIMESTEP\n"); - fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); - fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); - fprintf(fp,BIGINT_FORMAT "\n",ndump); - fprintf(fp,"ITEM: BOX BOUNDS %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e\n",boxxlo,boxxhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxylo,boxyhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxzlo,boxzhi); - fprintf(fp,"ITEM: ATOMS %s\n",columns); + fmt::print(fp,"ITEM: TIMESTEP\n{}\n" + "ITEM: NUMBER OF ATOMS\n{}\n", + update->ntimestep, ndump); + + fmt::print(fp,"ITEM: BOX BOUNDS {}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi); + + fmt::print(fp,"ITEM: ATOMS {}\n",columns); } /* ---------------------------------------------------------------------- */ @@ -310,19 +312,21 @@ void DumpAtom::header_item_triclinic(bigint ndump) { if (unit_flag && !unit_count) { ++unit_count; - fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style); + fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style); } - if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time()); + if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time()); - fprintf(fp,"ITEM: TIMESTEP\n"); - fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); - fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); - fprintf(fp,BIGINT_FORMAT "\n",ndump); - fprintf(fp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz); - fprintf(fp,"ITEM: ATOMS %s\n",columns); + fmt::print(fp,"ITEM: TIMESTEP\n{}\n" + "ITEM: NUMBER OF ATOMS\n{}\n", + update->ntimestep, ndump); + + fmt::print(fp,"ITEM: BOX BOUNDS xy xz yz {}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxxy,boxylo,boxyhi,boxxz,boxzlo,boxzhi,boxyz); + + fmt::print(fp,"ITEM: ATOMS {}\n",columns); } /* ---------------------------------------------------------------------- */ diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index d52dac745f..b1c9aed58b 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -123,7 +123,7 @@ void DumpCFG::write_header(bigint n) if (atom->peri_flag) scale = atom->pdscale; else if (unwrapflag == 1) scale = UNWRAPEXPAND; - fprintf(fp,"Number of particles = " BIGINT_FORMAT "\n", n); + fmt::print(fp,"Number of particles = {}\n", n); fprintf(fp,"A = %g Angstrom (basic length-scale)\n",scale); fprintf(fp,"H0(1,1) = %g A\n",domain->xprd); fprintf(fp,"H0(1,2) = 0 A \n"); diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 5d371d3145..e7371c1fe1 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -507,19 +507,21 @@ void DumpCustom::header_item(bigint ndump) { if (unit_flag && !unit_count) { ++unit_count; - fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style); + fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style); } - if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time()); + if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time()); - fprintf(fp,"ITEM: TIMESTEP\n"); - fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); - fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); - fprintf(fp,BIGINT_FORMAT "\n",ndump); - fprintf(fp,"ITEM: BOX BOUNDS %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e\n",boxxlo,boxxhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxylo,boxyhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxzlo,boxzhi); - fprintf(fp,"ITEM: ATOMS %s\n",columns); + fmt::print(fp,"ITEM: TIMESTEP\n{}\n" + "ITEM: NUMBER OF ATOMS\n{}\n", + update->ntimestep, ndump); + + fmt::print(fp,"ITEM: BOX BOUNDS {}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi); + + fmt::print(fp,"ITEM: ATOMS {}\n",columns); } /* ---------------------------------------------------------------------- */ @@ -528,19 +530,21 @@ void DumpCustom::header_item_triclinic(bigint ndump) { if (unit_flag && !unit_count) { ++unit_count; - fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style); + fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style); } - if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time()); + if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time()); - fprintf(fp,"ITEM: TIMESTEP\n"); - fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); - fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); - fprintf(fp,BIGINT_FORMAT "\n",ndump); - fprintf(fp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz); - fprintf(fp,"ITEM: ATOMS %s\n",columns); + fmt::print(fp,"ITEM: TIMESTEP\n{}\n" + "ITEM: NUMBER OF ATOMS\n{}\n", + update->ntimestep, ndump); + + fmt::print(fp,"ITEM: BOX BOUNDS xy xz yz {}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxxy,boxylo,boxyhi,boxxz,boxzlo,boxzhi,boxyz); + + fmt::print(fp,"ITEM: ATOMS {}\n",columns); } /* ---------------------------------------------------------------------- */ diff --git a/src/dump_local.cpp b/src/dump_local.cpp index 67586c625a..a5bc99d939 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -242,8 +242,7 @@ int DumpLocal::modify_param(int narg, char **arg) // use of &str[1] removes leading '%' from BIGINT_FORMAT string char *ptr = strchr(format_int_user,'d'); if (ptr == nullptr) - error->all(FLERR, - "Dump_modify int format does not contain d character"); + error->all(FLERR, "Dump_modify int format does not contain d character"); char str[8]; sprintf(str,"%s",BIGINT_FORMAT); *ptr = '\0'; @@ -273,26 +272,29 @@ void DumpLocal::write_header(bigint ndump) if (me == 0) { if (unit_flag && !unit_count) { ++unit_count; - fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style); + fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style); } - if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time()); + if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time()); + + fmt::print(fp,"ITEM: TIMESTEP\n{}\n" + "ITEM: NUMBER OF {}\n{}\n", + update->ntimestep, label, ndump); - fprintf(fp,"ITEM: TIMESTEP\n"); - fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); - fprintf(fp,"ITEM: NUMBER OF %s\n",label); - fprintf(fp,BIGINT_FORMAT "\n",ndump); if (domain->triclinic) { - fprintf(fp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz); + fmt::print(fp,"ITEM: BOX BOUNDS xy xz yz {}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxxy,boxylo,boxyhi,boxxz,boxzlo,boxzhi,boxyz); } else { - fprintf(fp,"ITEM: BOX BOUNDS %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e\n",boxxlo,boxxhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxylo,boxyhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxzlo,boxzhi); + fmt::print(fp,"ITEM: BOX BOUNDS {}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi); } - fprintf(fp,"ITEM: %s %s\n",label,columns); + + fmt::print(fp,"ITEM: {} {}\n", label, columns); } } diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index b6cb17b8c9..efe1bd9fdc 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -941,7 +941,7 @@ void FixAveChunk::end_of_step() if (overwrite) platform::fseek(fp,filepos); double count = 0.0; for (m = 0; m < nchunk; m++) count += count_total[m]; - fprintf(fp,BIGINT_FORMAT " %d %g\n",ntimestep,nchunk,count); + fmt::print(fp,"{} {} {}\n",ntimestep,nchunk,count); int compress = cchunk->compress; int *chunkID = cchunk->chunkID; diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index 486b991b77..17182c8667 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -487,7 +487,7 @@ void FixAveCorrelate::end_of_step() if (fp && me == 0) { clearerr(fp); if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,BIGINT_FORMAT " %d\n",ntimestep,nrepeat); + fmt::print(fp,"{} {}\n",ntimestep,nrepeat); for (i = 0; i < nrepeat; i++) { fprintf(fp,"%d %d %d",i+1,i*nevery,count[i]); if (count[i]) diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index 5a7c6d4ccb..c2acd652ad 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -815,7 +815,7 @@ void FixAveHisto::end_of_step() if (fp && me == 0) { clearerr(fp); if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,BIGINT_FORMAT " %d %g %g %g %g\n",ntimestep,nbins, + fmt::print(fp,"{} {} {} {} {} {}\n",ntimestep,nbins, stats_total[0],stats_total[1],stats_total[2],stats_total[3]); if (stats_total[0] != 0.0) for (i = 0; i < nbins; i++) diff --git a/src/fix_ave_histo_weight.cpp b/src/fix_ave_histo_weight.cpp index 16a64e093e..f90551b52f 100644 --- a/src/fix_ave_histo_weight.cpp +++ b/src/fix_ave_histo_weight.cpp @@ -468,7 +468,7 @@ void FixAveHistoWeight::end_of_step() if (fp && me == 0) { clearerr(fp); if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,BIGINT_FORMAT " %d %g %g %g %g\n",ntimestep,nbins, + fmt::print(fp,"{} {} {} {} {} {}\n",ntimestep,nbins, stats_total[0],stats_total[1],stats_total[2],stats_total[3]); if (stats_total[0] != 0.0) for (i = 0; i < nbins; i++) diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index 98b066ef0b..ee08c859f4 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -669,11 +669,10 @@ void FixAveTime::invoke_scalar(bigint ntimestep) if (fp && me == 0) { clearerr(fp); if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,BIGINT_FORMAT,ntimestep); + fmt::print(fp,"{}",ntimestep); for (i = 0; i < nvalues; i++) fprintf(fp,format,vector_total[i]/norm); fprintf(fp,"\n"); - if (ferror(fp)) - error->one(FLERR,"Error writing out time averaged data"); + if (ferror(fp)) error->one(FLERR,"Error writing out time averaged data"); fflush(fp); @@ -881,7 +880,7 @@ void FixAveTime::invoke_vector(bigint ntimestep) if (fp && me == 0) { if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,BIGINT_FORMAT " %d\n",ntimestep,nrows); + fmt::print(fp,"{} {}\n",ntimestep,nrows); for (i = 0; i < nrows; i++) { fprintf(fp,"%d",i+1); for (j = 0; j < nvalues; j++) fprintf(fp,format,array_total[i][j]/norm); diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index f7b9662c24..0e91a5f3fb 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -445,34 +445,35 @@ void FixPropertyAtom::write_data_section(int /*mth*/, FILE *fp, int n, double **buf, int /*index*/) { int k,icol,ncol,nv; + std::string line; for (int i = 0; i < n; i++) { - fprintf(fp,TAGINT_FORMAT,(tagint) ubuf(buf[i][0]).i); + line = fmt::format("{}",(tagint) ubuf(buf[i][0]).i); icol = 1; for (nv = 0; nv < nvalue; nv++) { if (styles[nv] == MOLECULE) - fprintf(fp," " TAGINT_FORMAT,(tagint) ubuf(buf[i][icol++]).i); + line += fmt::format(" {}",(tagint) ubuf(buf[i][icol++]).i); else if (styles[nv] == CHARGE) - fprintf(fp," %g",buf[i][icol++]); + line += fmt::format(" {}",buf[i][icol++]); else if (styles[nv] == RMASS) - fprintf(fp," %g",buf[i][icol++]); + line += fmt::format(" {}",buf[i][icol++]); else if (styles[nv] == IVEC) - fprintf(fp," %d",(int) ubuf(buf[i][icol++]).i); + line += fmt::format(" {}",(int) ubuf(buf[i][icol++]).i); else if (styles[nv] == DVEC) - fprintf(fp," %g",buf[i][icol++]); + line += fmt::format(" {}",buf[i][icol++]); else if (styles[nv] == IARRAY) { ncol = cols[nv]; for (k = 0; k < ncol; k++) - fprintf(fp," %d",(int) ubuf(buf[i][icol+k]).i); + line += fmt::format(" {}",(int) ubuf(buf[i][icol+k]).i); icol += ncol; } else if (styles[nv] == DARRAY) { ncol = cols[nv]; for (k = 0; k < ncol; k++) - fprintf(fp," %g",buf[i][icol+k]); + line += fmt::format(" {}",buf[i][icol+k]); icol += ncol; } } - fprintf(fp,"\n"); + fmt::print(fp,line+"\n"); } } From f3fa04ae0a63f316f0f71a77eeb57a737faa83aa Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 30 Mar 2022 15:01:03 -0400 Subject: [PATCH 055/130] bugfix --- src/dump_local.cpp | 2 +- src/read_data.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dump_local.cpp b/src/dump_local.cpp index a5bc99d939..d0344d24c9 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -293,7 +293,7 @@ void DumpLocal::write_header(bigint ndump) "{:>1.16e} {:>1.16e}\n", boundstr,boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi); } - + fmt::print(fp,"ITEM: {} {}\n", label, columns); } } diff --git a/src/read_data.cpp b/src/read_data.cpp index 9ec63bddf9..8144414af9 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -1128,8 +1128,8 @@ void ReadData::header(int firstpass) } else if (utils::strmatch(line,"^\\s*\\f+\\s+\\f+\\s+\\f+\\s+xy\\s+xz\\s+yz\\s")) { triclinic = 1; xy = utils::numeric(FLERR, words[0], false, lmp); - xz = utils::numeric(FLERR, words[0], false, lmp); - yz = utils::numeric(FLERR, words[0], false, lmp); + xz = utils::numeric(FLERR, words[1], false, lmp); + yz = utils::numeric(FLERR, words[2], false, lmp); } else break; } From c7a9a3e2f6aad0d1d097b882e5e278d18b1fc23b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 30 Mar 2022 16:13:38 -0400 Subject: [PATCH 056/130] simplify and replace use of XXXINT_FORMAT macros --- src/REPLICA/neb.cpp | 69 +++++++++++------------------------ src/REPLICA/prd.cpp | 41 ++++++--------------- src/REPLICA/tad.cpp | 65 +++++++++------------------------ src/REPLICA/temper.cpp | 18 ++++----- src/REPLICA/temper_grem.cpp | 18 ++++----- src/REPLICA/temper_npt.cpp | 18 ++++----- src/SHOCK/fix_wall_piston.cpp | 52 +++++++------------------- src/SPIN/neb_spin.cpp | 12 ++---- src/SRD/fix_srd.cpp | 9 +++-- src/UEF/dump_cfg_uef.cpp | 2 +- 10 files changed, 98 insertions(+), 206 deletions(-) diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index 3136bdae7c..f7e6c68b31 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -625,56 +625,29 @@ void NEB::print_status() } if (me_universe == 0) { - const double todeg=180.0/MY_PI; - FILE *uscreen = universe->uscreen; - FILE *ulogfile = universe->ulogfile; - if (uscreen) { - fprintf(uscreen,BIGINT_FORMAT " %12.8g %12.8g ", - update->ntimestep,fmaxreplica,fmaxatom); - fprintf(uscreen,"%12.8g %12.8g %12.8g ", - gradvnorm0,gradvnorm1,gradvnormc); - fprintf(uscreen,"%12.8g %12.8g %12.8g ",ebf,ebr,endpt); - for (int i = 0; i < nreplica; i++) - fprintf(uscreen,"%12.8g %12.8g ",rdist[i],all[i][0]); - if (verbose) { - fprintf(uscreen,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - NAN,180-acos(all[0][5])*todeg,180-acos(all[0][6])*todeg, - all[0][3],freplica[0],fmaxatomInRepl[0]); - for (int i = 1; i < nreplica-1; i++) - fprintf(uscreen,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - 180-acos(all[i][4])*todeg,180-acos(all[i][5])*todeg, - 180-acos(all[i][6])*todeg,all[i][3],freplica[i], - fmaxatomInRepl[i]); - fprintf(uscreen,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - NAN,180-acos(all[nreplica-1][5])*todeg,NAN,all[nreplica-1][3], - freplica[nreplica-1],fmaxatomInRepl[nreplica-1]); - } - fprintf(uscreen,"\n"); + constexpr double todeg=180.0/MY_PI; + std::string mesg = fmt::format("{} {:12.8g} {:12.8g} ",update->ntimestep,fmaxreplica,fmaxatom); + mesg += fmt::format("{:12.8g} {:12.8g} {:12.8g} ",gradvnorm0,gradvnorm1,gradvnormc); + mesg += fmt::format("{:12.8g} {:12.8g} {:12.8g} ",ebf,ebr,endpt); + for (int i = 0; i < nreplica; i++) mesg += fmt::format("{:12.8g} {:12.8g} ",rdist[i],all[i][0]); + if (verbose) { + mesg += fmt::format("{:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g}", + NAN,180-acos(all[0][5])*todeg,180-acos(all[0][6])*todeg, + all[0][3],freplica[0],fmaxatomInRepl[0]); + for (int i = 1; i < nreplica-1; i++) + mesg += fmt::format("{:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g}", + 180-acos(all[i][4])*todeg,180-acos(all[i][5])*todeg, + 180-acos(all[i][6])*todeg,all[i][3],freplica[i],fmaxatomInRepl[i]); + mesg += fmt::format("{:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g}", + NAN,180-acos(all[nreplica-1][5])*todeg,NAN,all[nreplica-1][3], + freplica[nreplica-1],fmaxatomInRepl[nreplica-1]); } + mesg += "\n"; - if (ulogfile) { - fprintf(ulogfile,BIGINT_FORMAT " %12.8g %12.8g ", - update->ntimestep,fmaxreplica,fmaxatom); - fprintf(ulogfile,"%12.8g %12.8g %12.8g ", - gradvnorm0,gradvnorm1,gradvnormc); - fprintf(ulogfile,"%12.8g %12.8g %12.8g ",ebf,ebr,endpt); - for (int i = 0; i < nreplica; i++) - fprintf(ulogfile,"%12.8g %12.8g ",rdist[i],all[i][0]); - if (verbose) { - fprintf(ulogfile,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - NAN,180-acos(all[0][5])*todeg,180-acos(all[0][6])*todeg, - all[0][3],freplica[0],fmaxatomInRepl[0]); - for (int i = 1; i < nreplica-1; i++) - fprintf(ulogfile,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - 180-acos(all[i][4])*todeg,180-acos(all[i][5])*todeg, - 180-acos(all[i][6])*todeg,all[i][3],freplica[i], - fmaxatomInRepl[i]); - fprintf(ulogfile,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - NAN,180-acos(all[nreplica-1][5])*todeg,NAN,all[nreplica-1][3], - freplica[nreplica-1],fmaxatomInRepl[nreplica-1]); - } - fprintf(ulogfile,"\n"); - fflush(ulogfile); + if (universe->uscreen) fputs(mesg.c_str(), universe->uscreen); + if (universe->ulogfile) { + fputs(mesg.c_str(), universe->ulogfile); + fflush(universe->ulogfile); } } } diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index 501e7675a8..ced3f6d0e7 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -416,18 +416,10 @@ void PRD::command(int narg, char **arg) neighbor->ndanger = ndanger; if (me_universe == 0) { - if (universe->uscreen) - fprintf(universe->uscreen, - "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT - " atoms\n", - timer->get_wall(Timer::TOTAL),nprocs_universe, - nsteps,atom->natoms); - if (universe->ulogfile) - fprintf(universe->ulogfile, - "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT - " atoms\n", - timer->get_wall(Timer::TOTAL),nprocs_universe, - nsteps,atom->natoms); + auto mesg = fmt::format("Loop time of {} on {} procs for {} steps with {} atoms\n", + timer->get_wall(Timer::TOTAL), nprocs_universe, nsteps,atom->natoms); + if (universe->uscreen) fmt::print(universe->uscreen, mesg); + if (universe->ulogfile) fmt::print(universe->ulogfile, mesg); } if (me == 0) utils::logmesg(lmp,"\nPRD done\n"); @@ -729,24 +721,13 @@ void PRD::log_event() { timer->set_wall(Timer::TOTAL, time_start); if (universe->me == 0) { - if (universe->uscreen) - fprintf(universe->uscreen, - BIGINT_FORMAT " %.3f " BIGINT_FORMAT " %d %d %d %d\n", - fix_event->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->clock, - fix_event->event_number,fix_event->correlated_event, - fix_event->ncoincident, - fix_event->replica_number); - if (universe->ulogfile) - fprintf(universe->ulogfile, - BIGINT_FORMAT " %.3f " BIGINT_FORMAT " %d %d %d %d\n", - fix_event->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->clock, - fix_event->event_number,fix_event->correlated_event, - fix_event->ncoincident, - fix_event->replica_number); + auto mesg = fmt::format("{} {:.3f} {} {} {} {} {}\n", fix_event->event_timestep, + timer->elapsed(Timer::TOTAL), fix_event->clock, + fix_event->event_number, fix_event->correlated_event, + fix_event->ncoincident, fix_event->replica_number); + + if (universe->uscreen) fmt::print(universe->uscreen, mesg); + if (universe->ulogfile) fmt::print(universe->ulogfile, mesg); } } diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index 0b1cc915c6..f98c63d1ff 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -364,18 +364,10 @@ void TAD::command(int narg, char **arg) neighbor->ndanger = ndanger; if (me_universe == 0) { - if (universe->uscreen) - fprintf(universe->uscreen, - "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT - " atoms\n", - timer->get_wall(Timer::TOTAL),nprocs_universe, - nsteps,atom->natoms); - if (universe->ulogfile) - fprintf(universe->ulogfile, - "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT - " atoms\n", - timer->get_wall(Timer::TOTAL),nprocs_universe, - nsteps,atom->natoms); + auto mesg = fmt::format("Loop time of {} on {} procs for {} steps with {} atoms\n", + timer->get_wall(Timer::TOTAL), nprocs_universe, nsteps,atom->natoms); + if (universe->uscreen) fmt::print(universe->uscreen, mesg); + if (universe->ulogfile) fmt::print(universe->ulogfile, mesg); } if ((me_universe == 0) && ulogfile_neb) fclose(ulogfile_neb); @@ -507,24 +499,13 @@ void TAD::log_event(int ievent) timer->set_wall(Timer::TOTAL, time_start); if (universe->me == 0) { double tfrac = 0.0; - if (universe->uscreen) - fprintf(universe->uscreen, - BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n", - fix_event->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->event_number,ievent, - "E ", - fix_event->ebarrier,tfrac, - fix_event->tlo,deltfirst); - if (universe->ulogfile) - fprintf(universe->ulogfile, - BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n", - fix_event->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->event_number,ievent, - "E ", - fix_event->ebarrier,tfrac, - fix_event->tlo,deltfirst); + auto mesg = fmt::format("{} {:.3f} {} {} {} {:.3f} {:.3f} {:.3f} {:.3f}\n", + fix_event->event_timestep, timer->elapsed(Timer::TOTAL), + fix_event->event_number, ievent, "E ", fix_event->ebarrier, + tfrac, fix_event->tlo, deltfirst); + + if (universe->uscreen) fmt::print(universe->uscreen, mesg); + if (universe->ulogfile) fmt::print(universe->ulogfile, mesg); } // dump snapshot of quenched coords @@ -909,26 +890,14 @@ void TAD::compute_tlo(int ievent) if (universe->me == 0) { double tfrac = 0.0; if (ievent > 0) tfrac = delthi/deltstop; + auto mesg = fmt::format("{} {:.3f} {} {} {} {:.3f} {:.3f} {:.3f} {:.3f}\n", + fix_event_list[ievent]->event_timestep, timer->elapsed(Timer::TOTAL), + fix_event->event_number, ievent, statstr, ebarrier, tfrac, + fix_event->tlo, deltlo); - if (universe->uscreen) - fprintf(universe->uscreen, - BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n", - fix_event_list[ievent]->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->event_number, - ievent,statstr,ebarrier,tfrac, - fix_event->tlo,deltlo); - - if (universe->ulogfile) - fprintf(universe->ulogfile, - BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n", - fix_event_list[ievent]->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->event_number, - ievent,statstr,ebarrier,tfrac, - fix_event->tlo,deltlo); + if (universe->uscreen) fmt::print(universe->uscreen, mesg); + if (universe->ulogfile) fmt::print(universe->ulogfile, mesg); } - } /* ---------------------------------------------------------------------- diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp index f31705213e..1bac1aea92 100644 --- a/src/REPLICA/temper.cpp +++ b/src/REPLICA/temper.cpp @@ -366,17 +366,15 @@ void Temper::scale_velocities(int t_partner, int t_me) void Temper::print_status() { - if (universe->uscreen) { - fprintf(universe->uscreen,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->uscreen," %d",world2temp[i]); - fprintf(universe->uscreen,"\n"); - } + std::string status = std::to_string(update->ntimestep); + for (int i = 0; i < nworlds; i++) + status += " " + std::to_string(world2temp[i]); + + status += "\n"; + + if (universe->uscreen) fputs(status.c_str(), universe->uscreen); if (universe->ulogfile) { - fprintf(universe->ulogfile,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->ulogfile," %d",world2temp[i]); - fprintf(universe->ulogfile,"\n"); + fputs(status.c_str(), universe->ulogfile); fflush(universe->ulogfile); } } diff --git a/src/REPLICA/temper_grem.cpp b/src/REPLICA/temper_grem.cpp index d50d0c6b4d..43d8ebe1d9 100644 --- a/src/REPLICA/temper_grem.cpp +++ b/src/REPLICA/temper_grem.cpp @@ -374,17 +374,15 @@ void TemperGrem::command(int narg, char **arg) void TemperGrem::print_status() { - if (universe->uscreen) { - fprintf(universe->uscreen,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->uscreen," %d",world2lambda[i]); - fprintf(universe->uscreen,"\n"); - } + std::string status = std::to_string(update->ntimestep); + for (int i = 0; i < nworlds; i++) + status += " " + std::to_string(world2lambda[i]); + + status += "\n"; + + if (universe->uscreen) fputs(status.c_str(), universe->uscreen); if (universe->ulogfile) { - fprintf(universe->ulogfile,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->ulogfile," %d",world2lambda[i]); - fprintf(universe->ulogfile,"\n"); + fputs(status.c_str(), universe->ulogfile); fflush(universe->ulogfile); } } diff --git a/src/REPLICA/temper_npt.cpp b/src/REPLICA/temper_npt.cpp index 700aa582db..eaf429380f 100644 --- a/src/REPLICA/temper_npt.cpp +++ b/src/REPLICA/temper_npt.cpp @@ -381,17 +381,15 @@ void TemperNPT::scale_velocities(int t_partner, int t_me) void TemperNPT::print_status() { - if (universe->uscreen) { - fprintf(universe->uscreen,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->uscreen," %d",world2temp[i]); - fprintf(universe->uscreen,"\n"); - } + std::string status = std::to_string(update->ntimestep); + for (int i = 0; i < nworlds; i++) + status += " " + std::to_string(world2temp[i]); + + status += "\n"; + + if (universe->uscreen) fputs(status.c_str(), universe->uscreen); if (universe->ulogfile) { - fprintf(universe->ulogfile,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->ulogfile," %d",world2temp[i]); - fprintf(universe->ulogfile,"\n"); + fputs(status.c_str(), universe->ulogfile); fflush(universe->ulogfile); } } diff --git a/src/SHOCK/fix_wall_piston.cpp b/src/SHOCK/fix_wall_piston.cpp index be2d51f2c4..d27a58e6d9 100644 --- a/src/SHOCK/fix_wall_piston.cpp +++ b/src/SHOCK/fix_wall_piston.cpp @@ -202,8 +202,7 @@ void FixWallPiston::post_integrate() if (zloflag) { zlo = z0 + 0.5 * paccelz * tt; vz = paccelz * t; } - } - else if (rampNL1flag) { + } else if (rampNL1flag) { paccelz = maxvz / tott; angfreq = MY_2PI / (0.5 * tott); @@ -211,11 +210,8 @@ void FixWallPiston::post_integrate() zlo = z0 + paccelz * (0.5*tt + 1.0/(angfreq*angfreq) - 1.0/(angfreq*angfreq)*cos(angfreq*t)); vz = paccelz * (t + 1.0/angfreq*sin(angfreq*t)); - } - else error->all(FLERR, - "NL ramp in wall/piston only implemented in zlo for now"); - } - else if (rampNL2flag) { + } else error->all(FLERR, "NL ramp in wall/piston only implemented in zlo for now"); + } else if (rampNL2flag) { paccelz = maxvz / tott; angfreq = 3.0*MY_2PI / tott; @@ -225,55 +221,35 @@ void FixWallPiston::post_integrate() 1.0/(6.0*angfreq*angfreq)*(1.0-cos(2.0*angfreq*t))); vz = paccelz * (t + 4.0/(3.0*angfreq)*sin(angfreq*t) + 1.0/(3.0*angfreq)*sin(2.0*angfreq*t)); - } - else error->all(FLERR, - "NL ramp in wall/piston only implemented in zlo for now"); - } - else if (rampNL3flag) { + } else error->all(FLERR, "NL ramp in wall/piston only implemented in zlo for now"); + } else if (rampNL3flag) { paccelz = maxvz / tott; if (zloflag) { zlo = z0 + paccelz*tott*tott/2.5 * (t2p5 ); vz = paccelz * tott * (t1p5 ); - } - else error->all(FLERR, - "NL ramp in wall/piston only implemented in zlo for now"); - } - else if (rampNL4flag) { + } else error->all(FLERR, "NL ramp in wall/piston only implemented in zlo for now"); + } else if (rampNL4flag) { paccelz = maxvz / tott; if (zloflag) { zlo = z0 + paccelz/tott/3.0 * (ttt); vz = paccelz / tott * (tt); - } - else error->all(FLERR, - "NL ramp in wall/piston only implemented in zlo for now"); - } - else if (rampNL5flag) { + } else error->all(FLERR, "NL ramp in wall/piston only implemented in zlo for now"); + } else if (rampNL5flag) { paccelz = maxvz / tott; if (zloflag) { zlo = z0 + paccelz/tott/tott/4.0 * (tttt); vz = paccelz / tott / tott * (ttt); - } - else error->all(FLERR, - "NL ramp in wall/piston only implemented in zlo for now"); - } - else { + } else error->all(FLERR, "NL ramp in wall/piston only implemented in zlo for now"); + } else { if (zloflag) { zlo = z0 + vz * t; } } - if (update->ntimestep % 1000 == 0) - if (comm->me == 0) { - if (screen) - fprintf(screen,"SHOCK: step " BIGINT_FORMAT - " t %g zpos %g vz %g az %g zlo %g\n", - update->ntimestep, t, zlo, vz, paccelz, domain->boxlo[2]); - if (logfile) - fprintf(logfile,"SHOCK: step " BIGINT_FORMAT - " t %g zpos %g vz %g az %g zlo %g\n", - update->ntimestep, t, zlo, vz, paccelz, domain->boxlo[2]); - } + if ((update->ntimestep % 1000 == 0) && (comm->me == 0)) + utils::logmesg(lmp,"SHOCK: step {} t {} zpos {} vz {} az {} zlo {}\n", + update->ntimestep, t, zlo, vz, paccelz, domain->boxlo[2]); // VIRIAL PRESSURE CONTRIBUTION? diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index 8c375e632b..1fee0ace0d 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -799,10 +799,8 @@ void NEBSpin::print_status() FILE *uscreen = universe->uscreen; FILE *ulogfile = universe->ulogfile; if (uscreen) { - fprintf(uscreen,BIGINT_FORMAT " %12.8g %12.8g ", - update->ntimestep,fmaxreplica,fmaxatom); - fprintf(uscreen,"%12.8g %12.8g %12.8g ", - gradvnorm0,gradvnorm1,gradvnormc); + fmt::print(uscreen,"{} {:12.8g} {:12.8g} ",update->ntimestep,fmaxreplica,fmaxatom); + fprintf(uscreen,"%12.8g %12.8g %12.8g ",gradvnorm0,gradvnorm1,gradvnormc); fprintf(uscreen,"%12.8g %12.8g %12.8g ",ebf,ebr,endpt); for (int i = 0; i < nreplica; i++) fprintf(uscreen,"%12.8g %12.8g ",rdist[i],all[i][0]); @@ -815,10 +813,8 @@ void NEBSpin::print_status() } if (ulogfile) { - fprintf(ulogfile,BIGINT_FORMAT " %12.8g %12.8g ", - update->ntimestep,fmaxreplica,fmaxatom); - fprintf(ulogfile,"%12.8g %12.8g %12.8g ", - gradvnorm0,gradvnorm1,gradvnormc); + fmt::print(ulogfile,"{} {:12.8} {:12.8g} ",update->ntimestep,fmaxreplica,fmaxatom); + fprintf(ulogfile,"%12.8g %12.8g %12.8g ",gradvnorm0,gradvnorm1,gradvnormc); fprintf(ulogfile,"%12.8g %12.8g %12.8g ",ebf,ebr,endpt); for (int i = 0; i < nreplica; i++) fprintf(ulogfile,"%12.8g %12.8g ",rdist[i],all[i][0]); diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index 1b588262e4..f4bcbec0b5 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -3942,6 +3942,7 @@ double FixSRD::distance(int i, int j) } /* ---------------------------------------------------------------------- */ +#ifdef SRD_DEBUG void FixSRD::print_collision(int i, int j, int ibounce, double t_remain, double dt, double *xscoll, double *xbcoll, double *norm, int type) @@ -3951,8 +3952,7 @@ void FixSRD::print_collision(int i, int j, int ibounce, double t_remain, double double **v = atom->v; if (type != WALL) { - printf("COLLISION between SRD " TAGINT_FORMAT " and BIG " TAGINT_FORMAT "\n", atom->tag[i], - atom->tag[j]); + fmt::print("COLLISION between SRD {} and BIG {}\n", atom->tag[i], atom->tag[j]); printf(" bounce # = %d\n", ibounce + 1); printf(" local indices: %d %d\n", i, j); printf(" timestep = %g\n", dt); @@ -3993,7 +3993,7 @@ void FixSRD::print_collision(int i, int j, int ibounce, double t_remain, double } else { int dim = wallwhich[j] / 2; - printf("COLLISION between SRD " TAGINT_FORMAT " and WALL %d\n", atom->tag[i], j); + fmt::print("COLLISION between SRD {} and WALL {}\n", atom->tag[i], j); printf(" bounce # = %d\n", ibounce + 1); printf(" local indices: %d %d\n", i, j); printf(" timestep = %g\n", dt); @@ -4025,3 +4025,6 @@ void FixSRD::print_collision(int i, int j, int ibounce, double t_remain, double printf(" separation at end = %g\n", rend); } } +#else +void FixSRD::print_collision(int, int, int, double, double, double *, double *, double *, int) {} +#endif diff --git a/src/UEF/dump_cfg_uef.cpp b/src/UEF/dump_cfg_uef.cpp index aea0bad8cf..f055ac3f7d 100644 --- a/src/UEF/dump_cfg_uef.cpp +++ b/src/UEF/dump_cfg_uef.cpp @@ -86,7 +86,7 @@ void DumpCFGUef::write_header(bigint n) if (atom->peri_flag) scale = atom->pdscale; else if (unwrapflag == 1) scale = UNWRAPEXPAND; - fprintf(fp,"Number of particles = " BIGINT_FORMAT "\n",n); + fmt::print(fp,"Number of particles = {}\n",n); fprintf(fp,"A = %g Angstrom (basic length-scale)\n",scale); // in box[][] columns are cell edges // in H0, rows are cell edges From 993441b25ab5b603bf3369592ce58a6ceaa01d4b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 30 Mar 2022 17:44:18 -0400 Subject: [PATCH 057/130] avoid XXXINT_FORMAT macros in fix reaxff/bonds --- src/REAXFF/fix_reaxff_bonds.cpp | 40 ++++++++++++++------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/src/REAXFF/fix_reaxff_bonds.cpp b/src/REAXFF/fix_reaxff_bonds.cpp index 30c55d8f1a..80cd8c7c85 100644 --- a/src/REAXFF/fix_reaxff_bonds.cpp +++ b/src/REAXFF/fix_reaxff_bonds.cpp @@ -56,8 +56,8 @@ FixReaxFFBonds::FixReaxFFBonds(LAMMPS *lmp, int narg, char **arg) : if (!fp) error->one(FLERR,"Cannot open compressed file"); } else fp = fopen(arg[4],"w"); - if (!fp) error->one(FLERR,fmt::format("Cannot open fix reaxff/bonds file {}: " - "{}",arg[4],utils::getsyserror())); + if (!fp) error->one(FLERR,fmt::format("Cannot open fix reaxff/bonds file {}: {}", + arg[4],utils::getsyserror())); } if (atom->tag_consecutive() == 0) @@ -249,14 +249,12 @@ void FixReaxFFBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local, MPI_Request irequest, irequest2; if (me == 0) { - fprintf(fp,"# Timestep " BIGINT_FORMAT " \n",ntimestep); - fprintf(fp,"# \n"); - fprintf(fp,"# Number of particles %d \n",natoms); - fprintf(fp,"# \n"); - fprintf(fp,"# Max number of bonds per atom %d with " - "coarse bond order cutoff %5.3f \n",maxnum,cutof3); - fprintf(fp,"# Particle connection table and bond orders \n"); - fprintf(fp,"# id type nb id_1...id_nb mol bo_1...bo_nb abo nlp q \n"); + fmt::print(fp,"# Timestep {}\n#\n",ntimestep); + fmt::print(fp,"# Number of particles {}\n#\n",natoms); + fmt::print(fp,"# Max number of bonds per atom {} with coarse bond order cutoff {:5.3f}\n", + maxnum,cutof3); + fmt::print(fp,"# Particle connection table and bond orders\n" + "# id type nb id_1...id_nb mol bo_1...bo_nb abo nlp q\n"); } j = 2; @@ -278,30 +276,26 @@ void FixReaxFFBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local, avqtmp = buf[j+3]; numbonds = nint(buf[j+4]); - fprintf(fp," " TAGINT_FORMAT " %d %d",itag,itype,numbonds); - - for (k = 5; k < 5+numbonds; k++) { - jtag = static_cast (buf[j+k]); - fprintf(fp," " TAGINT_FORMAT,jtag); - } + auto mesg = fmt::format(" {} {} {}",itag,itype,numbonds); + for (k = 5; k < 5+numbonds; k++) + mesg += " " + std::to_string(static_cast (buf[j+k])); j += (5+numbonds); - fprintf(fp," " TAGINT_FORMAT,static_cast (buf[j])); + mesg += " " + std::to_string(static_cast (buf[j])); j ++; - for (k = 0; k < numbonds; k++) { - abotmp = buf[j+k]; - fprintf(fp,"%14.3f",abotmp); - } + for (k = 0; k < numbonds; k++) mesg += fmt::format("{:14.3f}",buf[j+k]); j += (1+numbonds); - fprintf(fp,"%14.3f%14.3f%14.3f\n",sbotmp,nlptmp,avqtmp); + + mesg += fmt::format("{:14.3f}{:14.3f}{:14.3f}\n",sbotmp,nlptmp,avqtmp); + fmt::print(fp, mesg); } } } else { MPI_Isend(&buf[0],nbuf_local,MPI_DOUBLE,0,0,world,&irequest2); MPI_Wait(&irequest2,MPI_STATUS_IGNORE); } - if (me ==0) fprintf(fp,"# \n"); + if (me ==0) fputs("# \n",fp); } From 65a083c83ddf2fcdba87d7495ca0f566321f12ac Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Wed, 30 Mar 2022 15:52:55 -0600 Subject: [PATCH 058/130] add support for VELOCITIES command at nodes --- src/MDI/mdi_engine.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 84707def29..a90e8175d3 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -325,7 +325,8 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) receive_types(); } else if (strcmp(command,">VELOCITIES") == 0) { - receive_velocities(); + if (strcmp(node_engine,"@DEFAULT") == 0) receive_velocities(); + else receive_double3(VELOCITY); // ----------------------------------------------- @@ -521,7 +522,9 @@ void MDIEngine::mdi_commands() MDI_Register_node("@COORDS"); MDI_Register_command("@COORDS","<@"); MDI_Register_command("@COORDS","COORDS"); + MDI_Register_command("@COORDS",">VELOCITIES"); MDI_Register_command("@COORDS","@"); MDI_Register_command("@COORDS","@DEFAULT"); MDI_Register_command("@COORDS","@COORDS"); @@ -542,8 +545,10 @@ void MDIEngine::mdi_commands() MDI_Register_command("@FORCES","FORCES"); MDI_Register_command("@FORCES",">+FORCES"); + MDI_Register_command("@FORCES",">VELOCITIES"); MDI_Register_command("@FORCES","@"); MDI_Register_command("@FORCES","@DEFAULT"); MDI_Register_command("@FORCES","@COORDS"); @@ -1149,6 +1154,14 @@ void MDIEngine::receive_double3(int which) f[i][1] += buf3[3*ilocal+1] * mdi2lmp_force; f[i][2] += buf3[3*ilocal+2] * mdi2lmp_force; } + } else if (which == VELOCITY) { + double **v = atom->v; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast (tag[i]) - 1; + v[i][0] = buf3[3*ilocal+0] * mdi2lmp_velocity; + v[i][1] = buf3[3*ilocal+1] * mdi2lmp_velocity; + v[i][2] = buf3[3*ilocal+2] * mdi2lmp_velocity; + } } } From 1c9dc9c0d919bf6f97010694ec2ffcef39a9f9c0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 30 Mar 2022 22:11:46 -0400 Subject: [PATCH 059/130] correct formatting --- doc/src/fix_ttm.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/fix_ttm.rst b/doc/src/fix_ttm.rst index 777e7a894b..80a18d3dbe 100644 --- a/doc/src/fix_ttm.rst +++ b/doc/src/fix_ttm.rst @@ -154,7 +154,7 @@ of the electronic specific heat, but ignored temperature dependencies of any of the other parameters. See more discussion below for fix ttm/mod. -..note:: +.. note:: These fixes do not perform time integration of the atoms in the fix group, they only rescale their velocities. Thus a time integration @@ -164,7 +164,7 @@ ttm/mod. fix, e.g. :doc:`fix nvt ` or :doc:`fix langevin `. -..note:: +.. note:: These fixes require use of an orthogonal 3d simulation box with periodic boundary conditions in all dimensions. They also require @@ -305,8 +305,8 @@ is calculated as where lambda is the electron mean free path (see :ref:`(Norman) `, :ref:`(Pisarev) `) -The fix ttm/mod parameter file *init_file* has the following syntax/ -Every line with the odd number is considered as a comment and +The fix ttm/mod parameter file *init_file* has the following syntax. +Every line with an odd number is considered as a comment and ignored. The lines with the even numbers are treated as follows: .. parsed-literal:: From b64e90dfe058f315416ca803fe62342c1ddbcf6c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 30 Mar 2022 22:13:05 -0400 Subject: [PATCH 060/130] simplify. avoid XXXINT_FORMAT macros --- src/COMPRESS/dump_cfg_gz.cpp | 26 +++++----- src/COMPRESS/dump_cfg_zstd.cpp | 20 +++---- src/COMPRESS/dump_xyz_gz.cpp | 8 ++- src/COMPRESS/dump_xyz_zstd.cpp | 8 ++- src/MPIIO/dump_atom_mpiio.cpp | 16 ++---- src/MPIIO/dump_cfg_mpiio.cpp | 57 +++++++++----------- src/MPIIO/dump_xyz_mpiio.cpp | 22 ++++---- src/OPENMP/fix_qeq_comb_omp.cpp | 92 +++++++++++++++------------------ src/PHONON/fix_phonon.cpp | 67 ++++++++++++------------ src/QMMM/fix_qmmm.cpp | 68 ++++++------------------ src/dump_cfg.cpp | 29 ++++++----- src/dump_xyz.cpp | 8 +-- 12 files changed, 175 insertions(+), 246 deletions(-) diff --git a/src/COMPRESS/dump_cfg_gz.cpp b/src/COMPRESS/dump_cfg_gz.cpp index dcf85e1fc5..3b2f10ddb0 100644 --- a/src/COMPRESS/dump_cfg_gz.cpp +++ b/src/COMPRESS/dump_cfg_gz.cpp @@ -91,22 +91,20 @@ void DumpCFGGZ::write_header(bigint n) // so molecules are not split across periodic box boundaries double scale = 1.0; - if (atom->peri_flag) - scale = atom->pdscale; - else if (unwrapflag == 1) - scale = UNWRAPEXPAND; + if (atom->peri_flag) scale = atom->pdscale; + else if (unwrapflag == 1) scale = UNWRAPEXPAND; std::string header = fmt::format("Number of particles = {}\n", n); - header += fmt::format("A = {0:g} Angstrom (basic length-scale)\n", scale); - header += fmt::format("H0(1,1) = {0:g} A\n", domain->xprd); - header += fmt::format("H0(1,2) = 0 A \n"); - header += fmt::format("H0(1,3) = 0 A \n"); - header += fmt::format("H0(2,1) = {0:g} A \n", domain->xy); - header += fmt::format("H0(2,2) = {0:g} A\n", domain->yprd); - header += fmt::format("H0(2,3) = 0 A \n"); - header += fmt::format("H0(3,1) = {0:g} A \n", domain->xz); - header += fmt::format("H0(3,2) = {0:g} A \n", domain->yz); - header += fmt::format("H0(3,3) = {0:g} A\n", domain->zprd); + header += fmt::format("A = {:g} Angstrom (basic length-scale)\n", scale); + header += fmt::format("H0(1,1) = {:g} A\n", domain->xprd); + header += fmt::format("H0(1,2) = 0 A\n"); + header += fmt::format("H0(1,3) = 0 A\n"); + header += fmt::format("H0(2,1) = {:g} A\n", domain->xy); + header += fmt::format("H0(2,2) = {:g} A\n", domain->yprd); + header += fmt::format("H0(2,3) = 0 A\n"); + header += fmt::format("H0(3,1) = {:g} A\n", domain->xz); + header += fmt::format("H0(3,2) = {:g} A\n", domain->yz); + header += fmt::format("H0(3,3) = {:g} A\n", domain->zprd); header += fmt::format(".NO_VELOCITY.\n"); header += fmt::format("entry_count = {}\n", nfield - 2); for (int i = 0; i < nfield - 5; i++) header += fmt::format("auxiliary[{}] = {}\n", i, auxname[i]); diff --git a/src/COMPRESS/dump_cfg_zstd.cpp b/src/COMPRESS/dump_cfg_zstd.cpp index 8a3dc32e8d..865a8ccf87 100644 --- a/src/COMPRESS/dump_cfg_zstd.cpp +++ b/src/COMPRESS/dump_cfg_zstd.cpp @@ -105,16 +105,16 @@ void DumpCFGZstd::write_header(bigint n) scale = UNWRAPEXPAND; std::string header = fmt::format("Number of particles = {}\n", n); - header += fmt::format("A = {0:g} Angstrom (basic length-scale)\n", scale); - header += fmt::format("H0(1,1) = {0:g} A\n", domain->xprd); - header += fmt::format("H0(1,2) = 0 A \n"); - header += fmt::format("H0(1,3) = 0 A \n"); - header += fmt::format("H0(2,1) = {0:g} A \n", domain->xy); - header += fmt::format("H0(2,2) = {0:g} A\n", domain->yprd); - header += fmt::format("H0(2,3) = 0 A \n"); - header += fmt::format("H0(3,1) = {0:g} A \n", domain->xz); - header += fmt::format("H0(3,2) = {0:g} A \n", domain->yz); - header += fmt::format("H0(3,3) = {0:g} A\n", domain->zprd); + header += fmt::format("A = {:g} Angstrom (basic length-scale)\n", scale); + header += fmt::format("H0(1,1) = {:g} A\n", domain->xprd); + header += fmt::format("H0(1,2) = 0 A\n"); + header += fmt::format("H0(1,3) = 0 A\n"); + header += fmt::format("H0(2,1) = {:g} A\n", domain->xy); + header += fmt::format("H0(2,2) = {:g} A\n", domain->yprd); + header += fmt::format("H0(2,3) = 0 A\n"); + header += fmt::format("H0(3,1) = {:g} A\n", domain->xz); + header += fmt::format("H0(3,2) = {:g} A\n", domain->yz); + header += fmt::format("H0(3,3) = {:g} A\n", domain->zprd); header += fmt::format(".NO_VELOCITY.\n"); header += fmt::format("entry_count = {}\n", nfield - 2); for (int i = 0; i < nfield - 5; i++) header += fmt::format("auxiliary[{}] = {}\n", i, auxname[i]); diff --git a/src/COMPRESS/dump_xyz_gz.cpp b/src/COMPRESS/dump_xyz_gz.cpp index 9bfead1c5c..4b544c0d67 100644 --- a/src/COMPRESS/dump_xyz_gz.cpp +++ b/src/COMPRESS/dump_xyz_gz.cpp @@ -81,11 +81,9 @@ void DumpXYZGZ::openfile() void DumpXYZGZ::write_header(bigint ndump) { if (me == 0) { - auto header = fmt::format("{}\n", ndump); - if (time_flag) { - double tcurrent = update->atime + (update->ntimestep-update->atimestep) + update->dt; - header += fmt::format(" Atoms. Timestep: {} Time: {:.6f}\n", update->ntimestep, tcurrent); - } else header += fmt::format(" Atoms. Timestep: {}\n", update->ntimestep); + auto header = fmt::format("{}\n Atoms. Timestep: {}", ndump, update->ntimestep); + if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time()); + header += "\n"; writer.write(header.c_str(), header.length()); } } diff --git a/src/COMPRESS/dump_xyz_zstd.cpp b/src/COMPRESS/dump_xyz_zstd.cpp index bb2640b1b8..ed87bb3f2c 100644 --- a/src/COMPRESS/dump_xyz_zstd.cpp +++ b/src/COMPRESS/dump_xyz_zstd.cpp @@ -89,11 +89,9 @@ void DumpXYZZstd::openfile() void DumpXYZZstd::write_header(bigint ndump) { if (me == 0) { - auto header = fmt::format("{}\n", ndump); - if (time_flag) { - double tcurrent = update->atime + (update->ntimestep-update->atimestep) + update->dt; - header += fmt::format(" Atoms. Timestep: {} Time: {:.6f}\n", update->ntimestep, tcurrent); - } else header += fmt::format(" Atoms. Timestep: {}\n", update->ntimestep); + auto header = fmt::format("{}\n Atoms. Timestep: {}", ndump, update->ntimestep); + if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time()); + header += "\n"; writer.write(header.c_str(), header.length()); } } diff --git a/src/MPIIO/dump_atom_mpiio.cpp b/src/MPIIO/dump_atom_mpiio.cpp index 9ba779924f..aedb4005d2 100644 --- a/src/MPIIO/dump_atom_mpiio.cpp +++ b/src/MPIIO/dump_atom_mpiio.cpp @@ -212,20 +212,10 @@ void DumpAtomMPIIO::init_style() delete[] format; if (format_line_user) { - int n = strlen(format_line_user) + 2; - format = new char[n]; - strcpy(format, format_line_user); - strcat(format, "\n"); + format = utils::strdup(std::string(format_line_user) + "\n"); } else { - char *str; - if (image_flag == 0) - str = (char *) TAGINT_FORMAT " %d %g %g %g"; - else - str = (char *) TAGINT_FORMAT " %d %g %g %g %d %d %d"; - int n = strlen(str) + 2; - format = new char[n]; - strcpy(format, str); - strcat(format, "\n"); + if (image_flag == 0) format = utils::strdup(TAGINT_FORMAT " %d %g %g %g\n"); + else format = utils::strdup(TAGINT_FORMAT " %d %g %g %g %d %d %d\n"); } // setup boundary string diff --git a/src/MPIIO/dump_cfg_mpiio.cpp b/src/MPIIO/dump_cfg_mpiio.cpp index 88072d5adc..4f601eb865 100644 --- a/src/MPIIO/dump_cfg_mpiio.cpp +++ b/src/MPIIO/dump_cfg_mpiio.cpp @@ -271,41 +271,32 @@ void DumpCFGMPIIO::write_header(bigint n) // for unwrapped coords, set to UNWRAPEXPAND (10.0) // so molecules are not split across periodic box boundaries + double scale = 1.0; + if (atom->peri_flag) scale = atom->pdscale; + else if (unwrapflag == 1) scale = UNWRAPEXPAND; + + auto header = fmt::format("Number of particles = {}\n",n); + header += fmt::format("A = {} Angstrom (basic length-scale)\n",scale); + header += fmt::format("H0(1,1) = {} A\n",domain->xprd); + header += fmt::format("H0(1,2) = 0 A\n"); + header += fmt::format("H0(1,3) = 0 A\n"); + header += fmt::format("H0(2,1) = {} A\n",domain->xy); + header += fmt::format("H0(2,2) = {} A\n",domain->yprd); + header += fmt::format("H0(2,3) = 0 A\n"); + header += fmt::format("H0(3,1) = {} A\n",domain->xz); + header += fmt::format("H0(3,2) = {} A\n",domain->yz); + header += fmt::format("H0(3,3) = {} A\n",domain->zprd); + header += fmt::format(".NO_VELOCITY.\n"); + header += fmt::format("entry_count = {}\n",nfield-2); + for (int i = 0; i < nfield-5; i++) + header += fmt::format("auxiliary[{}] = {}\n",i,auxname[i]); + if (performEstimate) { - - headerBuffer = (char *) malloc(MAX_TEXT_HEADER_SIZE); - - headerSize = 0; - - double scale = 1.0; - if (atom->peri_flag) scale = atom->pdscale; - else if (unwrapflag == 1) scale = UNWRAPEXPAND; - - char str[64]; - - sprintf(str,"Number of particles = %s\n",BIGINT_FORMAT); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),str,n); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"A = %g Angstrom (basic length-scale)\n",scale); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(1,1) = %g A\n",domain->xprd); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(1,2) = 0 A \n"); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(1,3) = 0 A \n"); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(2,1) = %g A \n",domain->xy); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(2,2) = %g A\n",domain->yprd); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(2,3) = 0 A \n"); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(3,1) = %g A \n",domain->xz); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(3,2) = %g A \n",domain->yz); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(3,3) = %g A\n",domain->zprd); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),".NO_VELOCITY.\n"); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"entry_count = %d\n",nfield-2); - for (int i = 0; i < nfield-5; i++) - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"auxiliary[%d] = %s\n",i,auxname[i]); - } - else { // write data - + headerSize = header.size(); + } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_CHAR,MPI_STATUS_IGNORE); - mpifo += headerSize; - free(headerBuffer); + MPI_File_write_at(mpifh,mpifo,header.c_str(),header.size(),MPI_CHAR,MPI_STATUS_IGNORE); + mpifo += header.size(); } } diff --git a/src/MPIIO/dump_xyz_mpiio.cpp b/src/MPIIO/dump_xyz_mpiio.cpp index c976932b52..e829ff7a30 100644 --- a/src/MPIIO/dump_xyz_mpiio.cpp +++ b/src/MPIIO/dump_xyz_mpiio.cpp @@ -100,12 +100,11 @@ void DumpXYZMPIIO::openfile() if (append_flag) { // append open int err = MPI_File_open( world, filecurrent, MPI_MODE_CREATE | MPI_MODE_APPEND | MPI_MODE_WRONLY , MPI_INFO_NULL, &mpifh); - if (err != MPI_SUCCESS) error->one(FLERR, "Cannot open dump file {}",filecurrent); + if (err != MPI_SUCCESS) error->one(FLERR, "Cannot open dump file {}", filecurrent); int myrank; MPI_Comm_rank(world,&myrank); - if (myrank == 0) - MPI_File_get_size(mpifh,&mpifo); + if (myrank == 0) MPI_File_get_size(mpifh,&mpifo); MPI_Bcast(&mpifo, 1, MPI_LMP_BIGINT, 0, world); MPI_File_set_size(mpifh,mpifo+headerSize+sumFileSize); currentFileSize = mpifo+headerSize+sumFileSize; @@ -238,19 +237,16 @@ void DumpXYZMPIIO::init_style() void DumpXYZMPIIO::write_header(bigint n) { + auto header = fmt::format("{}\n Atoms. Timestep: {}", n, update->ntimestep); + if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time()); + header += "\n"; + if (performEstimate) { - - headerBuffer = (char *) malloc(MAX_TEXT_HEADER_SIZE); - - headerSize = 0; - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),BIGINT_FORMAT "\n",n); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"Atoms. Timestep: " BIGINT_FORMAT "\n",update->ntimestep); + headerSize = header.size(); } else { // write data - if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_CHAR,MPI_STATUS_IGNORE); - mpifo += headerSize; - free(headerBuffer); + MPI_File_write_at(mpifh,mpifo,header.c_str(),header.size(),MPI_CHAR,MPI_STATUS_IGNORE); + mpifo += header.size(); } } diff --git a/src/OPENMP/fix_qeq_comb_omp.cpp b/src/OPENMP/fix_qeq_comb_omp.cpp index 82d0b0665a..18f579ad3a 100644 --- a/src/OPENMP/fix_qeq_comb_omp.cpp +++ b/src/OPENMP/fix_qeq_comb_omp.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -36,45 +35,41 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixQEQCombOMP::FixQEQCombOMP(LAMMPS *lmp, int narg, char **arg) : - FixQEQComb(lmp, narg, arg) +FixQEQCombOMP::FixQEQCombOMP(LAMMPS *lmp, int narg, char **arg) : FixQEQComb(lmp, narg, arg) { - if (narg < 5) error->all(FLERR,"Illegal fix qeq/comb/omp command"); + if (narg < 5) error->all(FLERR, "Illegal fix qeq/comb/omp command"); } /* ---------------------------------------------------------------------- */ void FixQEQCombOMP::init() { - if (!atom->q_flag) - error->all(FLERR,"Fix qeq/comb/omp requires atom attribute q"); + if (!atom->q_flag) error->all(FLERR, "Fix qeq/comb/omp requires atom attribute q"); - if (nullptr != force->pair_match("comb3",0)) - error->all(FLERR,"No support for comb3 currently available in OPENMP"); + if (nullptr != force->pair_match("comb3", 0)) + error->all(FLERR, "No support for comb3 currently available in OPENMP"); - comb = (PairComb *) force->pair_match("comb/omp",1); + comb = (PairComb *) force->pair_match("comb/omp", 1); + if (comb == nullptr) comb = (PairComb *) force->pair_match("comb", 1); if (comb == nullptr) - comb = (PairComb *) force->pair_match("comb",1); - if (comb == nullptr) - error->all(FLERR,"Must use pair_style comb or " - "comb/omp with fix qeq/comb/omp"); + error->all(FLERR, "Must use pair_style comb or comb/omp with fix qeq/comb/omp"); - if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; - if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); + if (utils::strmatch(update->integrate_style, "^respa")) { + ilevel_respa = ((Respa *) update->integrate)->nlevels - 1; + if (respa_level >= 0) ilevel_respa = MIN(respa_level, ilevel_respa); } ngroup = group->count(igroup); - if (ngroup == 0) error->all(FLERR,"Fix qeq/comb group has no atoms"); + if (ngroup == 0) error->all(FLERR, "Fix qeq/comb group has no atoms"); } /* ---------------------------------------------------------------------- */ void FixQEQCombOMP::post_force(int /* vflag */) { - int i,ii,iloop,loopmax,inum,*ilist; - double heatpq,qmass,dtq,dtq2; - double enegchkall,enegmaxall; + int i, ii, iloop, loopmax, inum, *ilist; + double heatpq, qmass, dtq, dtq2; + double enegchkall, enegmaxall; if (update->ntimestep % nevery) return; @@ -88,28 +83,28 @@ void FixQEQCombOMP::post_force(int /* vflag */) memory->destroy(q1); memory->destroy(q2); nmax = atom->nmax; - memory->create(qf,nmax,"qeq:qf"); - memory->create(q1,nmax,"qeq:q1"); - memory->create(q2,nmax,"qeq:q2"); + memory->create(qf, nmax, "qeq:qf"); + memory->create(q1, nmax, "qeq:q1"); + memory->create(q2, nmax, "qeq:q2"); vector_atom = qf; } // more loops for first-time charge equilibrium iloop = 0; - if (firstflag) loopmax = 500; - else loopmax = 200; + if (firstflag) + loopmax = 500; + else + loopmax = 200; // charge-equilibration loop - if (me == 0 && fp) - fprintf(fp,"Charge equilibration on step " BIGINT_FORMAT "\n", - update->ntimestep); + if (me == 0 && fp) fmt::print(fp, "Charge equilibration on step {}\n", update->ntimestep); heatpq = 0.05; - qmass = 0.016; - dtq = 0.01; - dtq2 = 0.5*dtq*dtq/qmass; + qmass = 0.016; + dtq = 0.01; + dtq2 = 0.5 * dtq * dtq / qmass; double enegchk = 0.0; double enegtot = 0.0; @@ -126,54 +121,51 @@ void FixQEQCombOMP::post_force(int /* vflag */) q1[i] = q2[i] = qf[i] = 0.0; } - for (iloop = 0; iloop < loopmax; iloop ++) { + for (iloop = 0; iloop < loopmax; iloop++) { for (ii = 0; ii < inum; ii++) { i = ilist[ii]; if (mask[i] & groupbit) { - q1[i] += qf[i]*dtq2 - heatpq*q1[i]; - q[i] += q1[i]; + q1[i] += qf[i] * dtq2 - heatpq * q1[i]; + q[i] += q1[i]; } } comm->forward_comm(this); - if (comb) enegtot = comb->yasu_char(qf,igroup); + if (comb) enegtot = comb->yasu_char(qf, igroup); enegtot /= ngroup; enegchk = enegmax = 0.0; - for (ii = 0; ii < inum ; ii++) { + for (ii = 0; ii < inum; ii++) { i = ilist[ii]; if (mask[i] & groupbit) { - q2[i] = enegtot-qf[i]; - enegmax = MAX(enegmax,fabs(q2[i])); + q2[i] = enegtot - qf[i]; + enegmax = MAX(enegmax, fabs(q2[i])); enegchk += fabs(q2[i]); qf[i] = q2[i]; } } - MPI_Allreduce(&enegchk,&enegchkall,1,MPI_DOUBLE,MPI_SUM,world); - enegchk = enegchkall/ngroup; - MPI_Allreduce(&enegmax,&enegmaxall,1,MPI_DOUBLE,MPI_MAX,world); + MPI_Allreduce(&enegchk, &enegchkall, 1, MPI_DOUBLE, MPI_SUM, world); + enegchk = enegchkall / ngroup; + MPI_Allreduce(&enegmax, &enegmaxall, 1, MPI_DOUBLE, MPI_MAX, world); enegmax = enegmaxall; - if (enegchk <= precision && enegmax <= 100.0*precision) break; + if (enegchk <= precision && enegmax <= 100.0 * precision) break; if (me == 0 && fp) - fprintf(fp," iteration: %d, enegtot %.6g, " - "enegmax %.6g, fq deviation: %.6g\n", - iloop,enegtot,enegmax,enegchk); + fprintf(fp, " iteration: %d, enegtot %.6g, enegmax %.6g, fq deviation: %.6g\n", iloop, + enegtot, enegmax, enegchk); for (ii = 0; ii < inum; ii++) { i = ilist[ii]; - if (mask[i] & groupbit) - q1[i] += qf[i]*dtq2 - heatpq*q1[i]; + if (mask[i] & groupbit) q1[i] += qf[i] * dtq2 - heatpq * q1[i]; } } if (me == 0 && fp) { if (iloop == loopmax) - fprintf(fp,"Charges did not converge in %d iterations\n",iloop); + fprintf(fp, "Charges did not converge in %d iterations\n", iloop); else - fprintf(fp,"Charges converged in %d iterations to %.10f tolerance\n", - iloop,enegchk); + fprintf(fp, "Charges converged in %d iterations to %.10f tolerance\n", iloop, enegchk); } } diff --git a/src/PHONON/fix_phonon.cpp b/src/PHONON/fix_phonon.cpp index 3da204f6b8..b85337e5db 100644 --- a/src/PHONON/fix_phonon.cpp +++ b/src/PHONON/fix_phonon.cpp @@ -183,23 +183,22 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) if (me == 0) { flog = fopen(logfile, "w"); if (flog == nullptr) - error->one(FLERR,"Can not open output file {}: {}", - logfile,utils::getsyserror()); - fprintf(flog,"############################################################\n"); - fprintf(flog,"# group name of the atoms under study : %s\n", group->names[igroup]); - fprintf(flog,"# total number of atoms in the group : %d\n", ngroup); - fprintf(flog,"# dimension of the system : %d D\n", sysdim); - fprintf(flog,"# number of atoms per unit cell : %d\n", nucell); - fprintf(flog,"# dimension of the FFT mesh : %d x %d x %d\n", nx, ny, nz); - fprintf(flog,"# number of wait steps before measurement : " BIGINT_FORMAT "\n", waitsteps); - fprintf(flog,"# frequency of the measurement : %d\n", nevery); - fprintf(flog,"# output result after this many measurement: %d\n", nfreq); - fprintf(flog,"# number of processors used by this run : %d\n", nprocs); - fprintf(flog,"############################################################\n"); - fprintf(flog,"# mapping information between lattice indices and atom id\n"); - fprintf(flog,"# nx ny nz nucell\n"); - fprintf(flog,"%d %d %d %d\n", nx, ny, nz, nucell); - fprintf(flog,"# l1 l2 l3 k atom_id\n"); + error->one(FLERR,"Can not open output file {}: {}", logfile,utils::getsyserror()); + fmt::print(flog,"############################################################\n"); + fmt::print(flog,"# group name of the atoms under study : {}\n", group->names[igroup]); + fmt::print(flog,"# total number of atoms in the group : {}\n", ngroup); + fmt::print(flog,"# dimension of the system : {} D\n", sysdim); + fmt::print(flog,"# number of atoms per unit cell : {}\n", nucell); + fmt::print(flog,"# dimension of the FFT mesh : {} x {} x {}\n", nx, ny, nz); + fmt::print(flog,"# number of wait steps before measurement : {}\n", waitsteps); + fmt::print(flog,"# frequency of the measurement : {}\n", nevery); + fmt::print(flog,"# output result after this many measurement: {}\n", nfreq); + fmt::print(flog,"# number of processors used by this run : {}\n", nprocs); + fmt::print(flog,"############################################################\n"); + fmt::print(flog,"# mapping information between lattice indices and atom id\n"); + fmt::print(flog,"# nx ny nz nucell\n"); + fmt::print(flog,"{} {} {} {}\n", nx, ny, nz, nucell); + fmt::print(flog,"# l1 l2 l3 k atom_id\n"); int ix, iy, iz, iu; for (idx = 0; idx < ngroup; ++idx) { itag = surf2tag[idx]; @@ -207,9 +206,9 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) iz = (idx/nucell)%nz; iy = (idx/(nucell*nz))%ny; ix = (idx/(nucell*nz*ny))%nx; - fprintf(flog,"%d %d %d %d " TAGINT_FORMAT "\n", ix, iy, iz, iu, itag); + fmt::print(flog,"{} {} {} {} {}\n", ix, iy, iz, iu, itag); } - fprintf(flog,"############################################################\n"); + fmt::print(flog,"############################################################\n"); fflush(flog); } surf2tag.clear(); @@ -737,16 +736,16 @@ void FixPhonon::postprocess( ) fclose(fp_bin); // write log file, here however, it is the dynamical matrix that is written - fprintf(flog,"############################################################\n"); - fprintf(flog,"# Current time step : " BIGINT_FORMAT "\n", update->ntimestep); - fprintf(flog,"# Total number of measurements : %d\n", neval); - fprintf(flog,"# Average temperature of the measurement : %lg\n", TempAve); - fprintf(flog,"# Boltzmann constant under current units : %lg\n", boltz); - fprintf(flog,"# basis vector A1 = [%lg %lg %lg]\n", basevec[0], basevec[1], basevec[2]); - fprintf(flog,"# basis vector A2 = [%lg %lg %lg]\n", basevec[3], basevec[4], basevec[5]); - fprintf(flog,"# basis vector A3 = [%lg %lg %lg]\n", basevec[6], basevec[7], basevec[8]); - fprintf(flog,"############################################################\n"); - fprintf(flog,"# qx\t qy \t qz \t\t Phi(q)\n"); + fmt::print(flog,"############################################################\n"); + fmt::print(flog,"# Current time step : {}\n", update->ntimestep); + fmt::print(flog,"# Total number of measurements : {}\n", neval); + fmt::print(flog,"# Average temperature of the measurement : {}\n", TempAve); + fmt::print(flog,"# Boltzmann constant under current units : {}\n", boltz); + fmt::print(flog,"# basis vector A1 = [{} {} {}]\n", basevec[0], basevec[1], basevec[2]); + fmt::print(flog,"# basis vector A2 = [{} {} {}]\n", basevec[3], basevec[4], basevec[5]); + fmt::print(flog,"# basis vector A3 = [{} {} {}]\n", basevec[6], basevec[7], basevec[8]); + fmt::print(flog,"############################################################\n"); + fmt::print(flog,"# qx\t qy \t qz \t\t Phi(q)\n"); EnforceASR(); @@ -754,7 +753,8 @@ void FixPhonon::postprocess( ) for (idq = 0; idq < ntotal; ++idq) { ndim =0; for (idim = 0; idim < fft_dim; ++idim) - for (jdim = 0; jdim < fft_dim; ++jdim) Phi_all[idq][ndim++] *= M_inv_sqrt[idim/sysdim]*M_inv_sqrt[jdim/sysdim]; + for (jdim = 0; jdim < fft_dim; ++jdim) + Phi_all[idq][ndim++] *= M_inv_sqrt[idim/sysdim]*M_inv_sqrt[jdim/sysdim]; } idq =0; @@ -764,11 +764,10 @@ void FixPhonon::postprocess( ) double qy = double(iy)/double(ny); for (int iz = 0; iz < nz; ++iz) { double qz = double(iz)/double(nz); - fprintf(flog,"%lg %lg %lg", qx, qy, qz); + fmt::print(flog,"{} {} {}", qx, qy, qz); for (idim = 0; idim < fft_dim2; ++idim) - fprintf(flog, " %lg %lg", std::real(Phi_all[idq][idim]), - std::imag(Phi_all[idq][idim])); - fprintf(flog, "\n"); + fmt::print(flog, " {} {}", std::real(Phi_all[idq][idim]), std::imag(Phi_all[idq][idim])); + fmt::print(flog, "\n"); ++idq; } } diff --git a/src/QMMM/fix_qmmm.cpp b/src/QMMM/fix_qmmm.cpp index 8c59077c7d..d0cfe2ed95 100644 --- a/src/QMMM/fix_qmmm.cpp +++ b/src/QMMM/fix_qmmm.cpp @@ -443,10 +443,7 @@ void FixQMMM::exchange_positions() MPI_Send(isend_buf, 4, MPI_INT, 1, QMMM_TAG_SIZE, qm_comm); MPI_Send(celldata, 9, MPI_DOUBLE, 1, QMMM_TAG_CELL, qm_comm); } - if (verbose > 0) { - if (screen) fputs("QMMM: exchange positions\n",screen); - if (logfile) fputs("QMMM: exchange positions\n",logfile); - } + if (verbose > 0) utils::logmesg(lmp, "QMMM: exchange positions\n"); } if (qmmm_role == QMMM_ROLE_MASTER) { @@ -537,10 +534,7 @@ void FixQMMM::exchange_forces() const int nlocal = atom->nlocal; const int natoms = (int) atom->natoms; - if ((comm->me) == 0 && (verbose > 0)) { - if (screen) fputs("QMMM: exchange forces\n",screen); - if (logfile) fputs("QMMM: exchange forces\n",logfile); - } + if ((comm->me) == 0 && (verbose > 0)) utils::logmesg(lmp, "QMMM: exchange forces\n"); if (qmmm_role == QMMM_ROLE_MASTER) { struct commdata *buf = static_cast(comm_buf); @@ -561,21 +555,14 @@ void FixQMMM::exchange_forces() // so we need to apply the scaling factor to get to the // supported internal units ("metal" or "real") for (int i=0; i < num_qm; ++i) { - if (verbose > 1) { - const char fmt[] = "[" TAGINT_FORMAT "]: QM(%g %g %g) MM(%g %g %g) /\\(%g %g %g)\n"; - if (screen) fprintf(screen, fmt, qm_remap[i], - qmmm_fscale*qm_force[3*i+0], qmmm_fscale*qm_force[3*i+1], qmmm_fscale*qm_force[3*i+2], - mm_force_on_qm_atoms[3*i+0], mm_force_on_qm_atoms[3*i+1], mm_force_on_qm_atoms[3*i+2], - qmmm_fscale*qm_force[3*i+0] - mm_force_on_qm_atoms[3*i+0], - qmmm_fscale*qm_force[3*i+1] - mm_force_on_qm_atoms[3*i+1], - qmmm_fscale*qm_force[3*i+2] - mm_force_on_qm_atoms[3*i+2]); - if (logfile) fprintf(logfile, fmt, qm_remap[i], - qmmm_fscale*qm_force[3*i+0], qmmm_fscale*qm_force[3*i+1], qmmm_fscale*qm_force[3*i+2], - mm_force_on_qm_atoms[3*i+0], mm_force_on_qm_atoms[3*i+1], mm_force_on_qm_atoms[3*i+2], - qmmm_fscale*qm_force[3*i+0] - mm_force_on_qm_atoms[3*i+0], - qmmm_fscale*qm_force[3*i+1] - mm_force_on_qm_atoms[3*i+1], - qmmm_fscale*qm_force[3*i+2] - mm_force_on_qm_atoms[3*i+2]); - } + if (verbose > 1) + utils::logmesg(lmp, "[{}]: QM({} {} {}) MM({} {} {}) /\\({} {} {})\n", qm_remap[i], + qmmm_fscale*qm_force[3*i+0], qmmm_fscale*qm_force[3*i+1], qmmm_fscale*qm_force[3*i+2], + mm_force_on_qm_atoms[3*i+0], mm_force_on_qm_atoms[3*i+1], mm_force_on_qm_atoms[3*i+2], + qmmm_fscale*qm_force[3*i+0] - mm_force_on_qm_atoms[3*i+0], + qmmm_fscale*qm_force[3*i+1] - mm_force_on_qm_atoms[3*i+1], + qmmm_fscale*qm_force[3*i+2] - mm_force_on_qm_atoms[3*i+2]); + buf[i].tag = qm_remap[i]; buf[i].x = qmmm_fscale*qm_force[3*i+0] - mm_force_on_qm_atoms[3*i+0]; buf[i].y = qmmm_fscale*qm_force[3*i+1] - mm_force_on_qm_atoms[3*i+1]; @@ -684,21 +671,9 @@ void FixQMMM::init() memory->create(qm_charge,num_qm,"qmmm:qm_charge"); memory->create(qm_force,3*num_qm,"qmmm:qm_force"); - const char fmt1[] = "Initializing QM/MM master with %d QM atoms\n"; - const char fmt2[] = "Initializing QM/MM master with %d MM atoms\n"; - const char fmt3[] = "Electrostatic coupling with %d atoms\n"; - - if (screen) { - fprintf(screen,fmt1,num_qm); - fprintf(screen,fmt2,num_mm); - if (qmmm_mode == QMMM_MODE_ELEC) fprintf(screen,fmt3,num_mm-num_qm); - } - - if (logfile) { - fprintf(logfile,fmt1,num_qm); - fprintf(logfile,fmt2,num_mm); - if (qmmm_mode == QMMM_MODE_ELEC) fprintf(logfile,fmt3,num_mm-num_qm); - } + utils::logmesg(lmp, "Initializing QM/MM master with {} QM atoms\n", num_qm); + utils::logmesg(lmp, "Initializing QM/MM master with {} MM atoms\n", num_mm); + utils::logmesg(lmp, "Electrostatic coupling with {} atoms\n", num_mm-num_qm); } else if (qmmm_role == QMMM_ROLE_SLAVE) { @@ -711,11 +686,7 @@ void FixQMMM::init() memory->create(qm_coord,3*num_qm,"qmmm:qm_coord"); memory->create(qm_force,3*num_qm,"qmmm:qm_force"); - const char fmt[] = "Initializing QM/MM slave with %d QM atoms\n"; - - if (screen) fprintf(screen,fmt,num_qm); - if (logfile) fprintf(logfile,fmt,num_qm); - + utils::logmesg(lmp, "Initializing QM/MM slave with {} QM atoms\n",num_qm); } // communication buffer @@ -769,15 +740,10 @@ void FixQMMM::init() qm_remap=taginthash_keys(qm_hash); if (verbose > 1) { - const char fmt[] = "qm_remap[%d]=" TAGINT_FORMAT - " qm_hash[" TAGINT_FORMAT "]=" TAGINT_FORMAT "\n"; // print hashtable and reverse mapping - for (i=0; i < num_qm; ++i) { - if (screen) fprintf(screen,fmt,i,qm_remap[i],qm_remap[i], - taginthash_lookup(qm_hash, qm_remap[i])); - if (logfile) fprintf(logfile,fmt,i,qm_remap[i],qm_remap[i], - taginthash_lookup(qm_hash, qm_remap[i])); - } + for (i=0; i < num_qm; ++i) + utils::logmesg(lmp, "qm_remap[{}]={} qm_hash[{}]={}\n", + i,qm_remap[i],qm_remap[i],taginthash_lookup(qm_hash, qm_remap[i])); } } else { diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index b1c9aed58b..303327e797 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -123,21 +123,22 @@ void DumpCFG::write_header(bigint n) if (atom->peri_flag) scale = atom->pdscale; else if (unwrapflag == 1) scale = UNWRAPEXPAND; - fmt::print(fp,"Number of particles = {}\n", n); - fprintf(fp,"A = %g Angstrom (basic length-scale)\n",scale); - fprintf(fp,"H0(1,1) = %g A\n",domain->xprd); - fprintf(fp,"H0(1,2) = 0 A \n"); - fprintf(fp,"H0(1,3) = 0 A \n"); - fprintf(fp,"H0(2,1) = %g A \n",domain->xy); - fprintf(fp,"H0(2,2) = %g A\n",domain->yprd); - fprintf(fp,"H0(2,3) = 0 A \n"); - fprintf(fp,"H0(3,1) = %g A \n",domain->xz); - fprintf(fp,"H0(3,2) = %g A \n",domain->yz); - fprintf(fp,"H0(3,3) = %g A\n",domain->zprd); - fprintf(fp,".NO_VELOCITY.\n"); - fprintf(fp,"entry_count = %d\n",nfield-2); + auto header = fmt::format("Number of particles = {}\n",n); + header += fmt::format("A = {:g} Angstrom (basic length-scale)\n",scale); + header += fmt::format("H0(1,1) = {:g} A\n",domain->xprd); + header += fmt::format("H0(1,2) = 0 A\n"); + header += fmt::format("H0(1,3) = 0 A\n"); + header += fmt::format("H0(2,1) = {:g} A\n",domain->xy); + header += fmt::format("H0(2,2) = {:g} A\n",domain->yprd); + header += fmt::format("H0(2,3) = 0 A\n"); + header += fmt::format("H0(3,1) = {:g} A\n",domain->xz); + header += fmt::format("H0(3,2) = {:g} A\n",domain->yz); + header += fmt::format("H0(3,3) = {:g} A\n",domain->zprd); + header += fmt::format(".NO_VELOCITY.\n"); + header += fmt::format("entry_count = {}\n",nfield-2); for (int i = 0; i < nfield-5; i++) - fprintf(fp,"auxiliary[%d] = %s\n",i,auxname[i]); + header += fmt::format("auxiliary[{}] = {}\n",i,auxname[i]); + fmt::print(fp, header); } /* ---------------------------------------------------------------------- diff --git a/src/dump_xyz.cpp b/src/dump_xyz.cpp index e90243fd1f..d8819820ec 100644 --- a/src/dump_xyz.cpp +++ b/src/dump_xyz.cpp @@ -130,10 +130,10 @@ int DumpXYZ::modify_param(int narg, char **arg) void DumpXYZ::write_header(bigint n) { if (me == 0) { - if (time_flag) { - double tcurrent = update->atime + (update->ntimestep-update->atimestep) + update->dt; - fmt::print(fp,"{}\n Atoms. Timestep: {} Time: {:.6f}\n", n, update->ntimestep, tcurrent); - } else fmt::print(fp,"{}\n Atoms. Timestep: {}\n", n, update->ntimestep); + auto header = fmt::format("{}\n Atoms. Timestep: {}", n, update->ntimestep); + if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time()); + header += "\n"; + fmt::print(fp, header); } } From acd9c7950e2ef83e9793fb07bbcabb2f52afa015 Mon Sep 17 00:00:00 2001 From: davidfir3 <491197586@qq.com> Date: Thu, 31 Mar 2022 12:25:10 +0800 Subject: [PATCH 061/130] update doc and example --- doc/src/compute_fep_ta.rst | 2 + examples/PACKAGES/fep/README.md | 2 + examples/PACKAGES/fep/ta/data.spce | 6174 ++++++++++++++++++++++++++ examples/PACKAGES/fep/ta/in.spce.lmp | 49 + examples/PACKAGES/fep/ta/log.spce | 689 +++ examples/PACKAGES/fep/ta/spce.fep.ta | 22 + 6 files changed, 6938 insertions(+) create mode 100644 examples/PACKAGES/fep/ta/data.spce create mode 100644 examples/PACKAGES/fep/ta/in.spce.lmp create mode 100644 examples/PACKAGES/fep/ta/log.spce create mode 100644 examples/PACKAGES/fep/ta/spce.fep.ta diff --git a/doc/src/compute_fep_ta.rst b/doc/src/compute_fep_ta.rst index ad6b1ede82..eeb4a10915 100644 --- a/doc/src/compute_fep_ta.rst +++ b/doc/src/compute_fep_ta.rst @@ -76,6 +76,8 @@ example, the computed values can be averaged using :doc:`fix ave/time Restrictions """""""""""" +Constraints, like fix shake, may lead to incorrect values for energy difference. + This compute is distributed as the FEP package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` page for more info. diff --git a/examples/PACKAGES/fep/README.md b/examples/PACKAGES/fep/README.md index d8f0935115..0ccf3d10c3 100644 --- a/examples/PACKAGES/fep/README.md +++ b/examples/PACKAGES/fep/README.md @@ -23,3 +23,5 @@ to the final states. * `quicktests` -- very short runs with charged Lennard-Jones atoms to test *compute fep*, *fix adapt/fep* and *pair lj/cut/coul/long/soft*. + +* `ta` -- surface tension of SPCE water without constraints. Test-area method. diff --git a/examples/PACKAGES/fep/ta/data.spce b/examples/PACKAGES/fep/ta/data.spce new file mode 100644 index 0000000000..7ed4c1cedc --- /dev/null +++ b/examples/PACKAGES/fep/ta/data.spce @@ -0,0 +1,6174 @@ +LAMMPS Description + + 3072 atoms + 2048 bonds + 1024 angles + 0 dihedrals + 0 impropers + + 2 atom types + 1 bond types + 1 angle types + + 0.0 30 xlo xhi + 0.0 30 ylo yhi + 0.0 100 zlo zhi + +Masses + +1 15.9994 # O +2 1.008 # H + +Atoms # full + +1 1 1 -0.8476 0.0 0.0 25.0 +2 1 2 0.4238 0.8164904 0.0 25.577359 +3 1 2 0.4238 -0.8164904 0.0 25.577359 +4 2 1 -0.8476 0.0 0.0 28.10342 +5 2 2 0.4238 0.8164904 0.0 28.680779 +6 2 2 0.4238 -0.8164904 0.0 28.680779 +7 3 1 -0.8476 0.0 0.0 31.20684 +8 3 2 0.4238 0.8164904 0.0 31.784199 +9 3 2 0.4238 -0.8164904 0.0 31.784199 +10 4 1 -0.8476 0.0 0.0 34.31026 +11 4 2 0.4238 0.8164904 0.0 34.887619 +12 4 2 0.4238 -0.8164904 0.0 34.887619 +13 5 1 -0.8476 0.0 0.0 37.41368 +14 5 2 0.4238 0.8164904 0.0 37.991039 +15 5 2 0.4238 -0.8164904 0.0 37.991039 +16 6 1 -0.8476 0.0 0.0 40.5171 +17 6 2 0.4238 0.8164904 0.0 41.094459 +18 6 2 0.4238 -0.8164904 0.0 41.094459 +19 7 1 -0.8476 0.0 0.0 43.62052 +20 7 2 0.4238 0.8164904 0.0 44.197879 +21 7 2 0.4238 -0.8164904 0.0 44.197879 +22 8 1 -0.8476 0.0 0.0 46.72394 +23 8 2 0.4238 0.8164904 0.0 47.301299 +24 8 2 0.4238 -0.8164904 0.0 47.301299 +25 9 1 -0.8476 0.0 0.0 49.82736 +26 9 2 0.4238 0.8164904 0.0 50.404719 +27 9 2 0.4238 -0.8164904 0.0 50.404719 +28 10 1 -0.8476 0.0 0.0 52.93078 +29 10 2 0.4238 0.8164904 0.0 53.508139 +30 10 2 0.4238 -0.8164904 0.0 53.508139 +31 11 1 -0.8476 0.0 0.0 56.0342 +32 11 2 0.4238 0.8164904 0.0 56.611559 +33 11 2 0.4238 -0.8164904 0.0 56.611559 +34 12 1 -0.8476 0.0 0.0 59.13762 +35 12 2 0.4238 0.8164904 0.0 59.714979 +36 12 2 0.4238 -0.8164904 0.0 59.714979 +37 13 1 -0.8476 0.0 0.0 62.24104 +38 13 2 0.4238 0.8164904 0.0 62.818399 +39 13 2 0.4238 -0.8164904 0.0 62.818399 +40 14 1 -0.8476 0.0 0.0 65.34446 +41 14 2 0.4238 0.8164904 0.0 65.921819 +42 14 2 0.4238 -0.8164904 0.0 65.921819 +43 15 1 -0.8476 0.0 0.0 68.44788 +44 15 2 0.4238 0.8164904 0.0 69.025239 +45 15 2 0.4238 -0.8164904 0.0 69.025239 +46 16 1 -0.8476 0.0 0.0 71.5513 +47 16 2 0.4238 0.8164904 0.0 72.128659 +48 16 2 0.4238 -0.8164904 0.0 72.128659 +49 17 1 -0.8476 0.0 3.10342 25.0 +50 17 2 0.4238 0.8164904 3.10342 25.577359 +51 17 2 0.4238 -0.8164904 3.10342 25.577359 +52 18 1 -0.8476 0.0 3.10342 28.10342 +53 18 2 0.4238 0.8164904 3.10342 28.680779 +54 18 2 0.4238 -0.8164904 3.10342 28.680779 +55 19 1 -0.8476 0.0 3.10342 31.20684 +56 19 2 0.4238 0.8164904 3.10342 31.784199 +57 19 2 0.4238 -0.8164904 3.10342 31.784199 +58 20 1 -0.8476 0.0 3.10342 34.31026 +59 20 2 0.4238 0.8164904 3.10342 34.887619 +60 20 2 0.4238 -0.8164904 3.10342 34.887619 +61 21 1 -0.8476 0.0 3.10342 37.41368 +62 21 2 0.4238 0.8164904 3.10342 37.991039 +63 21 2 0.4238 -0.8164904 3.10342 37.991039 +64 22 1 -0.8476 0.0 3.10342 40.5171 +65 22 2 0.4238 0.8164904 3.10342 41.094459 +66 22 2 0.4238 -0.8164904 3.10342 41.094459 +67 23 1 -0.8476 0.0 3.10342 43.62052 +68 23 2 0.4238 0.8164904 3.10342 44.197879 +69 23 2 0.4238 -0.8164904 3.10342 44.197879 +70 24 1 -0.8476 0.0 3.10342 46.72394 +71 24 2 0.4238 0.8164904 3.10342 47.301299 +72 24 2 0.4238 -0.8164904 3.10342 47.301299 +73 25 1 -0.8476 0.0 3.10342 49.82736 +74 25 2 0.4238 0.8164904 3.10342 50.404719 +75 25 2 0.4238 -0.8164904 3.10342 50.404719 +76 26 1 -0.8476 0.0 3.10342 52.93078 +77 26 2 0.4238 0.8164904 3.10342 53.508139 +78 26 2 0.4238 -0.8164904 3.10342 53.508139 +79 27 1 -0.8476 0.0 3.10342 56.0342 +80 27 2 0.4238 0.8164904 3.10342 56.611559 +81 27 2 0.4238 -0.8164904 3.10342 56.611559 +82 28 1 -0.8476 0.0 3.10342 59.13762 +83 28 2 0.4238 0.8164904 3.10342 59.714979 +84 28 2 0.4238 -0.8164904 3.10342 59.714979 +85 29 1 -0.8476 0.0 3.10342 62.24104 +86 29 2 0.4238 0.8164904 3.10342 62.818399 +87 29 2 0.4238 -0.8164904 3.10342 62.818399 +88 30 1 -0.8476 0.0 3.10342 65.34446 +89 30 2 0.4238 0.8164904 3.10342 65.921819 +90 30 2 0.4238 -0.8164904 3.10342 65.921819 +91 31 1 -0.8476 0.0 3.10342 68.44788 +92 31 2 0.4238 0.8164904 3.10342 69.025239 +93 31 2 0.4238 -0.8164904 3.10342 69.025239 +94 32 1 -0.8476 0.0 3.10342 71.5513 +95 32 2 0.4238 0.8164904 3.10342 72.128659 +96 32 2 0.4238 -0.8164904 3.10342 72.128659 +97 33 1 -0.8476 0.0 6.20684 25.0 +98 33 2 0.4238 0.8164904 6.20684 25.577359 +99 33 2 0.4238 -0.8164904 6.20684 25.577359 +100 34 1 -0.8476 0.0 6.20684 28.10342 +101 34 2 0.4238 0.8164904 6.20684 28.680779 +102 34 2 0.4238 -0.8164904 6.20684 28.680779 +103 35 1 -0.8476 0.0 6.20684 31.20684 +104 35 2 0.4238 0.8164904 6.20684 31.784199 +105 35 2 0.4238 -0.8164904 6.20684 31.784199 +106 36 1 -0.8476 0.0 6.20684 34.31026 +107 36 2 0.4238 0.8164904 6.20684 34.887619 +108 36 2 0.4238 -0.8164904 6.20684 34.887619 +109 37 1 -0.8476 0.0 6.20684 37.41368 +110 37 2 0.4238 0.8164904 6.20684 37.991039 +111 37 2 0.4238 -0.8164904 6.20684 37.991039 +112 38 1 -0.8476 0.0 6.20684 40.5171 +113 38 2 0.4238 0.8164904 6.20684 41.094459 +114 38 2 0.4238 -0.8164904 6.20684 41.094459 +115 39 1 -0.8476 0.0 6.20684 43.62052 +116 39 2 0.4238 0.8164904 6.20684 44.197879 +117 39 2 0.4238 -0.8164904 6.20684 44.197879 +118 40 1 -0.8476 0.0 6.20684 46.72394 +119 40 2 0.4238 0.8164904 6.20684 47.301299 +120 40 2 0.4238 -0.8164904 6.20684 47.301299 +121 41 1 -0.8476 0.0 6.20684 49.82736 +122 41 2 0.4238 0.8164904 6.20684 50.404719 +123 41 2 0.4238 -0.8164904 6.20684 50.404719 +124 42 1 -0.8476 0.0 6.20684 52.93078 +125 42 2 0.4238 0.8164904 6.20684 53.508139 +126 42 2 0.4238 -0.8164904 6.20684 53.508139 +127 43 1 -0.8476 0.0 6.20684 56.0342 +128 43 2 0.4238 0.8164904 6.20684 56.611559 +129 43 2 0.4238 -0.8164904 6.20684 56.611559 +130 44 1 -0.8476 0.0 6.20684 59.13762 +131 44 2 0.4238 0.8164904 6.20684 59.714979 +132 44 2 0.4238 -0.8164904 6.20684 59.714979 +133 45 1 -0.8476 0.0 6.20684 62.24104 +134 45 2 0.4238 0.8164904 6.20684 62.818399 +135 45 2 0.4238 -0.8164904 6.20684 62.818399 +136 46 1 -0.8476 0.0 6.20684 65.34446 +137 46 2 0.4238 0.8164904 6.20684 65.921819 +138 46 2 0.4238 -0.8164904 6.20684 65.921819 +139 47 1 -0.8476 0.0 6.20684 68.44788 +140 47 2 0.4238 0.8164904 6.20684 69.025239 +141 47 2 0.4238 -0.8164904 6.20684 69.025239 +142 48 1 -0.8476 0.0 6.20684 71.5513 +143 48 2 0.4238 0.8164904 6.20684 72.128659 +144 48 2 0.4238 -0.8164904 6.20684 72.128659 +145 49 1 -0.8476 0.0 9.31026 25.0 +146 49 2 0.4238 0.8164904 9.31026 25.577359 +147 49 2 0.4238 -0.8164904 9.31026 25.577359 +148 50 1 -0.8476 0.0 9.31026 28.10342 +149 50 2 0.4238 0.8164904 9.31026 28.680779 +150 50 2 0.4238 -0.8164904 9.31026 28.680779 +151 51 1 -0.8476 0.0 9.31026 31.20684 +152 51 2 0.4238 0.8164904 9.31026 31.784199 +153 51 2 0.4238 -0.8164904 9.31026 31.784199 +154 52 1 -0.8476 0.0 9.31026 34.31026 +155 52 2 0.4238 0.8164904 9.31026 34.887619 +156 52 2 0.4238 -0.8164904 9.31026 34.887619 +157 53 1 -0.8476 0.0 9.31026 37.41368 +158 53 2 0.4238 0.8164904 9.31026 37.991039 +159 53 2 0.4238 -0.8164904 9.31026 37.991039 +160 54 1 -0.8476 0.0 9.31026 40.5171 +161 54 2 0.4238 0.8164904 9.31026 41.094459 +162 54 2 0.4238 -0.8164904 9.31026 41.094459 +163 55 1 -0.8476 0.0 9.31026 43.62052 +164 55 2 0.4238 0.8164904 9.31026 44.197879 +165 55 2 0.4238 -0.8164904 9.31026 44.197879 +166 56 1 -0.8476 0.0 9.31026 46.72394 +167 56 2 0.4238 0.8164904 9.31026 47.301299 +168 56 2 0.4238 -0.8164904 9.31026 47.301299 +169 57 1 -0.8476 0.0 9.31026 49.82736 +170 57 2 0.4238 0.8164904 9.31026 50.404719 +171 57 2 0.4238 -0.8164904 9.31026 50.404719 +172 58 1 -0.8476 0.0 9.31026 52.93078 +173 58 2 0.4238 0.8164904 9.31026 53.508139 +174 58 2 0.4238 -0.8164904 9.31026 53.508139 +175 59 1 -0.8476 0.0 9.31026 56.0342 +176 59 2 0.4238 0.8164904 9.31026 56.611559 +177 59 2 0.4238 -0.8164904 9.31026 56.611559 +178 60 1 -0.8476 0.0 9.31026 59.13762 +179 60 2 0.4238 0.8164904 9.31026 59.714979 +180 60 2 0.4238 -0.8164904 9.31026 59.714979 +181 61 1 -0.8476 0.0 9.31026 62.24104 +182 61 2 0.4238 0.8164904 9.31026 62.818399 +183 61 2 0.4238 -0.8164904 9.31026 62.818399 +184 62 1 -0.8476 0.0 9.31026 65.34446 +185 62 2 0.4238 0.8164904 9.31026 65.921819 +186 62 2 0.4238 -0.8164904 9.31026 65.921819 +187 63 1 -0.8476 0.0 9.31026 68.44788 +188 63 2 0.4238 0.8164904 9.31026 69.025239 +189 63 2 0.4238 -0.8164904 9.31026 69.025239 +190 64 1 -0.8476 0.0 9.31026 71.5513 +191 64 2 0.4238 0.8164904 9.31026 72.128659 +192 64 2 0.4238 -0.8164904 9.31026 72.128659 +193 65 1 -0.8476 0.0 12.41368 25.0 +194 65 2 0.4238 0.8164904 12.41368 25.577359 +195 65 2 0.4238 -0.8164904 12.41368 25.577359 +196 66 1 -0.8476 0.0 12.41368 28.10342 +197 66 2 0.4238 0.8164904 12.41368 28.680779 +198 66 2 0.4238 -0.8164904 12.41368 28.680779 +199 67 1 -0.8476 0.0 12.41368 31.20684 +200 67 2 0.4238 0.8164904 12.41368 31.784199 +201 67 2 0.4238 -0.8164904 12.41368 31.784199 +202 68 1 -0.8476 0.0 12.41368 34.31026 +203 68 2 0.4238 0.8164904 12.41368 34.887619 +204 68 2 0.4238 -0.8164904 12.41368 34.887619 +205 69 1 -0.8476 0.0 12.41368 37.41368 +206 69 2 0.4238 0.8164904 12.41368 37.991039 +207 69 2 0.4238 -0.8164904 12.41368 37.991039 +208 70 1 -0.8476 0.0 12.41368 40.5171 +209 70 2 0.4238 0.8164904 12.41368 41.094459 +210 70 2 0.4238 -0.8164904 12.41368 41.094459 +211 71 1 -0.8476 0.0 12.41368 43.62052 +212 71 2 0.4238 0.8164904 12.41368 44.197879 +213 71 2 0.4238 -0.8164904 12.41368 44.197879 +214 72 1 -0.8476 0.0 12.41368 46.72394 +215 72 2 0.4238 0.8164904 12.41368 47.301299 +216 72 2 0.4238 -0.8164904 12.41368 47.301299 +217 73 1 -0.8476 0.0 12.41368 49.82736 +218 73 2 0.4238 0.8164904 12.41368 50.404719 +219 73 2 0.4238 -0.8164904 12.41368 50.404719 +220 74 1 -0.8476 0.0 12.41368 52.93078 +221 74 2 0.4238 0.8164904 12.41368 53.508139 +222 74 2 0.4238 -0.8164904 12.41368 53.508139 +223 75 1 -0.8476 0.0 12.41368 56.0342 +224 75 2 0.4238 0.8164904 12.41368 56.611559 +225 75 2 0.4238 -0.8164904 12.41368 56.611559 +226 76 1 -0.8476 0.0 12.41368 59.13762 +227 76 2 0.4238 0.8164904 12.41368 59.714979 +228 76 2 0.4238 -0.8164904 12.41368 59.714979 +229 77 1 -0.8476 0.0 12.41368 62.24104 +230 77 2 0.4238 0.8164904 12.41368 62.818399 +231 77 2 0.4238 -0.8164904 12.41368 62.818399 +232 78 1 -0.8476 0.0 12.41368 65.34446 +233 78 2 0.4238 0.8164904 12.41368 65.921819 +234 78 2 0.4238 -0.8164904 12.41368 65.921819 +235 79 1 -0.8476 0.0 12.41368 68.44788 +236 79 2 0.4238 0.8164904 12.41368 69.025239 +237 79 2 0.4238 -0.8164904 12.41368 69.025239 +238 80 1 -0.8476 0.0 12.41368 71.5513 +239 80 2 0.4238 0.8164904 12.41368 72.128659 +240 80 2 0.4238 -0.8164904 12.41368 72.128659 +241 81 1 -0.8476 0.0 15.5171 25.0 +242 81 2 0.4238 0.8164904 15.5171 25.577359 +243 81 2 0.4238 -0.8164904 15.5171 25.577359 +244 82 1 -0.8476 0.0 15.5171 28.10342 +245 82 2 0.4238 0.8164904 15.5171 28.680779 +246 82 2 0.4238 -0.8164904 15.5171 28.680779 +247 83 1 -0.8476 0.0 15.5171 31.20684 +248 83 2 0.4238 0.8164904 15.5171 31.784199 +249 83 2 0.4238 -0.8164904 15.5171 31.784199 +250 84 1 -0.8476 0.0 15.5171 34.31026 +251 84 2 0.4238 0.8164904 15.5171 34.887619 +252 84 2 0.4238 -0.8164904 15.5171 34.887619 +253 85 1 -0.8476 0.0 15.5171 37.41368 +254 85 2 0.4238 0.8164904 15.5171 37.991039 +255 85 2 0.4238 -0.8164904 15.5171 37.991039 +256 86 1 -0.8476 0.0 15.5171 40.5171 +257 86 2 0.4238 0.8164904 15.5171 41.094459 +258 86 2 0.4238 -0.8164904 15.5171 41.094459 +259 87 1 -0.8476 0.0 15.5171 43.62052 +260 87 2 0.4238 0.8164904 15.5171 44.197879 +261 87 2 0.4238 -0.8164904 15.5171 44.197879 +262 88 1 -0.8476 0.0 15.5171 46.72394 +263 88 2 0.4238 0.8164904 15.5171 47.301299 +264 88 2 0.4238 -0.8164904 15.5171 47.301299 +265 89 1 -0.8476 0.0 15.5171 49.82736 +266 89 2 0.4238 0.8164904 15.5171 50.404719 +267 89 2 0.4238 -0.8164904 15.5171 50.404719 +268 90 1 -0.8476 0.0 15.5171 52.93078 +269 90 2 0.4238 0.8164904 15.5171 53.508139 +270 90 2 0.4238 -0.8164904 15.5171 53.508139 +271 91 1 -0.8476 0.0 15.5171 56.0342 +272 91 2 0.4238 0.8164904 15.5171 56.611559 +273 91 2 0.4238 -0.8164904 15.5171 56.611559 +274 92 1 -0.8476 0.0 15.5171 59.13762 +275 92 2 0.4238 0.8164904 15.5171 59.714979 +276 92 2 0.4238 -0.8164904 15.5171 59.714979 +277 93 1 -0.8476 0.0 15.5171 62.24104 +278 93 2 0.4238 0.8164904 15.5171 62.818399 +279 93 2 0.4238 -0.8164904 15.5171 62.818399 +280 94 1 -0.8476 0.0 15.5171 65.34446 +281 94 2 0.4238 0.8164904 15.5171 65.921819 +282 94 2 0.4238 -0.8164904 15.5171 65.921819 +283 95 1 -0.8476 0.0 15.5171 68.44788 +284 95 2 0.4238 0.8164904 15.5171 69.025239 +285 95 2 0.4238 -0.8164904 15.5171 69.025239 +286 96 1 -0.8476 0.0 15.5171 71.5513 +287 96 2 0.4238 0.8164904 15.5171 72.128659 +288 96 2 0.4238 -0.8164904 15.5171 72.128659 +289 97 1 -0.8476 0.0 18.62052 25.0 +290 97 2 0.4238 0.8164904 18.62052 25.577359 +291 97 2 0.4238 -0.8164904 18.62052 25.577359 +292 98 1 -0.8476 0.0 18.62052 28.10342 +293 98 2 0.4238 0.8164904 18.62052 28.680779 +294 98 2 0.4238 -0.8164904 18.62052 28.680779 +295 99 1 -0.8476 0.0 18.62052 31.20684 +296 99 2 0.4238 0.8164904 18.62052 31.784199 +297 99 2 0.4238 -0.8164904 18.62052 31.784199 +298 100 1 -0.8476 0.0 18.62052 34.31026 +299 100 2 0.4238 0.8164904 18.62052 34.887619 +300 100 2 0.4238 -0.8164904 18.62052 34.887619 +301 101 1 -0.8476 0.0 18.62052 37.41368 +302 101 2 0.4238 0.8164904 18.62052 37.991039 +303 101 2 0.4238 -0.8164904 18.62052 37.991039 +304 102 1 -0.8476 0.0 18.62052 40.5171 +305 102 2 0.4238 0.8164904 18.62052 41.094459 +306 102 2 0.4238 -0.8164904 18.62052 41.094459 +307 103 1 -0.8476 0.0 18.62052 43.62052 +308 103 2 0.4238 0.8164904 18.62052 44.197879 +309 103 2 0.4238 -0.8164904 18.62052 44.197879 +310 104 1 -0.8476 0.0 18.62052 46.72394 +311 104 2 0.4238 0.8164904 18.62052 47.301299 +312 104 2 0.4238 -0.8164904 18.62052 47.301299 +313 105 1 -0.8476 0.0 18.62052 49.82736 +314 105 2 0.4238 0.8164904 18.62052 50.404719 +315 105 2 0.4238 -0.8164904 18.62052 50.404719 +316 106 1 -0.8476 0.0 18.62052 52.93078 +317 106 2 0.4238 0.8164904 18.62052 53.508139 +318 106 2 0.4238 -0.8164904 18.62052 53.508139 +319 107 1 -0.8476 0.0 18.62052 56.0342 +320 107 2 0.4238 0.8164904 18.62052 56.611559 +321 107 2 0.4238 -0.8164904 18.62052 56.611559 +322 108 1 -0.8476 0.0 18.62052 59.13762 +323 108 2 0.4238 0.8164904 18.62052 59.714979 +324 108 2 0.4238 -0.8164904 18.62052 59.714979 +325 109 1 -0.8476 0.0 18.62052 62.24104 +326 109 2 0.4238 0.8164904 18.62052 62.818399 +327 109 2 0.4238 -0.8164904 18.62052 62.818399 +328 110 1 -0.8476 0.0 18.62052 65.34446 +329 110 2 0.4238 0.8164904 18.62052 65.921819 +330 110 2 0.4238 -0.8164904 18.62052 65.921819 +331 111 1 -0.8476 0.0 18.62052 68.44788 +332 111 2 0.4238 0.8164904 18.62052 69.025239 +333 111 2 0.4238 -0.8164904 18.62052 69.025239 +334 112 1 -0.8476 0.0 18.62052 71.5513 +335 112 2 0.4238 0.8164904 18.62052 72.128659 +336 112 2 0.4238 -0.8164904 18.62052 72.128659 +337 113 1 -0.8476 0.0 21.72394 25.0 +338 113 2 0.4238 0.8164904 21.72394 25.577359 +339 113 2 0.4238 -0.8164904 21.72394 25.577359 +340 114 1 -0.8476 0.0 21.72394 28.10342 +341 114 2 0.4238 0.8164904 21.72394 28.680779 +342 114 2 0.4238 -0.8164904 21.72394 28.680779 +343 115 1 -0.8476 0.0 21.72394 31.20684 +344 115 2 0.4238 0.8164904 21.72394 31.784199 +345 115 2 0.4238 -0.8164904 21.72394 31.784199 +346 116 1 -0.8476 0.0 21.72394 34.31026 +347 116 2 0.4238 0.8164904 21.72394 34.887619 +348 116 2 0.4238 -0.8164904 21.72394 34.887619 +349 117 1 -0.8476 0.0 21.72394 37.41368 +350 117 2 0.4238 0.8164904 21.72394 37.991039 +351 117 2 0.4238 -0.8164904 21.72394 37.991039 +352 118 1 -0.8476 0.0 21.72394 40.5171 +353 118 2 0.4238 0.8164904 21.72394 41.094459 +354 118 2 0.4238 -0.8164904 21.72394 41.094459 +355 119 1 -0.8476 0.0 21.72394 43.62052 +356 119 2 0.4238 0.8164904 21.72394 44.197879 +357 119 2 0.4238 -0.8164904 21.72394 44.197879 +358 120 1 -0.8476 0.0 21.72394 46.72394 +359 120 2 0.4238 0.8164904 21.72394 47.301299 +360 120 2 0.4238 -0.8164904 21.72394 47.301299 +361 121 1 -0.8476 0.0 21.72394 49.82736 +362 121 2 0.4238 0.8164904 21.72394 50.404719 +363 121 2 0.4238 -0.8164904 21.72394 50.404719 +364 122 1 -0.8476 0.0 21.72394 52.93078 +365 122 2 0.4238 0.8164904 21.72394 53.508139 +366 122 2 0.4238 -0.8164904 21.72394 53.508139 +367 123 1 -0.8476 0.0 21.72394 56.0342 +368 123 2 0.4238 0.8164904 21.72394 56.611559 +369 123 2 0.4238 -0.8164904 21.72394 56.611559 +370 124 1 -0.8476 0.0 21.72394 59.13762 +371 124 2 0.4238 0.8164904 21.72394 59.714979 +372 124 2 0.4238 -0.8164904 21.72394 59.714979 +373 125 1 -0.8476 0.0 21.72394 62.24104 +374 125 2 0.4238 0.8164904 21.72394 62.818399 +375 125 2 0.4238 -0.8164904 21.72394 62.818399 +376 126 1 -0.8476 0.0 21.72394 65.34446 +377 126 2 0.4238 0.8164904 21.72394 65.921819 +378 126 2 0.4238 -0.8164904 21.72394 65.921819 +379 127 1 -0.8476 0.0 21.72394 68.44788 +380 127 2 0.4238 0.8164904 21.72394 69.025239 +381 127 2 0.4238 -0.8164904 21.72394 69.025239 +382 128 1 -0.8476 0.0 21.72394 71.5513 +383 128 2 0.4238 0.8164904 21.72394 72.128659 +384 128 2 0.4238 -0.8164904 21.72394 72.128659 +385 129 1 -0.8476 3.10342 0.0 25.0 +386 129 2 0.4238 3.9199104 0.0 25.577359 +387 129 2 0.4238 2.2869295999999997 0.0 25.577359 +388 130 1 -0.8476 3.10342 0.0 28.10342 +389 130 2 0.4238 3.9199104 0.0 28.680779 +390 130 2 0.4238 2.2869295999999997 0.0 28.680779 +391 131 1 -0.8476 3.10342 0.0 31.20684 +392 131 2 0.4238 3.9199104 0.0 31.784199 +393 131 2 0.4238 2.2869295999999997 0.0 31.784199 +394 132 1 -0.8476 3.10342 0.0 34.31026 +395 132 2 0.4238 3.9199104 0.0 34.887619 +396 132 2 0.4238 2.2869295999999997 0.0 34.887619 +397 133 1 -0.8476 3.10342 0.0 37.41368 +398 133 2 0.4238 3.9199104 0.0 37.991039 +399 133 2 0.4238 2.2869295999999997 0.0 37.991039 +400 134 1 -0.8476 3.10342 0.0 40.5171 +401 134 2 0.4238 3.9199104 0.0 41.094459 +402 134 2 0.4238 2.2869295999999997 0.0 41.094459 +403 135 1 -0.8476 3.10342 0.0 43.62052 +404 135 2 0.4238 3.9199104 0.0 44.197879 +405 135 2 0.4238 2.2869295999999997 0.0 44.197879 +406 136 1 -0.8476 3.10342 0.0 46.72394 +407 136 2 0.4238 3.9199104 0.0 47.301299 +408 136 2 0.4238 2.2869295999999997 0.0 47.301299 +409 137 1 -0.8476 3.10342 0.0 49.82736 +410 137 2 0.4238 3.9199104 0.0 50.404719 +411 137 2 0.4238 2.2869295999999997 0.0 50.404719 +412 138 1 -0.8476 3.10342 0.0 52.93078 +413 138 2 0.4238 3.9199104 0.0 53.508139 +414 138 2 0.4238 2.2869295999999997 0.0 53.508139 +415 139 1 -0.8476 3.10342 0.0 56.0342 +416 139 2 0.4238 3.9199104 0.0 56.611559 +417 139 2 0.4238 2.2869295999999997 0.0 56.611559 +418 140 1 -0.8476 3.10342 0.0 59.13762 +419 140 2 0.4238 3.9199104 0.0 59.714979 +420 140 2 0.4238 2.2869295999999997 0.0 59.714979 +421 141 1 -0.8476 3.10342 0.0 62.24104 +422 141 2 0.4238 3.9199104 0.0 62.818399 +423 141 2 0.4238 2.2869295999999997 0.0 62.818399 +424 142 1 -0.8476 3.10342 0.0 65.34446 +425 142 2 0.4238 3.9199104 0.0 65.921819 +426 142 2 0.4238 2.2869295999999997 0.0 65.921819 +427 143 1 -0.8476 3.10342 0.0 68.44788 +428 143 2 0.4238 3.9199104 0.0 69.025239 +429 143 2 0.4238 2.2869295999999997 0.0 69.025239 +430 144 1 -0.8476 3.10342 0.0 71.5513 +431 144 2 0.4238 3.9199104 0.0 72.128659 +432 144 2 0.4238 2.2869295999999997 0.0 72.128659 +433 145 1 -0.8476 3.10342 3.10342 25.0 +434 145 2 0.4238 3.9199104 3.10342 25.577359 +435 145 2 0.4238 2.2869295999999997 3.10342 25.577359 +436 146 1 -0.8476 3.10342 3.10342 28.10342 +437 146 2 0.4238 3.9199104 3.10342 28.680779 +438 146 2 0.4238 2.2869295999999997 3.10342 28.680779 +439 147 1 -0.8476 3.10342 3.10342 31.20684 +440 147 2 0.4238 3.9199104 3.10342 31.784199 +441 147 2 0.4238 2.2869295999999997 3.10342 31.784199 +442 148 1 -0.8476 3.10342 3.10342 34.31026 +443 148 2 0.4238 3.9199104 3.10342 34.887619 +444 148 2 0.4238 2.2869295999999997 3.10342 34.887619 +445 149 1 -0.8476 3.10342 3.10342 37.41368 +446 149 2 0.4238 3.9199104 3.10342 37.991039 +447 149 2 0.4238 2.2869295999999997 3.10342 37.991039 +448 150 1 -0.8476 3.10342 3.10342 40.5171 +449 150 2 0.4238 3.9199104 3.10342 41.094459 +450 150 2 0.4238 2.2869295999999997 3.10342 41.094459 +451 151 1 -0.8476 3.10342 3.10342 43.62052 +452 151 2 0.4238 3.9199104 3.10342 44.197879 +453 151 2 0.4238 2.2869295999999997 3.10342 44.197879 +454 152 1 -0.8476 3.10342 3.10342 46.72394 +455 152 2 0.4238 3.9199104 3.10342 47.301299 +456 152 2 0.4238 2.2869295999999997 3.10342 47.301299 +457 153 1 -0.8476 3.10342 3.10342 49.82736 +458 153 2 0.4238 3.9199104 3.10342 50.404719 +459 153 2 0.4238 2.2869295999999997 3.10342 50.404719 +460 154 1 -0.8476 3.10342 3.10342 52.93078 +461 154 2 0.4238 3.9199104 3.10342 53.508139 +462 154 2 0.4238 2.2869295999999997 3.10342 53.508139 +463 155 1 -0.8476 3.10342 3.10342 56.0342 +464 155 2 0.4238 3.9199104 3.10342 56.611559 +465 155 2 0.4238 2.2869295999999997 3.10342 56.611559 +466 156 1 -0.8476 3.10342 3.10342 59.13762 +467 156 2 0.4238 3.9199104 3.10342 59.714979 +468 156 2 0.4238 2.2869295999999997 3.10342 59.714979 +469 157 1 -0.8476 3.10342 3.10342 62.24104 +470 157 2 0.4238 3.9199104 3.10342 62.818399 +471 157 2 0.4238 2.2869295999999997 3.10342 62.818399 +472 158 1 -0.8476 3.10342 3.10342 65.34446 +473 158 2 0.4238 3.9199104 3.10342 65.921819 +474 158 2 0.4238 2.2869295999999997 3.10342 65.921819 +475 159 1 -0.8476 3.10342 3.10342 68.44788 +476 159 2 0.4238 3.9199104 3.10342 69.025239 +477 159 2 0.4238 2.2869295999999997 3.10342 69.025239 +478 160 1 -0.8476 3.10342 3.10342 71.5513 +479 160 2 0.4238 3.9199104 3.10342 72.128659 +480 160 2 0.4238 2.2869295999999997 3.10342 72.128659 +481 161 1 -0.8476 3.10342 6.20684 25.0 +482 161 2 0.4238 3.9199104 6.20684 25.577359 +483 161 2 0.4238 2.2869295999999997 6.20684 25.577359 +484 162 1 -0.8476 3.10342 6.20684 28.10342 +485 162 2 0.4238 3.9199104 6.20684 28.680779 +486 162 2 0.4238 2.2869295999999997 6.20684 28.680779 +487 163 1 -0.8476 3.10342 6.20684 31.20684 +488 163 2 0.4238 3.9199104 6.20684 31.784199 +489 163 2 0.4238 2.2869295999999997 6.20684 31.784199 +490 164 1 -0.8476 3.10342 6.20684 34.31026 +491 164 2 0.4238 3.9199104 6.20684 34.887619 +492 164 2 0.4238 2.2869295999999997 6.20684 34.887619 +493 165 1 -0.8476 3.10342 6.20684 37.41368 +494 165 2 0.4238 3.9199104 6.20684 37.991039 +495 165 2 0.4238 2.2869295999999997 6.20684 37.991039 +496 166 1 -0.8476 3.10342 6.20684 40.5171 +497 166 2 0.4238 3.9199104 6.20684 41.094459 +498 166 2 0.4238 2.2869295999999997 6.20684 41.094459 +499 167 1 -0.8476 3.10342 6.20684 43.62052 +500 167 2 0.4238 3.9199104 6.20684 44.197879 +501 167 2 0.4238 2.2869295999999997 6.20684 44.197879 +502 168 1 -0.8476 3.10342 6.20684 46.72394 +503 168 2 0.4238 3.9199104 6.20684 47.301299 +504 168 2 0.4238 2.2869295999999997 6.20684 47.301299 +505 169 1 -0.8476 3.10342 6.20684 49.82736 +506 169 2 0.4238 3.9199104 6.20684 50.404719 +507 169 2 0.4238 2.2869295999999997 6.20684 50.404719 +508 170 1 -0.8476 3.10342 6.20684 52.93078 +509 170 2 0.4238 3.9199104 6.20684 53.508139 +510 170 2 0.4238 2.2869295999999997 6.20684 53.508139 +511 171 1 -0.8476 3.10342 6.20684 56.0342 +512 171 2 0.4238 3.9199104 6.20684 56.611559 +513 171 2 0.4238 2.2869295999999997 6.20684 56.611559 +514 172 1 -0.8476 3.10342 6.20684 59.13762 +515 172 2 0.4238 3.9199104 6.20684 59.714979 +516 172 2 0.4238 2.2869295999999997 6.20684 59.714979 +517 173 1 -0.8476 3.10342 6.20684 62.24104 +518 173 2 0.4238 3.9199104 6.20684 62.818399 +519 173 2 0.4238 2.2869295999999997 6.20684 62.818399 +520 174 1 -0.8476 3.10342 6.20684 65.34446 +521 174 2 0.4238 3.9199104 6.20684 65.921819 +522 174 2 0.4238 2.2869295999999997 6.20684 65.921819 +523 175 1 -0.8476 3.10342 6.20684 68.44788 +524 175 2 0.4238 3.9199104 6.20684 69.025239 +525 175 2 0.4238 2.2869295999999997 6.20684 69.025239 +526 176 1 -0.8476 3.10342 6.20684 71.5513 +527 176 2 0.4238 3.9199104 6.20684 72.128659 +528 176 2 0.4238 2.2869295999999997 6.20684 72.128659 +529 177 1 -0.8476 3.10342 9.31026 25.0 +530 177 2 0.4238 3.9199104 9.31026 25.577359 +531 177 2 0.4238 2.2869295999999997 9.31026 25.577359 +532 178 1 -0.8476 3.10342 9.31026 28.10342 +533 178 2 0.4238 3.9199104 9.31026 28.680779 +534 178 2 0.4238 2.2869295999999997 9.31026 28.680779 +535 179 1 -0.8476 3.10342 9.31026 31.20684 +536 179 2 0.4238 3.9199104 9.31026 31.784199 +537 179 2 0.4238 2.2869295999999997 9.31026 31.784199 +538 180 1 -0.8476 3.10342 9.31026 34.31026 +539 180 2 0.4238 3.9199104 9.31026 34.887619 +540 180 2 0.4238 2.2869295999999997 9.31026 34.887619 +541 181 1 -0.8476 3.10342 9.31026 37.41368 +542 181 2 0.4238 3.9199104 9.31026 37.991039 +543 181 2 0.4238 2.2869295999999997 9.31026 37.991039 +544 182 1 -0.8476 3.10342 9.31026 40.5171 +545 182 2 0.4238 3.9199104 9.31026 41.094459 +546 182 2 0.4238 2.2869295999999997 9.31026 41.094459 +547 183 1 -0.8476 3.10342 9.31026 43.62052 +548 183 2 0.4238 3.9199104 9.31026 44.197879 +549 183 2 0.4238 2.2869295999999997 9.31026 44.197879 +550 184 1 -0.8476 3.10342 9.31026 46.72394 +551 184 2 0.4238 3.9199104 9.31026 47.301299 +552 184 2 0.4238 2.2869295999999997 9.31026 47.301299 +553 185 1 -0.8476 3.10342 9.31026 49.82736 +554 185 2 0.4238 3.9199104 9.31026 50.404719 +555 185 2 0.4238 2.2869295999999997 9.31026 50.404719 +556 186 1 -0.8476 3.10342 9.31026 52.93078 +557 186 2 0.4238 3.9199104 9.31026 53.508139 +558 186 2 0.4238 2.2869295999999997 9.31026 53.508139 +559 187 1 -0.8476 3.10342 9.31026 56.0342 +560 187 2 0.4238 3.9199104 9.31026 56.611559 +561 187 2 0.4238 2.2869295999999997 9.31026 56.611559 +562 188 1 -0.8476 3.10342 9.31026 59.13762 +563 188 2 0.4238 3.9199104 9.31026 59.714979 +564 188 2 0.4238 2.2869295999999997 9.31026 59.714979 +565 189 1 -0.8476 3.10342 9.31026 62.24104 +566 189 2 0.4238 3.9199104 9.31026 62.818399 +567 189 2 0.4238 2.2869295999999997 9.31026 62.818399 +568 190 1 -0.8476 3.10342 9.31026 65.34446 +569 190 2 0.4238 3.9199104 9.31026 65.921819 +570 190 2 0.4238 2.2869295999999997 9.31026 65.921819 +571 191 1 -0.8476 3.10342 9.31026 68.44788 +572 191 2 0.4238 3.9199104 9.31026 69.025239 +573 191 2 0.4238 2.2869295999999997 9.31026 69.025239 +574 192 1 -0.8476 3.10342 9.31026 71.5513 +575 192 2 0.4238 3.9199104 9.31026 72.128659 +576 192 2 0.4238 2.2869295999999997 9.31026 72.128659 +577 193 1 -0.8476 3.10342 12.41368 25.0 +578 193 2 0.4238 3.9199104 12.41368 25.577359 +579 193 2 0.4238 2.2869295999999997 12.41368 25.577359 +580 194 1 -0.8476 3.10342 12.41368 28.10342 +581 194 2 0.4238 3.9199104 12.41368 28.680779 +582 194 2 0.4238 2.2869295999999997 12.41368 28.680779 +583 195 1 -0.8476 3.10342 12.41368 31.20684 +584 195 2 0.4238 3.9199104 12.41368 31.784199 +585 195 2 0.4238 2.2869295999999997 12.41368 31.784199 +586 196 1 -0.8476 3.10342 12.41368 34.31026 +587 196 2 0.4238 3.9199104 12.41368 34.887619 +588 196 2 0.4238 2.2869295999999997 12.41368 34.887619 +589 197 1 -0.8476 3.10342 12.41368 37.41368 +590 197 2 0.4238 3.9199104 12.41368 37.991039 +591 197 2 0.4238 2.2869295999999997 12.41368 37.991039 +592 198 1 -0.8476 3.10342 12.41368 40.5171 +593 198 2 0.4238 3.9199104 12.41368 41.094459 +594 198 2 0.4238 2.2869295999999997 12.41368 41.094459 +595 199 1 -0.8476 3.10342 12.41368 43.62052 +596 199 2 0.4238 3.9199104 12.41368 44.197879 +597 199 2 0.4238 2.2869295999999997 12.41368 44.197879 +598 200 1 -0.8476 3.10342 12.41368 46.72394 +599 200 2 0.4238 3.9199104 12.41368 47.301299 +600 200 2 0.4238 2.2869295999999997 12.41368 47.301299 +601 201 1 -0.8476 3.10342 12.41368 49.82736 +602 201 2 0.4238 3.9199104 12.41368 50.404719 +603 201 2 0.4238 2.2869295999999997 12.41368 50.404719 +604 202 1 -0.8476 3.10342 12.41368 52.93078 +605 202 2 0.4238 3.9199104 12.41368 53.508139 +606 202 2 0.4238 2.2869295999999997 12.41368 53.508139 +607 203 1 -0.8476 3.10342 12.41368 56.0342 +608 203 2 0.4238 3.9199104 12.41368 56.611559 +609 203 2 0.4238 2.2869295999999997 12.41368 56.611559 +610 204 1 -0.8476 3.10342 12.41368 59.13762 +611 204 2 0.4238 3.9199104 12.41368 59.714979 +612 204 2 0.4238 2.2869295999999997 12.41368 59.714979 +613 205 1 -0.8476 3.10342 12.41368 62.24104 +614 205 2 0.4238 3.9199104 12.41368 62.818399 +615 205 2 0.4238 2.2869295999999997 12.41368 62.818399 +616 206 1 -0.8476 3.10342 12.41368 65.34446 +617 206 2 0.4238 3.9199104 12.41368 65.921819 +618 206 2 0.4238 2.2869295999999997 12.41368 65.921819 +619 207 1 -0.8476 3.10342 12.41368 68.44788 +620 207 2 0.4238 3.9199104 12.41368 69.025239 +621 207 2 0.4238 2.2869295999999997 12.41368 69.025239 +622 208 1 -0.8476 3.10342 12.41368 71.5513 +623 208 2 0.4238 3.9199104 12.41368 72.128659 +624 208 2 0.4238 2.2869295999999997 12.41368 72.128659 +625 209 1 -0.8476 3.10342 15.5171 25.0 +626 209 2 0.4238 3.9199104 15.5171 25.577359 +627 209 2 0.4238 2.2869295999999997 15.5171 25.577359 +628 210 1 -0.8476 3.10342 15.5171 28.10342 +629 210 2 0.4238 3.9199104 15.5171 28.680779 +630 210 2 0.4238 2.2869295999999997 15.5171 28.680779 +631 211 1 -0.8476 3.10342 15.5171 31.20684 +632 211 2 0.4238 3.9199104 15.5171 31.784199 +633 211 2 0.4238 2.2869295999999997 15.5171 31.784199 +634 212 1 -0.8476 3.10342 15.5171 34.31026 +635 212 2 0.4238 3.9199104 15.5171 34.887619 +636 212 2 0.4238 2.2869295999999997 15.5171 34.887619 +637 213 1 -0.8476 3.10342 15.5171 37.41368 +638 213 2 0.4238 3.9199104 15.5171 37.991039 +639 213 2 0.4238 2.2869295999999997 15.5171 37.991039 +640 214 1 -0.8476 3.10342 15.5171 40.5171 +641 214 2 0.4238 3.9199104 15.5171 41.094459 +642 214 2 0.4238 2.2869295999999997 15.5171 41.094459 +643 215 1 -0.8476 3.10342 15.5171 43.62052 +644 215 2 0.4238 3.9199104 15.5171 44.197879 +645 215 2 0.4238 2.2869295999999997 15.5171 44.197879 +646 216 1 -0.8476 3.10342 15.5171 46.72394 +647 216 2 0.4238 3.9199104 15.5171 47.301299 +648 216 2 0.4238 2.2869295999999997 15.5171 47.301299 +649 217 1 -0.8476 3.10342 15.5171 49.82736 +650 217 2 0.4238 3.9199104 15.5171 50.404719 +651 217 2 0.4238 2.2869295999999997 15.5171 50.404719 +652 218 1 -0.8476 3.10342 15.5171 52.93078 +653 218 2 0.4238 3.9199104 15.5171 53.508139 +654 218 2 0.4238 2.2869295999999997 15.5171 53.508139 +655 219 1 -0.8476 3.10342 15.5171 56.0342 +656 219 2 0.4238 3.9199104 15.5171 56.611559 +657 219 2 0.4238 2.2869295999999997 15.5171 56.611559 +658 220 1 -0.8476 3.10342 15.5171 59.13762 +659 220 2 0.4238 3.9199104 15.5171 59.714979 +660 220 2 0.4238 2.2869295999999997 15.5171 59.714979 +661 221 1 -0.8476 3.10342 15.5171 62.24104 +662 221 2 0.4238 3.9199104 15.5171 62.818399 +663 221 2 0.4238 2.2869295999999997 15.5171 62.818399 +664 222 1 -0.8476 3.10342 15.5171 65.34446 +665 222 2 0.4238 3.9199104 15.5171 65.921819 +666 222 2 0.4238 2.2869295999999997 15.5171 65.921819 +667 223 1 -0.8476 3.10342 15.5171 68.44788 +668 223 2 0.4238 3.9199104 15.5171 69.025239 +669 223 2 0.4238 2.2869295999999997 15.5171 69.025239 +670 224 1 -0.8476 3.10342 15.5171 71.5513 +671 224 2 0.4238 3.9199104 15.5171 72.128659 +672 224 2 0.4238 2.2869295999999997 15.5171 72.128659 +673 225 1 -0.8476 3.10342 18.62052 25.0 +674 225 2 0.4238 3.9199104 18.62052 25.577359 +675 225 2 0.4238 2.2869295999999997 18.62052 25.577359 +676 226 1 -0.8476 3.10342 18.62052 28.10342 +677 226 2 0.4238 3.9199104 18.62052 28.680779 +678 226 2 0.4238 2.2869295999999997 18.62052 28.680779 +679 227 1 -0.8476 3.10342 18.62052 31.20684 +680 227 2 0.4238 3.9199104 18.62052 31.784199 +681 227 2 0.4238 2.2869295999999997 18.62052 31.784199 +682 228 1 -0.8476 3.10342 18.62052 34.31026 +683 228 2 0.4238 3.9199104 18.62052 34.887619 +684 228 2 0.4238 2.2869295999999997 18.62052 34.887619 +685 229 1 -0.8476 3.10342 18.62052 37.41368 +686 229 2 0.4238 3.9199104 18.62052 37.991039 +687 229 2 0.4238 2.2869295999999997 18.62052 37.991039 +688 230 1 -0.8476 3.10342 18.62052 40.5171 +689 230 2 0.4238 3.9199104 18.62052 41.094459 +690 230 2 0.4238 2.2869295999999997 18.62052 41.094459 +691 231 1 -0.8476 3.10342 18.62052 43.62052 +692 231 2 0.4238 3.9199104 18.62052 44.197879 +693 231 2 0.4238 2.2869295999999997 18.62052 44.197879 +694 232 1 -0.8476 3.10342 18.62052 46.72394 +695 232 2 0.4238 3.9199104 18.62052 47.301299 +696 232 2 0.4238 2.2869295999999997 18.62052 47.301299 +697 233 1 -0.8476 3.10342 18.62052 49.82736 +698 233 2 0.4238 3.9199104 18.62052 50.404719 +699 233 2 0.4238 2.2869295999999997 18.62052 50.404719 +700 234 1 -0.8476 3.10342 18.62052 52.93078 +701 234 2 0.4238 3.9199104 18.62052 53.508139 +702 234 2 0.4238 2.2869295999999997 18.62052 53.508139 +703 235 1 -0.8476 3.10342 18.62052 56.0342 +704 235 2 0.4238 3.9199104 18.62052 56.611559 +705 235 2 0.4238 2.2869295999999997 18.62052 56.611559 +706 236 1 -0.8476 3.10342 18.62052 59.13762 +707 236 2 0.4238 3.9199104 18.62052 59.714979 +708 236 2 0.4238 2.2869295999999997 18.62052 59.714979 +709 237 1 -0.8476 3.10342 18.62052 62.24104 +710 237 2 0.4238 3.9199104 18.62052 62.818399 +711 237 2 0.4238 2.2869295999999997 18.62052 62.818399 +712 238 1 -0.8476 3.10342 18.62052 65.34446 +713 238 2 0.4238 3.9199104 18.62052 65.921819 +714 238 2 0.4238 2.2869295999999997 18.62052 65.921819 +715 239 1 -0.8476 3.10342 18.62052 68.44788 +716 239 2 0.4238 3.9199104 18.62052 69.025239 +717 239 2 0.4238 2.2869295999999997 18.62052 69.025239 +718 240 1 -0.8476 3.10342 18.62052 71.5513 +719 240 2 0.4238 3.9199104 18.62052 72.128659 +720 240 2 0.4238 2.2869295999999997 18.62052 72.128659 +721 241 1 -0.8476 3.10342 21.72394 25.0 +722 241 2 0.4238 3.9199104 21.72394 25.577359 +723 241 2 0.4238 2.2869295999999997 21.72394 25.577359 +724 242 1 -0.8476 3.10342 21.72394 28.10342 +725 242 2 0.4238 3.9199104 21.72394 28.680779 +726 242 2 0.4238 2.2869295999999997 21.72394 28.680779 +727 243 1 -0.8476 3.10342 21.72394 31.20684 +728 243 2 0.4238 3.9199104 21.72394 31.784199 +729 243 2 0.4238 2.2869295999999997 21.72394 31.784199 +730 244 1 -0.8476 3.10342 21.72394 34.31026 +731 244 2 0.4238 3.9199104 21.72394 34.887619 +732 244 2 0.4238 2.2869295999999997 21.72394 34.887619 +733 245 1 -0.8476 3.10342 21.72394 37.41368 +734 245 2 0.4238 3.9199104 21.72394 37.991039 +735 245 2 0.4238 2.2869295999999997 21.72394 37.991039 +736 246 1 -0.8476 3.10342 21.72394 40.5171 +737 246 2 0.4238 3.9199104 21.72394 41.094459 +738 246 2 0.4238 2.2869295999999997 21.72394 41.094459 +739 247 1 -0.8476 3.10342 21.72394 43.62052 +740 247 2 0.4238 3.9199104 21.72394 44.197879 +741 247 2 0.4238 2.2869295999999997 21.72394 44.197879 +742 248 1 -0.8476 3.10342 21.72394 46.72394 +743 248 2 0.4238 3.9199104 21.72394 47.301299 +744 248 2 0.4238 2.2869295999999997 21.72394 47.301299 +745 249 1 -0.8476 3.10342 21.72394 49.82736 +746 249 2 0.4238 3.9199104 21.72394 50.404719 +747 249 2 0.4238 2.2869295999999997 21.72394 50.404719 +748 250 1 -0.8476 3.10342 21.72394 52.93078 +749 250 2 0.4238 3.9199104 21.72394 53.508139 +750 250 2 0.4238 2.2869295999999997 21.72394 53.508139 +751 251 1 -0.8476 3.10342 21.72394 56.0342 +752 251 2 0.4238 3.9199104 21.72394 56.611559 +753 251 2 0.4238 2.2869295999999997 21.72394 56.611559 +754 252 1 -0.8476 3.10342 21.72394 59.13762 +755 252 2 0.4238 3.9199104 21.72394 59.714979 +756 252 2 0.4238 2.2869295999999997 21.72394 59.714979 +757 253 1 -0.8476 3.10342 21.72394 62.24104 +758 253 2 0.4238 3.9199104 21.72394 62.818399 +759 253 2 0.4238 2.2869295999999997 21.72394 62.818399 +760 254 1 -0.8476 3.10342 21.72394 65.34446 +761 254 2 0.4238 3.9199104 21.72394 65.921819 +762 254 2 0.4238 2.2869295999999997 21.72394 65.921819 +763 255 1 -0.8476 3.10342 21.72394 68.44788 +764 255 2 0.4238 3.9199104 21.72394 69.025239 +765 255 2 0.4238 2.2869295999999997 21.72394 69.025239 +766 256 1 -0.8476 3.10342 21.72394 71.5513 +767 256 2 0.4238 3.9199104 21.72394 72.128659 +768 256 2 0.4238 2.2869295999999997 21.72394 72.128659 +769 257 1 -0.8476 6.20684 0.0 25.0 +770 257 2 0.4238 7.0233304 0.0 25.577359 +771 257 2 0.4238 5.3903495999999995 0.0 25.577359 +772 258 1 -0.8476 6.20684 0.0 28.10342 +773 258 2 0.4238 7.0233304 0.0 28.680779 +774 258 2 0.4238 5.3903495999999995 0.0 28.680779 +775 259 1 -0.8476 6.20684 0.0 31.20684 +776 259 2 0.4238 7.0233304 0.0 31.784199 +777 259 2 0.4238 5.3903495999999995 0.0 31.784199 +778 260 1 -0.8476 6.20684 0.0 34.31026 +779 260 2 0.4238 7.0233304 0.0 34.887619 +780 260 2 0.4238 5.3903495999999995 0.0 34.887619 +781 261 1 -0.8476 6.20684 0.0 37.41368 +782 261 2 0.4238 7.0233304 0.0 37.991039 +783 261 2 0.4238 5.3903495999999995 0.0 37.991039 +784 262 1 -0.8476 6.20684 0.0 40.5171 +785 262 2 0.4238 7.0233304 0.0 41.094459 +786 262 2 0.4238 5.3903495999999995 0.0 41.094459 +787 263 1 -0.8476 6.20684 0.0 43.62052 +788 263 2 0.4238 7.0233304 0.0 44.197879 +789 263 2 0.4238 5.3903495999999995 0.0 44.197879 +790 264 1 -0.8476 6.20684 0.0 46.72394 +791 264 2 0.4238 7.0233304 0.0 47.301299 +792 264 2 0.4238 5.3903495999999995 0.0 47.301299 +793 265 1 -0.8476 6.20684 0.0 49.82736 +794 265 2 0.4238 7.0233304 0.0 50.404719 +795 265 2 0.4238 5.3903495999999995 0.0 50.404719 +796 266 1 -0.8476 6.20684 0.0 52.93078 +797 266 2 0.4238 7.0233304 0.0 53.508139 +798 266 2 0.4238 5.3903495999999995 0.0 53.508139 +799 267 1 -0.8476 6.20684 0.0 56.0342 +800 267 2 0.4238 7.0233304 0.0 56.611559 +801 267 2 0.4238 5.3903495999999995 0.0 56.611559 +802 268 1 -0.8476 6.20684 0.0 59.13762 +803 268 2 0.4238 7.0233304 0.0 59.714979 +804 268 2 0.4238 5.3903495999999995 0.0 59.714979 +805 269 1 -0.8476 6.20684 0.0 62.24104 +806 269 2 0.4238 7.0233304 0.0 62.818399 +807 269 2 0.4238 5.3903495999999995 0.0 62.818399 +808 270 1 -0.8476 6.20684 0.0 65.34446 +809 270 2 0.4238 7.0233304 0.0 65.921819 +810 270 2 0.4238 5.3903495999999995 0.0 65.921819 +811 271 1 -0.8476 6.20684 0.0 68.44788 +812 271 2 0.4238 7.0233304 0.0 69.025239 +813 271 2 0.4238 5.3903495999999995 0.0 69.025239 +814 272 1 -0.8476 6.20684 0.0 71.5513 +815 272 2 0.4238 7.0233304 0.0 72.128659 +816 272 2 0.4238 5.3903495999999995 0.0 72.128659 +817 273 1 -0.8476 6.20684 3.10342 25.0 +818 273 2 0.4238 7.0233304 3.10342 25.577359 +819 273 2 0.4238 5.3903495999999995 3.10342 25.577359 +820 274 1 -0.8476 6.20684 3.10342 28.10342 +821 274 2 0.4238 7.0233304 3.10342 28.680779 +822 274 2 0.4238 5.3903495999999995 3.10342 28.680779 +823 275 1 -0.8476 6.20684 3.10342 31.20684 +824 275 2 0.4238 7.0233304 3.10342 31.784199 +825 275 2 0.4238 5.3903495999999995 3.10342 31.784199 +826 276 1 -0.8476 6.20684 3.10342 34.31026 +827 276 2 0.4238 7.0233304 3.10342 34.887619 +828 276 2 0.4238 5.3903495999999995 3.10342 34.887619 +829 277 1 -0.8476 6.20684 3.10342 37.41368 +830 277 2 0.4238 7.0233304 3.10342 37.991039 +831 277 2 0.4238 5.3903495999999995 3.10342 37.991039 +832 278 1 -0.8476 6.20684 3.10342 40.5171 +833 278 2 0.4238 7.0233304 3.10342 41.094459 +834 278 2 0.4238 5.3903495999999995 3.10342 41.094459 +835 279 1 -0.8476 6.20684 3.10342 43.62052 +836 279 2 0.4238 7.0233304 3.10342 44.197879 +837 279 2 0.4238 5.3903495999999995 3.10342 44.197879 +838 280 1 -0.8476 6.20684 3.10342 46.72394 +839 280 2 0.4238 7.0233304 3.10342 47.301299 +840 280 2 0.4238 5.3903495999999995 3.10342 47.301299 +841 281 1 -0.8476 6.20684 3.10342 49.82736 +842 281 2 0.4238 7.0233304 3.10342 50.404719 +843 281 2 0.4238 5.3903495999999995 3.10342 50.404719 +844 282 1 -0.8476 6.20684 3.10342 52.93078 +845 282 2 0.4238 7.0233304 3.10342 53.508139 +846 282 2 0.4238 5.3903495999999995 3.10342 53.508139 +847 283 1 -0.8476 6.20684 3.10342 56.0342 +848 283 2 0.4238 7.0233304 3.10342 56.611559 +849 283 2 0.4238 5.3903495999999995 3.10342 56.611559 +850 284 1 -0.8476 6.20684 3.10342 59.13762 +851 284 2 0.4238 7.0233304 3.10342 59.714979 +852 284 2 0.4238 5.3903495999999995 3.10342 59.714979 +853 285 1 -0.8476 6.20684 3.10342 62.24104 +854 285 2 0.4238 7.0233304 3.10342 62.818399 +855 285 2 0.4238 5.3903495999999995 3.10342 62.818399 +856 286 1 -0.8476 6.20684 3.10342 65.34446 +857 286 2 0.4238 7.0233304 3.10342 65.921819 +858 286 2 0.4238 5.3903495999999995 3.10342 65.921819 +859 287 1 -0.8476 6.20684 3.10342 68.44788 +860 287 2 0.4238 7.0233304 3.10342 69.025239 +861 287 2 0.4238 5.3903495999999995 3.10342 69.025239 +862 288 1 -0.8476 6.20684 3.10342 71.5513 +863 288 2 0.4238 7.0233304 3.10342 72.128659 +864 288 2 0.4238 5.3903495999999995 3.10342 72.128659 +865 289 1 -0.8476 6.20684 6.20684 25.0 +866 289 2 0.4238 7.0233304 6.20684 25.577359 +867 289 2 0.4238 5.3903495999999995 6.20684 25.577359 +868 290 1 -0.8476 6.20684 6.20684 28.10342 +869 290 2 0.4238 7.0233304 6.20684 28.680779 +870 290 2 0.4238 5.3903495999999995 6.20684 28.680779 +871 291 1 -0.8476 6.20684 6.20684 31.20684 +872 291 2 0.4238 7.0233304 6.20684 31.784199 +873 291 2 0.4238 5.3903495999999995 6.20684 31.784199 +874 292 1 -0.8476 6.20684 6.20684 34.31026 +875 292 2 0.4238 7.0233304 6.20684 34.887619 +876 292 2 0.4238 5.3903495999999995 6.20684 34.887619 +877 293 1 -0.8476 6.20684 6.20684 37.41368 +878 293 2 0.4238 7.0233304 6.20684 37.991039 +879 293 2 0.4238 5.3903495999999995 6.20684 37.991039 +880 294 1 -0.8476 6.20684 6.20684 40.5171 +881 294 2 0.4238 7.0233304 6.20684 41.094459 +882 294 2 0.4238 5.3903495999999995 6.20684 41.094459 +883 295 1 -0.8476 6.20684 6.20684 43.62052 +884 295 2 0.4238 7.0233304 6.20684 44.197879 +885 295 2 0.4238 5.3903495999999995 6.20684 44.197879 +886 296 1 -0.8476 6.20684 6.20684 46.72394 +887 296 2 0.4238 7.0233304 6.20684 47.301299 +888 296 2 0.4238 5.3903495999999995 6.20684 47.301299 +889 297 1 -0.8476 6.20684 6.20684 49.82736 +890 297 2 0.4238 7.0233304 6.20684 50.404719 +891 297 2 0.4238 5.3903495999999995 6.20684 50.404719 +892 298 1 -0.8476 6.20684 6.20684 52.93078 +893 298 2 0.4238 7.0233304 6.20684 53.508139 +894 298 2 0.4238 5.3903495999999995 6.20684 53.508139 +895 299 1 -0.8476 6.20684 6.20684 56.0342 +896 299 2 0.4238 7.0233304 6.20684 56.611559 +897 299 2 0.4238 5.3903495999999995 6.20684 56.611559 +898 300 1 -0.8476 6.20684 6.20684 59.13762 +899 300 2 0.4238 7.0233304 6.20684 59.714979 +900 300 2 0.4238 5.3903495999999995 6.20684 59.714979 +901 301 1 -0.8476 6.20684 6.20684 62.24104 +902 301 2 0.4238 7.0233304 6.20684 62.818399 +903 301 2 0.4238 5.3903495999999995 6.20684 62.818399 +904 302 1 -0.8476 6.20684 6.20684 65.34446 +905 302 2 0.4238 7.0233304 6.20684 65.921819 +906 302 2 0.4238 5.3903495999999995 6.20684 65.921819 +907 303 1 -0.8476 6.20684 6.20684 68.44788 +908 303 2 0.4238 7.0233304 6.20684 69.025239 +909 303 2 0.4238 5.3903495999999995 6.20684 69.025239 +910 304 1 -0.8476 6.20684 6.20684 71.5513 +911 304 2 0.4238 7.0233304 6.20684 72.128659 +912 304 2 0.4238 5.3903495999999995 6.20684 72.128659 +913 305 1 -0.8476 6.20684 9.31026 25.0 +914 305 2 0.4238 7.0233304 9.31026 25.577359 +915 305 2 0.4238 5.3903495999999995 9.31026 25.577359 +916 306 1 -0.8476 6.20684 9.31026 28.10342 +917 306 2 0.4238 7.0233304 9.31026 28.680779 +918 306 2 0.4238 5.3903495999999995 9.31026 28.680779 +919 307 1 -0.8476 6.20684 9.31026 31.20684 +920 307 2 0.4238 7.0233304 9.31026 31.784199 +921 307 2 0.4238 5.3903495999999995 9.31026 31.784199 +922 308 1 -0.8476 6.20684 9.31026 34.31026 +923 308 2 0.4238 7.0233304 9.31026 34.887619 +924 308 2 0.4238 5.3903495999999995 9.31026 34.887619 +925 309 1 -0.8476 6.20684 9.31026 37.41368 +926 309 2 0.4238 7.0233304 9.31026 37.991039 +927 309 2 0.4238 5.3903495999999995 9.31026 37.991039 +928 310 1 -0.8476 6.20684 9.31026 40.5171 +929 310 2 0.4238 7.0233304 9.31026 41.094459 +930 310 2 0.4238 5.3903495999999995 9.31026 41.094459 +931 311 1 -0.8476 6.20684 9.31026 43.62052 +932 311 2 0.4238 7.0233304 9.31026 44.197879 +933 311 2 0.4238 5.3903495999999995 9.31026 44.197879 +934 312 1 -0.8476 6.20684 9.31026 46.72394 +935 312 2 0.4238 7.0233304 9.31026 47.301299 +936 312 2 0.4238 5.3903495999999995 9.31026 47.301299 +937 313 1 -0.8476 6.20684 9.31026 49.82736 +938 313 2 0.4238 7.0233304 9.31026 50.404719 +939 313 2 0.4238 5.3903495999999995 9.31026 50.404719 +940 314 1 -0.8476 6.20684 9.31026 52.93078 +941 314 2 0.4238 7.0233304 9.31026 53.508139 +942 314 2 0.4238 5.3903495999999995 9.31026 53.508139 +943 315 1 -0.8476 6.20684 9.31026 56.0342 +944 315 2 0.4238 7.0233304 9.31026 56.611559 +945 315 2 0.4238 5.3903495999999995 9.31026 56.611559 +946 316 1 -0.8476 6.20684 9.31026 59.13762 +947 316 2 0.4238 7.0233304 9.31026 59.714979 +948 316 2 0.4238 5.3903495999999995 9.31026 59.714979 +949 317 1 -0.8476 6.20684 9.31026 62.24104 +950 317 2 0.4238 7.0233304 9.31026 62.818399 +951 317 2 0.4238 5.3903495999999995 9.31026 62.818399 +952 318 1 -0.8476 6.20684 9.31026 65.34446 +953 318 2 0.4238 7.0233304 9.31026 65.921819 +954 318 2 0.4238 5.3903495999999995 9.31026 65.921819 +955 319 1 -0.8476 6.20684 9.31026 68.44788 +956 319 2 0.4238 7.0233304 9.31026 69.025239 +957 319 2 0.4238 5.3903495999999995 9.31026 69.025239 +958 320 1 -0.8476 6.20684 9.31026 71.5513 +959 320 2 0.4238 7.0233304 9.31026 72.128659 +960 320 2 0.4238 5.3903495999999995 9.31026 72.128659 +961 321 1 -0.8476 6.20684 12.41368 25.0 +962 321 2 0.4238 7.0233304 12.41368 25.577359 +963 321 2 0.4238 5.3903495999999995 12.41368 25.577359 +964 322 1 -0.8476 6.20684 12.41368 28.10342 +965 322 2 0.4238 7.0233304 12.41368 28.680779 +966 322 2 0.4238 5.3903495999999995 12.41368 28.680779 +967 323 1 -0.8476 6.20684 12.41368 31.20684 +968 323 2 0.4238 7.0233304 12.41368 31.784199 +969 323 2 0.4238 5.3903495999999995 12.41368 31.784199 +970 324 1 -0.8476 6.20684 12.41368 34.31026 +971 324 2 0.4238 7.0233304 12.41368 34.887619 +972 324 2 0.4238 5.3903495999999995 12.41368 34.887619 +973 325 1 -0.8476 6.20684 12.41368 37.41368 +974 325 2 0.4238 7.0233304 12.41368 37.991039 +975 325 2 0.4238 5.3903495999999995 12.41368 37.991039 +976 326 1 -0.8476 6.20684 12.41368 40.5171 +977 326 2 0.4238 7.0233304 12.41368 41.094459 +978 326 2 0.4238 5.3903495999999995 12.41368 41.094459 +979 327 1 -0.8476 6.20684 12.41368 43.62052 +980 327 2 0.4238 7.0233304 12.41368 44.197879 +981 327 2 0.4238 5.3903495999999995 12.41368 44.197879 +982 328 1 -0.8476 6.20684 12.41368 46.72394 +983 328 2 0.4238 7.0233304 12.41368 47.301299 +984 328 2 0.4238 5.3903495999999995 12.41368 47.301299 +985 329 1 -0.8476 6.20684 12.41368 49.82736 +986 329 2 0.4238 7.0233304 12.41368 50.404719 +987 329 2 0.4238 5.3903495999999995 12.41368 50.404719 +988 330 1 -0.8476 6.20684 12.41368 52.93078 +989 330 2 0.4238 7.0233304 12.41368 53.508139 +990 330 2 0.4238 5.3903495999999995 12.41368 53.508139 +991 331 1 -0.8476 6.20684 12.41368 56.0342 +992 331 2 0.4238 7.0233304 12.41368 56.611559 +993 331 2 0.4238 5.3903495999999995 12.41368 56.611559 +994 332 1 -0.8476 6.20684 12.41368 59.13762 +995 332 2 0.4238 7.0233304 12.41368 59.714979 +996 332 2 0.4238 5.3903495999999995 12.41368 59.714979 +997 333 1 -0.8476 6.20684 12.41368 62.24104 +998 333 2 0.4238 7.0233304 12.41368 62.818399 +999 333 2 0.4238 5.3903495999999995 12.41368 62.818399 +1000 334 1 -0.8476 6.20684 12.41368 65.34446 +1001 334 2 0.4238 7.0233304 12.41368 65.921819 +1002 334 2 0.4238 5.3903495999999995 12.41368 65.921819 +1003 335 1 -0.8476 6.20684 12.41368 68.44788 +1004 335 2 0.4238 7.0233304 12.41368 69.025239 +1005 335 2 0.4238 5.3903495999999995 12.41368 69.025239 +1006 336 1 -0.8476 6.20684 12.41368 71.5513 +1007 336 2 0.4238 7.0233304 12.41368 72.128659 +1008 336 2 0.4238 5.3903495999999995 12.41368 72.128659 +1009 337 1 -0.8476 6.20684 15.5171 25.0 +1010 337 2 0.4238 7.0233304 15.5171 25.577359 +1011 337 2 0.4238 5.3903495999999995 15.5171 25.577359 +1012 338 1 -0.8476 6.20684 15.5171 28.10342 +1013 338 2 0.4238 7.0233304 15.5171 28.680779 +1014 338 2 0.4238 5.3903495999999995 15.5171 28.680779 +1015 339 1 -0.8476 6.20684 15.5171 31.20684 +1016 339 2 0.4238 7.0233304 15.5171 31.784199 +1017 339 2 0.4238 5.3903495999999995 15.5171 31.784199 +1018 340 1 -0.8476 6.20684 15.5171 34.31026 +1019 340 2 0.4238 7.0233304 15.5171 34.887619 +1020 340 2 0.4238 5.3903495999999995 15.5171 34.887619 +1021 341 1 -0.8476 6.20684 15.5171 37.41368 +1022 341 2 0.4238 7.0233304 15.5171 37.991039 +1023 341 2 0.4238 5.3903495999999995 15.5171 37.991039 +1024 342 1 -0.8476 6.20684 15.5171 40.5171 +1025 342 2 0.4238 7.0233304 15.5171 41.094459 +1026 342 2 0.4238 5.3903495999999995 15.5171 41.094459 +1027 343 1 -0.8476 6.20684 15.5171 43.62052 +1028 343 2 0.4238 7.0233304 15.5171 44.197879 +1029 343 2 0.4238 5.3903495999999995 15.5171 44.197879 +1030 344 1 -0.8476 6.20684 15.5171 46.72394 +1031 344 2 0.4238 7.0233304 15.5171 47.301299 +1032 344 2 0.4238 5.3903495999999995 15.5171 47.301299 +1033 345 1 -0.8476 6.20684 15.5171 49.82736 +1034 345 2 0.4238 7.0233304 15.5171 50.404719 +1035 345 2 0.4238 5.3903495999999995 15.5171 50.404719 +1036 346 1 -0.8476 6.20684 15.5171 52.93078 +1037 346 2 0.4238 7.0233304 15.5171 53.508139 +1038 346 2 0.4238 5.3903495999999995 15.5171 53.508139 +1039 347 1 -0.8476 6.20684 15.5171 56.0342 +1040 347 2 0.4238 7.0233304 15.5171 56.611559 +1041 347 2 0.4238 5.3903495999999995 15.5171 56.611559 +1042 348 1 -0.8476 6.20684 15.5171 59.13762 +1043 348 2 0.4238 7.0233304 15.5171 59.714979 +1044 348 2 0.4238 5.3903495999999995 15.5171 59.714979 +1045 349 1 -0.8476 6.20684 15.5171 62.24104 +1046 349 2 0.4238 7.0233304 15.5171 62.818399 +1047 349 2 0.4238 5.3903495999999995 15.5171 62.818399 +1048 350 1 -0.8476 6.20684 15.5171 65.34446 +1049 350 2 0.4238 7.0233304 15.5171 65.921819 +1050 350 2 0.4238 5.3903495999999995 15.5171 65.921819 +1051 351 1 -0.8476 6.20684 15.5171 68.44788 +1052 351 2 0.4238 7.0233304 15.5171 69.025239 +1053 351 2 0.4238 5.3903495999999995 15.5171 69.025239 +1054 352 1 -0.8476 6.20684 15.5171 71.5513 +1055 352 2 0.4238 7.0233304 15.5171 72.128659 +1056 352 2 0.4238 5.3903495999999995 15.5171 72.128659 +1057 353 1 -0.8476 6.20684 18.62052 25.0 +1058 353 2 0.4238 7.0233304 18.62052 25.577359 +1059 353 2 0.4238 5.3903495999999995 18.62052 25.577359 +1060 354 1 -0.8476 6.20684 18.62052 28.10342 +1061 354 2 0.4238 7.0233304 18.62052 28.680779 +1062 354 2 0.4238 5.3903495999999995 18.62052 28.680779 +1063 355 1 -0.8476 6.20684 18.62052 31.20684 +1064 355 2 0.4238 7.0233304 18.62052 31.784199 +1065 355 2 0.4238 5.3903495999999995 18.62052 31.784199 +1066 356 1 -0.8476 6.20684 18.62052 34.31026 +1067 356 2 0.4238 7.0233304 18.62052 34.887619 +1068 356 2 0.4238 5.3903495999999995 18.62052 34.887619 +1069 357 1 -0.8476 6.20684 18.62052 37.41368 +1070 357 2 0.4238 7.0233304 18.62052 37.991039 +1071 357 2 0.4238 5.3903495999999995 18.62052 37.991039 +1072 358 1 -0.8476 6.20684 18.62052 40.5171 +1073 358 2 0.4238 7.0233304 18.62052 41.094459 +1074 358 2 0.4238 5.3903495999999995 18.62052 41.094459 +1075 359 1 -0.8476 6.20684 18.62052 43.62052 +1076 359 2 0.4238 7.0233304 18.62052 44.197879 +1077 359 2 0.4238 5.3903495999999995 18.62052 44.197879 +1078 360 1 -0.8476 6.20684 18.62052 46.72394 +1079 360 2 0.4238 7.0233304 18.62052 47.301299 +1080 360 2 0.4238 5.3903495999999995 18.62052 47.301299 +1081 361 1 -0.8476 6.20684 18.62052 49.82736 +1082 361 2 0.4238 7.0233304 18.62052 50.404719 +1083 361 2 0.4238 5.3903495999999995 18.62052 50.404719 +1084 362 1 -0.8476 6.20684 18.62052 52.93078 +1085 362 2 0.4238 7.0233304 18.62052 53.508139 +1086 362 2 0.4238 5.3903495999999995 18.62052 53.508139 +1087 363 1 -0.8476 6.20684 18.62052 56.0342 +1088 363 2 0.4238 7.0233304 18.62052 56.611559 +1089 363 2 0.4238 5.3903495999999995 18.62052 56.611559 +1090 364 1 -0.8476 6.20684 18.62052 59.13762 +1091 364 2 0.4238 7.0233304 18.62052 59.714979 +1092 364 2 0.4238 5.3903495999999995 18.62052 59.714979 +1093 365 1 -0.8476 6.20684 18.62052 62.24104 +1094 365 2 0.4238 7.0233304 18.62052 62.818399 +1095 365 2 0.4238 5.3903495999999995 18.62052 62.818399 +1096 366 1 -0.8476 6.20684 18.62052 65.34446 +1097 366 2 0.4238 7.0233304 18.62052 65.921819 +1098 366 2 0.4238 5.3903495999999995 18.62052 65.921819 +1099 367 1 -0.8476 6.20684 18.62052 68.44788 +1100 367 2 0.4238 7.0233304 18.62052 69.025239 +1101 367 2 0.4238 5.3903495999999995 18.62052 69.025239 +1102 368 1 -0.8476 6.20684 18.62052 71.5513 +1103 368 2 0.4238 7.0233304 18.62052 72.128659 +1104 368 2 0.4238 5.3903495999999995 18.62052 72.128659 +1105 369 1 -0.8476 6.20684 21.72394 25.0 +1106 369 2 0.4238 7.0233304 21.72394 25.577359 +1107 369 2 0.4238 5.3903495999999995 21.72394 25.577359 +1108 370 1 -0.8476 6.20684 21.72394 28.10342 +1109 370 2 0.4238 7.0233304 21.72394 28.680779 +1110 370 2 0.4238 5.3903495999999995 21.72394 28.680779 +1111 371 1 -0.8476 6.20684 21.72394 31.20684 +1112 371 2 0.4238 7.0233304 21.72394 31.784199 +1113 371 2 0.4238 5.3903495999999995 21.72394 31.784199 +1114 372 1 -0.8476 6.20684 21.72394 34.31026 +1115 372 2 0.4238 7.0233304 21.72394 34.887619 +1116 372 2 0.4238 5.3903495999999995 21.72394 34.887619 +1117 373 1 -0.8476 6.20684 21.72394 37.41368 +1118 373 2 0.4238 7.0233304 21.72394 37.991039 +1119 373 2 0.4238 5.3903495999999995 21.72394 37.991039 +1120 374 1 -0.8476 6.20684 21.72394 40.5171 +1121 374 2 0.4238 7.0233304 21.72394 41.094459 +1122 374 2 0.4238 5.3903495999999995 21.72394 41.094459 +1123 375 1 -0.8476 6.20684 21.72394 43.62052 +1124 375 2 0.4238 7.0233304 21.72394 44.197879 +1125 375 2 0.4238 5.3903495999999995 21.72394 44.197879 +1126 376 1 -0.8476 6.20684 21.72394 46.72394 +1127 376 2 0.4238 7.0233304 21.72394 47.301299 +1128 376 2 0.4238 5.3903495999999995 21.72394 47.301299 +1129 377 1 -0.8476 6.20684 21.72394 49.82736 +1130 377 2 0.4238 7.0233304 21.72394 50.404719 +1131 377 2 0.4238 5.3903495999999995 21.72394 50.404719 +1132 378 1 -0.8476 6.20684 21.72394 52.93078 +1133 378 2 0.4238 7.0233304 21.72394 53.508139 +1134 378 2 0.4238 5.3903495999999995 21.72394 53.508139 +1135 379 1 -0.8476 6.20684 21.72394 56.0342 +1136 379 2 0.4238 7.0233304 21.72394 56.611559 +1137 379 2 0.4238 5.3903495999999995 21.72394 56.611559 +1138 380 1 -0.8476 6.20684 21.72394 59.13762 +1139 380 2 0.4238 7.0233304 21.72394 59.714979 +1140 380 2 0.4238 5.3903495999999995 21.72394 59.714979 +1141 381 1 -0.8476 6.20684 21.72394 62.24104 +1142 381 2 0.4238 7.0233304 21.72394 62.818399 +1143 381 2 0.4238 5.3903495999999995 21.72394 62.818399 +1144 382 1 -0.8476 6.20684 21.72394 65.34446 +1145 382 2 0.4238 7.0233304 21.72394 65.921819 +1146 382 2 0.4238 5.3903495999999995 21.72394 65.921819 +1147 383 1 -0.8476 6.20684 21.72394 68.44788 +1148 383 2 0.4238 7.0233304 21.72394 69.025239 +1149 383 2 0.4238 5.3903495999999995 21.72394 69.025239 +1150 384 1 -0.8476 6.20684 21.72394 71.5513 +1151 384 2 0.4238 7.0233304 21.72394 72.128659 +1152 384 2 0.4238 5.3903495999999995 21.72394 72.128659 +1153 385 1 -0.8476 9.31026 0.0 25.0 +1154 385 2 0.4238 10.126750399999999 0.0 25.577359 +1155 385 2 0.4238 8.4937696 0.0 25.577359 +1156 386 1 -0.8476 9.31026 0.0 28.10342 +1157 386 2 0.4238 10.126750399999999 0.0 28.680779 +1158 386 2 0.4238 8.4937696 0.0 28.680779 +1159 387 1 -0.8476 9.31026 0.0 31.20684 +1160 387 2 0.4238 10.126750399999999 0.0 31.784199 +1161 387 2 0.4238 8.4937696 0.0 31.784199 +1162 388 1 -0.8476 9.31026 0.0 34.31026 +1163 388 2 0.4238 10.126750399999999 0.0 34.887619 +1164 388 2 0.4238 8.4937696 0.0 34.887619 +1165 389 1 -0.8476 9.31026 0.0 37.41368 +1166 389 2 0.4238 10.126750399999999 0.0 37.991039 +1167 389 2 0.4238 8.4937696 0.0 37.991039 +1168 390 1 -0.8476 9.31026 0.0 40.5171 +1169 390 2 0.4238 10.126750399999999 0.0 41.094459 +1170 390 2 0.4238 8.4937696 0.0 41.094459 +1171 391 1 -0.8476 9.31026 0.0 43.62052 +1172 391 2 0.4238 10.126750399999999 0.0 44.197879 +1173 391 2 0.4238 8.4937696 0.0 44.197879 +1174 392 1 -0.8476 9.31026 0.0 46.72394 +1175 392 2 0.4238 10.126750399999999 0.0 47.301299 +1176 392 2 0.4238 8.4937696 0.0 47.301299 +1177 393 1 -0.8476 9.31026 0.0 49.82736 +1178 393 2 0.4238 10.126750399999999 0.0 50.404719 +1179 393 2 0.4238 8.4937696 0.0 50.404719 +1180 394 1 -0.8476 9.31026 0.0 52.93078 +1181 394 2 0.4238 10.126750399999999 0.0 53.508139 +1182 394 2 0.4238 8.4937696 0.0 53.508139 +1183 395 1 -0.8476 9.31026 0.0 56.0342 +1184 395 2 0.4238 10.126750399999999 0.0 56.611559 +1185 395 2 0.4238 8.4937696 0.0 56.611559 +1186 396 1 -0.8476 9.31026 0.0 59.13762 +1187 396 2 0.4238 10.126750399999999 0.0 59.714979 +1188 396 2 0.4238 8.4937696 0.0 59.714979 +1189 397 1 -0.8476 9.31026 0.0 62.24104 +1190 397 2 0.4238 10.126750399999999 0.0 62.818399 +1191 397 2 0.4238 8.4937696 0.0 62.818399 +1192 398 1 -0.8476 9.31026 0.0 65.34446 +1193 398 2 0.4238 10.126750399999999 0.0 65.921819 +1194 398 2 0.4238 8.4937696 0.0 65.921819 +1195 399 1 -0.8476 9.31026 0.0 68.44788 +1196 399 2 0.4238 10.126750399999999 0.0 69.025239 +1197 399 2 0.4238 8.4937696 0.0 69.025239 +1198 400 1 -0.8476 9.31026 0.0 71.5513 +1199 400 2 0.4238 10.126750399999999 0.0 72.128659 +1200 400 2 0.4238 8.4937696 0.0 72.128659 +1201 401 1 -0.8476 9.31026 3.10342 25.0 +1202 401 2 0.4238 10.126750399999999 3.10342 25.577359 +1203 401 2 0.4238 8.4937696 3.10342 25.577359 +1204 402 1 -0.8476 9.31026 3.10342 28.10342 +1205 402 2 0.4238 10.126750399999999 3.10342 28.680779 +1206 402 2 0.4238 8.4937696 3.10342 28.680779 +1207 403 1 -0.8476 9.31026 3.10342 31.20684 +1208 403 2 0.4238 10.126750399999999 3.10342 31.784199 +1209 403 2 0.4238 8.4937696 3.10342 31.784199 +1210 404 1 -0.8476 9.31026 3.10342 34.31026 +1211 404 2 0.4238 10.126750399999999 3.10342 34.887619 +1212 404 2 0.4238 8.4937696 3.10342 34.887619 +1213 405 1 -0.8476 9.31026 3.10342 37.41368 +1214 405 2 0.4238 10.126750399999999 3.10342 37.991039 +1215 405 2 0.4238 8.4937696 3.10342 37.991039 +1216 406 1 -0.8476 9.31026 3.10342 40.5171 +1217 406 2 0.4238 10.126750399999999 3.10342 41.094459 +1218 406 2 0.4238 8.4937696 3.10342 41.094459 +1219 407 1 -0.8476 9.31026 3.10342 43.62052 +1220 407 2 0.4238 10.126750399999999 3.10342 44.197879 +1221 407 2 0.4238 8.4937696 3.10342 44.197879 +1222 408 1 -0.8476 9.31026 3.10342 46.72394 +1223 408 2 0.4238 10.126750399999999 3.10342 47.301299 +1224 408 2 0.4238 8.4937696 3.10342 47.301299 +1225 409 1 -0.8476 9.31026 3.10342 49.82736 +1226 409 2 0.4238 10.126750399999999 3.10342 50.404719 +1227 409 2 0.4238 8.4937696 3.10342 50.404719 +1228 410 1 -0.8476 9.31026 3.10342 52.93078 +1229 410 2 0.4238 10.126750399999999 3.10342 53.508139 +1230 410 2 0.4238 8.4937696 3.10342 53.508139 +1231 411 1 -0.8476 9.31026 3.10342 56.0342 +1232 411 2 0.4238 10.126750399999999 3.10342 56.611559 +1233 411 2 0.4238 8.4937696 3.10342 56.611559 +1234 412 1 -0.8476 9.31026 3.10342 59.13762 +1235 412 2 0.4238 10.126750399999999 3.10342 59.714979 +1236 412 2 0.4238 8.4937696 3.10342 59.714979 +1237 413 1 -0.8476 9.31026 3.10342 62.24104 +1238 413 2 0.4238 10.126750399999999 3.10342 62.818399 +1239 413 2 0.4238 8.4937696 3.10342 62.818399 +1240 414 1 -0.8476 9.31026 3.10342 65.34446 +1241 414 2 0.4238 10.126750399999999 3.10342 65.921819 +1242 414 2 0.4238 8.4937696 3.10342 65.921819 +1243 415 1 -0.8476 9.31026 3.10342 68.44788 +1244 415 2 0.4238 10.126750399999999 3.10342 69.025239 +1245 415 2 0.4238 8.4937696 3.10342 69.025239 +1246 416 1 -0.8476 9.31026 3.10342 71.5513 +1247 416 2 0.4238 10.126750399999999 3.10342 72.128659 +1248 416 2 0.4238 8.4937696 3.10342 72.128659 +1249 417 1 -0.8476 9.31026 6.20684 25.0 +1250 417 2 0.4238 10.126750399999999 6.20684 25.577359 +1251 417 2 0.4238 8.4937696 6.20684 25.577359 +1252 418 1 -0.8476 9.31026 6.20684 28.10342 +1253 418 2 0.4238 10.126750399999999 6.20684 28.680779 +1254 418 2 0.4238 8.4937696 6.20684 28.680779 +1255 419 1 -0.8476 9.31026 6.20684 31.20684 +1256 419 2 0.4238 10.126750399999999 6.20684 31.784199 +1257 419 2 0.4238 8.4937696 6.20684 31.784199 +1258 420 1 -0.8476 9.31026 6.20684 34.31026 +1259 420 2 0.4238 10.126750399999999 6.20684 34.887619 +1260 420 2 0.4238 8.4937696 6.20684 34.887619 +1261 421 1 -0.8476 9.31026 6.20684 37.41368 +1262 421 2 0.4238 10.126750399999999 6.20684 37.991039 +1263 421 2 0.4238 8.4937696 6.20684 37.991039 +1264 422 1 -0.8476 9.31026 6.20684 40.5171 +1265 422 2 0.4238 10.126750399999999 6.20684 41.094459 +1266 422 2 0.4238 8.4937696 6.20684 41.094459 +1267 423 1 -0.8476 9.31026 6.20684 43.62052 +1268 423 2 0.4238 10.126750399999999 6.20684 44.197879 +1269 423 2 0.4238 8.4937696 6.20684 44.197879 +1270 424 1 -0.8476 9.31026 6.20684 46.72394 +1271 424 2 0.4238 10.126750399999999 6.20684 47.301299 +1272 424 2 0.4238 8.4937696 6.20684 47.301299 +1273 425 1 -0.8476 9.31026 6.20684 49.82736 +1274 425 2 0.4238 10.126750399999999 6.20684 50.404719 +1275 425 2 0.4238 8.4937696 6.20684 50.404719 +1276 426 1 -0.8476 9.31026 6.20684 52.93078 +1277 426 2 0.4238 10.126750399999999 6.20684 53.508139 +1278 426 2 0.4238 8.4937696 6.20684 53.508139 +1279 427 1 -0.8476 9.31026 6.20684 56.0342 +1280 427 2 0.4238 10.126750399999999 6.20684 56.611559 +1281 427 2 0.4238 8.4937696 6.20684 56.611559 +1282 428 1 -0.8476 9.31026 6.20684 59.13762 +1283 428 2 0.4238 10.126750399999999 6.20684 59.714979 +1284 428 2 0.4238 8.4937696 6.20684 59.714979 +1285 429 1 -0.8476 9.31026 6.20684 62.24104 +1286 429 2 0.4238 10.126750399999999 6.20684 62.818399 +1287 429 2 0.4238 8.4937696 6.20684 62.818399 +1288 430 1 -0.8476 9.31026 6.20684 65.34446 +1289 430 2 0.4238 10.126750399999999 6.20684 65.921819 +1290 430 2 0.4238 8.4937696 6.20684 65.921819 +1291 431 1 -0.8476 9.31026 6.20684 68.44788 +1292 431 2 0.4238 10.126750399999999 6.20684 69.025239 +1293 431 2 0.4238 8.4937696 6.20684 69.025239 +1294 432 1 -0.8476 9.31026 6.20684 71.5513 +1295 432 2 0.4238 10.126750399999999 6.20684 72.128659 +1296 432 2 0.4238 8.4937696 6.20684 72.128659 +1297 433 1 -0.8476 9.31026 9.31026 25.0 +1298 433 2 0.4238 10.126750399999999 9.31026 25.577359 +1299 433 2 0.4238 8.4937696 9.31026 25.577359 +1300 434 1 -0.8476 9.31026 9.31026 28.10342 +1301 434 2 0.4238 10.126750399999999 9.31026 28.680779 +1302 434 2 0.4238 8.4937696 9.31026 28.680779 +1303 435 1 -0.8476 9.31026 9.31026 31.20684 +1304 435 2 0.4238 10.126750399999999 9.31026 31.784199 +1305 435 2 0.4238 8.4937696 9.31026 31.784199 +1306 436 1 -0.8476 9.31026 9.31026 34.31026 +1307 436 2 0.4238 10.126750399999999 9.31026 34.887619 +1308 436 2 0.4238 8.4937696 9.31026 34.887619 +1309 437 1 -0.8476 9.31026 9.31026 37.41368 +1310 437 2 0.4238 10.126750399999999 9.31026 37.991039 +1311 437 2 0.4238 8.4937696 9.31026 37.991039 +1312 438 1 -0.8476 9.31026 9.31026 40.5171 +1313 438 2 0.4238 10.126750399999999 9.31026 41.094459 +1314 438 2 0.4238 8.4937696 9.31026 41.094459 +1315 439 1 -0.8476 9.31026 9.31026 43.62052 +1316 439 2 0.4238 10.126750399999999 9.31026 44.197879 +1317 439 2 0.4238 8.4937696 9.31026 44.197879 +1318 440 1 -0.8476 9.31026 9.31026 46.72394 +1319 440 2 0.4238 10.126750399999999 9.31026 47.301299 +1320 440 2 0.4238 8.4937696 9.31026 47.301299 +1321 441 1 -0.8476 9.31026 9.31026 49.82736 +1322 441 2 0.4238 10.126750399999999 9.31026 50.404719 +1323 441 2 0.4238 8.4937696 9.31026 50.404719 +1324 442 1 -0.8476 9.31026 9.31026 52.93078 +1325 442 2 0.4238 10.126750399999999 9.31026 53.508139 +1326 442 2 0.4238 8.4937696 9.31026 53.508139 +1327 443 1 -0.8476 9.31026 9.31026 56.0342 +1328 443 2 0.4238 10.126750399999999 9.31026 56.611559 +1329 443 2 0.4238 8.4937696 9.31026 56.611559 +1330 444 1 -0.8476 9.31026 9.31026 59.13762 +1331 444 2 0.4238 10.126750399999999 9.31026 59.714979 +1332 444 2 0.4238 8.4937696 9.31026 59.714979 +1333 445 1 -0.8476 9.31026 9.31026 62.24104 +1334 445 2 0.4238 10.126750399999999 9.31026 62.818399 +1335 445 2 0.4238 8.4937696 9.31026 62.818399 +1336 446 1 -0.8476 9.31026 9.31026 65.34446 +1337 446 2 0.4238 10.126750399999999 9.31026 65.921819 +1338 446 2 0.4238 8.4937696 9.31026 65.921819 +1339 447 1 -0.8476 9.31026 9.31026 68.44788 +1340 447 2 0.4238 10.126750399999999 9.31026 69.025239 +1341 447 2 0.4238 8.4937696 9.31026 69.025239 +1342 448 1 -0.8476 9.31026 9.31026 71.5513 +1343 448 2 0.4238 10.126750399999999 9.31026 72.128659 +1344 448 2 0.4238 8.4937696 9.31026 72.128659 +1345 449 1 -0.8476 9.31026 12.41368 25.0 +1346 449 2 0.4238 10.126750399999999 12.41368 25.577359 +1347 449 2 0.4238 8.4937696 12.41368 25.577359 +1348 450 1 -0.8476 9.31026 12.41368 28.10342 +1349 450 2 0.4238 10.126750399999999 12.41368 28.680779 +1350 450 2 0.4238 8.4937696 12.41368 28.680779 +1351 451 1 -0.8476 9.31026 12.41368 31.20684 +1352 451 2 0.4238 10.126750399999999 12.41368 31.784199 +1353 451 2 0.4238 8.4937696 12.41368 31.784199 +1354 452 1 -0.8476 9.31026 12.41368 34.31026 +1355 452 2 0.4238 10.126750399999999 12.41368 34.887619 +1356 452 2 0.4238 8.4937696 12.41368 34.887619 +1357 453 1 -0.8476 9.31026 12.41368 37.41368 +1358 453 2 0.4238 10.126750399999999 12.41368 37.991039 +1359 453 2 0.4238 8.4937696 12.41368 37.991039 +1360 454 1 -0.8476 9.31026 12.41368 40.5171 +1361 454 2 0.4238 10.126750399999999 12.41368 41.094459 +1362 454 2 0.4238 8.4937696 12.41368 41.094459 +1363 455 1 -0.8476 9.31026 12.41368 43.62052 +1364 455 2 0.4238 10.126750399999999 12.41368 44.197879 +1365 455 2 0.4238 8.4937696 12.41368 44.197879 +1366 456 1 -0.8476 9.31026 12.41368 46.72394 +1367 456 2 0.4238 10.126750399999999 12.41368 47.301299 +1368 456 2 0.4238 8.4937696 12.41368 47.301299 +1369 457 1 -0.8476 9.31026 12.41368 49.82736 +1370 457 2 0.4238 10.126750399999999 12.41368 50.404719 +1371 457 2 0.4238 8.4937696 12.41368 50.404719 +1372 458 1 -0.8476 9.31026 12.41368 52.93078 +1373 458 2 0.4238 10.126750399999999 12.41368 53.508139 +1374 458 2 0.4238 8.4937696 12.41368 53.508139 +1375 459 1 -0.8476 9.31026 12.41368 56.0342 +1376 459 2 0.4238 10.126750399999999 12.41368 56.611559 +1377 459 2 0.4238 8.4937696 12.41368 56.611559 +1378 460 1 -0.8476 9.31026 12.41368 59.13762 +1379 460 2 0.4238 10.126750399999999 12.41368 59.714979 +1380 460 2 0.4238 8.4937696 12.41368 59.714979 +1381 461 1 -0.8476 9.31026 12.41368 62.24104 +1382 461 2 0.4238 10.126750399999999 12.41368 62.818399 +1383 461 2 0.4238 8.4937696 12.41368 62.818399 +1384 462 1 -0.8476 9.31026 12.41368 65.34446 +1385 462 2 0.4238 10.126750399999999 12.41368 65.921819 +1386 462 2 0.4238 8.4937696 12.41368 65.921819 +1387 463 1 -0.8476 9.31026 12.41368 68.44788 +1388 463 2 0.4238 10.126750399999999 12.41368 69.025239 +1389 463 2 0.4238 8.4937696 12.41368 69.025239 +1390 464 1 -0.8476 9.31026 12.41368 71.5513 +1391 464 2 0.4238 10.126750399999999 12.41368 72.128659 +1392 464 2 0.4238 8.4937696 12.41368 72.128659 +1393 465 1 -0.8476 9.31026 15.5171 25.0 +1394 465 2 0.4238 10.126750399999999 15.5171 25.577359 +1395 465 2 0.4238 8.4937696 15.5171 25.577359 +1396 466 1 -0.8476 9.31026 15.5171 28.10342 +1397 466 2 0.4238 10.126750399999999 15.5171 28.680779 +1398 466 2 0.4238 8.4937696 15.5171 28.680779 +1399 467 1 -0.8476 9.31026 15.5171 31.20684 +1400 467 2 0.4238 10.126750399999999 15.5171 31.784199 +1401 467 2 0.4238 8.4937696 15.5171 31.784199 +1402 468 1 -0.8476 9.31026 15.5171 34.31026 +1403 468 2 0.4238 10.126750399999999 15.5171 34.887619 +1404 468 2 0.4238 8.4937696 15.5171 34.887619 +1405 469 1 -0.8476 9.31026 15.5171 37.41368 +1406 469 2 0.4238 10.126750399999999 15.5171 37.991039 +1407 469 2 0.4238 8.4937696 15.5171 37.991039 +1408 470 1 -0.8476 9.31026 15.5171 40.5171 +1409 470 2 0.4238 10.126750399999999 15.5171 41.094459 +1410 470 2 0.4238 8.4937696 15.5171 41.094459 +1411 471 1 -0.8476 9.31026 15.5171 43.62052 +1412 471 2 0.4238 10.126750399999999 15.5171 44.197879 +1413 471 2 0.4238 8.4937696 15.5171 44.197879 +1414 472 1 -0.8476 9.31026 15.5171 46.72394 +1415 472 2 0.4238 10.126750399999999 15.5171 47.301299 +1416 472 2 0.4238 8.4937696 15.5171 47.301299 +1417 473 1 -0.8476 9.31026 15.5171 49.82736 +1418 473 2 0.4238 10.126750399999999 15.5171 50.404719 +1419 473 2 0.4238 8.4937696 15.5171 50.404719 +1420 474 1 -0.8476 9.31026 15.5171 52.93078 +1421 474 2 0.4238 10.126750399999999 15.5171 53.508139 +1422 474 2 0.4238 8.4937696 15.5171 53.508139 +1423 475 1 -0.8476 9.31026 15.5171 56.0342 +1424 475 2 0.4238 10.126750399999999 15.5171 56.611559 +1425 475 2 0.4238 8.4937696 15.5171 56.611559 +1426 476 1 -0.8476 9.31026 15.5171 59.13762 +1427 476 2 0.4238 10.126750399999999 15.5171 59.714979 +1428 476 2 0.4238 8.4937696 15.5171 59.714979 +1429 477 1 -0.8476 9.31026 15.5171 62.24104 +1430 477 2 0.4238 10.126750399999999 15.5171 62.818399 +1431 477 2 0.4238 8.4937696 15.5171 62.818399 +1432 478 1 -0.8476 9.31026 15.5171 65.34446 +1433 478 2 0.4238 10.126750399999999 15.5171 65.921819 +1434 478 2 0.4238 8.4937696 15.5171 65.921819 +1435 479 1 -0.8476 9.31026 15.5171 68.44788 +1436 479 2 0.4238 10.126750399999999 15.5171 69.025239 +1437 479 2 0.4238 8.4937696 15.5171 69.025239 +1438 480 1 -0.8476 9.31026 15.5171 71.5513 +1439 480 2 0.4238 10.126750399999999 15.5171 72.128659 +1440 480 2 0.4238 8.4937696 15.5171 72.128659 +1441 481 1 -0.8476 9.31026 18.62052 25.0 +1442 481 2 0.4238 10.126750399999999 18.62052 25.577359 +1443 481 2 0.4238 8.4937696 18.62052 25.577359 +1444 482 1 -0.8476 9.31026 18.62052 28.10342 +1445 482 2 0.4238 10.126750399999999 18.62052 28.680779 +1446 482 2 0.4238 8.4937696 18.62052 28.680779 +1447 483 1 -0.8476 9.31026 18.62052 31.20684 +1448 483 2 0.4238 10.126750399999999 18.62052 31.784199 +1449 483 2 0.4238 8.4937696 18.62052 31.784199 +1450 484 1 -0.8476 9.31026 18.62052 34.31026 +1451 484 2 0.4238 10.126750399999999 18.62052 34.887619 +1452 484 2 0.4238 8.4937696 18.62052 34.887619 +1453 485 1 -0.8476 9.31026 18.62052 37.41368 +1454 485 2 0.4238 10.126750399999999 18.62052 37.991039 +1455 485 2 0.4238 8.4937696 18.62052 37.991039 +1456 486 1 -0.8476 9.31026 18.62052 40.5171 +1457 486 2 0.4238 10.126750399999999 18.62052 41.094459 +1458 486 2 0.4238 8.4937696 18.62052 41.094459 +1459 487 1 -0.8476 9.31026 18.62052 43.62052 +1460 487 2 0.4238 10.126750399999999 18.62052 44.197879 +1461 487 2 0.4238 8.4937696 18.62052 44.197879 +1462 488 1 -0.8476 9.31026 18.62052 46.72394 +1463 488 2 0.4238 10.126750399999999 18.62052 47.301299 +1464 488 2 0.4238 8.4937696 18.62052 47.301299 +1465 489 1 -0.8476 9.31026 18.62052 49.82736 +1466 489 2 0.4238 10.126750399999999 18.62052 50.404719 +1467 489 2 0.4238 8.4937696 18.62052 50.404719 +1468 490 1 -0.8476 9.31026 18.62052 52.93078 +1469 490 2 0.4238 10.126750399999999 18.62052 53.508139 +1470 490 2 0.4238 8.4937696 18.62052 53.508139 +1471 491 1 -0.8476 9.31026 18.62052 56.0342 +1472 491 2 0.4238 10.126750399999999 18.62052 56.611559 +1473 491 2 0.4238 8.4937696 18.62052 56.611559 +1474 492 1 -0.8476 9.31026 18.62052 59.13762 +1475 492 2 0.4238 10.126750399999999 18.62052 59.714979 +1476 492 2 0.4238 8.4937696 18.62052 59.714979 +1477 493 1 -0.8476 9.31026 18.62052 62.24104 +1478 493 2 0.4238 10.126750399999999 18.62052 62.818399 +1479 493 2 0.4238 8.4937696 18.62052 62.818399 +1480 494 1 -0.8476 9.31026 18.62052 65.34446 +1481 494 2 0.4238 10.126750399999999 18.62052 65.921819 +1482 494 2 0.4238 8.4937696 18.62052 65.921819 +1483 495 1 -0.8476 9.31026 18.62052 68.44788 +1484 495 2 0.4238 10.126750399999999 18.62052 69.025239 +1485 495 2 0.4238 8.4937696 18.62052 69.025239 +1486 496 1 -0.8476 9.31026 18.62052 71.5513 +1487 496 2 0.4238 10.126750399999999 18.62052 72.128659 +1488 496 2 0.4238 8.4937696 18.62052 72.128659 +1489 497 1 -0.8476 9.31026 21.72394 25.0 +1490 497 2 0.4238 10.126750399999999 21.72394 25.577359 +1491 497 2 0.4238 8.4937696 21.72394 25.577359 +1492 498 1 -0.8476 9.31026 21.72394 28.10342 +1493 498 2 0.4238 10.126750399999999 21.72394 28.680779 +1494 498 2 0.4238 8.4937696 21.72394 28.680779 +1495 499 1 -0.8476 9.31026 21.72394 31.20684 +1496 499 2 0.4238 10.126750399999999 21.72394 31.784199 +1497 499 2 0.4238 8.4937696 21.72394 31.784199 +1498 500 1 -0.8476 9.31026 21.72394 34.31026 +1499 500 2 0.4238 10.126750399999999 21.72394 34.887619 +1500 500 2 0.4238 8.4937696 21.72394 34.887619 +1501 501 1 -0.8476 9.31026 21.72394 37.41368 +1502 501 2 0.4238 10.126750399999999 21.72394 37.991039 +1503 501 2 0.4238 8.4937696 21.72394 37.991039 +1504 502 1 -0.8476 9.31026 21.72394 40.5171 +1505 502 2 0.4238 10.126750399999999 21.72394 41.094459 +1506 502 2 0.4238 8.4937696 21.72394 41.094459 +1507 503 1 -0.8476 9.31026 21.72394 43.62052 +1508 503 2 0.4238 10.126750399999999 21.72394 44.197879 +1509 503 2 0.4238 8.4937696 21.72394 44.197879 +1510 504 1 -0.8476 9.31026 21.72394 46.72394 +1511 504 2 0.4238 10.126750399999999 21.72394 47.301299 +1512 504 2 0.4238 8.4937696 21.72394 47.301299 +1513 505 1 -0.8476 9.31026 21.72394 49.82736 +1514 505 2 0.4238 10.126750399999999 21.72394 50.404719 +1515 505 2 0.4238 8.4937696 21.72394 50.404719 +1516 506 1 -0.8476 9.31026 21.72394 52.93078 +1517 506 2 0.4238 10.126750399999999 21.72394 53.508139 +1518 506 2 0.4238 8.4937696 21.72394 53.508139 +1519 507 1 -0.8476 9.31026 21.72394 56.0342 +1520 507 2 0.4238 10.126750399999999 21.72394 56.611559 +1521 507 2 0.4238 8.4937696 21.72394 56.611559 +1522 508 1 -0.8476 9.31026 21.72394 59.13762 +1523 508 2 0.4238 10.126750399999999 21.72394 59.714979 +1524 508 2 0.4238 8.4937696 21.72394 59.714979 +1525 509 1 -0.8476 9.31026 21.72394 62.24104 +1526 509 2 0.4238 10.126750399999999 21.72394 62.818399 +1527 509 2 0.4238 8.4937696 21.72394 62.818399 +1528 510 1 -0.8476 9.31026 21.72394 65.34446 +1529 510 2 0.4238 10.126750399999999 21.72394 65.921819 +1530 510 2 0.4238 8.4937696 21.72394 65.921819 +1531 511 1 -0.8476 9.31026 21.72394 68.44788 +1532 511 2 0.4238 10.126750399999999 21.72394 69.025239 +1533 511 2 0.4238 8.4937696 21.72394 69.025239 +1534 512 1 -0.8476 9.31026 21.72394 71.5513 +1535 512 2 0.4238 10.126750399999999 21.72394 72.128659 +1536 512 2 0.4238 8.4937696 21.72394 72.128659 +1537 513 1 -0.8476 12.41368 0.0 25.0 +1538 513 2 0.4238 13.230170399999999 0.0 25.577359 +1539 513 2 0.4238 11.5971896 0.0 25.577359 +1540 514 1 -0.8476 12.41368 0.0 28.10342 +1541 514 2 0.4238 13.230170399999999 0.0 28.680779 +1542 514 2 0.4238 11.5971896 0.0 28.680779 +1543 515 1 -0.8476 12.41368 0.0 31.20684 +1544 515 2 0.4238 13.230170399999999 0.0 31.784199 +1545 515 2 0.4238 11.5971896 0.0 31.784199 +1546 516 1 -0.8476 12.41368 0.0 34.31026 +1547 516 2 0.4238 13.230170399999999 0.0 34.887619 +1548 516 2 0.4238 11.5971896 0.0 34.887619 +1549 517 1 -0.8476 12.41368 0.0 37.41368 +1550 517 2 0.4238 13.230170399999999 0.0 37.991039 +1551 517 2 0.4238 11.5971896 0.0 37.991039 +1552 518 1 -0.8476 12.41368 0.0 40.5171 +1553 518 2 0.4238 13.230170399999999 0.0 41.094459 +1554 518 2 0.4238 11.5971896 0.0 41.094459 +1555 519 1 -0.8476 12.41368 0.0 43.62052 +1556 519 2 0.4238 13.230170399999999 0.0 44.197879 +1557 519 2 0.4238 11.5971896 0.0 44.197879 +1558 520 1 -0.8476 12.41368 0.0 46.72394 +1559 520 2 0.4238 13.230170399999999 0.0 47.301299 +1560 520 2 0.4238 11.5971896 0.0 47.301299 +1561 521 1 -0.8476 12.41368 0.0 49.82736 +1562 521 2 0.4238 13.230170399999999 0.0 50.404719 +1563 521 2 0.4238 11.5971896 0.0 50.404719 +1564 522 1 -0.8476 12.41368 0.0 52.93078 +1565 522 2 0.4238 13.230170399999999 0.0 53.508139 +1566 522 2 0.4238 11.5971896 0.0 53.508139 +1567 523 1 -0.8476 12.41368 0.0 56.0342 +1568 523 2 0.4238 13.230170399999999 0.0 56.611559 +1569 523 2 0.4238 11.5971896 0.0 56.611559 +1570 524 1 -0.8476 12.41368 0.0 59.13762 +1571 524 2 0.4238 13.230170399999999 0.0 59.714979 +1572 524 2 0.4238 11.5971896 0.0 59.714979 +1573 525 1 -0.8476 12.41368 0.0 62.24104 +1574 525 2 0.4238 13.230170399999999 0.0 62.818399 +1575 525 2 0.4238 11.5971896 0.0 62.818399 +1576 526 1 -0.8476 12.41368 0.0 65.34446 +1577 526 2 0.4238 13.230170399999999 0.0 65.921819 +1578 526 2 0.4238 11.5971896 0.0 65.921819 +1579 527 1 -0.8476 12.41368 0.0 68.44788 +1580 527 2 0.4238 13.230170399999999 0.0 69.025239 +1581 527 2 0.4238 11.5971896 0.0 69.025239 +1582 528 1 -0.8476 12.41368 0.0 71.5513 +1583 528 2 0.4238 13.230170399999999 0.0 72.128659 +1584 528 2 0.4238 11.5971896 0.0 72.128659 +1585 529 1 -0.8476 12.41368 3.10342 25.0 +1586 529 2 0.4238 13.230170399999999 3.10342 25.577359 +1587 529 2 0.4238 11.5971896 3.10342 25.577359 +1588 530 1 -0.8476 12.41368 3.10342 28.10342 +1589 530 2 0.4238 13.230170399999999 3.10342 28.680779 +1590 530 2 0.4238 11.5971896 3.10342 28.680779 +1591 531 1 -0.8476 12.41368 3.10342 31.20684 +1592 531 2 0.4238 13.230170399999999 3.10342 31.784199 +1593 531 2 0.4238 11.5971896 3.10342 31.784199 +1594 532 1 -0.8476 12.41368 3.10342 34.31026 +1595 532 2 0.4238 13.230170399999999 3.10342 34.887619 +1596 532 2 0.4238 11.5971896 3.10342 34.887619 +1597 533 1 -0.8476 12.41368 3.10342 37.41368 +1598 533 2 0.4238 13.230170399999999 3.10342 37.991039 +1599 533 2 0.4238 11.5971896 3.10342 37.991039 +1600 534 1 -0.8476 12.41368 3.10342 40.5171 +1601 534 2 0.4238 13.230170399999999 3.10342 41.094459 +1602 534 2 0.4238 11.5971896 3.10342 41.094459 +1603 535 1 -0.8476 12.41368 3.10342 43.62052 +1604 535 2 0.4238 13.230170399999999 3.10342 44.197879 +1605 535 2 0.4238 11.5971896 3.10342 44.197879 +1606 536 1 -0.8476 12.41368 3.10342 46.72394 +1607 536 2 0.4238 13.230170399999999 3.10342 47.301299 +1608 536 2 0.4238 11.5971896 3.10342 47.301299 +1609 537 1 -0.8476 12.41368 3.10342 49.82736 +1610 537 2 0.4238 13.230170399999999 3.10342 50.404719 +1611 537 2 0.4238 11.5971896 3.10342 50.404719 +1612 538 1 -0.8476 12.41368 3.10342 52.93078 +1613 538 2 0.4238 13.230170399999999 3.10342 53.508139 +1614 538 2 0.4238 11.5971896 3.10342 53.508139 +1615 539 1 -0.8476 12.41368 3.10342 56.0342 +1616 539 2 0.4238 13.230170399999999 3.10342 56.611559 +1617 539 2 0.4238 11.5971896 3.10342 56.611559 +1618 540 1 -0.8476 12.41368 3.10342 59.13762 +1619 540 2 0.4238 13.230170399999999 3.10342 59.714979 +1620 540 2 0.4238 11.5971896 3.10342 59.714979 +1621 541 1 -0.8476 12.41368 3.10342 62.24104 +1622 541 2 0.4238 13.230170399999999 3.10342 62.818399 +1623 541 2 0.4238 11.5971896 3.10342 62.818399 +1624 542 1 -0.8476 12.41368 3.10342 65.34446 +1625 542 2 0.4238 13.230170399999999 3.10342 65.921819 +1626 542 2 0.4238 11.5971896 3.10342 65.921819 +1627 543 1 -0.8476 12.41368 3.10342 68.44788 +1628 543 2 0.4238 13.230170399999999 3.10342 69.025239 +1629 543 2 0.4238 11.5971896 3.10342 69.025239 +1630 544 1 -0.8476 12.41368 3.10342 71.5513 +1631 544 2 0.4238 13.230170399999999 3.10342 72.128659 +1632 544 2 0.4238 11.5971896 3.10342 72.128659 +1633 545 1 -0.8476 12.41368 6.20684 25.0 +1634 545 2 0.4238 13.230170399999999 6.20684 25.577359 +1635 545 2 0.4238 11.5971896 6.20684 25.577359 +1636 546 1 -0.8476 12.41368 6.20684 28.10342 +1637 546 2 0.4238 13.230170399999999 6.20684 28.680779 +1638 546 2 0.4238 11.5971896 6.20684 28.680779 +1639 547 1 -0.8476 12.41368 6.20684 31.20684 +1640 547 2 0.4238 13.230170399999999 6.20684 31.784199 +1641 547 2 0.4238 11.5971896 6.20684 31.784199 +1642 548 1 -0.8476 12.41368 6.20684 34.31026 +1643 548 2 0.4238 13.230170399999999 6.20684 34.887619 +1644 548 2 0.4238 11.5971896 6.20684 34.887619 +1645 549 1 -0.8476 12.41368 6.20684 37.41368 +1646 549 2 0.4238 13.230170399999999 6.20684 37.991039 +1647 549 2 0.4238 11.5971896 6.20684 37.991039 +1648 550 1 -0.8476 12.41368 6.20684 40.5171 +1649 550 2 0.4238 13.230170399999999 6.20684 41.094459 +1650 550 2 0.4238 11.5971896 6.20684 41.094459 +1651 551 1 -0.8476 12.41368 6.20684 43.62052 +1652 551 2 0.4238 13.230170399999999 6.20684 44.197879 +1653 551 2 0.4238 11.5971896 6.20684 44.197879 +1654 552 1 -0.8476 12.41368 6.20684 46.72394 +1655 552 2 0.4238 13.230170399999999 6.20684 47.301299 +1656 552 2 0.4238 11.5971896 6.20684 47.301299 +1657 553 1 -0.8476 12.41368 6.20684 49.82736 +1658 553 2 0.4238 13.230170399999999 6.20684 50.404719 +1659 553 2 0.4238 11.5971896 6.20684 50.404719 +1660 554 1 -0.8476 12.41368 6.20684 52.93078 +1661 554 2 0.4238 13.230170399999999 6.20684 53.508139 +1662 554 2 0.4238 11.5971896 6.20684 53.508139 +1663 555 1 -0.8476 12.41368 6.20684 56.0342 +1664 555 2 0.4238 13.230170399999999 6.20684 56.611559 +1665 555 2 0.4238 11.5971896 6.20684 56.611559 +1666 556 1 -0.8476 12.41368 6.20684 59.13762 +1667 556 2 0.4238 13.230170399999999 6.20684 59.714979 +1668 556 2 0.4238 11.5971896 6.20684 59.714979 +1669 557 1 -0.8476 12.41368 6.20684 62.24104 +1670 557 2 0.4238 13.230170399999999 6.20684 62.818399 +1671 557 2 0.4238 11.5971896 6.20684 62.818399 +1672 558 1 -0.8476 12.41368 6.20684 65.34446 +1673 558 2 0.4238 13.230170399999999 6.20684 65.921819 +1674 558 2 0.4238 11.5971896 6.20684 65.921819 +1675 559 1 -0.8476 12.41368 6.20684 68.44788 +1676 559 2 0.4238 13.230170399999999 6.20684 69.025239 +1677 559 2 0.4238 11.5971896 6.20684 69.025239 +1678 560 1 -0.8476 12.41368 6.20684 71.5513 +1679 560 2 0.4238 13.230170399999999 6.20684 72.128659 +1680 560 2 0.4238 11.5971896 6.20684 72.128659 +1681 561 1 -0.8476 12.41368 9.31026 25.0 +1682 561 2 0.4238 13.230170399999999 9.31026 25.577359 +1683 561 2 0.4238 11.5971896 9.31026 25.577359 +1684 562 1 -0.8476 12.41368 9.31026 28.10342 +1685 562 2 0.4238 13.230170399999999 9.31026 28.680779 +1686 562 2 0.4238 11.5971896 9.31026 28.680779 +1687 563 1 -0.8476 12.41368 9.31026 31.20684 +1688 563 2 0.4238 13.230170399999999 9.31026 31.784199 +1689 563 2 0.4238 11.5971896 9.31026 31.784199 +1690 564 1 -0.8476 12.41368 9.31026 34.31026 +1691 564 2 0.4238 13.230170399999999 9.31026 34.887619 +1692 564 2 0.4238 11.5971896 9.31026 34.887619 +1693 565 1 -0.8476 12.41368 9.31026 37.41368 +1694 565 2 0.4238 13.230170399999999 9.31026 37.991039 +1695 565 2 0.4238 11.5971896 9.31026 37.991039 +1696 566 1 -0.8476 12.41368 9.31026 40.5171 +1697 566 2 0.4238 13.230170399999999 9.31026 41.094459 +1698 566 2 0.4238 11.5971896 9.31026 41.094459 +1699 567 1 -0.8476 12.41368 9.31026 43.62052 +1700 567 2 0.4238 13.230170399999999 9.31026 44.197879 +1701 567 2 0.4238 11.5971896 9.31026 44.197879 +1702 568 1 -0.8476 12.41368 9.31026 46.72394 +1703 568 2 0.4238 13.230170399999999 9.31026 47.301299 +1704 568 2 0.4238 11.5971896 9.31026 47.301299 +1705 569 1 -0.8476 12.41368 9.31026 49.82736 +1706 569 2 0.4238 13.230170399999999 9.31026 50.404719 +1707 569 2 0.4238 11.5971896 9.31026 50.404719 +1708 570 1 -0.8476 12.41368 9.31026 52.93078 +1709 570 2 0.4238 13.230170399999999 9.31026 53.508139 +1710 570 2 0.4238 11.5971896 9.31026 53.508139 +1711 571 1 -0.8476 12.41368 9.31026 56.0342 +1712 571 2 0.4238 13.230170399999999 9.31026 56.611559 +1713 571 2 0.4238 11.5971896 9.31026 56.611559 +1714 572 1 -0.8476 12.41368 9.31026 59.13762 +1715 572 2 0.4238 13.230170399999999 9.31026 59.714979 +1716 572 2 0.4238 11.5971896 9.31026 59.714979 +1717 573 1 -0.8476 12.41368 9.31026 62.24104 +1718 573 2 0.4238 13.230170399999999 9.31026 62.818399 +1719 573 2 0.4238 11.5971896 9.31026 62.818399 +1720 574 1 -0.8476 12.41368 9.31026 65.34446 +1721 574 2 0.4238 13.230170399999999 9.31026 65.921819 +1722 574 2 0.4238 11.5971896 9.31026 65.921819 +1723 575 1 -0.8476 12.41368 9.31026 68.44788 +1724 575 2 0.4238 13.230170399999999 9.31026 69.025239 +1725 575 2 0.4238 11.5971896 9.31026 69.025239 +1726 576 1 -0.8476 12.41368 9.31026 71.5513 +1727 576 2 0.4238 13.230170399999999 9.31026 72.128659 +1728 576 2 0.4238 11.5971896 9.31026 72.128659 +1729 577 1 -0.8476 12.41368 12.41368 25.0 +1730 577 2 0.4238 13.230170399999999 12.41368 25.577359 +1731 577 2 0.4238 11.5971896 12.41368 25.577359 +1732 578 1 -0.8476 12.41368 12.41368 28.10342 +1733 578 2 0.4238 13.230170399999999 12.41368 28.680779 +1734 578 2 0.4238 11.5971896 12.41368 28.680779 +1735 579 1 -0.8476 12.41368 12.41368 31.20684 +1736 579 2 0.4238 13.230170399999999 12.41368 31.784199 +1737 579 2 0.4238 11.5971896 12.41368 31.784199 +1738 580 1 -0.8476 12.41368 12.41368 34.31026 +1739 580 2 0.4238 13.230170399999999 12.41368 34.887619 +1740 580 2 0.4238 11.5971896 12.41368 34.887619 +1741 581 1 -0.8476 12.41368 12.41368 37.41368 +1742 581 2 0.4238 13.230170399999999 12.41368 37.991039 +1743 581 2 0.4238 11.5971896 12.41368 37.991039 +1744 582 1 -0.8476 12.41368 12.41368 40.5171 +1745 582 2 0.4238 13.230170399999999 12.41368 41.094459 +1746 582 2 0.4238 11.5971896 12.41368 41.094459 +1747 583 1 -0.8476 12.41368 12.41368 43.62052 +1748 583 2 0.4238 13.230170399999999 12.41368 44.197879 +1749 583 2 0.4238 11.5971896 12.41368 44.197879 +1750 584 1 -0.8476 12.41368 12.41368 46.72394 +1751 584 2 0.4238 13.230170399999999 12.41368 47.301299 +1752 584 2 0.4238 11.5971896 12.41368 47.301299 +1753 585 1 -0.8476 12.41368 12.41368 49.82736 +1754 585 2 0.4238 13.230170399999999 12.41368 50.404719 +1755 585 2 0.4238 11.5971896 12.41368 50.404719 +1756 586 1 -0.8476 12.41368 12.41368 52.93078 +1757 586 2 0.4238 13.230170399999999 12.41368 53.508139 +1758 586 2 0.4238 11.5971896 12.41368 53.508139 +1759 587 1 -0.8476 12.41368 12.41368 56.0342 +1760 587 2 0.4238 13.230170399999999 12.41368 56.611559 +1761 587 2 0.4238 11.5971896 12.41368 56.611559 +1762 588 1 -0.8476 12.41368 12.41368 59.13762 +1763 588 2 0.4238 13.230170399999999 12.41368 59.714979 +1764 588 2 0.4238 11.5971896 12.41368 59.714979 +1765 589 1 -0.8476 12.41368 12.41368 62.24104 +1766 589 2 0.4238 13.230170399999999 12.41368 62.818399 +1767 589 2 0.4238 11.5971896 12.41368 62.818399 +1768 590 1 -0.8476 12.41368 12.41368 65.34446 +1769 590 2 0.4238 13.230170399999999 12.41368 65.921819 +1770 590 2 0.4238 11.5971896 12.41368 65.921819 +1771 591 1 -0.8476 12.41368 12.41368 68.44788 +1772 591 2 0.4238 13.230170399999999 12.41368 69.025239 +1773 591 2 0.4238 11.5971896 12.41368 69.025239 +1774 592 1 -0.8476 12.41368 12.41368 71.5513 +1775 592 2 0.4238 13.230170399999999 12.41368 72.128659 +1776 592 2 0.4238 11.5971896 12.41368 72.128659 +1777 593 1 -0.8476 12.41368 15.5171 25.0 +1778 593 2 0.4238 13.230170399999999 15.5171 25.577359 +1779 593 2 0.4238 11.5971896 15.5171 25.577359 +1780 594 1 -0.8476 12.41368 15.5171 28.10342 +1781 594 2 0.4238 13.230170399999999 15.5171 28.680779 +1782 594 2 0.4238 11.5971896 15.5171 28.680779 +1783 595 1 -0.8476 12.41368 15.5171 31.20684 +1784 595 2 0.4238 13.230170399999999 15.5171 31.784199 +1785 595 2 0.4238 11.5971896 15.5171 31.784199 +1786 596 1 -0.8476 12.41368 15.5171 34.31026 +1787 596 2 0.4238 13.230170399999999 15.5171 34.887619 +1788 596 2 0.4238 11.5971896 15.5171 34.887619 +1789 597 1 -0.8476 12.41368 15.5171 37.41368 +1790 597 2 0.4238 13.230170399999999 15.5171 37.991039 +1791 597 2 0.4238 11.5971896 15.5171 37.991039 +1792 598 1 -0.8476 12.41368 15.5171 40.5171 +1793 598 2 0.4238 13.230170399999999 15.5171 41.094459 +1794 598 2 0.4238 11.5971896 15.5171 41.094459 +1795 599 1 -0.8476 12.41368 15.5171 43.62052 +1796 599 2 0.4238 13.230170399999999 15.5171 44.197879 +1797 599 2 0.4238 11.5971896 15.5171 44.197879 +1798 600 1 -0.8476 12.41368 15.5171 46.72394 +1799 600 2 0.4238 13.230170399999999 15.5171 47.301299 +1800 600 2 0.4238 11.5971896 15.5171 47.301299 +1801 601 1 -0.8476 12.41368 15.5171 49.82736 +1802 601 2 0.4238 13.230170399999999 15.5171 50.404719 +1803 601 2 0.4238 11.5971896 15.5171 50.404719 +1804 602 1 -0.8476 12.41368 15.5171 52.93078 +1805 602 2 0.4238 13.230170399999999 15.5171 53.508139 +1806 602 2 0.4238 11.5971896 15.5171 53.508139 +1807 603 1 -0.8476 12.41368 15.5171 56.0342 +1808 603 2 0.4238 13.230170399999999 15.5171 56.611559 +1809 603 2 0.4238 11.5971896 15.5171 56.611559 +1810 604 1 -0.8476 12.41368 15.5171 59.13762 +1811 604 2 0.4238 13.230170399999999 15.5171 59.714979 +1812 604 2 0.4238 11.5971896 15.5171 59.714979 +1813 605 1 -0.8476 12.41368 15.5171 62.24104 +1814 605 2 0.4238 13.230170399999999 15.5171 62.818399 +1815 605 2 0.4238 11.5971896 15.5171 62.818399 +1816 606 1 -0.8476 12.41368 15.5171 65.34446 +1817 606 2 0.4238 13.230170399999999 15.5171 65.921819 +1818 606 2 0.4238 11.5971896 15.5171 65.921819 +1819 607 1 -0.8476 12.41368 15.5171 68.44788 +1820 607 2 0.4238 13.230170399999999 15.5171 69.025239 +1821 607 2 0.4238 11.5971896 15.5171 69.025239 +1822 608 1 -0.8476 12.41368 15.5171 71.5513 +1823 608 2 0.4238 13.230170399999999 15.5171 72.128659 +1824 608 2 0.4238 11.5971896 15.5171 72.128659 +1825 609 1 -0.8476 12.41368 18.62052 25.0 +1826 609 2 0.4238 13.230170399999999 18.62052 25.577359 +1827 609 2 0.4238 11.5971896 18.62052 25.577359 +1828 610 1 -0.8476 12.41368 18.62052 28.10342 +1829 610 2 0.4238 13.230170399999999 18.62052 28.680779 +1830 610 2 0.4238 11.5971896 18.62052 28.680779 +1831 611 1 -0.8476 12.41368 18.62052 31.20684 +1832 611 2 0.4238 13.230170399999999 18.62052 31.784199 +1833 611 2 0.4238 11.5971896 18.62052 31.784199 +1834 612 1 -0.8476 12.41368 18.62052 34.31026 +1835 612 2 0.4238 13.230170399999999 18.62052 34.887619 +1836 612 2 0.4238 11.5971896 18.62052 34.887619 +1837 613 1 -0.8476 12.41368 18.62052 37.41368 +1838 613 2 0.4238 13.230170399999999 18.62052 37.991039 +1839 613 2 0.4238 11.5971896 18.62052 37.991039 +1840 614 1 -0.8476 12.41368 18.62052 40.5171 +1841 614 2 0.4238 13.230170399999999 18.62052 41.094459 +1842 614 2 0.4238 11.5971896 18.62052 41.094459 +1843 615 1 -0.8476 12.41368 18.62052 43.62052 +1844 615 2 0.4238 13.230170399999999 18.62052 44.197879 +1845 615 2 0.4238 11.5971896 18.62052 44.197879 +1846 616 1 -0.8476 12.41368 18.62052 46.72394 +1847 616 2 0.4238 13.230170399999999 18.62052 47.301299 +1848 616 2 0.4238 11.5971896 18.62052 47.301299 +1849 617 1 -0.8476 12.41368 18.62052 49.82736 +1850 617 2 0.4238 13.230170399999999 18.62052 50.404719 +1851 617 2 0.4238 11.5971896 18.62052 50.404719 +1852 618 1 -0.8476 12.41368 18.62052 52.93078 +1853 618 2 0.4238 13.230170399999999 18.62052 53.508139 +1854 618 2 0.4238 11.5971896 18.62052 53.508139 +1855 619 1 -0.8476 12.41368 18.62052 56.0342 +1856 619 2 0.4238 13.230170399999999 18.62052 56.611559 +1857 619 2 0.4238 11.5971896 18.62052 56.611559 +1858 620 1 -0.8476 12.41368 18.62052 59.13762 +1859 620 2 0.4238 13.230170399999999 18.62052 59.714979 +1860 620 2 0.4238 11.5971896 18.62052 59.714979 +1861 621 1 -0.8476 12.41368 18.62052 62.24104 +1862 621 2 0.4238 13.230170399999999 18.62052 62.818399 +1863 621 2 0.4238 11.5971896 18.62052 62.818399 +1864 622 1 -0.8476 12.41368 18.62052 65.34446 +1865 622 2 0.4238 13.230170399999999 18.62052 65.921819 +1866 622 2 0.4238 11.5971896 18.62052 65.921819 +1867 623 1 -0.8476 12.41368 18.62052 68.44788 +1868 623 2 0.4238 13.230170399999999 18.62052 69.025239 +1869 623 2 0.4238 11.5971896 18.62052 69.025239 +1870 624 1 -0.8476 12.41368 18.62052 71.5513 +1871 624 2 0.4238 13.230170399999999 18.62052 72.128659 +1872 624 2 0.4238 11.5971896 18.62052 72.128659 +1873 625 1 -0.8476 12.41368 21.72394 25.0 +1874 625 2 0.4238 13.230170399999999 21.72394 25.577359 +1875 625 2 0.4238 11.5971896 21.72394 25.577359 +1876 626 1 -0.8476 12.41368 21.72394 28.10342 +1877 626 2 0.4238 13.230170399999999 21.72394 28.680779 +1878 626 2 0.4238 11.5971896 21.72394 28.680779 +1879 627 1 -0.8476 12.41368 21.72394 31.20684 +1880 627 2 0.4238 13.230170399999999 21.72394 31.784199 +1881 627 2 0.4238 11.5971896 21.72394 31.784199 +1882 628 1 -0.8476 12.41368 21.72394 34.31026 +1883 628 2 0.4238 13.230170399999999 21.72394 34.887619 +1884 628 2 0.4238 11.5971896 21.72394 34.887619 +1885 629 1 -0.8476 12.41368 21.72394 37.41368 +1886 629 2 0.4238 13.230170399999999 21.72394 37.991039 +1887 629 2 0.4238 11.5971896 21.72394 37.991039 +1888 630 1 -0.8476 12.41368 21.72394 40.5171 +1889 630 2 0.4238 13.230170399999999 21.72394 41.094459 +1890 630 2 0.4238 11.5971896 21.72394 41.094459 +1891 631 1 -0.8476 12.41368 21.72394 43.62052 +1892 631 2 0.4238 13.230170399999999 21.72394 44.197879 +1893 631 2 0.4238 11.5971896 21.72394 44.197879 +1894 632 1 -0.8476 12.41368 21.72394 46.72394 +1895 632 2 0.4238 13.230170399999999 21.72394 47.301299 +1896 632 2 0.4238 11.5971896 21.72394 47.301299 +1897 633 1 -0.8476 12.41368 21.72394 49.82736 +1898 633 2 0.4238 13.230170399999999 21.72394 50.404719 +1899 633 2 0.4238 11.5971896 21.72394 50.404719 +1900 634 1 -0.8476 12.41368 21.72394 52.93078 +1901 634 2 0.4238 13.230170399999999 21.72394 53.508139 +1902 634 2 0.4238 11.5971896 21.72394 53.508139 +1903 635 1 -0.8476 12.41368 21.72394 56.0342 +1904 635 2 0.4238 13.230170399999999 21.72394 56.611559 +1905 635 2 0.4238 11.5971896 21.72394 56.611559 +1906 636 1 -0.8476 12.41368 21.72394 59.13762 +1907 636 2 0.4238 13.230170399999999 21.72394 59.714979 +1908 636 2 0.4238 11.5971896 21.72394 59.714979 +1909 637 1 -0.8476 12.41368 21.72394 62.24104 +1910 637 2 0.4238 13.230170399999999 21.72394 62.818399 +1911 637 2 0.4238 11.5971896 21.72394 62.818399 +1912 638 1 -0.8476 12.41368 21.72394 65.34446 +1913 638 2 0.4238 13.230170399999999 21.72394 65.921819 +1914 638 2 0.4238 11.5971896 21.72394 65.921819 +1915 639 1 -0.8476 12.41368 21.72394 68.44788 +1916 639 2 0.4238 13.230170399999999 21.72394 69.025239 +1917 639 2 0.4238 11.5971896 21.72394 69.025239 +1918 640 1 -0.8476 12.41368 21.72394 71.5513 +1919 640 2 0.4238 13.230170399999999 21.72394 72.128659 +1920 640 2 0.4238 11.5971896 21.72394 72.128659 +1921 641 1 -0.8476 15.5171 0.0 25.0 +1922 641 2 0.4238 16.3335904 0.0 25.577359 +1923 641 2 0.4238 14.7006096 0.0 25.577359 +1924 642 1 -0.8476 15.5171 0.0 28.10342 +1925 642 2 0.4238 16.3335904 0.0 28.680779 +1926 642 2 0.4238 14.7006096 0.0 28.680779 +1927 643 1 -0.8476 15.5171 0.0 31.20684 +1928 643 2 0.4238 16.3335904 0.0 31.784199 +1929 643 2 0.4238 14.7006096 0.0 31.784199 +1930 644 1 -0.8476 15.5171 0.0 34.31026 +1931 644 2 0.4238 16.3335904 0.0 34.887619 +1932 644 2 0.4238 14.7006096 0.0 34.887619 +1933 645 1 -0.8476 15.5171 0.0 37.41368 +1934 645 2 0.4238 16.3335904 0.0 37.991039 +1935 645 2 0.4238 14.7006096 0.0 37.991039 +1936 646 1 -0.8476 15.5171 0.0 40.5171 +1937 646 2 0.4238 16.3335904 0.0 41.094459 +1938 646 2 0.4238 14.7006096 0.0 41.094459 +1939 647 1 -0.8476 15.5171 0.0 43.62052 +1940 647 2 0.4238 16.3335904 0.0 44.197879 +1941 647 2 0.4238 14.7006096 0.0 44.197879 +1942 648 1 -0.8476 15.5171 0.0 46.72394 +1943 648 2 0.4238 16.3335904 0.0 47.301299 +1944 648 2 0.4238 14.7006096 0.0 47.301299 +1945 649 1 -0.8476 15.5171 0.0 49.82736 +1946 649 2 0.4238 16.3335904 0.0 50.404719 +1947 649 2 0.4238 14.7006096 0.0 50.404719 +1948 650 1 -0.8476 15.5171 0.0 52.93078 +1949 650 2 0.4238 16.3335904 0.0 53.508139 +1950 650 2 0.4238 14.7006096 0.0 53.508139 +1951 651 1 -0.8476 15.5171 0.0 56.0342 +1952 651 2 0.4238 16.3335904 0.0 56.611559 +1953 651 2 0.4238 14.7006096 0.0 56.611559 +1954 652 1 -0.8476 15.5171 0.0 59.13762 +1955 652 2 0.4238 16.3335904 0.0 59.714979 +1956 652 2 0.4238 14.7006096 0.0 59.714979 +1957 653 1 -0.8476 15.5171 0.0 62.24104 +1958 653 2 0.4238 16.3335904 0.0 62.818399 +1959 653 2 0.4238 14.7006096 0.0 62.818399 +1960 654 1 -0.8476 15.5171 0.0 65.34446 +1961 654 2 0.4238 16.3335904 0.0 65.921819 +1962 654 2 0.4238 14.7006096 0.0 65.921819 +1963 655 1 -0.8476 15.5171 0.0 68.44788 +1964 655 2 0.4238 16.3335904 0.0 69.025239 +1965 655 2 0.4238 14.7006096 0.0 69.025239 +1966 656 1 -0.8476 15.5171 0.0 71.5513 +1967 656 2 0.4238 16.3335904 0.0 72.128659 +1968 656 2 0.4238 14.7006096 0.0 72.128659 +1969 657 1 -0.8476 15.5171 3.10342 25.0 +1970 657 2 0.4238 16.3335904 3.10342 25.577359 +1971 657 2 0.4238 14.7006096 3.10342 25.577359 +1972 658 1 -0.8476 15.5171 3.10342 28.10342 +1973 658 2 0.4238 16.3335904 3.10342 28.680779 +1974 658 2 0.4238 14.7006096 3.10342 28.680779 +1975 659 1 -0.8476 15.5171 3.10342 31.20684 +1976 659 2 0.4238 16.3335904 3.10342 31.784199 +1977 659 2 0.4238 14.7006096 3.10342 31.784199 +1978 660 1 -0.8476 15.5171 3.10342 34.31026 +1979 660 2 0.4238 16.3335904 3.10342 34.887619 +1980 660 2 0.4238 14.7006096 3.10342 34.887619 +1981 661 1 -0.8476 15.5171 3.10342 37.41368 +1982 661 2 0.4238 16.3335904 3.10342 37.991039 +1983 661 2 0.4238 14.7006096 3.10342 37.991039 +1984 662 1 -0.8476 15.5171 3.10342 40.5171 +1985 662 2 0.4238 16.3335904 3.10342 41.094459 +1986 662 2 0.4238 14.7006096 3.10342 41.094459 +1987 663 1 -0.8476 15.5171 3.10342 43.62052 +1988 663 2 0.4238 16.3335904 3.10342 44.197879 +1989 663 2 0.4238 14.7006096 3.10342 44.197879 +1990 664 1 -0.8476 15.5171 3.10342 46.72394 +1991 664 2 0.4238 16.3335904 3.10342 47.301299 +1992 664 2 0.4238 14.7006096 3.10342 47.301299 +1993 665 1 -0.8476 15.5171 3.10342 49.82736 +1994 665 2 0.4238 16.3335904 3.10342 50.404719 +1995 665 2 0.4238 14.7006096 3.10342 50.404719 +1996 666 1 -0.8476 15.5171 3.10342 52.93078 +1997 666 2 0.4238 16.3335904 3.10342 53.508139 +1998 666 2 0.4238 14.7006096 3.10342 53.508139 +1999 667 1 -0.8476 15.5171 3.10342 56.0342 +2000 667 2 0.4238 16.3335904 3.10342 56.611559 +2001 667 2 0.4238 14.7006096 3.10342 56.611559 +2002 668 1 -0.8476 15.5171 3.10342 59.13762 +2003 668 2 0.4238 16.3335904 3.10342 59.714979 +2004 668 2 0.4238 14.7006096 3.10342 59.714979 +2005 669 1 -0.8476 15.5171 3.10342 62.24104 +2006 669 2 0.4238 16.3335904 3.10342 62.818399 +2007 669 2 0.4238 14.7006096 3.10342 62.818399 +2008 670 1 -0.8476 15.5171 3.10342 65.34446 +2009 670 2 0.4238 16.3335904 3.10342 65.921819 +2010 670 2 0.4238 14.7006096 3.10342 65.921819 +2011 671 1 -0.8476 15.5171 3.10342 68.44788 +2012 671 2 0.4238 16.3335904 3.10342 69.025239 +2013 671 2 0.4238 14.7006096 3.10342 69.025239 +2014 672 1 -0.8476 15.5171 3.10342 71.5513 +2015 672 2 0.4238 16.3335904 3.10342 72.128659 +2016 672 2 0.4238 14.7006096 3.10342 72.128659 +2017 673 1 -0.8476 15.5171 6.20684 25.0 +2018 673 2 0.4238 16.3335904 6.20684 25.577359 +2019 673 2 0.4238 14.7006096 6.20684 25.577359 +2020 674 1 -0.8476 15.5171 6.20684 28.10342 +2021 674 2 0.4238 16.3335904 6.20684 28.680779 +2022 674 2 0.4238 14.7006096 6.20684 28.680779 +2023 675 1 -0.8476 15.5171 6.20684 31.20684 +2024 675 2 0.4238 16.3335904 6.20684 31.784199 +2025 675 2 0.4238 14.7006096 6.20684 31.784199 +2026 676 1 -0.8476 15.5171 6.20684 34.31026 +2027 676 2 0.4238 16.3335904 6.20684 34.887619 +2028 676 2 0.4238 14.7006096 6.20684 34.887619 +2029 677 1 -0.8476 15.5171 6.20684 37.41368 +2030 677 2 0.4238 16.3335904 6.20684 37.991039 +2031 677 2 0.4238 14.7006096 6.20684 37.991039 +2032 678 1 -0.8476 15.5171 6.20684 40.5171 +2033 678 2 0.4238 16.3335904 6.20684 41.094459 +2034 678 2 0.4238 14.7006096 6.20684 41.094459 +2035 679 1 -0.8476 15.5171 6.20684 43.62052 +2036 679 2 0.4238 16.3335904 6.20684 44.197879 +2037 679 2 0.4238 14.7006096 6.20684 44.197879 +2038 680 1 -0.8476 15.5171 6.20684 46.72394 +2039 680 2 0.4238 16.3335904 6.20684 47.301299 +2040 680 2 0.4238 14.7006096 6.20684 47.301299 +2041 681 1 -0.8476 15.5171 6.20684 49.82736 +2042 681 2 0.4238 16.3335904 6.20684 50.404719 +2043 681 2 0.4238 14.7006096 6.20684 50.404719 +2044 682 1 -0.8476 15.5171 6.20684 52.93078 +2045 682 2 0.4238 16.3335904 6.20684 53.508139 +2046 682 2 0.4238 14.7006096 6.20684 53.508139 +2047 683 1 -0.8476 15.5171 6.20684 56.0342 +2048 683 2 0.4238 16.3335904 6.20684 56.611559 +2049 683 2 0.4238 14.7006096 6.20684 56.611559 +2050 684 1 -0.8476 15.5171 6.20684 59.13762 +2051 684 2 0.4238 16.3335904 6.20684 59.714979 +2052 684 2 0.4238 14.7006096 6.20684 59.714979 +2053 685 1 -0.8476 15.5171 6.20684 62.24104 +2054 685 2 0.4238 16.3335904 6.20684 62.818399 +2055 685 2 0.4238 14.7006096 6.20684 62.818399 +2056 686 1 -0.8476 15.5171 6.20684 65.34446 +2057 686 2 0.4238 16.3335904 6.20684 65.921819 +2058 686 2 0.4238 14.7006096 6.20684 65.921819 +2059 687 1 -0.8476 15.5171 6.20684 68.44788 +2060 687 2 0.4238 16.3335904 6.20684 69.025239 +2061 687 2 0.4238 14.7006096 6.20684 69.025239 +2062 688 1 -0.8476 15.5171 6.20684 71.5513 +2063 688 2 0.4238 16.3335904 6.20684 72.128659 +2064 688 2 0.4238 14.7006096 6.20684 72.128659 +2065 689 1 -0.8476 15.5171 9.31026 25.0 +2066 689 2 0.4238 16.3335904 9.31026 25.577359 +2067 689 2 0.4238 14.7006096 9.31026 25.577359 +2068 690 1 -0.8476 15.5171 9.31026 28.10342 +2069 690 2 0.4238 16.3335904 9.31026 28.680779 +2070 690 2 0.4238 14.7006096 9.31026 28.680779 +2071 691 1 -0.8476 15.5171 9.31026 31.20684 +2072 691 2 0.4238 16.3335904 9.31026 31.784199 +2073 691 2 0.4238 14.7006096 9.31026 31.784199 +2074 692 1 -0.8476 15.5171 9.31026 34.31026 +2075 692 2 0.4238 16.3335904 9.31026 34.887619 +2076 692 2 0.4238 14.7006096 9.31026 34.887619 +2077 693 1 -0.8476 15.5171 9.31026 37.41368 +2078 693 2 0.4238 16.3335904 9.31026 37.991039 +2079 693 2 0.4238 14.7006096 9.31026 37.991039 +2080 694 1 -0.8476 15.5171 9.31026 40.5171 +2081 694 2 0.4238 16.3335904 9.31026 41.094459 +2082 694 2 0.4238 14.7006096 9.31026 41.094459 +2083 695 1 -0.8476 15.5171 9.31026 43.62052 +2084 695 2 0.4238 16.3335904 9.31026 44.197879 +2085 695 2 0.4238 14.7006096 9.31026 44.197879 +2086 696 1 -0.8476 15.5171 9.31026 46.72394 +2087 696 2 0.4238 16.3335904 9.31026 47.301299 +2088 696 2 0.4238 14.7006096 9.31026 47.301299 +2089 697 1 -0.8476 15.5171 9.31026 49.82736 +2090 697 2 0.4238 16.3335904 9.31026 50.404719 +2091 697 2 0.4238 14.7006096 9.31026 50.404719 +2092 698 1 -0.8476 15.5171 9.31026 52.93078 +2093 698 2 0.4238 16.3335904 9.31026 53.508139 +2094 698 2 0.4238 14.7006096 9.31026 53.508139 +2095 699 1 -0.8476 15.5171 9.31026 56.0342 +2096 699 2 0.4238 16.3335904 9.31026 56.611559 +2097 699 2 0.4238 14.7006096 9.31026 56.611559 +2098 700 1 -0.8476 15.5171 9.31026 59.13762 +2099 700 2 0.4238 16.3335904 9.31026 59.714979 +2100 700 2 0.4238 14.7006096 9.31026 59.714979 +2101 701 1 -0.8476 15.5171 9.31026 62.24104 +2102 701 2 0.4238 16.3335904 9.31026 62.818399 +2103 701 2 0.4238 14.7006096 9.31026 62.818399 +2104 702 1 -0.8476 15.5171 9.31026 65.34446 +2105 702 2 0.4238 16.3335904 9.31026 65.921819 +2106 702 2 0.4238 14.7006096 9.31026 65.921819 +2107 703 1 -0.8476 15.5171 9.31026 68.44788 +2108 703 2 0.4238 16.3335904 9.31026 69.025239 +2109 703 2 0.4238 14.7006096 9.31026 69.025239 +2110 704 1 -0.8476 15.5171 9.31026 71.5513 +2111 704 2 0.4238 16.3335904 9.31026 72.128659 +2112 704 2 0.4238 14.7006096 9.31026 72.128659 +2113 705 1 -0.8476 15.5171 12.41368 25.0 +2114 705 2 0.4238 16.3335904 12.41368 25.577359 +2115 705 2 0.4238 14.7006096 12.41368 25.577359 +2116 706 1 -0.8476 15.5171 12.41368 28.10342 +2117 706 2 0.4238 16.3335904 12.41368 28.680779 +2118 706 2 0.4238 14.7006096 12.41368 28.680779 +2119 707 1 -0.8476 15.5171 12.41368 31.20684 +2120 707 2 0.4238 16.3335904 12.41368 31.784199 +2121 707 2 0.4238 14.7006096 12.41368 31.784199 +2122 708 1 -0.8476 15.5171 12.41368 34.31026 +2123 708 2 0.4238 16.3335904 12.41368 34.887619 +2124 708 2 0.4238 14.7006096 12.41368 34.887619 +2125 709 1 -0.8476 15.5171 12.41368 37.41368 +2126 709 2 0.4238 16.3335904 12.41368 37.991039 +2127 709 2 0.4238 14.7006096 12.41368 37.991039 +2128 710 1 -0.8476 15.5171 12.41368 40.5171 +2129 710 2 0.4238 16.3335904 12.41368 41.094459 +2130 710 2 0.4238 14.7006096 12.41368 41.094459 +2131 711 1 -0.8476 15.5171 12.41368 43.62052 +2132 711 2 0.4238 16.3335904 12.41368 44.197879 +2133 711 2 0.4238 14.7006096 12.41368 44.197879 +2134 712 1 -0.8476 15.5171 12.41368 46.72394 +2135 712 2 0.4238 16.3335904 12.41368 47.301299 +2136 712 2 0.4238 14.7006096 12.41368 47.301299 +2137 713 1 -0.8476 15.5171 12.41368 49.82736 +2138 713 2 0.4238 16.3335904 12.41368 50.404719 +2139 713 2 0.4238 14.7006096 12.41368 50.404719 +2140 714 1 -0.8476 15.5171 12.41368 52.93078 +2141 714 2 0.4238 16.3335904 12.41368 53.508139 +2142 714 2 0.4238 14.7006096 12.41368 53.508139 +2143 715 1 -0.8476 15.5171 12.41368 56.0342 +2144 715 2 0.4238 16.3335904 12.41368 56.611559 +2145 715 2 0.4238 14.7006096 12.41368 56.611559 +2146 716 1 -0.8476 15.5171 12.41368 59.13762 +2147 716 2 0.4238 16.3335904 12.41368 59.714979 +2148 716 2 0.4238 14.7006096 12.41368 59.714979 +2149 717 1 -0.8476 15.5171 12.41368 62.24104 +2150 717 2 0.4238 16.3335904 12.41368 62.818399 +2151 717 2 0.4238 14.7006096 12.41368 62.818399 +2152 718 1 -0.8476 15.5171 12.41368 65.34446 +2153 718 2 0.4238 16.3335904 12.41368 65.921819 +2154 718 2 0.4238 14.7006096 12.41368 65.921819 +2155 719 1 -0.8476 15.5171 12.41368 68.44788 +2156 719 2 0.4238 16.3335904 12.41368 69.025239 +2157 719 2 0.4238 14.7006096 12.41368 69.025239 +2158 720 1 -0.8476 15.5171 12.41368 71.5513 +2159 720 2 0.4238 16.3335904 12.41368 72.128659 +2160 720 2 0.4238 14.7006096 12.41368 72.128659 +2161 721 1 -0.8476 15.5171 15.5171 25.0 +2162 721 2 0.4238 16.3335904 15.5171 25.577359 +2163 721 2 0.4238 14.7006096 15.5171 25.577359 +2164 722 1 -0.8476 15.5171 15.5171 28.10342 +2165 722 2 0.4238 16.3335904 15.5171 28.680779 +2166 722 2 0.4238 14.7006096 15.5171 28.680779 +2167 723 1 -0.8476 15.5171 15.5171 31.20684 +2168 723 2 0.4238 16.3335904 15.5171 31.784199 +2169 723 2 0.4238 14.7006096 15.5171 31.784199 +2170 724 1 -0.8476 15.5171 15.5171 34.31026 +2171 724 2 0.4238 16.3335904 15.5171 34.887619 +2172 724 2 0.4238 14.7006096 15.5171 34.887619 +2173 725 1 -0.8476 15.5171 15.5171 37.41368 +2174 725 2 0.4238 16.3335904 15.5171 37.991039 +2175 725 2 0.4238 14.7006096 15.5171 37.991039 +2176 726 1 -0.8476 15.5171 15.5171 40.5171 +2177 726 2 0.4238 16.3335904 15.5171 41.094459 +2178 726 2 0.4238 14.7006096 15.5171 41.094459 +2179 727 1 -0.8476 15.5171 15.5171 43.62052 +2180 727 2 0.4238 16.3335904 15.5171 44.197879 +2181 727 2 0.4238 14.7006096 15.5171 44.197879 +2182 728 1 -0.8476 15.5171 15.5171 46.72394 +2183 728 2 0.4238 16.3335904 15.5171 47.301299 +2184 728 2 0.4238 14.7006096 15.5171 47.301299 +2185 729 1 -0.8476 15.5171 15.5171 49.82736 +2186 729 2 0.4238 16.3335904 15.5171 50.404719 +2187 729 2 0.4238 14.7006096 15.5171 50.404719 +2188 730 1 -0.8476 15.5171 15.5171 52.93078 +2189 730 2 0.4238 16.3335904 15.5171 53.508139 +2190 730 2 0.4238 14.7006096 15.5171 53.508139 +2191 731 1 -0.8476 15.5171 15.5171 56.0342 +2192 731 2 0.4238 16.3335904 15.5171 56.611559 +2193 731 2 0.4238 14.7006096 15.5171 56.611559 +2194 732 1 -0.8476 15.5171 15.5171 59.13762 +2195 732 2 0.4238 16.3335904 15.5171 59.714979 +2196 732 2 0.4238 14.7006096 15.5171 59.714979 +2197 733 1 -0.8476 15.5171 15.5171 62.24104 +2198 733 2 0.4238 16.3335904 15.5171 62.818399 +2199 733 2 0.4238 14.7006096 15.5171 62.818399 +2200 734 1 -0.8476 15.5171 15.5171 65.34446 +2201 734 2 0.4238 16.3335904 15.5171 65.921819 +2202 734 2 0.4238 14.7006096 15.5171 65.921819 +2203 735 1 -0.8476 15.5171 15.5171 68.44788 +2204 735 2 0.4238 16.3335904 15.5171 69.025239 +2205 735 2 0.4238 14.7006096 15.5171 69.025239 +2206 736 1 -0.8476 15.5171 15.5171 71.5513 +2207 736 2 0.4238 16.3335904 15.5171 72.128659 +2208 736 2 0.4238 14.7006096 15.5171 72.128659 +2209 737 1 -0.8476 15.5171 18.62052 25.0 +2210 737 2 0.4238 16.3335904 18.62052 25.577359 +2211 737 2 0.4238 14.7006096 18.62052 25.577359 +2212 738 1 -0.8476 15.5171 18.62052 28.10342 +2213 738 2 0.4238 16.3335904 18.62052 28.680779 +2214 738 2 0.4238 14.7006096 18.62052 28.680779 +2215 739 1 -0.8476 15.5171 18.62052 31.20684 +2216 739 2 0.4238 16.3335904 18.62052 31.784199 +2217 739 2 0.4238 14.7006096 18.62052 31.784199 +2218 740 1 -0.8476 15.5171 18.62052 34.31026 +2219 740 2 0.4238 16.3335904 18.62052 34.887619 +2220 740 2 0.4238 14.7006096 18.62052 34.887619 +2221 741 1 -0.8476 15.5171 18.62052 37.41368 +2222 741 2 0.4238 16.3335904 18.62052 37.991039 +2223 741 2 0.4238 14.7006096 18.62052 37.991039 +2224 742 1 -0.8476 15.5171 18.62052 40.5171 +2225 742 2 0.4238 16.3335904 18.62052 41.094459 +2226 742 2 0.4238 14.7006096 18.62052 41.094459 +2227 743 1 -0.8476 15.5171 18.62052 43.62052 +2228 743 2 0.4238 16.3335904 18.62052 44.197879 +2229 743 2 0.4238 14.7006096 18.62052 44.197879 +2230 744 1 -0.8476 15.5171 18.62052 46.72394 +2231 744 2 0.4238 16.3335904 18.62052 47.301299 +2232 744 2 0.4238 14.7006096 18.62052 47.301299 +2233 745 1 -0.8476 15.5171 18.62052 49.82736 +2234 745 2 0.4238 16.3335904 18.62052 50.404719 +2235 745 2 0.4238 14.7006096 18.62052 50.404719 +2236 746 1 -0.8476 15.5171 18.62052 52.93078 +2237 746 2 0.4238 16.3335904 18.62052 53.508139 +2238 746 2 0.4238 14.7006096 18.62052 53.508139 +2239 747 1 -0.8476 15.5171 18.62052 56.0342 +2240 747 2 0.4238 16.3335904 18.62052 56.611559 +2241 747 2 0.4238 14.7006096 18.62052 56.611559 +2242 748 1 -0.8476 15.5171 18.62052 59.13762 +2243 748 2 0.4238 16.3335904 18.62052 59.714979 +2244 748 2 0.4238 14.7006096 18.62052 59.714979 +2245 749 1 -0.8476 15.5171 18.62052 62.24104 +2246 749 2 0.4238 16.3335904 18.62052 62.818399 +2247 749 2 0.4238 14.7006096 18.62052 62.818399 +2248 750 1 -0.8476 15.5171 18.62052 65.34446 +2249 750 2 0.4238 16.3335904 18.62052 65.921819 +2250 750 2 0.4238 14.7006096 18.62052 65.921819 +2251 751 1 -0.8476 15.5171 18.62052 68.44788 +2252 751 2 0.4238 16.3335904 18.62052 69.025239 +2253 751 2 0.4238 14.7006096 18.62052 69.025239 +2254 752 1 -0.8476 15.5171 18.62052 71.5513 +2255 752 2 0.4238 16.3335904 18.62052 72.128659 +2256 752 2 0.4238 14.7006096 18.62052 72.128659 +2257 753 1 -0.8476 15.5171 21.72394 25.0 +2258 753 2 0.4238 16.3335904 21.72394 25.577359 +2259 753 2 0.4238 14.7006096 21.72394 25.577359 +2260 754 1 -0.8476 15.5171 21.72394 28.10342 +2261 754 2 0.4238 16.3335904 21.72394 28.680779 +2262 754 2 0.4238 14.7006096 21.72394 28.680779 +2263 755 1 -0.8476 15.5171 21.72394 31.20684 +2264 755 2 0.4238 16.3335904 21.72394 31.784199 +2265 755 2 0.4238 14.7006096 21.72394 31.784199 +2266 756 1 -0.8476 15.5171 21.72394 34.31026 +2267 756 2 0.4238 16.3335904 21.72394 34.887619 +2268 756 2 0.4238 14.7006096 21.72394 34.887619 +2269 757 1 -0.8476 15.5171 21.72394 37.41368 +2270 757 2 0.4238 16.3335904 21.72394 37.991039 +2271 757 2 0.4238 14.7006096 21.72394 37.991039 +2272 758 1 -0.8476 15.5171 21.72394 40.5171 +2273 758 2 0.4238 16.3335904 21.72394 41.094459 +2274 758 2 0.4238 14.7006096 21.72394 41.094459 +2275 759 1 -0.8476 15.5171 21.72394 43.62052 +2276 759 2 0.4238 16.3335904 21.72394 44.197879 +2277 759 2 0.4238 14.7006096 21.72394 44.197879 +2278 760 1 -0.8476 15.5171 21.72394 46.72394 +2279 760 2 0.4238 16.3335904 21.72394 47.301299 +2280 760 2 0.4238 14.7006096 21.72394 47.301299 +2281 761 1 -0.8476 15.5171 21.72394 49.82736 +2282 761 2 0.4238 16.3335904 21.72394 50.404719 +2283 761 2 0.4238 14.7006096 21.72394 50.404719 +2284 762 1 -0.8476 15.5171 21.72394 52.93078 +2285 762 2 0.4238 16.3335904 21.72394 53.508139 +2286 762 2 0.4238 14.7006096 21.72394 53.508139 +2287 763 1 -0.8476 15.5171 21.72394 56.0342 +2288 763 2 0.4238 16.3335904 21.72394 56.611559 +2289 763 2 0.4238 14.7006096 21.72394 56.611559 +2290 764 1 -0.8476 15.5171 21.72394 59.13762 +2291 764 2 0.4238 16.3335904 21.72394 59.714979 +2292 764 2 0.4238 14.7006096 21.72394 59.714979 +2293 765 1 -0.8476 15.5171 21.72394 62.24104 +2294 765 2 0.4238 16.3335904 21.72394 62.818399 +2295 765 2 0.4238 14.7006096 21.72394 62.818399 +2296 766 1 -0.8476 15.5171 21.72394 65.34446 +2297 766 2 0.4238 16.3335904 21.72394 65.921819 +2298 766 2 0.4238 14.7006096 21.72394 65.921819 +2299 767 1 -0.8476 15.5171 21.72394 68.44788 +2300 767 2 0.4238 16.3335904 21.72394 69.025239 +2301 767 2 0.4238 14.7006096 21.72394 69.025239 +2302 768 1 -0.8476 15.5171 21.72394 71.5513 +2303 768 2 0.4238 16.3335904 21.72394 72.128659 +2304 768 2 0.4238 14.7006096 21.72394 72.128659 +2305 769 1 -0.8476 18.62052 0.0 25.0 +2306 769 2 0.4238 19.4370104 0.0 25.577359 +2307 769 2 0.4238 17.8040296 0.0 25.577359 +2308 770 1 -0.8476 18.62052 0.0 28.10342 +2309 770 2 0.4238 19.4370104 0.0 28.680779 +2310 770 2 0.4238 17.8040296 0.0 28.680779 +2311 771 1 -0.8476 18.62052 0.0 31.20684 +2312 771 2 0.4238 19.4370104 0.0 31.784199 +2313 771 2 0.4238 17.8040296 0.0 31.784199 +2314 772 1 -0.8476 18.62052 0.0 34.31026 +2315 772 2 0.4238 19.4370104 0.0 34.887619 +2316 772 2 0.4238 17.8040296 0.0 34.887619 +2317 773 1 -0.8476 18.62052 0.0 37.41368 +2318 773 2 0.4238 19.4370104 0.0 37.991039 +2319 773 2 0.4238 17.8040296 0.0 37.991039 +2320 774 1 -0.8476 18.62052 0.0 40.5171 +2321 774 2 0.4238 19.4370104 0.0 41.094459 +2322 774 2 0.4238 17.8040296 0.0 41.094459 +2323 775 1 -0.8476 18.62052 0.0 43.62052 +2324 775 2 0.4238 19.4370104 0.0 44.197879 +2325 775 2 0.4238 17.8040296 0.0 44.197879 +2326 776 1 -0.8476 18.62052 0.0 46.72394 +2327 776 2 0.4238 19.4370104 0.0 47.301299 +2328 776 2 0.4238 17.8040296 0.0 47.301299 +2329 777 1 -0.8476 18.62052 0.0 49.82736 +2330 777 2 0.4238 19.4370104 0.0 50.404719 +2331 777 2 0.4238 17.8040296 0.0 50.404719 +2332 778 1 -0.8476 18.62052 0.0 52.93078 +2333 778 2 0.4238 19.4370104 0.0 53.508139 +2334 778 2 0.4238 17.8040296 0.0 53.508139 +2335 779 1 -0.8476 18.62052 0.0 56.0342 +2336 779 2 0.4238 19.4370104 0.0 56.611559 +2337 779 2 0.4238 17.8040296 0.0 56.611559 +2338 780 1 -0.8476 18.62052 0.0 59.13762 +2339 780 2 0.4238 19.4370104 0.0 59.714979 +2340 780 2 0.4238 17.8040296 0.0 59.714979 +2341 781 1 -0.8476 18.62052 0.0 62.24104 +2342 781 2 0.4238 19.4370104 0.0 62.818399 +2343 781 2 0.4238 17.8040296 0.0 62.818399 +2344 782 1 -0.8476 18.62052 0.0 65.34446 +2345 782 2 0.4238 19.4370104 0.0 65.921819 +2346 782 2 0.4238 17.8040296 0.0 65.921819 +2347 783 1 -0.8476 18.62052 0.0 68.44788 +2348 783 2 0.4238 19.4370104 0.0 69.025239 +2349 783 2 0.4238 17.8040296 0.0 69.025239 +2350 784 1 -0.8476 18.62052 0.0 71.5513 +2351 784 2 0.4238 19.4370104 0.0 72.128659 +2352 784 2 0.4238 17.8040296 0.0 72.128659 +2353 785 1 -0.8476 18.62052 3.10342 25.0 +2354 785 2 0.4238 19.4370104 3.10342 25.577359 +2355 785 2 0.4238 17.8040296 3.10342 25.577359 +2356 786 1 -0.8476 18.62052 3.10342 28.10342 +2357 786 2 0.4238 19.4370104 3.10342 28.680779 +2358 786 2 0.4238 17.8040296 3.10342 28.680779 +2359 787 1 -0.8476 18.62052 3.10342 31.20684 +2360 787 2 0.4238 19.4370104 3.10342 31.784199 +2361 787 2 0.4238 17.8040296 3.10342 31.784199 +2362 788 1 -0.8476 18.62052 3.10342 34.31026 +2363 788 2 0.4238 19.4370104 3.10342 34.887619 +2364 788 2 0.4238 17.8040296 3.10342 34.887619 +2365 789 1 -0.8476 18.62052 3.10342 37.41368 +2366 789 2 0.4238 19.4370104 3.10342 37.991039 +2367 789 2 0.4238 17.8040296 3.10342 37.991039 +2368 790 1 -0.8476 18.62052 3.10342 40.5171 +2369 790 2 0.4238 19.4370104 3.10342 41.094459 +2370 790 2 0.4238 17.8040296 3.10342 41.094459 +2371 791 1 -0.8476 18.62052 3.10342 43.62052 +2372 791 2 0.4238 19.4370104 3.10342 44.197879 +2373 791 2 0.4238 17.8040296 3.10342 44.197879 +2374 792 1 -0.8476 18.62052 3.10342 46.72394 +2375 792 2 0.4238 19.4370104 3.10342 47.301299 +2376 792 2 0.4238 17.8040296 3.10342 47.301299 +2377 793 1 -0.8476 18.62052 3.10342 49.82736 +2378 793 2 0.4238 19.4370104 3.10342 50.404719 +2379 793 2 0.4238 17.8040296 3.10342 50.404719 +2380 794 1 -0.8476 18.62052 3.10342 52.93078 +2381 794 2 0.4238 19.4370104 3.10342 53.508139 +2382 794 2 0.4238 17.8040296 3.10342 53.508139 +2383 795 1 -0.8476 18.62052 3.10342 56.0342 +2384 795 2 0.4238 19.4370104 3.10342 56.611559 +2385 795 2 0.4238 17.8040296 3.10342 56.611559 +2386 796 1 -0.8476 18.62052 3.10342 59.13762 +2387 796 2 0.4238 19.4370104 3.10342 59.714979 +2388 796 2 0.4238 17.8040296 3.10342 59.714979 +2389 797 1 -0.8476 18.62052 3.10342 62.24104 +2390 797 2 0.4238 19.4370104 3.10342 62.818399 +2391 797 2 0.4238 17.8040296 3.10342 62.818399 +2392 798 1 -0.8476 18.62052 3.10342 65.34446 +2393 798 2 0.4238 19.4370104 3.10342 65.921819 +2394 798 2 0.4238 17.8040296 3.10342 65.921819 +2395 799 1 -0.8476 18.62052 3.10342 68.44788 +2396 799 2 0.4238 19.4370104 3.10342 69.025239 +2397 799 2 0.4238 17.8040296 3.10342 69.025239 +2398 800 1 -0.8476 18.62052 3.10342 71.5513 +2399 800 2 0.4238 19.4370104 3.10342 72.128659 +2400 800 2 0.4238 17.8040296 3.10342 72.128659 +2401 801 1 -0.8476 18.62052 6.20684 25.0 +2402 801 2 0.4238 19.4370104 6.20684 25.577359 +2403 801 2 0.4238 17.8040296 6.20684 25.577359 +2404 802 1 -0.8476 18.62052 6.20684 28.10342 +2405 802 2 0.4238 19.4370104 6.20684 28.680779 +2406 802 2 0.4238 17.8040296 6.20684 28.680779 +2407 803 1 -0.8476 18.62052 6.20684 31.20684 +2408 803 2 0.4238 19.4370104 6.20684 31.784199 +2409 803 2 0.4238 17.8040296 6.20684 31.784199 +2410 804 1 -0.8476 18.62052 6.20684 34.31026 +2411 804 2 0.4238 19.4370104 6.20684 34.887619 +2412 804 2 0.4238 17.8040296 6.20684 34.887619 +2413 805 1 -0.8476 18.62052 6.20684 37.41368 +2414 805 2 0.4238 19.4370104 6.20684 37.991039 +2415 805 2 0.4238 17.8040296 6.20684 37.991039 +2416 806 1 -0.8476 18.62052 6.20684 40.5171 +2417 806 2 0.4238 19.4370104 6.20684 41.094459 +2418 806 2 0.4238 17.8040296 6.20684 41.094459 +2419 807 1 -0.8476 18.62052 6.20684 43.62052 +2420 807 2 0.4238 19.4370104 6.20684 44.197879 +2421 807 2 0.4238 17.8040296 6.20684 44.197879 +2422 808 1 -0.8476 18.62052 6.20684 46.72394 +2423 808 2 0.4238 19.4370104 6.20684 47.301299 +2424 808 2 0.4238 17.8040296 6.20684 47.301299 +2425 809 1 -0.8476 18.62052 6.20684 49.82736 +2426 809 2 0.4238 19.4370104 6.20684 50.404719 +2427 809 2 0.4238 17.8040296 6.20684 50.404719 +2428 810 1 -0.8476 18.62052 6.20684 52.93078 +2429 810 2 0.4238 19.4370104 6.20684 53.508139 +2430 810 2 0.4238 17.8040296 6.20684 53.508139 +2431 811 1 -0.8476 18.62052 6.20684 56.0342 +2432 811 2 0.4238 19.4370104 6.20684 56.611559 +2433 811 2 0.4238 17.8040296 6.20684 56.611559 +2434 812 1 -0.8476 18.62052 6.20684 59.13762 +2435 812 2 0.4238 19.4370104 6.20684 59.714979 +2436 812 2 0.4238 17.8040296 6.20684 59.714979 +2437 813 1 -0.8476 18.62052 6.20684 62.24104 +2438 813 2 0.4238 19.4370104 6.20684 62.818399 +2439 813 2 0.4238 17.8040296 6.20684 62.818399 +2440 814 1 -0.8476 18.62052 6.20684 65.34446 +2441 814 2 0.4238 19.4370104 6.20684 65.921819 +2442 814 2 0.4238 17.8040296 6.20684 65.921819 +2443 815 1 -0.8476 18.62052 6.20684 68.44788 +2444 815 2 0.4238 19.4370104 6.20684 69.025239 +2445 815 2 0.4238 17.8040296 6.20684 69.025239 +2446 816 1 -0.8476 18.62052 6.20684 71.5513 +2447 816 2 0.4238 19.4370104 6.20684 72.128659 +2448 816 2 0.4238 17.8040296 6.20684 72.128659 +2449 817 1 -0.8476 18.62052 9.31026 25.0 +2450 817 2 0.4238 19.4370104 9.31026 25.577359 +2451 817 2 0.4238 17.8040296 9.31026 25.577359 +2452 818 1 -0.8476 18.62052 9.31026 28.10342 +2453 818 2 0.4238 19.4370104 9.31026 28.680779 +2454 818 2 0.4238 17.8040296 9.31026 28.680779 +2455 819 1 -0.8476 18.62052 9.31026 31.20684 +2456 819 2 0.4238 19.4370104 9.31026 31.784199 +2457 819 2 0.4238 17.8040296 9.31026 31.784199 +2458 820 1 -0.8476 18.62052 9.31026 34.31026 +2459 820 2 0.4238 19.4370104 9.31026 34.887619 +2460 820 2 0.4238 17.8040296 9.31026 34.887619 +2461 821 1 -0.8476 18.62052 9.31026 37.41368 +2462 821 2 0.4238 19.4370104 9.31026 37.991039 +2463 821 2 0.4238 17.8040296 9.31026 37.991039 +2464 822 1 -0.8476 18.62052 9.31026 40.5171 +2465 822 2 0.4238 19.4370104 9.31026 41.094459 +2466 822 2 0.4238 17.8040296 9.31026 41.094459 +2467 823 1 -0.8476 18.62052 9.31026 43.62052 +2468 823 2 0.4238 19.4370104 9.31026 44.197879 +2469 823 2 0.4238 17.8040296 9.31026 44.197879 +2470 824 1 -0.8476 18.62052 9.31026 46.72394 +2471 824 2 0.4238 19.4370104 9.31026 47.301299 +2472 824 2 0.4238 17.8040296 9.31026 47.301299 +2473 825 1 -0.8476 18.62052 9.31026 49.82736 +2474 825 2 0.4238 19.4370104 9.31026 50.404719 +2475 825 2 0.4238 17.8040296 9.31026 50.404719 +2476 826 1 -0.8476 18.62052 9.31026 52.93078 +2477 826 2 0.4238 19.4370104 9.31026 53.508139 +2478 826 2 0.4238 17.8040296 9.31026 53.508139 +2479 827 1 -0.8476 18.62052 9.31026 56.0342 +2480 827 2 0.4238 19.4370104 9.31026 56.611559 +2481 827 2 0.4238 17.8040296 9.31026 56.611559 +2482 828 1 -0.8476 18.62052 9.31026 59.13762 +2483 828 2 0.4238 19.4370104 9.31026 59.714979 +2484 828 2 0.4238 17.8040296 9.31026 59.714979 +2485 829 1 -0.8476 18.62052 9.31026 62.24104 +2486 829 2 0.4238 19.4370104 9.31026 62.818399 +2487 829 2 0.4238 17.8040296 9.31026 62.818399 +2488 830 1 -0.8476 18.62052 9.31026 65.34446 +2489 830 2 0.4238 19.4370104 9.31026 65.921819 +2490 830 2 0.4238 17.8040296 9.31026 65.921819 +2491 831 1 -0.8476 18.62052 9.31026 68.44788 +2492 831 2 0.4238 19.4370104 9.31026 69.025239 +2493 831 2 0.4238 17.8040296 9.31026 69.025239 +2494 832 1 -0.8476 18.62052 9.31026 71.5513 +2495 832 2 0.4238 19.4370104 9.31026 72.128659 +2496 832 2 0.4238 17.8040296 9.31026 72.128659 +2497 833 1 -0.8476 18.62052 12.41368 25.0 +2498 833 2 0.4238 19.4370104 12.41368 25.577359 +2499 833 2 0.4238 17.8040296 12.41368 25.577359 +2500 834 1 -0.8476 18.62052 12.41368 28.10342 +2501 834 2 0.4238 19.4370104 12.41368 28.680779 +2502 834 2 0.4238 17.8040296 12.41368 28.680779 +2503 835 1 -0.8476 18.62052 12.41368 31.20684 +2504 835 2 0.4238 19.4370104 12.41368 31.784199 +2505 835 2 0.4238 17.8040296 12.41368 31.784199 +2506 836 1 -0.8476 18.62052 12.41368 34.31026 +2507 836 2 0.4238 19.4370104 12.41368 34.887619 +2508 836 2 0.4238 17.8040296 12.41368 34.887619 +2509 837 1 -0.8476 18.62052 12.41368 37.41368 +2510 837 2 0.4238 19.4370104 12.41368 37.991039 +2511 837 2 0.4238 17.8040296 12.41368 37.991039 +2512 838 1 -0.8476 18.62052 12.41368 40.5171 +2513 838 2 0.4238 19.4370104 12.41368 41.094459 +2514 838 2 0.4238 17.8040296 12.41368 41.094459 +2515 839 1 -0.8476 18.62052 12.41368 43.62052 +2516 839 2 0.4238 19.4370104 12.41368 44.197879 +2517 839 2 0.4238 17.8040296 12.41368 44.197879 +2518 840 1 -0.8476 18.62052 12.41368 46.72394 +2519 840 2 0.4238 19.4370104 12.41368 47.301299 +2520 840 2 0.4238 17.8040296 12.41368 47.301299 +2521 841 1 -0.8476 18.62052 12.41368 49.82736 +2522 841 2 0.4238 19.4370104 12.41368 50.404719 +2523 841 2 0.4238 17.8040296 12.41368 50.404719 +2524 842 1 -0.8476 18.62052 12.41368 52.93078 +2525 842 2 0.4238 19.4370104 12.41368 53.508139 +2526 842 2 0.4238 17.8040296 12.41368 53.508139 +2527 843 1 -0.8476 18.62052 12.41368 56.0342 +2528 843 2 0.4238 19.4370104 12.41368 56.611559 +2529 843 2 0.4238 17.8040296 12.41368 56.611559 +2530 844 1 -0.8476 18.62052 12.41368 59.13762 +2531 844 2 0.4238 19.4370104 12.41368 59.714979 +2532 844 2 0.4238 17.8040296 12.41368 59.714979 +2533 845 1 -0.8476 18.62052 12.41368 62.24104 +2534 845 2 0.4238 19.4370104 12.41368 62.818399 +2535 845 2 0.4238 17.8040296 12.41368 62.818399 +2536 846 1 -0.8476 18.62052 12.41368 65.34446 +2537 846 2 0.4238 19.4370104 12.41368 65.921819 +2538 846 2 0.4238 17.8040296 12.41368 65.921819 +2539 847 1 -0.8476 18.62052 12.41368 68.44788 +2540 847 2 0.4238 19.4370104 12.41368 69.025239 +2541 847 2 0.4238 17.8040296 12.41368 69.025239 +2542 848 1 -0.8476 18.62052 12.41368 71.5513 +2543 848 2 0.4238 19.4370104 12.41368 72.128659 +2544 848 2 0.4238 17.8040296 12.41368 72.128659 +2545 849 1 -0.8476 18.62052 15.5171 25.0 +2546 849 2 0.4238 19.4370104 15.5171 25.577359 +2547 849 2 0.4238 17.8040296 15.5171 25.577359 +2548 850 1 -0.8476 18.62052 15.5171 28.10342 +2549 850 2 0.4238 19.4370104 15.5171 28.680779 +2550 850 2 0.4238 17.8040296 15.5171 28.680779 +2551 851 1 -0.8476 18.62052 15.5171 31.20684 +2552 851 2 0.4238 19.4370104 15.5171 31.784199 +2553 851 2 0.4238 17.8040296 15.5171 31.784199 +2554 852 1 -0.8476 18.62052 15.5171 34.31026 +2555 852 2 0.4238 19.4370104 15.5171 34.887619 +2556 852 2 0.4238 17.8040296 15.5171 34.887619 +2557 853 1 -0.8476 18.62052 15.5171 37.41368 +2558 853 2 0.4238 19.4370104 15.5171 37.991039 +2559 853 2 0.4238 17.8040296 15.5171 37.991039 +2560 854 1 -0.8476 18.62052 15.5171 40.5171 +2561 854 2 0.4238 19.4370104 15.5171 41.094459 +2562 854 2 0.4238 17.8040296 15.5171 41.094459 +2563 855 1 -0.8476 18.62052 15.5171 43.62052 +2564 855 2 0.4238 19.4370104 15.5171 44.197879 +2565 855 2 0.4238 17.8040296 15.5171 44.197879 +2566 856 1 -0.8476 18.62052 15.5171 46.72394 +2567 856 2 0.4238 19.4370104 15.5171 47.301299 +2568 856 2 0.4238 17.8040296 15.5171 47.301299 +2569 857 1 -0.8476 18.62052 15.5171 49.82736 +2570 857 2 0.4238 19.4370104 15.5171 50.404719 +2571 857 2 0.4238 17.8040296 15.5171 50.404719 +2572 858 1 -0.8476 18.62052 15.5171 52.93078 +2573 858 2 0.4238 19.4370104 15.5171 53.508139 +2574 858 2 0.4238 17.8040296 15.5171 53.508139 +2575 859 1 -0.8476 18.62052 15.5171 56.0342 +2576 859 2 0.4238 19.4370104 15.5171 56.611559 +2577 859 2 0.4238 17.8040296 15.5171 56.611559 +2578 860 1 -0.8476 18.62052 15.5171 59.13762 +2579 860 2 0.4238 19.4370104 15.5171 59.714979 +2580 860 2 0.4238 17.8040296 15.5171 59.714979 +2581 861 1 -0.8476 18.62052 15.5171 62.24104 +2582 861 2 0.4238 19.4370104 15.5171 62.818399 +2583 861 2 0.4238 17.8040296 15.5171 62.818399 +2584 862 1 -0.8476 18.62052 15.5171 65.34446 +2585 862 2 0.4238 19.4370104 15.5171 65.921819 +2586 862 2 0.4238 17.8040296 15.5171 65.921819 +2587 863 1 -0.8476 18.62052 15.5171 68.44788 +2588 863 2 0.4238 19.4370104 15.5171 69.025239 +2589 863 2 0.4238 17.8040296 15.5171 69.025239 +2590 864 1 -0.8476 18.62052 15.5171 71.5513 +2591 864 2 0.4238 19.4370104 15.5171 72.128659 +2592 864 2 0.4238 17.8040296 15.5171 72.128659 +2593 865 1 -0.8476 18.62052 18.62052 25.0 +2594 865 2 0.4238 19.4370104 18.62052 25.577359 +2595 865 2 0.4238 17.8040296 18.62052 25.577359 +2596 866 1 -0.8476 18.62052 18.62052 28.10342 +2597 866 2 0.4238 19.4370104 18.62052 28.680779 +2598 866 2 0.4238 17.8040296 18.62052 28.680779 +2599 867 1 -0.8476 18.62052 18.62052 31.20684 +2600 867 2 0.4238 19.4370104 18.62052 31.784199 +2601 867 2 0.4238 17.8040296 18.62052 31.784199 +2602 868 1 -0.8476 18.62052 18.62052 34.31026 +2603 868 2 0.4238 19.4370104 18.62052 34.887619 +2604 868 2 0.4238 17.8040296 18.62052 34.887619 +2605 869 1 -0.8476 18.62052 18.62052 37.41368 +2606 869 2 0.4238 19.4370104 18.62052 37.991039 +2607 869 2 0.4238 17.8040296 18.62052 37.991039 +2608 870 1 -0.8476 18.62052 18.62052 40.5171 +2609 870 2 0.4238 19.4370104 18.62052 41.094459 +2610 870 2 0.4238 17.8040296 18.62052 41.094459 +2611 871 1 -0.8476 18.62052 18.62052 43.62052 +2612 871 2 0.4238 19.4370104 18.62052 44.197879 +2613 871 2 0.4238 17.8040296 18.62052 44.197879 +2614 872 1 -0.8476 18.62052 18.62052 46.72394 +2615 872 2 0.4238 19.4370104 18.62052 47.301299 +2616 872 2 0.4238 17.8040296 18.62052 47.301299 +2617 873 1 -0.8476 18.62052 18.62052 49.82736 +2618 873 2 0.4238 19.4370104 18.62052 50.404719 +2619 873 2 0.4238 17.8040296 18.62052 50.404719 +2620 874 1 -0.8476 18.62052 18.62052 52.93078 +2621 874 2 0.4238 19.4370104 18.62052 53.508139 +2622 874 2 0.4238 17.8040296 18.62052 53.508139 +2623 875 1 -0.8476 18.62052 18.62052 56.0342 +2624 875 2 0.4238 19.4370104 18.62052 56.611559 +2625 875 2 0.4238 17.8040296 18.62052 56.611559 +2626 876 1 -0.8476 18.62052 18.62052 59.13762 +2627 876 2 0.4238 19.4370104 18.62052 59.714979 +2628 876 2 0.4238 17.8040296 18.62052 59.714979 +2629 877 1 -0.8476 18.62052 18.62052 62.24104 +2630 877 2 0.4238 19.4370104 18.62052 62.818399 +2631 877 2 0.4238 17.8040296 18.62052 62.818399 +2632 878 1 -0.8476 18.62052 18.62052 65.34446 +2633 878 2 0.4238 19.4370104 18.62052 65.921819 +2634 878 2 0.4238 17.8040296 18.62052 65.921819 +2635 879 1 -0.8476 18.62052 18.62052 68.44788 +2636 879 2 0.4238 19.4370104 18.62052 69.025239 +2637 879 2 0.4238 17.8040296 18.62052 69.025239 +2638 880 1 -0.8476 18.62052 18.62052 71.5513 +2639 880 2 0.4238 19.4370104 18.62052 72.128659 +2640 880 2 0.4238 17.8040296 18.62052 72.128659 +2641 881 1 -0.8476 18.62052 21.72394 25.0 +2642 881 2 0.4238 19.4370104 21.72394 25.577359 +2643 881 2 0.4238 17.8040296 21.72394 25.577359 +2644 882 1 -0.8476 18.62052 21.72394 28.10342 +2645 882 2 0.4238 19.4370104 21.72394 28.680779 +2646 882 2 0.4238 17.8040296 21.72394 28.680779 +2647 883 1 -0.8476 18.62052 21.72394 31.20684 +2648 883 2 0.4238 19.4370104 21.72394 31.784199 +2649 883 2 0.4238 17.8040296 21.72394 31.784199 +2650 884 1 -0.8476 18.62052 21.72394 34.31026 +2651 884 2 0.4238 19.4370104 21.72394 34.887619 +2652 884 2 0.4238 17.8040296 21.72394 34.887619 +2653 885 1 -0.8476 18.62052 21.72394 37.41368 +2654 885 2 0.4238 19.4370104 21.72394 37.991039 +2655 885 2 0.4238 17.8040296 21.72394 37.991039 +2656 886 1 -0.8476 18.62052 21.72394 40.5171 +2657 886 2 0.4238 19.4370104 21.72394 41.094459 +2658 886 2 0.4238 17.8040296 21.72394 41.094459 +2659 887 1 -0.8476 18.62052 21.72394 43.62052 +2660 887 2 0.4238 19.4370104 21.72394 44.197879 +2661 887 2 0.4238 17.8040296 21.72394 44.197879 +2662 888 1 -0.8476 18.62052 21.72394 46.72394 +2663 888 2 0.4238 19.4370104 21.72394 47.301299 +2664 888 2 0.4238 17.8040296 21.72394 47.301299 +2665 889 1 -0.8476 18.62052 21.72394 49.82736 +2666 889 2 0.4238 19.4370104 21.72394 50.404719 +2667 889 2 0.4238 17.8040296 21.72394 50.404719 +2668 890 1 -0.8476 18.62052 21.72394 52.93078 +2669 890 2 0.4238 19.4370104 21.72394 53.508139 +2670 890 2 0.4238 17.8040296 21.72394 53.508139 +2671 891 1 -0.8476 18.62052 21.72394 56.0342 +2672 891 2 0.4238 19.4370104 21.72394 56.611559 +2673 891 2 0.4238 17.8040296 21.72394 56.611559 +2674 892 1 -0.8476 18.62052 21.72394 59.13762 +2675 892 2 0.4238 19.4370104 21.72394 59.714979 +2676 892 2 0.4238 17.8040296 21.72394 59.714979 +2677 893 1 -0.8476 18.62052 21.72394 62.24104 +2678 893 2 0.4238 19.4370104 21.72394 62.818399 +2679 893 2 0.4238 17.8040296 21.72394 62.818399 +2680 894 1 -0.8476 18.62052 21.72394 65.34446 +2681 894 2 0.4238 19.4370104 21.72394 65.921819 +2682 894 2 0.4238 17.8040296 21.72394 65.921819 +2683 895 1 -0.8476 18.62052 21.72394 68.44788 +2684 895 2 0.4238 19.4370104 21.72394 69.025239 +2685 895 2 0.4238 17.8040296 21.72394 69.025239 +2686 896 1 -0.8476 18.62052 21.72394 71.5513 +2687 896 2 0.4238 19.4370104 21.72394 72.128659 +2688 896 2 0.4238 17.8040296 21.72394 72.128659 +2689 897 1 -0.8476 21.72394 0.0 25.0 +2690 897 2 0.4238 22.540430399999998 0.0 25.577359 +2691 897 2 0.4238 20.9074496 0.0 25.577359 +2692 898 1 -0.8476 21.72394 0.0 28.10342 +2693 898 2 0.4238 22.540430399999998 0.0 28.680779 +2694 898 2 0.4238 20.9074496 0.0 28.680779 +2695 899 1 -0.8476 21.72394 0.0 31.20684 +2696 899 2 0.4238 22.540430399999998 0.0 31.784199 +2697 899 2 0.4238 20.9074496 0.0 31.784199 +2698 900 1 -0.8476 21.72394 0.0 34.31026 +2699 900 2 0.4238 22.540430399999998 0.0 34.887619 +2700 900 2 0.4238 20.9074496 0.0 34.887619 +2701 901 1 -0.8476 21.72394 0.0 37.41368 +2702 901 2 0.4238 22.540430399999998 0.0 37.991039 +2703 901 2 0.4238 20.9074496 0.0 37.991039 +2704 902 1 -0.8476 21.72394 0.0 40.5171 +2705 902 2 0.4238 22.540430399999998 0.0 41.094459 +2706 902 2 0.4238 20.9074496 0.0 41.094459 +2707 903 1 -0.8476 21.72394 0.0 43.62052 +2708 903 2 0.4238 22.540430399999998 0.0 44.197879 +2709 903 2 0.4238 20.9074496 0.0 44.197879 +2710 904 1 -0.8476 21.72394 0.0 46.72394 +2711 904 2 0.4238 22.540430399999998 0.0 47.301299 +2712 904 2 0.4238 20.9074496 0.0 47.301299 +2713 905 1 -0.8476 21.72394 0.0 49.82736 +2714 905 2 0.4238 22.540430399999998 0.0 50.404719 +2715 905 2 0.4238 20.9074496 0.0 50.404719 +2716 906 1 -0.8476 21.72394 0.0 52.93078 +2717 906 2 0.4238 22.540430399999998 0.0 53.508139 +2718 906 2 0.4238 20.9074496 0.0 53.508139 +2719 907 1 -0.8476 21.72394 0.0 56.0342 +2720 907 2 0.4238 22.540430399999998 0.0 56.611559 +2721 907 2 0.4238 20.9074496 0.0 56.611559 +2722 908 1 -0.8476 21.72394 0.0 59.13762 +2723 908 2 0.4238 22.540430399999998 0.0 59.714979 +2724 908 2 0.4238 20.9074496 0.0 59.714979 +2725 909 1 -0.8476 21.72394 0.0 62.24104 +2726 909 2 0.4238 22.540430399999998 0.0 62.818399 +2727 909 2 0.4238 20.9074496 0.0 62.818399 +2728 910 1 -0.8476 21.72394 0.0 65.34446 +2729 910 2 0.4238 22.540430399999998 0.0 65.921819 +2730 910 2 0.4238 20.9074496 0.0 65.921819 +2731 911 1 -0.8476 21.72394 0.0 68.44788 +2732 911 2 0.4238 22.540430399999998 0.0 69.025239 +2733 911 2 0.4238 20.9074496 0.0 69.025239 +2734 912 1 -0.8476 21.72394 0.0 71.5513 +2735 912 2 0.4238 22.540430399999998 0.0 72.128659 +2736 912 2 0.4238 20.9074496 0.0 72.128659 +2737 913 1 -0.8476 21.72394 3.10342 25.0 +2738 913 2 0.4238 22.540430399999998 3.10342 25.577359 +2739 913 2 0.4238 20.9074496 3.10342 25.577359 +2740 914 1 -0.8476 21.72394 3.10342 28.10342 +2741 914 2 0.4238 22.540430399999998 3.10342 28.680779 +2742 914 2 0.4238 20.9074496 3.10342 28.680779 +2743 915 1 -0.8476 21.72394 3.10342 31.20684 +2744 915 2 0.4238 22.540430399999998 3.10342 31.784199 +2745 915 2 0.4238 20.9074496 3.10342 31.784199 +2746 916 1 -0.8476 21.72394 3.10342 34.31026 +2747 916 2 0.4238 22.540430399999998 3.10342 34.887619 +2748 916 2 0.4238 20.9074496 3.10342 34.887619 +2749 917 1 -0.8476 21.72394 3.10342 37.41368 +2750 917 2 0.4238 22.540430399999998 3.10342 37.991039 +2751 917 2 0.4238 20.9074496 3.10342 37.991039 +2752 918 1 -0.8476 21.72394 3.10342 40.5171 +2753 918 2 0.4238 22.540430399999998 3.10342 41.094459 +2754 918 2 0.4238 20.9074496 3.10342 41.094459 +2755 919 1 -0.8476 21.72394 3.10342 43.62052 +2756 919 2 0.4238 22.540430399999998 3.10342 44.197879 +2757 919 2 0.4238 20.9074496 3.10342 44.197879 +2758 920 1 -0.8476 21.72394 3.10342 46.72394 +2759 920 2 0.4238 22.540430399999998 3.10342 47.301299 +2760 920 2 0.4238 20.9074496 3.10342 47.301299 +2761 921 1 -0.8476 21.72394 3.10342 49.82736 +2762 921 2 0.4238 22.540430399999998 3.10342 50.404719 +2763 921 2 0.4238 20.9074496 3.10342 50.404719 +2764 922 1 -0.8476 21.72394 3.10342 52.93078 +2765 922 2 0.4238 22.540430399999998 3.10342 53.508139 +2766 922 2 0.4238 20.9074496 3.10342 53.508139 +2767 923 1 -0.8476 21.72394 3.10342 56.0342 +2768 923 2 0.4238 22.540430399999998 3.10342 56.611559 +2769 923 2 0.4238 20.9074496 3.10342 56.611559 +2770 924 1 -0.8476 21.72394 3.10342 59.13762 +2771 924 2 0.4238 22.540430399999998 3.10342 59.714979 +2772 924 2 0.4238 20.9074496 3.10342 59.714979 +2773 925 1 -0.8476 21.72394 3.10342 62.24104 +2774 925 2 0.4238 22.540430399999998 3.10342 62.818399 +2775 925 2 0.4238 20.9074496 3.10342 62.818399 +2776 926 1 -0.8476 21.72394 3.10342 65.34446 +2777 926 2 0.4238 22.540430399999998 3.10342 65.921819 +2778 926 2 0.4238 20.9074496 3.10342 65.921819 +2779 927 1 -0.8476 21.72394 3.10342 68.44788 +2780 927 2 0.4238 22.540430399999998 3.10342 69.025239 +2781 927 2 0.4238 20.9074496 3.10342 69.025239 +2782 928 1 -0.8476 21.72394 3.10342 71.5513 +2783 928 2 0.4238 22.540430399999998 3.10342 72.128659 +2784 928 2 0.4238 20.9074496 3.10342 72.128659 +2785 929 1 -0.8476 21.72394 6.20684 25.0 +2786 929 2 0.4238 22.540430399999998 6.20684 25.577359 +2787 929 2 0.4238 20.9074496 6.20684 25.577359 +2788 930 1 -0.8476 21.72394 6.20684 28.10342 +2789 930 2 0.4238 22.540430399999998 6.20684 28.680779 +2790 930 2 0.4238 20.9074496 6.20684 28.680779 +2791 931 1 -0.8476 21.72394 6.20684 31.20684 +2792 931 2 0.4238 22.540430399999998 6.20684 31.784199 +2793 931 2 0.4238 20.9074496 6.20684 31.784199 +2794 932 1 -0.8476 21.72394 6.20684 34.31026 +2795 932 2 0.4238 22.540430399999998 6.20684 34.887619 +2796 932 2 0.4238 20.9074496 6.20684 34.887619 +2797 933 1 -0.8476 21.72394 6.20684 37.41368 +2798 933 2 0.4238 22.540430399999998 6.20684 37.991039 +2799 933 2 0.4238 20.9074496 6.20684 37.991039 +2800 934 1 -0.8476 21.72394 6.20684 40.5171 +2801 934 2 0.4238 22.540430399999998 6.20684 41.094459 +2802 934 2 0.4238 20.9074496 6.20684 41.094459 +2803 935 1 -0.8476 21.72394 6.20684 43.62052 +2804 935 2 0.4238 22.540430399999998 6.20684 44.197879 +2805 935 2 0.4238 20.9074496 6.20684 44.197879 +2806 936 1 -0.8476 21.72394 6.20684 46.72394 +2807 936 2 0.4238 22.540430399999998 6.20684 47.301299 +2808 936 2 0.4238 20.9074496 6.20684 47.301299 +2809 937 1 -0.8476 21.72394 6.20684 49.82736 +2810 937 2 0.4238 22.540430399999998 6.20684 50.404719 +2811 937 2 0.4238 20.9074496 6.20684 50.404719 +2812 938 1 -0.8476 21.72394 6.20684 52.93078 +2813 938 2 0.4238 22.540430399999998 6.20684 53.508139 +2814 938 2 0.4238 20.9074496 6.20684 53.508139 +2815 939 1 -0.8476 21.72394 6.20684 56.0342 +2816 939 2 0.4238 22.540430399999998 6.20684 56.611559 +2817 939 2 0.4238 20.9074496 6.20684 56.611559 +2818 940 1 -0.8476 21.72394 6.20684 59.13762 +2819 940 2 0.4238 22.540430399999998 6.20684 59.714979 +2820 940 2 0.4238 20.9074496 6.20684 59.714979 +2821 941 1 -0.8476 21.72394 6.20684 62.24104 +2822 941 2 0.4238 22.540430399999998 6.20684 62.818399 +2823 941 2 0.4238 20.9074496 6.20684 62.818399 +2824 942 1 -0.8476 21.72394 6.20684 65.34446 +2825 942 2 0.4238 22.540430399999998 6.20684 65.921819 +2826 942 2 0.4238 20.9074496 6.20684 65.921819 +2827 943 1 -0.8476 21.72394 6.20684 68.44788 +2828 943 2 0.4238 22.540430399999998 6.20684 69.025239 +2829 943 2 0.4238 20.9074496 6.20684 69.025239 +2830 944 1 -0.8476 21.72394 6.20684 71.5513 +2831 944 2 0.4238 22.540430399999998 6.20684 72.128659 +2832 944 2 0.4238 20.9074496 6.20684 72.128659 +2833 945 1 -0.8476 21.72394 9.31026 25.0 +2834 945 2 0.4238 22.540430399999998 9.31026 25.577359 +2835 945 2 0.4238 20.9074496 9.31026 25.577359 +2836 946 1 -0.8476 21.72394 9.31026 28.10342 +2837 946 2 0.4238 22.540430399999998 9.31026 28.680779 +2838 946 2 0.4238 20.9074496 9.31026 28.680779 +2839 947 1 -0.8476 21.72394 9.31026 31.20684 +2840 947 2 0.4238 22.540430399999998 9.31026 31.784199 +2841 947 2 0.4238 20.9074496 9.31026 31.784199 +2842 948 1 -0.8476 21.72394 9.31026 34.31026 +2843 948 2 0.4238 22.540430399999998 9.31026 34.887619 +2844 948 2 0.4238 20.9074496 9.31026 34.887619 +2845 949 1 -0.8476 21.72394 9.31026 37.41368 +2846 949 2 0.4238 22.540430399999998 9.31026 37.991039 +2847 949 2 0.4238 20.9074496 9.31026 37.991039 +2848 950 1 -0.8476 21.72394 9.31026 40.5171 +2849 950 2 0.4238 22.540430399999998 9.31026 41.094459 +2850 950 2 0.4238 20.9074496 9.31026 41.094459 +2851 951 1 -0.8476 21.72394 9.31026 43.62052 +2852 951 2 0.4238 22.540430399999998 9.31026 44.197879 +2853 951 2 0.4238 20.9074496 9.31026 44.197879 +2854 952 1 -0.8476 21.72394 9.31026 46.72394 +2855 952 2 0.4238 22.540430399999998 9.31026 47.301299 +2856 952 2 0.4238 20.9074496 9.31026 47.301299 +2857 953 1 -0.8476 21.72394 9.31026 49.82736 +2858 953 2 0.4238 22.540430399999998 9.31026 50.404719 +2859 953 2 0.4238 20.9074496 9.31026 50.404719 +2860 954 1 -0.8476 21.72394 9.31026 52.93078 +2861 954 2 0.4238 22.540430399999998 9.31026 53.508139 +2862 954 2 0.4238 20.9074496 9.31026 53.508139 +2863 955 1 -0.8476 21.72394 9.31026 56.0342 +2864 955 2 0.4238 22.540430399999998 9.31026 56.611559 +2865 955 2 0.4238 20.9074496 9.31026 56.611559 +2866 956 1 -0.8476 21.72394 9.31026 59.13762 +2867 956 2 0.4238 22.540430399999998 9.31026 59.714979 +2868 956 2 0.4238 20.9074496 9.31026 59.714979 +2869 957 1 -0.8476 21.72394 9.31026 62.24104 +2870 957 2 0.4238 22.540430399999998 9.31026 62.818399 +2871 957 2 0.4238 20.9074496 9.31026 62.818399 +2872 958 1 -0.8476 21.72394 9.31026 65.34446 +2873 958 2 0.4238 22.540430399999998 9.31026 65.921819 +2874 958 2 0.4238 20.9074496 9.31026 65.921819 +2875 959 1 -0.8476 21.72394 9.31026 68.44788 +2876 959 2 0.4238 22.540430399999998 9.31026 69.025239 +2877 959 2 0.4238 20.9074496 9.31026 69.025239 +2878 960 1 -0.8476 21.72394 9.31026 71.5513 +2879 960 2 0.4238 22.540430399999998 9.31026 72.128659 +2880 960 2 0.4238 20.9074496 9.31026 72.128659 +2881 961 1 -0.8476 21.72394 12.41368 25.0 +2882 961 2 0.4238 22.540430399999998 12.41368 25.577359 +2883 961 2 0.4238 20.9074496 12.41368 25.577359 +2884 962 1 -0.8476 21.72394 12.41368 28.10342 +2885 962 2 0.4238 22.540430399999998 12.41368 28.680779 +2886 962 2 0.4238 20.9074496 12.41368 28.680779 +2887 963 1 -0.8476 21.72394 12.41368 31.20684 +2888 963 2 0.4238 22.540430399999998 12.41368 31.784199 +2889 963 2 0.4238 20.9074496 12.41368 31.784199 +2890 964 1 -0.8476 21.72394 12.41368 34.31026 +2891 964 2 0.4238 22.540430399999998 12.41368 34.887619 +2892 964 2 0.4238 20.9074496 12.41368 34.887619 +2893 965 1 -0.8476 21.72394 12.41368 37.41368 +2894 965 2 0.4238 22.540430399999998 12.41368 37.991039 +2895 965 2 0.4238 20.9074496 12.41368 37.991039 +2896 966 1 -0.8476 21.72394 12.41368 40.5171 +2897 966 2 0.4238 22.540430399999998 12.41368 41.094459 +2898 966 2 0.4238 20.9074496 12.41368 41.094459 +2899 967 1 -0.8476 21.72394 12.41368 43.62052 +2900 967 2 0.4238 22.540430399999998 12.41368 44.197879 +2901 967 2 0.4238 20.9074496 12.41368 44.197879 +2902 968 1 -0.8476 21.72394 12.41368 46.72394 +2903 968 2 0.4238 22.540430399999998 12.41368 47.301299 +2904 968 2 0.4238 20.9074496 12.41368 47.301299 +2905 969 1 -0.8476 21.72394 12.41368 49.82736 +2906 969 2 0.4238 22.540430399999998 12.41368 50.404719 +2907 969 2 0.4238 20.9074496 12.41368 50.404719 +2908 970 1 -0.8476 21.72394 12.41368 52.93078 +2909 970 2 0.4238 22.540430399999998 12.41368 53.508139 +2910 970 2 0.4238 20.9074496 12.41368 53.508139 +2911 971 1 -0.8476 21.72394 12.41368 56.0342 +2912 971 2 0.4238 22.540430399999998 12.41368 56.611559 +2913 971 2 0.4238 20.9074496 12.41368 56.611559 +2914 972 1 -0.8476 21.72394 12.41368 59.13762 +2915 972 2 0.4238 22.540430399999998 12.41368 59.714979 +2916 972 2 0.4238 20.9074496 12.41368 59.714979 +2917 973 1 -0.8476 21.72394 12.41368 62.24104 +2918 973 2 0.4238 22.540430399999998 12.41368 62.818399 +2919 973 2 0.4238 20.9074496 12.41368 62.818399 +2920 974 1 -0.8476 21.72394 12.41368 65.34446 +2921 974 2 0.4238 22.540430399999998 12.41368 65.921819 +2922 974 2 0.4238 20.9074496 12.41368 65.921819 +2923 975 1 -0.8476 21.72394 12.41368 68.44788 +2924 975 2 0.4238 22.540430399999998 12.41368 69.025239 +2925 975 2 0.4238 20.9074496 12.41368 69.025239 +2926 976 1 -0.8476 21.72394 12.41368 71.5513 +2927 976 2 0.4238 22.540430399999998 12.41368 72.128659 +2928 976 2 0.4238 20.9074496 12.41368 72.128659 +2929 977 1 -0.8476 21.72394 15.5171 25.0 +2930 977 2 0.4238 22.540430399999998 15.5171 25.577359 +2931 977 2 0.4238 20.9074496 15.5171 25.577359 +2932 978 1 -0.8476 21.72394 15.5171 28.10342 +2933 978 2 0.4238 22.540430399999998 15.5171 28.680779 +2934 978 2 0.4238 20.9074496 15.5171 28.680779 +2935 979 1 -0.8476 21.72394 15.5171 31.20684 +2936 979 2 0.4238 22.540430399999998 15.5171 31.784199 +2937 979 2 0.4238 20.9074496 15.5171 31.784199 +2938 980 1 -0.8476 21.72394 15.5171 34.31026 +2939 980 2 0.4238 22.540430399999998 15.5171 34.887619 +2940 980 2 0.4238 20.9074496 15.5171 34.887619 +2941 981 1 -0.8476 21.72394 15.5171 37.41368 +2942 981 2 0.4238 22.540430399999998 15.5171 37.991039 +2943 981 2 0.4238 20.9074496 15.5171 37.991039 +2944 982 1 -0.8476 21.72394 15.5171 40.5171 +2945 982 2 0.4238 22.540430399999998 15.5171 41.094459 +2946 982 2 0.4238 20.9074496 15.5171 41.094459 +2947 983 1 -0.8476 21.72394 15.5171 43.62052 +2948 983 2 0.4238 22.540430399999998 15.5171 44.197879 +2949 983 2 0.4238 20.9074496 15.5171 44.197879 +2950 984 1 -0.8476 21.72394 15.5171 46.72394 +2951 984 2 0.4238 22.540430399999998 15.5171 47.301299 +2952 984 2 0.4238 20.9074496 15.5171 47.301299 +2953 985 1 -0.8476 21.72394 15.5171 49.82736 +2954 985 2 0.4238 22.540430399999998 15.5171 50.404719 +2955 985 2 0.4238 20.9074496 15.5171 50.404719 +2956 986 1 -0.8476 21.72394 15.5171 52.93078 +2957 986 2 0.4238 22.540430399999998 15.5171 53.508139 +2958 986 2 0.4238 20.9074496 15.5171 53.508139 +2959 987 1 -0.8476 21.72394 15.5171 56.0342 +2960 987 2 0.4238 22.540430399999998 15.5171 56.611559 +2961 987 2 0.4238 20.9074496 15.5171 56.611559 +2962 988 1 -0.8476 21.72394 15.5171 59.13762 +2963 988 2 0.4238 22.540430399999998 15.5171 59.714979 +2964 988 2 0.4238 20.9074496 15.5171 59.714979 +2965 989 1 -0.8476 21.72394 15.5171 62.24104 +2966 989 2 0.4238 22.540430399999998 15.5171 62.818399 +2967 989 2 0.4238 20.9074496 15.5171 62.818399 +2968 990 1 -0.8476 21.72394 15.5171 65.34446 +2969 990 2 0.4238 22.540430399999998 15.5171 65.921819 +2970 990 2 0.4238 20.9074496 15.5171 65.921819 +2971 991 1 -0.8476 21.72394 15.5171 68.44788 +2972 991 2 0.4238 22.540430399999998 15.5171 69.025239 +2973 991 2 0.4238 20.9074496 15.5171 69.025239 +2974 992 1 -0.8476 21.72394 15.5171 71.5513 +2975 992 2 0.4238 22.540430399999998 15.5171 72.128659 +2976 992 2 0.4238 20.9074496 15.5171 72.128659 +2977 993 1 -0.8476 21.72394 18.62052 25.0 +2978 993 2 0.4238 22.540430399999998 18.62052 25.577359 +2979 993 2 0.4238 20.9074496 18.62052 25.577359 +2980 994 1 -0.8476 21.72394 18.62052 28.10342 +2981 994 2 0.4238 22.540430399999998 18.62052 28.680779 +2982 994 2 0.4238 20.9074496 18.62052 28.680779 +2983 995 1 -0.8476 21.72394 18.62052 31.20684 +2984 995 2 0.4238 22.540430399999998 18.62052 31.784199 +2985 995 2 0.4238 20.9074496 18.62052 31.784199 +2986 996 1 -0.8476 21.72394 18.62052 34.31026 +2987 996 2 0.4238 22.540430399999998 18.62052 34.887619 +2988 996 2 0.4238 20.9074496 18.62052 34.887619 +2989 997 1 -0.8476 21.72394 18.62052 37.41368 +2990 997 2 0.4238 22.540430399999998 18.62052 37.991039 +2991 997 2 0.4238 20.9074496 18.62052 37.991039 +2992 998 1 -0.8476 21.72394 18.62052 40.5171 +2993 998 2 0.4238 22.540430399999998 18.62052 41.094459 +2994 998 2 0.4238 20.9074496 18.62052 41.094459 +2995 999 1 -0.8476 21.72394 18.62052 43.62052 +2996 999 2 0.4238 22.540430399999998 18.62052 44.197879 +2997 999 2 0.4238 20.9074496 18.62052 44.197879 +2998 1000 1 -0.8476 21.72394 18.62052 46.72394 +2999 1000 2 0.4238 22.540430399999998 18.62052 47.301299 +3000 1000 2 0.4238 20.9074496 18.62052 47.301299 +3001 1001 1 -0.8476 21.72394 18.62052 49.82736 +3002 1001 2 0.4238 22.540430399999998 18.62052 50.404719 +3003 1001 2 0.4238 20.9074496 18.62052 50.404719 +3004 1002 1 -0.8476 21.72394 18.62052 52.93078 +3005 1002 2 0.4238 22.540430399999998 18.62052 53.508139 +3006 1002 2 0.4238 20.9074496 18.62052 53.508139 +3007 1003 1 -0.8476 21.72394 18.62052 56.0342 +3008 1003 2 0.4238 22.540430399999998 18.62052 56.611559 +3009 1003 2 0.4238 20.9074496 18.62052 56.611559 +3010 1004 1 -0.8476 21.72394 18.62052 59.13762 +3011 1004 2 0.4238 22.540430399999998 18.62052 59.714979 +3012 1004 2 0.4238 20.9074496 18.62052 59.714979 +3013 1005 1 -0.8476 21.72394 18.62052 62.24104 +3014 1005 2 0.4238 22.540430399999998 18.62052 62.818399 +3015 1005 2 0.4238 20.9074496 18.62052 62.818399 +3016 1006 1 -0.8476 21.72394 18.62052 65.34446 +3017 1006 2 0.4238 22.540430399999998 18.62052 65.921819 +3018 1006 2 0.4238 20.9074496 18.62052 65.921819 +3019 1007 1 -0.8476 21.72394 18.62052 68.44788 +3020 1007 2 0.4238 22.540430399999998 18.62052 69.025239 +3021 1007 2 0.4238 20.9074496 18.62052 69.025239 +3022 1008 1 -0.8476 21.72394 18.62052 71.5513 +3023 1008 2 0.4238 22.540430399999998 18.62052 72.128659 +3024 1008 2 0.4238 20.9074496 18.62052 72.128659 +3025 1009 1 -0.8476 21.72394 21.72394 25.0 +3026 1009 2 0.4238 22.540430399999998 21.72394 25.577359 +3027 1009 2 0.4238 20.9074496 21.72394 25.577359 +3028 1010 1 -0.8476 21.72394 21.72394 28.10342 +3029 1010 2 0.4238 22.540430399999998 21.72394 28.680779 +3030 1010 2 0.4238 20.9074496 21.72394 28.680779 +3031 1011 1 -0.8476 21.72394 21.72394 31.20684 +3032 1011 2 0.4238 22.540430399999998 21.72394 31.784199 +3033 1011 2 0.4238 20.9074496 21.72394 31.784199 +3034 1012 1 -0.8476 21.72394 21.72394 34.31026 +3035 1012 2 0.4238 22.540430399999998 21.72394 34.887619 +3036 1012 2 0.4238 20.9074496 21.72394 34.887619 +3037 1013 1 -0.8476 21.72394 21.72394 37.41368 +3038 1013 2 0.4238 22.540430399999998 21.72394 37.991039 +3039 1013 2 0.4238 20.9074496 21.72394 37.991039 +3040 1014 1 -0.8476 21.72394 21.72394 40.5171 +3041 1014 2 0.4238 22.540430399999998 21.72394 41.094459 +3042 1014 2 0.4238 20.9074496 21.72394 41.094459 +3043 1015 1 -0.8476 21.72394 21.72394 43.62052 +3044 1015 2 0.4238 22.540430399999998 21.72394 44.197879 +3045 1015 2 0.4238 20.9074496 21.72394 44.197879 +3046 1016 1 -0.8476 21.72394 21.72394 46.72394 +3047 1016 2 0.4238 22.540430399999998 21.72394 47.301299 +3048 1016 2 0.4238 20.9074496 21.72394 47.301299 +3049 1017 1 -0.8476 21.72394 21.72394 49.82736 +3050 1017 2 0.4238 22.540430399999998 21.72394 50.404719 +3051 1017 2 0.4238 20.9074496 21.72394 50.404719 +3052 1018 1 -0.8476 21.72394 21.72394 52.93078 +3053 1018 2 0.4238 22.540430399999998 21.72394 53.508139 +3054 1018 2 0.4238 20.9074496 21.72394 53.508139 +3055 1019 1 -0.8476 21.72394 21.72394 56.0342 +3056 1019 2 0.4238 22.540430399999998 21.72394 56.611559 +3057 1019 2 0.4238 20.9074496 21.72394 56.611559 +3058 1020 1 -0.8476 21.72394 21.72394 59.13762 +3059 1020 2 0.4238 22.540430399999998 21.72394 59.714979 +3060 1020 2 0.4238 20.9074496 21.72394 59.714979 +3061 1021 1 -0.8476 21.72394 21.72394 62.24104 +3062 1021 2 0.4238 22.540430399999998 21.72394 62.818399 +3063 1021 2 0.4238 20.9074496 21.72394 62.818399 +3064 1022 1 -0.8476 21.72394 21.72394 65.34446 +3065 1022 2 0.4238 22.540430399999998 21.72394 65.921819 +3066 1022 2 0.4238 20.9074496 21.72394 65.921819 +3067 1023 1 -0.8476 21.72394 21.72394 68.44788 +3068 1023 2 0.4238 22.540430399999998 21.72394 69.025239 +3069 1023 2 0.4238 20.9074496 21.72394 69.025239 +3070 1024 1 -0.8476 21.72394 21.72394 71.5513 +3071 1024 2 0.4238 22.540430399999998 21.72394 72.128659 +3072 1024 2 0.4238 20.9074496 21.72394 72.128659 + +Bonds + +1 1 1 2 +2 1 1 3 +3 1 4 5 +4 1 4 6 +5 1 7 8 +6 1 7 9 +7 1 10 11 +8 1 10 12 +9 1 13 14 +10 1 13 15 +11 1 16 17 +12 1 16 18 +13 1 19 20 +14 1 19 21 +15 1 22 23 +16 1 22 24 +17 1 25 26 +18 1 25 27 +19 1 28 29 +20 1 28 30 +21 1 31 32 +22 1 31 33 +23 1 34 35 +24 1 34 36 +25 1 37 38 +26 1 37 39 +27 1 40 41 +28 1 40 42 +29 1 43 44 +30 1 43 45 +31 1 46 47 +32 1 46 48 +33 1 49 50 +34 1 49 51 +35 1 52 53 +36 1 52 54 +37 1 55 56 +38 1 55 57 +39 1 58 59 +40 1 58 60 +41 1 61 62 +42 1 61 63 +43 1 64 65 +44 1 64 66 +45 1 67 68 +46 1 67 69 +47 1 70 71 +48 1 70 72 +49 1 73 74 +50 1 73 75 +51 1 76 77 +52 1 76 78 +53 1 79 80 +54 1 79 81 +55 1 82 83 +56 1 82 84 +57 1 85 86 +58 1 85 87 +59 1 88 89 +60 1 88 90 +61 1 91 92 +62 1 91 93 +63 1 94 95 +64 1 94 96 +65 1 97 98 +66 1 97 99 +67 1 100 101 +68 1 100 102 +69 1 103 104 +70 1 103 105 +71 1 106 107 +72 1 106 108 +73 1 109 110 +74 1 109 111 +75 1 112 113 +76 1 112 114 +77 1 115 116 +78 1 115 117 +79 1 118 119 +80 1 118 120 +81 1 121 122 +82 1 121 123 +83 1 124 125 +84 1 124 126 +85 1 127 128 +86 1 127 129 +87 1 130 131 +88 1 130 132 +89 1 133 134 +90 1 133 135 +91 1 136 137 +92 1 136 138 +93 1 139 140 +94 1 139 141 +95 1 142 143 +96 1 142 144 +97 1 145 146 +98 1 145 147 +99 1 148 149 +100 1 148 150 +101 1 151 152 +102 1 151 153 +103 1 154 155 +104 1 154 156 +105 1 157 158 +106 1 157 159 +107 1 160 161 +108 1 160 162 +109 1 163 164 +110 1 163 165 +111 1 166 167 +112 1 166 168 +113 1 169 170 +114 1 169 171 +115 1 172 173 +116 1 172 174 +117 1 175 176 +118 1 175 177 +119 1 178 179 +120 1 178 180 +121 1 181 182 +122 1 181 183 +123 1 184 185 +124 1 184 186 +125 1 187 188 +126 1 187 189 +127 1 190 191 +128 1 190 192 +129 1 193 194 +130 1 193 195 +131 1 196 197 +132 1 196 198 +133 1 199 200 +134 1 199 201 +135 1 202 203 +136 1 202 204 +137 1 205 206 +138 1 205 207 +139 1 208 209 +140 1 208 210 +141 1 211 212 +142 1 211 213 +143 1 214 215 +144 1 214 216 +145 1 217 218 +146 1 217 219 +147 1 220 221 +148 1 220 222 +149 1 223 224 +150 1 223 225 +151 1 226 227 +152 1 226 228 +153 1 229 230 +154 1 229 231 +155 1 232 233 +156 1 232 234 +157 1 235 236 +158 1 235 237 +159 1 238 239 +160 1 238 240 +161 1 241 242 +162 1 241 243 +163 1 244 245 +164 1 244 246 +165 1 247 248 +166 1 247 249 +167 1 250 251 +168 1 250 252 +169 1 253 254 +170 1 253 255 +171 1 256 257 +172 1 256 258 +173 1 259 260 +174 1 259 261 +175 1 262 263 +176 1 262 264 +177 1 265 266 +178 1 265 267 +179 1 268 269 +180 1 268 270 +181 1 271 272 +182 1 271 273 +183 1 274 275 +184 1 274 276 +185 1 277 278 +186 1 277 279 +187 1 280 281 +188 1 280 282 +189 1 283 284 +190 1 283 285 +191 1 286 287 +192 1 286 288 +193 1 289 290 +194 1 289 291 +195 1 292 293 +196 1 292 294 +197 1 295 296 +198 1 295 297 +199 1 298 299 +200 1 298 300 +201 1 301 302 +202 1 301 303 +203 1 304 305 +204 1 304 306 +205 1 307 308 +206 1 307 309 +207 1 310 311 +208 1 310 312 +209 1 313 314 +210 1 313 315 +211 1 316 317 +212 1 316 318 +213 1 319 320 +214 1 319 321 +215 1 322 323 +216 1 322 324 +217 1 325 326 +218 1 325 327 +219 1 328 329 +220 1 328 330 +221 1 331 332 +222 1 331 333 +223 1 334 335 +224 1 334 336 +225 1 337 338 +226 1 337 339 +227 1 340 341 +228 1 340 342 +229 1 343 344 +230 1 343 345 +231 1 346 347 +232 1 346 348 +233 1 349 350 +234 1 349 351 +235 1 352 353 +236 1 352 354 +237 1 355 356 +238 1 355 357 +239 1 358 359 +240 1 358 360 +241 1 361 362 +242 1 361 363 +243 1 364 365 +244 1 364 366 +245 1 367 368 +246 1 367 369 +247 1 370 371 +248 1 370 372 +249 1 373 374 +250 1 373 375 +251 1 376 377 +252 1 376 378 +253 1 379 380 +254 1 379 381 +255 1 382 383 +256 1 382 384 +257 1 385 386 +258 1 385 387 +259 1 388 389 +260 1 388 390 +261 1 391 392 +262 1 391 393 +263 1 394 395 +264 1 394 396 +265 1 397 398 +266 1 397 399 +267 1 400 401 +268 1 400 402 +269 1 403 404 +270 1 403 405 +271 1 406 407 +272 1 406 408 +273 1 409 410 +274 1 409 411 +275 1 412 413 +276 1 412 414 +277 1 415 416 +278 1 415 417 +279 1 418 419 +280 1 418 420 +281 1 421 422 +282 1 421 423 +283 1 424 425 +284 1 424 426 +285 1 427 428 +286 1 427 429 +287 1 430 431 +288 1 430 432 +289 1 433 434 +290 1 433 435 +291 1 436 437 +292 1 436 438 +293 1 439 440 +294 1 439 441 +295 1 442 443 +296 1 442 444 +297 1 445 446 +298 1 445 447 +299 1 448 449 +300 1 448 450 +301 1 451 452 +302 1 451 453 +303 1 454 455 +304 1 454 456 +305 1 457 458 +306 1 457 459 +307 1 460 461 +308 1 460 462 +309 1 463 464 +310 1 463 465 +311 1 466 467 +312 1 466 468 +313 1 469 470 +314 1 469 471 +315 1 472 473 +316 1 472 474 +317 1 475 476 +318 1 475 477 +319 1 478 479 +320 1 478 480 +321 1 481 482 +322 1 481 483 +323 1 484 485 +324 1 484 486 +325 1 487 488 +326 1 487 489 +327 1 490 491 +328 1 490 492 +329 1 493 494 +330 1 493 495 +331 1 496 497 +332 1 496 498 +333 1 499 500 +334 1 499 501 +335 1 502 503 +336 1 502 504 +337 1 505 506 +338 1 505 507 +339 1 508 509 +340 1 508 510 +341 1 511 512 +342 1 511 513 +343 1 514 515 +344 1 514 516 +345 1 517 518 +346 1 517 519 +347 1 520 521 +348 1 520 522 +349 1 523 524 +350 1 523 525 +351 1 526 527 +352 1 526 528 +353 1 529 530 +354 1 529 531 +355 1 532 533 +356 1 532 534 +357 1 535 536 +358 1 535 537 +359 1 538 539 +360 1 538 540 +361 1 541 542 +362 1 541 543 +363 1 544 545 +364 1 544 546 +365 1 547 548 +366 1 547 549 +367 1 550 551 +368 1 550 552 +369 1 553 554 +370 1 553 555 +371 1 556 557 +372 1 556 558 +373 1 559 560 +374 1 559 561 +375 1 562 563 +376 1 562 564 +377 1 565 566 +378 1 565 567 +379 1 568 569 +380 1 568 570 +381 1 571 572 +382 1 571 573 +383 1 574 575 +384 1 574 576 +385 1 577 578 +386 1 577 579 +387 1 580 581 +388 1 580 582 +389 1 583 584 +390 1 583 585 +391 1 586 587 +392 1 586 588 +393 1 589 590 +394 1 589 591 +395 1 592 593 +396 1 592 594 +397 1 595 596 +398 1 595 597 +399 1 598 599 +400 1 598 600 +401 1 601 602 +402 1 601 603 +403 1 604 605 +404 1 604 606 +405 1 607 608 +406 1 607 609 +407 1 610 611 +408 1 610 612 +409 1 613 614 +410 1 613 615 +411 1 616 617 +412 1 616 618 +413 1 619 620 +414 1 619 621 +415 1 622 623 +416 1 622 624 +417 1 625 626 +418 1 625 627 +419 1 628 629 +420 1 628 630 +421 1 631 632 +422 1 631 633 +423 1 634 635 +424 1 634 636 +425 1 637 638 +426 1 637 639 +427 1 640 641 +428 1 640 642 +429 1 643 644 +430 1 643 645 +431 1 646 647 +432 1 646 648 +433 1 649 650 +434 1 649 651 +435 1 652 653 +436 1 652 654 +437 1 655 656 +438 1 655 657 +439 1 658 659 +440 1 658 660 +441 1 661 662 +442 1 661 663 +443 1 664 665 +444 1 664 666 +445 1 667 668 +446 1 667 669 +447 1 670 671 +448 1 670 672 +449 1 673 674 +450 1 673 675 +451 1 676 677 +452 1 676 678 +453 1 679 680 +454 1 679 681 +455 1 682 683 +456 1 682 684 +457 1 685 686 +458 1 685 687 +459 1 688 689 +460 1 688 690 +461 1 691 692 +462 1 691 693 +463 1 694 695 +464 1 694 696 +465 1 697 698 +466 1 697 699 +467 1 700 701 +468 1 700 702 +469 1 703 704 +470 1 703 705 +471 1 706 707 +472 1 706 708 +473 1 709 710 +474 1 709 711 +475 1 712 713 +476 1 712 714 +477 1 715 716 +478 1 715 717 +479 1 718 719 +480 1 718 720 +481 1 721 722 +482 1 721 723 +483 1 724 725 +484 1 724 726 +485 1 727 728 +486 1 727 729 +487 1 730 731 +488 1 730 732 +489 1 733 734 +490 1 733 735 +491 1 736 737 +492 1 736 738 +493 1 739 740 +494 1 739 741 +495 1 742 743 +496 1 742 744 +497 1 745 746 +498 1 745 747 +499 1 748 749 +500 1 748 750 +501 1 751 752 +502 1 751 753 +503 1 754 755 +504 1 754 756 +505 1 757 758 +506 1 757 759 +507 1 760 761 +508 1 760 762 +509 1 763 764 +510 1 763 765 +511 1 766 767 +512 1 766 768 +513 1 769 770 +514 1 769 771 +515 1 772 773 +516 1 772 774 +517 1 775 776 +518 1 775 777 +519 1 778 779 +520 1 778 780 +521 1 781 782 +522 1 781 783 +523 1 784 785 +524 1 784 786 +525 1 787 788 +526 1 787 789 +527 1 790 791 +528 1 790 792 +529 1 793 794 +530 1 793 795 +531 1 796 797 +532 1 796 798 +533 1 799 800 +534 1 799 801 +535 1 802 803 +536 1 802 804 +537 1 805 806 +538 1 805 807 +539 1 808 809 +540 1 808 810 +541 1 811 812 +542 1 811 813 +543 1 814 815 +544 1 814 816 +545 1 817 818 +546 1 817 819 +547 1 820 821 +548 1 820 822 +549 1 823 824 +550 1 823 825 +551 1 826 827 +552 1 826 828 +553 1 829 830 +554 1 829 831 +555 1 832 833 +556 1 832 834 +557 1 835 836 +558 1 835 837 +559 1 838 839 +560 1 838 840 +561 1 841 842 +562 1 841 843 +563 1 844 845 +564 1 844 846 +565 1 847 848 +566 1 847 849 +567 1 850 851 +568 1 850 852 +569 1 853 854 +570 1 853 855 +571 1 856 857 +572 1 856 858 +573 1 859 860 +574 1 859 861 +575 1 862 863 +576 1 862 864 +577 1 865 866 +578 1 865 867 +579 1 868 869 +580 1 868 870 +581 1 871 872 +582 1 871 873 +583 1 874 875 +584 1 874 876 +585 1 877 878 +586 1 877 879 +587 1 880 881 +588 1 880 882 +589 1 883 884 +590 1 883 885 +591 1 886 887 +592 1 886 888 +593 1 889 890 +594 1 889 891 +595 1 892 893 +596 1 892 894 +597 1 895 896 +598 1 895 897 +599 1 898 899 +600 1 898 900 +601 1 901 902 +602 1 901 903 +603 1 904 905 +604 1 904 906 +605 1 907 908 +606 1 907 909 +607 1 910 911 +608 1 910 912 +609 1 913 914 +610 1 913 915 +611 1 916 917 +612 1 916 918 +613 1 919 920 +614 1 919 921 +615 1 922 923 +616 1 922 924 +617 1 925 926 +618 1 925 927 +619 1 928 929 +620 1 928 930 +621 1 931 932 +622 1 931 933 +623 1 934 935 +624 1 934 936 +625 1 937 938 +626 1 937 939 +627 1 940 941 +628 1 940 942 +629 1 943 944 +630 1 943 945 +631 1 946 947 +632 1 946 948 +633 1 949 950 +634 1 949 951 +635 1 952 953 +636 1 952 954 +637 1 955 956 +638 1 955 957 +639 1 958 959 +640 1 958 960 +641 1 961 962 +642 1 961 963 +643 1 964 965 +644 1 964 966 +645 1 967 968 +646 1 967 969 +647 1 970 971 +648 1 970 972 +649 1 973 974 +650 1 973 975 +651 1 976 977 +652 1 976 978 +653 1 979 980 +654 1 979 981 +655 1 982 983 +656 1 982 984 +657 1 985 986 +658 1 985 987 +659 1 988 989 +660 1 988 990 +661 1 991 992 +662 1 991 993 +663 1 994 995 +664 1 994 996 +665 1 997 998 +666 1 997 999 +667 1 1000 1001 +668 1 1000 1002 +669 1 1003 1004 +670 1 1003 1005 +671 1 1006 1007 +672 1 1006 1008 +673 1 1009 1010 +674 1 1009 1011 +675 1 1012 1013 +676 1 1012 1014 +677 1 1015 1016 +678 1 1015 1017 +679 1 1018 1019 +680 1 1018 1020 +681 1 1021 1022 +682 1 1021 1023 +683 1 1024 1025 +684 1 1024 1026 +685 1 1027 1028 +686 1 1027 1029 +687 1 1030 1031 +688 1 1030 1032 +689 1 1033 1034 +690 1 1033 1035 +691 1 1036 1037 +692 1 1036 1038 +693 1 1039 1040 +694 1 1039 1041 +695 1 1042 1043 +696 1 1042 1044 +697 1 1045 1046 +698 1 1045 1047 +699 1 1048 1049 +700 1 1048 1050 +701 1 1051 1052 +702 1 1051 1053 +703 1 1054 1055 +704 1 1054 1056 +705 1 1057 1058 +706 1 1057 1059 +707 1 1060 1061 +708 1 1060 1062 +709 1 1063 1064 +710 1 1063 1065 +711 1 1066 1067 +712 1 1066 1068 +713 1 1069 1070 +714 1 1069 1071 +715 1 1072 1073 +716 1 1072 1074 +717 1 1075 1076 +718 1 1075 1077 +719 1 1078 1079 +720 1 1078 1080 +721 1 1081 1082 +722 1 1081 1083 +723 1 1084 1085 +724 1 1084 1086 +725 1 1087 1088 +726 1 1087 1089 +727 1 1090 1091 +728 1 1090 1092 +729 1 1093 1094 +730 1 1093 1095 +731 1 1096 1097 +732 1 1096 1098 +733 1 1099 1100 +734 1 1099 1101 +735 1 1102 1103 +736 1 1102 1104 +737 1 1105 1106 +738 1 1105 1107 +739 1 1108 1109 +740 1 1108 1110 +741 1 1111 1112 +742 1 1111 1113 +743 1 1114 1115 +744 1 1114 1116 +745 1 1117 1118 +746 1 1117 1119 +747 1 1120 1121 +748 1 1120 1122 +749 1 1123 1124 +750 1 1123 1125 +751 1 1126 1127 +752 1 1126 1128 +753 1 1129 1130 +754 1 1129 1131 +755 1 1132 1133 +756 1 1132 1134 +757 1 1135 1136 +758 1 1135 1137 +759 1 1138 1139 +760 1 1138 1140 +761 1 1141 1142 +762 1 1141 1143 +763 1 1144 1145 +764 1 1144 1146 +765 1 1147 1148 +766 1 1147 1149 +767 1 1150 1151 +768 1 1150 1152 +769 1 1153 1154 +770 1 1153 1155 +771 1 1156 1157 +772 1 1156 1158 +773 1 1159 1160 +774 1 1159 1161 +775 1 1162 1163 +776 1 1162 1164 +777 1 1165 1166 +778 1 1165 1167 +779 1 1168 1169 +780 1 1168 1170 +781 1 1171 1172 +782 1 1171 1173 +783 1 1174 1175 +784 1 1174 1176 +785 1 1177 1178 +786 1 1177 1179 +787 1 1180 1181 +788 1 1180 1182 +789 1 1183 1184 +790 1 1183 1185 +791 1 1186 1187 +792 1 1186 1188 +793 1 1189 1190 +794 1 1189 1191 +795 1 1192 1193 +796 1 1192 1194 +797 1 1195 1196 +798 1 1195 1197 +799 1 1198 1199 +800 1 1198 1200 +801 1 1201 1202 +802 1 1201 1203 +803 1 1204 1205 +804 1 1204 1206 +805 1 1207 1208 +806 1 1207 1209 +807 1 1210 1211 +808 1 1210 1212 +809 1 1213 1214 +810 1 1213 1215 +811 1 1216 1217 +812 1 1216 1218 +813 1 1219 1220 +814 1 1219 1221 +815 1 1222 1223 +816 1 1222 1224 +817 1 1225 1226 +818 1 1225 1227 +819 1 1228 1229 +820 1 1228 1230 +821 1 1231 1232 +822 1 1231 1233 +823 1 1234 1235 +824 1 1234 1236 +825 1 1237 1238 +826 1 1237 1239 +827 1 1240 1241 +828 1 1240 1242 +829 1 1243 1244 +830 1 1243 1245 +831 1 1246 1247 +832 1 1246 1248 +833 1 1249 1250 +834 1 1249 1251 +835 1 1252 1253 +836 1 1252 1254 +837 1 1255 1256 +838 1 1255 1257 +839 1 1258 1259 +840 1 1258 1260 +841 1 1261 1262 +842 1 1261 1263 +843 1 1264 1265 +844 1 1264 1266 +845 1 1267 1268 +846 1 1267 1269 +847 1 1270 1271 +848 1 1270 1272 +849 1 1273 1274 +850 1 1273 1275 +851 1 1276 1277 +852 1 1276 1278 +853 1 1279 1280 +854 1 1279 1281 +855 1 1282 1283 +856 1 1282 1284 +857 1 1285 1286 +858 1 1285 1287 +859 1 1288 1289 +860 1 1288 1290 +861 1 1291 1292 +862 1 1291 1293 +863 1 1294 1295 +864 1 1294 1296 +865 1 1297 1298 +866 1 1297 1299 +867 1 1300 1301 +868 1 1300 1302 +869 1 1303 1304 +870 1 1303 1305 +871 1 1306 1307 +872 1 1306 1308 +873 1 1309 1310 +874 1 1309 1311 +875 1 1312 1313 +876 1 1312 1314 +877 1 1315 1316 +878 1 1315 1317 +879 1 1318 1319 +880 1 1318 1320 +881 1 1321 1322 +882 1 1321 1323 +883 1 1324 1325 +884 1 1324 1326 +885 1 1327 1328 +886 1 1327 1329 +887 1 1330 1331 +888 1 1330 1332 +889 1 1333 1334 +890 1 1333 1335 +891 1 1336 1337 +892 1 1336 1338 +893 1 1339 1340 +894 1 1339 1341 +895 1 1342 1343 +896 1 1342 1344 +897 1 1345 1346 +898 1 1345 1347 +899 1 1348 1349 +900 1 1348 1350 +901 1 1351 1352 +902 1 1351 1353 +903 1 1354 1355 +904 1 1354 1356 +905 1 1357 1358 +906 1 1357 1359 +907 1 1360 1361 +908 1 1360 1362 +909 1 1363 1364 +910 1 1363 1365 +911 1 1366 1367 +912 1 1366 1368 +913 1 1369 1370 +914 1 1369 1371 +915 1 1372 1373 +916 1 1372 1374 +917 1 1375 1376 +918 1 1375 1377 +919 1 1378 1379 +920 1 1378 1380 +921 1 1381 1382 +922 1 1381 1383 +923 1 1384 1385 +924 1 1384 1386 +925 1 1387 1388 +926 1 1387 1389 +927 1 1390 1391 +928 1 1390 1392 +929 1 1393 1394 +930 1 1393 1395 +931 1 1396 1397 +932 1 1396 1398 +933 1 1399 1400 +934 1 1399 1401 +935 1 1402 1403 +936 1 1402 1404 +937 1 1405 1406 +938 1 1405 1407 +939 1 1408 1409 +940 1 1408 1410 +941 1 1411 1412 +942 1 1411 1413 +943 1 1414 1415 +944 1 1414 1416 +945 1 1417 1418 +946 1 1417 1419 +947 1 1420 1421 +948 1 1420 1422 +949 1 1423 1424 +950 1 1423 1425 +951 1 1426 1427 +952 1 1426 1428 +953 1 1429 1430 +954 1 1429 1431 +955 1 1432 1433 +956 1 1432 1434 +957 1 1435 1436 +958 1 1435 1437 +959 1 1438 1439 +960 1 1438 1440 +961 1 1441 1442 +962 1 1441 1443 +963 1 1444 1445 +964 1 1444 1446 +965 1 1447 1448 +966 1 1447 1449 +967 1 1450 1451 +968 1 1450 1452 +969 1 1453 1454 +970 1 1453 1455 +971 1 1456 1457 +972 1 1456 1458 +973 1 1459 1460 +974 1 1459 1461 +975 1 1462 1463 +976 1 1462 1464 +977 1 1465 1466 +978 1 1465 1467 +979 1 1468 1469 +980 1 1468 1470 +981 1 1471 1472 +982 1 1471 1473 +983 1 1474 1475 +984 1 1474 1476 +985 1 1477 1478 +986 1 1477 1479 +987 1 1480 1481 +988 1 1480 1482 +989 1 1483 1484 +990 1 1483 1485 +991 1 1486 1487 +992 1 1486 1488 +993 1 1489 1490 +994 1 1489 1491 +995 1 1492 1493 +996 1 1492 1494 +997 1 1495 1496 +998 1 1495 1497 +999 1 1498 1499 +1000 1 1498 1500 +1001 1 1501 1502 +1002 1 1501 1503 +1003 1 1504 1505 +1004 1 1504 1506 +1005 1 1507 1508 +1006 1 1507 1509 +1007 1 1510 1511 +1008 1 1510 1512 +1009 1 1513 1514 +1010 1 1513 1515 +1011 1 1516 1517 +1012 1 1516 1518 +1013 1 1519 1520 +1014 1 1519 1521 +1015 1 1522 1523 +1016 1 1522 1524 +1017 1 1525 1526 +1018 1 1525 1527 +1019 1 1528 1529 +1020 1 1528 1530 +1021 1 1531 1532 +1022 1 1531 1533 +1023 1 1534 1535 +1024 1 1534 1536 +1025 1 1537 1538 +1026 1 1537 1539 +1027 1 1540 1541 +1028 1 1540 1542 +1029 1 1543 1544 +1030 1 1543 1545 +1031 1 1546 1547 +1032 1 1546 1548 +1033 1 1549 1550 +1034 1 1549 1551 +1035 1 1552 1553 +1036 1 1552 1554 +1037 1 1555 1556 +1038 1 1555 1557 +1039 1 1558 1559 +1040 1 1558 1560 +1041 1 1561 1562 +1042 1 1561 1563 +1043 1 1564 1565 +1044 1 1564 1566 +1045 1 1567 1568 +1046 1 1567 1569 +1047 1 1570 1571 +1048 1 1570 1572 +1049 1 1573 1574 +1050 1 1573 1575 +1051 1 1576 1577 +1052 1 1576 1578 +1053 1 1579 1580 +1054 1 1579 1581 +1055 1 1582 1583 +1056 1 1582 1584 +1057 1 1585 1586 +1058 1 1585 1587 +1059 1 1588 1589 +1060 1 1588 1590 +1061 1 1591 1592 +1062 1 1591 1593 +1063 1 1594 1595 +1064 1 1594 1596 +1065 1 1597 1598 +1066 1 1597 1599 +1067 1 1600 1601 +1068 1 1600 1602 +1069 1 1603 1604 +1070 1 1603 1605 +1071 1 1606 1607 +1072 1 1606 1608 +1073 1 1609 1610 +1074 1 1609 1611 +1075 1 1612 1613 +1076 1 1612 1614 +1077 1 1615 1616 +1078 1 1615 1617 +1079 1 1618 1619 +1080 1 1618 1620 +1081 1 1621 1622 +1082 1 1621 1623 +1083 1 1624 1625 +1084 1 1624 1626 +1085 1 1627 1628 +1086 1 1627 1629 +1087 1 1630 1631 +1088 1 1630 1632 +1089 1 1633 1634 +1090 1 1633 1635 +1091 1 1636 1637 +1092 1 1636 1638 +1093 1 1639 1640 +1094 1 1639 1641 +1095 1 1642 1643 +1096 1 1642 1644 +1097 1 1645 1646 +1098 1 1645 1647 +1099 1 1648 1649 +1100 1 1648 1650 +1101 1 1651 1652 +1102 1 1651 1653 +1103 1 1654 1655 +1104 1 1654 1656 +1105 1 1657 1658 +1106 1 1657 1659 +1107 1 1660 1661 +1108 1 1660 1662 +1109 1 1663 1664 +1110 1 1663 1665 +1111 1 1666 1667 +1112 1 1666 1668 +1113 1 1669 1670 +1114 1 1669 1671 +1115 1 1672 1673 +1116 1 1672 1674 +1117 1 1675 1676 +1118 1 1675 1677 +1119 1 1678 1679 +1120 1 1678 1680 +1121 1 1681 1682 +1122 1 1681 1683 +1123 1 1684 1685 +1124 1 1684 1686 +1125 1 1687 1688 +1126 1 1687 1689 +1127 1 1690 1691 +1128 1 1690 1692 +1129 1 1693 1694 +1130 1 1693 1695 +1131 1 1696 1697 +1132 1 1696 1698 +1133 1 1699 1700 +1134 1 1699 1701 +1135 1 1702 1703 +1136 1 1702 1704 +1137 1 1705 1706 +1138 1 1705 1707 +1139 1 1708 1709 +1140 1 1708 1710 +1141 1 1711 1712 +1142 1 1711 1713 +1143 1 1714 1715 +1144 1 1714 1716 +1145 1 1717 1718 +1146 1 1717 1719 +1147 1 1720 1721 +1148 1 1720 1722 +1149 1 1723 1724 +1150 1 1723 1725 +1151 1 1726 1727 +1152 1 1726 1728 +1153 1 1729 1730 +1154 1 1729 1731 +1155 1 1732 1733 +1156 1 1732 1734 +1157 1 1735 1736 +1158 1 1735 1737 +1159 1 1738 1739 +1160 1 1738 1740 +1161 1 1741 1742 +1162 1 1741 1743 +1163 1 1744 1745 +1164 1 1744 1746 +1165 1 1747 1748 +1166 1 1747 1749 +1167 1 1750 1751 +1168 1 1750 1752 +1169 1 1753 1754 +1170 1 1753 1755 +1171 1 1756 1757 +1172 1 1756 1758 +1173 1 1759 1760 +1174 1 1759 1761 +1175 1 1762 1763 +1176 1 1762 1764 +1177 1 1765 1766 +1178 1 1765 1767 +1179 1 1768 1769 +1180 1 1768 1770 +1181 1 1771 1772 +1182 1 1771 1773 +1183 1 1774 1775 +1184 1 1774 1776 +1185 1 1777 1778 +1186 1 1777 1779 +1187 1 1780 1781 +1188 1 1780 1782 +1189 1 1783 1784 +1190 1 1783 1785 +1191 1 1786 1787 +1192 1 1786 1788 +1193 1 1789 1790 +1194 1 1789 1791 +1195 1 1792 1793 +1196 1 1792 1794 +1197 1 1795 1796 +1198 1 1795 1797 +1199 1 1798 1799 +1200 1 1798 1800 +1201 1 1801 1802 +1202 1 1801 1803 +1203 1 1804 1805 +1204 1 1804 1806 +1205 1 1807 1808 +1206 1 1807 1809 +1207 1 1810 1811 +1208 1 1810 1812 +1209 1 1813 1814 +1210 1 1813 1815 +1211 1 1816 1817 +1212 1 1816 1818 +1213 1 1819 1820 +1214 1 1819 1821 +1215 1 1822 1823 +1216 1 1822 1824 +1217 1 1825 1826 +1218 1 1825 1827 +1219 1 1828 1829 +1220 1 1828 1830 +1221 1 1831 1832 +1222 1 1831 1833 +1223 1 1834 1835 +1224 1 1834 1836 +1225 1 1837 1838 +1226 1 1837 1839 +1227 1 1840 1841 +1228 1 1840 1842 +1229 1 1843 1844 +1230 1 1843 1845 +1231 1 1846 1847 +1232 1 1846 1848 +1233 1 1849 1850 +1234 1 1849 1851 +1235 1 1852 1853 +1236 1 1852 1854 +1237 1 1855 1856 +1238 1 1855 1857 +1239 1 1858 1859 +1240 1 1858 1860 +1241 1 1861 1862 +1242 1 1861 1863 +1243 1 1864 1865 +1244 1 1864 1866 +1245 1 1867 1868 +1246 1 1867 1869 +1247 1 1870 1871 +1248 1 1870 1872 +1249 1 1873 1874 +1250 1 1873 1875 +1251 1 1876 1877 +1252 1 1876 1878 +1253 1 1879 1880 +1254 1 1879 1881 +1255 1 1882 1883 +1256 1 1882 1884 +1257 1 1885 1886 +1258 1 1885 1887 +1259 1 1888 1889 +1260 1 1888 1890 +1261 1 1891 1892 +1262 1 1891 1893 +1263 1 1894 1895 +1264 1 1894 1896 +1265 1 1897 1898 +1266 1 1897 1899 +1267 1 1900 1901 +1268 1 1900 1902 +1269 1 1903 1904 +1270 1 1903 1905 +1271 1 1906 1907 +1272 1 1906 1908 +1273 1 1909 1910 +1274 1 1909 1911 +1275 1 1912 1913 +1276 1 1912 1914 +1277 1 1915 1916 +1278 1 1915 1917 +1279 1 1918 1919 +1280 1 1918 1920 +1281 1 1921 1922 +1282 1 1921 1923 +1283 1 1924 1925 +1284 1 1924 1926 +1285 1 1927 1928 +1286 1 1927 1929 +1287 1 1930 1931 +1288 1 1930 1932 +1289 1 1933 1934 +1290 1 1933 1935 +1291 1 1936 1937 +1292 1 1936 1938 +1293 1 1939 1940 +1294 1 1939 1941 +1295 1 1942 1943 +1296 1 1942 1944 +1297 1 1945 1946 +1298 1 1945 1947 +1299 1 1948 1949 +1300 1 1948 1950 +1301 1 1951 1952 +1302 1 1951 1953 +1303 1 1954 1955 +1304 1 1954 1956 +1305 1 1957 1958 +1306 1 1957 1959 +1307 1 1960 1961 +1308 1 1960 1962 +1309 1 1963 1964 +1310 1 1963 1965 +1311 1 1966 1967 +1312 1 1966 1968 +1313 1 1969 1970 +1314 1 1969 1971 +1315 1 1972 1973 +1316 1 1972 1974 +1317 1 1975 1976 +1318 1 1975 1977 +1319 1 1978 1979 +1320 1 1978 1980 +1321 1 1981 1982 +1322 1 1981 1983 +1323 1 1984 1985 +1324 1 1984 1986 +1325 1 1987 1988 +1326 1 1987 1989 +1327 1 1990 1991 +1328 1 1990 1992 +1329 1 1993 1994 +1330 1 1993 1995 +1331 1 1996 1997 +1332 1 1996 1998 +1333 1 1999 2000 +1334 1 1999 2001 +1335 1 2002 2003 +1336 1 2002 2004 +1337 1 2005 2006 +1338 1 2005 2007 +1339 1 2008 2009 +1340 1 2008 2010 +1341 1 2011 2012 +1342 1 2011 2013 +1343 1 2014 2015 +1344 1 2014 2016 +1345 1 2017 2018 +1346 1 2017 2019 +1347 1 2020 2021 +1348 1 2020 2022 +1349 1 2023 2024 +1350 1 2023 2025 +1351 1 2026 2027 +1352 1 2026 2028 +1353 1 2029 2030 +1354 1 2029 2031 +1355 1 2032 2033 +1356 1 2032 2034 +1357 1 2035 2036 +1358 1 2035 2037 +1359 1 2038 2039 +1360 1 2038 2040 +1361 1 2041 2042 +1362 1 2041 2043 +1363 1 2044 2045 +1364 1 2044 2046 +1365 1 2047 2048 +1366 1 2047 2049 +1367 1 2050 2051 +1368 1 2050 2052 +1369 1 2053 2054 +1370 1 2053 2055 +1371 1 2056 2057 +1372 1 2056 2058 +1373 1 2059 2060 +1374 1 2059 2061 +1375 1 2062 2063 +1376 1 2062 2064 +1377 1 2065 2066 +1378 1 2065 2067 +1379 1 2068 2069 +1380 1 2068 2070 +1381 1 2071 2072 +1382 1 2071 2073 +1383 1 2074 2075 +1384 1 2074 2076 +1385 1 2077 2078 +1386 1 2077 2079 +1387 1 2080 2081 +1388 1 2080 2082 +1389 1 2083 2084 +1390 1 2083 2085 +1391 1 2086 2087 +1392 1 2086 2088 +1393 1 2089 2090 +1394 1 2089 2091 +1395 1 2092 2093 +1396 1 2092 2094 +1397 1 2095 2096 +1398 1 2095 2097 +1399 1 2098 2099 +1400 1 2098 2100 +1401 1 2101 2102 +1402 1 2101 2103 +1403 1 2104 2105 +1404 1 2104 2106 +1405 1 2107 2108 +1406 1 2107 2109 +1407 1 2110 2111 +1408 1 2110 2112 +1409 1 2113 2114 +1410 1 2113 2115 +1411 1 2116 2117 +1412 1 2116 2118 +1413 1 2119 2120 +1414 1 2119 2121 +1415 1 2122 2123 +1416 1 2122 2124 +1417 1 2125 2126 +1418 1 2125 2127 +1419 1 2128 2129 +1420 1 2128 2130 +1421 1 2131 2132 +1422 1 2131 2133 +1423 1 2134 2135 +1424 1 2134 2136 +1425 1 2137 2138 +1426 1 2137 2139 +1427 1 2140 2141 +1428 1 2140 2142 +1429 1 2143 2144 +1430 1 2143 2145 +1431 1 2146 2147 +1432 1 2146 2148 +1433 1 2149 2150 +1434 1 2149 2151 +1435 1 2152 2153 +1436 1 2152 2154 +1437 1 2155 2156 +1438 1 2155 2157 +1439 1 2158 2159 +1440 1 2158 2160 +1441 1 2161 2162 +1442 1 2161 2163 +1443 1 2164 2165 +1444 1 2164 2166 +1445 1 2167 2168 +1446 1 2167 2169 +1447 1 2170 2171 +1448 1 2170 2172 +1449 1 2173 2174 +1450 1 2173 2175 +1451 1 2176 2177 +1452 1 2176 2178 +1453 1 2179 2180 +1454 1 2179 2181 +1455 1 2182 2183 +1456 1 2182 2184 +1457 1 2185 2186 +1458 1 2185 2187 +1459 1 2188 2189 +1460 1 2188 2190 +1461 1 2191 2192 +1462 1 2191 2193 +1463 1 2194 2195 +1464 1 2194 2196 +1465 1 2197 2198 +1466 1 2197 2199 +1467 1 2200 2201 +1468 1 2200 2202 +1469 1 2203 2204 +1470 1 2203 2205 +1471 1 2206 2207 +1472 1 2206 2208 +1473 1 2209 2210 +1474 1 2209 2211 +1475 1 2212 2213 +1476 1 2212 2214 +1477 1 2215 2216 +1478 1 2215 2217 +1479 1 2218 2219 +1480 1 2218 2220 +1481 1 2221 2222 +1482 1 2221 2223 +1483 1 2224 2225 +1484 1 2224 2226 +1485 1 2227 2228 +1486 1 2227 2229 +1487 1 2230 2231 +1488 1 2230 2232 +1489 1 2233 2234 +1490 1 2233 2235 +1491 1 2236 2237 +1492 1 2236 2238 +1493 1 2239 2240 +1494 1 2239 2241 +1495 1 2242 2243 +1496 1 2242 2244 +1497 1 2245 2246 +1498 1 2245 2247 +1499 1 2248 2249 +1500 1 2248 2250 +1501 1 2251 2252 +1502 1 2251 2253 +1503 1 2254 2255 +1504 1 2254 2256 +1505 1 2257 2258 +1506 1 2257 2259 +1507 1 2260 2261 +1508 1 2260 2262 +1509 1 2263 2264 +1510 1 2263 2265 +1511 1 2266 2267 +1512 1 2266 2268 +1513 1 2269 2270 +1514 1 2269 2271 +1515 1 2272 2273 +1516 1 2272 2274 +1517 1 2275 2276 +1518 1 2275 2277 +1519 1 2278 2279 +1520 1 2278 2280 +1521 1 2281 2282 +1522 1 2281 2283 +1523 1 2284 2285 +1524 1 2284 2286 +1525 1 2287 2288 +1526 1 2287 2289 +1527 1 2290 2291 +1528 1 2290 2292 +1529 1 2293 2294 +1530 1 2293 2295 +1531 1 2296 2297 +1532 1 2296 2298 +1533 1 2299 2300 +1534 1 2299 2301 +1535 1 2302 2303 +1536 1 2302 2304 +1537 1 2305 2306 +1538 1 2305 2307 +1539 1 2308 2309 +1540 1 2308 2310 +1541 1 2311 2312 +1542 1 2311 2313 +1543 1 2314 2315 +1544 1 2314 2316 +1545 1 2317 2318 +1546 1 2317 2319 +1547 1 2320 2321 +1548 1 2320 2322 +1549 1 2323 2324 +1550 1 2323 2325 +1551 1 2326 2327 +1552 1 2326 2328 +1553 1 2329 2330 +1554 1 2329 2331 +1555 1 2332 2333 +1556 1 2332 2334 +1557 1 2335 2336 +1558 1 2335 2337 +1559 1 2338 2339 +1560 1 2338 2340 +1561 1 2341 2342 +1562 1 2341 2343 +1563 1 2344 2345 +1564 1 2344 2346 +1565 1 2347 2348 +1566 1 2347 2349 +1567 1 2350 2351 +1568 1 2350 2352 +1569 1 2353 2354 +1570 1 2353 2355 +1571 1 2356 2357 +1572 1 2356 2358 +1573 1 2359 2360 +1574 1 2359 2361 +1575 1 2362 2363 +1576 1 2362 2364 +1577 1 2365 2366 +1578 1 2365 2367 +1579 1 2368 2369 +1580 1 2368 2370 +1581 1 2371 2372 +1582 1 2371 2373 +1583 1 2374 2375 +1584 1 2374 2376 +1585 1 2377 2378 +1586 1 2377 2379 +1587 1 2380 2381 +1588 1 2380 2382 +1589 1 2383 2384 +1590 1 2383 2385 +1591 1 2386 2387 +1592 1 2386 2388 +1593 1 2389 2390 +1594 1 2389 2391 +1595 1 2392 2393 +1596 1 2392 2394 +1597 1 2395 2396 +1598 1 2395 2397 +1599 1 2398 2399 +1600 1 2398 2400 +1601 1 2401 2402 +1602 1 2401 2403 +1603 1 2404 2405 +1604 1 2404 2406 +1605 1 2407 2408 +1606 1 2407 2409 +1607 1 2410 2411 +1608 1 2410 2412 +1609 1 2413 2414 +1610 1 2413 2415 +1611 1 2416 2417 +1612 1 2416 2418 +1613 1 2419 2420 +1614 1 2419 2421 +1615 1 2422 2423 +1616 1 2422 2424 +1617 1 2425 2426 +1618 1 2425 2427 +1619 1 2428 2429 +1620 1 2428 2430 +1621 1 2431 2432 +1622 1 2431 2433 +1623 1 2434 2435 +1624 1 2434 2436 +1625 1 2437 2438 +1626 1 2437 2439 +1627 1 2440 2441 +1628 1 2440 2442 +1629 1 2443 2444 +1630 1 2443 2445 +1631 1 2446 2447 +1632 1 2446 2448 +1633 1 2449 2450 +1634 1 2449 2451 +1635 1 2452 2453 +1636 1 2452 2454 +1637 1 2455 2456 +1638 1 2455 2457 +1639 1 2458 2459 +1640 1 2458 2460 +1641 1 2461 2462 +1642 1 2461 2463 +1643 1 2464 2465 +1644 1 2464 2466 +1645 1 2467 2468 +1646 1 2467 2469 +1647 1 2470 2471 +1648 1 2470 2472 +1649 1 2473 2474 +1650 1 2473 2475 +1651 1 2476 2477 +1652 1 2476 2478 +1653 1 2479 2480 +1654 1 2479 2481 +1655 1 2482 2483 +1656 1 2482 2484 +1657 1 2485 2486 +1658 1 2485 2487 +1659 1 2488 2489 +1660 1 2488 2490 +1661 1 2491 2492 +1662 1 2491 2493 +1663 1 2494 2495 +1664 1 2494 2496 +1665 1 2497 2498 +1666 1 2497 2499 +1667 1 2500 2501 +1668 1 2500 2502 +1669 1 2503 2504 +1670 1 2503 2505 +1671 1 2506 2507 +1672 1 2506 2508 +1673 1 2509 2510 +1674 1 2509 2511 +1675 1 2512 2513 +1676 1 2512 2514 +1677 1 2515 2516 +1678 1 2515 2517 +1679 1 2518 2519 +1680 1 2518 2520 +1681 1 2521 2522 +1682 1 2521 2523 +1683 1 2524 2525 +1684 1 2524 2526 +1685 1 2527 2528 +1686 1 2527 2529 +1687 1 2530 2531 +1688 1 2530 2532 +1689 1 2533 2534 +1690 1 2533 2535 +1691 1 2536 2537 +1692 1 2536 2538 +1693 1 2539 2540 +1694 1 2539 2541 +1695 1 2542 2543 +1696 1 2542 2544 +1697 1 2545 2546 +1698 1 2545 2547 +1699 1 2548 2549 +1700 1 2548 2550 +1701 1 2551 2552 +1702 1 2551 2553 +1703 1 2554 2555 +1704 1 2554 2556 +1705 1 2557 2558 +1706 1 2557 2559 +1707 1 2560 2561 +1708 1 2560 2562 +1709 1 2563 2564 +1710 1 2563 2565 +1711 1 2566 2567 +1712 1 2566 2568 +1713 1 2569 2570 +1714 1 2569 2571 +1715 1 2572 2573 +1716 1 2572 2574 +1717 1 2575 2576 +1718 1 2575 2577 +1719 1 2578 2579 +1720 1 2578 2580 +1721 1 2581 2582 +1722 1 2581 2583 +1723 1 2584 2585 +1724 1 2584 2586 +1725 1 2587 2588 +1726 1 2587 2589 +1727 1 2590 2591 +1728 1 2590 2592 +1729 1 2593 2594 +1730 1 2593 2595 +1731 1 2596 2597 +1732 1 2596 2598 +1733 1 2599 2600 +1734 1 2599 2601 +1735 1 2602 2603 +1736 1 2602 2604 +1737 1 2605 2606 +1738 1 2605 2607 +1739 1 2608 2609 +1740 1 2608 2610 +1741 1 2611 2612 +1742 1 2611 2613 +1743 1 2614 2615 +1744 1 2614 2616 +1745 1 2617 2618 +1746 1 2617 2619 +1747 1 2620 2621 +1748 1 2620 2622 +1749 1 2623 2624 +1750 1 2623 2625 +1751 1 2626 2627 +1752 1 2626 2628 +1753 1 2629 2630 +1754 1 2629 2631 +1755 1 2632 2633 +1756 1 2632 2634 +1757 1 2635 2636 +1758 1 2635 2637 +1759 1 2638 2639 +1760 1 2638 2640 +1761 1 2641 2642 +1762 1 2641 2643 +1763 1 2644 2645 +1764 1 2644 2646 +1765 1 2647 2648 +1766 1 2647 2649 +1767 1 2650 2651 +1768 1 2650 2652 +1769 1 2653 2654 +1770 1 2653 2655 +1771 1 2656 2657 +1772 1 2656 2658 +1773 1 2659 2660 +1774 1 2659 2661 +1775 1 2662 2663 +1776 1 2662 2664 +1777 1 2665 2666 +1778 1 2665 2667 +1779 1 2668 2669 +1780 1 2668 2670 +1781 1 2671 2672 +1782 1 2671 2673 +1783 1 2674 2675 +1784 1 2674 2676 +1785 1 2677 2678 +1786 1 2677 2679 +1787 1 2680 2681 +1788 1 2680 2682 +1789 1 2683 2684 +1790 1 2683 2685 +1791 1 2686 2687 +1792 1 2686 2688 +1793 1 2689 2690 +1794 1 2689 2691 +1795 1 2692 2693 +1796 1 2692 2694 +1797 1 2695 2696 +1798 1 2695 2697 +1799 1 2698 2699 +1800 1 2698 2700 +1801 1 2701 2702 +1802 1 2701 2703 +1803 1 2704 2705 +1804 1 2704 2706 +1805 1 2707 2708 +1806 1 2707 2709 +1807 1 2710 2711 +1808 1 2710 2712 +1809 1 2713 2714 +1810 1 2713 2715 +1811 1 2716 2717 +1812 1 2716 2718 +1813 1 2719 2720 +1814 1 2719 2721 +1815 1 2722 2723 +1816 1 2722 2724 +1817 1 2725 2726 +1818 1 2725 2727 +1819 1 2728 2729 +1820 1 2728 2730 +1821 1 2731 2732 +1822 1 2731 2733 +1823 1 2734 2735 +1824 1 2734 2736 +1825 1 2737 2738 +1826 1 2737 2739 +1827 1 2740 2741 +1828 1 2740 2742 +1829 1 2743 2744 +1830 1 2743 2745 +1831 1 2746 2747 +1832 1 2746 2748 +1833 1 2749 2750 +1834 1 2749 2751 +1835 1 2752 2753 +1836 1 2752 2754 +1837 1 2755 2756 +1838 1 2755 2757 +1839 1 2758 2759 +1840 1 2758 2760 +1841 1 2761 2762 +1842 1 2761 2763 +1843 1 2764 2765 +1844 1 2764 2766 +1845 1 2767 2768 +1846 1 2767 2769 +1847 1 2770 2771 +1848 1 2770 2772 +1849 1 2773 2774 +1850 1 2773 2775 +1851 1 2776 2777 +1852 1 2776 2778 +1853 1 2779 2780 +1854 1 2779 2781 +1855 1 2782 2783 +1856 1 2782 2784 +1857 1 2785 2786 +1858 1 2785 2787 +1859 1 2788 2789 +1860 1 2788 2790 +1861 1 2791 2792 +1862 1 2791 2793 +1863 1 2794 2795 +1864 1 2794 2796 +1865 1 2797 2798 +1866 1 2797 2799 +1867 1 2800 2801 +1868 1 2800 2802 +1869 1 2803 2804 +1870 1 2803 2805 +1871 1 2806 2807 +1872 1 2806 2808 +1873 1 2809 2810 +1874 1 2809 2811 +1875 1 2812 2813 +1876 1 2812 2814 +1877 1 2815 2816 +1878 1 2815 2817 +1879 1 2818 2819 +1880 1 2818 2820 +1881 1 2821 2822 +1882 1 2821 2823 +1883 1 2824 2825 +1884 1 2824 2826 +1885 1 2827 2828 +1886 1 2827 2829 +1887 1 2830 2831 +1888 1 2830 2832 +1889 1 2833 2834 +1890 1 2833 2835 +1891 1 2836 2837 +1892 1 2836 2838 +1893 1 2839 2840 +1894 1 2839 2841 +1895 1 2842 2843 +1896 1 2842 2844 +1897 1 2845 2846 +1898 1 2845 2847 +1899 1 2848 2849 +1900 1 2848 2850 +1901 1 2851 2852 +1902 1 2851 2853 +1903 1 2854 2855 +1904 1 2854 2856 +1905 1 2857 2858 +1906 1 2857 2859 +1907 1 2860 2861 +1908 1 2860 2862 +1909 1 2863 2864 +1910 1 2863 2865 +1911 1 2866 2867 +1912 1 2866 2868 +1913 1 2869 2870 +1914 1 2869 2871 +1915 1 2872 2873 +1916 1 2872 2874 +1917 1 2875 2876 +1918 1 2875 2877 +1919 1 2878 2879 +1920 1 2878 2880 +1921 1 2881 2882 +1922 1 2881 2883 +1923 1 2884 2885 +1924 1 2884 2886 +1925 1 2887 2888 +1926 1 2887 2889 +1927 1 2890 2891 +1928 1 2890 2892 +1929 1 2893 2894 +1930 1 2893 2895 +1931 1 2896 2897 +1932 1 2896 2898 +1933 1 2899 2900 +1934 1 2899 2901 +1935 1 2902 2903 +1936 1 2902 2904 +1937 1 2905 2906 +1938 1 2905 2907 +1939 1 2908 2909 +1940 1 2908 2910 +1941 1 2911 2912 +1942 1 2911 2913 +1943 1 2914 2915 +1944 1 2914 2916 +1945 1 2917 2918 +1946 1 2917 2919 +1947 1 2920 2921 +1948 1 2920 2922 +1949 1 2923 2924 +1950 1 2923 2925 +1951 1 2926 2927 +1952 1 2926 2928 +1953 1 2929 2930 +1954 1 2929 2931 +1955 1 2932 2933 +1956 1 2932 2934 +1957 1 2935 2936 +1958 1 2935 2937 +1959 1 2938 2939 +1960 1 2938 2940 +1961 1 2941 2942 +1962 1 2941 2943 +1963 1 2944 2945 +1964 1 2944 2946 +1965 1 2947 2948 +1966 1 2947 2949 +1967 1 2950 2951 +1968 1 2950 2952 +1969 1 2953 2954 +1970 1 2953 2955 +1971 1 2956 2957 +1972 1 2956 2958 +1973 1 2959 2960 +1974 1 2959 2961 +1975 1 2962 2963 +1976 1 2962 2964 +1977 1 2965 2966 +1978 1 2965 2967 +1979 1 2968 2969 +1980 1 2968 2970 +1981 1 2971 2972 +1982 1 2971 2973 +1983 1 2974 2975 +1984 1 2974 2976 +1985 1 2977 2978 +1986 1 2977 2979 +1987 1 2980 2981 +1988 1 2980 2982 +1989 1 2983 2984 +1990 1 2983 2985 +1991 1 2986 2987 +1992 1 2986 2988 +1993 1 2989 2990 +1994 1 2989 2991 +1995 1 2992 2993 +1996 1 2992 2994 +1997 1 2995 2996 +1998 1 2995 2997 +1999 1 2998 2999 +2000 1 2998 3000 +2001 1 3001 3002 +2002 1 3001 3003 +2003 1 3004 3005 +2004 1 3004 3006 +2005 1 3007 3008 +2006 1 3007 3009 +2007 1 3010 3011 +2008 1 3010 3012 +2009 1 3013 3014 +2010 1 3013 3015 +2011 1 3016 3017 +2012 1 3016 3018 +2013 1 3019 3020 +2014 1 3019 3021 +2015 1 3022 3023 +2016 1 3022 3024 +2017 1 3025 3026 +2018 1 3025 3027 +2019 1 3028 3029 +2020 1 3028 3030 +2021 1 3031 3032 +2022 1 3031 3033 +2023 1 3034 3035 +2024 1 3034 3036 +2025 1 3037 3038 +2026 1 3037 3039 +2027 1 3040 3041 +2028 1 3040 3042 +2029 1 3043 3044 +2030 1 3043 3045 +2031 1 3046 3047 +2032 1 3046 3048 +2033 1 3049 3050 +2034 1 3049 3051 +2035 1 3052 3053 +2036 1 3052 3054 +2037 1 3055 3056 +2038 1 3055 3057 +2039 1 3058 3059 +2040 1 3058 3060 +2041 1 3061 3062 +2042 1 3061 3063 +2043 1 3064 3065 +2044 1 3064 3066 +2045 1 3067 3068 +2046 1 3067 3069 +2047 1 3070 3071 +2048 1 3070 3072 + +Angles + +1 1 2 1 3 +2 1 5 4 6 +3 1 8 7 9 +4 1 11 10 12 +5 1 14 13 15 +6 1 17 16 18 +7 1 20 19 21 +8 1 23 22 24 +9 1 26 25 27 +10 1 29 28 30 +11 1 32 31 33 +12 1 35 34 36 +13 1 38 37 39 +14 1 41 40 42 +15 1 44 43 45 +16 1 47 46 48 +17 1 50 49 51 +18 1 53 52 54 +19 1 56 55 57 +20 1 59 58 60 +21 1 62 61 63 +22 1 65 64 66 +23 1 68 67 69 +24 1 71 70 72 +25 1 74 73 75 +26 1 77 76 78 +27 1 80 79 81 +28 1 83 82 84 +29 1 86 85 87 +30 1 89 88 90 +31 1 92 91 93 +32 1 95 94 96 +33 1 98 97 99 +34 1 101 100 102 +35 1 104 103 105 +36 1 107 106 108 +37 1 110 109 111 +38 1 113 112 114 +39 1 116 115 117 +40 1 119 118 120 +41 1 122 121 123 +42 1 125 124 126 +43 1 128 127 129 +44 1 131 130 132 +45 1 134 133 135 +46 1 137 136 138 +47 1 140 139 141 +48 1 143 142 144 +49 1 146 145 147 +50 1 149 148 150 +51 1 152 151 153 +52 1 155 154 156 +53 1 158 157 159 +54 1 161 160 162 +55 1 164 163 165 +56 1 167 166 168 +57 1 170 169 171 +58 1 173 172 174 +59 1 176 175 177 +60 1 179 178 180 +61 1 182 181 183 +62 1 185 184 186 +63 1 188 187 189 +64 1 191 190 192 +65 1 194 193 195 +66 1 197 196 198 +67 1 200 199 201 +68 1 203 202 204 +69 1 206 205 207 +70 1 209 208 210 +71 1 212 211 213 +72 1 215 214 216 +73 1 218 217 219 +74 1 221 220 222 +75 1 224 223 225 +76 1 227 226 228 +77 1 230 229 231 +78 1 233 232 234 +79 1 236 235 237 +80 1 239 238 240 +81 1 242 241 243 +82 1 245 244 246 +83 1 248 247 249 +84 1 251 250 252 +85 1 254 253 255 +86 1 257 256 258 +87 1 260 259 261 +88 1 263 262 264 +89 1 266 265 267 +90 1 269 268 270 +91 1 272 271 273 +92 1 275 274 276 +93 1 278 277 279 +94 1 281 280 282 +95 1 284 283 285 +96 1 287 286 288 +97 1 290 289 291 +98 1 293 292 294 +99 1 296 295 297 +100 1 299 298 300 +101 1 302 301 303 +102 1 305 304 306 +103 1 308 307 309 +104 1 311 310 312 +105 1 314 313 315 +106 1 317 316 318 +107 1 320 319 321 +108 1 323 322 324 +109 1 326 325 327 +110 1 329 328 330 +111 1 332 331 333 +112 1 335 334 336 +113 1 338 337 339 +114 1 341 340 342 +115 1 344 343 345 +116 1 347 346 348 +117 1 350 349 351 +118 1 353 352 354 +119 1 356 355 357 +120 1 359 358 360 +121 1 362 361 363 +122 1 365 364 366 +123 1 368 367 369 +124 1 371 370 372 +125 1 374 373 375 +126 1 377 376 378 +127 1 380 379 381 +128 1 383 382 384 +129 1 386 385 387 +130 1 389 388 390 +131 1 392 391 393 +132 1 395 394 396 +133 1 398 397 399 +134 1 401 400 402 +135 1 404 403 405 +136 1 407 406 408 +137 1 410 409 411 +138 1 413 412 414 +139 1 416 415 417 +140 1 419 418 420 +141 1 422 421 423 +142 1 425 424 426 +143 1 428 427 429 +144 1 431 430 432 +145 1 434 433 435 +146 1 437 436 438 +147 1 440 439 441 +148 1 443 442 444 +149 1 446 445 447 +150 1 449 448 450 +151 1 452 451 453 +152 1 455 454 456 +153 1 458 457 459 +154 1 461 460 462 +155 1 464 463 465 +156 1 467 466 468 +157 1 470 469 471 +158 1 473 472 474 +159 1 476 475 477 +160 1 479 478 480 +161 1 482 481 483 +162 1 485 484 486 +163 1 488 487 489 +164 1 491 490 492 +165 1 494 493 495 +166 1 497 496 498 +167 1 500 499 501 +168 1 503 502 504 +169 1 506 505 507 +170 1 509 508 510 +171 1 512 511 513 +172 1 515 514 516 +173 1 518 517 519 +174 1 521 520 522 +175 1 524 523 525 +176 1 527 526 528 +177 1 530 529 531 +178 1 533 532 534 +179 1 536 535 537 +180 1 539 538 540 +181 1 542 541 543 +182 1 545 544 546 +183 1 548 547 549 +184 1 551 550 552 +185 1 554 553 555 +186 1 557 556 558 +187 1 560 559 561 +188 1 563 562 564 +189 1 566 565 567 +190 1 569 568 570 +191 1 572 571 573 +192 1 575 574 576 +193 1 578 577 579 +194 1 581 580 582 +195 1 584 583 585 +196 1 587 586 588 +197 1 590 589 591 +198 1 593 592 594 +199 1 596 595 597 +200 1 599 598 600 +201 1 602 601 603 +202 1 605 604 606 +203 1 608 607 609 +204 1 611 610 612 +205 1 614 613 615 +206 1 617 616 618 +207 1 620 619 621 +208 1 623 622 624 +209 1 626 625 627 +210 1 629 628 630 +211 1 632 631 633 +212 1 635 634 636 +213 1 638 637 639 +214 1 641 640 642 +215 1 644 643 645 +216 1 647 646 648 +217 1 650 649 651 +218 1 653 652 654 +219 1 656 655 657 +220 1 659 658 660 +221 1 662 661 663 +222 1 665 664 666 +223 1 668 667 669 +224 1 671 670 672 +225 1 674 673 675 +226 1 677 676 678 +227 1 680 679 681 +228 1 683 682 684 +229 1 686 685 687 +230 1 689 688 690 +231 1 692 691 693 +232 1 695 694 696 +233 1 698 697 699 +234 1 701 700 702 +235 1 704 703 705 +236 1 707 706 708 +237 1 710 709 711 +238 1 713 712 714 +239 1 716 715 717 +240 1 719 718 720 +241 1 722 721 723 +242 1 725 724 726 +243 1 728 727 729 +244 1 731 730 732 +245 1 734 733 735 +246 1 737 736 738 +247 1 740 739 741 +248 1 743 742 744 +249 1 746 745 747 +250 1 749 748 750 +251 1 752 751 753 +252 1 755 754 756 +253 1 758 757 759 +254 1 761 760 762 +255 1 764 763 765 +256 1 767 766 768 +257 1 770 769 771 +258 1 773 772 774 +259 1 776 775 777 +260 1 779 778 780 +261 1 782 781 783 +262 1 785 784 786 +263 1 788 787 789 +264 1 791 790 792 +265 1 794 793 795 +266 1 797 796 798 +267 1 800 799 801 +268 1 803 802 804 +269 1 806 805 807 +270 1 809 808 810 +271 1 812 811 813 +272 1 815 814 816 +273 1 818 817 819 +274 1 821 820 822 +275 1 824 823 825 +276 1 827 826 828 +277 1 830 829 831 +278 1 833 832 834 +279 1 836 835 837 +280 1 839 838 840 +281 1 842 841 843 +282 1 845 844 846 +283 1 848 847 849 +284 1 851 850 852 +285 1 854 853 855 +286 1 857 856 858 +287 1 860 859 861 +288 1 863 862 864 +289 1 866 865 867 +290 1 869 868 870 +291 1 872 871 873 +292 1 875 874 876 +293 1 878 877 879 +294 1 881 880 882 +295 1 884 883 885 +296 1 887 886 888 +297 1 890 889 891 +298 1 893 892 894 +299 1 896 895 897 +300 1 899 898 900 +301 1 902 901 903 +302 1 905 904 906 +303 1 908 907 909 +304 1 911 910 912 +305 1 914 913 915 +306 1 917 916 918 +307 1 920 919 921 +308 1 923 922 924 +309 1 926 925 927 +310 1 929 928 930 +311 1 932 931 933 +312 1 935 934 936 +313 1 938 937 939 +314 1 941 940 942 +315 1 944 943 945 +316 1 947 946 948 +317 1 950 949 951 +318 1 953 952 954 +319 1 956 955 957 +320 1 959 958 960 +321 1 962 961 963 +322 1 965 964 966 +323 1 968 967 969 +324 1 971 970 972 +325 1 974 973 975 +326 1 977 976 978 +327 1 980 979 981 +328 1 983 982 984 +329 1 986 985 987 +330 1 989 988 990 +331 1 992 991 993 +332 1 995 994 996 +333 1 998 997 999 +334 1 1001 1000 1002 +335 1 1004 1003 1005 +336 1 1007 1006 1008 +337 1 1010 1009 1011 +338 1 1013 1012 1014 +339 1 1016 1015 1017 +340 1 1019 1018 1020 +341 1 1022 1021 1023 +342 1 1025 1024 1026 +343 1 1028 1027 1029 +344 1 1031 1030 1032 +345 1 1034 1033 1035 +346 1 1037 1036 1038 +347 1 1040 1039 1041 +348 1 1043 1042 1044 +349 1 1046 1045 1047 +350 1 1049 1048 1050 +351 1 1052 1051 1053 +352 1 1055 1054 1056 +353 1 1058 1057 1059 +354 1 1061 1060 1062 +355 1 1064 1063 1065 +356 1 1067 1066 1068 +357 1 1070 1069 1071 +358 1 1073 1072 1074 +359 1 1076 1075 1077 +360 1 1079 1078 1080 +361 1 1082 1081 1083 +362 1 1085 1084 1086 +363 1 1088 1087 1089 +364 1 1091 1090 1092 +365 1 1094 1093 1095 +366 1 1097 1096 1098 +367 1 1100 1099 1101 +368 1 1103 1102 1104 +369 1 1106 1105 1107 +370 1 1109 1108 1110 +371 1 1112 1111 1113 +372 1 1115 1114 1116 +373 1 1118 1117 1119 +374 1 1121 1120 1122 +375 1 1124 1123 1125 +376 1 1127 1126 1128 +377 1 1130 1129 1131 +378 1 1133 1132 1134 +379 1 1136 1135 1137 +380 1 1139 1138 1140 +381 1 1142 1141 1143 +382 1 1145 1144 1146 +383 1 1148 1147 1149 +384 1 1151 1150 1152 +385 1 1154 1153 1155 +386 1 1157 1156 1158 +387 1 1160 1159 1161 +388 1 1163 1162 1164 +389 1 1166 1165 1167 +390 1 1169 1168 1170 +391 1 1172 1171 1173 +392 1 1175 1174 1176 +393 1 1178 1177 1179 +394 1 1181 1180 1182 +395 1 1184 1183 1185 +396 1 1187 1186 1188 +397 1 1190 1189 1191 +398 1 1193 1192 1194 +399 1 1196 1195 1197 +400 1 1199 1198 1200 +401 1 1202 1201 1203 +402 1 1205 1204 1206 +403 1 1208 1207 1209 +404 1 1211 1210 1212 +405 1 1214 1213 1215 +406 1 1217 1216 1218 +407 1 1220 1219 1221 +408 1 1223 1222 1224 +409 1 1226 1225 1227 +410 1 1229 1228 1230 +411 1 1232 1231 1233 +412 1 1235 1234 1236 +413 1 1238 1237 1239 +414 1 1241 1240 1242 +415 1 1244 1243 1245 +416 1 1247 1246 1248 +417 1 1250 1249 1251 +418 1 1253 1252 1254 +419 1 1256 1255 1257 +420 1 1259 1258 1260 +421 1 1262 1261 1263 +422 1 1265 1264 1266 +423 1 1268 1267 1269 +424 1 1271 1270 1272 +425 1 1274 1273 1275 +426 1 1277 1276 1278 +427 1 1280 1279 1281 +428 1 1283 1282 1284 +429 1 1286 1285 1287 +430 1 1289 1288 1290 +431 1 1292 1291 1293 +432 1 1295 1294 1296 +433 1 1298 1297 1299 +434 1 1301 1300 1302 +435 1 1304 1303 1305 +436 1 1307 1306 1308 +437 1 1310 1309 1311 +438 1 1313 1312 1314 +439 1 1316 1315 1317 +440 1 1319 1318 1320 +441 1 1322 1321 1323 +442 1 1325 1324 1326 +443 1 1328 1327 1329 +444 1 1331 1330 1332 +445 1 1334 1333 1335 +446 1 1337 1336 1338 +447 1 1340 1339 1341 +448 1 1343 1342 1344 +449 1 1346 1345 1347 +450 1 1349 1348 1350 +451 1 1352 1351 1353 +452 1 1355 1354 1356 +453 1 1358 1357 1359 +454 1 1361 1360 1362 +455 1 1364 1363 1365 +456 1 1367 1366 1368 +457 1 1370 1369 1371 +458 1 1373 1372 1374 +459 1 1376 1375 1377 +460 1 1379 1378 1380 +461 1 1382 1381 1383 +462 1 1385 1384 1386 +463 1 1388 1387 1389 +464 1 1391 1390 1392 +465 1 1394 1393 1395 +466 1 1397 1396 1398 +467 1 1400 1399 1401 +468 1 1403 1402 1404 +469 1 1406 1405 1407 +470 1 1409 1408 1410 +471 1 1412 1411 1413 +472 1 1415 1414 1416 +473 1 1418 1417 1419 +474 1 1421 1420 1422 +475 1 1424 1423 1425 +476 1 1427 1426 1428 +477 1 1430 1429 1431 +478 1 1433 1432 1434 +479 1 1436 1435 1437 +480 1 1439 1438 1440 +481 1 1442 1441 1443 +482 1 1445 1444 1446 +483 1 1448 1447 1449 +484 1 1451 1450 1452 +485 1 1454 1453 1455 +486 1 1457 1456 1458 +487 1 1460 1459 1461 +488 1 1463 1462 1464 +489 1 1466 1465 1467 +490 1 1469 1468 1470 +491 1 1472 1471 1473 +492 1 1475 1474 1476 +493 1 1478 1477 1479 +494 1 1481 1480 1482 +495 1 1484 1483 1485 +496 1 1487 1486 1488 +497 1 1490 1489 1491 +498 1 1493 1492 1494 +499 1 1496 1495 1497 +500 1 1499 1498 1500 +501 1 1502 1501 1503 +502 1 1505 1504 1506 +503 1 1508 1507 1509 +504 1 1511 1510 1512 +505 1 1514 1513 1515 +506 1 1517 1516 1518 +507 1 1520 1519 1521 +508 1 1523 1522 1524 +509 1 1526 1525 1527 +510 1 1529 1528 1530 +511 1 1532 1531 1533 +512 1 1535 1534 1536 +513 1 1538 1537 1539 +514 1 1541 1540 1542 +515 1 1544 1543 1545 +516 1 1547 1546 1548 +517 1 1550 1549 1551 +518 1 1553 1552 1554 +519 1 1556 1555 1557 +520 1 1559 1558 1560 +521 1 1562 1561 1563 +522 1 1565 1564 1566 +523 1 1568 1567 1569 +524 1 1571 1570 1572 +525 1 1574 1573 1575 +526 1 1577 1576 1578 +527 1 1580 1579 1581 +528 1 1583 1582 1584 +529 1 1586 1585 1587 +530 1 1589 1588 1590 +531 1 1592 1591 1593 +532 1 1595 1594 1596 +533 1 1598 1597 1599 +534 1 1601 1600 1602 +535 1 1604 1603 1605 +536 1 1607 1606 1608 +537 1 1610 1609 1611 +538 1 1613 1612 1614 +539 1 1616 1615 1617 +540 1 1619 1618 1620 +541 1 1622 1621 1623 +542 1 1625 1624 1626 +543 1 1628 1627 1629 +544 1 1631 1630 1632 +545 1 1634 1633 1635 +546 1 1637 1636 1638 +547 1 1640 1639 1641 +548 1 1643 1642 1644 +549 1 1646 1645 1647 +550 1 1649 1648 1650 +551 1 1652 1651 1653 +552 1 1655 1654 1656 +553 1 1658 1657 1659 +554 1 1661 1660 1662 +555 1 1664 1663 1665 +556 1 1667 1666 1668 +557 1 1670 1669 1671 +558 1 1673 1672 1674 +559 1 1676 1675 1677 +560 1 1679 1678 1680 +561 1 1682 1681 1683 +562 1 1685 1684 1686 +563 1 1688 1687 1689 +564 1 1691 1690 1692 +565 1 1694 1693 1695 +566 1 1697 1696 1698 +567 1 1700 1699 1701 +568 1 1703 1702 1704 +569 1 1706 1705 1707 +570 1 1709 1708 1710 +571 1 1712 1711 1713 +572 1 1715 1714 1716 +573 1 1718 1717 1719 +574 1 1721 1720 1722 +575 1 1724 1723 1725 +576 1 1727 1726 1728 +577 1 1730 1729 1731 +578 1 1733 1732 1734 +579 1 1736 1735 1737 +580 1 1739 1738 1740 +581 1 1742 1741 1743 +582 1 1745 1744 1746 +583 1 1748 1747 1749 +584 1 1751 1750 1752 +585 1 1754 1753 1755 +586 1 1757 1756 1758 +587 1 1760 1759 1761 +588 1 1763 1762 1764 +589 1 1766 1765 1767 +590 1 1769 1768 1770 +591 1 1772 1771 1773 +592 1 1775 1774 1776 +593 1 1778 1777 1779 +594 1 1781 1780 1782 +595 1 1784 1783 1785 +596 1 1787 1786 1788 +597 1 1790 1789 1791 +598 1 1793 1792 1794 +599 1 1796 1795 1797 +600 1 1799 1798 1800 +601 1 1802 1801 1803 +602 1 1805 1804 1806 +603 1 1808 1807 1809 +604 1 1811 1810 1812 +605 1 1814 1813 1815 +606 1 1817 1816 1818 +607 1 1820 1819 1821 +608 1 1823 1822 1824 +609 1 1826 1825 1827 +610 1 1829 1828 1830 +611 1 1832 1831 1833 +612 1 1835 1834 1836 +613 1 1838 1837 1839 +614 1 1841 1840 1842 +615 1 1844 1843 1845 +616 1 1847 1846 1848 +617 1 1850 1849 1851 +618 1 1853 1852 1854 +619 1 1856 1855 1857 +620 1 1859 1858 1860 +621 1 1862 1861 1863 +622 1 1865 1864 1866 +623 1 1868 1867 1869 +624 1 1871 1870 1872 +625 1 1874 1873 1875 +626 1 1877 1876 1878 +627 1 1880 1879 1881 +628 1 1883 1882 1884 +629 1 1886 1885 1887 +630 1 1889 1888 1890 +631 1 1892 1891 1893 +632 1 1895 1894 1896 +633 1 1898 1897 1899 +634 1 1901 1900 1902 +635 1 1904 1903 1905 +636 1 1907 1906 1908 +637 1 1910 1909 1911 +638 1 1913 1912 1914 +639 1 1916 1915 1917 +640 1 1919 1918 1920 +641 1 1922 1921 1923 +642 1 1925 1924 1926 +643 1 1928 1927 1929 +644 1 1931 1930 1932 +645 1 1934 1933 1935 +646 1 1937 1936 1938 +647 1 1940 1939 1941 +648 1 1943 1942 1944 +649 1 1946 1945 1947 +650 1 1949 1948 1950 +651 1 1952 1951 1953 +652 1 1955 1954 1956 +653 1 1958 1957 1959 +654 1 1961 1960 1962 +655 1 1964 1963 1965 +656 1 1967 1966 1968 +657 1 1970 1969 1971 +658 1 1973 1972 1974 +659 1 1976 1975 1977 +660 1 1979 1978 1980 +661 1 1982 1981 1983 +662 1 1985 1984 1986 +663 1 1988 1987 1989 +664 1 1991 1990 1992 +665 1 1994 1993 1995 +666 1 1997 1996 1998 +667 1 2000 1999 2001 +668 1 2003 2002 2004 +669 1 2006 2005 2007 +670 1 2009 2008 2010 +671 1 2012 2011 2013 +672 1 2015 2014 2016 +673 1 2018 2017 2019 +674 1 2021 2020 2022 +675 1 2024 2023 2025 +676 1 2027 2026 2028 +677 1 2030 2029 2031 +678 1 2033 2032 2034 +679 1 2036 2035 2037 +680 1 2039 2038 2040 +681 1 2042 2041 2043 +682 1 2045 2044 2046 +683 1 2048 2047 2049 +684 1 2051 2050 2052 +685 1 2054 2053 2055 +686 1 2057 2056 2058 +687 1 2060 2059 2061 +688 1 2063 2062 2064 +689 1 2066 2065 2067 +690 1 2069 2068 2070 +691 1 2072 2071 2073 +692 1 2075 2074 2076 +693 1 2078 2077 2079 +694 1 2081 2080 2082 +695 1 2084 2083 2085 +696 1 2087 2086 2088 +697 1 2090 2089 2091 +698 1 2093 2092 2094 +699 1 2096 2095 2097 +700 1 2099 2098 2100 +701 1 2102 2101 2103 +702 1 2105 2104 2106 +703 1 2108 2107 2109 +704 1 2111 2110 2112 +705 1 2114 2113 2115 +706 1 2117 2116 2118 +707 1 2120 2119 2121 +708 1 2123 2122 2124 +709 1 2126 2125 2127 +710 1 2129 2128 2130 +711 1 2132 2131 2133 +712 1 2135 2134 2136 +713 1 2138 2137 2139 +714 1 2141 2140 2142 +715 1 2144 2143 2145 +716 1 2147 2146 2148 +717 1 2150 2149 2151 +718 1 2153 2152 2154 +719 1 2156 2155 2157 +720 1 2159 2158 2160 +721 1 2162 2161 2163 +722 1 2165 2164 2166 +723 1 2168 2167 2169 +724 1 2171 2170 2172 +725 1 2174 2173 2175 +726 1 2177 2176 2178 +727 1 2180 2179 2181 +728 1 2183 2182 2184 +729 1 2186 2185 2187 +730 1 2189 2188 2190 +731 1 2192 2191 2193 +732 1 2195 2194 2196 +733 1 2198 2197 2199 +734 1 2201 2200 2202 +735 1 2204 2203 2205 +736 1 2207 2206 2208 +737 1 2210 2209 2211 +738 1 2213 2212 2214 +739 1 2216 2215 2217 +740 1 2219 2218 2220 +741 1 2222 2221 2223 +742 1 2225 2224 2226 +743 1 2228 2227 2229 +744 1 2231 2230 2232 +745 1 2234 2233 2235 +746 1 2237 2236 2238 +747 1 2240 2239 2241 +748 1 2243 2242 2244 +749 1 2246 2245 2247 +750 1 2249 2248 2250 +751 1 2252 2251 2253 +752 1 2255 2254 2256 +753 1 2258 2257 2259 +754 1 2261 2260 2262 +755 1 2264 2263 2265 +756 1 2267 2266 2268 +757 1 2270 2269 2271 +758 1 2273 2272 2274 +759 1 2276 2275 2277 +760 1 2279 2278 2280 +761 1 2282 2281 2283 +762 1 2285 2284 2286 +763 1 2288 2287 2289 +764 1 2291 2290 2292 +765 1 2294 2293 2295 +766 1 2297 2296 2298 +767 1 2300 2299 2301 +768 1 2303 2302 2304 +769 1 2306 2305 2307 +770 1 2309 2308 2310 +771 1 2312 2311 2313 +772 1 2315 2314 2316 +773 1 2318 2317 2319 +774 1 2321 2320 2322 +775 1 2324 2323 2325 +776 1 2327 2326 2328 +777 1 2330 2329 2331 +778 1 2333 2332 2334 +779 1 2336 2335 2337 +780 1 2339 2338 2340 +781 1 2342 2341 2343 +782 1 2345 2344 2346 +783 1 2348 2347 2349 +784 1 2351 2350 2352 +785 1 2354 2353 2355 +786 1 2357 2356 2358 +787 1 2360 2359 2361 +788 1 2363 2362 2364 +789 1 2366 2365 2367 +790 1 2369 2368 2370 +791 1 2372 2371 2373 +792 1 2375 2374 2376 +793 1 2378 2377 2379 +794 1 2381 2380 2382 +795 1 2384 2383 2385 +796 1 2387 2386 2388 +797 1 2390 2389 2391 +798 1 2393 2392 2394 +799 1 2396 2395 2397 +800 1 2399 2398 2400 +801 1 2402 2401 2403 +802 1 2405 2404 2406 +803 1 2408 2407 2409 +804 1 2411 2410 2412 +805 1 2414 2413 2415 +806 1 2417 2416 2418 +807 1 2420 2419 2421 +808 1 2423 2422 2424 +809 1 2426 2425 2427 +810 1 2429 2428 2430 +811 1 2432 2431 2433 +812 1 2435 2434 2436 +813 1 2438 2437 2439 +814 1 2441 2440 2442 +815 1 2444 2443 2445 +816 1 2447 2446 2448 +817 1 2450 2449 2451 +818 1 2453 2452 2454 +819 1 2456 2455 2457 +820 1 2459 2458 2460 +821 1 2462 2461 2463 +822 1 2465 2464 2466 +823 1 2468 2467 2469 +824 1 2471 2470 2472 +825 1 2474 2473 2475 +826 1 2477 2476 2478 +827 1 2480 2479 2481 +828 1 2483 2482 2484 +829 1 2486 2485 2487 +830 1 2489 2488 2490 +831 1 2492 2491 2493 +832 1 2495 2494 2496 +833 1 2498 2497 2499 +834 1 2501 2500 2502 +835 1 2504 2503 2505 +836 1 2507 2506 2508 +837 1 2510 2509 2511 +838 1 2513 2512 2514 +839 1 2516 2515 2517 +840 1 2519 2518 2520 +841 1 2522 2521 2523 +842 1 2525 2524 2526 +843 1 2528 2527 2529 +844 1 2531 2530 2532 +845 1 2534 2533 2535 +846 1 2537 2536 2538 +847 1 2540 2539 2541 +848 1 2543 2542 2544 +849 1 2546 2545 2547 +850 1 2549 2548 2550 +851 1 2552 2551 2553 +852 1 2555 2554 2556 +853 1 2558 2557 2559 +854 1 2561 2560 2562 +855 1 2564 2563 2565 +856 1 2567 2566 2568 +857 1 2570 2569 2571 +858 1 2573 2572 2574 +859 1 2576 2575 2577 +860 1 2579 2578 2580 +861 1 2582 2581 2583 +862 1 2585 2584 2586 +863 1 2588 2587 2589 +864 1 2591 2590 2592 +865 1 2594 2593 2595 +866 1 2597 2596 2598 +867 1 2600 2599 2601 +868 1 2603 2602 2604 +869 1 2606 2605 2607 +870 1 2609 2608 2610 +871 1 2612 2611 2613 +872 1 2615 2614 2616 +873 1 2618 2617 2619 +874 1 2621 2620 2622 +875 1 2624 2623 2625 +876 1 2627 2626 2628 +877 1 2630 2629 2631 +878 1 2633 2632 2634 +879 1 2636 2635 2637 +880 1 2639 2638 2640 +881 1 2642 2641 2643 +882 1 2645 2644 2646 +883 1 2648 2647 2649 +884 1 2651 2650 2652 +885 1 2654 2653 2655 +886 1 2657 2656 2658 +887 1 2660 2659 2661 +888 1 2663 2662 2664 +889 1 2666 2665 2667 +890 1 2669 2668 2670 +891 1 2672 2671 2673 +892 1 2675 2674 2676 +893 1 2678 2677 2679 +894 1 2681 2680 2682 +895 1 2684 2683 2685 +896 1 2687 2686 2688 +897 1 2690 2689 2691 +898 1 2693 2692 2694 +899 1 2696 2695 2697 +900 1 2699 2698 2700 +901 1 2702 2701 2703 +902 1 2705 2704 2706 +903 1 2708 2707 2709 +904 1 2711 2710 2712 +905 1 2714 2713 2715 +906 1 2717 2716 2718 +907 1 2720 2719 2721 +908 1 2723 2722 2724 +909 1 2726 2725 2727 +910 1 2729 2728 2730 +911 1 2732 2731 2733 +912 1 2735 2734 2736 +913 1 2738 2737 2739 +914 1 2741 2740 2742 +915 1 2744 2743 2745 +916 1 2747 2746 2748 +917 1 2750 2749 2751 +918 1 2753 2752 2754 +919 1 2756 2755 2757 +920 1 2759 2758 2760 +921 1 2762 2761 2763 +922 1 2765 2764 2766 +923 1 2768 2767 2769 +924 1 2771 2770 2772 +925 1 2774 2773 2775 +926 1 2777 2776 2778 +927 1 2780 2779 2781 +928 1 2783 2782 2784 +929 1 2786 2785 2787 +930 1 2789 2788 2790 +931 1 2792 2791 2793 +932 1 2795 2794 2796 +933 1 2798 2797 2799 +934 1 2801 2800 2802 +935 1 2804 2803 2805 +936 1 2807 2806 2808 +937 1 2810 2809 2811 +938 1 2813 2812 2814 +939 1 2816 2815 2817 +940 1 2819 2818 2820 +941 1 2822 2821 2823 +942 1 2825 2824 2826 +943 1 2828 2827 2829 +944 1 2831 2830 2832 +945 1 2834 2833 2835 +946 1 2837 2836 2838 +947 1 2840 2839 2841 +948 1 2843 2842 2844 +949 1 2846 2845 2847 +950 1 2849 2848 2850 +951 1 2852 2851 2853 +952 1 2855 2854 2856 +953 1 2858 2857 2859 +954 1 2861 2860 2862 +955 1 2864 2863 2865 +956 1 2867 2866 2868 +957 1 2870 2869 2871 +958 1 2873 2872 2874 +959 1 2876 2875 2877 +960 1 2879 2878 2880 +961 1 2882 2881 2883 +962 1 2885 2884 2886 +963 1 2888 2887 2889 +964 1 2891 2890 2892 +965 1 2894 2893 2895 +966 1 2897 2896 2898 +967 1 2900 2899 2901 +968 1 2903 2902 2904 +969 1 2906 2905 2907 +970 1 2909 2908 2910 +971 1 2912 2911 2913 +972 1 2915 2914 2916 +973 1 2918 2917 2919 +974 1 2921 2920 2922 +975 1 2924 2923 2925 +976 1 2927 2926 2928 +977 1 2930 2929 2931 +978 1 2933 2932 2934 +979 1 2936 2935 2937 +980 1 2939 2938 2940 +981 1 2942 2941 2943 +982 1 2945 2944 2946 +983 1 2948 2947 2949 +984 1 2951 2950 2952 +985 1 2954 2953 2955 +986 1 2957 2956 2958 +987 1 2960 2959 2961 +988 1 2963 2962 2964 +989 1 2966 2965 2967 +990 1 2969 2968 2970 +991 1 2972 2971 2973 +992 1 2975 2974 2976 +993 1 2978 2977 2979 +994 1 2981 2980 2982 +995 1 2984 2983 2985 +996 1 2987 2986 2988 +997 1 2990 2989 2991 +998 1 2993 2992 2994 +999 1 2996 2995 2997 +1000 1 2999 2998 3000 +1001 1 3002 3001 3003 +1002 1 3005 3004 3006 +1003 1 3008 3007 3009 +1004 1 3011 3010 3012 +1005 1 3014 3013 3015 +1006 1 3017 3016 3018 +1007 1 3020 3019 3021 +1008 1 3023 3022 3024 +1009 1 3026 3025 3027 +1010 1 3029 3028 3030 +1011 1 3032 3031 3033 +1012 1 3035 3034 3036 +1013 1 3038 3037 3039 +1014 1 3041 3040 3042 +1015 1 3044 3043 3045 +1016 1 3047 3046 3048 +1017 1 3050 3049 3051 +1018 1 3053 3052 3054 +1019 1 3056 3055 3057 +1020 1 3059 3058 3060 +1021 1 3062 3061 3063 +1022 1 3065 3064 3066 +1023 1 3068 3067 3069 +1024 1 3071 3070 3072 + diff --git a/examples/PACKAGES/fep/ta/in.spce.lmp b/examples/PACKAGES/fep/ta/in.spce.lmp new file mode 100644 index 0000000000..a9464cc7be --- /dev/null +++ b/examples/PACKAGES/fep/ta/in.spce.lmp @@ -0,0 +1,49 @@ + +units real +boundary p p p + +atom_style full +bond_style harmonic +angle_style harmonic + +special_bonds lj/coul 0.0 0.0 0.5 + +pair_style lj/cut/coul/long 12.0 12.0 +pair_modify tail no +kspace_style pppm 1.0e-5 + +read_data data.spce # 8x8x16 SPCE molecules in a 30x30x100 box + +bond_coeff 1 517.630258 1.0 +angle_coeff 1 37.950526 109.47 +pair_coeff 1 1 0.1553 3.166 # O O +pair_coeff 1 2 0.0 1.0 # O H +pair_coeff 2 2 0.0 1.0 # H H + +# don't use fix shake with compute fep/ta +# fix SHAKE all shake 0.0001 20 0 b 1 + +neighbor 2.0 bin +# neigh_modify delay 0 every 1 check yes + +timestep 1.0 + +variable TK equal 300.0 +compute TA all fep/ta ${TK} xy 1.0005 + +velocity all create ${TK} 12345 + +thermo_style custom step temp press etotal pe c_TA[*] +thermo 5000 + +fix NVT all nvt temp ${TK} ${TK} 100 +run 300000 + +reset_timestep 0 + +variable gamma_v equal 100*(pzz-0.5*(pxx+pyy))/2/100 # surface tension via the mechanical route + +fix FEP all ave/time 100 1000 100000 c_TA[*] v_gamma_v ave running file spce.fep.ta + +run 2000000 + diff --git a/examples/PACKAGES/fep/ta/log.spce b/examples/PACKAGES/fep/ta/log.spce new file mode 100644 index 0000000000..96bb1bd351 --- /dev/null +++ b/examples/PACKAGES/fep/ta/log.spce @@ -0,0 +1,689 @@ +LAMMPS (17 Feb 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +package gpu 0 + +units real +boundary p p p + +atom_style full +bond_style harmonic +angle_style harmonic + +special_bonds lj/coul 0.0 0.0 0.5 + +pair_style lj/cut/coul/long 12.0 12.0 +pair_modify tail no +kspace_style pppm 1.0e-5 + +read_data data.spce # 8x8x16 SPCE molecules in a 30x30x100 box +Reading data file ... + orthogonal box = (0 0 0) to (30 30 100) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 3072 atoms + scanning bonds ... + 2 = max bonds/atom + scanning angles ... + 1 = max angles/atom + reading bonds ... + 2048 bonds + reading angles ... + 1024 angles +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0.5 + special bond factors coul: 0 0 0.5 + 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.001 seconds + read_data CPU = 0.006 seconds + +bond_coeff 1 517.630258 1.0 +angle_coeff 1 37.950526 109.47 +pair_coeff 1 1 0.1553 3.166 # O O +pair_coeff 1 2 0.0 1.0 # O H +pair_coeff 2 2 0.0 1.0 # H H + +# don't use fix shake with compute fep/ta +# fix SHAKE all shake 0.0001 20 0 b 1 + +neighbor 2.0 bin +# neigh_modify delay 0 every 1 check yes + +timestep 1.0 + +variable TK equal 300.0 +compute TA all fep/ta ${TK} xy 1.0005 +compute TA all fep/ta 300 xy 1.0005 + +velocity all create ${TK} 12345 +velocity all create 300 12345 + +thermo_style custom step temp press etotal pe c_TA[*] +thermo 5000 + +fix NVT all nvt temp ${TK} ${TK} 100 +fix NVT all nvt temp 300 ${TK} 100 +fix NVT all nvt temp 300 300 100 +run 300000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- GPU package (short-range, long-range and three-body potentials): + +@Article{Brown11, + author = {W. M. Brown, P. Wang, S. J. Plimpton, A. N. Tharrington}, + title = {Implementing Molecular Dynamics on Hybrid High Performance Computers - Short Range Forces}, + journal = {Comp.~Phys.~Comm.}, + year = 2011, + volume = 182, + pages = {898--911} +} + +@Article{Brown12, + author = {W. M. Brown, A. Kohlmeyer, S. J. Plimpton, A. N. Tharrington}, + title = {Implementing Molecular Dynamics on Hybrid High Performance Computers - Particle-Particle Particle-Mesh}, + journal = {Comp.~Phys.~Comm.}, + year = 2012, + volume = 183, + pages = {449--459} +} + +@Article{Brown13, + author = {W. M. Brown, Y. Masako}, + title = {Implementing Molecular Dynamics on Hybrid High Performance Computers – Three-Body Potentials}, + journal = {Comp.~Phys.~Comm.}, + year = 2013, + volume = 184, + pages = {2785--2793} +} + +@Article{Trung15, + author = {T. D. Nguyen, S. J. Plimpton}, + title = {Accelerating dissipative particle dynamics simulations for soft matter systems}, + journal = {Comput.~Mater.~Sci.}, + year = 2015, + volume = 100, + pages = {173--180} +} + +@Article{Trung17, + author = {T. D. Nguyen}, + title = {GPU-accelerated Tersoff potentials for massively parallel Molecular Dynamics simulations}, + journal = {Comp.~Phys.~Comm.}, + year = 2017, + volume = 212, + pages = {113--122} +} + +@Article{Nikolskiy19, + author = {V. Nikolskiy, V. Stegailov}, + title = {GPU acceleration of four-site water models in LAMMPS}, + journal = {Proceeding of the International Conference on Parallel Computing (ParCo 2019), Prague, Czech Republic}, + year = 2019 +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +PPPM initialization ... + using 12-bit tables for long-range coulomb (src/kspace.cpp:340) + G vector (1/distance) = 0.24270009 + grid = 20 20 50 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0037271514 + estimated relative force accuracy = 1.1224206e-05 + using double precision FFTW3 + 3d grid and FFT values/proc = 40824 20000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +FEP/TA settings ... + temperature = 300.000000 + scale factor = 1.000500 + tail no +Per MPI rank memory allocation (min/avg/max) = 10.59 | 10.59 | 10.59 Mbytes + Step Temp Press TotEng PotEng c_TA[1] c_TA[2] c_TA[3] + 0 300 5742.8831 8061.6965 5315.4762 -10.940045 93249708 0.45 + 5000 301.43029 -118.64017 -7888.4723 -10647.786 -0.13617205 1.2566061 0.45 + 10000 294.49018 -301.44062 -8063.3808 -10759.164 -0.14897537 1.2838851 0.45 + 15000 294.36123 -407.07728 -8189.2912 -10883.894 0.34568257 0.55998421 0.45 + 20000 300.95171 111.50248 -8104.1193 -10859.052 0.11293291 0.82742794 0.45 + 25000 300.28473 388.00598 -8147.8655 -10896.692 0.11270184 0.82774872 0.45 + 30000 306.62229 -113.93849 -8191.7529 -10998.594 0.26068823 0.6457922 0.45 + 35000 303.66349 -426.81556 -8269.8364 -11049.593 0.78191631 0.26939311 0.45 + 40000 291.70214 -50.50854 -8368.0775 -11038.339 0.20120788 0.71354814 0.45 + 45000 299.74326 -289.18081 -8346.2716 -11090.142 0.4163404 0.49739645 0.45 + 50000 300.53193 36.834691 -8367.5726 -11118.662 0.20517137 0.70881996 0.45 + 55000 298.20207 -107.76906 -8274.386 -11004.148 0.7409946 0.2885342 0.45 + 60000 298.32558 -65.20542 -8433.4884 -11164.381 0.16210976 0.76191344 0.45 + 65000 297.3149 -102.87381 -8379.2515 -11100.892 0.21193701 0.70082127 0.45 + 70000 300.78423 -463.75811 -8381.3317 -11134.731 0.32109349 0.58356406 0.45 + 75000 299.53099 -53.264996 -8495.159 -11237.086 0.44828935 0.47144212 0.45 + 80000 295.55879 -590.1244 -8432.3435 -11137.909 0.28788374 0.61699451 0.45 + 85000 298.73289 -234.73297 -8473.8721 -11208.493 -0.11723275 1.2173128 0.45 + 90000 307.02709 -264.9035 -8303.7625 -11114.309 -0.098959935 1.1805672 0.45 + 95000 304.79112 199.8891 -8364.2553 -11154.334 0.036986735 0.93984396 0.45 + 100000 295.49748 -743.18974 -8453.8066 -11158.811 0.249981 0.65749559 0.45 + 105000 303.11352 -163.70166 -8324.4846 -11099.206 -0.012286442 1.0208231 0.45 + 110000 294.30278 -33.731015 -8512.8168 -11206.884 -0.0129379 1.0219392 0.45 + 115000 293.65421 393.24871 -8481.1933 -11169.324 0.75255277 0.28299408 0.45 + 120000 300.56448 16.832298 -8507.3819 -11258.769 0.13389897 0.79883437 0.45 + 125000 297.92506 -398.77893 -8576.4403 -11303.666 0.07292658 0.88485917 0.45 + 130000 303.007 -589.11865 -8560.7259 -11334.472 0.42876446 0.48713794 0.45 + 135000 310.82674 -203.4991 -8565.3181 -11410.647 0.075268046 0.88139064 0.45 + 140000 303.68345 -710.20709 -8570.895 -11350.834 -0.1023741 1.1873476 0.45 + 145000 293.86825 129.05781 -8457.0747 -11147.165 0.39475138 0.51573896 0.45 + 150000 296.93136 -734.03863 -8577.2763 -11295.406 0.73600373 0.29095985 0.45 + 155000 296.67522 -290.20206 -8631.0579 -11346.843 -0.30049664 1.6554154 0.45 + 160000 301.5685 -656.03394 -8646.3196 -11406.898 0.08494101 0.86720512 0.45 + 165000 295.8808 342.45206 -8602.0309 -11310.544 -0.30873864 1.6784606 0.45 + 170000 303.33048 -64.144957 -8580.8446 -11357.552 0.13622456 0.79572423 0.45 + 175000 300.75245 -908.44969 -8566.8005 -11319.909 0.15795135 0.76724659 0.45 + 180000 301.34603 -350.00512 -8489.0111 -11247.553 0.21089487 0.70204744 0.45 + 185000 305.96254 62.840515 -8458.0542 -11258.856 -0.050029338 1.0875408 0.45 + 190000 300.14392 256.935 -8684.6591 -11432.197 0.40144188 0.50998337 0.45 + 195000 299.32366 -218.70113 -8505.3328 -11245.362 -0.19428451 1.3852659 0.45 + 200000 307.89424 -569.89954 -8615.1541 -11433.639 0.55121888 0.39668508 0.45 + 205000 299.34873 334.69765 -8657.6353 -11397.894 0.17751997 0.74247109 0.45 + 210000 298.54619 -261.12193 -8601.2439 -11334.156 0.74219016 0.28795615 0.45 + 215000 304.02395 -306.81112 -8531.9913 -11315.047 0.86987192 0.23244073 0.45 + 220000 299.95916 278.60921 -8682.394 -11428.24 -0.26474202 1.559051 0.45 + 225000 302.839 -226.36906 -8515.0815 -11287.29 0.060381353 0.90367684 0.45 + 230000 299.54085 240.08589 -8636.8991 -11378.916 -0.46699438 2.1887589 0.45 + 235000 297.62792 -138.20813 -8627.0888 -11351.595 -0.035013312 1.0604901 0.45 + 240000 299.15558 442.88999 -8749.2731 -11487.763 0.14696819 0.78151268 0.45 + 245000 291.76323 174.70322 -8597.8808 -11268.701 -0.3979188 1.9492946 0.45 + 250000 308.21961 37.282506 -8603.7127 -11425.176 0.021882894 0.96395922 0.45 + 255000 307.18484 -493.77408 -8459.5942 -11271.585 0.16914044 0.75298079 0.45 + 260000 294.17364 -238.05366 -8677.8379 -11370.723 -0.35710078 1.8202968 0.45 + 265000 289.14461 -304.12454 -8727.2613 -11374.111 0.18045129 0.73882932 0.45 + 270000 301.51228 -255.75558 -8640.9577 -11401.022 0.49252861 0.43772444 0.45 + 275000 294.98349 -351.00974 -8678.3965 -11378.695 -0.31576914 1.6983718 0.45 + 280000 294.37376 279.87325 -8668.9575 -11363.675 0.26328091 0.64298978 0.45 + 285000 295.68351 249.3086 -8748.533 -11455.24 0.6820904 0.31849899 0.45 + 290000 298.74266 -749.43024 -8583.8679 -11318.578 0.030414997 0.95026156 0.45 + 295000 292.67215 -573.39647 -8713.3223 -11392.463 0.25656615 0.65027291 0.45 + 300000 302.48853 186.71329 -8655.8918 -11424.892 0.20319721 0.71117107 0.45 +Loop time of 706.805 on 1 procs for 300000 steps with 3072 atoms + +Performance: 36.672 ns/day, 0.654 hours/ns, 424.445 timesteps/s +95.4% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 149.88 | 149.88 | 149.88 | 0.0 | 21.21 +Bond | 17.824 | 17.824 | 17.824 | 0.0 | 2.52 +Kspace | 517.46 | 517.46 | 517.46 | 0.0 | 73.21 +Neigh | 1.3789 | 1.3789 | 1.3789 | 0.0 | 0.20 +Comm | 9.412 | 9.412 | 9.412 | 0.0 | 1.33 +Output | 0.092 | 0.092 | 0.092 | 0.0 | 0.01 +Modify | 8.3026 | 8.3026 | 8.3026 | 0.0 | 1.17 +Other | | 2.458 | | | 0.35 + +Nlocal: 3072 ave 3072 max 3072 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 8370 ave 8370 max 8370 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 + +Total # of neighbors = -1 +Ave neighs/atom = -0.00032552083 +Ave special neighs/atom = 2 +Neighbor list builds = 14698 +Dangerous builds = 21 + +reset_timestep 0 + +variable gamma_v equal 100*(pzz-0.5*(pxx+pyy))/2/100 # surface tension via the mechanical route + +fix FEP all ave/time 100 1000 100000 c_TA[*] v_gamma_v ave running file spce.fep.ta + +run 2000000 +PPPM initialization ... + using 12-bit tables for long-range coulomb (src/kspace.cpp:340) + G vector (1/distance) = 0.24270009 + grid = 20 20 50 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0037271514 + estimated relative force accuracy = 1.1224206e-05 + using double precision FFTW3 + 3d grid and FFT values/proc = 40824 20000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 10.61 | 10.61 | 10.61 Mbytes + Step Temp Press TotEng PotEng c_TA[1] c_TA[2] c_TA[3] + 0 302.48853 186.71327 -8655.8918 -11424.892 0.20325452 0.71110271 0.45 + 5000 296.71986 -573.544 -8510.0832 -11226.277 0.43636365 0.48096787 0.45 + 10000 302.58189 314.36295 -8636.8139 -11406.669 0.005932853 0.99009761 0.45 + 15000 296.98096 -950.66627 -8635.9066 -11354.49 0.48058674 0.44658101 0.45 + 20000 297.11923 -474.65836 -8666.9864 -11386.836 0.27933535 0.62590536 0.45 + 25000 302.26474 -621.83271 -8655.4227 -11422.375 0.01931686 0.96811729 0.45 + 30000 300.37645 -358.95128 -8568.7732 -11318.44 0.25415456 0.65290873 0.45 + 35000 296.5436 179.71411 -8665.0335 -11379.614 0.1911473 0.72569185 0.45 + 40000 300.79459 92.193193 -8617.7807 -11371.275 0.27587113 0.629553 0.45 + 45000 298.87827 220.06674 -8695.83 -11431.782 0.28715816 0.61774591 0.45 + 50000 304.4095 -375.31266 -8614.4396 -11401.025 -0.18683272 1.3680584 0.45 + 55000 305.11287 128.51602 -8559.8245 -11352.848 0.24122754 0.66722084 0.45 + 60000 296.56241 302.30371 -8725.6357 -11440.388 -0.27104279 1.5756158 0.45 + 65000 295.78468 -393.18931 -8716.4616 -11424.095 0.39132466 0.51871194 0.45 + 70000 297.67504 155.75977 -8641.2451 -11366.182 0.031194864 0.94901929 0.45 + 75000 298.81381 -207.51201 -8622.9859 -11358.348 -0.11330086 1.2093106 0.45 + 80000 296.17928 -360.65589 -8679.0048 -11390.25 0.68794433 0.31538684 0.45 + 85000 303.90294 488.01134 -8643.2028 -11425.151 0.41330713 0.49993365 0.45 + 90000 296.49425 14.901201 -8636.0539 -11350.182 -0.21538319 1.4351695 0.45 + 95000 308.63505 137.10659 -8570.395 -11395.661 0.51407684 0.42218544 0.45 + 100000 302.56638 -402.80803 -8635.0157 -11404.729 0.1552006 0.77079493 0.45 + 105000 293.79289 -417.74599 -8626.2538 -11315.654 -0.13491963 1.253969 0.45 + 110000 293.52504 -808.94658 -8684.9259 -11371.874 0.20573374 0.70815164 0.45 + 115000 307.6821 132.78071 -8639.817 -11456.36 -0.67060193 3.0798018 0.45 + 120000 303.22974 121.87128 -8714.7295 -11490.515 0.3675961 0.5397742 0.45 + 125000 303.8202 -34.518279 -8625.1384 -11406.329 0.17151619 0.74998608 0.45 + 130000 294.5718 -508.86133 -8684.9608 -11381.491 0.23323323 0.67622827 0.45 + 135000 302.79866 -445.99091 -8627.6163 -11399.456 0.3300839 0.57482965 0.45 + 140000 297.84052 -78.442467 -8621.5234 -11347.976 0.39157424 0.51849484 0.45 + 145000 303.64247 463.89678 -8673.8591 -11453.423 0.39692857 0.51385891 0.45 + 150000 288.38239 28.567607 -8789.6464 -11429.518 -0.045509865 1.0793274 0.45 + 155000 296.02581 -111.35664 -8674.295 -11384.135 0.23313764 0.67633671 0.45 + 160000 307.72004 -410.73956 -8578.8169 -11395.707 0.28485416 0.62013794 0.45 + 165000 300.42279 -483.56039 -8598.0354 -11348.126 0.38342507 0.52563101 0.45 + 170000 302.51326 -150.99512 -8626.2426 -11395.469 0.2439355 0.66419697 0.45 + 175000 295.41161 -554.9058 -8760.0201 -11464.238 0.38186652 0.52700696 0.45 + 180000 296.21987 -194.97724 -8645.4143 -11357.031 0.098453456 0.84777037 0.45 + 185000 296.52352 -186.85833 -8690.0538 -11404.45 0.6348999 0.34473516 0.45 + 190000 304.72799 -60.2868 -8667.2005 -11456.701 0.1885985 0.72880108 0.45 + 195000 306.65221 -871.17267 -8679.3434 -11486.458 0.56138735 0.38997638 0.45 + 200000 301.07509 362.96369 -8616.9867 -11373.048 -0.53126323 2.4379049 0.45 + 205000 303.65587 -216.8767 -8564.3182 -11344.005 0.11046546 0.83085967 0.45 + 210000 296.20891 -474.08356 -8698.3778 -11409.894 -0.11237476 1.2074335 0.45 + 215000 295.37276 422.46284 -8714.4636 -11418.326 0.042757549 0.93079022 0.45 + 220000 301.20663 -202.20616 -8577.1827 -11334.449 0.30387837 0.60066105 0.45 + 225000 306.20481 -90.566175 -8503.5134 -11306.533 0.29188403 0.6128683 0.45 + 230000 303.54253 -24.255163 -8641.8724 -11420.521 -0.38522168 1.9082173 0.45 + 235000 300.29265 -572.08074 -8664.2779 -11413.177 0.48055356 0.44660587 0.45 + 240000 302.90712 -226.88617 -8636.6962 -11409.528 -0.15295452 1.2924832 0.45 + 245000 305.05222 -68.241521 -8591.0885 -11383.557 -0.19850824 1.3951152 0.45 + 250000 300.27784 -46.680162 -8746.7288 -11495.492 -0.0098493376 1.0166585 0.45 + 255000 308.23091 -424.64171 -8573.7405 -11395.307 0.1366107 0.79520901 0.45 + 260000 296.11619 4.6901264 -8742.1916 -11452.859 -0.12450429 1.2322516 0.45 + 265000 301.62359 134.42152 -8565.5323 -11326.615 -0.028534957 1.0490284 0.45 + 270000 306.71999 -62.484213 -8690.7983 -11498.534 0.28432443 0.62068922 0.45 + 275000 292.91982 532.15442 -8779.2684 -11460.676 -0.40898808 1.9858264 0.45 + 280000 306.88024 -339.05165 -8557.2761 -11366.479 0.12573772 0.80984534 0.45 + 285000 303.38798 617.66326 -8630.5787 -11407.813 -0.1310487 1.2458532 0.45 + 290000 299.66094 302.90333 -8692.267 -11435.383 0.65063395 0.33575584 0.45 + 295000 304.49009 656.72392 -8710.7918 -11498.115 -0.16849302 1.3266137 0.45 + 300000 303.80861 -221.66912 -8688.9465 -11470.031 -0.24985266 1.5205954 0.45 + 305000 300.67136 -498.92059 -8669.6648 -11422.031 0.19219443 0.72441833 0.45 + 310000 305.7021 -521.59218 -8505.6751 -11304.093 0.52013748 0.4179152 0.45 + 315000 302.66313 -359.25677 -8682.4925 -11453.091 -0.26135382 1.5502155 0.45 + 320000 304.5646 441.04962 -8610.9569 -11398.962 0.41662005 0.49716319 0.45 + 325000 300.04934 -142.59053 -8698.3246 -11444.997 -0.23029219 1.4715132 0.45 + 330000 305.55522 -212.47771 -8576.3678 -11373.441 0.091594168 0.85758093 0.45 + 335000 294.79439 -151.62761 -8762.4565 -11461.024 0.14345357 0.78613362 0.45 + 340000 302.4373 463.41717 -8643.2588 -11411.79 0.36279978 0.54413438 0.45 + 345000 295.91624 -272.3623 -8678.9725 -11387.81 0.1032874 0.84092407 0.45 + 350000 300.60829 62.418773 -8633.2343 -11385.023 -0.040578988 1.0704371 0.45 + 355000 301.41802 -860.82496 -8573.5867 -11332.788 0.04947461 0.9203617 0.45 + 360000 298.03103 -265.05516 -8619.4232 -11347.619 -0.20903224 1.4199617 0.45 + 365000 298.08727 -359.76277 -8612.4898 -11341.201 0.040109682 0.93493354 0.45 + 370000 301.55162 -339.05976 -8687.3746 -11447.799 0.1705358 0.75122045 0.45 + 375000 299.3933 -290.38029 -8723.9515 -11464.618 -0.1476 1.2809266 0.45 + 380000 303.02442 -1104.7914 -8626.7252 -11400.631 0.3211992 0.58346059 0.45 + 385000 301.49421 -613.53228 -8662.2479 -11422.146 -0.42642873 2.0447796 0.45 + 390000 302.01134 -351.23257 -8662.4664 -11427.099 0.23747904 0.67142935 0.45 + 395000 307.32962 -443.86959 -8624.8646 -11438.181 0.17359502 0.74737541 0.45 + 400000 301.67955 -253.92045 -8690.6143 -11452.209 -0.43779134 2.0841261 0.45 + 405000 302.60773 -97.544471 -8646.8281 -11416.92 0.071259831 0.88733652 0.45 + 410000 302.48853 -630.99507 -8710.4497 -11479.45 0.28763517 0.61725182 0.45 + 415000 296.46562 -443.33457 -8763.0661 -11476.932 0.088532948 0.86199583 0.45 + 420000 295.37803 -70.515081 -8720.0027 -11423.913 0.06359365 0.89882065 0.45 + 425000 299.31069 -48.284153 -8678.6115 -11418.522 0.063520704 0.89893064 0.45 + 430000 296.37918 -651.48627 -8784.4246 -11497.5 -0.0094249768 1.0159351 0.45 + 435000 303.07145 -284.10404 -8558.3149 -11332.651 0.034731239 0.94340646 0.45 + 440000 293.1823 -280.18182 -8707.2432 -11391.054 0.14151034 0.78870025 0.45 + 445000 305.55617 -286.4858 -8646.9315 -11444.013 0.26166889 0.64473078 0.45 + 450000 300.67206 102.89156 -8705.2376 -11457.61 0.88202179 0.2277515 0.45 + 455000 304.23258 9.5792632 -8571.8771 -11356.843 -0.42835558 2.0513992 0.45 + 460000 292.30355 265.8009 -8707.4453 -11383.212 0.20592758 0.70792142 0.45 + 465000 297.62746 193.66269 -8716.5132 -11441.015 0.36938368 0.53815813 0.45 + 470000 292.53483 -75.549804 -8728.3188 -11406.202 0.49993961 0.43231669 0.45 + 475000 296.10181 -202.26042 -8657.5804 -11368.116 -0.29829888 1.6493239 0.45 + 480000 300.24953 249.20038 -8688.6705 -11437.175 0.4372485 0.48025452 0.45 + 485000 296.41241 -73.46156 -8558.9344 -11272.314 -0.15947631 1.3067001 0.45 + 490000 302.51379 -654.60188 -8571.28 -11340.512 0.36608136 0.54114742 0.45 + 495000 300.50497 -127.55361 -8724.7069 -11475.55 0.029571506 0.95160701 0.45 + 500000 303.60879 183.79306 -8568.3539 -11347.609 0.050255275 0.91915729 0.45 + 505000 303.19721 -181.45226 -8614.403 -11389.891 0.32941264 0.57547725 0.45 + 510000 296.74554 -22.844257 -8659.5977 -11376.026 0.017555998 0.97098101 0.45 + 515000 304.94785 184.89151 -8657.5502 -11449.063 0.36892431 0.53857296 0.45 + 520000 297.55996 -618.66865 -8737.5039 -11461.388 0.0057510291 0.99039963 0.45 + 525000 301.79028 298.59479 -8629.0889 -11391.698 0.34316268 0.56235619 0.45 + 530000 309.73127 127.43322 -8551.5448 -11386.846 0.76278829 0.27817682 0.45 + 535000 296.10155 231.50902 -8700.9183 -11411.452 0.44398766 0.47485618 0.45 + 540000 299.71005 -102.1096 -8655.905 -11399.471 0.76085637 0.27907974 0.45 + 545000 300.14982 -206.19313 -8714.8486 -11462.44 0.22627441 0.68416793 0.45 + 550000 294.79885 -643.7432 -8605.2486 -11303.857 -0.057557071 1.1013603 0.45 + 555000 294.17638 -19.930168 -8726.0381 -11418.949 0.40954478 0.50309869 0.45 + 560000 297.03199 -369.45853 -8470.404 -11189.455 -0.6540448 2.9954437 0.45 + 565000 291.48707 -349.3956 -8714.1576 -11382.45 0.16175418 0.76236802 0.45 + 570000 310.66906 -63.356318 -8637.4971 -11481.383 0.025729917 0.95775884 0.45 + 575000 300.62447 -741.10788 -8620.5725 -11372.509 0.16003059 0.76457532 0.45 + 580000 303.7169 -69.625554 -8649.3106 -11429.556 0.13011667 0.80391862 0.45 + 585000 296.8583 22.033506 -8781.0388 -11498.5 0.05826221 0.9068948 0.45 + 590000 295.12104 251.36802 -8661.2354 -11362.793 0.0042041083 0.99297285 0.45 + 595000 291.91551 264.01646 -8784.286 -11456.5 -0.3176707 1.7037977 0.45 + 600000 299.51751 -425.6209 -8680.4016 -11422.205 0.063170047 0.89945954 0.45 + 605000 296.04489 -702.56187 -8648.8336 -11358.848 0.44150563 0.47683729 0.45 + 610000 293.08062 387.21018 -8636.9022 -11319.782 0.430424 0.48578377 0.45 + 615000 300.1062 -406.07366 -8651.5383 -11398.731 0.16393273 0.75958719 0.45 + 620000 304.45492 -717.77411 -8466.6335 -11253.634 0.14754207 0.78076073 0.45 + 625000 300.25467 394.44177 -8545.7468 -11294.298 -0.098814662 1.1802796 0.45 + 630000 301.25687 315.97468 -8555.4413 -11313.167 -0.30209606 1.6598626 0.45 + 635000 296.62552 -313.8236 -8661.4264 -11376.756 0.82351209 0.25123759 0.45 + 640000 300.49659 458.65236 -8648.2545 -11399.021 -0.2575 1.5402266 0.45 + 645000 299.08458 -40.905776 -8589.4621 -11327.303 0.07180479 0.88652576 0.45 + 650000 299.78807 286.71966 -8663.8862 -11408.166 -0.10586303 1.1943167 0.45 + 655000 300.2646 175.76273 -8685.9588 -11434.601 -0.4131303 1.9996722 0.45 + 660000 296.01304 69.482635 -8722.0849 -11431.808 0.65234529 0.33479341 0.45 + 665000 307.08179 -192.78965 -8554.9636 -11366.011 0.37228163 0.53554848 0.45 + 670000 298.81489 46.512873 -8651.3386 -11386.71 -0.34071772 1.7709545 0.45 + 675000 298.09695 -320.42123 -8744.4868 -11473.286 0.21787637 0.6938739 0.45 + 680000 291.73582 -346.08326 -8809.3602 -11479.93 0.35114775 0.55487414 0.45 + 685000 299.8583 -53.573198 -8742.9543 -11487.877 -0.032502983 1.056034 0.45 + 690000 299.56857 -129.53024 -8600.751 -11343.022 0.11604588 0.82311864 0.45 + 695000 287.63895 77.534045 -8889.5114 -11522.578 0.16150699 0.76268419 0.45 + 700000 294.71917 -187.77101 -8824.4116 -11522.291 0.33093056 0.57401387 0.45 + 705000 301.78978 -269.32554 -8594.7858 -11357.39 -0.098783804 1.1802185 0.45 + 710000 305.58313 -214.43945 -8518.1241 -11315.453 -0.03149037 1.0542418 0.45 + 715000 306.30354 -121.41526 -8617.5112 -11421.435 0.10640694 0.83653526 0.45 + 720000 304.94559 91.460869 -8587.9126 -11379.405 -0.4078455 1.982024 0.45 + 725000 295.36839 -505.69412 -8724.4826 -11428.305 0.71800645 0.29987744 0.45 + 730000 298.79826 -9.9970862 -8716.023 -11451.242 0.59730469 0.36717499 0.45 + 735000 300.95964 286.58072 -8641.7744 -11396.779 0.23910326 0.66960256 0.45 + 740000 298.32007 -198.81619 -8685.7142 -11416.556 0.16840724 0.75390743 0.45 + 745000 296.06461 157.22083 -8605.3591 -11315.555 0.3149783 0.58958082 0.45 + 750000 297.27956 -277.36948 -8673.9548 -11395.272 0.058965185 0.90582605 0.45 + 755000 296.79569 203.4854 -8671.4835 -11388.371 0.097863507 0.84860972 0.45 + 760000 296.34981 -296.05791 -8699.7009 -11412.507 0.34644945 0.55926433 0.45 + 765000 302.19536 -657.32604 -8674.9726 -11441.289 -0.25940717 1.5451618 0.45 + 770000 301.91884 -775.45423 -8695.1619 -11458.947 -0.12199652 1.227079 0.45 + 775000 299.9563 -211.10367 -8637.8471 -11383.667 0.3478892 0.55791532 0.45 + 780000 296.00862 -396.64708 -8721.8097 -11431.493 0.25358512 0.65353267 0.45 + 785000 295.12431 -24.44772 -8734.6065 -11436.194 -0.19904079 1.396362 0.45 + 790000 308.18585 -171.55104 -8659.2474 -11480.402 0.30853408 0.59598847 0.45 + 795000 296.45675 -137.73831 -8648.3419 -11362.127 -0.32469954 1.7240046 0.45 + 800000 301.11214 53.405034 -8663.3832 -11419.784 0.1323728 0.800882 0.45 + 805000 305.74305 -320.69662 -8642.7722 -11441.565 0.15136393 0.77577146 0.45 + 810000 305.37725 -264.53003 -8671.4307 -11466.875 0.3113551 0.59317494 0.45 + 815000 304.38239 -240.94118 -8474.7091 -11261.046 -0.080564405 1.1446952 0.45 + 820000 296.05915 -369.13085 -8698.3399 -11408.485 -0.028085872 1.0482385 0.45 + 825000 299.79549 123.66824 -8712.0882 -11456.436 -0.36082461 1.8317026 0.45 + 830000 296.0201 231.08408 -8726.975 -11436.763 -0.22224484 1.4517833 0.45 + 835000 294.90197 -293.4635 -8750.8202 -11450.373 -0.13935283 1.2633285 0.45 + 840000 301.79184 -18.424101 -8689.643 -11452.266 0.19065717 0.72628873 0.45 + 845000 303.63406 232.88156 -8607.7816 -11387.268 0.16521847 0.75795075 0.45 + 850000 300.78823 -301.92537 -8697.521 -11450.957 0.043047914 0.93033698 0.45 + 855000 300.26171 -407.09613 -8617.7866 -11366.403 0.30989277 0.59463173 0.45 + 860000 303.77064 192.13208 -8630.0944 -11410.831 0.44012319 0.47794432 0.45 + 865000 300.12867 323.6738 -8735.2213 -11482.619 0.098660075 0.8474766 0.45 + 870000 299.40232 -213.89349 -8642.3645 -11383.114 0.1478115 0.78040795 0.45 + 875000 300.46794 23.703316 -8624.9835 -11375.487 0.021260277 0.96496648 0.45 + 880000 298.40697 20.053507 -8834.9602 -11566.598 0.25906036 0.647558 0.45 + 885000 299.89193 -56.830889 -8726.8039 -11472.035 -0.14632707 1.2781945 0.45 + 890000 297.49341 -718.63083 -8683.0987 -11406.373 0.017721028 0.97071226 0.45 + 895000 293.34825 -483.14011 -8698.5638 -11383.894 -0.34844876 1.7940698 0.45 + 900000 303.8984 71.405143 -8703.2466 -11485.153 -0.0040127852 1.0067537 0.45 + 905000 296.96955 99.337161 -8644.502 -11362.981 0.29986926 0.60471403 0.45 + 910000 294.13396 -276.63831 -8661.5829 -11354.105 -0.24102928 1.4982558 0.45 + 915000 303.26417 -43.876545 -8575.252 -11351.353 0.013417579 0.97774479 0.45 + 920000 305.27911 -346.57544 -8582.8329 -11377.379 -0.20901843 1.4199288 0.45 + 925000 307.27639 482.10278 -8628.8226 -11441.652 -0.26779925 1.5670667 0.45 + 930000 305.11633 324.47709 -8579.3587 -11372.414 0.68253083 0.31826378 0.45 + 935000 300.11916 -9.8766723 -8780.2986 -11527.61 -0.13402188 1.2520821 0.45 + 940000 295.78408 -67.021801 -8735.3706 -11442.998 0.46658388 0.45719462 0.45 + 945000 300.211 161.55245 -8703.5002 -11451.652 0.062310593 0.90075717 0.45 + 950000 302.51856 -145.81508 -8539.9241 -11309.199 0.019344642 0.96807218 0.45 + 955000 297.23872 14.140867 -8682.9686 -11403.912 -0.30285941 1.6619893 0.45 + 960000 296.19195 158.66375 -8772.8876 -11484.249 0.3298895 0.57501712 0.45 + 965000 293.56726 -302.80176 -8807.9639 -11495.298 0.16057514 0.76387726 0.45 + 970000 307.76289 234.82705 -8569.0805 -11386.363 0.40582434 0.50624817 0.45 + 975000 302.4391 -372.66289 -8569.3448 -11337.893 1.1335506 0.14935733 0.45 + 980000 292.59861 191.50447 -8796.4307 -11474.898 0.82080866 0.25237947 0.45 + 985000 301.61407 97.625218 -8720.889 -11481.885 0.12835918 0.80629208 0.45 + 990000 303.38224 -380.86284 -8666.6015 -11443.783 0.29943962 0.60514999 0.45 + 995000 299.25364 -139.10643 -8631.5948 -11370.983 0.033070141 0.94603876 0.45 + 1000000 295.67561 -191.48596 -8566.021 -11272.656 0.34200535 0.56344895 0.45 + 1005000 304.80384 39.665031 -8603.3665 -11393.562 0.75244137 0.28304697 0.45 + 1010000 298.87735 -181.49155 -8699.7359 -11435.679 0.23524427 0.67395098 0.45 + 1015000 289.92007 -182.58369 -8652.9669 -11306.915 -0.61857139 2.8224052 0.45 + 1020000 300.13923 106.07213 -8618.1949 -11365.69 0.15241071 0.77441051 0.45 + 1025000 307.39589 -312.91975 -8613.3088 -11427.232 0.44069144 0.47748897 0.45 + 1030000 298.41225 441.04111 -8696.1929 -11427.879 -0.1456028 1.2766425 0.45 + 1035000 306.71758 -95.739338 -8471.0526 -11278.766 0.69089513 0.31382964 0.45 + 1040000 302.24132 -415.80447 -8608.0891 -11374.827 0.0090309238 0.98496572 0.45 + 1045000 305.58772 -150.58406 -8563.9959 -11361.367 0.062478239 0.90050391 0.45 + 1050000 303.60025 21.785837 -8623.6613 -11402.839 0.18503623 0.73316896 0.45 + 1055000 293.38734 613.83617 -8606.7635 -11292.451 -0.2195833 1.4453164 0.45 + 1060000 305.11418 -29.208186 -8589.4319 -11382.468 -0.095889014 1.1745016 0.45 + 1065000 294.13176 470.07703 -8724.8028 -11417.305 0.28934127 0.61548789 0.45 + 1070000 309.64471 -634.00961 -8534.3395 -11368.848 -0.048186981 1.0841851 0.45 + 1075000 300.56742 -209.29645 -8615.1904 -11366.605 -0.26336339 1.5554498 0.45 + 1080000 297.94855 218.48741 -8697.7569 -11425.198 -0.0401787 1.0697186 0.45 + 1085000 308.40523 -177.4101 -8681.0198 -11504.182 0.32537753 0.57938558 0.45 + 1090000 295.63403 117.27818 -8609.1285 -11315.382 0.27576906 0.62966079 0.45 + 1095000 300.09566 635.58958 -8552.5989 -11299.695 -0.056458656 1.0993329 0.45 + 1100000 300.68272 375.84619 -8709.6822 -11462.152 0.28519281 0.61978578 0.45 + 1105000 303.34279 -980.64631 -8585.6781 -11362.499 0.34352221 0.56201715 0.45 + 1110000 304.45088 84.082657 -8606.3018 -11393.266 0.019454666 0.96789353 0.45 + 1115000 296.03894 543.18998 -8568.9408 -11278.901 0.38977572 0.5200614 0.45 + 1120000 307.38628 -200.46817 -8619.8059 -11433.641 -0.21765351 1.4406454 0.45 + 1125000 303.36463 -96.322086 -8596.6485 -11373.669 -0.050201944 1.0878558 0.45 + 1130000 295.03081 19.554539 -8820.2191 -11520.951 0.24816885 0.65949722 0.45 + 1135000 297.2534 -452.18389 -8614.3296 -11335.407 0.47102824 0.45379893 0.45 + 1140000 298.03519 -102.40026 -8663.5539 -11391.788 0.42591169 0.48947459 0.45 + 1145000 295.38879 -444.99161 -8629.1445 -11333.153 0.39655669 0.51417955 0.45 + 1150000 303.8409 -236.98919 -8595.3972 -11376.777 0.64097267 0.34124136 0.45 + 1155000 306.07517 -215.50846 -8588.4969 -11390.33 0.036055871 0.94131261 0.45 + 1160000 294.9636 -931.69596 -8675.0022 -11375.119 0.19752892 0.71796511 0.45 + 1165000 294.72276 -192.71028 -8637.3451 -11335.257 -0.00048188528 1.0008086 0.45 + 1170000 301.23614 -213.88646 -8482.7135 -11240.25 0.71933969 0.29920755 0.45 + 1175000 300.44993 375.9896 -8633.2248 -11383.564 0.30232015 0.60223308 0.45 + 1180000 300.16377 118.10917 -8654.5233 -11402.243 0.12296714 0.81361774 0.45 + 1185000 293.70358 210.30955 -8646.4181 -11335.001 0.30210616 0.6024493 0.45 + 1190000 304.75915 -651.08053 -8575.2958 -11365.082 -0.02759447 1.0473748 0.45 + 1195000 297.70391 95.378065 -8731.319 -11456.521 0.52250206 0.41626089 0.45 + 1200000 293.90642 -733.78695 -8697.185 -11387.624 0.13079675 0.80300207 0.45 + 1205000 303.05224 -511.38179 -8632.6207 -11406.781 -0.20143249 1.4019752 0.45 + 1210000 293.80664 245.08881 -8756.1441 -11445.67 0.37969913 0.52892642 0.45 + 1215000 296.59811 308.46776 -8624.2865 -11339.366 0.14440905 0.78487467 0.45 + 1220000 303.74266 188.84272 -8605.9211 -11386.402 -0.092746405 1.1683266 0.45 + 1225000 299.9013 -466.73438 -8576.203 -11321.52 0.27417371 0.63134804 0.45 + 1230000 299.66611 -174.43092 -8604.5105 -11347.674 0.47991062 0.44708777 0.45 + 1235000 295.89844 394.40733 -8789.3714 -11498.046 0.088629157 0.86185673 0.45 + 1240000 298.78384 419.34789 -8688.5635 -11423.651 0.22218371 0.68887865 0.45 + 1245000 299.90866 183.59906 -8698.2559 -11443.64 1.1590193 0.143111 0.45 + 1250000 296.01051 196.22426 -8831.5506 -11541.251 -0.04226137 1.0734621 0.45 + 1255000 292.09199 -163.44863 -8711.8649 -11385.695 0.57648767 0.38022263 0.45 + 1260000 298.83471 -194.96215 -8646.8698 -11382.423 0.10966149 0.83198091 0.45 + 1265000 302.24158 163.34413 -8653.0984 -11419.838 0.51878502 0.41886437 0.45 + 1270000 298.29186 -765.77064 -8697.9423 -11428.526 -0.40185995 1.9622238 0.45 + 1275000 300.55952 -162.42423 -8614.8996 -11366.242 -0.43706076 2.0815736 0.45 + 1280000 294.52892 156.17026 -8718.8337 -11414.971 0.010263439 0.98293149 0.45 + 1285000 301.40565 -778.44393 -8670.527 -11429.615 0.025111338 0.95875312 0.45 + 1290000 294.20057 -918.07774 -8683.4672 -11376.599 0.046386022 0.92514227 0.45 + 1295000 301.09196 -665.75324 -8687.0149 -11443.231 0.11169829 0.82914327 0.45 + 1300000 294.16167 -297.06724 -8708.7055 -11401.481 0.11765896 0.82089447 0.45 + 1305000 303.07886 -538.32897 -8514.6586 -11289.063 -0.047420749 1.0827925 0.45 + 1310000 302.36674 -40.952458 -8536.8784 -11304.764 -0.42539639 2.0412418 0.45 + 1315000 302.05477 -60.391628 -8662.9591 -11427.989 0.13452485 0.79799615 0.45 + 1320000 303.48158 71.63406 -8661.3057 -11439.397 -0.039130791 1.0678399 0.45 + 1325000 296.35737 -261.05768 -8561.6568 -11274.532 0.44670407 0.47269742 0.45 + 1330000 296.29207 -147.71061 -8543.8084 -11256.086 0.2909439 0.61383553 0.45 + 1335000 301.48737 453.77169 -8648.236 -11408.072 0.078354877 0.87683873 0.45 + 1340000 300.90975 -596.76946 -8621.8298 -11376.378 0.49429189 0.43643168 0.45 + 1345000 295.08431 -540.90158 -8694.8895 -11396.111 0.17025999 0.75156807 0.45 + 1350000 296.63006 -197.97304 -8632.9441 -11348.316 -0.29504955 1.6403589 0.45 + 1355000 305.25857 -242.97453 -8473.9923 -11268.35 0.069838933 0.88945392 0.45 + 1360000 296.22833 -151.24398 -8660.529 -11372.223 -0.28031505 1.6003133 0.45 + 1365000 301.25457 -383.71973 -8610.3716 -11368.076 -0.18330657 1.3599906 0.45 + 1370000 300.8142 -179.49364 -8641.5538 -11395.227 0.23629239 0.67276715 0.45 + 1375000 307.62118 -82.315057 -8464.9289 -11280.914 0.024560511 0.95963938 0.45 + 1380000 303.12816 -335.58742 -8512.0211 -11286.877 0.30238814 0.60216441 0.45 + 1385000 304.36118 711.2159 -8577.0597 -11363.203 0.34444857 0.56114453 0.45 + 1390000 294.15072 406.74931 -8678.8526 -11371.528 0.29195829 0.61279196 0.45 + 1395000 300.50629 -164.22554 -8592.1543 -11343.009 0.098759052 0.84733591 0.45 + 1400000 297.37345 -98.001104 -8741.5121 -11463.689 0.27444766 0.63105799 0.45 + 1405000 294.17572 -86.526127 -8712.3447 -11405.249 0.4297415 0.48634023 0.45 + 1410000 310.48104 141.84417 -8647.4854 -11489.65 0.86645808 0.23377559 0.45 + 1415000 310.06801 -433.29574 -8486.7744 -11325.158 -0.21510676 1.4345042 0.45 + 1420000 303.98547 -69.701496 -8551.8036 -11334.507 0.16419779 0.75924955 0.45 + 1425000 301.40096 -115.67827 -8639.4818 -11398.527 0.20161321 0.71306316 0.45 + 1430000 299.1258 -79.769416 -8721.6844 -11459.902 0.36298014 0.54396978 0.45 + 1435000 298.45349 180.92871 -8700.7025 -11432.766 0.43843749 0.47929766 0.45 + 1440000 299.14006 146.72026 -8675.5643 -11413.913 0.50244279 0.43050527 0.45 + 1445000 299.98035 -404.81666 -8725.6961 -11471.737 0.49995597 0.43230482 0.45 + 1450000 295.10222 59.166328 -8728.5327 -11429.918 0.04154017 0.93269286 0.45 + 1455000 292.52514 144.30376 -8743.1245 -11420.919 0.04910241 0.92093649 0.45 + 1460000 303.68948 -264.34132 -8631.6334 -11411.627 0.23528019 0.67391039 0.45 + 1465000 302.97467 98.874471 -8689.2883 -11462.739 0.21805801 0.69366252 0.45 + 1470000 294.50716 133.30708 -8625.4721 -11321.411 0.98143982 0.19276882 0.45 + 1475000 302.04729 -120.74445 -8637.7677 -11402.729 0.4707242 0.45403042 0.45 + 1480000 305.16876 -436.598 -8614.8793 -11408.415 0.27111226 0.63459852 0.45 + 1485000 297.20205 -166.62152 -8598.691 -11319.299 -0.24681532 1.5128679 0.45 + 1490000 299.73617 -126.47006 -8649.4834 -11393.289 0.47833671 0.44826968 0.45 + 1495000 295.64416 481.3869 -8697.4378 -11403.784 0.1128182 0.82758717 0.45 + 1500000 301.34876 -64.948239 -8570.0291 -11328.596 0.10524924 0.83816132 0.45 + 1505000 297.45753 538.92423 -8678.9073 -11401.854 0.15764246 0.76764423 0.45 + 1510000 304.47978 -609.79308 -8491.9652 -11279.194 0.40940159 0.50321953 0.45 + 1515000 301.26466 -130.2245 -8572.0691 -11329.866 0.89811777 0.22168463 0.45 + 1520000 306.33064 472.83128 -8553.0557 -11357.227 -0.3949103 1.9394824 0.45 + 1525000 303.77309 446.96086 -8658.8797 -11439.639 0.23907939 0.66962936 0.45 + 1530000 305.94257 -462.96121 -8683.4501 -11484.069 -0.29365623 1.6365296 0.45 + 1535000 296.45268 -725.6647 -8564.4464 -11278.194 0.031785638 0.94807932 0.45 + 1540000 297.90338 -418.20316 -8566.3092 -11293.337 0.50491901 0.42872083 0.45 + 1545000 304.3796 -281.11491 -8571.3965 -11357.708 0.26286914 0.64343405 0.45 + 1550000 296.71481 -62.772449 -8680.9078 -11397.055 0.15669974 0.76885909 0.45 + 1555000 297.50225 148.74592 -8754.0913 -11477.447 0.14286636 0.78690833 0.45 + 1560000 300.52393 373.85791 -8638.4601 -11389.477 0.089292836 0.8608978 0.45 + 1565000 295.18741 -197.82529 -8603.6291 -11305.795 0.36113621 0.54565489 0.45 + 1570000 295.50662 -297.43989 -8727.7936 -11432.881 0.24895806 0.65862474 0.45 + 1575000 306.12787 745.92559 -8609.3706 -11411.686 0.42705392 0.48853767 0.45 + 1580000 300.84367 544.00229 -8635.6029 -11389.546 -0.20268104 1.4049145 0.45 + 1585000 293.01964 208.25986 -8624.1146 -11306.436 -0.013645123 1.0231522 0.45 + 1590000 304.09 110.80761 -8602.177 -11385.837 -0.39136115 1.9279703 0.45 + 1595000 289.74205 -521.57012 -8666.417 -11318.735 0.30601242 0.59851474 0.45 + 1600000 297.3494 368.04946 -8684.986 -11406.943 0.079346518 0.87538143 0.45 + 1605000 301.19957 -293.44562 -8521.9202 -11279.121 0.49408391 0.43658396 0.45 + 1610000 299.66627 -592.72965 -8750.1489 -11493.314 -0.20726596 1.415761 0.45 + 1615000 301.32181 329.96166 -8575.077 -11333.397 0.21514479 0.69706049 0.45 + 1620000 297.46259 -575.7077 -8604.3396 -11327.332 0.051950054 0.91654801 0.45 + 1625000 301.143 -578.27016 -8622.6936 -11379.377 0.33929754 0.566014 0.45 + 1630000 301.9449 119.02272 -8744.8752 -11508.899 0.25690123 0.64990753 0.45 + 1635000 292.31769 -256.96526 -8729.3974 -11405.293 0.2041501 0.71003527 0.45 + 1640000 305.17316 -224.04815 -8619.2426 -11412.818 0.61612842 0.35576261 0.45 + 1645000 299.82547 -453.0871 -8601.8345 -11346.457 0.44515417 0.47392794 0.45 + 1650000 300.70213 -184.15313 -8604.5269 -11357.175 0.40413562 0.50768423 0.45 + 1655000 298.34797 241.12842 -8736.9407 -11468.038 0.2219039 0.68920205 0.45 + 1660000 305.65546 522.2866 -8702.2765 -11500.267 -0.093142651 1.1691034 0.45 + 1665000 296.92311 -22.202256 -8648.9808 -11367.035 0.21695848 0.69494306 0.45 + 1670000 293.71721 -216.98365 -8726.8596 -11415.567 0.062675713 0.90020567 0.45 + 1675000 302.06866 69.039243 -8665.567 -11430.724 0.0012561112 0.99789522 0.45 + 1680000 292.51483 -764.83087 -8759.3069 -11437.007 0.0022259364 0.99627318 0.45 + 1685000 300.70748 -239.98915 -8682.5295 -11435.226 0.21854685 0.69309397 0.45 + 1690000 303.31754 36.443117 -8554.7105 -11331.3 0.18904617 0.72825402 0.45 + 1695000 300.96783 -365.40002 -8606.9996 -11362.08 0.21317894 0.69936284 0.45 + 1700000 301.78038 -460.56572 -8703.0763 -11465.594 -0.074311844 1.1327524 0.45 + 1705000 299.08328 224.74817 -8680.6969 -11418.526 0.14954235 0.77814547 0.45 + 1710000 303.24064 298.73582 -8637.4191 -11413.304 -0.11628651 1.2153822 0.45 + 1715000 299.1988 535.86954 -8722.2318 -11461.118 0.51289768 0.42302132 0.45 + 1720000 300.88716 -11.654893 -8624.0905 -11378.432 0.62281958 0.35179195 0.45 + 1725000 306.59581 -286.69581 -8574.7957 -11381.394 0.3964476 0.51427364 0.45 + 1730000 302.58784 590.55523 -8670.9964 -11440.906 -0.28655798 1.6171597 0.45 + 1735000 295.17235 -60.036989 -8631.671 -11333.699 0.72231294 0.29771902 0.45 + 1740000 290.06228 -254.79282 -8715.6619 -11370.912 0.35583392 0.55052961 0.45 + 1745000 306.47487 418.58552 -8590.4226 -11395.914 -0.04975774 1.0870455 0.45 + 1750000 296.74674 -73.367187 -8727.0183 -11443.458 -0.27066543 1.5746188 0.45 + 1755000 299.03541 551.77198 -8712.6905 -11450.081 -0.35865936 1.8250619 0.45 + 1760000 288.98684 -380.17132 -8775.8546 -11421.26 -0.17754854 1.3469184 0.45 + 1765000 300.76459 -662.80282 -8671.5414 -11424.761 0.078118597 0.87718632 0.45 + 1770000 301.47287 -498.34628 -8675.582 -11435.285 0.57886218 0.37871122 0.45 + 1775000 307.18565 -70.676548 -8554.9531 -11366.951 0.38766498 0.52190597 0.45 + 1780000 302.58164 -329.49774 -8638.9781 -11408.831 0.53149245 0.41003059 0.45 + 1785000 307.4086 294.59322 -8586.4793 -11400.518 0.34963097 0.55628768 0.45 + 1790000 295.81491 -366.57154 -8756.8143 -11464.724 0.61653346 0.35552098 0.45 + 1795000 296.46712 18.92361 -8640.9928 -11354.873 0.21158778 0.70123194 0.45 + 1800000 290.9851 -805.74081 -8636.1049 -11299.802 0.36361854 0.54338759 0.45 + 1805000 291.6313 -58.207903 -8707.0768 -11376.689 0.2659117 0.6401586 0.45 + 1810000 299.14324 327.45026 -8613.3385 -11351.716 0.58264334 0.37631684 0.45 + 1815000 295.3441 37.594139 -8747.5577 -11451.158 0.10312363 0.84115511 0.45 + 1820000 297.19616 596.87014 -8601.4315 -11321.985 0.11690702 0.82193051 0.45 + 1825000 305.23709 -229.45704 -8586.9328 -11381.094 -0.070794327 1.1260885 0.45 + 1830000 308.48265 -50.225625 -8595.8609 -11419.732 0.28577292 0.61918297 0.45 + 1835000 301.67215 30.600339 -8561.9509 -11323.478 0.67464985 0.32249901 0.45 + 1840000 297.44022 -46.915689 -8760.5329 -11483.321 0.20308399 0.71130615 0.45 + 1845000 294.56439 121.7989 -8819.2766 -11515.739 -0.13859762 1.2617292 0.45 + 1850000 303.92475 63.511256 -8655.7131 -11437.861 -0.064617898 1.1144821 0.45 + 1855000 302.36347 -403.0262 -8663.1963 -11431.052 0.63223295 0.34628081 0.45 + 1860000 292.88227 124.53259 -8622.4528 -11303.517 0.21782313 0.69393587 0.45 + 1865000 299.49141 1.3922328 -8592.8243 -11334.389 0.024359522 0.95996296 0.45 + 1870000 295.36403 -1.848842 -8534.7607 -11238.543 0.53331666 0.40877784 0.45 + 1875000 299.5254 -303.35635 -8642.4199 -11384.296 0.12049946 0.8169925 0.45 + 1880000 302.15027 -233.4192 -8607.1984 -11373.102 0.42967343 0.48639576 0.45 + 1885000 293.78387 -312.31798 -8576.6303 -11265.948 0.62050206 0.35316217 0.45 + 1890000 296.33987 227.42925 -8675.0988 -11387.814 -0.2387251 1.4924762 0.45 + 1895000 296.4116 -297.41585 -8695.6693 -11409.041 0.1899345 0.72716967 0.45 + 1900000 305.04631 -744.8928 -8495.6073 -11288.022 -0.092917858 1.1686627 0.45 + 1905000 299.13767 -233.05542 -8771.8955 -11510.222 -0.053515786 1.0939196 0.45 + 1910000 301.18529 391.32364 -8594.238 -11351.309 0.17761387 0.74235415 0.45 + 1915000 304.53139 -205.26743 -8615.1863 -11402.887 -0.65441918 2.9973254 0.45 + 1920000 304.46794 75.506851 -8696.0461 -11483.166 0.28757039 0.6173189 0.45 + 1925000 295.83229 -40.226799 -8677.0683 -11385.137 0.34338584 0.56214572 0.45 + 1930000 298.91694 72.305481 -8662.7622 -11399.068 -0.45255095 2.1363683 0.45 + 1935000 297.28693 -277.78411 -8678.223 -11399.608 0.32165864 0.58301111 0.45 + 1940000 295.22194 -153.48885 -8737.0529 -11439.534 0.47753767 0.4488709 0.45 + 1945000 298.41366 0.98105216 -8615.733 -11347.432 0.061208942 0.90242323 0.45 + 1950000 298.47932 -461.39566 -8587.8993 -11320.199 0.41883297 0.49532116 0.45 + 1955000 293.30456 -530.72887 -8712.242 -11397.172 -0.052983042 1.0929425 0.45 + 1960000 307.27812 -609.68084 -8563.1295 -11375.974 0.10863685 0.83341209 0.45 + 1965000 309.21876 -661.65884 -8619.5376 -11450.147 -0.00074060514 1.0012431 0.45 + 1970000 294.16474 130.9219 -8662.5966 -11355.4 -0.048761848 1.0852311 0.45 + 1975000 293.87023 -652.42226 -8587.2681 -11277.376 -0.42701916 2.0468057 0.45 + 1980000 302.66906 -396.94893 -8576.3291 -11346.982 0.55938449 0.39128874 0.45 + 1985000 304.00863 167.22102 -8525.9503 -11308.866 -0.12417188 1.2315647 0.45 + 1990000 299.53376 -234.11494 -8528.8821 -11270.834 0.58392743 0.37550715 0.45 + 1995000 296.20959 -99.022727 -8599.3854 -11310.908 0.10920765 0.83261451 0.45 + 2000000 307.40367 -179.44965 -8545.6064 -11359.6 0.485016 0.44327537 0.45 +Loop time of 4787.7 on 1 procs for 2000000 steps with 3072 atoms + +Performance: 36.092 ns/day, 0.665 hours/ns, 417.737 timesteps/s +95.4% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1015.1 | 1015.1 | 1015.1 | 0.0 | 21.20 +Bond | 121.19 | 121.19 | 121.19 | 0.0 | 2.53 +Kspace | 3455.1 | 3455.1 | 3455.1 | 0.0 | 72.17 +Neigh | 8.7475 | 8.7475 | 8.7475 | 0.0 | 0.18 +Comm | 58.679 | 58.679 | 58.679 | 0.0 | 1.23 +Output | 0.60209 | 0.60209 | 0.60209 | 0.0 | 0.01 +Modify | 81.328 | 81.328 | 81.328 | 0.0 | 1.70 +Other | | 46.88 | | | 0.98 + +Nlocal: 3072 ave 3072 max 3072 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 8395 ave 8395 max 8395 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 + +Total # of neighbors = -1 +Ave neighs/atom = -0.00032552083 +Ave special neighs/atom = 2 +Neighbor list builds = 93794 +Dangerous builds = 0 + +Total wall time: 1:31:34 diff --git a/examples/PACKAGES/fep/ta/spce.fep.ta b/examples/PACKAGES/fep/ta/spce.fep.ta new file mode 100644 index 0000000000..7ed4013d65 --- /dev/null +++ b/examples/PACKAGES/fep/ta/spce.fep.ta @@ -0,0 +1,22 @@ +# Time-averaged data for fix FEP +# TimeStep c_TA[1] c_TA[2] c_TA[3] v_gamma_v +100000 0.168677 0.863546 0.45 65.7437 +200000 0.169722 0.861354 0.45 66.6859 +300000 0.165507 0.868407 0.45 63.1899 +400000 0.162311 0.875704 0.45 60.7859 +500000 0.165468 0.872729 0.45 63.2053 +600000 0.165267 0.873825 0.45 63.1828 +700000 0.167824 0.869356 0.45 65.1722 +800000 0.170332 0.866538 0.45 67.0749 +900000 0.164396 0.875043 0.45 62.4639 +1000000 0.164738 0.87663 0.45 62.5659 +1100000 0.168395 0.870496 0.45 65.415 +1200000 0.170147 0.867104 0.45 66.7132 +1300000 0.170509 0.866709 0.45 66.9833 +1400000 0.171152 0.865294 0.45 67.5598 +1500000 0.172363 0.863433 0.45 68.547 +1600000 0.171538 0.864062 0.45 67.8359 +1700000 0.171662 0.864029 0.45 67.9145 +1800000 0.170202 0.866069 0.45 66.7697 +1900000 0.171403 0.864162 0.45 67.6313 +2000000 0.170962 0.864753 0.45 67.2314 From b97c30e6e7e74bc14009318f1cec3e56ce820f4a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 31 Mar 2022 06:24:44 -0400 Subject: [PATCH 062/130] more refactoring, modernizing, removing of debug code --- .../fix_smd_tlsph_reference_configuration.cpp | 720 ++-- src/MACHDYN/pair_smd_tlsph.cpp | 3296 ++++++++--------- src/MANIFOLD/fix_nve_manifold_rattle.cpp | 20 +- src/MC/fix_bond_break.cpp | 65 +- src/MC/fix_bond_break.h | 5 - src/MC/fix_bond_create.cpp | 59 - src/MC/fix_bond_create.h | 5 - 7 files changed, 1920 insertions(+), 2250 deletions(-) diff --git a/src/MACHDYN/fix_smd_tlsph_reference_configuration.cpp b/src/MACHDYN/fix_smd_tlsph_reference_configuration.cpp index a3ba73709b..df23726b38 100644 --- a/src/MACHDYN/fix_smd_tlsph_reference_configuration.cpp +++ b/src/MACHDYN/fix_smd_tlsph_reference_configuration.cpp @@ -27,7 +27,6 @@ #include "fix_smd_tlsph_reference_configuration.h" -#include #include "atom.h" #include "comm.h" #include "neigh_list.h" @@ -41,12 +40,14 @@ #include "smd_kernels.h" #include "smd_math.h" +#include + using namespace Eigen; using namespace LAMMPS_NS; using namespace FixConst; using namespace SMD_Kernels; -using namespace std; using namespace SMD_Math; + #define DELTA 16384 #define INSERT_PREDEFINED_CRACKS false @@ -54,141 +55,134 @@ using namespace SMD_Math; /* ---------------------------------------------------------------------- */ FixSMD_TLSPH_ReferenceConfiguration::FixSMD_TLSPH_ReferenceConfiguration(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) { + Fix(lmp, narg, arg) { - if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR, "Pair tlsph with partner list requires an atom map, see atom_modify"); + if (atom->map_style == Atom::MAP_NONE) + error->all(FLERR, "Pair tlsph with partner list requires an atom map, see atom_modify"); - maxpartner = 1; - npartner = nullptr; - partner = nullptr; - wfd_list = nullptr; - wf_list = nullptr; - energy_per_bond = nullptr; - degradation_ij = nullptr; - grow_arrays(atom->nmax); - atom->add_callback(Atom::GROW); + maxpartner = 1; + npartner = nullptr; + partner = nullptr; + wfd_list = nullptr; + wf_list = nullptr; + energy_per_bond = nullptr; + degradation_ij = nullptr; + grow_arrays(atom->nmax); + atom->add_callback(Atom::GROW); - // initialize npartner to 0 so neighbor list creation is OK the 1st time - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { - npartner[i] = 0; - } + // initialize npartner to 0 so neighbor list creation is OK the 1st time + int nlocal = atom->nlocal; + for (int i = 0; i < nlocal; i++) { + npartner[i] = 0; + } - comm_forward = 14; - updateFlag = 1; + comm_forward = 14; + updateFlag = 1; } /* ---------------------------------------------------------------------- */ FixSMD_TLSPH_ReferenceConfiguration::~FixSMD_TLSPH_ReferenceConfiguration() { - // unregister this fix so atom class doesn't invoke it any more + // unregister this fix so atom class doesn't invoke it any more - atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays - memory->destroy(npartner); - memory->destroy(partner); - memory->destroy(wfd_list); - memory->destroy(wf_list); - memory->destroy(degradation_ij); - memory->destroy(energy_per_bond); + memory->destroy(npartner); + memory->destroy(partner); + memory->destroy(wfd_list); + memory->destroy(wf_list); + memory->destroy(degradation_ij); + memory->destroy(energy_per_bond); } /* ---------------------------------------------------------------------- */ int FixSMD_TLSPH_ReferenceConfiguration::setmask() { - int mask = 0; - mask |= PRE_EXCHANGE; - return mask; + int mask = 0; + mask |= PRE_EXCHANGE; + return mask; } /* ---------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::init() { - if (atom->tag_enable == 0) - error->all(FLERR, "Pair style tlsph requires atoms have IDs"); + if (atom->tag_enable == 0) error->all(FLERR, "Pair style tlsph requires atoms have IDs"); } /* ---------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::pre_exchange() { - //return; - //printf("in FixSMD_TLSPH_ReferenceConfiguration::pre_exchange()\n"); - double **defgrad = atom->smd_data_9; - double *radius = atom->radius; - double *rho = atom->rho; - double *vfrac = atom->vfrac; - double **x = atom->x; - double **x0 = atom->x0; - double *rmass = atom->rmass; - int nlocal = atom->nlocal; - int i, itmp; - int *mask = atom->mask; - if (igroup == atom->firstgroup) { - nlocal = atom->nfirst; + double **defgrad = atom->smd_data_9; + double *radius = atom->radius; + double *rho = atom->rho; + double *vfrac = atom->vfrac; + double **x = atom->x; + double **x0 = atom->x0; + double *rmass = atom->rmass; + int nlocal = atom->nlocal; + int i, itmp; + int *mask = atom->mask; + if (igroup == atom->firstgroup) { + nlocal = atom->nfirst; + } + + int *updateFlag_ptr = (int *) force->pair->extract("smd/tlsph/updateFlag_ptr", itmp); + if (updateFlag_ptr == nullptr) { + error->one(FLERR, + "fix FixSMD_TLSPH_ReferenceConfiguration failed to access updateFlag pointer. Check if a pair style exist which calculates this quantity."); + } + + int *nn = (int *) force->pair->extract("smd/tlsph/numNeighsRefConfig_ptr", itmp); + if (nn == nullptr) { + error->all(FLERR, "FixSMDIntegrateTlsph::updateReferenceConfiguration() failed to access numNeighsRefConfig_ptr array"); + } + + // sum all update flag across processors + MPI_Allreduce(updateFlag_ptr, &updateFlag, 1, MPI_INT, MPI_MAX, world); + + if (updateFlag > 0) { + if (comm->me == 0) utils::logmesg(lmp, "**** updating ref config at step: {}\n", update->ntimestep); + + for (i = 0; i < nlocal; i++) { + + if (mask[i] & groupbit) { + + // re-set x0 coordinates + x0[i][0] = x[i][0]; + x0[i][1] = x[i][1]; + x0[i][2] = x[i][2]; + + // re-set deformation gradient + defgrad[i][0] = 1.0; + defgrad[i][1] = 0.0; + defgrad[i][2] = 0.0; + defgrad[i][3] = 0.0; + defgrad[i][4] = 1.0; + defgrad[i][5] = 0.0; + defgrad[i][6] = 0.0; + defgrad[i][7] = 0.0; + defgrad[i][8] = 1.0; + /* + * Adjust particle volume as the reference configuration is changed. + * We safeguard against excessive deformations by limiting the adjustment range + * to the intervale J \in [0.9..1.1] + */ + vfrac[i] = rmass[i] / rho[i]; + + if (nn[i] < 15) { + radius[i] *= 1.2; } + } + } - int *updateFlag_ptr = (int *) force->pair->extract("smd/tlsph/updateFlag_ptr", itmp); - if (updateFlag_ptr == nullptr) { - error->one(FLERR, - "fix FixSMD_TLSPH_ReferenceConfiguration failed to access updateFlag pointer. Check if a pair style exist which calculates this quantity."); - } + // update of reference config could have changed x0, vfrac, radius + // communicate these quantities now to ghosts: x0, vfrac, radius + comm->forward_comm(this); - int *nn = (int *) force->pair->extract("smd/tlsph/numNeighsRefConfig_ptr", itmp); - if (nn == nullptr) { - error->all(FLERR, "FixSMDIntegrateTlsph::updateReferenceConfiguration() failed to access numNeighsRefConfig_ptr array"); - } - - // sum all update flag across processors - MPI_Allreduce(updateFlag_ptr, &updateFlag, 1, MPI_INT, MPI_MAX, world); - - if (updateFlag > 0) { - if (comm->me == 0) { - printf("**** updating ref config at step: " BIGINT_FORMAT "\n", update->ntimestep); - } - - for (i = 0; i < nlocal; i++) { - - if (mask[i] & groupbit) { - - // re-set x0 coordinates - x0[i][0] = x[i][0]; - x0[i][1] = x[i][1]; - x0[i][2] = x[i][2]; - - // re-set deformation gradient - defgrad[i][0] = 1.0; - defgrad[i][1] = 0.0; - defgrad[i][2] = 0.0; - defgrad[i][3] = 0.0; - defgrad[i][4] = 1.0; - defgrad[i][5] = 0.0; - defgrad[i][6] = 0.0; - defgrad[i][7] = 0.0; - defgrad[i][8] = 1.0; - /* - * Adjust particle volume as the reference configuration is changed. - * We safeguard against excessive deformations by limiting the adjustment range - * to the intervale J \in [0.9..1.1] - */ - vfrac[i] = rmass[i] / rho[i]; -// - if (nn[i] < 15) { - radius[i] *= 1.2; - } // else //{ - // radius[i] *= pow(J, 1.0 / domain->dimension); - //} - } - } - - // update of reference config could have changed x0, vfrac, radius - // communicate these quantities now to ghosts: x0, vfrac, radius - comm->forward_comm(this); - - setup(0); - } + setup(0); + } } /* ---------------------------------------------------------------------- @@ -197,155 +191,155 @@ void FixSMD_TLSPH_ReferenceConfiguration::pre_exchange() { ------------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::setup(int /*vflag*/) { - int i, j, ii, jj, n, inum, jnum; - int *ilist, *jlist, *numneigh, **firstneigh; - double r, h, wf, wfd; - Vector3d dx; + int i, j, ii, jj, n, inum, jnum; + int *ilist, *jlist, *numneigh, **firstneigh; + double r, h, wf, wfd; + Vector3d dx; - if (updateFlag == 0) - return; + if (updateFlag == 0) + return; - int nlocal = atom->nlocal; - nmax = atom->nmax; - grow_arrays(nmax); + int nlocal = atom->nlocal; + nmax = atom->nmax; + grow_arrays(nmax); // 1st loop over neighbor list // calculate npartner for each owned atom // nlocal_neigh = nlocal when neigh list was built, may be smaller than nlocal - double **x0 = atom->x; - double *radius = atom->radius; - int *mask = atom->mask; - tagint *tag = atom->tag; - NeighList *list = pair->list; - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - firstneigh = list->firstneigh; + double **x0 = atom->x; + double *radius = atom->radius; + int *mask = atom->mask; + tagint *tag = atom->tag; + NeighList *list = pair->list; + inum = list->inum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; - // zero npartner for all current atoms - for (i = 0; i < nlocal; i++) - npartner[i] = 0; + // zero npartner for all current atoms + for (i = 0; i < nlocal; i++) + npartner[i] = 0; - for (ii = 0; ii < inum; ii++) { - i = ilist[ii]; - jlist = firstneigh[i]; - jnum = numneigh[i]; + for (ii = 0; ii < inum; ii++) { + i = ilist[ii]; + jlist = firstneigh[i]; + jnum = numneigh[i]; - for (jj = 0; jj < jnum; jj++) { - j = jlist[jj]; - j &= NEIGHMASK; + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + j &= NEIGHMASK; - if (INSERT_PREDEFINED_CRACKS) { - if (!crack_exclude(i, j)) - continue; - } + if (INSERT_PREDEFINED_CRACKS) { + if (!crack_exclude(i, j)) + continue; + } - dx(0) = x0[i][0] - x0[j][0]; - dx(1) = x0[i][1] - x0[j][1]; - dx(2) = x0[i][2] - x0[j][2]; - r = dx.norm(); - h = radius[i] + radius[j]; + dx(0) = x0[i][0] - x0[j][0]; + dx(1) = x0[i][1] - x0[j][1]; + dx(2) = x0[i][2] - x0[j][2]; + r = dx.norm(); + h = radius[i] + radius[j]; - if (r <= h) { - npartner[i]++; - if (j < nlocal) { - npartner[j]++; - } - } - } + if (r <= h) { + npartner[i]++; + if (j < nlocal) { + npartner[j]++; } + } + } + } - maxpartner = 0; - for (i = 0; i < nlocal; i++) - maxpartner = MAX(maxpartner, npartner[i]); - int maxall; - MPI_Allreduce(&maxpartner, &maxall, 1, MPI_INT, MPI_MAX, world); - maxpartner = maxall; + maxpartner = 0; + for (i = 0; i < nlocal; i++) + maxpartner = MAX(maxpartner, npartner[i]); + int maxall; + MPI_Allreduce(&maxpartner, &maxall, 1, MPI_INT, MPI_MAX, world); + maxpartner = maxall; - grow_arrays(nmax); + grow_arrays(nmax); - for (i = 0; i < nlocal; i++) { - npartner[i] = 0; - for (jj = 0; jj < maxpartner; jj++) { - wfd_list[i][jj] = 0.0; - wf_list[i][jj] = 0.0; - degradation_ij[i][jj] = 0.0; - energy_per_bond[i][jj] = 0.0; - } + for (i = 0; i < nlocal; i++) { + npartner[i] = 0; + for (jj = 0; jj < maxpartner; jj++) { + wfd_list[i][jj] = 0.0; + wf_list[i][jj] = 0.0; + degradation_ij[i][jj] = 0.0; + energy_per_bond[i][jj] = 0.0; + } + } + + for (ii = 0; ii < inum; ii++) { + i = ilist[ii]; + jlist = firstneigh[i]; + jnum = numneigh[i]; + + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + j &= NEIGHMASK; + + dx(0) = x0[i][0] - x0[j][0]; + dx(1) = x0[i][1] - x0[j][1]; + dx(2) = x0[i][2] - x0[j][2]; + r = dx.norm(); + h = radius[i] + radius[j]; + + if (INSERT_PREDEFINED_CRACKS) { + if (!crack_exclude(i, j)) + continue; + } + + if (r < h) { + spiky_kernel_and_derivative(h, r, domain->dimension, wf, wfd); + + partner[i][npartner[i]] = tag[j]; + wfd_list[i][npartner[i]] = wfd; + wf_list[i][npartner[i]] = wf; + npartner[i]++; + if (j < nlocal) { + partner[j][npartner[j]] = tag[i]; + wfd_list[j][npartner[j]] = wfd; + wf_list[j][npartner[j]] = wf; + npartner[j]++; } + } + } + } - for (ii = 0; ii < inum; ii++) { - i = ilist[ii]; - jlist = firstneigh[i]; - jnum = numneigh[i]; + // count number of particles for which this group is active - for (jj = 0; jj < jnum; jj++) { - j = jlist[jj]; - j &= NEIGHMASK; + // bond statistics + if (update->ntimestep > -1) { + n = 0; + int count = 0; + for (i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + n += npartner[i]; + count += 1; + } + } + int nall, countall; + MPI_Allreduce(&n, &nall, 1, MPI_INT, MPI_SUM, world); + MPI_Allreduce(&count, &countall, 1, MPI_INT, MPI_SUM, world); + if (countall < 1) countall = 1; - dx(0) = x0[i][0] - x0[j][0]; - dx(1) = x0[i][1] - x0[j][1]; - dx(2) = x0[i][2] - x0[j][2]; - r = dx.norm(); - h = radius[i] + radius[j]; + if (comm->me == 0) { + if (screen) { + printf("\n>>========>>========>>========>>========>>========>>========>>========>>========\n"); + fprintf(screen, "TLSPH neighbors:\n"); + fprintf(screen, " max # of neighbors for a single particle = %d\n", maxpartner); + fprintf(screen, " average # of neighbors/particle in group tlsph = %g\n", (double) nall / countall); + printf(">>========>>========>>========>>========>>========>>========>>========>>========\n\n"); + } + if (logfile) { + fprintf(logfile, "\nTLSPH neighbors:\n"); + fprintf(logfile, " max # of neighbors for a single particle = %d\n", maxpartner); + fprintf(logfile, " average # of neighbors/particle in group tlsph = %g\n", (double) nall / countall); + } + } + } - if (INSERT_PREDEFINED_CRACKS) { - if (!crack_exclude(i, j)) - continue; - } - - if (r < h) { - spiky_kernel_and_derivative(h, r, domain->dimension, wf, wfd); - - partner[i][npartner[i]] = tag[j]; - wfd_list[i][npartner[i]] = wfd; - wf_list[i][npartner[i]] = wf; - npartner[i]++; - if (j < nlocal) { - partner[j][npartner[j]] = tag[i]; - wfd_list[j][npartner[j]] = wfd; - wf_list[j][npartner[j]] = wf; - npartner[j]++; - } - } - } - } - - // count number of particles for which this group is active - - // bond statistics - if (update->ntimestep > -1) { - n = 0; - int count = 0; - for (i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) { - n += npartner[i]; - count += 1; - } - } - int nall, countall; - MPI_Allreduce(&n, &nall, 1, MPI_INT, MPI_SUM, world); - MPI_Allreduce(&count, &countall, 1, MPI_INT, MPI_SUM, world); - if (countall < 1) countall = 1; - - if (comm->me == 0) { - if (screen) { - printf("\n>>========>>========>>========>>========>>========>>========>>========>>========\n"); - fprintf(screen, "TLSPH neighbors:\n"); - fprintf(screen, " max # of neighbors for a single particle = %d\n", maxpartner); - fprintf(screen, " average # of neighbors/particle in group tlsph = %g\n", (double) nall / countall); - printf(">>========>>========>>========>>========>>========>>========>>========>>========\n\n"); - } - if (logfile) { - fprintf(logfile, "\nTLSPH neighbors:\n"); - fprintf(logfile, " max # of neighbors for a single particle = %d\n", maxpartner); - fprintf(logfile, " average # of neighbors/particle in group tlsph = %g\n", (double) nall / countall); - } - } - } - - updateFlag = 0; // set update flag to zero after the update + updateFlag = 0; // set update flag to zero after the update } @@ -354,14 +348,14 @@ void FixSMD_TLSPH_ReferenceConfiguration::setup(int /*vflag*/) { ------------------------------------------------------------------------- */ double FixSMD_TLSPH_ReferenceConfiguration::memory_usage() { - int nmax = atom->nmax; - int bytes = nmax * sizeof(int); - bytes += (double)nmax * maxpartner * sizeof(tagint); // partner array - bytes += (double)nmax * maxpartner * sizeof(float); // wf_list - bytes += (double)nmax * maxpartner * sizeof(float); // wfd_list - bytes += (double)nmax * maxpartner * sizeof(float); // damage_per_interaction array - bytes += (double)nmax * sizeof(int); // npartner array - return bytes; + int nmax = atom->nmax; + int bytes = nmax * sizeof(int); + bytes += (double)nmax * maxpartner * sizeof(tagint); // partner array + bytes += (double)nmax * maxpartner * sizeof(float); // wf_list + bytes += (double)nmax * maxpartner * sizeof(float); // wfd_list + bytes += (double)nmax * maxpartner * sizeof(float); // damage_per_interaction array + bytes += (double)nmax * sizeof(int); // npartner array + return bytes; } @@ -370,13 +364,12 @@ double FixSMD_TLSPH_ReferenceConfiguration::memory_usage() { ------------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::grow_arrays(int nmax) { - //printf("in FixSMD_TLSPH_ReferenceConfiguration::grow_arrays\n"); - memory->grow(npartner, nmax, "tlsph_refconfig_neigh:npartner"); - memory->grow(partner, nmax, maxpartner, "tlsph_refconfig_neigh:partner"); - memory->grow(wfd_list, nmax, maxpartner, "tlsph_refconfig_neigh:wfd"); - memory->grow(wf_list, nmax, maxpartner, "tlsph_refconfig_neigh:wf"); - memory->grow(degradation_ij, nmax, maxpartner, "tlsph_refconfig_neigh:degradation_ij"); - memory->grow(energy_per_bond, nmax, maxpartner, "tlsph_refconfig_neigh:damage_onset_strain"); + memory->grow(npartner, nmax, "tlsph_refconfig_neigh:npartner"); + memory->grow(partner, nmax, maxpartner, "tlsph_refconfig_neigh:partner"); + memory->grow(wfd_list, nmax, maxpartner, "tlsph_refconfig_neigh:wfd"); + memory->grow(wf_list, nmax, maxpartner, "tlsph_refconfig_neigh:wf"); + memory->grow(degradation_ij, nmax, maxpartner, "tlsph_refconfig_neigh:degradation_ij"); + memory->grow(energy_per_bond, nmax, maxpartner, "tlsph_refconfig_neigh:damage_onset_strain"); } /* ---------------------------------------------------------------------- @@ -384,14 +377,14 @@ void FixSMD_TLSPH_ReferenceConfiguration::grow_arrays(int nmax) { ------------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::copy_arrays(int i, int j, int /*delflag*/) { - npartner[j] = npartner[i]; - for (int m = 0; m < npartner[j]; m++) { - partner[j][m] = partner[i][m]; - wfd_list[j][m] = wfd_list[i][m]; - wf_list[j][m] = wf_list[i][m]; - degradation_ij[j][m] = degradation_ij[i][m]; - energy_per_bond[j][m] = energy_per_bond[i][m]; - } + npartner[j] = npartner[i]; + for (int m = 0; m < npartner[j]; m++) { + partner[j][m] = partner[i][m]; + wfd_list[j][m] = wfd_list[i][m]; + wf_list[j][m] = wf_list[i][m]; + degradation_ij[j][m] = degradation_ij[i][m]; + energy_per_bond[j][m] = energy_per_bond[i][m]; + } } /* ---------------------------------------------------------------------- @@ -402,18 +395,16 @@ int FixSMD_TLSPH_ReferenceConfiguration::pack_exchange(int i, double *buf) { // NOTE: how do I know comm buf is big enough if extreme # of touching neighs // Comm::BUFEXTRA may need to be increased -//printf("pack_exchange ...\n"); - - int m = 0; - buf[m++] = npartner[i]; - for (int n = 0; n < npartner[i]; n++) { - buf[m++] = partner[i][n]; - buf[m++] = wfd_list[i][n]; - buf[m++] = wf_list[i][n]; - buf[m++] = degradation_ij[i][n]; - buf[m++] = energy_per_bond[i][n]; - } - return m; + int m = 0; + buf[m++] = npartner[i]; + for (int n = 0; n < npartner[i]; n++) { + buf[m++] = partner[i][n]; + buf[m++] = wfd_list[i][n]; + buf[m++] = wf_list[i][n]; + buf[m++] = degradation_ij[i][n]; + buf[m++] = energy_per_bond[i][n]; + } + return m; } @@ -422,27 +413,25 @@ int FixSMD_TLSPH_ReferenceConfiguration::pack_exchange(int i, double *buf) { ------------------------------------------------------------------------- */ int FixSMD_TLSPH_ReferenceConfiguration::unpack_exchange(int nlocal, double *buf) { - if (nlocal == nmax) { - //printf("nlocal=%d, nmax=%d\n", nlocal, nmax); - nmax = nmax / DELTA * DELTA; - nmax += DELTA; - grow_arrays(nmax); + if (nlocal == nmax) { + nmax = nmax / DELTA * DELTA; + nmax += DELTA; + grow_arrays(nmax); - error->message(FLERR, - "in Fixtlsph_refconfigNeighGCG::unpack_exchange: local arrays too small for receiving partner information; growing arrays"); - } -//printf("nlocal=%d, nmax=%d\n", nlocal, nmax); + if (comm->me == 0) + error->message(FLERR, "in Fixtlsph_refconfigNeighGCG::unpack_exchange: local arrays too small for receiving partner information; growing arrays"); + } - int m = 0; - npartner[nlocal] = static_cast(buf[m++]); - for (int n = 0; n < npartner[nlocal]; n++) { - partner[nlocal][n] = static_cast(buf[m++]); - wfd_list[nlocal][n] = static_cast(buf[m++]); - wf_list[nlocal][n] = static_cast(buf[m++]); - degradation_ij[nlocal][n] = static_cast(buf[m++]); - energy_per_bond[nlocal][n] = static_cast(buf[m++]); - } - return m; + int m = 0; + npartner[nlocal] = static_cast(buf[m++]); + for (int n = 0; n < npartner[nlocal]; n++) { + partner[nlocal][n] = static_cast(buf[m++]); + wfd_list[nlocal][n] = static_cast(buf[m++]); + wf_list[nlocal][n] = static_cast(buf[m++]); + degradation_ij[nlocal][n] = static_cast(buf[m++]); + energy_per_bond[nlocal][n] = static_cast(buf[m++]); + } + return m; } /* ---------------------------------------------------------------------- @@ -450,18 +439,18 @@ int FixSMD_TLSPH_ReferenceConfiguration::unpack_exchange(int nlocal, double *buf ------------------------------------------------------------------------- */ int FixSMD_TLSPH_ReferenceConfiguration::pack_restart(int i, double *buf) { - int m = 0; - // pack buf[0] this way because other fixes unpack it - buf[m++] = 4 * npartner[i] + 2; - buf[m++] = npartner[i]; - for (int n = 0; n < npartner[i]; n++) { - buf[m++] = partner[i][n]; - buf[m++] = wfd_list[i][n]; - buf[m++] = wf_list[i][n]; - buf[m++] = degradation_ij[i][n]; - buf[m++] = energy_per_bond[i][n]; - } - return m; + int m = 0; + // pack buf[0] this way because other fixes unpack it + buf[m++] = 4 * npartner[i] + 2; + buf[m++] = npartner[i]; + for (int n = 0; n < npartner[i]; n++) { + buf[m++] = partner[i][n]; + buf[m++] = wfd_list[i][n]; + buf[m++] = wf_list[i][n]; + buf[m++] = degradation_ij[i][n]; + buf[m++] = energy_per_bond[i][n]; + } + return m; } /* ---------------------------------------------------------------------- @@ -496,9 +485,9 @@ void FixSMD_TLSPH_ReferenceConfiguration::unpack_restart(int /*nlocal*/, int /*n int FixSMD_TLSPH_ReferenceConfiguration::maxsize_restart() { // maxtouch_all = max # of touching partners across all procs - int maxtouch_all; - MPI_Allreduce(&maxpartner, &maxtouch_all, 1, MPI_INT, MPI_MAX, world); - return 4 * maxtouch_all + 2; + int maxtouch_all; + MPI_Allreduce(&maxpartner, &maxtouch_all, 1, MPI_INT, MPI_MAX, world); + return 4 * maxtouch_all + 2; } /* ---------------------------------------------------------------------- @@ -506,72 +495,71 @@ int FixSMD_TLSPH_ReferenceConfiguration::maxsize_restart() { ------------------------------------------------------------------------- */ int FixSMD_TLSPH_ReferenceConfiguration::size_restart(int nlocal) { - return 4 * npartner[nlocal] + 2; + return 4 * npartner[nlocal] + 2; } /* ---------------------------------------------------------------------- */ int FixSMD_TLSPH_ReferenceConfiguration::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) { - int i, j, m; - double *radius = atom->radius; - double *vfrac = atom->vfrac; - double **x0 = atom->x0; - double **defgrad0 = atom->smd_data_9; + int i, j, m; + double *radius = atom->radius; + double *vfrac = atom->vfrac; + double **x0 = atom->x0; + double **defgrad0 = atom->smd_data_9; - //printf("FixSMD_TLSPH_ReferenceConfiguration:::pack_forward_comm\n"); - m = 0; - for (i = 0; i < n; i++) { - j = list[i]; - buf[m++] = x0[j][0]; - buf[m++] = x0[j][1]; - buf[m++] = x0[j][2]; + m = 0; + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = x0[j][0]; + buf[m++] = x0[j][1]; + buf[m++] = x0[j][2]; - buf[m++] = vfrac[j]; - buf[m++] = radius[j]; + buf[m++] = vfrac[j]; + buf[m++] = radius[j]; - buf[m++] = defgrad0[i][0]; - buf[m++] = defgrad0[i][1]; - buf[m++] = defgrad0[i][2]; - buf[m++] = defgrad0[i][3]; - buf[m++] = defgrad0[i][4]; - buf[m++] = defgrad0[i][5]; - buf[m++] = defgrad0[i][6]; - buf[m++] = defgrad0[i][7]; - buf[m++] = defgrad0[i][8]; + buf[m++] = defgrad0[i][0]; + buf[m++] = defgrad0[i][1]; + buf[m++] = defgrad0[i][2]; + buf[m++] = defgrad0[i][3]; + buf[m++] = defgrad0[i][4]; + buf[m++] = defgrad0[i][5]; + buf[m++] = defgrad0[i][6]; + buf[m++] = defgrad0[i][7]; + buf[m++] = defgrad0[i][8]; - } - return m; + } + return m; } /* ---------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::unpack_forward_comm(int n, int first, double *buf) { - int i, m, last; - double *radius = atom->radius; - double *vfrac = atom->vfrac; - double **x0 = atom->x0; - double **defgrad0 = atom->smd_data_9; + int i, m, last; + double *radius = atom->radius; + double *vfrac = atom->vfrac; + double **x0 = atom->x0; + double **defgrad0 = atom->smd_data_9; - m = 0; - last = first + n; - for (i = first; i < last; i++) { - x0[i][0] = buf[m++]; - x0[i][1] = buf[m++]; - x0[i][2] = buf[m++]; + m = 0; + last = first + n; + for (i = first; i < last; i++) { + x0[i][0] = buf[m++]; + x0[i][1] = buf[m++]; + x0[i][2] = buf[m++]; - vfrac[i] = buf[m++]; - radius[i] = buf[m++]; + vfrac[i] = buf[m++]; + radius[i] = buf[m++]; - defgrad0[i][0] = buf[m++]; - defgrad0[i][1] = buf[m++]; - defgrad0[i][2] = buf[m++]; - defgrad0[i][3] = buf[m++]; - defgrad0[i][4] = buf[m++]; - defgrad0[i][5] = buf[m++]; - defgrad0[i][6] = buf[m++]; - defgrad0[i][7] = buf[m++]; - defgrad0[i][8] = buf[m++]; - } + defgrad0[i][0] = buf[m++]; + defgrad0[i][1] = buf[m++]; + defgrad0[i][2] = buf[m++]; + defgrad0[i][3] = buf[m++]; + defgrad0[i][4] = buf[m++]; + defgrad0[i][5] = buf[m++]; + defgrad0[i][6] = buf[m++]; + defgrad0[i][7] = buf[m++]; + defgrad0[i][8] = buf[m++]; + } } /* ---------------------------------------------------------------------- @@ -582,26 +570,24 @@ void FixSMD_TLSPH_ReferenceConfiguration::unpack_forward_comm(int n, int first, bool FixSMD_TLSPH_ReferenceConfiguration::crack_exclude(int i, int j) { - double **x = atom->x; - double l0 = domain->lattice->xlattice; + double **x = atom->x; + double l0 = domain->lattice->xlattice; - // line between pair of atoms i,j - double x1 = x[i][0] / l0; - double y1 = x[i][1] / l0; + // line between pair of atoms i,j + double x1 = x[i][0] / l0; + double y1 = x[i][1] / l0; - double x2 = x[j][0] / l0; - double y2 = x[j][1] / l0; + double x2 = x[j][0] / l0; + double y2 = x[j][1] / l0; - // hardcoded crack line - double x3 = -0.1 / l0; - double y3 = ((int) 1.0 / l0) + 0.5; - //printf("y3 = %f\n", y3); - double x4 = 0.1 / l0 - 1.0 + 0.1; - double y4 = y3; + // hardcoded crack line + double x3 = -0.1 / l0; + double y3 = ((int) 1.0 / l0) + 0.5; + double x4 = 0.1 / l0 - 1.0 + 0.1; + double y4 = y3; - bool retVal = DoLineSegmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4); + bool retVal = DoLineSegmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4); - return !retVal; - //return 1; + return !retVal; } diff --git a/src/MACHDYN/pair_smd_tlsph.cpp b/src/MACHDYN/pair_smd_tlsph.cpp index 5fcc8742de..323325aa30 100644 --- a/src/MACHDYN/pair_smd_tlsph.cpp +++ b/src/MACHDYN/pair_smd_tlsph.cpp @@ -45,11 +45,9 @@ #include #include #include -#include using namespace SMD_Kernels; using namespace Eigen; -using namespace std; using namespace LAMMPS_NS; using namespace SMD_Math; @@ -62,68 +60,67 @@ using namespace SMD_Math; /* ---------------------------------------------------------------------- */ PairTlsph::PairTlsph(LAMMPS *lmp) : - Pair(lmp) { + Pair(lmp) { - onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; + onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; - failureModel = nullptr; - strengthModel = eos = nullptr; + failureModel = nullptr; + strengthModel = eos = nullptr; - nmax = 0; // make sure no atom on this proc such that initial memory allocation is correct - Fdot = Fincr = K = PK1 = nullptr; - R = FincrInv = W = D = nullptr; - detF = nullptr; - smoothVelDifference = nullptr; - numNeighsRefConfig = nullptr; - CauchyStress = nullptr; - hourglass_error = nullptr; - Lookup = nullptr; - particle_dt = nullptr; + nmax = 0; // make sure no atom on this proc such that initial memory allocation is correct + Fdot = Fincr = K = PK1 = nullptr; + R = FincrInv = W = D = nullptr; + detF = nullptr; + smoothVelDifference = nullptr; + numNeighsRefConfig = nullptr; + CauchyStress = nullptr; + hourglass_error = nullptr; + Lookup = nullptr; + particle_dt = nullptr; - updateFlag = 0; - first = true; - dtCFL = 0.0; // initialize dtCFL so it is set to safe value if extracted on zero-th timestep + updateFlag = 0; + first = true; + dtCFL = 0.0; // initialize dtCFL so it is set to safe value if extracted on zero-th timestep - comm_forward = 22; // this pair style communicates 20 doubles to ghost atoms : PK1 tensor + F tensor + shepardWeight - fix_tlsph_reference_configuration = nullptr; + comm_forward = 22; // this pair style communicates 20 doubles to ghost atoms : PK1 tensor + F tensor + shepardWeight + fix_tlsph_reference_configuration = nullptr; - cut_comm = MAX(neighbor->cutneighmax, comm->cutghostuser); // cutoff radius within which ghost atoms are communicated. + cut_comm = MAX(neighbor->cutneighmax, comm->cutghostuser); // cutoff radius within which ghost atoms are communicated. } /* ---------------------------------------------------------------------- */ PairTlsph::~PairTlsph() { - //printf("in PairTlsph::~PairTlsph()\n"); - if (allocated) { - memory->destroy(setflag); - memory->destroy(cutsq); - memory->destroy(strengthModel); - memory->destroy(eos); - memory->destroy(Lookup); + if (allocated) { + memory->destroy(setflag); + memory->destroy(cutsq); + memory->destroy(strengthModel); + memory->destroy(eos); + memory->destroy(Lookup); - delete[] onerad_dynamic; - delete[] onerad_frozen; - delete[] maxrad_dynamic; - delete[] maxrad_frozen; + delete[] onerad_dynamic; + delete[] onerad_frozen; + delete[] maxrad_dynamic; + delete[] maxrad_frozen; - delete[] Fdot; - delete[] Fincr; - delete[] K; - delete[] detF; - delete[] PK1; - delete[] smoothVelDifference; - delete[] R; - delete[] FincrInv; - delete[] W; - delete[] D; - delete[] numNeighsRefConfig; - delete[] CauchyStress; - delete[] hourglass_error; - delete[] particle_dt; + delete[] Fdot; + delete[] Fincr; + delete[] K; + delete[] detF; + delete[] PK1; + delete[] smoothVelDifference; + delete[] R; + delete[] FincrInv; + delete[] W; + delete[] D; + delete[] numNeighsRefConfig; + delete[] CauchyStress; + delete[] hourglass_error; + delete[] particle_dt; - delete[] failureModel; - } + delete[] failureModel; + } } /* ---------------------------------------------------------------------- @@ -133,561 +130,548 @@ PairTlsph::~PairTlsph() { ---------------------------------------------------------------------- */ void PairTlsph::PreCompute() { - tagint *mol = atom->molecule; - double *vfrac = atom->vfrac; - double *radius = atom->radius; - double **x0 = atom->x0; - double **x = atom->x; - double **v = atom->vest; // extrapolated velocities corresponding to current positions - double **vint = atom->v; // Velocity-Verlet algorithm velocities - double *damage = atom->damage; - tagint *tag = atom->tag; - int *type = atom->type; - int nlocal = atom->nlocal; - int jnum, jj, i, j, itype, idim; + tagint *mol = atom->molecule; + double *vfrac = atom->vfrac; + double *radius = atom->radius; + double **x0 = atom->x0; + double **x = atom->x; + double **v = atom->vest; // extrapolated velocities corresponding to current positions + double **vint = atom->v; // Velocity-Verlet algorithm velocities + double *damage = atom->damage; + tagint *tag = atom->tag; + int *type = atom->type; + int nlocal = atom->nlocal; + int jnum, jj, i, j, itype, idim; - tagint **partner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->partner; - int *npartner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->npartner; - float **wfd_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wfd_list; - float **wf_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wf_list; - float **degradation_ij = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->degradation_ij; - double r0, r0Sq, wf, wfd, h, irad, voli, volj, scale, shepardWeight; - Vector3d dx, dx0, dv, g; - Matrix3d Ktmp, Ftmp, Fdottmp, L, U, eye; - Vector3d vi, vj, vinti, vintj, xi, xj, x0i, x0j, dvint; - int periodic = (domain->xperiodic || domain->yperiodic || domain->zperiodic); - bool status; - Matrix3d F0; + tagint **partner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->partner; + int *npartner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->npartner; + float **wfd_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wfd_list; + float **wf_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wf_list; + float **degradation_ij = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->degradation_ij; + double r0, r0Sq, wf, wfd, h, irad, voli, volj, scale, shepardWeight; + Vector3d dx, dx0, dv, g; + Matrix3d Ktmp, Ftmp, Fdottmp, L, U, eye; + Vector3d vi, vj, vinti, vintj, xi, xj, x0i, x0j, dvint; + int periodic = (domain->xperiodic || domain->yperiodic || domain->zperiodic); + bool status; + Matrix3d F0; - eye.setIdentity(); + eye.setIdentity(); - for (i = 0; i < nlocal; i++) { + for (i = 0; i < nlocal; i++) { - itype = type[i]; - if (setflag[itype][itype] == 1) { + itype = type[i]; + if (setflag[itype][itype] == 1) { - K[i].setZero(); - Fincr[i].setZero(); - Fdot[i].setZero(); - numNeighsRefConfig[i] = 0; - smoothVelDifference[i].setZero(); - hourglass_error[i] = 0.0; + K[i].setZero(); + Fincr[i].setZero(); + Fdot[i].setZero(); + numNeighsRefConfig[i] = 0; + smoothVelDifference[i].setZero(); + hourglass_error[i] = 0.0; - if (mol[i] < 0) { // valid SPH particle have mol > 0 - continue; - } + if (mol[i] < 0) { // valid SPH particle have mol > 0 + continue; + } - // initialize aveage mass density - h = 2.0 * radius[i]; - r0 = 0.0; - spiky_kernel_and_derivative(h, r0, domain->dimension, wf, wfd); + // initialize aveage mass density + h = 2.0 * radius[i]; + r0 = 0.0; + spiky_kernel_and_derivative(h, r0, domain->dimension, wf, wfd); - jnum = npartner[i]; - irad = radius[i]; - voli = vfrac[i]; - shepardWeight = wf * voli; + jnum = npartner[i]; + irad = radius[i]; + voli = vfrac[i]; + shepardWeight = wf * voli; - // initialize Eigen data structures from LAMMPS data structures - for (idim = 0; idim < 3; idim++) { - xi(idim) = x[i][idim]; - x0i(idim) = x0[i][idim]; - vi(idim) = v[i][idim]; - vinti(idim) = vint[i][idim]; - } + // initialize Eigen data structures from LAMMPS data structures + for (idim = 0; idim < 3; idim++) { + xi(idim) = x[i][idim]; + x0i(idim) = x0[i][idim]; + vi(idim) = v[i][idim]; + vinti(idim) = vint[i][idim]; + } - for (jj = 0; jj < jnum; jj++) { + for (jj = 0; jj < jnum; jj++) { - if (partner[i][jj] == 0) - continue; - j = atom->map(partner[i][jj]); - if (j < 0) { // // check if lost a partner without first breaking bond - partner[i][jj] = 0; - continue; - } + if (partner[i][jj] == 0) + continue; + j = atom->map(partner[i][jj]); + if (j < 0) { // // check if lost a partner without first breaking bond + partner[i][jj] = 0; + continue; + } - if (mol[j] < 0) { // particle has failed. do not include it for computing any property - continue; - } + if (mol[j] < 0) { // particle has failed. do not include it for computing any property + continue; + } - if (mol[i] != mol[j]) { - continue; - } + if (mol[i] != mol[j]) { + continue; + } - // initialize Eigen data structures from LAMMPS data structures - for (idim = 0; idim < 3; idim++) { - xj(idim) = x[j][idim]; - x0j(idim) = x0[j][idim]; - vj(idim) = v[j][idim]; - vintj(idim) = vint[j][idim]; - } - dx0 = x0j - x0i; - dx = xj - xi; + // initialize Eigen data structures from LAMMPS data structures + for (idim = 0; idim < 3; idim++) { + xj(idim) = x[j][idim]; + x0j(idim) = x0[j][idim]; + vj(idim) = v[j][idim]; + vintj(idim) = vint[j][idim]; + } + dx0 = x0j - x0i; + dx = xj - xi; - if (periodic) - domain->minimum_image(dx0(0), dx0(1), dx0(2)); + if (periodic) + domain->minimum_image(dx0(0), dx0(1), dx0(2)); - r0Sq = dx0.squaredNorm(); - h = irad + radius[j]; + r0Sq = dx0.squaredNorm(); + h = irad + radius[j]; - r0 = sqrt(r0Sq); - volj = vfrac[j]; + r0 = sqrt(r0Sq); + volj = vfrac[j]; - // distance vectors in current and reference configuration, velocity difference - dv = vj - vi; - dvint = vintj - vinti; + // distance vectors in current and reference configuration, velocity difference + dv = vj - vi; + dvint = vintj - vinti; - // scale the interaction according to the damage variable - scale = 1.0 - degradation_ij[i][jj]; - wf = wf_list[i][jj] * scale; - wfd = wfd_list[i][jj] * scale; - g = (wfd / r0) * dx0; + // scale the interaction according to the damage variable + scale = 1.0 - degradation_ij[i][jj]; + wf = wf_list[i][jj] * scale; + wfd = wfd_list[i][jj] * scale; + g = (wfd / r0) * dx0; - /* build matrices */ - Ktmp = -g * dx0.transpose(); - Fdottmp = -dv * g.transpose(); - Ftmp = -(dx - dx0) * g.transpose(); + /* build matrices */ + Ktmp = -g * dx0.transpose(); + Fdottmp = -dv * g.transpose(); + Ftmp = -(dx - dx0) * g.transpose(); - K[i] += volj * Ktmp; - Fdot[i] += volj * Fdottmp; - Fincr[i] += volj * Ftmp; - shepardWeight += volj * wf; - smoothVelDifference[i] += volj * wf * dvint; - numNeighsRefConfig[i]++; - } // end loop over j + K[i] += volj * Ktmp; + Fdot[i] += volj * Fdottmp; + Fincr[i] += volj * Ftmp; + shepardWeight += volj * wf; + smoothVelDifference[i] += volj * wf * dvint; + numNeighsRefConfig[i]++; + } // end loop over j - // normalize average velocity field around an integration point - if (shepardWeight > 0.0) { - smoothVelDifference[i] /= shepardWeight; - } else { - smoothVelDifference[i].setZero(); - } + // normalize average velocity field around an integration point + if (shepardWeight > 0.0) { + smoothVelDifference[i] /= shepardWeight; + } else { + smoothVelDifference[i].setZero(); + } - pseudo_inverse_SVD(K[i]); - Fdot[i] *= K[i]; - Fincr[i] *= K[i]; - Fincr[i] += eye; + pseudo_inverse_SVD(K[i]); + Fdot[i] *= K[i]; + Fincr[i] *= K[i]; + Fincr[i] += eye; - if (JAUMANN) { - R[i].setIdentity(); // for Jaumann stress rate, we do not need a subsequent rotation back into the reference configuration - } else { - status = PolDec(Fincr[i], R[i], U, false); // polar decomposition of the deformation gradient, F = R * U - if (!status) { - error->message(FLERR, "Polar decomposition of deformation gradient failed.\n"); - mol[i] = -1; - } else { - Fincr[i] = R[i] * U; - } - } + if (JAUMANN) { + R[i].setIdentity(); // for Jaumann stress rate, we do not need a subsequent rotation back into the reference configuration + } else { + status = PolDec(Fincr[i], R[i], U, false); // polar decomposition of the deformation gradient, F = R * U + if (!status) { + error->message(FLERR, "Polar decomposition of deformation gradient failed.\n"); + mol[i] = -1; + } else { + Fincr[i] = R[i] * U; + } + } - detF[i] = Fincr[i].determinant(); - FincrInv[i] = Fincr[i].inverse(); + detF[i] = Fincr[i].determinant(); + FincrInv[i] = Fincr[i].inverse(); - // velocity gradient - L = Fdot[i] * FincrInv[i]; + // velocity gradient + L = Fdot[i] * FincrInv[i]; - // symmetric (D) and asymmetric (W) parts of L - D[i] = 0.5 * (L + L.transpose()); - W[i] = 0.5 * (L - L.transpose()); // spin tensor:: need this for Jaumann rate + // symmetric (D) and asymmetric (W) parts of L + D[i] = 0.5 * (L + L.transpose()); + W[i] = 0.5 * (L - L.transpose()); // spin tensor:: need this for Jaumann rate - // unrotated rate-of-deformation tensor d, see right side of Pronto2d, eqn.(2.1.7) - // convention: unrotated frame is that one, where the true rotation of an integration point has been subtracted. - // stress in the unrotated frame of reference is denoted sigma (stress seen by an observer doing rigid body rotations along with the material) - // stress in the true frame of reference (a stationary observer) is denoted by T, "true stress" - D[i] = (R[i].transpose() * D[i] * R[i]).eval(); + // unrotated rate-of-deformation tensor d, see right side of Pronto2d, eqn.(2.1.7) + // convention: unrotated frame is that one, where the true rotation of an integration point has been subtracted. + // stress in the unrotated frame of reference is denoted sigma (stress seen by an observer doing rigid body rotations along with the material) + // stress in the true frame of reference (a stationary observer) is denoted by T, "true stress" + D[i] = (R[i].transpose() * D[i] * R[i]).eval(); - // limit strain rate - //double limit = 1.0e-3 * Lookup[SIGNAL_VELOCITY][itype] / radius[i]; - //D[i] = LimitEigenvalues(D[i], limit); + // limit strain rate + //double limit = 1.0e-3 * Lookup[SIGNAL_VELOCITY][itype] / radius[i]; + //D[i] = LimitEigenvalues(D[i], limit); - /* - * make sure F stays within some limits - */ + /* + * make sure F stays within some limits + */ - if ((detF[i] < DETF_MIN) || (detF[i] > DETF_MAX) || (numNeighsRefConfig[i] == 0)) { - printf("deleting particle [" TAGINT_FORMAT "] because det(F)=%f is outside stable range %f -- %f \n", tag[i], - Fincr[i].determinant(), - DETF_MIN, DETF_MAX); - printf("nn = %d, damage=%f\n", numNeighsRefConfig[i], damage[i]); - cout << "Here is matrix F:" << endl << Fincr[i] << endl; - cout << "Here is matrix F-1:" << endl << FincrInv[i] << endl; - cout << "Here is matrix K-1:" << endl << K[i] << endl; - cout << "Here is matrix K:" << endl << K[i].inverse() << endl; - cout << "Here is det of K" << endl << (K[i].inverse()).determinant() << endl; - cout << "Here is matrix R:" << endl << R[i] << endl; - cout << "Here is det of R" << endl << R[i].determinant() << endl; - cout << "Here is matrix U:" << endl << U << endl; - mol[i] = -1; - //error->one(FLERR, ""); - } + if ((detF[i] < DETF_MIN) || (detF[i] > DETF_MAX) || (numNeighsRefConfig[i] == 0)) { + utils::logmesg(lmp, "deleting particle [{}] because det(F)={}f is outside stable range" + " {} -- {} \n", tag[i], Fincr[i].determinant(), DETF_MIN, DETF_MAX); + utils::logmesg(lmp,"nn = {}, damage={}\n", numNeighsRefConfig[i], damage[i]); + mol[i] = -1; + } - if (mol[i] < 0) { - D[i].setZero(); - Fdot[i].setZero(); - Fincr[i].setIdentity(); - smoothVelDifference[i].setZero(); - detF[i] = 1.0; - K[i].setIdentity(); + if (mol[i] < 0) { + D[i].setZero(); + Fdot[i].setZero(); + Fincr[i].setIdentity(); + smoothVelDifference[i].setZero(); + detF[i] = 1.0; + K[i].setIdentity(); - vint[i][0] = 0.0; - vint[i][1] = 0.0; - vint[i][2] = 0.0; - } - } // end loop over i - } // end check setflag + vint[i][0] = 0.0; + vint[i][1] = 0.0; + vint[i][2] = 0.0; + } + } // end loop over i + } // end check setflag } /* ---------------------------------------------------------------------- */ void PairTlsph::compute(int eflag, int vflag) { - if (atom->nmax > nmax) { - nmax = atom->nmax; - delete[] Fdot; - Fdot = new Matrix3d[nmax]; // memory usage: 9 doubles - delete[] Fincr; - Fincr = new Matrix3d[nmax]; // memory usage: 9 doubles - delete[] K; - K = new Matrix3d[nmax]; // memory usage: 9 doubles - delete[] PK1; - PK1 = new Matrix3d[nmax]; // memory usage: 9 doubles; total 5*9=45 doubles - delete[] detF; - detF = new double[nmax]; // memory usage: 1 double; total 46 doubles - delete[] smoothVelDifference; - smoothVelDifference = new Vector3d[nmax]; // memory usage: 3 doubles; total 49 doubles - delete[] R; - R = new Matrix3d[nmax]; // memory usage: 9 doubles; total 67 doubles - delete[] FincrInv; - FincrInv = new Matrix3d[nmax]; // memory usage: 9 doubles; total 85 doubles - delete[] W; - W = new Matrix3d[nmax]; // memory usage: 9 doubles; total 94 doubles - delete[] D; - D = new Matrix3d[nmax]; // memory usage: 9 doubles; total 103 doubles - delete[] numNeighsRefConfig; - numNeighsRefConfig = new int[nmax]; // memory usage: 1 int; total 108 doubles - delete[] CauchyStress; - CauchyStress = new Matrix3d[nmax]; // memory usage: 9 doubles; total 118 doubles - delete[] hourglass_error; - hourglass_error = new double[nmax]; - delete[] particle_dt; - particle_dt = new double[nmax]; - } + if (atom->nmax > nmax) { + nmax = atom->nmax; + delete[] Fdot; + Fdot = new Matrix3d[nmax]; // memory usage: 9 doubles + delete[] Fincr; + Fincr = new Matrix3d[nmax]; // memory usage: 9 doubles + delete[] K; + K = new Matrix3d[nmax]; // memory usage: 9 doubles + delete[] PK1; + PK1 = new Matrix3d[nmax]; // memory usage: 9 doubles; total 5*9=45 doubles + delete[] detF; + detF = new double[nmax]; // memory usage: 1 double; total 46 doubles + delete[] smoothVelDifference; + smoothVelDifference = new Vector3d[nmax]; // memory usage: 3 doubles; total 49 doubles + delete[] R; + R = new Matrix3d[nmax]; // memory usage: 9 doubles; total 67 doubles + delete[] FincrInv; + FincrInv = new Matrix3d[nmax]; // memory usage: 9 doubles; total 85 doubles + delete[] W; + W = new Matrix3d[nmax]; // memory usage: 9 doubles; total 94 doubles + delete[] D; + D = new Matrix3d[nmax]; // memory usage: 9 doubles; total 103 doubles + delete[] numNeighsRefConfig; + numNeighsRefConfig = new int[nmax]; // memory usage: 1 int; total 108 doubles + delete[] CauchyStress; + CauchyStress = new Matrix3d[nmax]; // memory usage: 9 doubles; total 118 doubles + delete[] hourglass_error; + hourglass_error = new double[nmax]; + delete[] particle_dt; + particle_dt = new double[nmax]; + } - if (first) { // return on first call, because reference connectivity lists still needs to be built. Also zero quantities which are otherwise undefined. - first = false; + if (first) { // return on first call, because reference connectivity lists still needs to be built. Also zero quantities which are otherwise undefined. + first = false; - for (int i = 0; i < atom->nlocal; i++) { - Fincr[i].setZero(); - detF[i] = 0.0; - smoothVelDifference[i].setZero(); - D[i].setZero(); - numNeighsRefConfig[i] = 0; - CauchyStress[i].setZero(); - hourglass_error[i] = 0.0; - particle_dt[i] = 0.0; - } + for (int i = 0; i < atom->nlocal; i++) { + Fincr[i].setZero(); + detF[i] = 0.0; + smoothVelDifference[i].setZero(); + D[i].setZero(); + numNeighsRefConfig[i] = 0; + CauchyStress[i].setZero(); + hourglass_error[i] = 0.0; + particle_dt[i] = 0.0; + } - return; - } + return; + } - /* - * calculate deformations and rate-of-deformations - */ - PairTlsph::PreCompute(); + /* + * calculate deformations and rate-of-deformations + */ + PairTlsph::PreCompute(); - /* - * calculate stresses from constitutive models - */ - PairTlsph::AssembleStress(); + /* + * calculate stresses from constitutive models + */ + PairTlsph::AssembleStress(); - /* - * QUANTITIES ABOVE HAVE ONLY BEEN CALCULATED FOR NLOCAL PARTICLES. - * NEED TO DO A FORWARD COMMUNICATION TO GHOST ATOMS NOW - */ - comm->forward_comm(this); + /* + * QUANTITIES ABOVE HAVE ONLY BEEN CALCULATED FOR NLOCAL PARTICLES. + * NEED TO DO A FORWARD COMMUNICATION TO GHOST ATOMS NOW + */ + comm->forward_comm(this); - /* - * compute forces between particles - */ - updateFlag = 0; - ComputeForces(eflag, vflag); + /* + * compute forces between particles + */ + updateFlag = 0; + ComputeForces(eflag, vflag); } void PairTlsph::ComputeForces(int eflag, int vflag) { - tagint *mol = atom->molecule; - double **x = atom->x; - double **v = atom->vest; - double **x0 = atom->x0; - double **f = atom->f; - double *vfrac = atom->vfrac; - double *desph = atom->desph; - double *rmass = atom->rmass; - double *radius = atom->radius; - double *damage = atom->damage; - double *plastic_strain = atom->eff_plastic_strain; - int *type = atom->type; - int nlocal = atom->nlocal; - int i, j, jj, jnum, itype, idim; - double r, hg_mag, wf, wfd, h, r0, r0Sq, voli, volj; - double delVdotDelR, visc_magnitude, deltaE, mu_ij, hg_err, gamma_dot_dx, delta, scale; - double strain1d, strain1d_max, softening_strain, shepardWeight; - char str[128]; - Vector3d fi, fj, dx0, dx, dv, f_stress, f_hg, dxp_i, dxp_j, gamma, g, gamma_i, gamma_j, x0i, x0j; - Vector3d xi, xj, vi, vj, f_visc, sumForces, f_spring; - int periodic = (domain->xperiodic || domain->yperiodic || domain->zperiodic); + tagint *mol = atom->molecule; + double **x = atom->x; + double **v = atom->vest; + double **x0 = atom->x0; + double **f = atom->f; + double *vfrac = atom->vfrac; + double *desph = atom->desph; + double *rmass = atom->rmass; + double *radius = atom->radius; + double *damage = atom->damage; + double *plastic_strain = atom->eff_plastic_strain; + int *type = atom->type; + int nlocal = atom->nlocal; + int i, j, jj, jnum, itype, idim; + double r, hg_mag, wf, wfd, h, r0, r0Sq, voli, volj; + double delVdotDelR, visc_magnitude, deltaE, mu_ij, hg_err, gamma_dot_dx, delta, scale; + double strain1d, strain1d_max, softening_strain, shepardWeight; + Vector3d fi, fj, dx0, dx, dv, f_stress, f_hg, dxp_i, dxp_j, gamma, g, gamma_i, gamma_j, x0i, x0j; + Vector3d xi, xj, vi, vj, f_visc, sumForces, f_spring; + int periodic = (domain->xperiodic || domain->yperiodic || domain->zperiodic); - tagint **partner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->partner; - int *npartner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->npartner; - float **wfd_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wfd_list; - float **wf_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wf_list; - float **degradation_ij = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->degradation_ij; - float **energy_per_bond = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->energy_per_bond; - Matrix3d eye; - eye.setIdentity(); + tagint **partner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->partner; + int *npartner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->npartner; + float **wfd_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wfd_list; + float **wf_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wf_list; + float **degradation_ij = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->degradation_ij; + float **energy_per_bond = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->energy_per_bond; + Matrix3d eye; + eye.setIdentity(); - ev_init(eflag, vflag); + ev_init(eflag, vflag); + /* + * iterate over pairs of particles i, j and assign forces using PK1 stress tensor + */ + + //updateFlag = 0; + hMin = 1.0e22; + dtRelative = 1.0e22; + + for (i = 0; i < nlocal; i++) { + + if (mol[i] < 0) { + continue; // Particle i is not a valid SPH particle (anymore). Skip all interactions with this particle. + } + + itype = type[i]; + jnum = npartner[i]; + voli = vfrac[i]; + + // initialize aveage mass density + h = 2.0 * radius[i]; + r = 0.0; + spiky_kernel_and_derivative(h, r, domain->dimension, wf, wfd); + shepardWeight = wf * voli; + + for (idim = 0; idim < 3; idim++) { + x0i(idim) = x0[i][idim]; + xi(idim) = x[i][idim]; + vi(idim) = v[i][idim]; + } + + for (jj = 0; jj < jnum; jj++) { + if (partner[i][jj] == 0) + continue; + j = atom->map(partner[i][jj]); + if (j < 0) { // // check if lost a partner without first breaking bond + partner[i][jj] = 0; + continue; + } + + if (mol[j] < 0) { + continue; // Particle j is not a valid SPH particle (anymore). Skip all interactions with this particle. + } + + if (mol[i] != mol[j]) { + continue; + } + + if (type[j] != itype) + error->all(FLERR, "particle pair is not of same type!"); + + for (idim = 0; idim < 3; idim++) { + x0j(idim) = x0[j][idim]; + xj(idim) = x[j][idim]; + vj(idim) = v[j][idim]; + } + + if (periodic) + domain->minimum_image(dx0(0), dx0(1), dx0(2)); + + // check that distance between i and j (in the reference config) is less than cutoff + dx0 = x0j - x0i; + r0Sq = dx0.squaredNorm(); + h = radius[i] + radius[j]; + hMin = MIN(hMin, h); + r0 = sqrt(r0Sq); + volj = vfrac[j]; + + // distance vectors in current and reference configuration, velocity difference + dx = xj - xi; + dv = vj - vi; + r = dx.norm(); // current distance + + // scale the interaction according to the damage variable + scale = 1.0 - degradation_ij[i][jj]; + wf = wf_list[i][jj] * scale; + wfd = wfd_list[i][jj] * scale; + + g = (wfd / r0) * dx0; // uncorrected kernel gradient + + /* + * force contribution -- note that the kernel gradient correction has been absorbed into PK1 + */ + + f_stress = -voli * volj * (PK1[i] + PK1[j]) * g; + + /* + * artificial viscosity + */ + delVdotDelR = dx.dot(dv) / (r + 0.1 * h); // project relative velocity onto unit particle distance vector [m/s] + LimitDoubleMagnitude(delVdotDelR, 0.01 * Lookup[SIGNAL_VELOCITY][itype]); + mu_ij = h * delVdotDelR / (r + 0.1 * h); // units: [m * m/s / m = m/s] + visc_magnitude = (-Lookup[VISCOSITY_Q1][itype] * Lookup[SIGNAL_VELOCITY][itype] * mu_ij + + Lookup[VISCOSITY_Q2][itype] * mu_ij * mu_ij) / Lookup[REFERENCE_DENSITY][itype]; // units: m^5/(s^2 kg)) + f_visc = rmass[i] * rmass[j] * visc_magnitude * wfd * dx / (r + 1.0e-2 * h); // units: kg^2 * m^5/(s^2 kg) * m^-4 = kg m / s^2 = N + + /* + * hourglass deviation of particles i and j + */ + + gamma = 0.5 * (Fincr[i] + Fincr[j]) * dx0 - dx; + hg_err = gamma.norm() / r0; + hourglass_error[i] += volj * wf * hg_err; + + /* SPH-like hourglass formulation */ + + if (MAX(plastic_strain[i], plastic_strain[j]) > 1.0e-3) { /* - * iterate over pairs of particles i, j and assign forces using PK1 stress tensor + * viscous hourglass formulation for particles with plastic deformation + */ + delta = gamma.dot(dx); + if (delVdotDelR * delta < 0.0) { + hg_err = MAX(hg_err, 0.05); // limit hg_err to avoid numerical instabilities + hg_mag = -hg_err * Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] * Lookup[SIGNAL_VELOCITY][itype] * mu_ij + / Lookup[REFERENCE_DENSITY][itype]; // this has units of pressure + } else { + hg_mag = 0.0; + } + f_hg = rmass[i] * rmass[j] * hg_mag * wfd * dx / (r + 1.0e-2 * h); + + } else { + /* + * stiffness hourglass formulation for particle in the elastic regime */ - //updateFlag = 0; - hMin = 1.0e22; - dtRelative = 1.0e22; + gamma_dot_dx = gamma.dot(dx); // project hourglass error vector onto pair distance vector + LimitDoubleMagnitude(gamma_dot_dx, 0.1 * r); // limit projected vector to avoid numerical instabilities + delta = 0.5 * gamma_dot_dx / (r + 0.1 * h); // delta has dimensions of [m] + hg_mag = Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] * delta / (r0Sq + 0.01 * h * h); // hg_mag has dimensions [m^(-1)] + hg_mag *= -voli * volj * wf * Lookup[YOUNGS_MODULUS][itype]; // hg_mag has dimensions [J*m^(-1)] = [N] + f_hg = (hg_mag / (r + 0.01 * h)) * dx; + } - for (i = 0; i < nlocal; i++) { + // scale hourglass force with damage + f_hg *= (1.0 - damage[i]) * (1.0 - damage[j]); - if (mol[i] < 0) { - continue; // Particle i is not a valid SPH particle (anymore). Skip all interactions with this particle. - } + // sum stress, viscous, and hourglass forces + sumForces = f_stress + f_visc + f_hg; // + f_spring; - itype = type[i]; - jnum = npartner[i]; - voli = vfrac[i]; + // energy rate -- project velocity onto force vector + deltaE = 0.5 * sumForces.dot(dv); - // initialize aveage mass density - h = 2.0 * radius[i]; - r = 0.0; - spiky_kernel_and_derivative(h, r, domain->dimension, wf, wfd); - shepardWeight = wf * voli; + // apply forces to pair of particles + f[i][0] += sumForces(0); + f[i][1] += sumForces(1); + f[i][2] += sumForces(2); + desph[i] += deltaE; - for (idim = 0; idim < 3; idim++) { - x0i(idim) = x0[i][idim]; - xi(idim) = x[i][idim]; - vi(idim) = v[i][idim]; - } + // tally atomistic stress tensor + if (evflag) { + ev_tally_xyz(i, j, nlocal, 0, 0.0, 0.0, sumForces(0), sumForces(1), sumForces(2), dx(0), dx(1), dx(2)); + } - for (jj = 0; jj < jnum; jj++) { - if (partner[i][jj] == 0) - continue; - j = atom->map(partner[i][jj]); - if (j < 0) { // // check if lost a partner without first breaking bond - partner[i][jj] = 0; - continue; - } + shepardWeight += wf * volj; - if (mol[j] < 0) { - continue; // Particle j is not a valid SPH particle (anymore). Skip all interactions with this particle. - } + // check if a particle has moved too much w.r.t another particle + if (r > r0) { + if (update_method == UPDATE_CONSTANT_THRESHOLD) { + if (r - r0 > update_threshold) { + updateFlag = 1; + } + } else if (update_method == UPDATE_PAIRWISE_RATIO) { + if ((r - r0) / h > update_threshold) { + updateFlag = 1; + } + } + } - if (mol[i] != mol[j]) { - continue; - } + if (failureModel[itype].failure_max_pairwise_strain) { - if (type[j] != itype) { - sprintf(str, "particle pair is not of same type!"); - error->all(FLERR, str); - } + strain1d = (r - r0) / r0; + strain1d_max = Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype]; + softening_strain = 2.0 * strain1d_max; - for (idim = 0; idim < 3; idim++) { - x0j(idim) = x0[j][idim]; - xj(idim) = x[j][idim]; - vj(idim) = v[j][idim]; - } + if (strain1d > strain1d_max) { + degradation_ij[i][jj] = (strain1d - strain1d_max) / softening_strain; + } else { + degradation_ij[i][jj] = 0.0; + } - if (periodic) - domain->minimum_image(dx0(0), dx0(1), dx0(2)); + if (degradation_ij[i][jj] >= 1.0) { // delete interaction if fully damaged + partner[i][jj] = 0; + } + } - // check that distance between i and j (in the reference config) is less than cutoff - dx0 = x0j - x0i; - r0Sq = dx0.squaredNorm(); - h = radius[i] + radius[j]; - hMin = MIN(hMin, h); - r0 = sqrt(r0Sq); - volj = vfrac[j]; + if (failureModel[itype].failure_energy_release_rate) { - // distance vectors in current and reference configuration, velocity difference - dx = xj - xi; - dv = vj - vi; - r = dx.norm(); // current distance + // integration approach + energy_per_bond[i][jj] += update->dt * f_stress.dot(dv) / (voli * volj); + double Vic = (2.0 / 3.0) * h * h * h; // interaction volume for 2d plane strain + double critical_energy_per_bond = Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] / (2.0 * Vic); - // scale the interaction according to the damage variable - scale = 1.0 - degradation_ij[i][jj]; - wf = wf_list[i][jj] * scale; - wfd = wfd_list[i][jj] * scale; + if (energy_per_bond[i][jj] > critical_energy_per_bond) { + //degradation_ij[i][jj] = 1.0; + partner[i][jj] = 0; + } + } - g = (wfd / r0) * dx0; // uncorrected kernel gradient + if (failureModel[itype].integration_point_wise) { - /* - * force contribution -- note that the kernel gradient correction has been absorbed into PK1 - */ + strain1d = (r - r0) / r0; - f_stress = -voli * volj * (PK1[i] + PK1[j]) * g; + if (strain1d > 0.0) { - /* - * artificial viscosity - */ - delVdotDelR = dx.dot(dv) / (r + 0.1 * h); // project relative velocity onto unit particle distance vector [m/s] - LimitDoubleMagnitude(delVdotDelR, 0.01 * Lookup[SIGNAL_VELOCITY][itype]); - mu_ij = h * delVdotDelR / (r + 0.1 * h); // units: [m * m/s / m = m/s] - visc_magnitude = (-Lookup[VISCOSITY_Q1][itype] * Lookup[SIGNAL_VELOCITY][itype] * mu_ij - + Lookup[VISCOSITY_Q2][itype] * mu_ij * mu_ij) / Lookup[REFERENCE_DENSITY][itype]; // units: m^5/(s^2 kg)) - f_visc = rmass[i] * rmass[j] * visc_magnitude * wfd * dx / (r + 1.0e-2 * h); // units: kg^2 * m^5/(s^2 kg) * m^-4 = kg m / s^2 = N + if ((damage[i] == 1.0) && (damage[j] == 1.0)) { + // check if damage_onset is already defined + if (energy_per_bond[i][jj] == 0.0) { // pair damage not defined yet + energy_per_bond[i][jj] = strain1d; + } else { // damage initiation strain already defined + strain1d_max = energy_per_bond[i][jj]; + softening_strain = 2.0 * strain1d_max; - /* - * hourglass deviation of particles i and j - */ + if (strain1d > strain1d_max) { + degradation_ij[i][jj] = (strain1d - strain1d_max) / softening_strain; + } else { + degradation_ij[i][jj] = 0.0; + } + } + } - gamma = 0.5 * (Fincr[i] + Fincr[j]) * dx0 - dx; - hg_err = gamma.norm() / r0; - hourglass_error[i] += volj * wf * hg_err; + if (degradation_ij[i][jj] >= 1.0) { // delete interaction if fully damaged + partner[i][jj] = 0; + } - /* SPH-like hourglass formulation */ + } else { + degradation_ij[i][jj] = 0.0; + } // end failureModel[itype].integration_point_wise - if (MAX(plastic_strain[i], plastic_strain[j]) > 1.0e-3) { - /* - * viscous hourglass formulation for particles with plastic deformation - */ - delta = gamma.dot(dx); - if (delVdotDelR * delta < 0.0) { - hg_err = MAX(hg_err, 0.05); // limit hg_err to avoid numerical instabilities - hg_mag = -hg_err * Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] * Lookup[SIGNAL_VELOCITY][itype] * mu_ij - / Lookup[REFERENCE_DENSITY][itype]; // this has units of pressure - } else { - hg_mag = 0.0; - } - f_hg = rmass[i] * rmass[j] * hg_mag * wfd * dx / (r + 1.0e-2 * h); + } - } else { - /* - * stiffness hourglass formulation for particle in the elastic regime - */ + } // end loop over jj neighbors of i - gamma_dot_dx = gamma.dot(dx); // project hourglass error vector onto pair distance vector - LimitDoubleMagnitude(gamma_dot_dx, 0.1 * r); // limit projected vector to avoid numerical instabilities - delta = 0.5 * gamma_dot_dx / (r + 0.1 * h); // delta has dimensions of [m] - hg_mag = Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] * delta / (r0Sq + 0.01 * h * h); // hg_mag has dimensions [m^(-1)] - hg_mag *= -voli * volj * wf * Lookup[YOUNGS_MODULUS][itype]; // hg_mag has dimensions [J*m^(-1)] = [N] - f_hg = (hg_mag / (r + 0.01 * h)) * dx; - } + // avoid division by zero and overflow + if ((shepardWeight != 0.0) && (fabs(hourglass_error[i]) < 1.0e300)) { + hourglass_error[i] /= shepardWeight; + } - // scale hourglass force with damage - f_hg *= (1.0 - damage[i]) * (1.0 - damage[j]); + } // end loop over i - // sum stress, viscous, and hourglass forces - sumForces = f_stress + f_visc + f_hg; // + f_spring; - - // energy rate -- project velocity onto force vector - deltaE = 0.5 * sumForces.dot(dv); - - // apply forces to pair of particles - f[i][0] += sumForces(0); - f[i][1] += sumForces(1); - f[i][2] += sumForces(2); - desph[i] += deltaE; - - // tally atomistic stress tensor - if (evflag) { - ev_tally_xyz(i, j, nlocal, 0, 0.0, 0.0, sumForces(0), sumForces(1), sumForces(2), dx(0), dx(1), dx(2)); - } - - shepardWeight += wf * volj; - - // check if a particle has moved too much w.r.t another particle - if (r > r0) { - if (update_method == UPDATE_CONSTANT_THRESHOLD) { - if (r - r0 > update_threshold) { - updateFlag = 1; - } - } else if (update_method == UPDATE_PAIRWISE_RATIO) { - if ((r - r0) / h > update_threshold) { - updateFlag = 1; - } - } - } - - if (failureModel[itype].failure_max_pairwise_strain) { - - strain1d = (r - r0) / r0; - strain1d_max = Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype]; - softening_strain = 2.0 * strain1d_max; - - if (strain1d > strain1d_max) { - degradation_ij[i][jj] = (strain1d - strain1d_max) / softening_strain; - } else { - degradation_ij[i][jj] = 0.0; - } - - if (degradation_ij[i][jj] >= 1.0) { // delete interaction if fully damaged - partner[i][jj] = 0; - } - } - - if (failureModel[itype].failure_energy_release_rate) { - - // integration approach - energy_per_bond[i][jj] += update->dt * f_stress.dot(dv) / (voli * volj); - double Vic = (2.0 / 3.0) * h * h * h; // interaction volume for 2d plane strain - double critical_energy_per_bond = Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] / (2.0 * Vic); - - if (energy_per_bond[i][jj] > critical_energy_per_bond) { - //degradation_ij[i][jj] = 1.0; - partner[i][jj] = 0; - } - } - - if (failureModel[itype].integration_point_wise) { - - strain1d = (r - r0) / r0; - - if (strain1d > 0.0) { - - if ((damage[i] == 1.0) && (damage[j] == 1.0)) { - // check if damage_onset is already defined - if (energy_per_bond[i][jj] == 0.0) { // pair damage not defined yet - energy_per_bond[i][jj] = strain1d; - } else { // damage initiation strain already defined - strain1d_max = energy_per_bond[i][jj]; - softening_strain = 2.0 * strain1d_max; - - if (strain1d > strain1d_max) { - degradation_ij[i][jj] = (strain1d - strain1d_max) / softening_strain; - } else { - degradation_ij[i][jj] = 0.0; - } - } - } - - if (degradation_ij[i][jj] >= 1.0) { // delete interaction if fully damaged - partner[i][jj] = 0; - } - - } else { - degradation_ij[i][jj] = 0.0; - } // end failureModel[itype].integration_point_wise - - } - - } // end loop over jj neighbors of i - - // avoid division by zero and overflow - if ((shepardWeight != 0.0) && (fabs(hourglass_error[i]) < 1.0e300)) { - hourglass_error[i] /= shepardWeight; - } - - } // end loop over i - - if (vflag_fdotr) - virial_fdotr_compute(); + if (vflag_fdotr) + virial_fdotr_compute(); } /* ---------------------------------------------------------------------- @@ -696,181 +680,181 @@ void PairTlsph::ComputeForces(int eflag, int vflag) { shape matrix correction ------------------------------------------------------------------------- */ void PairTlsph::AssembleStress() { - tagint *mol = atom->molecule; - double *eff_plastic_strain = atom->eff_plastic_strain; - double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; - double **tlsph_stress = atom->smd_stress; - int *type = atom->type; - double *radius = atom->radius; - double *damage = atom->damage; - double *rmass = atom->rmass; - double *vfrac = atom->vfrac; - double *esph = atom->esph; - double pInitial, d_iso, pFinal, p_rate, plastic_strain_increment; - int i, itype; - int nlocal = atom->nlocal; - double dt = update->dt; - double M_eff, p_wave_speed, mass_specific_energy, vol_specific_energy, rho; - Matrix3d sigma_rate, eye, sigmaInitial, sigmaFinal, T, T_damaged, Jaumann_rate, sigma_rate_check; - Matrix3d d_dev, sigmaInitial_dev, sigmaFinal_dev, sigma_dev_rate, strain; - Vector3d x0i, xi, xp; + tagint *mol = atom->molecule; + double *eff_plastic_strain = atom->eff_plastic_strain; + double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; + double **tlsph_stress = atom->smd_stress; + int *type = atom->type; + double *radius = atom->radius; + double *damage = atom->damage; + double *rmass = atom->rmass; + double *vfrac = atom->vfrac; + double *esph = atom->esph; + double pInitial, d_iso, pFinal, p_rate, plastic_strain_increment; + int i, itype; + int nlocal = atom->nlocal; + double dt = update->dt; + double M_eff, p_wave_speed, mass_specific_energy, vol_specific_energy, rho; + Matrix3d sigma_rate, eye, sigmaInitial, sigmaFinal, T, T_damaged, Jaumann_rate, sigma_rate_check; + Matrix3d d_dev, sigmaInitial_dev, sigmaFinal_dev, sigma_dev_rate, strain; + Vector3d x0i, xi, xp; - eye.setIdentity(); - dtCFL = 1.0e22; - pFinal = 0.0; + eye.setIdentity(); + dtCFL = 1.0e22; + pFinal = 0.0; - for (i = 0; i < nlocal; i++) { - particle_dt[i] = 0.0; + for (i = 0; i < nlocal; i++) { + particle_dt[i] = 0.0; - itype = type[i]; - if (setflag[itype][itype] == 1) { - if (mol[i] > 0) { // only do the following if particle has not failed -- mol < 0 means particle has failed + itype = type[i]; + if (setflag[itype][itype] == 1) { + if (mol[i] > 0) { // only do the following if particle has not failed -- mol < 0 means particle has failed - /* - * initial stress state: given by the unrotateted Cauchy stress. - * Assemble Eigen 3d matrix from stored stress state - */ - sigmaInitial(0, 0) = tlsph_stress[i][0]; - sigmaInitial(0, 1) = tlsph_stress[i][1]; - sigmaInitial(0, 2) = tlsph_stress[i][2]; - sigmaInitial(1, 1) = tlsph_stress[i][3]; - sigmaInitial(1, 2) = tlsph_stress[i][4]; - sigmaInitial(2, 2) = tlsph_stress[i][5]; - sigmaInitial(1, 0) = sigmaInitial(0, 1); - sigmaInitial(2, 0) = sigmaInitial(0, 2); - sigmaInitial(2, 1) = sigmaInitial(1, 2); + /* + * initial stress state: given by the unrotateted Cauchy stress. + * Assemble Eigen 3d matrix from stored stress state + */ + sigmaInitial(0, 0) = tlsph_stress[i][0]; + sigmaInitial(0, 1) = tlsph_stress[i][1]; + sigmaInitial(0, 2) = tlsph_stress[i][2]; + sigmaInitial(1, 1) = tlsph_stress[i][3]; + sigmaInitial(1, 2) = tlsph_stress[i][4]; + sigmaInitial(2, 2) = tlsph_stress[i][5]; + sigmaInitial(1, 0) = sigmaInitial(0, 1); + sigmaInitial(2, 0) = sigmaInitial(0, 2); + sigmaInitial(2, 1) = sigmaInitial(1, 2); - //cout << "this is sigma initial" << endl << sigmaInitial << endl; + //cout << "this is sigma initial" << endl << sigmaInitial << endl; - pInitial = sigmaInitial.trace() / 3.0; // isotropic part of initial stress - sigmaInitial_dev = Deviator(sigmaInitial); - d_iso = D[i].trace(); // volumetric part of stretch rate - d_dev = Deviator(D[i]); // deviatoric part of stretch rate - strain = 0.5 * (Fincr[i].transpose() * Fincr[i] - eye); - mass_specific_energy = esph[i] / rmass[i]; // energy per unit mass - rho = rmass[i] / (detF[i] * vfrac[i]); - vol_specific_energy = mass_specific_energy * rho; // energy per current volume + pInitial = sigmaInitial.trace() / 3.0; // isotropic part of initial stress + sigmaInitial_dev = Deviator(sigmaInitial); + d_iso = D[i].trace(); // volumetric part of stretch rate + d_dev = Deviator(D[i]); // deviatoric part of stretch rate + strain = 0.5 * (Fincr[i].transpose() * Fincr[i] - eye); + mass_specific_energy = esph[i] / rmass[i]; // energy per unit mass + rho = rmass[i] / (detF[i] * vfrac[i]); + vol_specific_energy = mass_specific_energy * rho; // energy per current volume - /* - * pressure: compute pressure rate p_rate and final pressure pFinal - */ + /* + * pressure: compute pressure rate p_rate and final pressure pFinal + */ - ComputePressure(i, rho, mass_specific_energy, vol_specific_energy, pInitial, d_iso, pFinal, p_rate); + ComputePressure(i, rho, mass_specific_energy, vol_specific_energy, pInitial, d_iso, pFinal, p_rate); - /* - * material strength - */ + /* + * material strength + */ - //cout << "this is the strain deviator rate" << endl << d_dev << endl; - ComputeStressDeviator(i, sigmaInitial_dev, d_dev, sigmaFinal_dev, sigma_dev_rate, plastic_strain_increment); - //cout << "this is the stress deviator rate" << endl << sigma_dev_rate << endl; + //cout << "this is the strain deviator rate" << endl << d_dev << endl; + ComputeStressDeviator(i, sigmaInitial_dev, d_dev, sigmaFinal_dev, sigma_dev_rate, plastic_strain_increment); + //cout << "this is the stress deviator rate" << endl << sigma_dev_rate << endl; - // keep a rolling average of the plastic strain rate over the last 100 or so timesteps - eff_plastic_strain[i] += plastic_strain_increment; + // keep a rolling average of the plastic strain rate over the last 100 or so timesteps + eff_plastic_strain[i] += plastic_strain_increment; - // compute a characteristic time over which to average the plastic strain - double tav = 1000 * radius[i] / (Lookup[SIGNAL_VELOCITY][itype]); - eff_plastic_strain_rate[i] -= eff_plastic_strain_rate[i] * dt / tav; - eff_plastic_strain_rate[i] += plastic_strain_increment / tav; - eff_plastic_strain_rate[i] = MAX(0.0, eff_plastic_strain_rate[i]); + // compute a characteristic time over which to average the plastic strain + double tav = 1000 * radius[i] / (Lookup[SIGNAL_VELOCITY][itype]); + eff_plastic_strain_rate[i] -= eff_plastic_strain_rate[i] * dt / tav; + eff_plastic_strain_rate[i] += plastic_strain_increment / tav; + eff_plastic_strain_rate[i] = MAX(0.0, eff_plastic_strain_rate[i]); - /* - * assemble total stress from pressure and deviatoric stress - */ - sigmaFinal = pFinal * eye + sigmaFinal_dev; // this is the stress that is kept + /* + * assemble total stress from pressure and deviatoric stress + */ + sigmaFinal = pFinal * eye + sigmaFinal_dev; // this is the stress that is kept - if (JAUMANN) { - /* - * sigma is already the co-rotated Cauchy stress. - * The stress rate, however, needs to be made objective. - */ + if (JAUMANN) { + /* + * sigma is already the co-rotated Cauchy stress. + * The stress rate, however, needs to be made objective. + */ - if (dt > 1.0e-16) { - sigma_rate = (1.0 / dt) * (sigmaFinal - sigmaInitial); - } else { - sigma_rate.setZero(); - } + if (dt > 1.0e-16) { + sigma_rate = (1.0 / dt) * (sigmaFinal - sigmaInitial); + } else { + sigma_rate.setZero(); + } - Jaumann_rate = sigma_rate + W[i] * sigmaInitial + sigmaInitial * W[i].transpose(); - sigmaFinal = sigmaInitial + dt * Jaumann_rate; - T = sigmaFinal; - } else { - /* - * sigma is the unrotated stress. - * need to do forward rotation of the unrotated stress sigma to the current configuration - */ - T = R[i] * sigmaFinal * R[i].transpose(); - } + Jaumann_rate = sigma_rate + W[i] * sigmaInitial + sigmaInitial * W[i].transpose(); + sigmaFinal = sigmaInitial + dt * Jaumann_rate; + T = sigmaFinal; + } else { + /* + * sigma is the unrotated stress. + * need to do forward rotation of the unrotated stress sigma to the current configuration + */ + T = R[i] * sigmaFinal * R[i].transpose(); + } - /* - * store unrotated stress in atom vector - * symmetry is exploited - */ - tlsph_stress[i][0] = sigmaFinal(0, 0); - tlsph_stress[i][1] = sigmaFinal(0, 1); - tlsph_stress[i][2] = sigmaFinal(0, 2); - tlsph_stress[i][3] = sigmaFinal(1, 1); - tlsph_stress[i][4] = sigmaFinal(1, 2); - tlsph_stress[i][5] = sigmaFinal(2, 2); + /* + * store unrotated stress in atom vector + * symmetry is exploited + */ + tlsph_stress[i][0] = sigmaFinal(0, 0); + tlsph_stress[i][1] = sigmaFinal(0, 1); + tlsph_stress[i][2] = sigmaFinal(0, 2); + tlsph_stress[i][3] = sigmaFinal(1, 1); + tlsph_stress[i][4] = sigmaFinal(1, 2); + tlsph_stress[i][5] = sigmaFinal(2, 2); - /* - * Damage due to failure criteria. - */ + /* + * Damage due to failure criteria. + */ - if (failureModel[itype].integration_point_wise) { - ComputeDamage(i, strain, T, T_damaged); - //T = T_damaged; Do not do this, it is undefined as of now - } + if (failureModel[itype].integration_point_wise) { + ComputeDamage(i, strain, T, T_damaged); + //T = T_damaged; Do not do this, it is undefined as of now + } - // store rotated, "true" Cauchy stress - CauchyStress[i] = T; + // store rotated, "true" Cauchy stress + CauchyStress[i] = T; - /* - * We have the corotational Cauchy stress. - * Convert to PK1. Note that reference configuration used for computing the forces is linked via - * the incremental deformation gradient, not the full deformation gradient. - */ - PK1[i] = detF[i] * T * FincrInv[i].transpose(); + /* + * We have the corotational Cauchy stress. + * Convert to PK1. Note that reference configuration used for computing the forces is linked via + * the incremental deformation gradient, not the full deformation gradient. + */ + PK1[i] = detF[i] * T * FincrInv[i].transpose(); - /* - * pre-multiply stress tensor with shape matrix to save computation in force loop - */ - PK1[i] = PK1[i] * K[i]; + /* + * pre-multiply stress tensor with shape matrix to save computation in force loop + */ + PK1[i] = PK1[i] * K[i]; - /* - * compute stable time step according to Pronto 2d - */ + /* + * compute stable time step according to Pronto 2d + */ - Matrix3d deltaSigma; - deltaSigma = sigmaFinal - sigmaInitial; - p_rate = deltaSigma.trace() / (3.0 * dt + 1.0e-16); - sigma_dev_rate = Deviator(deltaSigma) / (dt + 1.0e-16); + Matrix3d deltaSigma; + deltaSigma = sigmaFinal - sigmaInitial; + p_rate = deltaSigma.trace() / (3.0 * dt + 1.0e-16); + sigma_dev_rate = Deviator(deltaSigma) / (dt + 1.0e-16); - double K_eff, mu_eff; - effective_longitudinal_modulus(itype, dt, d_iso, p_rate, d_dev, sigma_dev_rate, damage[i], K_eff, mu_eff, M_eff); - p_wave_speed = sqrt(M_eff / rho); + double K_eff, mu_eff; + effective_longitudinal_modulus(itype, dt, d_iso, p_rate, d_dev, sigma_dev_rate, damage[i], K_eff, mu_eff, M_eff); + p_wave_speed = sqrt(M_eff / rho); - if (mol[i] < 0) { - error->one(FLERR, "this should not happen"); - } + if (mol[i] < 0) { + error->one(FLERR, "this should not happen"); + } - particle_dt[i] = 2.0 * radius[i] / p_wave_speed; - dtCFL = MIN(dtCFL, particle_dt[i]); + particle_dt[i] = 2.0 * radius[i] / p_wave_speed; + dtCFL = MIN(dtCFL, particle_dt[i]); - } else { // end if mol > 0 - PK1[i].setZero(); - K[i].setIdentity(); - CauchyStress[i].setZero(); - sigma_rate.setZero(); - tlsph_stress[i][0] = 0.0; - tlsph_stress[i][1] = 0.0; - tlsph_stress[i][2] = 0.0; - tlsph_stress[i][3] = 0.0; - tlsph_stress[i][4] = 0.0; - tlsph_stress[i][5] = 0.0; - } // end if mol > 0 - } // end setflag - } // end for + } else { // end if mol > 0 + PK1[i].setZero(); + K[i].setIdentity(); + CauchyStress[i].setZero(); + sigma_rate.setZero(); + tlsph_stress[i][0] = 0.0; + tlsph_stress[i][1] = 0.0; + tlsph_stress[i][2] = 0.0; + tlsph_stress[i][3] = 0.0; + tlsph_stress[i][4] = 0.0; + tlsph_stress[i][5] = 0.0; + } // end if mol > 0 + } // end setflag + } // end for } /* ---------------------------------------------------------------------- @@ -878,25 +862,25 @@ void PairTlsph::AssembleStress() { ------------------------------------------------------------------------- */ void PairTlsph::allocate() { - allocated = 1; - int n = atom->ntypes; + allocated = 1; + int n = atom->ntypes; - memory->create(setflag, n + 1, n + 1, "pair:setflag"); - for (int i = 1; i <= n; i++) - for (int j = i; j <= n; j++) - setflag[i][j] = 0; + memory->create(setflag, n + 1, n + 1, "pair:setflag"); + for (int i = 1; i <= n; i++) + for (int j = i; j <= n; j++) + setflag[i][j] = 0; - memory->create(strengthModel, n + 1, "pair:strengthmodel"); - memory->create(eos, n + 1, "pair:eosmodel"); - failureModel = new failure_types[n + 1]; - memory->create(Lookup, MAX_KEY_VALUE, n + 1, "pair:LookupTable"); + memory->create(strengthModel, n + 1, "pair:strengthmodel"); + memory->create(eos, n + 1, "pair:eosmodel"); + failureModel = new failure_types[n + 1]; + memory->create(Lookup, MAX_KEY_VALUE, n + 1, "pair:LookupTable"); - memory->create(cutsq, n + 1, n + 1, "pair:cutsq"); // always needs to be allocated, even with granular neighborlist + memory->create(cutsq, n + 1, n + 1, "pair:cutsq"); // always needs to be allocated, even with granular neighborlist - onerad_dynamic = new double[n + 1]; - onerad_frozen = new double[n + 1]; - maxrad_dynamic = new double[n + 1]; - maxrad_frozen = new double[n + 1]; + onerad_dynamic = new double[n + 1]; + onerad_frozen = new double[n + 1]; + maxrad_dynamic = new double[n + 1]; + maxrad_frozen = new double[n + 1]; } @@ -906,83 +890,73 @@ void PairTlsph::allocate() { void PairTlsph::settings(int narg, char **arg) { - if (comm->me == 0) { - printf( - "\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n"); - printf("TLSPH settings\n"); - } + if (comm->me == 0) + utils::logmesg(lmp,"\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n" + "TLSPH settings\n"); - /* - * default value for update_threshold for updates of reference configuration: - * The maximum relative displacement which is tracked by the construction of LAMMPS' neighborlists - * is the following. - */ + /* + * default value for update_threshold for updates of reference configuration: + * The maximum relative displacement which is tracked by the construction of LAMMPS' neighborlists + * is the following. + */ - cut_comm = MAX(neighbor->cutneighmax, comm->cutghostuser); // cutoff radius within which ghost atoms are communicated. - update_threshold = cut_comm; - update_method = UPDATE_NONE; + cut_comm = MAX(neighbor->cutneighmax, comm->cutghostuser); // cutoff radius within which ghost atoms are communicated. + update_threshold = cut_comm; + update_method = UPDATE_NONE; - int iarg = 0; + int iarg = 0; - while (true) { + while (true) { - if (iarg >= narg) { - break; - } + if (iarg >= narg) { + break; + } - if (strcmp(arg[iarg], "*UPDATE_CONSTANT") == 0) { - iarg++; - if (iarg == narg) { - error->all(FLERR, "expected number following *UPDATE_CONSTANT keyword"); - } + if (strcmp(arg[iarg], "*UPDATE_CONSTANT") == 0) { + iarg++; + if (iarg == narg) { + error->all(FLERR, "expected number following *UPDATE_CONSTANT keyword"); + } - update_method = UPDATE_CONSTANT_THRESHOLD; - update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); + update_method = UPDATE_CONSTANT_THRESHOLD; + update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); - } else if (strcmp(arg[iarg], "*UPDATE_PAIRWISE") == 0) { - iarg++; - if (iarg == narg) { - error->all(FLERR, "expected number following *UPDATE_PAIRWISE keyword"); - } + } else if (strcmp(arg[iarg], "*UPDATE_PAIRWISE") == 0) { + iarg++; + if (iarg == narg) { + error->all(FLERR, "expected number following *UPDATE_PAIRWISE keyword"); + } - update_method = UPDATE_PAIRWISE_RATIO; - update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); + update_method = UPDATE_PAIRWISE_RATIO; + update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); - } else { - char msg[128]; - sprintf(msg, "Illegal keyword for smd/integrate_tlsph: %s\n", arg[iarg]); - error->all(FLERR, msg); - } + } else { + error->all(FLERR, "Illegal keyword for smd/integrate_tlsph: {}\n", arg[iarg]); + } + iarg++; + } - iarg++; - } - - if ((update_threshold > cut_comm) && (update_method == UPDATE_CONSTANT_THRESHOLD)) { - if (comm->me == 0) { - printf("\n ***** WARNING ***\n"); - printf("requested reference configuration update threshold is %g length units\n", update_threshold); - printf("This value exceeds the maximum value %g beyond which TLSPH displacements can be tracked at current settings.\n", - cut_comm); - printf("Expect loss of neighbors!\n"); - } - } - - if (comm->me == 0) { - - if (update_method == UPDATE_CONSTANT_THRESHOLD) { - printf("... will update reference configuration if magnitude of relative displacement exceeds %g length units\n", - update_threshold); - } else if (update_method == UPDATE_PAIRWISE_RATIO) { - printf("... will update reference configuration if ratio pairwise distance / smoothing length exceeds %g\n", - update_threshold); - } else if (update_method == UPDATE_NONE) { - printf("... will never update reference configuration\n"); - } - printf( - ">>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n"); - - } + if ((update_threshold > cut_comm) && (update_method == UPDATE_CONSTANT_THRESHOLD)) { + if (comm->me == 0) { + utils::logmesg(lmp, "\n ***** WARNING ***\n"); + utils::logmesg(lmp, "requested reference configuration update threshold is {} length units\n", update_threshold); + utils::logmesg(lmp, "This value exceeds the maximum value {} beyond which TLSPH displacements can be tracked at current settings.\n",cut_comm); + utils::logmesg(lmp, "Expect loss of neighbors!\n"); + } + } + if (comm->me == 0) { + if (update_method == UPDATE_CONSTANT_THRESHOLD) { + utils::logmesg(lmp, "... will update reference configuration if magnitude of relative displacement exceeds {} length units\n", + update_threshold); + } else if (update_method == UPDATE_PAIRWISE_RATIO) { + utils::logmesg(lmp, "... will update reference configuration if ratio pairwise distance / smoothing length exceeds {}\n", + update_threshold); + } else if (update_method == UPDATE_NONE) { + utils::logmesg(lmp, "... will never update reference configuration\n"); + } + utils::logmesg(lmp,">>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n"); + } } /* ---------------------------------------------------------------------- @@ -990,702 +964,585 @@ void PairTlsph::settings(int narg, char **arg) { ------------------------------------------------------------------------- */ void PairTlsph::coeff(int narg, char **arg) { - int ioffset, iarg, iNextKwd, itype; - char str[128]; - std::string s, t; + int ioffset, iarg, iNextKwd, itype; + std::string s, t; - if (narg < 3) { - sprintf(str, "number of arguments for pair tlsph is too small!"); - error->all(FLERR, str); - } - if (!allocated) - allocate(); + if (narg < 3) + error->all(FLERR, "number of arguments for pair tlsph is too small!"); - /* - * check that TLSPH parameters are given only in i,i form - */ - if (utils::inumeric(FLERR, arg[0], false, lmp) != utils::inumeric(FLERR, arg[1], false, lmp)) { - sprintf(str, "TLSPH coefficients can only be specified between particles of same type!"); - error->all(FLERR, str); - } - itype = utils::inumeric(FLERR, arg[0],false,lmp); + if (!allocated) + allocate(); + + /* + * check that TLSPH parameters are given only in i,i form + */ + if (utils::inumeric(FLERR, arg[0], false, lmp) != utils::inumeric(FLERR, arg[1], false, lmp)) + error->all(FLERR, "TLSPH coefficients can only be specified between particles of same type!"); + + itype = utils::inumeric(FLERR, arg[0],false,lmp); // set all eos, strength and failure models to inactive by default - eos[itype] = EOS_NONE; - strengthModel[itype] = STRENGTH_NONE; + eos[itype] = EOS_NONE; + strengthModel[itype] = STRENGTH_NONE; - if (comm->me == 0) { - printf( - "\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n"); - printf("SMD / TLSPH PROPERTIES OF PARTICLE TYPE %d:\n", itype); + if (comm->me == 0) + utils::logmesg(lmp,"\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n" + "SMD / TLSPH PROPERTIES OF PARTICLE TYPE {}:\n", itype); + + /* + * read parameters which are common -- regardless of material / eos model + */ + + ioffset = 2; + if (strcmp(arg[ioffset], "*COMMON") != 0) + error->all(FLERR, "common keyword missing!"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) error->all(FLERR, "no *KEYWORD terminates *COMMON"); + if (iNextKwd - ioffset != 7 + 1) + error->all(FLERR, "expected 7 arguments following *COMMON but got {}\n", iNextKwd - ioffset - 1); + + Lookup[REFERENCE_DENSITY][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[YOUNGS_MODULUS][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[POISSON_RATIO][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[VISCOSITY_Q1][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[VISCOSITY_Q2][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[HEAT_CAPACITY][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); + + Lookup[LAME_LAMBDA][itype] = Lookup[YOUNGS_MODULUS][itype] * Lookup[POISSON_RATIO][itype] + / ((1.0 + Lookup[POISSON_RATIO][itype]) * (1.0 - 2.0 * Lookup[POISSON_RATIO][itype])); + Lookup[SHEAR_MODULUS][itype] = Lookup[YOUNGS_MODULUS][itype] / (2.0 * (1.0 + Lookup[POISSON_RATIO][itype])); + Lookup[M_MODULUS][itype] = Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype]; + Lookup[SIGNAL_VELOCITY][itype] = sqrt( + (Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype]) / Lookup[REFERENCE_DENSITY][itype]); + Lookup[BULK_MODULUS][itype] = Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype] / 3.0; + + if (comm->me == 0) { + utils::logmesg(lmp, "\nmaterial unspecific properties for SMD/TLSPH definition of particle type {}:\n", itype); + utils::logmesg(lmp, "{:60} : {}\n", "reference density", Lookup[REFERENCE_DENSITY][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Young's modulus", Lookup[YOUNGS_MODULUS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Poisson ratio", Lookup[POISSON_RATIO][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "linear viscosity coefficient", Lookup[VISCOSITY_Q1][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "quadratic viscosity coefficient", Lookup[VISCOSITY_Q2][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "hourglass control coefficient", Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "heat capacity [energy / (mass * temperature)]", Lookup[HEAT_CAPACITY][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Lame constant lambda", Lookup[LAME_LAMBDA][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "shear modulus", Lookup[SHEAR_MODULUS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "bulk modulus", Lookup[BULK_MODULUS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "signal velocity", Lookup[SIGNAL_VELOCITY][itype]); + } + + /* + * read following material cards + */ + + eos[itype] = EOS_NONE; + strengthModel[itype] = STRENGTH_NONE; + + while (true) { + if (strcmp(arg[iNextKwd], "*END") == 0) { + if (comm->me == 0) + utils::logmesg(lmp,"found *END keyword" + "\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n\n"); + break; + } + + /* + * Linear Elasticity model based on deformation gradient + */ + ioffset = iNextKwd; + if (strcmp(arg[ioffset], "*LINEAR_DEFGRAD") == 0) { + strengthModel[itype] = LINEAR_DEFGRAD; + + if (comm->me == 0) utils::logmesg(lmp, "reading *LINEAR_DEFGRAD\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } - /* - * read parameters which are common -- regardless of material / eos model - */ + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *LINEAR_DEFGRAD"); - ioffset = 2; - if (strcmp(arg[ioffset], "*COMMON") != 0) { - sprintf(str, "common keyword missing!"); - error->all(FLERR, str); + if (iNextKwd - ioffset != 1) + error->all(FLERR, "expected 0 arguments following *LINEAR_DEFGRAD but got {}\n", iNextKwd - ioffset - 1); + + if (comm->me == 0) utils::logmesg(lmp, "\nLinear Elasticity model based on deformation gradient\n"); + + } else if (strcmp(arg[ioffset], "*STRENGTH_LINEAR") == 0) { + + /* + * Linear Elasticity strength only model based on strain rate + */ + + strengthModel[itype] = STRENGTH_LINEAR; + if (comm->me == 0) utils::logmesg(lmp,"reading *STRENGTH_LINEAR\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *STRENGTH_LINEAR"); + + if (iNextKwd - ioffset != 1) + error->all(FLERR, "expected 0 arguments following *STRENGTH_LINEAR but got {}\n", iNextKwd - ioffset - 1); + + if (comm->me == 0) utils::logmesg(lmp, "Linear Elasticity strength based on strain rate\n"); + + } // end Linear Elasticity strength only model based on strain rate + + else if (strcmp(arg[ioffset], "*STRENGTH_LINEAR_PLASTIC") == 0) { + + /* + * Linear Elastic / perfectly plastic strength only model based on strain rate + */ + + strengthModel[itype] = STRENGTH_LINEAR_PLASTIC; + if (comm->me == 0) utils::logmesg(lmp,"reading *STRENGTH_LINEAR_PLASTIC\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } -//printf("keyword following *COMMON is %s\n", arg[iNextKwd]); + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *STRENGTH_LINEAR_PLASTIC"); - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *COMMON"); - error->all(FLERR, str); + if (iNextKwd - ioffset != 2 + 1) + error->all(FLERR, "expected 2 arguments following *STRENGTH_LINEAR_PLASTIC but got {}\n", iNextKwd - ioffset - 1); + + Lookup[YIELD_STRESS][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[HARDENING_PARAMETER][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "Linear elastic / perfectly plastic strength based on strain rate"); + utils::logmesg(lmp, "{:60} : {}\n", "Young's modulus", Lookup[YOUNGS_MODULUS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Poisson ratio", Lookup[POISSON_RATIO][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "shear modulus", Lookup[SHEAR_MODULUS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "constant yield stress", Lookup[YIELD_STRESS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "constant hardening parameter", Lookup[HARDENING_PARAMETER][itype]); + } + } // end Linear Elastic / perfectly plastic strength only model based on strain rate + + else if (strcmp(arg[ioffset], "*JOHNSON_COOK") == 0) { + + /* + * JOHNSON - COOK + */ + + strengthModel[itype] = STRENGTH_JOHNSON_COOK; + if (comm->me == 0) utils::logmesg(lmp, "reading *JOHNSON_COOK\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } - if (iNextKwd - ioffset != 7 + 1) { - sprintf(str, "expected 7 arguments following *COMMON but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *JOHNSON_COOK"); + + if (iNextKwd - ioffset != 8 + 1) + error->all(FLERR, "expected 8 arguments following *JOHNSON_COOK but got {}\n", iNextKwd - ioffset - 1); + + Lookup[JC_A][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[JC_B][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[JC_a][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[JC_C][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[JC_epdot0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[JC_T0][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[JC_Tmelt][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); + Lookup[JC_M][itype] = utils::numeric(FLERR, arg[ioffset + 8],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "Johnson Cook material strength model\n"); + utils::logmesg(lmp, "{:60} : {}\n", "A: initial yield stress", Lookup[JC_A][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "B : proportionality factor for plastic strain dependency", Lookup[JC_B][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "a : exponent for plastic strain dependency", Lookup[JC_a][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "C : proportionality factor for logarithmic plastic strain rate dependency",Lookup[JC_C][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "epdot0 : dimensionality factor for plastic strain rate dependency", Lookup[JC_epdot0][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "T0 : reference (room) temperature", Lookup[JC_T0][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Tmelt : melting temperature", Lookup[JC_Tmelt][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "M : exponent for temperature dependency", Lookup[JC_M][itype]); + } + + } else if (strcmp(arg[ioffset], "*EOS_NONE") == 0) { + + /* + * no eos + */ + + eos[itype] = EOS_NONE; + if (comm->me == 0) utils::logmesg(lmp, "reading *EOS_NONE\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } - Lookup[REFERENCE_DENSITY][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[YOUNGS_MODULUS][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - Lookup[POISSON_RATIO][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); - Lookup[VISCOSITY_Q1][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); - Lookup[VISCOSITY_Q2][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); - Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); - Lookup[HEAT_CAPACITY][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *EOS_NONE"); - Lookup[LAME_LAMBDA][itype] = Lookup[YOUNGS_MODULUS][itype] * Lookup[POISSON_RATIO][itype] - / ((1.0 + Lookup[POISSON_RATIO][itype]) * (1.0 - 2.0 * Lookup[POISSON_RATIO][itype])); - Lookup[SHEAR_MODULUS][itype] = Lookup[YOUNGS_MODULUS][itype] / (2.0 * (1.0 + Lookup[POISSON_RATIO][itype])); - Lookup[M_MODULUS][itype] = Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype]; - Lookup[SIGNAL_VELOCITY][itype] = sqrt( - (Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype]) / Lookup[REFERENCE_DENSITY][itype]); - Lookup[BULK_MODULUS][itype] = Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype] / 3.0; + if (iNextKwd - ioffset != 1) + error->all(FLERR, "expected 0 arguments following *EOS_NONE but got {}\n", iNextKwd - ioffset - 1); - if (comm->me == 0) { - printf("\n material unspecific properties for SMD/TLSPH definition of particle type %d:\n", itype); - printf("%60s : %g\n", "reference density", Lookup[REFERENCE_DENSITY][itype]); - printf("%60s : %g\n", "Young's modulus", Lookup[YOUNGS_MODULUS][itype]); - printf("%60s : %g\n", "Poisson ratio", Lookup[POISSON_RATIO][itype]); - printf("%60s : %g\n", "linear viscosity coefficient", Lookup[VISCOSITY_Q1][itype]); - printf("%60s : %g\n", "quadratic viscosity coefficient", Lookup[VISCOSITY_Q2][itype]); - printf("%60s : %g\n", "hourglass control coefficient", Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype]); - printf("%60s : %g\n", "heat capacity [energy / (mass * temperature)]", Lookup[HEAT_CAPACITY][itype]); - printf("%60s : %g\n", "Lame constant lambda", Lookup[LAME_LAMBDA][itype]); - printf("%60s : %g\n", "shear modulus", Lookup[SHEAR_MODULUS][itype]); - printf("%60s : %g\n", "bulk modulus", Lookup[BULK_MODULUS][itype]); - printf("%60s : %g\n", "signal velocity", Lookup[SIGNAL_VELOCITY][itype]); + if (comm->me == 0) utils::logmesg(lmp, "\nno EOS selected\n"); + } else if (strcmp(arg[ioffset], "*EOS_LINEAR") == 0) { + + /* + * linear eos + */ + + eos[itype] = EOS_LINEAR; + if (comm->me == 0) utils::logmesg(lmp, "reading *EOS_LINEAR\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } - - /* - * read following material cards - */ - -//printf("next kwd is %s\n", arg[iNextKwd]); - eos[itype] = EOS_NONE; - strengthModel[itype] = STRENGTH_NONE; - - while (true) { - if (strcmp(arg[iNextKwd], "*END") == 0) { - if (comm->me == 0) { - printf("found *END keyword"); - printf( - "\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n\n"); - } - break; - } - - /* - * Linear Elasticity model based on deformation gradient - */ - ioffset = iNextKwd; - if (strcmp(arg[ioffset], "*LINEAR_DEFGRAD") == 0) { - strengthModel[itype] = LINEAR_DEFGRAD; - - if (comm->me == 0) { - printf("reading *LINEAR_DEFGRAD\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *LINEAR_DEFGRAD"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1) { - sprintf(str, "expected 0 arguments following *LINEAR_DEFGRAD but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - if (comm->me == 0) { - printf("\n%60s\n", "Linear Elasticity model based on deformation gradient"); - } - } else if (strcmp(arg[ioffset], "*STRENGTH_LINEAR") == 0) { - - /* - * Linear Elasticity strength only model based on strain rate - */ - - strengthModel[itype] = STRENGTH_LINEAR; - if (comm->me == 0) { - printf("reading *STRENGTH_LINEAR\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *STRENGTH_LINEAR"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1) { - sprintf(str, "expected 0 arguments following *STRENGTH_LINEAR but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - if (comm->me == 0) { - printf("%60s\n", "Linear Elasticity strength based on strain rate"); - } - } // end Linear Elasticity strength only model based on strain rate - - else if (strcmp(arg[ioffset], "*STRENGTH_LINEAR_PLASTIC") == 0) { - - /* - * Linear Elastic / perfectly plastic strength only model based on strain rate - */ - - strengthModel[itype] = STRENGTH_LINEAR_PLASTIC; - if (comm->me == 0) { - printf("reading *STRENGTH_LINEAR_PLASTIC\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *STRENGTH_LINEAR_PLASTIC"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 2 + 1) { - sprintf(str, "expected 2 arguments following *STRENGTH_LINEAR_PLASTIC but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - Lookup[YIELD_STRESS][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[HARDENING_PARAMETER][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - - if (comm->me == 0) { - printf("%60s\n", "Linear elastic / perfectly plastic strength based on strain rate"); - printf("%60s : %g\n", "Young's modulus", Lookup[YOUNGS_MODULUS][itype]); - printf("%60s : %g\n", "Poisson ratio", Lookup[POISSON_RATIO][itype]); - printf("%60s : %g\n", "shear modulus", Lookup[SHEAR_MODULUS][itype]); - printf("%60s : %g\n", "constant yield stress", Lookup[YIELD_STRESS][itype]); - printf("%60s : %g\n", "constant hardening parameter", Lookup[HARDENING_PARAMETER][itype]); - } - } // end Linear Elastic / perfectly plastic strength only model based on strain rate - - else if (strcmp(arg[ioffset], "*JOHNSON_COOK") == 0) { - - /* - * JOHNSON - COOK - */ - - strengthModel[itype] = STRENGTH_JOHNSON_COOK; - if (comm->me == 0) { - printf("reading *JOHNSON_COOK\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *JOHNSON_COOK"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 8 + 1) { - sprintf(str, "expected 8 arguments following *JOHNSON_COOK but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - Lookup[JC_A][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[JC_B][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - Lookup[JC_a][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); - Lookup[JC_C][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); - Lookup[JC_epdot0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); - Lookup[JC_T0][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); - Lookup[JC_Tmelt][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); - Lookup[JC_M][itype] = utils::numeric(FLERR, arg[ioffset + 8],false,lmp); - - if (comm->me == 0) { - printf("%60s\n", "Johnson Cook material strength model"); - printf("%60s : %g\n", "A: initial yield stress", Lookup[JC_A][itype]); - printf("%60s : %g\n", "B : proportionality factor for plastic strain dependency", Lookup[JC_B][itype]); - printf("%60s : %g\n", "a : exponent for plastic strain dependency", Lookup[JC_a][itype]); - printf("%60s : %g\n", "C : proportionality factor for logarithmic plastic strain rate dependency", - Lookup[JC_C][itype]); - printf("%60s : %g\n", "epdot0 : dimensionality factor for plastic strain rate dependency", - Lookup[JC_epdot0][itype]); - printf("%60s : %g\n", "T0 : reference (room) temperature", Lookup[JC_T0][itype]); - printf("%60s : %g\n", "Tmelt : melting temperature", Lookup[JC_Tmelt][itype]); - printf("%60s : %g\n", "M : exponent for temperature dependency", Lookup[JC_M][itype]); - } - - } else if (strcmp(arg[ioffset], "*EOS_NONE") == 0) { - - /* - * no eos - */ - - eos[itype] = EOS_NONE; - if (comm->me == 0) { - printf("reading *EOS_NONE\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *EOS_NONE"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1) { - sprintf(str, "expected 0 arguments following *EOS_NONE but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - if (comm->me == 0) { - printf("\n%60s\n", "no EOS selected"); - } - - } else if (strcmp(arg[ioffset], "*EOS_LINEAR") == 0) { - - /* - * linear eos - */ - - eos[itype] = EOS_LINEAR; - if (comm->me == 0) { - printf("reading *EOS_LINEAR\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *EOS_LINEAR"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1) { - sprintf(str, "expected 0 arguments following *EOS_LINEAR but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - if (comm->me == 0) { - printf("\n%60s\n", "linear EOS based on strain rate"); - printf("%60s : %g\n", "bulk modulus", Lookup[BULK_MODULUS][itype]); - } - } // end linear eos - else if (strcmp(arg[ioffset], "*EOS_SHOCK") == 0) { - - /* - * shock eos - */ - - eos[itype] = EOS_SHOCK; - if (comm->me == 0) { - printf("reading *EOS_SHOCK\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *EOS_SHOCK"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 3 + 1) { - sprintf(str, "expected 3 arguments (c0, S, Gamma) following *EOS_SHOCK but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - Lookup[EOS_SHOCK_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[EOS_SHOCK_S][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - Lookup[EOS_SHOCK_GAMMA][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); - if (comm->me == 0) { - printf("\n%60s\n", "shock EOS based on strain rate"); - printf("%60s : %g\n", "reference speed of sound", Lookup[EOS_SHOCK_C0][itype]); - printf("%60s : %g\n", "Hugoniot parameter S", Lookup[EOS_SHOCK_S][itype]); - printf("%60s : %g\n", "Grueneisen Gamma", Lookup[EOS_SHOCK_GAMMA][itype]); - } - } // end shock eos - - else if (strcmp(arg[ioffset], "*EOS_POLYNOMIAL") == 0) { - /* - * polynomial eos - */ - - eos[itype] = EOS_POLYNOMIAL; - if (comm->me == 0) { - printf("reading *EOS_POLYNOMIAL\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *EOS_POLYNOMIAL"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 7 + 1) { - sprintf(str, "expected 7 arguments following *EOS_POLYNOMIAL but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - Lookup[EOS_POLYNOMIAL_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[EOS_POLYNOMIAL_C1][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - Lookup[EOS_POLYNOMIAL_C2][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); - Lookup[EOS_POLYNOMIAL_C3][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); - Lookup[EOS_POLYNOMIAL_C4][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); - Lookup[EOS_POLYNOMIAL_C5][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); - Lookup[EOS_POLYNOMIAL_C6][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); - if (comm->me == 0) { - printf("\n%60s\n", "polynomial EOS based on strain rate"); - printf("%60s : %g\n", "parameter c0", Lookup[EOS_POLYNOMIAL_C0][itype]); - printf("%60s : %g\n", "parameter c1", Lookup[EOS_POLYNOMIAL_C1][itype]); - printf("%60s : %g\n", "parameter c2", Lookup[EOS_POLYNOMIAL_C2][itype]); - printf("%60s : %g\n", "parameter c3", Lookup[EOS_POLYNOMIAL_C3][itype]); - printf("%60s : %g\n", "parameter c4", Lookup[EOS_POLYNOMIAL_C4][itype]); - printf("%60s : %g\n", "parameter c5", Lookup[EOS_POLYNOMIAL_C5][itype]); - printf("%60s : %g\n", "parameter c6", Lookup[EOS_POLYNOMIAL_C6][itype]); - } - } // end polynomial eos - - else if (strcmp(arg[ioffset], "*FAILURE_MAX_PLASTIC_STRAIN") == 0) { - - /* - * maximum plastic strain failure criterion - */ - - if (comm->me == 0) { - printf("reading *FAILURE_MAX_PLASTIC_SRTRAIN\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_MAX_PLASTIC_STRAIN"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1 + 1) { - sprintf(str, "expected 1 arguments following *FAILURE_MAX_PLASTIC_STRAIN but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_max_plastic_strain = true; - failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "maximum plastic strain failure criterion"); - printf("%60s : %g\n", "failure occurs when plastic strain reaches limit", - Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]); - } - } // end maximum plastic strain failure criterion - else if (strcmp(arg[ioffset], "*FAILURE_MAX_PAIRWISE_STRAIN") == 0) { - - /* - * failure criterion based on maximum strain between a pair of TLSPH particles. - */ - - if (comm->me == 0) { - printf("reading *FAILURE_MAX_PAIRWISE_STRAIN\n"); - } - - if (update_method != UPDATE_NONE) { - error->all(FLERR, "cannot use *FAILURE_MAX_PAIRWISE_STRAIN with updated Total-Lagrangian formalism"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_MAX_PAIRWISE_STRAIN"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1 + 1) { - sprintf(str, "expected 1 arguments following *FAILURE_MAX_PAIRWISE_STRAIN but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_max_pairwise_strain = true; - failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "maximum pairwise strain failure criterion"); - printf("%60s : %g\n", "failure occurs when pairwise strain reaches limit", - Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype]); - } - } // end pair based maximum strain failure criterion - else if (strcmp(arg[ioffset], "*FAILURE_MAX_PRINCIPAL_STRAIN") == 0) { - error->all(FLERR, "this failure model is currently unsupported"); - - /* - * maximum principal strain failure criterion - */ - if (comm->me == 0) { - printf("reading *FAILURE_MAX_PRINCIPAL_STRAIN\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_MAX_PRINCIPAL_STRAIN"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1 + 1) { - sprintf(str, "expected 1 arguments following *FAILURE_MAX_PRINCIPAL_STRAIN but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_max_principal_strain = true; - failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "maximum principal strain failure criterion"); - printf("%60s : %g\n", "failure occurs when principal strain reaches limit", - Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype]); - } - } // end maximum principal strain failure criterion - else if (strcmp(arg[ioffset], "*FAILURE_JOHNSON_COOK") == 0) { - error->all(FLERR, "this failure model is currently unsupported"); - if (comm->me == 0) { - printf("reading *FAILURE_JOHNSON_COOK\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_JOHNSON_COOK"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 5 + 1) { - sprintf(str, "expected 5 arguments following *FAILURE_JOHNSON_COOK but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_johnson_cook = true; - failureModel[itype].integration_point_wise = true; - - Lookup[FAILURE_JC_D1][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[FAILURE_JC_D2][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - Lookup[FAILURE_JC_D3][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); - Lookup[FAILURE_JC_D4][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); - Lookup[FAILURE_JC_EPDOT0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "Johnson-Cook failure criterion"); - printf("%60s : %g\n", "parameter d1", Lookup[FAILURE_JC_D1][itype]); - printf("%60s : %g\n", "parameter d2", Lookup[FAILURE_JC_D2][itype]); - printf("%60s : %g\n", "parameter d3", Lookup[FAILURE_JC_D3][itype]); - printf("%60s : %g\n", "parameter d4", Lookup[FAILURE_JC_D4][itype]); - printf("%60s : %g\n", "reference plastic strain rate", Lookup[FAILURE_JC_EPDOT0][itype]); - } - - } else if (strcmp(arg[ioffset], "*FAILURE_MAX_PRINCIPAL_STRESS") == 0) { - error->all(FLERR, "this failure model is currently unsupported"); - - /* - * maximum principal stress failure criterion - */ - - if (comm->me == 0) { - printf("reading *FAILURE_MAX_PRINCIPAL_STRESS\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_MAX_PRINCIPAL_STRESS"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1 + 1) { - sprintf(str, "expected 1 arguments following *FAILURE_MAX_PRINCIPAL_STRESS but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_max_principal_stress = true; - failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "maximum principal stress failure criterion"); - printf("%60s : %g\n", "failure occurs when principal stress reaches limit", - Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype]); - } - } // end maximum principal stress failure criterion - - else if (strcmp(arg[ioffset], "*FAILURE_ENERGY_RELEASE_RATE") == 0) { - if (comm->me == 0) { - printf("reading *FAILURE_ENERGY_RELEASE_RATE\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_ENERGY_RELEASE_RATE"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1 + 1) { - sprintf(str, "expected 1 arguments following *FAILURE_ENERGY_RELEASE_RATE but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_energy_release_rate = true; - Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "critical energy release rate failure criterion"); - printf("%60s : %g\n", "failure occurs when energy release rate reaches limit", - Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype]); - } - } // end energy release rate failure criterion - - else { - snprintf(str,128,"unknown *KEYWORD: %s", arg[ioffset]); - error->all(FLERR, str); - } - + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *EOS_LINEAR"); + + if (iNextKwd - ioffset != 1) + error->all(FLERR, "expected 0 arguments following *EOS_LINEAR but got {}\n", iNextKwd - ioffset - 1); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nlinear EOS based on strain rate\n"); + utils::logmesg(lmp, "{:60} : {}\n", "bulk modulus", Lookup[BULK_MODULUS][itype]); + } + } // end linear eos + else if (strcmp(arg[ioffset], "*EOS_SHOCK") == 0) { + + /* + * shock eos + */ + + eos[itype] = EOS_SHOCK; + if (comm->me == 0) utils::logmesg(lmp, "reading *EOS_SHOCK\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } - setflag[itype][itype] = 1; + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *EOS_SHOCK"); + if (iNextKwd - ioffset != 3 + 1) + error->all(FLERR, "expected 3 arguments (c0, S, Gamma) following *EOS_SHOCK but got {}\n", iNextKwd - ioffset - 1); + + Lookup[EOS_SHOCK_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[EOS_SHOCK_S][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[EOS_SHOCK_GAMMA][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + if (comm->me == 0) { + utils::logmesg(lmp, "\nshock EOS based on strain rate\n"); + utils::logmesg(lmp, "{:60} : {}\n", "reference speed of sound", Lookup[EOS_SHOCK_C0][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Hugoniot parameter S", Lookup[EOS_SHOCK_S][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Grueneisen Gamma", Lookup[EOS_SHOCK_GAMMA][itype]); + } + } // end shock eos + + else if (strcmp(arg[ioffset], "*EOS_POLYNOMIAL") == 0) { + /* + * polynomial eos + */ + + eos[itype] = EOS_POLYNOMIAL; + if (comm->me == 0) utils::logmesg(lmp, "reading *EOS_POLYNOMIAL\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *EOS_POLYNOMIAL"); + + if (iNextKwd - ioffset != 7 + 1) + error->all(FLERR, "expected 7 arguments following *EOS_POLYNOMIAL but got {}\n", iNextKwd - ioffset - 1); + + Lookup[EOS_POLYNOMIAL_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[EOS_POLYNOMIAL_C1][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[EOS_POLYNOMIAL_C2][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[EOS_POLYNOMIAL_C3][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[EOS_POLYNOMIAL_C4][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[EOS_POLYNOMIAL_C5][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[EOS_POLYNOMIAL_C6][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); + if (comm->me == 0) { + utils::logmesg(lmp, "\npolynomial EOS based on strain rate\n"); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c0", Lookup[EOS_POLYNOMIAL_C0][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c1", Lookup[EOS_POLYNOMIAL_C1][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c2", Lookup[EOS_POLYNOMIAL_C2][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c3", Lookup[EOS_POLYNOMIAL_C3][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c4", Lookup[EOS_POLYNOMIAL_C4][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c5", Lookup[EOS_POLYNOMIAL_C5][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c6", Lookup[EOS_POLYNOMIAL_C6][itype]); + } + } // end polynomial eos + + else if (strcmp(arg[ioffset], "*FAILURE_MAX_PLASTIC_STRAIN") == 0) { + + /* + * maximum plastic strain failure criterion + */ + + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_MAX_PLASTIC_SRTRAIN\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) error->all(FLERR, "no *KEYWORD terminates *FAILURE_MAX_PLASTIC_STRAIN"); + if (iNextKwd - ioffset != 1 + 1) + error->all(FLERR, "expected 1 arguments following *FAILURE_MAX_PLASTIC_STRAIN but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_max_plastic_strain = true; + failureModel[itype].integration_point_wise = true; + Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nmaximum plastic strain failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "failure occurs when plastic strain reaches limit", + Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]); + } + } // end maximum plastic strain failure criterion + else if (strcmp(arg[ioffset], "*FAILURE_MAX_PAIRWISE_STRAIN") == 0) { + + /* + * failure criterion based on maximum strain between a pair of TLSPH particles. + */ + + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_MAX_PAIRWISE_STRAIN\n"); + + if (update_method != UPDATE_NONE) { + error->all(FLERR, "cannot use *FAILURE_MAX_PAIRWISE_STRAIN with updated Total-Lagrangian formalism"); + } + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *FAILURE_MAX_PAIRWISE_STRAIN"); + + if (iNextKwd - ioffset != 1 + 1) + error->all(FLERR, "expected 1 arguments following *FAILURE_MAX_PAIRWISE_STRAIN but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_max_pairwise_strain = true; + failureModel[itype].integration_point_wise = true; + Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nmaximum pairwise strain failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "failure occurs when pairwise strain reaches limit", + Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype]); + } + } // end pair based maximum strain failure criterion + else if (strcmp(arg[ioffset], "*FAILURE_MAX_PRINCIPAL_STRAIN") == 0) { + error->all(FLERR, "this failure model is currently unsupported"); + + /* + * maximum principal strain failure criterion + */ + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_MAX_PRINCIPAL_STRAIN\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *FAILURE_MAX_PRINCIPAL_STRAIN"); + + if (iNextKwd - ioffset != 1 + 1) + error->all(FLERR, "expected 1 arguments following *FAILURE_MAX_PRINCIPAL_STRAIN but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_max_principal_strain = true; + failureModel[itype].integration_point_wise = true; + Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nmaximum principal strain failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "failure occurs when principal strain reaches limit", + Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype]); + } + } // end maximum principal strain failure criterion + else if (strcmp(arg[ioffset], "*FAILURE_JOHNSON_COOK") == 0) { + error->all(FLERR, "this failure model is currently unsupported"); + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_JOHNSON_COOK\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *FAILURE_JOHNSON_COOK"); + + if (iNextKwd - ioffset != 5 + 1) + error->all(FLERR, "expected 5 arguments following *FAILURE_JOHNSON_COOK but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_johnson_cook = true; + failureModel[itype].integration_point_wise = true; + + Lookup[FAILURE_JC_D1][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[FAILURE_JC_D2][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[FAILURE_JC_D3][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[FAILURE_JC_D4][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[FAILURE_JC_EPDOT0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nJohnson-Cook failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "parameter d1", Lookup[FAILURE_JC_D1][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter d2", Lookup[FAILURE_JC_D2][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter d3", Lookup[FAILURE_JC_D3][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter d4", Lookup[FAILURE_JC_D4][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "reference plastic strain rate", Lookup[FAILURE_JC_EPDOT0][itype]); + } + + } else if (strcmp(arg[ioffset], "*FAILURE_MAX_PRINCIPAL_STRESS") == 0) { + error->all(FLERR, "this failure model is currently unsupported"); + + /* + * maximum principal stress failure criterion + */ + + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_MAX_PRINCIPAL_STRESS\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *FAILURE_MAX_PRINCIPAL_STRESS"); + + if (iNextKwd - ioffset != 1 + 1) + error->all(FLERR, "expected 1 arguments following *FAILURE_MAX_PRINCIPAL_STRESS but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_max_principal_stress = true; + failureModel[itype].integration_point_wise = true; + Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nmaximum principal stress failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "failure occurs when principal stress reaches limit", + Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype]); + } + } // end maximum principal stress failure criterion + + else if (strcmp(arg[ioffset], "*FAILURE_ENERGY_RELEASE_RATE") == 0) { + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_ENERGY_RELEASE_RATE\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *FAILURE_ENERGY_RELEASE_RATE"); + + if (iNextKwd - ioffset != 1 + 1) + error->all(FLERR, "expected 1 arguments following *FAILURE_ENERGY_RELEASE_RATE but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_energy_release_rate = true; + Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp,"\ncritical energy release rate failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "failure occurs when energy release rate reaches limit", + Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype]); + } + } // end energy release rate failure criterion + + else error->all(FLERR, "unknown *KEYWORD: {}", arg[ioffset]); + } + setflag[itype][itype] = 1; } /* ---------------------------------------------------------------------- @@ -1694,23 +1551,22 @@ void PairTlsph::coeff(int narg, char **arg) { double PairTlsph::init_one(int i, int j) { - if (!allocated) - allocate(); + if (!allocated) + allocate(); - if (setflag[i][j] == 0) - error->all(FLERR, "All pair coeffs are not set"); + if (setflag[i][j] == 0) + error->all(FLERR, "All pair coeffs are not set"); - if (force->newton == 1) - error->all(FLERR, "Pair style tlsph requires newton off"); + if (force->newton == 1) + error->all(FLERR, "Pair style tlsph requires newton off"); // cutoff = sum of max I,J radii for // dynamic/dynamic & dynamic/frozen interactions, but not frozen/frozen - double cutoff = maxrad_dynamic[i] + maxrad_dynamic[j]; - cutoff = MAX(cutoff, maxrad_frozen[i] + maxrad_dynamic[j]); - cutoff = MAX(cutoff, maxrad_dynamic[i] + maxrad_frozen[j]); -//printf("cutoff for pair pair tlsph = %f\n", cutoff); - return cutoff; + double cutoff = maxrad_dynamic[i] + maxrad_dynamic[j]; + cutoff = MAX(cutoff, maxrad_frozen[i] + maxrad_dynamic[j]); + cutoff = MAX(cutoff, maxrad_dynamic[i] + maxrad_frozen[j]); + return cutoff; } /* ---------------------------------------------------------------------- @@ -1718,57 +1574,57 @@ double PairTlsph::init_one(int i, int j) { ------------------------------------------------------------------------- */ void PairTlsph::init_style() { - int i; + int i; - if (force->newton_pair == 1) { - error->all(FLERR, "Pair style tlsph requires newton pair off"); - } + if (force->newton_pair == 1) { + error->all(FLERR, "Pair style tlsph requires newton pair off"); + } // request a granular neighbor list - neighbor->add_request(this, NeighConst::REQ_SIZE); + neighbor->add_request(this, NeighConst::REQ_SIZE); // set maxrad_dynamic and maxrad_frozen for each type // include future Fix pour particles as dynamic - for (i = 1; i <= atom->ntypes; i++) - onerad_dynamic[i] = onerad_frozen[i] = 0.0; + for (i = 1; i <= atom->ntypes; i++) + onerad_dynamic[i] = onerad_frozen[i] = 0.0; - double *radius = atom->radius; - int *type = atom->type; - int nlocal = atom->nlocal; + double *radius = atom->radius; + int *type = atom->type; + int nlocal = atom->nlocal; - for (i = 0; i < nlocal; i++) - onerad_dynamic[type[i]] = MAX(onerad_dynamic[type[i]], radius[i]); + for (i = 0; i < nlocal; i++) + onerad_dynamic[type[i]] = MAX(onerad_dynamic[type[i]], radius[i]); - MPI_Allreduce(&onerad_dynamic[1], &maxrad_dynamic[1], atom->ntypes, MPI_DOUBLE, MPI_MAX, world); - MPI_Allreduce(&onerad_frozen[1], &maxrad_frozen[1], atom->ntypes, MPI_DOUBLE, MPI_MAX, world); + MPI_Allreduce(&onerad_dynamic[1], &maxrad_dynamic[1], atom->ntypes, MPI_DOUBLE, MPI_MAX, world); + MPI_Allreduce(&onerad_frozen[1], &maxrad_frozen[1], atom->ntypes, MPI_DOUBLE, MPI_MAX, world); // if first init, create Fix needed for storing reference configuration neighbors - int igroup = group->find("tlsph"); - if (igroup == -1) - error->all(FLERR, "Pair style tlsph requires its particles to be part of a group named tlsph. This group does not exist."); + int igroup = group->find("tlsph"); + if (igroup == -1) + error->all(FLERR, "Pair style tlsph requires its particles to be part of a group named tlsph. This group does not exist."); - if (fix_tlsph_reference_configuration == nullptr) { - char **fixarg = new char*[3]; - fixarg[0] = (char *) "SMD_TLSPH_NEIGHBORS"; - fixarg[1] = (char *) "tlsph"; - fixarg[2] = (char *) "SMD_TLSPH_NEIGHBORS"; - modify->add_fix(3, fixarg); - delete[] fixarg; - fix_tlsph_reference_configuration = (FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[modify->nfix - 1]; - fix_tlsph_reference_configuration->pair = this; - } + if (fix_tlsph_reference_configuration == nullptr) { + char **fixarg = new char*[3]; + fixarg[0] = (char *) "SMD_TLSPH_NEIGHBORS"; + fixarg[1] = (char *) "tlsph"; + fixarg[2] = (char *) "SMD_TLSPH_NEIGHBORS"; + modify->add_fix(3, fixarg); + delete[] fixarg; + fix_tlsph_reference_configuration = (FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[modify->nfix - 1]; + fix_tlsph_reference_configuration->pair = this; + } // find associated SMD_TLSPH_NEIGHBORS fix that must exist // could have changed locations in fix list since created - ifix_tlsph = -1; - for (int i = 0; i < modify->nfix; i++) - if (strcmp(modify->fix[i]->style, "SMD_TLSPH_NEIGHBORS") == 0) - ifix_tlsph = i; - if (ifix_tlsph == -1) - error->all(FLERR, "Fix SMD_TLSPH_NEIGHBORS does not exist"); + ifix_tlsph = -1; + for (int i = 0; i < modify->nfix; i++) + if (strcmp(modify->fix[i]->style, "SMD_TLSPH_NEIGHBORS") == 0) + ifix_tlsph = i; + if (ifix_tlsph == -1) + error->all(FLERR, "Fix SMD_TLSPH_NEIGHBORS does not exist"); } @@ -1794,123 +1650,118 @@ double PairTlsph::memory_usage() { ------------------------------------------------------------------------- */ void *PairTlsph::extract(const char *str, int &/*i*/) { -//printf("in PairTlsph::extract\n"); - if (strcmp(str, "smd/tlsph/Fincr_ptr") == 0) { - return (void *) Fincr; - } else if (strcmp(str, "smd/tlsph/detF_ptr") == 0) { - return (void *) detF; - } else if (strcmp(str, "smd/tlsph/PK1_ptr") == 0) { - return (void *) PK1; - } else if (strcmp(str, "smd/tlsph/smoothVel_ptr") == 0) { - return (void *) smoothVelDifference; - } else if (strcmp(str, "smd/tlsph/numNeighsRefConfig_ptr") == 0) { - return (void *) numNeighsRefConfig; - } else if (strcmp(str, "smd/tlsph/stressTensor_ptr") == 0) { - return (void *) CauchyStress; - } else if (strcmp(str, "smd/tlsph/updateFlag_ptr") == 0) { - return (void *) &updateFlag; - } else if (strcmp(str, "smd/tlsph/strain_rate_ptr") == 0) { - return (void *) D; - } else if (strcmp(str, "smd/tlsph/hMin_ptr") == 0) { - return (void *) &hMin; - } else if (strcmp(str, "smd/tlsph/dtCFL_ptr") == 0) { - return (void *) &dtCFL; - } else if (strcmp(str, "smd/tlsph/dtRelative_ptr") == 0) { - return (void *) &dtRelative; - } else if (strcmp(str, "smd/tlsph/hourglass_error_ptr") == 0) { - return (void *) hourglass_error; - } else if (strcmp(str, "smd/tlsph/particle_dt_ptr") == 0) { - return (void *) particle_dt; - } else if (strcmp(str, "smd/tlsph/rotation_ptr") == 0) { - return (void *) R; - } + if (strcmp(str, "smd/tlsph/Fincr_ptr") == 0) { + return (void *) Fincr; + } else if (strcmp(str, "smd/tlsph/detF_ptr") == 0) { + return (void *) detF; + } else if (strcmp(str, "smd/tlsph/PK1_ptr") == 0) { + return (void *) PK1; + } else if (strcmp(str, "smd/tlsph/smoothVel_ptr") == 0) { + return (void *) smoothVelDifference; + } else if (strcmp(str, "smd/tlsph/numNeighsRefConfig_ptr") == 0) { + return (void *) numNeighsRefConfig; + } else if (strcmp(str, "smd/tlsph/stressTensor_ptr") == 0) { + return (void *) CauchyStress; + } else if (strcmp(str, "smd/tlsph/updateFlag_ptr") == 0) { + return (void *) &updateFlag; + } else if (strcmp(str, "smd/tlsph/strain_rate_ptr") == 0) { + return (void *) D; + } else if (strcmp(str, "smd/tlsph/hMin_ptr") == 0) { + return (void *) &hMin; + } else if (strcmp(str, "smd/tlsph/dtCFL_ptr") == 0) { + return (void *) &dtCFL; + } else if (strcmp(str, "smd/tlsph/dtRelative_ptr") == 0) { + return (void *) &dtRelative; + } else if (strcmp(str, "smd/tlsph/hourglass_error_ptr") == 0) { + return (void *) hourglass_error; + } else if (strcmp(str, "smd/tlsph/particle_dt_ptr") == 0) { + return (void *) particle_dt; + } else if (strcmp(str, "smd/tlsph/rotation_ptr") == 0) { + return (void *) R; + } - return nullptr; + return nullptr; } /* ---------------------------------------------------------------------- */ int PairTlsph::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) { - int i, j, m; - tagint *mol = atom->molecule; - double *damage = atom->damage; - double *eff_plastic_strain = atom->eff_plastic_strain; - double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; + int i, j, m; + tagint *mol = atom->molecule; + double *damage = atom->damage; + double *eff_plastic_strain = atom->eff_plastic_strain; + double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; -//printf("in PairTlsph::pack_forward_comm\n"); + m = 0; + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = PK1[j](0, 0); // PK1 is not symmetric + buf[m++] = PK1[j](0, 1); + buf[m++] = PK1[j](0, 2); + buf[m++] = PK1[j](1, 0); + buf[m++] = PK1[j](1, 1); + buf[m++] = PK1[j](1, 2); + buf[m++] = PK1[j](2, 0); + buf[m++] = PK1[j](2, 1); + buf[m++] = PK1[j](2, 2); // 9 - m = 0; - for (i = 0; i < n; i++) { - j = list[i]; - buf[m++] = PK1[j](0, 0); // PK1 is not symmetric - buf[m++] = PK1[j](0, 1); - buf[m++] = PK1[j](0, 2); - buf[m++] = PK1[j](1, 0); - buf[m++] = PK1[j](1, 1); - buf[m++] = PK1[j](1, 2); - buf[m++] = PK1[j](2, 0); - buf[m++] = PK1[j](2, 1); - buf[m++] = PK1[j](2, 2); // 9 + buf[m++] = Fincr[j](0, 0); // Fincr is not symmetric + buf[m++] = Fincr[j](0, 1); + buf[m++] = Fincr[j](0, 2); + buf[m++] = Fincr[j](1, 0); + buf[m++] = Fincr[j](1, 1); + buf[m++] = Fincr[j](1, 2); + buf[m++] = Fincr[j](2, 0); + buf[m++] = Fincr[j](2, 1); + buf[m++] = Fincr[j](2, 2); // 9 + 9 = 18 - buf[m++] = Fincr[j](0, 0); // Fincr is not symmetric - buf[m++] = Fincr[j](0, 1); - buf[m++] = Fincr[j](0, 2); - buf[m++] = Fincr[j](1, 0); - buf[m++] = Fincr[j](1, 1); - buf[m++] = Fincr[j](1, 2); - buf[m++] = Fincr[j](2, 0); - buf[m++] = Fincr[j](2, 1); - buf[m++] = Fincr[j](2, 2); // 9 + 9 = 18 + buf[m++] = mol[j]; //19 + buf[m++] = damage[j]; //20 + buf[m++] = eff_plastic_strain[j]; //21 + buf[m++] = eff_plastic_strain_rate[j]; //22 - buf[m++] = mol[j]; //19 - buf[m++] = damage[j]; //20 - buf[m++] = eff_plastic_strain[j]; //21 - buf[m++] = eff_plastic_strain_rate[j]; //22 - - } - return m; + } + return m; } /* ---------------------------------------------------------------------- */ void PairTlsph::unpack_forward_comm(int n, int first, double *buf) { - int i, m, last; - tagint *mol = atom->molecule; - double *damage = atom->damage; - double *eff_plastic_strain = atom->eff_plastic_strain; - double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; + int i, m, last; + tagint *mol = atom->molecule; + double *damage = atom->damage; + double *eff_plastic_strain = atom->eff_plastic_strain; + double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; -//printf("in PairTlsph::unpack_forward_comm\n"); + m = 0; + last = first + n; + for (i = first; i < last; i++) { - m = 0; - last = first + n; - for (i = first; i < last; i++) { + PK1[i](0, 0) = buf[m++]; // PK1 is not symmetric + PK1[i](0, 1) = buf[m++]; + PK1[i](0, 2) = buf[m++]; + PK1[i](1, 0) = buf[m++]; + PK1[i](1, 1) = buf[m++]; + PK1[i](1, 2) = buf[m++]; + PK1[i](2, 0) = buf[m++]; + PK1[i](2, 1) = buf[m++]; + PK1[i](2, 2) = buf[m++]; - PK1[i](0, 0) = buf[m++]; // PK1 is not symmetric - PK1[i](0, 1) = buf[m++]; - PK1[i](0, 2) = buf[m++]; - PK1[i](1, 0) = buf[m++]; - PK1[i](1, 1) = buf[m++]; - PK1[i](1, 2) = buf[m++]; - PK1[i](2, 0) = buf[m++]; - PK1[i](2, 1) = buf[m++]; - PK1[i](2, 2) = buf[m++]; + Fincr[i](0, 0) = buf[m++]; + Fincr[i](0, 1) = buf[m++]; + Fincr[i](0, 2) = buf[m++]; + Fincr[i](1, 0) = buf[m++]; + Fincr[i](1, 1) = buf[m++]; + Fincr[i](1, 2) = buf[m++]; + Fincr[i](2, 0) = buf[m++]; + Fincr[i](2, 1) = buf[m++]; + Fincr[i](2, 2) = buf[m++]; - Fincr[i](0, 0) = buf[m++]; - Fincr[i](0, 1) = buf[m++]; - Fincr[i](0, 2) = buf[m++]; - Fincr[i](1, 0) = buf[m++]; - Fincr[i](1, 1) = buf[m++]; - Fincr[i](1, 2) = buf[m++]; - Fincr[i](2, 0) = buf[m++]; - Fincr[i](2, 1) = buf[m++]; - Fincr[i](2, 2) = buf[m++]; - - mol[i] = static_cast(buf[m++]); - damage[i] = buf[m++]; - eff_plastic_strain[i] = buf[m++]; //22 - eff_plastic_strain_rate[i] = buf[m++]; //23 - } + mol[i] = static_cast(buf[m++]); + damage[i] = buf[m++]; + eff_plastic_strain[i] = buf[m++]; //22 + eff_plastic_strain_rate[i] = buf[m++]; //23 + } } /* ---------------------------------------------------------------------- @@ -1919,166 +1770,145 @@ void PairTlsph::unpack_forward_comm(int n, int first, double *buf) { ------------------------------------------------------------------------- */ void PairTlsph::effective_longitudinal_modulus(const int itype, const double dt, const double d_iso, const double p_rate, - const Matrix3d d_dev, const Matrix3d sigma_dev_rate, const double /*damage*/, double &K_eff, double &mu_eff, double &M_eff) { - double M0; // initial longitudinal modulus - double shear_rate_sq; + const Matrix3d d_dev, const Matrix3d sigma_dev_rate, const double /*damage*/, double &K_eff, double &mu_eff, double &M_eff) { + double M0; // initial longitudinal modulus + double shear_rate_sq; -// if (damage >= 0.5) { -// M_eff = Lookup[M_MODULUS][itype]; -// K_eff = Lookup[BULK_MODULUS][itype]; -// mu_eff = Lookup[SHEAR_MODULUS][itype]; -// return; -// } + M0 = Lookup[M_MODULUS][itype]; - M0 = Lookup[M_MODULUS][itype]; + if (dt * d_iso > 1.0e-6) { + K_eff = p_rate / d_iso; + if (K_eff < 0.0) { // it is possible for K_eff to become negative due to strain softening + K_eff = Lookup[BULK_MODULUS][itype]; + } + } else { + K_eff = Lookup[BULK_MODULUS][itype]; + } - if (dt * d_iso > 1.0e-6) { - K_eff = p_rate / d_iso; - if (K_eff < 0.0) { // it is possible for K_eff to become negative due to strain softening -// if (damage == 0.0) { -// error->one(FLERR, "computed a negative effective bulk modulus but particle is not damaged."); -// } - K_eff = Lookup[BULK_MODULUS][itype]; - } - } else { - K_eff = Lookup[BULK_MODULUS][itype]; - } - - if (domain->dimension == 3) { + if (domain->dimension == 3) { // Calculate 2 mu by looking at ratio shear stress / shear strain. Use numerical softening to avoid divide-by-zero. - mu_eff = 0.5 - * (sigma_dev_rate(0, 1) / (d_dev(0, 1) + 1.0e-16) + sigma_dev_rate(0, 2) / (d_dev(0, 2) + 1.0e-16) - + sigma_dev_rate(1, 2) / (d_dev(1, 2) + 1.0e-16)); + mu_eff = 0.5 + * (sigma_dev_rate(0, 1) / (d_dev(0, 1) + 1.0e-16) + sigma_dev_rate(0, 2) / (d_dev(0, 2) + 1.0e-16) + + sigma_dev_rate(1, 2) / (d_dev(1, 2) + 1.0e-16)); // Calculate magnitude of deviatoric strain rate. This is used for deciding if shear modulus should be computed from current rate or be taken as the initial value. - shear_rate_sq = d_dev(0, 1) * d_dev(0, 1) + d_dev(0, 2) * d_dev(0, 2) + d_dev(1, 2) * d_dev(1, 2); - } else { - mu_eff = 0.5 * (sigma_dev_rate(0, 1) / (d_dev(0, 1) + 1.0e-16)); - shear_rate_sq = d_dev(0, 1) * d_dev(0, 1); - } + shear_rate_sq = d_dev(0, 1) * d_dev(0, 1) + d_dev(0, 2) * d_dev(0, 2) + d_dev(1, 2) * d_dev(1, 2); + } else { + mu_eff = 0.5 * (sigma_dev_rate(0, 1) / (d_dev(0, 1) + 1.0e-16)); + shear_rate_sq = d_dev(0, 1) * d_dev(0, 1); + } - if (dt * dt * shear_rate_sq < 1.0e-8) { - mu_eff = Lookup[SHEAR_MODULUS][itype]; - } + if (dt * dt * shear_rate_sq < 1.0e-8) { + mu_eff = Lookup[SHEAR_MODULUS][itype]; + } - if (mu_eff < Lookup[SHEAR_MODULUS][itype]) { // it is possible for mu_eff to become negative due to strain softening -// if (damage == 0.0) { -// printf("mu_eff = %f, tau=%f, gamma=%f\n", mu_eff, sigma_dev_rate(0, 1), d_dev(0, 1)); -// error->message(FLERR, "computed a negative effective shear modulus but particle is not damaged."); -// } - mu_eff = Lookup[SHEAR_MODULUS][itype]; - } + if (mu_eff < Lookup[SHEAR_MODULUS][itype]) { // it is possible for mu_eff to become negative due to strain softening + mu_eff = Lookup[SHEAR_MODULUS][itype]; + } -//mu_eff = Lookup[SHEAR_MODULUS][itype]; + if (mu_eff < 0.0) { + error->one(FLERR, "mu_eff = {}, tau={}, gamma={}", mu_eff, sigma_dev_rate(0, 1), d_dev(0, 1)); - if (K_eff < 0.0) { - printf("K_eff = %f, p_rate=%f, vol_rate=%f\n", K_eff, p_rate, d_iso); - } + } - if (mu_eff < 0.0) { - printf("mu_eff = %f, tau=%f, gamma=%f\n", mu_eff, sigma_dev_rate(0, 1), d_dev(0, 1)); - error->one(FLERR, ""); - } + M_eff = (K_eff + 4.0 * mu_eff / 3.0); // effective dilational modulus, see Pronto 2d eqn 3.4.8 - M_eff = (K_eff + 4.0 * mu_eff / 3.0); // effective dilational modulus, see Pronto 2d eqn 3.4.8 - - if (M_eff < M0) { // do not allow effective dilatational modulus to decrease beyond its initial value - M_eff = M0; - } + if (M_eff < M0) { // do not allow effective dilatational modulus to decrease beyond its initial value + M_eff = M0; + } } /* ---------------------------------------------------------------------- compute pressure. Called from AssembleStress(). ------------------------------------------------------------------------- */ void PairTlsph::ComputePressure(const int i, const double rho, const double mass_specific_energy, const double vol_specific_energy, - const double pInitial, const double d_iso, double &pFinal, double &p_rate) { - int *type = atom->type; - double dt = update->dt; + const double pInitial, const double d_iso, double &pFinal, double &p_rate) { + int *type = atom->type; + double dt = update->dt; - int itype; + int itype; - itype = type[i]; + itype = type[i]; - switch (eos[itype]) { - case EOS_LINEAR: - LinearEOS(Lookup[BULK_MODULUS][itype], pInitial, d_iso, dt, pFinal, p_rate); - break; - case EOS_NONE: - pFinal = 0.0; - p_rate = 0.0; - break; - case EOS_SHOCK: + switch (eos[itype]) { + case EOS_LINEAR: + LinearEOS(Lookup[BULK_MODULUS][itype], pInitial, d_iso, dt, pFinal, p_rate); + break; + case EOS_NONE: + pFinal = 0.0; + p_rate = 0.0; + break; + case EOS_SHOCK: // rho, rho0, e, e0, c0, S, Gamma, pInitial, dt, &pFinal, &p_rate); - ShockEOS(rho, Lookup[REFERENCE_DENSITY][itype], mass_specific_energy, 0.0, Lookup[EOS_SHOCK_C0][itype], - Lookup[EOS_SHOCK_S][itype], Lookup[EOS_SHOCK_GAMMA][itype], pInitial, dt, pFinal, p_rate); - break; - case EOS_POLYNOMIAL: - polynomialEOS(rho, Lookup[REFERENCE_DENSITY][itype], vol_specific_energy, Lookup[EOS_POLYNOMIAL_C0][itype], - Lookup[EOS_POLYNOMIAL_C1][itype], Lookup[EOS_POLYNOMIAL_C2][itype], Lookup[EOS_POLYNOMIAL_C3][itype], - Lookup[EOS_POLYNOMIAL_C4][itype], Lookup[EOS_POLYNOMIAL_C5][itype], Lookup[EOS_POLYNOMIAL_C6][itype], pInitial, dt, - pFinal, p_rate); + ShockEOS(rho, Lookup[REFERENCE_DENSITY][itype], mass_specific_energy, 0.0, Lookup[EOS_SHOCK_C0][itype], + Lookup[EOS_SHOCK_S][itype], Lookup[EOS_SHOCK_GAMMA][itype], pInitial, dt, pFinal, p_rate); + break; + case EOS_POLYNOMIAL: + polynomialEOS(rho, Lookup[REFERENCE_DENSITY][itype], vol_specific_energy, Lookup[EOS_POLYNOMIAL_C0][itype], + Lookup[EOS_POLYNOMIAL_C1][itype], Lookup[EOS_POLYNOMIAL_C2][itype], Lookup[EOS_POLYNOMIAL_C3][itype], + Lookup[EOS_POLYNOMIAL_C4][itype], Lookup[EOS_POLYNOMIAL_C5][itype], Lookup[EOS_POLYNOMIAL_C6][itype], pInitial, dt, + pFinal, p_rate); - break; - default: - error->one(FLERR, "unknown EOS."); - break; - } + break; + default: + error->one(FLERR, "unknown EOS."); + break; + } } /* ---------------------------------------------------------------------- Compute stress deviator. Called from AssembleStress(). ------------------------------------------------------------------------- */ void PairTlsph::ComputeStressDeviator(const int i, const Matrix3d sigmaInitial_dev, const Matrix3d d_dev, Matrix3d &sigmaFinal_dev, - Matrix3d &sigma_dev_rate, double &plastic_strain_increment) { - double *eff_plastic_strain = atom->eff_plastic_strain; - double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; - int *type = atom->type; - double *rmass = atom->rmass; -//double *vfrac = atom->vfrac; - double *esph = atom->esph; - double dt = update->dt; - double yieldStress; - int itype; + Matrix3d &sigma_dev_rate, double &plastic_strain_increment) { + double *eff_plastic_strain = atom->eff_plastic_strain; + double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; + int *type = atom->type; + double *rmass = atom->rmass; + double *esph = atom->esph; + double dt = update->dt; + double yieldStress; + int itype; - double mass_specific_energy = esph[i] / rmass[i]; // energy per unit mass - plastic_strain_increment = 0.0; - itype = type[i]; + double mass_specific_energy = esph[i] / rmass[i]; // energy per unit mass + plastic_strain_increment = 0.0; + itype = type[i]; - switch (strengthModel[itype]) { - case STRENGTH_LINEAR: + switch (strengthModel[itype]) { + case STRENGTH_LINEAR: - sigma_dev_rate = 2.0 * Lookup[SHEAR_MODULUS][itype] * d_dev; - sigmaFinal_dev = sigmaInitial_dev + dt * sigma_dev_rate; + sigma_dev_rate = 2.0 * Lookup[SHEAR_MODULUS][itype] * d_dev; + sigmaFinal_dev = sigmaInitial_dev + dt * sigma_dev_rate; - break; - case LINEAR_DEFGRAD: + break; + case LINEAR_DEFGRAD: //LinearStrengthDefgrad(Lookup[LAME_LAMBDA][itype], Lookup[SHEAR_MODULUS][itype], Fincr[i], &sigmaFinal_dev); //eff_plastic_strain[i] = 0.0; //p_rate = pInitial - sigmaFinal_dev.trace() / 3.0; //sigma_dev_rate = sigmaInitial_dev - Deviator(sigmaFinal_dev); - error->one(FLERR, "LINEAR_DEFGRAD is only for debugging purposes and currently deactivated."); - R[i].setIdentity(); - break; - case STRENGTH_LINEAR_PLASTIC: + error->one(FLERR, "LINEAR_DEFGRAD is only for debugging purposes and currently deactivated."); + R[i].setIdentity(); + break; + case STRENGTH_LINEAR_PLASTIC: - yieldStress = Lookup[YIELD_STRESS][itype] + Lookup[HARDENING_PARAMETER][itype] * eff_plastic_strain[i]; - LinearPlasticStrength(Lookup[SHEAR_MODULUS][itype], yieldStress, sigmaInitial_dev, d_dev, dt, sigmaFinal_dev, - sigma_dev_rate, plastic_strain_increment); - break; - case STRENGTH_JOHNSON_COOK: - JohnsonCookStrength(Lookup[SHEAR_MODULUS][itype], Lookup[HEAT_CAPACITY][itype], mass_specific_energy, Lookup[JC_A][itype], - Lookup[JC_B][itype], Lookup[JC_a][itype], Lookup[JC_C][itype], Lookup[JC_epdot0][itype], Lookup[JC_T0][itype], - Lookup[JC_Tmelt][itype], Lookup[JC_M][itype], dt, eff_plastic_strain[i], eff_plastic_strain_rate[i], - sigmaInitial_dev, d_dev, sigmaFinal_dev, sigma_dev_rate, plastic_strain_increment); - break; - case STRENGTH_NONE: - sigmaFinal_dev.setZero(); - sigma_dev_rate.setZero(); - break; - default: - error->one(FLERR, "unknown strength model."); - break; - } + yieldStress = Lookup[YIELD_STRESS][itype] + Lookup[HARDENING_PARAMETER][itype] * eff_plastic_strain[i]; + LinearPlasticStrength(Lookup[SHEAR_MODULUS][itype], yieldStress, sigmaInitial_dev, d_dev, dt, sigmaFinal_dev, + sigma_dev_rate, plastic_strain_increment); + break; + case STRENGTH_JOHNSON_COOK: + JohnsonCookStrength(Lookup[SHEAR_MODULUS][itype], Lookup[HEAT_CAPACITY][itype], mass_specific_energy, Lookup[JC_A][itype], + Lookup[JC_B][itype], Lookup[JC_a][itype], Lookup[JC_C][itype], Lookup[JC_epdot0][itype], Lookup[JC_T0][itype], + Lookup[JC_Tmelt][itype], Lookup[JC_M][itype], dt, eff_plastic_strain[i], eff_plastic_strain_rate[i], + sigmaInitial_dev, d_dev, sigmaFinal_dev, sigma_dev_rate, plastic_strain_increment); + break; + case STRENGTH_NONE: + sigmaFinal_dev.setZero(); + sigma_dev_rate.setZero(); + break; + default: + error->one(FLERR, "unknown strength model."); + break; + } } @@ -2086,67 +1916,45 @@ void PairTlsph::ComputeStressDeviator(const int i, const Matrix3d sigmaInitial_d Compute damage. Called from AssembleStress(). ------------------------------------------------------------------------- */ void PairTlsph::ComputeDamage(const int i, const Matrix3d strain, const Matrix3d stress, Matrix3d &/*stress_damaged*/) { - double *eff_plastic_strain = atom->eff_plastic_strain; - double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; - double *radius = atom->radius; - double *damage = atom->damage; - int *type = atom->type; - int itype = type[i]; - double jc_failure_strain; -//double damage_gap, damage_rate; - Matrix3d eye, stress_deviator; + double *eff_plastic_strain = atom->eff_plastic_strain; + double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; + double *radius = atom->radius; + double *damage = atom->damage; + int *type = atom->type; + int itype = type[i]; + double jc_failure_strain; + Matrix3d eye, stress_deviator; - eye.setIdentity(); - stress_deviator = Deviator(stress); - double pressure = -stress.trace() / 3.0; + eye.setIdentity(); + stress_deviator = Deviator(stress); + double pressure = -stress.trace() / 3.0; - if (failureModel[itype].failure_max_principal_stress) { - error->one(FLERR, "not yet implemented"); - /* - * maximum stress failure criterion: - */ - IsotropicMaxStressDamage(stress, Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype]); - } else if (failureModel[itype].failure_max_principal_strain) { - error->one(FLERR, "not yet implemented"); - /* - * maximum strain failure criterion: - */ - IsotropicMaxStrainDamage(strain, Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype]); - } else if (failureModel[itype].failure_max_plastic_strain) { - if (eff_plastic_strain[i] >= Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]) { - damage[i] = 1.0; - //double damage_gap = 0.5 * Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]; - //damage[i] = (eff_plastic_strain[i] - Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]) / damage_gap; - } - } else if (failureModel[itype].failure_johnson_cook) { + if (failureModel[itype].failure_max_principal_stress) { + error->one(FLERR, "not yet implemented"); + /* + * maximum stress failure criterion: + */ + IsotropicMaxStressDamage(stress, Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype]); + } else if (failureModel[itype].failure_max_principal_strain) { + error->one(FLERR, "not yet implemented"); + /* + * maximum strain failure criterion: + */ + IsotropicMaxStrainDamage(strain, Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype]); + } else if (failureModel[itype].failure_max_plastic_strain) { + if (eff_plastic_strain[i] >= Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]) { + damage[i] = 1.0; + } + } else if (failureModel[itype].failure_johnson_cook) { - //cout << "this is stress deviator" << stress_deviator << endl; - - jc_failure_strain = JohnsonCookFailureStrain(pressure, stress_deviator, Lookup[FAILURE_JC_D1][itype], - Lookup[FAILURE_JC_D2][itype], Lookup[FAILURE_JC_D3][itype], Lookup[FAILURE_JC_D4][itype], - Lookup[FAILURE_JC_EPDOT0][itype], eff_plastic_strain_rate[i]); - - //cout << "plastic strain increment is " << plastic_strain_increment << " jc fs is " << jc_failure_strain << endl; - //printf("JC failure strain is: %f\n", jc_failure_strain); - - if (eff_plastic_strain[i] >= jc_failure_strain) { - double damage_rate = Lookup[SIGNAL_VELOCITY][itype] / (100.0 * radius[i]); - damage[i] += damage_rate * update->dt; - //damage[i] = 1.0; - } - } - - /* - * Apply damage to integration point - */ - -// damage[i] = MIN(damage[i], 0.8); -// -// if (pressure > 0.0) { // compression: particle can carry compressive load but reduced shear -// stress_damaged = -pressure * eye + (1.0 - damage[i]) * Deviator(stress); -// } else { // tension: particle has reduced tensile and shear load bearing capability -// stress_damaged = (1.0 - damage[i]) * (-pressure * eye + Deviator(stress)); -// } + jc_failure_strain = JohnsonCookFailureStrain(pressure, stress_deviator, Lookup[FAILURE_JC_D1][itype], + Lookup[FAILURE_JC_D2][itype], Lookup[FAILURE_JC_D3][itype], Lookup[FAILURE_JC_D4][itype], + Lookup[FAILURE_JC_EPDOT0][itype], eff_plastic_strain_rate[i]); + if (eff_plastic_strain[i] >= jc_failure_strain) { + double damage_rate = Lookup[SIGNAL_VELOCITY][itype] / (100.0 * radius[i]); + damage[i] += damage_rate * update->dt; + } + } } diff --git a/src/MANIFOLD/fix_nve_manifold_rattle.cpp b/src/MANIFOLD/fix_nve_manifold_rattle.cpp index e3c0024d57..9c59b5ceca 100644 --- a/src/MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/MANIFOLD/fix_nve_manifold_rattle.cpp @@ -537,13 +537,9 @@ void FixNVEManifoldRattle::rattle_manifold_x(double *x, double *v, // gg = ptr_m->g(x); } - if (iters >= max_iter && res > tolerance) { - char msg[2048]; - sprintf(msg,"Failed to constrain atom " TAGINT_FORMAT - " (x = (%f, %f, %f)! res = %e, iters = %d\n", - tagi, x[0], x[1], x[2], res, iters); - error->one(FLERR,msg); - } + if (iters >= max_iter && res > tolerance) + error->one(FLERR, "Failed to constrain atom {} (x = ({}, {}, {})! res = {}, iters = {}\n", + tagi, x[0], x[1], x[2], res, iters); // "sync" x and v: v[0] = vt[0] - l*no_dt[0]; @@ -631,13 +627,9 @@ void FixNVEManifoldRattle::rattle_manifold_v(double *v, double *f, ++iters; } while ((res > tolerance) && (iters < max_iter)); - if (iters >= max_iter && res >= tolerance) { - char msg[2048]; - sprintf(msg,"Failed to constrain atom " TAGINT_FORMAT - " (x = (%f, %f, %f)! res = %e, iters = %d\n", - tagi, x[0], x[1], x[2], res, iters); - error->all(FLERR,msg); - } + if (iters >= max_iter && res >= tolerance) + error->all(FLERR,"Failed to constrain atom {} (x = ({}, {}, {})! res = {}, iters = {}\n", + tagi, x[0], x[1], x[2], res, iters); stats.v_iters += iters; } diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 7e55cbd965..f7199d95f6 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -14,16 +14,17 @@ #include "fix_bond_break.h" -#include -#include "update.h" -#include "respa.h" #include "atom.h" -#include "force.h" #include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" #include "neighbor.h" #include "random_mars.h" -#include "memory.h" -#include "error.h" +#include "respa.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -157,15 +158,11 @@ void FixBondBreak::init() else improperflag = 0; if (force->improper) { - if (force->improper_match("class2") || force->improper_match("ring")) - error->all(FLERR,"Cannot yet use fix bond/break with this " - "improper style"); + if (force->improper_match("^class2") || force->improper_match("^ring")) + error->all(FLERR,"Cannot yet use fix bond/break with this improper style"); } lastcheck = -1; - - // DEBUG - //print_bb(); } /* ---------------------------------------------------------------------- */ @@ -790,50 +787,6 @@ void FixBondBreak::unpack_reverse_comm(int n, int *list, double *buf) } } - -/* ---------------------------------------------------------------------- */ - -void FixBondBreak::print_bb() -{ - for (int i = 0; i < atom->nlocal; i++) { - printf("TAG " TAGINT_FORMAT ": %d nbonds: ",atom->tag[i],atom->num_bond[i]); - for (int j = 0; j < atom->num_bond[i]; j++) { - printf(" " TAGINT_FORMAT, atom->bond_atom[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d nangles: ",atom->tag[i],atom->num_angle[i]); - for (int j = 0; j < atom->num_angle[i]; j++) { - printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT ",", - atom->angle_atom1[i][j],atom->angle_atom2[i][j], - atom->angle_atom3[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d ndihedrals: ",atom->tag[i],atom->num_dihedral[i]); - for (int j = 0; j < atom->num_dihedral[i]; j++) { - printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT ",", - atom->dihedral_atom1[i][j],atom->dihedral_atom2[i][j], - atom->dihedral_atom3[i][j],atom->dihedral_atom4[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d %d %d nspecial: ",atom->tag[i], - atom->nspecial[i][0],atom->nspecial[i][1],atom->nspecial[i][2]); - for (int j = 0; j < atom->nspecial[i][2]; j++) { - printf(" " TAGINT_FORMAT, atom->special[i][j]); - } - printf("\n"); - } -} - -/* ---------------------------------------------------------------------- */ - -void FixBondBreak::print_copy(const char *str, tagint m, - int n1, int n2, int n3, int *v) -{ - printf("%s " TAGINT_FORMAT ": %d %d %d nspecial: ",str,m,n1,n2,n3); - for (int j = 0; j < n3; j++) printf(" %d",v[j]); - printf("\n"); -} - /* ---------------------------------------------------------------------- */ double FixBondBreak::compute_vector(int n) diff --git a/src/MC/fix_bond_break.h b/src/MC/fix_bond_break.h index f470adcce0..52b3c84725 100644 --- a/src/MC/fix_bond_break.h +++ b/src/MC/fix_bond_break.h @@ -71,11 +71,6 @@ class FixBondBreak : public Fix { void break_impropers(int, tagint, tagint); void rebuild_special_one(int); int dedup(int, int, tagint *); - - // DEBUG - - void print_bb(); - void print_copy(const char *, tagint, int, int, int, int *); }; } // namespace LAMMPS_NS diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index c05a37cb38..4317d4c162 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -621,9 +621,6 @@ void FixBondCreate::post_integrate() // also add angles/dihedrals/impropers induced by created bonds update_topology(); - - // DEBUG - //print_bb(); } /* ---------------------------------------------------------------------- @@ -685,11 +682,6 @@ void FixBondCreate::update_topology() nimpropers = 0; overflow = 0; - //printf("NCREATE %d: ",ncreate); - //for (i = 0; i < ncreate; i++) - // printf(" %d %d,",created[i][0],created[i][1]); - //printf("\n"); - for (i = 0; i < nlocal; i++) { influenced = 0; slist = special[i]; @@ -1439,54 +1431,3 @@ double FixBondCreate::memory_usage() return bytes; } -/* ---------------------------------------------------------------------- */ - -void FixBondCreate::print_bb() -{ - for (int i = 0; i < atom->nlocal; i++) { - printf("TAG " TAGINT_FORMAT ": %d nbonds: ",atom->tag[i],atom->num_bond[i]); - for (int j = 0; j < atom->num_bond[i]; j++) { - printf(" " TAGINT_FORMAT,atom->bond_atom[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d nangles: ",atom->tag[i],atom->num_angle[i]); - for (int j = 0; j < atom->num_angle[i]; j++) { - printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT ",", - atom->angle_atom1[i][j], atom->angle_atom2[i][j], - atom->angle_atom3[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d ndihedrals: ",atom->tag[i],atom->num_dihedral[i]); - for (int j = 0; j < atom->num_dihedral[i]; j++) { - printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " - TAGINT_FORMAT ",", atom->dihedral_atom1[i][j], - atom->dihedral_atom2[i][j],atom->dihedral_atom3[i][j], - atom->dihedral_atom4[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d nimpropers: ",atom->tag[i],atom->num_improper[i]); - for (int j = 0; j < atom->num_improper[i]; j++) { - printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " - TAGINT_FORMAT ",",atom->improper_atom1[i][j], - atom->improper_atom2[i][j],atom->improper_atom3[i][j], - atom->improper_atom4[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d %d %d nspecial: ",atom->tag[i], - atom->nspecial[i][0],atom->nspecial[i][1],atom->nspecial[i][2]); - for (int j = 0; j < atom->nspecial[i][2]; j++) { - printf(" " TAGINT_FORMAT,atom->special[i][j]); - } - printf("\n"); - } -} - -/* ---------------------------------------------------------------------- */ - -void FixBondCreate::print_copy(const char *str, tagint m, - int n1, int n2, int n3, int *v) -{ - printf("%s " TAGINT_FORMAT ": %d %d %d nspecial: ",str,m,n1,n2,n3); - for (int j = 0; j < n3; j++) printf(" %d",v[j]); - printf("\n"); -} diff --git a/src/MC/fix_bond_create.h b/src/MC/fix_bond_create.h index 26505a5906..339094c8ef 100644 --- a/src/MC/fix_bond_create.h +++ b/src/MC/fix_bond_create.h @@ -88,11 +88,6 @@ class FixBondCreate : public Fix { int dedup(int, int, tagint *); virtual int constrain(int, int, double, double) { return 1; } - - // DEBUG - - void print_bb(); - void print_copy(const char *, tagint, int, int, int, int *); }; } // namespace LAMMPS_NS From 33b64666115f1298847f0ff2389aa88c92cb87a9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 31 Mar 2022 07:31:43 -0400 Subject: [PATCH 063/130] add minimal fix tmd example --- examples/PACKAGES/tmd/data.peptide | 1 + examples/PACKAGES/tmd/in.tmd | 45 ++++ examples/PACKAGES/tmd/log.31Mar22.tmd.g++.1 | 210 ++++++++++++++++++ examples/PACKAGES/tmd/log.31Mar22.tmd.g++.4 | 210 ++++++++++++++++++ .../PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.1 | 4 + .../PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.4 | 4 + examples/PACKAGES/tmd/tmd.target | 13 ++ 7 files changed, 487 insertions(+) create mode 120000 examples/PACKAGES/tmd/data.peptide create mode 100644 examples/PACKAGES/tmd/in.tmd create mode 100644 examples/PACKAGES/tmd/log.31Mar22.tmd.g++.1 create mode 100644 examples/PACKAGES/tmd/log.31Mar22.tmd.g++.4 create mode 100644 examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.1 create mode 100644 examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.4 create mode 100644 examples/PACKAGES/tmd/tmd.target diff --git a/examples/PACKAGES/tmd/data.peptide b/examples/PACKAGES/tmd/data.peptide new file mode 120000 index 0000000000..47dd25a04b --- /dev/null +++ b/examples/PACKAGES/tmd/data.peptide @@ -0,0 +1 @@ +../../peptide/data.peptide \ No newline at end of file diff --git a/examples/PACKAGES/tmd/in.tmd b/examples/PACKAGES/tmd/in.tmd new file mode 100644 index 0000000000..6cbf57b951 --- /dev/null +++ b/examples/PACKAGES/tmd/in.tmd @@ -0,0 +1,45 @@ +# Solvated 5-mer peptide + +units real +atom_style full + +pair_style lj/charmm/coul/long 8.0 10.0 10.0 +bond_style harmonic +angle_style charmm +dihedral_style charmm +improper_style harmonic +kspace_style pppm 0.0001 + +read_data data.peptide + +neighbor 2.0 bin +neigh_modify delay 5 + +timestep 2.0 + +thermo_style multi +thermo 50 + +group tmd id 1:6 + +fix 1 all nvt temp 275.0 275.0 100.0 tchain 1 +fix 0 tmd tmd 0.1 tmd.target 100 tmd.log +fix 2 all shake 0.0001 10 100 b 4 6 8 10 12 14 18 a 31 + +group peptide type <= 12 + +#dump 1 peptide atom 10 dump.peptide + +#dump 2 peptide image 25 image.*.jpg type type & +# axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 2 pad 3 + +#dump 3 peptide movie 25 movie.mpg type type & +# axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 3 pad 3 + +#compute bnd all property/local btype batom1 batom2 +#dump 2 peptide local 300 dump.bond index c_bnd[1] c_bnd[2] c_bnd[3] + +run 300 + diff --git a/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.1 b/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.1 new file mode 100644 index 0000000000..ff290e55c6 --- /dev/null +++ b/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.1 @@ -0,0 +1,210 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Solvated 5-mer peptide + +units real +atom_style full + +pair_style lj/charmm/coul/long 8.0 10.0 10.0 +bond_style harmonic +angle_style charmm +dihedral_style charmm +improper_style harmonic +kspace_style pppm 0.0001 + +read_data data.peptide +Reading data file ... + orthogonal box = (36.840194 41.013691 29.768095) to (64.21156 68.385058 57.139462) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 2004 atoms + reading velocities ... + 2004 velocities + scanning bonds ... + 3 = max bonds/atom + scanning angles ... + 6 = max angles/atom + scanning dihedrals ... + 14 = max dihedrals/atom + scanning impropers ... + 1 = max impropers/atom + reading bonds ... + 1365 bonds + reading angles ... + 786 angles + reading dihedrals ... + 207 dihedrals + reading impropers ... + 12 impropers +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 4 = max # of 1-2 neighbors + 7 = max # of 1-3 neighbors + 14 = max # of 1-4 neighbors + 18 = max # of special neighbors + special bonds CPU = 0.001 seconds + read_data CPU = 0.011 seconds + +neighbor 2.0 bin +neigh_modify delay 5 + +timestep 2.0 + +thermo_style multi +thermo 50 + +group tmd id 1:6 +6 atoms in group tmd + +fix 1 all nvt temp 275.0 275.0 100.0 tchain 1 +fix 0 tmd tmd 0.1 tmd.target 100 tmd.log +Reading TMD target file tmd.target ... +fix 2 all shake 0.0001 10 100 b 4 6 8 10 12 14 18 a 31 + 19 = # of size 2 clusters + 6 = # of size 3 clusters + 3 = # of size 4 clusters + 640 = # of frozen angles + find clusters CPU = 0.000 seconds + +group peptide type <= 12 +84 atoms in group peptide + +#dump 1 peptide atom 10 dump.peptide + +#dump 2 peptide image 25 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 2 pad 3 + +#dump 3 peptide movie 25 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 3 pad 3 + +#compute bnd all property/local btype batom1 batom2 +#dump 2 peptide local 300 dump.bond index c_bnd[1] c_bnd[2] c_bnd[3] + +run 300 +PPPM initialization ... + using 12-bit tables for long-range coulomb (src/kspace.cpp:340) + G vector (1/distance) = 0.26872465 + grid = 15 15 15 + stencil order = 5 + estimated absolute RMS force accuracy = 0.022820853 + estimated relative force accuracy = 6.872432e-05 + using double precision FFTW3 + 3d grid and FFT values/proc = 10648 3375 + generated 91 of 91 mixed pair_coeff terms from arithmetic mixing rule +Neighbor list info ... + update every 1 steps, delay 5 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 5 5 5 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/charmm/coul/long, 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: 4 1.111 1.44264e-05 9 +Bond: 6 0.996998 7.26967e-06 6 +Bond: 8 1.08 1.32536e-05 9 +Bond: 10 1.111 1.22749e-05 8 +Bond: 12 1.08 1.11767e-05 9 +Bond: 14 0.96 0 1 +Bond: 18 0.957206 4.37979e-05 1280 +Angle: 31 104.519 0.00396029 640 +Per MPI rank memory allocation (min/avg/max) = 19.78 | 19.78 | 19.78 Mbytes +------------ Step 0 ----- CPU = 0 (sec) ------------- +TotEng = -5237.4580 KinEng = 1134.9186 Temp = 282.1005 +PotEng = -6372.3766 E_bond = 16.5572 E_angle = 36.3726 +E_dihed = 15.5190 E_impro = 1.9426 E_vdwl = 692.8945 +E_coul = 26772.2646 E_long = -33907.9271 Press = -837.0112 +------------ Step 50 ----- CPU = 0.6301453 (sec) ------------- +TotEng = -5001.6799 KinEng = 1319.3760 Temp = 327.9501 +PotEng = -6321.0559 E_bond = 17.4415 E_angle = 42.4509 +E_dihed = 25.0839 E_impro = 4.4025 E_vdwl = 725.7619 +E_coul = 26771.0015 E_long = -33907.1980 Press = -1.1409 +SHAKE stats (type/ave/delta/count) on step 100 +Bond: 4 1.11096 0.000146572 9 +Bond: 6 0.996997 7.55911e-06 6 +Bond: 8 1.08 8.22449e-06 9 +Bond: 10 1.11099 3.00424e-05 8 +Bond: 12 1.08 6.53505e-06 9 +Bond: 14 0.95999 0 1 +Bond: 18 0.957195 4.74892e-05 1280 +Angle: 31 104.52 0.00446577 640 +------------ Step 100 ----- CPU = 1.251267 (sec) ------------- +TotEng = -5114.3221 KinEng = 1168.2996 Temp = 290.3979 +PotEng = -6282.6217 E_bond = 45.5470 E_angle = 87.5725 +E_dihed = 26.1332 E_impro = 1.8662 E_vdwl = 791.5291 +E_coul = 26670.6791 E_long = -33905.9488 Press = -29.3446 +------------ Step 150 ----- CPU = 1.869158 (sec) ------------- +TotEng = -5302.3058 KinEng = 1211.4300 Temp = 301.1186 +PotEng = -6513.7358 E_bond = 51.4069 E_angle = 82.5752 +E_dihed = 31.1298 E_impro = 4.3390 E_vdwl = 764.0550 +E_coul = 26461.8974 E_long = -33909.1392 Press = -1204.2714 +SHAKE stats (type/ave/delta/count) on step 200 +Bond: 4 1.11094 0.000292869 9 +Bond: 6 0.996989 3.13206e-05 6 +Bond: 8 1.07999 4.4723e-05 9 +Bond: 10 1.111 1.08895e-05 8 +Bond: 12 1.07999 1.42694e-05 9 +Bond: 14 0.959976 0 1 +Bond: 18 0.957195 8.58256e-05 1280 +Angle: 31 104.52 0.00597861 640 +------------ Step 200 ----- CPU = 2.48933 (sec) ------------- +TotEng = -5785.4658 KinEng = 1048.7220 Temp = 260.6751 +PotEng = -6834.1879 E_bond = 21.7304 E_angle = 48.3249 +E_dihed = 20.5973 E_impro = 2.0603 E_vdwl = 818.9175 +E_coul = 26165.9672 E_long = -33911.7854 Press = -1228.5741 +------------ Step 250 ----- CPU = 3.119859 (sec) ------------- +TotEng = -6108.4578 KinEng = 828.5247 Temp = 205.9419 +PotEng = -6936.9825 E_bond = 26.5971 E_angle = 68.2771 +E_dihed = 36.1232 E_impro = 5.2092 E_vdwl = 884.1147 +E_coul = 25955.7300 E_long = -33913.0338 Press = -1365.4744 +SHAKE stats (type/ave/delta/count) on step 300 +Bond: 4 1.11174 0.0109853 9 +Bond: 6 0.996999 1.94772e-06 6 +Bond: 8 1.08 3.97091e-06 9 +Bond: 10 1.111 2.52635e-06 8 +Bond: 12 1.08 1.24444e-06 9 +Bond: 14 0.96 0 1 +Bond: 18 0.9572 1.22873e-05 1280 +Angle: 31 104.52 0.00134864 640 +------------ Step 300 ----- CPU = 3.74524 (sec) ------------- +TotEng = -5492.5012 KinEng = 1315.6902 Temp = 327.0339 +PotEng = -6808.1914 E_bond = 88.7967 E_angle = 104.4231 +E_dihed = 28.2383 E_impro = 43.5062 E_vdwl = 992.5311 +E_coul = 25849.1502 E_long = -33914.8370 Press = 268.8004 +Loop time of 3.74527 on 1 procs for 300 steps with 2004 atoms + +Performance: 13.841 ns/day, 1.734 hours/ns, 80.101 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 | 2.9399 | 2.9399 | 2.9399 | 0.0 | 78.50 +Bond | 0.0069522 | 0.0069522 | 0.0069522 | 0.0 | 0.19 +Kspace | 0.25203 | 0.25203 | 0.25203 | 0.0 | 6.73 +Neigh | 0.48624 | 0.48624 | 0.48624 | 0.0 | 12.98 +Comm | 0.016948 | 0.016948 | 0.016948 | 0.0 | 0.45 +Output | 0.00023689 | 0.00023689 | 0.00023689 | 0.0 | 0.01 +Modify | 0.039476 | 0.039476 | 0.039476 | 0.0 | 1.05 +Other | | 0.003502 | | | 0.09 + +Nlocal: 2004 ave 2004 max 2004 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 11242 ave 11242 max 11242 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 710782 ave 710782 max 710782 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 710782 +Ave neighs/atom = 354.68164 +Ave special neighs/atom = 2.3403194 +Neighbor list builds = 32 +Dangerous builds = 1 + +Total wall time: 0:00:03 diff --git a/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.4 b/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.4 new file mode 100644 index 0000000000..c38f5ae7bb --- /dev/null +++ b/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.4 @@ -0,0 +1,210 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Solvated 5-mer peptide + +units real +atom_style full + +pair_style lj/charmm/coul/long 8.0 10.0 10.0 +bond_style harmonic +angle_style charmm +dihedral_style charmm +improper_style harmonic +kspace_style pppm 0.0001 + +read_data data.peptide +Reading data file ... + orthogonal box = (36.840194 41.013691 29.768095) to (64.21156 68.385058 57.139462) + 1 by 2 by 2 MPI processor grid + reading atoms ... + 2004 atoms + reading velocities ... + 2004 velocities + scanning bonds ... + 3 = max bonds/atom + scanning angles ... + 6 = max angles/atom + scanning dihedrals ... + 14 = max dihedrals/atom + scanning impropers ... + 1 = max impropers/atom + reading bonds ... + 1365 bonds + reading angles ... + 786 angles + reading dihedrals ... + 207 dihedrals + reading impropers ... + 12 impropers +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 4 = max # of 1-2 neighbors + 7 = max # of 1-3 neighbors + 14 = max # of 1-4 neighbors + 18 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.017 seconds + +neighbor 2.0 bin +neigh_modify delay 5 + +timestep 2.0 + +thermo_style multi +thermo 50 + +group tmd id 1:6 +6 atoms in group tmd + +fix 1 all nvt temp 275.0 275.0 100.0 tchain 1 +fix 0 tmd tmd 0.1 tmd.target 100 tmd.log +Reading TMD target file tmd.target ... +fix 2 all shake 0.0001 10 100 b 4 6 8 10 12 14 18 a 31 + 19 = # of size 2 clusters + 6 = # of size 3 clusters + 3 = # of size 4 clusters + 640 = # of frozen angles + find clusters CPU = 0.000 seconds + +group peptide type <= 12 +84 atoms in group peptide + +#dump 1 peptide atom 10 dump.peptide + +#dump 2 peptide image 25 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 2 pad 3 + +#dump 3 peptide movie 25 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 3 pad 3 + +#compute bnd all property/local btype batom1 batom2 +#dump 2 peptide local 300 dump.bond index c_bnd[1] c_bnd[2] c_bnd[3] + +run 300 +PPPM initialization ... + using 12-bit tables for long-range coulomb (src/kspace.cpp:340) + G vector (1/distance) = 0.26872465 + grid = 15 15 15 + stencil order = 5 + estimated absolute RMS force accuracy = 0.022820853 + estimated relative force accuracy = 6.872432e-05 + using double precision FFTW3 + 3d grid and FFT values/proc = 4312 960 + generated 91 of 91 mixed pair_coeff terms from arithmetic mixing rule +Neighbor list info ... + update every 1 steps, delay 5 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 5 5 5 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/charmm/coul/long, 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: 4 1.111 1.44264e-05 9 +Bond: 6 0.996998 7.26967e-06 6 +Bond: 8 1.08 1.32536e-05 6 +Bond: 10 1.111 1.22749e-05 8 +Bond: 12 1.08 1.11767e-05 9 +Bond: 14 0.96 0 1 +Bond: 18 0.957206 4.37979e-05 1280 +Angle: 31 104.519 0.00396029 640 +Per MPI rank memory allocation (min/avg/max) = 16.78 | 16.97 | 17.16 Mbytes +------------ Step 0 ----- CPU = 0 (sec) ------------- +TotEng = -5237.4580 KinEng = 1134.9186 Temp = 282.1005 +PotEng = -6372.3766 E_bond = 16.5572 E_angle = 36.3726 +E_dihed = 15.5190 E_impro = 1.9426 E_vdwl = 692.8945 +E_coul = 26772.2646 E_long = -33907.9271 Press = -837.0112 +------------ Step 50 ----- CPU = 0.1916178 (sec) ------------- +TotEng = -5001.6799 KinEng = 1319.3760 Temp = 327.9501 +PotEng = -6321.0559 E_bond = 17.4415 E_angle = 42.4509 +E_dihed = 25.0839 E_impro = 4.4025 E_vdwl = 725.7619 +E_coul = 26771.0015 E_long = -33907.1980 Press = -1.1409 +SHAKE stats (type/ave/delta/count) on step 100 +Bond: 4 1.11096 0.000146572 9 +Bond: 6 0.996997 7.55911e-06 6 +Bond: 8 1.08 8.22449e-06 6 +Bond: 10 1.11099 3.00424e-05 8 +Bond: 12 1.08 6.53505e-06 9 +Bond: 14 0.95999 0 1 +Bond: 18 0.957195 4.74892e-05 1280 +Angle: 31 104.52 0.00446577 640 +------------ Step 100 ----- CPU = 0.3672111 (sec) ------------- +TotEng = -5114.3221 KinEng = 1168.2996 Temp = 290.3979 +PotEng = -6282.6217 E_bond = 45.5470 E_angle = 87.5725 +E_dihed = 26.1332 E_impro = 1.8662 E_vdwl = 791.5291 +E_coul = 26670.6792 E_long = -33905.9488 Press = -29.3446 +------------ Step 150 ----- CPU = 0.5543252 (sec) ------------- +TotEng = -5302.3058 KinEng = 1211.4300 Temp = 301.1186 +PotEng = -6513.7358 E_bond = 51.4069 E_angle = 82.5752 +E_dihed = 31.1298 E_impro = 4.3390 E_vdwl = 764.0550 +E_coul = 26461.8975 E_long = -33909.1392 Press = -1204.2714 +SHAKE stats (type/ave/delta/count) on step 200 +Bond: 4 1.11094 0.000292869 9 +Bond: 6 0.996989 3.13206e-05 6 +Bond: 8 1.07999 4.4723e-05 6 +Bond: 10 1.111 1.08895e-05 8 +Bond: 12 1.07999 1.42694e-05 9 +Bond: 14 0.959976 0 1 +Bond: 18 0.957195 8.58257e-05 1280 +Angle: 31 104.52 0.00597861 640 +------------ Step 200 ----- CPU = 0.7449468 (sec) ------------- +TotEng = -5785.4658 KinEng = 1048.7220 Temp = 260.6751 +PotEng = -6834.1878 E_bond = 21.7304 E_angle = 48.3249 +E_dihed = 20.5973 E_impro = 2.0603 E_vdwl = 818.9173 +E_coul = 26165.9673 E_long = -33911.7854 Press = -1228.5754 +------------ Step 250 ----- CPU = 0.9417257 (sec) ------------- +TotEng = -6108.4577 KinEng = 828.5246 Temp = 205.9418 +PotEng = -6936.9823 E_bond = 26.5971 E_angle = 68.2771 +E_dihed = 36.1232 E_impro = 5.2092 E_vdwl = 884.1146 +E_coul = 25955.7302 E_long = -33913.0338 Press = -1365.4736 +SHAKE stats (type/ave/delta/count) on step 300 +Bond: 4 1.11174 0.0109854 9 +Bond: 6 0.996999 1.94775e-06 6 +Bond: 8 1.08 3.97089e-06 6 +Bond: 10 1.111 2.52634e-06 8 +Bond: 12 1.08 1.24445e-06 9 +Bond: 14 0.96 0 1 +Bond: 18 0.9572 1.22873e-05 1280 +Angle: 31 104.52 0.0013486 640 +------------ Step 300 ----- CPU = 1.137003 (sec) ------------- +TotEng = -5492.5016 KinEng = 1315.6899 Temp = 327.0339 +PotEng = -6808.1915 E_bond = 88.7968 E_angle = 104.4228 +E_dihed = 28.2384 E_impro = 43.5061 E_vdwl = 992.5315 +E_coul = 25849.1499 E_long = -33914.8370 Press = 268.8010 +Loop time of 1.13706 on 4 procs for 300 steps with 2004 atoms + +Performance: 45.591 ns/day, 0.526 hours/ns, 263.838 timesteps/s +99.5% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.75407 | 0.80373 | 0.84144 | 3.6 | 70.68 +Bond | 0.0010088 | 0.0024668 | 0.0045274 | 2.6 | 0.22 +Kspace | 0.095468 | 0.13434 | 0.18276 | 8.9 | 11.81 +Neigh | 0.13509 | 0.13515 | 0.13522 | 0.0 | 11.89 +Comm | 0.024217 | 0.025086 | 0.026404 | 0.5 | 2.21 +Output | 0.00020952 | 0.00023591 | 0.00031389 | 0.0 | 0.02 +Modify | 0.033319 | 0.033374 | 0.033436 | 0.0 | 2.94 +Other | | 0.00268 | | | 0.24 + +Nlocal: 501 ave 530 max 459 min +Histogram: 1 0 0 0 0 0 1 1 0 1 +Nghost: 6562.75 ave 6755 max 6370 min +Histogram: 1 0 0 0 1 1 0 0 0 1 +Neighs: 177696 ave 195050 max 158403 min +Histogram: 1 0 0 1 0 0 0 1 0 1 + +Total # of neighbors = 710782 +Ave neighs/atom = 354.68164 +Ave special neighs/atom = 2.3403194 +Neighbor list builds = 32 +Dangerous builds = 1 + +Total wall time: 0:00:01 diff --git a/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.1 b/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.1 new file mode 100644 index 0000000000..6b1732cb2a --- /dev/null +++ b/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.1 @@ -0,0 +1,4 @@ +# Step rho_target rho_old gamma_back gamma_forward lambda work_lambda work_analytical +100 11.580338717125848 11.637740410711476 0.00432656530431019 -0.0006058453921097923 1295.0393774041895 -7808.460018545273 562.4687334224966 +200 5.840169358562925 5.897571052148553 0.009256742629063092 -0.0004765379201060169 1404.114149312145 -15441.509720360129 1352.9255849946983 +300 0.10000000000000142 0.15740169358562994 -0.030035833473071705 -0.5643261296323345 -121.59623659080042 -22929.738462520727 2299.6676396746325 diff --git a/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.4 b/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.4 new file mode 100644 index 0000000000..17188a756a --- /dev/null +++ b/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.4 @@ -0,0 +1,4 @@ +# Step rho_target rho_old gamma_back gamma_forward lambda work_lambda work_analytical +100 11.580338717125848 11.637740410711476 0.004326565303381905 -0.0006058453930379918 1295.0393771263327 -7808.46001855425 562.4687334073235 +200 5.840169358562925 5.897571052148553 0.009256742652188668 -0.0004765378969710561 1404.114152819961 -15441.50972264099 1352.9255825827688 +300 0.10000000000000142 0.15740169358562994 -0.03003651537895091 -0.5643268572640833 -121.59899719968097 -22929.73877163682 2299.6674130478946 diff --git a/examples/PACKAGES/tmd/tmd.target b/examples/PACKAGES/tmd/tmd.target new file mode 100644 index 0000000000..e83cebb32c --- /dev/null +++ b/examples/PACKAGES/tmd/tmd.target @@ -0,0 +1,13 @@ +# pull a few peptide atoms across the box + 36.840194 64.211560 xlo xhi + 41.013691 68.385058 ylo yhi + 29.768095 57.139462 zlo zhi # comment +# comment + 1 53.99993 48.52678 46.78550 0 0 0 + 2 55.10395 48.23499 45.86693 0 0 0 + 3 53.81519 49.54928 47.43995 0 0 0 + 4 55.71714 47.34797 46.13434 0 0 0 + 5 55.72261 49.13657 45.67007 0 0 0 + 6 54.66624 48.09539 44.85538 0 0 0 + 7 53.28193 47.47427 46.91953 0 0 0 + 8 52.07157 47.45486 47.62418 0 0 0 From 52b563a83e15c6512bb8d30be00b7c97c99cdf98 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 31 Mar 2022 07:36:50 -0400 Subject: [PATCH 064/130] modernize parsing in fix tmd, add support for comments and empty lines --- doc/src/fix_tmd.rst | 19 ++++--- src/EXTRA-FIX/fix_tmd.cpp | 110 +++++++++++++++++++++----------------- 2 files changed, 72 insertions(+), 57 deletions(-) diff --git a/doc/src/fix_tmd.rst b/doc/src/fix_tmd.rst index b4595d24cd..ccebb35823 100644 --- a/doc/src/fix_tmd.rst +++ b/doc/src/fix_tmd.rst @@ -29,10 +29,10 @@ Description """"""""""" Perform targeted molecular dynamics (TMD) on a group of atoms. A -holonomic constraint is used to force the atoms to move towards (or -away from) the target configuration. The parameter "rho" is -monotonically decreased (or increased) from its initial value to -rho_final at the end of the run. +holonomic constraint is used to force the atoms to move towards (or away +from) the target configuration. The parameter "rho" is monotonically +decreased (or increased) from its initial value to rho_final at the end +of the run. Rho has distance units and is a measure of the root-mean-squared distance (RMSD) between the current configuration of the atoms in the @@ -55,22 +55,25 @@ a .gz suffix). The format of the target file1 is as follows: The first 3 lines may or may not be needed, depending on the format of the atoms to follow. If image flags are included with the atoms, the -first 3 lo/hi lines must appear in the file. If image flags are not -included, the first 3 lines should not appear. The 3 lines contain the +first 3 lo/hi lines **must** appear in the file. If image flags are not +included, the first 3 lines **must not** appear. The 3 lines contain the simulation box dimensions for the atom coordinates, in the same format as in a LAMMPS data file (see the :doc:`read_data ` command). The remaining lines each contain an atom ID and its target x,y,z coordinates. The atom lines (all or none of them) can optionally be -followed by 3 integer values: nx,ny,nz. For periodic dimensions, they +followed by 3 integer values: nx,ny,nz.For periodic dimensions, they specify which image of the box the atom is considered to be in, i.e. a value of N (positive or negative) means add N times the box length to -the coordinate to get the true value. +the coordinate to get the true value. Those 3 integers either must +be given for all atoms or none. The atom lines can be listed in any order, but every atom in the group must be listed in the file. Atoms not in the fix group may also be listed; they will be ignored. +Comments starting with '#' and empty lines may be included as well. + TMD statistics are written to file2 every N timesteps, unless N is specified as 0, which means no statistics. diff --git a/src/EXTRA-FIX/fix_tmd.cpp b/src/EXTRA-FIX/fix_tmd.cpp index 4d85687e4d..8ee6e3e141 100644 --- a/src/EXTRA-FIX/fix_tmd.cpp +++ b/src/EXTRA-FIX/fix_tmd.cpp @@ -27,6 +27,7 @@ #include "memory.h" #include "modify.h" #include "respa.h" +#include "tokenizer.h" #include "update.h" #include @@ -268,10 +269,8 @@ void FixTMD::initial_integrate(int /*vflag*/) work_lambda += lambda*(rho_target - rho_old); if (!(update->ntimestep % nfileevery) && (previous_stat != update->ntimestep)) { - fprintf(fp, - BIGINT_FORMAT " %g %g %g %g %g %g %g\n", - update->ntimestep,rho_target,rho_old, - gamma_back,gamma_forward,lambda,work_lambda,work_analytical); + fmt::print(fp, "{} {} {} {} {} {} {} {}\n", update->ntimestep,rho_target,rho_old, + gamma_back,gamma_forward,lambda,work_lambda,work_analytical); fflush(fp); previous_stat = update->ntimestep; } @@ -392,7 +391,7 @@ void FixTMD::readfile(char *file) char *buffer = new char[CHUNK*MAXLINE]; char *next,*bufptr; - int i,m,n,nlines,imageflag,ix,iy,iz; + int i,m,nlines,imageflag,ix,iy,iz; tagint itag; double x,y,z,xprd,yprd,zprd; @@ -422,53 +421,66 @@ void FixTMD::readfile(char *file) for (i = 0; i < nlines; i++) { next = strchr(bufptr,'\n'); *next = '\0'; - - if (firstline) { - if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+xlo\\s+xhi")) { - double lo,hi; - n = sscanf(bufptr,"%lg %lg",&lo,&hi); - if (n != 2) - error->all(FLERR,"Incorrect format in TMD target file"); - xprd = hi - lo; - bufptr = next + 1; - continue; - } else if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+ylo\\s+yhi")) { - double lo,hi; - n = sscanf(bufptr,"%lg %lg",&lo,&hi); - if (n != 2) - error->all(FLERR,"Incorrect format in TMD target file"); - yprd = hi - lo; - bufptr = next + 1; - continue; - } else if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+zlo\\s+zhi")) { - double lo,hi; - n = sscanf(bufptr,"%lg %lg",&lo,&hi); - if (n != 2) - error->all(FLERR,"Incorrect format in TMD target file"); - zprd = hi - lo; - bufptr = next + 1; - continue; - } else if (utils::trim_and_count_words(bufptr) == 4) { - if (xprd >= 0.0 || yprd >= 0.0 || zprd >= 0.0) - error->all(FLERR,"Incorrect format in TMD target file"); - imageflag = 0; - firstline = 0; - } else if (utils::trim_and_count_words(bufptr) == 7) { - if (xprd < 0.0 || yprd < 0.0 || zprd < 0.0) - error->all(FLERR,"Incorrect format in TMD target file"); - imageflag = 1; - firstline = 0; - } else error->all(FLERR,"Incorrect format in TMD target file"); + // trim comments and skip empty lines + char *comment = strchr(bufptr,'#'); + if (comment) *comment = '\0'; + if (!strlen(bufptr)) { + bufptr = next + 1; + continue; } - if (imageflag) - n = 7 - sscanf(bufptr,TAGINT_FORMAT " %lg %lg %lg %d %d %d", - &itag,&x,&y,&z,&ix,&iy,&iz); - else - n = 4 - sscanf(bufptr,TAGINT_FORMAT " %lg %lg %lg",&itag,&x,&y,&z); + if (firstline) { + try { + ValueTokenizer values(bufptr); - if (n != 0) { - error->all(FLERR,"Incorrectly formatted line in TMD target file"); + if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+xlo\\s+xhi")) { + auto lo = values.next_double(); + auto hi = values.next_double(); + xprd = hi - lo; + bufptr = next + 1; + continue; + } else if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+ylo\\s+yhi")) { + auto lo = values.next_double(); + auto hi = values.next_double(); + yprd = hi - lo; + bufptr = next + 1; + continue; + } else if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+zlo\\s+zhi")) { + auto lo = values.next_double(); + auto hi = values.next_double(); + zprd = hi - lo; + bufptr = next + 1; + continue; + } else if (utils::trim_and_count_words(bufptr) == 4) { + if (xprd >= 0.0 || yprd >= 0.0 || zprd >= 0.0) + throw TokenizerException("must use imageflags when providing box boundaries", bufptr); + imageflag = 0; + firstline = 0; + } else if (utils::trim_and_count_words(bufptr) == 7) { + if (xprd < 0.0 || yprd < 0.0 || zprd < 0.0) + throw TokenizerException("Invalid box boundaries",""); + imageflag = 1; + firstline = 0; + } else throw TokenizerException("unknown data", bufptr); + } + catch (std::exception &e) { + error->all(FLERR,"Incorrect format in TMD target file: {}", e.what()); + } + } + + try { + ValueTokenizer values(bufptr); + itag = values.next_tagint(); + x = values.next_double(); + y = values.next_double(); + z = values.next_double(); + if (imageflag) { + ix = values.next_int(); + iy = values.next_int(); + iz = values.next_int(); + } + } catch (std::exception &e) { + error->all(FLERR,"Incorrectly formatted line in TMD target file: {}", e.what()); bufptr = next + 1; continue; } From 12ddc4ad12ef685464e7c0404ff896640638ef5e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 31 Mar 2022 07:51:14 -0400 Subject: [PATCH 065/130] final set of XXXINT_FORMAT changes --- src/EXTRA-FIX/fix_ave_correlate_long.cpp | 26 +- src/EXTRA-FIX/fix_filter_corotate.cpp | 558 +++++++++++------------ src/INTEL/verlet_lrt_intel.cpp | 11 +- 3 files changed, 282 insertions(+), 313 deletions(-) diff --git a/src/EXTRA-FIX/fix_ave_correlate_long.cpp b/src/EXTRA-FIX/fix_ave_correlate_long.cpp index 5dc3f01aad..856cda90c2 100644 --- a/src/EXTRA-FIX/fix_ave_correlate_long.cpp +++ b/src/EXTRA-FIX/fix_ave_correlate_long.cpp @@ -188,14 +188,11 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/correlate/long does not exist"); if (argindex[i] == 0 && modify->compute[icompute]->scalar_flag == 0) - error->all(FLERR, - "Fix ave/correlate/long compute does not calculate a scalar"); + error->all(FLERR,"Fix ave/correlate/long compute does not calculate a scalar"); if (argindex[i] && modify->compute[icompute]->vector_flag == 0) - error->all(FLERR, - "Fix ave/correlate/long compute does not calculate a vector"); + error->all(FLERR,"Fix ave/correlate/long compute does not calculate a vector"); if (argindex[i] && argindex[i] > modify->compute[icompute]->size_vector) - error->all(FLERR,"Fix ave/correlate/long compute vector " - "is accessed out-of-range"); + error->all(FLERR,"Fix ave/correlate/long compute vector is accessed out-of-range"); } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); @@ -206,19 +203,16 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): if (argindex[i] && modify->fix[ifix]->vector_flag == 0) error->all(FLERR,"Fix ave/correlate/long fix does not calculate a vector"); if (argindex[i] && argindex[i] > modify->fix[ifix]->size_vector) - error->all(FLERR, - "Fix ave/correlate/long fix vector is accessed out-of-range"); + error->all(FLERR,"Fix ave/correlate/long fix vector is accessed out-of-range"); if (nevery % modify->fix[ifix]->global_freq) - error->all(FLERR,"Fix for fix ave/correlate/long " - "not computed at compatible time"); + error->all(FLERR,"Fix for fix ave/correlate/long not computed at compatible time"); } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/correlate/long does not exist"); if (input->variable->equalstyle(ivariable) == 0) - error->all(FLERR, - "Fix ave/correlate/long variable is not equal-style variable"); + error->all(FLERR,"Fix ave/correlate/long variable is not equal-style variable"); } } @@ -434,7 +428,7 @@ void FixAveCorrelateLong::end_of_step() scalar = compute->vector[argindex[i]-1]; } - // access fix fields, guaranteed to be ready + // access fix fields, guaranteed to be ready } else if (which[i] == ArgInfo::FIX) { if (argindex[i] == 0) @@ -442,7 +436,7 @@ void FixAveCorrelateLong::end_of_step() else scalar = modify->fix[m]->compute_vector(argindex[i]-1); - // evaluate equal-style variable + // evaluate equal-style variable } else if (which[i] == ArgInfo::VARIABLE) scalar = input->variable->compute_equal(m); @@ -465,13 +459,13 @@ void FixAveCorrelateLong::end_of_step() if (fp && me == 0) { if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,"# Timestep: " BIGINT_FORMAT "\n", ntimestep); + fmt::print(fp,"# Timestep: {}\n", ntimestep); for (unsigned int i=0;idt*nevery); for (int j=0;j #include #include -#include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "domain.h" -#include "angle.h" -#include "bond.h" -#include "math_const.h" -#include "update.h" -#include "modify.h" -#include "memory.h" -#include "error.h" -#include "force.h" -#include "respa.h" -#include "citeme.h" - using namespace LAMMPS_NS; using namespace MathConst; using namespace FixConst; @@ -359,64 +359,42 @@ void FixFilterCorotate::pre_neighbor() if (shake_flag[i] == 2) { atom1 = atom->map(shake_atom[i][0]); atom2 = atom->map(shake_atom[i][1]); - if (atom1 == -1 || atom2 == -1) { - char str[128]; - sprintf(str,"Cluster atoms " TAGINT_FORMAT " " TAGINT_FORMAT - " missing on proc %d at step " BIGINT_FORMAT, - shake_atom[i][0],shake_atom[i][1],me,update->ntimestep); - error->one(FLERR,str); - } + if (atom1 == -1 || atom2 == -1) + error->one(FLERR,"Cluster atoms {} {} missing on proc {} at step {}", + shake_atom[i][0],shake_atom[i][1],me,update->ntimestep); if (i <= atom1 && i <= atom2) list[nlist++] = i; + } else if (shake_flag[i] == 1 || shake_flag[i] == 3) { atom1 = atom->map(shake_atom[i][0]); atom2 = atom->map(shake_atom[i][1]); atom3 = atom->map(shake_atom[i][2]); - if (atom1 == -1 || atom2 == -1 || atom3 == -1) { - char str[128]; - sprintf(str,"Cluster atoms " - TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT - " missing on proc %d at step " BIGINT_FORMAT, - shake_atom[i][0],shake_atom[i][1],shake_atom[i][2], - me,update->ntimestep); - error->one(FLERR,str); - } + if (atom1 == -1 || atom2 == -1 || atom3 == -1) + error->one(FLERR,"Cluster atoms {} {} {} missing on proc {} at step {}", + shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],me,update->ntimestep); if (i <= atom1 && i <= atom2 && i <= atom3) list[nlist++] = i; + } else if (shake_flag[i] == 4) { atom1 = atom->map(shake_atom[i][0]); atom2 = atom->map(shake_atom[i][1]); atom3 = atom->map(shake_atom[i][2]); atom4 = atom->map(shake_atom[i][3]); - if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { - char str[128]; - sprintf(str,"Cluster atoms " - TAGINT_FORMAT " " TAGINT_FORMAT " " - TAGINT_FORMAT " " TAGINT_FORMAT - " missing on proc %d at step " BIGINT_FORMAT, - shake_atom[i][0],shake_atom[i][1], - shake_atom[i][2],shake_atom[i][3], - me,update->ntimestep); - error->one(FLERR,str); - } + if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) + error->one(FLERR,"Cluster atoms {} {} {} {} missing on proc {} at step {}", + shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],shake_atom[i][3], + me,update->ntimestep); if (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4) list[nlist++] = i; + } else if (shake_flag[i] == 5) { atom1 = atom->map(shake_atom[i][0]); atom2 = atom->map(shake_atom[i][1]); atom3 = atom->map(shake_atom[i][2]); atom4 = atom->map(shake_atom[i][3]); atom5 = atom->map(shake_atom[i][4]); - if (atom1 == -1 || atom2 == -1 || atom3 == -1 || - atom4 == -1 || atom5 == -1) { - char str[128]; - sprintf(str,"Cluster atoms " - TAGINT_FORMAT " " TAGINT_FORMAT " " - TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT - " missing on proc %d at step " BIGINT_FORMAT, - shake_atom[i][0],shake_atom[i][1], - shake_atom[i][2],shake_atom[i][3],shake_atom[i][4], - me,update->ntimestep); - error->one(FLERR,str); - } + if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1 || atom5 == -1) + error->one(FLERR,"Cluster atoms {} {} {} {} {} missing on proc {} at step {}", + shake_atom[i][0],shake_atom[i][1], shake_atom[i][2],shake_atom[i][3], + shake_atom[i][4],me,update->ntimestep); if (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4 && i <= atom5) list[nlist++] = i; } @@ -432,244 +410,244 @@ void FixFilterCorotate::pre_neighbor() int *type = atom->type; for (int i=0; imap(shake_atom[m][0]), - shake_atom[m][1],shake_atom[m][2],0); + m = list[i]; + N = shake_flag[m]; + + //switch cluster type 3 to angle cluster: + if (N == 3) + { + //make it an angle cluster: + if (shake_type[m][2] == 0) + shake_type[m][2] = angletype_findset(atom->map(shake_atom[m][0]), + shake_atom[m][1],shake_atom[m][2],0); + } + + if (N == 1) N = 3; //angle cluster + + if (N == 2) //cluster of size 2: + { + atom1 = atom->map(shake_atom[m][0]); + atom2 = atom->map(shake_atom[m][1]); + + r0 = bond_distance[shake_type[m][0]]; + + m1 = mass[type[atom1]]; + m2 = mass[type[atom2]]; + m_all = m1 + m2; + + double a1 = -m2/(m1+m2)*r0; + double a2 = m1/(m1+m2)*r0; + + clist_q0[i][0] = a1; + clist_q0[i][1] = 0; + clist_q0[i][2] = 0; + + clist_q0[i][3] = a2; + clist_q0[i][4] = 0; + clist_q0[i][5] = 0; + + clist_nselect1[i] = 1; + clist_select1[i][0] = 1; + + clist_nselect2[i] = 0; + clist_select2[i][0] = 0; + } else if (N == 3) //angle cluster + { + oxy = atom->map(shake_atom[m][0]); + atom1 = atom->map(shake_atom[m][1]); + atom2 = atom->map(shake_atom[m][2]); + + r0 = bond_distance[shake_type[m][0]]; + r1 = bond_distance[shake_type[m][1]]; + + + theta0 = angle_distance[shake_type[m][2]]; + + m1 = mass[type[oxy]]; + m2 = mass[type[atom1]]; + m3 = mass[type[atom2]]; + m_all = m1 + m2 + m3; + + double alpha1 = 0.5*(MY_PI - theta0); + + double xcenter = m2/m_all*r0*sin(alpha1) + m3/m_all*r1*sin(alpha1); + double ycenter = -m2/m_all*r0*cos(alpha1)+ m3/m_all*r1*cos(alpha1); + + double q1 = -xcenter; + double q2 = -ycenter; + + double q4 = r0*sin(alpha1)-xcenter; + double q5 = r0*cos(alpha1)-ycenter; + + double q7 = r1*sin(alpha1)-xcenter; + double q8 = -r1*cos(alpha1)-ycenter; + + clist_q0[i][0] = q1; + clist_q0[i][1] = q2; + clist_q0[i][2] = 0; + + clist_q0[i][3] = q4; + clist_q0[i][4] = q5; + clist_q0[i][5] = 0; + + clist_q0[i][6] = q7; + clist_q0[i][7] = q8; + clist_q0[i][8] = 0; + + clist_nselect1[i] = 2; + clist_select1[i][0] = 1; clist_select1[i][1] = 2; + clist_nselect2[i] = 1; + clist_select2[i][0] = 1; + } else if (N == 4) + { + oxy = atom->map(shake_atom[m][0]); + atom1 = atom->map(shake_atom[m][1]); + atom2 = atom->map(shake_atom[m][2]); + atom3 = atom->map(shake_atom[m][3]); + + r0 = bond_distance[shake_type[m][0]]; + r1 = bond_distance[shake_type[m][1]]; + r2 = bond_distance[shake_type[m][2]]; + + m1 = atom->mass[atom->type[oxy]]; + m2 = atom->mass[atom->type[atom1]]; + m3 = atom->mass[atom->type[atom2]]; + m4 = atom->mass[atom->type[atom3]]; + m_all = m1 + m2 + m3 + m4; + + //how to get these angles? + double alpha1 = MY_PI/2.57; //roughly 70 degrees + double alpha2 = MY_PI/3; + //ENSURE ycenter,zcenter = 0! + //approximate xcenter, if r0 !=r1 != r2, exact if r0 = r1 = r2 + double xcenter = (m2*r0+m3*r1+m4*r2)/m_all*cos(alpha1); + + clist_q0[i][0] = -xcenter; + clist_q0[i][1] = 0.0; + clist_q0[i][2] = 0.0; + clist_q0[i][3] = r0*cos(alpha1)-xcenter; + clist_q0[i][4] = -r0*sin(alpha1); + clist_q0[i][5] = 0.0; + clist_q0[i][6] = r1*cos(alpha1)-xcenter; + clist_q0[i][7] = r1*sin(alpha1)*cos(alpha2); + clist_q0[i][8] = -r1*sin(alpha1)*sin(alpha2); + clist_q0[i][9] = r2*cos(alpha1)-xcenter; + clist_q0[i][10] = r2*sin(alpha1)*cos(alpha2); + clist_q0[i][11] = r2*sin(alpha1)*sin(alpha2); + + clist_nselect1[i] = 3; + clist_nselect2[i] = 2; + + clist_select1[i][0] = 1;clist_select1[i][1] = 2;clist_select1[i][2] = 3; + clist_select2[i][0] = 2;clist_select2[i][1] = 3; + + //signum ensures correct ordering of three satellites + //signum = sign(cross(x2-x1,x3-x1))T*(x1-x0)) + double del1[3], del2[3], del3[3]; + del1[0] = x[atom1][0]-x[oxy][0]; + del1[1] = x[atom1][1]-x[oxy][1]; + del1[2] = x[atom1][2]-x[oxy][2]; + domain->minimum_image(del1); + + del2[0] = x[atom2][0]-x[atom1][0]; + del2[1] = x[atom2][1]-x[atom1][1]; + del2[2] = x[atom2][2]-x[atom1][2]; + domain->minimum_image(del2); + + del3[0] = x[atom3][0]-x[atom1][0]; + del3[1] = x[atom3][1]-x[atom1][1]; + del3[2] = x[atom3][2]-x[atom1][2]; + domain->minimum_image(del3); + + double a = (del2[1])*(del3[2]) - (del2[2])*(del3[1]); + double b = (del2[2])*(del3[0]) - (del2[0])*(del3[2]); + double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]); + int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2])); + + if (abs(signum) != 1) + error->all(FLERR,"Wrong orientation in cluster of size 4" + "in fix filter/corotate!"); + clist_q0[i][8] *= signum; + clist_q0[i][11] *= signum; + + } else if (N == 5) { + oxy = atom->map(shake_atom[m][0]); + atom1 = atom->map(shake_atom[m][1]); + atom2 = atom->map(shake_atom[m][2]); + atom3 = atom->map(shake_atom[m][3]); + int c1 = atom->map(shake_atom[m][4]); + + r1 = bond_distance[shake_type[m][3]]; + r0 = bond_distance[shake_type[m][0]]; + theta0 = angle_distance[shake_type[m][2]]; + + m1 = atom->mass[atom->type[oxy]]; + m2 = atom->mass[atom->type[atom1]]; + m3 = atom->mass[atom->type[atom2]]; + m4 = atom->mass[atom->type[atom3]]; + m5 = atom->mass[atom->type[c1]]; + m_all = m1 + m2 + m3 + m4 + m5; + + double alpha1 = MY_PI/2.57; //roughly 70 degrees + double alpha2 = MY_PI/3; + //ENSURE ycenter,zcenter = 0! + double xcenter = -(m2+m3+m4)/m_all*r0*cos(alpha1) +r1*m5/m_all; + + clist_q0[i][0] = -xcenter; + clist_q0[i][1] = 0.0; + clist_q0[i][2] = 0.0; + clist_q0[i][3] = -r0*cos(alpha1)-xcenter; + clist_q0[i][4] = -r0*sin(alpha1); + clist_q0[i][5] = 0.0; + clist_q0[i][6] = -r0*cos(alpha1)-xcenter; + clist_q0[i][7] = r0*sin(alpha1)*cos(alpha2); + clist_q0[i][8] = r0*sin(alpha1)*sin(alpha2); + clist_q0[i][9] = -r0*cos(alpha1)-xcenter; + clist_q0[i][10] = r0*sin(alpha1)*cos(alpha2); + clist_q0[i][11] = -r0*sin(alpha1)*sin(alpha2); + clist_q0[i][12] = r1-xcenter; + clist_q0[i][13] = 0.0; + clist_q0[i][14] = 0.0; + clist_nselect1[i] = 1; + clist_nselect2[i] = 2; + + clist_select1[i][0] = 4; + clist_select2[i][0] = 2;clist_select2[i][1] = 3; + + //signum ensures correct ordering of three satellites + //signum = sign(cross(x2-x1,x3-x1))T*(x1-x0)) + double del1[3], del2[3], del3[3]; + del1[0] = x[atom1][0]-x[oxy][0]; + del1[1] = x[atom1][1]-x[oxy][1]; + del1[2] = x[atom1][2]-x[oxy][2]; + domain->minimum_image(del1); + + del2[0] = x[atom2][0]-x[atom1][0]; + del2[1] = x[atom2][1]-x[atom1][1]; + del2[2] = x[atom2][2]-x[atom1][2]; + domain->minimum_image(del2); + + del3[0] = x[atom3][0]-x[atom1][0]; + del3[1] = x[atom3][1]-x[atom1][1]; + del3[2] = x[atom3][2]-x[atom1][2]; + domain->minimum_image(del3); + + double a = (del2[1])*(del3[2]) - (del2[2])*(del3[1]); + double b = (del2[2])*(del3[0]) - (del2[0])*(del3[2]); + double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]); + int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2])); + + if (abs(signum)!= 1) + error->all(FLERR,"Wrong orientation in cluster of size 5" + "in fix filter/corotate!"); + clist_q0[i][8] *= signum; + clist_q0[i][11] *= signum; + } else { + error->all(FLERR,"Fix filter/corotate cluster with size > 5" + "not yet configured..."); + } } - - if (N == 1) N = 3; //angle cluster - - if (N == 2) //cluster of size 2: - { - atom1 = atom->map(shake_atom[m][0]); - atom2 = atom->map(shake_atom[m][1]); - - r0 = bond_distance[shake_type[m][0]]; - - m1 = mass[type[atom1]]; - m2 = mass[type[atom2]]; - m_all = m1 + m2; - - double a1 = -m2/(m1+m2)*r0; - double a2 = m1/(m1+m2)*r0; - - clist_q0[i][0] = a1; - clist_q0[i][1] = 0; - clist_q0[i][2] = 0; - - clist_q0[i][3] = a2; - clist_q0[i][4] = 0; - clist_q0[i][5] = 0; - - clist_nselect1[i] = 1; - clist_select1[i][0] = 1; - - clist_nselect2[i] = 0; - clist_select2[i][0] = 0; - } else if (N == 3) //angle cluster - { - oxy = atom->map(shake_atom[m][0]); - atom1 = atom->map(shake_atom[m][1]); - atom2 = atom->map(shake_atom[m][2]); - - r0 = bond_distance[shake_type[m][0]]; - r1 = bond_distance[shake_type[m][1]]; - - - theta0 = angle_distance[shake_type[m][2]]; - - m1 = mass[type[oxy]]; - m2 = mass[type[atom1]]; - m3 = mass[type[atom2]]; - m_all = m1 + m2 + m3; - - double alpha1 = 0.5*(MY_PI - theta0); - - double xcenter = m2/m_all*r0*sin(alpha1) + m3/m_all*r1*sin(alpha1); - double ycenter = -m2/m_all*r0*cos(alpha1)+ m3/m_all*r1*cos(alpha1); - - double q1 = -xcenter; - double q2 = -ycenter; - - double q4 = r0*sin(alpha1)-xcenter; - double q5 = r0*cos(alpha1)-ycenter; - - double q7 = r1*sin(alpha1)-xcenter; - double q8 = -r1*cos(alpha1)-ycenter; - - clist_q0[i][0] = q1; - clist_q0[i][1] = q2; - clist_q0[i][2] = 0; - - clist_q0[i][3] = q4; - clist_q0[i][4] = q5; - clist_q0[i][5] = 0; - - clist_q0[i][6] = q7; - clist_q0[i][7] = q8; - clist_q0[i][8] = 0; - - clist_nselect1[i] = 2; - clist_select1[i][0] = 1; clist_select1[i][1] = 2; - clist_nselect2[i] = 1; - clist_select2[i][0] = 1; - } else if (N == 4) - { - oxy = atom->map(shake_atom[m][0]); - atom1 = atom->map(shake_atom[m][1]); - atom2 = atom->map(shake_atom[m][2]); - atom3 = atom->map(shake_atom[m][3]); - - r0 = bond_distance[shake_type[m][0]]; - r1 = bond_distance[shake_type[m][1]]; - r2 = bond_distance[shake_type[m][2]]; - - m1 = atom->mass[atom->type[oxy]]; - m2 = atom->mass[atom->type[atom1]]; - m3 = atom->mass[atom->type[atom2]]; - m4 = atom->mass[atom->type[atom3]]; - m_all = m1 + m2 + m3 + m4; - - //how to get these angles? - double alpha1 = MY_PI/2.57; //roughly 70 degrees - double alpha2 = MY_PI/3; - //ENSURE ycenter,zcenter = 0! - //approximate xcenter, if r0 !=r1 != r2, exact if r0 = r1 = r2 - double xcenter = (m2*r0+m3*r1+m4*r2)/m_all*cos(alpha1); - - clist_q0[i][0] = -xcenter; - clist_q0[i][1] = 0.0; - clist_q0[i][2] = 0.0; - clist_q0[i][3] = r0*cos(alpha1)-xcenter; - clist_q0[i][4] = -r0*sin(alpha1); - clist_q0[i][5] = 0.0; - clist_q0[i][6] = r1*cos(alpha1)-xcenter; - clist_q0[i][7] = r1*sin(alpha1)*cos(alpha2); - clist_q0[i][8] = -r1*sin(alpha1)*sin(alpha2); - clist_q0[i][9] = r2*cos(alpha1)-xcenter; - clist_q0[i][10] = r2*sin(alpha1)*cos(alpha2); - clist_q0[i][11] = r2*sin(alpha1)*sin(alpha2); - - clist_nselect1[i] = 3; - clist_nselect2[i] = 2; - - clist_select1[i][0] = 1;clist_select1[i][1] = 2;clist_select1[i][2] = 3; - clist_select2[i][0] = 2;clist_select2[i][1] = 3; - - //signum ensures correct ordering of three satellites - //signum = sign(cross(x2-x1,x3-x1))T*(x1-x0)) - double del1[3], del2[3], del3[3]; - del1[0] = x[atom1][0]-x[oxy][0]; - del1[1] = x[atom1][1]-x[oxy][1]; - del1[2] = x[atom1][2]-x[oxy][2]; - domain->minimum_image(del1); - - del2[0] = x[atom2][0]-x[atom1][0]; - del2[1] = x[atom2][1]-x[atom1][1]; - del2[2] = x[atom2][2]-x[atom1][2]; - domain->minimum_image(del2); - - del3[0] = x[atom3][0]-x[atom1][0]; - del3[1] = x[atom3][1]-x[atom1][1]; - del3[2] = x[atom3][2]-x[atom1][2]; - domain->minimum_image(del3); - - double a = (del2[1])*(del3[2]) - (del2[2])*(del3[1]); - double b = (del2[2])*(del3[0]) - (del2[0])*(del3[2]); - double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]); - int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2])); - - if (abs(signum) != 1) - error->all(FLERR,"Wrong orientation in cluster of size 4" - "in fix filter/corotate!"); - clist_q0[i][8] *= signum; - clist_q0[i][11] *= signum; - - } else if (N == 5) { - oxy = atom->map(shake_atom[m][0]); - atom1 = atom->map(shake_atom[m][1]); - atom2 = atom->map(shake_atom[m][2]); - atom3 = atom->map(shake_atom[m][3]); - int c1 = atom->map(shake_atom[m][4]); - - r1 = bond_distance[shake_type[m][3]]; - r0 = bond_distance[shake_type[m][0]]; - theta0 = angle_distance[shake_type[m][2]]; - - m1 = atom->mass[atom->type[oxy]]; - m2 = atom->mass[atom->type[atom1]]; - m3 = atom->mass[atom->type[atom2]]; - m4 = atom->mass[atom->type[atom3]]; - m5 = atom->mass[atom->type[c1]]; - m_all = m1 + m2 + m3 + m4 + m5; - - double alpha1 = MY_PI/2.57; //roughly 70 degrees - double alpha2 = MY_PI/3; - //ENSURE ycenter,zcenter = 0! - double xcenter = -(m2+m3+m4)/m_all*r0*cos(alpha1) +r1*m5/m_all; - - clist_q0[i][0] = -xcenter; - clist_q0[i][1] = 0.0; - clist_q0[i][2] = 0.0; - clist_q0[i][3] = -r0*cos(alpha1)-xcenter; - clist_q0[i][4] = -r0*sin(alpha1); - clist_q0[i][5] = 0.0; - clist_q0[i][6] = -r0*cos(alpha1)-xcenter; - clist_q0[i][7] = r0*sin(alpha1)*cos(alpha2); - clist_q0[i][8] = r0*sin(alpha1)*sin(alpha2); - clist_q0[i][9] = -r0*cos(alpha1)-xcenter; - clist_q0[i][10] = r0*sin(alpha1)*cos(alpha2); - clist_q0[i][11] = -r0*sin(alpha1)*sin(alpha2); - clist_q0[i][12] = r1-xcenter; - clist_q0[i][13] = 0.0; - clist_q0[i][14] = 0.0; - clist_nselect1[i] = 1; - clist_nselect2[i] = 2; - - clist_select1[i][0] = 4; - clist_select2[i][0] = 2;clist_select2[i][1] = 3; - - //signum ensures correct ordering of three satellites - //signum = sign(cross(x2-x1,x3-x1))T*(x1-x0)) - double del1[3], del2[3], del3[3]; - del1[0] = x[atom1][0]-x[oxy][0]; - del1[1] = x[atom1][1]-x[oxy][1]; - del1[2] = x[atom1][2]-x[oxy][2]; - domain->minimum_image(del1); - - del2[0] = x[atom2][0]-x[atom1][0]; - del2[1] = x[atom2][1]-x[atom1][1]; - del2[2] = x[atom2][2]-x[atom1][2]; - domain->minimum_image(del2); - - del3[0] = x[atom3][0]-x[atom1][0]; - del3[1] = x[atom3][1]-x[atom1][1]; - del3[2] = x[atom3][2]-x[atom1][2]; - domain->minimum_image(del3); - - double a = (del2[1])*(del3[2]) - (del2[2])*(del3[1]); - double b = (del2[2])*(del3[0]) - (del2[0])*(del3[2]); - double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]); - int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2])); - - if (abs(signum)!= 1) - error->all(FLERR,"Wrong orientation in cluster of size 5" - "in fix filter/corotate!"); - clist_q0[i][8] *= signum; - clist_q0[i][11] *= signum; - } else { - error->all(FLERR,"Fix filter/corotate cluster with size > 5" - "not yet configured..."); - } - } } /* ---------------------------------------------------------------------- diff --git a/src/INTEL/verlet_lrt_intel.cpp b/src/INTEL/verlet_lrt_intel.cpp index f867ad73e6..0fd2aa354d 100644 --- a/src/INTEL/verlet_lrt_intel.cpp +++ b/src/INTEL/verlet_lrt_intel.cpp @@ -94,10 +94,10 @@ void VerletLRTIntel::setup(int flag) } #endif - if (comm->me == 0 && screen) { + if (comm->me == 0) { fprintf(screen,"Setting up VerletLRTIntel run ...\n"); fprintf(screen," Unit style : %s\n", update->unit_style); - fprintf(screen," Current step : " BIGINT_FORMAT "\n", update->ntimestep); + fmt::print(screen," Current step : {}\n", update->ntimestep); fprintf(screen," Time step : %g\n", update->dt); timer->print_timeout(screen); } @@ -109,11 +109,8 @@ void VerletLRTIntel::setup(int flag) sched_getaffinity(0, sizeof(cpuset), &cpuset); int my_cpu_count = CPU_COUNT(&cpuset); if (my_cpu_count < comm->nthreads + 1) { - char str[128]; - sprintf(str,"Using %d threads per MPI rank, but only %d core(s)" - " allocated for each MPI rank", - comm->nthreads + 1, my_cpu_count); - error->warning(FLERR, str); + error->warning(FLERR, "Using {} threads per MPI rank, but only {} core(s) allocated " + "for each MPI rank", comm->nthreads + 1, my_cpu_count); } } #endif From 28976b8c92a961f87f2ee21761f7c00aeea74b80 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 31 Mar 2022 08:44:43 -0400 Subject: [PATCH 066/130] recover compilation on windows with old MPICH version --- src/MPIIO/dump_cfg_mpiio.cpp | 2 +- src/MPIIO/dump_xyz_mpiio.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MPIIO/dump_cfg_mpiio.cpp b/src/MPIIO/dump_cfg_mpiio.cpp index 4f601eb865..7f2048861c 100644 --- a/src/MPIIO/dump_cfg_mpiio.cpp +++ b/src/MPIIO/dump_cfg_mpiio.cpp @@ -295,7 +295,7 @@ void DumpCFGMPIIO::write_header(bigint n) headerSize = header.size(); } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,header.c_str(),header.size(),MPI_CHAR,MPI_STATUS_IGNORE); + MPI_File_write_at(mpifh,mpifo,(void *)header.c_str(),header.size(),MPI_CHAR,MPI_STATUS_IGNORE); mpifo += header.size(); } } diff --git a/src/MPIIO/dump_xyz_mpiio.cpp b/src/MPIIO/dump_xyz_mpiio.cpp index e829ff7a30..5d4e2b5c21 100644 --- a/src/MPIIO/dump_xyz_mpiio.cpp +++ b/src/MPIIO/dump_xyz_mpiio.cpp @@ -245,7 +245,7 @@ void DumpXYZMPIIO::write_header(bigint n) headerSize = header.size(); } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,header.c_str(),header.size(),MPI_CHAR,MPI_STATUS_IGNORE); + MPI_File_write_at(mpifh,mpifo,(void *)header.c_str(),header.size(),MPI_CHAR,MPI_STATUS_IGNORE); mpifo += header.size(); } } From df05bbb72bef41c770cb3f27b28db67f47eebd8c Mon Sep 17 00:00:00 2001 From: Matt Bettencourt Date: Thu, 31 Mar 2022 17:20:56 +0200 Subject: [PATCH 067/130] moved dpd_tstat to kokkos --- src/KOKKOS/Install.sh | 4 +- src/KOKKOS/pair_dpd_kokkos.h | 4 +- src/KOKKOS/pair_dpd_tstat_kokkos.cpp | 452 +++++++++++++++++++++++++++ src/KOKKOS/pair_dpd_tstat_kokkos.h | 126 ++++++++ 4 files changed, 583 insertions(+), 3 deletions(-) create mode 100644 src/KOKKOS/pair_dpd_tstat_kokkos.cpp create mode 100644 src/KOKKOS/pair_dpd_tstat_kokkos.h diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index 8c4a3ea9ae..33b4a24f6f 100755 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -230,10 +230,12 @@ action pair_coul_long_kokkos.cpp pair_coul_long.cpp action pair_coul_long_kokkos.h pair_coul_long.h action pair_coul_wolf_kokkos.cpp action pair_coul_wolf_kokkos.h -action pair_dpd_ext_kokkos.cpp pair_dpd_ext.cpp action pair_dpd_kokkos.h pair_dpd.h action pair_dpd_kokkos.cpp pair_dpd.cpp +action pair_dpd_ext_kokkos.cpp pair_dpd_ext.cpp action pair_dpd_ext_kokkos.h pair_dpd_ext.h +action pair_dpd_tstat_kokkos.h pair_dpd_tstat.h +action pair_dpd_tstat_kokkos.cpp pair_dpd_tstat.cpp action pair_dpd_fdt_energy_kokkos.cpp pair_dpd_fdt_energy.cpp action pair_dpd_fdt_energy_kokkos.h pair_dpd_fdt_energy.h action pair_eam_kokkos.cpp pair_eam.cpp diff --git a/src/KOKKOS/pair_dpd_kokkos.h b/src/KOKKOS/pair_dpd_kokkos.h index da2558a6fb..0db0ae4144 100644 --- a/src/KOKKOS/pair_dpd_kokkos.h +++ b/src/KOKKOS/pair_dpd_kokkos.h @@ -78,7 +78,7 @@ class PairDPDKokkos : public PairDPD { void ev_tally(EV_FLOAT &ev, const int &i, const int &j, const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; - private: + protected: double special_lj[4]; int eflag,vflag; @@ -116,7 +116,7 @@ class PairDPDKokkos : public PairDPD { typename AT::t_efloat_1d d_eatom; typename AT::t_virial_array d_vatom; - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION int sbmask(const int& j) const; friend void pair_virial_fdotr_compute(PairDPDKokkos*); diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp new file mode 100644 index 0000000000..b96a2a4d56 --- /dev/null +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp @@ -0,0 +1,452 @@ +// clang-format off +/* ---------------------------------------------------------------------- + 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: Matt Bettencourt (NVIDIA) +------------------------------------------------------------------------- */ + +#include "pair_dpd_tstat_kokkos.h" + +#include "atom.h" +#include "atom_kokkos.h" +#include "memory_kokkos.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "random_mars.h" +#include "update.h" +#include "atom_masks.h" +#include "kokkos.h" + +#include + +using namespace LAMMPS_NS; + +#define EPSILON 1.0e-10 + + +template +PairDPDTstatKokkos::PairDPDTstatKokkos(class LAMMPS *lmp) : + PairDPDTstat(lmp) , +#ifdef DPD_USE_RAN_MARS + rand_pool(0 /* unused */, lmp) +#else + rand_pool() +#endif +{ + kokkosable = 1; + atomKK = (AtomKokkos *) atom; + execution_space = ExecutionSpaceFromDevice::space; + + datamask_read = X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; +} + +/* ---------------------------------------------------------------------- */ + +template +PairDPDTstatKokkos::~PairDPDTstatKokkos() { + if (copymode) return; + +#ifdef DPD_USE_RAN_MARS + rand_pool.destroy(); +#endif + + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + + memoryKK->destroy_kokkos(k_cutsq,cutsq); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDTstatKokkos::init_style() +{ + PairDPD::init_style(); + +#ifdef DPD_USE_RAN_MARS + rand_pool.init(random,seed); +#else + typedef Kokkos::Experimental::UniqueToken< + DeviceType, Kokkos::Experimental::UniqueTokenScope::Global> unique_token_type; + unique_token_type unique_token; + rand_pool.init(seed + comm->me,unique_token.size()); +#endif + + neighflag = lmp->kokkos->neighflag; + + if (force->newton_pair == 0 || neighflag == FULL ) + error->all(FLERR,"Must use half neighbor list style and newton on with pair dpd/kk"); + + auto request = neighbor->find_request(this); + request->set_kokkos_host(std::is_same::value && + !std::is_same::value); + request->set_kokkos_device(std::is_same::value); + + if (neighflag == FULL) + request->enable_full(); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDTstatKokkos::compute(int eflagin, int vflagin) +{ + eflag = eflagin; vflag = vflagin; + if (neighflag == FULL) no_virial_fdotr_compute = 1; + + ev_init(eflag,vflag); + + // adjust sigma if target T is changing + if (t_start != t_stop) { + double delta = update->ntimestep - update->beginstep; + if (delta != 0.0) delta /= update->endstep - update->beginstep; + temperature = t_start + delta * (t_stop-t_start); + double boltz = force->boltz; + for (int i = 1; i <= atom->ntypes; i++) + for (int j = i; j <= atom->ntypes; j++) + k_params.h_view(j,i).sigma = k_params.h_view(j,i).sigma = + sqrt(2.0*boltz*temperature*gamma[i][j]); + } + k_params.template modify(); + + if (eflag_atom) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + d_eatom = k_eatom.template view(); + } + if (vflag_atom) { + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"pair:vatom"); + d_vatom = k_vatom.template view(); + } + + atomKK->sync(execution_space,X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK); + + x = atomKK->k_x.view(); + v = atomKK->k_v.view(); + f = atomKK->k_f.view(); + type = atomKK->k_type.view(); + + k_cutsq.template sync(); + k_params.template sync(); + + special_lj[0] = force->special_lj[0]; + special_lj[1] = force->special_lj[1]; + special_lj[2] = force->special_lj[2]; + special_lj[3] = force->special_lj[3]; + + nlocal = atom->nlocal; + newton_pair = force->newton_pair; + dtinvsqrt = 1.0/sqrt(update->dt); + + NeighListKokkos* k_list = static_cast*>(list); + d_numneigh = k_list->d_numneigh; + d_neighbors = k_list->d_neighbors; + d_ilist = k_list->d_ilist; + + // loop over neighbors of my atoms + + int inum = list->inum; + EV_FLOAT ev; + copymode = 1; + if (neighflag == HALF) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } else if (neighflag == HALFTHREAD) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } else if (neighflag == FULL) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } + + if (eflag_global) eng_vdwl += ev.evdwl; + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (vflag_fdotr) pair_virial_fdotr_compute(this); + + if (eflag_atom) { + k_eatom.template modify(); + k_eatom.template sync(); + } + + if (vflag_atom) { + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; + + if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); + else atomKK->modified(execution_space,F_MASK); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos, const int &ii) const { + EV_FLOAT ev; + this->template operator()(TagDPDTstatKokkos(), ii, ev); +} +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos, const int &ii, EV_FLOAT &ev) const { + + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_f = f; + + int i,j,jj,jnum,itype,jtype; + double xtmp,ytmp,ztmp,delx,dely,delz,fpair; + double vxtmp,vytmp,vztmp,delvx,delvy,delvz; + double rsq,r,rinv,dot,wd,randnum,factor_dpd; + double fx = 0,fy = 0,fz = 0; + i = d_ilist[ii]; + xtmp = x(i,0); + ytmp = x(i,1); + ztmp = x(i,2); + vxtmp = v(i,0); + vytmp = v(i,1); + vztmp = v(i,2); + itype = type(i); + jnum = d_numneigh[i]; + rand_type rand_gen = rand_pool.get_state(); + for (jj = 0; jj < jnum; jj++) { + j = d_neighbors(i,jj); + factor_dpd = special_lj[sbmask(j)]; + j &= NEIGHMASK; + + delx = xtmp - x(j,0); + dely = ytmp - x(j,1); + delz = ztmp - x(j,2); + rsq = delx*delx + dely*dely + delz*delz; + jtype = type(j); + if (rsq < d_cutsq(itype,jtype)) { + r = sqrt(rsq); + if (r < EPSILON) continue; // r can be 0.0 in DPD systems + rinv = 1.0/r; + delvx = vxtmp - v(j,0); + delvy = vytmp - v(j,1); + delvz = vztmp - v(j,2); + dot = delx*delvx + dely*delvy + delz*delvz; + + wd = 1.0 - r/params(itype,jtype).cut; + + randnum = rand_gen.normal(); + + + // drag force - parallel + fpair = -params(itype,jtype).gamma*wd*wd*dot*rinv; + + // random force - parallel + fpair += params(itype,jtype).sigma*wd*randnum*dtinvsqrt; + fpair *= factor_dpd*rinv; + + fx += fpair*delx; + fy += fpair*dely; + fz += fpair*delz; + + if ((neighflag==HALF || neighflag==HALFTHREAD) && (NEWTON_PAIR || j < nlocal) ) { + a_f(j,0) -= fpair*delx; + a_f(j,1) -= fpair*dely; + a_f(j,2) -= fpair*delz; + } + + if (EVFLAG) + this->template ev_tally(ev,i,j,0.0,fpair,delx,dely,delz); + } + } + a_f(i,0) += fx; + a_f(i,1) += fy; + a_f(i,2) += fz; + rand_pool.free_state(rand_gen); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDTstatKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const +{ + const int EFLAG = eflag; + const int VFLAG = vflag_either; + + // The eatom and vatom arrays are atomic for Half/Thread neighbor style + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_eatom = k_eatom.view(); + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_vatom = k_vatom.view(); + + if (EFLAG) { + if (eflag_atom) { + const E_FLOAT epairhalf = 0.5 * epair; + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) a_eatom[i] += epairhalf; + if (NEWTON_PAIR || j < nlocal) a_eatom[j] += epairhalf; + } else { + a_eatom[i] += epairhalf; + } + } + } + + if (VFLAG) { + const E_FLOAT v0 = delx*delx*fpair; + const E_FLOAT v1 = dely*dely*fpair; + const E_FLOAT v2 = delz*delz*fpair; + const E_FLOAT v3 = delx*dely*fpair; + const E_FLOAT v4 = delx*delz*fpair; + const E_FLOAT v5 = dely*delz*fpair; + + if (vflag_global) { + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + if (NEWTON_PAIR || j < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + } else { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + } + + if (vflag_atom) { + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + } + if (NEWTON_PAIR || j < nlocal) { + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; + } + } else { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDTstatKokkos::allocate() +{ + PairDPD::allocate(); + int n = atom->ntypes; + + memory->destroy(cutsq); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + d_cutsq = k_cutsq.template view(); + + k_params = Kokkos::DualView("PairDPD::params",n+1,n+1); + params = k_params.template view(); +} + +/* ---------------------------------------------------------------------- */ + +template +KOKKOS_INLINE_FUNCTION +int PairDPDTstatKokkos::sbmask(const int& j) const { + return j >> SBBITS & 3; +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +template +double PairDPDTstatKokkos::init_one(int i, int j) +{ + double cutone = PairDPD::init_one(i,j); + + k_params.h_view(i,j).cut = cut[i][j]; + k_params.h_view(i,j).a0 = a0[i][j]; + k_params.h_view(i,j).gamma = gamma[i][j]; + k_params.h_view(i,j).sigma = sigma[i][j]; + k_params.h_view(j,i) = k_params.h_view(i,j); + + k_params.template modify(); + + k_cutsq.h_view(i,j) = cutone*cutone; + k_cutsq.h_view(j,i) = k_cutsq.h_view(i,j); + k_cutsq.template modify(); + + return cutone; +} + +namespace LAMMPS_NS { +template class PairDPDTstatKokkos; +#ifdef LMP_KOKKOS_GPU +template class PairDPDTstatKokkos; +#endif +} diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.h b/src/KOKKOS/pair_dpd_tstat_kokkos.h new file mode 100644 index 0000000000..0e9c12ce9d --- /dev/null +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.h @@ -0,0 +1,126 @@ +/* -*- 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(dpd/tstat/kk,PairDPDTstatKokkos); +PairStyle(dpd/tstat/kk/device,PairDPDTstatKokkos); +PairStyle(dpd/tstat/kk/host,PairDPDTstatKokkos); +// clang-format on +#else + +#ifndef LMP_PAIR_DPD_TSTAT_KOKKOS_H +#define LMP_PAIR_DPD_TSTAT_KOKKOS_H + +#include "pair_dpd_tstat.h" +#include "pair_kokkos.h" +#include "kokkos_type.h" + +#if !defined(DPD_USE_RAN_MARS) && !defined(DPD_USE_Random_XorShift64) && !defined(Random_XorShift1024) +#define DPD_USE_Random_XorShift64 +#endif + +#ifdef DPD_USE_RAN_MARS +#include "rand_pool_wrap_kokkos.h" +#else +#include "Kokkos_Random.hpp" +#endif + +namespace LAMMPS_NS { + +template +class PairDPDTstatKokkos : public PairDPDTstat { + public: + typedef DeviceType device_type; + typedef ArrayTypes AT; + typedef EV_FLOAT value_type; + + PairDPDTstatKokkos(class LAMMPS*); + ~PairDPDTstatKokkos() override; + + void allocate() override; + + void init_style() override; + double init_one(int i, int j) override; + void compute(int, int) override; + + struct params_dpd { + KOKKOS_INLINE_FUNCTION + params_dpd() {cut=a0=gamma=sigma=0;} + KOKKOS_INLINE_FUNCTION + params_dpd(int /*i*/) {cut=a0=gamma=sigma=0;} + F_FLOAT cutsq,cut,a0,gamma,sigma; + }; + + template + struct TagDPDTstatKokkos{}; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDTstatKokkos, const int &i) const; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDTstatKokkos, const int &i, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void ev_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const; + protected: + + double special_lj[4]; + int eflag,vflag; + int neighflag, nlocal,newton_pair; + double dtinvsqrt; + +#ifdef DPD_USE_RAN_MARS + RandPoolWrap rand_pool; + typedef RandWrap rand_type; +#elif defined(DPD_USE_Random_XorShift64) + Kokkos::Random_XorShift64_Pool rand_pool; + typedef typename Kokkos::Random_XorShift64_Pool::generator_type rand_type; +#elif defined(DPD_USE_Random_XorShift1024) + Kokkos::Random_XorShift1024_Pool rand_pool; + typedef typename Kokkos::Random_XorShift1024_Pool::generator_type rand_type; +#endif + typename AT::t_x_array_randomread x; + typename AT::t_x_array_randomread v; + typename AT::t_f_array f; + typename AT::t_int_1d_randomread type; + + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d_randomread d_ilist; + typename AT::t_int_1d_randomread d_numneigh; + + typename AT::tdual_ffloat_2d k_cutsq; + typename AT::t_ffloat_2d d_cutsq; + + Kokkos::DualView k_params; + typename Kokkos::DualView::t_dev_const_um params; + + DAT::tdual_efloat_1d k_eatom; + DAT::tdual_virial_array k_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; + + KOKKOS_FUNCTION + int sbmask(const int& j) const; + friend void pair_virial_fdotr_compute(PairDPDTstatKokkos*); + +}; +} +#endif +#endif From 229f0af5371fa4d7d3759e3254bccc18cb91a8a7 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 31 Mar 2022 12:09:05 -0600 Subject: [PATCH 068/130] enable LAMMPS as driver to use plugin engine --- examples/mdi/README | 12 ++++ examples/mdi/in.aimd.driver.plugin | 34 +++++++++ src/MDI/fix_mdi_aimd.cpp | 8 +-- src/MDI/fix_mdi_aimd.h | 8 +-- src/MDI/mdi_engine.cpp | 2 + src/MDI/mdi_plugin.cpp | 109 +++++++++++++++++++++++++++++ src/MDI/mdi_plugin.h | 53 ++++++++++++++ 7 files changed, 218 insertions(+), 8 deletions(-) create mode 100644 examples/mdi/in.aimd.driver.plugin create mode 100644 src/MDI/mdi_plugin.cpp create mode 100644 src/MDI/mdi_plugin.h diff --git a/examples/mdi/README b/examples/mdi/README index 4be15c77fc..dedf388a3b 100644 --- a/examples/mdi/README +++ b/examples/mdi/README @@ -67,6 +67,18 @@ Run with MPI: 3 procs + 4 procs % mpirun -np 3 lmp_mpi -mdi "-name aimd -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 4 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine +--- + +Run in plugin mode: 1 proc + +% lmp_mpi -mdi "-name aimd -role DRIVER -method LINK -plugin_path /home/sjplimp/lammps/git/src" -log log.aimd.driver.plugin -in in.aimd.driver.plugin + +--- + +Run in plugin mode: 3 procs + +% mpirun -np 3 lmp_mpi -mdi "-name aimd -role DRIVER -method LINK -plugin_path /home/sjplimp/lammps/git/src" -log log.aimd.driver.plugin -in in.aimd.driver.plugin + ------------------------------------------------- ------------------------------------------------- diff --git a/examples/mdi/in.aimd.driver.plugin b/examples/mdi/in.aimd.driver.plugin new file mode 100644 index 0000000000..655fd3c134 --- /dev/null +++ b/examples/mdi/in.aimd.driver.plugin @@ -0,0 +1,34 @@ +# 3d Lennard-Jones melt - MDI driver script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +region box block 0 $x 0 $y 0 $z +create_box 1 box +create_atoms 1 box +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +# NVE +fix 1 all nve +# NPT +#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0 + +fix 2 all mdi/aimd +fix_modify 2 energy yes virial yes + +thermo_style custom step temp pe etotal press vol +thermo 1 + +mdi/plugin lammps & + args '-mdi "-role ENGINE -name lammps -method LINK"' & + command "run 5" diff --git a/src/MDI/fix_mdi_aimd.cpp b/src/MDI/fix_mdi_aimd.cpp index d90ab2ec5b..e3f86fa58f 100644 --- a/src/MDI/fix_mdi_aimd.cpp +++ b/src/MDI/fix_mdi_aimd.cpp @@ -69,8 +69,8 @@ FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : // connect to MDI engine - MDI_Accept_communicator(&mdicomm); - if (mdicomm <= 0) error->all(FLERR, "Unable to connect to MDI engine"); + // MDI_Accept_communicator(&mdicomm); + // if (mdicomm <= 0) error->all(FLERR, "Unable to connect to MDI engine"); nprocs = comm->nprocs; } @@ -81,8 +81,8 @@ FixMDIAimd::~FixMDIAimd() { // send exit command to engine - int ierr = MDI_Send_command("EXIT",mdicomm); - if (ierr) error->all(FLERR,"MDI: EXIT command"); + //int ierr = MDI_Send_command("EXIT",mdicomm); + //if (ierr) error->all(FLERR,"MDI: EXIT command"); // clean up diff --git a/src/MDI/fix_mdi_aimd.h b/src/MDI/fix_mdi_aimd.h index 4cf2b536b0..0d891bd47b 100644 --- a/src/MDI/fix_mdi_aimd.h +++ b/src/MDI/fix_mdi_aimd.h @@ -27,6 +27,10 @@ namespace LAMMPS_NS { class FixMDIAimd : public Fix { public: + // MDI communicator, public so that LAMMPS can work with a plugin + + MDI_Comm mdicomm; + FixMDIAimd(class LAMMPS *, int, char **); ~FixMDIAimd(); int setmask(); @@ -44,10 +48,6 @@ class FixMDIAimd : public Fix { double engine_energy; int lmpunits; - // MDI communicator - - MDI_Comm mdicomm; - // unit conversion factors double lmp2mdi_length,mdi2lmp_length; diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index a90e8175d3..c9188baa61 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -534,6 +534,8 @@ void MDIEngine::mdi_commands() // node at POST_FORCE location in timestep // only used if fix MDI/ENGINE is instantiated + // two register callbacks allow LAMMPS to interact more easily + // with drivers which don't know LAMMPS control flow MDI_Register_node("@FORCES"); MDI_Register_callback("@FORCES",">FORCES"); diff --git a/src/MDI/mdi_plugin.cpp b/src/MDI/mdi_plugin.cpp new file mode 100644 index 0000000000..77b4b200ad --- /dev/null +++ b/src/MDI/mdi_plugin.cpp @@ -0,0 +1,109 @@ +/* ---------------------------------------------------------------------- + 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: Taylor Barnes (MolSSI) + MolSSI Driver Interface (MDI) support for LAMMPS +------------------------------------------------------------------------- */ + +#include "mdi_plugin.h" + +#include "error.h" +#include "fix_mdi_aimd.h" +#include "input.h" +#include "modify.h" + +#include + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- + mdi command: plugin + may later have other MDI command variants +---------------------------------------------------------------------- */ + +void MDIPlugin::command(int narg, char **arg) +{ + if (narg < 1) error->all(FLERR,"Illegal mdi/plugin command"); + + char *plugin_name = arg[0]; + char *plugin_args = nullptr; + plugin_command = nullptr; + + printf("NARG %d\n",narg); + + int iarg = 1; + while (iarg < narg) { + if (strcmp(arg[iarg],"args") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal mdi/plugin command"); + plugin_args = arg[iarg+1]; + iarg += 2; + } else if (strcmp(arg[iarg],"command") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal mdi/plugin command"); + plugin_command = arg[iarg+1]; + iarg += 2; + } else error->all(FLERR,"Illegal mdi/plugin command"); + } + + // error if no command was specified + + if (!plugin_command) error->all(FLERR,"MDI/plugin must specify command"); + + // find FixMDIAimd instance so can reset its mdicomm + + fixptr = modify->get_fix_by_style("mdi/aimd")[0]; + + // launch the MDI plugin library + // path for lib was specified in -mdi command-line arg when LAMMPS started + // this calls back to plugin_wrapper, which must issue MDI EXIT at end + + printf("PRE-LAUNCH\n"); + printf("NAME %s\n",plugin_name); + printf("ARGS %s\n",plugin_args); + + MDI_Launch_plugin(plugin_name,plugin_args,world,plugin_wrapper,(void *)this); +} + +/* ---------------------------------------------------------------------- + callback function from MDI_Launch_plugin() + this function must wrap entire interaction of LAMMPS as a driver + with the plugin +---------------------------------------------------------------------- */ + +int MDIPlugin::plugin_wrapper(void *pmpicomm, MDI_Comm mdicomm, + void *ptr) +{ + printf("INSIDE CALLBACK\n"); + + MPI_Comm mpicomm = *(MPI_Comm *) pmpicomm; + MDIPlugin *thisptr = (MDIPlugin *) ptr; + LAMMPS *lammps = thisptr->lmp; + + // set FixMDIAimd mdicomm to this mdicomm + + FixMDIAimd *aimdptr = (FixMDIAimd *) (thisptr->fixptr); + aimdptr->mdicomm = mdicomm; + + // invoke the specified LAMMPS command + // that operation will issue MDI commands to the plugin engine + + printf("PRE RUN command\n"); + + lammps->input->one(thisptr->plugin_command); + + // send MDI exit to plugin, which unloads the plugin + + MDI_Send_command("EXIT",mdicomm); + + return 0; +} diff --git a/src/MDI/mdi_plugin.h b/src/MDI/mdi_plugin.h new file mode 100644 index 0000000000..37cf042d31 --- /dev/null +++ b/src/MDI/mdi_plugin.h @@ -0,0 +1,53 @@ +/* -*- 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 COMMAND_CLASS +// clang-format off +CommandStyle(mdi/plugin,MDIPlugin); +// clang-format on +#else + +#ifndef LMP_MDI_PLUGIN_H +#define LMP_MDI_PLUGIN_H + +#include "command.h" +#include "mdi.h" + +namespace LAMMPS_NS { + +class MDIPlugin : public Command { + public: + MDIPlugin(LAMMPS *lmp) : Command(lmp) {} + void command(int, char **) override; + + private: + char *plugin_command; + class Fix *fixptr; + + static int plugin_wrapper(void *, MDI_Comm, void *); +}; + +} + +#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. + +*/ From 19a6eecfbb078d1268c161314053012200a04452 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 31 Mar 2022 14:41:38 -0600 Subject: [PATCH 069/130] more debugging for plugin engine mode --- examples/mdi/sequence_driver.py | 2 +- src/MDI/mdi_engine.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/mdi/sequence_driver.py b/examples/mdi/sequence_driver.py index c7527cb6d4..66b9bc9aff 100644 --- a/examples/mdi/sequence_driver.py +++ b/examples/mdi/sequence_driver.py @@ -307,7 +307,7 @@ if not plugin: # MDI will call back to perform_tasks() if plugin: - error("Cannot yet run in plugin mode") + #error("Cannot yet run in plugin mode") mdi.MDI_Init(mdiarg) world = MPI.COMM_WORLD plugin_args += " -mdi \"-role ENGINE -name lammps -method LINK\"" diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index c9188baa61..1244e72dc0 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -32,6 +32,7 @@ #include "integrate.h" #include "irregular.h" #include "library.h" +#include "library_mdi.h" #include "memory.h" #include "min.h" #include "modify.h" @@ -164,6 +165,11 @@ void MDIEngine::mdi_engine(int narg, char **arg) mdi_commands(); + // register the execute_command function with MDI + // only used when engine runs in plugin mode + + MDI_Set_execute_command_func(lammps_execute_mdi_command,this); + // one-time operation to establish a connection with the driver MDI_Accept_communicator(&mdicomm); From e3611c5d73ffe7886f4578d633a5886a7114924f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 31 Mar 2022 17:02:11 -0400 Subject: [PATCH 070/130] add support for custom keywords with thermo output --- doc/src/thermo_modify.rst | 38 +++++++++++++++++----- src/thermo.cpp | 66 +++++++++++++++++++++++++++++++++------ src/thermo.h | 4 ++- 3 files changed, 91 insertions(+), 17 deletions(-) diff --git a/doc/src/thermo_modify.rst b/doc/src/thermo_modify.rst index e209dd937b..2258255d01 100644 --- a/doc/src/thermo_modify.rst +++ b/doc/src/thermo_modify.rst @@ -21,9 +21,14 @@ Syntax *norm* value = *yes* or *no* *flush* value = *yes* or *no* *line* value = *one* or *multi* or *yaml* - *format* values = *line* string, *int* string, *float* string, M string, or *none* + *header* values = ID string, or *default* + string = new header name + ID = integer from 1 to N, or integer from -N to -1, where N = # of quantities being output + *or* a thermo keyword or reference to compute, fix, property or variable. + *format* values = *line* string, *int* string, *float* string, ID string, or *none* string = C-style format string - M = integer from 1 to N, where N = # of quantities being output + ID = integer from 1 to N, or integer from -N to -1, where N = # of quantities being output + *or* a thermo keyword or reference to compute, fix, property or variable. *temp* value = compute ID that calculates a temperature *press* value = compute ID that calculates a pressure @@ -36,7 +41,8 @@ Examples thermo_modify temp myTemp format 3 %15.8g thermo_modify temp myTemp format line "%ld %g %g %15.8g" thermo_modify line multi format float %g - themos_modify line yaml format none + thermo_modify line yaml format none + thermo_modify header 1 Timestep header -2 Pressure header f_1[1] AvgDensity Description """"""""""" @@ -147,6 +153,20 @@ containing the timestep and CPU time ("multi"), or in a YAML format block ("yaml"). This modify option overrides the *one*, *multi*, or *yaml* thermo_style settings. +The *header* keyword can be used to change the default header keyword +for a column or field of thermodynamic output. The setting for +*ID string* replaces the default keyword with the provided string. +*ID* can be a positive integer - then it represents the column number +counting from the left -, a negative integer - then it represents the +column number from the right (i.e. -1 is the last column/keyword), +or a thermo keyword (or compute, fix, property, or variable reference) +- then it replaces the string for that specific keyword -. + +The *header* keyword can be used multiple times. If multiple *header* +settings refer to the same keyword, the last setting has precedence. +the default setting is used. A setting of *default* clears all previous +settings, reverting all values to their default format. + The *format* keyword can be used to change the default numeric format of any of quantities the :doc:`thermo_style ` command outputs. All the specified format strings are C-style formats, e.g. as @@ -155,12 +175,16 @@ argument which is the format string for the entire line of thermo output, with N fields, which you must enclose in quotes if it is more than one field. The *int* and *float* keywords take a single format argument and are applied to all integer or floating-point quantities -output. The setting for *M string* also takes a single format argument -which is used for the Mth value output in each line, e.g. the fifth -column is output in high precision for "format 5 %20.15g". +output. The setting for *ID string* also takes a single format argument +which is used for the indexed value in each line. The interpretation is +the same as for *header*, i.e. a positive integer is the n-th value corresponding +to the n-th thermo keyword, a negative integer is counting backwards and +a string matches the entry with the thermo keyword., e.g. the fifth +column is output in high precision for "format 5 %20.15g" and the +pair energy for "format epair %20.15g". The *format* keyword can be used multiple times. The precedence is -that for each value in a line of output, the *M* format (if specified) +that for each value in a line of output, the *ID* format (if specified) is used, else the *int* or *float* setting (if specified) is used, else the *line* setting (if specified) for that value is used, else the default setting is used. A setting of *none* clears all previous diff --git a/src/thermo.cpp b/src/thermo.cpp index e1534f11bd..b5e6d6ba54 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -252,8 +252,12 @@ void Thermo::init() format[i] += format_this + " "; else if (lineflag == YAMLLINE) format[i] += format_this + ", "; - else - format[i] += fmt::format("{:<8} = {} ", keyword[i], format_this); + else { + if (keyword_user[i].size()) + format[i] += fmt::format("{:<8} = {} ", keyword_user[i], format_this); + else + format[i] += fmt::format("{:<8} = {} ", keyword[i], format_this); + } } // chop off trailing blank or add closing bracket if needed and then add newline @@ -324,11 +328,13 @@ void Thermo::header() std::string hdr; if (lineflag == YAMLLINE) hdr = "---\nkeywords: ["; for (int i = 0; i < nfield; i++) { + auto head = keyword[i]; + if (keyword_user[i].size()) head = keyword_user[i]; if (lineflag == ONELINE) { if (vtype[i] == FLOAT) - hdr += fmt::format("{:^14} ", keyword[i]); + hdr += fmt::format("{:^14} ", head); else if ((vtype[i] == INT) || (vtype[i] == BIGINT)) - hdr += fmt::format("{:^11} ", keyword[i]); + hdr += fmt::format("{:^11} ", head); } else if (lineflag == YAMLLINE) { hdr += keyword[i]; hdr += ", "; @@ -622,6 +628,30 @@ void Thermo::modify_params(int narg, char **arg) error->all(FLERR, "Illegal thermo_modify command"); iarg += 2; + } else if (strcmp(arg[iarg], "header") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (strcmp(arg[iarg + 1], "default") == 0) { + for (int i=0; i < nfield_initial + 1; ++i) + keyword_user[i].clear(); + iarg += 2; + } else { + if (iarg + 3 > narg) error->all(FLERR, "Illegal thermo_modify command"); + int icol = -1; + if (utils::is_integer(arg[iarg + 1])) { + icol = utils::inumeric(FLERR,arg[iarg + 1],false,lmp); + if (icol < 0) icol = nfield_initial + icol + 1; + icol--; + } else { + try { + icol = key2col.at(arg[iarg + 1]); + } catch (std::out_of_range &) { + icol = -1; + } + } + if ((icol < 0) || (icol >= nfield_initial)) error->all(FLERR, "Illegal thermo_modify command"); + keyword_user[icol] = arg[iarg+2]; + iarg += 3; + } } else if (strcmp(arg[iarg], "format") == 0) { if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); @@ -646,14 +676,24 @@ void Thermo::modify_params(int narg, char **arg) found = format_int_user.find('d', found); if (found == std::string::npos) error->all(FLERR, "Thermo_modify int format does not contain a d conversion character"); - format_bigint_user = - format_int_user.replace(found, 1, std::string(BIGINT_FORMAT).substr(1)); + format_bigint_user = format_int_user.replace(found, 1, std::string(BIGINT_FORMAT).substr(1)); } else if (strcmp(arg[iarg + 1], "float") == 0) { format_float_user = arg[iarg + 2]; } else { - int i = utils::inumeric(FLERR, arg[iarg + 1], false, lmp) - 1; - if (i < 0 || i >= nfield_initial + 1) error->all(FLERR, "Illegal thermo_modify command"); - format_column_user[i] = arg[iarg + 2]; + int icol = -1; + if (utils::is_integer(arg[iarg + 1])) { + icol = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); + if (icol < 0) icol = nfield_initial + icol + 1; + icol--; + } else { + try { + icol = key2col.at(arg[iarg + 1]); + } catch (std::out_of_range &) { + icol = -1; + } + } + if (icol < 0 || icol >= nfield_initial + 1) error->all(FLERR, "Illegal thermo_modify command"); + format_column_user[icol] = arg[iarg + 2]; } iarg += 3; @@ -675,10 +715,12 @@ void Thermo::allocate() keyword.resize(n); format.resize(n); format_column_user.resize(n); + keyword_user.resize(n); for (int i = 0; i < n; i++) { keyword[i].clear(); format[i].clear(); format_column_user[i].clear(); + keyword_user[i].clear(); } vfunc = new FnPtr[n]; @@ -702,6 +744,12 @@ void Thermo::allocate() nvariable = 0; id_variable = new char *[n]; variables = new int[n]; + + int i = 0; + key2col.clear(); + for (auto item : utils::split_words(line)) { + key2col[item] = i++; + } } /* ---------------------------------------------------------------------- diff --git a/src/thermo.h b/src/thermo.h index b0a2309312..9d0fefbc56 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -15,6 +15,7 @@ #define LMP_THERMO_H #include "pointers.h" +#include namespace LAMMPS_NS { @@ -47,8 +48,9 @@ class Thermo : protected Pointers { int nfield, nfield_initial; int *vtype; std::string line; - std::vector keyword, format, format_column_user; + 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; int normvalue; // use this for normflag unless natoms = 0 int normuserflag; // 0 if user has not set, 1 if has From 4437f16e08b489e81d6bf6701d73e18ef80de3e4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 31 Mar 2022 17:49:24 -0400 Subject: [PATCH 071/130] remove references to non-existing folders --- bench/README | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bench/README b/bench/README index 7d5aced119..99a0484355 100644 --- a/bench/README +++ b/bench/README @@ -4,10 +4,8 @@ This directory contains 5 benchmark problems which are discussed in the Benchmark section of the LAMMPS documentation, and on the Benchmark page of the LAMMPS WWW site (https://www.lammps.org/bench.html). -This directory also has several sub-directories: +This directory also has one sub-directories: -FERMI benchmark scripts for desktop machine with Fermi GPUs (Tesla) -KEPLER benchmark scripts for GPU cluster with Kepler GPUs POTENTIALS benchmarks scripts for various potentials in LAMMPS The results for all of these benchmarks are displayed and discussed on From 4042a52db1cc31a5434e3a89a29a1fad9f766321 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 31 Mar 2022 21:58:35 -0400 Subject: [PATCH 072/130] rename header keyword to colname --- doc/src/thermo_modify.rst | 43 ++++++++++++++++++++------------------- src/thermo.cpp | 2 +- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/doc/src/thermo_modify.rst b/doc/src/thermo_modify.rst index 2258255d01..9a5e739c0e 100644 --- a/doc/src/thermo_modify.rst +++ b/doc/src/thermo_modify.rst @@ -21,13 +21,13 @@ Syntax *norm* value = *yes* or *no* *flush* value = *yes* or *no* *line* value = *one* or *multi* or *yaml* - *header* values = ID string, or *default* - string = new header name - ID = integer from 1 to N, or integer from -N to -1, where N = # of quantities being output + *colname* values = ID string, or *default* + string = new column header name + ID = integer from 1 to N, or integer from -1 to -N, where N = # of quantities being output *or* a thermo keyword or reference to compute, fix, property or variable. *format* values = *line* string, *int* string, *float* string, ID string, or *none* string = C-style format string - ID = integer from 1 to N, or integer from -N to -1, where N = # of quantities being output + ID = integer from 1 to N, or integer from -1 to -N, where N = # of quantities being output *or* a thermo keyword or reference to compute, fix, property or variable. *temp* value = compute ID that calculates a temperature *press* value = compute ID that calculates a pressure @@ -42,7 +42,7 @@ Examples thermo_modify temp myTemp format line "%ld %g %g %15.8g" thermo_modify line multi format float %g thermo_modify line yaml format none - thermo_modify header 1 Timestep header -2 Pressure header f_1[1] AvgDensity + thermo_modify colname 1 Timestep colname -2 Pressure colname f_1[1] AvgDensity Description """"""""""" @@ -153,16 +153,16 @@ containing the timestep and CPU time ("multi"), or in a YAML format block ("yaml"). This modify option overrides the *one*, *multi*, or *yaml* thermo_style settings. -The *header* keyword can be used to change the default header keyword -for a column or field of thermodynamic output. The setting for -*ID string* replaces the default keyword with the provided string. -*ID* can be a positive integer - then it represents the column number -counting from the left -, a negative integer - then it represents the -column number from the right (i.e. -1 is the last column/keyword), -or a thermo keyword (or compute, fix, property, or variable reference) -- then it replaces the string for that specific keyword -. +The *colname* keyword can be used to change the default header keyword +for a column or field of thermodynamic output. The setting for *ID +string* replaces the default text with the provided string. *ID* can be +a positive integer when it represents the column number counting from +the left, a negative integer when then it represents the column number +from the right (i.e. -1 is the last column/keyword), or a thermo keyword +(or compute, fix, property, or variable reference) and then it replaces +the string for that specific thermo keyword. -The *header* keyword can be used multiple times. If multiple *header* +The *colname* keyword can be used multiple times. If multiple *colname* settings refer to the same keyword, the last setting has precedence. the default setting is used. A setting of *default* clears all previous settings, reverting all values to their default format. @@ -177,11 +177,11 @@ than one field. The *int* and *float* keywords take a single format argument and are applied to all integer or floating-point quantities output. The setting for *ID string* also takes a single format argument which is used for the indexed value in each line. The interpretation is -the same as for *header*, i.e. a positive integer is the n-th value corresponding -to the n-th thermo keyword, a negative integer is counting backwards and -a string matches the entry with the thermo keyword., e.g. the fifth -column is output in high precision for "format 5 %20.15g" and the -pair energy for "format epair %20.15g". +the same as for *colname*, i.e. a positive integer is the n-th value +corresponding to the n-th thermo keyword, a negative integer is counting +backwards, and a string matches the entry with the thermo keyword., +e.g. the fifth column is output in high precision for "format 5 %20.15g" +and the pair energy for "format epair %20.15g". The *format* keyword can be used multiple times. The precedence is that for each value in a line of output, the *ID* format (if specified) @@ -197,9 +197,10 @@ settings, reverting all values to their default format. When specifying the *format int* option you can use a "%d"-style format identifier in the format string and LAMMPS will convert this to the corresponding 8-byte form when it is applied to those - keywords. However, when specifying the *line* option or *format M + keywords. However, when specifying the *line* option or *format ID string* option for *step* and *natoms*, you should specify a format - string appropriate for an 8-byte signed integer, e.g. one with "%ld". + string appropriate for an 8-byte signed integer, e.g. one with "%ld" + or "%lld" depending on the platform. The *temp* keyword is used to determine how thermodynamic temperature is calculated, which is used by all thermo quantities that require a diff --git a/src/thermo.cpp b/src/thermo.cpp index b5e6d6ba54..fe6f92d85d 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -628,7 +628,7 @@ void Thermo::modify_params(int narg, char **arg) error->all(FLERR, "Illegal thermo_modify command"); iarg += 2; - } else if (strcmp(arg[iarg], "header") == 0) { + } else if (strcmp(arg[iarg], "colname") == 0) { if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); if (strcmp(arg[iarg + 1], "default") == 0) { for (int i=0; i < nfield_initial + 1; ++i) From c470c204d47e303e32918620a435ddb4f5ba9ebb Mon Sep 17 00:00:00 2001 From: Matt Bettencourt Date: Fri, 1 Apr 2022 10:35:05 +0200 Subject: [PATCH 073/130] remved unused var --- src/KOKKOS/pair_dpd_tstat_kokkos.cpp | 1 - src/KOKKOS/pair_dpd_tstat_kokkos.h | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp index b96a2a4d56..dc364c8b3d 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp @@ -430,7 +430,6 @@ double PairDPDTstatKokkos::init_one(int i, int j) double cutone = PairDPD::init_one(i,j); k_params.h_view(i,j).cut = cut[i][j]; - k_params.h_view(i,j).a0 = a0[i][j]; k_params.h_view(i,j).gamma = gamma[i][j]; k_params.h_view(i,j).sigma = sigma[i][j]; k_params.h_view(j,i) = k_params.h_view(i,j); diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.h b/src/KOKKOS/pair_dpd_tstat_kokkos.h index 0e9c12ce9d..b71bfd4d8d 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.h +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.h @@ -56,10 +56,10 @@ class PairDPDTstatKokkos : public PairDPDTstat { struct params_dpd { KOKKOS_INLINE_FUNCTION - params_dpd() {cut=a0=gamma=sigma=0;} + params_dpd() {cut=gamma=sigma=0;} KOKKOS_INLINE_FUNCTION - params_dpd(int /*i*/) {cut=a0=gamma=sigma=0;} - F_FLOAT cutsq,cut,a0,gamma,sigma; + params_dpd(int /*i*/) {cut=gamma=sigma=0;} + F_FLOAT cutsq,cut,gamma,sigma; }; template @@ -79,7 +79,6 @@ class PairDPDTstatKokkos : public PairDPDTstat { const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; protected: - double special_lj[4]; int eflag,vflag; int neighflag, nlocal,newton_pair; From 9c0934e82cb3487d4e420abdcf0f95946888a766 Mon Sep 17 00:00:00 2001 From: Matt Bettencourt Date: Fri, 1 Apr 2022 10:35:34 +0200 Subject: [PATCH 074/130] Have ext-tstat working --- src/KOKKOS/Install.sh | 2 + src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp | 498 +++++++++++++++++++++++ src/KOKKOS/pair_dpd_ext_tstat_kokkos.h | 125 ++++++ 3 files changed, 625 insertions(+) create mode 100644 src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp create mode 100644 src/KOKKOS/pair_dpd_ext_tstat_kokkos.h diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index 33b4a24f6f..65ac13c061 100755 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -234,6 +234,8 @@ action pair_dpd_kokkos.h pair_dpd.h action pair_dpd_kokkos.cpp pair_dpd.cpp action pair_dpd_ext_kokkos.cpp pair_dpd_ext.cpp action pair_dpd_ext_kokkos.h pair_dpd_ext.h +action pair_dpd_ext_tstat_kokkos.h pair_dpd_ext_tstat.h +action pair_dpd_ext_tstat_kokkos.cpp pair_dpd_ext_tstat.cpp action pair_dpd_tstat_kokkos.h pair_dpd_tstat.h action pair_dpd_tstat_kokkos.cpp pair_dpd_tstat.cpp action pair_dpd_fdt_energy_kokkos.cpp pair_dpd_fdt_energy.cpp diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp new file mode 100644 index 0000000000..8b794f8571 --- /dev/null +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp @@ -0,0 +1,498 @@ +// clang-format off +/* ---------------------------------------------------------------------- + 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: Matt Bettencourt (NVIDIA) +------------------------------------------------------------------------- */ + +#include "pair_dpd_ext_tstat_kokkos.h" + +#include "atom.h" +#include "atom_kokkos.h" +#include "memory_kokkos.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "random_mars.h" +#include "update.h" +#include "atom_masks.h" +#include "kokkos.h" + +#include + +using namespace LAMMPS_NS; + +#define EPSILON 1.0e-10 + + +template +PairDPDExtTstatKokkos::PairDPDExtTstatKokkos(class LAMMPS *lmp) : + PairDPDExtTstat(lmp) , +#ifdef DPD_USE_RAN_MARS + rand_pool(0 /* unused */, lmp) +#else + rand_pool() +#endif +{ + kokkosable = 1; + atomKK = (AtomKokkos *) atom; + execution_space = ExecutionSpaceFromDevice::space; + + datamask_read = X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; +} + +/* ---------------------------------------------------------------------- */ + +template +PairDPDExtTstatKokkos::~PairDPDExtTstatKokkos() { + if (copymode) return; + +#ifdef DPD_USE_RAN_MARS + rand_pool.destroy(); +#endif + + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + + memoryKK->destroy_kokkos(k_cutsq,cutsq); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtTstatKokkos::init_style() +{ + PairDPDExt::init_style(); + +#ifdef DPD_USE_RAN_MARS + rand_pool.init(random,seed); +#else + typedef Kokkos::Experimental::UniqueToken< + DeviceType, Kokkos::Experimental::UniqueTokenScope::Global> unique_token_type; + unique_token_type unique_token; + rand_pool.init(seed + comm->me,unique_token.size()); +#endif + + neighflag = lmp->kokkos->neighflag; + + if (force->newton_pair == 0 || neighflag == FULL ) + error->all(FLERR,"Must use half neighbor list style and newton on with pair dpd/ext/kk"); + + auto request = neighbor->find_request(this); + request->set_kokkos_host(std::is_same::value && + !std::is_same::value); + request->set_kokkos_device(std::is_same::value); + + if (neighflag == FULL) + request->enable_full(); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) +{ + eflag = eflagin; vflag = vflagin; + if (neighflag == FULL) no_virial_fdotr_compute = 1; + + ev_init(eflag,vflag); + + // adjust sigma if target T is changing + if (t_start != t_stop) { + double delta = update->ntimestep - update->beginstep; + if (delta != 0.0) delta /= update->endstep - update->beginstep; + temperature = t_start + delta * (t_stop-t_start); + double boltz = force->boltz; + for (int i = 1; i <= atom->ntypes; i++) + for (int j = i; j <= atom->ntypes; j++) { + std::cout << k_params.h_view(j,i).sigma <<" "; + k_params.h_view(j,i).sigma = k_params.h_view(j,i).sigma = + sqrt(2.0*boltz*temperature*gamma[i][j]); + std::cout << k_params.h_view(j,i).sigma <<"\n"; + } + } + k_params.template modify(); + + if (eflag_atom) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + d_eatom = k_eatom.template view(); + } + if (vflag_atom) { + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"pair:vatom"); + d_vatom = k_vatom.template view(); + } + + atomKK->sync(execution_space,X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK); + + x = atomKK->k_x.view(); + v = atomKK->k_v.view(); + f = atomKK->k_f.view(); + type = atomKK->k_type.view(); + + k_cutsq.template sync(); + k_params.template sync(); + + special_lj[0] = force->special_lj[0]; + special_lj[1] = force->special_lj[1]; + special_lj[2] = force->special_lj[2]; + special_lj[3] = force->special_lj[3]; + + nlocal = atom->nlocal; + newton_pair = force->newton_pair; + dtinvsqrt = 1.0/sqrt(update->dt); + + NeighListKokkos* k_list = static_cast*>(list); + d_numneigh = k_list->d_numneigh; + d_neighbors = k_list->d_neighbors; + d_ilist = k_list->d_ilist; + + // loop over neighbors of my atoms + + int inum = list->inum; + EV_FLOAT ev; + copymode = 1; + if (neighflag == HALF) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } else if (neighflag == HALFTHREAD) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } else if (neighflag == FULL) { + if (newton_pair) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + } + + if (eflag_global) eng_vdwl += ev.evdwl; + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (vflag_fdotr) pair_virial_fdotr_compute(this); + + if (eflag_atom) { + k_eatom.template modify(); + k_eatom.template sync(); + } + + if (vflag_atom) { + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; + + if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); + else atomKK->modified(execution_space,F_MASK); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos, const int &ii) const { + EV_FLOAT ev; + this->template operator()(TagDPDExtTstatKokkos(), ii, ev); +} +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos, const int &ii, EV_FLOAT &ev) const { + + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_f = f; + + int i,j,jj,jnum,itype,jtype; + double xtmp,ytmp,ztmp,delx,dely,delz,fpairx,fpairy,fpairz,fpair; + double vxtmp,vytmp,vztmp,delvx,delvy,delvz; + double rsq,r,rinv,dot,wd,wdPar,wdPerp,randnum,randnumx,randnumy,randnumz,factor_dpd; + double fx = 0,fy = 0,fz = 0; + + i = d_ilist[ii]; + xtmp = x(i,0); + ytmp = x(i,1); + ztmp = x(i,2); + vxtmp = v(i,0); + vytmp = v(i,1); + vztmp = v(i,2); + itype = type(i); + jnum = d_numneigh[i]; + rand_type rand_gen = rand_pool.get_state(); + for (jj = 0; jj < jnum; jj++) { + double P[3][3]; + j = d_neighbors(i,jj); + factor_dpd = special_lj[sbmask(j)]; + j &= NEIGHMASK; + + delx = xtmp - x(j,0); + dely = ytmp - x(j,1); + delz = ztmp - x(j,2); + rsq = delx*delx + dely*dely + delz*delz; + jtype = type(j); + if (rsq < d_cutsq(itype,jtype)) { + r = sqrt(rsq); + if (r < EPSILON) continue; // r can be 0.0 in DPD systems + rinv = 1.0/r; + delvx = vxtmp - v(j,0); + delvy = vytmp - v(j,1); + delvz = vztmp - v(j,2); + dot = delx*delvx + dely*delvy + delz*delvz; + + P[0][0] = 1.0 - delx*delx*rinv*rinv; + P[0][1] = - delx*dely*rinv*rinv; + P[0][2] = - delx*delz*rinv*rinv; + + P[1][0] = P[0][1]; + P[1][1] = 1.0 - dely*dely*rinv*rinv; + P[1][2] = - dely*delz*rinv*rinv; + + P[2][0] = P[0][2]; + P[2][1] = P[1][2]; + P[2][2] = 1.0 - delz*delz*rinv*rinv; + + wd = 1.0 - r/params(itype,jtype).cut; + wdPar = pow(wd,params(itype,jtype).ws); + wdPerp = pow(wd,params(itype,jtype).wsT); + + randnum = 0.1;//rand_gen.normal(); + randnumx = 0.1;//rand_gen.normal(); + randnumy = 0.1;//rand_gen.normal(); + randnumz = 0.1;//rand_gen.normal(); + + // drag force - parallel + fpair = -params(itype,jtype).gamma*wdPar*wdPar*dot*rinv; + + // random force - parallel + fpair += params(itype,jtype).sigma*wdPar*randnum*dtinvsqrt; + + fpairx = fpair*rinv*delx; + fpairy = fpair*rinv*dely; + fpairz = fpair*rinv*delz; + + // drag force - perpendicular + fpairx -= params(itype,jtype).gammaT*wdPerp*wdPerp* + (P[0][0]*delvx + P[0][1]*delvy + P[0][2]*delvz); + fpairy -= params(itype,jtype).gammaT*wdPerp*wdPerp* + (P[1][0]*delvx + P[1][1]*delvy + P[1][2]*delvz); + fpairz -= params(itype,jtype).gammaT*wdPerp*wdPerp* + (P[2][0]*delvx + P[2][1]*delvy + P[2][2]*delvz); + + // random force - perpendicular + fpairx += params(itype,jtype).sigmaT*wdPerp* + (P[0][0]*randnumx + P[0][1]*randnumy + P[0][2]*randnumz)*dtinvsqrt; + fpairy += params(itype,jtype).sigmaT*wdPerp* + (P[1][0]*randnumx + P[1][1]*randnumy + P[1][2]*randnumz)*dtinvsqrt; + fpairz += params(itype,jtype).sigmaT*wdPerp* + (P[2][0]*randnumx + P[2][1]*randnumy + P[2][2]*randnumz)*dtinvsqrt; + + fpairx *= factor_dpd; + fpairy *= factor_dpd; + fpairz *= factor_dpd; + + fx += fpairx; + fy += fpairy; + fz += fpairz; + if ((neighflag==HALF || neighflag==HALFTHREAD) && (NEWTON_PAIR || j < nlocal) ) { + a_f(j,0) -= fpairx; + a_f(j,1) -= fpairy; + a_f(j,2) -= fpairz; + } + + if (EVFLAG) + this->template ev_tally(ev,i,j,0.0,fpair,delx,dely,delz); + } + } + a_f(i,0) += fx; + a_f(i,1) += fy; + a_f(i,2) += fz; + rand_pool.free_state(rand_gen); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtTstatKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const +{ + const int EFLAG = eflag; + const int VFLAG = vflag_either; + + // The eatom and vatom arrays are atomic for Half/Thread neighbor style + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_eatom = k_eatom.view(); + Kokkos::View::value,Kokkos::MemoryTraits::value> > a_vatom = k_vatom.view(); + + if (EFLAG) { + if (eflag_atom) { + const E_FLOAT epairhalf = 0.5 * epair; + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) a_eatom[i] += epairhalf; + if (NEWTON_PAIR || j < nlocal) a_eatom[j] += epairhalf; + } else { + a_eatom[i] += epairhalf; + } + } + } + + if (VFLAG) { + const E_FLOAT v0 = delx*delx*fpair; + const E_FLOAT v1 = dely*dely*fpair; + const E_FLOAT v2 = delz*delz*fpair; + const E_FLOAT v3 = delx*dely*fpair; + const E_FLOAT v4 = delx*delz*fpair; + const E_FLOAT v5 = dely*delz*fpair; + + if (vflag_global) { + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + if (NEWTON_PAIR || j < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + } else { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } + } + + if (vflag_atom) { + if (NEIGHFLAG!=FULL) { + if (NEWTON_PAIR || i < nlocal) { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + } + if (NEWTON_PAIR || j < nlocal) { + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; + } + } else { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtTstatKokkos::allocate() +{ + PairDPDExt::allocate(); + int n = atom->ntypes; + + memory->destroy(cutsq); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + d_cutsq = k_cutsq.template view(); + + k_params = Kokkos::DualView("PairDPDExt::params",n+1,n+1); + params = k_params.template view(); +} + +/* ---------------------------------------------------------------------- */ + +template +KOKKOS_INLINE_FUNCTION +int PairDPDExtTstatKokkos::sbmask(const int& j) const { + return j >> SBBITS & 3; +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +template +double PairDPDExtTstatKokkos::init_one(int i, int j) +{ + double cutone = PairDPDExt::init_one(i,j); + + k_params.h_view(i,j).cut = cut[i][j]; + k_params.h_view(i,j).ws = ws[i][j]; + k_params.h_view(i,j).wsT = wsT[i][j]; + k_params.h_view(i,j).gamma = gamma[i][j]; + k_params.h_view(i,j).sigma = sigma[i][j]; + k_params.h_view(i,j).gammaT = gammaT[i][j]; + k_params.h_view(i,j).sigmaT = sigmaT[i][j]; + k_params.h_view(j,i) = k_params.h_view(i,j); + + k_params.template modify(); + + k_cutsq.h_view(i,j) = cutone*cutone; + k_cutsq.h_view(j,i) = k_cutsq.h_view(i,j); + k_cutsq.template modify(); + + return cutone; +} + +namespace LAMMPS_NS { +template class PairDPDExtTstatKokkos; +#ifdef LMP_KOKKOS_GPU +template class PairDPDExtTstatKokkos; +#endif +} diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h new file mode 100644 index 0000000000..2c03bd2ec4 --- /dev/null +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h @@ -0,0 +1,125 @@ +/* -*- 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(dpd/ext/tstat/kk,PairDPDExtTstatKokkos); +PairStyle(dpd/ext/tstat/kk/device,PairDPDExtTstatKokkos); +PairStyle(dpd/ext/tstat/kk/host,PairDPDExtTstatKokkos); +// clang-format on +#else + +#ifndef LMP_PAIR_DPD_EXT_TSTAT_KOKKOS_H +#define LMP_PAIR_DPD_EXT_TSTAT_KOKKOS_H + +#include "pair_dpd_ext_tstat.h" +#include "pair_kokkos.h" +#include "kokkos_type.h" + +#if !defined(DPD_USE_RAN_MARS) && !defined(DPD_USE_Random_XorShift64) && !defined(Random_XorShift1024) +#define DPD_USE_Random_XorShift64 +#endif + +#ifdef DPD_USE_RAN_MARS +#include "rand_pool_wrap_kokkos.h" +#else +#include "Kokkos_Random.hpp" +#endif + +namespace LAMMPS_NS { + +template +class PairDPDExtTstatKokkos : public PairDPDExtTstat { + public: + typedef DeviceType device_type; + typedef ArrayTypes AT; + typedef EV_FLOAT value_type; + + PairDPDExtTstatKokkos(class LAMMPS*); + ~PairDPDExtTstatKokkos() override; + + void allocate() override; + + void init_style() override; + double init_one(int i, int j) override; + void compute(int, int) override; + + struct params_dpd { + KOKKOS_INLINE_FUNCTION + params_dpd() {cut=ws=wsT=gamma=sigma=gammaT=sigmaT=0;} + KOKKOS_INLINE_FUNCTION + params_dpd(int /*i*/) {cut=ws=wsT=gamma=sigma=gammaT=sigmaT=0;} + F_FLOAT cutsq,cut,ws,wsT,gamma,sigma,gammaT,sigmaT; + }; + + template + struct TagDPDExtTstatKokkos{}; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDExtTstatKokkos, const int &i) const; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDExtTstatKokkos, const int &i, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void ev_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const; + private: + double special_lj[4]; + int eflag,vflag; + int neighflag, nlocal,newton_pair; + double dtinvsqrt; + +#ifdef DPD_USE_RAN_MARS + RandPoolWrap rand_pool; + typedef RandWrap rand_type; +#elif defined(DPD_USE_Random_XorShift64) + Kokkos::Random_XorShift64_Pool rand_pool; + typedef typename Kokkos::Random_XorShift64_Pool::generator_type rand_type; +#elif defined(DPD_USE_Random_XorShift1024) + Kokkos::Random_XorShift1024_Pool rand_pool; + typedef typename Kokkos::Random_XorShift1024_Pool::generator_type rand_type; +#endif + typename AT::t_x_array_randomread x; + typename AT::t_x_array_randomread v; + typename AT::t_f_array f; + typename AT::t_int_1d_randomread type; + + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d_randomread d_ilist; + typename AT::t_int_1d_randomread d_numneigh; + + typename AT::tdual_ffloat_2d k_cutsq; + typename AT::t_ffloat_2d d_cutsq; + + Kokkos::DualView k_params; + typename Kokkos::DualView::t_dev_const_um params; + + DAT::tdual_efloat_1d k_eatom; + DAT::tdual_virial_array k_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; + + KOKKOS_INLINE_FUNCTION + int sbmask(const int& j) const; + friend void pair_virial_fdotr_compute(PairDPDExtTstatKokkos*); + +}; +} +#endif +#endif From ce67cb0ca10e3cb4d1774fab5aca6e0b50f7fa9c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 1 Apr 2022 07:41:13 -0400 Subject: [PATCH 075/130] first stab at implementing dump_modify colname --- src/dump.cpp | 66 ++++++++++++++++++++++++++++++--------------- src/dump.h | 4 +++ src/dump_atom.cpp | 29 ++++++++++++++------ src/dump_atom.h | 2 +- src/dump_cfg.cpp | 28 +++++++++++-------- src/dump_custom.cpp | 36 ++++++++++++++++--------- src/dump_custom.h | 1 + src/thermo.cpp | 5 ++-- 8 files changed, 115 insertions(+), 56 deletions(-) diff --git a/src/dump.cpp b/src/dump.cpp index 2e6df77cd9..480bbe666c 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -150,19 +150,19 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) Dump::~Dump() { - delete [] id; - delete [] style; - delete [] filename; - delete [] multiname; + delete[] id; + delete[] style; + delete[] filename; + delete[] multiname; - delete [] format; - delete [] format_default; - delete [] format_line_user; - delete [] format_float_user; - delete [] format_int_user; - delete [] format_bigint_user; + delete[] format; + delete[] format_default; + delete[] format_line_user; + delete[] format_float_user; + delete[] format_int_user; + delete[] format_bigint_user; - delete [] refresh; + delete[] refresh; // format_column_user is deallocated by child classes that use it @@ -1019,7 +1019,7 @@ void Dump::balance() memory->destroy(tmp); memory->destroy(proc_offsets); memory->destroy(proc_new_offsets); - delete [] request; + delete[] request; } /* ---------------------------------------------------------------------- @@ -1059,7 +1059,7 @@ void Dump::modify_params(int narg, char **arg) if (strcmp(id,output->dump[idump]->id) == 0) break; int n; if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { - delete [] output->var_dump[idump]; + delete[] output->var_dump[idump]; output->var_dump[idump] = utils::strdup(&arg[iarg+1][2]); n = 0; } else { @@ -1077,7 +1077,7 @@ void Dump::modify_params(int narg, char **arg) if (strcmp(id,output->dump[idump]->id) == 0) break; double delta; if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { - delete [] output->var_dump[idump]; + delete[] output->var_dump[idump]; output->var_dump[idump] = utils::strdup(&arg[iarg+1][2]); delta = 0.0; } else { @@ -1107,7 +1107,7 @@ void Dump::modify_params(int narg, char **arg) MPI_Comm_free(&clustercomm); MPI_Comm_split(world,icluster,0,&clustercomm); - delete [] multiname; + delete[] multiname; char *ptr = strchr(filename,'%'); *ptr = '\0'; multiname = utils::strdup(fmt::format("{}{}{}", filename, icluster, ptr+1)); @@ -1124,14 +1124,38 @@ void Dump::modify_params(int narg, char **arg) flush_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; + } else if (strcmp(arg[iarg],"colname") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (strcmp(arg[iarg+1],"default") == 0) { + for (auto item : keyword_user) item.clear(); + iarg += 2; + } else { + if (iarg+3 > narg) error->all(FLERR,"Illegal dump_modify command"); + int icol = -1; + if (utils::is_integer(arg[iarg + 1])) { + icol = utils::inumeric(FLERR,arg[iarg + 1],false,lmp); + if (icol < 0) icol = keyword_user.size() + icol + 1; + icol--; + } else { + try { + icol = key2col.at(arg[iarg + 1]); + } catch (std::out_of_range &) { + icol = -1; + } + } + if ((icol < 0) || (icol >= (int)keyword_user.size())) + error->all(FLERR, "Illegal thermo_modify command"); + keyword_user[icol] = arg[iarg+2]; + iarg += 3; + } } else if (strcmp(arg[iarg],"format") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); if (strcmp(arg[iarg+1],"none") == 0) { - delete [] format_line_user; - delete [] format_int_user; - delete [] format_bigint_user; - delete [] format_float_user; + delete[] format_line_user; + delete[] format_int_user; + delete[] format_bigint_user; + delete[] format_float_user; format_line_user = nullptr; format_int_user = nullptr; format_bigint_user = nullptr; @@ -1146,7 +1170,7 @@ void Dump::modify_params(int narg, char **arg) if (iarg+3 > narg) error->all(FLERR,"Illegal dump_modify command"); if (strcmp(arg[iarg+1],"line") == 0) { - delete [] format_line_user; + delete[] format_line_user; format_line_user = utils::strdup(arg[iarg+2]); iarg += 3; } else { // pass other format options to child classes @@ -1204,7 +1228,7 @@ void Dump::modify_params(int narg, char **arg) MPI_Comm_free(&clustercomm); MPI_Comm_split(world,icluster,0,&clustercomm); - delete [] multiname; + delete[] multiname; char *ptr = strchr(filename,'%'); *ptr = '\0'; multiname = utils::strdup(fmt::format("{}{}{}", filename, icluster, ptr+1)); diff --git a/src/dump.h b/src/dump.h index bce32c9d65..34e0677af8 100644 --- a/src/dump.h +++ b/src/dump.h @@ -16,6 +16,8 @@ #include "pointers.h" // IWYU pragma: export +#include + namespace LAMMPS_NS { class Dump : protected Pointers { @@ -100,6 +102,8 @@ class Dump : protected Pointers { char *format_bigint_user; char **format_column_user; enum { INT, DOUBLE, STRING, BIGINT }; + std::map key2col; + std::vector keyword_user; FILE *fp; // file to write dump to int size_one; // # of quantities for one atom diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp index 0dbd3b3278..faad91f3c5 100644 --- a/src/dump_atom.cpp +++ b/src/dump_atom.cpp @@ -38,6 +38,9 @@ DumpAtom::DumpAtom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) buffer_allow = 1; buffer_flag = 1; format_default = nullptr; + key2col = { { "id", 0 }, { "type", 1 }, { "x", 2 }, { "y", 3 }, + { "z", 4 }, { "ix", 5 }, { "iy", 6 }, { "iz", 7 } }; + keyword_user = { "", "", "", "", "", "", "", "" }; } /* ---------------------------------------------------------------------- */ @@ -63,15 +66,25 @@ void DumpAtom::init_style() domain->boundary_string(boundstr); // setup column string + std::string default_columns; if (scale_flag == 0 && image_flag == 0) - columns = (char *) "id type x y z"; + default_columns = "id type x y z"; else if (scale_flag == 0 && image_flag == 1) - columns = (char *) "id type x y z ix iy iz"; + default_columns = "id type x y z ix iy iz"; else if (scale_flag == 1 && image_flag == 0) - columns = (char *) "id type xs ys zs"; + default_columns = "id type xs ys zs"; else if (scale_flag == 1 && image_flag == 1) - columns = (char *) "id type xs ys zs ix iy iz"; + default_columns = "id type xs ys zs ix iy iz"; + + int icol = 0; + columns.clear(); + for (auto item : utils::split_words(default_columns)) { + if (columns.size()) columns += " "; + if (keyword_user[icol].size()) columns += keyword_user[icol]; + else columns += item; + ++icol; + } // setup function ptrs @@ -201,9 +214,9 @@ void DumpAtom::header_unit_style_binary() void DumpAtom::header_columns_binary() { - int len = strlen(columns); + int len = columns.size(); fwrite(&len, sizeof(int), 1, fp); - fwrite(columns, sizeof(char), len, fp); + fwrite(columns.c_str(), sizeof(char), len, fp); } /* ---------------------------------------------------------------------- */ @@ -301,7 +314,7 @@ void DumpAtom::header_item(bigint ndump) fprintf(fp,"%-1.16e %-1.16e\n",boxxlo,boxxhi); fprintf(fp,"%-1.16e %-1.16e\n",boxylo,boxyhi); fprintf(fp,"%-1.16e %-1.16e\n",boxzlo,boxzhi); - fprintf(fp,"ITEM: ATOMS %s\n",columns); + fprintf(fp,"ITEM: ATOMS %s\n",columns.c_str()); } /* ---------------------------------------------------------------------- */ @@ -322,7 +335,7 @@ void DumpAtom::header_item_triclinic(bigint ndump) fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy); fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz); fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz); - fprintf(fp,"ITEM: ATOMS %s\n",columns); + fprintf(fp,"ITEM: ATOMS %s\n",columns.c_str()); } /* ---------------------------------------------------------------------- */ diff --git a/src/dump_atom.h b/src/dump_atom.h index 1e1a9315d7..3c67e3de54 100644 --- a/src/dump_atom.h +++ b/src/dump_atom.h @@ -36,7 +36,7 @@ class DumpAtom : public Dump { int scale_flag; // 1 if atom coords are scaled, 0 if no int image_flag; // 1 if append box count to atom coords, 0 if no - char *columns; // column labels + std::string columns; // column labels void init_style() override; int modify_param(int, char **) override; diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index d52dac745f..552607b0a5 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -53,26 +53,26 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : if (strcmp(earg[2],"xs") == 0) { if (strcmp(earg[3],"ysu") == 0 || strcmp(earg[4],"zsu") == 0) - error->all(FLERR, - "Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu"); + error->all(FLERR,"Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu"); unwrapflag = 0; } else { if (strcmp(earg[3],"ys") == 0 || strcmp(earg[4],"zs") == 0) - error->all(FLERR, - "Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu"); + error->all(FLERR,"Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu"); unwrapflag = 1; } // setup auxiliary property name strings // convert 'X_ID[m]' (X=c,f,v) to 'X_ID_m' - if (nfield > 5) auxname = new char*[nfield]; + if (nfield > 5) auxname = new char*[nfield-5]; else auxname = nullptr; int i = 0; + key2col.clear(); + keyword_user.resize(nfield-5); for (int iarg = 5; iarg < nfield; iarg++, i++) { - ArgInfo argi(earg[iarg],ArgInfo::COMPUTE|ArgInfo::FIX|ArgInfo::VARIABLE - |ArgInfo::DNAME|ArgInfo::INAME); + ArgInfo argi(earg[iarg],ArgInfo::COMPUTE|ArgInfo::FIX|ArgInfo::VARIABLE| + ArgInfo::DNAME|ArgInfo::INAME); if (argi.get_dim() == 1) { std::string newarg = fmt::format("{}_{}_{}", earg[iarg][0], argi.get_name(), argi.get_index1()); @@ -80,6 +80,8 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : } else { auxname[i] = utils::strdup(earg[iarg]); } + key2col[earg[iarg]] = i; + keyword_user[i].clear(); } } @@ -88,8 +90,8 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : DumpCFG::~DumpCFG() { if (auxname) { - for (int i = 0; i < nfield-5; i++) delete [] auxname[i]; - delete [] auxname; + for (int i = 0; i < nfield-5; i++) delete[] auxname[i]; + delete[] auxname; } } @@ -136,8 +138,12 @@ void DumpCFG::write_header(bigint n) fprintf(fp,"H0(3,3) = %g A\n",domain->zprd); fprintf(fp,".NO_VELOCITY.\n"); fprintf(fp,"entry_count = %d\n",nfield-2); - for (int i = 0; i < nfield-5; i++) - fprintf(fp,"auxiliary[%d] = %s\n",i,auxname[i]); + for (int i = 0; i < nfield-5; i++) { + if (keyword_user[i].size()) + fprintf(fp,"auxiliary[%d] = %s\n",i,keyword_user[i].c_str()); + else + fprintf(fp,"auxiliary[%d] = %s\n",i,auxname[i]); + } } /* ---------------------------------------------------------------------- diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 5d371d3145..b22e9d6eec 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -55,14 +55,11 @@ enum{LT,LE,GT,GE,EQ,NEQ,XOR}; DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), idregion(nullptr), thresh_array(nullptr), thresh_op(nullptr), thresh_value(nullptr), - thresh_last(nullptr), thresh_fix(nullptr), - thresh_fixID(nullptr), thresh_first(nullptr), - earg(nullptr), vtype(nullptr), vformat(nullptr), columns(nullptr), choose(nullptr), - dchoose(nullptr), clist(nullptr), field2index(nullptr), - argindex(nullptr), id_compute(nullptr), - compute(nullptr), id_fix(nullptr), fix(nullptr), - id_variable(nullptr), variable(nullptr), - vbuf(nullptr), id_custom(nullptr), custom(nullptr), custom_flag(nullptr), + thresh_last(nullptr), thresh_fix(nullptr), thresh_fixID(nullptr), thresh_first(nullptr), + earg(nullptr), vtype(nullptr), vformat(nullptr), columns(nullptr), columns_default(nullptr), + choose(nullptr), dchoose(nullptr), clist(nullptr), field2index(nullptr), argindex(nullptr), + id_compute(nullptr), compute(nullptr), id_fix(nullptr), fix(nullptr), id_variable(nullptr), + variable(nullptr), vbuf(nullptr), id_custom(nullptr), custom(nullptr), custom_flag(nullptr), typenames(nullptr), pack_choice(nullptr) { if (narg == 5) error->all(FLERR,"No dump custom arguments specified"); @@ -180,13 +177,14 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : // setup column string cols.clear(); + keyword_user.resize(nfield); for (int iarg = 0; iarg < nfield; iarg++) { + key2col[earg[iarg]] = iarg; + keyword_user[iarg].clear(); + if (cols.size()) cols += " "; cols += earg[iarg]; - cols += " "; } - // remove trailing blank and copy - cols.resize(cols.size()-1); - columns = utils::strdup(cols); + columns_default = utils::strdup(cols); } /* ---------------------------------------------------------------------- */ @@ -257,6 +255,7 @@ DumpCustom::~DumpCustom() delete[] format_column_user; } + delete[] columns_default; delete[] columns; } @@ -264,6 +263,19 @@ DumpCustom::~DumpCustom() void DumpCustom::init_style() { + // assemble ITEMS: column string from defaults and user values + + delete[] columns; + std::string combined; + int icol = 0; + for (auto item : utils::split_words(columns_default)) { + if (combined.size()) combined += " "; + if (keyword_user[icol].size()) combined += keyword_user[icol]; + else combined += item; + ++icol; + } + columns = utils::strdup(combined); + // format = copy of default or user-specified line format delete[] format; diff --git a/src/dump_custom.h b/src/dump_custom.h index 5a99cca009..0dcfd82bba 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -60,6 +60,7 @@ class DumpCustom : public Dump { char **vformat; // format string for each vector element // char *columns; // column labels + char *columns_default; // int nchoose; // # of selected atoms int maxlocal; // size of atom selection and variable arrays diff --git a/src/thermo.cpp b/src/thermo.cpp index fe6f92d85d..a7d76017f8 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -631,8 +631,7 @@ void Thermo::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg], "colname") == 0) { if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); if (strcmp(arg[iarg + 1], "default") == 0) { - for (int i=0; i < nfield_initial + 1; ++i) - keyword_user[i].clear(); + for (auto item : keyword_user) item.clear(); iarg += 2; } else { if (iarg + 3 > narg) error->all(FLERR, "Illegal thermo_modify command"); @@ -660,7 +659,7 @@ void Thermo::modify_params(int narg, char **arg) format_int_user.clear(); format_bigint_user.clear(); format_float_user.clear(); - for (int i = 0; i < nfield_initial + 1; ++i) format_column_user[i].clear(); + for (auto item : format_column_user) item.clear(); iarg += 2; continue; } From 68f27bb4cdd55c5a69efb0823563310ad307f663 Mon Sep 17 00:00:00 2001 From: Matt Bettencourt Date: Fri, 1 Apr 2022 17:02:57 +0200 Subject: [PATCH 076/130] addressing comments from Evan's review --- src/KOKKOS/pair_dpd_ext_kokkos.cpp | 16 ++++++-------- src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp | 20 +++++++---------- src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp | 26 +++++++++++------------ src/KOKKOS/pair_dpd_kokkos.cpp | 16 ++++++-------- src/KOKKOS/pair_dpd_tstat_kokkos.cpp | 18 +++++++--------- 5 files changed, 42 insertions(+), 54 deletions(-) diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp index 2fde5e8095..cc6db548f7 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -378,21 +378,19 @@ void PairDPDExtKokkos::ev_tally(EV_FLOAT &ev, const int &i, const in if (vflag_global) { if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } - if (NEWTON_PAIR || j < nlocal) { ev.v[0] += 0.5*v0; ev.v[1] += 0.5*v1; ev.v[2] += 0.5*v2; ev.v[3] += 0.5*v3; ev.v[4] += 0.5*v4; ev.v[5] += 0.5*v5; + if (NEWTON_PAIR || j < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; } } else { ev.v[0] += 0.5*v0; diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp index 8b794f8571..3f022df490 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp @@ -121,10 +121,8 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) double boltz = force->boltz; for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) { - std::cout << k_params.h_view(j,i).sigma <<" "; - k_params.h_view(j,i).sigma = k_params.h_view(j,i).sigma = + k_params.h_view(i,j).sigma = k_params.h_view(j,i).sigma = sqrt(2.0*boltz*temperature*gamma[i][j]); - std::cout << k_params.h_view(j,i).sigma <<"\n"; } } k_params.template modify(); @@ -383,21 +381,19 @@ void PairDPDExtTstatKokkos::ev_tally(EV_FLOAT &ev, const int &i, con if (vflag_global) { if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } - if (NEWTON_PAIR || j < nlocal) { ev.v[0] += 0.5*v0; ev.v[1] += 0.5*v1; ev.v[2] += 0.5*v2; ev.v[3] += 0.5*v3; ev.v[4] += 0.5*v4; ev.v[5] += 0.5*v5; + if (NEWTON_PAIR || j < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; } } else { ev.v[0] += 0.5*v0; diff --git a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp index 123467865a..dc22938dc8 100644 --- a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp @@ -729,21 +729,19 @@ void PairDPDfdtEnergyKokkos::ev_tally(EV_FLOAT &ev, const int &i, co if (vflag_atom) { if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) { - v_vatom(i,0) += 0.5*v0; - v_vatom(i,1) += 0.5*v1; - v_vatom(i,2) += 0.5*v2; - v_vatom(i,3) += 0.5*v3; - v_vatom(i,4) += 0.5*v4; - v_vatom(i,5) += 0.5*v5; - } + v_vatom(i,0) += 0.5*v0; + v_vatom(i,1) += 0.5*v1; + v_vatom(i,2) += 0.5*v2; + v_vatom(i,3) += 0.5*v3; + v_vatom(i,4) += 0.5*v4; + v_vatom(i,5) += 0.5*v5; if (NEWTON_PAIR || j < nlocal) { - v_vatom(j,0) += 0.5*v0; - v_vatom(j,1) += 0.5*v1; - v_vatom(j,2) += 0.5*v2; - v_vatom(j,3) += 0.5*v3; - v_vatom(j,4) += 0.5*v4; - v_vatom(j,5) += 0.5*v5; + v_vatom(j,0) += 0.5*v0; + v_vatom(j,1) += 0.5*v1; + v_vatom(j,2) += 0.5*v2; + v_vatom(j,3) += 0.5*v3; + v_vatom(j,4) += 0.5*v4; + v_vatom(j,5) += 0.5*v5; } } else { v_vatom(i,0) += 0.5*v0; diff --git a/src/KOKKOS/pair_dpd_kokkos.cpp b/src/KOKKOS/pair_dpd_kokkos.cpp index 190acac98e..b9ecec7bcd 100644 --- a/src/KOKKOS/pair_dpd_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_kokkos.cpp @@ -339,21 +339,19 @@ void PairDPDKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int & if (vflag_global) { if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } - if (NEWTON_PAIR || j < nlocal) { ev.v[0] += 0.5*v0; ev.v[1] += 0.5*v1; ev.v[2] += 0.5*v2; ev.v[3] += 0.5*v3; ev.v[4] += 0.5*v4; ev.v[5] += 0.5*v5; + if (NEWTON_PAIR || j < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; } } else { ev.v[0] += 0.5*v0; diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp index dc364c8b3d..6c50e084af 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp @@ -121,7 +121,7 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) double boltz = force->boltz; for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) - k_params.h_view(j,i).sigma = k_params.h_view(j,i).sigma = + k_params.h_view(i,j).sigma = k_params.h_view(j,i).sigma = sqrt(2.0*boltz*temperature*gamma[i][j]); } k_params.template modify(); @@ -340,21 +340,19 @@ void PairDPDTstatKokkos::ev_tally(EV_FLOAT &ev, const int &i, const if (vflag_global) { if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } - if (NEWTON_PAIR || j < nlocal) { ev.v[0] += 0.5*v0; ev.v[1] += 0.5*v1; ev.v[2] += 0.5*v2; ev.v[3] += 0.5*v3; ev.v[4] += 0.5*v4; ev.v[5] += 0.5*v5; + if (NEWTON_PAIR || j < nlocal) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; } } else { ev.v[0] += 0.5*v0; From 294dcc5f93f47603d2bf7617fe6bb176be8b597a Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 1 Apr 2022 09:27:48 -0600 Subject: [PATCH 077/130] more debugging for plugin mode --- examples/mdi/README | 47 +++++++++++++++--------- examples/mdi/in.aimd.driver.plugin | 6 ++-- src/MDI/fix_mdi_aimd.cpp | 26 ++++++++++---- src/MDI/fix_mdi_aimd.h | 3 +- src/MDI/mdi_plugin.cpp | 57 ++++++++++++++++++++++-------- src/MDI/mdi_plugin.h | 2 +- src/library.cpp | 5 +++ 7 files changed, 104 insertions(+), 42 deletions(-) diff --git a/examples/mdi/README b/examples/mdi/README index dedf388a3b..51268e57ee 100644 --- a/examples/mdi/README +++ b/examples/mdi/README @@ -2,32 +2,47 @@ These are examples that work the MDI package in LAMMPS which uses the MolSSI MDI library for coupling codes together and communicating between them with MDI messages. -To use the serial_drive.py example you will need Python 3 with Numpy -and mpi4py available in your Python. Make sure LAMMPS and Python are -using same the same version of MPI. - In MDI lingo, one code is the driver and another code is the engine. The 2 codes can be written in any language; C++ (LAMMPS) and Python -are illustrated here. The 2 codes can be run on different numbers of -processors. - -The 2 codes can communicate either via TCP (sockets) or via MPI. For -the TCP case, the driver and engine need to be launched separately, +are illustrated here. The 2 codes can each be stand-alone codes, in +which case they can be run on different numbers of processors. The 2 +codes can communicate either via TCP (sockets) or via MPI. For the +TCP case, the driver and engine need to be launched separately, e.g. in 2 windows on your desktop machine. For the MPI case, a single mpirun command launches both codes. -The example run commands below have variants for these options. +Alternatively the engine code can be a plugin library which the driver +code loads, in which case the driver and engine run on the same +processors. + +LAMMPS supports operating in all these modes. It can be an engine +operating either as a stand-alone code or as a plugin. It can also be +a driver and couple to an engine that is either a stand-alone code or +a plugin. Examples for all these use cases are in this directory. +The example run commands below illustrate all the variants. + +To use LAMMPS as a plugin engine, you must build it as a shared library. +Something like this: + +cd src +make yes-mdi +make mode=shlib mpi + +To use the serial_driver.py example you will need Python 3 with Numpy +and mpi4py available in your Python. Make sure LAMMPS and Python are +using same the same version of MPI. ------------------------------------------------- ------------------------------------------------- -* Example #1 = run AIMD with 2 instances of LAMMPS as driver and engine - as an engine, LAMMPS is a surrogate for a quantum code +* Example #1 = run ab inito MD (AIMD) + 2 instances of LAMMPS operate as a driver and engine + as an engine, LAMMPS is a surrogate for a quantum code Note that the 2 input scripts in.aimd.alone and in.aimd.driver have an option for running in NVE vs NPT mode. Comment in/out the appropriate line to change modes. Nothing needs to be -changed in the 3rd input script in.aimd.engine. +changed in the in.aimd.engine or in.aimd.engine.plugin scripts. --- @@ -83,13 +98,13 @@ Run in plugin mode: 3 procs ------------------------------------------------- * Example #2 = Python driver runs sequence of unrelated LAMMPS calculations - calcs can be single-point, MD runs, or minimizations + Each calculation can be a single-point evaluation, an MD run, or a minimization. The sequence_driver.py code allows for optional switches in addition to -mdi (required) and the -plugin and -plugin_args switches which are used to link to an engine as a plugin library. The example run commands below just use the default values of the optional switches. -The switches are also explained the top of the file; the info is +The switches are also explained at the top of the file; the info is copied here: # -n 10 @@ -163,7 +178,7 @@ The aimd_driver.py code allows for an optional switch in addition to -mdi (required) and the -plugin and -plugin_args swiches which are used to link to the 2 engines as a plugin libraries. The example run commands below use the default values of the optional switch. The -switches are also explained the top of the file; the info is copied +switch is also explained the top of the file; the info is copied here: # -nsteps 5 diff --git a/examples/mdi/in.aimd.driver.plugin b/examples/mdi/in.aimd.driver.plugin index 655fd3c134..a974bff9df 100644 --- a/examples/mdi/in.aimd.driver.plugin +++ b/examples/mdi/in.aimd.driver.plugin @@ -23,12 +23,12 @@ fix 1 all nve # NPT #fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0 -fix 2 all mdi/aimd +fix 2 all mdi/aimd plugin fix_modify 2 energy yes virial yes thermo_style custom step temp pe etotal press vol thermo 1 -mdi/plugin lammps & - args '-mdi "-role ENGINE -name lammps -method LINK"' & +mdi/plugin lammps mdi "-role ENGINE -name lammps -method LINK" & + infile in.aimd.engine extra "-log log.aimd.engine.plugin" & command "run 5" diff --git a/src/MDI/fix_mdi_aimd.cpp b/src/MDI/fix_mdi_aimd.cpp index e3f86fa58f..31989a4938 100644 --- a/src/MDI/fix_mdi_aimd.cpp +++ b/src/MDI/fix_mdi_aimd.cpp @@ -30,7 +30,7 @@ enum{NATIVE,REAL,METAL}; // LAMMPS units which MDI supports FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - if (narg != 3) error->all(FLERR, "Illegal fix mdi/aimd command"); + if (narg > 4) error->all(FLERR, "Illegal fix mdi/aimd command"); scalar_flag = 1; global_freq = 1; @@ -39,6 +39,14 @@ FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : virial_global_flag = 1; thermo_energy = thermo_virial = 1; + // check for plugin arg + + plugin = 0; + if (narg == 4) { + if (strcmp(arg[3],"plugin") == 0) plugin = 1; + else error->all(FLERR, "Illegal fix mdi/aimd command"); + } + // check requirements for LAMMPS to work with MDI as an engine if (atom->tag_enable == 0) @@ -67,10 +75,12 @@ FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : unit_conversions(); - // connect to MDI engine + // connect to MDI engine, only if engine is stand-alone code - // MDI_Accept_communicator(&mdicomm); - // if (mdicomm <= 0) error->all(FLERR, "Unable to connect to MDI engine"); + if (!plugin) { + MDI_Accept_communicator(&mdicomm); + if (mdicomm <= 0) error->all(FLERR, "Unable to connect to MDI engine"); + } nprocs = comm->nprocs; } @@ -79,10 +89,12 @@ FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : FixMDIAimd::~FixMDIAimd() { - // send exit command to engine + // send exit command to engine, only if engine is stand-alone code - //int ierr = MDI_Send_command("EXIT",mdicomm); - //if (ierr) error->all(FLERR,"MDI: EXIT command"); + if (!plugin) { + int ierr = MDI_Send_command("EXIT",mdicomm); + if (ierr) error->all(FLERR,"MDI: EXIT command"); + } // clean up diff --git a/src/MDI/fix_mdi_aimd.h b/src/MDI/fix_mdi_aimd.h index 0d891bd47b..dd3b2ab981 100644 --- a/src/MDI/fix_mdi_aimd.h +++ b/src/MDI/fix_mdi_aimd.h @@ -44,6 +44,8 @@ class FixMDIAimd : public Fix { private: int nprocs; + int plugin; + int eflag_caller; double engine_energy; int lmpunits; @@ -65,7 +67,6 @@ class FixMDIAimd : public Fix { void reallocate(); void unit_conversions(); - }; } diff --git a/src/MDI/mdi_plugin.cpp b/src/MDI/mdi_plugin.cpp index 77b4b200ad..8d4bb376c8 100644 --- a/src/MDI/mdi_plugin.cpp +++ b/src/MDI/mdi_plugin.cpp @@ -37,27 +37,52 @@ void MDIPlugin::command(int narg, char **arg) if (narg < 1) error->all(FLERR,"Illegal mdi/plugin command"); char *plugin_name = arg[0]; - char *plugin_args = nullptr; - plugin_command = nullptr; - printf("NARG %d\n",narg); + char *mdi_arg = nullptr; + char *infile_arg = nullptr; + char *extra_arg = nullptr; + lammps_command = nullptr; int iarg = 1; while (iarg < narg) { - if (strcmp(arg[iarg],"args") == 0) { + if (strcmp(arg[iarg],"mdi") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal mdi/plugin command"); - plugin_args = arg[iarg+1]; + mdi_arg = arg[iarg+1]; + iarg += 2; + } else if (strcmp(arg[iarg],"infile") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal mdi/plugin command"); + infile_arg = arg[iarg+1]; + iarg += 2; + } else if (strcmp(arg[iarg],"extra") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal mdi/plugin command"); + extra_arg = arg[iarg+1]; iarg += 2; } else if (strcmp(arg[iarg],"command") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal mdi/plugin command"); - plugin_command = arg[iarg+1]; + int n = strlen(arg[iarg+1]) + 1; + lammps_command = new char[n]; + strcpy(lammps_command,arg[iarg+1]); iarg += 2; } else error->all(FLERR,"Illegal mdi/plugin command"); } - // error if no command was specified + // error checks - if (!plugin_command) error->all(FLERR,"MDI/plugin must specify command"); + if (!mdi_arg || !infile_arg || !lammps_command) + error->all(FLERR,"MDI/plugin must specify mdi, infile, command keywords"); + + // build full plugin_args string for args to plugin library + + int n = strlen(mdi_arg) + strlen(infile_arg) + strlen(extra_arg) + 16; + char *plugin_args = new char[n]; + strcat(plugin_args,"-mdi \""); + strcat(plugin_args,mdi_arg); + strcat(plugin_args,"\" -in "); + strcat(plugin_args,infile_arg); + if (extra_arg) { + strcat(plugin_args," "); + strcat(plugin_args,extra_arg); + } // find FixMDIAimd instance so can reset its mdicomm @@ -72,6 +97,8 @@ void MDIPlugin::command(int narg, char **arg) printf("ARGS %s\n",plugin_args); MDI_Launch_plugin(plugin_name,plugin_args,world,plugin_wrapper,(void *)this); + + delete [] plugin_args; } /* ---------------------------------------------------------------------- @@ -81,25 +108,27 @@ void MDIPlugin::command(int narg, char **arg) ---------------------------------------------------------------------- */ int MDIPlugin::plugin_wrapper(void *pmpicomm, MDI_Comm mdicomm, - void *ptr) + void *vptr) { printf("INSIDE CALLBACK\n"); MPI_Comm mpicomm = *(MPI_Comm *) pmpicomm; - MDIPlugin *thisptr = (MDIPlugin *) ptr; - LAMMPS *lammps = thisptr->lmp; + MDIPlugin *ptr = (MDIPlugin *) vptr; + LAMMPS *lammps = ptr->lmp; + char *lammps_command = ptr->lammps_command; // set FixMDIAimd mdicomm to this mdicomm - FixMDIAimd *aimdptr = (FixMDIAimd *) (thisptr->fixptr); + FixMDIAimd *aimdptr = (FixMDIAimd *) (ptr->fixptr); aimdptr->mdicomm = mdicomm; // invoke the specified LAMMPS command // that operation will issue MDI commands to the plugin engine - printf("PRE RUN command\n"); + printf("PRE RUN command: %s\n",lammps_command); - lammps->input->one(thisptr->plugin_command); + lammps->input->one(lammps_command); + delete [] lammps_command; // send MDI exit to plugin, which unloads the plugin diff --git a/src/MDI/mdi_plugin.h b/src/MDI/mdi_plugin.h index 37cf042d31..54bb1c5f4b 100644 --- a/src/MDI/mdi_plugin.h +++ b/src/MDI/mdi_plugin.h @@ -31,7 +31,7 @@ class MDIPlugin : public Command { void command(int, char **) override; private: - char *plugin_command; + char *lammps_command; class Fix *fixptr; static int plugin_wrapper(void *, MDI_Comm, void *); diff --git a/src/library.cpp b/src/library.cpp index ace9905451..a983b24b7f 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -172,6 +172,9 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr) lammps_mpi_init(); if (ptr) ptr_argument_warning(); + printf("LAMMPS instantiate argc %d argv[1] %s argv[2] %s\n", + argc,argv[1],argv[2]); + #ifdef LAMMPS_EXCEPTIONS try { @@ -183,7 +186,9 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr) if (ptr) *ptr = nullptr; } #else + printf("PRE-INSTANTIATE\n"); lmp = new LAMMPS(argc, argv, comm); + printf("POST-INSTANTIATE %p\n",lmp); if (ptr) *ptr = (void *) lmp; #endif return (void *) lmp; From fb76cb9a5ca95d1a766527d0041e99d78fc0c52d Mon Sep 17 00:00:00 2001 From: Matt Bettencourt Date: Fri, 1 Apr 2022 17:54:12 +0200 Subject: [PATCH 078/130] updated virtual --- src/DPD-BASIC/pair_dpd.h | 6 +++--- src/DPD-BASIC/pair_dpd_ext.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/DPD-BASIC/pair_dpd.h b/src/DPD-BASIC/pair_dpd.h index 7a5f6708d7..2a08c60376 100644 --- a/src/DPD-BASIC/pair_dpd.h +++ b/src/DPD-BASIC/pair_dpd.h @@ -28,11 +28,11 @@ class PairDPD : public Pair { public: PairDPD(class LAMMPS *); ~PairDPD() override; - virtual void compute(int, int) override; + void compute(int, int) override; void settings(int, char **) override; void coeff(int, char **) override; - virtual void init_style() override; - virtual double init_one(int, int) override; + void init_style() override; + double init_one(int, int) override; void write_restart(FILE *) override; void read_restart(FILE *) override; void write_restart_settings(FILE *) override; diff --git a/src/DPD-BASIC/pair_dpd_ext.h b/src/DPD-BASIC/pair_dpd_ext.h index f01af7b34b..eae8fd9f1d 100644 --- a/src/DPD-BASIC/pair_dpd_ext.h +++ b/src/DPD-BASIC/pair_dpd_ext.h @@ -28,11 +28,11 @@ class PairDPDExt : public Pair { public: PairDPDExt(class LAMMPS *); ~PairDPDExt() override; - virtual void compute(int, int) override; + void compute(int, int) override; void settings(int, char **) override; void coeff(int, char **) override; - virtual void init_style() override; - virtual double init_one(int, int) override; + void init_style() override; + double init_one(int, int) override; void write_restart(FILE *) override; void read_restart(FILE *) override; void write_restart_settings(FILE *) override; From fb9316701ba972ebad2744ffd0bdc6f654cc940f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 1 Apr 2022 14:57:41 -0400 Subject: [PATCH 079/130] port colname changes to MPIIO package --- src/MPIIO/dump_atom_mpiio.cpp | 19 +++++++++++++++---- src/MPIIO/dump_custom_mpiio.cpp | 13 +++++++++++++ src/dump_atom.cpp | 1 + src/dump_custom.cpp | 2 +- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/MPIIO/dump_atom_mpiio.cpp b/src/MPIIO/dump_atom_mpiio.cpp index 9ba779924f..f8e29ba46e 100644 --- a/src/MPIIO/dump_atom_mpiio.cpp +++ b/src/MPIIO/dump_atom_mpiio.cpp @@ -234,14 +234,25 @@ void DumpAtomMPIIO::init_style() // setup column string + std::string default_columns; + if (scale_flag == 0 && image_flag == 0) - columns = (char *) "id type x y z"; + default_columns = "id type x y z"; else if (scale_flag == 0 && image_flag == 1) - columns = (char *) "id type x y z ix iy iz"; + default_columns = "id type x y z ix iy iz"; else if (scale_flag == 1 && image_flag == 0) - columns = (char *) "id type xs ys zs"; + default_columns = "id type xs ys zs"; else if (scale_flag == 1 && image_flag == 1) - columns = (char *) "id type xs ys zs ix iy iz"; + default_columns = "id type xs ys zs ix iy iz"; + + int icol = 0; + columns.clear(); + for (auto item : utils::split_words(default_columns)) { + if (columns.size()) columns += " "; + if (keyword_user[icol].size()) columns += keyword_user[icol]; + else columns += item; + ++icol; + } // setup function ptrs diff --git a/src/MPIIO/dump_custom_mpiio.cpp b/src/MPIIO/dump_custom_mpiio.cpp index 372b8705b9..196a2d0bb9 100644 --- a/src/MPIIO/dump_custom_mpiio.cpp +++ b/src/MPIIO/dump_custom_mpiio.cpp @@ -216,6 +216,19 @@ void DumpCustomMPIIO::write() void DumpCustomMPIIO::init_style() { + // assemble ITEMS: column string from defaults and user values + + delete[] columns; + std::string combined; + int icol = 0; + for (auto item : utils::split_words(columns_default)) { + if (combined.size()) combined += " "; + if (keyword_user[icol].size()) combined += keyword_user[icol]; + else combined += item; + ++icol; + } + columns = utils::strdup(combined); + // format = copy of default or user-specified line format delete[] format; diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp index faad91f3c5..3662c01313 100644 --- a/src/dump_atom.cpp +++ b/src/dump_atom.cpp @@ -66,6 +66,7 @@ void DumpAtom::init_style() domain->boundary_string(boundstr); // setup column string + std::string default_columns; if (scale_flag == 0 && image_flag == 0) diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index b22e9d6eec..8232360d42 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -275,7 +275,7 @@ void DumpCustom::init_style() ++icol; } columns = utils::strdup(combined); - + // format = copy of default or user-specified line format delete[] format; From 49abd0d2691b272b12582881ff7e8acf3e96a6db Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 1 Apr 2022 15:17:10 -0400 Subject: [PATCH 080/130] update docs --- doc/src/dump_modify.rst | 32 ++++++++++++++++++++++++++++++-- doc/src/thermo_modify.rst | 14 +++++++------- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index 352f9c61bf..e81cc04531 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -26,6 +26,10 @@ Syntax N = index of frame written upon first dump *balance* arg = *yes* or *no* *buffer* arg = *yes* or *no* + *colname* values = ID string, or *default* + string = new column header name + ID = integer from 1 to N, or integer from -1 to -N, where N = # of quantities being output + *or* a thermo keyword or reference to compute, fix, property or variable. *delay* arg = Dstep Dstep = delay output until this timestep *element* args = E1 E2 ... EN, where N = # of atom types @@ -40,9 +44,10 @@ Syntax Np = write one file for every this many processors *first* arg = *yes* or *no* *flush* arg = *yes* or *no* - *format* args = *line* string, *int* string, *float* string, M string, or *none* + *format* args = *line* string, *int* string, *float* string, ID string, or *none* string = C-style format string - M = integer from 1 to N, where N = # of per-atom quantities being output + ID = integer from 1 to N, or integer from -1 to -N, where N = # of quantities being output + *or* a thermo keyword or reference to compute, fix, property or variable. *header* arg = *yes* or *no* *yes* to write the header *no* to not write the header @@ -375,6 +380,29 @@ performed with dump style *xtc*\ . ---------- +The *colname* keyword can be used to change the default header keyword +for dump styles: *atom*, *custom*, and *cfg* and their compressed and +MPIIO variants. The setting for *ID string* replaces the default text +with the provided string. *ID* can be a positive integer when it +represents the column number counting from the left, a negative integer +when it represents the column number from the right (i.e. -1 is the last +column/keyword), or a thermo keyword (or compute, fix, property, or +variable reference) and then it replaces the string for that specific +keyword. For *atom* dump styles only the keywords "id", "type", "x", +"y", "z", "ix", "iy", "iz" can be accessed via string regardless of +whether scaled or unwrapped coodinates were enabled or disabled, and +it always assumes 8 columns for indexing regardless of whether image +flags are enabled or not. For dump style *cfg* only the "auxiliary" +keywords (6th or later keyword) may be changed and the column indexing +considers only them (i.e. the 6th keyword is the the 1st column). + +The *colname* keyword can be used multiple times. If multiple *colname* +settings refer to the same keyword, the last setting has precedence. A +setting of *default* clears all previous settings, reverting all values +to their default names. + +---------- + The *format* keyword can be used to change the default numeric format output by the text-based dump styles: *atom*, *local*, *custom*, *cfg*, and *xyz* styles, and their MPIIO variants. Only the *line* or *none* diff --git a/doc/src/thermo_modify.rst b/doc/src/thermo_modify.rst index 9a5e739c0e..ffdbf020a1 100644 --- a/doc/src/thermo_modify.rst +++ b/doc/src/thermo_modify.rst @@ -157,15 +157,15 @@ The *colname* keyword can be used to change the default header keyword for a column or field of thermodynamic output. The setting for *ID string* replaces the default text with the provided string. *ID* can be a positive integer when it represents the column number counting from -the left, a negative integer when then it represents the column number -from the right (i.e. -1 is the last column/keyword), or a thermo keyword -(or compute, fix, property, or variable reference) and then it replaces -the string for that specific thermo keyword. +the left, a negative integer when it represents the column number from +the right (i.e. -1 is the last column/keyword), or a thermo keyword (or +compute, fix, property, or variable reference) and then it replaces the +string for that specific thermo keyword. The *colname* keyword can be used multiple times. If multiple *colname* -settings refer to the same keyword, the last setting has precedence. -the default setting is used. A setting of *default* clears all previous -settings, reverting all values to their default format. +settings refer to the same keyword, the last setting has precedence. A +setting of *default* clears all previous settings, reverting all values +to their default values. The *format* keyword can be used to change the default numeric format of any of quantities the :doc:`thermo_style ` command From 02f972292c5f6031e5ee62c6bfddca2d0039b7dd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 4 Apr 2022 12:16:28 -0400 Subject: [PATCH 081/130] spelling --- doc/src/dump_modify.rst | 2 +- doc/src/package.rst | 2 +- doc/utils/sphinx-config/false_positives.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index e81cc04531..4d1fb77b10 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -390,7 +390,7 @@ column/keyword), or a thermo keyword (or compute, fix, property, or variable reference) and then it replaces the string for that specific keyword. For *atom* dump styles only the keywords "id", "type", "x", "y", "z", "ix", "iy", "iz" can be accessed via string regardless of -whether scaled or unwrapped coodinates were enabled or disabled, and +whether scaled or unwrapped coordinates were enabled or disabled, and it always assumes 8 columns for indexing regardless of whether image flags are enabled or not. For dump style *cfg* only the "auxiliary" keywords (6th or later keyword) may be changed and the column indexing diff --git a/doc/src/package.rst b/doc/src/package.rst index 0d13de9711..98faaf9842 100644 --- a/doc/src/package.rst +++ b/doc/src/package.rst @@ -474,7 +474,7 @@ list on GPUs. This can be faster in some cases (e.g. ReaxFF HNS benchmark) but slower in others (e.g. Lennard Jones benchmark). The copy between different memory layouts is done out of place and therefore doubles the memory overhead of the neigh list, which can be -signicant. +significant. The *newton* keyword sets the Newton flags for pairwise and bonded interactions to *off* or *on*, the same as the :doc:`newton ` diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 85f9d3d58f..1dd2354141 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1787,6 +1787,7 @@ Liu Livermore lj llammps +lld LLVM lm lmp From 4fadf4c83090c86672371ec11027e10fbc7090d5 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Mon, 4 Apr 2022 10:30:12 -0600 Subject: [PATCH 082/130] more debugging on plugin mode --- examples/mdi/sequence_driver.py | 4 ++++ src/MDI/library_mdi.cpp | 1 + src/MDI/mdi_engine.cpp | 12 ++++++++++++ src/library.cpp | 5 ----- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/examples/mdi/sequence_driver.py b/examples/mdi/sequence_driver.py index 66b9bc9aff..b04a1c23f2 100644 --- a/examples/mdi/sequence_driver.py +++ b/examples/mdi/sequence_driver.py @@ -137,9 +137,13 @@ def perform_tasks(world,mdicomm,dummy): if mode == "eval": pass elif mode == "run": + print("SENDING INIT_MD") mdi.MDI_Send_command("@INIT_MD",mdicomm) + print("SENDING NITERATE") mdi.MDI_Send_command(">NITERATE",mdicomm) + print("SENDING NITERATE data nsteps") mdi.MDI_Send(nsteps,1,mdi.MDI_INT,mdicomm) + print("SENDING DEFAULT") mdi.MDI_Send_command("@DEFAULT",mdicomm) elif mode == "min": mdi.MDI_Send_command("@INIT_OPTG",mdicomm) diff --git a/src/MDI/library_mdi.cpp b/src/MDI/library_mdi.cpp index 4048f805a5..112ce18d2d 100644 --- a/src/MDI/library_mdi.cpp +++ b/src/MDI/library_mdi.cpp @@ -131,6 +131,7 @@ The function executes a single command from an external MDI driver. int lammps_execute_mdi_command(const char *command, MDI_Comm comm, void *class_obj) { + printf("LIB wrapper command %s\n",command); MDIEngine *mdi_engine = (MDIEngine *) class_obj; return mdi_engine->execute_command(command,comm); } diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 1244e72dc0..e9c5e4f8ec 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -186,12 +186,16 @@ void MDIEngine::mdi_engine(int narg, char **arg) // top-level mdi engine only recognizes three nodes // DEFAULT, INIT_MD, INIT_OPTG + printf("MAIN LOOP pre engine_node DEF\n"); engine_node("@DEFAULT"); + printf("MAIN LOOP post engine_node DEF\n"); // MDI commands for dynamics or minimization if (strcmp(mdicmd,"@INIT_MD") == 0) { + printf("MAIN LOOP pre mdi_md\n"); mdi_md(); + printf("MAIN LOOP post mdi_md\n"); if (exit_command) break; } else if (strcmp(mdicmd,"@INIT_OPTG") == 0) { @@ -251,6 +255,8 @@ void MDIEngine::engine_node(const char *node) // read the next command from the driver // all procs call this, but only proc 0 receives the command + printf("PRE MDI RECV_command: node eng/drv: %s/%s\n",node_engine,node_driver); + ierr = MDI_Recv_command(mdicmd,mdicomm); if (ierr) error->all(FLERR,"MDI: Unable to receive command from driver"); @@ -258,6 +264,8 @@ void MDIEngine::engine_node(const char *node) MPI_Bcast(mdicmd,MDI_COMMAND_LENGTH,MPI_CHAR,0,world); + printf("POST MDI RECV_command: node eng/drv: %s/%s\n",mdicmd); + // execute the command execute_command(mdicmd,mdicomm); @@ -306,6 +314,8 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) // receives first, sends second, node commands third // --------------------------------------- + printf("ABOUT to process command %s\n",command); + if (strcmp(command,">CELL") == 0) { receive_cell(); @@ -607,7 +617,9 @@ void MDIEngine::mdi_md() niterate = -1; + printf("PRE @INIT_MD\n"); engine_node("@INIT_MD"); + printf("POST @INIT_MD %s\n",mdicmd); if (strcmp(mdicmd,"EXIT") == 0) return; // add an instance of fix MDI/ENGINE diff --git a/src/library.cpp b/src/library.cpp index a983b24b7f..ace9905451 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -172,9 +172,6 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr) lammps_mpi_init(); if (ptr) ptr_argument_warning(); - printf("LAMMPS instantiate argc %d argv[1] %s argv[2] %s\n", - argc,argv[1],argv[2]); - #ifdef LAMMPS_EXCEPTIONS try { @@ -186,9 +183,7 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr) if (ptr) *ptr = nullptr; } #else - printf("PRE-INSTANTIATE\n"); lmp = new LAMMPS(argc, argv, comm); - printf("POST-INSTANTIATE %p\n",lmp); if (ptr) *ptr = (void *) lmp; #endif return (void *) lmp; From 87446270595ae613c15f527d7d3cfbacc89060e6 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Tue, 5 Apr 2022 16:04:43 -0600 Subject: [PATCH 083/130] Tiny tweaks --- src/KOKKOS/pair_dpd_ext_kokkos.h | 1 - src/KOKKOS/pair_dpd_kokkos.cpp | 3 ++- src/KOKKOS/pair_dpd_kokkos.h | 1 - src/KOKKOS/pair_dpd_tstat_kokkos.cpp | 2 +- src/KOKKOS/pair_dpd_tstat_kokkos.h | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.h b/src/KOKKOS/pair_dpd_ext_kokkos.h index 886f9525f9..bfd6770a98 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.h +++ b/src/KOKKOS/pair_dpd_ext_kokkos.h @@ -79,7 +79,6 @@ class PairDPDExtKokkos : public PairDPDExt { const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; private: - double special_lj[4]; int eflag,vflag; int neighflag, nlocal,newton_pair; diff --git a/src/KOKKOS/pair_dpd_kokkos.cpp b/src/KOKKOS/pair_dpd_kokkos.cpp index b9ecec7bcd..33e3c6f17d 100644 --- a/src/KOKKOS/pair_dpd_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_kokkos.cpp @@ -216,6 +216,7 @@ void PairDPDKokkos::operator() (TagDPDKokkostemplate operator()(TagDPDKokkos(), ii, ev); } + template template KOKKOS_INLINE_FUNCTION @@ -271,7 +272,7 @@ void PairDPDKokkos::operator() (TagDPDKokkos::operator() (TagDPDTstatKokkos Date: Tue, 5 Apr 2022 17:04:23 -0600 Subject: [PATCH 084/130] Add ScatterView --- src/KOKKOS/pair_dpd_ext_kokkos.cpp | 40 ++++++++++++++++++++--- src/KOKKOS/pair_dpd_ext_kokkos.h | 19 ++++++++++- src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp | 40 ++++++++++++++++++++--- src/KOKKOS/pair_dpd_ext_tstat_kokkos.h | 19 ++++++++++- src/KOKKOS/pair_dpd_kokkos.cpp | 41 +++++++++++++++++++++--- src/KOKKOS/pair_dpd_kokkos.h | 23 +++++++++++-- src/KOKKOS/pair_dpd_tstat_kokkos.cpp | 40 ++++++++++++++++++++--- src/KOKKOS/pair_dpd_tstat_kokkos.h | 19 ++++++++++- 8 files changed, 218 insertions(+), 23 deletions(-) diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp index cc6db548f7..81b53dfe41 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -148,6 +148,17 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) d_neighbors = k_list->d_neighbors; d_ilist = k_list->d_ilist; + need_dup = lmp->kokkos->need_dup(); + if (need_dup) { + dup_f = Kokkos::Experimental::create_scatter_view(f); + dup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + dup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } else { + ndup_f = Kokkos::Experimental::create_scatter_view(f); + ndup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + ndup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } + // loop over neighbors of my atoms int inum = list->inum; @@ -179,6 +190,9 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) } } + if (need_dup) + Kokkos::Experimental::contribute(f, dup_f); + if (eflag_global) eng_vdwl += ev.evdwl; if (vflag_global) { virial[0] += ev.v[0]; @@ -192,11 +206,15 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) if (vflag_fdotr) pair_virial_fdotr_compute(this); if (eflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_eatom, dup_eatom); k_eatom.template modify(); k_eatom.template sync(); } if (vflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_vatom, dup_vatom); k_vatom.template modify(); k_vatom.template sync(); } @@ -205,6 +223,13 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); else atomKK->modified(execution_space,F_MASK); + + // free duplicated memory + if (need_dup) { + dup_f = decltype(dup_f)(); + dup_eatom = decltype(dup_eatom)(); + dup_vatom = decltype(dup_vatom)(); + } } /* ---------------------------------------------------------------------- */ @@ -221,7 +246,10 @@ template KOKKOS_INLINE_FUNCTION void PairDPDExtKokkos::operator() (TagDPDExtKokkos, const int &ii, EV_FLOAT &ev) const { - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_f = f; + // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); int i,j,jj,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,fpairx,fpairy,fpairz,fpair; @@ -352,9 +380,13 @@ void PairDPDExtKokkos::ev_tally(EV_FLOAT &ev, const int &i, const in const int EFLAG = eflag; const int VFLAG = vflag_either; - // The eatom and vatom arrays are atomic for Half/Thread neighbor style - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_eatom = k_eatom.view(); - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_vatom = k_vatom.view(); + // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); + + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (EFLAG) { if (eflag_atom) { diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.h b/src/KOKKOS/pair_dpd_ext_kokkos.h index bfd6770a98..0d7b3f1a18 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.h +++ b/src/KOKKOS/pair_dpd_ext_kokkos.h @@ -81,9 +81,26 @@ class PairDPDExtKokkos : public PairDPDExt { private: double special_lj[4]; int eflag,vflag; - int neighflag, nlocal,newton_pair; + int neighflag,nlocal,newton_pair; double dtinvsqrt; + int need_dup; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; + #ifdef DPD_USE_RAN_MARS RandPoolWrap rand_pool; typedef RandWrap rand_type; diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp index 3f022df490..23644011ef 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp @@ -162,6 +162,17 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) d_neighbors = k_list->d_neighbors; d_ilist = k_list->d_ilist; + need_dup = lmp->kokkos->need_dup(); + if (need_dup) { + dup_f = Kokkos::Experimental::create_scatter_view(f); + dup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + dup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } else { + ndup_f = Kokkos::Experimental::create_scatter_view(f); + ndup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + ndup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } + // loop over neighbors of my atoms int inum = list->inum; @@ -193,6 +204,9 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) } } + if (need_dup) + Kokkos::Experimental::contribute(f, dup_f); + if (eflag_global) eng_vdwl += ev.evdwl; if (vflag_global) { virial[0] += ev.v[0]; @@ -206,11 +220,15 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) if (vflag_fdotr) pair_virial_fdotr_compute(this); if (eflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_eatom, dup_eatom); k_eatom.template modify(); k_eatom.template sync(); } if (vflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_vatom, dup_vatom); k_vatom.template modify(); k_vatom.template sync(); } @@ -219,6 +237,13 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); else atomKK->modified(execution_space,F_MASK); + + // free duplicated memory + if (need_dup) { + dup_f = decltype(dup_f)(); + dup_eatom = decltype(dup_eatom)(); + dup_vatom = decltype(dup_vatom)(); + } } /* ---------------------------------------------------------------------- */ @@ -234,8 +259,11 @@ template template KOKKOS_INLINE_FUNCTION void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos, const int &ii, EV_FLOAT &ev) const { + // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_f = f; int i,j,jj,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,fpairx,fpairy,fpairz,fpair; @@ -355,9 +383,13 @@ void PairDPDExtTstatKokkos::ev_tally(EV_FLOAT &ev, const int &i, con const int EFLAG = eflag; const int VFLAG = vflag_either; - // The eatom and vatom arrays are atomic for Half/Thread neighbor style - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_eatom = k_eatom.view(); - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_vatom = k_vatom.view(); + // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); + + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (EFLAG) { if (eflag_atom) { diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h index 2c03bd2ec4..f9d32e2ab0 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h @@ -81,9 +81,26 @@ class PairDPDExtTstatKokkos : public PairDPDExtTstat { private: double special_lj[4]; int eflag,vflag; - int neighflag, nlocal,newton_pair; + int neighflag,nlocal,newton_pair; double dtinvsqrt; + int need_dup; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; + #ifdef DPD_USE_RAN_MARS RandPoolWrap rand_pool; typedef RandWrap rand_type; diff --git a/src/KOKKOS/pair_dpd_kokkos.cpp b/src/KOKKOS/pair_dpd_kokkos.cpp index 33e3c6f17d..6d942f437e 100644 --- a/src/KOKKOS/pair_dpd_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_kokkos.cpp @@ -148,6 +148,17 @@ void PairDPDKokkos::compute(int eflagin, int vflagin) d_neighbors = k_list->d_neighbors; d_ilist = k_list->d_ilist; + need_dup = lmp->kokkos->need_dup(); + if (need_dup) { + dup_f = Kokkos::Experimental::create_scatter_view(f); + dup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + dup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } else { + ndup_f = Kokkos::Experimental::create_scatter_view(f); + ndup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + ndup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } + // loop over neighbors of my atoms int inum = list->inum; @@ -179,6 +190,9 @@ void PairDPDKokkos::compute(int eflagin, int vflagin) } } + if (need_dup) + Kokkos::Experimental::contribute(f, dup_f); + if (eflag_global) eng_vdwl += ev.evdwl; if (vflag_global) { virial[0] += ev.v[0]; @@ -192,11 +206,15 @@ void PairDPDKokkos::compute(int eflagin, int vflagin) if (vflag_fdotr) pair_virial_fdotr_compute(this); if (eflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_eatom, dup_eatom); k_eatom.template modify(); k_eatom.template sync(); } if (vflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_vatom, dup_vatom); k_vatom.template modify(); k_vatom.template sync(); } @@ -205,6 +223,13 @@ void PairDPDKokkos::compute(int eflagin, int vflagin) if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); else atomKK->modified(execution_space,F_MASK); + + // free duplicated memory + if (need_dup) { + dup_f = decltype(dup_f)(); + dup_eatom = decltype(dup_eatom)(); + dup_vatom = decltype(dup_vatom)(); + } } /* ---------------------------------------------------------------------- */ @@ -216,13 +241,15 @@ void PairDPDKokkos::operator() (TagDPDKokkostemplate operator()(TagDPDKokkos(), ii, ev); } - template template KOKKOS_INLINE_FUNCTION void PairDPDKokkos::operator() (TagDPDKokkos, const int &ii, EV_FLOAT &ev) const { - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_f = f; + // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); int i,j,jj,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,fpair; @@ -314,9 +341,13 @@ void PairDPDKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int & const int EFLAG = eflag; const int VFLAG = vflag_either; - // The eatom and vatom arrays are atomic for Half/Thread neighbor style - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_eatom = k_eatom.view(); - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_vatom = k_vatom.view(); + // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); + + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (EFLAG) { if (eflag_atom) { diff --git a/src/KOKKOS/pair_dpd_kokkos.h b/src/KOKKOS/pair_dpd_kokkos.h index 4a12278230..bd7ad4dd4e 100644 --- a/src/KOKKOS/pair_dpd_kokkos.h +++ b/src/KOKKOS/pair_dpd_kokkos.h @@ -78,12 +78,29 @@ class PairDPDKokkos : public PairDPD { void ev_tally(EV_FLOAT &ev, const int &i, const int &j, const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; - protected: + private: double special_lj[4]; int eflag,vflag; - int neighflag, nlocal,newton_pair; + int neighflag,nlocal,newton_pair; double dtinvsqrt; + int need_dup; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; + #ifdef DPD_USE_RAN_MARS RandPoolWrap rand_pool; typedef RandWrap rand_type; @@ -115,7 +132,7 @@ class PairDPDKokkos : public PairDPD { typename AT::t_efloat_1d d_eatom; typename AT::t_virial_array d_vatom; - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const; friend void pair_virial_fdotr_compute(PairDPDKokkos*); diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp index 1aeba85e41..d6b9e4d4b5 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp @@ -161,6 +161,17 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) d_neighbors = k_list->d_neighbors; d_ilist = k_list->d_ilist; + need_dup = lmp->kokkos->need_dup(); + if (need_dup) { + dup_f = Kokkos::Experimental::create_scatter_view(f); + dup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + dup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } else { + ndup_f = Kokkos::Experimental::create_scatter_view(f); + ndup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + ndup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } + // loop over neighbors of my atoms int inum = list->inum; @@ -192,6 +203,9 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) } } + if (need_dup) + Kokkos::Experimental::contribute(f, dup_f); + if (eflag_global) eng_vdwl += ev.evdwl; if (vflag_global) { virial[0] += ev.v[0]; @@ -205,11 +219,15 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) if (vflag_fdotr) pair_virial_fdotr_compute(this); if (eflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_eatom, dup_eatom); k_eatom.template modify(); k_eatom.template sync(); } if (vflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_vatom, dup_vatom); k_vatom.template modify(); k_vatom.template sync(); } @@ -218,6 +236,13 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); else atomKK->modified(execution_space,F_MASK); + + // free duplicated memory + if (need_dup) { + dup_f = decltype(dup_f)(); + dup_eatom = decltype(dup_eatom)(); + dup_vatom = decltype(dup_vatom)(); + } } /* ---------------------------------------------------------------------- */ @@ -234,7 +259,10 @@ template KOKKOS_INLINE_FUNCTION void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos, const int &ii, EV_FLOAT &ev) const { - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_f = f; + // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); int i,j,jj,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,fpair; @@ -314,9 +342,13 @@ void PairDPDTstatKokkos::ev_tally(EV_FLOAT &ev, const int &i, const const int EFLAG = eflag; const int VFLAG = vflag_either; - // The eatom and vatom arrays are atomic for Half/Thread neighbor style - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_eatom = k_eatom.view(); - Kokkos::View::value,Kokkos::MemoryTraits::value> > a_vatom = k_vatom.view(); + // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); + + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (EFLAG) { if (eflag_atom) { diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.h b/src/KOKKOS/pair_dpd_tstat_kokkos.h index 3c8ef6637d..5e5e126299 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.h +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.h @@ -81,9 +81,26 @@ class PairDPDTstatKokkos : public PairDPDTstat { private: double special_lj[4]; int eflag,vflag; - int neighflag, nlocal,newton_pair; + int neighflag,nlocal,newton_pair; double dtinvsqrt; + int need_dup; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; + #ifdef DPD_USE_RAN_MARS RandPoolWrap rand_pool; typedef RandWrap rand_type; From f89a08985eaeca56fd63b87045b6df8112a5a783 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 5 Apr 2022 21:50:36 -0400 Subject: [PATCH 085/130] update DPD-BASIC package examples --- examples/PACKAGES/dpd-basic/README | 20 +- examples/PACKAGES/dpd-basic/dpd/in.dpd | 43 + .../dpd-basic/dpd/log.5Apr22.dpd.g++.1 | 154 ++ .../dpd-basic/dpd/log.5Apr22.dpd.g++.4 | 154 ++ .../dpdext.data => dpd_tstat/cg_spce.data} | 2 +- .../dpd-basic/dpd_tstat/cg_spce_table.pot | 354 +++ .../PACKAGES/dpd-basic/dpd_tstat/in.dpd_tstat | 31 + .../dpd_tstat/log.5Apr22.dpd_tstat.g++.1 | 106 + .../dpd_tstat/log.5Apr22.dpd_tstat.g++.4 | 106 + examples/PACKAGES/dpd-basic/dpdext/in.dpdext | 18 +- .../dpd-basic/dpdext/log.5Apr22.dpdext.g++.1 | 153 ++ .../dpd-basic/dpdext/log.5Apr22.dpdext.g++.4 | 153 ++ .../dpd-basic/dpdext_tstat/cg_spce.data | 2197 +---------------- .../dpd-basic/dpdext_tstat/cg_spce_table.pot | 355 +-- .../{in.cg_spce => in.dpdext_tstat} | 8 +- .../dpdext_tstat/log.10Mar21.dpdext.g++.1 | 293 --- .../dpdext_tstat/log.10Mar21.dpdext.g++.4 | 293 --- .../log.5Apr22.dpdext_tstat.g++.1 | 106 + .../log.5Apr22.dpdext_tstat.g++.4 | 106 + 19 files changed, 1494 insertions(+), 3158 deletions(-) create mode 100644 examples/PACKAGES/dpd-basic/dpd/in.dpd create mode 100644 examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.1 create mode 100644 examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.4 rename examples/PACKAGES/dpd-basic/{dpdext/dpdext.data => dpd_tstat/cg_spce.data} (99%) create mode 100644 examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce_table.pot create mode 100644 examples/PACKAGES/dpd-basic/dpd_tstat/in.dpd_tstat create mode 100644 examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.1 create mode 100644 examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.4 create mode 100644 examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.1 create mode 100644 examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.4 mode change 100644 => 120000 examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data mode change 100644 => 120000 examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot rename examples/PACKAGES/dpd-basic/dpdext_tstat/{in.cg_spce => in.dpdext_tstat} (76%) delete mode 100644 examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.1 delete mode 100644 examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.4 create mode 100644 examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.1 create mode 100644 examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.4 diff --git a/examples/PACKAGES/dpd-basic/README b/examples/PACKAGES/dpd-basic/README index 43d66c4bd3..aec19f4fcb 100644 --- a/examples/PACKAGES/dpd-basic/README +++ b/examples/PACKAGES/dpd-basic/README @@ -1,10 +1,16 @@ -Examples for Extended Dissipative Particle Dynamics (DPD) ---------------------------------------------------------- -This directory contains examples for extended DPD simulations +Examples for Basic Dissipative Particle Dynamics (DPD) +------------------------------------------------------ +This directory contains examples for DPD simulations using +pair styles from the DPD-BASIC package. -1) 'dpdext' - test case (DPD fluid) for 'dpdext' pair style (in.dpdext) and an initial - configuration (dpdext.data) +1) 'dpd' - simple example (DPD fluid) for 'dpd' pair style (in.dpd) -2) 'dpdext_tstat' - test case (coarse-grained SPC/E water) for 'dpdext/tstat' pair style - (in.cg_spce), an initial configuration (dpdext.data) and tabulated potential +2) 'dpd_tstat' - coarse-grained SPC/E water example for 'dpd/tstat' pair style + (in.dpd_tstat), an initial configuration (dpdext.data) and tabulated potential + (cg_spce_table.pot) obtained by bottom-up coarse-graining of the atomistic SPC/E water. + +3) 'dpdext' - simple example (DPD fluid) for 'dpd/ext' pair style (in.dpdext) + +4) 'dpdext_tstat' - coarse-grained SPC/E water example for 'dpd/ext/tstat' pair style + (in.dpdext_tstat), an initial configuration (dpdext.data) and tabulated potential (cg_spce_table.pot) obtained by bottom-up coarse-graining of the atomistic SPC/E water. diff --git a/examples/PACKAGES/dpd-basic/dpd/in.dpd b/examples/PACKAGES/dpd-basic/dpd/in.dpd new file mode 100644 index 0000000000..14612e49a2 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd/in.dpd @@ -0,0 +1,43 @@ +# DPD Fluid + +variable T equal 1.0 +variable rc equal 1.0 +variable rcD equal 1.2 + +units lj +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +### create box and configuration +variable L equal 5.0 +lattice fcc 3.0 +region simBox block 0 ${L} 0 ${L} 0 ${L} +create_box 2 simBox +#create_atoms 1 region simBox +create_atoms 1 random 100 12456 simBox +create_atoms 2 random 100 13245 simBox +mass 1 1.0 +mass 2 2.0 +### + +pair_style dpd ${T} ${rc} 3854262 + +pair_coeff 1 1 25.0 4.5 1.2 +pair_coeff 1 2 25.1 4.51 1.21 +pair_coeff 2 2 25.2 4.52 1.22 + +timestep 0.01 +run_style verlet + +velocity all create ${T} 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 5000 + diff --git a/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.1 b/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.1 new file mode 100644 index 0000000000..4d514c90a6 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.1 @@ -0,0 +1,154 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# DPD Fluid + +variable T equal 1.0 +variable rc equal 1.0 +variable rcD equal 1.2 + +units lj +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +### create box and configuration +variable L equal 5.0 +lattice fcc 3.0 +Lattice spacing in x,y,z = 1.1006424 1.1006424 1.1006424 +region simBox block 0 ${L} 0 ${L} 0 ${L} +region simBox block 0 5 0 ${L} 0 ${L} +region simBox block 0 5 0 5 0 ${L} +region simBox block 0 5 0 5 0 5 +create_box 2 simBox +Created orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + 1 by 1 by 1 MPI processor grid +#create_atoms 1 region simBox +create_atoms 1 random 100 12456 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +create_atoms 2 random 100 13245 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +mass 1 1.0 +mass 2 2.0 +### + +pair_style dpd ${T} ${rc} 3854262 +pair_style dpd 1 ${rc} 3854262 +pair_style dpd 1 1 3854262 + +pair_coeff 1 1 25.0 4.5 1.2 +pair_coeff 1 2 25.1 4.51 1.21 +pair_coeff 2 2 25.2 4.52 1.22 + +timestep 0.01 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 1 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 5000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.52 + ghost atom cutoff = 1.52 + binsize = 0.76, bins = 8 8 8 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair dpd, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.083 | 3.083 | 3.083 Mbytes + Step Time Temp Press + 0 0 1 9.5226009 + 100 1 1.9913643 9.2036029 + 200 2 1.6321732 9.2787957 + 300 3 1.3533438 8.3081433 + 400 4 1.2125884 8.0809065 + 500 5 1.0682216 8.0877925 + 600 6 0.99100473 8.1100319 + 700 7 0.99731243 7.8225195 + 800 8 1.0597693 7.8368218 + 900 9 0.99038588 7.9450569 + 1000 10 1.077129 7.5857015 + 1100 11 0.99070336 7.5138128 + 1200 12 1.013894 7.2794857 + 1300 13 1.0433203 7.7439871 + 1400 14 1.0285528 7.5662235 + 1500 15 0.99180601 7.8376313 + 1600 16 0.98059071 8.0243735 + 1700 17 1.0070947 8.3186893 + 1800 18 0.99507569 7.0786393 + 1900 19 1.0040168 7.8120389 + 2000 20 0.98636164 7.472185 + 2100 21 0.95811165 7.7085985 + 2200 22 0.93568327 6.9424246 + 2300 23 0.92804144 8.1239435 + 2400 24 0.94940276 7.6108611 + 2500 25 1.0535153 8.0772721 + 2600 26 1.0902144 7.5609768 + 2700 27 1.0737336 7.8706755 + 2800 28 0.93074581 7.3699993 + 2900 29 1.0440705 7.6454988 + 3000 30 0.93868164 7.841168 + 3100 31 1.0172025 7.6856163 + 3200 32 1.0405368 7.5325735 + 3300 33 0.96721201 7.8262809 + 3400 34 0.90430758 7.1693921 + 3500 35 0.89938433 7.865845 + 3600 36 0.9907178 7.3462971 + 3700 37 1.0311879 7.8876401 + 3800 38 0.98339132 7.3413929 + 3900 39 1.2111264 8.0968408 + 4000 40 1.062489 7.7315959 + 4100 41 0.94737492 7.3386028 + 4200 42 1.0453816 8.2017304 + 4300 43 0.97024897 7.7379624 + 4400 44 0.9553861 7.8047635 + 4500 45 1.043252 7.7486215 + 4600 46 0.98611474 8.1237053 + 4700 47 0.98624285 8.5801642 + 4800 48 0.97176754 7.1540299 + 4900 49 1.0165401 7.3853841 + 5000 50 0.88359115 7.5541592 +Loop time of 0.359916 on 1 procs for 5000 steps with 200 atoms + +Performance: 12002788.048 tau/day, 13892.116 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 | 0.24932 | 0.24932 | 0.24932 | 0.0 | 69.27 +Neigh | 0.068726 | 0.068726 | 0.068726 | 0.0 | 19.10 +Comm | 0.028691 | 0.028691 | 0.028691 | 0.0 | 7.97 +Output | 0.00066318 | 0.00066318 | 0.00066318 | 0.0 | 0.18 +Modify | 0.0078062 | 0.0078062 | 0.0078062 | 0.0 | 2.17 +Other | | 0.004713 | | | 1.31 + +Nlocal: 200 ave 200 max 200 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 546 ave 546 max 546 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1649 ave 1649 max 1649 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1649 +Ave neighs/atom = 8.245 +Neighbor list builds = 500 +Dangerous builds = 500 + +Total wall time: 0:00:00 diff --git a/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.4 b/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.4 new file mode 100644 index 0000000000..69f849b9d7 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.4 @@ -0,0 +1,154 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# DPD Fluid + +variable T equal 1.0 +variable rc equal 1.0 +variable rcD equal 1.2 + +units lj +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +### create box and configuration +variable L equal 5.0 +lattice fcc 3.0 +Lattice spacing in x,y,z = 1.1006424 1.1006424 1.1006424 +region simBox block 0 ${L} 0 ${L} 0 ${L} +region simBox block 0 5 0 ${L} 0 ${L} +region simBox block 0 5 0 5 0 ${L} +region simBox block 0 5 0 5 0 5 +create_box 2 simBox +Created orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + 1 by 2 by 2 MPI processor grid +#create_atoms 1 region simBox +create_atoms 1 random 100 12456 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +create_atoms 2 random 100 13245 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +mass 1 1.0 +mass 2 2.0 +### + +pair_style dpd ${T} ${rc} 3854262 +pair_style dpd 1 ${rc} 3854262 +pair_style dpd 1 1 3854262 + +pair_coeff 1 1 25.0 4.5 1.2 +pair_coeff 1 2 25.1 4.51 1.21 +pair_coeff 2 2 25.2 4.52 1.22 + +timestep 0.01 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 1 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 5000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.52 + ghost atom cutoff = 1.52 + binsize = 0.76, bins = 8 8 8 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair dpd, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.064 | 3.064 | 3.064 Mbytes + Step Time Temp Press + 0 0 1 8.603339 + 100 1 1.8691059 8.9058297 + 200 2 1.4500635 8.7420141 + 300 3 1.3089453 8.3985981 + 400 4 1.1647803 8.2948808 + 500 5 1.1399445 7.7421817 + 600 6 1.0297918 7.2040397 + 700 7 1.046713 7.6115758 + 800 8 0.93523712 7.6885563 + 900 9 0.94701493 7.9662712 + 1000 10 0.99302416 7.7606189 + 1100 11 0.98975674 7.5207427 + 1200 12 0.98661662 7.3565222 + 1300 13 1.0289377 7.6110453 + 1400 14 0.9982501 7.8065701 + 1500 15 1.0043888 7.3957185 + 1600 16 1.0175816 7.7885955 + 1700 17 1.0252117 7.5076258 + 1800 18 1.0275139 8.1052823 + 1900 19 1.0021054 7.0385989 + 2000 20 1.0489009 7.7138149 + 2100 21 0.91250488 7.3540839 + 2200 22 0.92470996 7.9600233 + 2300 23 0.96932725 7.3106045 + 2400 24 0.93443088 7.4594635 + 2500 25 0.95596038 7.2544715 + 2600 26 1.0368594 7.6229263 + 2700 27 0.94639332 7.4869636 + 2800 28 0.99917354 7.9806636 + 2900 29 0.95048071 7.0086404 + 3000 30 0.95226181 7.7807205 + 3100 31 0.95864429 7.8059442 + 3200 32 0.85678761 7.3416027 + 3300 33 0.95951096 7.3467158 + 3400 34 0.97665772 8.2900991 + 3500 35 0.92885927 7.5385993 + 3600 36 1.0455015 8.0627999 + 3700 37 0.91911809 8.0371736 + 3800 38 0.92022241 7.5803999 + 3900 39 1.0465522 7.6920189 + 4000 40 0.98568475 7.4529825 + 4100 41 1.0389372 7.2273346 + 4200 42 1.0257545 7.6081878 + 4300 43 1.0937573 8.2158237 + 4400 44 1.0908817 7.5021567 + 4500 45 1.0482874 7.5924368 + 4600 46 1.1468439 8.0285157 + 4700 47 1.119683 8.3365123 + 4800 48 1.0963877 7.51772 + 4900 49 1.0766762 7.3137035 + 5000 50 1.0359203 7.7354572 +Loop time of 0.148597 on 4 procs for 5000 steps with 200 atoms + +Performance: 29071936.422 tau/day, 33648.075 timesteps/s +98.8% 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.059602 | 0.063397 | 0.068622 | 1.3 | 42.66 +Neigh | 0.017747 | 0.018193 | 0.018698 | 0.3 | 12.24 +Comm | 0.055145 | 0.061014 | 0.065369 | 1.5 | 41.06 +Output | 0.00042708 | 0.00050725 | 0.00071024 | 0.0 | 0.34 +Modify | 0.0023494 | 0.002532 | 0.0026434 | 0.2 | 1.70 +Other | | 0.002953 | | | 1.99 + +Nlocal: 50 ave 52 max 48 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Nghost: 292.75 ave 299 max 287 min +Histogram: 1 0 1 0 0 0 1 0 0 1 +Neighs: 413.5 ave 441 max 399 min +Histogram: 2 0 0 1 0 0 0 0 0 1 + +Total # of neighbors = 1654 +Ave neighs/atom = 8.27 +Neighbor list builds = 500 +Dangerous builds = 500 + +Total wall time: 0:00:00 diff --git a/examples/PACKAGES/dpd-basic/dpdext/dpdext.data b/examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce.data similarity index 99% rename from examples/PACKAGES/dpd-basic/dpdext/dpdext.data rename to examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce.data index dddbf6ad6c..d487e2c73c 100644 --- a/examples/PACKAGES/dpd-basic/dpdext/dpdext.data +++ b/examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce.data @@ -1,4 +1,4 @@ - DPD Fluid + Coarse-Grained SPC/E Water 2180 atoms diff --git a/examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce_table.pot b/examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce_table.pot new file mode 100644 index 0000000000..853ff4bec0 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce_table.pot @@ -0,0 +1,354 @@ +VOTCA +N 351 R 2.0 9.0 + +1 2.000000E+00 2.190202E+01 7.229762E+01 +2 2.020000E+00 2.048957E+01 6.887333E+01 +3 2.040000E+00 1.915004E+01 6.500604E+01 +4 2.060000E+00 1.789228E+01 6.069573E+01 +5 2.080000E+00 1.672516E+01 5.594242E+01 +6 2.100000E+00 1.565754E+01 5.074609E+01 +7 2.120000E+00 1.467088E+01 4.787307E+01 +8 2.140000E+00 1.374450E+01 4.471740E+01 +9 2.160000E+00 1.288407E+01 4.127908E+01 +10 2.180000E+00 1.209522E+01 3.755811E+01 +11 2.200000E+00 1.138363E+01 3.355449E+01 +12 2.220000E+00 1.072913E+01 3.188695E+01 +13 2.240000E+00 1.010845E+01 3.017359E+01 +14 2.260000E+00 9.522496E+00 2.841440E+01 +15 2.280000E+00 8.972182E+00 2.660938E+01 +16 2.300000E+00 8.458426E+00 2.475854E+01 +17 2.320000E+00 8.014166E+00 2.006698E+01 +18 2.340000E+00 7.639767E+00 1.777244E+01 +19 2.360000E+00 7.287288E+00 1.787493E+01 +20 2.380000E+00 6.908790E+00 2.037445E+01 +21 2.400000E+00 6.456330E+00 2.527099E+01 +22 2.420000E+00 5.858025E+00 3.384695E+01 +23 2.440000E+00 5.130955E+00 3.814748E+01 +24 2.460000E+00 4.360629E+00 3.817257E+01 +25 2.480000E+00 3.632555E+00 3.392224E+01 +26 2.500000E+00 3.032242E+00 2.539647E+01 +27 2.520000E+00 2.547993E+00 2.297813E+01 +28 2.540000E+00 2.115131E+00 2.025763E+01 +29 2.560000E+00 1.739702E+00 1.723497E+01 +30 2.580000E+00 1.427747E+00 1.391013E+01 +31 2.600000E+00 1.185311E+00 1.028314E+01 +32 2.620000E+00 9.860176E-01 9.578245E+00 +33 2.640000E+00 8.048986E-01 8.465708E+00 +34 2.660000E+00 6.501069E-01 6.945526E+00 +35 2.680000E+00 5.297952E-01 5.017699E+00 +36 2.700000E+00 4.521166E-01 2.682227E+00 +37 2.720000E+00 3.986447E-01 2.615311E+00 +38 2.740000E+00 3.494900E-01 2.250522E+00 +39 2.760000E+00 3.106097E-01 1.587859E+00 +40 2.780000E+00 2.879614E-01 6.273237E-01 +41 2.800000E+00 2.875026E-01 -6.310851E-01 +42 2.820000E+00 3.002733E-01 -6.543549E-01 +43 2.840000E+00 3.140112E-01 -7.277911E-01 +44 2.860000E+00 3.297194E-01 -8.513935E-01 +45 2.880000E+00 3.484014E-01 -1.025162E+00 +46 2.900000E+00 3.710604E-01 -1.249097E+00 +47 2.920000E+00 3.974884E-01 -1.380483E+00 +48 2.940000E+00 4.257507E-01 -1.432530E+00 +49 2.960000E+00 4.542607E-01 -1.405240E+00 +50 2.980000E+00 4.814314E-01 -1.298611E+00 +51 3.000000E+00 5.056762E-01 -1.112645E+00 +52 3.020000E+00 5.266502E-01 -9.832894E-01 +53 3.040000E+00 5.449492E-01 -8.451544E-01 +54 3.060000E+00 5.603978E-01 -6.982396E-01 +55 3.080000E+00 5.728203E-01 -5.425450E-01 +56 3.100000E+00 5.820411E-01 -3.780706E-01 +57 3.120000E+00 5.882509E-01 -2.409307E-01 +58 3.140000E+00 5.915991E-01 -9.190908E-02 +59 3.160000E+00 5.918481E-01 6.899430E-02 +60 3.180000E+00 5.887601E-01 2.417794E-01 +61 3.200000E+00 5.820977E-01 4.264463E-01 +62 3.220000E+00 5.733491E-01 4.528343E-01 +63 3.240000E+00 5.638075E-01 5.057356E-01 +64 3.260000E+00 5.529429E-01 5.851503E-01 +65 3.280000E+00 5.402248E-01 6.910784E-01 +66 3.300000E+00 5.251230E-01 8.235199E-01 +67 3.320000E+00 5.086524E-01 8.236482E-01 +68 3.340000E+00 4.921725E-01 8.244583E-01 +69 3.360000E+00 4.756696E-01 8.259503E-01 +70 3.380000E+00 4.591299E-01 8.281240E-01 +71 3.400000E+00 4.425400E-01 8.309796E-01 +72 3.420000E+00 4.259181E-01 8.311861E-01 +73 3.440000E+00 4.092937E-01 8.312292E-01 +74 3.460000E+00 3.926700E-01 8.311089E-01 +75 3.480000E+00 3.760504E-01 8.308252E-01 +76 3.500000E+00 3.594381E-01 8.303781E-01 +77 3.520000E+00 3.428394E-01 8.295412E-01 +78 3.540000E+00 3.262547E-01 8.289646E-01 +79 3.560000E+00 3.096790E-01 8.286483E-01 +80 3.580000E+00 2.931071E-01 8.285923E-01 +81 3.600000E+00 2.765336E-01 8.287966E-01 +82 3.620000E+00 2.599901E-01 8.254306E-01 +83 3.640000E+00 2.435212E-01 8.213359E-01 +84 3.660000E+00 2.271415E-01 8.165124E-01 +85 3.680000E+00 2.108656E-01 8.109603E-01 +86 3.700000E+00 1.947080E-01 8.046794E-01 +87 3.720000E+00 1.790243E-01 7.653050E-01 +88 3.740000E+00 1.640312E-01 7.356166E-01 +89 3.760000E+00 1.495351E-01 7.156143E-01 +90 3.780000E+00 1.353421E-01 7.052980E-01 +91 3.800000E+00 1.212586E-01 7.046676E-01 +92 3.820000E+00 1.072429E-01 6.965706E-01 +93 3.840000E+00 9.340878E-02 6.865180E-01 +94 3.860000E+00 7.979524E-02 6.745098E-01 +95 3.880000E+00 6.644142E-02 6.605462E-01 +96 3.900000E+00 5.338643E-02 6.446270E-01 +97 3.920000E+00 4.067486E-02 6.268536E-01 +98 3.940000E+00 2.829935E-02 6.110218E-01 +99 3.960000E+00 1.622105E-02 5.971317E-01 +100 3.980000E+00 4.401131E-03 5.851833E-01 +101 4.000000E+00 -7.199230E-03 5.751764E-01 +102 4.020000E+00 -1.856170E-02 5.611971E-01 +103 4.040000E+00 -2.965216E-02 5.479743E-01 +104 4.060000E+00 -4.048572E-02 5.355079E-01 +105 4.080000E+00 -5.107752E-02 5.237981E-01 +106 4.100000E+00 -6.144268E-02 5.128447E-01 +107 4.120000E+00 -7.151117E-02 4.939504E-01 +108 4.140000E+00 -8.119856E-02 4.747353E-01 +109 4.160000E+00 -9.049845E-02 4.551994E-01 +110 4.180000E+00 -9.940440E-02 4.353427E-01 +111 4.200000E+00 -1.079100E-01 4.151651E-01 +112 4.220000E+00 -1.159565E-01 3.900062E-01 +113 4.240000E+00 -1.235312E-01 3.679865E-01 +114 4.260000E+00 -1.306969E-01 3.491061E-01 +115 4.280000E+00 -1.375164E-01 3.333651E-01 +116 4.300000E+00 -1.440524E-01 3.207633E-01 +117 4.320000E+00 -1.503014E-01 3.040292E-01 +118 4.340000E+00 -1.562092E-01 2.866389E-01 +119 4.360000E+00 -1.617626E-01 2.685925E-01 +120 4.380000E+00 -1.669485E-01 2.498899E-01 +121 4.400000E+00 -1.717538E-01 2.305311E-01 +122 4.420000E+00 -1.760941E-01 2.036400E-01 +123 4.440000E+00 -1.799054E-01 1.776469E-01 +124 4.460000E+00 -1.832059E-01 1.525518E-01 +125 4.480000E+00 -1.860135E-01 1.283546E-01 +126 4.500000E+00 -1.883461E-01 1.050554E-01 +127 4.520000E+00 -1.902569E-01 8.558005E-02 +128 4.540000E+00 -1.917515E-01 6.344105E-02 +129 4.560000E+00 -1.927768E-01 3.863842E-02 +130 4.580000E+00 -1.932793E-01 1.117216E-02 +131 4.600000E+00 -1.932059E-01 -1.895774E-02 +132 4.620000E+00 -1.926829E-01 -3.331832E-02 +133 4.640000E+00 -1.918741E-01 -4.753697E-02 +134 4.660000E+00 -1.907824E-01 -6.161370E-02 +135 4.680000E+00 -1.894105E-01 -7.554851E-02 +136 4.700000E+00 -1.877614E-01 -8.934140E-02 +137 4.720000E+00 -1.859159E-01 -9.580751E-02 +138 4.740000E+00 -1.839049E-01 -1.058976E-01 +139 4.760000E+00 -1.816559E-01 -1.196116E-01 +140 4.780000E+00 -1.790963E-01 -1.369495E-01 +141 4.800000E+00 -1.761537E-01 -1.579114E-01 +142 4.820000E+00 -1.728280E-01 -1.744216E-01 +143 4.840000E+00 -1.691864E-01 -1.895036E-01 +144 4.860000E+00 -1.652574E-01 -2.031575E-01 +145 4.880000E+00 -1.610696E-01 -2.153832E-01 +146 4.900000E+00 -1.566516E-01 -2.261808E-01 +147 4.920000E+00 -1.521084E-01 -2.290714E-01 +148 4.940000E+00 -1.474515E-01 -2.375453E-01 +149 4.960000E+00 -1.425693E-01 -2.516026E-01 +150 4.980000E+00 -1.373502E-01 -2.712432E-01 +151 5.000000E+00 -1.316824E-01 -2.964672E-01 +152 5.020000E+00 -1.257009E-01 -3.016666E-01 +153 5.040000E+00 -1.196162E-01 -3.067953E-01 +154 5.060000E+00 -1.134296E-01 -3.118535E-01 +155 5.080000E+00 -1.071425E-01 -3.168409E-01 +156 5.100000E+00 -1.007564E-01 -3.217577E-01 +157 5.120000E+00 -9.430843E-02 -3.230025E-01 +158 5.140000E+00 -8.783782E-02 -3.240216E-01 +159 5.160000E+00 -8.134907E-02 -3.248150E-01 +160 5.180000E+00 -7.484672E-02 -3.253827E-01 +161 5.200000E+00 -6.833527E-02 -3.257248E-01 +162 5.220000E+00 -6.171989E-02 -3.350608E-01 +163 5.240000E+00 -5.496291E-02 -3.398853E-01 +164 5.260000E+00 -4.815456E-02 -3.401983E-01 +165 5.280000E+00 -4.138506E-02 -3.359997E-01 +166 5.300000E+00 -3.474465E-02 -3.272895E-01 +167 5.320000E+00 -2.866480E-02 -2.819209E-01 +168 5.340000E+00 -2.341879E-02 -2.439062E-01 +169 5.360000E+00 -1.885953E-02 -2.132454E-01 +170 5.380000E+00 -1.483994E-02 -1.899386E-01 +171 5.400000E+00 -1.121296E-02 -1.739857E-01 +172 5.420000E+00 -7.974056E-03 -1.497398E-01 +173 5.440000E+00 -5.229953E-03 -1.245058E-01 +174 5.460000E+00 -3.000413E-03 -9.828350E-02 +175 5.480000E+00 -1.305201E-03 -7.107305E-02 +176 5.500000E+00 -1.640790E-04 -4.287441E-02 +177 5.520000E+00 6.371635E-04 -3.612657E-02 +178 5.540000E+00 1.236053E-03 -2.263906E-02 +179 5.560000E+00 1.497795E-03 -2.411882E-03 +180 5.580000E+00 1.287597E-03 2.455496E-02 +181 5.600000E+00 4.706651E-04 5.826147E-02 +182 5.620000E+00 -7.026386E-04 5.910929E-02 +183 5.640000E+00 -1.895322E-03 6.019943E-02 +184 5.660000E+00 -3.112231E-03 6.153190E-02 +185 5.680000E+00 -4.358213E-03 6.310668E-02 +186 5.700000E+00 -5.638114E-03 6.492378E-02 +187 5.720000E+00 -6.949688E-03 6.610584E-02 +188 5.740000E+00 -8.277238E-03 6.652145E-02 +189 5.760000E+00 -9.605436E-03 6.617062E-02 +190 5.780000E+00 -1.091895E-02 6.505335E-02 +191 5.800000E+00 -1.220246E-02 6.316963E-02 +192 5.820000E+00 -1.341489E-02 5.820182E-02 +193 5.840000E+00 -1.453566E-02 5.400257E-02 +194 5.860000E+00 -1.558012E-02 5.057189E-02 +195 5.880000E+00 -1.656366E-02 4.790978E-02 +196 5.900000E+00 -1.750164E-02 4.601622E-02 +197 5.920000E+00 -1.840088E-02 4.358369E-02 +198 5.940000E+00 -1.923199E-02 3.920163E-02 +199 5.960000E+00 -1.995595E-02 3.287003E-02 +200 5.980000E+00 -2.053379E-02 2.458889E-02 +201 6.000000E+00 -2.092651E-02 1.435822E-02 +202 6.020000E+00 -2.120502E-02 1.352840E-02 +203 6.040000E+00 -2.146907E-02 1.291186E-02 +204 6.060000E+00 -2.172292E-02 1.250861E-02 +205 6.080000E+00 -2.197084E-02 1.231865E-02 +206 6.100000E+00 -2.221709E-02 1.234198E-02 +207 6.120000E+00 -2.246474E-02 1.237271E-02 +208 6.140000E+00 -2.270998E-02 1.210114E-02 +209 6.160000E+00 -2.294677E-02 1.152726E-02 +210 6.180000E+00 -2.316905E-02 1.065107E-02 +211 6.200000E+00 -2.337079E-02 9.472569E-03 +212 6.220000E+00 -2.332237E-02 -1.276224E-02 +213 6.240000E+00 -2.292243E-02 -2.567822E-02 +214 6.260000E+00 -2.235736E-02 -2.927535E-02 +215 6.280000E+00 -2.181354E-02 -2.355364E-02 +216 6.300000E+00 -2.147734E-02 -8.513096E-03 +217 6.320000E+00 -2.141633E-02 1.466366E-03 +218 6.340000E+00 -2.149820E-02 5.775798E-03 +219 6.360000E+00 -2.160956E-02 4.415202E-03 +220 6.380000E+00 -2.163701E-02 -2.615423E-03 +221 6.400000E+00 -2.146714E-02 -1.531608E-02 +222 6.420000E+00 -2.107402E-02 -2.337955E-02 +223 6.440000E+00 -2.055660E-02 -2.774728E-02 +224 6.460000E+00 -1.998877E-02 -2.841924E-02 +225 6.480000E+00 -1.944446E-02 -2.539546E-02 +226 6.500000E+00 -1.899759E-02 -1.867591E-02 +227 6.520000E+00 -1.869042E-02 -1.259095E-02 +228 6.540000E+00 -1.847196E-02 -9.804901E-03 +229 6.560000E+00 -1.827623E-02 -1.031775E-02 +230 6.580000E+00 -1.803726E-02 -1.412951E-02 +231 6.600000E+00 -1.768906E-02 -2.124018E-02 +232 6.620000E+00 -1.710949E-02 -3.551655E-02 +233 6.640000E+00 -1.631641E-02 -4.259122E-02 +234 6.660000E+00 -1.545385E-02 -4.246419E-02 +235 6.680000E+00 -1.466585E-02 -3.513545E-02 +236 6.700000E+00 -1.409644E-02 -2.060502E-02 +237 6.720000E+00 -1.374966E-02 -1.461056E-02 +238 6.740000E+00 -1.349054E-02 -1.183851E-02 +239 6.760000E+00 -1.325464E-02 -1.228886E-02 +240 6.780000E+00 -1.297750E-02 -1.596163E-02 +241 6.800000E+00 -1.259469E-02 -2.285680E-02 +242 6.820000E+00 -1.213049E-02 -2.349903E-02 +243 6.840000E+00 -1.165728E-02 -2.375897E-02 +244 6.860000E+00 -1.118268E-02 -2.363664E-02 +245 6.880000E+00 -1.071436E-02 -2.313203E-02 +246 6.900000E+00 -1.025995E-02 -2.224514E-02 +247 6.920000E+00 -9.817276E-03 -2.203990E-02 +248 6.940000E+00 -9.377653E-03 -2.193988E-02 +249 6.960000E+00 -8.938979E-03 -2.194508E-02 +250 6.980000E+00 -8.499148E-03 -2.205550E-02 +251 7.000000E+00 -8.056057E-03 -2.227113E-02 +252 7.020000E+00 -7.597830E-03 -2.345789E-02 +253 7.040000E+00 -7.121492E-03 -2.408210E-02 +254 7.060000E+00 -6.638296E-03 -2.414376E-02 +255 7.080000E+00 -6.159492E-03 -2.364288E-02 +256 7.100000E+00 -5.696331E-03 -2.257946E-02 +257 7.120000E+00 -5.301441E-03 -1.729553E-02 +258 7.140000E+00 -4.989070E-03 -1.432759E-02 +259 7.160000E+00 -4.712898E-03 -1.367562E-02 +260 7.180000E+00 -4.426605E-03 -1.533964E-02 +261 7.200000E+00 -4.083872E-03 -1.931964E-02 +262 7.220000E+00 -3.631995E-03 -2.538390E-02 +263 7.240000E+00 -3.087883E-03 -2.854317E-02 +264 7.260000E+00 -2.509635E-03 -2.879748E-02 +265 7.280000E+00 -1.955351E-03 -2.614680E-02 +266 7.300000E+00 -1.483130E-03 -2.059115E-02 +267 7.320000E+00 -1.113389E-03 -1.639767E-02 +268 7.340000E+00 -8.266321E-04 -1.229279E-02 +269 7.360000E+00 -6.210869E-04 -8.276492E-03 +270 7.380000E+00 -4.949818E-04 -4.348786E-03 +271 7.400000E+00 -4.465449E-04 -5.096684E-04 +272 7.420000E+00 -5.304321E-04 8.162452E-03 +273 7.440000E+00 -7.436056E-04 1.241897E-02 +274 7.460000E+00 -9.977534E-04 1.225988E-02 +275 7.480000E+00 -1.204563E-03 7.685191E-03 +276 7.500000E+00 -1.275724E-03 -1.305104E-03 +277 7.520000E+00 -1.199415E-03 -5.916706E-03 +278 7.540000E+00 -1.055417E-03 -8.074089E-03 +279 7.560000E+00 -8.928131E-04 -7.777253E-03 +280 7.580000E+00 -7.606883E-04 -5.026198E-03 +281 7.600000E+00 -7.081267E-04 1.790768E-04 +282 7.620000E+00 -7.213835E-04 1.157786E-03 +283 7.640000E+00 -7.548855E-04 2.203601E-03 +284 7.660000E+00 -8.099749E-04 3.316523E-03 +285 7.680000E+00 -8.879938E-04 4.496550E-03 +286 7.700000E+00 -9.902843E-04 5.743685E-03 +287 7.720000E+00 -1.122403E-03 7.421734E-03 +288 7.740000E+00 -1.285295E-03 8.820936E-03 +289 7.760000E+00 -1.473382E-03 9.941291E-03 +290 7.780000E+00 -1.681087E-03 1.078280E-02 +291 7.800000E+00 -1.902835E-03 1.134546E-02 +292 7.820000E+00 -2.225281E-03 2.008573E-02 +293 7.840000E+00 -2.673724E-03 2.394500E-02 +294 7.860000E+00 -3.150542E-03 2.292328E-02 +295 7.880000E+00 -3.558115E-03 1.702056E-02 +296 7.900000E+00 -3.798824E-03 6.236836E-03 +297 7.920000E+00 -3.844315E-03 -1.142168E-03 +298 7.940000E+00 -3.774961E-03 -5.247538E-03 +299 7.960000E+00 -3.656237E-03 -6.079274E-03 +300 7.980000E+00 -3.553615E-03 -3.637376E-03 +301 8.000000E+00 -3.532566E-03 2.078155E-03 +302 8.020000E+00 -3.611956E-03 5.494873E-03 +303 8.040000E+00 -3.737724E-03 6.716053E-03 +304 8.060000E+00 -3.865961E-03 5.741694E-03 +305 8.080000E+00 -3.952755E-03 2.571796E-03 +306 8.100000E+00 -3.954196E-03 -2.793640E-03 +307 8.120000E+00 -3.873685E-03 -5.086591E-03 +308 8.140000E+00 -3.757567E-03 -6.354313E-03 +309 8.160000E+00 -3.626347E-03 -6.596805E-03 +310 8.180000E+00 -3.500530E-03 -5.814068E-03 +311 8.200000E+00 -3.400620E-03 -4.006101E-03 +312 8.220000E+00 -3.334411E-03 -2.730570E-03 +313 8.240000E+00 -3.286762E-03 -2.150229E-03 +314 8.260000E+00 -3.243768E-03 -2.265076E-03 +315 8.280000E+00 -3.191524E-03 -3.075114E-03 +316 8.300000E+00 -3.116129E-03 -4.580340E-03 +317 8.320000E+00 -2.964210E-03 -1.014102E-02 +318 8.340000E+00 -2.729309E-03 -1.287854E-02 +319 8.360000E+00 -2.467889E-03 -1.279292E-02 +320 8.380000E+00 -2.236413E-03 -9.884157E-03 +321 8.400000E+00 -2.091344E-03 -4.152240E-03 +322 8.420000E+00 -2.034875E-03 -1.692189E-03 +323 8.440000E+00 -2.015752E-03 -4.177491E-04 +324 8.460000E+00 -2.010261E-03 -3.289192E-04 +325 8.480000E+00 -1.994691E-03 -1.425700E-03 +326 8.500000E+00 -1.945329E-03 -3.708091E-03 +327 8.520000E+00 -1.867098E-03 -4.115259E-03 +328 8.540000E+00 -1.780711E-03 -4.523663E-03 +329 8.560000E+00 -1.686143E-03 -4.933304E-03 +330 8.580000E+00 -1.583370E-03 -5.344181E-03 +331 8.600000E+00 -1.472368E-03 -5.756296E-03 +332 8.620000E+00 -1.328792E-03 -8.394009E-03 +333 8.640000E+00 -1.144899E-03 -9.787974E-03 +334 8.660000E+00 -9.455644E-04 -9.938189E-03 +335 8.680000E+00 -7.556630E-04 -8.844656E-03 +336 8.700000E+00 -6.000698E-04 -6.507373E-03 +337 8.720000E+00 -5.364035E-04 -3.286769E-04 +338 8.740000E+00 -5.681458E-04 3.033482E-03 +339 8.760000E+00 -6.389659E-04 3.579102E-03 +340 8.780000E+00 -6.925330E-04 1.308185E-03 +341 8.800000E+00 -6.725164E-04 -3.779270E-03 +342 8.820000E+00 -5.113768E-04 -1.169180E-02 +343 8.840000E+00 -2.305599E-04 -1.574700E-02 +344 8.860000E+00 9.278768E-05 -1.594487E-02 +345 8.880000E+00 3.815195E-04 -1.228542E-02 +346 8.900000E+00 5.584889E-04 -4.768636E-03 +347 8.920000E+00 6.079481E-04 -2.335309E-04 +348 8.940000E+00 5.700798E-04 3.964121E-03 +349 8.960000E+00 4.516330E-04 7.824320E-03 +350 8.980000E+00 2.593567E-04 1.134707E-02 +351 9.000000E+00 0.000000E+00 1.453236E-02 diff --git a/examples/PACKAGES/dpd-basic/dpd_tstat/in.dpd_tstat b/examples/PACKAGES/dpd-basic/dpd_tstat/in.dpd_tstat new file mode 100644 index 0000000000..a7fff24a23 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd_tstat/in.dpd_tstat @@ -0,0 +1,31 @@ +# Coarse-Grained SPC/E Water + +variable T equal 300.0 +variable rc equal 9.0 +variable rcD equal 10.0 + +units real +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +read_data cg_spce.data + +pair_style hybrid/overlay table spline 1000 dpd/tstat ${T} ${T} ${rc} 385262 + +pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} +pair_coeff 1 1 dpd/tstat 10.0 ${rcD} + +timestep 1.0 +run_style verlet + +velocity all create ${T} 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 1000 diff --git a/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.1 b/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.1 new file mode 100644 index 0000000000..428ee4651a --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.1 @@ -0,0 +1,106 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Coarse-Grained SPC/E Water + +variable T equal 300.0 +variable rc equal 9.0 +variable rcD equal 10.0 + +units real +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +read_data cg_spce.data +Reading data file ... + orthogonal box = (0 0 0) to (40.31 40.31 40.31) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 2180 atoms + read_data CPU = 0.003 seconds + +pair_style hybrid/overlay table spline 1000 dpd/tstat ${T} ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 300 ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 300 9 385262 + +pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} +pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 +WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. +WARNING: Should only be flagged at inflection points (src/pair_table.cpp:465) +pair_coeff 1 1 dpd/tstat 10.0 ${rcD} +pair_coeff 1 1 dpd/tstat 10.0 10 + +timestep 1.0 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 300 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 1000 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 7 7 7 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair table, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard + (2) pair dpd/tstat, perpetual, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +Per MPI rank memory allocation (min/avg/max) = 5.38 | 5.38 | 5.38 Mbytes + Step Time Temp Press + 0 0 300 7459.7935 + 100 100 309.27219 6997.2438 + 200 200 311.23318 9940.3922 + 300 300 300.14145 7970.3486 + 400 400 293.17924 8390.7272 + 500 500 285.9647 7304.1147 + 600 600 291.15512 6605.1675 + 700 700 294.54557 7708.3815 + 800 800 288.72442 8641.2675 + 900 900 294.83288 7145.1684 + 1000 1000 291.12446 8525.4556 +Loop time of 10.1894 on 1 procs for 1000 steps with 2180 atoms + +Performance: 8.479 ns/day, 2.830 hours/ns, 98.141 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 | 10.02 | 10.02 | 10.02 | 0.0 | 98.34 +Neigh | 0.087623 | 0.087623 | 0.087623 | 0.0 | 0.86 +Comm | 0.055526 | 0.055526 | 0.055526 | 0.0 | 0.54 +Output | 0.00026505 | 0.00026505 | 0.00026505 | 0.0 | 0.00 +Modify | 0.013958 | 0.013958 | 0.013958 | 0.0 | 0.14 +Other | | 0.01163 | | | 0.11 + +Nlocal: 2180 ave 2180 max 2180 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 6741 ave 6741 max 6741 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 261567 ave 261567 max 261567 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 261567 +Ave neighs/atom = 119.98486 +Neighbor list builds = 14 +Dangerous builds = 0 +Total wall time: 0:00:10 diff --git a/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.4 b/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.4 new file mode 100644 index 0000000000..f20bde0e6b --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.4 @@ -0,0 +1,106 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Coarse-Grained SPC/E Water + +variable T equal 300.0 +variable rc equal 9.0 +variable rcD equal 10.0 + +units real +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +read_data cg_spce.data +Reading data file ... + orthogonal box = (0 0 0) to (40.31 40.31 40.31) + 1 by 2 by 2 MPI processor grid + reading atoms ... + 2180 atoms + read_data CPU = 0.003 seconds + +pair_style hybrid/overlay table spline 1000 dpd/tstat ${T} ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 300 ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 300 9 385262 + +pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} +pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 +WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. +WARNING: Should only be flagged at inflection points (src/pair_table.cpp:465) +pair_coeff 1 1 dpd/tstat 10.0 ${rcD} +pair_coeff 1 1 dpd/tstat 10.0 10 + +timestep 1.0 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 300 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 1000 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 7 7 7 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair table, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard + (2) pair dpd/tstat, perpetual, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +Per MPI rank memory allocation (min/avg/max) = 3.695 | 3.696 | 3.697 Mbytes + Step Time Temp Press + 0 0 300 7929.9249 + 100 100 305.51763 8531.8105 + 200 200 304.43334 8697.989 + 300 300 292.42805 6865.4712 + 400 400 300.66447 7606.6995 + 500 500 298.43456 8713.2403 + 600 600 298.10981 6913.5475 + 700 700 297.39737 9121.8642 + 800 800 298.23888 7833.1307 + 900 900 293.91793 8423.8417 + 1000 1000 299.65933 7974.9976 +Loop time of 2.82436 on 4 procs for 1000 steps with 2180 atoms + +Performance: 30.591 ns/day, 0.785 hours/ns, 354.062 timesteps/s +99.7% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.6238 | 2.644 | 2.6909 | 1.7 | 93.61 +Neigh | 0.021524 | 0.021958 | 0.022778 | 0.3 | 0.78 +Comm | 0.10035 | 0.1479 | 0.16842 | 7.2 | 5.24 +Output | 0.00019058 | 0.00021173 | 0.00026852 | 0.0 | 0.01 +Modify | 0.0041395 | 0.0041846 | 0.0042798 | 0.1 | 0.15 +Other | | 0.006091 | | | 0.22 + +Nlocal: 545 ave 559 max 536 min +Histogram: 1 0 1 1 0 0 0 0 0 1 +Nghost: 3613.5 ave 3634 max 3604 min +Histogram: 1 2 0 0 0 0 0 0 0 1 +Neighs: 65402 ave 68101 max 63621 min +Histogram: 1 1 0 0 1 0 0 0 0 1 + +Total # of neighbors = 261608 +Ave neighs/atom = 120.00367 +Neighbor list builds = 14 +Dangerous builds = 0 +Total wall time: 0:00:02 diff --git a/examples/PACKAGES/dpd-basic/dpdext/in.dpdext b/examples/PACKAGES/dpd-basic/dpdext/in.dpdext index 726f3a7b39..9f87743fed 100644 --- a/examples/PACKAGES/dpd-basic/dpdext/in.dpdext +++ b/examples/PACKAGES/dpd-basic/dpdext/in.dpdext @@ -4,9 +4,9 @@ variable T equal 1.0 variable rc equal 1.0 variable rcD equal 1.2 -units lj +units lj boundary p p p -atom_style atomic +atom_style atomic dimension 3 newton on comm_modify vel yes @@ -16,29 +16,27 @@ variable L equal 5.0 lattice fcc 3.0 region simBox block 0 ${L} 0 ${L} 0 ${L} create_box 2 simBox -#create_atoms 1 region simBox -create_atoms 1 random 100 132456 simBox -create_atoms 2 random 100 132456 simBox +create_atoms 1 random 100 12456 simBox +create_atoms 2 random 100 13245 simBox mass 1 1.0 mass 2 2.0 ### -pair_style dpd/ext ${T} ${rc} 3854262 +pair_style dpd/ext ${T} ${rc} 3854262 pair_coeff 1 1 25.0 4.5 4.53 0.5 0.53 1.2 #${rcD} pair_coeff 1 2 25.1 4.51 4.54 0.51 0.54 1.21 #${rcD} pair_coeff 2 2 25.2 4.52 4.55 0.52 0.55 1.22 #${rcD} -timestep 0.01 +timestep 0.01 run_style verlet velocity all create ${T} 68768932 thermo_style custom step time temp press -thermo 500 +thermo 100 fix 1 all nve -run 50000 +run 5000 -write_data final.data pair ij \ No newline at end of file diff --git a/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.1 b/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.1 new file mode 100644 index 0000000000..660b4f464d --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.1 @@ -0,0 +1,153 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# DPD Fluid + +variable T equal 1.0 +variable rc equal 1.0 +variable rcD equal 1.2 + +units lj +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +### create box and configuration +variable L equal 5.0 +lattice fcc 3.0 +Lattice spacing in x,y,z = 1.1006424 1.1006424 1.1006424 +region simBox block 0 ${L} 0 ${L} 0 ${L} +region simBox block 0 5 0 ${L} 0 ${L} +region simBox block 0 5 0 5 0 ${L} +region simBox block 0 5 0 5 0 5 +create_box 2 simBox +Created orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + 1 by 1 by 1 MPI processor grid +create_atoms 1 random 100 12456 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +create_atoms 2 random 100 13245 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +mass 1 1.0 +mass 2 2.0 +### + +pair_style dpd/ext ${T} ${rc} 3854262 +pair_style dpd/ext 1 ${rc} 3854262 +pair_style dpd/ext 1 1 3854262 + +pair_coeff 1 1 25.0 4.5 4.53 0.5 0.53 1.2 #${rcD} +pair_coeff 1 2 25.1 4.51 4.54 0.51 0.54 1.21 #${rcD} +pair_coeff 2 2 25.2 4.52 4.55 0.52 0.55 1.22 #${rcD} + +timestep 0.01 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 1 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 5000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.52 + ghost atom cutoff = 1.52 + binsize = 0.76, bins = 8 8 8 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair dpd/ext, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.083 | 3.083 | 3.083 Mbytes + Step Time Temp Press + 0 0 1 10.864186 + 100 1 1.1314376 7.1955963 + 200 2 1.0058948 8.4574538 + 300 3 0.93292241 7.7033353 + 400 4 0.93599378 7.9649888 + 500 5 1.0390423 7.9498546 + 600 6 1.0750333 7.3594973 + 700 7 1.119325 7.1843859 + 800 8 0.96727219 6.8327896 + 900 9 0.98826001 8.1974994 + 1000 10 1.105819 7.8830702 + 1100 11 0.99559202 7.8295372 + 1200 12 0.9210428 8.2045593 + 1300 13 0.96628584 8.6531905 + 1400 14 1.1808689 7.7659964 + 1500 15 0.96208743 7.9977415 + 1600 16 1.0080123 7.6254557 + 1700 17 0.96910957 8.3643075 + 1800 18 1.0562621 7.5966268 + 1900 19 0.93109173 7.7944606 + 2000 20 1.1126085 9.3753501 + 2100 21 1.1328553 7.6293793 + 2200 22 0.8964042 7.5985061 + 2300 23 1.0043044 8.0016943 + 2400 24 1.0319521 8.1249684 + 2500 25 0.95913468 7.2383318 + 2600 26 0.99480311 7.6491295 + 2700 27 0.9735191 7.5004628 + 2800 28 0.96145308 8.222045 + 2900 29 1.0131071 6.6390842 + 3000 30 0.99463836 7.0147693 + 3100 31 0.96803993 8.2738796 + 3200 32 0.94066026 9.476403 + 3300 33 0.97401823 6.409563 + 3400 34 1.0548493 7.7301555 + 3500 35 0.98567796 8.2949868 + 3600 36 0.86621746 7.4759028 + 3700 37 0.94934175 8.1189998 + 3800 38 0.9626774 7.7986715 + 3900 39 0.95728518 6.8669836 + 4000 40 1.0866412 7.41281 + 4100 41 0.98873564 6.4612262 + 4200 42 0.9109925 7.1806331 + 4300 43 1.0344723 8.4617679 + 4400 44 0.98920584 7.3622901 + 4500 45 0.99386139 6.8002442 + 4600 46 1.0947487 6.8868352 + 4700 47 0.98789482 7.8428621 + 4800 48 1.0035907 8.3878628 + 4900 49 1.0336467 8.1592349 + 5000 50 1.0870964 8.217988 +Loop time of 0.907286 on 1 procs for 5000 steps with 200 atoms + +Performance: 4761453.941 tau/day, 5510.942 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 | 0.79672 | 0.79672 | 0.79672 | 0.0 | 87.81 +Neigh | 0.066416 | 0.066416 | 0.066416 | 0.0 | 7.32 +Comm | 0.029801 | 0.029801 | 0.029801 | 0.0 | 3.28 +Output | 0.0010415 | 0.0010415 | 0.0010415 | 0.0 | 0.11 +Modify | 0.0078915 | 0.0078915 | 0.0078915 | 0.0 | 0.87 +Other | | 0.005414 | | | 0.60 + +Nlocal: 200 ave 200 max 200 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 563 ave 563 max 563 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1624 ave 1624 max 1624 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1624 +Ave neighs/atom = 8.12 +Neighbor list builds = 500 +Dangerous builds = 500 + +Total wall time: 0:00:00 diff --git a/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.4 b/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.4 new file mode 100644 index 0000000000..3b505741a8 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.4 @@ -0,0 +1,153 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# DPD Fluid + +variable T equal 1.0 +variable rc equal 1.0 +variable rcD equal 1.2 + +units lj +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +### create box and configuration +variable L equal 5.0 +lattice fcc 3.0 +Lattice spacing in x,y,z = 1.1006424 1.1006424 1.1006424 +region simBox block 0 ${L} 0 ${L} 0 ${L} +region simBox block 0 5 0 ${L} 0 ${L} +region simBox block 0 5 0 5 0 ${L} +region simBox block 0 5 0 5 0 5 +create_box 2 simBox +Created orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + 1 by 2 by 2 MPI processor grid +create_atoms 1 random 100 12456 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +create_atoms 2 random 100 13245 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +mass 1 1.0 +mass 2 2.0 +### + +pair_style dpd/ext ${T} ${rc} 3854262 +pair_style dpd/ext 1 ${rc} 3854262 +pair_style dpd/ext 1 1 3854262 + +pair_coeff 1 1 25.0 4.5 4.53 0.5 0.53 1.2 #${rcD} +pair_coeff 1 2 25.1 4.51 4.54 0.51 0.54 1.21 #${rcD} +pair_coeff 2 2 25.2 4.52 4.55 0.52 0.55 1.22 #${rcD} + +timestep 0.01 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 1 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 5000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.52 + ghost atom cutoff = 1.52 + binsize = 0.76, bins = 8 8 8 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair dpd/ext, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.064 | 3.064 | 3.064 Mbytes + Step Time Temp Press + 0 0 1 9.2729849 + 100 1 1.1416138 7.7058466 + 200 2 0.91696292 8.1601454 + 300 3 0.96358166 6.7987934 + 400 4 0.94726377 7.6196059 + 500 5 1.0941462 7.5974711 + 600 6 0.91469027 8.3921536 + 700 7 1.0912559 7.362721 + 800 8 0.96537861 9.2089379 + 900 9 0.9986577 8.0072887 + 1000 10 0.9580071 7.2399027 + 1100 11 0.94763774 7.8075521 + 1200 12 0.9942368 7.5215461 + 1300 13 1.0312465 8.2684258 + 1400 14 0.95133276 7.2734722 + 1500 15 0.97273431 7.1831939 + 1600 16 1.0052028 7.929104 + 1700 17 0.93909435 8.2831308 + 1800 18 1.0647294 8.850861 + 1900 19 1.0268112 7.2828461 + 2000 20 0.91293528 8.208191 + 2100 21 0.94719411 8.3353929 + 2200 22 0.90507637 9.1708397 + 2300 23 1.0663386 7.1415871 + 2400 24 1.0132089 9.2210634 + 2500 25 1.0633849 8.3368039 + 2600 26 0.95803955 8.8247976 + 2700 27 0.95264552 7.3204561 + 2800 28 0.93548595 7.290555 + 2900 29 0.96876322 7.4969147 + 3000 30 0.99554648 8.2055023 + 3100 31 1.0190751 7.907751 + 3200 32 1.0887502 7.7247246 + 3300 33 1.0059692 7.4039814 + 3400 34 1.0055991 7.3469353 + 3500 35 1.0067689 7.2161248 + 3600 36 1.1103667 8.4373236 + 3700 37 1.0668979 7.1922528 + 3800 38 0.97902043 5.5426601 + 3900 39 1.0268733 6.7786635 + 4000 40 1.0036613 7.8078466 + 4100 41 1.0714377 7.4129166 + 4200 42 0.99168608 6.0096099 + 4300 43 1.084818 7.4932992 + 4400 44 0.98348896 8.9950057 + 4500 45 1.045253 6.1309568 + 4600 46 1.0266723 6.3227645 + 4700 47 1.0183525 8.1505786 + 4800 48 1.0527309 8.2824928 + 4900 49 0.96877903 7.6341751 + 5000 50 1.0178917 7.5037327 +Loop time of 0.320182 on 4 procs for 5000 steps with 200 atoms + +Performance: 13492326.176 tau/day, 15616.118 timesteps/s +98.4% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.20185 | 0.21019 | 0.2166 | 1.4 | 65.65 +Neigh | 0.017652 | 0.018339 | 0.019085 | 0.5 | 5.73 +Comm | 0.076802 | 0.084707 | 0.094197 | 2.6 | 26.46 +Output | 0.00057039 | 0.00066408 | 0.00093301 | 0.0 | 0.21 +Modify | 0.0025036 | 0.0027709 | 0.0030403 | 0.5 | 0.87 +Other | | 0.003508 | | | 1.10 + +Nlocal: 50 ave 53 max 45 min +Histogram: 1 0 0 0 0 0 1 0 1 1 +Nghost: 288.5 ave 300 max 279 min +Histogram: 1 1 0 0 0 0 1 0 0 1 +Neighs: 418.25 ave 438 max 384 min +Histogram: 1 0 0 0 0 1 0 0 0 2 + +Total # of neighbors = 1673 +Ave neighs/atom = 8.365 +Neighbor list builds = 500 +Dangerous builds = 500 + +Total wall time: 0:00:00 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data deleted file mode 100644 index d487e2c73c..0000000000 --- a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data +++ /dev/null @@ -1,2196 +0,0 @@ - Coarse-Grained SPC/E Water - - 2180 atoms - - 1 atom types - - 0.0000000E+00 40.310000000000 xlo xhi - 0.0000000E+00 40.310000000000 ylo yhi - 0.0000000E+00 40.310000000000 zlo zhi - - Masses - -1 18.01540 - - Atoms - -1 1 2.815000E+01 5.430000E+00 2.370000E+00 -2 1 1.890000E+00 2.957000E+01 1.761000E+01 -3 1 8.920000E+00 3.556000E+01 8.240000E+00 -4 1 2.307000E+01 9.600000E+00 4.710000E+00 -5 1 1.688000E+01 8.940000E+00 3.880000E+00 -6 1 2.571000E+01 1.277000E+01 1.056000E+01 -7 1 2.788000E+01 3.328000E+01 1.300000E-01 -8 1 3.287000E+01 2.050000E+00 1.368000E+01 -9 1 4.900000E+00 2.183000E+01 1.751000E+01 -10 1 9.670000E+00 3.108000E+01 1.843000E+01 -11 1 1.233000E+01 3.490000E+00 1.091000E+01 -12 1 6.630000E+00 1.581000E+01 3.455000E+01 -13 1 3.951000E+01 2.047000E+01 2.288000E+01 -14 1 3.977000E+01 3.173000E+01 9.060000E+00 -15 1 5.370000E+00 8.940000E+00 3.646000E+01 -16 1 2.129000E+01 3.853000E+01 3.468000E+01 -17 1 1.987000E+01 2.677000E+01 3.762000E+01 -18 1 2.658000E+01 3.167000E+01 2.280000E+00 -19 1 1.231000E+01 3.336000E+01 1.098000E+01 -20 1 7.310000E+00 1.410000E+01 1.654000E+01 -21 1 3.388000E+01 2.584000E+01 1.677000E+01 -22 1 1.115000E+01 3.070000E+00 3.992000E+01 -23 1 3.171000E+01 3.195000E+01 2.267000E+01 -24 1 5.960000E+00 3.507000E+01 1.230000E+01 -25 1 2.904000E+01 1.740000E+00 9.460000E+00 -26 1 1.539000E+01 2.686000E+01 2.030000E+00 -27 1 3.890000E+00 2.148000E+01 2.877000E+01 -28 1 4.550000E+00 2.800000E+01 2.431000E+01 -29 1 9.680000E+00 3.992000E+01 2.964000E+01 -30 1 2.560000E+00 3.939000E+01 2.987000E+01 -31 1 4.960000E+00 2.280000E+01 6.230000E+00 -32 1 2.795000E+01 3.511000E+01 9.810000E+00 -33 1 3.254000E+01 3.032000E+01 3.025000E+01 -34 1 2.292000E+01 3.033000E+01 1.730000E+01 -35 1 2.190000E+00 2.025000E+01 3.929000E+01 -36 1 9.460000E+00 3.815000E+01 6.950000E+00 -37 1 2.409000E+01 2.885000E+01 7.730000E+00 -38 1 3.711000E+01 3.888000E+01 3.314000E+01 -39 1 3.492000E+01 1.987000E+01 8.240000E+00 -40 1 1.350000E+00 3.799000E+01 3.885000E+01 -41 1 3.289000E+01 3.289000E+01 1.859000E+01 -42 1 3.337000E+01 1.603000E+01 3.141000E+01 -43 1 5.120000E+00 6.540000E+00 3.231000E+01 -44 1 5.080000E+00 3.640000E+00 2.178000E+01 -45 1 7.090000E+00 1.072000E+01 1.911000E+01 -46 1 2.804000E+01 1.444000E+01 2.027000E+01 -47 1 2.972000E+01 3.928000E+01 2.997000E+01 -48 1 2.170000E+01 3.263000E+01 3.100000E+01 -49 1 3.063000E+01 8.940000E+00 3.410000E+00 -50 1 2.400000E+00 1.484000E+01 2.534000E+01 -51 1 2.128000E+01 3.944000E+01 1.892000E+01 -52 1 3.616000E+01 3.993000E+01 1.443000E+01 -53 1 2.416000E+01 2.414000E+01 1.280000E+01 -54 1 3.177000E+01 1.047000E+01 1.568000E+01 -55 1 4.024000E+01 1.188000E+01 3.343000E+01 -56 1 6.040000E+00 1.367000E+01 4.028000E+01 -57 1 1.537000E+01 3.589000E+01 6.930000E+00 -58 1 1.231000E+01 2.220000E+00 1.471000E+01 -59 1 3.450000E+00 4.810000E+00 2.487000E+01 -60 1 1.589000E+01 2.520000E+00 1.705000E+01 -61 1 3.705000E+01 3.620000E+01 6.730000E+00 -62 1 3.777000E+01 2.710000E+01 4.029000E+01 -63 1 8.260000E+00 2.033000E+01 4.030000E+01 -64 1 8.210000E+00 3.558000E+01 1.717000E+01 -65 1 3.338000E+01 1.389000E+01 2.210000E+01 -66 1 1.454000E+01 1.650000E+00 1.300000E+01 -67 1 1.977000E+01 3.489000E+01 1.751000E+01 -68 1 5.630000E+00 4.220000E+00 3.875000E+01 -69 1 7.570000E+00 2.576000E+01 1.371000E+01 -70 1 9.340000E+00 3.392000E+01 3.538000E+01 -71 1 2.116000E+01 8.590000E+00 1.475000E+01 -72 1 2.328000E+01 4.022000E+01 1.138000E+01 -73 1 1.298000E+01 3.479000E+01 2.338000E+01 -74 1 2.232000E+01 3.339000E+01 5.320000E+00 -75 1 3.290000E+00 3.240000E+01 2.024000E+01 -76 1 3.794000E+01 3.982000E+01 1.790000E+00 -77 1 1.111000E+01 1.440000E+01 2.301000E+01 -78 1 2.556000E+01 1.714000E+01 1.684000E+01 -79 1 2.500000E+00 2.474000E+01 2.028000E+01 -80 1 1.692000E+01 3.837000E+01 1.303000E+01 -81 1 6.310000E+00 2.551000E+01 3.960000E+01 -82 1 2.402000E+01 1.966000E+01 2.905000E+01 -83 1 2.216000E+01 9.500000E+00 2.543000E+01 -84 1 2.006000E+01 3.431000E+01 4.260000E+00 -85 1 2.198000E+01 8.670000E+00 2.806000E+01 -86 1 1.465000E+01 2.763000E+01 8.340000E+00 -87 1 3.975000E+01 3.870000E+00 3.701000E+01 -88 1 2.952000E+01 7.340000E+00 5.310000E+00 -89 1 2.759000E+01 1.589000E+01 3.402000E+01 -90 1 3.746000E+01 3.945000E+01 2.486000E+01 -91 1 2.370000E+01 2.429000E+01 2.803000E+01 -92 1 1.270000E+01 1.653000E+01 2.314000E+01 -93 1 1.653000E+01 2.786000E+01 2.885000E+01 -94 1 3.146000E+01 2.340000E+00 8.320000E+00 -95 1 3.406000E+01 2.124000E+01 2.389000E+01 -96 1 5.130000E+00 1.574000E+01 8.360000E+00 -97 1 3.087000E+01 6.020000E+00 2.295000E+01 -98 1 3.607000E+01 3.674000E+01 9.200000E+00 -99 1 2.507000E+01 2.107000E+01 3.778000E+01 -100 1 3.351000E+01 4.870000E+00 1.301000E+01 -101 1 2.978000E+01 1.879000E+01 1.277000E+01 -102 1 2.496000E+01 1.400000E-01 3.900000E+01 -103 1 3.761000E+01 3.179000E+01 2.540000E+00 -104 1 2.600000E+00 6.800000E+00 3.347000E+01 -105 1 2.570000E+01 3.173000E+01 1.831000E+01 -106 1 9.460000E+00 1.524000E+01 2.542000E+01 -107 1 2.255000E+01 2.515000E+01 2.190000E+00 -108 1 1.902000E+01 1.988000E+01 3.138000E+01 -109 1 9.450000E+00 3.164000E+01 2.652000E+01 -110 1 6.810000E+00 9.420000E+00 1.463000E+01 -111 1 1.651000E+01 5.200000E+00 2.836000E+01 -112 1 2.234000E+01 2.475000E+01 3.956000E+01 -113 1 3.805000E+01 2.946000E+01 9.080000E+00 -114 1 3.553000E+01 1.590000E+01 1.032000E+01 -115 1 2.565000E+01 3.402000E+01 1.062000E+01 -116 1 1.554000E+01 5.410000E+00 3.926000E+01 -117 1 2.449000E+01 1.282000E+01 1.305000E+01 -118 1 1.590000E+00 3.743000E+01 3.398000E+01 -119 1 1.954000E+01 9.570000E+00 1.179000E+01 -120 1 9.870000E+00 1.497000E+01 1.872000E+01 -121 1 2.925000E+01 3.397000E+01 7.650000E+00 -122 1 2.738000E+01 3.514000E+01 2.980000E+01 -123 1 3.704000E+01 2.310000E+00 2.189000E+01 -124 1 1.988000E+01 1.471000E+01 1.600000E-01 -125 1 1.118000E+01 1.476000E+01 3.354000E+01 -126 1 3.100000E-01 2.588000E+01 3.313000E+01 -127 1 3.437000E+01 2.586000E+01 2.337000E+01 -128 1 3.931000E+01 3.398000E+01 3.424000E+01 -129 1 7.070000E+00 3.063000E+01 2.188000E+01 -130 1 1.840000E+00 1.104000E+01 1.974000E+01 -131 1 1.924000E+01 3.244000E+01 3.670000E+01 -132 1 1.675000E+01 3.463000E+01 1.524000E+01 -133 1 1.670000E+01 3.557000E+01 2.765000E+01 -134 1 3.999000E+01 3.970000E+01 2.385000E+01 -135 1 3.096000E+01 5.990000E+00 1.962000E+01 -136 1 2.357000E+01 1.297000E+01 2.012000E+01 -137 1 5.010000E+00 1.524000E+01 3.843000E+01 -138 1 6.180000E+00 1.152000E+01 2.331000E+01 -139 1 1.200000E+00 2.550000E+01 2.334000E+01 -140 1 4.210000E+00 2.882000E+01 1.460000E+00 -141 1 5.750000E+00 2.729000E+01 7.300000E+00 -142 1 2.792000E+01 6.980000E+00 2.345000E+01 -143 1 9.150000E+00 1.540000E+00 3.415000E+01 -144 1 3.475000E+01 3.229000E+01 2.751000E+01 -145 1 2.668000E+01 2.350000E+00 2.394000E+01 -146 1 3.942000E+01 8.270000E+00 2.016000E+01 -147 1 7.790000E+00 9.330000E+00 2.277000E+01 -148 1 3.106000E+01 3.520000E+01 1.946000E+01 -149 1 1.154000E+01 4.670000E+00 2.609000E+01 -150 1 3.318000E+01 3.935000E+01 3.181000E+01 -151 1 3.033000E+01 3.290000E+00 1.594000E+01 -152 1 2.314000E+01 1.230000E+00 6.300000E-01 -153 1 2.688000E+01 1.040000E+01 1.937000E+01 -154 1 2.805000E+01 3.313000E+01 1.849000E+01 -155 1 3.801000E+01 1.582000E+01 2.545000E+01 -156 1 2.225000E+01 3.680000E+00 9.400000E-01 -157 1 3.259000E+01 2.797000E+01 1.170000E+01 -158 1 1.934000E+01 1.035000E+01 4.000000E-02 -159 1 2.211000E+01 1.586000E+01 4.280000E+00 -160 1 2.636000E+01 2.283000E+01 3.116000E+01 -161 1 3.060000E+00 1.832000E+01 3.778000E+01 -162 1 4.009000E+01 3.503000E+01 8.480000E+00 -163 1 2.116000E+01 3.349000E+01 2.047000E+01 -164 1 2.972000E+01 2.068000E+01 8.160000E+00 -165 1 2.669000E+01 9.500000E-01 7.660000E+00 -166 1 4.360000E+00 6.290000E+00 2.123000E+01 -167 1 3.325000E+01 3.367000E+01 1.095000E+01 -168 1 3.761000E+01 3.190000E+00 1.278000E+01 -169 1 3.670000E+00 2.074000E+01 1.536000E+01 -170 1 1.508000E+01 1.371000E+01 3.257000E+01 -171 1 3.460000E+00 2.393000E+01 2.349000E+01 -172 1 1.095000E+01 1.959000E+01 1.153000E+01 -173 1 2.578000E+01 2.144000E+01 3.342000E+01 -174 1 1.847000E+01 6.670000E+00 6.450000E+00 -175 1 3.564000E+01 3.459000E+01 1.988000E+01 -176 1 1.759000E+01 1.536000E+01 2.579000E+01 -177 1 1.543000E+01 4.010000E+00 1.133000E+01 -178 1 5.270000E+00 8.170000E+00 2.305000E+01 -179 1 7.670000E+00 2.964000E+01 3.700000E-01 -180 1 8.700000E-01 2.032000E+01 3.475000E+01 -181 1 6.880000E+00 3.688000E+01 5.760000E+00 -182 1 2.034000E+01 2.438000E+01 7.170000E+00 -183 1 2.680000E+01 2.198000E+01 1.000000E-02 -184 1 1.444000E+01 2.689000E+01 1.594000E+01 -185 1 3.904000E+01 2.121000E+01 9.920000E+00 -186 1 9.170000E+00 3.546000E+01 4.400000E-01 -187 1 1.350000E+01 1.685000E+01 5.530000E+00 -188 1 7.110000E+00 2.915000E+01 1.820000E+01 -189 1 3.826000E+01 1.259000E+01 2.531000E+01 -190 1 1.024000E+01 1.480000E+00 1.877000E+01 -191 1 3.318000E+01 2.380000E+00 1.160000E+00 -192 1 1.620000E+01 2.425000E+01 2.638000E+01 -193 1 3.329000E+01 1.363000E+01 1.299000E+01 -194 1 2.751000E+01 2.008000E+01 1.454000E+01 -195 1 6.290000E+00 2.970000E+01 6.260000E+00 -196 1 2.577000E+01 1.073000E+01 1.675000E+01 -197 1 1.178000E+01 2.553000E+01 2.947000E+01 -198 1 1.227000E+01 2.341000E+01 1.374000E+01 -199 1 3.420000E+00 3.994000E+01 3.429000E+01 -200 1 7.020000E+00 3.270000E+00 1.405000E+01 -201 1 3.130000E+01 8.500000E-01 3.230000E+01 -202 1 3.793000E+01 6.070000E+00 2.987000E+01 -203 1 5.770000E+00 2.558000E+01 2.327000E+01 -204 1 3.144000E+01 3.996000E+01 2.539000E+01 -205 1 2.692000E+01 2.118000E+01 2.730000E+00 -206 1 1.698000E+01 1.947000E+01 3.821000E+01 -207 1 2.264000E+01 3.201000E+01 3.543000E+01 -208 1 3.579000E+01 8.900000E-01 2.210000E+00 -209 1 2.386000E+01 9.300000E-01 7.290000E+00 -210 1 1.831000E+01 2.571000E+01 8.400000E-01 -211 1 1.325000E+01 1.549000E+01 1.296000E+01 -212 1 2.693000E+01 3.916000E+01 3.400000E-01 -213 1 2.757000E+01 1.330000E+01 1.579000E+01 -214 1 3.146000E+01 2.151000E+01 2.460000E+01 -215 1 5.010000E+00 2.472000E+01 1.316000E+01 -216 1 3.586000E+01 7.470000E+00 1.382000E+01 -217 1 2.176000E+01 1.877000E+01 1.732000E+01 -218 1 7.300000E+00 1.480000E+01 7.050000E+00 -219 1 8.680000E+00 2.746000E+01 7.610000E+00 -220 1 3.326000E+01 3.281000E+01 1.580000E+01 -221 1 2.980000E+00 1.509000E+01 2.820000E+01 -222 1 3.621000E+01 1.533000E+01 1.612000E+01 -223 1 8.640000E+00 9.260000E+00 1.227000E+01 -224 1 2.920000E+01 1.315000E+01 2.229000E+01 -225 1 1.842000E+01 3.040000E+00 2.652000E+01 -226 1 6.990000E+00 1.572000E+01 3.156000E+01 -227 1 9.330000E+00 4.450000E+00 3.682000E+01 -228 1 3.521000E+01 1.321000E+01 9.970000E+00 -229 1 1.032000E+01 1.774000E+01 3.277000E+01 -230 1 3.870000E+01 2.491000E+01 3.721000E+01 -231 1 2.480000E+00 3.320000E+01 3.706000E+01 -232 1 3.795000E+01 5.200000E+00 2.095000E+01 -233 1 1.240000E+00 1.685000E+01 1.170000E+01 -234 1 2.528000E+01 3.293000E+01 3.957000E+01 -235 1 3.658000E+01 3.679000E+01 1.689000E+01 -236 1 1.325000E+01 2.419000E+01 4.700000E+00 -237 1 1.819000E+01 4.320000E+00 0.000000E+00 -238 1 3.282000E+01 7.330000E+00 3.172000E+01 -239 1 5.030000E+00 3.222000E+01 1.552000E+01 -240 1 6.640000E+00 3.435000E+01 1.538000E+01 -241 1 7.250000E+00 8.860000E+00 3.137000E+01 -242 1 2.514000E+01 5.190000E+00 5.740000E+00 -243 1 1.975000E+01 2.949000E+01 2.054000E+01 -244 1 2.737000E+01 2.537000E+01 9.950000E+00 -245 1 1.586000E+01 1.974000E+01 9.550000E+00 -246 1 3.506000E+01 2.875000E+01 3.141000E+01 -247 1 2.802000E+01 2.129000E+01 1.900000E+01 -248 1 3.022000E+01 2.140000E+01 3.370000E+01 -249 1 7.530000E+00 1.148000E+01 1.661000E+01 -250 1 2.137000E+01 2.405000E+01 1.341000E+01 -251 1 8.940000E+00 1.907000E+01 2.363000E+01 -252 1 2.814000E+01 3.540000E+01 1.704000E+01 -253 1 2.201000E+01 1.323000E+01 5.790000E+00 -254 1 3.282000E+01 1.123000E+01 2.798000E+01 -255 1 3.007000E+01 3.075000E+01 3.564000E+01 -256 1 2.144000E+01 2.451000E+01 3.577000E+01 -257 1 2.238000E+01 2.254000E+01 6.560000E+00 -258 1 2.965000E+01 3.416000E+01 2.582000E+01 -259 1 3.839000E+01 3.504000E+01 3.685000E+01 -260 1 3.415000E+01 1.119000E+01 3.936000E+01 -261 1 3.310000E+01 1.422000E+01 2.646000E+01 -262 1 1.370000E+01 3.952000E+01 1.585000E+01 -263 1 1.279000E+01 2.395000E+01 2.746000E+01 -264 1 1.760000E+00 3.403000E+01 1.054000E+01 -265 1 1.049000E+01 7.180000E+00 2.963000E+01 -266 1 1.886000E+01 4.200000E+00 1.764000E+01 -267 1 7.570000E+00 1.001000E+01 8.850000E+00 -268 1 2.180000E+01 2.746000E+01 3.128000E+01 -269 1 3.308000E+01 2.905000E+01 1.539000E+01 -270 1 3.186000E+01 2.445000E+01 6.800000E+00 -271 1 3.047000E+01 2.204000E+01 6.050000E+00 -272 1 1.734000E+01 2.366000E+01 3.421000E+01 -273 1 1.277000E+01 2.862000E+01 2.138000E+01 -274 1 9.830000E+00 2.602000E+01 1.516000E+01 -275 1 3.661000E+01 1.411000E+01 2.375000E+01 -276 1 1.343000E+01 1.414000E+01 2.735000E+01 -277 1 1.653000E+01 2.172000E+01 2.870000E+00 -278 1 2.107000E+01 2.185000E+01 3.690000E+01 -279 1 3.664000E+01 3.410000E+01 2.809000E+01 -280 1 3.016000E+01 2.572000E+01 2.045000E+01 -281 1 1.800000E+00 1.859000E+01 6.690000E+00 -282 1 9.300000E-01 2.920000E+00 3.291000E+01 -283 1 1.215000E+01 2.864000E+01 5.550000E+00 -284 1 1.697000E+01 3.419000E+01 1.006000E+01 -285 1 1.210000E+00 4.930000E+00 4.830000E+00 -286 1 1.177000E+01 4.940000E+00 1.829000E+01 -287 1 2.625000E+01 7.380000E+00 2.798000E+01 -288 1 9.000000E-01 9.530000E+00 2.272000E+01 -289 1 1.592000E+01 1.530000E+01 1.692000E+01 -290 1 2.390000E+00 1.613000E+01 6.940000E+00 -291 1 3.898000E+01 7.710000E+00 8.020000E+00 -292 1 3.644000E+01 2.475000E+01 3.385000E+01 -293 1 2.802000E+01 3.480000E+00 4.028000E+01 -294 1 3.279000E+01 2.458000E+01 2.784000E+01 -295 1 1.913000E+01 3.837000E+01 2.331000E+01 -296 1 2.613000E+01 3.081000E+01 2.674000E+01 -297 1 2.532000E+01 3.771000E+01 1.013000E+01 -298 1 1.711000E+01 2.262000E+01 1.300000E+01 -299 1 2.871000E+01 1.246000E+01 1.832000E+01 -300 1 1.272000E+01 4.620000E+00 1.570000E+01 -301 1 2.197000E+01 2.425000E+01 2.139000E+01 -302 1 8.500000E+00 3.999000E+01 2.546000E+01 -303 1 4.070000E+00 3.246000E+01 4.270000E+00 -304 1 4.013000E+01 2.952000E+01 1.460000E+01 -305 1 5.930000E+00 3.346000E+01 2.326000E+01 -306 1 1.439000E+01 9.140000E+00 2.484000E+01 -307 1 9.330000E+00 6.640000E+00 2.131000E+01 -308 1 1.420000E+00 3.616000E+01 1.303000E+01 -309 1 2.305000E+01 2.713000E+01 1.359000E+01 -310 1 1.925000E+01 2.965000E+01 3.961000E+01 -311 1 2.497000E+01 6.660000E+00 1.485000E+01 -312 1 2.556000E+01 2.865000E+01 2.880000E+01 -313 1 7.550000E+00 2.085000E+01 3.045000E+01 -314 1 1.802000E+01 2.925000E+01 3.721000E+01 -315 1 1.246000E+01 3.098000E+01 2.556000E+01 -316 1 2.276000E+01 1.251000E+01 2.868000E+01 -317 1 3.486000E+01 2.344000E+01 3.855000E+01 -318 1 6.280000E+00 3.151000E+01 3.906000E+01 -319 1 3.735000E+01 2.264000E+01 3.812000E+01 -320 1 1.332000E+01 8.980000E+00 7.770000E+00 -321 1 7.600000E+00 3.136000E+01 7.920000E+00 -322 1 3.200000E+00 2.920000E+00 5.280000E+00 -323 1 8.170000E+00 3.254000E+01 2.026000E+01 -324 1 3.333000E+01 1.170000E+00 1.636000E+01 -325 1 6.700000E+00 2.234000E+01 2.669000E+01 -326 1 6.900000E+00 1.025000E+01 1.160000E+00 -327 1 2.358000E+01 5.690000E+00 2.170000E+01 -328 1 6.430000E+00 2.517000E+01 1.905000E+01 -329 1 2.326000E+01 8.260000E+00 2.295000E+01 -330 1 2.460000E+01 5.410000E+00 4.700000E-01 -331 1 1.027000E+01 3.768000E+01 9.570000E+00 -332 1 9.450000E+00 1.871000E+01 3.017000E+01 -333 1 2.388000E+01 3.240000E+01 3.140000E+00 -334 1 1.889000E+01 2.567000E+01 1.466000E+01 -335 1 2.108000E+01 3.427000E+01 3.588000E+01 -336 1 3.488000E+01 3.803000E+01 2.242000E+01 -337 1 3.365000E+01 1.929000E+01 1.290000E+01 -338 1 1.810000E+01 3.344000E+01 1.303000E+01 -339 1 2.758000E+01 1.885000E+01 3.407000E+01 -340 1 3.829000E+01 2.758000E+01 7.120000E+00 -341 1 2.168000E+01 3.619000E+01 2.075000E+01 -342 1 5.040000E+00 2.573000E+01 5.050000E+00 -343 1 1.410000E+00 3.445000E+01 2.788000E+01 -344 1 2.773000E+01 1.125000E+01 3.333000E+01 -345 1 2.771000E+01 2.476000E+01 3.514000E+01 -346 1 2.428000E+01 1.029000E+01 2.774000E+01 -347 1 3.090000E+00 2.826000E+01 2.660000E+01 -348 1 3.362000E+01 1.246000E+01 1.582000E+01 -349 1 3.486000E+01 7.960000E+00 2.133000E+01 -350 1 8.200000E-01 3.203000E+01 2.350000E+01 -351 1 3.545000E+01 3.597000E+01 2.943000E+01 -352 1 8.600000E-01 1.621000E+01 1.422000E+01 -353 1 3.739000E+01 3.666000E+01 1.962000E+01 -354 1 2.228000E+01 2.954000E+01 3.150000E+00 -355 1 2.835000E+01 5.820000E+00 7.670000E+00 -356 1 9.200000E-01 2.790000E+00 3.912000E+01 -357 1 3.029000E+01 1.368000E+01 1.318000E+01 -358 1 9.330000E+00 2.945000E+01 3.619000E+01 -359 1 2.842000E+01 4.110000E+00 2.477000E+01 -360 1 3.226000E+01 3.613000E+01 3.814000E+01 -361 1 1.100000E+01 1.278000E+01 1.770000E+00 -362 1 4.630000E+00 2.791000E+01 1.784000E+01 -363 1 1.707000E+01 6.750000E+00 2.289000E+01 -364 1 1.461000E+01 2.572000E+01 2.945000E+01 -365 1 3.159000E+01 2.440000E+01 3.511000E+01 -366 1 3.020000E+01 1.310000E+00 1.446000E+01 -367 1 3.759000E+01 2.400000E+00 6.600000E+00 -368 1 2.129000E+01 3.053000E+01 3.711000E+01 -369 1 3.927000E+01 3.698000E+01 3.886000E+01 -370 1 2.680000E+01 1.916000E+01 2.140000E+01 -371 1 1.641000E+01 3.931000E+01 2.595000E+01 -372 1 9.690000E+00 2.920000E+01 1.350000E+01 -373 1 2.753000E+01 3.731000E+01 1.496000E+01 -374 1 3.919000E+01 3.481000E+01 2.686000E+01 -375 1 4.580000E+00 3.495000E+01 3.575000E+01 -376 1 1.669000E+01 3.878000E+01 1.774000E+01 -377 1 3.577000E+01 2.542000E+01 8.300000E-01 -378 1 2.120000E+00 7.530000E+00 1.505000E+01 -379 1 2.696000E+01 1.639000E+01 2.185000E+01 -380 1 1.869000E+01 2.578000E+01 3.481000E+01 -381 1 3.108000E+01 2.050000E+00 1.130000E+01 -382 1 2.538000E+01 2.567000E+01 1.472000E+01 -383 1 1.538000E+01 3.608000E+01 4.100000E+00 -384 1 1.799000E+01 1.564000E+01 7.600000E+00 -385 1 1.348000E+01 2.671000E+01 3.384000E+01 -386 1 2.680000E+01 1.150000E+01 2.732000E+01 -387 1 1.540000E+00 1.068000E+01 6.000000E+00 -388 1 4.023000E+01 1.474000E+01 5.400000E+00 -389 1 3.603000E+01 1.044000E+01 1.040000E+00 -390 1 4.027000E+01 2.082000E+01 1.968000E+01 -391 1 8.140000E+00 7.470000E+00 1.017000E+01 -392 1 2.301000E+01 2.329000E+01 2.513000E+01 -393 1 2.445000E+01 3.558000E+01 3.913000E+01 -394 1 1.612000E+01 7.370000E+00 3.142000E+01 -395 1 5.760000E+00 3.391000E+01 1.460000E+00 -396 1 3.129000E+01 8.290000E+00 2.114000E+01 -397 1 2.631000E+01 3.050000E+00 2.120000E+00 -398 1 9.910000E+00 1.148000E+01 4.270000E+00 -399 1 3.146000E+01 1.048000E+01 9.000000E-02 -400 1 3.029000E+01 2.582000E+01 3.696000E+01 -401 1 9.700000E-01 3.600000E-01 6.090000E+00 -402 1 3.565000E+01 1.051000E+01 3.233000E+01 -403 1 1.931000E+01 3.769000E+01 1.438000E+01 -404 1 3.355000E+01 3.627000E+01 1.898000E+01 -405 1 1.822000E+01 3.092000E+01 1.960000E+00 -406 1 2.619000E+01 2.340000E+01 4.470000E+00 -407 1 3.452000E+01 1.894000E+01 1.873000E+01 -408 1 1.800000E+01 1.734000E+01 2.255000E+01 -409 1 2.946000E+01 3.888000E+01 3.664000E+01 -410 1 2.969000E+01 3.251000E+01 2.916000E+01 -411 1 3.049000E+01 3.154000E+01 1.894000E+01 -412 1 9.580000E+00 2.081000E+01 1.784000E+01 -413 1 6.710000E+00 3.164000E+01 1.056000E+01 -414 1 2.241000E+01 2.598000E+01 2.520000E+01 -415 1 9.400000E-01 3.714000E+01 7.120000E+00 -416 1 1.092000E+01 3.565000E+01 1.807000E+01 -417 1 3.221000E+01 3.286000E+01 2.858000E+01 -418 1 1.093000E+01 2.681000E+01 2.706000E+01 -419 1 3.190000E+00 3.247000E+01 3.307000E+01 -420 1 3.676000E+01 3.171000E+01 1.952000E+01 -421 1 2.035000E+01 1.811000E+01 2.446000E+01 -422 1 2.091000E+01 6.640000E+00 2.509000E+01 -423 1 1.010000E+01 1.037000E+01 1.606000E+01 -424 1 2.802000E+01 5.650000E+00 3.563000E+01 -425 1 3.514000E+01 3.759000E+01 3.460000E+01 -426 1 1.331000E+01 6.790000E+00 2.066000E+01 -427 1 3.670000E+01 3.280000E+00 1.023000E+01 -428 1 2.502000E+01 1.631000E+01 4.016000E+01 -429 1 3.680000E+01 3.883000E+01 3.693000E+01 -430 1 2.102000E+01 2.652000E+01 2.284000E+01 -431 1 3.128000E+01 1.447000E+01 3.730000E+01 -432 1 3.794000E+01 2.310000E+01 8.370000E+00 -433 1 5.030000E+00 3.022000E+01 2.741000E+01 -434 1 2.962000E+01 1.390000E+00 2.630000E+00 -435 1 7.470000E+00 1.300000E-01 8.060000E+00 -436 1 3.823000E+01 5.110000E+00 4.540000E+00 -437 1 3.993000E+01 2.487000E+01 2.555000E+01 -438 1 3.419000E+01 2.951000E+01 2.442000E+01 -439 1 2.047000E+01 2.120000E+00 1.372000E+01 -440 1 3.523000E+01 2.256000E+01 8.270000E+00 -441 1 2.551000E+01 3.081000E+01 9.110000E+00 -442 1 1.465000E+01 2.800000E+00 2.347000E+01 -443 1 2.903000E+01 1.144000E+01 1.204000E+01 -444 1 2.534000E+01 9.610000E+00 6.210000E+00 -445 1 3.062000E+01 7.070000E+00 2.967000E+01 -446 1 2.014000E+01 2.659000E+01 1.931000E+01 -447 1 2.399000E+01 1.880000E+01 3.480000E+01 -448 1 5.950000E+00 4.015000E+01 2.619000E+01 -449 1 1.404000E+01 3.854000E+01 3.780000E+00 -450 1 2.456000E+01 3.041000E+01 1.332000E+01 -451 1 2.196000E+01 1.540000E+01 3.747000E+01 -452 1 1.775000E+01 2.995000E+01 1.391000E+01 -453 1 3.000000E+01 2.423000E+01 1.001000E+01 -454 1 2.089000E+01 1.681000E+01 1.216000E+01 -455 1 1.788000E+01 2.556000E+01 7.570000E+00 -456 1 4.270000E+00 3.488000E+01 2.894000E+01 -457 1 2.754000E+01 3.101000E+01 2.264000E+01 -458 1 3.745000E+01 1.266000E+01 1.446000E+01 -459 1 1.948000E+01 8.000000E-02 3.541000E+01 -460 1 2.737000E+01 1.305000E+01 7.530000E+00 -461 1 3.302000E+01 2.540000E+01 2.041000E+01 -462 1 1.480000E+00 1.862000E+01 3.188000E+01 -463 1 7.900000E+00 1.395000E+01 1.408000E+01 -464 1 2.880000E+00 2.228000E+01 2.579000E+01 -465 1 3.848000E+01 3.161000E+01 2.994000E+01 -466 1 2.209000E+01 5.990000E+00 3.548000E+01 -467 1 2.863000E+01 3.632000E+01 3.624000E+01 -468 1 3.886000E+01 6.300000E+00 5.500000E-01 -469 1 3.331000E+01 1.047000E+01 4.380000E+00 -470 1 1.915000E+01 3.204000E+01 1.581000E+01 -471 1 8.850000E+00 2.500000E+01 2.963000E+01 -472 1 8.900000E+00 2.761000E+01 2.023000E+01 -473 1 1.218000E+01 1.500000E+01 2.970000E+00 -474 1 3.538000E+01 2.514000E+01 2.735000E+01 -475 1 3.498000E+01 3.620000E+00 1.695000E+01 -476 1 2.180000E+00 2.672000E+01 3.022000E+01 -477 1 2.349000E+01 3.983000E+01 1.417000E+01 -478 1 2.961000E+01 2.362000E+01 1.624000E+01 -479 1 1.777000E+01 4.920000E+00 3.195000E+01 -480 1 2.344000E+01 3.231000E+01 2.207000E+01 -481 1 3.998000E+01 9.400000E+00 3.494000E+01 -482 1 2.316000E+01 2.077000E+01 2.094000E+01 -483 1 3.072000E+01 3.947000E+01 1.320000E+00 -484 1 3.821000E+01 3.383000E+01 6.130000E+00 -485 1 2.503000E+01 2.028000E+01 5.030000E+00 -486 1 8.130000E+00 2.060000E+00 2.800000E-01 -487 1 2.430000E+01 2.911000E+01 4.990000E+00 -488 1 2.613000E+01 2.770000E+00 2.049000E+01 -489 1 3.885000E+01 2.315000E+01 1.970000E+01 -490 1 3.372000E+01 2.897000E+01 3.922000E+01 -491 1 1.540000E+01 3.012000E+01 2.314000E+01 -492 1 2.695000E+01 2.389000E+01 1.219000E+01 -493 1 3.379000E+01 3.924000E+01 2.480000E+00 -494 1 3.960000E+00 2.416000E+01 3.545000E+01 -495 1 1.618000E+01 2.350000E+01 3.071000E+01 -496 1 2.070000E+00 1.474000E+01 3.868000E+01 -497 1 3.018000E+01 2.268000E+01 1.230000E+01 -498 1 2.320000E+01 2.918000E+01 2.774000E+01 -499 1 1.001000E+01 3.753000E+01 2.846000E+01 -500 1 2.132000E+01 2.645000E+01 1.565000E+01 -501 1 2.124000E+01 4.000000E-01 1.562000E+01 -502 1 2.089000E+01 3.840000E+00 3.390000E+00 -503 1 9.170000E+00 2.348000E+01 1.682000E+01 -504 1 3.598000E+01 1.163000E+01 1.901000E+01 -505 1 6.180000E+00 2.294000E+01 3.150000E+01 -506 1 2.943000E+01 2.030000E+01 1.530000E+00 -507 1 3.094000E+01 1.106000E+01 1.918000E+01 -508 1 7.800000E-01 2.906000E+01 2.530000E+01 -509 1 2.225000E+01 3.673000E+01 1.809000E+01 -510 1 2.905000E+01 3.090000E+01 4.890000E+00 -511 1 2.936000E+01 2.555000E+01 1.342000E+01 -512 1 3.532000E+01 3.460000E+00 3.339000E+01 -513 1 1.160000E+00 1.028000E+01 3.751000E+01 -514 1 2.057000E+01 3.865000E+01 2.644000E+01 -515 1 3.607000E+01 2.724000E+01 2.521000E+01 -516 1 2.070000E+00 2.438000E+01 1.330000E+01 -517 1 3.426000E+01 1.288000E+01 3.510000E+00 -518 1 1.031000E+01 1.441000E+01 1.237000E+01 -519 1 9.380000E+00 3.884000E+01 1.909000E+01 -520 1 1.407000E+01 8.440000E+00 4.290000E+00 -521 1 1.541000E+01 2.054000E+01 1.640000E+01 -522 1 2.758000E+01 1.626000E+01 1.016000E+01 -523 1 2.593000E+01 1.352000E+01 3.500000E+01 -524 1 1.201000E+01 2.840000E+00 2.228000E+01 -525 1 2.295000E+01 1.030000E+00 2.891000E+01 -526 1 1.343000E+01 3.535000E+01 1.220000E+00 -527 1 1.510000E+00 1.070000E+01 3.078000E+01 -528 1 1.510000E+00 3.334000E+01 1.352000E+01 -529 1 1.523000E+01 2.434000E+01 1.679000E+01 -530 1 7.270000E+00 1.314000E+01 3.473000E+01 -531 1 7.970000E+00 3.660000E+00 2.739000E+01 -532 1 1.714000E+01 3.790000E+01 3.372000E+01 -533 1 1.506000E+01 3.911000E+01 2.845000E+01 -534 1 1.887000E+01 1.030000E+01 1.960000E+01 -535 1 1.438000E+01 2.701000E+01 1.312000E+01 -536 1 8.390000E+00 3.570000E+00 2.481000E+01 -537 1 3.839000E+01 2.238000E+01 2.579000E+01 -538 1 1.575000E+01 1.470000E+00 2.340000E+00 -539 1 3.519000E+01 5.500000E-01 2.541000E+01 -540 1 2.842000E+01 2.741000E+01 3.819000E+01 -541 1 5.460000E+00 1.297000E+01 6.280000E+00 -542 1 8.890000E+00 2.460000E+00 8.160000E+00 -543 1 2.594000E+01 3.498000E+01 2.231000E+01 -544 1 1.479000E+01 2.808000E+01 5.580000E+00 -545 1 6.030000E+00 1.235000E+01 2.913000E+01 -546 1 3.869000E+01 3.718000E+01 1.300000E+01 -547 1 1.380000E+00 3.164000E+01 3.510000E+00 -548 1 3.547000E+01 2.438000E+01 6.340000E+00 -549 1 3.259000E+01 5.000000E-01 2.295000E+01 -550 1 1.518000E+01 6.600000E-01 1.028000E+01 -551 1 3.941000E+01 9.710000E+00 6.370000E+00 -552 1 2.449000E+01 2.411000E+01 2.216000E+01 -553 1 2.358000E+01 3.512000E+01 2.349000E+01 -554 1 2.868000E+01 2.597000E+01 2.906000E+01 -555 1 1.977000E+01 3.606000E+01 3.134000E+01 -556 1 1.723000E+01 2.773000E+01 1.903000E+01 -557 1 9.900000E+00 7.220000E+00 4.900000E-01 -558 1 3.167000E+01 3.729000E+01 1.212000E+01 -559 1 1.327000E+01 1.870000E+01 3.987000E+01 -560 1 7.720000E+00 2.210000E+01 1.457000E+01 -561 1 3.201000E+01 3.360000E+01 4.220000E+00 -562 1 2.924000E+01 1.310000E+00 2.747000E+01 -563 1 3.574000E+01 3.101000E+01 1.548000E+01 -564 1 2.924000E+01 3.047000E+01 3.831000E+01 -565 1 1.850000E+00 8.130000E+00 3.932000E+01 -566 1 1.161000E+01 2.185000E+01 8.210000E+00 -567 1 3.442000E+01 6.840000E+00 2.270000E+00 -568 1 3.389000E+01 1.524000E+01 3.643000E+01 -569 1 1.774000E+01 1.401000E+01 1.280000E+01 -570 1 1.943000E+01 2.805000E+01 8.920000E+00 -571 1 3.791000E+01 3.482000E+01 3.156000E+01 -572 1 9.810000E+00 6.760000E+00 1.259000E+01 -573 1 1.101000E+01 1.849000E+01 2.777000E+01 -574 1 3.854000E+01 2.472000E+01 2.208000E+01 -575 1 5.050000E+00 1.827000E+01 1.847000E+01 -576 1 3.709000E+01 3.437000E+01 2.310000E+00 -577 1 1.735000E+01 3.308000E+01 9.600000E-01 -578 1 2.036000E+01 1.672000E+01 8.720000E+00 -579 1 2.025000E+01 1.720000E+00 3.060000E+01 -580 1 2.330000E+01 3.287000E+01 1.820000E+01 -581 1 2.037000E+01 1.620000E+01 2.636000E+01 -582 1 2.366000E+01 3.854000E+01 3.295000E+01 -583 1 1.795000E+01 3.777000E+01 2.290000E+00 -584 1 3.894000E+01 1.893000E+01 3.680000E+01 -585 1 1.733000E+01 1.950000E+00 1.934000E+01 -586 1 2.097000E+01 2.876000E+01 1.299000E+01 -587 1 1.085000E+01 1.202000E+01 2.193000E+01 -588 1 1.420000E+01 1.297000E+01 7.240000E+00 -589 1 3.595000E+01 3.720000E+01 2.476000E+01 -590 1 2.613000E+01 3.840000E+00 3.338000E+01 -591 1 2.638000E+01 1.730000E+01 1.315000E+01 -592 1 3.991000E+01 3.899000E+01 3.256000E+01 -593 1 3.695000E+01 3.579000E+01 4.020000E+01 -594 1 1.289000E+01 3.423000E+01 2.926000E+01 -595 1 2.269000E+01 2.160000E+01 3.927000E+01 -596 1 9.350000E+00 1.344000E+01 3.833000E+01 -597 1 1.540000E+01 5.170000E+00 2.454000E+01 -598 1 2.038000E+01 2.065000E+01 2.232000E+01 -599 1 1.578000E+01 3.991000E+01 2.335000E+01 -600 1 5.790000E+00 1.380000E+00 3.840000E+00 -601 1 3.080000E+00 8.560000E+00 3.132000E+01 -602 1 1.149000E+01 3.351000E+01 3.040000E+00 -603 1 2.710000E+00 6.500000E-01 2.371000E+01 -604 1 1.380000E+00 1.240000E+00 2.604000E+01 -605 1 2.461000E+01 1.463000E+01 2.216000E+01 -606 1 3.489000E+01 3.560000E+01 1.214000E+01 -607 1 2.110000E+01 1.130000E+01 3.203000E+01 -608 1 2.710000E+00 2.171000E+01 1.921000E+01 -609 1 2.371000E+01 2.064000E+01 1.711000E+01 -610 1 2.608000E+01 3.770000E+01 2.926000E+01 -611 1 9.100000E-01 3.790000E+00 2.455000E+01 -612 1 1.232000E+01 3.946000E+01 2.822000E+01 -613 1 7.920000E+00 3.155000E+01 3.494000E+01 -614 1 8.640000E+00 1.228000E+01 3.600000E-01 -615 1 1.209000E+01 1.765000E+01 1.449000E+01 -616 1 9.430000E+00 3.682000E+01 2.133000E+01 -617 1 3.655000E+01 3.211000E+01 1.296000E+01 -618 1 8.400000E+00 3.299000E+01 2.640000E+00 -619 1 3.150000E+01 1.270000E+00 2.872000E+01 -620 1 2.434000E+01 2.294000E+01 9.930000E+00 -621 1 7.010000E+00 3.645000E+01 2.206000E+01 -622 1 2.411000E+01 7.500000E+00 7.340000E+00 -623 1 3.769000E+01 2.512000E+01 1.061000E+01 -624 1 2.642000E+01 2.827000E+01 1.392000E+01 -625 1 1.534000E+01 2.490000E+00 3.676000E+01 -626 1 3.848000E+01 1.350000E+00 9.000000E+00 -627 1 2.170000E+01 3.500000E+01 9.420000E+00 -628 1 3.720000E+00 3.177000E+01 2.306000E+01 -629 1 1.584000E+01 9.150000E+00 2.081000E+01 -630 1 3.619000E+01 2.571000E+01 3.644000E+01 -631 1 5.290000E+00 4.017000E+01 3.818000E+01 -632 1 2.045000E+01 3.980000E+00 3.903000E+01 -633 1 2.976000E+01 1.756000E+01 6.560000E+00 -634 1 2.771000E+01 2.528000E+01 1.758000E+01 -635 1 2.285000E+01 2.420000E+00 3.632000E+01 -636 1 3.797000E+01 1.128000E+01 8.220000E+00 -637 1 1.619000E+01 3.179000E+01 2.109000E+01 -638 1 1.248000E+01 2.994000E+01 1.643000E+01 -639 1 3.304000E+01 1.518000E+01 4.690000E+00 -640 1 1.678000E+01 2.830000E+01 1.621000E+01 -641 1 1.230000E+01 3.206000E+01 1.360000E+01 -642 1 3.749000E+01 1.930000E+01 8.980000E+00 -643 1 3.385000E+01 2.638000E+01 1.406000E+01 -644 1 1.365000E+01 3.490000E+00 3.058000E+01 -645 1 6.730000E+00 2.010000E+01 1.255000E+01 -646 1 3.550000E+01 3.928000E+01 1.700000E+01 -647 1 3.594000E+01 6.490000E+00 4.005000E+01 -648 1 3.877000E+01 3.043000E+01 1.877000E+01 -649 1 9.340000E+00 2.314000E+01 3.499000E+01 -650 1 3.007000E+01 2.930000E+01 1.071000E+01 -651 1 3.420000E+01 1.243000E+01 3.417000E+01 -652 1 6.270000E+00 3.567000E+01 3.941000E+01 -653 1 3.647000E+01 2.536000E+01 2.990000E+01 -654 1 3.468000E+01 8.800000E-01 3.509000E+01 -655 1 3.280000E+01 2.184000E+01 1.227000E+01 -656 1 1.615000E+01 1.291000E+01 1.584000E+01 -657 1 3.990000E+01 3.177000E+01 1.626000E+01 -658 1 5.200000E+00 2.090000E+01 3.293000E+01 -659 1 3.609000E+01 7.970000E+00 3.355000E+01 -660 1 2.126000E+01 1.560000E+00 1.093000E+01 -661 1 3.862000E+01 1.842000E+01 1.982000E+01 -662 1 1.861000E+01 1.123000E+01 2.674000E+01 -663 1 2.391000E+01 1.732000E+01 3.061000E+01 -664 1 6.350000E+00 1.859000E+01 2.796000E+01 -665 1 3.644000E+01 6.380000E+00 1.109000E+01 -666 1 1.520000E+00 2.203000E+01 1.682000E+01 -667 1 3.213000E+01 1.863000E+01 5.570000E+00 -668 1 3.212000E+01 2.800000E+01 8.050000E+00 -669 1 3.344000E+01 1.076000E+01 1.339000E+01 -670 1 1.797000E+01 3.840000E+00 3.663000E+01 -671 1 7.730000E+00 5.790000E+00 3.015000E+01 -672 1 2.891000E+01 2.616000E+01 2.630000E+01 -673 1 1.781000E+01 1.785000E+01 4.280000E+00 -674 1 2.327000E+01 2.643000E+01 3.553000E+01 -675 1 8.190000E+00 3.984000E+01 3.549000E+01 -676 1 3.472000E+01 2.874000E+01 2.162000E+01 -677 1 2.685000E+01 2.769000E+01 8.010000E+00 -678 1 1.593000E+01 1.886000E+01 3.164000E+01 -679 1 1.452000E+01 6.930000E+00 1.527000E+01 -680 1 1.704000E+01 2.665000E+01 2.424000E+01 -681 1 3.051000E+01 2.600000E-01 2.126000E+01 -682 1 3.610000E+00 1.666000E+01 4.260000E+00 -683 1 1.560000E+00 2.023000E+01 2.785000E+01 -684 1 7.960000E+00 6.270000E+00 1.879000E+01 -685 1 1.494000E+01 2.269000E+01 2.395000E+01 -686 1 3.239000E+01 3.789000E+01 1.615000E+01 -687 1 2.933000E+01 3.430000E+01 1.219000E+01 -688 1 3.053000E+01 3.060000E+01 1.596000E+01 -689 1 3.924000E+01 4.960000E+00 1.373000E+01 -690 1 3.640000E+00 7.120000E+00 3.330000E+00 -691 1 1.567000E+01 3.612000E+01 4.030000E+01 -692 1 1.589000E+01 1.675000E+01 1.275000E+01 -693 1 2.139000E+01 2.311000E+01 1.618000E+01 -694 1 2.488000E+01 2.183000E+01 1.498000E+01 -695 1 3.215000E+01 3.492000E+01 2.542000E+01 -696 1 2.819000E+01 1.378000E+01 3.237000E+01 -697 1 3.815000E+01 1.373000E+01 3.633000E+01 -698 1 4.340000E+00 3.811000E+01 5.780000E+00 -699 1 4.390000E+00 3.276000E+01 3.068000E+01 -700 1 2.930000E+01 4.008000E+01 1.894000E+01 -701 1 1.313000E+01 1.999000E+01 9.970000E+00 -702 1 3.142000E+01 3.774000E+01 2.725000E+01 -703 1 2.779000E+01 3.169000E+01 8.130000E+00 -704 1 5.340000E+00 3.398000E+01 9.790000E+00 -705 1 2.602000E+01 6.270000E+00 9.090000E+00 -706 1 2.247000E+01 2.886000E+01 1.950000E+01 -707 1 4.650000E+00 3.260000E+00 8.180000E+00 -708 1 3.039000E+01 3.515000E+01 2.966000E+01 -709 1 2.434000E+01 7.210000E+00 3.155000E+01 -710 1 1.250000E+00 5.230000E+00 3.544000E+01 -711 1 1.390000E+01 2.491000E+01 2.517000E+01 -712 1 3.581000E+01 1.145000E+01 2.867000E+01 -713 1 5.800000E-01 1.696000E+01 3.703000E+01 -714 1 2.303000E+01 3.198000E+01 1.486000E+01 -715 1 2.135000E+01 1.115000E+01 1.687000E+01 -716 1 3.806000E+01 3.995000E+01 1.678000E+01 -717 1 4.140000E+00 3.313000E+01 1.790000E+01 -718 1 3.480000E+01 3.762000E+01 6.200000E-01 -719 1 3.188000E+01 1.792000E+01 2.097000E+01 -720 1 2.350000E+00 1.273000E+01 2.318000E+01 -721 1 2.728000E+01 1.889000E+01 9.160000E+00 -722 1 3.408000E+01 3.084000E+01 3.294000E+01 -723 1 3.240000E+00 1.244000E+01 2.943000E+01 -724 1 2.051000E+01 1.324000E+01 1.061000E+01 -725 1 3.179000E+01 2.032000E+01 3.777000E+01 -726 1 1.300000E+00 3.036000E+01 3.260000E+01 -727 1 5.810000E+00 3.539000E+01 2.529000E+01 -728 1 1.356000E+01 4.050000E+00 7.980000E+00 -729 1 1.280000E+00 1.406000E+01 3.084000E+01 -730 1 3.751000E+01 9.910000E+00 1.419000E+01 -731 1 3.560000E+00 2.043000E+01 3.572000E+01 -732 1 2.807000E+01 1.272000E+01 2.957000E+01 -733 1 1.030000E+01 3.771000E+01 3.320000E+00 -734 1 2.519000E+01 3.108000E+01 3.485000E+01 -735 1 4.210000E+00 1.015000E+01 1.481000E+01 -736 1 3.297000E+01 3.553000E+01 3.800000E-01 -737 1 1.391000E+01 4.250000E+00 2.798000E+01 -738 1 3.163000E+01 3.147000E+01 2.522000E+01 -739 1 6.800000E-01 9.000000E+00 9.580000E+00 -740 1 3.693000E+01 1.269000E+01 2.138000E+01 -741 1 3.779000E+01 1.676000E+01 2.900000E+00 -742 1 3.409000E+01 3.193000E+01 3.230000E+00 -743 1 2.104000E+01 1.530000E+00 3.802000E+01 -744 1 3.698000E+01 8.310000E+00 2.317000E+01 -745 1 1.636000E+01 3.968000E+01 2.039000E+01 -746 1 1.718000E+01 2.280000E+01 1.567000E+01 -747 1 2.872000E+01 3.545000E+01 2.363000E+01 -748 1 1.478000E+01 2.706000E+01 1.992000E+01 -749 1 2.920000E+00 2.723000E+01 4.320000E+00 -750 1 9.980000E+00 3.424000E+01 2.143000E+01 -751 1 3.957000E+01 3.017000E+01 3.709000E+01 -752 1 4.000000E+00 3.655000E+01 7.970000E+00 -753 1 3.551000E+01 4.002000E+01 2.020000E+01 -754 1 3.830000E+00 3.087000E+01 6.520000E+00 -755 1 2.354000E+01 2.238000E+01 4.140000E+00 -756 1 1.044000E+01 3.541000E+01 5.160000E+00 -757 1 2.194000E+01 3.613000E+01 3.780000E+01 -758 1 2.092000E+01 2.245000E+01 1.115000E+01 -759 1 3.496000E+01 1.040000E+00 1.250000E+01 -760 1 3.112000E+01 2.356000E+01 2.265000E+01 -761 1 4.018000E+01 2.631000E+01 1.422000E+01 -762 1 3.725000E+01 2.257000E+01 4.990000E+00 -763 1 4.260000E+00 7.250000E+00 5.800000E-01 -764 1 1.535000E+01 2.568000E+01 4.500000E+00 -765 1 2.280000E+00 7.200000E+00 2.548000E+01 -766 1 1.892000E+01 2.767000E+01 3.048000E+01 -767 1 3.965000E+01 2.569000E+01 8.820000E+00 -768 1 3.997000E+01 2.795000E+01 1.922000E+01 -769 1 3.916000E+01 2.240000E+01 1.647000E+01 -770 1 2.000000E-02 1.028000E+01 2.766000E+01 -771 1 8.010000E+00 6.310000E+00 2.720000E+00 -772 1 1.906000E+01 3.198000E+01 2.144000E+01 -773 1 2.095000E+01 2.715000E+01 3.392000E+01 -774 1 3.462000E+01 2.642000E+01 3.263000E+01 -775 1 1.301000E+01 2.714000E+01 1.069000E+01 -776 1 1.523000E+01 2.320000E+00 6.840000E+00 -777 1 5.620000E+00 1.000000E-01 2.002000E+01 -778 1 5.430000E+00 8.100000E+00 8.940000E+00 -779 1 1.961000E+01 2.385000E+01 4.008000E+01 -780 1 1.642000E+01 1.774000E+01 3.617000E+01 -781 1 1.140000E+00 2.459000E+01 3.976000E+01 -782 1 6.360000E+00 7.020000E+00 3.485000E+01 -783 1 3.050000E+00 3.680000E+01 3.114000E+01 -784 1 3.819000E+01 3.930000E+01 1.971000E+01 -785 1 3.449000E+01 5.310000E+00 7.490000E+00 -786 1 2.447000E+01 2.977000E+01 2.104000E+01 -787 1 1.216000E+01 2.083000E+01 1.964000E+01 -788 1 3.000000E-02 1.740000E+01 3.406000E+01 -789 1 1.061000E+01 6.600000E-01 1.321000E+01 -790 1 6.150000E+00 1.853000E+01 3.426000E+01 -791 1 3.316000E+01 1.856000E+01 3.208000E+01 -792 1 9.170000E+00 1.165000E+01 1.375000E+01 -793 1 7.100000E+00 2.260000E+00 3.753000E+01 -794 1 3.203000E+01 8.540000E+00 2.772000E+01 -795 1 3.570000E+01 1.662000E+01 1.270000E+00 -796 1 1.294000E+01 1.035000E+01 2.984000E+01 -797 1 2.190000E+00 3.980000E+01 7.100000E-01 -798 1 3.700000E+01 1.581000E+01 3.798000E+01 -799 1 7.490000E+00 1.611000E+01 2.699000E+01 -800 1 1.770000E+01 3.511000E+01 2.850000E+00 -801 1 3.115000E+01 2.188000E+01 1.933000E+01 -802 1 1.725000E+01 7.210000E+00 2.589000E+01 -803 1 2.056000E+01 2.099000E+01 4.240000E+00 -804 1 9.800000E+00 8.470000E+00 4.960000E+00 -805 1 3.926000E+01 1.310000E+00 3.630000E+01 -806 1 1.438000E+01 1.603000E+01 3.682000E+01 -807 1 3.647000E+01 2.067000E+01 3.631000E+01 -808 1 6.610000E+00 2.971000E+01 3.295000E+01 -809 1 2.104000E+01 7.710000E+00 3.731000E+01 -810 1 1.582000E+01 3.212000E+01 1.447000E+01 -811 1 1.030000E+00 1.449000E+01 2.940000E+00 -812 1 9.300000E-01 5.000000E-01 3.422000E+01 -813 1 2.733000E+01 3.544000E+01 2.021000E+01 -814 1 1.997000E+01 8.780000E+00 3.361000E+01 -815 1 1.831000E+01 1.683000E+01 1.128000E+01 -816 1 4.900000E+00 9.750000E+00 2.688000E+01 -817 1 2.096000E+01 9.670000E+00 6.390000E+00 -818 1 8.240000E+00 2.498000E+01 3.239000E+01 -819 1 2.763000E+01 1.116000E+01 9.470000E+00 -820 1 3.852000E+01 3.052000E+01 1.193000E+01 -821 1 3.237000E+01 2.209000E+01 1.608000E+01 -822 1 3.000000E+01 2.932000E+01 2.511000E+01 -823 1 3.354000E+01 3.845000E+01 1.356000E+01 -824 1 1.186000E+01 2.160000E+00 3.527000E+01 -825 1 3.336000E+01 2.013000E+01 2.136000E+01 -826 1 3.470000E+01 1.719000E+01 3.890000E+00 -827 1 3.460000E+00 3.257000E+01 9.700000E-01 -828 1 1.512000E+01 3.043000E+01 1.635000E+01 -829 1 1.564000E+01 1.436000E+01 3.110000E+00 -830 1 1.960000E+00 3.510000E+00 2.854000E+01 -831 1 3.933000E+01 1.727000E+01 2.233000E+01 -832 1 6.770000E+00 2.061000E+01 1.888000E+01 -833 1 1.690000E+01 3.100000E+00 8.990000E+00 -834 1 7.920000E+00 1.209000E+01 2.119000E+01 -835 1 8.140000E+00 1.669000E+01 1.654000E+01 -836 1 1.356000E+01 3.261000E+01 1.777000E+01 -837 1 1.916000E+01 2.254000E+01 2.240000E+00 -838 1 8.200000E-01 1.630000E+00 9.600000E+00 -839 1 4.230000E+00 7.800000E-01 1.595000E+01 -840 1 3.256000E+01 3.110000E+01 1.334000E+01 -841 1 2.620000E+00 3.921000E+01 1.443000E+01 -842 1 2.916000E+01 2.898000E+01 2.530000E+00 -843 1 4.006000E+01 2.917000E+01 3.966000E+01 -844 1 9.600000E+00 3.287000E+01 1.425000E+01 -845 1 7.700000E+00 4.030000E+01 2.270000E+00 -846 1 2.284000E+01 1.328000E+01 3.290000E+01 -847 1 1.866000E+01 2.900000E-01 2.668000E+01 -848 1 5.620000E+00 1.563000E+01 2.383000E+01 -849 1 2.584000E+01 1.075000E+01 1.414000E+01 -850 1 3.147000E+01 3.050000E+00 5.580000E+00 -851 1 2.520000E+01 3.040000E+01 1.900000E-01 -852 1 2.617000E+01 2.138000E+01 2.898000E+01 -853 1 3.771000E+01 1.780000E+01 4.010000E+01 -854 1 1.203000E+01 3.870000E+01 1.346000E+01 -855 1 6.580000E+00 2.261000E+01 4.900000E-01 -856 1 2.727000E+01 3.260000E+00 1.314000E+01 -857 1 3.430000E+00 1.018000E+01 2.242000E+01 -858 1 1.162000E+01 2.183000E+01 2.590000E+00 -859 1 2.840000E+01 2.584000E+01 4.910000E+00 -860 1 2.730000E+00 1.896000E+01 1.988000E+01 -861 1 2.209000E+01 3.577000E+01 1.290000E+01 -862 1 2.057000E+01 6.120000E+00 1.587000E+01 -863 1 2.596000E+01 9.010000E+00 9.880000E+00 -864 1 1.852000E+01 1.698000E+01 1.500000E+01 -865 1 7.580000E+00 9.280000E+00 2.879000E+01 -866 1 2.592000E+01 1.074000E+01 1.900000E-01 -867 1 1.295000E+01 5.200000E+00 4.022000E+01 -868 1 2.274000E+01 1.780000E+01 2.731000E+01 -869 1 3.434000E+01 4.240000E+00 2.660000E+01 -870 1 1.378000E+01 3.530000E+01 2.066000E+01 -871 1 3.765000E+01 9.920000E+00 2.705000E+01 -872 1 3.754000E+01 2.837000E+01 3.605000E+01 -873 1 5.760000E+00 3.360000E+00 3.454000E+01 -874 1 3.029000E+01 2.226000E+01 2.898000E+01 -875 1 3.327000E+01 1.732000E+01 7.840000E+00 -876 1 3.632000E+01 1.310000E+01 6.250000E+00 -877 1 3.194000E+01 2.590000E+01 2.524000E+01 -878 1 1.028000E+01 1.960000E+00 4.490000E+00 -879 1 3.579000E+01 2.290000E+00 2.966000E+01 -880 1 3.942000E+01 3.196000E+01 6.600000E-01 -881 1 3.678000E+01 3.858000E+01 5.240000E+00 -882 1 1.144000E+01 3.168000E+01 3.634000E+01 -883 1 1.450000E+01 2.814000E+01 3.868000E+01 -884 1 3.402000E+01 1.046000E+01 2.060000E+01 -885 1 1.743000E+01 3.810000E+01 3.998000E+01 -886 1 3.809000E+01 3.529000E+01 2.441000E+01 -887 1 3.648000E+01 2.244000E+01 1.856000E+01 -888 1 3.363000E+01 1.148000E+01 2.301000E+01 -889 1 1.700000E+00 2.129000E+01 9.050000E+00 -890 1 7.440000E+00 2.906000E+01 2.745000E+01 -891 1 2.516000E+01 1.413000E+01 3.209000E+01 -892 1 1.770000E+00 1.710000E+00 2.115000E+01 -893 1 3.475000E+01 4.018000E+01 3.987000E+01 -894 1 3.282000E+01 3.888000E+01 3.845000E+01 -895 1 2.771000E+01 2.233000E+01 2.152000E+01 -896 1 1.500000E-01 3.264000E+01 6.430000E+00 -897 1 3.724000E+01 1.184000E+01 3.794000E+01 -898 1 1.817000E+01 3.143000E+01 2.934000E+01 -899 1 3.997000E+01 7.000000E+00 2.259000E+01 -900 1 1.854000E+01 1.541000E+01 1.812000E+01 -901 1 1.820000E+00 2.583000E+01 3.519000E+01 -902 1 3.299000E+01 2.158000E+01 2.852000E+01 -903 1 3.254000E+01 2.840000E+01 2.650000E+01 -904 1 2.985000E+01 1.900000E+01 1.933000E+01 -905 1 3.170000E+00 1.346000E+01 8.600000E+00 -906 1 1.997000E+01 3.786000E+01 8.920000E+00 -907 1 3.431000E+01 1.089000E+01 7.990000E+00 -908 1 2.038000E+01 7.980000E+00 3.979000E+01 -909 1 4.080000E+00 2.395000E+01 3.035000E+01 -910 1 3.444000E+01 9.670000E+00 3.008000E+01 -911 1 1.583000E+01 1.467000E+01 2.227000E+01 -912 1 1.431000E+01 1.500000E+01 3.947000E+01 -913 1 4.670000E+00 2.058000E+01 3.000000E-01 -914 1 9.300000E+00 2.344000E+01 5.290000E+00 -915 1 2.399000E+01 2.950000E+01 2.521000E+01 -916 1 2.265000E+01 5.580000E+00 3.851000E+01 -917 1 2.574000E+01 2.662000E+01 3.447000E+01 -918 1 2.933000E+01 2.029000E+01 2.288000E+01 -919 1 2.541000E+01 9.850000E+00 2.358000E+01 -920 1 5.910000E+00 3.300000E+00 5.750000E+00 -921 1 1.326000E+01 7.000000E-02 2.430000E+01 -922 1 3.950000E+00 2.194000E+01 2.171000E+01 -923 1 3.333000E+01 3.333000E+01 3.166000E+01 -924 1 1.750000E+00 1.349000E+01 1.146000E+01 -925 1 3.112000E+01 2.539000E+01 1.787000E+01 -926 1 1.868000E+01 1.020000E+00 1.011000E+01 -927 1 1.286000E+01 2.967000E+01 1.190000E+01 -928 1 7.900000E+00 3.319000E+01 5.760000E+00 -929 1 3.152000E+01 1.395000E+01 1.066000E+01 -930 1 1.509000E+01 3.071000E+01 1.065000E+01 -931 1 2.109000E+01 1.130000E+01 8.650000E+00 -932 1 3.999000E+01 2.953000E+01 2.270000E+01 -933 1 1.099000E+01 3.969000E+01 2.321000E+01 -934 1 1.117000E+01 3.025000E+01 3.283000E+01 -935 1 3.573000E+01 2.144000E+01 3.377000E+01 -936 1 3.968000E+01 2.056000E+01 3.883000E+01 -937 1 3.883000E+01 2.733000E+01 2.522000E+01 -938 1 3.058000E+01 3.023000E+01 3.197000E+01 -939 1 1.682000E+01 3.112000E+01 3.195000E+01 -940 1 5.210000E+00 1.511000E+01 2.270000E+00 -941 1 2.484000E+01 3.855000E+01 1.900000E+01 -942 1 1.251000E+01 8.200000E-01 6.010000E+00 -943 1 1.945000E+01 2.246000E+01 2.716000E+01 -944 1 3.236000E+01 2.477000E+01 4.090000E+00 -945 1 3.575000E+01 2.625000E+01 2.092000E+01 -946 1 3.212000E+01 3.182000E+01 8.550000E+00 -947 1 8.700000E+00 3.527000E+01 2.976000E+01 -948 1 3.505000E+01 1.031000E+01 3.573000E+01 -949 1 1.260000E+00 1.847000E+01 3.270000E+00 -950 1 2.692000E+01 3.179000E+01 3.059000E+01 -951 1 1.983000E+01 3.155000E+01 1.247000E+01 -952 1 2.251000E+01 2.447000E+01 3.282000E+01 -953 1 3.023000E+01 1.924000E+01 3.172000E+01 -954 1 1.474000E+01 3.618000E+01 2.940000E+01 -955 1 5.110000E+00 5.140000E+00 1.415000E+01 -956 1 1.730000E+01 2.116000E+01 1.800000E-01 -957 1 1.817000E+01 3.470000E+00 2.967000E+01 -958 1 1.196000E+01 3.108000E+01 2.941000E+01 -959 1 3.782000E+01 2.364000E+01 1.930000E+00 -960 1 1.775000E+01 1.363000E+01 2.943000E+01 -961 1 1.126000E+01 4.530000E+00 1.315000E+01 -962 1 1.827000E+01 3.255000E+01 2.395000E+01 -963 1 1.220000E+01 9.900000E-01 2.410000E+00 -964 1 2.614000E+01 3.974000E+01 1.483000E+01 -965 1 1.964000E+01 3.425000E+01 2.586000E+01 -966 1 2.316000E+01 5.030000E+00 2.602000E+01 -967 1 2.478000E+01 3.461000E+01 2.617000E+01 -968 1 3.113000E+01 1.817000E+01 2.240000E+00 -969 1 8.710000E+00 3.614000E+01 1.418000E+01 -970 1 1.900000E-01 3.677000E+01 3.071000E+01 -971 1 3.538000E+01 5.140000E+00 2.318000E+01 -972 1 9.790000E+00 2.135000E+01 2.544000E+01 -973 1 1.234000E+01 3.592000E+01 1.006000E+01 -974 1 2.808000E+01 2.346000E+01 6.350000E+00 -975 1 1.086000E+01 3.276000E+01 2.368000E+01 -976 1 3.010000E+01 1.223000E+01 2.699000E+01 -977 1 1.798000E+01 3.060000E+00 4.020000E+00 -978 1 9.390000E+00 1.377000E+01 5.800000E+00 -979 1 9.450000E+00 9.490000E+00 2.509000E+01 -980 1 1.634000E+01 2.181000E+01 2.177000E+01 -981 1 2.499000E+01 2.674000E+01 4.900000E-01 -982 1 7.580000E+00 1.520000E+01 3.701000E+01 -983 1 3.193000E+01 1.752000E+01 1.411000E+01 -984 1 3.935000E+01 5.860000E+00 1.126000E+01 -985 1 4.690000E+00 2.804000E+01 1.205000E+01 -986 1 1.666000E+01 4.480000E+00 5.880000E+00 -987 1 1.574000E+01 1.277000E+01 2.425000E+01 -988 1 3.410000E+00 5.510000E+00 9.080000E+00 -989 1 3.154000E+01 1.890000E+00 1.838000E+01 -990 1 9.200000E-01 1.946000E+01 1.111000E+01 -991 1 1.300000E-01 3.681000E+01 1.547000E+01 -992 1 2.851000E+01 3.912000E+01 2.277000E+01 -993 1 1.302000E+01 3.893000E+01 3.916000E+01 -994 1 2.523000E+01 2.550000E+01 2.880000E+00 -995 1 1.403000E+01 2.277000E+01 1.031000E+01 -996 1 9.250000E+00 3.892000E+01 1.171000E+01 -997 1 2.110000E+00 4.720000E+00 1.958000E+01 -998 1 3.144000E+01 3.505000E+01 3.586000E+01 -999 1 8.950000E+00 3.743000E+01 3.477000E+01 -1000 1 3.336000E+01 2.864000E+01 3.608000E+01 -1001 1 8.380000E+00 6.150000E+00 3.305000E+01 -1002 1 4.015000E+01 3.770000E+01 4.670000E+00 -1003 1 2.169000E+01 8.000000E+00 8.710000E+00 -1004 1 3.218000E+01 8.590000E+00 3.414000E+01 -1005 1 1.451000E+01 1.921000E+01 2.655000E+01 -1006 1 3.070000E+01 5.380000E+00 1.411000E+01 -1007 1 1.231000E+01 1.584000E+01 1.988000E+01 -1008 1 1.339000E+01 1.660000E+00 2.670000E+01 -1009 1 1.676000E+01 3.086000E+01 5.210000E+00 -1010 1 1.886000E+01 4.200000E+00 1.443000E+01 -1011 1 4.390000E+00 2.058000E+01 7.710000E+00 -1012 1 1.980000E+00 1.848000E+01 1.524000E+01 -1013 1 8.270000E+00 4.710000E+00 1.614000E+01 -1014 1 3.172000E+01 1.239000E+01 2.488000E+01 -1015 1 5.750000E+00 1.411000E+01 1.242000E+01 -1016 1 3.544000E+01 3.200000E+01 9.300000E-01 -1017 1 3.444000E+01 2.616000E+01 3.838000E+01 -1018 1 2.259000E+01 3.158000E+01 7.330000E+00 -1019 1 1.400000E+01 3.055000E+01 3.491000E+01 -1020 1 2.852000E+01 2.002000E+01 2.953000E+01 -1021 1 3.060000E+01 1.624000E+01 9.080000E+00 -1022 1 1.561000E+01 1.068000E+01 1.044000E+01 -1023 1 2.138000E+01 2.543000E+01 2.883000E+01 -1024 1 1.760000E+00 2.414000E+01 4.110000E+00 -1025 1 1.033000E+01 2.356000E+01 3.815000E+01 -1026 1 1.698000E+01 1.150000E+01 2.182000E+01 -1027 1 1.922000E+01 1.262000E+01 3.896000E+01 -1028 1 3.953000E+01 1.910000E+00 2.334000E+01 -1029 1 9.940000E+00 2.793000E+01 3.256000E+01 -1030 1 4.600000E-01 1.283000E+01 3.671000E+01 -1031 1 1.190000E+00 7.660000E+00 1.186000E+01 -1032 1 1.931000E+01 1.312000E+01 4.800000E+00 -1033 1 3.352000E+01 2.255000E+01 3.626000E+01 -1034 1 1.631000E+01 7.100000E+00 8.830000E+00 -1035 1 1.934000E+01 7.420000E+00 2.788000E+01 -1036 1 2.025000E+01 2.075000E+01 4.015000E+01 -1037 1 2.824000E+01 9.520000E+00 1.630000E+01 -1038 1 3.989000E+01 3.390000E+01 2.986000E+01 -1039 1 2.294000E+01 4.790000E+00 1.448000E+01 -1040 1 4.019000E+01 2.327000E+01 3.411000E+01 -1041 1 3.940000E+00 2.697000E+01 2.054000E+01 -1042 1 1.789000E+01 9.490000E+00 6.520000E+00 -1043 1 2.719000E+01 3.389000E+01 3.250000E+01 -1044 1 2.649000E+01 2.743000E+01 4.230000E+00 -1045 1 1.330000E+00 2.940000E+01 3.013000E+01 -1046 1 3.535000E+01 7.110000E+00 2.989000E+01 -1047 1 2.787000E+01 2.802000E+01 1.162000E+01 -1048 1 1.347000E+01 1.450000E+00 2.050000E+01 -1049 1 3.466000E+01 4.150000E+00 2.072000E+01 -1050 1 2.759000E+01 3.805000E+01 1.863000E+01 -1051 1 2.095000E+01 6.790000E+00 3.055000E+01 -1052 1 2.306000E+01 4.640000E+00 2.881000E+01 -1053 1 1.007000E+01 4.480000E+00 9.390000E+00 -1054 1 1.015000E+01 1.046000E+01 3.502000E+01 -1055 1 3.088000E+01 3.307000E+01 3.856000E+01 -1056 1 2.231000E+01 1.040000E+01 1.146000E+01 -1057 1 2.929000E+01 3.853000E+01 3.949000E+01 -1058 1 1.854000E+01 1.947000E+01 6.520000E+00 -1059 1 2.403000E+01 2.653000E+01 1.121000E+01 -1060 1 3.800000E+01 2.400000E+00 3.421000E+01 -1061 1 6.580000E+00 2.857000E+01 9.530000E+00 -1062 1 4.490000E+00 3.065000E+01 3.451000E+01 -1063 1 3.653000E+01 3.394000E+01 1.567000E+01 -1064 1 2.440000E+00 9.340000E+00 3.483000E+01 -1065 1 3.460000E+00 1.150000E+01 3.806000E+01 -1066 1 2.549000E+01 2.264000E+01 2.415000E+01 -1067 1 1.379000E+01 1.752000E+01 9.020000E+00 -1068 1 2.549000E+01 5.930000E+00 3.170000E+00 -1069 1 2.217000E+01 2.260000E+01 1.850000E+00 -1070 1 6.090000E+00 2.440000E+00 1.047000E+01 -1071 1 1.302000E+01 5.270000E+00 4.540000E+00 -1072 1 5.730000E+00 3.967000E+01 3.079000E+01 -1073 1 3.165000E+01 3.579000E+01 7.390000E+00 -1074 1 1.633000E+01 3.326000E+01 2.629000E+01 -1075 1 2.980000E+01 1.057000E+01 2.904000E+01 -1076 1 3.549000E+01 3.290000E+00 1.411000E+01 -1077 1 8.450000E+00 1.779000E+01 1.943000E+01 -1078 1 1.337000E+01 3.361000E+01 3.931000E+01 -1079 1 2.140000E+01 1.651000E+01 3.171000E+01 -1080 1 1.546000E+01 1.432000E+01 1.942000E+01 -1081 1 2.476000E+01 6.300000E+00 1.785000E+01 -1082 1 4.200000E+00 1.800000E+01 2.192000E+01 -1083 1 1.934000E+01 3.368000E+01 9.130000E+00 -1084 1 3.580000E+00 1.281000E+01 1.377000E+01 -1085 1 3.595000E+01 1.280000E+00 3.766000E+01 -1086 1 2.502000E+01 3.406000E+01 3.411000E+01 -1087 1 3.642000E+01 2.752000E+01 1.059000E+01 -1088 1 2.228000E+01 3.248000E+01 1.165000E+01 -1089 1 1.361000E+01 1.065000E+01 2.154000E+01 -1090 1 4.050000E+00 2.082000E+01 2.820000E+00 -1091 1 3.283000E+01 7.500000E+00 3.904000E+01 -1092 1 3.332000E+01 3.896000E+01 2.900000E+01 -1093 1 1.987000E+01 1.390000E+00 1.983000E+01 -1094 1 2.039000E+01 3.180000E+01 3.345000E+01 -1095 1 1.746000E+01 6.920000E+00 2.017000E+01 -1096 1 1.084000E+01 2.573000E+01 2.256000E+01 -1097 1 2.710000E+01 2.340000E+01 1.489000E+01 -1098 1 1.000000E-01 4.290000E+00 2.696000E+01 -1099 1 6.400000E+00 1.850000E+01 4.014000E+01 -1100 1 2.334000E+01 2.521000E+01 1.682000E+01 -1101 1 2.029000E+01 1.331000E+01 2.654000E+01 -1102 1 3.414000E+01 1.391000E+01 1.841000E+01 -1103 1 2.984000E+01 3.839000E+01 4.600000E+00 -1104 1 2.570000E+01 1.898000E+01 2.920000E+00 -1105 1 3.812000E+01 3.690000E+01 2.990000E+00 -1106 1 3.477000E+01 1.278000E+01 3.741000E+01 -1107 1 2.619000E+01 8.990000E+00 3.811000E+01 -1108 1 2.288000E+01 3.753000E+01 1.554000E+01 -1109 1 9.580000E+00 1.119000E+01 2.883000E+01 -1110 1 2.885000E+01 3.501000E+01 3.864000E+01 -1111 1 3.804000E+01 2.327000E+01 1.392000E+01 -1112 1 3.221000E+01 1.475000E+01 4.019000E+01 -1113 1 2.298000E+01 3.750000E+00 2.336000E+01 -1114 1 3.079000E+01 2.918000E+01 2.843000E+01 -1115 1 2.192000E+01 3.333000E+01 2.466000E+01 -1116 1 3.105000E+01 1.491000E+01 2.302000E+01 -1117 1 1.463000E+01 1.740000E+01 1.902000E+01 -1118 1 5.160000E+00 1.431000E+01 1.833000E+01 -1119 1 3.748000E+01 3.474000E+01 1.228000E+01 -1120 1 1.928000E+01 2.761000E+01 1.711000E+01 -1121 1 3.456000E+01 2.111000E+01 1.480000E+01 -1122 1 3.947000E+01 1.284000E+01 2.774000E+01 -1123 1 3.109000E+01 1.864000E+01 1.692000E+01 -1124 1 1.101000E+01 3.502000E+01 2.637000E+01 -1125 1 6.450000E+00 8.300000E+00 3.935000E+01 -1126 1 1.102000E+01 3.965000E+01 3.741000E+01 -1127 1 3.034000E+01 2.946000E+01 1.600000E-01 -1128 1 5.820000E+00 2.265000E+01 3.620000E+00 -1129 1 1.668000E+01 3.081000E+01 2.721000E+01 -1130 1 3.337000E+01 3.333000E+01 3.704000E+01 -1131 1 8.670000E+00 1.893000E+01 3.462000E+01 -1132 1 5.250000E+00 2.861000E+01 3.655000E+01 -1133 1 3.401000E+01 2.099000E+01 3.105000E+01 -1134 1 1.878000E+01 6.930000E+00 3.430000E+00 -1135 1 1.820000E+01 2.042000E+01 1.970000E+01 -1136 1 3.604000E+01 1.869000E+01 2.686000E+01 -1137 1 7.900000E-01 2.344000E+01 7.790000E+00 -1138 1 1.429000E+01 2.965000E+01 2.851000E+01 -1139 1 2.285000E+01 2.852000E+01 6.800000E-01 -1140 1 1.117000E+01 3.682000E+01 2.353000E+01 -1141 1 2.882000E+01 3.799000E+01 9.160000E+00 -1142 1 4.028000E+01 9.430000E+00 1.387000E+01 -1143 1 5.200000E+00 2.358000E+01 3.807000E+01 -1144 1 1.787000E+01 1.770000E+00 3.866000E+01 -1145 1 5.650000E+00 3.737000E+01 2.922000E+01 -1146 1 2.560000E+00 3.544000E+01 1.994000E+01 -1147 1 3.677000E+01 2.009000E+01 2.316000E+01 -1148 1 1.355000E+01 1.968000E+01 5.330000E+00 -1149 1 1.637000E+01 2.384000E+01 9.270000E+00 -1150 1 3.193000E+01 4.010000E+01 3.606000E+01 -1151 1 3.170000E+01 3.120000E+01 5.860000E+00 -1152 1 2.779000E+01 1.944000E+01 6.280000E+00 -1153 1 2.472000E+01 3.992000E+01 2.727000E+01 -1154 1 2.030000E+01 2.963000E+01 2.512000E+01 -1155 1 3.187000E+01 3.400000E+00 3.720000E+01 -1156 1 2.517000E+01 8.650000E+00 1.247000E+01 -1157 1 1.124000E+01 1.631000E+01 3.400000E-01 -1158 1 1.664000E+01 1.285000E+01 2.707000E+01 -1159 1 4.510000E+00 2.920000E+01 2.199000E+01 -1160 1 5.080000E+00 3.390000E+00 3.060000E+01 -1161 1 2.670000E+01 2.982000E+01 3.829000E+01 -1162 1 2.712000E+01 2.265000E+01 9.090000E+00 -1163 1 3.638000E+01 3.170000E+01 5.510000E+00 -1164 1 2.496000E+01 1.438000E+01 1.584000E+01 -1165 1 1.659000E+01 3.052000E+01 1.874000E+01 -1166 1 1.083000E+01 2.998000E+01 2.351000E+01 -1167 1 3.754000E+01 3.751000E+01 3.049000E+01 -1168 1 3.229000E+01 2.187000E+01 3.982000E+01 -1169 1 3.652000E+01 2.556000E+01 1.345000E+01 -1170 1 3.551000E+01 4.010000E+01 1.011000E+01 -1171 1 2.740000E+00 1.585000E+01 3.276000E+01 -1172 1 3.376000E+01 2.291000E+01 1.852000E+01 -1173 1 2.598000E+01 3.266000E+01 2.092000E+01 -1174 1 3.882000E+01 1.360000E+00 1.439000E+01 -1175 1 2.282000E+01 1.660000E+01 2.088000E+01 -1176 1 1.938000E+01 7.990000E+00 2.275000E+01 -1177 1 1.095000E+01 1.666000E+01 4.800000E+00 -1178 1 3.468000E+01 1.184000E+01 2.623000E+01 -1179 1 3.108000E+01 2.838000E+01 1.891000E+01 -1180 1 3.415000E+01 7.750000E+00 1.679000E+01 -1181 1 3.713000E+01 1.988000E+01 5.110000E+00 -1182 1 2.110000E+00 3.913000E+01 3.360000E+00 -1183 1 2.311000E+01 3.560000E+01 6.700000E+00 -1184 1 2.552000E+01 3.364000E+01 7.380000E+00 -1185 1 1.535000E+01 1.344000E+01 1.084000E+01 -1186 1 6.340000E+00 1.187000E+01 1.055000E+01 -1187 1 1.725000E+01 1.950000E+01 1.471000E+01 -1188 1 4.015000E+01 1.317000E+01 1.957000E+01 -1189 1 3.513000E+01 3.980000E+00 3.989000E+01 -1190 1 2.488000E+01 2.747000E+01 3.122000E+01 -1191 1 9.150000E+00 2.214000E+01 3.258000E+01 -1192 1 2.424000E+01 1.200000E+01 6.930000E+00 -1193 1 3.965000E+01 1.413000E+01 1.342000E+01 -1194 1 3.927000E+01 1.600000E-01 4.270000E+00 -1195 1 2.271000E+01 3.680000E+00 1.178000E+01 -1196 1 2.294000E+01 7.560000E+00 1.360000E+00 -1197 1 1.907000E+01 1.235000E+01 1.466000E+01 -1198 1 1.544000E+01 5.110000E+00 1.966000E+01 -1199 1 2.580000E+01 2.601000E+01 2.841000E+01 -1200 1 4.280000E+00 3.770000E+01 2.640000E+01 -1201 1 2.765000E+01 2.761000E+01 5.000000E-01 -1202 1 3.100000E+01 2.392000E+01 3.257000E+01 -1203 1 3.931000E+01 2.020000E+01 2.697000E+01 -1204 1 2.428000E+01 2.482000E+01 3.084000E+01 -1205 1 1.408000E+01 1.666000E+01 1.350000E+00 -1206 1 1.547000E+01 3.540000E+01 3.676000E+01 -1207 1 3.507000E+01 2.395000E+01 1.057000E+01 -1208 1 3.648000E+01 8.430000E+00 9.010000E+00 -1209 1 2.923000E+01 1.604000E+01 1.253000E+01 -1210 1 1.365000E+01 9.500000E-01 1.787000E+01 -1211 1 1.272000E+01 2.981000E+01 7.750000E+00 -1212 1 1.840000E+00 2.728000E+01 3.907000E+01 -1213 1 1.120000E+00 1.518000E+01 1.694000E+01 -1214 1 3.563000E+01 9.240000E+00 3.370000E+00 -1215 1 1.424000E+01 2.757000E+01 2.428000E+01 -1216 1 5.890000E+00 1.033000E+01 5.660000E+00 -1217 1 9.570000E+00 3.371000E+01 3.266000E+01 -1218 1 2.773000E+01 1.012000E+01 2.509000E+01 -1219 1 3.792000E+01 3.945000E+01 2.844000E+01 -1220 1 5.150000E+00 1.463000E+01 2.636000E+01 -1221 1 3.328000E+01 3.381000E+01 2.108000E+01 -1222 1 8.140000E+00 2.831000E+01 2.295000E+01 -1223 1 1.308000E+01 3.189000E+01 3.179000E+01 -1224 1 4.870000E+00 3.625000E+01 1.928000E+01 -1225 1 1.535000E+01 3.519000E+01 1.842000E+01 -1226 1 1.529000E+01 1.635000E+01 2.662000E+01 -1227 1 1.112000E+01 2.849000E+01 1.917000E+01 -1228 1 1.693000E+01 8.820000E+00 3.693000E+01 -1229 1 3.550000E+00 8.000000E-02 4.940000E+00 -1230 1 1.206000E+01 3.431000E+01 3.570000E+01 -1231 1 5.870000E+00 5.960000E+00 4.430000E+00 -1232 1 3.294000E+01 1.180000E+00 3.710000E+00 -1233 1 2.256000E+01 7.940000E+00 1.246000E+01 -1234 1 1.547000E+01 2.903000E+01 3.290000E+01 -1235 1 7.720000E+00 1.020000E+00 2.322000E+01 -1236 1 2.902000E+01 2.914000E+01 8.300000E+00 -1237 1 1.436000E+01 3.453000E+01 3.256000E+01 -1238 1 2.781000E+01 3.972000E+01 3.000000E+00 -1239 1 2.858000E+01 2.193000E+01 3.591000E+01 -1240 1 2.391000E+01 2.270000E+01 1.922000E+01 -1241 1 1.600000E-01 2.370000E+00 3.034000E+01 -1242 1 2.127000E+01 3.586000E+01 3.348000E+01 -1243 1 2.298000E+01 1.863000E+01 2.466000E+01 -1244 1 2.380000E+00 1.022000E+01 2.573000E+01 -1245 1 2.251000E+01 1.543000E+01 1.045000E+01 -1246 1 1.938000E+01 3.690000E+00 7.760000E+00 -1247 1 1.976000E+01 6.120000E+00 3.336000E+01 -1248 1 2.334000E+01 3.926000E+01 2.133000E+01 -1249 1 3.026000E+01 2.779000E+01 5.850000E+00 -1250 1 2.347000E+01 8.300000E-01 3.432000E+01 -1251 1 3.707000E+01 4.440000E+00 2.697000E+01 -1252 1 1.840000E+01 2.950000E+00 2.370000E+01 -1253 1 2.758000E+01 3.078000E+01 1.500000E+01 -1254 1 3.211000E+01 1.728000E+01 2.356000E+01 -1255 1 1.314000E+01 1.152000E+01 2.412000E+01 -1256 1 5.890000E+00 2.665000E+01 3.327000E+01 -1257 1 1.501000E+01 2.282000E+01 2.825000E+01 -1258 1 1.249000E+01 3.631000E+01 7.180000E+00 -1259 1 5.500000E+00 2.406000E+01 9.120000E+00 -1260 1 1.059000E+01 4.300000E-01 3.199000E+01 -1261 1 3.132000E+01 3.683000E+01 2.740000E+00 -1262 1 1.165000E+01 2.439000E+01 1.650000E+00 -1263 1 1.434000E+01 6.550000E+00 6.850000E+00 -1264 1 7.480000E+00 2.303000E+01 7.160000E+00 -1265 1 3.002000E+01 2.488000E+01 2.780000E+00 -1266 1 4.010000E+01 2.802000E+01 3.485000E+01 -1267 1 1.400000E+00 2.684000E+01 1.046000E+01 -1268 1 2.590000E+01 2.991000E+01 3.237000E+01 -1269 1 2.170000E+01 3.797000E+01 2.319000E+01 -1270 1 3.904000E+01 1.949000E+01 2.990000E+00 -1271 1 2.555000E+01 4.360000E+00 1.111000E+01 -1272 1 2.977000E+01 2.702000E+01 1.584000E+01 -1273 1 1.501000E+01 3.299000E+01 2.369000E+01 -1274 1 1.219000E+01 2.916000E+01 3.926000E+01 -1275 1 2.820000E+01 3.847000E+01 2.768000E+01 -1276 1 2.101000E+01 1.450000E+01 2.000000E+01 -1277 1 5.330000E+00 1.646000E+01 2.920000E+01 -1278 1 3.312000E+01 3.543000E+01 2.790000E+01 -1279 1 1.800000E+01 1.098000E+01 1.700000E+01 -1280 1 7.030000E+00 3.831000E+01 1.719000E+01 -1281 1 1.319000E+01 9.240000E+00 1.075000E+01 -1282 1 3.920000E+00 7.200000E+00 1.115000E+01 -1283 1 3.650000E+00 2.979000E+01 1.546000E+01 -1284 1 3.500000E+00 3.072000E+01 3.912000E+01 -1285 1 3.430000E+00 1.000000E+00 2.804000E+01 -1286 1 3.679000E+01 8.930000E+00 1.675000E+01 -1287 1 3.414000E+01 7.190000E+00 2.456000E+01 -1288 1 6.710000E+00 1.730000E+01 1.122000E+01 -1289 1 1.709000E+01 2.770000E+01 1.262000E+01 -1290 1 3.694000E+01 1.546000E+01 1.331000E+01 -1291 1 2.718000E+01 2.792000E+01 1.645000E+01 -1292 1 2.908000E+01 3.329000E+01 3.528000E+01 -1293 1 3.268000E+01 2.537000E+01 3.058000E+01 -1294 1 1.485000E+01 1.259000E+01 1.325000E+01 -1295 1 8.820000E+00 3.261000E+01 4.007000E+01 -1296 1 3.998000E+01 1.613000E+01 2.972000E+01 -1297 1 3.139000E+01 2.758000E+01 3.560000E+00 -1298 1 3.836000E+01 3.975000E+01 3.901000E+01 -1299 1 1.090000E+00 4.980000E+00 1.548000E+01 -1300 1 1.421000E+01 3.173000E+01 5.250000E+00 -1301 1 3.944000E+01 1.907000E+01 6.630000E+00 -1302 1 1.319000E+01 2.388000E+01 3.310000E+01 -1303 1 1.448000E+01 2.150000E+01 1.276000E+01 -1304 1 2.870000E+01 1.075000E+01 3.650000E+00 -1305 1 6.410000E+00 1.970000E+01 9.590000E+00 -1306 1 1.254000E+01 3.653000E+01 3.732000E+01 -1307 1 3.622000E+01 3.267000E+01 3.146000E+01 -1308 1 3.814000E+01 3.510000E+00 2.927000E+01 -1309 1 3.172000E+01 1.006000E+01 3.114000E+01 -1310 1 4.270000E+00 3.802000E+01 1.210000E+01 -1311 1 2.905000E+01 3.354000E+01 4.750000E+00 -1312 1 2.541000E+01 1.406000E+01 2.628000E+01 -1313 1 1.076000E+01 4.920000E+00 3.349000E+01 -1314 1 2.420000E+01 1.290000E+00 3.290000E+00 -1315 1 2.271000E+01 3.960000E+01 2.526000E+01 -1316 1 2.240000E+00 3.942000E+01 8.460000E+00 -1317 1 2.018000E+01 1.189000E+01 2.936000E+01 -1318 1 6.670000E+00 3.647000E+01 3.150000E+00 -1319 1 1.217000E+01 3.813000E+01 1.310000E+00 -1320 1 2.958000E+01 8.560000E+00 2.654000E+01 -1321 1 6.460000E+00 1.124000E+01 3.265000E+01 -1322 1 3.173000E+01 4.810000E+00 3.261000E+01 -1323 1 1.022000E+01 7.550000E+00 2.677000E+01 -1324 1 1.739000E+01 1.514000E+01 4.980000E+00 -1325 1 1.226000E+01 2.119000E+01 2.735000E+01 -1326 1 3.404000E+01 6.900000E+00 3.635000E+01 -1327 1 2.650000E+01 3.732000E+01 5.370000E+00 -1328 1 3.277000E+01 4.990000E+00 1.680000E+01 -1329 1 1.502000E+01 1.545000E+01 7.820000E+00 -1330 1 7.740000E+00 2.527000E+01 3.585000E+01 -1331 1 1.992000E+01 3.187000E+01 1.825000E+01 -1332 1 3.401000E+01 6.910000E+00 2.720000E+01 -1333 1 2.875000E+01 2.100000E+00 2.223000E+01 -1334 1 2.556000E+01 2.718000E+01 2.141000E+01 -1335 1 4.860000E+00 3.796000E+01 4.027000E+01 -1336 1 4.010000E+00 2.570000E+01 1.649000E+01 -1337 1 2.580000E+00 2.737000E+01 1.471000E+01 -1338 1 2.040000E+01 4.770000E+00 2.774000E+01 -1339 1 2.217000E+01 2.430000E+01 8.960000E+00 -1340 1 2.120000E+01 1.712000E+01 1.479000E+01 -1341 1 2.385000E+01 1.226000E+01 1.738000E+01 -1342 1 2.168000E+01 3.595000E+01 2.633000E+01 -1343 1 3.779000E+01 2.744000E+01 2.254000E+01 -1344 1 3.197000E+01 8.010000E+00 1.350000E+00 -1345 1 1.345000E+01 1.666000E+01 2.972000E+01 -1346 1 2.106000E+01 1.860000E+01 5.840000E+00 -1347 1 2.651000E+01 1.600000E-01 3.379000E+01 -1348 1 1.457000E+01 4.990000E+00 3.677000E+01 -1349 1 2.559000E+01 1.070000E+01 3.575000E+01 -1350 1 3.456000E+01 3.082000E+01 1.151000E+01 -1351 1 2.127000E+01 6.240000E+00 6.000000E+00 -1352 1 6.170000E+00 3.078000E+01 3.640000E+00 -1353 1 1.606000E+01 2.608000E+01 3.980000E+01 -1354 1 2.043000E+01 3.960000E+00 2.226000E+01 -1355 1 3.570000E+00 1.118000E+01 1.740000E+01 -1356 1 2.415000E+01 3.418000E+01 1.358000E+01 -1357 1 2.250000E+01 1.542000E+01 7.510000E+00 -1358 1 2.400000E-01 2.390000E+00 1.615000E+01 -1359 1 1.864000E+01 3.642000E+01 2.140000E+01 -1360 1 3.561000E+01 2.350000E+00 1.924000E+01 -1361 1 1.393000E+01 2.400000E+01 4.011000E+01 -1362 1 2.980000E+01 5.650000E+00 3.999000E+01 -1363 1 6.930000E+00 2.818000E+01 2.740000E+00 -1364 1 2.728000E+01 8.100000E-01 3.012000E+01 -1365 1 2.297000E+01 3.893000E+01 3.844000E+01 -1366 1 1.987000E+01 3.658000E+01 5.510000E+00 -1367 1 1.177000E+01 2.127000E+01 3.189000E+01 -1368 1 3.160000E+01 1.245000E+01 3.217000E+01 -1369 1 3.270000E+01 1.684000E+01 1.796000E+01 -1370 1 2.535000E+01 2.905000E+01 1.800000E+01 -1371 1 2.630000E+00 4.370000E+00 1.343000E+01 -1372 1 1.124000E+01 1.275000E+01 1.044000E+01 -1373 1 1.947000E+01 1.880000E+01 2.250000E+00 -1374 1 3.409000E+01 4.040000E+00 5.220000E+00 -1375 1 1.379000E+01 1.329000E+01 4.620000E+00 -1376 1 1.963000E+01 1.086000E+01 3.570000E+00 -1377 1 1.305000E+01 1.861000E+01 3.700000E+01 -1378 1 5.910000E+00 3.479000E+01 7.090000E+00 -1379 1 2.664000E+01 3.274000E+01 1.313000E+01 -1380 1 3.940000E+00 3.429000E+01 3.908000E+01 -1381 1 4.960000E+00 1.359000E+01 3.255000E+01 -1382 1 2.380000E+01 1.574000E+01 3.517000E+01 -1383 1 9.930000E+00 1.304000E+01 3.540000E+01 -1384 1 8.350000E+00 2.658000E+01 1.746000E+01 -1385 1 2.680000E+01 1.073000E+01 3.069000E+01 -1386 1 2.992000E+01 1.538000E+01 2.555000E+01 -1387 1 2.805000E+01 1.774000E+01 3.190000E+00 -1388 1 3.191000E+01 3.929000E+01 6.120000E+00 -1389 1 3.335000E+01 1.971000E+01 1.050000E+00 -1390 1 2.216000E+01 1.137000E+01 2.750000E+00 -1391 1 2.882000E+01 1.110000E+01 7.400000E-01 -1392 1 7.640000E+00 3.850000E+01 3.779000E+01 -1393 1 3.707000E+01 2.949000E+01 3.358000E+01 -1394 1 2.828000E+01 9.070000E+00 1.356000E+01 -1395 1 1.108000E+01 6.850000E+00 8.000000E+00 -1396 1 1.787000E+01 1.364000E+01 9.840000E+00 -1397 1 2.900000E+01 3.620000E+01 1.090000E+00 -1398 1 9.170000E+00 3.214000E+01 1.168000E+01 -1399 1 1.810000E+01 9.150000E+00 9.360000E+00 -1400 1 2.430000E+00 2.545000E+01 1.760000E+00 -1401 1 2.090000E+00 3.653000E+01 1.733000E+01 -1402 1 9.260000E+00 2.339000E+01 4.100000E-01 -1403 1 3.103000E+01 5.880000E+00 8.890000E+00 -1404 1 3.511000E+01 2.325000E+01 1.322000E+01 -1405 1 1.774000E+01 2.442000E+01 4.870000E+00 -1406 1 3.054000E+01 1.328000E+01 1.581000E+01 -1407 1 3.084000E+01 2.721000E+01 3.022000E+01 -1408 1 3.960000E+00 3.703000E+01 3.776000E+01 -1409 1 2.184000E+01 1.208000E+01 3.655000E+01 -1410 1 2.615000E+01 1.950000E+01 1.868000E+01 -1411 1 3.420000E+00 7.500000E-01 3.176000E+01 -1412 1 3.223000E+01 2.681000E+01 3.401000E+01 -1413 1 2.986000E+01 2.995000E+01 2.098000E+01 -1414 1 2.076000E+01 2.310000E+01 2.351000E+01 -1415 1 2.757000E+01 1.960000E+00 1.832000E+01 -1416 1 2.290000E+01 1.656000E+01 1.825000E+01 -1417 1 3.730000E+00 3.849000E+01 2.385000E+01 -1418 1 2.070000E+00 3.006000E+01 3.690000E+01 -1419 1 2.486000E+01 3.901000E+01 3.640000E+00 -1420 1 6.690000E+00 1.080000E+00 1.762000E+01 -1421 1 2.810000E+01 3.061000E+01 2.849000E+01 -1422 1 1.667000E+01 2.217000E+01 3.643000E+01 -1423 1 1.246000E+01 3.921000E+01 3.348000E+01 -1424 1 1.620000E+00 1.527000E+01 2.182000E+01 -1425 1 8.390000E+00 2.229000E+01 2.910000E+00 -1426 1 4.960000E+00 1.722000E+01 3.227000E+01 -1427 1 1.097000E+01 3.120000E+00 3.136000E+01 -1428 1 1.470000E+00 3.810000E+01 2.636000E+01 -1429 1 9.630000E+00 1.670000E+00 3.791000E+01 -1430 1 1.733000E+01 9.980000E+00 3.389000E+01 -1431 1 1.300000E-01 1.829000E+01 5.300000E-01 -1432 1 1.720000E+01 2.888000E+01 3.760000E+00 -1433 1 3.608000E+01 1.331000E+01 1.390000E+00 -1434 1 3.466000E+01 2.952000E+01 2.841000E+01 -1435 1 2.257000E+01 9.070000E+00 3.054000E+01 -1436 1 8.100000E+00 2.772000E+01 3.451000E+01 -1437 1 1.917000E+01 2.970000E+01 3.244000E+01 -1438 1 2.160000E+00 9.940000E+00 1.380000E+00 -1439 1 1.853000E+01 1.426000E+01 2.321000E+01 -1440 1 2.528000E+01 3.675000E+01 3.157000E+01 -1441 1 2.960000E+00 2.813000E+01 3.537000E+01 -1442 1 5.020000E+00 4.000000E-01 1.215000E+01 -1443 1 1.564000E+01 3.659000E+01 2.433000E+01 -1444 1 3.000000E+00 3.658000E+01 1.670000E+00 -1445 1 3.501000E+01 1.470000E+01 3.992000E+01 -1446 1 2.720000E+01 3.610000E+00 6.250000E+00 -1447 1 3.294000E+01 3.124000E+01 3.537000E+01 -1448 1 5.810000E+00 2.759000E+01 1.464000E+01 -1449 1 3.810000E+01 3.890000E+01 8.600000E+00 -1450 1 4.022000E+01 5.010000E+00 7.200000E+00 -1451 1 2.377000E+01 3.116000E+01 3.824000E+01 -1452 1 3.817000E+01 1.637000E+01 5.570000E+00 -1453 1 3.050000E+00 2.772000E+01 3.266000E+01 -1454 1 3.022000E+01 3.328000E+01 1.495000E+01 -1455 1 6.080000E+00 1.196000E+01 2.602000E+01 -1456 1 2.198000E+01 3.821000E+01 6.410000E+00 -1457 1 3.644000E+01 7.460000E+00 3.733000E+01 -1458 1 1.589000E+01 3.311000E+01 3.883000E+01 -1459 1 3.532000E+01 1.931000E+01 2.946000E+01 -1460 1 2.519000E+01 1.542000E+01 1.105000E+01 -1461 1 7.320000E+00 1.694000E+01 1.880000E+00 -1462 1 1.205000E+01 2.463000E+01 1.075000E+01 -1463 1 1.325000E+01 2.868000E+01 1.600000E+00 -1464 1 2.294000E+01 2.149000E+01 3.254000E+01 -1465 1 1.392000E+01 7.080000E+00 2.761000E+01 -1466 1 3.159000E+01 3.295000E+01 3.362000E+01 -1467 1 1.675000E+01 6.980000E+00 1.550000E+00 -1468 1 4.680000E+00 4.700000E-01 8.310000E+00 -1469 1 2.746000E+01 3.543000E+01 3.680000E+00 -1470 1 2.042000E+01 2.320000E+01 3.005000E+01 -1471 1 3.860000E+01 1.418000E+01 1.530000E+00 -1472 1 2.749000E+01 3.548000E+01 2.641000E+01 -1473 1 1.658000E+01 2.845000E+01 1.001000E+01 -1474 1 2.232000E+01 3.803000E+01 2.870000E+00 -1475 1 2.061000E+01 3.710000E+00 3.526000E+01 -1476 1 9.570000E+00 1.493000E+01 3.136000E+01 -1477 1 4.630000E+00 1.600000E+00 1.140000E+00 -1478 1 3.290000E+00 7.150000E+00 3.688000E+01 -1479 1 5.330000E+00 3.326000E+01 2.706000E+01 -1480 1 1.874000E+01 2.017000E+01 3.637000E+01 -1481 1 1.154000E+01 1.770000E+00 8.630000E+00 -1482 1 2.200000E-01 1.175000E+01 9.020000E+00 -1483 1 1.778000E+01 1.796000E+01 8.780000E+00 -1484 1 8.550000E+00 1.950000E+01 1.572000E+01 -1485 1 1.368000E+01 9.410000E+00 3.781000E+01 -1486 1 5.060000E+00 2.528000E+01 1.760000E+00 -1487 1 1.348000E+01 7.750000E+00 3.034000E+01 -1488 1 1.100000E-01 3.838000E+01 1.051000E+01 -1489 1 7.400000E-01 2.262000E+01 2.198000E+01 -1490 1 1.359000E+01 1.589000E+01 3.418000E+01 -1491 1 2.760000E+01 5.130000E+00 3.155000E+01 -1492 1 8.070000E+00 3.178000E+01 1.642000E+01 -1493 1 3.561000E+01 2.099000E+01 4.011000E+01 -1494 1 1.933000E+01 1.870000E+00 3.318000E+01 -1495 1 3.815000E+01 2.150000E+01 5.100000E-01 -1496 1 1.389000E+01 3.694000E+01 1.196000E+01 -1497 1 9.190000E+00 2.380000E+01 1.214000E+01 -1498 1 1.472000E+01 2.570000E+01 2.248000E+01 -1499 1 9.430000E+00 6.980000E+00 1.543000E+01 -1500 1 3.500000E+01 1.781000E+01 3.705000E+01 -1501 1 3.357000E+01 1.549000E+01 1.559000E+01 -1502 1 1.196000E+01 3.850000E+01 5.740000E+00 -1503 1 9.320000E+00 2.848000E+01 2.568000E+01 -1504 1 1.820000E+00 8.920000E+00 3.910000E+00 -1505 1 6.640000E+00 1.783000E+01 4.430000E+00 -1506 1 1.285000E+01 3.971000E+01 9.180000E+00 -1507 1 8.750000E+00 3.740000E+00 5.670000E+00 -1508 1 1.418000E+01 1.894000E+01 1.328000E+01 -1509 1 3.084000E+01 1.262000E+01 3.479000E+01 -1510 1 3.272000E+01 2.918000E+01 1.780000E+00 -1511 1 2.370000E+00 1.336000E+01 5.600000E+00 -1512 1 2.893000E+01 6.660000E+00 1.092000E+01 -1513 1 4.600000E-01 1.000000E-01 1.299000E+01 -1514 1 1.375000E+01 2.610000E+00 4.080000E+00 -1515 1 2.833000E+01 3.156000E+01 2.518000E+01 -1516 1 1.641000E+01 2.219000E+01 5.640000E+00 -1517 1 3.764000E+01 9.750000E+00 3.632000E+01 -1518 1 1.009000E+01 3.697000E+01 3.843000E+01 -1519 1 1.439000E+01 3.326000E+01 3.508000E+01 -1520 1 4.320000E+00 4.370000E+00 2.500000E+00 -1521 1 9.200000E+00 2.266000E+01 9.410000E+00 -1522 1 8.290000E+00 2.166000E+01 3.791000E+01 -1523 1 2.775000E+01 1.574000E+01 7.580000E+00 -1524 1 3.112000E+01 1.926000E+01 1.035000E+01 -1525 1 2.905000E+01 1.047000E+01 2.138000E+01 -1526 1 2.190000E+01 9.510000E+00 3.525000E+01 -1527 1 3.581000E+01 2.896000E+01 1.660000E+00 -1528 1 9.700000E-01 3.178000E+01 1.872000E+01 -1529 1 7.040000E+00 5.100000E+00 9.470000E+00 -1530 1 3.515000E+01 1.636000E+01 2.275000E+01 -1531 1 1.136000E+01 2.126000E+01 3.580000E+01 -1532 1 2.387000E+01 1.600000E+00 2.197000E+01 -1533 1 1.347000E+01 8.830000E+00 5.600000E-01 -1534 1 3.177000E+01 1.369000E+01 2.890000E+01 -1535 1 1.407000E+01 2.034000E+01 2.640000E+00 -1536 1 3.052000E+01 1.010000E+01 8.730000E+00 -1537 1 3.484000E+01 1.526000E+01 3.368000E+01 -1538 1 2.878000E+01 1.497000E+01 3.620000E+01 -1539 1 1.971000E+01 2.704000E+01 1.131000E+01 -1540 1 6.930000E+00 3.917000E+01 1.046000E+01 -1541 1 2.469000E+01 1.259000E+01 2.390000E+01 -1542 1 1.780000E+00 2.473000E+01 1.754000E+01 -1543 1 3.880000E+01 5.180000E+00 1.822000E+01 -1544 1 1.251000E+01 3.104000E+01 3.040000E+00 -1545 1 2.450000E+01 2.044000E+01 2.614000E+01 -1546 1 1.047000E+01 3.333000E+01 7.610000E+00 -1547 1 7.280000E+00 7.750000E+00 5.920000E+00 -1548 1 2.830000E+00 2.413000E+01 3.270000E+01 -1549 1 1.217000E+01 2.309000E+01 2.254000E+01 -1550 1 2.141000E+01 3.446000E+01 2.861000E+01 -1551 1 3.979000E+01 1.027000E+01 2.290000E+00 -1552 1 7.000000E-01 2.459000E+01 2.969000E+01 -1553 1 1.352000E+01 1.136000E+01 2.727000E+01 -1554 1 3.741000E+01 3.061000E+01 2.193000E+01 -1555 1 2.734000E+01 2.234000E+01 2.685000E+01 -1556 1 2.172000E+01 2.230000E+00 8.240000E+00 -1557 1 3.788000E+01 1.843000E+01 2.492000E+01 -1558 1 6.350000E+00 3.578000E+01 3.374000E+01 -1559 1 2.286000E+01 2.200000E+00 3.186000E+01 -1560 1 3.322000E+01 4.590000E+00 2.710000E+00 -1561 1 1.315000E+01 1.466000E+01 1.008000E+01 -1562 1 2.883000E+01 2.383000E+01 3.093000E+01 -1563 1 1.278000E+01 1.185000E+01 3.666000E+01 -1564 1 4.220000E+00 1.916000E+01 5.310000E+00 -1565 1 2.612000E+01 6.230000E+00 2.050000E+01 -1566 1 1.400000E+00 1.401000E+01 3.426000E+01 -1567 1 5.210000E+00 2.573000E+01 2.616000E+01 -1568 1 1.423000E+01 1.097000E+01 3.458000E+01 -1569 1 1.777000E+01 2.522000E+01 1.154000E+01 -1570 1 3.381000E+01 6.400000E+00 1.077000E+01 -1571 1 1.508000E+01 4.400000E-01 3.908000E+01 -1572 1 6.730000E+00 3.688000E+01 9.070000E+00 -1573 1 2.040000E+01 2.065000E+01 1.584000E+01 -1574 1 1.844000E+01 9.810000E+00 2.893000E+01 -1575 1 1.950000E+00 6.940000E+00 2.815000E+01 -1576 1 9.500000E+00 2.587000E+01 9.680000E+00 -1577 1 3.990000E+00 2.400000E+00 1.982000E+01 -1578 1 2.900000E+01 3.571000E+01 3.371000E+01 -1579 1 3.817000E+01 1.882000E+01 2.905000E+01 -1580 1 1.229000E+01 1.288000E+01 1.493000E+01 -1581 1 2.226000E+01 1.038000E+01 2.000000E-01 -1582 1 8.750000E+00 1.312000E+01 2.703000E+01 -1583 1 9.670000E+00 3.071000E+01 1.930000E+00 -1584 1 1.697000E+01 2.436000E+01 2.133000E+01 -1585 1 3.249000E+01 3.746000E+01 3.428000E+01 -1586 1 2.899000E+01 3.809000E+01 1.194000E+01 -1587 1 3.445000E+01 2.889000E+01 9.390000E+00 -1588 1 1.401000E+01 2.116000E+01 3.661000E+01 -1589 1 8.700000E-01 2.382000E+01 3.668000E+01 -1590 1 3.915000E+01 7.480000E+00 1.593000E+01 -1591 1 1.036000E+01 1.030000E+01 3.190000E+01 -1592 1 4.220000E+00 1.625000E+01 1.119000E+01 -1593 1 3.389000E+01 1.780000E+00 2.755000E+01 -1594 1 1.246000E+01 8.160000E+00 3.565000E+01 -1595 1 3.811000E+01 1.320000E+01 4.170000E+00 -1596 1 2.947000E+01 6.310000E+00 3.321000E+01 -1597 1 1.444000E+01 2.160000E+01 7.480000E+00 -1598 1 3.360000E+01 2.825000E+01 1.814000E+01 -1599 1 6.400000E-01 3.160000E+01 2.619000E+01 -1600 1 2.477000E+01 2.643000E+01 1.880000E+01 -1601 1 1.755000E+01 2.823000E+01 3.460000E+01 -1602 1 3.945000E+01 2.520000E+01 1.824000E+01 -1603 1 3.013000E+01 2.077000E+01 1.514000E+01 -1604 1 2.459000E+01 3.660000E+01 3.478000E+01 -1605 1 2.318000E+01 9.770000E+00 3.799000E+01 -1606 1 3.523000E+01 9.760000E+00 1.120000E+01 -1607 1 3.625000E+01 3.149000E+01 8.750000E+00 -1608 1 3.202000E+01 7.500000E+00 7.090000E+00 -1609 1 1.357000E+01 3.376000E+01 2.663000E+01 -1610 1 2.101000E+01 1.504000E+01 1.717000E+01 -1611 1 2.895000E+01 4.980000E+00 2.930000E+01 -1612 1 3.817000E+01 2.899000E+01 3.097000E+01 -1613 1 3.765000E+01 3.460000E+00 3.898000E+01 -1614 1 2.575000E+01 4.890000E+00 2.528000E+01 -1615 1 3.599000E+01 1.568000E+01 1.927000E+01 -1616 1 2.431000E+01 5.700000E+00 3.397000E+01 -1617 1 2.130000E+00 2.891000E+01 6.330000E+00 -1618 1 3.190000E+00 5.440000E+00 3.909000E+01 -1619 1 2.340000E+00 3.554000E+01 2.575000E+01 -1620 1 1.124000E+01 7.820000E+00 3.241000E+01 -1621 1 5.200000E-01 5.850000E+00 3.887000E+01 -1622 1 8.370000E+00 6.440000E+00 3.862000E+01 -1623 1 1.790000E+00 3.708000E+01 2.244000E+01 -1624 1 1.278000E+01 2.651000E+01 1.812000E+01 -1625 1 2.391000E+01 2.164000E+01 1.222000E+01 -1626 1 2.356000E+01 1.921000E+01 7.060000E+00 -1627 1 3.853000E+01 3.246000E+01 3.819000E+01 -1628 1 6.430000E+00 2.372000E+01 3.407000E+01 -1629 1 1.055000E+01 2.012000E+01 5.500000E+00 -1630 1 2.635000E+01 1.908000E+01 3.655000E+01 -1631 1 1.615000E+01 5.330000E+00 1.680000E+01 -1632 1 2.050000E+01 2.713000E+01 2.675000E+01 -1633 1 2.450000E+00 1.850000E+00 1.185000E+01 -1634 1 3.842000E+01 1.927000E+01 1.340000E+01 -1635 1 3.560000E+01 2.991000E+01 3.746000E+01 -1636 1 1.205000E+01 1.955000E+01 3.382000E+01 -1637 1 3.346000E+01 1.793000E+01 3.918000E+01 -1638 1 1.804000E+01 1.845000E+01 2.919000E+01 -1639 1 2.013000E+01 3.484000E+01 1.485000E+01 -1640 1 1.857000E+01 2.674000E+01 2.141000E+01 -1641 1 1.780000E+00 3.457000E+01 3.455000E+01 -1642 1 1.133000E+01 5.160000E+00 2.104000E+01 -1643 1 8.710000E+00 2.148000E+01 2.817000E+01 -1644 1 2.564000E+01 2.289000E+01 3.583000E+01 -1645 1 1.795000E+01 2.480000E+01 3.808000E+01 -1646 1 2.110000E+00 2.141000E+01 3.274000E+01 -1647 1 3.600000E+01 1.830000E+01 2.078000E+01 -1648 1 1.551000E+01 4.011000E+01 5.650000E+00 -1649 1 3.445000E+01 3.825000E+01 6.640000E+00 -1650 1 2.430000E+00 3.178000E+01 2.884000E+01 -1651 1 3.040000E+01 1.860000E+00 3.503000E+01 -1652 1 2.811000E+01 8.440000E+00 2.985000E+01 -1653 1 1.467000E+01 1.845000E+01 3.386000E+01 -1654 1 3.925000E+01 6.950000E+00 3.398000E+01 -1655 1 3.377000E+01 2.648000E+01 6.800000E+00 -1656 1 4.520000E+00 2.755000E+01 3.924000E+01 -1657 1 2.454000E+01 3.519000E+01 2.140000E+00 -1658 1 3.307000E+01 3.625000E+01 4.980000E+00 -1659 1 3.070000E+00 3.100000E+00 1.713000E+01 -1660 1 3.759000E+01 1.688000E+01 3.333000E+01 -1661 1 9.100000E+00 3.988000E+01 4.560000E+00 -1662 1 2.423000E+01 8.630000E+00 3.409000E+01 -1663 1 3.720000E+01 2.865000E+01 2.818000E+01 -1664 1 9.920000E+00 1.170000E+00 2.153000E+01 -1665 1 5.900000E+00 1.950000E+00 2.841000E+01 -1666 1 3.709000E+01 1.570000E+01 2.824000E+01 -1667 1 3.722000E+01 7.380000E+00 2.617000E+01 -1668 1 3.050000E+00 2.716000E+01 8.050000E+00 -1669 1 1.669000E+01 3.698000E+01 1.056000E+01 -1670 1 3.190000E+00 9.160000E+00 7.780000E+00 -1671 1 2.651000E+01 2.454000E+01 1.986000E+01 -1672 1 2.637000E+01 1.740000E+00 2.675000E+01 -1673 1 2.998000E+01 3.964000E+01 1.620000E+01 -1674 1 1.909000E+01 1.974000E+01 2.647000E+01 -1675 1 1.444000E+01 2.134000E+01 3.925000E+01 -1676 1 6.450000E+00 3.316000E+01 3.692000E+01 -1677 1 1.319000E+01 2.623000E+01 3.686000E+01 -1678 1 2.803000E+01 2.920000E+01 3.413000E+01 -1679 1 2.336000E+01 1.011000E+01 1.954000E+01 -1680 1 2.556000E+01 1.220000E+01 3.832000E+01 -1681 1 2.229000E+01 2.916000E+01 2.311000E+01 -1682 1 3.942000E+01 3.332000E+01 1.121000E+01 -1683 1 2.733000E+01 1.537000E+01 2.445000E+01 -1684 1 1.812000E+01 3.589000E+01 3.707000E+01 -1685 1 1.044000E+01 2.163000E+01 1.333000E+01 -1686 1 2.497000E+01 1.248000E+01 2.150000E+00 -1687 1 2.822000E+01 2.474000E+01 8.800000E-01 -1688 1 2.875000E+01 1.143000E+01 3.599000E+01 -1689 1 1.142000E+01 2.230000E+00 2.508000E+01 -1690 1 2.919000E+01 1.269000E+01 5.180000E+00 -1691 1 3.500000E+00 2.240000E+00 3.905000E+01 -1692 1 2.187000E+01 1.219000E+01 2.446000E+01 -1693 1 1.705000E+01 5.650000E+00 1.264000E+01 -1694 1 1.888000E+01 3.955000E+01 2.936000E+01 -1695 1 1.288000E+01 8.860000E+00 1.602000E+01 -1696 1 1.724000E+01 1.053000E+01 1.660000E+00 -1697 1 2.829000E+01 6.300000E-01 1.257000E+01 -1698 1 2.346000E+01 1.376000E+01 3.924000E+01 -1699 1 2.246000E+01 3.885000E+01 3.055000E+01 -1700 1 9.180000E+00 2.009000E+01 9.260000E+00 -1701 1 3.654000E+01 2.511000E+01 1.799000E+01 -1702 1 1.297000E+01 2.850000E+01 2.644000E+01 -1703 1 2.678000E+01 8.660000E+00 2.131000E+01 -1704 1 1.525000E+01 1.230000E+01 6.700000E-01 -1705 1 4.003000E+01 6.860000E+00 2.565000E+01 -1706 1 2.540000E+00 2.277000E+01 3.831000E+01 -1707 1 3.055000E+01 4.690000E+00 1.134000E+01 -1708 1 9.390000E+00 8.790000E+00 1.818000E+01 -1709 1 2.059000E+01 4.900000E-01 1.360000E+00 -1710 1 2.695000E+01 3.643000E+01 1.245000E+01 -1711 1 2.780000E+00 2.471000E+01 6.670000E+00 -1712 1 3.233000E+01 4.870000E+00 3.930000E+01 -1713 1 3.906000E+01 1.200000E+00 2.692000E+01 -1714 1 2.170000E+01 1.590000E+00 2.602000E+01 -1715 1 1.250000E+01 6.840000E+00 2.030000E+00 -1716 1 2.013000E+01 2.539000E+01 3.270000E+00 -1717 1 2.575000E+01 2.447000E+01 3.931000E+01 -1718 1 2.806000E+01 3.913000E+01 6.600000E+00 -1719 1 3.321000E+01 1.275000E+01 6.310000E+00 -1720 1 1.335000E+01 1.245000E+01 1.926000E+01 -1721 1 2.568000E+01 3.640000E+01 7.660000E+00 -1722 1 9.700000E-01 1.674000E+01 2.402000E+01 -1723 1 3.637000E+01 1.364000E+01 3.056000E+01 -1724 1 1.406000E+01 3.772000E+01 3.148000E+01 -1725 1 3.019000E+01 2.769000E+01 3.261000E+01 -1726 1 3.516000E+01 3.715000E+01 3.827000E+01 -1727 1 1.748000E+01 1.960000E+01 1.160000E+01 -1728 1 1.846000E+01 2.165000E+01 9.830000E+00 -1729 1 2.400000E+01 1.108000E+01 9.510000E+00 -1730 1 2.802000E+01 2.607000E+01 2.209000E+01 -1731 1 1.259000E+01 1.397000E+01 3.003000E+01 -1732 1 2.862000E+01 4.430000E+00 2.085000E+01 -1733 1 4.460000E+00 3.632000E+01 1.409000E+01 -1734 1 3.450000E+01 2.260000E+00 2.344000E+01 -1735 1 1.382000E+01 1.144000E+01 1.661000E+01 -1736 1 5.300000E-01 2.182000E+01 3.018000E+01 -1737 1 4.340000E+00 3.899000E+01 1.785000E+01 -1738 1 1.810000E+00 3.137000E+01 1.155000E+01 -1739 1 1.918000E+01 1.017000E+01 3.683000E+01 -1740 1 9.850000E+00 1.740000E+01 2.490000E+00 -1741 1 1.590000E+01 2.014000E+01 2.892000E+01 -1742 1 3.247000E+01 3.502000E+01 1.348000E+01 -1743 1 4.860000E+00 2.190000E+00 2.418000E+01 -1744 1 3.659000E+01 7.050000E+00 5.770000E+00 -1745 1 2.973000E+01 3.784000E+01 2.522000E+01 -1746 1 2.486000E+01 1.655000E+01 6.790000E+00 -1747 1 6.670000E+00 4.340000E+00 9.500000E-01 -1748 1 1.712000E+01 1.086000E+01 1.260000E+01 -1749 1 6.540000E+00 3.900000E-01 1.445000E+01 -1750 1 3.619000E+01 1.766000E+01 1.223000E+01 -1751 1 1.913000E+01 1.603000E+01 2.980000E+01 -1752 1 1.849000E+01 3.419000E+01 2.948000E+01 -1753 1 2.348000E+01 3.249000E+01 2.717000E+01 -1754 1 2.548000E+01 5.370000E+00 2.971000E+01 -1755 1 2.172000E+01 3.547000E+01 2.350000E+00 -1756 1 1.574000E+01 8.970000E+00 2.768000E+01 -1757 1 2.262000E+01 1.982000E+01 9.520000E+00 -1758 1 2.746000E+01 1.683000E+01 1.884000E+01 -1759 1 1.144000E+01 3.645000E+01 3.426000E+01 -1760 1 3.298000E+01 2.106000E+01 3.349000E+01 -1761 1 5.250000E+00 1.928000E+01 3.035000E+01 -1762 1 6.300000E-01 1.250000E+01 2.530000E+01 -1763 1 9.400000E-01 1.665000E+01 1.941000E+01 -1764 1 1.082000E+01 2.477000E+01 2.503000E+01 -1765 1 2.280000E+00 2.330000E+00 2.390000E+00 -1766 1 4.002000E+01 4.001000E+01 2.991000E+01 -1767 1 1.660000E+01 3.330000E+00 2.148000E+01 -1768 1 1.935000E+01 6.840000E+00 1.167000E+01 -1769 1 1.072000E+01 1.611000E+01 2.903000E+01 -1770 1 2.711000E+01 3.258000E+01 3.736000E+01 -1771 1 2.850000E+01 7.330000E+00 3.782000E+01 -1772 1 2.094000E+01 3.183000E+01 2.010000E+00 -1773 1 1.675000E+01 1.975000E+01 2.478000E+01 -1774 1 7.740000E+00 1.220000E+00 3.048000E+01 -1775 1 1.595000E+01 4.029000E+01 1.457000E+01 -1776 1 3.644000E+01 1.568000E+01 7.500000E+00 -1777 1 3.895000E+01 2.472000E+01 4.001000E+01 -1778 1 1.380000E+00 1.794000E+01 2.928000E+01 -1779 1 3.220000E+00 3.290000E+01 8.260000E+00 -1780 1 3.617000E+01 3.785000E+01 1.173000E+01 -1781 1 1.069000E+01 1.774000E+01 2.524000E+01 -1782 1 1.614000E+01 1.690000E+00 2.742000E+01 -1783 1 2.514000E+01 1.900000E+01 3.252000E+01 -1784 1 1.745000E+01 2.930000E+01 2.496000E+01 -1785 1 3.321000E+01 4.022000E+01 8.670000E+00 -1786 1 2.966000E+01 3.301000E+01 3.181000E+01 -1787 1 1.331000E+01 1.131000E+01 2.400000E+00 -1788 1 8.890000E+00 1.479000E+01 2.137000E+01 -1789 1 3.566000E+01 3.528000E+01 3.652000E+01 -1790 1 3.735000E+01 1.192000E+01 1.096000E+01 -1791 1 3.360000E+01 2.954000E+01 4.820000E+00 -1792 1 1.115000E+01 2.559000E+01 3.225000E+01 -1793 1 3.132000E+01 2.833000E+01 3.790000E+01 -1794 1 1.190000E+00 1.581000E+01 7.000000E-01 -1795 1 1.856000E+01 2.268000E+01 1.798000E+01 -1796 1 3.294000E+01 4.810000E+00 3.516000E+01 -1797 1 3.802000E+01 1.726000E+01 1.693000E+01 -1798 1 2.040000E+01 3.594000E+01 4.023000E+01 -1799 1 9.300000E+00 2.855000E+01 3.863000E+01 -1800 1 9.360000E+00 1.686000E+01 3.854000E+01 -1801 1 1.280000E+01 6.540000E+00 2.445000E+01 -1802 1 2.370000E+00 4.027000E+01 1.901000E+01 -1803 1 2.906000E+01 1.402000E+01 5.900000E-01 -1804 1 1.776000E+01 1.308000E+01 1.941000E+01 -1805 1 2.507000E+01 2.350000E+00 3.028000E+01 -1806 1 3.982000E+01 2.348000E+01 1.195000E+01 -1807 1 3.519000E+01 2.357000E+01 2.474000E+01 -1808 1 3.429000E+01 8.730000E+00 6.230000E+00 -1809 1 1.530000E+00 2.867000E+01 1.236000E+01 -1810 1 6.780000E+00 3.438000E+01 3.128000E+01 -1811 1 2.726000E+01 1.453000E+01 3.880000E+01 -1812 1 1.550000E+01 1.497000E+01 3.016000E+01 -1813 1 8.100000E+00 1.239000E+01 3.094000E+01 -1814 1 2.568000E+01 3.996000E+01 2.365000E+01 -1815 1 1.689000E+01 3.979000E+01 3.122000E+01 -1816 1 5.090000E+00 1.760000E+01 1.576000E+01 -1817 1 1.208000E+01 7.970000E+00 1.855000E+01 -1818 1 3.058000E+01 1.607000E+01 3.210000E+01 -1819 1 2.125000E+01 1.535000E+01 3.423000E+01 -1820 1 3.765000E+01 2.319000E+01 3.189000E+01 -1821 1 3.334000E+01 8.090000E+00 1.414000E+01 -1822 1 1.188000E+01 2.877000E+01 3.491000E+01 -1823 1 3.550000E+01 3.490000E+01 4.560000E+00 -1824 1 3.913000E+01 3.114000E+01 3.342000E+01 -1825 1 1.413000E+01 6.370000E+00 1.086000E+01 -1826 1 3.283000E+01 3.270000E+01 2.100000E-01 -1827 1 1.939000E+01 3.919000E+01 1.671000E+01 -1828 1 2.796000E+01 7.160000E+00 1.817000E+01 -1829 1 3.993000E+01 7.720000E+00 2.884000E+01 -1830 1 2.421000E+01 1.850000E+01 2.216000E+01 -1831 1 2.020000E+01 2.950000E+01 6.580000E+00 -1832 1 2.442000E+01 1.847000E+01 1.490000E+01 -1833 1 1.147000E+01 3.184000E+01 3.898000E+01 -1834 1 4.028000E+01 8.290000E+00 3.143000E+01 -1835 1 2.108000E+01 2.404000E+01 1.882000E+01 -1836 1 3.810000E+01 1.056000E+01 4.260000E+00 -1837 1 3.573000E+01 1.000000E+00 5.380000E+00 -1838 1 2.222000E+01 2.716000E+01 9.020000E+00 -1839 1 3.159000E+01 3.808000E+01 9.170000E+00 -1840 1 3.800000E-01 3.962000E+01 1.735000E+01 -1841 1 1.787000E+01 3.647000E+01 1.850000E+01 -1842 1 2.036000E+01 3.717000E+01 2.874000E+01 -1843 1 2.341000E+01 8.270000E+00 1.640000E+01 -1844 1 3.000000E-02 3.900000E+00 1.260000E+00 -1845 1 2.710000E+01 8.220000E+00 4.250000E+00 -1846 1 2.366000E+01 1.866000E+01 8.300000E-01 -1847 1 1.576000E+01 8.180000E+00 3.938000E+01 -1848 1 3.188000E+01 3.540000E+00 2.061000E+01 -1849 1 1.290000E+01 1.954000E+01 3.000000E+01 -1850 1 1.485000E+01 1.040000E+00 2.991000E+01 -1851 1 1.851000E+01 3.678000E+01 2.594000E+01 -1852 1 2.624000E+01 3.060000E+00 1.558000E+01 -1853 1 3.924000E+01 3.449000E+01 1.527000E+01 -1854 1 3.210000E+00 6.620000E+00 6.430000E+00 -1855 1 5.410000E+00 1.136000E+01 3.553000E+01 -1856 1 3.661000E+01 3.311000E+01 2.536000E+01 -1857 1 5.570000E+00 8.200000E-01 3.565000E+01 -1858 1 1.049000E+01 3.328000E+01 3.019000E+01 -1859 1 7.730000E+00 1.702000E+01 2.246000E+01 -1860 1 3.585000E+01 1.798000E+01 6.350000E+00 -1861 1 2.886000E+01 3.490000E+00 4.270000E+00 -1862 1 2.747000E+01 3.870000E+01 3.198000E+01 -1863 1 1.700000E+00 3.540000E+01 4.007000E+01 -1864 1 5.500000E-01 1.921000E+01 1.775000E+01 -1865 1 2.096000E+01 3.016000E+01 1.527000E+01 -1866 1 1.844000E+01 1.621000E+01 3.494000E+01 -1867 1 3.465000E+01 3.493000E+01 2.428000E+01 -1868 1 1.211000E+01 2.377000E+01 1.886000E+01 -1869 1 3.870000E+01 3.101000E+01 2.706000E+01 -1870 1 3.814000E+01 1.502000E+01 2.090000E+01 -1871 1 2.744000E+01 6.160000E+00 1.375000E+01 -1872 1 3.002000E+01 3.709000E+01 3.162000E+01 -1873 1 1.150000E+00 2.778000E+01 2.136000E+01 -1874 1 3.644000E+01 1.673000E+01 3.066000E+01 -1875 1 1.287000E+01 2.362000E+01 3.770000E+01 -1876 1 1.185000E+01 3.817000E+01 1.808000E+01 -1877 1 2.347000E+01 3.306000E+01 9.350000E+00 -1878 1 1.964000E+01 9.700000E-01 4.610000E+00 -1879 1 7.420000E+00 3.815000E+01 3.236000E+01 -1880 1 2.014000E+01 3.887000E+01 1.179000E+01 -1881 1 3.820000E+00 5.500000E+00 2.936000E+01 -1882 1 9.780000E+00 1.925000E+01 3.726000E+01 -1883 1 3.490000E+00 2.258000E+01 1.048000E+01 -1884 1 2.490000E+00 4.002000E+01 3.716000E+01 -1885 1 2.331000E+01 3.465000E+01 3.216000E+01 -1886 1 3.424000E+01 3.044000E+01 7.240000E+00 -1887 1 3.263000E+01 2.463000E+01 9.450000E+00 -1888 1 1.900000E+01 3.387000E+01 3.913000E+01 -1889 1 1.298000E+01 2.100000E+01 2.478000E+01 -1890 1 4.660000E+00 1.164000E+01 2.001000E+01 -1891 1 8.660000E+00 1.968000E+01 3.490000E+00 -1892 1 3.391000E+01 3.492000E+01 8.690000E+00 -1893 1 1.517000E+01 3.302000E+01 1.216000E+01 -1894 1 6.180000E+00 3.916000E+01 2.259000E+01 -1895 1 1.852000E+01 2.288000E+01 3.203000E+01 -1896 1 1.905000E+01 3.223000E+01 6.490000E+00 -1897 1 9.770000E+00 1.761000E+01 1.277000E+01 -1898 1 2.610000E+01 3.758000E+01 2.540000E+01 -1899 1 2.390000E+00 3.675000E+01 1.053000E+01 -1900 1 8.360000E+00 1.743000E+01 6.530000E+00 -1901 1 2.823000E+01 1.711000E+01 2.806000E+01 -1902 1 5.350000E+00 6.730000E+00 2.541000E+01 -1903 1 3.550000E+01 1.965000E+01 2.970000E+00 -1904 1 3.121000E+01 2.204000E+01 1.890000E+00 -1905 1 1.863000E+01 9.320000E+00 1.485000E+01 -1906 1 2.233000E+01 3.000000E-02 4.780000E+00 -1907 1 2.608000E+01 3.149000E+01 5.060000E+00 -1908 1 3.112000E+01 1.725000E+01 2.705000E+01 -1909 1 1.776000E+01 3.282000E+01 3.413000E+01 -1910 1 2.572000E+01 7.650000E+00 2.505000E+01 -1911 1 6.210000E+00 6.950000E+00 2.819000E+01 -1912 1 4.017000E+01 1.496000E+01 1.018000E+01 -1913 1 1.221000E+01 1.925000E+01 1.672000E+01 -1914 1 2.248000E+01 3.717000E+01 1.079000E+01 -1915 1 1.144000E+01 3.481000E+01 1.522000E+01 -1916 1 1.109000E+01 3.150000E+01 9.400000E+00 -1917 1 7.050000E+00 1.754000E+01 1.385000E+01 -1918 1 1.539000E+01 3.066000E+01 3.746000E+01 -1919 1 9.780000E+00 2.493000E+01 1.945000E+01 -1920 1 2.155000E+01 2.014000E+01 3.036000E+01 -1921 1 2.627000E+01 1.994000E+01 1.207000E+01 -1922 1 1.927000E+01 7.270000E+00 1.826000E+01 -1923 1 1.879000E+01 3.570000E+01 3.430000E+01 -1924 1 2.097000E+01 1.404000E+01 2.410000E+00 -1925 1 7.430000E+00 3.211000E+01 2.874000E+01 -1926 1 3.223000E+01 2.498000E+01 1.243000E+01 -1927 1 3.034000E+01 2.710000E+01 2.332000E+01 -1928 1 2.535000E+01 2.886000E+01 1.108000E+01 -1929 1 2.469000E+01 1.790000E+01 9.410000E+00 -1930 1 2.729000E+01 1.739000E+01 3.872000E+01 -1931 1 1.462000E+01 1.766000E+01 1.618000E+01 -1932 1 2.636000E+01 2.520000E+00 3.791000E+01 -1933 1 3.723000E+01 1.258000E+01 3.390000E+01 -1934 1 2.390000E+00 3.449000E+01 6.190000E+00 -1935 1 3.512000E+01 2.505000E+01 3.450000E+00 -1936 1 1.540000E+01 1.715000E+01 3.580000E+00 -1937 1 2.794000E+01 4.620000E+00 1.701000E+01 -1938 1 3.736000E+01 2.940000E+01 4.100000E+00 -1939 1 8.540000E+00 3.099000E+01 3.167000E+01 -1940 1 3.295000E+01 9.760000E+00 3.737000E+01 -1941 1 3.131000E+01 1.453000E+01 2.660000E+00 -1942 1 3.097000E+01 2.230000E+00 4.007000E+01 -1943 1 2.284000E+01 1.487000E+01 1.404000E+01 -1944 1 1.652000E+01 7.380000E+00 3.470000E+01 -1945 1 3.885000E+01 1.276000E+01 3.047000E+01 -1946 1 2.190000E+01 3.253000E+01 3.989000E+01 -1947 1 9.730000E+00 2.930000E+01 2.916000E+01 -1948 1 9.940000E+00 2.907000E+01 4.120000E+00 -1949 1 1.190000E+00 1.979000E+01 2.460000E+01 -1950 1 9.110000E+00 3.736000E+01 2.585000E+01 -1951 1 1.398000E+01 3.498000E+01 1.410000E+01 -1952 1 2.461000E+01 4.540000E+00 3.690000E+01 -1953 1 2.442000E+01 1.181000E+01 3.066000E+01 -1954 1 1.450000E+01 3.678000E+01 1.617000E+01 -1955 1 4.290000E+00 3.034000E+01 1.083000E+01 -1956 1 3.091000E+01 3.558000E+01 1.665000E+01 -1957 1 3.978000E+01 2.183000E+01 5.820000E+00 -1958 1 2.088000E+01 1.798000E+01 6.000000E-02 -1959 1 1.122000E+01 1.952000E+01 1.430000E+00 -1960 1 2.802000E+01 7.800000E-01 3.607000E+01 -1961 1 4.170000E+00 1.698000E+01 5.000000E-02 -1962 1 2.842000E+01 1.480000E+01 3.340000E+00 -1963 1 2.181000E+01 7.510000E+00 3.770000E+00 -1964 1 3.611000E+01 2.040000E+01 1.695000E+01 -1965 1 3.023000E+01 3.286000E+01 1.530000E+00 -1966 1 4.480000E+00 2.643000E+01 2.905000E+01 -1967 1 1.683000E+01 3.526000E+01 3.156000E+01 -1968 1 1.940000E+00 5.440000E+00 2.230000E+01 -1969 1 9.040000E+00 3.510000E+01 1.158000E+01 -1970 1 1.770000E+01 2.642000E+01 2.703000E+01 -1971 1 3.857000E+01 2.051000E+01 3.124000E+01 -1972 1 7.100000E+00 2.992000E+01 1.491000E+01 -1973 1 5.650000E+00 3.046000E+01 2.999000E+01 -1974 1 1.350000E+01 5.300000E-01 3.686000E+01 -1975 1 3.550000E+01 9.410000E+00 2.492000E+01 -1976 1 3.505000E+01 2.131000E+01 2.675000E+01 -1977 1 1.567000E+01 1.046000E+01 3.034000E+01 -1978 1 1.478000E+01 3.745000E+01 2.196000E+01 -1979 1 3.800000E-01 3.909000E+01 2.115000E+01 -1980 1 2.131000E+01 9.730000E+00 2.169000E+01 -1981 1 1.924000E+01 2.112000E+01 1.348000E+01 -1982 1 1.861000E+01 3.049000E+01 1.008000E+01 -1983 1 3.514000E+01 5.950000E+00 1.891000E+01 -1984 1 3.828000E+01 1.015000E+01 3.113000E+01 -1985 1 2.987000E+01 9.100000E+00 3.284000E+01 -1986 1 3.806000E+01 1.669000E+01 9.930000E+00 -1987 1 3.625000E+01 3.150000E+00 3.690000E+00 -1988 1 1.120000E+01 1.831000E+01 1.908000E+01 -1989 1 1.729000E+01 1.204000E+01 3.186000E+01 -1990 1 2.065000E+01 1.251000E+01 2.196000E+01 -1991 1 3.660000E+00 1.325000E+01 3.220000E+00 -1992 1 3.760000E+01 4.830000E+00 8.060000E+00 -1993 1 3.707000E+01 5.360000E+00 3.269000E+01 -1994 1 2.071000E+01 2.979000E+01 2.930000E+01 -1995 1 5.900000E-01 3.394000E+01 1.640000E+00 -1996 1 3.053000E+01 7.920000E+00 1.475000E+01 -1997 1 1.812000E+01 1.180000E+00 1.559000E+01 -1998 1 1.635000E+01 2.170000E+00 3.428000E+01 -1999 1 3.770000E+01 1.321000E+01 1.713000E+01 -2000 1 1.345000E+01 3.422000E+01 4.590000E+00 -2001 1 6.390000E+00 7.100000E+00 1.604000E+01 -2002 1 2.936000E+01 2.284000E+01 3.840000E+01 -2003 1 2.132000E+01 1.267000E+01 1.311000E+01 -2004 1 3.830000E+00 1.482000E+01 3.601000E+01 -2005 1 3.017000E+01 3.080000E+00 3.063000E+01 -2006 1 5.670000E+00 2.356000E+01 1.549000E+01 -2007 1 2.568000E+01 1.509000E+01 2.150000E+00 -2008 1 3.750000E+01 5.240000E+00 3.576000E+01 -2009 1 4.020000E+01 6.800000E+00 3.420000E+00 -2010 1 7.520000E+00 4.850000E+00 2.242000E+01 -2011 1 9.120000E+00 1.100000E+00 1.607000E+01 -2012 1 3.420000E+01 3.660000E+00 9.460000E+00 -2013 1 1.500000E+00 4.630000E+00 1.097000E+01 -2014 1 8.710000E+00 3.340000E+00 1.196000E+01 -2015 1 1.524000E+01 4.090000E+00 3.273000E+01 -2016 1 3.619000E+01 2.718000E+01 5.430000E+00 -2017 1 3.464000E+01 3.084000E+01 1.802000E+01 -2018 1 3.812000E+01 2.797000E+01 1.283000E+01 -2019 1 1.100000E+01 3.628000E+01 3.115000E+01 -2020 1 1.196000E+01 4.770000E+00 3.605000E+01 -2021 1 2.456000E+01 1.463000E+01 2.922000E+01 -2022 1 3.370000E+00 1.203000E+01 3.398000E+01 -2023 1 2.095000E+01 1.951000E+01 1.167000E+01 -2024 1 7.290000E+00 3.550000E+00 3.223000E+01 -2025 1 1.255000E+01 2.448000E+01 7.530000E+00 -2026 1 8.020000E+00 3.410000E+00 1.872000E+01 -2027 1 1.272000E+01 2.208000E+01 1.634000E+01 -2028 1 2.495000E+01 7.100000E-01 1.731000E+01 -2029 1 1.877000E+01 6.440000E+00 3.718000E+01 -2030 1 1.307000E+01 3.171000E+01 2.130000E+01 -2031 1 7.780000E+00 2.693000E+01 4.990000E+00 -2032 1 2.468000E+01 1.657000E+01 4.060000E+00 -2033 1 1.011000E+01 2.092000E+01 2.196000E+01 -2034 1 1.853000E+01 2.212000E+01 7.060000E+00 -2035 1 1.012000E+01 5.650000E+00 4.570000E+00 -2036 1 3.418000E+01 1.482000E+01 2.907000E+01 -2037 1 3.052000E+01 1.917000E+01 2.514000E+01 -2038 1 3.050000E+01 8.230000E+00 1.743000E+01 -2039 1 3.790000E+00 1.501000E+01 1.572000E+01 -2040 1 6.640000E+00 4.770000E+00 3.640000E+01 -2041 1 7.250000E+00 1.136000E+01 3.650000E+00 -2042 1 3.843000E+01 1.134000E+01 2.400000E-01 -2043 1 1.824000E+01 2.348000E+01 2.447000E+01 -2044 1 3.782000E+01 4.890000E+00 2.427000E+01 -2045 1 1.455000E+01 3.351000E+01 8.510000E+00 -2046 1 1.213000E+01 1.013000E+01 5.290000E+00 -2047 1 1.491000E+01 3.854000E+01 7.660000E+00 -2048 1 3.424000E+01 1.661000E+01 2.545000E+01 -2049 1 6.710000E+00 3.793000E+01 1.432000E+01 -2050 1 3.840000E+00 1.933000E+01 2.429000E+01 -2051 1 5.700000E-01 3.471000E+01 2.379000E+01 -2052 1 3.556000E+01 3.795000E+01 2.740000E+01 -2053 1 6.480000E+00 1.991000E+01 2.495000E+01 -2054 1 3.000000E+01 2.298000E+01 2.647000E+01 -2055 1 1.057000E+01 1.534000E+01 1.510000E+01 -2056 1 6.830000E+00 1.818000E+01 3.757000E+01 -2057 1 1.961000E+01 2.792000E+01 4.360000E+00 -2058 1 1.999000E+01 1.749000E+01 3.711000E+01 -2059 1 6.520000E+00 3.406000E+01 1.856000E+01 -2060 1 2.003000E+01 4.008000E+01 7.370000E+00 -2061 1 1.647000E+01 1.287000E+01 3.846000E+01 -2062 1 1.188000E+01 2.675000E+01 3.140000E+00 -2063 1 3.070000E+01 8.620000E+00 1.174000E+01 -2064 1 7.650000E+00 2.423000E+01 2.152000E+01 -2065 1 3.066000E+01 1.515000E+01 1.777000E+01 -2066 1 9.030000E+00 2.920000E+01 1.074000E+01 -2067 1 2.170000E+01 5.990000E+00 1.078000E+01 -2068 1 2.112000E+01 6.610000E+00 2.084000E+01 -2069 1 1.844000E+01 1.560000E+01 3.228000E+01 -2070 1 8.050000E+00 2.401000E+01 2.487000E+01 -2071 1 1.931000E+01 1.304000E+01 3.612000E+01 -2072 1 3.055000E+01 3.181000E+01 1.144000E+01 -2073 1 2.670000E+01 3.999000E+01 1.013000E+01 -2074 1 3.010000E+00 3.455000E+01 1.576000E+01 -2075 1 1.197000E+01 3.352000E+01 1.999000E+01 -2076 1 7.530000E+00 3.550000E+01 2.745000E+01 -2077 1 6.260000E+00 2.133000E+01 3.595000E+01 -2078 1 3.640000E+00 1.123000E+01 1.010000E+01 -2079 1 3.208000E+01 3.646000E+01 2.263000E+01 -2080 1 2.974000E+01 3.693000E+01 2.101000E+01 -2081 1 3.843000E+01 1.063000E+01 1.834000E+01 -2082 1 1.259000E+01 1.919000E+01 2.240000E+01 -2083 1 1.861000E+01 3.866000E+01 3.746000E+01 -2084 1 3.072000E+01 2.510000E+00 2.531000E+01 -2085 1 1.811000E+01 3.599000E+01 7.630000E+00 -2086 1 1.513000E+01 4.009000E+01 3.336000E+01 -2087 1 1.111000E+01 1.203000E+01 7.930000E+00 -2088 1 1.400000E+01 2.710000E+00 4.600000E-01 -2089 1 8.820000E+00 7.960000E+00 3.614000E+01 -2090 1 2.054000E+01 3.935000E+01 3.947000E+01 -2091 1 4.016000E+01 3.491000E+01 4.170000E+00 -2092 1 5.450000E+00 7.670000E+00 1.850000E+01 -2093 1 2.836000E+01 1.260000E+01 2.475000E+01 -2094 1 3.201000E+01 2.872000E+01 2.179000E+01 -2095 1 3.032000E+01 1.611000E+01 2.945000E+01 -2096 1 2.493000E+01 2.700000E+01 2.410000E+01 -2097 1 2.096000E+01 3.122000E+01 2.710000E+01 -2098 1 1.995000E+01 1.826000E+01 3.333000E+01 -2099 1 1.625000E+01 3.130000E+01 8.000000E+00 -2100 1 1.063000E+01 1.206000E+01 1.804000E+01 -2101 1 1.247000E+01 1.196000E+01 3.214000E+01 -2102 1 3.433000E+01 3.517000E+01 1.640000E+01 -2103 1 2.322000E+01 3.050000E+00 1.655000E+01 -2104 1 3.519000E+01 8.700000E-01 3.234000E+01 -2105 1 1.722000E+01 1.723000E+01 1.978000E+01 -2106 1 2.480000E+01 3.750000E+01 6.700000E-01 -2107 1 3.973000E+01 3.731000E+01 2.819000E+01 -2108 1 1.546000E+01 1.690000E+01 2.411000E+01 -2109 1 1.067000E+01 1.007000E+01 1.075000E+01 -2110 1 3.864000E+01 1.058000E+01 2.272000E+01 -2111 1 3.115000E+01 9.980000E+00 2.317000E+01 -2112 1 2.253000E+01 1.992000E+01 1.380000E+01 -2113 1 1.176000E+01 1.405000E+01 3.903000E+01 -2114 1 1.018000E+01 9.280000E+00 8.030000E+00 -2115 1 1.445000E+01 2.184000E+01 3.200000E+01 -2116 1 1.692000E+01 2.470000E+01 1.871000E+01 -2117 1 2.841000E+01 2.090000E+01 1.081000E+01 -2118 1 1.582000E+01 9.670000E+00 1.823000E+01 -2119 1 3.260000E+00 4.080000E+00 3.358000E+01 -2120 1 3.262000E+01 2.107000E+01 3.990000E+00 -2121 1 1.652000E+01 1.218000E+01 3.564000E+01 -2122 1 2.648000E+01 2.505000E+01 2.501000E+01 -2123 1 3.168000E+01 8.160000E+00 2.482000E+01 -2124 1 1.468000E+01 1.968000E+01 2.087000E+01 -2125 1 1.103000E+01 2.608000E+01 6.010000E+00 -2126 1 1.102000E+01 1.184000E+01 2.603000E+01 -2127 1 3.776000E+01 3.770000E+00 1.490000E+00 -2128 1 2.031000E+01 2.734000E+01 6.700000E-01 -2129 1 3.770000E+00 3.563000E+01 4.170000E+00 -2130 1 4.490000E+00 2.167000E+01 1.302000E+01 -2131 1 3.730000E+00 2.565000E+01 1.098000E+01 -2132 1 3.893000E+01 2.628000E+01 3.085000E+01 -2133 1 1.716000E+01 7.780000E+00 1.678000E+01 -2134 1 3.330000E+01 3.916000E+01 1.899000E+01 -2135 1 3.264000E+01 4.210000E+00 2.427000E+01 -2136 1 1.114000E+01 8.100000E+00 2.329000E+01 -2137 1 1.026000E+01 8.900000E-01 2.724000E+01 -2138 1 2.257000E+01 2.754000E+01 3.789000E+01 -2139 1 2.495000E+01 2.840000E+01 3.687000E+01 -2140 1 3.977000E+01 2.981000E+01 5.800000E+00 -2141 1 2.256000E+01 3.840000E+00 6.270000E+00 -2142 1 7.580000E+00 1.410000E+01 3.520000E+00 -2143 1 1.702000E+01 3.918000E+01 9.200000E+00 -2144 1 2.898000E+01 1.973000E+01 3.924000E+01 -2145 1 4.020000E+01 1.529000E+01 2.723000E+01 -2146 1 7.220000E+00 2.652000E+01 2.819000E+01 -2147 1 1.020000E+01 4.510000E+00 2.913000E+01 -2148 1 1.075000E+01 1.786000E+01 8.600000E+00 -2149 1 2.851000E+01 6.170000E+00 2.682000E+01 -2150 1 1.450000E+00 2.132000E+01 4.020000E+00 -2151 1 4.360000E+00 1.142000E+01 4.500000E-01 -2152 1 6.800000E+00 2.136000E+01 2.166000E+01 -2153 1 1.803000E+01 3.907000E+01 4.900000E+00 -2154 1 3.187000E+01 1.368000E+01 1.983000E+01 -2155 1 3.040000E+01 9.820000E+00 3.786000E+01 -2156 1 3.694000E+01 5.550000E+00 1.614000E+01 -2157 1 1.520000E+00 2.840000E+00 7.180000E+00 -2158 1 7.550000E+00 3.788000E+01 1.150000E+00 -2159 1 3.262000E+01 8.680000E+00 1.004000E+01 -2160 1 9.400000E+00 1.616000E+01 1.029000E+01 -2161 1 5.980000E+00 1.628000E+01 2.001000E+01 -2162 1 1.590000E+00 2.898000E+01 2.510000E+00 -2163 1 2.260000E+00 2.503000E+01 2.702000E+01 -2164 1 3.725000E+01 2.886000E+01 1.681000E+01 -2165 1 1.751000E+01 3.490000E+01 2.327000E+01 -2166 1 2.729000E+01 1.952000E+01 2.661000E+01 -2167 1 8.190000E+00 3.201000E+01 2.417000E+01 -2168 1 7.080000E+00 2.577000E+01 1.091000E+01 -2169 1 3.065000E+01 6.030000E+00 2.910000E+00 -2170 1 2.078000E+01 1.994000E+01 1.970000E+01 -2171 1 7.100000E-01 7.250000E+00 1.784000E+01 -2172 1 3.287000E+01 8.740000E+00 1.891000E+01 -2173 1 1.178000E+01 2.800000E+01 1.470000E+01 -2174 1 2.178000E+01 2.015000E+01 3.462000E+01 -2175 1 3.874000E+01 1.992000E+01 1.613000E+01 -2176 1 3.554000E+01 3.239000E+01 3.856000E+01 -2177 1 1.772000E+01 4.020000E+01 1.210000E+00 -2178 1 2.093000E+01 1.558000E+01 2.323000E+01 -2179 1 8.900000E+00 2.592000E+01 3.849000E+01 -2180 1 1.428000E+01 6.460000E+00 3.351000E+01 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data new file mode 120000 index 0000000000..da2da72a38 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data @@ -0,0 +1 @@ +../dpd_tstat/cg_spce.data \ No newline at end of file diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot deleted file mode 100644 index 853ff4bec0..0000000000 --- a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot +++ /dev/null @@ -1,354 +0,0 @@ -VOTCA -N 351 R 2.0 9.0 - -1 2.000000E+00 2.190202E+01 7.229762E+01 -2 2.020000E+00 2.048957E+01 6.887333E+01 -3 2.040000E+00 1.915004E+01 6.500604E+01 -4 2.060000E+00 1.789228E+01 6.069573E+01 -5 2.080000E+00 1.672516E+01 5.594242E+01 -6 2.100000E+00 1.565754E+01 5.074609E+01 -7 2.120000E+00 1.467088E+01 4.787307E+01 -8 2.140000E+00 1.374450E+01 4.471740E+01 -9 2.160000E+00 1.288407E+01 4.127908E+01 -10 2.180000E+00 1.209522E+01 3.755811E+01 -11 2.200000E+00 1.138363E+01 3.355449E+01 -12 2.220000E+00 1.072913E+01 3.188695E+01 -13 2.240000E+00 1.010845E+01 3.017359E+01 -14 2.260000E+00 9.522496E+00 2.841440E+01 -15 2.280000E+00 8.972182E+00 2.660938E+01 -16 2.300000E+00 8.458426E+00 2.475854E+01 -17 2.320000E+00 8.014166E+00 2.006698E+01 -18 2.340000E+00 7.639767E+00 1.777244E+01 -19 2.360000E+00 7.287288E+00 1.787493E+01 -20 2.380000E+00 6.908790E+00 2.037445E+01 -21 2.400000E+00 6.456330E+00 2.527099E+01 -22 2.420000E+00 5.858025E+00 3.384695E+01 -23 2.440000E+00 5.130955E+00 3.814748E+01 -24 2.460000E+00 4.360629E+00 3.817257E+01 -25 2.480000E+00 3.632555E+00 3.392224E+01 -26 2.500000E+00 3.032242E+00 2.539647E+01 -27 2.520000E+00 2.547993E+00 2.297813E+01 -28 2.540000E+00 2.115131E+00 2.025763E+01 -29 2.560000E+00 1.739702E+00 1.723497E+01 -30 2.580000E+00 1.427747E+00 1.391013E+01 -31 2.600000E+00 1.185311E+00 1.028314E+01 -32 2.620000E+00 9.860176E-01 9.578245E+00 -33 2.640000E+00 8.048986E-01 8.465708E+00 -34 2.660000E+00 6.501069E-01 6.945526E+00 -35 2.680000E+00 5.297952E-01 5.017699E+00 -36 2.700000E+00 4.521166E-01 2.682227E+00 -37 2.720000E+00 3.986447E-01 2.615311E+00 -38 2.740000E+00 3.494900E-01 2.250522E+00 -39 2.760000E+00 3.106097E-01 1.587859E+00 -40 2.780000E+00 2.879614E-01 6.273237E-01 -41 2.800000E+00 2.875026E-01 -6.310851E-01 -42 2.820000E+00 3.002733E-01 -6.543549E-01 -43 2.840000E+00 3.140112E-01 -7.277911E-01 -44 2.860000E+00 3.297194E-01 -8.513935E-01 -45 2.880000E+00 3.484014E-01 -1.025162E+00 -46 2.900000E+00 3.710604E-01 -1.249097E+00 -47 2.920000E+00 3.974884E-01 -1.380483E+00 -48 2.940000E+00 4.257507E-01 -1.432530E+00 -49 2.960000E+00 4.542607E-01 -1.405240E+00 -50 2.980000E+00 4.814314E-01 -1.298611E+00 -51 3.000000E+00 5.056762E-01 -1.112645E+00 -52 3.020000E+00 5.266502E-01 -9.832894E-01 -53 3.040000E+00 5.449492E-01 -8.451544E-01 -54 3.060000E+00 5.603978E-01 -6.982396E-01 -55 3.080000E+00 5.728203E-01 -5.425450E-01 -56 3.100000E+00 5.820411E-01 -3.780706E-01 -57 3.120000E+00 5.882509E-01 -2.409307E-01 -58 3.140000E+00 5.915991E-01 -9.190908E-02 -59 3.160000E+00 5.918481E-01 6.899430E-02 -60 3.180000E+00 5.887601E-01 2.417794E-01 -61 3.200000E+00 5.820977E-01 4.264463E-01 -62 3.220000E+00 5.733491E-01 4.528343E-01 -63 3.240000E+00 5.638075E-01 5.057356E-01 -64 3.260000E+00 5.529429E-01 5.851503E-01 -65 3.280000E+00 5.402248E-01 6.910784E-01 -66 3.300000E+00 5.251230E-01 8.235199E-01 -67 3.320000E+00 5.086524E-01 8.236482E-01 -68 3.340000E+00 4.921725E-01 8.244583E-01 -69 3.360000E+00 4.756696E-01 8.259503E-01 -70 3.380000E+00 4.591299E-01 8.281240E-01 -71 3.400000E+00 4.425400E-01 8.309796E-01 -72 3.420000E+00 4.259181E-01 8.311861E-01 -73 3.440000E+00 4.092937E-01 8.312292E-01 -74 3.460000E+00 3.926700E-01 8.311089E-01 -75 3.480000E+00 3.760504E-01 8.308252E-01 -76 3.500000E+00 3.594381E-01 8.303781E-01 -77 3.520000E+00 3.428394E-01 8.295412E-01 -78 3.540000E+00 3.262547E-01 8.289646E-01 -79 3.560000E+00 3.096790E-01 8.286483E-01 -80 3.580000E+00 2.931071E-01 8.285923E-01 -81 3.600000E+00 2.765336E-01 8.287966E-01 -82 3.620000E+00 2.599901E-01 8.254306E-01 -83 3.640000E+00 2.435212E-01 8.213359E-01 -84 3.660000E+00 2.271415E-01 8.165124E-01 -85 3.680000E+00 2.108656E-01 8.109603E-01 -86 3.700000E+00 1.947080E-01 8.046794E-01 -87 3.720000E+00 1.790243E-01 7.653050E-01 -88 3.740000E+00 1.640312E-01 7.356166E-01 -89 3.760000E+00 1.495351E-01 7.156143E-01 -90 3.780000E+00 1.353421E-01 7.052980E-01 -91 3.800000E+00 1.212586E-01 7.046676E-01 -92 3.820000E+00 1.072429E-01 6.965706E-01 -93 3.840000E+00 9.340878E-02 6.865180E-01 -94 3.860000E+00 7.979524E-02 6.745098E-01 -95 3.880000E+00 6.644142E-02 6.605462E-01 -96 3.900000E+00 5.338643E-02 6.446270E-01 -97 3.920000E+00 4.067486E-02 6.268536E-01 -98 3.940000E+00 2.829935E-02 6.110218E-01 -99 3.960000E+00 1.622105E-02 5.971317E-01 -100 3.980000E+00 4.401131E-03 5.851833E-01 -101 4.000000E+00 -7.199230E-03 5.751764E-01 -102 4.020000E+00 -1.856170E-02 5.611971E-01 -103 4.040000E+00 -2.965216E-02 5.479743E-01 -104 4.060000E+00 -4.048572E-02 5.355079E-01 -105 4.080000E+00 -5.107752E-02 5.237981E-01 -106 4.100000E+00 -6.144268E-02 5.128447E-01 -107 4.120000E+00 -7.151117E-02 4.939504E-01 -108 4.140000E+00 -8.119856E-02 4.747353E-01 -109 4.160000E+00 -9.049845E-02 4.551994E-01 -110 4.180000E+00 -9.940440E-02 4.353427E-01 -111 4.200000E+00 -1.079100E-01 4.151651E-01 -112 4.220000E+00 -1.159565E-01 3.900062E-01 -113 4.240000E+00 -1.235312E-01 3.679865E-01 -114 4.260000E+00 -1.306969E-01 3.491061E-01 -115 4.280000E+00 -1.375164E-01 3.333651E-01 -116 4.300000E+00 -1.440524E-01 3.207633E-01 -117 4.320000E+00 -1.503014E-01 3.040292E-01 -118 4.340000E+00 -1.562092E-01 2.866389E-01 -119 4.360000E+00 -1.617626E-01 2.685925E-01 -120 4.380000E+00 -1.669485E-01 2.498899E-01 -121 4.400000E+00 -1.717538E-01 2.305311E-01 -122 4.420000E+00 -1.760941E-01 2.036400E-01 -123 4.440000E+00 -1.799054E-01 1.776469E-01 -124 4.460000E+00 -1.832059E-01 1.525518E-01 -125 4.480000E+00 -1.860135E-01 1.283546E-01 -126 4.500000E+00 -1.883461E-01 1.050554E-01 -127 4.520000E+00 -1.902569E-01 8.558005E-02 -128 4.540000E+00 -1.917515E-01 6.344105E-02 -129 4.560000E+00 -1.927768E-01 3.863842E-02 -130 4.580000E+00 -1.932793E-01 1.117216E-02 -131 4.600000E+00 -1.932059E-01 -1.895774E-02 -132 4.620000E+00 -1.926829E-01 -3.331832E-02 -133 4.640000E+00 -1.918741E-01 -4.753697E-02 -134 4.660000E+00 -1.907824E-01 -6.161370E-02 -135 4.680000E+00 -1.894105E-01 -7.554851E-02 -136 4.700000E+00 -1.877614E-01 -8.934140E-02 -137 4.720000E+00 -1.859159E-01 -9.580751E-02 -138 4.740000E+00 -1.839049E-01 -1.058976E-01 -139 4.760000E+00 -1.816559E-01 -1.196116E-01 -140 4.780000E+00 -1.790963E-01 -1.369495E-01 -141 4.800000E+00 -1.761537E-01 -1.579114E-01 -142 4.820000E+00 -1.728280E-01 -1.744216E-01 -143 4.840000E+00 -1.691864E-01 -1.895036E-01 -144 4.860000E+00 -1.652574E-01 -2.031575E-01 -145 4.880000E+00 -1.610696E-01 -2.153832E-01 -146 4.900000E+00 -1.566516E-01 -2.261808E-01 -147 4.920000E+00 -1.521084E-01 -2.290714E-01 -148 4.940000E+00 -1.474515E-01 -2.375453E-01 -149 4.960000E+00 -1.425693E-01 -2.516026E-01 -150 4.980000E+00 -1.373502E-01 -2.712432E-01 -151 5.000000E+00 -1.316824E-01 -2.964672E-01 -152 5.020000E+00 -1.257009E-01 -3.016666E-01 -153 5.040000E+00 -1.196162E-01 -3.067953E-01 -154 5.060000E+00 -1.134296E-01 -3.118535E-01 -155 5.080000E+00 -1.071425E-01 -3.168409E-01 -156 5.100000E+00 -1.007564E-01 -3.217577E-01 -157 5.120000E+00 -9.430843E-02 -3.230025E-01 -158 5.140000E+00 -8.783782E-02 -3.240216E-01 -159 5.160000E+00 -8.134907E-02 -3.248150E-01 -160 5.180000E+00 -7.484672E-02 -3.253827E-01 -161 5.200000E+00 -6.833527E-02 -3.257248E-01 -162 5.220000E+00 -6.171989E-02 -3.350608E-01 -163 5.240000E+00 -5.496291E-02 -3.398853E-01 -164 5.260000E+00 -4.815456E-02 -3.401983E-01 -165 5.280000E+00 -4.138506E-02 -3.359997E-01 -166 5.300000E+00 -3.474465E-02 -3.272895E-01 -167 5.320000E+00 -2.866480E-02 -2.819209E-01 -168 5.340000E+00 -2.341879E-02 -2.439062E-01 -169 5.360000E+00 -1.885953E-02 -2.132454E-01 -170 5.380000E+00 -1.483994E-02 -1.899386E-01 -171 5.400000E+00 -1.121296E-02 -1.739857E-01 -172 5.420000E+00 -7.974056E-03 -1.497398E-01 -173 5.440000E+00 -5.229953E-03 -1.245058E-01 -174 5.460000E+00 -3.000413E-03 -9.828350E-02 -175 5.480000E+00 -1.305201E-03 -7.107305E-02 -176 5.500000E+00 -1.640790E-04 -4.287441E-02 -177 5.520000E+00 6.371635E-04 -3.612657E-02 -178 5.540000E+00 1.236053E-03 -2.263906E-02 -179 5.560000E+00 1.497795E-03 -2.411882E-03 -180 5.580000E+00 1.287597E-03 2.455496E-02 -181 5.600000E+00 4.706651E-04 5.826147E-02 -182 5.620000E+00 -7.026386E-04 5.910929E-02 -183 5.640000E+00 -1.895322E-03 6.019943E-02 -184 5.660000E+00 -3.112231E-03 6.153190E-02 -185 5.680000E+00 -4.358213E-03 6.310668E-02 -186 5.700000E+00 -5.638114E-03 6.492378E-02 -187 5.720000E+00 -6.949688E-03 6.610584E-02 -188 5.740000E+00 -8.277238E-03 6.652145E-02 -189 5.760000E+00 -9.605436E-03 6.617062E-02 -190 5.780000E+00 -1.091895E-02 6.505335E-02 -191 5.800000E+00 -1.220246E-02 6.316963E-02 -192 5.820000E+00 -1.341489E-02 5.820182E-02 -193 5.840000E+00 -1.453566E-02 5.400257E-02 -194 5.860000E+00 -1.558012E-02 5.057189E-02 -195 5.880000E+00 -1.656366E-02 4.790978E-02 -196 5.900000E+00 -1.750164E-02 4.601622E-02 -197 5.920000E+00 -1.840088E-02 4.358369E-02 -198 5.940000E+00 -1.923199E-02 3.920163E-02 -199 5.960000E+00 -1.995595E-02 3.287003E-02 -200 5.980000E+00 -2.053379E-02 2.458889E-02 -201 6.000000E+00 -2.092651E-02 1.435822E-02 -202 6.020000E+00 -2.120502E-02 1.352840E-02 -203 6.040000E+00 -2.146907E-02 1.291186E-02 -204 6.060000E+00 -2.172292E-02 1.250861E-02 -205 6.080000E+00 -2.197084E-02 1.231865E-02 -206 6.100000E+00 -2.221709E-02 1.234198E-02 -207 6.120000E+00 -2.246474E-02 1.237271E-02 -208 6.140000E+00 -2.270998E-02 1.210114E-02 -209 6.160000E+00 -2.294677E-02 1.152726E-02 -210 6.180000E+00 -2.316905E-02 1.065107E-02 -211 6.200000E+00 -2.337079E-02 9.472569E-03 -212 6.220000E+00 -2.332237E-02 -1.276224E-02 -213 6.240000E+00 -2.292243E-02 -2.567822E-02 -214 6.260000E+00 -2.235736E-02 -2.927535E-02 -215 6.280000E+00 -2.181354E-02 -2.355364E-02 -216 6.300000E+00 -2.147734E-02 -8.513096E-03 -217 6.320000E+00 -2.141633E-02 1.466366E-03 -218 6.340000E+00 -2.149820E-02 5.775798E-03 -219 6.360000E+00 -2.160956E-02 4.415202E-03 -220 6.380000E+00 -2.163701E-02 -2.615423E-03 -221 6.400000E+00 -2.146714E-02 -1.531608E-02 -222 6.420000E+00 -2.107402E-02 -2.337955E-02 -223 6.440000E+00 -2.055660E-02 -2.774728E-02 -224 6.460000E+00 -1.998877E-02 -2.841924E-02 -225 6.480000E+00 -1.944446E-02 -2.539546E-02 -226 6.500000E+00 -1.899759E-02 -1.867591E-02 -227 6.520000E+00 -1.869042E-02 -1.259095E-02 -228 6.540000E+00 -1.847196E-02 -9.804901E-03 -229 6.560000E+00 -1.827623E-02 -1.031775E-02 -230 6.580000E+00 -1.803726E-02 -1.412951E-02 -231 6.600000E+00 -1.768906E-02 -2.124018E-02 -232 6.620000E+00 -1.710949E-02 -3.551655E-02 -233 6.640000E+00 -1.631641E-02 -4.259122E-02 -234 6.660000E+00 -1.545385E-02 -4.246419E-02 -235 6.680000E+00 -1.466585E-02 -3.513545E-02 -236 6.700000E+00 -1.409644E-02 -2.060502E-02 -237 6.720000E+00 -1.374966E-02 -1.461056E-02 -238 6.740000E+00 -1.349054E-02 -1.183851E-02 -239 6.760000E+00 -1.325464E-02 -1.228886E-02 -240 6.780000E+00 -1.297750E-02 -1.596163E-02 -241 6.800000E+00 -1.259469E-02 -2.285680E-02 -242 6.820000E+00 -1.213049E-02 -2.349903E-02 -243 6.840000E+00 -1.165728E-02 -2.375897E-02 -244 6.860000E+00 -1.118268E-02 -2.363664E-02 -245 6.880000E+00 -1.071436E-02 -2.313203E-02 -246 6.900000E+00 -1.025995E-02 -2.224514E-02 -247 6.920000E+00 -9.817276E-03 -2.203990E-02 -248 6.940000E+00 -9.377653E-03 -2.193988E-02 -249 6.960000E+00 -8.938979E-03 -2.194508E-02 -250 6.980000E+00 -8.499148E-03 -2.205550E-02 -251 7.000000E+00 -8.056057E-03 -2.227113E-02 -252 7.020000E+00 -7.597830E-03 -2.345789E-02 -253 7.040000E+00 -7.121492E-03 -2.408210E-02 -254 7.060000E+00 -6.638296E-03 -2.414376E-02 -255 7.080000E+00 -6.159492E-03 -2.364288E-02 -256 7.100000E+00 -5.696331E-03 -2.257946E-02 -257 7.120000E+00 -5.301441E-03 -1.729553E-02 -258 7.140000E+00 -4.989070E-03 -1.432759E-02 -259 7.160000E+00 -4.712898E-03 -1.367562E-02 -260 7.180000E+00 -4.426605E-03 -1.533964E-02 -261 7.200000E+00 -4.083872E-03 -1.931964E-02 -262 7.220000E+00 -3.631995E-03 -2.538390E-02 -263 7.240000E+00 -3.087883E-03 -2.854317E-02 -264 7.260000E+00 -2.509635E-03 -2.879748E-02 -265 7.280000E+00 -1.955351E-03 -2.614680E-02 -266 7.300000E+00 -1.483130E-03 -2.059115E-02 -267 7.320000E+00 -1.113389E-03 -1.639767E-02 -268 7.340000E+00 -8.266321E-04 -1.229279E-02 -269 7.360000E+00 -6.210869E-04 -8.276492E-03 -270 7.380000E+00 -4.949818E-04 -4.348786E-03 -271 7.400000E+00 -4.465449E-04 -5.096684E-04 -272 7.420000E+00 -5.304321E-04 8.162452E-03 -273 7.440000E+00 -7.436056E-04 1.241897E-02 -274 7.460000E+00 -9.977534E-04 1.225988E-02 -275 7.480000E+00 -1.204563E-03 7.685191E-03 -276 7.500000E+00 -1.275724E-03 -1.305104E-03 -277 7.520000E+00 -1.199415E-03 -5.916706E-03 -278 7.540000E+00 -1.055417E-03 -8.074089E-03 -279 7.560000E+00 -8.928131E-04 -7.777253E-03 -280 7.580000E+00 -7.606883E-04 -5.026198E-03 -281 7.600000E+00 -7.081267E-04 1.790768E-04 -282 7.620000E+00 -7.213835E-04 1.157786E-03 -283 7.640000E+00 -7.548855E-04 2.203601E-03 -284 7.660000E+00 -8.099749E-04 3.316523E-03 -285 7.680000E+00 -8.879938E-04 4.496550E-03 -286 7.700000E+00 -9.902843E-04 5.743685E-03 -287 7.720000E+00 -1.122403E-03 7.421734E-03 -288 7.740000E+00 -1.285295E-03 8.820936E-03 -289 7.760000E+00 -1.473382E-03 9.941291E-03 -290 7.780000E+00 -1.681087E-03 1.078280E-02 -291 7.800000E+00 -1.902835E-03 1.134546E-02 -292 7.820000E+00 -2.225281E-03 2.008573E-02 -293 7.840000E+00 -2.673724E-03 2.394500E-02 -294 7.860000E+00 -3.150542E-03 2.292328E-02 -295 7.880000E+00 -3.558115E-03 1.702056E-02 -296 7.900000E+00 -3.798824E-03 6.236836E-03 -297 7.920000E+00 -3.844315E-03 -1.142168E-03 -298 7.940000E+00 -3.774961E-03 -5.247538E-03 -299 7.960000E+00 -3.656237E-03 -6.079274E-03 -300 7.980000E+00 -3.553615E-03 -3.637376E-03 -301 8.000000E+00 -3.532566E-03 2.078155E-03 -302 8.020000E+00 -3.611956E-03 5.494873E-03 -303 8.040000E+00 -3.737724E-03 6.716053E-03 -304 8.060000E+00 -3.865961E-03 5.741694E-03 -305 8.080000E+00 -3.952755E-03 2.571796E-03 -306 8.100000E+00 -3.954196E-03 -2.793640E-03 -307 8.120000E+00 -3.873685E-03 -5.086591E-03 -308 8.140000E+00 -3.757567E-03 -6.354313E-03 -309 8.160000E+00 -3.626347E-03 -6.596805E-03 -310 8.180000E+00 -3.500530E-03 -5.814068E-03 -311 8.200000E+00 -3.400620E-03 -4.006101E-03 -312 8.220000E+00 -3.334411E-03 -2.730570E-03 -313 8.240000E+00 -3.286762E-03 -2.150229E-03 -314 8.260000E+00 -3.243768E-03 -2.265076E-03 -315 8.280000E+00 -3.191524E-03 -3.075114E-03 -316 8.300000E+00 -3.116129E-03 -4.580340E-03 -317 8.320000E+00 -2.964210E-03 -1.014102E-02 -318 8.340000E+00 -2.729309E-03 -1.287854E-02 -319 8.360000E+00 -2.467889E-03 -1.279292E-02 -320 8.380000E+00 -2.236413E-03 -9.884157E-03 -321 8.400000E+00 -2.091344E-03 -4.152240E-03 -322 8.420000E+00 -2.034875E-03 -1.692189E-03 -323 8.440000E+00 -2.015752E-03 -4.177491E-04 -324 8.460000E+00 -2.010261E-03 -3.289192E-04 -325 8.480000E+00 -1.994691E-03 -1.425700E-03 -326 8.500000E+00 -1.945329E-03 -3.708091E-03 -327 8.520000E+00 -1.867098E-03 -4.115259E-03 -328 8.540000E+00 -1.780711E-03 -4.523663E-03 -329 8.560000E+00 -1.686143E-03 -4.933304E-03 -330 8.580000E+00 -1.583370E-03 -5.344181E-03 -331 8.600000E+00 -1.472368E-03 -5.756296E-03 -332 8.620000E+00 -1.328792E-03 -8.394009E-03 -333 8.640000E+00 -1.144899E-03 -9.787974E-03 -334 8.660000E+00 -9.455644E-04 -9.938189E-03 -335 8.680000E+00 -7.556630E-04 -8.844656E-03 -336 8.700000E+00 -6.000698E-04 -6.507373E-03 -337 8.720000E+00 -5.364035E-04 -3.286769E-04 -338 8.740000E+00 -5.681458E-04 3.033482E-03 -339 8.760000E+00 -6.389659E-04 3.579102E-03 -340 8.780000E+00 -6.925330E-04 1.308185E-03 -341 8.800000E+00 -6.725164E-04 -3.779270E-03 -342 8.820000E+00 -5.113768E-04 -1.169180E-02 -343 8.840000E+00 -2.305599E-04 -1.574700E-02 -344 8.860000E+00 9.278768E-05 -1.594487E-02 -345 8.880000E+00 3.815195E-04 -1.228542E-02 -346 8.900000E+00 5.584889E-04 -4.768636E-03 -347 8.920000E+00 6.079481E-04 -2.335309E-04 -348 8.940000E+00 5.700798E-04 3.964121E-03 -349 8.960000E+00 4.516330E-04 7.824320E-03 -350 8.980000E+00 2.593567E-04 1.134707E-02 -351 9.000000E+00 0.000000E+00 1.453236E-02 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot new file mode 120000 index 0000000000..9abb769be2 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot @@ -0,0 +1 @@ +../dpd_tstat/cg_spce_table.pot \ No newline at end of file diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/in.cg_spce b/examples/PACKAGES/dpd-basic/dpdext_tstat/in.dpdext_tstat similarity index 76% rename from examples/PACKAGES/dpd-basic/dpdext_tstat/in.cg_spce rename to examples/PACKAGES/dpd-basic/dpdext_tstat/in.dpdext_tstat index b93dc3eec5..205aef99e4 100644 --- a/examples/PACKAGES/dpd-basic/dpdext_tstat/in.cg_spce +++ b/examples/PACKAGES/dpd-basic/dpdext_tstat/in.dpdext_tstat @@ -4,7 +4,7 @@ variable T equal 300.0 variable rc equal 9.0 variable rcD equal 10.0 -units real +units real boundary p p p atom_style atomic dimension 3 @@ -13,7 +13,7 @@ comm_modify vel yes read_data cg_spce.data -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 ${rcD} @@ -24,8 +24,8 @@ run_style verlet velocity all create ${T} 68768932 thermo_style custom step time temp press -thermo 10 +thermo 100 fix 1 all nve -run 2000 +run 1000 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.1 b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.1 deleted file mode 100644 index 8f75dfa917..0000000000 --- a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.1 +++ /dev/null @@ -1,293 +0,0 @@ -LAMMPS (8 Apr 2021) -# Coarse-Grained SPC/E Water - -variable T equal 300.0 -variable rc equal 9.0 -variable rcD equal 10.0 - -units real -boundary p p p -atom_style atomic -dimension 3 -newton on -comm_modify vel yes - -read_data cg_spce.data -Reading data file ... - orthogonal box = (0.0000000 0.0000000 0.0000000) to (40.310000 40.310000 40.310000) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 2180 atoms - read_data CPU = 0.020 seconds - -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 ${T} ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 300 ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 300 9 385262 - -pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} -pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 -WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. - Should only be flagged at inflection points (../pair_table.cpp:461) -pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 ${rcD} -pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 10 - -timestep 1.0 -run_style verlet - -velocity all create ${T} 68768932 -velocity all create 300 68768932 - -thermo_style custom step time temp press -thermo 10 - -fix 1 all nve - -run 2000 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12 - ghost atom cutoff = 12 - binsize = 6, bins = 7 7 7 - 2 neighbor lists, perpetual/occasional/extra = 2 0 0 - (1) pair table, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard - (2) pair dpd/ext/tstat, perpetual, copy from (1) - attributes: half, newton on - pair build: copy - stencil: none - bin: none -Per MPI rank memory allocation (min/avg/max) = 5.380 | 5.380 | 5.380 Mbytes -Step Time Temp Press - 0 0 300 7368.7186 - 10 10 298.34842 6443.6033 - 20 20 303.36187 9303.0158 - 30 30 301.59356 7533.7912 - 40 40 300.97217 5623.9089 - 50 50 300.31652 9105.8093 - 60 60 296.92173 9213.304 - 70 70 294.36593 12701.327 - 80 80 295.30077 6098.4732 - 90 90 296.35396 8051.719 - 100 100 293.72532 5555.983 - 110 110 290.95711 9001.8346 - 120 120 290.91972 10264.241 - 130 130 294.14911 11450.959 - 140 140 299.11994 7244.1639 - 150 150 301.20082 7675.7516 - 160 160 300.71883 9718.1901 - 170 170 295.47176 8931.1414 - 180 180 290.45284 7381.7674 - 190 190 291.66922 11028.436 - 200 200 294.0543 11897.269 - 210 210 299.17955 8939.2171 - 220 220 298.45193 8047.038 - 230 230 300.48548 10033.64 - 240 240 299.24752 6310.7247 - 250 250 304.51487 8710.5626 - 260 260 303.6513 5230.8162 - 270 270 300.76074 12164.773 - 280 280 302.60275 11145.98 - 290 290 297.22957 9521.4384 - 300 300 297.1365 7446.9006 - 310 310 292.18323 8021.8344 - 320 320 295.03958 9130.8594 - 330 330 293.9622 4647.512 - 340 340 290.77751 8001.486 - 350 350 292.34687 11887.668 - 360 360 295.95968 9262.148 - 370 370 293.50476 4181.549 - 380 380 288.69498 7632.071 - 390 390 289.63957 5130.0205 - 400 400 295.02212 5643.5024 - 410 410 296.3944 7267.235 - 420 420 299.22019 7149.9305 - 430 430 298.36689 8384.595 - 440 440 295.33149 10515.75 - 450 450 294.76959 11569.389 - 460 460 300.141 7272.4453 - 470 470 299.14431 7792.5419 - 480 480 302.3697 5837.8675 - 490 490 301.94692 6999.1059 - 500 500 300.25929 4885.3948 - 510 510 302.50013 8231.0438 - 520 520 300.76412 8445.0349 - 530 530 298.5016 9110.432 - 540 540 301.14513 9348.6421 - 550 550 297.36425 10753.314 - 560 560 296.50046 10476.823 - 570 570 300.57267 9889.7968 - 580 580 300.4868 8377.423 - 590 590 296.65103 6859.32 - 600 600 298.50013 7080.5995 - 610 610 300.28274 9502.5438 - 620 620 298.45508 8819.7846 - 630 630 300.24859 6291.4944 - 640 640 299.38719 7430.2366 - 650 650 297.91915 9435.3218 - 660 660 300.61208 6287.9931 - 670 670 303.59291 8357.7639 - 680 680 301.85511 1697.3038 - 690 690 298.96873 5210.2286 - 700 700 298.09035 7510.4359 - 710 710 303.11692 10129.526 - 720 720 302.65473 10488.388 - 730 730 300.15444 7118.5953 - 740 740 300.19245 10582.032 - 750 750 296.73618 6538.0363 - 760 760 299.72857 7588.9487 - 770 770 299.00347 6633.9983 - 780 780 301.38129 8053.5347 - 790 790 298.54819 8711.4965 - 800 800 305.54197 9717.9727 - 810 810 302.96497 7582.0444 - 820 820 306.81537 9433.6446 - 830 830 309.16373 10088.582 - 840 840 313.53881 9509.8624 - 850 850 310.82992 5366.015 - 860 860 306.49798 8499.9157 - 870 870 308.93421 5690.3242 - 880 880 302.56668 5526.3636 - 890 890 306.72501 7380.8469 - 900 900 308.87199 10388.13 - 910 910 312.7367 6613.0734 - 920 920 308.34508 5903.4291 - 930 930 306.39924 8615.6622 - 940 940 310.37544 6849.4694 - 950 950 310.13051 6188.7605 - 960 960 308.68049 7637.532 - 970 970 302.85465 6448.7926 - 980 980 307.40719 8763.0959 - 990 990 304.02815 8373.6518 - 1000 1000 300.69539 5682.6678 - 1010 1010 299.16385 6012.246 - 1020 1020 305.118 7913.4144 - 1030 1030 304.20382 10580.788 - 1040 1040 302.91134 7698.4548 - 1050 1050 298.08593 8952.6724 - 1060 1060 302.56196 10602.997 - 1070 1070 305.98211 12174.358 - 1080 1080 305.70253 12288.219 - 1090 1090 303.22805 7922.7166 - 1100 1100 301.54879 5031.3836 - 1110 1110 302.57611 8547.4189 - 1120 1120 302.00845 12966.595 - 1130 1130 296.10912 4514.1707 - 1140 1140 295.11601 6543.7239 - 1150 1150 287.29188 6453.3386 - 1160 1160 284.83881 7168.9427 - 1170 1170 289.77871 7895.7434 - 1180 1180 293.48011 7680.6885 - 1190 1190 295.69035 8609.6593 - 1200 1200 296.0653 7343.68 - 1210 1210 302.72922 6973.6048 - 1220 1220 304.11805 7322.7664 - 1230 1230 300.24647 6418.2612 - 1240 1240 293.24074 9039.1214 - 1250 1250 300.56214 7877.4055 - 1260 1260 308.03086 5644.2135 - 1270 1270 311.12289 6875.5126 - 1280 1280 307.83182 7204.9894 - 1290 1290 309.58491 9993.2255 - 1300 1300 305.36536 8626.859 - 1310 1310 304.35084 3471.1205 - 1320 1320 304.40125 2149.2701 - 1330 1330 295.74547 6252.9592 - 1340 1340 293.16034 3407.4408 - 1350 1350 298.6302 10139.977 - 1360 1360 300.46627 7312.9011 - 1370 1370 298.00367 2780.8886 - 1380 1380 300.97807 9403.3451 - 1390 1390 294.32612 12005.453 - 1400 1400 296.13403 5569.4907 - 1410 1410 297.86152 9558.6064 - 1420 1420 303.01992 8678.345 - 1430 1430 298.53849 5544.6316 - 1440 1440 293.60633 12879.765 - 1450 1450 296.28813 9312.4229 - 1460 1460 292.64466 8344.5877 - 1470 1470 295.28975 7689.9396 - 1480 1480 300.10761 7436.7346 - 1490 1490 291.6152 8909.6757 - 1500 1500 286.644 9756.5014 - 1510 1510 294.52064 10383.164 - 1520 1520 297.49618 4972.89 - 1530 1530 295.63379 6192.5729 - 1540 1540 295.04528 4987.7191 - 1550 1550 290.41403 7013.6076 - 1560 1560 295.62326 7222.5009 - 1570 1570 299.90584 4282.5688 - 1580 1580 299.04532 7885.433 - 1590 1590 300.03907 5508.0652 - 1600 1600 298.05683 9262.3744 - 1610 1610 297.50015 9544.6913 - 1620 1620 303.21217 6393.6756 - 1630 1630 304.44383 9674.6583 - 1640 1640 302.68977 9065.4408 - 1650 1650 303.62415 6851.1575 - 1660 1660 306.11103 8592.0481 - 1670 1670 300.84566 8483.551 - 1680 1680 303.92882 10113.096 - 1690 1690 305.02534 7389.9402 - 1700 1700 303.52902 5541.9256 - 1710 1710 299.27905 9547.7344 - 1720 1720 294.14366 7269.2402 - 1730 1730 299.49977 8086.0601 - 1740 1740 298.66942 7026.6067 - 1750 1750 296.94428 9595.2435 - 1760 1760 297.36921 6268.7436 - 1770 1770 299.88423 10598.189 - 1780 1780 293.76868 7405.7641 - 1790 1790 297.19444 10837.102 - 1800 1800 296.46054 8345.699 - 1810 1810 299.06801 5256.5992 - 1820 1820 294.17725 5510.7529 - 1830 1830 286.78527 6310.8881 - 1840 1840 284.89686 8249.1144 - 1850 1850 293.79389 4578.9263 - 1860 1860 298.31279 8752.305 - 1870 1870 295.31087 8401.2736 - 1880 1880 298.13297 4354.8694 - 1890 1890 298.90786 11454.088 - 1900 1900 299.1416 9121.4138 - 1910 1910 296.43134 12157.884 - 1920 1920 292.05445 8613.1522 - 1930 1930 300.3421 7898.3626 - 1940 1940 304.55746 6311.259 - 1950 1950 304.03899 8789.3537 - 1960 1960 305.08259 7243.5622 - 1970 1970 304.0858 8712.4796 - 1980 1980 299.14574 5166.3501 - 1990 1990 300.07254 10019.769 - 2000 2000 301.78176 8789.7968 -Loop time of 91.2059 on 1 procs for 2000 steps with 2180 atoms - -Performance: 1.895 ns/day, 12.667 hours/ns, 21.928 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 | 90.668 | 90.668 | 90.668 | 0.0 | 99.41 -Neigh | 0.23231 | 0.23231 | 0.23231 | 0.0 | 0.25 -Comm | 0.20819 | 0.20819 | 0.20819 | 0.0 | 0.23 -Output | 0.0049558 | 0.0049558 | 0.0049558 | 0.0 | 0.01 -Modify | 0.052906 | 0.052906 | 0.052906 | 0.0 | 0.06 -Other | | 0.03904 | | | 0.04 - -Nlocal: 2180.00 ave 2180 max 2180 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 6693.00 ave 6693 max 6693 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 261496.0 ave 261496 max 261496 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 261496 -Ave neighs/atom = 119.95229 -Neighbor list builds = 25 -Dangerous builds = 0 -Total wall time: 0:01:31 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.4 b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.4 deleted file mode 100644 index 278aba0687..0000000000 --- a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.4 +++ /dev/null @@ -1,293 +0,0 @@ -LAMMPS (8 Apr 2021) -# Coarse-Grained SPC/E Water - -variable T equal 300.0 -variable rc equal 9.0 -variable rcD equal 10.0 - -units real -boundary p p p -atom_style atomic -dimension 3 -newton on -comm_modify vel yes - -read_data cg_spce.data -Reading data file ... - orthogonal box = (0.0000000 0.0000000 0.0000000) to (40.310000 40.310000 40.310000) - 1 by 2 by 2 MPI processor grid - reading atoms ... - 2180 atoms - read_data CPU = 0.005 seconds - -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 ${T} ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 300 ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 300 9 385262 - -pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} -pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 -WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. - Should only be flagged at inflection points (../pair_table.cpp:461) -pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 ${rcD} -pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 10 - -timestep 1.0 -run_style verlet - -velocity all create ${T} 68768932 -velocity all create 300 68768932 - -thermo_style custom step time temp press -thermo 10 - -fix 1 all nve - -run 2000 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12 - ghost atom cutoff = 12 - binsize = 6, bins = 7 7 7 - 2 neighbor lists, perpetual/occasional/extra = 2 0 0 - (1) pair table, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard - (2) pair dpd/ext/tstat, perpetual, copy from (1) - attributes: half, newton on - pair build: copy - stencil: none - bin: none -Per MPI rank memory allocation (min/avg/max) = 3.695 | 3.696 | 3.697 Mbytes -Step Time Temp Press - 0 0 300 5965.5396 - 10 10 303.16391 8779.1574 - 20 20 306.9014 8268.573 - 30 30 305.84291 9976.0547 - 40 40 301.20527 8832.3902 - 50 50 305.72012 8041.0146 - 60 60 305.1676 7118.8042 - 70 70 305.01132 9423.9307 - 80 80 308.10236 10781.423 - 90 90 309.18703 3637.9961 - 100 100 305.11814 7726.7672 - 110 110 298.37346 8575.1602 - 120 120 304.79786 8910.8048 - 130 130 309.05401 6351.4839 - 140 140 304.28367 4805.137 - 150 150 300.28903 7412.6411 - 160 160 299.39358 10183.593 - 170 170 296.80729 5437.1054 - 180 180 295.2755 8317.0414 - 190 190 303.25949 8338.3453 - 200 200 303.24607 9636.5224 - 210 210 298.56684 10288.264 - 220 220 293.42999 9001.0482 - 230 230 293.12497 9083.5194 - 240 240 291.92847 9659.3388 - 250 250 299.2202 6328.759 - 260 260 297.45209 10405.677 - 270 270 292.12257 7273.9369 - 280 280 289.81113 8957.8747 - 290 290 299.06683 6695.3776 - 300 300 300.75468 6298.5705 - 310 310 296.26524 7432.4815 - 320 320 294.21403 9941.7038 - 330 330 293.01776 4750.2993 - 340 340 295.22553 4968.3595 - 350 350 293.95589 9224.5496 - 360 360 297.94278 8792.0395 - 370 370 298.99075 5453.7814 - 380 380 302.1188 6229.2283 - 390 390 298.48943 8517.5273 - 400 400 295.3701 11328.394 - 410 410 287.74238 4058.0382 - 420 420 288.83732 5706.6773 - 430 430 298.8242 6178.7142 - 440 440 304.42682 10138.321 - 450 450 300.28695 9731.3417 - 460 460 300.34539 9249.4691 - 470 470 303.32231 11638.718 - 480 480 301.46777 4186.402 - 490 490 292.56069 9184.8386 - 500 500 297.26162 11766.733 - 510 510 295.34018 6436.33 - 520 520 300.16314 9325.3669 - 530 530 305.00513 5947.6408 - 540 540 300.88805 5222.7384 - 550 550 301.56707 6669.1808 - 560 560 304.89854 10730.053 - 570 570 299.50424 7956.1042 - 580 580 301.23382 10192.246 - 590 590 298.81222 6017.2125 - 600 600 300.57891 4575.433 - 610 610 301.95936 6309.7515 - 620 620 301.09393 5993.6489 - 630 630 300.47565 4388.7137 - 640 640 299.31886 9535.6093 - 650 650 295.06025 7954.5811 - 660 660 298.72666 8630.7466 - 670 670 302.53833 5636.1305 - 680 680 306.32833 12539.149 - 690 690 296.1951 11345.293 - 700 700 297.00325 6352.1448 - 710 710 298.51181 6922.4379 - 720 720 293.80125 4849.4922 - 730 730 296.52677 11141.583 - 740 740 294.15306 3527.8677 - 750 750 294.74737 8454.0815 - 760 760 292.53913 8187.9032 - 770 770 294.37078 7487.5703 - 780 780 297.50085 9198.7697 - 790 790 298.37773 8969.0024 - 800 800 293.29879 6506.6479 - 810 810 296.58266 8805.7872 - 820 820 290.85616 5248.8123 - 830 830 292.29488 5123.8203 - 840 840 292.77623 8263.5675 - 850 850 297.88225 6777.7444 - 860 860 300.01913 10439.087 - 870 870 295.79578 7318.1322 - 880 880 301.5994 8242.4774 - 890 890 306.63208 8090.6106 - 900 900 303.53759 6831.2666 - 910 910 300.70481 3811.0498 - 920 920 299.96274 8351.1573 - 930 930 299.67435 7046.0534 - 940 940 310.81742 6887.6925 - 950 950 305.09984 4811.088 - 960 960 301.33039 4184.851 - 970 970 301.19205 6417.6542 - 980 980 299.6491 7738.2233 - 990 990 297.33655 9264.0874 - 1000 1000 302.33418 7166.2751 - 1010 1010 300.08402 9121.0882 - 1020 1020 302.82225 6405.7109 - 1030 1030 304.01683 6944.0839 - 1040 1040 305.82618 6160.3838 - 1050 1050 308.12518 4356.0931 - 1060 1060 307.64811 6954.7245 - 1070 1070 313.70509 5558.9804 - 1080 1080 316.09239 7250.6147 - 1090 1090 310.2845 5441.3722 - 1100 1100 300.18899 4417.8774 - 1110 1110 304.02471 5609.1668 - 1120 1120 303.46016 10355.031 - 1130 1130 305.68165 6400.913 - 1140 1140 308.78348 7235.1894 - 1150 1150 299.30025 9246.4856 - 1160 1160 302.70799 9866.9536 - 1170 1170 302.0977 8643.5532 - 1180 1180 307.15407 8866.4664 - 1190 1190 305.78146 7562.4911 - 1200 1200 302.54605 7974.9973 - 1210 1210 306.14264 9554.2381 - 1220 1220 308.89843 6219.5361 - 1230 1230 305.71844 7633.9105 - 1240 1240 306.51911 7705.4795 - 1250 1250 304.78473 8590.5595 - 1260 1260 300.82969 9281.5964 - 1270 1270 305.9271 4951.1323 - 1280 1280 310.32728 9446.3989 - 1290 1290 318.27879 9102.5544 - 1300 1300 310.45777 5931.5457 - 1310 1310 304.81268 1214.4291 - 1320 1320 307.08811 10315.961 - 1330 1330 306.86917 8584.9658 - 1340 1340 307.26912 7254.864 - 1350 1350 310.02754 8508.6256 - 1360 1360 306.12763 4912.6641 - 1370 1370 301.67924 6715.8196 - 1380 1380 298.37239 6149.8821 - 1390 1390 299.62894 8181.4761 - 1400 1400 301.60395 6714.4244 - 1410 1410 297.65752 7035.6575 - 1420 1420 297.02817 7510.2637 - 1430 1430 303.59177 10361.937 - 1440 1440 300.10771 8473.2311 - 1450 1450 291.21837 6097.9954 - 1460 1460 291.58663 7729.0841 - 1470 1470 292.52447 6555.8661 - 1480 1480 294.48264 6960.0201 - 1490 1490 298.34869 8044.2321 - 1500 1500 296.8193 11731.289 - 1510 1510 296.52073 5452.8935 - 1520 1520 294.54819 9591.7969 - 1530 1530 297.36394 5148.5383 - 1540 1540 289.08137 6057.0981 - 1550 1550 288.27007 8965.1965 - 1560 1560 294.84398 8316.9487 - 1570 1570 299.79573 8760.7322 - 1580 1580 295.66745 5045.5322 - 1590 1590 298.14356 7161.1834 - 1600 1600 297.10402 6529.9938 - 1610 1610 299.69137 7741.6027 - 1620 1620 304.93043 11222.109 - 1630 1630 302.01322 10893.107 - 1640 1640 295.47422 8400.3124 - 1650 1650 301.93122 7190.2609 - 1660 1660 305.02639 6140.5552 - 1670 1670 302.86047 8651.5366 - 1680 1680 304.82151 9909.407 - 1690 1690 300.48426 8428.8845 - 1700 1700 293.06643 5333.8144 - 1710 1710 295.43687 9103.4353 - 1720 1720 298.77208 8162.1053 - 1730 1730 300.08189 9603.4371 - 1740 1740 303.16004 10693.291 - 1750 1750 303.54199 9151.023 - 1760 1760 300.99281 4641.2985 - 1770 1770 297.36657 3888.5753 - 1780 1780 298.32969 7286.2299 - 1790 1790 297.34183 8975.8956 - 1800 1800 295.83042 6366.7607 - 1810 1810 295.92044 9308.4953 - 1820 1820 298.10087 7117.2369 - 1830 1830 296.13936 4849.3739 - 1840 1840 296.5869 8321.4011 - 1850 1850 296.74513 9530.6806 - 1860 1860 298.57398 8788.0603 - 1870 1870 299.12825 6015.4777 - 1880 1880 301.91639 11706.441 - 1890 1890 309.85968 10909.493 - 1900 1900 302.64998 8779.8967 - 1910 1910 301.62919 9176.3902 - 1920 1920 300.66238 5369.8681 - 1930 1930 297.64499 8185.09 - 1940 1940 296.47852 10188.803 - 1950 1950 297.802 6679.4466 - 1960 1960 299.78754 7316.8198 - 1970 1970 300.09083 6008.9414 - 1980 1980 297.94119 5615.6403 - 1990 1990 298.37687 9727.308 - 2000 2000 296.08394 6400.2746 -Loop time of 41.5171 on 4 procs for 2000 steps with 2180 atoms - -Performance: 4.162 ns/day, 5.766 hours/ns, 48.173 timesteps/s -99.5% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 38.667 | 38.954 | 39.453 | 4.8 | 93.83 -Neigh | 0.10947 | 0.11039 | 0.11153 | 0.3 | 0.27 -Comm | 1.8661 | 2.3644 | 2.652 | 19.6 | 5.70 -Output | 0.0082644 | 0.0094232 | 0.01281 | 2.0 | 0.02 -Modify | 0.024678 | 0.025206 | 0.025888 | 0.3 | 0.06 -Other | | 0.05335 | | | 0.13 - -Nlocal: 545.000 ave 559 max 531 min -Histogram: 1 0 0 0 1 1 0 0 0 1 -Nghost: 3619.00 ave 3655 max 3594 min -Histogram: 1 1 0 0 1 0 0 0 0 1 -Neighs: 65415.5 ave 66835 max 64310 min -Histogram: 1 0 0 2 0 0 0 0 0 1 - -Total # of neighbors = 261662 -Ave neighs/atom = 120.02844 -Neighbor list builds = 26 -Dangerous builds = 0 -Total wall time: 0:00:41 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.1 b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.1 new file mode 100644 index 0000000000..44bebd62ce --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.1 @@ -0,0 +1,106 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Coarse-Grained SPC/E Water + +variable T equal 300.0 +variable rc equal 9.0 +variable rcD equal 10.0 + +units real +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +read_data cg_spce.data +Reading data file ... + orthogonal box = (0 0 0) to (40.31 40.31 40.31) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 2180 atoms + read_data CPU = 0.003 seconds + +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 300 ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 300 9 385262 + +pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} +pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 +WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. +WARNING: Should only be flagged at inflection points (src/pair_table.cpp:465) +pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 ${rcD} +pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 10 + +timestep 1.0 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 300 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 1000 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 7 7 7 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair table, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard + (2) pair dpd/ext/tstat, perpetual, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +Per MPI rank memory allocation (min/avg/max) = 5.38 | 5.38 | 5.38 Mbytes + Step Time Temp Press + 0 0 300 7353.4129 + 100 100 303.74025 4964.013 + 200 200 298.35396 8007.7802 + 300 300 298.28547 6291.5807 + 400 400 298.01797 6252.1041 + 500 500 299.88984 3489.931 + 600 600 302.5718 9092.203 + 700 700 305.38722 5909.02 + 800 800 294.81401 10282.286 + 900 900 292.40724 8338.6878 + 1000 1000 293.64788 6951.569 +Loop time of 28.1058 on 1 procs for 1000 steps with 2180 atoms + +Performance: 3.074 ns/day, 7.807 hours/ns, 35.580 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 | 27.948 | 27.948 | 27.948 | 0.0 | 99.44 +Neigh | 0.071647 | 0.071647 | 0.071647 | 0.0 | 0.25 +Comm | 0.058215 | 0.058215 | 0.058215 | 0.0 | 0.21 +Output | 0.00026724 | 0.00026724 | 0.00026724 | 0.0 | 0.00 +Modify | 0.014429 | 0.014429 | 0.014429 | 0.0 | 0.05 +Other | | 0.01283 | | | 0.05 + +Nlocal: 2180 ave 2180 max 2180 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 6643 ave 6643 max 6643 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 261826 ave 261826 max 261826 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 261826 +Ave neighs/atom = 120.10367 +Neighbor list builds = 12 +Dangerous builds = 0 +Total wall time: 0:00:28 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.4 b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.4 new file mode 100644 index 0000000000..fc9e1116ec --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.4 @@ -0,0 +1,106 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Coarse-Grained SPC/E Water + +variable T equal 300.0 +variable rc equal 9.0 +variable rcD equal 10.0 + +units real +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +read_data cg_spce.data +Reading data file ... + orthogonal box = (0 0 0) to (40.31 40.31 40.31) + 1 by 2 by 2 MPI processor grid + reading atoms ... + 2180 atoms + read_data CPU = 0.003 seconds + +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 300 ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 300 9 385262 + +pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} +pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 +WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. +WARNING: Should only be flagged at inflection points (src/pair_table.cpp:465) +pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 ${rcD} +pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 10 + +timestep 1.0 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 300 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 1000 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 7 7 7 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair table, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard + (2) pair dpd/ext/tstat, perpetual, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +Per MPI rank memory allocation (min/avg/max) = 3.695 | 3.696 | 3.697 Mbytes + Step Time Temp Press + 0 0 300 5950.2338 + 100 100 301.15012 9090.2244 + 200 200 301.28795 10589.557 + 300 300 293.61974 5971.7781 + 400 400 310.4217 8198.7972 + 500 500 299.89888 9140.3132 + 600 600 305.56607 7783.4481 + 700 700 295.99415 6276.9444 + 800 800 296.50051 5058.1115 + 900 900 288.68499 8637.0269 + 1000 1000 291.17292 6516.4192 +Loop time of 7.57429 on 4 procs for 1000 steps with 2180 atoms + +Performance: 11.407 ns/day, 2.104 hours/ns, 132.026 timesteps/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 7.2745 | 7.3674 | 7.4316 | 2.1 | 97.27 +Neigh | 0.01863 | 0.018866 | 0.019429 | 0.2 | 0.25 +Comm | 0.1123 | 0.17708 | 0.27025 | 13.8 | 2.34 +Output | 0.00019274 | 0.00021224 | 0.00026504 | 0.0 | 0.00 +Modify | 0.0041691 | 0.0042729 | 0.0043136 | 0.1 | 0.06 +Other | | 0.006464 | | | 0.09 + +Nlocal: 545 ave 552 max 531 min +Histogram: 1 0 0 0 0 0 0 0 2 1 +Nghost: 3620.5 ave 3656 max 3584 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Neighs: 65419 ave 66338 max 64104 min +Histogram: 1 0 0 0 1 0 0 0 1 1 + +Total # of neighbors = 261676 +Ave neighs/atom = 120.03486 +Neighbor list builds = 12 +Dangerous builds = 0 +Total wall time: 0:00:07 From 4ad8af629dc08759c3edb79780d0039f42ec9048 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 5 Apr 2022 21:53:29 -0400 Subject: [PATCH 086/130] whitespace --- src/DPD-BASIC/pair_dpd.cpp | 2 +- src/KOKKOS/pair_dpd_ext_kokkos.cpp | 2 +- src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp | 2 +- src/KOKKOS/pair_dpd_kokkos.cpp | 2 +- src/KOKKOS/pair_dpd_tstat_kokkos.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DPD-BASIC/pair_dpd.cpp b/src/DPD-BASIC/pair_dpd.cpp index e988f1521e..b16be8d212 100644 --- a/src/DPD-BASIC/pair_dpd.cpp +++ b/src/DPD-BASIC/pair_dpd.cpp @@ -47,7 +47,7 @@ PairDPD::PairDPD(LAMMPS *lmp) : Pair(lmp) PairDPD::~PairDPD() { if (copymode) return; - + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp index 81b53dfe41..e9bb3510d8 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -359,7 +359,7 @@ void PairDPDExtKokkos::operator() (TagDPDExtKokkostemplate ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); + this->template ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); } } a_f(i,0) += fx; diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp index 23644011ef..8204e2615b 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp @@ -362,7 +362,7 @@ void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkostemplate ev_tally(ev,i,j,0.0,fpair,delx,dely,delz); + this->template ev_tally(ev,i,j,0.0,fpair,delx,dely,delz); } } a_f(i,0) += fx; diff --git a/src/KOKKOS/pair_dpd_kokkos.cpp b/src/KOKKOS/pair_dpd_kokkos.cpp index 6d942f437e..4678ef0bc4 100644 --- a/src/KOKKOS/pair_dpd_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_kokkos.cpp @@ -320,7 +320,7 @@ void PairDPDKokkos::operator() (TagDPDKokkostemplate ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); + this->template ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); } } a_f(i,0) += fx; diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp index d6b9e4d4b5..116895f69c 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp @@ -321,7 +321,7 @@ void PairDPDTstatKokkos::operator() (TagDPDTstatKokkostemplate ev_tally(ev,i,j,0.0,fpair,delx,dely,delz); + this->template ev_tally(ev,i,j,0.0,fpair,delx,dely,delz); } } a_f(i,0) += fx; From e4f62cae9a0af37849c4b5f40f88da7c14551d2c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 5 Apr 2022 22:01:21 -0400 Subject: [PATCH 087/130] integrated added styles into manual --- doc/src/Commands_pair.rst | 8 ++++---- doc/src/pair_dpd.rst | 6 ++++-- doc/src/pair_dpd_ext.rst | 10 ++++++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index 7d8c5c31e8..7a1ed4ee72 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -88,12 +88,12 @@ OPT. * :doc:`coul/tt ` * :doc:`coul/wolf (ko) ` * :doc:`coul/wolf/cs ` - * :doc:`dpd (gio) ` + * :doc:`dpd (giko) ` * :doc:`dpd/fdt ` - * :doc:`dpd/ext ` - * :doc:`dpd/ext/tstat ` + * :doc:`dpd/ext (k) ` + * :doc:`dpd/ext/tstat (k) ` * :doc:`dpd/fdt/energy (k) ` - * :doc:`dpd/tstat (go) ` + * :doc:`dpd/tstat (gko) ` * :doc:`dsmc ` * :doc:`e3b ` * :doc:`drip ` diff --git a/doc/src/pair_dpd.rst b/doc/src/pair_dpd.rst index 8c61c789a6..5bc8cedaed 100644 --- a/doc/src/pair_dpd.rst +++ b/doc/src/pair_dpd.rst @@ -1,20 +1,22 @@ .. index:: pair_style dpd .. index:: pair_style dpd/gpu .. index:: pair_style dpd/intel +.. index:: pair_style dpd/kk .. index:: pair_style dpd/omp .. index:: pair_style dpd/tstat .. index:: pair_style dpd/tstat/gpu +.. index:: pair_style dpd/tstat/kk .. index:: pair_style dpd/tstat/omp pair_style dpd command ====================== -Accelerator Variants: *dpd/gpu*, *dpd/intel*, *dpd/omp* +Accelerator Variants: *dpd/gpu*, *dpd/intel*, *dpd/kk*, *dpd/omp* pair_style dpd/tstat command ============================ -Accelerator Variants: *dpd/tstat/gpu*, *dpd/tstat/omp* +Accelerator Variants: *dpd/tstat/gpu*, *dpd/tstat/kk*, *dpd/tstat/omp* Syntax """""" diff --git a/doc/src/pair_dpd_ext.rst b/doc/src/pair_dpd_ext.rst index 7512f8e688..88395f1c73 100644 --- a/doc/src/pair_dpd_ext.rst +++ b/doc/src/pair_dpd_ext.rst @@ -1,12 +1,18 @@ .. index:: pair_style dpd/ext +.. index:: pair_style dpd/ext/kk .. index:: pair_style dpd/ext/tstat +.. index:: pair_style dpd/ext/tstat/kk pair_style dpd/ext command ========================== +Accelerator Variants: dpd/ext/kk + pair_style dpd/ext/tstat command ================================ +Accelerator Variants: dpd/ext/tstat/kk + Syntax """""" @@ -137,6 +143,10 @@ except that A is not included. ---------- +.. include:: accel_styles.rst + +---------- + **Mixing, shift, table, tail correction, restart, rRESPA info**\ : From cd7f08a8e79c68a2ad8d22d3cff99cf0e36202df Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 6 Apr 2022 09:25:11 -0400 Subject: [PATCH 088/130] support dump_modify for column headers in ADIOS dump styles --- doc/src/dump_modify.rst | 6 +++--- src/ADIOS/dump_atom_adios.cpp | 3 +++ src/ADIOS/dump_custom_adios.cpp | 13 +++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index 4d1fb77b10..5dfde62282 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -381,9 +381,9 @@ performed with dump style *xtc*\ . ---------- The *colname* keyword can be used to change the default header keyword -for dump styles: *atom*, *custom*, and *cfg* and their compressed and -MPIIO variants. The setting for *ID string* replaces the default text -with the provided string. *ID* can be a positive integer when it +for dump styles: *atom*, *custom*, and *cfg* and their compressed, ADIOS, +and MPIIO variants. The setting for *ID string* replaces the default +text with the provided string. *ID* can be a positive integer when it represents the column number counting from the left, a negative integer when it represents the column number from the right (i.e. -1 is the last column/keyword), or a thermo keyword (or compute, fix, property, or diff --git a/src/ADIOS/dump_atom_adios.cpp b/src/ADIOS/dump_atom_adios.cpp index 3e637b02d7..7588b6775b 100644 --- a/src/ADIOS/dump_atom_adios.cpp +++ b/src/ADIOS/dump_atom_adios.cpp @@ -238,6 +238,9 @@ void DumpAtomADIOS::init_style() columnNames = {"id", "type", "xs", "ys", "zs", "ix", "iy", "iz"}; } + for (int icol = 0; icol < (int)columnNames.size(); ++icol) + if (keyword_user[icol].size()) columnNames[icol] = keyword_user[icol]; + // setup function ptrs if (scale_flag == 1 && image_flag == 0 && domain->triclinic == 0) diff --git a/src/ADIOS/dump_custom_adios.cpp b/src/ADIOS/dump_custom_adios.cpp index 263f15349c..82cc4a9c0c 100644 --- a/src/ADIOS/dump_custom_adios.cpp +++ b/src/ADIOS/dump_custom_adios.cpp @@ -214,6 +214,19 @@ void DumpCustomADIOS::write() void DumpCustomADIOS::init_style() { + // assemble column string from defaults and user values + + delete[] columns; + std::string combined; + int icol = 0; + for (auto item : utils::split_words(columns_default)) { + if (combined.size()) combined += " "; + if (keyword_user[icol].size()) combined += keyword_user[icol]; + else combined += item; + ++icol; + } + columns = utils::strdup(combined); + // setup boundary string domain->boundary_string(boundstr); From 2b8b916cba466ac10dc2612f230b38cf3336e05b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 6 Apr 2022 10:08:53 -0400 Subject: [PATCH 089/130] delete unused enums --- src/MPIIO/dump_custom_mpiio.cpp | 11 ----------- src/MPIIO/dump_xyz_mpiio.cpp | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/src/MPIIO/dump_custom_mpiio.cpp b/src/MPIIO/dump_custom_mpiio.cpp index 196a2d0bb9..a911ea1149 100644 --- a/src/MPIIO/dump_custom_mpiio.cpp +++ b/src/MPIIO/dump_custom_mpiio.cpp @@ -39,17 +39,6 @@ using namespace LAMMPS_NS; #define DUMP_BUF_CHUNK_SIZE 16384 #define DUMP_BUF_INCREMENT_SIZE 4096 -// clang-format off -enum{ ID, MOL, TYPE, ELEMENT, MASS, - X, Y, Z, XS, YS, ZS, XSTRI, YSTRI, ZSTRI, XU, YU, ZU, XUTRI, YUTRI, ZUTRI, - XSU, YSU, ZSU, XSUTRI, YSUTRI, ZSUTRI, - IX, IY, IZ, VX, VY, VZ, FX, FY, FZ, - Q, MUX, MUY, MUZ, MU, RADIUS, DIAMETER, - OMEGAX, OMEGAY, OMEGAZ, ANGMOMX, ANGMOMY, ANGMOMZ, - TQX, TQY, TQZ, SPIN, ERADIUS, ERVEL, ERFORCE, - COMPUTE, FIX, VARIABLE }; -enum{ LT, LE, GT, GE, EQ, NEQ }; -// clang-format on /* ---------------------------------------------------------------------- */ DumpCustomMPIIO::DumpCustomMPIIO(LAMMPS *lmp, int narg, char **arg) diff --git a/src/MPIIO/dump_xyz_mpiio.cpp b/src/MPIIO/dump_xyz_mpiio.cpp index c976932b52..c03d71dcb2 100644 --- a/src/MPIIO/dump_xyz_mpiio.cpp +++ b/src/MPIIO/dump_xyz_mpiio.cpp @@ -38,17 +38,6 @@ using namespace LAMMPS_NS; #define DUMP_BUF_CHUNK_SIZE 16384 #define DUMP_BUF_INCREMENT_SIZE 4096 -enum{ID,MOL,TYPE,ELEMENT,MASS, - X,Y,Z,XS,YS,ZS,XSTRI,YSTRI,ZSTRI,XU,YU,ZU,XUTRI,YUTRI,ZUTRI, - XSU,YSU,ZSU,XSUTRI,YSUTRI,ZSUTRI, - IX,IY,IZ, - VX,VY,VZ,FX,FY,FZ, - Q,MUX,MUY,MUZ,MU,RADIUS,DIAMETER, - OMEGAX,OMEGAY,OMEGAZ,ANGMOMX,ANGMOMY,ANGMOMZ, - TQX,TQY,TQZ,SPIN,ERADIUS,ERVEL,ERFORCE, - COMPUTE,FIX,VARIABLE}; -enum{LT,LE,GT,GE,EQ,NEQ}; - /* ---------------------------------------------------------------------- */ DumpXYZMPIIO::DumpXYZMPIIO(LAMMPS *lmp, int narg, char **arg) : From 4bd28cf92090460f4030b12307c64cbd0bfebfbf Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Wed, 6 Apr 2022 15:24:02 -0600 Subject: [PATCH 090/130] altering how plugin mode works --- examples/mdi/in.aimd.driver.plugin | 2 +- examples/mdi/sequence_driver.py | 13 +- src/MDI/library_mdi.cpp | 1 - src/MDI/mdi_command.cpp | 36 +++ src/MDI/mdi_command.h | 48 ++++ src/MDI/mdi_engine.cpp | 366 +++++++++++++++++------------ src/MDI/mdi_engine.h | 29 +-- src/MDI/mdi_plugin.cpp | 28 ++- src/MDI/mdi_plugin.h | 14 +- src/lammps.cpp | 2 + 10 files changed, 344 insertions(+), 195 deletions(-) create mode 100644 src/MDI/mdi_command.cpp create mode 100644 src/MDI/mdi_command.h diff --git a/examples/mdi/in.aimd.driver.plugin b/examples/mdi/in.aimd.driver.plugin index a974bff9df..858e42e2bd 100644 --- a/examples/mdi/in.aimd.driver.plugin +++ b/examples/mdi/in.aimd.driver.plugin @@ -29,6 +29,6 @@ fix_modify 2 energy yes virial yes thermo_style custom step temp pe etotal press vol thermo 1 -mdi/plugin lammps mdi "-role ENGINE -name lammps -method LINK" & +mdi plugin lammps mdi "-role ENGINE -name lammps -method LINK" & infile in.aimd.engine extra "-log log.aimd.engine.plugin" & command "run 5" diff --git a/examples/mdi/sequence_driver.py b/examples/mdi/sequence_driver.py index b04a1c23f2..e53186250c 100644 --- a/examples/mdi/sequence_driver.py +++ b/examples/mdi/sequence_driver.py @@ -137,20 +137,14 @@ def perform_tasks(world,mdicomm,dummy): if mode == "eval": pass elif mode == "run": - print("SENDING INIT_MD") - mdi.MDI_Send_command("@INIT_MD",mdicomm) - print("SENDING NITERATE") - mdi.MDI_Send_command(">NITERATE",mdicomm) - print("SENDING NITERATE data nsteps") + mdi.MDI_Send_command(">NSTEPS",mdicomm) mdi.MDI_Send(nsteps,1,mdi.MDI_INT,mdicomm) - print("SENDING DEFAULT") - mdi.MDI_Send_command("@DEFAULT",mdicomm) + mdi.MDI_Send_command("MD",mdicomm) elif mode == "min": - mdi.MDI_Send_command("@INIT_OPTG",mdicomm) mdi.MDI_Send_command(">TOLERANCE",mdicomm) params = [tol,tol,1000.0,1000.0] mdi.MDI_Send(params,4,mdi.MDI_DOUBLE,mdicomm) - mdi.MDI_Send_command("@DEFAULT",mdicomm) + mdi.MDI_Send_command("OPTG",mdicomm) # request potential energy @@ -311,7 +305,6 @@ if not plugin: # MDI will call back to perform_tasks() if plugin: - #error("Cannot yet run in plugin mode") mdi.MDI_Init(mdiarg) world = MPI.COMM_WORLD plugin_args += " -mdi \"-role ENGINE -name lammps -method LINK\"" diff --git a/src/MDI/library_mdi.cpp b/src/MDI/library_mdi.cpp index 112ce18d2d..4048f805a5 100644 --- a/src/MDI/library_mdi.cpp +++ b/src/MDI/library_mdi.cpp @@ -131,7 +131,6 @@ The function executes a single command from an external MDI driver. int lammps_execute_mdi_command(const char *command, MDI_Comm comm, void *class_obj) { - printf("LIB wrapper command %s\n",command); MDIEngine *mdi_engine = (MDIEngine *) class_obj; return mdi_engine->execute_command(command,comm); } diff --git a/src/MDI/mdi_command.cpp b/src/MDI/mdi_command.cpp new file mode 100644 index 0000000000..720258cc69 --- /dev/null +++ b/src/MDI/mdi_command.cpp @@ -0,0 +1,36 @@ +/* ---------------------------------------------------------------------- + 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. +------------------------------------------------------------------------- */ + +#include "mdi_command.h" + +#include +#include "mdi_engine.h" +#include "mdi_plugin.h" +#include "error.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- + mdi command: engine or plugin +---------------------------------------------------------------------- */ + +void MDICommand::command(int narg, char **arg) +{ + if (narg < 1) error->all(FLERR,"Illegal mdi command"); + + if (strcmp(arg[0],"engine") == 0) { + MDIEngine(lmp,narg-1,&arg[1]); + } else if (strcmp(arg[0],"plugin") == 0) { + MDIPlugin(lmp,narg-1,&arg[1]); + } else error->all(FLERR,"Illegal mdi command"); +} diff --git a/src/MDI/mdi_command.h b/src/MDI/mdi_command.h new file mode 100644 index 0000000000..27ec7442df --- /dev/null +++ b/src/MDI/mdi_command.h @@ -0,0 +1,48 @@ +/* -*- 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 COMMAND_CLASS +// clang-format off +CommandStyle(mdi,MDICommand); +// clang-format on +#else + +#ifndef LMP_MDI_COMMAND_H +#define LMP_MDI_COMMAND_H + +#include "command.h" +#include "mdi.h" + +namespace LAMMPS_NS { + +class MDICommand : public Command { + public: + MDICommand(LAMMPS *lmp) : Command(lmp) {} + + void command(int, char **) override; +}; + +} + +#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. + +*/ diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index e9c5e4f8ec..3130280e30 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -53,19 +53,6 @@ enum{DEFAULT,MD,OPT}; // top-level MDI engine modes enum{TYPE,CHARGE,MASS,COORD,VELOCITY,FORCE,ADDFORCE}; -/* ---------------------------------------------------------------------- - mdi command: engine - may later have other MDI command variants ----------------------------------------------------------------------- */ - -void MDIEngine::command(int narg, char **arg) -{ - if (narg < 1) error->all(FLERR,"Illegal mdi command"); - - if (strcmp(arg[0],"engine") == 0) mdi_engine(narg-1,&arg[1]); - else error->all(FLERR,"Illegal mdi command"); -} - /* ---------------------------------------------------------------------- trigger LAMMPS to start acting as an MDI engine either in standalone mode or plugin mode @@ -75,8 +62,8 @@ void MDIEngine::command(int narg, char **arg) when EXIT command is received, mdi engine command exits ---------------------------------------------------------------------- */ -void MDIEngine::mdi_engine(int narg, char **arg) -{ +MDIEngine::MDIEngine(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) +{ if (narg) error->all(FLERR,"Illegal mdi engine command"); // check requirements for LAMMPS to work with MDI as an engine @@ -159,8 +146,16 @@ void MDIEngine::mdi_engine(int narg, char **arg) sys_natoms = atom->natoms; reallocate(); + nsteps = 0; + + etol = ftol = 1.0e-6; + niterate = -1; + max_eval = std::numeric_limits::max(); + nbytes = -1; + actionflag = 0; + // define MDI commands that LAMMPS engine recognizes mdi_commands(); @@ -186,16 +181,12 @@ void MDIEngine::mdi_engine(int narg, char **arg) // top-level mdi engine only recognizes three nodes // DEFAULT, INIT_MD, INIT_OPTG - printf("MAIN LOOP pre engine_node DEF\n"); engine_node("@DEFAULT"); - printf("MAIN LOOP post engine_node DEF\n"); // MDI commands for dynamics or minimization if (strcmp(mdicmd,"@INIT_MD") == 0) { - printf("MAIN LOOP pre mdi_md\n"); mdi_md(); - printf("MAIN LOOP post mdi_md\n"); if (exit_command) break; } else if (strcmp(mdicmd,"@INIT_OPTG") == 0) { @@ -255,8 +246,6 @@ void MDIEngine::engine_node(const char *node) // read the next command from the driver // all procs call this, but only proc 0 receives the command - printf("PRE MDI RECV_command: node eng/drv: %s/%s\n",node_engine,node_driver); - ierr = MDI_Recv_command(mdicmd,mdicomm); if (ierr) error->all(FLERR,"MDI: Unable to receive command from driver"); @@ -264,8 +253,6 @@ void MDIEngine::engine_node(const char *node) MPI_Bcast(mdicmd,MDI_COMMAND_LENGTH,MPI_CHAR,0,world); - printf("POST MDI RECV_command: node eng/drv: %s/%s\n",mdicmd); - // execute the command execute_command(mdicmd,mdicomm); @@ -314,8 +301,6 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) // receives first, sends second, node commands third // --------------------------------------- - printf("ABOUT to process command %s\n",command); - if (strcmp(command,">CELL") == 0) { receive_cell(); @@ -337,6 +322,12 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) } else if (strcmp(command,">NATOMS") == 0) { receive_natoms(); + } else if (strcmp(command,">NSTEPS") == 0) { + receive_nsteps(); + + } else if (strcmp(command,">TOLERANCE") == 0) { + receive_tolerance(); + } else if (strcmp(command,">TYPES") == 0) { receive_types(); @@ -363,11 +354,11 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) send_double3(COORD); } else if (strcmp(command,"NITERATE") == 0) { - receive_niterate(); - } else if (strcmp(command,">TOLERANCE") == 0) { - receive_tolerance(); } else if (strcmp(command,"CHARGES"); MDI_Register_command("@DEFAULT",">COORDS"); MDI_Register_command("@DEFAULT",">NATOMS"); + MDI_Register_command("@DEFAULT",">NSTEPS"); + MDI_Register_command("@DEFAULT",">TOLERANCE"); MDI_Register_command("@DEFAULT",">TYPES"); MDI_Register_command("@DEFAULT",">VELOCITIES"); + MDI_Register_command("@DEFAULT","MD"); + MDI_Register_command("@DEFAULT","OPTG"); MDI_Register_command("@DEFAULT","@INIT_MD"); MDI_Register_command("@DEFAULT","@INIT_OPTG"); MDI_Register_command("@DEFAULT","EXIT"); @@ -513,7 +516,6 @@ void MDIEngine::mdi_commands() MDI_Register_node("@INIT_MD"); MDI_Register_command("@INIT_MD","<@"); - MDI_Register_command("@INIT_MD",">NITERATE"); MDI_Register_command("@INIT_MD","@"); MDI_Register_command("@INIT_MD","@DEFAULT"); MDI_Register_command("@INIT_MD","@COORDS"); @@ -525,7 +527,6 @@ void MDIEngine::mdi_commands() MDI_Register_node("@INIT_OPTG"); MDI_Register_command("@INIT_OPTG","<@"); - MDI_Register_command("@INIT_OPTG",">TOLERANCE"); MDI_Register_command("@INIT_OPTG","@"); MDI_Register_command("@INIT_OPTG","@DEFAULT"); MDI_Register_command("@INIT_OPTG","@COORDS"); @@ -593,9 +594,7 @@ void MDIEngine::mdi_commands() } /* ---------------------------------------------------------------------- - run MD simulation - either for NITERATE steps or one step at a time - latter is controlled by driver + run MD simulation one step at a time, controlled by driver ---------------------------------------------------------------------- */ void MDIEngine::mdi_md() @@ -611,17 +610,6 @@ void MDIEngine::mdi_md() if (flag_velocities) adjust_velocities(); } - // engine is now at @INIT_MD node - // receive >NITERATE command if driver sends, else niterate = -1 - // any @ command from driver will start the simulation - - niterate = -1; - - printf("PRE @INIT_MD\n"); - engine_node("@INIT_MD"); - printf("POST @INIT_MD %s\n",mdicmd); - if (strcmp(mdicmd,"EXIT") == 0) return; - // add an instance of fix MDI/ENGINE // delete the instance before this method returns @@ -631,47 +619,45 @@ void MDIEngine::mdi_md() mdi_fix->mdi_engine = this; // initialize LAMMPS and setup() the simulation - // set nsteps to niterate if >= 0, else set to 1 update->whichflag = 1; timer->init_timeout(); - update->nsteps = (niterate >= 0) ? niterate : 1; + update->nsteps = 1; update->beginstep = update->firststep = update->ntimestep; update->endstep = update->laststep = update->ntimestep + update->nsteps; lmp->init(); update->integrate->setup(1); + // engine is now at @INIT_MD node + // any @ command from driver will start the simulation + + engine_node("@INIT_MD"); + if (strcmp(mdicmd,"EXIT") == 0) return; + + // run one step at a time forever + // driver triggers exit with @ command other than @COORDS,@FORCES,@ENDSTEP + timer->init(); timer->barrier_start(); - // if niterate >= 0, run for niterate steps - // else if niterate < 0: - // run one step at a time forever - // driver triggers exit with @ command other than @COORDS,@FORCES,@ENDSTEP - - if (niterate >= 0) { - update->integrate->run(niterate); - - } else { - - while (true) { - update->nsteps += 1; - update->laststep += 1; - update->endstep = update->laststep; - output->next = update->ntimestep + 1; - - update->integrate->run(1); - - if (strcmp(mdicmd,"@COORDS") != 0 && - strcmp(mdicmd,"@FORCES") != 0 && - strcmp(mdicmd,"@ENDSTEP") != 0) break; - } + while (true) { + update->nsteps += 1; + update->laststep += 1; + update->endstep = update->laststep; + output->next = update->ntimestep + 1; + + update->integrate->run(1); + + if (strcmp(mdicmd,"@COORDS") != 0 && + strcmp(mdicmd,"@FORCES") != 0 && + strcmp(mdicmd,"@ENDSTEP") != 0) break; } timer->barrier_stop(); update->integrate->cleanup(); + modify->delete_fix("MDI_ENGINE_INTERNAL"); // clear flags @@ -681,9 +667,54 @@ void MDIEngine::mdi_md() } /* ---------------------------------------------------------------------- - perform minimization - either to convergence using >TOLERANCE settings or one iteration at a time - latter is controlled by driver + run MD simulation for >NSTEPS +---------------------------------------------------------------------- */ + +void MDIEngine::md() +{ + // create or update system if requested prior to MD command + + int flag_create = flag_natoms | flag_types; + if (flag_create) create_system(); + else { + if (flag_cell || flag_cell_displ) adjust_box(); + if (flag_charges) adjust_charges(); + if (flag_coords) adjust_coords(); + if (flag_velocities) adjust_velocities(); + } + + // initialize LAMMPS and setup() the simulation + // run the simulation for nsteps + // clean up + + update->whichflag = 1; + timer->init_timeout(); + + update->nsteps = nsteps; + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->ntimestep + update->nsteps; + + lmp->init(); + update->integrate->setup(1); + + timer->init(); + timer->barrier_start(); + + update->integrate->run(nsteps); + + timer->barrier_stop(); + update->integrate->cleanup(); + + // clear flags + + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; + + actionflag = 1; +} + +/* ---------------------------------------------------------------------- + perform minimization one iteration at a time, controlled by driver ---------------------------------------------------------------------- */ void MDIEngine::mdi_optg() @@ -699,16 +730,6 @@ void MDIEngine::mdi_optg() if (flag_velocities) adjust_velocities(); } - // engine is now at @INIT_OPTG node - // receive >TOLERANCE if driver sends - - etol = ftol = 1.0e-6; - niterate = -1; - max_eval = std::numeric_limits::max(); - - engine_node("@INIT_OPTG"); - if (strcmp(mdicmd,"EXIT") == 0) return; - // add an instance of fix MDI/ENGINE // delete the instance before this method returns @@ -718,7 +739,76 @@ void MDIEngine::mdi_optg() mdi_fix->mdi_engine = this; // initialize LAMMPS and setup() the simulation - // set nsteps to niterate if >= 0 via >TOLERANCE, else set to huge value + + update->whichflag = 2; + timer->init_timeout(); + + update->nsteps = (niterate >= 0) ? niterate : max_eval; + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->firststep + update->nsteps; + + update->etol = 0.0; + update->ftol = 0.0; + update->max_eval = std::numeric_limits::max(); + + lmp->init(); + update->minimize->setup(); + + // engine is now at @INIT_OPTG node + // any @ command from driver will start the minimization + + engine_node("@INIT_OPTG"); + if (strcmp(mdicmd,"EXIT") == 0) return; + + // run one iteration at a time forever + // driver triggers exit with @ command other than @COORDS,@FORCES + // two issues with running in this mode: + // @COORDS and @FORCES are not just triggered per min iteration + // but also for line search eng/force evals + // if driver triggers exit on step that is not multiple of thermo output + // then energy/virial not computed, and init(); + timer->barrier_start(); + + while (1) { + update->minimize->run(1); + + if (strcmp(mdicmd,"@COORDS") != 0 && + strcmp(mdicmd,"@FORCES") != 0) break; + } + + timer->barrier_stop(); + update->minimize->cleanup(); + + modify->delete_fix("MDI_ENGINE_INTERNAL"); + + // clear flags + + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; +} + +/* ---------------------------------------------------------------------- + perform minimization to convergence using >TOLERANCE settings +---------------------------------------------------------------------- */ + +void MDIEngine::optg() +{ + // create or update system if requested prior to OPTG command + + int flag_create = flag_natoms | flag_types; + if (flag_create) create_system(); + else { + if (flag_cell || flag_cell_displ) adjust_box(); + if (flag_charges) adjust_charges(); + if (flag_coords) adjust_coords(); + if (flag_velocities) adjust_velocities(); + } + + // initialize LAMMPS and setup() the simulation + // run the minimization using 4 >TOLERANCE parameters + // clean up update->whichflag = 2; timer->init_timeout(); @@ -737,40 +827,17 @@ void MDIEngine::mdi_optg() timer->init(); timer->barrier_start(); - // if niterate >= 0, minimize for at most niterate iterations - // else if niterate < 0: - // run one iteration at a time forever - // driver triggers exit with @ command other than @COORDS,@FORCES - // two issues with running in this mode: - // @COORDS and @FORCES are not triggered per min iteration - // but also for line search evals - // if driver triggers exit on step that is not multiple of thermo output - // then energy/virial not computed, and = 0) { - update->minimize->run(niterate); - - } else { - niterate = std::numeric_limits::max(); - update->etol = 0.0; - update->ftol = 0.0; - - while (1) { - update->minimize->run(1); - - if (strcmp(mdicmd,"@COORDS") != 0 && - strcmp(mdicmd,"@FORCES") != 0) break; - } - } + update->minimize->run(niterate); timer->barrier_stop(); update->minimize->cleanup(); - modify->delete_fix("MDI_ENGINE_INTERNAL"); // clear flags flag_natoms = flag_types = 0; flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; + + actionflag = 1; } /* ---------------------------------------------------------------------- @@ -1036,6 +1103,7 @@ void MDIEngine::adjust_velocities() void MDIEngine::receive_cell() { + actionflag = 0; flag_cell = 1; int ierr = MDI_Recv(sys_cell,9,MDI_DOUBLE,mdicomm); if (ierr) error->all(FLERR, "MDI: >CELL data"); @@ -1060,6 +1128,7 @@ void MDIEngine::receive_cell() void MDIEngine::receive_cell_displ() { + actionflag = 0; flag_cell_displ = 1; int ierr = MDI_Recv(sys_cell_displ,3,MDI_DOUBLE,mdicomm); if (ierr) error->all(FLERR,"MDI: >CELL_DISPLS data"); @@ -1075,6 +1144,7 @@ void MDIEngine::receive_cell_displ() void MDIEngine::receive_charges() { + actionflag = 0; flag_charges = 1; int ierr = MDI_Recv(sys_charges,sys_natoms,MDI_DOUBLE,mdicomm); if (ierr) error->all(FLERR,"MDI: >CHARGES data"); @@ -1087,6 +1157,7 @@ void MDIEngine::receive_charges() void MDIEngine::receive_coords() { + actionflag = 0; flag_coords = 1; int n = 3*sys_natoms; int ierr = MDI_Recv(sys_coords,n,MDI_DOUBLE,mdicomm); @@ -1103,6 +1174,7 @@ void MDIEngine::receive_coords() void MDIEngine::receive_natoms() { + actionflag = 0; flag_natoms = 1; int ierr = MDI_Recv(&sys_natoms,1,MDI_INT,mdicomm); if (ierr) error->all(FLERR,"MDI: >NATOMS data"); @@ -1111,12 +1183,47 @@ void MDIEngine::receive_natoms() reallocate(); } +/* ---------------------------------------------------------------------- + >NSTEPS command + receive nsteps for timestepping +---------------------------------------------------------------------- */ + +void MDIEngine::receive_nsteps() +{ + int ierr = MDI_Recv(&nsteps,1,MDI_INT,mdicomm); + if (ierr) error->all(FLERR,"MDI: >NSTEPS data"); + MPI_Bcast(&nsteps,1,MPI_INT,0,world); + if (nsteps < 0) error->all(FLERR,"MDI received nsteps < 0"); +} + +/* ---------------------------------------------------------------------- + >TOLERANCE command + receive 4 minimization tolerance params +---------------------------------------------------------------------- */ + +void MDIEngine::receive_tolerance() +{ + double params[4]; + int ierr = MDI_Recv(params,4,MDI_DOUBLE,mdicomm); + if (ierr) error->all(FLERR,"MDI: >TOLERANCE data"); + MPI_Bcast(params,4,MPI_INT,0,world); + + etol = params[0]; + ftol = params[1]; + niterate = static_cast (params[2]); + max_eval = static_cast (params[3]); + + if (etol < 0.0 || ftol < 0.0 || niterate < 0 || max_eval < 0) + error->all(FLERR,"MDI received invalid toleranace parameters"); +} + /* ---------------------------------------------------------------------- >TYPES command ---------------------------------------------------------------------- */ void MDIEngine::receive_types() { + actionflag = 0; flag_types = 1; int ierr = MDI_Recv(sys_types,sys_natoms,MDI_INT,mdicomm); if (ierr) error->all(FLERR,"MDI: >TYPES data"); @@ -1129,6 +1236,7 @@ void MDIEngine::receive_types() void MDIEngine::receive_velocities() { + actionflag = 0; flag_velocities = 1; int n = 3*sys_natoms; int ierr = MDI_Recv(sys_velocities,n,MDI_DOUBLE,mdicomm); @@ -1139,9 +1247,9 @@ void MDIEngine::receive_velocities() } /* ---------------------------------------------------------------------- - >FORCES command receive vector of 3 doubles for all atoms atoms are ordered by atomID, 1 to Natoms + used by >FORCES command ---------------------------------------------------------------------- */ void MDIEngine::receive_double3(int which) @@ -1545,36 +1653,6 @@ void MDIEngine::infile() delete [] infile; } -/* ---------------------------------------------------------------------- - >NITERATE command - receive number of iterations for timestepping ----------------------------------------------------------------------- */ - -void MDIEngine::receive_niterate() -{ - int ierr = MDI_Recv(&niterate,1,MDI_INT,mdicomm); - if (ierr) error->all(FLERR,"MDI: >NITERATE data"); - MPI_Bcast(&niterate,1,MPI_INT,0,world); -} - -/* ---------------------------------------------------------------------- - >TOLERANCE command - receive 4 minimization tolerance params ----------------------------------------------------------------------- */ - -void MDIEngine::receive_tolerance() -{ - double params[4]; - int ierr = MDI_Recv(params,4,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: >TOLERANCE data"); - MPI_Bcast(params,4,MPI_INT,0,world); - - etol = params[0]; - ftol = params[1]; - niterate = static_cast (params[2]); - max_eval = static_cast (params[3]); -} - /* ---------------------------------------------------------------------- #include "error.h" #include "fix_mdi_aimd.h" #include "input.h" #include "modify.h" -#include +#include using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- - mdi command: plugin - may later have other MDI command variants + trigger LAMMPS to load an MDI plugin engine + after loading the plugin library, it executes a LAMMPS command such as "run" + the command will use other LAMMPS commands, such as fix mdi/aimd + which act as an MDI driver, issuing MDI commands to the engine + when MDI_Launch_plugin() exits, the engine is shut down and + this class is destroyed ---------------------------------------------------------------------- */ -void MDIPlugin::command(int narg, char **arg) +MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) { - if (narg < 1) error->all(FLERR,"Illegal mdi/plugin command"); + if (narg < 1) error->all(FLERR,"Illegal mdi plugin command"); char *plugin_name = arg[0]; @@ -46,35 +51,36 @@ void MDIPlugin::command(int narg, char **arg) int iarg = 1; while (iarg < narg) { if (strcmp(arg[iarg],"mdi") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal mdi/plugin command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal mdi plugin command"); mdi_arg = arg[iarg+1]; iarg += 2; } else if (strcmp(arg[iarg],"infile") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal mdi/plugin command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal mdi plugin command"); infile_arg = arg[iarg+1]; iarg += 2; } else if (strcmp(arg[iarg],"extra") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal mdi/plugin command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal mdi plugin command"); extra_arg = arg[iarg+1]; iarg += 2; } else if (strcmp(arg[iarg],"command") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal mdi/plugin command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal mdi plugin command"); int n = strlen(arg[iarg+1]) + 1; lammps_command = new char[n]; strcpy(lammps_command,arg[iarg+1]); iarg += 2; - } else error->all(FLERR,"Illegal mdi/plugin command"); + } else error->all(FLERR,"Illegal mdi plugin command"); } // error checks if (!mdi_arg || !infile_arg || !lammps_command) - error->all(FLERR,"MDI/plugin must specify mdi, infile, command keywords"); + error->all(FLERR,"MDI plugin must specify mdi, infile, command keywords"); // build full plugin_args string for args to plugin library int n = strlen(mdi_arg) + strlen(infile_arg) + strlen(extra_arg) + 16; char *plugin_args = new char[n]; + plugin_args[0] = 0; strcat(plugin_args,"-mdi \""); strcat(plugin_args,mdi_arg); strcat(plugin_args,"\" -in "); diff --git a/src/MDI/mdi_plugin.h b/src/MDI/mdi_plugin.h index 54bb1c5f4b..fe97c319e5 100644 --- a/src/MDI/mdi_plugin.h +++ b/src/MDI/mdi_plugin.h @@ -11,24 +11,17 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef COMMAND_CLASS -// clang-format off -CommandStyle(mdi/plugin,MDIPlugin); -// clang-format on -#else - #ifndef LMP_MDI_PLUGIN_H #define LMP_MDI_PLUGIN_H -#include "command.h" +#include "pointers.h" #include "mdi.h" namespace LAMMPS_NS { -class MDIPlugin : public Command { +class MDIPlugin : protected Pointers { public: - MDIPlugin(LAMMPS *lmp) : Command(lmp) {} - void command(int, char **) override; + MDIPlugin(class LAMMPS *, int, char **); private: char *lammps_command; @@ -39,7 +32,6 @@ class MDIPlugin : public Command { } -#endif #endif /* ERROR/WARNING messages: diff --git a/src/lammps.cpp b/src/lammps.cpp index c74983be43..64477476cc 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -122,6 +122,8 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : modify(nullptr), group(nullptr), output(nullptr), timer(nullptr), kokkos(nullptr), atomKK(nullptr), memoryKK(nullptr), python(nullptr), citeme(nullptr) { + printf("LAMMPS init %d %s %s\n",narg,arg[1],arg[2]); + memory = new Memory(this); error = new Error(this); universe = new Universe(this,communicator); From b1e92c9ec6ea1487f951e0b8e1225f3d5ceef015 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 6 Apr 2022 17:38:25 -0400 Subject: [PATCH 091/130] update YAML reading python example to read faster using libyaml. --- doc/src/Howto_structured_data.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/src/Howto_structured_data.rst b/doc/src/Howto_structured_data.rst index 56a1778ece..f18fda4a8c 100644 --- a/doc/src/Howto_structured_data.rst +++ b/doc/src/Howto_structured_data.rst @@ -79,6 +79,10 @@ This data can be extracted and parsed from a log file using python with: .. code-block:: python import re, yaml + try: + from yaml import CSafeLoader as Loader, CSafeDumper as Dumper + except ImportError: + from yaml import SafeLoader, SafeDumper docs = "" with open("log.lammps") as f: @@ -86,7 +90,7 @@ This data can be extracted and parsed from a log file using python with: m = re.search(r"^(keywords:.*$|data:$|---$|\.\.\.$| - \[.*\]$)", line) if m: docs += m.group(0) + '\n' - thermo = list(yaml.load_all(docs, Loader=yaml.SafeLoader)) + thermo = list(yaml.load_all(docs, Loader=Loader)) print("Number of runs: ", len(thermo)) print(thermo[1]['keywords'][4], ' = ', thermo[1]['data'][2][4]) From 207b34ae122ac057b9d651e7e7935f5aeb628d64 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Wed, 6 Apr 2022 16:38:58 -0600 Subject: [PATCH 092/130] allow for pre-timestepping comm with engine, e.g. for force eval --- src/MDI/mdi_engine.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 3130280e30..41a75ba2c0 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -628,7 +628,6 @@ void MDIEngine::mdi_md() update->endstep = update->laststep = update->ntimestep + update->nsteps; lmp->init(); - update->integrate->setup(1); // engine is now at @INIT_MD node // any @ command from driver will start the simulation @@ -639,6 +638,8 @@ void MDIEngine::mdi_md() // run one step at a time forever // driver triggers exit with @ command other than @COORDS,@FORCES,@ENDSTEP + update->integrate->setup(1); + timer->init(); timer->barrier_start(); @@ -752,7 +753,6 @@ void MDIEngine::mdi_optg() update->max_eval = std::numeric_limits::max(); lmp->init(); - update->minimize->setup(); // engine is now at @INIT_OPTG node // any @ command from driver will start the minimization @@ -768,6 +768,8 @@ void MDIEngine::mdi_optg() // if driver triggers exit on step that is not multiple of thermo output // then energy/virial not computed, and minimize->setup(); + timer->init(); timer->barrier_start(); From e944ecd1c222a2a1b72969b8dfed9c99871035d4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 6 Apr 2022 19:10:16 -0400 Subject: [PATCH 093/130] correct docs --- doc/src/dump_modify.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index 5dfde62282..4bc852ea36 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -29,7 +29,7 @@ Syntax *colname* values = ID string, or *default* string = new column header name ID = integer from 1 to N, or integer from -1 to -N, where N = # of quantities being output - *or* a thermo keyword or reference to compute, fix, property or variable. + *or* a custom dump keyword or reference to compute, fix, property or variable. *delay* arg = Dstep Dstep = delay output until this timestep *element* args = E1 E2 ... EN, where N = # of atom types @@ -47,7 +47,7 @@ Syntax *format* args = *line* string, *int* string, *float* string, ID string, or *none* string = C-style format string ID = integer from 1 to N, or integer from -1 to -N, where N = # of quantities being output - *or* a thermo keyword or reference to compute, fix, property or variable. + *or* a custom dump keyword or reference to compute, fix, property or variable. *header* arg = *yes* or *no* *yes* to write the header *no* to not write the header @@ -386,7 +386,7 @@ and MPIIO variants. The setting for *ID string* replaces the default text with the provided string. *ID* can be a positive integer when it represents the column number counting from the left, a negative integer when it represents the column number from the right (i.e. -1 is the last -column/keyword), or a thermo keyword (or compute, fix, property, or +column/keyword), or a custom dump keyword (or compute, fix, property, or variable reference) and then it replaces the string for that specific keyword. For *atom* dump styles only the keywords "id", "type", "x", "y", "z", "ix", "iy", "iz" can be accessed via string regardless of From 348ee5299e5d5d719652d5c52c7d8ae9cfdba3f8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 6 Apr 2022 19:11:55 -0400 Subject: [PATCH 094/130] implement a dump style yaml --- doc/src/dump.rst | 79 +++++++++++++++++-- doc/src/dump_modify.rst | 4 +- src/.gitignore | 2 + src/EXTRA-DUMP/dump_yaml.cpp | 143 +++++++++++++++++++++++++++++++++++ src/EXTRA-DUMP/dump_yaml.h | 89 ++++++++++++++++++++++ src/thermo.h | 1 + 6 files changed, 309 insertions(+), 9 deletions(-) create mode 100644 src/EXTRA-DUMP/dump_yaml.cpp create mode 100644 src/EXTRA-DUMP/dump_yaml.h diff --git a/doc/src/dump.rst b/doc/src/dump.rst index c94813a41e..fdf31bbd06 100644 --- a/doc/src/dump.rst +++ b/doc/src/dump.rst @@ -36,7 +36,7 @@ Syntax * ID = user-assigned name for the dump * group-ID = ID of the group of atoms to be dumped -* style = *atom* or *atom/gz* or *atom/zstd or *atom/mpiio* or *cfg* or *cfg/gz* or *cfg/zstd* or *cfg/mpiio* or *custom* or *custom/gz* or *custom/zstd* or *custom/mpiio* or *dcd* or *h5md* or *image* or *local* or *local/gz* or *local/zstd* or *molfile* or *movie* or *netcdf* or *netcdf/mpiio* or *vtk* or *xtc* or *xyz* or *xyz/gz* or *xyz/zstd* or *xyz/mpiio* +* style = *atom* or *atom/gz* or *atom/zstd or *atom/mpiio* or *cfg* or *cfg/gz* or *cfg/zstd* or *cfg/mpiio* or *custom* or *custom/gz* or *custom/zstd* or *custom/mpiio* or *dcd* or *h5md* or *image* or *local* or *local/gz* or *local/zstd* or *molfile* or *movie* or *netcdf* or *netcdf/mpiio* or *vtk* or *xtc* or *xyz* or *xyz/gz* or *xyz/zstd* or *xyz/mpiio* or *yaml* * N = dump every this many timesteps * file = name of file to write dump info to * args = list of arguments for a particular style @@ -68,8 +68,9 @@ Syntax *xyz/gz* args = none *xyz/zstd* args = none *xyz/mpiio* args = none + *yaml* args = same as *custom* args, see below -* *custom* or *custom/gz* or *custom/zstd* or *custom/mpiio* or *netcdf* or *netcdf/mpiio* args = list of atom attributes +* *custom* or *custom/gz* or *custom/zstd* or *custom/mpiio* or *netcdf* or *netcdf/mpiio* or *yaml* args = list of atom attributes .. parsed-literal:: @@ -386,6 +387,70 @@ from using the (numerical) atom type to an element name (or some other label). This will help many visualization programs to guess bonds and colors. +Dump style *yaml* has the same command syntax as style *custom* and +writes YAML format files that can be easily parsed by a variety of data +processing tools and programming languages. Each timestep will be +written as a YAML "document" (i.e. starts with "---" and ends with +"..."). The style supports writing one file per timestep through the +"\*" wildcard but not multi-processor outputs with the "%" token in the +filename. In addition to per-atom data, :doc:`thermo ` data can +be included in the *yaml* style dump file using the :doc:`dump_modify +thermo yes `. The data included in the dump file uses the +"thermo" tag and is otherwise identical to data specified by the +:doc:`thermo_style ` command. + +Below is an example for a YAML format dump created by the following commands. + +.. code-block:: LAMMPS + + dump out all yaml 100 dump.yaml id type x y z vx vy vz ix iy iz + dump_modify out time yes units yes thermo yes format 1 %5d format "% 10.6e" + +The tags "time", "units", and "thermo" are optional and enabled by the +dump_modify command. The list under the "box" tag has 3 lines for +orthogonal boxes and 4 lines with triclinic boxes, where the first 3 are +the box boundaries and the 4th the three tilt factors (xy, xz, yz). The +"thermo" data follows the format of the *yaml* thermo style. The +"keywords" tag lists the per-atom properties contained in the "data" +columns, which contain a list with one line per atom. The keywords may +be renamed using the dump_modify command same as for the *custom* dump +style. + +.. code-block:: yaml + + --- + timestep: 0 + units: lj + time: 0 + natoms: 4000 + boundary: [ p, p, p, p, p, p, ] + thermo: + - keywords: [ Step, Temp, E_pair, E_mol, TotEng, Press, ] + - data: [ 0, 0, -27093.472213010766, 0, 0, 0, ] + box: + - [ 0, 16.795961913825074 ] + - [ 0, 16.795961913825074 ] + - [ 0, 16.795961913825074 ] + - [ 0, 0, 0 ] + keywords: [ id, type, x, y, z, vx, vy, vz, ix, iy, iz, ] + data: + - [ 1 , 1 , 0.000000e+00 , 0.000000e+00 , 0.000000e+00 , -1.841579e-01 , -9.710036e-01 , -2.934617e+00 , 0 , 0 , 0, ] + - [ 2 , 1 , 8.397981e-01 , 8.397981e-01 , 0.000000e+00 , -1.799591e+00 , 2.127197e+00 , 2.298572e+00 , 0 , 0 , 0, ] + - [ 3 , 1 , 8.397981e-01 , 0.000000e+00 , 8.397981e-01 , -1.807682e+00 , -9.585130e-01 , 1.605884e+00 , 0 , 0 , 0, ] + + [...] + ... + --- + timestep: 100 + units: lj + time: 0.5 + + [...] + + ... + +---------- + Note that *atom*, *custom*, *dcd*, *xtc*, and *xyz* style dump files can be read directly by `VMD `_, a popular molecular viewing program. @@ -427,9 +492,9 @@ If a "%" character appears in the filename, then each of P processors writes a portion of the dump file, and the "%" character is replaced with the processor ID from 0 to P-1. For example, tmp.dump.% becomes tmp.dump.0, tmp.dump.1, ... tmp.dump.P-1, etc. This creates smaller -files and can be a fast mode of output on parallel machines that -support parallel I/O for output. This option is not available for the -*dcd*, *xtc*, and *xyz* styles. +files and can be a fast mode of output on parallel machines that support +parallel I/O for output. This option is **not** available for the *dcd*, +*xtc*, *xyz*, and *yaml* styles. By default, P = the number of processors meaning one file per processor, but P can be set to a smaller value via the *nfile* or @@ -722,8 +787,8 @@ are part of the MPIIO package. They are only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. -The *xtc* and *dcd* styles are part of the EXTRA-DUMP package. They -are only enabled if LAMMPS was built with that package. See the +The *xtc*, *dcd* and *yaml* styles are part of the EXTRA-DUMP package. +They are only enabled if LAMMPS was built with that package. See the :doc:`Build package ` page for more info. Related commands diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index 4bc852ea36..9e3f7f738d 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -712,8 +712,8 @@ run, this option is ignored since the output is already balanced. ---------- -The *thermo* keyword only applies the dump *netcdf* style. It -triggers writing of :doc:`thermo ` information to the dump file +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 `. diff --git a/src/.gitignore b/src/.gitignore index 8803d8a7e3..30eb498043 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -600,6 +600,8 @@ /dump_xyz_mpiio.h /dump_xyz_zstd.cpp /dump_xyz_zstd.h +/dump_yaml.cpp +/dump_yaml.h /dynamical_matrix.cpp /dynamical_matrix.h /ewald.cpp diff --git a/src/EXTRA-DUMP/dump_yaml.cpp b/src/EXTRA-DUMP/dump_yaml.cpp new file mode 100644 index 0000000000..d6bf27885d --- /dev/null +++ b/src/EXTRA-DUMP/dump_yaml.cpp @@ -0,0 +1,143 @@ +/* ---------------------------------------------------------------------- + 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. +------------------------------------------------------------------------- */ + +#include "dump_yaml.h" + +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "output.h" +#include "thermo.h" +#include "update.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ +DumpYAML::DumpYAML(class LAMMPS *_lmp, int narg, char **args) : + DumpCustom(_lmp, narg, args), thermo(false) +{ + buffer_allow = 0; + buffer_flag = 0; +} + +/* ---------------------------------------------------------------------- */ + +void DumpYAML::init_style() +{ + if (binary) error->all(FLERR, "Dump style yaml does not support binary output"); + if (multiproc) error->all(FLERR, "Dump style yaml does not support multi-processor output"); + + DumpCustom::init_style(); +} + +/* ---------------------------------------------------------------------- */ + +void DumpYAML::write() +{ + // temporarily enable so write_header() is called + // by all MPI ranks to compute thermo data + if (thermo) filewriter = 1; + + Dump::write(); +} + +/* ---------------------------------------------------------------------- */ + +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: [ "; + + 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 += "]\n"; + MPI_Barrier(world); + } + + if (comm->me == 0) { + const std::string boundary(boundstr); + fmt::print(fp, "---\ntimestep: {}\n", update->ntimestep); + if (unit_flag) fmt::print(fp, "units: {}\n", update->unit_style); + if (time_flag) fmt::print(fp, "time: {:.16g}\n", compute_time()); + + fmt::print(fp, "natoms: {}\n", ndump); + fputs("boundary: [ ", fp); + for (const auto bflag : boundary) { + if (bflag == ' ') continue; + fmt::print(fp, "{}, ", bflag); + } + fputs("]\n", fp); + + if (thermo) fmt::print(fp, thermo_data); + + fmt::print(fp, "box:\n - [ {}, {} ]\n", boxxlo, boxxhi); + fmt::print(fp, " - [ {}, {} ]\n", boxylo, boxyhi); + fmt::print(fp, " - [ {}, {} ]\n", boxzlo, boxzhi); + if (domain->triclinic) fmt::print(fp, " - [ {}, {}, {} ]\n", boxxy, boxxz, boxyz); + + fmt::print(fp, "keywords: [ "); + for (const auto &item : utils::split_words(columns)) fmt::print(fp, "{}, ", item); + fputs(" ]\ndata:\n", fp); + } else // reset so that the remainder of the output is not multi-proc + filewriter = 0; +} + +/* ---------------------------------------------------------------------- */ + +void DumpYAML::write_data(int n, double *mybuf) +{ + int m = 0; + for (int i = 0; i < n; i++) { + fputs(" - [ ", fp); + for (int j = 0; j < nfield; j++) { + if (vtype[j] == Dump::INT) + fprintf(fp, vformat[j], static_cast(mybuf[m])); + else if (vtype[j] == Dump::DOUBLE) + fprintf(fp, vformat[j], mybuf[m]); + else if (vtype[j] == Dump::STRING) + fprintf(fp, vformat[j], typenames[(int) mybuf[m]]); + else if (vtype[j] == Dump::BIGINT) + fprintf(fp, vformat[j], static_cast(mybuf[m])); + m++; + fputs(", ", fp); + } + fputs("]\n", fp); + } + fputs("...\n", fp); +} + +/* ---------------------------------------------------------------------- */ + +int DumpYAML::modify_param(int narg, char **arg) +{ + int n = DumpCustom::modify_param(narg, arg); + if (n > 0) return n; + + if (strcmp(arg[0], "thermo") == 0) { + if (narg < 2) error->all(FLERR, "expected 'yes' or 'no' after 'thermo' keyword."); + thermo = utils::logical(FLERR, arg[1], false, lmp) == 1; + return 2; + } else + return 0; +} diff --git a/src/EXTRA-DUMP/dump_yaml.h b/src/EXTRA-DUMP/dump_yaml.h new file mode 100644 index 0000000000..e9717ea0b3 --- /dev/null +++ b/src/EXTRA-DUMP/dump_yaml.h @@ -0,0 +1,89 @@ +/* -*- 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 DUMP_CLASS +// clang-format off +DumpStyle(yaml,DumpYAML); +// clang-format on +#else + +#ifndef LMP_DUMP_YAML_H +#define LMP_DUMP_YAML_H + +#include "dump_custom.h" + +namespace LAMMPS_NS { + +class DumpYAML : public DumpCustom { + public: + DumpYAML(class LAMMPS *, int, char **); + +protected: + bool thermo; + + void init_style() override; + void write() override; + void write_header(bigint) override; + void write_data(int, double *) override; + + int modify_param(int, char **) override; +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Cannot open dump file %s + +The output file for the dump command cannot be opened. Check that the +path and name are correct. + +E: Too much per-proc info for dump + +Number of local atoms times number of columns must fit in a 32-bit +integer for dump. + +E: Dump_modify format line is too short + +UNDOCUMENTED + +E: Could not find dump custom compute ID + +Self-explanatory. + +E: Could not find dump custom fix ID + +Self-explanatory. + +E: Dump custom and fix not computed at compatible times + +The fix must produce per-atom quantities on timesteps that dump custom +needs them. + +E: Could not find dump custom variable name + +Self-explanatory. + +E: Region ID for dump custom does not exist + +Self-explanatory. + +U: Dump_modify format string is too short + +There are more fields to be dumped in a line of output than your +format string specifies. + +*/ diff --git a/src/thermo.h b/src/thermo.h index 9d0fefbc56..c36eac3d8f 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -23,6 +23,7 @@ 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; From 58ecf03e5da37321b41d284d13867cc64de511aa Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 7 Apr 2022 00:37:18 -0400 Subject: [PATCH 095/130] correct yaml import --- doc/src/Howto_structured_data.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/Howto_structured_data.rst b/doc/src/Howto_structured_data.rst index f18fda4a8c..b320e87279 100644 --- a/doc/src/Howto_structured_data.rst +++ b/doc/src/Howto_structured_data.rst @@ -82,7 +82,7 @@ This data can be extracted and parsed from a log file using python with: try: from yaml import CSafeLoader as Loader, CSafeDumper as Dumper except ImportError: - from yaml import SafeLoader, SafeDumper + from yaml import SafeLoader as Loader, SafeDumper as Dumper docs = "" with open("log.lammps") as f: From 082254455b4ada187abdcae743e9986ab0481fa4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 7 Apr 2022 00:29:54 -0400 Subject: [PATCH 096/130] improve confusing error messages --- src/POEMS/fix_poems.cpp | 4 +++- src/RIGID/fix_rigid.cpp | 3 ++- src/RIGID/fix_rigid_small.cpp | 3 ++- src/modify.cpp | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index d2df9b0159..7ac3570f2f 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -356,7 +356,9 @@ void FixPOEMS::init() for (auto ifix : modify->get_fix_list()) { if (utils::strmatch(ifix->style, "^poems")) pflag = true; if (pflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag) - if (comm->me == 0) error->warning(FLERR, "Fix {} alters forces after fix poems", ifix->id); + if (comm->me == 0) + error->warning(FLERR,"Fix {} with ID {} alters forces after fix poems", + ifix->style, ifix->id); } } diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 6b211d05bf..780dbd66f5 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -693,7 +693,8 @@ void FixRigid::init() for (auto ifix : modify->get_fix_list()) { if (ifix->rigid_flag) rflag = true; if ((comm->me == 0) && rflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag) - error->warning(FLERR,"Fix {} alters forces after fix rigid", ifix->id); + error->warning(FLERR,"Fix {} with ID {} alters forces after fix rigid", + ifix->style, ifix->id); } } diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 5c524c832b..45aadd845f 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -538,7 +538,8 @@ void FixRigidSmall::init() for (auto ifix : modify->get_fix_list()) { if (ifix->rigid_flag) rflag = true; if ((comm->me == 0) && rflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag) - error->warning(FLERR,"Fix {} alters forces after fix rigid", ifix->id); + error->warning(FLERR,"Fix {} with ID {} alters forces after fix rigid/small", + ifix->style, ifix->id); } } diff --git a/src/modify.cpp b/src/modify.cpp index 7c6f8e4ae3..7554079e2a 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -249,11 +249,11 @@ void Modify::init() for (i = 0; i < nfix; i++) if (!fix[i]->dynamic_group_allow && group->dynamic[fix[i]->igroup]) - error->all(FLERR, "Fix {} does not allow use with a dynamic group", fix[i]->id); + error->all(FLERR, "Fix {} does not allow use with a dynamic group", fix[i]->style); for (i = 0; i < ncompute; i++) if (!compute[i]->dynamic_group_allow && group->dynamic[compute[i]->igroup]) - error->all(FLERR, "Compute {} does not allow use with a dynamic group", compute[i]->id); + error->all(FLERR, "Compute {} does not allow use with a dynamic group", compute[i]->style); // warn if any particle is time integrated more than once From 601bdadf447a9a6f5a6337d8e94653858c27ed33 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 7 Apr 2022 02:05:05 -0400 Subject: [PATCH 097/130] update for recent changes in thermo output --- python/lammps/formats.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/lammps/formats.py b/python/lammps/formats.py index 641e17be3e..f7a7a4eb83 100644 --- a/python/lammps/formats.py +++ b/python/lammps/formats.py @@ -46,14 +46,15 @@ class LogFile: for line in f: if "ERROR" in line or "exited on signal" in line: self.errors.append(line) - elif line.startswith('Step '): + + elif re.match(r'^ *Step ', line): in_thermo = True in_data_section = True keys = line.split() current_run = {} for k in keys: current_run[k] = [] - elif line.startswith('---------------- Step'): + elif re.match(r'^------* Step ', line): if not in_thermo: current_run = {'Step': [], 'CPU': []} in_thermo = True From 98b908387f083735884f89d79c1dbb25d2e715b0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 7 Apr 2022 02:05:47 -0400 Subject: [PATCH 098/130] add unit test for yaml style thermo output and updated logfile class --- examples/README | 1 + examples/yaml/in.yaml | 37 +++++++ examples/yaml/log.7Apr22.yaml.g++.1 | 151 ++++++++++++++++++++++++++++ python/lammps/formats.py | 38 +++++-- unittest/python/python-formats.py | 22 ++++ 5 files changed, 243 insertions(+), 6 deletions(-) create mode 100644 examples/yaml/in.yaml create mode 100644 examples/yaml/log.7Apr22.yaml.g++.1 diff --git a/examples/README b/examples/README index 0c09b6d847..d9637af5c2 100644 --- a/examples/README +++ b/examples/README @@ -118,6 +118,7 @@ ttm: two-temeperature model examples vashishta: models using the Vashishta potential voronoi: Voronoi tesselation via compute voronoi/atom command wall: use of reflective walls with different stochastic models +yaml: demonstrates use of yaml thermo and dump styles Here is how you might run and visualize one of the sample problems: diff --git a/examples/yaml/in.yaml b/examples/yaml/in.yaml new file mode 100644 index 0000000000..28660751c8 --- /dev/null +++ b/examples/yaml/in.yaml @@ -0,0 +1,37 @@ +# 3d Lennard-Jones melt + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z + +units lj +atom_style atomic + +lattice fcc 0.8442 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 20 check no + +fix 1 all nve +thermo_style yaml +thermo 10 + +dump 1 all yaml 25 dump.yaml id type x y z ix iy iz vx vy vz +dump_modify 1 sort id thermo yes units yes time yes format 1 %5d format float "% 12.8e" format int %2d + +run 100 + +run 100 diff --git a/examples/yaml/log.7Apr22.yaml.g++.1 b/examples/yaml/log.7Apr22.yaml.g++.1 new file mode 100644 index 0000000000..0c39dbe6a3 --- /dev/null +++ b/examples/yaml/log.7Apr22.yaml.g++.1 @@ -0,0 +1,151 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# 3d Lennard-Jones melt + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0 0 0) to (33.591924 33.591924 33.591924) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 32000 atoms + using lattice units in orthogonal box = (0 0 0) to (33.591924 33.591924 33.591924) + create_atoms CPU = 0.003 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 20 check no + +fix 1 all nve +thermo_style yaml +thermo 10 + +dump 1 all yaml 25 dump.yaml id type x y z ix iy iz vx vy vz +dump_modify 1 sort id thermo yes units yes time yes format 1 %5d format float "% 12.8e" format int %2d + +run 100 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 20 steps, delay 0 steps, check no + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 24 24 24 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 20.56 | 20.56 | 20.56 Mbytes +--- +keywords: [Step, Temp, KinEng, PotEng, E_bond, E_angle, E_dihed, E_impro, E_vdwl, E_coul, E_long, Press, ] +data: + - [0, 1.44000000000001, 2.15993250000001, -6.77336805323422, 0, 0, 0, 0, -6.77336805323422, 0, 0, -5.01970725908556, ] + - [10, 1.12539487029313, 1.68803955255514, -6.30005271976029, 0, 0, 0, 0, -6.30005271976029, 0, 0, -2.55968522600129, ] + - [20, 0.625793798302192, 0.938661363368992, -5.55655653922756, 0, 0, 0, 0, -5.55655653922756, 0, 0, 0.973517658007722, ] + - [30, 0.745927295413064, 1.11885597777762, -5.73951278150759, 0, 0, 0, 0, -5.73951278150759, 0, 0, 0.339284096694852, ] + - [40, 0.731026217827733, 1.09650505988764, -5.71764564663628, 0, 0, 0, 0, -5.71764564663628, 0, 0, 0.388973418756238, ] + - [50, 0.740091517740786, 1.11010258482128, -5.73150426762886, 0, 0, 0, 0, -5.73150426762886, 0, 0, 0.335273324523691, ] + - [60, 0.750500641591031, 1.12571578266897, -5.74713299283555, 0, 0, 0, 0, -5.74713299283555, 0, 0, 0.26343139026926, ] + - [70, 0.755436366857812, 1.13311913920702, -5.75480059117447, 0, 0, 0, 0, -5.75480059117447, 0, 0, 0.224276619217515, ] + - [80, 0.759974280364828, 1.13992579675285, -5.76187162670983, 0, 0, 0, 0, -5.76187162670983, 0, 0, 0.191626237124102, ] + - [90, 0.760464250735042, 1.14066072934081, -5.76280209529731, 0, 0, 0, 0, -5.76280209529731, 0, 0, 0.189478083345243, ] + - [100, 0.757453103239936, 1.13614414924569, -5.75850548601596, 0, 0, 0, 0, -5.75850548601596, 0, 0, 0.207261053624723, ] +... +Loop time of 1.89046 on 1 procs for 100 steps with 32000 atoms + +Performance: 22851.622 tau/day, 52.897 timesteps/s +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.2896 | 1.2896 | 1.2896 | 0.0 | 68.22 +Neigh | 0.17687 | 0.17687 | 0.17687 | 0.0 | 9.36 +Comm | 0.014543 | 0.014543 | 0.014543 | 0.0 | 0.77 +Output | 0.37678 | 0.37678 | 0.37678 | 0.0 | 19.93 +Modify | 0.028638 | 0.028638 | 0.028638 | 0.0 | 1.51 +Other | | 0.003975 | | | 0.21 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19657 ave 19657 max 19657 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1.20283e+06 ave 1.20283e+06 max 1.20283e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1202833 +Ave neighs/atom = 37.588531 +Neighbor list builds = 5 +Dangerous builds not checked + +run 100 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 20.57 | 20.57 | 20.57 Mbytes +--- +keywords: [Step, Temp, KinEng, PotEng, E_bond, E_angle, E_dihed, E_impro, E_vdwl, E_coul, E_long, Press, ] +data: + - [100, 0.757453103239935, 1.13614414924569, -5.7585054860159, 0, 0, 0, 0, -5.7585054860159, 0, 0, 0.207261053624721, ] + - [110, 0.759322359337036, 1.13894794576996, -5.7614668389562, 0, 0, 0, 0, -5.7614668389562, 0, 0, 0.194314975399602, ] + - [120, 0.759372342462676, 1.13902291811546, -5.76149365656489, 0, 0, 0, 0, -5.76149365656489, 0, 0, 0.191600048851267, ] + - [130, 0.756833027516501, 1.13521406472659, -5.75777334823494, 0, 0, 0, 0, -5.75777334823494, 0, 0, 0.208792327853067, ] + - [140, 0.759725426691298, 1.13955252790757, -5.76208910746081, 0, 0, 0, 0, -5.76208910746081, 0, 0, 0.193895435346637, ] + - [150, 0.760545839455106, 1.14078310859643, -5.7633284876011, 0, 0, 0, 0, -5.7633284876011, 0, 0, 0.187959630462945, ] + - [160, 0.758404626168493, 1.13757138903589, -5.76023198892283, 0, 0, 0, 0, -5.76023198892283, 0, 0, 0.19692107984108, ] + - [170, 0.758880300638885, 1.13828487844424, -5.76103232235402, 0, 0, 0, 0, -5.76103232235402, 0, 0, 0.197653518549842, ] + - [180, 0.753691827878246, 1.13050241251294, -5.75304767384283, 0, 0, 0, 0, -5.75304767384283, 0, 0, 0.237041776410937, ] + - [190, 0.757361226563721, 1.13600633853809, -5.75852399133222, 0, 0, 0, 0, -5.75852399133222, 0, 0, 0.219529562657488, ] + - [200, 0.759531750132731, 1.13926202214831, -5.76188923485725, 0, 0, 0, 0, -5.76188923485725, 0, 0, 0.209105747192796, ] +... +Loop time of 1.93916 on 1 procs for 100 steps with 32000 atoms + +Performance: 22277.687 tau/day, 51.569 timesteps/s +99.4% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.3292 | 1.3292 | 1.3292 | 0.0 | 68.55 +Neigh | 0.18317 | 0.18317 | 0.18317 | 0.0 | 9.45 +Comm | 0.013626 | 0.013626 | 0.013626 | 0.0 | 0.70 +Output | 0.38206 | 0.38206 | 0.38206 | 0.0 | 19.70 +Modify | 0.027034 | 0.027034 | 0.027034 | 0.0 | 1.39 +Other | | 0.004028 | | | 0.21 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19570 ave 19570 max 19570 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1.19982e+06 ave 1.19982e+06 max 1.19982e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1199821 +Ave neighs/atom = 37.494406 +Neighbor list builds = 5 +Dangerous builds not checked +Total wall time: 0:00:04 diff --git a/python/lammps/formats.py b/python/lammps/formats.py index f7a7a4eb83..83d05dd9f7 100644 --- a/python/lammps/formats.py +++ b/python/lammps/formats.py @@ -14,14 +14,19 @@ ################################################################################ # LAMMPS output formats # Written by Richard Berger +# and Axel Kohlmeyer ################################################################################ -import re +import re, yaml +try: + from yaml import CSafeLoader as Loader, CSafeDumper as Dumper +except ImportError: + from yaml import SafeLoader as Loader, SafeDumper as Dumper class LogFile: """Reads LAMMPS log files and extracts the thermo information - It supports both the default thermo output style (including custom) and multi. + It supports the line, multi, and yaml thermo output styles. :param filename: path to log file :type filename: str @@ -33,11 +38,13 @@ class LogFile: STYLE_DEFAULT = 0 STYLE_MULTI = 1 + STYLE_YAML = 2 def __init__(self, filename): alpha = re.compile(r'[a-df-zA-DF-Z]') # except e or E for floating-point numbers kvpairs = re.compile(r'([a-zA-Z_0-9]+)\s+=\s*([0-9\.eE\-]+)') style = LogFile.STYLE_DEFAULT + yamllog = "" self.runs = [] self.errors = [] with open(filename, 'rt') as f: @@ -54,6 +61,24 @@ class LogFile: current_run = {} for k in keys: current_run[k] = [] + + elif re.match(r'^(keywords:.*$|data:$|---$| - \[.*\]$)', line): + style = LogFile.STYLE_YAML + yamllog += line; + current_run = {} + + elif re.match(r'^\.\.\.$', line): + thermo = yaml.load(yamllog, Loader=Loader) + for k in thermo['keywords']: + current_run[k] = [] + for step in thermo['data']: + icol = 0 + for k in thermo['keywords']: + current_run[k].append(step[icol]) + icol += 1 + self.runs.append(current_run) + yamllog = "" + elif re.match(r'^------* Step ', line): if not in_thermo: current_run = {'Step': [], 'CPU': []} @@ -65,28 +90,29 @@ class LogFile: cpu = float(str_cpu.split('=')[1].split()[0]) current_run["Step"].append(step) current_run["CPU"].append(cpu) + elif line.startswith('Loop time of'): in_thermo = False - self.runs.append(current_run) + if style != LogFile.STYLE_YAML: + self.runs.append(current_run) + elif in_thermo and in_data_section: if style == LogFile.STYLE_DEFAULT: if alpha.search(line): continue - for k, v in zip(keys, map(float, line.split())): current_run[k].append(v) + elif style == LogFile.STYLE_MULTI: if '=' not in line: in_data_section = False continue - for k,v in kvpairs.findall(line): if k not in current_run: current_run[k] = [float(v)] else: current_run[k].append(float(v)) - class AvgChunkFile: """Reads files generated by fix ave/chunk diff --git a/unittest/python/python-formats.py b/unittest/python/python-formats.py index ca877b8305..9e7863e198 100644 --- a/unittest/python/python-formats.py +++ b/unittest/python/python-formats.py @@ -7,6 +7,7 @@ EXAMPLES_DIR=os.path.abspath(os.path.join(__file__, '..', '..', '..', 'examples' DEFAULT_STYLE_EXAMPLE_LOG="melt/log.8Apr21.melt.g++.1" MULTI_STYLE_EXAMPLE_LOG="peptide/log.27Nov18.peptide.g++.1" AVG_CHUNK_FILE="VISCOSITY/profile.13Oct16.nemd.2d.g++.1" +YAML_STYLE_EXAMPLE_LOG="yaml/log.7Apr22.yaml.g++.1" class Logfiles(unittest.TestCase): def testLogFileNotFound(self): @@ -58,6 +59,27 @@ class Logfiles(unittest.TestCase): self.assertEqual(run0["Step"], list(range(0,350, 50))) + def testYamlLogFile(self): + log = LogFile(os.path.join(EXAMPLES_DIR, YAML_STYLE_EXAMPLE_LOG)) + self.assertEqual(len(log.runs), 2) + run = log.runs[0] + self.assertEqual(len(run.keys()), 12) + self.assertIn("Step", run) + self.assertIn("Temp", run) + self.assertIn("E_vdwl", run) + self.assertIn("E_coul", run) + self.assertIn("E_bond", run) + self.assertIn("E_angle", run) + self.assertIn("Press", run) + self.assertEqual(len(run["Step"]), 11) + self.assertEqual(len(run["Temp"]), 11) + self.assertEqual(len(run["E_vdwl"]), 11) + self.assertEqual(len(run["E_coul"]), 11) + self.assertEqual(len(run["E_bond"]), 11) + self.assertEqual(len(run["E_angle"]), 11) + self.assertEqual(len(run["Press"]), 11) + self.assertEqual(log.runs[0]["Step"], [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) + class AvgChunkFiles(unittest.TestCase): def testAvgChunkFileNotFound(self): From 59fa0be35f999a169dd824cee2b457c057d40193 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 7 Apr 2022 02:05:05 -0400 Subject: [PATCH 099/130] update for recent changes in thermo output --- python/lammps/formats.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/lammps/formats.py b/python/lammps/formats.py index 641e17be3e..f7a7a4eb83 100644 --- a/python/lammps/formats.py +++ b/python/lammps/formats.py @@ -46,14 +46,15 @@ class LogFile: for line in f: if "ERROR" in line or "exited on signal" in line: self.errors.append(line) - elif line.startswith('Step '): + + elif re.match(r'^ *Step ', line): in_thermo = True in_data_section = True keys = line.split() current_run = {} for k in keys: current_run[k] = [] - elif line.startswith('---------------- Step'): + elif re.match(r'^------* Step ', line): if not in_thermo: current_run = {'Step': [], 'CPU': []} in_thermo = True From 0e8e1171c60412cc3fa9355deb287083a8e3ac75 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 7 Apr 2022 02:05:47 -0400 Subject: [PATCH 100/130] add unit test for yaml style thermo output and updated logfile class --- examples/README | 1 + examples/yaml/in.yaml | 37 +++++++ examples/yaml/log.7Apr22.yaml.g++.1 | 151 ++++++++++++++++++++++++++++ python/lammps/formats.py | 38 +++++-- unittest/python/python-formats.py | 22 ++++ 5 files changed, 243 insertions(+), 6 deletions(-) create mode 100644 examples/yaml/in.yaml create mode 100644 examples/yaml/log.7Apr22.yaml.g++.1 diff --git a/examples/README b/examples/README index 0c09b6d847..d9637af5c2 100644 --- a/examples/README +++ b/examples/README @@ -118,6 +118,7 @@ ttm: two-temeperature model examples vashishta: models using the Vashishta potential voronoi: Voronoi tesselation via compute voronoi/atom command wall: use of reflective walls with different stochastic models +yaml: demonstrates use of yaml thermo and dump styles Here is how you might run and visualize one of the sample problems: diff --git a/examples/yaml/in.yaml b/examples/yaml/in.yaml new file mode 100644 index 0000000000..28660751c8 --- /dev/null +++ b/examples/yaml/in.yaml @@ -0,0 +1,37 @@ +# 3d Lennard-Jones melt + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z + +units lj +atom_style atomic + +lattice fcc 0.8442 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 20 check no + +fix 1 all nve +thermo_style yaml +thermo 10 + +dump 1 all yaml 25 dump.yaml id type x y z ix iy iz vx vy vz +dump_modify 1 sort id thermo yes units yes time yes format 1 %5d format float "% 12.8e" format int %2d + +run 100 + +run 100 diff --git a/examples/yaml/log.7Apr22.yaml.g++.1 b/examples/yaml/log.7Apr22.yaml.g++.1 new file mode 100644 index 0000000000..0c39dbe6a3 --- /dev/null +++ b/examples/yaml/log.7Apr22.yaml.g++.1 @@ -0,0 +1,151 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# 3d Lennard-Jones melt + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0 0 0) to (33.591924 33.591924 33.591924) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 32000 atoms + using lattice units in orthogonal box = (0 0 0) to (33.591924 33.591924 33.591924) + create_atoms CPU = 0.003 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 20 check no + +fix 1 all nve +thermo_style yaml +thermo 10 + +dump 1 all yaml 25 dump.yaml id type x y z ix iy iz vx vy vz +dump_modify 1 sort id thermo yes units yes time yes format 1 %5d format float "% 12.8e" format int %2d + +run 100 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 20 steps, delay 0 steps, check no + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 24 24 24 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 20.56 | 20.56 | 20.56 Mbytes +--- +keywords: [Step, Temp, KinEng, PotEng, E_bond, E_angle, E_dihed, E_impro, E_vdwl, E_coul, E_long, Press, ] +data: + - [0, 1.44000000000001, 2.15993250000001, -6.77336805323422, 0, 0, 0, 0, -6.77336805323422, 0, 0, -5.01970725908556, ] + - [10, 1.12539487029313, 1.68803955255514, -6.30005271976029, 0, 0, 0, 0, -6.30005271976029, 0, 0, -2.55968522600129, ] + - [20, 0.625793798302192, 0.938661363368992, -5.55655653922756, 0, 0, 0, 0, -5.55655653922756, 0, 0, 0.973517658007722, ] + - [30, 0.745927295413064, 1.11885597777762, -5.73951278150759, 0, 0, 0, 0, -5.73951278150759, 0, 0, 0.339284096694852, ] + - [40, 0.731026217827733, 1.09650505988764, -5.71764564663628, 0, 0, 0, 0, -5.71764564663628, 0, 0, 0.388973418756238, ] + - [50, 0.740091517740786, 1.11010258482128, -5.73150426762886, 0, 0, 0, 0, -5.73150426762886, 0, 0, 0.335273324523691, ] + - [60, 0.750500641591031, 1.12571578266897, -5.74713299283555, 0, 0, 0, 0, -5.74713299283555, 0, 0, 0.26343139026926, ] + - [70, 0.755436366857812, 1.13311913920702, -5.75480059117447, 0, 0, 0, 0, -5.75480059117447, 0, 0, 0.224276619217515, ] + - [80, 0.759974280364828, 1.13992579675285, -5.76187162670983, 0, 0, 0, 0, -5.76187162670983, 0, 0, 0.191626237124102, ] + - [90, 0.760464250735042, 1.14066072934081, -5.76280209529731, 0, 0, 0, 0, -5.76280209529731, 0, 0, 0.189478083345243, ] + - [100, 0.757453103239936, 1.13614414924569, -5.75850548601596, 0, 0, 0, 0, -5.75850548601596, 0, 0, 0.207261053624723, ] +... +Loop time of 1.89046 on 1 procs for 100 steps with 32000 atoms + +Performance: 22851.622 tau/day, 52.897 timesteps/s +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.2896 | 1.2896 | 1.2896 | 0.0 | 68.22 +Neigh | 0.17687 | 0.17687 | 0.17687 | 0.0 | 9.36 +Comm | 0.014543 | 0.014543 | 0.014543 | 0.0 | 0.77 +Output | 0.37678 | 0.37678 | 0.37678 | 0.0 | 19.93 +Modify | 0.028638 | 0.028638 | 0.028638 | 0.0 | 1.51 +Other | | 0.003975 | | | 0.21 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19657 ave 19657 max 19657 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1.20283e+06 ave 1.20283e+06 max 1.20283e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1202833 +Ave neighs/atom = 37.588531 +Neighbor list builds = 5 +Dangerous builds not checked + +run 100 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 20.57 | 20.57 | 20.57 Mbytes +--- +keywords: [Step, Temp, KinEng, PotEng, E_bond, E_angle, E_dihed, E_impro, E_vdwl, E_coul, E_long, Press, ] +data: + - [100, 0.757453103239935, 1.13614414924569, -5.7585054860159, 0, 0, 0, 0, -5.7585054860159, 0, 0, 0.207261053624721, ] + - [110, 0.759322359337036, 1.13894794576996, -5.7614668389562, 0, 0, 0, 0, -5.7614668389562, 0, 0, 0.194314975399602, ] + - [120, 0.759372342462676, 1.13902291811546, -5.76149365656489, 0, 0, 0, 0, -5.76149365656489, 0, 0, 0.191600048851267, ] + - [130, 0.756833027516501, 1.13521406472659, -5.75777334823494, 0, 0, 0, 0, -5.75777334823494, 0, 0, 0.208792327853067, ] + - [140, 0.759725426691298, 1.13955252790757, -5.76208910746081, 0, 0, 0, 0, -5.76208910746081, 0, 0, 0.193895435346637, ] + - [150, 0.760545839455106, 1.14078310859643, -5.7633284876011, 0, 0, 0, 0, -5.7633284876011, 0, 0, 0.187959630462945, ] + - [160, 0.758404626168493, 1.13757138903589, -5.76023198892283, 0, 0, 0, 0, -5.76023198892283, 0, 0, 0.19692107984108, ] + - [170, 0.758880300638885, 1.13828487844424, -5.76103232235402, 0, 0, 0, 0, -5.76103232235402, 0, 0, 0.197653518549842, ] + - [180, 0.753691827878246, 1.13050241251294, -5.75304767384283, 0, 0, 0, 0, -5.75304767384283, 0, 0, 0.237041776410937, ] + - [190, 0.757361226563721, 1.13600633853809, -5.75852399133222, 0, 0, 0, 0, -5.75852399133222, 0, 0, 0.219529562657488, ] + - [200, 0.759531750132731, 1.13926202214831, -5.76188923485725, 0, 0, 0, 0, -5.76188923485725, 0, 0, 0.209105747192796, ] +... +Loop time of 1.93916 on 1 procs for 100 steps with 32000 atoms + +Performance: 22277.687 tau/day, 51.569 timesteps/s +99.4% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.3292 | 1.3292 | 1.3292 | 0.0 | 68.55 +Neigh | 0.18317 | 0.18317 | 0.18317 | 0.0 | 9.45 +Comm | 0.013626 | 0.013626 | 0.013626 | 0.0 | 0.70 +Output | 0.38206 | 0.38206 | 0.38206 | 0.0 | 19.70 +Modify | 0.027034 | 0.027034 | 0.027034 | 0.0 | 1.39 +Other | | 0.004028 | | | 0.21 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19570 ave 19570 max 19570 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1.19982e+06 ave 1.19982e+06 max 1.19982e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1199821 +Ave neighs/atom = 37.494406 +Neighbor list builds = 5 +Dangerous builds not checked +Total wall time: 0:00:04 diff --git a/python/lammps/formats.py b/python/lammps/formats.py index f7a7a4eb83..83d05dd9f7 100644 --- a/python/lammps/formats.py +++ b/python/lammps/formats.py @@ -14,14 +14,19 @@ ################################################################################ # LAMMPS output formats # Written by Richard Berger +# and Axel Kohlmeyer ################################################################################ -import re +import re, yaml +try: + from yaml import CSafeLoader as Loader, CSafeDumper as Dumper +except ImportError: + from yaml import SafeLoader as Loader, SafeDumper as Dumper class LogFile: """Reads LAMMPS log files and extracts the thermo information - It supports both the default thermo output style (including custom) and multi. + It supports the line, multi, and yaml thermo output styles. :param filename: path to log file :type filename: str @@ -33,11 +38,13 @@ class LogFile: STYLE_DEFAULT = 0 STYLE_MULTI = 1 + STYLE_YAML = 2 def __init__(self, filename): alpha = re.compile(r'[a-df-zA-DF-Z]') # except e or E for floating-point numbers kvpairs = re.compile(r'([a-zA-Z_0-9]+)\s+=\s*([0-9\.eE\-]+)') style = LogFile.STYLE_DEFAULT + yamllog = "" self.runs = [] self.errors = [] with open(filename, 'rt') as f: @@ -54,6 +61,24 @@ class LogFile: current_run = {} for k in keys: current_run[k] = [] + + elif re.match(r'^(keywords:.*$|data:$|---$| - \[.*\]$)', line): + style = LogFile.STYLE_YAML + yamllog += line; + current_run = {} + + elif re.match(r'^\.\.\.$', line): + thermo = yaml.load(yamllog, Loader=Loader) + for k in thermo['keywords']: + current_run[k] = [] + for step in thermo['data']: + icol = 0 + for k in thermo['keywords']: + current_run[k].append(step[icol]) + icol += 1 + self.runs.append(current_run) + yamllog = "" + elif re.match(r'^------* Step ', line): if not in_thermo: current_run = {'Step': [], 'CPU': []} @@ -65,28 +90,29 @@ class LogFile: cpu = float(str_cpu.split('=')[1].split()[0]) current_run["Step"].append(step) current_run["CPU"].append(cpu) + elif line.startswith('Loop time of'): in_thermo = False - self.runs.append(current_run) + if style != LogFile.STYLE_YAML: + self.runs.append(current_run) + elif in_thermo and in_data_section: if style == LogFile.STYLE_DEFAULT: if alpha.search(line): continue - for k, v in zip(keys, map(float, line.split())): current_run[k].append(v) + elif style == LogFile.STYLE_MULTI: if '=' not in line: in_data_section = False continue - for k,v in kvpairs.findall(line): if k not in current_run: current_run[k] = [float(v)] else: current_run[k].append(float(v)) - class AvgChunkFile: """Reads files generated by fix ave/chunk diff --git a/unittest/python/python-formats.py b/unittest/python/python-formats.py index ca877b8305..9e7863e198 100644 --- a/unittest/python/python-formats.py +++ b/unittest/python/python-formats.py @@ -7,6 +7,7 @@ EXAMPLES_DIR=os.path.abspath(os.path.join(__file__, '..', '..', '..', 'examples' DEFAULT_STYLE_EXAMPLE_LOG="melt/log.8Apr21.melt.g++.1" MULTI_STYLE_EXAMPLE_LOG="peptide/log.27Nov18.peptide.g++.1" AVG_CHUNK_FILE="VISCOSITY/profile.13Oct16.nemd.2d.g++.1" +YAML_STYLE_EXAMPLE_LOG="yaml/log.7Apr22.yaml.g++.1" class Logfiles(unittest.TestCase): def testLogFileNotFound(self): @@ -58,6 +59,27 @@ class Logfiles(unittest.TestCase): self.assertEqual(run0["Step"], list(range(0,350, 50))) + def testYamlLogFile(self): + log = LogFile(os.path.join(EXAMPLES_DIR, YAML_STYLE_EXAMPLE_LOG)) + self.assertEqual(len(log.runs), 2) + run = log.runs[0] + self.assertEqual(len(run.keys()), 12) + self.assertIn("Step", run) + self.assertIn("Temp", run) + self.assertIn("E_vdwl", run) + self.assertIn("E_coul", run) + self.assertIn("E_bond", run) + self.assertIn("E_angle", run) + self.assertIn("Press", run) + self.assertEqual(len(run["Step"]), 11) + self.assertEqual(len(run["Temp"]), 11) + self.assertEqual(len(run["E_vdwl"]), 11) + self.assertEqual(len(run["E_coul"]), 11) + self.assertEqual(len(run["E_bond"]), 11) + self.assertEqual(len(run["E_angle"]), 11) + self.assertEqual(len(run["Press"]), 11) + self.assertEqual(log.runs[0]["Step"], [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) + class AvgChunkFiles(unittest.TestCase): def testAvgChunkFileNotFound(self): From 3970942028d6964957e556d11bb5e8d9870649c8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 7 Apr 2022 02:43:39 -0400 Subject: [PATCH 101/130] add test for yaml dump style --- examples/yaml/in.yaml | 8 ++--- python/lammps/formats.py | 2 +- unittest/python/python-formats.py | 55 +++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/examples/yaml/in.yaml b/examples/yaml/in.yaml index 28660751c8..f682f39776 100644 --- a/examples/yaml/in.yaml +++ b/examples/yaml/in.yaml @@ -29,9 +29,9 @@ fix 1 all nve thermo_style yaml thermo 10 -dump 1 all yaml 25 dump.yaml id type x y z ix iy iz vx vy vz -dump_modify 1 sort id thermo yes units yes time yes format 1 %5d format float "% 12.8e" format int %2d +#dump 1 all yaml 25 dump.yaml id type x y z ix iy iz vx vy vz +#dump_modify 1 sort id thermo yes units yes time yes format 1 %5d format float "% 12.8e" format int %2d -run 100 +run 100 post no -run 100 +run 100 post no diff --git a/python/lammps/formats.py b/python/lammps/formats.py index 83d05dd9f7..a311867253 100644 --- a/python/lammps/formats.py +++ b/python/lammps/formats.py @@ -21,7 +21,7 @@ import re, yaml try: from yaml import CSafeLoader as Loader, CSafeDumper as Dumper except ImportError: - from yaml import SafeLoader as Loader, SafeDumper as Dumper + from yaml import SafeLoader as Loader, SafeDumper as Dumper class LogFile: """Reads LAMMPS log files and extracts the thermo information diff --git a/unittest/python/python-formats.py b/unittest/python/python-formats.py index 9e7863e198..4d6aa7e2cd 100644 --- a/unittest/python/python-formats.py +++ b/unittest/python/python-formats.py @@ -2,6 +2,12 @@ import os import unittest from lammps.formats import LogFile, AvgChunkFile +import yaml +try: + from yaml import CSafeLoader as Loader, CSafeDumper as Dumper +except ImportError: + from yaml import SafeLoader, SafeDumper + EXAMPLES_DIR=os.path.abspath(os.path.join(__file__, '..', '..', '..', 'examples')) DEFAULT_STYLE_EXAMPLE_LOG="melt/log.8Apr21.melt.g++.1" @@ -109,5 +115,54 @@ class AvgChunkFiles(unittest.TestCase): self.assertEqual(len(chunk['coord'][0]), 1) +from lammps import lammps +has_full = False +try: + machine=None + if 'LAMMPS_MACHINE_NAME' in os.environ: + machine=os.environ['LAMMPS_MACHINE_NAME'] + lmp=lammps(name=machine) + has_full = lmp.has_style("atom","full") + lmp.close() +except: + pass + +@unittest.skipIf(not has_full, "atom_style full is not available") +class PythonDump(unittest.TestCase): + def setUp(self): + machine = None + if 'LAMMPS_MACHINE_NAME' in os.environ: + machine=os.environ['LAMMPS_MACHINE_NAME'] + self.lmp = lammps(name=machine, cmdargs=['-nocite', '-log','none', '-echo','screen']) + + def tearDown(self): + del self.lmp + + def testDumpYaml(self): + dumpfile = os.path.join(os.path.abspath('.'), 'dump.yaml') + self.lmp.command('shell cd ' + os.environ['TEST_INPUT_DIR']) + self.lmp.command("newton on on") + self.lmp.file("in.fourmol") + self.lmp.command("dump 1 all yaml 2 " + dumpfile + " id type mol q x y z vx vy vz") + self.lmp.command("dump_modify 1 time yes sort id units yes") + self.lmp.command("run 4 post no") + with open(dumpfile) as d: + traj = tuple(yaml.load_all(d, Loader=Loader)) + self.assertEqual(len(traj), 3) + self.assertEqual(traj[0]['timestep'], 0) + self.assertEqual(traj[0]['time'], 0) + self.assertEqual(traj[0]['natoms'], 29) + self.assertEqual(traj[0]['units'], 'real') + self.assertEqual(len(traj[0]['boundary']), 6) + self.assertEqual(traj[0]['boundary'][0], 'p') + self.assertEqual(traj[1]['timestep'], 2) + self.assertEqual(traj[1]['time'], 0.2) + self.assertEqual(traj[2]['timestep'], 4) + self.assertEqual(traj[2]['time'], 0.4) + self.assertEqual(traj[0]['keywords'],['id', 'type', 'mol', 'q', 'x', 'y', 'z', + 'vx', 'vy', 'vz']) + self.assertEqual(traj[0]['data'][0],[1, 3, 1, -0.47, -0.279937, 2.47266, -0.172009, + 0.000778678, 0.000589703, -0.000221795]) + if __name__ == "__main__": unittest.main() From 8a6e6fe523e6c936e1689590c3996cffcee7b9b9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 7 Apr 2022 05:59:31 -0400 Subject: [PATCH 102/130] make dump style yaml test dependent on it being available --- unittest/python/python-formats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unittest/python/python-formats.py b/unittest/python/python-formats.py index 4d6aa7e2cd..ac0f2ec6ed 100644 --- a/unittest/python/python-formats.py +++ b/unittest/python/python-formats.py @@ -116,18 +116,18 @@ class AvgChunkFiles(unittest.TestCase): from lammps import lammps -has_full = False +has_dump_yaml = False try: machine=None if 'LAMMPS_MACHINE_NAME' in os.environ: machine=os.environ['LAMMPS_MACHINE_NAME'] lmp=lammps(name=machine) - has_full = lmp.has_style("atom","full") + has_dump_yaml = lmp.has_style("atom","full") && lmp.has_style("dump", "yaml") lmp.close() except: pass -@unittest.skipIf(not has_full, "atom_style full is not available") +@unittest.skipIf(not has_dump_yaml, "Either atom_style full or dump_style yaml are not available") class PythonDump(unittest.TestCase): def setUp(self): machine = None From f5add950834eda00c1b22e1b50e3330a28003ea0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 7 Apr 2022 06:08:54 -0400 Subject: [PATCH 103/130] fix syntax error --- unittest/python/python-formats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittest/python/python-formats.py b/unittest/python/python-formats.py index ac0f2ec6ed..c3dc6d52dc 100644 --- a/unittest/python/python-formats.py +++ b/unittest/python/python-formats.py @@ -122,7 +122,7 @@ try: if 'LAMMPS_MACHINE_NAME' in os.environ: machine=os.environ['LAMMPS_MACHINE_NAME'] lmp=lammps(name=machine) - has_dump_yaml = lmp.has_style("atom","full") && lmp.has_style("dump", "yaml") + has_dump_yaml = lmp.has_style("atom","full") and lmp.has_style("dump", "yaml") lmp.close() except: pass From fdf59e6a03b72b1563e9a10368366e9ffe26fe81 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 7 Apr 2022 09:26:43 -0600 Subject: [PATCH 104/130] more debugging for plugin library mode --- doc/src/mdi.rst | 134 +++-- examples/mdi/README | 21 +- src/MDI/README | 11 +- src/MDI/fix_mdi_engine_old.cpp | 960 --------------------------------- src/MDI/fix_mdi_engine_old.h | 143 ----- src/MDI/mdi_engine_old.cpp | 345 ------------ src/MDI/mdi_engine_old.h | 53 -- src/MDI/mdi_plugin.cpp | 13 +- 8 files changed, 109 insertions(+), 1571 deletions(-) delete mode 100644 src/MDI/fix_mdi_engine_old.cpp delete mode 100644 src/MDI/fix_mdi_engine_old.h delete mode 100644 src/MDI/mdi_engine_old.cpp delete mode 100644 src/MDI/mdi_engine_old.h diff --git a/doc/src/mdi.rst b/doc/src/mdi.rst index 9ba3ba82dd..830a0c5022 100644 --- a/doc/src/mdi.rst +++ b/doc/src/mdi.rst @@ -8,10 +8,19 @@ Syntax .. parsed-literal:: - mdi engine + mdi mode args -* engine = start operating as an MDI engine +* mode = *engine* or *plugin* + .. parsed-literal:: + + *engine* args = none + *plugin* args = keyword value keyword value ... + keywords = *mdi* or *infile* or *extra* or *command* + *mdi* value = args passed to MDI for driver to operate with plugins + *infile* value = filename the engine will read at start-up + *extra* value = aditional command-line args to pass to engine library when loaded + *command value = a LAMMPS input script command to execute Examples """""""" @@ -19,19 +28,33 @@ Examples .. code-block:: LAMMPS mdi engine + mdi plugin lammps mdi "-role ENGINE -name lammps -method LINK" & + infile in.aimd.engine extra "-log log.aimd.engine.plugin" & + command "run 5" Description """"""""""" -This command enables LAMMPS act as a server with another client code -to effectively couple the two codes together in client/server mode. +This command implements two high-level operations within LAMMPS to use +the `MDI Library +` for +coupling to another code. -More specifically, this command causes LAMMPS to begin using the `MDI -Library `_ -to run as an MDI engine (server), responding to MDI commands issued by -an external MDI driver code (client). See the :doc:`Howto mdi -` page for more information about how LAMMPS can operate as -either an MDI driver or engine. +The *engine* mode enables LAMMPS to act as a server, responding to +requests from another client code to effectively couple the two codes +together in client/server mode. In MDI lingo this means LAMMPS +operates as an MDI engine. + +The *plugin* mode enables LAMMPS to act as a client, and load the +server code as a library plugin. In MDI lingo this means LAMMPS +operates as an MDI driver, and the server is an MDI engine. In this +case the MDI engine is a library plugin. It can also be a stand-alone +code, lauched separately from LAMMPS. + +See the Howto MDI doc page for a discussion of all the different ways +2 or more codes can interact via MDI. The examples/mdi/README file +has example use cases and launch commands for using LAMMPS as both a +driver and engine in all these different ways. The examples/mdi directory contains input scripts for LAMMPS acting as an MDI engine to operate as a surrogate quantum mechanics (QM) code @@ -44,26 +67,30 @@ communicate using the MDI library via either MPI or sockets. ---------- -The mdi engine command should typically be used in an input script +The *mdi engine* command should typically be used in an input script after LAMMPS has setup the system it is going to model in collaboration with the driver code. Depending on how the driver code tells the LAMMPS engine to exit, other commands can be executed after -this command, but typically it should be used at the end of the LAMMPS -input script. +this command, but typically it should it is used at the end of a +LAMMPS input script. -To act as a MD-based MDI engine, this is the list of standard MDI -commands issued by a driver code which LAMMPS currently recognizes. -Using standard commands defined by the MDI library means that a driver -code can work interchangeably with LAMMPS or other MD codes which -support the MDI standard. See more details about these commands in -the `MDI library documentation + + +To act as an MDI engine operating as an MD code (or surrogate QM +code), this is the list of standard MDI commands issued by a driver +code which LAMMPS currently recognizes. Using standard commands +defined by the MDI library means that a driver code can work +interchangeably with LAMMPS or other MD codes which support the MDI +standard. See more details about these commands in the `MDI library +documentation `_ These commands are valid at the @DEFAULT node defined by MDI. Commands that start with ">" mean the driver is sending information to the engine (LAMMMPS). Commands that start with "<" are requests by -the driver for LAMMPS to send it information. Command that start with -"@" are MDI "node" commands, which are described further below. +the driver for LAMMPS to send it information. Commands that start +with a letter perform actions. Commands that start with "@" are MDI +"node" commands, which are described further below. .. list-table:: :widths: 20 80 @@ -89,18 +116,26 @@ the driver for LAMMPS to send it information. Command that start with - Request string label of each atom (N values) * - NSTEPS value) + * - OPTG + Perform an energy minimization to convergence (most recent >TOLERANCE values) * - >NATOMS or NSTEPS + - Send number of timesteps for next MD dynamics run via MD command * - TOLERANCE + - Send 4 tolerance parameters for next MD minimization via OPTG command * - >TYPES or VELOCITIES or NSTEPS +value. The OPTG command performs a minimization using the 4 +convergence paremeters from the most recent >TOLERANCE command. The 4 +parameters sent are those used by the :doc:`minimize ` +command in LAMMPS: etol, ftol, maxiter, and maxeval. + The mdi engine command also implements the following custom MDI commands which are LAMMPS-specific. These commands are also valid at the @DEFAULT node defined by MDI: @@ -143,24 +191,20 @@ sufficient to support what a user-written driver code needs. Code to support new commands can be added to the MDI package within LAMMPS, specifically to the src/MDI/mdi_engine.cpp file. -MDI also defines a standard mechanism for the driver to request that an -MD engine (LAMMPS) perform a dynamics simulation or an energy -minimization. This can be done one step (or iteration for -minimization) at a time, where the driver can (optionally) communicate -with LAMMPS at intermediate points of the timestep or iteration by -issuing MDI node commands which start with "@". LAMMPS also adds 2 -custom MDI commands to allow the driver to tell LAMMPS to perform an -entire N-step MD run or an entire minimization to convergence without -intermediate communication from the driver. +MDI also defines a standard mechanism for the driver to request that +an MD engine (LAMMPS) perform a dynamics simulation one step at a time +or an energy minimization one iteration at a time. This is so that +the driver can (optionally) communicate with LAMMPS at intermediate +points of the timestep or iteration by issuing MDI node commands which +start with "@". -To tell LAMMPS to run dynamics, the driver sends as @INIT_MD command -followed by the these commands. The >NITERATE command is a custom -command added by LAMMPS: +To tell LAMMPS to run dynamics in single-step mode, the driver sends +as @INIT_MD command followed by the these commands. The driver +can interact with LAMMPS at 3 node locations within each +timestep: @COORDS, @FORCES, @ENDSTEP: * - Command name - Action - * - >NITERATE - - Send # of timesteps for the MD simulation (1 value) * - @COORDS - Proceed to next @COORDS node = post-integrate location in LAMMPS timestep * - @FORCES @@ -172,14 +216,12 @@ command added by LAMMPS: * - EXIT - Driver tells LAMMPS to exit the MD simulation and engine mode -To tell LAMMPS to run an energy minimization, the driver sends as -@INIT_OPTG command followed by these commands. The >TOLERANCE command -is a custom command added by LAMMPS: +To tell LAMMPS to run an energy minimization in single-iteration mode. +The driver can interact with LAMMPS at 2 node locations within each +iteration of the minimizer: @COORDS, @FORCES: * - Command name - Action - * - >TOLERANCE - - Send tolerance parameters for the minimization (4 values) * - @COORDS - Proceed to next @COORDS node = min-pre-force location in LAMMPS min iteration * - @FORCES @@ -189,9 +231,6 @@ is a custom command added by LAMMPS: * - EXIT - Driver tells LAMMPS to exit the minimization and engine mode -The 4 tolerance parameters are those used by the :doc:`minimize -` command in LAMMPS: etol, ftol, maxiter, and maxeval. - While LAMMPS is at its @COORDS node, the following standard MDI commands are supported, as documented above: >COORDS or -#include - -enum { NONE, REAL, METAL }; // LAMMPS units which MDI supports - -using namespace LAMMPS_NS; -using namespace FixConst; - -/* ---------------------------------------------------------------------- */ - -FixMDIEngineOld::FixMDIEngineOld(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_pe(nullptr), id_ke(nullptr), pe(nullptr), ke(nullptr) -{ - if (narg != 3) error->all(FLERR, "Illegal fix mdi command"); - - // The 2 atomic-scale units LAMMPS has are: - // real: coords = Ang, eng = Kcal/mole, force = Kcal/mole/Ang - // metal: coords = Ang, eng = eV, force = eV/Ang - - lmpunits = NONE; - if (strcmp(update->unit_style, "real") == 0) lmpunits = REAL; - if (strcmp(update->unit_style, "metal") == 0) lmpunits = METAL; - if (lmpunits == NONE) error->all(FLERR, "MDI requires real or metal units"); - - // MDI setup - - most_recent_init = 0; - exit_flag = false; - local_exit_flag = false; - target_command = new char[MDI_COMMAND_LENGTH + 1]; - command = new char[MDI_COMMAND_LENGTH + 1]; - current_node = new char[MDI_COMMAND_LENGTH]; - target_node = new char[MDI_COMMAND_LENGTH]; - strncpy(target_node, "\0", MDI_COMMAND_LENGTH); - strncpy(current_node, "@DEFAULT", MDI_COMMAND_LENGTH); - - // register the execute_command function with MDI - - MDI_Set_execute_command_func(lammps_execute_mdi_command, this); - - // accept a communicator to the driver - // master = 1 for proc 0, otherwise 0 - - master = (comm->me == 0) ? 1 : 0; - - MDI_Accept_communicator(&driver_socket); - if (driver_socket <= 0) error->all(FLERR, "Unable to connect to driver"); - - // create computes for KE and PE - - id_pe = utils::strdup(std::string(id) + "_pe"); - modify->add_compute(fmt::format("{} all pe", id_pe)); - - id_ke = utils::strdup(std::string(id) + "_ke"); - modify->add_compute(fmt::format("{} all ke", id_ke)); - - // irregular class and data structs used by MDI - - irregular = new Irregular(lmp); - add_force = nullptr; -} - -/* ---------------------------------------------------------------------- */ - -FixMDIEngineOld::~FixMDIEngineOld() -{ - delete[] target_command; - delete[] command; - delete[] current_node; - delete[] target_node; - - modify->delete_compute(id_pe); - modify->delete_compute(id_ke); - delete irregular; - memory->destroy(add_force); -} - -/* ---------------------------------------------------------------------- */ - -int FixMDIEngineOld::setmask() -{ - int mask = 0; - - mask |= POST_INTEGRATE; - mask |= POST_FORCE; - mask |= MIN_PRE_FORCE; - mask |= MIN_POST_FORCE; - - return mask; -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::exchange_forces() -{ - double **f = atom->f; - const int *const mask = atom->mask; - const int nlocal = atom->nlocal; - - // add forces from the driver - - for (int i = 0; i < nlocal; ++i) { - if (mask[i] & groupbit) { - f[i][0] += add_force[3 * (atom->tag[i] - 1) + 0]; - f[i][1] += add_force[3 * (atom->tag[i] - 1) + 1]; - f[i][2] += add_force[3 * (atom->tag[i] - 1) + 2]; - } - } -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::init() -{ - // confirm that two required computes are still available - - int icompute_pe = modify->find_compute(id_pe); - if (icompute_pe < 0) error->all(FLERR, "Potential energy ID for fix mdi/engine does not exist"); - int icompute_ke = modify->find_compute(id_ke); - if (icompute_pe < 0) error->all(FLERR, "Kinetic energy ID for fix mdi/engine does not exist"); - - pe = modify->compute[icompute_pe]; - ke = modify->compute[icompute_ke]; - - // one-time allocation of add_force array - - if (!add_force) { - int64_t ncoords = 3 * atom->natoms; - memory->create(add_force, ncoords, "mdi/engine:add_force"); - for (int64_t i = 0; i < ncoords; i++) add_force[i] = 0.0; - } -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::min_setup(int /* vflag */) -{ - engine_mode("@FORCES"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::post_integrate() -{ - engine_mode("@COORDS"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::min_pre_force(int /* vflag */) -{ - engine_mode("@COORDS"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::min_post_force(int /* vflag */) -{ - engine_mode("@FORCES"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::post_force(int /* vflag */) -{ - if (most_recent_init == 1) - engine_mode("@FORCES"); - else if (most_recent_init == 2) - engine_mode("@FORCES"); -} - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// rest of file processes and responds to MDI driver commands -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- - -/* ---------------------------------------------------------------------- - process a single command from driver ----------------------------------------------------------------------- */ - -int FixMDIEngineOld::execute_command(const char *command, MDI_Comm mdicomm) -{ - // confirm this command is supported at this node - - int command_exists = 1; - if (master) { - ierr = MDI_Check_command_exists(current_node, command, MDI_COMM_NULL, &command_exists); - } - if (ierr != 0) error->all(FLERR, "MDI: Unable to check whether current command is supported"); - if (command_exists != 1) - error->all(FLERR, "MDI: Received a command that is unsupported at current node"); - - // respond to any driver command - - if (strcmp(command, ">NATOMS") == 0) { - int64_t mdi_natoms = 0; - ierr = MDI_Recv((char *) &mdi_natoms, 1, MDI_INT64_T, mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: Unable to receive number of atoms from driver"); - error->all(FLERR, "MDI: '>NATOMS' driver command not (yet) supported"); - // FIXME: to import the number of atoms, more steps than below are needed for LAMMPS. - // also a check for overflow is needed in case natoms is 32-bit - atom->natoms = mdi_natoms; - MPI_Bcast(&atom->natoms, 1, MPI_LMP_BIGINT, 0, world); - - } else if (strcmp(command, "natoms; - ierr = MDI_Send((char *) &mdi_natoms, 1, MDI_INT64_T, mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send number of atoms to driver"); - - } else if (strcmp(command, "ntypes, 1, MDI_INT, mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send number of atom types to driver"); - - } else if (strcmp(command, "CELL") == 0) { - receive_cell(error); - - } else if (strcmp(command, "CELL_DISPL") == 0) { - receive_celldispl(error); - - } else if (strcmp(command, ">COORDS") == 0) { - receive_coordinates(error); - - } else if (strcmp(command, "FORCES") == 0) { - receive_forces(error, 0); - - // add forces received from the driver to current forces - - } else if (strcmp(command, ">+FORCES") == 0) { - receive_forces(error, 1); - - // initialize new MD simulation or minimization - // return control to return to mdi/engine - - } else if (strcmp(command, "@INIT_MD") == 0) { - if (most_recent_init != 0) error->all(FLERR, "MDI: MDI is already performing a simulation"); - most_recent_init = 1; - local_exit_flag = true; - - // initialize new energy minimization - // return control to return to mdi/engine - - } else if (strcmp(command, "@INIT_OPTG") == 0) { - if (most_recent_init != 0) error->all(FLERR, "MDI: MDI is already performing a simulation"); - most_recent_init = 2; - local_exit_flag = true; - - } else if (strcmp(command, "@") == 0) { - strncpy(target_node, "\0", MDI_COMMAND_LENGTH); - local_exit_flag = true; - - } else if (strcmp(command, "<@") == 0) { - ierr = MDI_Send(current_node, MDI_NAME_LENGTH, MDI_CHAR, mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send node to driver"); - - } else if (strcmp(command, "etol = std::numeric_limits::max(); - update->ftol = std::numeric_limits::max(); - - // set the maximum number of force evaluations to 0 - update->max_eval = 0; - } - - } else if (strcmp(command, "@COORDS") == 0) { - strncpy(target_node, "@COORDS", MDI_COMMAND_LENGTH); - local_exit_flag = true; - - } else if (strcmp(command, "@FORCES") == 0) { - strncpy(target_node, "@FORCES", MDI_COMMAND_LENGTH); - local_exit_flag = true; - - } else if (strcmp(command, "EXIT") == 0) { - // exit the driver code - exit_flag = true; - - // are we in the middle of a geometry optimization? - if (most_recent_init == 2) { - // ensure that the energy and force tolerances are met - update->etol = std::numeric_limits::max(); - update->ftol = std::numeric_limits::max(); - - // set the maximum number of force evaluations to 0 - update->max_eval = 0; - } - - } else { - error->all(FLERR, "MDI: Unknown command from driver"); - } - - return 0; -} - -/* ---------------------------------------------------------------------- */ - -char *FixMDIEngineOld::engine_mode(const char *node) -{ - /* - if (screen) - fprintf(screen,"MDI ENGINE MODE: %i\n",node); - if (logfile) - fprintf(logfile,"MDI ENGINE MODE: %i\n",node); - */ - - printf("ENG NODE ENTRY eng/driver %s %s %d %d\n", - node,target_node,strlen(node),strlen(target_node)); - - // do not process commands if engine and driver are not at same node - // target_node = node that driver has set via a @ command - // current_node = node that engine (LAMMPS) has set - - strncpy(current_node, node, MDI_COMMAND_LENGTH); - if (strcmp(target_node, "\0") != 0 && strcmp(target_node, current_node) != 0) - local_exit_flag = true; - - // respond to commands from the driver - - while (not exit_flag and not local_exit_flag) { - - // read the next command from the driver - // all procs call this, but only proc 0 receives the command - - ierr = MDI_Recv_command(command, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to receive command from driver"); - - // broadcast command to the other MPI tasks - - MPI_Bcast(command, MDI_COMMAND_LENGTH, MPI_CHAR, 0, world); - - // execute the command - - printf("RECV CMD %s\n",command); - this->execute_command(command, driver_socket); - - // check if the target node is something other than the current node - - printf("ENG NODES eng/driver %s %s %d %d\n", - node,target_node,strlen(node),strlen(target_node)); - - if (strcmp(target_node, "\0") != 0 && strcmp(target_node, current_node) != 0) - local_exit_flag = true; - } - - // local exit occured so turn off local exit flag - - local_exit_flag = false; - - return command; -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::receive_coordinates(Error *error) -{ - // get conversion factor to atomic units - double posconv; - - // real: coords = Ang, eng = Kcal/mole, force = Kcal/mole/Ang - // metal: coords = Ang, eng = eV, force = eV/Ang - - if (lmpunits == REAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } else if (lmpunits == METAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } - - // create buffer to hold all coords - - double *buffer; - buffer = new double[3 * atom->natoms]; - - ierr = MDI_Recv((char *) buffer, 3 * atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to receive coordinates from driver"); - MPI_Bcast(buffer, 3 * atom->natoms, MPI_DOUBLE, 0, world); - - // pick local atoms from the buffer - - double **x = atom->x; - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { - x[i][0] = buffer[3 * (atom->tag[i] - 1) + 0] * posconv; - x[i][1] = buffer[3 * (atom->tag[i] - 1) + 1] * posconv; - x[i][2] = buffer[3 * (atom->tag[i] - 1) + 2] * posconv; - } - - // ensure atoms are in current box & update box via shrink-wrap - // has to be be done before invoking Irregular::migrate_atoms() - // since it requires atoms be inside simulation box - - if (domain->triclinic) domain->x2lamda(atom->nlocal); - domain->pbc(); - domain->reset_box(); - if (domain->triclinic) domain->lamda2x(atom->nlocal); - - // move atoms to new processors via irregular() only needed if - // migrate_check() says an atom moves too far - - if (domain->triclinic) domain->x2lamda(atom->nlocal); - if (irregular->migrate_check()) irregular->migrate_atoms(); - if (domain->triclinic) domain->lamda2x(atom->nlocal); - - delete[] buffer; -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::send_coordinates(Error *error) -{ - // get conversion factor to atomic units - double posconv; - if (lmpunits == REAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } else if (lmpunits == METAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } - - int64_t ncoords = 3 * atom->natoms; - double *coords; - double *coords_reduced; - memory->create(coords, ncoords, "mdi/engine:coords"); - memory->create(coords_reduced, ncoords, "mdi/engine:coords_reduced"); - - // zero coords - - for (int64_t icoord = 0; icoord < ncoords; icoord++) coords[icoord] = 0.0; - - // copy local atoms into buffer at correct locations - - double **x = atom->x; - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { - coords[3 * (atom->tag[i] - 1) + 0] = x[i][0] / posconv; - coords[3 * (atom->tag[i] - 1) + 1] = x[i][1] / posconv; - coords[3 * (atom->tag[i] - 1) + 2] = x[i][2] / posconv; - } - - MPI_Reduce(coords, coords_reduced, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - ierr = MDI_Send((char *) coords_reduced, 3 * atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send coordinates to driver"); - - memory->destroy(coords); - memory->destroy(coords_reduced); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::send_charges(Error *error) -{ - double *charges; - double *charges_reduced; - - memory->create(charges, atom->natoms, "mdi/engine:charges"); - memory->create(charges_reduced, atom->natoms, "mdi/engine:charges_reduced"); - - // zero the charges array - - for (int icharge = 0; icharge < atom->natoms; icharge++) charges[icharge] = 0.0; - - // pick local atoms from the buffer - - double *charge = atom->q; - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { charges[atom->tag[i] - 1] = charge[i]; } - - MPI_Reduce(charges, charges_reduced, atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - ierr = MDI_Send((char *) charges_reduced, atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send charges to driver"); - - memory->destroy(charges); - memory->destroy(charges_reduced); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::send_energy(Error *error) -{ - // get conversion factor to atomic units - double energy_conv = 1.0; - if (lmpunits == REAL) { - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - energy_conv = kelvin_to_hartree / force->boltz; - } else if (lmpunits == METAL) { - double ev_to_hartree; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - energy_conv = ev_to_hartree; - } - - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - - double potential_energy = pe->compute_scalar(); - double kinetic_energy = ke->compute_scalar(); - double total_energy; - double *send_energy = &total_energy; - - // convert the energy to atomic units - potential_energy *= energy_conv; - kinetic_energy *= energy_conv; - total_energy = potential_energy + kinetic_energy; - - ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send potential energy to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::send_pe(Error *error) -{ - // get conversion factor to atomic units - double energy_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - energy_conv = kelvin_to_hartree / force->boltz; - } else if (lmpunits == METAL) { - double ev_to_hartree; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - energy_conv = ev_to_hartree; - } - - double potential_energy = pe->compute_scalar(); - double *send_energy = &potential_energy; - - // convert the energy to atomic units - potential_energy *= energy_conv; - - ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send potential energy to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::send_ke(Error *error) -{ - // get conversion factor to atomic units - double energy_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - energy_conv = kelvin_to_hartree / force->boltz; - } else if (lmpunits == METAL) { - double ev_to_hartree; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - energy_conv = ev_to_hartree; - } - - double kinetic_energy = ke->compute_scalar(); - double *send_energy = &kinetic_energy; - - // convert the energy to atomic units - kinetic_energy *= energy_conv; - - ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send potential energy to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::send_types(Error *error) -{ - int *const type = atom->type; - - ierr = MDI_Send((char *) type, atom->natoms, MDI_INT, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send atom types to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::send_labels(Error *error) -{ - char *labels = new char[atom->natoms * MDI_LABEL_LENGTH]; - memset(labels, ' ', atom->natoms * MDI_LABEL_LENGTH); - - for (int iatom = 0; iatom < atom->natoms; iatom++) { - std::string label = std::to_string(atom->type[iatom]); - int label_len = std::min(int(label.length()), MDI_LABEL_LENGTH); - strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); - } - - ierr = MDI_Send(labels, atom->natoms * MDI_LABEL_LENGTH, MDI_CHAR, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send atom types to driver"); - - delete[] labels; -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::send_masses(Error *error) -{ - double *const rmass = atom->rmass; - double *const mass = atom->mass; - int *const type = atom->type; - int nlocal = atom->nlocal; - - double *mass_by_atom; - double *mass_by_atom_reduced; - memory->create(mass_by_atom, atom->natoms, "mdi/engine:mass_by_atom"); - memory->create(mass_by_atom_reduced, atom->natoms, "mdi/engine:mass_by_atom_reduced"); - for (int iatom = 0; iatom < atom->natoms; iatom++) { mass_by_atom[iatom] = 0.0; } - - // determine the atomic masses - - if (rmass) { - for (int iatom = 0; iatom < nlocal; iatom++) { - mass_by_atom[atom->tag[iatom] - 1] = rmass[iatom]; - } - } else { - for (int iatom = 0; iatom < nlocal; iatom++) { - mass_by_atom[atom->tag[iatom] - 1] = mass[type[iatom]]; - } - } - - MPI_Reduce(mass_by_atom, mass_by_atom_reduced, atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - // send the atomic masses to the driver - - ierr = MDI_Send((char *) mass_by_atom_reduced, atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send atom masses to driver"); - - memory->destroy(mass_by_atom); - memory->destroy(mass_by_atom_reduced); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::send_forces(Error *error) -{ - // get conversion factor to atomic units - double force_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = (kelvin_to_hartree / force->boltz) * (force->angstrom / angstrom_to_bohr); - } else if (lmpunits == METAL) { - double ev_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = ev_to_hartree / angstrom_to_bohr; - } - - double *forces; - double *forces_reduced; - double *x_buf; - - int nlocal = atom->nlocal; - int64_t ncoords = 3 * atom->natoms; - - memory->create(forces, ncoords, "mdi/engine:forces"); - memory->create(forces_reduced, ncoords, "mdi/engine:forces_reduced"); - x_buf = new double[3 * nlocal]; - - // zero the forces array - - for (int iforce = 0; iforce < 3 * atom->natoms; iforce++) forces[iforce] = 0.0; - - // if not at a node, calculate the forces - - if (strcmp(current_node, "@DEFAULT") == 0) { - // certain fixes, such as shake, move the coordinates - // to ensure that the coordinates do not change, store a copy - double **x = atom->x; - for (int i = 0; i < nlocal; i++) { - x_buf[3 * i + 0] = x[i][0]; - x_buf[3 * i + 1] = x[i][1]; - x_buf[3 * i + 2] = x[i][2]; - } - - // calculate the forces - update->whichflag = 1; // 1 for dynamics - update->nsteps = 1; - lmp->init(); - update->integrate->setup_minimal(1); - - if (strcmp(current_node, "@DEFAULT") == 0) { - // restore the original set of coordinates - double **x_new = atom->x; - for (int i = 0; i < nlocal; i++) { - x_new[i][0] = x_buf[3 * i + 0]; - x_new[i][1] = x_buf[3 * i + 1]; - x_new[i][2] = x_buf[3 * i + 2]; - } - } - } - - // pick local atoms from the buffer - double **f = atom->f; - for (int i = 0; i < nlocal; i++) { - forces[3 * (atom->tag[i] - 1) + 0] = f[i][0] * force_conv; - forces[3 * (atom->tag[i] - 1) + 1] = f[i][1] * force_conv; - forces[3 * (atom->tag[i] - 1) + 2] = f[i][2] * force_conv; - } - - // reduce the forces onto rank 0 - MPI_Reduce(forces, forces_reduced, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - // send the forces through MDI - ierr = MDI_Send((char *) forces_reduced, 3 * atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send atom forces to driver"); - - memory->destroy(forces); - memory->destroy(forces_reduced); - delete[] x_buf; -} - -/* ---------------------------------------------------------------------- */ - -// Receive forces from the driver -// mode = 0: replace current forces with forces from driver -// mode = 1: add forces from driver to current forces - -void FixMDIEngineOld::receive_forces(Error *error, int mode) -{ - // get conversion factor to atomic units - double force_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = (kelvin_to_hartree / force->boltz) * (force->angstrom / angstrom_to_bohr); - } else if (lmpunits == METAL) { - double ev_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = ev_to_hartree / angstrom_to_bohr; - } - - int64_t ncoords = 3 * atom->natoms; - double *forces; - memory->create(forces, ncoords, "mdi/engine:forces"); - - ierr = MDI_Recv((char *) forces, 3 * atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to receive atom forces to driver"); - MPI_Bcast(forces, 3 * atom->natoms, MPI_DOUBLE, 0, world); - - // pick local atoms from the buffer - double **f = atom->f; - int nlocal = atom->nlocal; - - if (mode == 0) { // Replace - for (int i = 0; i < nlocal; i++) { - f[i][0] = forces[3 * (atom->tag[i] - 1) + 0] / force_conv; - f[i][1] = forces[3 * (atom->tag[i] - 1) + 1] / force_conv; - f[i][2] = forces[3 * (atom->tag[i] - 1) + 2] / force_conv; - } - } else { - for (int i = 0; i < nlocal; i++) { - f[i][0] += forces[3 * (atom->tag[i] - 1) + 0] / force_conv; - f[i][1] += forces[3 * (atom->tag[i] - 1) + 1] / force_conv; - f[i][2] += forces[3 * (atom->tag[i] - 1) + 2] / force_conv; - } - } - - memory->destroy(forces); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::send_cell(Error *error) -{ - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - - double celldata[9]; - - celldata[0] = domain->boxhi[0] - domain->boxlo[0]; - celldata[1] = 0.0; - celldata[2] = 0.0; - celldata[3] = domain->xy; - celldata[4] = domain->boxhi[1] - domain->boxlo[1]; - celldata[5] = 0.0; - celldata[6] = domain->xz; - celldata[7] = domain->yz; - celldata[8] = domain->boxhi[2] - domain->boxlo[2]; - - // convert the units to bohr - - double unit_conv = force->angstrom * angstrom_to_bohr; - for (int icell = 0; icell < 9; icell++) { celldata[icell] *= unit_conv; } - - ierr = MDI_Send((char *) celldata, 9, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send cell dimensions to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::receive_cell(Error *error) -{ - double celldata[9]; - - // receive the new cell vector from the driver - ierr = MDI_Recv((char *) celldata, 9, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send cell dimensions to driver"); - MPI_Bcast(&celldata[0], 9, MPI_DOUBLE, 0, world); - - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - double unit_conv = force->angstrom * angstrom_to_bohr; - for (int icell = 0; icell < 9; icell++) { celldata[icell] /= unit_conv; } - - // ensure that the new cell vector is orthogonal - double small = std::numeric_limits::min(); - if (fabs(celldata[1]) > small or fabs(celldata[2]) > small or fabs(celldata[3]) > small or - fabs(celldata[5]) > small or fabs(celldata[6]) > small or fabs(celldata[7]) > small) { - error->all(FLERR, - "MDI: LAMMPS currently only supports the >CELL command for orthogonal cell vectors"); - } - - // set the new LAMMPS cell dimensions - // This only works for orthogonal cell vectors. - // Supporting the more general case would be possible, - // but considerably more complex. - domain->boxhi[0] = celldata[0] + domain->boxlo[0]; - domain->boxhi[1] = celldata[4] + domain->boxlo[1]; - domain->boxhi[2] = celldata[8] + domain->boxlo[2]; - domain->xy = 0.0; - domain->xz = 0.0; - domain->yz = 0.0; -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::send_celldispl(Error *error) -{ - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - - double celldata[3]; - - celldata[0] = domain->boxlo[0]; - celldata[1] = domain->boxlo[1]; - celldata[2] = domain->boxlo[2]; - - // convert the units to bohr - - double unit_conv = force->angstrom * angstrom_to_bohr; - for (int icell = 0; icell < 3; icell++) { celldata[icell] *= unit_conv; } - - ierr = MDI_Send((char *) celldata, 3, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send cell displacement to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngineOld::receive_celldispl(Error *error) -{ - // receive the cell displacement from the driver - double celldata[3]; - ierr = MDI_Recv((char *) celldata, 3, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to receive cell displacement from driver"); - MPI_Bcast(&celldata[0], 3, MPI_DOUBLE, 0, world); - - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - double unit_conv = force->angstrom * angstrom_to_bohr; - - double old_boxlo[3]; - old_boxlo[0] = domain->boxlo[0]; - old_boxlo[1] = domain->boxlo[1]; - old_boxlo[2] = domain->boxlo[2]; - - // adjust the values of boxlo and boxhi for the new cell displacement vector - domain->boxlo[0] = celldata[0] / unit_conv; - domain->boxlo[1] = celldata[1] / unit_conv; - domain->boxlo[2] = celldata[2] / unit_conv; - domain->boxhi[0] += domain->boxlo[0] - old_boxlo[0]; - domain->boxhi[1] += domain->boxlo[1] - old_boxlo[1]; - domain->boxhi[2] += domain->boxlo[2] - old_boxlo[2]; -} diff --git a/src/MDI/fix_mdi_engine_old.h b/src/MDI/fix_mdi_engine_old.h deleted file mode 100644 index 4fc87999a0..0000000000 --- a/src/MDI/fix_mdi_engine_old.h +++ /dev/null @@ -1,143 +0,0 @@ -/* -*- 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 FIX_CLASS -// clang-format off -FixStyle(mdi/engine/old, FixMDIEngineOld); -// clang-format on -#else - -#ifndef LMP_FIX_MDI_ENGINE_OLD_H -#define LMP_FIX_MDI_ENGINE_OLD_H - -#include "fix.h" -#include "mdi.h" - -namespace LAMMPS_NS { - -class FixMDIEngineOld : public Fix { - public: - FixMDIEngineOld(class LAMMPS *, int, char **); - ~FixMDIEngineOld(); - int setmask(); - void init(); - - int execute_command(const char *command, MDI_Comm driver_socket); - char *engine_mode(const char *node); - - // receive and update forces - - //void setup(int); - void min_setup(int); - void post_integrate(); - void post_force(int); - void min_pre_force(int); //@COORDS - void min_post_force(int); //@FORCES - - double *add_force; // stores forces added using +FORCE command - double potential_energy; // stores potential energy - double kinetic_energy; // stores kinetic energy - - // current command - - char *command; - - protected: - void exchange_forces(); - - private: - int lmpunits; // REAL or METAL - int master, ierr; - int driver_socket; - int most_recent_init; // which MDI init command was most recently received? - // 0 - none - // 1 - MD - // 2 - OPTG - bool exit_flag; - bool local_exit_flag; - char *current_node; - char *target_node; // is the code supposed to advance to a particular node? - // 0 - none - // 1 - @COORDS (before pre-force calculation) - // 2 - @PRE-FORCES (before final force calculation) - // 3 - @FORCES (before time integration) - // -1 - after MD_INIT command - // -2 - after MD_INIT command followed by @PRE-FORCES (actually @INIT_OPTG?) - - // command to be executed at the target node - - char *target_command; - - char *id_pe; - char *id_ke; - class Irregular *irregular; - class Minimize *minimizer; - class Compute *pe; - class Compute *ke; - - void send_types(Error *); - void send_labels(Error *); - void send_masses(Error *); - void receive_coordinates(Error *); - void send_coordinates(Error *); - void send_charges(Error *); - void send_energy(Error *); - void send_forces(Error *); - void send_pe(Error *); - void send_ke(Error *); - void receive_forces(Error *, int); - void send_cell(Error *); - void receive_cell(Error *); - void send_celldispl(Error *); - void receive_celldispl(Error *); -}; - -} // namespace LAMMPS_NS - -#endif -#endif - -/* ERROR/WARNING messages: - -E: Illegal ... command - -Self-explanatory. - -E: Potential energy ID for fix mdi does not exist - -Self-explanatory. - -E: Cannot use MDI command without atom IDs - -Self-explanatory. - -E: MDI command requires consecutive atom IDs - -Self-explanatory. - -E: Unable to connect to driver - -Self-explanatory. - -E: Unable to ... driver - -Self-explanatory. - -E: Unknown command from driver - -The driver sent a command that is not supported by the LAMMPS -interface. In some cases this might be because a nonsensical -command was sent (i.e. "SCF"). In other cases, the LAMMPS -interface might benefit from being expanded. - -*/ diff --git a/src/MDI/mdi_engine_old.cpp b/src/MDI/mdi_engine_old.cpp deleted file mode 100644 index cb711c2780..0000000000 --- a/src/MDI/mdi_engine_old.cpp +++ /dev/null @@ -1,345 +0,0 @@ -/* ---------------------------------------------------------------------- - 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: Taylor Barnes (MolSSI) - MolSSI Driver Interface (MDI) support for LAMMPS -------------------------------------------------------------------------- */ - -#include "mdi_engine_old.h" - -#include "atom.h" -#include "error.h" -#include "fix_mdi_engine_old.h" -#include "force.h" -#include "mdi.h" -#include "min.h" -#include "minimize.h" -#include "modify.h" -#include "output.h" -#include "timer.h" -#include "update.h" -#include "verlet.h" - -#include -#include - -using namespace LAMMPS_NS; - -/* ---------------------------------------------------------------------- - trigger LAMMPS to start acting as an MDI engine - endlessly loop over receiving commands from driver and responding - much of the logic for this is in FixMDIEngine - when EXIT command is received, mdi/engine command exits ----------------------------------------------------------------------- */ - -void MDIEngineOld::command(int narg, char ** /*arg*/) -{ - // list of nodes and commands that a MDI-compliant MD code should support - - // default node and its commands - - MDI_Register_node("@DEFAULT"); - MDI_Register_command("@DEFAULT", "<@"); - MDI_Register_command("@DEFAULT", "CELL"); - MDI_Register_command("@DEFAULT", ">CELL_DISPL"); - MDI_Register_command("@DEFAULT", ">COORDS"); - MDI_Register_command("@DEFAULT", "@INIT_MD"); - MDI_Register_command("@DEFAULT", "@INIT_OPTG"); - MDI_Register_command("@DEFAULT", "EXIT"); - - // node for setting up and running a dynamics simulation - - MDI_Register_node("@INIT_MD"); - MDI_Register_command("@INIT_MD", "<@"); - MDI_Register_command("@INIT_MD", "CELL"); - MDI_Register_command("@INIT_MD", ">CELL_DISPL"); - MDI_Register_command("@INIT_MD", ">COORDS"); - MDI_Register_command("@INIT_MD", ">FORCES"); - MDI_Register_command("@INIT_MD", ">+FORCES"); - MDI_Register_command("@INIT_MD", "@"); - MDI_Register_command("@INIT_MD", "@COORDS"); - MDI_Register_command("@INIT_MD", "@DEFAULT"); - MDI_Register_command("@INIT_MD", "@FORCES"); - MDI_Register_command("@INIT_MD", "EXIT"); - - // node for setting up and running a minimization - - MDI_Register_node("@INIT_OPTG"); - MDI_Register_command("@INIT_OPTG", "<@"); - MDI_Register_command("@INIT_OPTG", "CELL"); - MDI_Register_command("@INIT_OPTG", ">CELL_DISPL"); - MDI_Register_command("@INIT_OPTG", ">COORDS"); - MDI_Register_command("@INIT_OPTG", ">FORCES"); - MDI_Register_command("@INIT_OPTG", ">+FORCES"); - MDI_Register_command("@INIT_OPTG", "@"); - MDI_Register_command("@INIT_OPTG", "@COORDS"); - MDI_Register_command("@INIT_OPTG", "@DEFAULT"); - MDI_Register_command("@INIT_OPTG", "@FORCES"); - MDI_Register_command("@INIT_OPTG", "EXIT"); - - // node at POST_FORCE location in timestep - - MDI_Register_node("@FORCES"); - MDI_Register_callback("@FORCES", ">FORCES"); - MDI_Register_callback("@FORCES", ">+FORCES"); - MDI_Register_command("@FORCES", "<@"); - MDI_Register_command("@FORCES", "CELL"); - MDI_Register_command("@FORCES", ">CELL_DISPL"); - MDI_Register_command("@FORCES", ">COORDS"); - MDI_Register_command("@FORCES", ">FORCES"); - MDI_Register_command("@FORCES", ">+FORCES"); - MDI_Register_command("@FORCES", "@"); - MDI_Register_command("@FORCES", "@COORDS"); - MDI_Register_command("@FORCES", "@DEFAULT"); - MDI_Register_command("@FORCES", "@FORCES"); - MDI_Register_command("@FORCES", "EXIT"); - - // node at POST_INTEGRATE location in timestep - - MDI_Register_node("@COORDS"); - MDI_Register_command("@COORDS", "<@"); - MDI_Register_command("@COORDS", "CELL"); - MDI_Register_command("@COORDS", ">CELL_DISPL"); - MDI_Register_command("@COORDS", ">COORDS"); - MDI_Register_command("@COORDS", ">FORCES"); - MDI_Register_command("@COORDS", ">+FORCES"); - MDI_Register_command("@COORDS", "@"); - MDI_Register_command("@COORDS", "@COORDS"); - MDI_Register_command("@COORDS", "@DEFAULT"); - MDI_Register_command("@COORDS", "@FORCES"); - MDI_Register_command("@COORDS", "EXIT"); - - // if the mdi/engine fix is not already present, add it now - - std::vector matches = modify->get_fix_by_style("mdi/engine/old"); - bool added_mdi_engine_fix = false; - if (matches.size() == 0) { - modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine/old"); - added_mdi_engine_fix = true; - } - - // identify the mdi_engine fix - - matches = modify->get_fix_by_style("mdi/engine/old"); - mdi_fix = (FixMDIEngineOld *) matches[0]; - - // check that LAMMPS is setup as a compatible MDI engine - - if (narg > 0) error->all(FLERR, "Illegal mdi/engine command"); - - if (atom->tag_enable == 0) error->all(FLERR, "Cannot use mdi/engine without atom IDs"); - - if (atom->tag_consecutive() == 0) error->all(FLERR, "mdi/engine requires consecutive atom IDs"); - - // endless engine loop, responding to driver commands - - char *command; - - while (1) { - - // mdi/engine command only recognizes three nodes - // DEFAULT, INIT_MD, INIT_OPTG - - command = mdi_fix->engine_mode("@DEFAULT"); - - // MDI commands for dynamics or minimization - - if (strcmp(command, "@INIT_MD") == 0) { - command = mdi_md(); - if (strcmp(command, "EXIT")) break; - - } else if (strcmp(command, "@INIT_OPTG") == 0) { - command = mdi_optg(); - if (strcmp(command, "EXIT")) break; - - } else if (strcmp(command, "EXIT") == 0) { - break; - - } else - error->all(FLERR, "MDI node exited with invalid command: {}", command); - } - - // remove mdi/engine fix that mdi/engine instantiated - - if (added_mdi_engine_fix) modify->delete_fix("MDI_ENGINE_INTERNAL"); -} - -/* ---------------------------------------------------------------------- - run an MD simulation under control of driver ----------------------------------------------------------------------- */ - -char *MDIEngineOld::mdi_md() -{ - // initialize an MD simulation - - update->whichflag = 1; - timer->init_timeout(); - update->nsteps = 1; - update->ntimestep = 0; - update->firststep = update->ntimestep; - update->laststep = update->ntimestep + update->nsteps; - update->beginstep = update->firststep; - update->endstep = update->laststep; - - lmp->init(); - - // engine is now at @INIT_MD node - - char *command = nullptr; - command = mdi_fix->engine_mode("@INIT_MD"); - - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; - - // setup the MD simulation - - update->integrate->setup(1); - - command = mdi_fix->engine_mode("@FORCES"); - - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; - - // run MD one step at a time - - while (1) { - update->whichflag = 1; - timer->init_timeout(); - update->nsteps += 1; - update->laststep += 1; - update->endstep = update->laststep; - output->next = update->ntimestep + 1; - - // single MD timestep - - update->integrate->run(1); - - // done with MD if driver sends @DEFAULT or EXIT - - command = mdi_fix->command; - - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; - } - - return nullptr; -} - -/* ---------------------------------------------------------------------- - perform minimization under control of driver ----------------------------------------------------------------------- */ - -char *MDIEngineOld::mdi_optg() -{ - - // setup the minimizer in a way that ensures optimization - // will continue until MDI driver exits - - update->etol = std::numeric_limits::min(); - update->ftol = std::numeric_limits::min(); - update->nsteps = std::numeric_limits::max(); - update->max_eval = std::numeric_limits::max(); - - update->whichflag = 2; - update->beginstep = update->firststep = update->ntimestep; - update->endstep = update->laststep = update->firststep + update->nsteps; - - lmp->init(); - - // engine is now at @INIT_OPTG node - - char *command = nullptr; - command = mdi_fix->engine_mode("@INIT_OPTG"); - - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; - - // setup the minimization - - update->minimize->setup(); - - // get new command - - command = mdi_fix->command; - - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; - - // Start a minimization, which is configured to run (essentially) - // infinite steps. When the driver sends the EXIT command, - // the minimizer's energy and force tolerances are set to - // extremely large values, causing the minimization to end. - - update->minimize->iterate(update->nsteps); - - // return if driver sends @DEFAULT or EXIT - - command = mdi_fix->command; - - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; - - error->all(FLERR, "MDI reached end of OPTG simulation with invalid command: {}", command); - return nullptr; -} diff --git a/src/MDI/mdi_engine_old.h b/src/MDI/mdi_engine_old.h deleted file mode 100644 index bea4574e61..0000000000 --- a/src/MDI/mdi_engine_old.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- 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 COMMAND_CLASS -// clang-format off -CommandStyle(mdi/engine, MDIEngineOld); -// clang-format on -#else - -#ifndef LMP_MDI_ENGINE_OLD_H -#define LMP_MDI_ENGINE_OLD_H - -#include "command.h" - -namespace LAMMPS_NS { - -class MDIEngineOld : public Command { - public: - MDIEngineOld(LAMMPS *lmp) : Command(lmp) {} - virtual ~MDIEngineOld() {} - void command(int, char **); - - private: - class FixMDIEngineOld *mdi_fix; - - char *mdi_md(); - char *mdi_optg(); -}; - -} // 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. - -*/ diff --git a/src/MDI/mdi_plugin.cpp b/src/MDI/mdi_plugin.cpp index 34402ee85b..9d2d2b6475 100644 --- a/src/MDI/mdi_plugin.cpp +++ b/src/MDI/mdi_plugin.cpp @@ -91,6 +91,7 @@ MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) } // find FixMDIAimd instance so can reset its mdicomm + // NOTE: this is a kludge - need better way to handle this fixptr = modify->get_fix_by_style("mdi/aimd")[0]; @@ -98,11 +99,7 @@ MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // path for lib was specified in -mdi command-line arg when LAMMPS started // this calls back to plugin_wrapper, which must issue MDI EXIT at end - printf("PRE-LAUNCH\n"); - printf("NAME %s\n",plugin_name); - printf("ARGS %s\n",plugin_args); - - MDI_Launch_plugin(plugin_name,plugin_args,world,plugin_wrapper,(void *)this); + MDI_Launch_plugin(plugin_name,plugin_args,&world,plugin_wrapper,(void *)this); delete [] plugin_args; } @@ -116,14 +113,12 @@ MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) int MDIPlugin::plugin_wrapper(void *pmpicomm, MDI_Comm mdicomm, void *vptr) { - printf("INSIDE CALLBACK\n"); - MPI_Comm mpicomm = *(MPI_Comm *) pmpicomm; MDIPlugin *ptr = (MDIPlugin *) vptr; LAMMPS *lammps = ptr->lmp; char *lammps_command = ptr->lammps_command; - // set FixMDIAimd mdicomm to this mdicomm + // set FixMDIAimd mdicomm to driver's mdicomm passed to this callback FixMDIAimd *aimdptr = (FixMDIAimd *) (ptr->fixptr); aimdptr->mdicomm = mdicomm; @@ -131,8 +126,6 @@ int MDIPlugin::plugin_wrapper(void *pmpicomm, MDI_Comm mdicomm, // invoke the specified LAMMPS command // that operation will issue MDI commands to the plugin engine - printf("PRE RUN command: %s\n",lammps_command); - lammps->input->one(lammps_command); delete [] lammps_command; From 4f67f586d0aadcb15561f3d72f10de8781b3b355 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Thu, 7 Apr 2022 10:02:58 -0600 Subject: [PATCH 105/130] Fix memory issue and leftover debugging --- src/KOKKOS/pair_dpd_ext_kokkos.cpp | 3 ++- src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp | 10 +++++----- src/KOKKOS/pair_dpd_kokkos.cpp | 4 ++-- src/KOKKOS/pair_dpd_tstat_kokkos.cpp | 5 ++--- src/KOKKOS/pair_reaxff_kokkos.cpp | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp index e9bb3510d8..4b6096272a 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -111,7 +111,7 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) eflag = eflagin; vflag = vflagin; if (neighflag == FULL) no_virial_fdotr_compute = 1; - ev_init(eflag,vflag); + ev_init(eflag,vflag,0); if (eflag_atom) { memoryKK->destroy_kokkos(k_eatom,eatom); @@ -307,6 +307,7 @@ void PairDPDExtKokkos::operator() (TagDPDExtKokkos::compute(int eflagin, int vflagin) eflag = eflagin; vflag = vflagin; if (neighflag == FULL) no_virial_fdotr_compute = 1; - ev_init(eflag,vflag); + ev_init(eflag,vflag,0); // adjust sigma if target T is changing if (t_start != t_stop) { @@ -317,10 +317,10 @@ void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos::compute(int eflagin, int vflagin) eflag = eflagin; vflag = vflagin; if (neighflag == FULL) no_virial_fdotr_compute = 1; - ev_init(eflag,vflag); + ev_init(eflag,vflag,0); if (eflag_atom) { memoryKK->destroy_kokkos(k_eatom,eatom); @@ -288,7 +288,7 @@ void PairDPDKokkos::operator() (TagDPDKokkos::compute(int eflagin, int vflagin) eflag = eflagin; vflag = vflagin; if (neighflag == FULL) no_virial_fdotr_compute = 1; - ev_init(eflag,vflag); + ev_init(eflag,vflag,0); // adjust sigma if target T is changing if (t_start != t_stop) { @@ -300,8 +300,7 @@ void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos::compute(int eflag_in, int vflag_in) eflag = eflag_in; vflag = vflag_in; - ev_init(eflag,vflag); + ev_init(eflag,vflag,0); atomKK->sync(execution_space,datamask_read); k_params_sing.template sync(); From 2956aee8dc214763855254ff5e32d88c936e74ec Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Thu, 7 Apr 2022 10:45:50 -0600 Subject: [PATCH 106/130] Small tweaks --- src/KOKKOS/pair_dpd_ext_kokkos.cpp | 1 + src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp | 1 + src/KOKKOS/pair_dpd_kokkos.cpp | 1 + src/KOKKOS/pair_dpd_tstat_kokkos.cpp | 1 + src/KOKKOS/pair_dpd_tstat_kokkos.h | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp index 4b6096272a..3a1c5f1ee2 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -241,6 +241,7 @@ void PairDPDExtKokkos::operator() (TagDPDExtKokkostemplate operator()(TagDPDExtKokkos(), ii, ev); } + template template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp index d32ee2e196..71ac1179e9 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp @@ -255,6 +255,7 @@ void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkostemplate operator()(TagDPDExtTstatKokkos(), ii, ev); } + template template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_dpd_kokkos.cpp b/src/KOKKOS/pair_dpd_kokkos.cpp index a55e851e0d..550c5e80d0 100644 --- a/src/KOKKOS/pair_dpd_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_kokkos.cpp @@ -241,6 +241,7 @@ void PairDPDKokkos::operator() (TagDPDKokkostemplate operator()(TagDPDKokkos(), ii, ev); } + template template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp index 594ab78611..f161f5f688 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp @@ -254,6 +254,7 @@ void PairDPDTstatKokkos::operator() (TagDPDTstatKokkostemplate operator()(TagDPDTstatKokkos(), ii, ev); } + template template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.h b/src/KOKKOS/pair_dpd_tstat_kokkos.h index 5e5e126299..4c76c1788e 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.h +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.h @@ -132,7 +132,7 @@ class PairDPDTstatKokkos : public PairDPDTstat { typename AT::t_efloat_1d d_eatom; typename AT::t_virial_array d_vatom; - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const; friend void pair_virial_fdotr_compute(PairDPDTstatKokkos*); From 9b969648d579202c903570a954e7e77668a12d03 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 7 Apr 2022 11:51:52 -0400 Subject: [PATCH 107/130] add kimplugin source and CMake based build support --- doc/src/Developer_plugins.rst | 21 ++++ doc/src/plugin.rst | 9 +- examples/kim/plugin/CMakeLists.txt | 109 +++++++++++++++++++ examples/kim/plugin/LAMMPSInterfaceCXX.cmake | 88 +++++++++++++++ examples/kim/plugin/kimplugin.cpp | 54 +++++++++ 5 files changed, 276 insertions(+), 5 deletions(-) create mode 100644 examples/kim/plugin/CMakeLists.txt create mode 100644 examples/kim/plugin/LAMMPSInterfaceCXX.cmake create mode 100644 examples/kim/plugin/kimplugin.cpp diff --git a/doc/src/Developer_plugins.rst b/doc/src/Developer_plugins.rst index 96bb872929..1f698d27d5 100644 --- a/doc/src/Developer_plugins.rst +++ b/doc/src/Developer_plugins.rst @@ -262,3 +262,24 @@ A plugin may be registered under an existing style name. In that case the plugin will override the existing code. This can be used to modify the behavior of existing styles or to debug new versions of them without having to re-compile or re-install all of LAMMPS. + +Compiling plugins +^^^^^^^^^^^^^^^^^ + +Plugins need to be compiled with the same compilers and libraries +(e.g. MPI) and compilation settings (MPI on/off, OpenMP, integer sizes) +as the LAMMPS executable and library. Otherwise the plugin will likely +not load due to mismatches in the function signatures (LAMMPS is C++ so +scope, type, and number of arguments are encoded into the symbol names +and thus differences in them will lead to failed plugin load commands. +Compilation of the plugin can be done managed via both, CMake or +traditional GNU makefiles. Some examples that can be used as a template +are in the ``examples/plugins`` folder. The CMake script code has some +small adjustments to allow building he plugins for running unit tests +with them. Another example that converts the KIM package into a plugin +can be found in the ``examples/kim/plugin`` folder. No changes to the +sources of the KIM package themselves are needed; only the plugin +interface and loader code needs to be added. This example only supports +building with CMake, but is probably a more typical example. To compile +you need to run CMake with -DLAMMPS_SOURCE_DIR=. +Other configuration setting are identical to those for compiling LAMMPS. diff --git a/doc/src/plugin.rst b/doc/src/plugin.rst index 83eea789d1..1a10ab84ad 100644 --- a/doc/src/plugin.rst +++ b/doc/src/plugin.rst @@ -70,12 +70,11 @@ Restrictions """""""""""" The *plugin* command is part of the PLUGIN package. It is -only enabled if LAMMPS was built with that package. -See the :doc:`Build package ` page for -more info. Plugins are not available on Windows. +only enabled if LAMMPS was built with that package. See +the :doc:`Build package ` page for more info. -If plugins access functions or classes from a package, LAMMPS must -have been compiled with that package included. +If plugins access functions or classes from a package, +LAMMPS must have been compiled with that package included. Plugins are dependent on the LAMMPS binary interface (ABI) and particularly the MPI library used. So they are not guaranteed diff --git a/examples/kim/plugin/CMakeLists.txt b/examples/kim/plugin/CMakeLists.txt new file mode 100644 index 0000000000..1d955aa8a1 --- /dev/null +++ b/examples/kim/plugin/CMakeLists.txt @@ -0,0 +1,109 @@ +########################################## +# CMake build system for plugin examples. +# The is meant to be used as a template for plugins that are +# distributed independent from the LAMMPS package. +########################################## + +cmake_minimum_required(VERSION 3.10) + +# enforce out-of-source build +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "In-source builds are not allowed. You must create and use a build directory. " + "Please remove CMakeCache.txt and CMakeFiles first.") +endif() + +project(kimplugin VERSION 1.0 LANGUAGES CXX) + +set(LAMMPS_SOURCE_DIR "" CACHE PATH "Location of LAMMPS sources folder") +if(NOT LAMMPS_SOURCE_DIR) + message(FATAL_ERROR "Must set LAMMPS_SOURCE_DIR") +endif() + +# by default, install into $HOME/.local (not /usr/local), +# so that no root access (and sudo) is needed +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Default install path" FORCE) +endif() + +# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro +# and prints lots of pointless warnings about "unsafe" functions +if(MSVC) + add_compile_options(/Zc:__cplusplus) + add_compile_options(/wd4244) + add_compile_options(/wd4267) + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) +endif() + +# C++11 is required +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# Need -restrict with Intel compilers +if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict") +endif() + +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +include(CheckIncludeFileCXX) +include(LAMMPSInterfaceCXX) + +########################## +# building the plugins + +add_library(kimplugin MODULE kimplugin.cpp ${LAMMPS_SOURCE_DIR}/KIM/pair_kim.cpp + ${LAMMPS_SOURCE_DIR}/KIM/fix_store_kim.cpp ${LAMMPS_SOURCE_DIR}/KIM/kim_command.cpp + ${LAMMPS_SOURCE_DIR}/KIM/kim_init.cpp ${LAMMPS_SOURCE_DIR}/KIM/kim_interactions.cpp + ${LAMMPS_SOURCE_DIR}/KIM/kim_param.cpp ${LAMMPS_SOURCE_DIR}/KIM/kim_property.cpp + ${LAMMPS_SOURCE_DIR}/KIM/kim_query.cpp ${LAMMPS_SOURCE_DIR}/KIM/kim_units.cpp) +target_link_libraries(kimplugin PRIVATE lammps) +target_include_directories(kimplugin PRIVATE ${LAMMPS_SOURCE_DIR}/KIM) +set_target_properties(kimplugin PROPERTIES PREFIX "" SUFFIX ".so") + +set(KIM-API_MIN_VERSION 2.1.3) +find_package(PkgConfig REQUIRED) +if(KIM-API_FOUND AND KIM-API_VERSION VERSION_GREATER_EQUAL 2.2.0) + # For kim-api >= 2.2.0 + find_package(KIM-API 2.2.0 CONFIG REQUIRED) + target_link_libraries(kimplugin PRIVATE KIM-API::kim-api) +else() + # For kim-api 2.1.3 (consistent with previous version of this file) + find_package(PkgConfig REQUIRED) + pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=${KIM-API_MIN_VERSION}) + target_link_libraries(kimplugin PRIVATE PkgConfig::KIM-API) +endif() + +########################## +# need libcurl +find_package(CURL) +if(CURL_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.12) + target_include_directories(kimplugin PRIVATE ${CURL_INCLUDE_DIRS}) + target_link_libraries(kimplugin PRIVATE ${CURL_LIBRARIES}) + else() + target_link_libraries(kimplugin PRIVATE CURL::libcurl) + endif() + target_compile_definitions(kimplugin PRIVATE -DLMP_KIM_CURL) + set(LMP_DEBUG_CURL OFF CACHE STRING "Set libcurl verbose mode on/off. If on, it displays a lot of verbose information about its operations.") + mark_as_advanced(LMP_DEBUG_CURL) + if(LMP_DEBUG_CURL) + target_compile_definitions(kimplugin PRIVATE -DLMP_DEBUG_CURL) + endif() + set(LMP_NO_SSL_CHECK OFF CACHE STRING "Tell libcurl to not verify the peer. If on, the connection succeeds regardless of the names in the certificate. Insecure - Use with caution!") + mark_as_advanced(LMP_NO_SSL_CHECK) + if(LMP_NO_SSL_CHECK) + target_compile_definitions(kimplugin PRIVATE -DLMP_NO_SSL_CHECK) + endif() +endif() + +# MacOS seems to need this +if(CMAKE_SYSTEM_NAME STREQUAL Darwin) + set_target_properties(kimplugin PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") +# tell CMake to export all symbols to a .dll on Windows with special case for MinGW cross-compilers + set_target_properties(kimplugin.so PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + if(CMAKE_CROSSCOMPILING) + set_target_properties(kimplugin PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols") + endif() +else() + set_target_properties(kimplugin PROPERTIES LINK_FLAGS "-rdynamic") +endif() diff --git a/examples/kim/plugin/LAMMPSInterfaceCXX.cmake b/examples/kim/plugin/LAMMPSInterfaceCXX.cmake new file mode 100644 index 0000000000..dfbd77e28a --- /dev/null +++ b/examples/kim/plugin/LAMMPSInterfaceCXX.cmake @@ -0,0 +1,88 @@ +# Cmake script code to define the LAMMPS C++ interface +# settings required for building LAMMPS plugins + +################################################################################ +# helper function +function(validate_option name values) + string(TOLOWER ${${name}} needle_lower) + string(TOUPPER ${${name}} needle_upper) + list(FIND ${values} ${needle_lower} IDX_LOWER) + list(FIND ${values} ${needle_upper} IDX_UPPER) + if(${IDX_LOWER} LESS 0 AND ${IDX_UPPER} LESS 0) + list_to_bulletpoints(POSSIBLE_VALUE_LIST ${${values}}) + message(FATAL_ERROR "\n########################################################################\n" + "Invalid value '${${name}}' for option ${name}\n" + "\n" + "Possible values are:\n" + "${POSSIBLE_VALUE_LIST}" + "########################################################################") + endif() +endfunction(validate_option) + +################################################################################# +# LAMMPS C++ interface. We only need the header related parts. +add_library(lammps INTERFACE) +target_include_directories(lammps INTERFACE ${LAMMPS_SOURCE_DIR}) +if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING) + target_link_libraries(lammps INTERFACE ${CMAKE_BINARY_DIR}/../liblammps.dll.a) +endif() +################################################################################ +# MPI configuration +if(NOT CMAKE_CROSSCOMPILING) + set(MPI_CXX_SKIP_MPICXX TRUE) + find_package(MPI QUIET) + option(BUILD_MPI "Build MPI version" ${MPI_FOUND}) +else() + option(BUILD_MPI "Build MPI version" OFF) +endif() + +if(BUILD_MPI) + find_package(MPI REQUIRED) + option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF) + if(LAMMPS_LONGLONG_TO_LONG) + target_compile_definitions(lammps INTERFACE -DLAMMPS_LONGLONG_TO_LONG) + endif() + target_link_libraries(lammps INTERFACE MPI::MPI_CXX) +else() + target_include_directories(lammps INTERFACE "${LAMMPS_SOURCE_DIR}/STUBS") +endif() + +set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)") +set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall) +set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES}) +validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES) +string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES) +target_compile_definitions(lammps INTERFACE -DLAMMPS_${LAMMPS_SIZES}) + +################################################################################ +# detect if we may enable OpenMP support by default +set(BUILD_OMP_DEFAULT OFF) +find_package(OpenMP QUIET) +if(OpenMP_FOUND) + check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE) + if(HAVE_OMP_H_INCLUDE) + set(BUILD_OMP_DEFAULT ON) + endif() +endif() + +option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT}) + +if(BUILD_OMP) + find_package(OpenMP REQUIRED) + check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE) + if(NOT HAVE_OMP_H_INCLUDE) + message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support") + endif() + + if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR + (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR + ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR + ((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0))) + # GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts. + # Intel 18.0 was tested to support both, so we switch to OpenMP 4+ from 19.x onward to be safe. + target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=4) + else() + target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=3) + endif() + target_link_libraries(lammps INTERFACE OpenMP::OpenMP_CXX) +endif() diff --git a/examples/kim/plugin/kimplugin.cpp b/examples/kim/plugin/kimplugin.cpp new file mode 100644 index 0000000000..45b1f75681 --- /dev/null +++ b/examples/kim/plugin/kimplugin.cpp @@ -0,0 +1,54 @@ + +#include "lammpsplugin.h" +#include "version.h" + +#include "pair_kim.h" +#include "fix_store_kim.h" +#include "kim_command.h" + +using namespace LAMMPS_NS; + +static Pair *pair_kim_creator(LAMMPS *lmp) +{ + return new PairKIM(lmp); +} + +static Fix *fix_store_kim_creator(LAMMPS *lmp, int argc, char **argv) +{ + return new FixStoreKIM(lmp, argc, argv); +} + +static Command *kim_command_creator(LAMMPS *lmp) +{ + return new KimCommand(lmp); +} + +extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc) +{ + lammpsplugin_t plugin; + lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc; + + // register kim pair style + plugin.version = LAMMPS_VERSION; + plugin.style = "pair"; + plugin.name = "kim"; + plugin.info = "KIM plugin pair style v1.0"; + plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)"; + plugin.creator.v1 = (lammpsplugin_factory1 *) &pair_kim_creator; + plugin.handle = handle; + (*register_plugin)(&plugin, lmp); + + // register fix STORE/KIM only need to update changed fields + plugin.style = "fix"; + plugin.name = "STORE/KIM"; + plugin.info = "Internal settings storage for KIM fix style v1.0"; + plugin.creator.v2 = (lammpsplugin_factory2 *) &fix_store_kim_creator; + (*register_plugin)(&plugin, lmp); + + // register KIM command + plugin.style = "command"; + plugin.name = "kim"; + plugin.info = "kim command style v1.0"; + plugin.creator.v1 = (lammpsplugin_factory1 *) &kim_command_creator; + (*register_plugin)(&plugin, lmp); +} From ddb6350fe835d0d02856c48a948fd628a073d938 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Thu, 7 Apr 2022 10:53:38 -0600 Subject: [PATCH 108/130] Remove unused var --- src/KOKKOS/pair_dpd_ext_kokkos.h | 2 +- src/KOKKOS/pair_dpd_ext_tstat_kokkos.h | 2 +- src/KOKKOS/pair_dpd_kokkos.h | 2 +- src/KOKKOS/pair_dpd_tstat_kokkos.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.h b/src/KOKKOS/pair_dpd_ext_kokkos.h index 0d7b3f1a18..160cf396a7 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.h +++ b/src/KOKKOS/pair_dpd_ext_kokkos.h @@ -59,7 +59,7 @@ class PairDPDExtKokkos : public PairDPDExt { params_dpd() {cut=ws=wsT=a0=gamma=sigma=gammaT=sigmaT=0;} KOKKOS_INLINE_FUNCTION params_dpd(int /*i*/) {cut=ws=wsT=a0=gamma=sigma=gammaT=sigmaT=0;} - F_FLOAT cutsq,cut,ws,wsT,a0,gamma,sigma,gammaT,sigmaT; + F_FLOAT cut,ws,wsT,a0,gamma,sigma,gammaT,sigmaT; }; template diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h index f9d32e2ab0..3d489e0165 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h @@ -59,7 +59,7 @@ class PairDPDExtTstatKokkos : public PairDPDExtTstat { params_dpd() {cut=ws=wsT=gamma=sigma=gammaT=sigmaT=0;} KOKKOS_INLINE_FUNCTION params_dpd(int /*i*/) {cut=ws=wsT=gamma=sigma=gammaT=sigmaT=0;} - F_FLOAT cutsq,cut,ws,wsT,gamma,sigma,gammaT,sigmaT; + F_FLOAT cut,ws,wsT,gamma,sigma,gammaT,sigmaT; }; template diff --git a/src/KOKKOS/pair_dpd_kokkos.h b/src/KOKKOS/pair_dpd_kokkos.h index bd7ad4dd4e..3299c533e2 100644 --- a/src/KOKKOS/pair_dpd_kokkos.h +++ b/src/KOKKOS/pair_dpd_kokkos.h @@ -59,7 +59,7 @@ class PairDPDKokkos : public PairDPD { params_dpd() {cut=a0=gamma=sigma=0;} KOKKOS_INLINE_FUNCTION params_dpd(int /*i*/) {cut=a0=gamma=sigma=0;} - F_FLOAT cutsq,cut,a0,gamma,sigma; + F_FLOAT cut,a0,gamma,sigma; }; template diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.h b/src/KOKKOS/pair_dpd_tstat_kokkos.h index 4c76c1788e..4e1efb930f 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.h +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.h @@ -59,7 +59,7 @@ class PairDPDTstatKokkos : public PairDPDTstat { params_dpd() {cut=gamma=sigma=0;} KOKKOS_INLINE_FUNCTION params_dpd(int /*i*/) {cut=gamma=sigma=0;} - F_FLOAT cutsq,cut,gamma,sigma; + F_FLOAT cut,gamma,sigma; }; template From e2f25a96e1362ca7aec03d26e0ec73ab9045befe Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 7 Apr 2022 14:50:33 -0400 Subject: [PATCH 109/130] spelling --- doc/src/Developer_plugins.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/src/Developer_plugins.rst b/doc/src/Developer_plugins.rst index 1f698d27d5..9bf52801a7 100644 --- a/doc/src/Developer_plugins.rst +++ b/doc/src/Developer_plugins.rst @@ -272,14 +272,14 @@ as the LAMMPS executable and library. Otherwise the plugin will likely not load due to mismatches in the function signatures (LAMMPS is C++ so scope, type, and number of arguments are encoded into the symbol names and thus differences in them will lead to failed plugin load commands. -Compilation of the plugin can be done managed via both, CMake or -traditional GNU makefiles. Some examples that can be used as a template -are in the ``examples/plugins`` folder. The CMake script code has some -small adjustments to allow building he plugins for running unit tests -with them. Another example that converts the KIM package into a plugin -can be found in the ``examples/kim/plugin`` folder. No changes to the -sources of the KIM package themselves are needed; only the plugin -interface and loader code needs to be added. This example only supports -building with CMake, but is probably a more typical example. To compile -you need to run CMake with -DLAMMPS_SOURCE_DIR=. -Other configuration setting are identical to those for compiling LAMMPS. +Compilation of the plugin can be managed via both, CMake or traditional +GNU makefiles. Some examples that can be used as a template are in the +``examples/plugins`` folder. The CMake script code has some small +adjustments to allow building the plugins for running unit tests with +them. Another example that converts the KIM package into a plugin can be +found in the ``examples/kim/plugin`` folder. No changes to the sources +of the KIM package themselves are needed; only the plugin interface and +loader code needs to be added. This example only supports building with +CMake, but is probably a more typical example. To compile you need to +run CMake with -DLAMMPS_SOURCE_DIR=. Other +configuration setting are identical to those for compiling LAMMPS. From 0b6aa59621e79b397230279b48eeb15400c8f0be Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 7 Apr 2022 14:42:58 -0600 Subject: [PATCH 110/130] updated doc pages --- doc/src/Howto_mdi.rst | 55 ++++++++------ doc/src/fix_mdi_aimd.rst | 32 ++++++-- doc/src/mdi.rst | 154 +++++++++++++++++++++++---------------- 3 files changed, 148 insertions(+), 93 deletions(-) diff --git a/doc/src/Howto_mdi.rst b/doc/src/Howto_mdi.rst index c46b740a5c..0c505bb184 100644 --- a/doc/src/Howto_mdi.rst +++ b/doc/src/Howto_mdi.rst @@ -3,7 +3,7 @@ Using LAMMPS with the MDI library for code coupling .. note:: - As of March 2022, this Howto page will soon replace the :doc:`Howto + As of April 2022, this Howto page will soon replace the :doc:`Howto client/server ` doc page. Client/server coupling of two (or more) codes is where one code is the @@ -36,8 +36,8 @@ of one or more engine codes. Driver and engine codes can be written in any language: C, C++, Fortran, Python, etc. In addition to allowing driver and engine(s) to run as stand-alone -executables, MDI also enables a server code to be a "plugin" to the -client code. In this scenario, server code(s) are compiled as shared +executables, MDI also enables an engine to be a *plugin* to the client +code. In this scenario, server code(s) are compiled as shared libraries, and one (or more) instances of the server are instantiated by the driver code. If the driver code runs in parallel, it can split its MPI communicator into multiple sub-communicators, and launch each @@ -46,7 +46,8 @@ within that sub-communicator exchange messages with the corresponding engine instance, and can also send MPI messages to other processors in the driver. The driver code can also destroy engine instances and re-instantiate them. LAMMPS can operate as either a stand-alone or -plugin MDI engine. +plugin MDI engine. When it operates as a driver, if can use either +stand-alone or plugin MDI engines. The way in which an MDI driver communicates with an MDI engine is by making MDI_Send() and MDI_Recv() calls, which are conceptually similar @@ -58,39 +59,45 @@ engine via MPI calls or sockets. This a run-time choice by the user. ---------- -The :ref:`MDI ` package provides a :doc:`mdi/engine -` command which enables LAMMPS to operate as an MDI -engine. Its doc page explains the variety of standard and custom MDI -commands which the LAMMPS engine recognizes and can respond to. +The :ref:`MDI ` package provides a :doc:`mdi engine ` +command which enables LAMMPS to operate as an MDI engine. Its doc +page explains the variety of standard and custom MDI commands which +the LAMMPS engine recognizes and can respond to. -The :ref:`MDI ` package also has a `fix mdi/aimd -` command in which LAMMPS operates as an MDI driver to -peform *ab initio* MD simulations in conjunction with a quantum -mechanics code. It's post_force() method illustrates how a driver -issues MDI commands to another code. +The package also provides a :doc:`mdi plugin ` command which +enables LAMMPS to operate as an MDI driver and load an MDI engine as a +plugin library. + +The package also has a `fix mdi/aimd ` command in which +LAMMPS operates as an MDI driver to peform *ab initio* MD simulations +in conjunction with a quantum mechanics code. Its post_force() method +illustrates how a driver issues MDI commands to another code. This +command can be used to couple to an MDI engine which is either a +stand-alone code or a plugin library. ---------- The examples/mdi directory contains Python scripts and LAMMPS input -script which use LAMMPS as either an MDI driver or engine. Three -example use cases are provided: +script which use LAMMPS as either an MDI driver or engine or both. +Three example use cases are provided: -* Run ab intitio MD (AIMD) with 2 instances of LAMMPS as driver and - engine. As an engine, LAMMPS is a surrogate for a quantum code. +* Run ab intitio MD (AIMD) using 2 instances of LAMMPS, one as driver + and one as an engine. As an engine, LAMMPS is a surrogate for a + quantum code. -* A python driver invokes a sequence of unrelated LAMMPS calculations. - Calculations can be single-point energy/force evaluations, full MD - runs, or full minimizations. +* A Python script driver invokes a sequence of unrelated LAMMPS + calculations. Calculations can be single-point energy/force + evaluations, MD runs, or energy minimizations. * Run AIMD with a Python driver code and 2 LAMMPS instances as - engines. The first LAMMPS instance performs MD timesteps. The + engines. The first LAMMPS instance performs MD timestepping. The second LAMMPS instance acts as a surrogate QM code to compute - forces. The aimd_driver.py code allows for the two engines - to be used in either stand-alone or plugin mode. + forces. Note that in any of these example where LAMMPS is used as an engine, an actual QM code (which supports MDI) could be used in its place, -without modifying any of the other scripts or code. +without modifying other code or scripts, except to specify the name of +the QM code. The examples/mdi/README file explains how to launch both driver and engine codes so that they communicate using the MDI library via either diff --git a/doc/src/fix_mdi_aimd.rst b/doc/src/fix_mdi_aimd.rst index 1e81fd5fa2..a9d33b8959 100644 --- a/doc/src/fix_mdi_aimd.rst +++ b/doc/src/fix_mdi_aimd.rst @@ -8,10 +8,11 @@ Syntax .. parsed-literal:: - fix ID group-ID mdi/aimd + fix ID group-ID mdi/aimd keyword * ID, group-ID are documented in :doc:`fix ` command * mdi/aimd = style name of this fix command +* optional keyword = *plugin* Examples """""""" @@ -19,6 +20,7 @@ Examples .. code-block:: LAMMPS fix 1 all mdi/aimd + fix 1 all mdi/aimd plugin Description """"""""""" @@ -31,19 +33,33 @@ More specifically, this command causes LAMMPS to begin using the `MDI Library `_ to run as an MDI driver (client), whicn sends MDI commands to an external MDI engine code (server) which in the case of AIMD is a -quantum mechanics (QM) code, or could be LAMMPS itself, asking as a +quantum mechanics (QM) code, or could be LAMMPS itself, actings as a surrogate for a QM code. See the :doc:`Howto mdi ` page for more information about how LAMMPS can operate as either an MDI driver or engine. The examples/mdi directory contains input scripts perfoming AIMD in this manner with LAMMPS acting as both a driver and an engine -(surrogate for a QM code). The examples/README file explains how to -launch both driver and engine codes so that they communicate using the -MDI library via either MPI or sockets. Any QM code that supports MDI -could be used in place of LAMMPS acting as a QM surrogate. See the -:doc:`Howto mdi ` page for a current list (March 2022) of -such QM codes. +(surrogate for a QM code). The examples/mdi/README file explains how +to launch both driver and engine codes so that they communicate using +the MDI library via either MPI or sockets. Any QM code that supports +MDI could be used in place of LAMMPS acting as a QM surrogate. See +the :doc:`Howto mdi ` page for a current list (March 2022) +of such QM codes. + +The engine code can run either as a stand-alone code, launched at the +same time as LAMMPS, or as a plugin library. See the :doc:`mdi plugin +` command for how to trigger LAMMPS to load the plugin library. +Again, the examples/mdi/README file explains how to launch both driver +and engine codes so that engine is used in plugin mode. + +To use this fix with a plugin engine, you must specify the +*plugin* keyword as the last argument, as illustrated above. + +.. note:: + + As of April 2022, the *plugin* keyword is needed. In a future + version of the MDI library it will no longer be necessary. ---------- diff --git a/doc/src/mdi.rst b/doc/src/mdi.rst index 830a0c5022..93eef50065 100644 --- a/doc/src/mdi.rst +++ b/doc/src/mdi.rst @@ -15,7 +15,8 @@ Syntax .. parsed-literal:: *engine* args = none - *plugin* args = keyword value keyword value ... + *plugin* args = name keyword value keyword value ... + name = name of plugin library, e.g. lammps means a liblammps.so library will be loaded keywords = *mdi* or *infile* or *extra* or *command* *mdi* value = args passed to MDI for driver to operate with plugins *infile* value = filename the engine will read at start-up @@ -38,59 +39,51 @@ Description This command implements two high-level operations within LAMMPS to use the `MDI Library ` for -coupling to another code. +coupling to other codes in a client/server protocol. -The *engine* mode enables LAMMPS to act as a server, responding to -requests from another client code to effectively couple the two codes -together in client/server mode. In MDI lingo this means LAMMPS -operates as an MDI engine. +The *engine* mode enables LAMMPS to act as an MDI engine (server), +responding to requests from an MDI driver (client) code. -The *plugin* mode enables LAMMPS to act as a client, and load the -server code as a library plugin. In MDI lingo this means LAMMPS -operates as an MDI driver, and the server is an MDI engine. In this -case the MDI engine is a library plugin. It can also be a stand-alone -code, lauched separately from LAMMPS. +The *plugin* mode enables LAMMPS to act as an MDI driver (client), and +load the MDI engine (server) code as a library plugin. In this case +the MDI engine is a library plugin. It can also be a stand-alone +code, launched separately from LAMMPS, in which case the mdi plugin +command is not used. See the Howto MDI doc page for a discussion of all the different ways -2 or more codes can interact via MDI. The examples/mdi/README file -has example use cases and launch commands for using LAMMPS as both a -driver and engine in all these different ways. +2 or more codes can interact via MDI. -The examples/mdi directory contains input scripts for LAMMPS acting as -an MDI engine to operate as a surrogate quantum mechanics (QM) code -for running ab initio MD (AIMD) or within a materials modeling -workflow to perform various MD tasks. It likewise has example scripts -for LAMMPS acting as an MDI driver for AIMD simulations, which could -use real QM codes which support MDI. The examples/mdi/README file -explains how to launch both driver and engine codes so that they -communicate using the MDI library via either MPI or sockets. +The examples/mdi directory has examples which use LAMMPS in 4 +different modes: as a driver using an engine as either a stand-alone +code or as a plugin, and as an engine operating as either a +stand-alone code or as a plugin. The README file in that directory +shows how to launch and couple codes for all the 4 usage modes, and so +they communicate via the MDI library using either MPI or sockets. ---------- -The *mdi engine* command should typically be used in an input script -after LAMMPS has setup the system it is going to model in -collaboration with the driver code. Depending on how the driver code -tells the LAMMPS engine to exit, other commands can be executed after -this command, but typically it should it is used at the end of a -LAMMPS input script. - - +The *mdi engine* command is used to make LAMMPS operate as an MDI +engine. It is typically used in an input script after LAMMPS has +setup the system it is going to model consistent with what the driver +code expects. Depending on when the driver code tells the LAMMPS +engine to exit, other commands can be executed after this command, but +typically it is used at the end of a LAMMPS input script. To act as an MDI engine operating as an MD code (or surrogate QM code), this is the list of standard MDI commands issued by a driver code which LAMMPS currently recognizes. Using standard commands defined by the MDI library means that a driver code can work -interchangeably with LAMMPS or other MD codes which support the MDI -standard. See more details about these commands in the `MDI library -documentation +interchangeably with LAMMPS or other MD codes or with QM codes which +support the MDI standard. See more details about these commands in +the `MDI library documentation `_ These commands are valid at the @DEFAULT node defined by MDI. Commands that start with ">" mean the driver is sending information to -the engine (LAMMMPS). Commands that start with "<" are requests by -the driver for LAMMPS to send it information. Commands that start -with a letter perform actions. Commands that start with "@" are MDI -"node" commands, which are described further below. +LAMMPS. Commands that start with "<" are requests by the driver for +LAMMPS to send it information. Commands that start with an alphabetic +letter perform actions. Commands that start with "@" are MDI "node" +commands, which are described further below. .. list-table:: :widths: 20 80 @@ -139,31 +132,30 @@ with a letter perform actions. Commands that start with "@" are MDI * - EXIT - Driver tells LAMMPS to exit engine mode - .. note:: The COORDS - command), then LAMMPS will do a more expensive operation to migrate - atoms to new processors as needed and re-neighbor. If the >NATOMS - or >TYPES commands have been sent (since the previous >COORDS - command), then LAMMPS assumes the system is new and re-initializes - an entirely new simulation. + compute atomic interactions for the current configuration of atoms + and size/shape of the simulation box. I.e. LAMMPS invokes its + pair, bond, angle, ..., kspace styles. If the driver is updating + the atom coordinates and/or box incrementally (as in an MD + simulation which the driver is managing), then the LAMMPS engine + will do the same, and only occasionally trigger neighbor list + builds. If the change in atom positions is large (since the + previous >COORDS command), then LAMMPS will do a more expensive + operation to migrate atoms to new processors as needed and + re-neighbor. If the >NATOMS or >TYPES commands have been sent + (since the previous >COORDS command), then LAMMPS assumes the + system is new and re-initializes an entirely new simulation. The MD and OPTG commands perform an entire MD simulation or energy -minimization (to convergence) with no communication with the driver +minimization (to convergence) with no communication from the driver until the simulation is complete. By contrast, the @INIT_MD and @INIT_OPTG commands allow the driver to communicate with the engine at each timestep of a dynamics run or iteration of a minimization; see more info below. -The MD command performa a simulation using the most recent >NSTEPS +The MD command performs a simulation using the most recent >NSTEPS value. The OPTG command performs a minimization using the 4 convergence paremeters from the most recent >TOLERANCE command. The 4 parameters sent are those used by the :doc:`minimize ` @@ -182,7 +174,7 @@ the @DEFAULT node defined by MDI: * - >COMMANDS - Send multiple LAMMPS input script commands as a newline-separated string (Nbytes in length) * - >INFILE - - Send filename of an input script to execute (Nbytes in length) + - Send filename of an input script to execute (filename Nbytes in length) * - ` command, should perform MDI +communication with the engine, while the specified *command* executes. +Note that if *command* is an :doc:`include ` command, then it +could specify a filename with multiple LAMMPS commands. + +.. note:: + + When the single *command* is complete, LAMMPS will send an MDI + EXIT command to the plugin engine and the plugin will be removed. + The "mdi plugin" command will then exit and the next command + (if any) in the LAMMPS input script will be processed. A subsequent + "mdi plugin" command could then load the same library plugin or + a different one if desired. Restrictions @@ -259,11 +291,11 @@ This command is part of the MDI package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` page for more info. -To use LAMMPS as an MDI engine in conjunction with other MDI-enabled -atomistic codes, the :doc:`units ` command should be used to -specify *real* or *metal* units. This will ensure the correct unit -conversions between LAMMPS and MDI units, which the other codes will -also perform in their preferred units. +To use LAMMPS in conjunction with other MDI-enabled atomistic codes, +the :doc:`units ` command should be used to specify *real* or +*metal* units. This will ensure the correct unit conversions between +LAMMPS and MDI units, which the other codes will also perform in their +preferred units. LAMMPS can also be used as an MDI engine in other unit choices it supports, e.g. *lj*, but then no unit conversion is performed. From 40aa1466248998c1e2cec637fbb45d4323aff285 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Thu, 7 Apr 2022 15:05:07 -0600 Subject: [PATCH 111/130] Prune unused code and fix virial issue --- src/KOKKOS/pair_dpd_ext_kokkos.cpp | 172 ++++++++-------------- src/KOKKOS/pair_dpd_ext_kokkos.h | 21 +-- src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp | 171 +++++++--------------- src/KOKKOS/pair_dpd_ext_tstat_kokkos.h | 20 +-- src/KOKKOS/pair_dpd_kokkos.cpp | 147 ++++++------------- src/KOKKOS/pair_dpd_kokkos.h | 14 +- src/KOKKOS/pair_dpd_tstat_kokkos.cpp | 174 ++++++----------------- src/KOKKOS/pair_dpd_tstat_kokkos.h | 22 ++- 8 files changed, 230 insertions(+), 511 deletions(-) diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp index 3a1c5f1ee2..210f696cb8 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -91,16 +91,13 @@ void PairDPDExtKokkos::init_style() neighflag = lmp->kokkos->neighflag; - if (force->newton_pair == 0 || neighflag == FULL ) + if (force->newton_pair == 0 || neighflag == FULL) error->all(FLERR,"Must use half neighbor list style and newton on with pair dpd/ext/kk"); auto request = neighbor->find_request(this); request->set_kokkos_host(std::is_same::value && !std::is_same::value); request->set_kokkos_device(std::is_same::value); - - if (neighflag == FULL) - request->enable_full(); } /* ---------------------------------------------------------------------- */ @@ -109,7 +106,6 @@ template void PairDPDExtKokkos::compute(int eflagin, int vflagin) { eflag = eflagin; vflag = vflagin; - if (neighflag == FULL) no_virial_fdotr_compute = 1; ev_init(eflag,vflag,0); @@ -140,7 +136,6 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) special_lj[3] = force->special_lj[3]; nlocal = atom->nlocal; - newton_pair = force->newton_pair; dtinvsqrt = 1.0/sqrt(update->dt); NeighListKokkos* k_list = static_cast*>(list); @@ -165,29 +160,11 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) EV_FLOAT ev; copymode = 1; if (neighflag == HALF) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } else if (neighflag == HALFTHREAD) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } - } else if (neighflag == FULL) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } if (need_dup) @@ -235,17 +212,17 @@ void PairDPDExtKokkos::compute(int eflagin, int vflagin) /* ---------------------------------------------------------------------- */ template -template +template KOKKOS_INLINE_FUNCTION -void PairDPDExtKokkos::operator() (TagDPDExtKokkos, const int &ii) const { +void PairDPDExtKokkos::operator() (TagDPDExtKokkos, const int &ii) const { EV_FLOAT ev; - this->template operator()(TagDPDExtKokkos(), ii, ev); + this->template operator()(TagDPDExtKokkos(), ii, ev); } template -template +template KOKKOS_INLINE_FUNCTION -void PairDPDExtKokkos::operator() (TagDPDExtKokkos, const int &ii, EV_FLOAT &ev) const { +void PairDPDExtKokkos::operator() (TagDPDExtKokkos, const int &ii, EV_FLOAT &ev) const { // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial @@ -345,23 +322,21 @@ void PairDPDExtKokkos::operator() (TagDPDExtKokkostemplate ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); + if (EVFLAG && (eflag_atom || vflag_either)) + this->template ev_tally_xyz(ev,i,j,evdwl,fpairx,fpairy,fpairz,delx,dely,delz); } } a_f(i,0) += fx; @@ -373,15 +348,13 @@ void PairDPDExtKokkos::operator() (TagDPDExtKokkos -template +template KOKKOS_INLINE_FUNCTION -void PairDPDExtKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j, - const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, - const F_FLOAT &dely, const F_FLOAT &delz) const +void PairDPDExtKokkos::ev_tally_xyz(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, + const F_FLOAT &fx, const F_FLOAT &fy, const F_FLOAT &fz, + const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const { - const int EFLAG = eflag; - const int VFLAG = vflag_either; - // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); @@ -390,78 +363,47 @@ void PairDPDExtKokkos::ev_tally(EV_FLOAT &ev, const int &i, const in auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); auto a_vatom = v_vatom.template access>(); - if (EFLAG) { - if (eflag_atom) { - const E_FLOAT epairhalf = 0.5 * epair; - if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) a_eatom[i] += epairhalf; - if (NEWTON_PAIR || j < nlocal) a_eatom[j] += epairhalf; - } else { - a_eatom[i] += epairhalf; - } - } + if (eflag_atom) { + const E_FLOAT epairhalf = 0.5 * epair; + a_eatom[i] += epairhalf; + a_eatom[j] += epairhalf; } - if (VFLAG) { - const E_FLOAT v0 = delx*delx*fpair; - const E_FLOAT v1 = dely*dely*fpair; - const E_FLOAT v2 = delz*delz*fpair; - const E_FLOAT v3 = delx*dely*fpair; - const E_FLOAT v4 = delx*delz*fpair; - const E_FLOAT v5 = dely*delz*fpair; + if (vflag_either) { + const E_FLOAT v0 = delx*delx*fx; + const E_FLOAT v1 = dely*dely*fy; + const E_FLOAT v2 = delz*delz*fz; + const E_FLOAT v3 = delx*dely*fy; + const E_FLOAT v4 = delx*delz*fz; + const E_FLOAT v5 = dely*delz*fz; if (vflag_global) { - if (NEIGHFLAG!=FULL) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - if (NEWTON_PAIR || j < nlocal) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } - } else { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; } if (vflag_atom) { - if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) { - a_vatom(i,0) += 0.5*v0; - a_vatom(i,1) += 0.5*v1; - a_vatom(i,2) += 0.5*v2; - a_vatom(i,3) += 0.5*v3; - a_vatom(i,4) += 0.5*v4; - a_vatom(i,5) += 0.5*v5; - } - if (NEWTON_PAIR || j < nlocal) { - a_vatom(j,0) += 0.5*v0; - a_vatom(j,1) += 0.5*v1; - a_vatom(j,2) += 0.5*v2; - a_vatom(j,3) += 0.5*v3; - a_vatom(j,4) += 0.5*v4; - a_vatom(j,5) += 0.5*v5; - } - } else { - a_vatom(i,0) += 0.5*v0; - a_vatom(i,1) += 0.5*v1; - a_vatom(i,2) += 0.5*v2; - a_vatom(i,3) += 0.5*v3; - a_vatom(i,4) += 0.5*v4; - a_vatom(i,5) += 0.5*v5; - } + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; } } } diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.h b/src/KOKKOS/pair_dpd_ext_kokkos.h index 160cf396a7..1c04be6b01 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.h +++ b/src/KOKKOS/pair_dpd_ext_kokkos.h @@ -62,26 +62,27 @@ class PairDPDExtKokkos : public PairDPDExt { F_FLOAT cut,ws,wsT,a0,gamma,sigma,gammaT,sigmaT; }; - template + template struct TagDPDExtKokkos{}; - template + template KOKKOS_INLINE_FUNCTION - void operator () (TagDPDExtKokkos, const int &i) const; + void operator () (TagDPDExtKokkos, const int &i) const; - template + template KOKKOS_INLINE_FUNCTION - void operator () (TagDPDExtKokkos, const int &i, EV_FLOAT&) const; + void operator () (TagDPDExtKokkos, const int &i, EV_FLOAT&) const; - template + template KOKKOS_INLINE_FUNCTION - void ev_tally(EV_FLOAT &ev, const int &i, const int &j, - const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, - const F_FLOAT &dely, const F_FLOAT &delz) const; + void ev_tally_xyz(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, + const F_FLOAT &fx, const F_FLOAT &fy, const F_FLOAT &fz, + const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; private: double special_lj[4]; int eflag,vflag; - int neighflag,nlocal,newton_pair; + int neighflag,nlocal; double dtinvsqrt; int need_dup; diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp index 71ac1179e9..8673c1f66d 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp @@ -98,9 +98,6 @@ void PairDPDExtTstatKokkos::init_style() request->set_kokkos_host(std::is_same::value && !std::is_same::value); request->set_kokkos_device(std::is_same::value); - - if (neighflag == FULL) - request->enable_full(); } /* ---------------------------------------------------------------------- */ @@ -109,7 +106,6 @@ template void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) { eflag = eflagin; vflag = vflagin; - if (neighflag == FULL) no_virial_fdotr_compute = 1; ev_init(eflag,vflag,0); @@ -154,7 +150,6 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) special_lj[3] = force->special_lj[3]; nlocal = atom->nlocal; - newton_pair = force->newton_pair; dtinvsqrt = 1.0/sqrt(update->dt); NeighListKokkos* k_list = static_cast*>(list); @@ -179,29 +174,11 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) EV_FLOAT ev; copymode = 1; if (neighflag == HALF) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } + if (vflag_either) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } else if (neighflag == HALFTHREAD) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } - } else if (neighflag == FULL) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } + if (vflag_either) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } if (need_dup) @@ -249,17 +226,17 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) /* ---------------------------------------------------------------------- */ template -template +template KOKKOS_INLINE_FUNCTION -void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos, const int &ii) const { +void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos, const int &ii) const { EV_FLOAT ev; - this->template operator()(TagDPDExtTstatKokkos(), ii, ev); + this->template operator()(TagDPDExtTstatKokkos(), ii, ev); } template -template +template KOKKOS_INLINE_FUNCTION -void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos, const int &ii, EV_FLOAT &ev) const { +void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos, const int &ii, EV_FLOAT &ev) const { // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); @@ -356,14 +333,12 @@ void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkostemplate ev_tally(ev,i,j,0.0,fpair,delx,dely,delz); + if (VFLAG) + this->template v_tally_xyz(ev,i,j,fpairx,fpairy,fpairz,delx,dely,delz); } } a_f(i,0) += fx; @@ -375,96 +350,52 @@ void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos -template +template KOKKOS_INLINE_FUNCTION -void PairDPDExtTstatKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j, - const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, - const F_FLOAT &dely, const F_FLOAT &delz) const +void PairDPDExtTstatKokkos::v_tally_xyz(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &fx, const F_FLOAT &fy, const F_FLOAT &fz, + const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const { - const int EFLAG = eflag; - const int VFLAG = vflag_either; - // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - - auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access>(); + // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); auto a_vatom = v_vatom.template access>(); - if (EFLAG) { - if (eflag_atom) { - const E_FLOAT epairhalf = 0.5 * epair; - if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) a_eatom[i] += epairhalf; - if (NEWTON_PAIR || j < nlocal) a_eatom[j] += epairhalf; - } else { - a_eatom[i] += epairhalf; - } - } + const E_FLOAT v0 = delx*delx*fx; + const E_FLOAT v1 = dely*dely*fy; + const E_FLOAT v2 = delz*delz*fz; + const E_FLOAT v3 = delx*dely*fy; + const E_FLOAT v4 = delx*delz*fz; + const E_FLOAT v5 = dely*delz*fz; + + if (vflag_global) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; } - if (VFLAG) { - const E_FLOAT v0 = delx*delx*fpair; - const E_FLOAT v1 = dely*dely*fpair; - const E_FLOAT v2 = delz*delz*fpair; - const E_FLOAT v3 = delx*dely*fpair; - const E_FLOAT v4 = delx*delz*fpair; - const E_FLOAT v5 = dely*delz*fpair; - - if (vflag_global) { - if (NEIGHFLAG!=FULL) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - if (NEWTON_PAIR || j < nlocal) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } - } else { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } - } - - if (vflag_atom) { - if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) { - a_vatom(i,0) += 0.5*v0; - a_vatom(i,1) += 0.5*v1; - a_vatom(i,2) += 0.5*v2; - a_vatom(i,3) += 0.5*v3; - a_vatom(i,4) += 0.5*v4; - a_vatom(i,5) += 0.5*v5; - } - if (NEWTON_PAIR || j < nlocal) { - a_vatom(j,0) += 0.5*v0; - a_vatom(j,1) += 0.5*v1; - a_vatom(j,2) += 0.5*v2; - a_vatom(j,3) += 0.5*v3; - a_vatom(j,4) += 0.5*v4; - a_vatom(j,5) += 0.5*v5; - } - } else { - a_vatom(i,0) += 0.5*v0; - a_vatom(i,1) += 0.5*v1; - a_vatom(i,2) += 0.5*v2; - a_vatom(i,3) += 0.5*v3; - a_vatom(i,4) += 0.5*v4; - a_vatom(i,5) += 0.5*v5; - } - } + if (vflag_atom) { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; } } diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h index 3d489e0165..eb4c9f6dfd 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h @@ -62,26 +62,26 @@ class PairDPDExtTstatKokkos : public PairDPDExtTstat { F_FLOAT cut,ws,wsT,gamma,sigma,gammaT,sigmaT; }; - template + template struct TagDPDExtTstatKokkos{}; - template + template KOKKOS_INLINE_FUNCTION - void operator () (TagDPDExtTstatKokkos, const int &i) const; + void operator () (TagDPDExtTstatKokkos, const int &i) const; - template + template KOKKOS_INLINE_FUNCTION - void operator () (TagDPDExtTstatKokkos, const int &i, EV_FLOAT&) const; + void operator () (TagDPDExtTstatKokkos, const int &i, EV_FLOAT&) const; - template + template KOKKOS_INLINE_FUNCTION - void ev_tally(EV_FLOAT &ev, const int &i, const int &j, - const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, - const F_FLOAT &dely, const F_FLOAT &delz) const; + void v_tally_xyz(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &fx,const F_FLOAT &fy, const F_FLOAT &fz, + const F_FLOAT &delx,const F_FLOAT &dely, const F_FLOAT &delz) const; private: double special_lj[4]; int eflag,vflag; - int neighflag,nlocal,newton_pair; + int neighflag,nlocal; double dtinvsqrt; int need_dup; diff --git a/src/KOKKOS/pair_dpd_kokkos.cpp b/src/KOKKOS/pair_dpd_kokkos.cpp index 550c5e80d0..d9c6282194 100644 --- a/src/KOKKOS/pair_dpd_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_kokkos.cpp @@ -91,16 +91,13 @@ void PairDPDKokkos::init_style() neighflag = lmp->kokkos->neighflag; - if (force->newton_pair == 0 || neighflag == FULL ) + if (force->newton_pair == 0 || neighflag == FULL) error->all(FLERR,"Must use half neighbor list style and newton on with pair dpd/kk"); auto request = neighbor->find_request(this); request->set_kokkos_host(std::is_same::value && !std::is_same::value); request->set_kokkos_device(std::is_same::value); - - if (neighflag == FULL) - request->enable_full(); } /* ---------------------------------------------------------------------- */ @@ -109,7 +106,6 @@ template void PairDPDKokkos::compute(int eflagin, int vflagin) { eflag = eflagin; vflag = vflagin; - if (neighflag == FULL) no_virial_fdotr_compute = 1; ev_init(eflag,vflag,0); @@ -140,7 +136,6 @@ void PairDPDKokkos::compute(int eflagin, int vflagin) special_lj[3] = force->special_lj[3]; nlocal = atom->nlocal; - newton_pair = force->newton_pair; dtinvsqrt = 1.0/sqrt(update->dt); NeighListKokkos* k_list = static_cast*>(list); @@ -165,29 +160,11 @@ void PairDPDKokkos::compute(int eflagin, int vflagin) EV_FLOAT ev; copymode = 1; if (neighflag == HALF) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } else if (neighflag == HALFTHREAD) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } - } else if (neighflag == FULL) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } if (need_dup) @@ -235,17 +212,17 @@ void PairDPDKokkos::compute(int eflagin, int vflagin) /* ---------------------------------------------------------------------- */ template -template +template KOKKOS_INLINE_FUNCTION -void PairDPDKokkos::operator() (TagDPDKokkos, const int &ii) const { +void PairDPDKokkos::operator() (TagDPDKokkos, const int &ii) const { EV_FLOAT ev; - this->template operator()(TagDPDKokkos(), ii, ev); + this->template operator()(TagDPDKokkos(), ii, ev); } template -template +template KOKKOS_INLINE_FUNCTION -void PairDPDKokkos::operator() (TagDPDKokkos, const int &ii, EV_FLOAT &ev) const { +void PairDPDKokkos::operator() (TagDPDKokkos, const int &ii, EV_FLOAT &ev) const { // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial @@ -305,23 +282,20 @@ void PairDPDKokkos::operator() (TagDPDKokkostemplate ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); + if (EVFLAG && (eflag_atom || vflag_either)) + this->template ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); } } a_f(i,0) += fx; @@ -333,15 +307,12 @@ void PairDPDKokkos::operator() (TagDPDKokkos -template +template KOKKOS_INLINE_FUNCTION void PairDPDKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j, const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const { - const int EFLAG = eflag; - const int VFLAG = vflag_either; - // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); @@ -350,19 +321,13 @@ void PairDPDKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int & auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); auto a_vatom = v_vatom.template access>(); - if (EFLAG) { - if (eflag_atom) { - const E_FLOAT epairhalf = 0.5 * epair; - if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) a_eatom[i] += epairhalf; - if (NEWTON_PAIR || j < nlocal) a_eatom[j] += epairhalf; - } else { - a_eatom[i] += epairhalf; - } - } + if (eflag_atom) { + const E_FLOAT epairhalf = 0.5 * epair; + a_eatom[i] += epairhalf; + a_eatom[j] += epairhalf; } - if (VFLAG) { + if (vflag_either) { const E_FLOAT v0 = delx*delx*fpair; const E_FLOAT v1 = dely*dely*fpair; const E_FLOAT v2 = delz*delz*fpair; @@ -371,57 +336,27 @@ void PairDPDKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int & const E_FLOAT v5 = dely*delz*fpair; if (vflag_global) { - if (NEIGHFLAG!=FULL) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - if (NEWTON_PAIR || j < nlocal) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } - } else { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; } if (vflag_atom) { - if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) { - a_vatom(i,0) += 0.5*v0; - a_vatom(i,1) += 0.5*v1; - a_vatom(i,2) += 0.5*v2; - a_vatom(i,3) += 0.5*v3; - a_vatom(i,4) += 0.5*v4; - a_vatom(i,5) += 0.5*v5; - } - if (NEWTON_PAIR || j < nlocal) { - a_vatom(j,0) += 0.5*v0; - a_vatom(j,1) += 0.5*v1; - a_vatom(j,2) += 0.5*v2; - a_vatom(j,3) += 0.5*v3; - a_vatom(j,4) += 0.5*v4; - a_vatom(j,5) += 0.5*v5; - } - } else { - a_vatom(i,0) += 0.5*v0; - a_vatom(i,1) += 0.5*v1; - a_vatom(i,2) += 0.5*v2; - a_vatom(i,3) += 0.5*v3; - a_vatom(i,4) += 0.5*v4; - a_vatom(i,5) += 0.5*v5; - } + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; } } } diff --git a/src/KOKKOS/pair_dpd_kokkos.h b/src/KOKKOS/pair_dpd_kokkos.h index 3299c533e2..c492ffcfdd 100644 --- a/src/KOKKOS/pair_dpd_kokkos.h +++ b/src/KOKKOS/pair_dpd_kokkos.h @@ -62,18 +62,18 @@ class PairDPDKokkos : public PairDPD { F_FLOAT cut,a0,gamma,sigma; }; - template + template struct TagDPDKokkos{}; - template + template KOKKOS_INLINE_FUNCTION - void operator () (TagDPDKokkos, const int &i) const; + void operator () (TagDPDKokkos, const int &i) const; - template + template KOKKOS_INLINE_FUNCTION - void operator () (TagDPDKokkos, const int &i, EV_FLOAT&) const; + void operator () (TagDPDKokkos, const int &i, EV_FLOAT&) const; - template + template KOKKOS_INLINE_FUNCTION void ev_tally(EV_FLOAT &ev, const int &i, const int &j, const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, @@ -81,7 +81,7 @@ class PairDPDKokkos : public PairDPD { private: double special_lj[4]; int eflag,vflag; - int neighflag,nlocal,newton_pair; + int neighflag,nlocal; double dtinvsqrt; int need_dup; diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp index f161f5f688..2720f88dd4 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp @@ -67,7 +67,6 @@ PairDPDTstatKokkos::~PairDPDTstatKokkos() { rand_pool.destroy(); #endif - memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->destroy_kokkos(k_cutsq,cutsq); @@ -98,9 +97,6 @@ void PairDPDTstatKokkos::init_style() request->set_kokkos_host(std::is_same::value && !std::is_same::value); request->set_kokkos_device(std::is_same::value); - - if (neighflag == FULL) - request->enable_full(); } /* ---------------------------------------------------------------------- */ @@ -109,7 +105,6 @@ template void PairDPDTstatKokkos::compute(int eflagin, int vflagin) { eflag = eflagin; vflag = vflagin; - if (neighflag == FULL) no_virial_fdotr_compute = 1; ev_init(eflag,vflag,0); @@ -126,11 +121,6 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) } k_params.template modify(); - if (eflag_atom) { - memoryKK->destroy_kokkos(k_eatom,eatom); - memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); - d_eatom = k_eatom.template view(); - } if (vflag_atom) { memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"pair:vatom"); @@ -153,7 +143,6 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) special_lj[3] = force->special_lj[3]; nlocal = atom->nlocal; - newton_pair = force->newton_pair; dtinvsqrt = 1.0/sqrt(update->dt); NeighListKokkos* k_list = static_cast*>(list); @@ -164,11 +153,9 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) need_dup = lmp->kokkos->need_dup(); if (need_dup) { dup_f = Kokkos::Experimental::create_scatter_view(f); - dup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); dup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); } else { ndup_f = Kokkos::Experimental::create_scatter_view(f); - ndup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); ndup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); } @@ -178,35 +165,16 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) EV_FLOAT ev; copymode = 1; if (neighflag == HALF) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } + if (vflag_either) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } else if (neighflag == HALFTHREAD) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } - } else if (neighflag == FULL) { - if (newton_pair) { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } else { - if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - } + if (vflag_either) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); } if (need_dup) Kokkos::Experimental::contribute(f, dup_f); - if (eflag_global) eng_vdwl += ev.evdwl; if (vflag_global) { virial[0] += ev.v[0]; virial[1] += ev.v[1]; @@ -218,13 +186,6 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) if (vflag_fdotr) pair_virial_fdotr_compute(this); - if (eflag_atom) { - if (need_dup) - Kokkos::Experimental::contribute(d_eatom, dup_eatom); - k_eatom.template modify(); - k_eatom.template sync(); - } - if (vflag_atom) { if (need_dup) Kokkos::Experimental::contribute(d_vatom, dup_vatom); @@ -240,7 +201,6 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) // free duplicated memory if (need_dup) { dup_f = decltype(dup_f)(); - dup_eatom = decltype(dup_eatom)(); dup_vatom = decltype(dup_vatom)(); } } @@ -248,17 +208,17 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) /* ---------------------------------------------------------------------- */ template -template +template KOKKOS_INLINE_FUNCTION -void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos, const int &ii) const { +void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos, const int &ii) const { EV_FLOAT ev; - this->template operator()(TagDPDTstatKokkos(), ii, ev); + this->template operator()(TagDPDTstatKokkos(), ii, ev); } template -template +template KOKKOS_INLINE_FUNCTION -void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos, const int &ii, EV_FLOAT &ev) const { +void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos, const int &ii, EV_FLOAT &ev) const { // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial @@ -314,14 +274,12 @@ void PairDPDTstatKokkos::operator() (TagDPDTstatKokkostemplate ev_tally(ev,i,j,0.0,fpair,delx,dely,delz); + if (VFLAG) + this->template v_tally(ev,i,j,fpair,delx,dely,delz); } } a_f(i,0) += fx; @@ -333,36 +291,18 @@ void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos -template +template KOKKOS_INLINE_FUNCTION -void PairDPDTstatKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j, - const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, +void PairDPDTstatKokkos::v_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const { - const int EFLAG = eflag; - const int VFLAG = vflag_either; - // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - - auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access>(); + // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); auto a_vatom = v_vatom.template access>(); - if (EFLAG) { - if (eflag_atom) { - const E_FLOAT epairhalf = 0.5 * epair; - if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) a_eatom[i] += epairhalf; - if (NEWTON_PAIR || j < nlocal) a_eatom[j] += epairhalf; - } else { - a_eatom[i] += epairhalf; - } - } - } - - if (VFLAG) { const E_FLOAT v0 = delx*delx*fpair; const E_FLOAT v1 = dely*dely*fpair; const E_FLOAT v2 = delz*delz*fpair; @@ -370,59 +310,33 @@ void PairDPDTstatKokkos::ev_tally(EV_FLOAT &ev, const int &i, const const E_FLOAT v4 = delx*delz*fpair; const E_FLOAT v5 = dely*delz*fpair; - if (vflag_global) { - if (NEIGHFLAG!=FULL) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - if (NEWTON_PAIR || j < nlocal) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } - } else { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } - } + if (vflag_global) { + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[0] += 0.5*v0; + ev.v[1] += 0.5*v1; + ev.v[2] += 0.5*v2; + ev.v[3] += 0.5*v3; + ev.v[4] += 0.5*v4; + ev.v[5] += 0.5*v5; + } - if (vflag_atom) { - if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) { - a_vatom(i,0) += 0.5*v0; - a_vatom(i,1) += 0.5*v1; - a_vatom(i,2) += 0.5*v2; - a_vatom(i,3) += 0.5*v3; - a_vatom(i,4) += 0.5*v4; - a_vatom(i,5) += 0.5*v5; - } - if (NEWTON_PAIR || j < nlocal) { - a_vatom(j,0) += 0.5*v0; - a_vatom(j,1) += 0.5*v1; - a_vatom(j,2) += 0.5*v2; - a_vatom(j,3) += 0.5*v3; - a_vatom(j,4) += 0.5*v4; - a_vatom(j,5) += 0.5*v5; - } - } else { - a_vatom(i,0) += 0.5*v0; - a_vatom(i,1) += 0.5*v1; - a_vatom(i,2) += 0.5*v2; - a_vatom(i,3) += 0.5*v3; - a_vatom(i,4) += 0.5*v4; - a_vatom(i,5) += 0.5*v5; - } - } + if (vflag_atom) { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; } } diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.h b/src/KOKKOS/pair_dpd_tstat_kokkos.h index 4e1efb930f..ae21cd1a14 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.h +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.h @@ -62,26 +62,26 @@ class PairDPDTstatKokkos : public PairDPDTstat { F_FLOAT cut,gamma,sigma; }; - template + template struct TagDPDTstatKokkos{}; - template + template KOKKOS_INLINE_FUNCTION - void operator () (TagDPDTstatKokkos, const int &i) const; + void operator () (TagDPDTstatKokkos, const int &i) const; - template + template KOKKOS_INLINE_FUNCTION - void operator () (TagDPDTstatKokkos, const int &i, EV_FLOAT&) const; + void operator () (TagDPDTstatKokkos, const int &i, EV_FLOAT&) const; - template + template KOKKOS_INLINE_FUNCTION - void ev_tally(EV_FLOAT &ev, const int &i, const int &j, - const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, + void v_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; private: double special_lj[4]; int eflag,vflag; - int neighflag,nlocal,newton_pair; + int neighflag,nlocal; double dtinvsqrt; int need_dup; @@ -95,10 +95,8 @@ class PairDPDTstatKokkos : public PairDPDTstat { using NonDupScatterView = KKScatterView; DupScatterView dup_f; - DupScatterView dup_eatom; DupScatterView dup_vatom; NonDupScatterView ndup_f; - NonDupScatterView ndup_eatom; NonDupScatterView ndup_vatom; #ifdef DPD_USE_RAN_MARS @@ -127,9 +125,7 @@ class PairDPDTstatKokkos : public PairDPDTstat { typename Kokkos::DualView::t_dev_const_um params; - DAT::tdual_efloat_1d k_eatom; DAT::tdual_virial_array k_vatom; - typename AT::t_efloat_1d d_eatom; typename AT::t_virial_array d_vatom; KOKKOS_INLINE_FUNCTION From adef9b7747746fc4d2c84fdbed4e1ce26e189640 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 7 Apr 2022 15:13:29 -0600 Subject: [PATCH 112/130] add log files to examples/mdi --- examples/mdi/README | 10 +-- examples/mdi/log.7Apr22.mdi.aimd.alone.g++.1 | 90 +++++++++++++++++++ .../mdi/log.7Apr22.mdi.aimd.driver.mpi.g++.1 | 79 ++++++++++++++++ .../mdi/log.7Apr22.mdi.aimd.driver.mpi.g++.3 | 79 ++++++++++++++++ .../log.7Apr22.mdi.aimd.driver.plugin.g++.1 | 80 +++++++++++++++++ .../log.7Apr22.mdi.aimd.driver.plugin.g++.3 | 80 +++++++++++++++++ .../mdi/log.7Apr22.mdi.aimd.driver.tcp.g++.1 | 79 ++++++++++++++++ .../mdi/log.7Apr22.mdi.aimd.driver.tcp.g++.3 | 79 ++++++++++++++++ .../mdi/log.7Apr22.mdi.aimd.engine.mpi.g++.1 | 55 ++++++++++++ .../mdi/log.7Apr22.mdi.aimd.engine.mpi.g++.4 | 55 ++++++++++++ .../log.7Apr22.mdi.aimd.engine.plugin.g++.1 | 55 ++++++++++++ .../log.7Apr22.mdi.aimd.engine.plugin.g++.3 | 55 ++++++++++++ .../mdi/log.7Apr22.mdi.aimd.engine.tcp.g++.1 | 55 ++++++++++++ .../mdi/log.7Apr22.mdi.aimd.engine.tcp.g++.4 | 55 ++++++++++++ .../log.7Apr22.mdi.aimdpy.driver.mpi.g++.1 | 5 ++ .../log.7Apr22.mdi.aimdpy.driver.mpi.g++.2 | 5 ++ .../log.7Apr22.mdi.aimdpy.driver.tcp.g++.1 | 6 ++ .../log.7Apr22.mdi.aimdpy.driver.tcp.g++.2 | 6 ++ .../mdi/log.7Apr22.mdi.aimdpy.mm.mpi.g++.1 | 44 +++++++++ .../mdi/log.7Apr22.mdi.aimdpy.mm.mpi.g++.2 | 44 +++++++++ .../mdi/log.7Apr22.mdi.aimdpy.mm.tcp.g++.1 | 44 +++++++++ .../mdi/log.7Apr22.mdi.aimdpy.mm.tcp.g++.2 | 44 +++++++++ .../mdi/log.7Apr22.mdi.aimdpy.qm.mpi.g++.1 | 55 ++++++++++++ .../mdi/log.7Apr22.mdi.aimdpy.qm.mpi.g++.3 | 55 ++++++++++++ .../mdi/log.7Apr22.mdi.aimdpy.qm.tcp.g++.1 | 55 ++++++++++++ .../mdi/log.7Apr22.mdi.aimdpy.qm.tcp.g++.3 | 55 ++++++++++++ .../log.7Apr22.mdi.sequence.driver.mpi.g++.1 | 3 + .../log.7Apr22.mdi.sequence.driver.mpi.g++.2 | 3 + ...og.7Apr22.mdi.sequence.driver.plugin.g++.1 | 3 + ...og.7Apr22.mdi.sequence.driver.plugin.g++.3 | 3 + .../log.7Apr22.mdi.sequence.driver.tcp.g++.1 | 3 + .../log.7Apr22.mdi.sequence.driver.tcp.g++.2 | 3 + .../log.7Apr22.mdi.sequence.engine.mpi.g++.1 | 89 ++++++++++++++++++ .../log.7Apr22.mdi.sequence.engine.mpi.g++.4 | 89 ++++++++++++++++++ ...og.7Apr22.mdi.sequence.engine.plugin.g++.1 | 89 ++++++++++++++++++ ...og.7Apr22.mdi.sequence.engine.plugin.g++.3 | 89 ++++++++++++++++++ .../log.7Apr22.mdi.sequence.engine.tcp.g++.1 | 89 ++++++++++++++++++ .../log.7Apr22.mdi.sequence.engine.tcp.g++.4 | 89 ++++++++++++++++++ examples/mdi/sequence_driver.py | 10 +-- 39 files changed, 1876 insertions(+), 10 deletions(-) create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.alone.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.driver.mpi.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.driver.mpi.g++.3 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.driver.plugin.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.driver.plugin.g++.3 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.driver.tcp.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.driver.tcp.g++.3 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.engine.mpi.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.engine.mpi.g++.4 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.engine.plugin.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.engine.plugin.g++.3 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.engine.tcp.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimd.engine.tcp.g++.4 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.driver.mpi.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.driver.mpi.g++.2 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.driver.tcp.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.driver.tcp.g++.2 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.mm.mpi.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.mm.mpi.g++.2 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.mm.tcp.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.mm.tcp.g++.2 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.qm.mpi.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.qm.mpi.g++.3 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.qm.tcp.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.aimdpy.qm.tcp.g++.3 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.driver.mpi.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.driver.mpi.g++.2 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.driver.plugin.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.driver.plugin.g++.3 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.driver.tcp.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.driver.tcp.g++.2 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.engine.mpi.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.engine.mpi.g++.4 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.engine.plugin.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.engine.plugin.g++.3 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.engine.tcp.g++.1 create mode 100644 examples/mdi/log.7Apr22.mdi.sequence.engine.tcp.g++.4 diff --git a/examples/mdi/README b/examples/mdi/README index e13493750e..fd459e6670 100644 --- a/examples/mdi/README +++ b/examples/mdi/README @@ -108,11 +108,11 @@ commands below just use the default values of the optional switches. The switches are also explained at the top of the file; the info is copied here: -# -n 10 -# number of calculations to perform, default = 1 +# -n 3 +# number of calculations to perform, default = 3 # -mode eval/run/min # style of calculations: single snapshot evals, dynamics, minimization -# default = eval +# default = run # -size Nx Ny Nz # cubic lattice, default = 2 2 2 # -rho 0.75 0.1 @@ -152,9 +152,9 @@ Run with MPI: 1 proc each --- -Run with MPI: 2 procs + 3 procs +Run with MPI: 2 procs + 4 procs -% mpirun -np 2 python3 sequence_driver.py -mdi "-role DRIVER -name sequence -method MPI" : -np 3 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.sequence -in in.sequence +% mpirun -np 2 python3 sequence_driver.py -mdi "-role DRIVER -name sequence -method MPI" : -np 4 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.sequence -in in.sequence --- diff --git a/examples/mdi/log.7Apr22.mdi.aimd.alone.g++.1 b/examples/mdi/log.7Apr22.mdi.aimd.alone.g++.1 new file mode 100644 index 0000000000..5fa3743530 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.alone.g++.1 @@ -0,0 +1,90 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI driver script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +# NVE +fix 1 all nve +# NPT +#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0 + +thermo_style custom step temp pe etotal press vol +thermo 1 + +run 5 + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.144 | 3.144 | 3.144 Mbytes +Step Temp PotEng TotEng Press Volume + 0 1.44 -6.7733681 -4.6176881 -5.0221006 592.27671 + 1 1.4377309 -6.7699814 -4.6176981 -5.0007431 592.27671 + 2 1.430825 -6.7596844 -4.6177394 -4.9363501 592.27671 + 3 1.4189655 -6.7420029 -4.6178116 -4.8276957 592.27671 + 4 1.4016029 -6.7161132 -4.6179137 -4.6726332 592.27671 + 5 1.3779738 -6.6808361 -4.6180094 -4.468186 592.27671 +Loop time of 0.00427098 on 1 procs for 5 steps with 500 atoms + +Performance: 505739.085 tau/day, 1170.692 timesteps/s +73.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0038665 | 0.0038665 | 0.0038665 | 0.0 | 90.53 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0001297 | 0.0001297 | 0.0001297 | 0.0 | 3.04 +Output | 0.00014902 | 0.00014902 | 0.00014902 | 0.0 | 3.49 +Modify | 6.5249e-05 | 6.5249e-05 | 6.5249e-05 | 0.0 | 1.53 +Other | | 6.054e-05 | | | 1.42 + +Nlocal: 500 ave 500 max 500 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1956 ave 1956 max 1956 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 19500 ave 19500 max 19500 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 19500 +Ave neighs/atom = 39 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.driver.mpi.g++.1 b/examples/mdi/log.7Apr22.mdi.aimd.driver.mpi.g++.1 new file mode 100644 index 0000000000..d817aed5a3 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.driver.mpi.g++.1 @@ -0,0 +1,79 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI driver script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +# NVE +fix 1 all nve +# NPT +#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0 + +fix 2 all mdi/aimd +fix_modify 2 energy yes virial yes + +thermo_style custom step temp pe etotal press vol +thermo 1 + +run 5 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (../atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:209) +Per MPI rank memory allocation (min/avg/max) = 2.297 | 2.297 | 2.297 Mbytes +Step Temp PotEng TotEng Press Volume + 0 1.44 -6.7733681 -4.6176881 -5.0221006 592.27671 + 1 1.4377309 -6.7699814 -4.6176981 -5.0007431 592.27671 + 2 1.430825 -6.7596844 -4.6177394 -4.9363501 592.27671 + 3 1.4189655 -6.7420029 -4.6178116 -4.8276957 592.27671 + 4 1.4016029 -6.7161132 -4.6179137 -4.6726332 592.27671 + 5 1.3779738 -6.6808361 -4.6180094 -4.468186 592.27671 +Loop time of 0.0029525 on 1 procs for 5 steps with 500 atoms + +Performance: 731582.413 tau/day, 1693.478 timesteps/s +99.3% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 1.2632e-05 | 1.2632e-05 | 1.2632e-05 | 0.0 | 0.43 +Output | 0.00010561 | 0.00010561 | 0.00010561 | 0.0 | 3.58 +Modify | 0.0028043 | 0.0028043 | 0.0028043 | 0.0 | 94.98 +Other | | 3e-05 | | | 1.02 + +Nlocal: 500 ave 500 max 500 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 166 ave 166 max 166 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 + +Total # of neighbors = -1 +Ave neighs/atom = -0.002 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.driver.mpi.g++.3 b/examples/mdi/log.7Apr22.mdi.aimd.driver.mpi.g++.3 new file mode 100644 index 0000000000..eaf806cfc9 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.driver.mpi.g++.3 @@ -0,0 +1,79 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI driver script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 3 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +# NVE +fix 1 all nve +# NPT +#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0 + +fix 2 all mdi/aimd +fix_modify 2 energy yes virial yes + +thermo_style custom step temp pe etotal press vol +thermo 1 + +run 5 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (../atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:209) +Per MPI rank memory allocation (min/avg/max) = 2.297 | 2.297 | 2.297 Mbytes +Step Temp PotEng TotEng Press Volume + 0 1.44 -6.7733681 -4.6176881 -5.0221006 592.27671 + 1 1.4377309 -6.7699814 -4.6176981 -5.0007431 592.27671 + 2 1.430825 -6.7596844 -4.6177394 -4.9363501 592.27671 + 3 1.4189655 -6.7420029 -4.6178116 -4.8276957 592.27671 + 4 1.4016029 -6.7161132 -4.6179137 -4.6726332 592.27671 + 5 1.3779738 -6.6808361 -4.6180094 -4.468186 592.27671 +Loop time of 0.00315597 on 3 procs for 5 steps with 500 atoms + +Performance: 684416.574 tau/day, 1584.298 timesteps/s +99.5% CPU use with 3 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 1.769e-05 | 3.7059e-05 | 4.7808e-05 | 0.0 | 1.17 +Output | 0.00011556 | 0.00015516 | 0.00021954 | 0.0 | 4.92 +Modify | 0.002819 | 0.0028366 | 0.0028599 | 0.0 | 89.88 +Other | | 0.0001272 | | | 4.03 + +Nlocal: 166.667 ave 200 max 150 min +Histogram: 2 0 0 0 0 0 0 0 0 1 +Nghost: 55.3333 ave 92 max 32 min +Histogram: 1 1 0 0 0 0 0 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 3 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = -3 +Ave neighs/atom = -0.006 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.driver.plugin.g++.1 b/examples/mdi/log.7Apr22.mdi.aimd.driver.plugin.g++.1 new file mode 100644 index 0000000000..dea662c157 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.driver.plugin.g++.1 @@ -0,0 +1,80 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI driver script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +# NVE +fix 1 all nve +# NPT +#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0 + +fix 2 all mdi/aimd plugin +fix_modify 2 energy yes virial yes + +thermo_style custom step temp pe etotal press vol +thermo 1 + +mdi plugin lammps mdi "-role ENGINE -name lammps -method LINK" infile in.aimd.engine extra "-log log.aimd.engine.plugin" command "run 5" +run 5 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (../atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:209) +Per MPI rank memory allocation (min/avg/max) = 2.297 | 2.297 | 2.297 Mbytes +Step Temp PotEng TotEng Press Volume + 0 1.44 -6.7733681 -4.6176881 -5.0221006 592.27671 + 1 1.4377309 -6.7699814 -4.6176981 -5.0007431 592.27671 + 2 1.430825 -6.7596844 -4.6177394 -4.9363501 592.27671 + 3 1.4189655 -6.7420029 -4.6178116 -4.8276957 592.27671 + 4 1.4016029 -6.7161132 -4.6179137 -4.6726332 592.27671 + 5 1.3779738 -6.6808361 -4.6180094 -4.468186 592.27671 +Loop time of 0.00396559 on 1 procs for 5 steps with 500 atoms + +Performance: 544685.246 tau/day, 1260.845 timesteps/s +98.3% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 1.5936e-05 | 1.5936e-05 | 1.5936e-05 | 0.0 | 0.40 +Output | 0.00011527 | 0.00011527 | 0.00011527 | 0.0 | 2.91 +Modify | 0.0038025 | 0.0038025 | 0.0038025 | 0.0 | 95.89 +Other | | 3.184e-05 | | | 0.80 + +Nlocal: 500 ave 500 max 500 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 166 ave 166 max 166 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 + +Total # of neighbors = -1 +Ave neighs/atom = -0.002 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.driver.plugin.g++.3 b/examples/mdi/log.7Apr22.mdi.aimd.driver.plugin.g++.3 new file mode 100644 index 0000000000..ff9e2dd8f5 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.driver.plugin.g++.3 @@ -0,0 +1,80 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI driver script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 3 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +# NVE +fix 1 all nve +# NPT +#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0 + +fix 2 all mdi/aimd plugin +fix_modify 2 energy yes virial yes + +thermo_style custom step temp pe etotal press vol +thermo 1 + +mdi plugin lammps mdi "-role ENGINE -name lammps -method LINK" infile in.aimd.engine extra "-log log.aimd.engine.plugin" command "run 5" +run 5 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (../atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:209) +Per MPI rank memory allocation (min/avg/max) = 2.297 | 2.297 | 2.297 Mbytes +Step Temp PotEng TotEng Press Volume + 0 1.44 -6.7733681 -4.6176881 -5.0221006 592.27671 + 1 1.4377309 -6.7699814 -4.6176981 -5.0007431 592.27671 + 2 1.430825 -6.7596844 -4.6177394 -4.9363501 592.27671 + 3 1.4189655 -6.7420029 -4.6178116 -4.8276957 592.27671 + 4 1.4016029 -6.7161132 -4.6179137 -4.6726332 592.27671 + 5 1.3779738 -6.6808361 -4.6180094 -4.468186 592.27671 +Loop time of 0.00287217 on 3 procs for 5 steps with 500 atoms + +Performance: 752045.581 tau/day, 1740.846 timesteps/s +99.1% CPU use with 3 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 1.6368e-05 | 3.9139e-05 | 5.1029e-05 | 0.0 | 1.36 +Output | 9.6932e-05 | 0.00012081 | 0.00016442 | 0.0 | 4.21 +Modify | 0.0026109 | 0.0026258 | 0.0026494 | 0.0 | 91.42 +Other | | 8.637e-05 | | | 3.01 + +Nlocal: 166.667 ave 200 max 150 min +Histogram: 2 0 0 0 0 0 0 0 0 1 +Nghost: 55.3333 ave 92 max 32 min +Histogram: 1 1 0 0 0 0 0 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 3 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = -3 +Ave neighs/atom = -0.006 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.driver.tcp.g++.1 b/examples/mdi/log.7Apr22.mdi.aimd.driver.tcp.g++.1 new file mode 100644 index 0000000000..1ff358e269 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.driver.tcp.g++.1 @@ -0,0 +1,79 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI driver script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +# NVE +fix 1 all nve +# NPT +#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0 + +fix 2 all mdi/aimd +fix_modify 2 energy yes virial yes + +thermo_style custom step temp pe etotal press vol +thermo 1 + +run 5 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (../atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:209) +Per MPI rank memory allocation (min/avg/max) = 2.297 | 2.297 | 2.297 Mbytes +Step Temp PotEng TotEng Press Volume + 0 1.44 -6.7733681 -4.6176881 -5.0221006 592.27671 + 1 1.4377309 -6.7699814 -4.6176981 -5.0007431 592.27671 + 2 1.430825 -6.7596844 -4.6177394 -4.9363501 592.27671 + 3 1.4189655 -6.7420029 -4.6178116 -4.8276957 592.27671 + 4 1.4016029 -6.7161132 -4.6179137 -4.6726332 592.27671 + 5 1.3779738 -6.6808361 -4.6180094 -4.468186 592.27671 +Loop time of 1.20486 on 1 procs for 5 steps with 500 atoms + +Performance: 1792.736 tau/day, 4.150 timesteps/s +0.1% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 2.4487e-05 | 2.4487e-05 | 2.4487e-05 | 0.0 | 0.00 +Output | 0.00026499 | 0.00026499 | 0.00026499 | 0.0 | 0.02 +Modify | 1.2045 | 1.2045 | 1.2045 | 0.0 | 99.97 +Other | | 6.184e-05 | | | 0.01 + +Nlocal: 500 ave 500 max 500 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 166 ave 166 max 166 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 + +Total # of neighbors = -1 +Ave neighs/atom = -0.002 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:08 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.driver.tcp.g++.3 b/examples/mdi/log.7Apr22.mdi.aimd.driver.tcp.g++.3 new file mode 100644 index 0000000000..6abf6b3928 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.driver.tcp.g++.3 @@ -0,0 +1,79 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI driver script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 3 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +# NVE +fix 1 all nve +# NPT +#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0 + +fix 2 all mdi/aimd +fix_modify 2 energy yes virial yes + +thermo_style custom step temp pe etotal press vol +thermo 1 + +run 5 +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (../atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:209) +Per MPI rank memory allocation (min/avg/max) = 2.297 | 2.297 | 2.297 Mbytes +Step Temp PotEng TotEng Press Volume + 0 1.44 -6.7733681 -4.6176881 -5.0221006 592.27671 + 1 1.4377309 -6.7699814 -4.6176981 -5.0007431 592.27671 + 2 1.430825 -6.7596844 -4.6177394 -4.9363501 592.27671 + 3 1.4189655 -6.7420029 -4.6178116 -4.8276957 592.27671 + 4 1.4016029 -6.7161132 -4.6179137 -4.6726332 592.27671 + 5 1.3779738 -6.6808361 -4.6180094 -4.468186 592.27671 +Loop time of 1.19983 on 3 procs for 5 steps with 500 atoms + +Performance: 1800.259 tau/day, 4.167 timesteps/s +66.7% CPU use with 3 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 4.604e-06 | 4.8462e-05 | 7.527e-05 | 0.0 | 0.00 +Output | 0.00015266 | 0.00020593 | 0.00031177 | 0.0 | 0.02 +Modify | 1.1993 | 1.1994 | 1.1994 | 0.0 | 99.96 +Other | | 0.0002123 | | | 0.02 + +Nlocal: 166.667 ave 200 max 150 min +Histogram: 2 0 0 0 0 0 0 0 0 1 +Nghost: 55.3333 ave 92 max 32 min +Histogram: 1 1 0 0 0 0 0 0 0 1 +Neighs: 0 ave 0 max 0 min +Histogram: 3 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = -3 +Ave neighs/atom = -0.006 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:08 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.engine.mpi.g++.1 b/examples/mdi/log.7Apr22.mdi.aimd.engine.mpi.g++.1 new file mode 100644 index 0000000000..615dae0578 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.engine.mpi.g++.1 @@ -0,0 +1,55 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI engine script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +mdi engine +WARNING: No fixes with time integration, atoms won't move (../verlet.cpp:60) + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.144 | 3.144 | 3.144 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -6.7733681 0 -6.7733681 -6.2353173 + 1 0 -6.7699814 0 -6.7699814 -6.2120481 + 2 0 -6.7596844 0 -6.7596844 -6.1418368 + 3 0 -6.7420029 0 -6.7420029 -6.0231905 + 4 0 -6.7161132 0 -6.7161132 -5.8534999 + 5 0 -6.6808361 0 -6.6808361 -5.6291449 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.engine.mpi.g++.4 b/examples/mdi/log.7Apr22.mdi.aimd.engine.mpi.g++.4 new file mode 100644 index 0000000000..88d5c66892 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.engine.mpi.g++.4 @@ -0,0 +1,55 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI engine script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +mdi engine +WARNING: No fixes with time integration, atoms won't move (../verlet.cpp:60) + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.109 | 3.109 | 3.109 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -6.7733681 0 -6.7733681 -6.2353173 + 1 0 -6.7699814 0 -6.7699814 -6.2120481 + 2 0 -6.7596844 0 -6.7596844 -6.1418368 + 3 0 -6.7420029 0 -6.7420029 -6.0231905 + 4 0 -6.7161132 0 -6.7161132 -5.8534999 + 5 0 -6.6808361 0 -6.6808361 -5.6291449 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.engine.plugin.g++.1 b/examples/mdi/log.7Apr22.mdi.aimd.engine.plugin.g++.1 new file mode 100644 index 0000000000..615dae0578 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.engine.plugin.g++.1 @@ -0,0 +1,55 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI engine script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +mdi engine +WARNING: No fixes with time integration, atoms won't move (../verlet.cpp:60) + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.144 | 3.144 | 3.144 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -6.7733681 0 -6.7733681 -6.2353173 + 1 0 -6.7699814 0 -6.7699814 -6.2120481 + 2 0 -6.7596844 0 -6.7596844 -6.1418368 + 3 0 -6.7420029 0 -6.7420029 -6.0231905 + 4 0 -6.7161132 0 -6.7161132 -5.8534999 + 5 0 -6.6808361 0 -6.6808361 -5.6291449 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.engine.plugin.g++.3 b/examples/mdi/log.7Apr22.mdi.aimd.engine.plugin.g++.3 new file mode 100644 index 0000000000..fb8034972f --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.engine.plugin.g++.3 @@ -0,0 +1,55 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI engine script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 3 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +mdi engine +WARNING: No fixes with time integration, atoms won't move (../verlet.cpp:60) + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.124 | 3.13 | 3.133 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -6.7733681 0 -6.7733681 -6.2353173 + 1 0 -6.7699814 0 -6.7699814 -6.2120481 + 2 0 -6.7596844 0 -6.7596844 -6.1418368 + 3 0 -6.7420029 0 -6.7420029 -6.0231905 + 4 0 -6.7161132 0 -6.7161132 -5.8534999 + 5 0 -6.6808361 0 -6.6808361 -5.6291449 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.engine.tcp.g++.1 b/examples/mdi/log.7Apr22.mdi.aimd.engine.tcp.g++.1 new file mode 100644 index 0000000000..72becb2bba --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.engine.tcp.g++.1 @@ -0,0 +1,55 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI engine script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +mdi engine +WARNING: No fixes with time integration, atoms won't move (../verlet.cpp:60) + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.144 | 3.144 | 3.144 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -6.7733681 0 -6.7733681 -6.2353173 + 1 0 -6.7699814 0 -6.7699814 -6.2120481 + 2 0 -6.7596844 0 -6.7596844 -6.1418368 + 3 0 -6.7420029 0 -6.7420029 -6.0231905 + 4 0 -6.7161132 0 -6.7161132 -5.8534999 + 5 0 -6.6808361 0 -6.6808361 -5.6291449 +Total wall time: 0:00:01 diff --git a/examples/mdi/log.7Apr22.mdi.aimd.engine.tcp.g++.4 b/examples/mdi/log.7Apr22.mdi.aimd.engine.tcp.g++.4 new file mode 100644 index 0000000000..3154bd0b27 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimd.engine.tcp.g++.4 @@ -0,0 +1,55 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - MDI engine script + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +mdi engine +WARNING: No fixes with time integration, atoms won't move (../verlet.cpp:60) + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.109 | 3.109 | 3.109 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -6.7733681 0 -6.7733681 -6.2353173 + 1 0 -6.7699814 0 -6.7699814 -6.2120481 + 2 0 -6.7596844 0 -6.7596844 -6.1418368 + 3 0 -6.7420029 0 -6.7420029 -6.0231905 + 4 0 -6.7161132 0 -6.7161132 -5.8534999 + 5 0 -6.6808361 0 -6.6808361 -5.6291449 +Total wall time: 0:00:01 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.driver.mpi.g++.1 b/examples/mdi/log.7Apr22.mdi.aimdpy.driver.mpi.g++.1 new file mode 100644 index 0000000000..741e8a1dfe --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.driver.mpi.g++.1 @@ -0,0 +1,5 @@ +Step 1: MM energy 2.15228, QM energy -6.76998, Total energy -4.6177 +Step 2: MM energy 2.14195, QM energy -6.75968, Total energy -4.61774 +Step 3: MM energy 2.12419, QM energy -6.742, Total energy -4.61781 +Step 4: MM energy 2.0982, QM energy -6.71611, Total energy -4.61791 +Step 5: MM energy 2.06283, QM energy -6.68084, Total energy -4.61801 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.driver.mpi.g++.2 b/examples/mdi/log.7Apr22.mdi.aimdpy.driver.mpi.g++.2 new file mode 100644 index 0000000000..741e8a1dfe --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.driver.mpi.g++.2 @@ -0,0 +1,5 @@ +Step 1: MM energy 2.15228, QM energy -6.76998, Total energy -4.6177 +Step 2: MM energy 2.14195, QM energy -6.75968, Total energy -4.61774 +Step 3: MM energy 2.12419, QM energy -6.742, Total energy -4.61781 +Step 4: MM energy 2.0982, QM energy -6.71611, Total energy -4.61791 +Step 5: MM energy 2.06283, QM energy -6.68084, Total energy -4.61801 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.driver.tcp.g++.1 b/examples/mdi/log.7Apr22.mdi.aimdpy.driver.tcp.g++.1 new file mode 100644 index 0000000000..2205a0f051 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.driver.tcp.g++.1 @@ -0,0 +1,6 @@ +Step 0: MM energy 2.15568, QM energy -6.77337, Total energy -4.61769 +Step 1: MM energy 2.15228, QM energy -6.76998, Total energy -4.6177 +Step 2: MM energy 2.14195, QM energy -6.75968, Total energy -4.61774 +Step 3: MM energy 2.12419, QM energy -6.742, Total energy -4.61781 +Step 4: MM energy 2.0982, QM energy -6.71611, Total energy -4.61791 +Step 5: MM energy 2.06283, QM energy -6.68084, Total energy -4.61801 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.driver.tcp.g++.2 b/examples/mdi/log.7Apr22.mdi.aimdpy.driver.tcp.g++.2 new file mode 100644 index 0000000000..2205a0f051 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.driver.tcp.g++.2 @@ -0,0 +1,6 @@ +Step 0: MM energy 2.15568, QM energy -6.77337, Total energy -4.61769 +Step 1: MM energy 2.15228, QM energy -6.76998, Total energy -4.6177 +Step 2: MM energy 2.14195, QM energy -6.75968, Total energy -4.61774 +Step 3: MM energy 2.12419, QM energy -6.742, Total energy -4.61781 +Step 4: MM energy 2.0982, QM energy -6.71611, Total energy -4.61791 +Step 5: MM energy 2.06283, QM energy -6.68084, Total energy -4.61801 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.mm.mpi.g++.1 b/examples/mdi/log.7Apr22.mdi.aimdpy.mm.mpi.g++.1 new file mode 100644 index 0000000000..55825ab30a --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.mm.mpi.g++.1 @@ -0,0 +1,44 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - LAMMPS as MM engine for aimd_driver.py + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +mdi engine +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (../atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:209) +Per MPI rank memory allocation (min/avg/max) = 2.297 | 2.297 | 2.297 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1.44 0 0 2.15568 1.2132167 + 1 1.4377309 0 0 2.1522832 1.211305 + 2 1.430825 0 0 2.141945 1.2054866 + 3 1.4189655 0 0 2.1241913 1.1954949 + 4 1.4016029 0 0 2.0981995 1.1808667 + 5 1.3779738 0 0 2.0628267 1.1609589 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.mm.mpi.g++.2 b/examples/mdi/log.7Apr22.mdi.aimdpy.mm.mpi.g++.2 new file mode 100644 index 0000000000..4c636b8486 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.mm.mpi.g++.2 @@ -0,0 +1,44 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - LAMMPS as MM engine for aimd_driver.py + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 2 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +mdi engine +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (../atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:209) +Per MPI rank memory allocation (min/avg/max) = 2.297 | 2.297 | 2.297 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1.44 0 0 2.15568 1.2132167 + 1 1.4377309 0 0 2.1522832 1.211305 + 2 1.430825 0 0 2.141945 1.2054866 + 3 1.4189655 0 0 2.1241913 1.1954949 + 4 1.4016029 0 0 2.0981995 1.1808667 + 5 1.3779738 0 0 2.0628267 1.1609589 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.mm.tcp.g++.1 b/examples/mdi/log.7Apr22.mdi.aimdpy.mm.tcp.g++.1 new file mode 100644 index 0000000000..7eb94ac4c6 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.mm.tcp.g++.1 @@ -0,0 +1,44 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - LAMMPS as MM engine for aimd_driver.py + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +mdi engine +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (../atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:209) +Per MPI rank memory allocation (min/avg/max) = 2.297 | 2.297 | 2.297 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1.44 0 0 2.15568 1.2132167 + 1 1.4377309 0 0 2.1522832 1.211305 + 2 1.430825 0 0 2.141945 1.2054866 + 3 1.4189655 0 0 2.1241913 1.1954949 + 4 1.4016029 0 0 2.0981995 1.1808667 + 5 1.3779738 0 0 2.0628267 1.1609589 +Total wall time: 0:00:11 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.mm.tcp.g++.2 b/examples/mdi/log.7Apr22.mdi.aimdpy.mm.tcp.g++.2 new file mode 100644 index 0000000000..6d253ee790 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.mm.tcp.g++.2 @@ -0,0 +1,44 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - LAMMPS as MM engine for aimd_driver.py + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 2 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +mdi engine +WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (../atom.cpp:2141) +WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:209) +Per MPI rank memory allocation (min/avg/max) = 2.297 | 2.297 | 2.297 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1.44 0 0 2.15568 1.2132167 + 1 1.4377309 0 0 2.1522832 1.211305 + 2 1.430825 0 0 2.141945 1.2054866 + 3 1.4189655 0 0 2.1241913 1.1954949 + 4 1.4016029 0 0 2.0981995 1.1808667 + 5 1.3779738 0 0 2.0628267 1.1609589 +Total wall time: 0:00:11 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.qm.mpi.g++.1 b/examples/mdi/log.7Apr22.mdi.aimdpy.qm.mpi.g++.1 new file mode 100644 index 0000000000..e75a12c948 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.qm.mpi.g++.1 @@ -0,0 +1,55 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - LAMMPS as surrogate QM engine for aimd_driver.py + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +mdi engine +WARNING: No fixes with time integration, atoms won't move (../verlet.cpp:60) + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.144 | 3.144 | 3.144 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -6.7733681 0 -6.7733681 -6.2353173 + 1 0 -6.7699814 0 -6.7699814 -6.2120481 + 2 0 -6.7596844 0 -6.7596844 -6.1418368 + 3 0 -6.7420029 0 -6.7420029 -6.0231905 + 4 0 -6.7161132 0 -6.7161132 -5.8534999 + 5 0 -6.6808361 0 -6.6808361 -5.6291449 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.qm.mpi.g++.3 b/examples/mdi/log.7Apr22.mdi.aimdpy.qm.mpi.g++.3 new file mode 100644 index 0000000000..5d6702100c --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.qm.mpi.g++.3 @@ -0,0 +1,55 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - LAMMPS as surrogate QM engine for aimd_driver.py + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 3 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +mdi engine +WARNING: No fixes with time integration, atoms won't move (../verlet.cpp:60) + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.124 | 3.13 | 3.133 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -6.7733681 0 -6.7733681 -6.2353173 + 1 0 -6.7699814 0 -6.7699814 -6.2120481 + 2 0 -6.7596844 0 -6.7596844 -6.1418368 + 3 0 -6.7420029 0 -6.7420029 -6.0231905 + 4 0 -6.7161132 0 -6.7161132 -5.8534999 + 5 0 -6.6808361 0 -6.6808361 -5.6291449 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.qm.tcp.g++.1 b/examples/mdi/log.7Apr22.mdi.aimdpy.qm.tcp.g++.1 new file mode 100644 index 0000000000..8750392def --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.qm.tcp.g++.1 @@ -0,0 +1,55 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - LAMMPS as surrogate QM engine for aimd_driver.py + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +mdi engine +WARNING: No fixes with time integration, atoms won't move (../verlet.cpp:60) + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.144 | 3.144 | 3.144 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -6.7733681 0 -6.7733681 -6.2353173 + 1 0 -6.7699814 0 -6.7699814 -6.2120481 + 2 0 -6.7596844 0 -6.7596844 -6.1418368 + 3 0 -6.7420029 0 -6.7420029 -6.0231905 + 4 0 -6.7161132 0 -6.7161132 -5.8534999 + 5 0 -6.6808361 0 -6.6808361 -5.6291449 +Total wall time: 0:00:01 diff --git a/examples/mdi/log.7Apr22.mdi.aimdpy.qm.tcp.g++.3 b/examples/mdi/log.7Apr22.mdi.aimdpy.qm.tcp.g++.3 new file mode 100644 index 0000000000..cd5d443e65 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.aimdpy.qm.tcp.g++.3 @@ -0,0 +1,55 @@ +LAMMPS (17 Feb 2022) +# 3d Lennard-Jones melt - LAMMPS as surrogate QM engine for aimd_driver.py + +variable x index 5 +variable y index 5 +variable z index 5 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 $x 0 $y 0 $z +region box block 0 5 0 $y 0 $z +region box block 0 5 0 5 0 $z +region box block 0 5 0 5 0 5 +create_box 1 box +Created orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + 1 by 1 by 3 MPI processor grid +create_atoms 1 box +Created 500 atoms + using lattice units in orthogonal box = (0 0 0) to (8.397981 8.397981 8.397981) + create_atoms CPU = 0.001 seconds +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +mdi engine +WARNING: No fixes with time integration, atoms won't move (../verlet.cpp:60) + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.124 | 3.13 | 3.133 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -6.7733681 0 -6.7733681 -6.2353173 + 1 0 -6.7699814 0 -6.7699814 -6.2120481 + 2 0 -6.7596844 0 -6.7596844 -6.1418368 + 3 0 -6.7420029 0 -6.7420029 -6.0231905 + 4 0 -6.7161132 0 -6.7161132 -5.8534999 + 5 0 -6.6808361 0 -6.6808361 -5.6291449 +Total wall time: 0:00:01 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.driver.mpi.g++.1 b/examples/mdi/log.7Apr22.mdi.sequence.driver.mpi.g++.1 new file mode 100644 index 0000000000..86d23d382b --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.driver.mpi.g++.1 @@ -0,0 +1,3 @@ +Calc 1: eng -4.5209 pressure 0.98188 aveForce 4.4409e-16 -1.1102e-16 6.6613e-16 +Calc 2: eng -4.5432 pressure -0.53137 aveForce 7.0083e-16 1.1796e-16 5.4384e-16 +Calc 3: eng -4.501 pressure 2.0049 aveForce 0 2.0817e-16 -4.3021e-16 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.driver.mpi.g++.2 b/examples/mdi/log.7Apr22.mdi.sequence.driver.mpi.g++.2 new file mode 100644 index 0000000000..17e040d0d7 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.driver.mpi.g++.2 @@ -0,0 +1,3 @@ +Calc 1: eng -4.5209 pressure 0.98188 aveForce -2.2204e-16 0 2.2204e-16 +Calc 2: eng -4.5432 pressure -0.53137 aveForce -2.498e-16 -1.8735e-16 -3.4001e-16 +Calc 3: eng -4.501 pressure 2.0049 aveForce -7.9103e-16 3.4694e-16 4.0246e-16 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.driver.plugin.g++.1 b/examples/mdi/log.7Apr22.mdi.sequence.driver.plugin.g++.1 new file mode 100644 index 0000000000..86d23d382b --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.driver.plugin.g++.1 @@ -0,0 +1,3 @@ +Calc 1: eng -4.5209 pressure 0.98188 aveForce 4.4409e-16 -1.1102e-16 6.6613e-16 +Calc 2: eng -4.5432 pressure -0.53137 aveForce 7.0083e-16 1.1796e-16 5.4384e-16 +Calc 3: eng -4.501 pressure 2.0049 aveForce 0 2.0817e-16 -4.3021e-16 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.driver.plugin.g++.3 b/examples/mdi/log.7Apr22.mdi.sequence.driver.plugin.g++.3 new file mode 100644 index 0000000000..e634b156b8 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.driver.plugin.g++.3 @@ -0,0 +1,3 @@ +Calc 1: eng -4.5209 pressure 0.98188 aveForce -1.1102e-16 8.3267e-16 1.9429e-16 +Calc 2: eng -4.5432 pressure -0.53137 aveForce 9.0206e-17 4.996e-16 1.5959e-16 +Calc 3: eng -4.501 pressure 2.0049 aveForce -1.4849e-15 -8.1879e-16 -1.7347e-16 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.driver.tcp.g++.1 b/examples/mdi/log.7Apr22.mdi.sequence.driver.tcp.g++.1 new file mode 100644 index 0000000000..86d23d382b --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.driver.tcp.g++.1 @@ -0,0 +1,3 @@ +Calc 1: eng -4.5209 pressure 0.98188 aveForce 4.4409e-16 -1.1102e-16 6.6613e-16 +Calc 2: eng -4.5432 pressure -0.53137 aveForce 7.0083e-16 1.1796e-16 5.4384e-16 +Calc 3: eng -4.501 pressure 2.0049 aveForce 0 2.0817e-16 -4.3021e-16 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.driver.tcp.g++.2 b/examples/mdi/log.7Apr22.mdi.sequence.driver.tcp.g++.2 new file mode 100644 index 0000000000..17e040d0d7 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.driver.tcp.g++.2 @@ -0,0 +1,3 @@ +Calc 1: eng -4.5209 pressure 0.98188 aveForce -2.2204e-16 0 2.2204e-16 +Calc 2: eng -4.5432 pressure -0.53137 aveForce -2.498e-16 -1.8735e-16 -3.4001e-16 +Calc 3: eng -4.501 pressure 2.0049 aveForce -7.9103e-16 3.4694e-16 4.0246e-16 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.engine.mpi.g++.1 b/examples/mdi/log.7Apr22.mdi.sequence.engine.mpi.g++.1 new file mode 100644 index 0000000000..929cdce5cf --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.engine.mpi.g++.1 @@ -0,0 +1,89 @@ +LAMMPS (17 Feb 2022) +# MDI engine script to process a series of evaulate, run, minimize commands + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 1 0 1 0 1 +create_box 1 box +Created orthogonal box = (0 0 0) to (1.6795962 1.6795962 1.6795962) + 1 by 1 by 1 MPI processor grid +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +thermo 10 + +mdi engine +delete_atoms group all +Deleted 0 atoms, new total = 0 + 1 by 1 by 1 MPI processor grid + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.9713146 0 -2.4947521 3.1253597 + 10 1.2380002 -4.3210346 0 -2.4930499 2.0015258 + 20 1.173596 -4.2234559 0 -2.4905682 2.3587731 + 30 1.2989994 -4.4124445 0 -2.4943907 1.903698 + 40 1.4510255 -4.6467459 0 -2.504216 1.2196259 + 50 1.4631454 -4.6641774 0 -2.5037518 1.2838406 + 60 1.2694188 -4.3794267 0 -2.5050505 2.4497113 + 70 1.3363814 -4.4759884 0 -2.5027378 2.2441463 + 80 1.402534 -4.5752515 0 -2.5043224 1.9011715 + 90 1.3870321 -4.5512479 0 -2.5032084 2.0040237 + 100 1.3635651 -4.5209384 0 -2.5075493 1.9773816 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 1 by 1 by 1 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -4.1934138 0 -2.7168513 0.72358299 + 10 1.0170498 -4.2225288 0 -2.7207912 0.7556766 + 20 0.92567967 -4.0920979 0 -2.725274 1.2463143 + 30 1.0851758 -4.3346599 0 -2.73233 0.53176652 + 40 1.2163699 -4.5351986 0 -2.7391524 -0.077915153 + 50 1.2305739 -4.5558134 0 -2.7387942 -0.10711153 + 60 1.1172288 -4.3979372 0 -2.7482791 0.52752067 + 70 1.2228415 -4.5540741 0 -2.7484722 0.11937533 + 80 1.1776333 -4.4870195 0 -2.7481704 0.33904864 + 90 1.219283 -4.5483185 0 -2.747971 0.17898549 + 100 1.2138939 -4.5432229 0 -2.7508327 0.3076354 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 1 by 1 by 1 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.8524214 0 -2.3758589 4.6814052 + 10 1.3356745 -4.3481612 0 -2.3759544 3.061856 + 20 1.1791601 -4.117932 0 -2.3768284 3.8565 + 30 1.3435556 -4.3613609 0 -2.3775171 3.0728735 + 40 1.5628445 -4.6886004 0 -2.3809628 2.0989245 + 50 1.4735556 -4.5569123 0 -2.3811152 2.6364099 + 60 1.609387 -4.7581056 0 -2.3817452 1.8988642 + 70 1.5014902 -4.5938759 0 -2.3768318 2.458161 + 80 1.3763383 -4.4089865 0 -2.3767369 3.0379808 + 90 1.498202 -4.5909613 0 -2.3787724 2.5543714 + 100 1.43934 -4.5009545 0 -2.375679 3.0923444 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.engine.mpi.g++.4 b/examples/mdi/log.7Apr22.mdi.sequence.engine.mpi.g++.4 new file mode 100644 index 0000000000..ada69c6ca7 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.engine.mpi.g++.4 @@ -0,0 +1,89 @@ +LAMMPS (17 Feb 2022) +# MDI engine script to process a series of evaulate, run, minimize commands + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 1 0 1 0 1 +create_box 1 box +Created orthogonal box = (0 0 0) to (1.6795962 1.6795962 1.6795962) + 1 by 2 by 2 MPI processor grid +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +thermo 10 + +mdi engine +delete_atoms group all +Deleted 0 atoms, new total = 0 + 1 by 2 by 2 MPI processor grid + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.9713146 0 -2.4947521 3.1253597 + 10 1.2380002 -4.3210346 0 -2.4930499 2.0015258 + 20 1.173596 -4.2234559 0 -2.4905682 2.3587731 + 30 1.2989994 -4.4124445 0 -2.4943907 1.903698 + 40 1.4510255 -4.6467459 0 -2.504216 1.2196259 + 50 1.4631454 -4.6641774 0 -2.5037518 1.2838406 + 60 1.2694188 -4.3794267 0 -2.5050505 2.4497113 + 70 1.3363814 -4.4759884 0 -2.5027378 2.2441463 + 80 1.402534 -4.5752515 0 -2.5043224 1.9011715 + 90 1.3870321 -4.5512479 0 -2.5032084 2.0040237 + 100 1.3635651 -4.5209384 0 -2.5075493 1.9773816 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 1 by 2 by 2 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -4.1934138 0 -2.7168513 0.72358299 + 10 1.0170498 -4.2225288 0 -2.7207912 0.7556766 + 20 0.92567967 -4.0920979 0 -2.725274 1.2463143 + 30 1.0851758 -4.3346599 0 -2.73233 0.53176652 + 40 1.2163699 -4.5351986 0 -2.7391524 -0.077915153 + 50 1.2305739 -4.5558134 0 -2.7387942 -0.10711153 + 60 1.1172288 -4.3979372 0 -2.7482791 0.52752067 + 70 1.2228415 -4.5540741 0 -2.7484722 0.11937533 + 80 1.1776333 -4.4870195 0 -2.7481704 0.33904864 + 90 1.219283 -4.5483185 0 -2.747971 0.17898549 + 100 1.2138939 -4.5432229 0 -2.7508327 0.3076354 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 1 by 2 by 2 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.8524214 0 -2.3758589 4.6814052 + 10 1.3356745 -4.3481612 0 -2.3759544 3.061856 + 20 1.1791601 -4.117932 0 -2.3768284 3.8565 + 30 1.3435556 -4.3613609 0 -2.3775171 3.0728735 + 40 1.5628445 -4.6886004 0 -2.3809628 2.0989245 + 50 1.4735556 -4.5569123 0 -2.3811152 2.6364099 + 60 1.609387 -4.7581056 0 -2.3817452 1.8988642 + 70 1.5014902 -4.5938759 0 -2.3768318 2.458161 + 80 1.3763383 -4.4089865 0 -2.3767369 3.0379808 + 90 1.498202 -4.5909613 0 -2.3787724 2.5543714 + 100 1.43934 -4.5009545 0 -2.375679 3.0923444 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.engine.plugin.g++.1 b/examples/mdi/log.7Apr22.mdi.sequence.engine.plugin.g++.1 new file mode 100644 index 0000000000..929cdce5cf --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.engine.plugin.g++.1 @@ -0,0 +1,89 @@ +LAMMPS (17 Feb 2022) +# MDI engine script to process a series of evaulate, run, minimize commands + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 1 0 1 0 1 +create_box 1 box +Created orthogonal box = (0 0 0) to (1.6795962 1.6795962 1.6795962) + 1 by 1 by 1 MPI processor grid +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +thermo 10 + +mdi engine +delete_atoms group all +Deleted 0 atoms, new total = 0 + 1 by 1 by 1 MPI processor grid + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.9713146 0 -2.4947521 3.1253597 + 10 1.2380002 -4.3210346 0 -2.4930499 2.0015258 + 20 1.173596 -4.2234559 0 -2.4905682 2.3587731 + 30 1.2989994 -4.4124445 0 -2.4943907 1.903698 + 40 1.4510255 -4.6467459 0 -2.504216 1.2196259 + 50 1.4631454 -4.6641774 0 -2.5037518 1.2838406 + 60 1.2694188 -4.3794267 0 -2.5050505 2.4497113 + 70 1.3363814 -4.4759884 0 -2.5027378 2.2441463 + 80 1.402534 -4.5752515 0 -2.5043224 1.9011715 + 90 1.3870321 -4.5512479 0 -2.5032084 2.0040237 + 100 1.3635651 -4.5209384 0 -2.5075493 1.9773816 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 1 by 1 by 1 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -4.1934138 0 -2.7168513 0.72358299 + 10 1.0170498 -4.2225288 0 -2.7207912 0.7556766 + 20 0.92567967 -4.0920979 0 -2.725274 1.2463143 + 30 1.0851758 -4.3346599 0 -2.73233 0.53176652 + 40 1.2163699 -4.5351986 0 -2.7391524 -0.077915153 + 50 1.2305739 -4.5558134 0 -2.7387942 -0.10711153 + 60 1.1172288 -4.3979372 0 -2.7482791 0.52752067 + 70 1.2228415 -4.5540741 0 -2.7484722 0.11937533 + 80 1.1776333 -4.4870195 0 -2.7481704 0.33904864 + 90 1.219283 -4.5483185 0 -2.747971 0.17898549 + 100 1.2138939 -4.5432229 0 -2.7508327 0.3076354 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 1 by 1 by 1 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.8524214 0 -2.3758589 4.6814052 + 10 1.3356745 -4.3481612 0 -2.3759544 3.061856 + 20 1.1791601 -4.117932 0 -2.3768284 3.8565 + 30 1.3435556 -4.3613609 0 -2.3775171 3.0728735 + 40 1.5628445 -4.6886004 0 -2.3809628 2.0989245 + 50 1.4735556 -4.5569123 0 -2.3811152 2.6364099 + 60 1.609387 -4.7581056 0 -2.3817452 1.8988642 + 70 1.5014902 -4.5938759 0 -2.3768318 2.458161 + 80 1.3763383 -4.4089865 0 -2.3767369 3.0379808 + 90 1.498202 -4.5909613 0 -2.3787724 2.5543714 + 100 1.43934 -4.5009545 0 -2.375679 3.0923444 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.engine.plugin.g++.3 b/examples/mdi/log.7Apr22.mdi.sequence.engine.plugin.g++.3 new file mode 100644 index 0000000000..df8d258715 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.engine.plugin.g++.3 @@ -0,0 +1,89 @@ +LAMMPS (17 Feb 2022) +# MDI engine script to process a series of evaulate, run, minimize commands + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 1 0 1 0 1 +create_box 1 box +Created orthogonal box = (0 0 0) to (1.6795962 1.6795962 1.6795962) + 1 by 1 by 3 MPI processor grid +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +thermo 10 + +mdi engine +delete_atoms group all +Deleted 0 atoms, new total = 0 + 1 by 1 by 3 MPI processor grid + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.07 | 3.07 | 3.071 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.9713146 0 -2.4947521 3.1253597 + 10 1.2380002 -4.3210346 0 -2.4930499 2.0015258 + 20 1.173596 -4.2234559 0 -2.4905682 2.3587731 + 30 1.2989994 -4.4124445 0 -2.4943907 1.903698 + 40 1.4510255 -4.6467459 0 -2.504216 1.2196259 + 50 1.4631454 -4.6641774 0 -2.5037518 1.2838406 + 60 1.2694188 -4.3794267 0 -2.5050505 2.4497113 + 70 1.3363814 -4.4759884 0 -2.5027378 2.2441463 + 80 1.402534 -4.5752515 0 -2.5043224 1.9011715 + 90 1.3870321 -4.5512479 0 -2.5032084 2.0040237 + 100 1.3635651 -4.5209384 0 -2.5075493 1.9773816 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 1 by 1 by 3 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.07 | 3.07 | 3.071 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -4.1934138 0 -2.7168513 0.72358299 + 10 1.0170498 -4.2225288 0 -2.7207912 0.7556766 + 20 0.92567967 -4.0920979 0 -2.725274 1.2463143 + 30 1.0851758 -4.3346599 0 -2.73233 0.53176652 + 40 1.2163699 -4.5351986 0 -2.7391524 -0.077915153 + 50 1.2305739 -4.5558134 0 -2.7387942 -0.10711153 + 60 1.1172288 -4.3979372 0 -2.7482791 0.52752067 + 70 1.2228415 -4.5540741 0 -2.7484722 0.11937533 + 80 1.1776333 -4.4870195 0 -2.7481704 0.33904864 + 90 1.219283 -4.5483185 0 -2.747971 0.17898549 + 100 1.2138939 -4.5432229 0 -2.7508327 0.3076354 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 3 by 1 by 1 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.07 | 3.07 | 3.071 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.8524214 0 -2.3758589 4.6814052 + 10 1.3356745 -4.3481612 0 -2.3759544 3.061856 + 20 1.1791601 -4.117932 0 -2.3768284 3.8565 + 30 1.3435556 -4.3613609 0 -2.3775171 3.0728735 + 40 1.5628445 -4.6886004 0 -2.3809628 2.0989245 + 50 1.4735556 -4.5569123 0 -2.3811152 2.6364099 + 60 1.609387 -4.7581056 0 -2.3817452 1.8988642 + 70 1.5014902 -4.5938759 0 -2.3768318 2.458161 + 80 1.3763383 -4.4089865 0 -2.3767369 3.0379808 + 90 1.498202 -4.5909613 0 -2.3787724 2.5543714 + 100 1.43934 -4.5009545 0 -2.375679 3.0923444 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.engine.tcp.g++.1 b/examples/mdi/log.7Apr22.mdi.sequence.engine.tcp.g++.1 new file mode 100644 index 0000000000..929cdce5cf --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.engine.tcp.g++.1 @@ -0,0 +1,89 @@ +LAMMPS (17 Feb 2022) +# MDI engine script to process a series of evaulate, run, minimize commands + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 1 0 1 0 1 +create_box 1 box +Created orthogonal box = (0 0 0) to (1.6795962 1.6795962 1.6795962) + 1 by 1 by 1 MPI processor grid +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +thermo 10 + +mdi engine +delete_atoms group all +Deleted 0 atoms, new total = 0 + 1 by 1 by 1 MPI processor grid + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.9713146 0 -2.4947521 3.1253597 + 10 1.2380002 -4.3210346 0 -2.4930499 2.0015258 + 20 1.173596 -4.2234559 0 -2.4905682 2.3587731 + 30 1.2989994 -4.4124445 0 -2.4943907 1.903698 + 40 1.4510255 -4.6467459 0 -2.504216 1.2196259 + 50 1.4631454 -4.6641774 0 -2.5037518 1.2838406 + 60 1.2694188 -4.3794267 0 -2.5050505 2.4497113 + 70 1.3363814 -4.4759884 0 -2.5027378 2.2441463 + 80 1.402534 -4.5752515 0 -2.5043224 1.9011715 + 90 1.3870321 -4.5512479 0 -2.5032084 2.0040237 + 100 1.3635651 -4.5209384 0 -2.5075493 1.9773816 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 1 by 1 by 1 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -4.1934138 0 -2.7168513 0.72358299 + 10 1.0170498 -4.2225288 0 -2.7207912 0.7556766 + 20 0.92567967 -4.0920979 0 -2.725274 1.2463143 + 30 1.0851758 -4.3346599 0 -2.73233 0.53176652 + 40 1.2163699 -4.5351986 0 -2.7391524 -0.077915153 + 50 1.2305739 -4.5558134 0 -2.7387942 -0.10711153 + 60 1.1172288 -4.3979372 0 -2.7482791 0.52752067 + 70 1.2228415 -4.5540741 0 -2.7484722 0.11937533 + 80 1.1776333 -4.4870195 0 -2.7481704 0.33904864 + 90 1.219283 -4.5483185 0 -2.747971 0.17898549 + 100 1.2138939 -4.5432229 0 -2.7508327 0.3076354 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 1 by 1 by 1 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.8524214 0 -2.3758589 4.6814052 + 10 1.3356745 -4.3481612 0 -2.3759544 3.061856 + 20 1.1791601 -4.117932 0 -2.3768284 3.8565 + 30 1.3435556 -4.3613609 0 -2.3775171 3.0728735 + 40 1.5628445 -4.6886004 0 -2.3809628 2.0989245 + 50 1.4735556 -4.5569123 0 -2.3811152 2.6364099 + 60 1.609387 -4.7581056 0 -2.3817452 1.8988642 + 70 1.5014902 -4.5938759 0 -2.3768318 2.458161 + 80 1.3763383 -4.4089865 0 -2.3767369 3.0379808 + 90 1.498202 -4.5909613 0 -2.3787724 2.5543714 + 100 1.43934 -4.5009545 0 -2.375679 3.0923444 +Total wall time: 0:00:00 diff --git a/examples/mdi/log.7Apr22.mdi.sequence.engine.tcp.g++.4 b/examples/mdi/log.7Apr22.mdi.sequence.engine.tcp.g++.4 new file mode 100644 index 0000000000..ada69c6ca7 --- /dev/null +++ b/examples/mdi/log.7Apr22.mdi.sequence.engine.tcp.g++.4 @@ -0,0 +1,89 @@ +LAMMPS (17 Feb 2022) +# MDI engine script to process a series of evaulate, run, minimize commands + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 1 0 1 0 1 +create_box 1 box +Created orthogonal box = (0 0 0) to (1.6795962 1.6795962 1.6795962) + 1 by 2 by 2 MPI processor grid +mass 1 1.0 + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve + +thermo 10 + +mdi engine +delete_atoms group all +Deleted 0 atoms, new total = 0 + 1 by 2 by 2 MPI processor grid + generated 0 of 0 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 = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.9713146 0 -2.4947521 3.1253597 + 10 1.2380002 -4.3210346 0 -2.4930499 2.0015258 + 20 1.173596 -4.2234559 0 -2.4905682 2.3587731 + 30 1.2989994 -4.4124445 0 -2.4943907 1.903698 + 40 1.4510255 -4.6467459 0 -2.504216 1.2196259 + 50 1.4631454 -4.6641774 0 -2.5037518 1.2838406 + 60 1.2694188 -4.3794267 0 -2.5050505 2.4497113 + 70 1.3363814 -4.4759884 0 -2.5027378 2.2441463 + 80 1.402534 -4.5752515 0 -2.5043224 1.9011715 + 90 1.3870321 -4.5512479 0 -2.5032084 2.0040237 + 100 1.3635651 -4.5209384 0 -2.5075493 1.9773816 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 1 by 2 by 2 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -4.1934138 0 -2.7168513 0.72358299 + 10 1.0170498 -4.2225288 0 -2.7207912 0.7556766 + 20 0.92567967 -4.0920979 0 -2.725274 1.2463143 + 30 1.0851758 -4.3346599 0 -2.73233 0.53176652 + 40 1.2163699 -4.5351986 0 -2.7391524 -0.077915153 + 50 1.2305739 -4.5558134 0 -2.7387942 -0.10711153 + 60 1.1172288 -4.3979372 0 -2.7482791 0.52752067 + 70 1.2228415 -4.5540741 0 -2.7484722 0.11937533 + 80 1.1776333 -4.4870195 0 -2.7481704 0.33904864 + 90 1.219283 -4.5483185 0 -2.747971 0.17898549 + 100 1.2138939 -4.5432229 0 -2.7508327 0.3076354 +delete_atoms group all +Deleted 64 atoms, new total = 0 + 1 by 2 by 2 MPI processor grid + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 3.077 | 3.077 | 3.077 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 1 -3.8524214 0 -2.3758589 4.6814052 + 10 1.3356745 -4.3481612 0 -2.3759544 3.061856 + 20 1.1791601 -4.117932 0 -2.3768284 3.8565 + 30 1.3435556 -4.3613609 0 -2.3775171 3.0728735 + 40 1.5628445 -4.6886004 0 -2.3809628 2.0989245 + 50 1.4735556 -4.5569123 0 -2.3811152 2.6364099 + 60 1.609387 -4.7581056 0 -2.3817452 1.8988642 + 70 1.5014902 -4.5938759 0 -2.3768318 2.458161 + 80 1.3763383 -4.4089865 0 -2.3767369 3.0379808 + 90 1.498202 -4.5909613 0 -2.3787724 2.5543714 + 100 1.43934 -4.5009545 0 -2.375679 3.0923444 +Total wall time: 0:00:00 diff --git a/examples/mdi/sequence_driver.py b/examples/mdi/sequence_driver.py index e53186250c..ad1633ba2c 100644 --- a/examples/mdi/sequence_driver.py +++ b/examples/mdi/sequence_driver.py @@ -16,11 +16,11 @@ # -plugin_args arglist # args to add when launching plugin library, only when using plugin mode # enclose arglist in quotes if multiple words -# -n 10 -# number of calculations to perform, default = 1 +# -n 3 +# number of calculations to perform, default = 3 # -mode eval/run/min # style of calculations: single snapshot evals, dynamics, minimization -# default = eval +# default = run # -size Nx Ny Nz # cubic lattice, default = 4 4 4 # -rho 0.75 0.1 @@ -208,8 +208,8 @@ mdiarg = "" plugin = "" plugin_args = "" -ncalc = 1 -mode = "eval" +ncalc = 3 +mode = "run" nx = ny = nz = 4 rho = 0.75 rhodelta = 0.1 From f40180f7fba840b7402f95fde1bc5d43cd99170b Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 7 Apr 2022 15:15:50 -0600 Subject: [PATCH 113/130] lib README edit --- lib/README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/README b/lib/README index dc25053cec..936618e536 100644 --- a/lib/README +++ b/lib/README @@ -35,6 +35,8 @@ kokkos Kokkos package for GPU and many-core acceleration from Kokkos development team (Sandia) linalg set of BLAS and LAPACK routines needed by ATC package from Axel Kohlmeyer (Temple U) +mdi hooks to the MDI library, used by MDI package + from Taylor Barnes (MolSSI at Virginia Tech) message client/server communication library via MPI, sockets, files from Steve Plimpton (Sandia) molfile hooks to VMD molfile plugins, used by the MOLFILE package From ab0e5d5568ebcce20ef82a0b33f15314b7c3c8d5 Mon Sep 17 00:00:00 2001 From: Nick Curtis Date: Thu, 7 Apr 2022 17:48:03 -0400 Subject: [PATCH 114/130] Fix for building GPU backend on ROCm 5.0+ Change-Id: I32ad9be86d6a0467ccae555a1d0272813c905e97 --- cmake/Modules/Packages/GPU.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index aec8887c30..53b5f33b9b 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -347,6 +347,10 @@ elseif(GPU_API STREQUAL "HIP") target_link_libraries(gpu PRIVATE hip::host) if(HIP_USE_DEVICE_SORT) + if(HIP_PLATFORM STREQUAL "amd") + # newer version of ROCm (5.1+) require c++14 for rocprim + set_property(TARGET gpu PROPERTY CXX_STANDARD 14) + endif() # add hipCUB target_include_directories(gpu PRIVATE ${HIP_ROOT_DIR}/../include) target_compile_definitions(gpu PRIVATE -DUSE_HIP_DEVICE_SORT) From 77565add6e648575f6b1adb5228a4c11048320bf Mon Sep 17 00:00:00 2001 From: Nick Curtis Date: Thu, 7 Apr 2022 17:54:20 -0400 Subject: [PATCH 115/130] Add C++14 to Makefile build system Change-Id: I24f72b4aaca93a49877775c3d181507c83cd7f82 --- lib/gpu/Makefile.hip | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/gpu/Makefile.hip b/lib/gpu/Makefile.hip index d5391f7d6b..9b6087bcc3 100644 --- a/lib/gpu/Makefile.hip +++ b/lib/gpu/Makefile.hip @@ -28,6 +28,11 @@ HIP_HOST_INCLUDE += -I./ # path to hipcub HIP_HOST_INCLUDE += -I$(HIP_PATH)/../include +ifeq (amd,$(HIP_PLATFORM)) + # newer version of ROCm (5.1+) require c++14 for rocprim + HIP_OPTS += -std=c++14 +endif + # use mpi HIP_HOST_OPTS += -DMPI_GERYON -DUCL_NO_EXIT # this settings should match LAMMPS Makefile From bd4d92c76d98deb38e644f9e13dba77eea6e1b56 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Thu, 7 Apr 2022 16:02:45 -0600 Subject: [PATCH 116/130] entry for mdi sub-dir in Examples.rst --- doc/src/Examples.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/src/Examples.rst b/doc/src/Examples.rst index c211727902..a85131b1f0 100644 --- a/doc/src/Examples.rst +++ b/doc/src/Examples.rst @@ -94,6 +94,8 @@ Lowercase directories +-------------+------------------------------------------------------------------+ | latte | examples for using fix latte for DFTB via the LATTE library | +-------------+------------------------------------------------------------------+ +| mdi | use of the MDI package and MolSSI MDI code coupling library | ++-------------+------------------------------------------------------------------+ | meam | MEAM test for SiC and shear (same as shear examples) | +-------------+------------------------------------------------------------------+ | melt | rapid melt of 3d LJ system | From 4efdfaa8f351710fb6b64709716cec1056de9a2c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 07:04:48 -0400 Subject: [PATCH 117/130] simplify and make consistent, fix time based dump bug --- src/output.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/output.cpp b/src/output.cpp index 7a1eaaf807..c9da837f63 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -192,7 +192,7 @@ void Output::setup(int memflag) // decide whether to write snapshot and/or calculate next step for dump if (ndump && update->restrict_output == 0) { - next_time_dump_any = MAXBIGINT; + next_dump_any = next_time_dump_any = MAXBIGINT; for (int idump = 0; idump < ndump; idump++) { @@ -256,8 +256,7 @@ void Output::setup(int memflag) if (mode_dump[idump] && (dump[idump]->clearstep || var_dump[idump])) next_time_dump_any = MIN(next_time_dump_any,next_dump[idump]); - if (idump) next_dump_any = MIN(next_dump_any,next_dump[idump]); - else next_dump_any = next_dump[0]; + 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 @@ -356,9 +355,9 @@ void Output::setup(int memflag) // what other command may have added it if (next_dump_any == ntimestep) { + next_dump_any = next_time_dump_any = MAXBIGINT; for (int idump = 0; idump < ndump; idump++) { - next_time_dump_any = MAXBIGINT; if (next_dump[idump] == ntimestep) { if (last_dump[idump] == ntimestep) continue; @@ -381,8 +380,7 @@ void Output::setup(int memflag) if (mode_dump[idump] && (dump[idump]->clearstep || var_dump[idump])) next_time_dump_any = MIN(next_time_dump_any,next_dump[idump]); - if (idump) next_dump_any = MIN(next_dump_any,next_dump[idump]); - else next_dump_any = next_dump[0]; + next_dump_any = MIN(next_dump_any,next_dump[idump]); } } From f8ec0365c6cc4024309b57e3c5bc5e11f4b0e761 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Fri, 8 Apr 2022 12:52:26 -0600 Subject: [PATCH 118/130] Fix a few more issues --- src/KOKKOS/pair_dpd_ext_kokkos.cpp | 29 ++++++-------- src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp | 50 +++++++++--------------- src/KOKKOS/pair_dpd_ext_tstat_kokkos.h | 4 -- src/KOKKOS/pair_dpd_tstat_kokkos.cpp | 28 +++++++------ 4 files changed, 46 insertions(+), 65 deletions(-) diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp index 210f696cb8..dd866c8525 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -370,25 +370,20 @@ void PairDPDExtKokkos::ev_tally_xyz(EV_FLOAT &ev, const int &i, cons } if (vflag_either) { - const E_FLOAT v0 = delx*delx*fx; - const E_FLOAT v1 = dely*dely*fy; - const E_FLOAT v2 = delz*delz*fz; - const E_FLOAT v3 = delx*dely*fy; - const E_FLOAT v4 = delx*delz*fz; - const E_FLOAT v5 = dely*delz*fz; + const E_FLOAT v0 = delx*fx; + const E_FLOAT v1 = dely*fy; + const E_FLOAT v2 = delz*fz; + const E_FLOAT v3 = delx*fy; + const E_FLOAT v4 = delx*fz; + const E_FLOAT v5 = dely*fz; if (vflag_global) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; } if (vflag_atom) { diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp index 8673c1f66d..393a95893b 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp @@ -67,7 +67,6 @@ PairDPDExtTstatKokkos::~PairDPDExtTstatKokkos() { rand_pool.destroy(); #endif - memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->destroy_kokkos(k_cutsq,cutsq); @@ -124,10 +123,12 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) k_params.template modify(); if (eflag_atom) { - memoryKK->destroy_kokkos(k_eatom,eatom); - memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); - d_eatom = k_eatom.template view(); + maxeatom = atom->nmax; + memory->destroy(eatom); + memory->create(eatom,maxeatom,"pair:eatom"); + memset(&eatom[0], 0, maxeatom * sizeof(double)); } + if (vflag_atom) { memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"pair:vatom"); @@ -160,11 +161,9 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) need_dup = lmp->kokkos->need_dup(); if (need_dup) { dup_f = Kokkos::Experimental::create_scatter_view(f); - dup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); dup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); } else { ndup_f = Kokkos::Experimental::create_scatter_view(f); - ndup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); ndup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); } @@ -184,7 +183,6 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) if (need_dup) Kokkos::Experimental::contribute(f, dup_f); - if (eflag_global) eng_vdwl += ev.evdwl; if (vflag_global) { virial[0] += ev.v[0]; virial[1] += ev.v[1]; @@ -196,13 +194,6 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) if (vflag_fdotr) pair_virial_fdotr_compute(this); - if (eflag_atom) { - if (need_dup) - Kokkos::Experimental::contribute(d_eatom, dup_eatom); - k_eatom.template modify(); - k_eatom.template sync(); - } - if (vflag_atom) { if (need_dup) Kokkos::Experimental::contribute(d_vatom, dup_vatom); @@ -218,7 +209,6 @@ void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) // free duplicated memory if (need_dup) { dup_f = decltype(dup_f)(); - dup_eatom = decltype(dup_eatom)(); dup_vatom = decltype(dup_vatom)(); } } @@ -237,6 +227,7 @@ template template KOKKOS_INLINE_FUNCTION void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos, const int &ii, EV_FLOAT &ev) const { + // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); @@ -362,25 +353,20 @@ void PairDPDExtTstatKokkos::v_tally_xyz(EV_FLOAT &ev, const int &i, auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); auto a_vatom = v_vatom.template access>(); - const E_FLOAT v0 = delx*delx*fx; - const E_FLOAT v1 = dely*dely*fy; - const E_FLOAT v2 = delz*delz*fz; - const E_FLOAT v3 = delx*dely*fy; - const E_FLOAT v4 = delx*delz*fz; - const E_FLOAT v5 = dely*delz*fz; + const E_FLOAT v0 = delx*fx; + const E_FLOAT v1 = dely*fy; + const E_FLOAT v2 = delz*fz; + const E_FLOAT v3 = delx*fy; + const E_FLOAT v4 = delx*fz; + const E_FLOAT v5 = dely*fz; if (vflag_global) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; } if (vflag_atom) { diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h index eb4c9f6dfd..03debe58af 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h @@ -95,10 +95,8 @@ class PairDPDExtTstatKokkos : public PairDPDExtTstat { using NonDupScatterView = KKScatterView; DupScatterView dup_f; - DupScatterView dup_eatom; DupScatterView dup_vatom; NonDupScatterView ndup_f; - NonDupScatterView ndup_eatom; NonDupScatterView ndup_vatom; #ifdef DPD_USE_RAN_MARS @@ -127,9 +125,7 @@ class PairDPDExtTstatKokkos : public PairDPDExtTstat { typename Kokkos::DualView::t_dev_const_um params; - DAT::tdual_efloat_1d k_eatom; DAT::tdual_virial_array k_vatom; - typename AT::t_efloat_1d d_eatom; typename AT::t_virial_array d_vatom; KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp index 2720f88dd4..5c25104757 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp @@ -115,12 +115,20 @@ void PairDPDTstatKokkos::compute(int eflagin, int vflagin) temperature = t_start + delta * (t_stop-t_start); double boltz = force->boltz; for (int i = 1; i <= atom->ntypes; i++) - for (int j = i; j <= atom->ntypes; j++) + for (int j = i; j <= atom->ntypes; j++) { k_params.h_view(i,j).sigma = k_params.h_view(j,i).sigma = sqrt(2.0*boltz*temperature*gamma[i][j]); + } } k_params.template modify(); + if (eflag_atom) { + maxeatom = atom->nmax; + memory->destroy(eatom); + memory->create(eatom,maxeatom,"pair:eatom"); + memset(&eatom[0], 0, maxeatom * sizeof(double)); + } + if (vflag_atom) { memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"pair:vatom"); @@ -230,6 +238,7 @@ void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos::v_tally(EV_FLOAT &ev, const int &i, const i const E_FLOAT v5 = dely*delz*fpair; if (vflag_global) { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; } if (vflag_atom) { From caa977e869e5c2ac7e89c067b32811bfa136e06d Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 8 Apr 2022 13:28:14 -0600 Subject: [PATCH 119/130] Remove redundant calls --- src/KOKKOS/pair_dpd_ext_kokkos.cpp | 4 ++-- src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp | 4 ++-- src/KOKKOS/pair_dpd_kokkos.cpp | 4 ++-- src/KOKKOS/pair_dpd_tstat_kokkos.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp index dd866c8525..81a1b0b0a3 100644 --- a/src/KOKKOS/pair_dpd_ext_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -53,8 +53,8 @@ PairDPDExtKokkos::PairDPDExtKokkos(class LAMMPS *lmp) : atomKK = (AtomKokkos *) atom; execution_space = ExecutionSpaceFromDevice::space; - datamask_read = X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; - datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_read = EMPTY_MASK; + datamask_modify = EMPTY_MASK; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp index 393a95893b..76b7658ac9 100644 --- a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp @@ -53,8 +53,8 @@ PairDPDExtTstatKokkos::PairDPDExtTstatKokkos(class LAMMPS *lmp) : atomKK = (AtomKokkos *) atom; execution_space = ExecutionSpaceFromDevice::space; - datamask_read = X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; - datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_read = EMPTY_MASK; + datamask_modify = EMPTY_MASK; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_dpd_kokkos.cpp b/src/KOKKOS/pair_dpd_kokkos.cpp index d9c6282194..2b2c4594ac 100644 --- a/src/KOKKOS/pair_dpd_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_kokkos.cpp @@ -53,8 +53,8 @@ PairDPDKokkos::PairDPDKokkos(class LAMMPS *lmp) : atomKK = (AtomKokkos *) atom; execution_space = ExecutionSpaceFromDevice::space; - datamask_read = X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; - datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_read = EMPTY_MASK; + datamask_modify = EMPTY_MASK; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp index 5c25104757..d9a37c825a 100644 --- a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp @@ -53,8 +53,8 @@ PairDPDTstatKokkos::PairDPDTstatKokkos(class LAMMPS *lmp) : atomKK = (AtomKokkos *) atom; execution_space = ExecutionSpaceFromDevice::space; - datamask_read = X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; - datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_read = EMPTY_MASK; + datamask_modify = EMPTY_MASK; } /* ---------------------------------------------------------------------- */ From 33798b99a4fe4d701a5c6627472c939fa27830b1 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 8 Apr 2022 14:08:51 -0600 Subject: [PATCH 120/130] remove debug print statement --- src/lammps.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lammps.cpp b/src/lammps.cpp index 64477476cc..c74983be43 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -122,8 +122,6 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : modify(nullptr), group(nullptr), output(nullptr), timer(nullptr), kokkos(nullptr), atomKK(nullptr), memoryKK(nullptr), python(nullptr), citeme(nullptr) { - printf("LAMMPS init %d %s %s\n",narg,arg[1],arg[2]); - memory = new Memory(this); error = new Error(this); universe = new Universe(this,communicator); From bfaa1e9ed0cb94ee89633c178c74b1b09963bd80 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 16:28:57 -0400 Subject: [PATCH 121/130] whitespace --- doc/src/mdi.rst | 4 ++-- src/MDI/mdi_engine.cpp | 24 ++++++++++++------------ src/MDI/mdi_engine.h | 4 ++-- src/MDI/mdi_plugin.cpp | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/doc/src/mdi.rst b/doc/src/mdi.rst index 93eef50065..95b41a2219 100644 --- a/doc/src/mdi.rst +++ b/doc/src/mdi.rst @@ -51,7 +51,7 @@ code, launched separately from LAMMPS, in which case the mdi plugin command is not used. See the Howto MDI doc page for a discussion of all the different ways -2 or more codes can interact via MDI. +2 or more codes can interact via MDI. The examples/mdi directory has examples which use LAMMPS in 4 different modes: as a driver using an engine as either a stand-alone @@ -241,7 +241,7 @@ commands are supported, as documented above: FORCES"); MDI_Register_callback("@FORCES",">+FORCES"); - MDI_Register_command("@FORCES","<@"); + MDI_Register_command("@FORCES","<@"); MDI_Register_command("@FORCES","add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); - FixMDIEngine *mdi_fix = + FixMDIEngine *mdi_fix = (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); mdi_fix->mdi_engine = this; @@ -622,7 +622,7 @@ void MDIEngine::mdi_md() update->whichflag = 1; timer->init_timeout(); - + update->nsteps = 1; update->beginstep = update->firststep = update->ntimestep; update->endstep = update->laststep = update->ntimestep + update->nsteps; @@ -648,9 +648,9 @@ void MDIEngine::mdi_md() update->laststep += 1; update->endstep = update->laststep; output->next = update->ntimestep + 1; - + update->integrate->run(1); - + if (strcmp(mdicmd,"@COORDS") != 0 && strcmp(mdicmd,"@FORCES") != 0 && strcmp(mdicmd,"@ENDSTEP") != 0) break; @@ -690,7 +690,7 @@ void MDIEngine::md() update->whichflag = 1; timer->init_timeout(); - + update->nsteps = nsteps; update->beginstep = update->firststep = update->ntimestep; update->endstep = update->laststep = update->ntimestep + update->nsteps; @@ -735,7 +735,7 @@ void MDIEngine::mdi_optg() // delete the instance before this method returns modify->add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); - FixMDIEngine *mdi_fix = + FixMDIEngine *mdi_fix = (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); mdi_fix->mdi_engine = this; @@ -851,11 +851,11 @@ void MDIEngine::optg() void MDIEngine::evaluate() { int flag_create = flag_natoms | flag_types; - int flag_other = flag_cell | flag_cell_displ | flag_charges | + int flag_other = flag_cell | flag_cell_displ | flag_charges | flag_coords | flag_velocities; // create or update system if requested - + if (flag_create) create_system(); else if (flag_other) { if (flag_cell || flag_cell_displ) adjust_box(); @@ -1215,7 +1215,7 @@ void MDIEngine::receive_tolerance() niterate = static_cast (params[2]); max_eval = static_cast (params[3]); - if (etol < 0.0 || ftol < 0.0 || niterate < 0 || max_eval < 0) + if (etol < 0.0 || ftol < 0.0 || niterate < 0 || max_eval < 0) error->all(FLERR,"MDI received invalid toleranace parameters"); } @@ -1378,7 +1378,7 @@ void MDIEngine::send_labels() // use atomID to index into ordered ibuf1 - tagint *tag = atom->tag; + tagint *tag = atom->tag; int *type = atom->type; int nlocal = atom->nlocal; diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index e2b62b7e86..57a7942722 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -61,7 +61,7 @@ class MDIEngine : protected Pointers { int *sys_types; double *sys_charges,*sys_coords,*sys_velocities; double sys_cell[9],sys_cell_displ[3]; - + int nsteps; // timesteps for MD double etol,ftol; // 4 minimization params for OPTG int niterate,max_eval; @@ -82,7 +82,7 @@ class MDIEngine : protected Pointers { char *id_ke,*id_pe,*id_press; // computes invoked by MDI class Compute *ke,*pe,*press; - class Irregular *irregular; // irregular comm if new COORDS + class Irregular *irregular; // irregular comm if new COORDS // are highly displaced // class methods diff --git a/src/MDI/mdi_plugin.cpp b/src/MDI/mdi_plugin.cpp index 9d2d2b6475..f63a9b5de9 100644 --- a/src/MDI/mdi_plugin.cpp +++ b/src/MDI/mdi_plugin.cpp @@ -73,7 +73,7 @@ MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // error checks - if (!mdi_arg || !infile_arg || !lammps_command) + if (!mdi_arg || !infile_arg || !lammps_command) error->all(FLERR,"MDI plugin must specify mdi, infile, command keywords"); // build full plugin_args string for args to plugin library @@ -110,14 +110,14 @@ MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) with the plugin ---------------------------------------------------------------------- */ -int MDIPlugin::plugin_wrapper(void *pmpicomm, MDI_Comm mdicomm, +int MDIPlugin::plugin_wrapper(void *pmpicomm, MDI_Comm mdicomm, void *vptr) { MPI_Comm mpicomm = *(MPI_Comm *) pmpicomm; MDIPlugin *ptr = (MDIPlugin *) vptr; LAMMPS *lammps = ptr->lmp; char *lammps_command = ptr->lammps_command; - + // set FixMDIAimd mdicomm to driver's mdicomm passed to this callback FixMDIAimd *aimdptr = (FixMDIAimd *) (ptr->fixptr); From 07aecb3678fc5e0ad73f8fec910510b0fec1d926 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 16:36:21 -0400 Subject: [PATCH 122/130] whitespace fixes and apply clang-format --- src/MDI/fix_mdi_aimd.cpp | 135 +++---- src/MDI/fix_mdi_aimd.h | 14 +- src/MDI/fix_mdi_engine.cpp | 9 +- src/MDI/library_mdi.cpp | 12 +- src/MDI/mdi_command.cpp | 18 +- src/MDI/mdi_command.h | 2 +- src/MDI/mdi_engine.cpp | 789 ++++++++++++++++++------------------- src/MDI/mdi_engine.h | 68 ++-- src/MDI/mdi_plugin.cpp | 59 +-- src/MDI/mdi_plugin.h | 4 +- 10 files changed, 551 insertions(+), 559 deletions(-) diff --git a/src/MDI/fix_mdi_aimd.cpp b/src/MDI/fix_mdi_aimd.cpp index 31989a4938..52df86e3e0 100644 --- a/src/MDI/fix_mdi_aimd.cpp +++ b/src/MDI/fix_mdi_aimd.cpp @@ -11,11 +11,11 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "error.h" #include "fix_mdi_aimd.h" #include "atom.h" #include "comm.h" #include "domain.h" +#include "error.h" #include "force.h" #include "memory.h" #include "update.h" @@ -23,12 +23,11 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{NATIVE,REAL,METAL}; // LAMMPS units which MDI supports +enum { NATIVE, REAL, METAL }; // LAMMPS units which MDI supports /* ---------------------------------------------------------------------- */ -FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) +FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg > 4) error->all(FLERR, "Illegal fix mdi/aimd command"); @@ -43,14 +42,15 @@ FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : plugin = 0; if (narg == 4) { - if (strcmp(arg[3],"plugin") == 0) plugin = 1; - else error->all(FLERR, "Illegal fix mdi/aimd command"); + if (strcmp(arg[3], "plugin") == 0) + plugin = 1; + else + error->all(FLERR, "Illegal fix mdi/aimd command"); } // check requirements for LAMMPS to work with MDI as an engine - if (atom->tag_enable == 0) - error->all(FLERR, "Cannot use MDI engine without atom IDs"); + if (atom->tag_enable == 0) error->all(FLERR, "Cannot use MDI engine without atom IDs"); if (atom->natoms && atom->tag_consecutive() == 0) error->all(FLERR, "MDI engine requires consecutive atom IDs"); @@ -60,7 +60,7 @@ FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : int role; MDI_Get_role(&role); if (role != MDI_DRIVER) - error->all(FLERR,"Must invoke LAMMPS as an MDI driver to use fix mdi/aimd"); + error->all(FLERR, "Must invoke LAMMPS as an MDI driver to use fix mdi/aimd"); // storage for all atoms @@ -69,9 +69,12 @@ FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : // set unit conversion factors - if (strcmp(update->unit_style, "real") == 0) lmpunits = REAL; - else if (strcmp(update->unit_style, "metal") == 0) lmpunits = METAL; - else lmpunits = NATIVE; + if (strcmp(update->unit_style, "real") == 0) + lmpunits = REAL; + else if (strcmp(update->unit_style, "metal") == 0) + lmpunits = METAL; + else + lmpunits = NATIVE; unit_conversions(); @@ -92,8 +95,8 @@ FixMDIAimd::~FixMDIAimd() // send exit command to engine, only if engine is stand-alone code if (!plugin) { - int ierr = MDI_Send_command("EXIT",mdicomm); - if (ierr) error->all(FLERR,"MDI: EXIT command"); + int ierr = MDI_Send_command("EXIT", mdicomm); + if (ierr) error->all(FLERR, "MDI: EXIT command"); } // clean up @@ -124,7 +127,7 @@ void FixMDIAimd::setup(int vflag) void FixMDIAimd::setup_pre_reverse(int eflag, int vflag) { - pre_reverse(eflag,vflag); + pre_reverse(eflag, vflag); } /* ---------------------------------------------------------------------- @@ -140,25 +143,25 @@ void FixMDIAimd::pre_reverse(int eflag, int /*vflag*/) void FixMDIAimd::post_force(int vflag) { - int ilocal,ierr; + int ilocal, ierr; double cell[9]; int eflag = eflag_caller; - ev_init(eflag,vflag); + ev_init(eflag, vflag); // if simulation box dynamically changes, send current box to MDI engine if (domain->box_change_size || domain->box_change_shape) { - ierr = MDI_Send_command(">CELL_DISPL",mdicomm); - if (ierr) error->all(FLERR,"MDI: >CELL_DISPL command"); + ierr = MDI_Send_command(">CELL_DISPL", mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL_DISPL command"); cell[0] = domain->boxlo[0] * lmp2mdi_length; cell[1] = domain->boxlo[1] * lmp2mdi_length; cell[2] = domain->boxlo[2] * lmp2mdi_length; - ierr = MDI_Send(cell,3,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: >CELL_DISPL data"); + ierr = MDI_Send(cell, 3, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL_DISPL data"); - ierr = MDI_Send_command(">CELL",mdicomm); - if (ierr) error->all(FLERR,"MDI: >CELL command"); + ierr = MDI_Send_command(">CELL", mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL command"); cell[0] = domain->boxhi[0] - domain->boxlo[0]; cell[1] = 0.0; cell[2] = 0.0; @@ -168,43 +171,43 @@ void FixMDIAimd::post_force(int vflag) cell[6] = domain->xz; cell[7] = domain->yz; cell[8] = domain->boxhi[2] - domain->boxlo[2]; - ierr = MDI_Send(cell,9,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: >CELL data"); + ierr = MDI_Send(cell, 9, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL data"); } // gather all coords, ordered by atomID reallocate(); - memset(buf3,0,3*atom->natoms*sizeof(double)); + memset(buf3, 0, 3 * atom->natoms * sizeof(double)); double **x = atom->x; tagint *tag = atom->tag; int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - buf3[3*ilocal+0] = x[i][0] * lmp2mdi_length; - buf3[3*ilocal+1] = x[i][1] * lmp2mdi_length; - buf3[3*ilocal+2] = x[i][2] * lmp2mdi_length; + ilocal = static_cast(tag[i]) - 1; + buf3[3 * ilocal + 0] = x[i][0] * lmp2mdi_length; + buf3[3 * ilocal + 1] = x[i][1] * lmp2mdi_length; + buf3[3 * ilocal + 2] = x[i][2] * lmp2mdi_length; } - MPI_Reduce(buf3,buf3all,3*atom->natoms,MPI_DOUBLE,MPI_SUM,0,world); + MPI_Reduce(buf3, buf3all, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); // send current coords to MDI engine - ierr = MDI_Send_command(">COORDS",mdicomm); - if (ierr) error->all(FLERR,"MDI: >COORDS command"); - ierr = MDI_Send(buf3all,3*atom->natoms,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: >COORDS data"); + ierr = MDI_Send_command(">COORDS", mdicomm); + if (ierr) error->all(FLERR, "MDI: >COORDS command"); + ierr = MDI_Send(buf3all, 3 * atom->natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >COORDS data"); // request forces from MDI engine // this triggers engine to evaluate forces,energy,stress for current system - ierr = MDI_Send_command("all(FLERR,"MDI: natoms,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: natoms,MPI_DOUBLE,0,world); + ierr = MDI_Send_command("all(FLERR, "MDI: natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: natoms, MPI_DOUBLE, 0, world); // add forces to owned atoms // use atomID to index into ordered buf3 @@ -212,20 +215,20 @@ void FixMDIAimd::post_force(int vflag) double **f = atom->f; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - f[i][0] += buf3[3*ilocal+0] * mdi2lmp_force; - f[i][1] += buf3[3*ilocal+1] * mdi2lmp_force; - f[i][2] += buf3[3*ilocal+2] * mdi2lmp_force; + ilocal = static_cast(tag[i]) - 1; + f[i][0] += buf3[3 * ilocal + 0] * mdi2lmp_force; + f[i][1] += buf3[3 * ilocal + 1] * mdi2lmp_force; + f[i][2] += buf3[3 * ilocal + 2] * mdi2lmp_force; } // optionally request potential energy from MDI engine if (eflag_global) { - ierr = MDI_Send_command("all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR, "MDI: all(FLERR, "MDI: all(FLERR,"MDI: all(FLERR,"MDI: all(FLERR, "MDI: all(FLERR, "MDI: xprd * domain->yprd * domain->zprd; for (int i = 0; i < 6; i++) { @@ -272,16 +275,16 @@ void FixMDIAimd::reallocate() { if (atom->natoms <= maxbuf) return; - if (3*atom->natoms > MAXSMALLINT) - error->all(FLERR,"Natoms too large to use with fix mdi/aimd"); + if (3 * atom->natoms > MAXSMALLINT) + error->all(FLERR, "Natoms too large to use with fix mdi/aimd"); maxbuf = atom->natoms; memory->destroy(buf3); memory->destroy(buf3all); - memory->create(buf3,3*maxbuf,"mdi:buf3"); - memory->create(buf3all,3*maxbuf,"mdi:buf3all"); + memory->create(buf3, 3 * maxbuf, "mdi:buf3"); + memory->create(buf3all, 3 * maxbuf, "mdi:buf3all"); } /* ---------------------------------------------------------------------- @@ -290,12 +293,12 @@ void FixMDIAimd::reallocate() void FixMDIAimd::unit_conversions() { - double angstrom_to_bohr,kelvin_to_hartree,ev_to_hartree,second_to_aut; + double angstrom_to_bohr, kelvin_to_hartree, ev_to_hartree, second_to_aut; - MDI_Conversion_factor("angstrom","bohr",&angstrom_to_bohr); - MDI_Conversion_factor("kelvin_energy","hartree",&kelvin_to_hartree); - MDI_Conversion_factor("electron_volt","hartree",&ev_to_hartree); - MDI_Conversion_Factor("second","atomic_unit_of_time",&second_to_aut); + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); + MDI_Conversion_Factor("second", "atomic_unit_of_time", &second_to_aut); // length units @@ -340,11 +343,11 @@ void FixMDIAimd::unit_conversions() if (lmpunits == REAL) { lmp2mdi_pressure = (kelvin_to_hartree / force->boltz) / - (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; } else if (lmpunits == METAL) { - lmp2mdi_pressure = ev_to_hartree / - (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + lmp2mdi_pressure = + ev_to_hartree / (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; } diff --git a/src/MDI/fix_mdi_aimd.h b/src/MDI/fix_mdi_aimd.h index dd3b2ab981..6ca886794f 100644 --- a/src/MDI/fix_mdi_aimd.h +++ b/src/MDI/fix_mdi_aimd.h @@ -52,16 +52,16 @@ class FixMDIAimd : public Fix { // unit conversion factors - double lmp2mdi_length,mdi2lmp_length; - double lmp2mdi_energy,mdi2lmp_energy; - double lmp2mdi_force,mdi2lmp_force; - double lmp2mdi_pressure,mdi2lmp_pressure; - double lmp2mdi_velocity,mdi2lmp_velocity; + double lmp2mdi_length, mdi2lmp_length; + double lmp2mdi_energy, mdi2lmp_energy; + double lmp2mdi_force, mdi2lmp_force; + double lmp2mdi_pressure, mdi2lmp_pressure; + double lmp2mdi_velocity, mdi2lmp_velocity; // buffers for MDI comm int maxbuf; - double *buf3,*buf3all; + double *buf3, *buf3all; // methods @@ -69,7 +69,7 @@ class FixMDIAimd : public Fix { void unit_conversions(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MDI/fix_mdi_engine.cpp b/src/MDI/fix_mdi_engine.cpp index a60740d7b3..aac4f727fb 100644 --- a/src/MDI/fix_mdi_engine.cpp +++ b/src/MDI/fix_mdi_engine.cpp @@ -16,18 +16,19 @@ MolSSI Driver Interface (MDI) support for LAMMPS ------------------------------------------------------------------------- */ -#include "error.h" #include "fix_mdi_engine.h" -#include "mdi_engine.h" + +#include "error.h" #include "update.h" +#include "mdi_engine.h" + using namespace LAMMPS_NS; using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixMDIEngine::FixMDIEngine(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) +FixMDIEngine::FixMDIEngine(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg != 3) error->all(FLERR, "Illegal fix mdi/engine command"); } diff --git a/src/MDI/library_mdi.cpp b/src/MDI/library_mdi.cpp index 4048f805a5..445e42b7e4 100644 --- a/src/MDI/library_mdi.cpp +++ b/src/MDI/library_mdi.cpp @@ -74,8 +74,7 @@ int MDI_Plugin_init_lammps() bool found_filename = false; while (iarg < mdi_argc && !found_filename) { - if ((strcmp(mdi_argv[iarg], "-in") == 0) || - (strcmp(mdi_argv[iarg], "-i") == 0)) { + if ((strcmp(mdi_argv[iarg], "-in") == 0) || (strcmp(mdi_argv[iarg], "-i") == 0)) { if (iarg + 2 > mdi_argc) MPI_Abort(MPI_COMM_WORLD, 1); filename = mdi_argv[iarg + 1]; @@ -84,8 +83,7 @@ int MDI_Plugin_init_lammps() // remove -in argument from the command list mdi_argc -= 2; - for (int jarg = iarg; jarg < mdi_argc; jarg++) - mdi_argv[jarg] = mdi_argv[jarg + 2]; + for (int jarg = iarg; jarg < mdi_argc; jarg++) mdi_argv[jarg] = mdi_argv[jarg + 2]; } iarg++; } @@ -97,9 +95,9 @@ int MDI_Plugin_init_lammps() void *lmp = nullptr; if (lammps_config_has_mpi_support() > 0) - lmp = lammps_open(mdi_argc+1, &mdi_argv[-1], mpi_world_comm, nullptr); + lmp = lammps_open(mdi_argc + 1, &mdi_argv[-1], mpi_world_comm, nullptr); else - lmp = lammps_open_no_mpi(mdi_argc+1, &mdi_argv[-1], nullptr); + lmp = lammps_open_no_mpi(mdi_argc + 1, &mdi_argv[-1], nullptr); // process the specified input script // must contain "mdi engine" command @@ -132,5 +130,5 @@ The function executes a single command from an external MDI driver. int lammps_execute_mdi_command(const char *command, MDI_Comm comm, void *class_obj) { MDIEngine *mdi_engine = (MDIEngine *) class_obj; - return mdi_engine->execute_command(command,comm); + return mdi_engine->execute_command(command, comm); } diff --git a/src/MDI/mdi_command.cpp b/src/MDI/mdi_command.cpp index 720258cc69..65e47e197a 100644 --- a/src/MDI/mdi_command.cpp +++ b/src/MDI/mdi_command.cpp @@ -13,10 +13,11 @@ #include "mdi_command.h" -#include +#include "error.h" #include "mdi_engine.h" #include "mdi_plugin.h" -#include "error.h" + +#include using namespace LAMMPS_NS; @@ -26,11 +27,12 @@ using namespace LAMMPS_NS; void MDICommand::command(int narg, char **arg) { - if (narg < 1) error->all(FLERR,"Illegal mdi command"); + if (narg < 1) error->all(FLERR, "Illegal mdi command"); - if (strcmp(arg[0],"engine") == 0) { - MDIEngine(lmp,narg-1,&arg[1]); - } else if (strcmp(arg[0],"plugin") == 0) { - MDIPlugin(lmp,narg-1,&arg[1]); - } else error->all(FLERR,"Illegal mdi command"); + if (strcmp(arg[0], "engine") == 0) { + MDIEngine(lmp, narg - 1, &arg[1]); + } else if (strcmp(arg[0], "plugin") == 0) { + MDIPlugin(lmp, narg - 1, &arg[1]); + } else + error->all(FLERR, "Illegal mdi command"); } diff --git a/src/MDI/mdi_command.h b/src/MDI/mdi_command.h index 27ec7442df..d944c66004 100644 --- a/src/MDI/mdi_command.h +++ b/src/MDI/mdi_command.h @@ -32,7 +32,7 @@ class MDICommand : public Command { void command(int, char **) override; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 42ec3d1e6b..e6fff575eb 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -18,8 +18,6 @@ #include "mdi_engine.h" -#include -#include #include "atom.h" #include "comm.h" #include "compute.h" @@ -42,16 +40,19 @@ #include "timer.h" #include "update.h" +#include +#include + #include using namespace LAMMPS_NS; -enum{NATIVE,REAL,METAL}; // LAMMPS units which MDI supports -enum{DEFAULT,MD,OPT}; // top-level MDI engine modes +enum { NATIVE, REAL, METAL }; // LAMMPS units which MDI supports +enum { DEFAULT, MD, OPT }; // top-level MDI engine modes // per-atom data which engine commands access -enum{TYPE,CHARGE,MASS,COORD,VELOCITY,FORCE,ADDFORCE}; +enum { TYPE, CHARGE, MASS, COORD, VELOCITY, FORCE, ADDFORCE }; /* ---------------------------------------------------------------------- trigger LAMMPS to start acting as an MDI engine @@ -64,22 +65,21 @@ enum{TYPE,CHARGE,MASS,COORD,VELOCITY,FORCE,ADDFORCE}; MDIEngine::MDIEngine(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) { - if (narg) error->all(FLERR,"Illegal mdi engine command"); + if (narg) error->all(FLERR, "Illegal mdi engine command"); // check requirements for LAMMPS to work with MDI as an engine - if (atom->tag_enable == 0) - error->all(FLERR,"Cannot use MDI engine without atom IDs"); + if (atom->tag_enable == 0) error->all(FLERR, "Cannot use MDI engine without atom IDs"); if (atom->natoms && atom->tag_consecutive() == 0) - error->all(FLERR,"MDI engine requires consecutive atom IDs"); + error->all(FLERR, "MDI engine requires consecutive atom IDs"); // confirm LAMMPS is being run as an engine int role; MDI_Get_role(&role); if (role != MDI_ENGINE) - error->all(FLERR,"Must invoke LAMMPS as an MDI engine to use mdi engine"); + error->all(FLERR, "Must invoke LAMMPS as an MDI engine to use mdi engine"); // root = 1 for proc 0, otherwise 0 @@ -89,9 +89,9 @@ MDIEngine::MDIEngine(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) mdicmd = new char[MDI_COMMAND_LENGTH]; node_engine = new char[MDI_COMMAND_LENGTH]; - strncpy(node_engine,"@DEFAULT",MDI_COMMAND_LENGTH); + strncpy(node_engine, "@DEFAULT", MDI_COMMAND_LENGTH); node_driver = new char[MDI_COMMAND_LENGTH]; - strncpy(node_driver,"\0",MDI_COMMAND_LENGTH); + strncpy(node_driver, "\0", MDI_COMMAND_LENGTH); // create computes for KE. PE, pressure // pressure compute only calculates virial, no kinetic term @@ -122,9 +122,12 @@ MDIEngine::MDIEngine(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // set unit conversion factors - if (strcmp(update->unit_style, "real") == 0) lmpunits = REAL; - else if (strcmp(update->unit_style, "metal") == 0) lmpunits = METAL; - else lmpunits = NATIVE; + if (strcmp(update->unit_style, "real") == 0) + lmpunits = REAL; + else if (strcmp(update->unit_style, "metal") == 0) + lmpunits = METAL; + else + lmpunits = NATIVE; unit_conversions(); @@ -163,12 +166,12 @@ MDIEngine::MDIEngine(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // register the execute_command function with MDI // only used when engine runs in plugin mode - MDI_Set_execute_command_func(lammps_execute_mdi_command,this); + MDI_Set_execute_command_func(lammps_execute_mdi_command, this); // one-time operation to establish a connection with the driver MDI_Accept_communicator(&mdicomm); - if (mdicomm <= 0) error->all(FLERR,"Unable to connect to MDI driver"); + if (mdicomm <= 0) error->all(FLERR, "Unable to connect to MDI driver"); // endless engine loop, responding to driver commands @@ -185,11 +188,11 @@ MDIEngine::MDIEngine(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // MDI commands for dynamics or minimization - if (strcmp(mdicmd,"@INIT_MD") == 0) { + if (strcmp(mdicmd, "@INIT_MD") == 0) { mdi_md(); if (exit_command) break; - } else if (strcmp(mdicmd,"@INIT_OPTG") == 0) { + } else if (strcmp(mdicmd, "@INIT_OPTG") == 0) { mdi_optg(); if (exit_command) break; @@ -197,23 +200,21 @@ MDIEngine::MDIEngine(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) break; } else - error->all(FLERR, - fmt::format("MDI engine exited with invalid command: {}", - mdicmd)); + error->all(FLERR, fmt::format("MDI engine exited with invalid command: {}", mdicmd)); } // clean up - delete [] mdicmd; - delete [] node_engine; - delete [] node_driver; + delete[] mdicmd; + delete[] node_engine; + delete[] node_driver; modify->delete_compute(id_pe); modify->delete_compute(id_press); - delete [] id_ke; - delete [] id_pe; - delete [] id_press; + delete[] id_ke; + delete[] id_pe; + delete[] id_press; delete irregular; @@ -234,10 +235,9 @@ void MDIEngine::engine_node(const char *node) // do not process commands if engine and driver request are not the same - strncpy(node_engine,node,MDI_COMMAND_LENGTH); + strncpy(node_engine, node, MDI_COMMAND_LENGTH); - if (strcmp(node_driver,"\0") != 0 && strcmp(node_driver,node_engine) != 0) - node_match = false; + if (strcmp(node_driver, "\0") != 0 && strcmp(node_driver, node_engine) != 0) node_match = false; // respond to commands from the driver @@ -246,21 +246,20 @@ void MDIEngine::engine_node(const char *node) // read the next command from the driver // all procs call this, but only proc 0 receives the command - ierr = MDI_Recv_command(mdicmd,mdicomm); - if (ierr) error->all(FLERR,"MDI: Unable to receive command from driver"); + ierr = MDI_Recv_command(mdicmd, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to receive command from driver"); // broadcast command to the other MPI tasks - MPI_Bcast(mdicmd,MDI_COMMAND_LENGTH,MPI_CHAR,0,world); + MPI_Bcast(mdicmd, MDI_COMMAND_LENGTH, MPI_CHAR, 0, world); // execute the command - execute_command(mdicmd,mdicomm); + execute_command(mdicmd, mdicomm); // check if driver request is now different than engine node - if (strcmp(node_driver,"\0") != 0 && strcmp(node_driver,node_engine) != 0) - node_match = false; + if (strcmp(node_driver, "\0") != 0 && strcmp(node_driver, node_engine) != 0) node_match = false; } // node exit was triggered so reset node_match @@ -284,181 +283,178 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) int command_exists; if (root) { - ierr = MDI_Check_command_exists(node_engine,command,MDI_COMM_NULL, - &command_exists); - if (ierr) - error->one(FLERR, - "MDI: Unable to check whether current command is supported"); + ierr = MDI_Check_command_exists(node_engine, command, MDI_COMM_NULL, &command_exists); + if (ierr) error->one(FLERR, "MDI: Unable to check whether current command is supported"); } - MPI_Bcast(&command_exists,1,MPI_INT,0,world); + MPI_Bcast(&command_exists, 1, MPI_INT, 0, world); if (!command_exists) - error->all(FLERR,"MDI: Received command {} unsupported by engine node {}", - command,node_engine); + error->all(FLERR, "MDI: Received command {} unsupported by engine node {}", command, + node_engine); // --------------------------------------- // respond to MDI standard commands // receives first, sends second, node commands third // --------------------------------------- - if (strcmp(command,">CELL") == 0) { + if (strcmp(command, ">CELL") == 0) { receive_cell(); - } else if (strcmp(command,">CELL_DISPL") == 0) { + } else if (strcmp(command, ">CELL_DISPL") == 0) { receive_cell_displ(); - } else if (strcmp(command,">CHARGES") == 0) { + } else if (strcmp(command, ">CHARGES") == 0) { receive_charges(); - } else if (strcmp(command,">COORDS") == 0) { + } else if (strcmp(command, ">COORDS") == 0) { receive_coords(); - } else if (strcmp(command,">FORCES") == 0) { + } else if (strcmp(command, ">FORCES") == 0) { receive_double3(FORCE); - } else if (strcmp(command,">+FORCES") == 0) { + } else if (strcmp(command, ">+FORCES") == 0) { receive_double3(ADDFORCE); - } else if (strcmp(command,">NATOMS") == 0) { + } else if (strcmp(command, ">NATOMS") == 0) { receive_natoms(); - } else if (strcmp(command,">NSTEPS") == 0) { + } else if (strcmp(command, ">NSTEPS") == 0) { receive_nsteps(); - } else if (strcmp(command,">TOLERANCE") == 0) { + } else if (strcmp(command, ">TOLERANCE") == 0) { receive_tolerance(); - } else if (strcmp(command,">TYPES") == 0) { + } else if (strcmp(command, ">TYPES") == 0) { receive_types(); - } else if (strcmp(command,">VELOCITIES") == 0) { - if (strcmp(node_engine,"@DEFAULT") == 0) receive_velocities(); - else receive_double3(VELOCITY); + } else if (strcmp(command, ">VELOCITIES") == 0) { + if (strcmp(node_engine, "@DEFAULT") == 0) + receive_velocities(); + else + receive_double3(VELOCITY); - // ----------------------------------------------- + // ----------------------------------------------- - } else if (strcmp(command,"<@") == 0) { - ierr = MDI_Send(node_engine,MDI_NAME_LENGTH,MDI_CHAR,mdicomm); - if (ierr) error->all(FLERR,"MDI: <@ data"); + } else if (strcmp(command, "<@") == 0) { + ierr = MDI_Send(node_engine, MDI_NAME_LENGTH, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: <@ data"); - } else if (strcmp(command,"all(FLERR,"MDI: MDI engine is already performing a simulation"); + } else if (strcmp(command, "@INIT_MD") == 0) { + if (mode != DEFAULT) error->all(FLERR, "MDI: MDI engine is already performing a simulation"); mode = MD; - strncpy(node_driver,command,MDI_COMMAND_LENGTH); + strncpy(node_driver, command, MDI_COMMAND_LENGTH); node_match = false; - } else if (strcmp(command,"@INIT_OPTG") == 0) { - if (mode != DEFAULT) - error->all(FLERR,"MDI: MDI engine is already performing a simulation"); + } else if (strcmp(command, "@INIT_OPTG") == 0) { + if (mode != DEFAULT) error->all(FLERR, "MDI: MDI engine is already performing a simulation"); mode = OPT; - strncpy(node_driver,command,MDI_COMMAND_LENGTH); + strncpy(node_driver, command, MDI_COMMAND_LENGTH); node_match = false; - } else if (strcmp(command,"@") == 0) { - strncpy(node_driver,"\0",MDI_COMMAND_LENGTH); + } else if (strcmp(command, "@") == 0) { + strncpy(node_driver, "\0", MDI_COMMAND_LENGTH); node_match = false; - } else if (strcmp(command,"@DEFAULT") == 0) { + } else if (strcmp(command, "@DEFAULT") == 0) { mode = DEFAULT; - strncpy(node_driver,command,MDI_COMMAND_LENGTH); + strncpy(node_driver, command, MDI_COMMAND_LENGTH); node_match = false; - } else if (strcmp(command,"@COORDS") == 0) { - strncpy(node_driver,command,MDI_COMMAND_LENGTH); + } else if (strcmp(command, "@COORDS") == 0) { + strncpy(node_driver, command, MDI_COMMAND_LENGTH); node_match = false; - } else if (strcmp(command,"@FORCES") == 0) { - strncpy(node_driver,command,MDI_COMMAND_LENGTH); + } else if (strcmp(command, "@FORCES") == 0) { + strncpy(node_driver, command, MDI_COMMAND_LENGTH); node_match = false; - } else if (strcmp(command,"@ENDSTEP") == 0) { - strncpy(node_driver,command,MDI_COMMAND_LENGTH); + } else if (strcmp(command, "@ENDSTEP") == 0) { + strncpy(node_driver, command, MDI_COMMAND_LENGTH); node_match = false; - // exit command + // exit command - } else if (strcmp(command,"EXIT") == 0) { + } else if (strcmp(command, "EXIT") == 0) { exit_command = true; - // ------------------------------------------------------- - // custom LAMMPS commands - // ------------------------------------------------------- + // ------------------------------------------------------- + // custom LAMMPS commands + // ------------------------------------------------------- - } else if (strcmp(command,"NBYTES") == 0) { + } else if (strcmp(command, "NBYTES") == 0) { nbytes_command(); - } else if (strcmp(command,"COMMAND") == 0) { + } else if (strcmp(command, "COMMAND") == 0) { single_command(); - } else if (strcmp(command,"COMMANDS") == 0) { + } else if (strcmp(command, "COMMANDS") == 0) { many_commands(); - } else if (strcmp(command,"INFILE") == 0) { + } else if (strcmp(command, "INFILE") == 0) { infile(); - } else if (strcmp(command,"all(FLERR,"MDI: Unknown command {} received from driver",command); + error->all(FLERR, "MDI: Unknown command {} received from driver", command); } return 0; @@ -475,79 +471,79 @@ void MDIEngine::mdi_commands() // default node, MDI standard commands MDI_Register_node("@DEFAULT"); - MDI_Register_command("@DEFAULT","<@"); - MDI_Register_command("@DEFAULT","CELL"); - MDI_Register_command("@DEFAULT",">CELL_DISPL"); - MDI_Register_command("@DEFAULT",">CHARGES"); - MDI_Register_command("@DEFAULT",">COORDS"); - MDI_Register_command("@DEFAULT",">NATOMS"); - MDI_Register_command("@DEFAULT",">NSTEPS"); - MDI_Register_command("@DEFAULT",">TOLERANCE"); - MDI_Register_command("@DEFAULT",">TYPES"); - MDI_Register_command("@DEFAULT",">VELOCITIES"); - MDI_Register_command("@DEFAULT","MD"); - MDI_Register_command("@DEFAULT","OPTG"); - MDI_Register_command("@DEFAULT","@INIT_MD"); - MDI_Register_command("@DEFAULT","@INIT_OPTG"); - MDI_Register_command("@DEFAULT","EXIT"); + MDI_Register_command("@DEFAULT", "<@"); + MDI_Register_command("@DEFAULT", "CELL"); + MDI_Register_command("@DEFAULT", ">CELL_DISPL"); + MDI_Register_command("@DEFAULT", ">CHARGES"); + MDI_Register_command("@DEFAULT", ">COORDS"); + MDI_Register_command("@DEFAULT", ">NATOMS"); + MDI_Register_command("@DEFAULT", ">NSTEPS"); + MDI_Register_command("@DEFAULT", ">TOLERANCE"); + MDI_Register_command("@DEFAULT", ">TYPES"); + MDI_Register_command("@DEFAULT", ">VELOCITIES"); + MDI_Register_command("@DEFAULT", "MD"); + MDI_Register_command("@DEFAULT", "OPTG"); + MDI_Register_command("@DEFAULT", "@INIT_MD"); + MDI_Register_command("@DEFAULT", "@INIT_OPTG"); + MDI_Register_command("@DEFAULT", "EXIT"); // default node, custom commands added by LAMMPS - MDI_Register_command("@DEFAULT","NBYTES"); - MDI_Register_command("@DEFAULT","COMMAND"); - MDI_Register_command("@DEFAULT","COMMANDS"); - MDI_Register_command("@DEFAULT","INFILE"); - MDI_Register_command("@DEFAULT","COORDS"); - MDI_Register_command("@COORDS",">VELOCITIES"); - MDI_Register_command("@COORDS","@"); - MDI_Register_command("@COORDS","@DEFAULT"); - MDI_Register_command("@COORDS","@COORDS"); - MDI_Register_command("@COORDS","@FORCES"); - MDI_Register_command("@COORDS","@ENDSTEP"); - MDI_Register_command("@COORDS","EXIT"); + MDI_Register_command("@COORDS", "<@"); + MDI_Register_command("@COORDS", "COORDS"); + MDI_Register_command("@COORDS", ">VELOCITIES"); + MDI_Register_command("@COORDS", "@"); + MDI_Register_command("@COORDS", "@DEFAULT"); + MDI_Register_command("@COORDS", "@COORDS"); + MDI_Register_command("@COORDS", "@FORCES"); + MDI_Register_command("@COORDS", "@ENDSTEP"); + MDI_Register_command("@COORDS", "EXIT"); // node at POST_FORCE location in timestep // only used if fix MDI/ENGINE is instantiated @@ -555,42 +551,42 @@ void MDIEngine::mdi_commands() // with drivers which don't know LAMMPS control flow MDI_Register_node("@FORCES"); - MDI_Register_callback("@FORCES",">FORCES"); - MDI_Register_callback("@FORCES",">+FORCES"); - MDI_Register_command("@FORCES","<@"); - MDI_Register_command("@FORCES","FORCES"); - MDI_Register_command("@FORCES",">+FORCES"); - MDI_Register_command("@FORCES",">VELOCITIES"); - MDI_Register_command("@FORCES","@"); - MDI_Register_command("@FORCES","@DEFAULT"); - MDI_Register_command("@FORCES","@COORDS"); - MDI_Register_command("@FORCES","@FORCES"); - MDI_Register_command("@FORCES","@ENDSTEP"); - MDI_Register_command("@FORCES","EXIT"); + MDI_Register_callback("@FORCES", ">FORCES"); + MDI_Register_callback("@FORCES", ">+FORCES"); + MDI_Register_command("@FORCES", "<@"); + MDI_Register_command("@FORCES", "FORCES"); + MDI_Register_command("@FORCES", ">+FORCES"); + MDI_Register_command("@FORCES", ">VELOCITIES"); + MDI_Register_command("@FORCES", "@"); + MDI_Register_command("@FORCES", "@DEFAULT"); + MDI_Register_command("@FORCES", "@COORDS"); + MDI_Register_command("@FORCES", "@FORCES"); + MDI_Register_command("@FORCES", "@ENDSTEP"); + MDI_Register_command("@FORCES", "EXIT"); // node at END_OF_STEP location in timestep // only used if fix MDI/ENGINE is instantiated MDI_Register_node("@ENDSTEP"); - MDI_Register_command("@ENDSTEP","<@"); - MDI_Register_command("@ENDSTEP","add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); - FixMDIEngine *mdi_fix = - (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); + FixMDIEngine *mdi_fix = (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); mdi_fix->mdi_engine = this; // initialize LAMMPS and setup() the simulation @@ -633,7 +629,7 @@ void MDIEngine::mdi_md() // any @ command from driver will start the simulation engine_node("@INIT_MD"); - if (strcmp(mdicmd,"EXIT") == 0) return; + if (strcmp(mdicmd, "EXIT") == 0) return; // run one step at a time forever // driver triggers exit with @ command other than @COORDS,@FORCES,@ENDSTEP @@ -651,9 +647,9 @@ void MDIEngine::mdi_md() update->integrate->run(1); - if (strcmp(mdicmd,"@COORDS") != 0 && - strcmp(mdicmd,"@FORCES") != 0 && - strcmp(mdicmd,"@ENDSTEP") != 0) break; + if (strcmp(mdicmd, "@COORDS") != 0 && strcmp(mdicmd, "@FORCES") != 0 && + strcmp(mdicmd, "@ENDSTEP") != 0) + break; } timer->barrier_stop(); @@ -676,7 +672,8 @@ void MDIEngine::md() // create or update system if requested prior to MD command int flag_create = flag_natoms | flag_types; - if (flag_create) create_system(); + if (flag_create) + create_system(); else { if (flag_cell || flag_cell_displ) adjust_box(); if (flag_charges) adjust_charges(); @@ -723,7 +720,8 @@ void MDIEngine::mdi_optg() // create or update system if requested prior to @INIT_OPTG int flag_create = flag_natoms | flag_types; - if (flag_create) create_system(); + if (flag_create) + create_system(); else { if (flag_cell || flag_cell_displ) adjust_box(); if (flag_charges) adjust_charges(); @@ -735,8 +733,7 @@ void MDIEngine::mdi_optg() // delete the instance before this method returns modify->add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); - FixMDIEngine *mdi_fix = - (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); + FixMDIEngine *mdi_fix = (FixMDIEngine *) modify->get_fix_by_id("MDI_ENGINE_INTERNAL"); mdi_fix->mdi_engine = this; // initialize LAMMPS and setup() the simulation @@ -758,7 +755,7 @@ void MDIEngine::mdi_optg() // any @ command from driver will start the minimization engine_node("@INIT_OPTG"); - if (strcmp(mdicmd,"EXIT") == 0) return; + if (strcmp(mdicmd, "EXIT") == 0) return; // run one iteration at a time forever // driver triggers exit with @ command other than @COORDS,@FORCES @@ -776,8 +773,7 @@ void MDIEngine::mdi_optg() while (1) { update->minimize->run(1); - if (strcmp(mdicmd,"@COORDS") != 0 && - strcmp(mdicmd,"@FORCES") != 0) break; + if (strcmp(mdicmd, "@COORDS") != 0 && strcmp(mdicmd, "@FORCES") != 0) break; } timer->barrier_stop(); @@ -800,7 +796,8 @@ void MDIEngine::optg() // create or update system if requested prior to OPTG command int flag_create = flag_natoms | flag_types; - if (flag_create) create_system(); + if (flag_create) + create_system(); else { if (flag_cell || flag_cell_displ) adjust_box(); if (flag_charges) adjust_charges(); @@ -851,12 +848,12 @@ void MDIEngine::optg() void MDIEngine::evaluate() { int flag_create = flag_natoms | flag_types; - int flag_other = flag_cell | flag_cell_displ | flag_charges | - flag_coords | flag_velocities; + int flag_other = flag_cell | flag_cell_displ | flag_charges | flag_coords | flag_velocities; // create or update system if requested - if (flag_create) create_system(); + if (flag_create) + create_system(); else if (flag_other) { if (flag_cell || flag_cell_displ) adjust_box(); if (flag_charges) adjust_charges(); @@ -914,7 +911,7 @@ void MDIEngine::evaluate() output->thermo->compute(1); } - modify->addstep_compute(update->ntimestep+1); + modify->addstep_compute(update->ntimestep + 1); } // clear flags that trigger next eval @@ -933,8 +930,7 @@ void MDIEngine::create_system() { // check requirements - if (flag_cell == 0 || flag_natoms == 0 || - flag_types == 0 || flag_coords == 0) + if (flag_cell == 0 || flag_natoms == 0 || flag_types == 0 || flag_coords == 0) error->all(FLERR, "MDI create_system requires >CELL, >NATOMS, >TYPES, >COORDS " "MDI commands"); @@ -945,8 +941,8 @@ void MDIEngine::create_system() // invoke lib->reset_box() - double boxlo[3],boxhi[3]; - double xy,yz,xz; + double boxlo[3], boxhi[3]; + double xy, yz, xz; if (flag_cell_displ) { boxlo[0] = sys_cell_displ[0]; @@ -964,19 +960,18 @@ void MDIEngine::create_system() yz = sys_cell[7]; xz = sys_cell[6]; - lammps_reset_box(lmp,boxlo,boxhi,xy,yz,xz); + lammps_reset_box(lmp, boxlo, boxhi, xy, yz, xz); // invoke lib->create_atoms() // optionally set charges if specified by ">CHARGES" if (flag_velocities) - int natoms = lammps_create_atoms(lmp,sys_natoms,NULL,sys_types, - sys_coords,sys_velocities,NULL,1); + int natoms = + lammps_create_atoms(lmp, sys_natoms, NULL, sys_types, sys_coords, sys_velocities, NULL, 1); else - int natoms = lammps_create_atoms(lmp,sys_natoms,NULL,sys_types, - sys_coords,NULL,NULL,1); + int natoms = lammps_create_atoms(lmp, sys_natoms, NULL, sys_types, sys_coords, NULL, NULL, 1); - if (flag_charges) lammps_scatter_atoms(lmp,(char *) "q",1,1,sys_charges); + if (flag_charges) lammps_scatter_atoms(lmp, (char *) "q", 1, 1, sys_charges); // new system @@ -1044,7 +1039,7 @@ void MDIEngine::adjust_charges() int ilocal; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; + ilocal = static_cast(tag[i]) - 1; q[i] = sys_charges[ilocal]; } } @@ -1062,10 +1057,10 @@ void MDIEngine::adjust_coords() int ilocal; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - x[i][0] = sys_coords[3*ilocal+0]; - x[i][1] = sys_coords[3*ilocal+1]; - x[i][2] = sys_coords[3*ilocal+2]; + ilocal = static_cast(tag[i]) - 1; + x[i][0] = sys_coords[3 * ilocal + 0]; + x[i][1] = sys_coords[3 * ilocal + 1]; + x[i][2] = sys_coords[3 * ilocal + 2]; } } @@ -1082,10 +1077,10 @@ void MDIEngine::adjust_velocities() int ilocal; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - v[i][0] = sys_velocities[3*ilocal+0]; - v[i][1] = sys_velocities[3*ilocal+1]; - v[i][2] = sys_velocities[3*ilocal+2]; + ilocal = static_cast(tag[i]) - 1; + v[i][0] = sys_velocities[3 * ilocal + 0]; + v[i][1] = sys_velocities[3 * ilocal + 1]; + v[i][2] = sys_velocities[3 * ilocal + 2]; } } @@ -1107,17 +1102,16 @@ void MDIEngine::receive_cell() { actionflag = 0; flag_cell = 1; - int ierr = MDI_Recv(sys_cell,9,MDI_DOUBLE,mdicomm); + int ierr = MDI_Recv(sys_cell, 9, MDI_DOUBLE, mdicomm); if (ierr) error->all(FLERR, "MDI: >CELL data"); - MPI_Bcast(sys_cell,9,MPI_DOUBLE,0,world); + MPI_Bcast(sys_cell, 9, MPI_DOUBLE, 0, world); - for (int icell = 0; icell < 9; icell++) - sys_cell[icell] *= mdi2lmp_length; + for (int icell = 0; icell < 9; icell++) sys_cell[icell] *= mdi2lmp_length; // error check that edge vectors match LAMMPS triclinic requirement if (sys_cell[1] != 0.0 || sys_cell[2] != 0.0 || sys_cell[5] != 0.0) - error->all(FLERR,"MDI: Received cell edges are not LAMMPS compatible"); + error->all(FLERR, "MDI: Received cell edges are not LAMMPS compatible"); } /* ---------------------------------------------------------------------- @@ -1132,12 +1126,11 @@ void MDIEngine::receive_cell_displ() { actionflag = 0; flag_cell_displ = 1; - int ierr = MDI_Recv(sys_cell_displ,3,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: >CELL_DISPLS data"); - MPI_Bcast(sys_cell_displ,3,MPI_DOUBLE,0,world); + int ierr = MDI_Recv(sys_cell_displ, 3, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL_DISPLS data"); + MPI_Bcast(sys_cell_displ, 3, MPI_DOUBLE, 0, world); - for (int icell = 0; icell < 3; icell++) - sys_cell_displ[icell] *= mdi2lmp_length; + for (int icell = 0; icell < 3; icell++) sys_cell_displ[icell] *= mdi2lmp_length; } /* ---------------------------------------------------------------------- @@ -1148,9 +1141,9 @@ void MDIEngine::receive_charges() { actionflag = 0; flag_charges = 1; - int ierr = MDI_Recv(sys_charges,sys_natoms,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: >CHARGES data"); - MPI_Bcast(sys_charges,sys_natoms,MPI_DOUBLE,0,world); + int ierr = MDI_Recv(sys_charges, sys_natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >CHARGES data"); + MPI_Bcast(sys_charges, sys_natoms, MPI_DOUBLE, 0, world); } /* ---------------------------------------------------------------------- @@ -1161,12 +1154,11 @@ void MDIEngine::receive_coords() { actionflag = 0; flag_coords = 1; - int n = 3*sys_natoms; - int ierr = MDI_Recv(sys_coords,n,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: >COORDS data"); - MPI_Bcast(sys_coords,n,MPI_DOUBLE,0,world); - for (int i = 0; i < n; i++) - sys_coords[i] * mdi2lmp_length; + int n = 3 * sys_natoms; + int ierr = MDI_Recv(sys_coords, n, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >COORDS data"); + MPI_Bcast(sys_coords, n, MPI_DOUBLE, 0, world); + for (int i = 0; i < n; i++) sys_coords[i] * mdi2lmp_length; } /* ---------------------------------------------------------------------- @@ -1178,10 +1170,10 @@ void MDIEngine::receive_natoms() { actionflag = 0; flag_natoms = 1; - int ierr = MDI_Recv(&sys_natoms,1,MDI_INT,mdicomm); - if (ierr) error->all(FLERR,"MDI: >NATOMS data"); - MPI_Bcast(&sys_natoms,1,MPI_INT,0,world); - if (sys_natoms < 0) error->all(FLERR,"MDI received natoms < 0"); + int ierr = MDI_Recv(&sys_natoms, 1, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI: >NATOMS data"); + MPI_Bcast(&sys_natoms, 1, MPI_INT, 0, world); + if (sys_natoms < 0) error->all(FLERR, "MDI received natoms < 0"); reallocate(); } @@ -1192,10 +1184,10 @@ void MDIEngine::receive_natoms() void MDIEngine::receive_nsteps() { - int ierr = MDI_Recv(&nsteps,1,MDI_INT,mdicomm); - if (ierr) error->all(FLERR,"MDI: >NSTEPS data"); - MPI_Bcast(&nsteps,1,MPI_INT,0,world); - if (nsteps < 0) error->all(FLERR,"MDI received nsteps < 0"); + int ierr = MDI_Recv(&nsteps, 1, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI: >NSTEPS data"); + MPI_Bcast(&nsteps, 1, MPI_INT, 0, world); + if (nsteps < 0) error->all(FLERR, "MDI received nsteps < 0"); } /* ---------------------------------------------------------------------- @@ -1206,17 +1198,17 @@ void MDIEngine::receive_nsteps() void MDIEngine::receive_tolerance() { double params[4]; - int ierr = MDI_Recv(params,4,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: >TOLERANCE data"); - MPI_Bcast(params,4,MPI_INT,0,world); + int ierr = MDI_Recv(params, 4, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >TOLERANCE data"); + MPI_Bcast(params, 4, MPI_INT, 0, world); etol = params[0]; ftol = params[1]; - niterate = static_cast (params[2]); - max_eval = static_cast (params[3]); + niterate = static_cast(params[2]); + max_eval = static_cast(params[3]); if (etol < 0.0 || ftol < 0.0 || niterate < 0 || max_eval < 0) - error->all(FLERR,"MDI received invalid toleranace parameters"); + error->all(FLERR, "MDI received invalid toleranace parameters"); } /* ---------------------------------------------------------------------- @@ -1227,9 +1219,9 @@ void MDIEngine::receive_types() { actionflag = 0; flag_types = 1; - int ierr = MDI_Recv(sys_types,sys_natoms,MDI_INT,mdicomm); - if (ierr) error->all(FLERR,"MDI: >TYPES data"); - MPI_Bcast(sys_types,sys_natoms,MPI_INT,0,world); + int ierr = MDI_Recv(sys_types, sys_natoms, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI: >TYPES data"); + MPI_Bcast(sys_types, sys_natoms, MPI_INT, 0, world); } /* ---------------------------------------------------------------------- @@ -1240,12 +1232,11 @@ void MDIEngine::receive_velocities() { actionflag = 0; flag_velocities = 1; - int n = 3*sys_natoms; - int ierr = MDI_Recv(sys_velocities,n,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: >VELOCITIES data"); - MPI_Bcast(sys_velocities,n,MPI_DOUBLE,0,world); - for (int i = 0; i < n; i++) - sys_coords[i] * mdi2lmp_velocity; + int n = 3 * sys_natoms; + int ierr = MDI_Recv(sys_velocities, n, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >VELOCITIES data"); + MPI_Bcast(sys_velocities, n, MPI_DOUBLE, 0, world); + for (int i = 0; i < n; i++) sys_coords[i] * mdi2lmp_velocity; } /* ---------------------------------------------------------------------- @@ -1256,10 +1247,10 @@ void MDIEngine::receive_velocities() void MDIEngine::receive_double3(int which) { - int n = 3*atom->natoms; - int ierr = MDI_Recv(buf3,n,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: natoms; + int ierr = MDI_Recv(buf3, n, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: f; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - f[i][0] = buf3[3*ilocal+0] * mdi2lmp_force; - f[i][1] = buf3[3*ilocal+1] * mdi2lmp_force; - f[i][2] = buf3[3*ilocal+2] * mdi2lmp_force; + ilocal = static_cast(tag[i]) - 1; + f[i][0] = buf3[3 * ilocal + 0] * mdi2lmp_force; + f[i][1] = buf3[3 * ilocal + 1] * mdi2lmp_force; + f[i][2] = buf3[3 * ilocal + 2] * mdi2lmp_force; } } else if (which == ADDFORCE) { double **f = atom->f; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - f[i][0] += buf3[3*ilocal+0] * mdi2lmp_force; - f[i][1] += buf3[3*ilocal+1] * mdi2lmp_force; - f[i][2] += buf3[3*ilocal+2] * mdi2lmp_force; + ilocal = static_cast(tag[i]) - 1; + f[i][0] += buf3[3 * ilocal + 0] * mdi2lmp_force; + f[i][1] += buf3[3 * ilocal + 1] * mdi2lmp_force; + f[i][2] += buf3[3 * ilocal + 2] * mdi2lmp_force; } } else if (which == VELOCITY) { double **v = atom->v; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - v[i][0] = buf3[3*ilocal+0] * mdi2lmp_velocity; - v[i][1] = buf3[3*ilocal+1] * mdi2lmp_velocity; - v[i][2] = buf3[3*ilocal+2] * mdi2lmp_velocity; + ilocal = static_cast(tag[i]) - 1; + v[i][0] = buf3[3 * ilocal + 0] * mdi2lmp_velocity; + v[i][1] = buf3[3 * ilocal + 1] * mdi2lmp_velocity; + v[i][2] = buf3[3 * ilocal + 2] * mdi2lmp_velocity; } } } @@ -1320,11 +1311,10 @@ void MDIEngine::send_cell() celldata[7] = domain->yz; celldata[8] = domain->boxhi[2] - domain->boxlo[2]; - for (int icell = 0; icell < 9; icell++) - celldata[icell] *= lmp2mdi_length; + for (int icell = 0; icell < 9; icell++) celldata[icell] *= lmp2mdi_length; - int ierr = MDI_Send(celldata,9,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: all(FLERR, "MDI: boxlo[1]; celldata[2] = domain->boxlo[2]; - for (int icell = 0; icell < 3; icell++) - celldata[icell] *= lmp2mdi_length; + for (int icell = 0; icell < 3; icell++) celldata[icell] *= lmp2mdi_length; - int ierr = MDI_Send(celldata,3,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: all(FLERR, "MDI: all(FLERR,"MDI: all(FLERR, "MDI: natoms * MDI_LABEL_LENGTH]; - memset(labels,' ',atom->natoms * MDI_LABEL_LENGTH); + memset(labels, ' ', atom->natoms * MDI_LABEL_LENGTH); - memset(ibuf1,0,atom->natoms*sizeof(int)); + memset(ibuf1, 0, atom->natoms * sizeof(int)); // use atomID to index into ordered ibuf1 @@ -1385,11 +1374,11 @@ void MDIEngine::send_labels() int ilocal; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; + ilocal = static_cast(tag[i]) - 1; ibuf1[ilocal] = type[i]; } - MPI_Reduce(ibuf1,ibuf1all,atom->natoms,MPI_INT,MPI_SUM,0,world); + MPI_Reduce(ibuf1, ibuf1all, atom->natoms, MPI_INT, MPI_SUM, 0, world); if (comm->me == 0) { for (int iatom = 0; iatom < atom->natoms; iatom++) { @@ -1399,10 +1388,10 @@ void MDIEngine::send_labels() } } - int ierr = MDI_Send(labels,atom->natoms*MDI_LABEL_LENGTH,MDI_CHAR,mdicomm); - if (ierr) error->all(FLERR,"MDI: natoms * MDI_LABEL_LENGTH, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: (atom->natoms); - int ierr = MDI_Send(&natoms,1,MDI_INT,mdicomm); - if (ierr != 0) error->all(FLERR,"MDI: (atom->natoms); + int ierr = MDI_Send(&natoms, 1, MDI_INT, mdicomm); + if (ierr != 0) error->all(FLERR, "MDI: compute_scalar(); potential_energy *= lmp2mdi_energy; - int ierr = MDI_Send(&potential_energy,1,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: all(FLERR, "MDI: compute_vector(); - for (int i = 0; i < 6; i++) - vtensor[i] = press->vector[i] * lmp2mdi_pressure; + for (int i = 0; i < 6; i++) vtensor[i] = press->vector[i] * lmp2mdi_pressure; - int ierr = MDI_Send(vtensor,6,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: all(FLERR, "MDI: natoms*sizeof(double)); + memset(buf1, 0, atom->natoms * sizeof(double)); // use atomID to index into ordered buf1 @@ -1467,7 +1455,7 @@ void MDIEngine::send_double1(int which) if (which == CHARGE) { double *q = atom->q; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; + ilocal = static_cast(tag[i]) - 1; buf1[ilocal] = q[i]; } } else if (which == MASS) { @@ -1475,22 +1463,22 @@ void MDIEngine::send_double1(int which) double *rmass = atom->rmass; if (rmass) { for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; + ilocal = static_cast(tag[i]) - 1; buf1[ilocal] = rmass[i]; } } else { int *type = atom->type; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; + ilocal = static_cast(tag[i]) - 1; buf1[ilocal] = mass[type[i]]; } } } - MPI_Reduce(buf1,buf1all,atom->natoms,MPI_DOUBLE,MPI_SUM,0,world); + MPI_Reduce(buf1, buf1all, atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - int ierr = MDI_Send(buf1all,atom->natoms,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: natoms*sizeof(int)); + memset(ibuf1, 0, atom->natoms * sizeof(int)); // use atomID to index into ordered ibuf1 @@ -1513,15 +1501,15 @@ void MDIEngine::send_int1(int which) if (which == TYPE) { int *type = atom->type; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; + ilocal = static_cast(tag[i]) - 1; ibuf1[ilocal] = type[i]; } } - MPI_Reduce(ibuf1,ibuf1all,atom->natoms,MPI_INT,MPI_SUM,0,world); + MPI_Reduce(ibuf1, ibuf1all, atom->natoms, MPI_INT, MPI_SUM, 0, world); - int ierr = MDI_Send(ibuf1all,atom->natoms,MDI_INT,mdicomm); - if (ierr) error->all(FLERR,"MDI: natoms, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI: natoms*sizeof(double)); + memset(buf3, 0, 3 * atom->natoms * sizeof(double)); // use atomID to index into ordered buf3 @@ -1544,33 +1532,33 @@ void MDIEngine::send_double3(int which) if (which == COORD) { double **x = atom->x; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - buf3[3*ilocal+0] = x[i][0] * lmp2mdi_length; - buf3[3*ilocal+1] = x[i][1] * lmp2mdi_length; - buf3[3*ilocal+2] = x[i][2] * lmp2mdi_length; + ilocal = static_cast(tag[i]) - 1; + buf3[3 * ilocal + 0] = x[i][0] * lmp2mdi_length; + buf3[3 * ilocal + 1] = x[i][1] * lmp2mdi_length; + buf3[3 * ilocal + 2] = x[i][2] * lmp2mdi_length; } } else if (which == FORCE) { double **f = atom->f; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - buf3[3*ilocal+0] = f[i][0] * lmp2mdi_force; - buf3[3*ilocal+1] = f[i][1] * lmp2mdi_force; - buf3[3*ilocal+2] = f[i][2] * lmp2mdi_force; + ilocal = static_cast(tag[i]) - 1; + buf3[3 * ilocal + 0] = f[i][0] * lmp2mdi_force; + buf3[3 * ilocal + 1] = f[i][1] * lmp2mdi_force; + buf3[3 * ilocal + 2] = f[i][2] * lmp2mdi_force; } } else if (which == VELOCITY) { double **v = atom->v; for (int i = 0; i < nlocal; i++) { - ilocal = static_cast (tag[i]) - 1; - buf3[3*ilocal+0] = v[i][0] * lmp2mdi_velocity; - buf3[3*ilocal+1] = v[i][1] * lmp2mdi_velocity; - buf3[3*ilocal+2] = v[i][2] * lmp2mdi_velocity; + ilocal = static_cast(tag[i]) - 1; + buf3[3 * ilocal + 0] = v[i][0] * lmp2mdi_velocity; + buf3[3 * ilocal + 1] = v[i][1] * lmp2mdi_velocity; + buf3[3 * ilocal + 2] = v[i][2] * lmp2mdi_velocity; } } - MPI_Reduce(buf3,buf3all,3*atom->natoms,MPI_DOUBLE,MPI_SUM,0,world); + MPI_Reduce(buf3, buf3all, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - int ierr = MDI_Send(buf3all,3*atom->natoms,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: all(FLERR,"MDI: NBYTES data"); - MPI_Bcast(&nbytes,1,MPI_INT,0,world); + int ierr = MDI_Recv(&nbytes, 1, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI: NBYTES data"); + MPI_Bcast(&nbytes, 1, MPI_INT, 0, world); } /* ---------------------------------------------------------------------- @@ -1600,17 +1588,17 @@ void MDIEngine::nbytes_command() void MDIEngine::single_command() { - if (nbytes < 0) error->all(FLERR,"MDI: COMMAND nbytes has not been set"); + if (nbytes < 0) error->all(FLERR, "MDI: COMMAND nbytes has not been set"); - char *cmd = new char[nbytes+1]; - int ierr = MDI_Recv(cmd,nbytes+1,MDI_CHAR,mdicomm); - if (ierr) error->all(FLERR,"MDI: COMMAND data"); - MPI_Bcast(cmd,nbytes+1,MPI_CHAR,0,world); + char *cmd = new char[nbytes + 1]; + int ierr = MDI_Recv(cmd, nbytes + 1, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: COMMAND data"); + MPI_Bcast(cmd, nbytes + 1, MPI_CHAR, 0, world); cmd[nbytes] = '\0'; - lammps_command(lmp,cmd); + lammps_command(lmp, cmd); - delete [] cmd; + delete[] cmd; } /* ---------------------------------------------------------------------- @@ -1621,17 +1609,17 @@ void MDIEngine::single_command() void MDIEngine::many_commands() { - if (nbytes < 0) error->all(FLERR,"MDI: COMMANDS nbytes has not been set"); + if (nbytes < 0) error->all(FLERR, "MDI: COMMANDS nbytes has not been set"); - char *cmds = new char[nbytes+1]; - int ierr = MDI_Recv(cmds, nbytes+1, MDI_CHAR, mdicomm); - if (ierr) error->all(FLERR,"MDI: COMMANDS data"); - MPI_Bcast(cmds,nbytes+1,MPI_CHAR,0,world); + char *cmds = new char[nbytes + 1]; + int ierr = MDI_Recv(cmds, nbytes + 1, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: COMMANDS data"); + MPI_Bcast(cmds, nbytes + 1, MPI_CHAR, 0, world); cmds[nbytes] = '\0'; - lammps_commands_string(lmp,cmds); + lammps_commands_string(lmp, cmds); - delete [] cmds; + delete[] cmds; } /* ---------------------------------------------------------------------- @@ -1642,17 +1630,17 @@ void MDIEngine::many_commands() void MDIEngine::infile() { - if (nbytes < 0) error->all(FLERR,"MDI: INFILE nbytes has not been set"); + if (nbytes < 0) error->all(FLERR, "MDI: INFILE nbytes has not been set"); - char *infile = new char[nbytes+1]; - int ierr = MDI_Recv(infile,nbytes+1,MDI_CHAR,mdicomm); - if (ierr) error->all(FLERR,"MDI: INFILE data"); - MPI_Bcast(infile,nbytes+1,MPI_CHAR,0,world); + char *infile = new char[nbytes + 1]; + int ierr = MDI_Recv(infile, nbytes + 1, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: INFILE data"); + MPI_Bcast(infile, nbytes + 1, MPI_CHAR, 0, world); infile[nbytes] = '\0'; - lammps_file(lmp,infile); + lammps_file(lmp, infile); - delete [] infile; + delete[] infile; } /* ---------------------------------------------------------------------- @@ -1665,8 +1653,8 @@ void MDIEngine::send_ke() double kinetic_energy = ke->compute_scalar(); kinetic_energy *= lmp2mdi_energy; - int ierr = MDI_Send(&kinetic_energy,1,MDI_DOUBLE,mdicomm); - if (ierr) error->all(FLERR,"MDI: all(FLERR, "MDI: MAXSMALLINT) - error->all(FLERR,"Natoms too large to use with mdi engine"); + if (3 * sys_natoms > MAXSMALLINT) error->all(FLERR, "Natoms too large to use with mdi engine"); maxatom = sys_natoms; @@ -1710,18 +1697,18 @@ void MDIEngine::deallocate() void MDIEngine::allocate() { - memory->create(sys_types,maxatom,"mdi:sys_types"); - memory->create(sys_coords,3*maxatom,"mdi:sys_coords"); - memory->create(sys_velocities,3*maxatom,"mdi:sys_velocities"); - memory->create(sys_charges,maxatom,"mdi:sys_charges"); + memory->create(sys_types, maxatom, "mdi:sys_types"); + memory->create(sys_coords, 3 * maxatom, "mdi:sys_coords"); + memory->create(sys_velocities, 3 * maxatom, "mdi:sys_velocities"); + memory->create(sys_charges, maxatom, "mdi:sys_charges"); - memory->create(ibuf1,maxatom,"mdi:ibuf1"); - memory->create(buf1,maxatom,"mdi:buf1"); - memory->create(buf3,3*maxatom,"mdi:buf3"); + memory->create(ibuf1, maxatom, "mdi:ibuf1"); + memory->create(buf1, maxatom, "mdi:buf1"); + memory->create(buf3, 3 * maxatom, "mdi:buf3"); - memory->create(ibuf1all,maxatom,"mdi:ibuf1all"); - memory->create(buf1all,maxatom,"mdi:buf1all"); - memory->create(buf3all,3*maxatom,"mdi:buf3all"); + memory->create(ibuf1all, maxatom, "mdi:ibuf1all"); + memory->create(buf1all, maxatom, "mdi:buf1all"); + memory->create(buf3all, 3 * maxatom, "mdi:buf3all"); } /* ---------------------------------------------------------------------- @@ -1730,12 +1717,12 @@ void MDIEngine::allocate() void MDIEngine::unit_conversions() { - double angstrom_to_bohr,kelvin_to_hartree,ev_to_hartree,second_to_aut; + double angstrom_to_bohr, kelvin_to_hartree, ev_to_hartree, second_to_aut; - MDI_Conversion_factor("angstrom","bohr",&angstrom_to_bohr); - MDI_Conversion_factor("kelvin_energy","hartree",&kelvin_to_hartree); - MDI_Conversion_factor("electron_volt","hartree",&ev_to_hartree); - MDI_Conversion_Factor("second","atomic_unit_of_time",&second_to_aut); + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); + MDI_Conversion_Factor("second", "atomic_unit_of_time", &second_to_aut); // length units @@ -1780,11 +1767,11 @@ void MDIEngine::unit_conversions() if (lmpunits == REAL) { lmp2mdi_pressure = (kelvin_to_hartree / force->boltz) / - (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; } else if (lmpunits == METAL) { - lmp2mdi_pressure = ev_to_hartree / - (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + lmp2mdi_pressure = + ev_to_hartree / (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; } diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index 57a7942722..65207e50eb 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -14,8 +14,8 @@ #ifndef LMP_MDI_ENGINE_H #define LMP_MDI_ENGINE_H -#include "pointers.h" #include "mdi.h" +#include "pointers.h" namespace LAMMPS_NS { @@ -27,63 +27,63 @@ class MDIEngine : protected Pointers { void engine_node(const char *node); private: - int lmpunits; // REAL or METAL or NATIVE - int root; // 1 for proc 0, otherwise 0 + int lmpunits; // REAL or METAL or NATIVE + int root; // 1 for proc 0, otherwise 0 - MDI_Comm mdicomm; // MDI communicator + MDI_Comm mdicomm; // MDI communicator // state of MDI engine - int mode; // which mode engine is in (DEFAULT,MD,OPTG) - char *mdicmd; // current MDI command being processed - char *node_engine; // which node engine is at - char *node_driver; // which node driver has requested - bool node_match; // true if driver and engine node currently match - bool exit_command; // true if EXIT command received from driver + int mode; // which mode engine is in (DEFAULT,MD,OPTG) + char *mdicmd; // current MDI command being processed + char *node_engine; // which node engine is at + char *node_driver; // which node driver has requested + bool node_match; // true if driver and engine node currently match + bool exit_command; // true if EXIT command received from driver // unit conversion factors - double lmp2mdi_length,mdi2lmp_length; - double lmp2mdi_energy,mdi2lmp_energy; - double lmp2mdi_velocity,mdi2lmp_velocity; - double lmp2mdi_force,mdi2lmp_force; - double lmp2mdi_pressure,mdi2lmp_pressure; - double lmp2mdi_virial,mdi2lmp_virial; + double lmp2mdi_length, mdi2lmp_length; + double lmp2mdi_energy, mdi2lmp_energy; + double lmp2mdi_velocity, mdi2lmp_velocity; + double lmp2mdi_force, mdi2lmp_force; + double lmp2mdi_pressure, mdi2lmp_pressure; + double lmp2mdi_virial, mdi2lmp_virial; // flags for data received by engine // not acted on until a request to send #include "error.h" #include "fix_mdi_aimd.h" #include "input.h" #include "modify.h" +#include + #include using namespace LAMMPS_NS; @@ -39,7 +40,7 @@ using namespace LAMMPS_NS; MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) { - if (narg < 1) error->all(FLERR,"Illegal mdi plugin command"); + if (narg < 1) error->all(FLERR, "Illegal mdi plugin command"); char *plugin_name = arg[0]; @@ -50,44 +51,45 @@ MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) int iarg = 1; while (iarg < narg) { - if (strcmp(arg[iarg],"mdi") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal mdi plugin command"); - mdi_arg = arg[iarg+1]; + if (strcmp(arg[iarg], "mdi") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal mdi plugin command"); + mdi_arg = arg[iarg + 1]; iarg += 2; - } else if (strcmp(arg[iarg],"infile") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal mdi plugin command"); - infile_arg = arg[iarg+1]; + } else if (strcmp(arg[iarg], "infile") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal mdi plugin command"); + infile_arg = arg[iarg + 1]; iarg += 2; - } else if (strcmp(arg[iarg],"extra") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal mdi plugin command"); - extra_arg = arg[iarg+1]; + } else if (strcmp(arg[iarg], "extra") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal mdi plugin command"); + extra_arg = arg[iarg + 1]; iarg += 2; - } else if (strcmp(arg[iarg],"command") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal mdi plugin command"); - int n = strlen(arg[iarg+1]) + 1; + } else if (strcmp(arg[iarg], "command") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal mdi plugin command"); + int n = strlen(arg[iarg + 1]) + 1; lammps_command = new char[n]; - strcpy(lammps_command,arg[iarg+1]); + strcpy(lammps_command, arg[iarg + 1]); iarg += 2; - } else error->all(FLERR,"Illegal mdi plugin command"); + } else + error->all(FLERR, "Illegal mdi plugin command"); } // error checks if (!mdi_arg || !infile_arg || !lammps_command) - error->all(FLERR,"MDI plugin must specify mdi, infile, command keywords"); + error->all(FLERR, "MDI plugin must specify mdi, infile, command keywords"); // build full plugin_args string for args to plugin library int n = strlen(mdi_arg) + strlen(infile_arg) + strlen(extra_arg) + 16; char *plugin_args = new char[n]; plugin_args[0] = 0; - strcat(plugin_args,"-mdi \""); - strcat(plugin_args,mdi_arg); - strcat(plugin_args,"\" -in "); - strcat(plugin_args,infile_arg); + strcat(plugin_args, "-mdi \""); + strcat(plugin_args, mdi_arg); + strcat(plugin_args, "\" -in "); + strcat(plugin_args, infile_arg); if (extra_arg) { - strcat(plugin_args," "); - strcat(plugin_args,extra_arg); + strcat(plugin_args, " "); + strcat(plugin_args, extra_arg); } // find FixMDIAimd instance so can reset its mdicomm @@ -99,9 +101,9 @@ MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // path for lib was specified in -mdi command-line arg when LAMMPS started // this calls back to plugin_wrapper, which must issue MDI EXIT at end - MDI_Launch_plugin(plugin_name,plugin_args,&world,plugin_wrapper,(void *)this); + MDI_Launch_plugin(plugin_name, plugin_args, &world, plugin_wrapper, (void *) this); - delete [] plugin_args; + delete[] plugin_args; } /* ---------------------------------------------------------------------- @@ -110,8 +112,7 @@ MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) with the plugin ---------------------------------------------------------------------- */ -int MDIPlugin::plugin_wrapper(void *pmpicomm, MDI_Comm mdicomm, - void *vptr) +int MDIPlugin::plugin_wrapper(void *pmpicomm, MDI_Comm mdicomm, void *vptr) { MPI_Comm mpicomm = *(MPI_Comm *) pmpicomm; MDIPlugin *ptr = (MDIPlugin *) vptr; @@ -127,11 +128,11 @@ int MDIPlugin::plugin_wrapper(void *pmpicomm, MDI_Comm mdicomm, // that operation will issue MDI commands to the plugin engine lammps->input->one(lammps_command); - delete [] lammps_command; + delete[] lammps_command; // send MDI exit to plugin, which unloads the plugin - MDI_Send_command("EXIT",mdicomm); + MDI_Send_command("EXIT", mdicomm); return 0; } diff --git a/src/MDI/mdi_plugin.h b/src/MDI/mdi_plugin.h index fe97c319e5..c70a09975e 100644 --- a/src/MDI/mdi_plugin.h +++ b/src/MDI/mdi_plugin.h @@ -14,8 +14,8 @@ #ifndef LMP_MDI_PLUGIN_H #define LMP_MDI_PLUGIN_H -#include "pointers.h" #include "mdi.h" +#include "pointers.h" namespace LAMMPS_NS { @@ -30,7 +30,7 @@ class MDIPlugin : protected Pointers { static int plugin_wrapper(void *, MDI_Comm, void *); }; -} +} // namespace LAMMPS_NS #endif From 2c509d96a6c82c305c4ce0ca3bc1070225a988d5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 16:43:41 -0400 Subject: [PATCH 123/130] we are not compatible with those old versions for the MDI library --- lib/mdi/Install.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/mdi/Install.py b/lib/mdi/Install.py index 2921bdf9b8..7f8cc91cd0 100644 --- a/lib/mdi/Install.py +++ b/lib/mdi/Install.py @@ -39,8 +39,6 @@ url = "https://github.com/MolSSI-MDI/MDI_Library/archive/v%s.tar.gz" % version # known checksums for different MDI versions. used to validate the download. checksums = { \ - '1.2.7' : '2f3177b30ccdbd6ae28ea3bdd5fed0db', \ - '1.2.9' : 'ddfa46d6ee15b4e59cfd527ec7212184', \ '1.3.0' : '8a8da217148bd9b700083b67d795af5e', \ } From ef7c6a580e5f8101b97c733d3fb8f61a9dfd5689 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 16:51:52 -0400 Subject: [PATCH 124/130] simplify --- examples/kim/plugin/CMakeLists.txt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/examples/kim/plugin/CMakeLists.txt b/examples/kim/plugin/CMakeLists.txt index 1d955aa8a1..d7f55b6b40 100644 --- a/examples/kim/plugin/CMakeLists.txt +++ b/examples/kim/plugin/CMakeLists.txt @@ -59,18 +59,9 @@ target_link_libraries(kimplugin PRIVATE lammps) target_include_directories(kimplugin PRIVATE ${LAMMPS_SOURCE_DIR}/KIM) set_target_properties(kimplugin PROPERTIES PREFIX "" SUFFIX ".so") -set(KIM-API_MIN_VERSION 2.1.3) find_package(PkgConfig REQUIRED) -if(KIM-API_FOUND AND KIM-API_VERSION VERSION_GREATER_EQUAL 2.2.0) - # For kim-api >= 2.2.0 - find_package(KIM-API 2.2.0 CONFIG REQUIRED) - target_link_libraries(kimplugin PRIVATE KIM-API::kim-api) -else() - # For kim-api 2.1.3 (consistent with previous version of this file) - find_package(PkgConfig REQUIRED) - pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=${KIM-API_MIN_VERSION}) - target_link_libraries(kimplugin PRIVATE PkgConfig::KIM-API) -endif() +find_package(KIM-API 2.2.0 CONFIG REQUIRED) +target_link_libraries(kimplugin PRIVATE KIM-API::kim-api) ########################## # need libcurl From 530d8c007dd9b55b3fe9d404f299d0a22fcabef9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 18:09:10 -0400 Subject: [PATCH 125/130] minor tweak --- examples/kim/plugin/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/kim/plugin/CMakeLists.txt b/examples/kim/plugin/CMakeLists.txt index d7f55b6b40..f4cb5f598d 100644 --- a/examples/kim/plugin/CMakeLists.txt +++ b/examples/kim/plugin/CMakeLists.txt @@ -59,7 +59,6 @@ target_link_libraries(kimplugin PRIVATE lammps) target_include_directories(kimplugin PRIVATE ${LAMMPS_SOURCE_DIR}/KIM) set_target_properties(kimplugin PROPERTIES PREFIX "" SUFFIX ".so") -find_package(PkgConfig REQUIRED) find_package(KIM-API 2.2.0 CONFIG REQUIRED) target_link_libraries(kimplugin PRIVATE KIM-API::kim-api) From 6849356d63b16c182a4796fb80142dbd5d8751f1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 18:34:45 -0400 Subject: [PATCH 126/130] fix spelling, formatting, and cross-link/indexing issues --- doc/src/Commands_all.rst | 2 +- doc/src/Howto_client_server.rst | 5 ----- doc/src/Howto_mdi.rst | 11 +++------- doc/src/Packages_details.rst | 2 +- doc/src/commands_list.rst | 2 +- doc/src/fix_mdi_aimd.rst | 8 +++---- doc/src/mdi.rst | 23 +++++++++++---------- doc/utils/sphinx-config/false_positives.txt | 5 +++++ 8 files changed, 27 insertions(+), 31 deletions(-) diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index fd68c51399..307b6c6f30 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -67,7 +67,7 @@ An alphabetic list of all general LAMMPS commands. * :doc:`lattice ` * :doc:`log ` * :doc:`mass ` - * :doc:`mdi ` + * :doc:`mdi ` * :doc:`message ` * :doc:`minimize ` * :doc:`min_modify ` diff --git a/doc/src/Howto_client_server.rst b/doc/src/Howto_client_server.rst index 58e6224b2a..7e21b78dfd 100644 --- a/doc/src/Howto_client_server.rst +++ b/doc/src/Howto_client_server.rst @@ -1,11 +1,6 @@ Using LAMMPS in client/server mode ================================== -.. note:: - - As of March 2022, this Howto page will soon be deprecated in favor - of the :doc:`Howto mdi ` doc page. - Client/server coupling of two codes is where one code is the "client" and sends request messages to a "server" code. The server responds to each request with a reply message. This enables the two codes to work diff --git a/doc/src/Howto_mdi.rst b/doc/src/Howto_mdi.rst index 0c505bb184..f5aab0be22 100644 --- a/doc/src/Howto_mdi.rst +++ b/doc/src/Howto_mdi.rst @@ -1,11 +1,6 @@ Using LAMMPS with the MDI library for code coupling =================================================== -.. note:: - - As of April 2022, this Howto page will soon replace the :doc:`Howto - client/server ` doc page. - Client/server coupling of two (or more) codes is where one code is the "client" and sends request messages (data) to one (or more) "server" code(s). A server responds to each request with a reply message @@ -69,7 +64,7 @@ enables LAMMPS to operate as an MDI driver and load an MDI engine as a plugin library. The package also has a `fix mdi/aimd ` command in which -LAMMPS operates as an MDI driver to peform *ab initio* MD simulations +LAMMPS operates as an MDI driver to perform *ab initio* MD simulations in conjunction with a quantum mechanics code. Its post_force() method illustrates how a driver issues MDI commands to another code. This command can be used to couple to an MDI engine which is either a @@ -81,7 +76,7 @@ The examples/mdi directory contains Python scripts and LAMMPS input script which use LAMMPS as either an MDI driver or engine or both. Three example use cases are provided: -* Run ab intitio MD (AIMD) using 2 instances of LAMMPS, one as driver +* Run ab initio MD (AIMD) using 2 instances of LAMMPS, one as driver and one as an engine. As an engine, LAMMPS is a surrogate for a quantum code. @@ -115,7 +110,7 @@ itself. The list of QCEngine-supported and i-PI-supported quantum codes is on the `MDI webpage `_. -Here is how to build QE as a stand-alond ``pw.x`` file which can be +Here is how to build QE as a stand-alone ``pw.x`` file which can be used in stand-alone mode: .. code-block:: bash diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 606bc04afa..57a77891e1 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -1412,7 +1412,7 @@ This package has :ref:`specific installation instructions ` on the :doc * src/MDI/README * lib/mdi/README * :doc:`Howto MDI ` -* :doc:`mdi/engine ` +* :doc:`mdi ` * :doc:`fix mdi/aimd ` * examples/PACKAGES/mdi diff --git a/doc/src/commands_list.rst b/doc/src/commands_list.rst index 75affe7ce6..1745fbd220 100644 --- a/doc/src/commands_list.rst +++ b/doc/src/commands_list.rst @@ -59,7 +59,7 @@ Commands lattice log mass - mdi_engine + mdi message min_modify min_spin diff --git a/doc/src/fix_mdi_aimd.rst b/doc/src/fix_mdi_aimd.rst index a9d33b8959..64bc4a3d6a 100644 --- a/doc/src/fix_mdi_aimd.rst +++ b/doc/src/fix_mdi_aimd.rst @@ -31,14 +31,14 @@ simulations. More specifically, this command causes LAMMPS to begin using the `MDI Library `_ -to run as an MDI driver (client), whicn sends MDI commands to an +to run as an MDI driver (client), which sends MDI commands to an external MDI engine code (server) which in the case of AIMD is a -quantum mechanics (QM) code, or could be LAMMPS itself, actings as a +quantum mechanics (QM) code, or could be LAMMPS itself, acting as a surrogate for a QM code. See the :doc:`Howto mdi ` page for more information about how LAMMPS can operate as either an MDI driver or engine. -The examples/mdi directory contains input scripts perfoming AIMD in +The examples/mdi directory contains input scripts performing AIMD in this manner with LAMMPS acting as both a driver and an engine (surrogate for a QM code). The examples/mdi/README file explains how to launch both driver and engine codes so that they communicate using @@ -70,7 +70,7 @@ input scripts. LAMMPS then begins its timestepping. At the point in each timestep when LAMMPS needs the force on each atom, it communicates with the engine code. It sends the current -simulation box size and shape (if they change dynamicaly, e.g. during +simulation box size and shape (if they change dynamically, e.g. during an NPT simulation), and the current atom coordinates. The engine code computes quantum forces on each atom and returns them to LAMMPS. If LAMMPS also needs the system energy and/or virial, it requests those diff --git a/doc/src/mdi.rst b/doc/src/mdi.rst index 95b41a2219..3a6f0234fc 100644 --- a/doc/src/mdi.rst +++ b/doc/src/mdi.rst @@ -14,14 +14,15 @@ Syntax .. parsed-literal:: - *engine* args = none - *plugin* args = name keyword value keyword value ... - name = name of plugin library, e.g. lammps means a liblammps.so library will be loaded - keywords = *mdi* or *infile* or *extra* or *command* - *mdi* value = args passed to MDI for driver to operate with plugins - *infile* value = filename the engine will read at start-up - *extra* value = aditional command-line args to pass to engine library when loaded - *command value = a LAMMPS input script command to execute + *engine* args = none + *plugin* args = name keyword value keyword value + name = name of plugin library, e.g. lammps means a liblammps.so library will be loaded + keywords = *mdi* or *infile* or *extra* or *command* + *mdi* value = args passed to MDI for driver to operate with plugins + *infile* value = filename the engine will read at start-up + *extra* value = aditional command-line args to pass to engine library when loaded + *command* value = a LAMMPS input script command to execute + Examples """""""" @@ -110,9 +111,9 @@ commands, which are described further below. * - NSTEPS value) + - Perform an MD simulation for N timesteps (most recent >NSTEPS value) * - OPTG - Perform an energy minimization to convergence (most recent >TOLERANCE values) + - Perform an energy minimization to convergence (most recent >TOLERANCE values) * - >NATOMS or NSTEPS @@ -157,7 +158,7 @@ more info below. The MD command performs a simulation using the most recent >NSTEPS value. The OPTG command performs a minimization using the 4 -convergence paremeters from the most recent >TOLERANCE command. The 4 +convergence parameters from the most recent >TOLERANCE command. The 4 parameters sent are those used by the :doc:`minimize ` command in LAMMPS: etol, ftol, maxiter, and maxeval. diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 6799e62d24..347159b33e 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1414,6 +1414,7 @@ initializations InitiatorIDs initio InP +inq inregion instantiation Institut @@ -1735,6 +1736,7 @@ libdl libfftw libgcc libgpu +libinqmdi libjpeg libkim liblammps @@ -1749,6 +1751,7 @@ libplumed libplumedKernel libpng libpoems +libqemdi libqmmm librar libreax @@ -2202,6 +2205,7 @@ Nbondtypes nBOt nbrhood Nbtypes +Nbytes nc Nc nchunk @@ -3644,6 +3648,7 @@ Wittmaack wn Wolde workflow +workflows Worley Wriggers Wuppertal From 375062d02ce6e4183a21ddf1da47c77ff97af1c2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 21:18:28 -0400 Subject: [PATCH 127/130] restore modern API usage --- src/MDI/mdi_engine.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index e6fff575eb..87ed04037d 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -105,16 +105,9 @@ MDIEngine::MDIEngine(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) id_press = utils::strdup(std::string("MDI_ENGINE") + "_press"); modify->add_compute(fmt::format("{} all pressure NULL virial", id_press)); - int icompute_ke = modify->find_compute(id_ke); - int icompute_pe = modify->find_compute(id_pe); - int icompute_press = modify->find_compute(id_press); - - ke = modify->compute[icompute_ke]; - pe = modify->compute[icompute_pe]; - press = modify->compute[icompute_press]; - - //pe = modify->get_compute_by_id("thermo_pe"); - //press = modify->get_compute_by_id("thermo_press"); + ke = modify->get_compute_by_id(id_ke); + pe = modify->get_compute_by_id(id_pe); + press = modify->get_compute_by_id(id_press); // irregular class used if >COORDS change dramatically From f3685fa8de588cdcd9a249e9f32d0bedc7d74053 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 21:18:55 -0400 Subject: [PATCH 128/130] fix bugs --- src/MDI/mdi_engine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 87ed04037d..91933d079e 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -202,6 +202,7 @@ MDIEngine::MDIEngine(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) delete[] node_engine; delete[] node_driver; + modify->delete_compute(id_ke); modify->delete_compute(id_pe); modify->delete_compute(id_press); @@ -1151,7 +1152,7 @@ void MDIEngine::receive_coords() int ierr = MDI_Recv(sys_coords, n, MDI_DOUBLE, mdicomm); if (ierr) error->all(FLERR, "MDI: >COORDS data"); MPI_Bcast(sys_coords, n, MPI_DOUBLE, 0, world); - for (int i = 0; i < n; i++) sys_coords[i] * mdi2lmp_length; + for (int i = 0; i < n; i++) sys_coords[i] *= mdi2lmp_length; } /* ---------------------------------------------------------------------- @@ -1229,7 +1230,7 @@ void MDIEngine::receive_velocities() int ierr = MDI_Recv(sys_velocities, n, MDI_DOUBLE, mdicomm); if (ierr) error->all(FLERR, "MDI: >VELOCITIES data"); MPI_Bcast(sys_velocities, n, MPI_DOUBLE, 0, world); - for (int i = 0; i < n; i++) sys_coords[i] * mdi2lmp_velocity; + for (int i = 0; i < n; i++) sys_coords[i] *= mdi2lmp_velocity; } /* ---------------------------------------------------------------------- From 81933b797221e465df0c9d9c30df28a72ccb76ce Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 21:19:32 -0400 Subject: [PATCH 129/130] silence compiler warnings --- src/MDI/fix_mdi_engine.cpp | 10 +++++----- src/MDI/mdi_engine.cpp | 13 ++++++------- src/MDI/mdi_plugin.cpp | 5 ++--- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/MDI/fix_mdi_engine.cpp b/src/MDI/fix_mdi_engine.cpp index aac4f727fb..e68b9b54b4 100644 --- a/src/MDI/fix_mdi_engine.cpp +++ b/src/MDI/fix_mdi_engine.cpp @@ -28,7 +28,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixMDIEngine::FixMDIEngine(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) +FixMDIEngine::FixMDIEngine(LAMMPS *_lmp, int narg, char **arg) : Fix(_lmp, narg, arg) { if (narg != 3) error->all(FLERR, "Illegal fix mdi/engine command"); } @@ -48,7 +48,7 @@ int FixMDIEngine::setmask() /* ---------------------------------------------------------------------- */ -void FixMDIEngine::setup(int vflag) +void FixMDIEngine::setup(int /*vflag*/) { // engine is now at FORCES node @@ -66,7 +66,7 @@ void FixMDIEngine::post_integrate() /* ---------------------------------------------------------------------- */ -void FixMDIEngine::min_pre_force(int vflag) +void FixMDIEngine::min_pre_force(int /*vflag*/) { // engine is now at COORDS node for minimizer @@ -75,7 +75,7 @@ void FixMDIEngine::min_pre_force(int vflag) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::post_force(int vflag) +void FixMDIEngine::post_force(int /*vflag*/) { // engine is now at FORCES node for MD @@ -84,7 +84,7 @@ void FixMDIEngine::post_force(int vflag) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::min_post_force(int vflag) +void FixMDIEngine::min_post_force(int /*vflag*/) { // engine is now at FORCES node for minimizer diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 91933d079e..6a1f8e5c30 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -63,7 +63,7 @@ enum { TYPE, CHARGE, MASS, COORD, VELOCITY, FORCE, ADDFORCE }; when EXIT command is received, mdi engine command exits ---------------------------------------------------------------------- */ -MDIEngine::MDIEngine(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) +MDIEngine::MDIEngine(LAMMPS *_lmp, int narg, char ** /*arg*/) : Pointers(_lmp) { if (narg) error->all(FLERR, "Illegal mdi engine command"); @@ -278,12 +278,12 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) int command_exists; if (root) { ierr = MDI_Check_command_exists(node_engine, command, MDI_COMM_NULL, &command_exists); - if (ierr) error->one(FLERR, "MDI: Unable to check whether current command is supported"); + if (ierr) error->one(FLERR, "MDI: Cannot confirm that command '{}' is supported", command); } MPI_Bcast(&command_exists, 1, MPI_INT, 0, world); if (!command_exists) - error->all(FLERR, "MDI: Received command {} unsupported by engine node {}", command, + error->all(FLERR, "MDI: Received command '{}' unsupported by engine node {}", command, node_engine); // --------------------------------------- @@ -960,10 +960,9 @@ void MDIEngine::create_system() // optionally set charges if specified by ">CHARGES" if (flag_velocities) - int natoms = - lammps_create_atoms(lmp, sys_natoms, NULL, sys_types, sys_coords, sys_velocities, NULL, 1); + lammps_create_atoms(lmp, sys_natoms, NULL, sys_types, sys_coords, sys_velocities, NULL, 1); else - int natoms = lammps_create_atoms(lmp, sys_natoms, NULL, sys_types, sys_coords, NULL, NULL, 1); + lammps_create_atoms(lmp, sys_natoms, NULL, sys_types, sys_coords, NULL, NULL, 1); if (flag_charges) lammps_scatter_atoms(lmp, (char *) "q", 1, 1, sys_charges); @@ -1628,7 +1627,7 @@ void MDIEngine::infile() char *infile = new char[nbytes + 1]; int ierr = MDI_Recv(infile, nbytes + 1, MDI_CHAR, mdicomm); - if (ierr) error->all(FLERR, "MDI: INFILE data"); + if (ierr) error->all(FLERR, "MDI: INFILE data for {}", infile); MPI_Bcast(infile, nbytes + 1, MPI_CHAR, 0, world); infile[nbytes] = '\0'; diff --git a/src/MDI/mdi_plugin.cpp b/src/MDI/mdi_plugin.cpp index 65bc1d8942..d1fcd2d941 100644 --- a/src/MDI/mdi_plugin.cpp +++ b/src/MDI/mdi_plugin.cpp @@ -38,7 +38,7 @@ using namespace LAMMPS_NS; this class is destroyed ---------------------------------------------------------------------- */ -MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) +MDIPlugin::MDIPlugin(LAMMPS *_lmp, int narg, char **arg) : Pointers(_lmp) { if (narg < 1) error->all(FLERR, "Illegal mdi plugin command"); @@ -112,9 +112,8 @@ MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) with the plugin ---------------------------------------------------------------------- */ -int MDIPlugin::plugin_wrapper(void *pmpicomm, MDI_Comm mdicomm, void *vptr) +int MDIPlugin::plugin_wrapper(void * /*pmpicomm*/, MDI_Comm mdicomm, void *vptr) { - MPI_Comm mpicomm = *(MPI_Comm *) pmpicomm; MDIPlugin *ptr = (MDIPlugin *) vptr; LAMMPS *lammps = ptr->lmp; char *lammps_command = ptr->lammps_command; From 5ff42d89933f6d5b593edb31b5e07e0533e961aa Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 21:21:36 -0400 Subject: [PATCH 130/130] simplify --- src/MDI/mdi_engine.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 6a1f8e5c30..9d13e1f1c6 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -97,17 +97,13 @@ MDIEngine::MDIEngine(LAMMPS *_lmp, int narg, char ** /*arg*/) : Pointers(_lmp) // pressure compute only calculates virial, no kinetic term id_ke = utils::strdup(std::string("MDI_ENGINE") + "_ke"); - modify->add_compute(fmt::format("{} all ke", id_ke)); + ke = modify->add_compute(fmt::format("{} all ke", id_ke)); id_pe = utils::strdup(std::string("MDI_ENGINE") + "_pe"); - modify->add_compute(fmt::format("{} all pe", id_pe)); + pe = modify->add_compute(fmt::format("{} all pe", id_pe)); id_press = utils::strdup(std::string("MDI_ENGINE") + "_press"); - modify->add_compute(fmt::format("{} all pressure NULL virial", id_press)); - - ke = modify->get_compute_by_id(id_ke); - pe = modify->get_compute_by_id(id_pe); - press = modify->get_compute_by_id(id_press); + press = modify->add_compute(fmt::format("{} all pressure NULL virial", id_press)); // irregular class used if >COORDS change dramatically