diff --git a/doc/src/Howto_mdi.rst b/doc/src/Howto_mdi.rst index 8e13563b37..a0a1cd0286 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:: - This Howto doc page will eventually replace the + This Howto doc page will eventually replace the :doc:`Howto client/server ` doc page. Client/server coupling of two codes is where one code is the "client" diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 8a3602674f..e70c20a60d 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -1801,7 +1801,7 @@ USER-MDI package A LAMMPS command and fix to allow client-server coupling of LAMMPS to other atomic or molecular simulation codes via the `MolSSI Driver Interface -(MDI) library `_. +(MDI) library `_. **Author:** Taylor Barnes - MolSSI, taylor.a.barnes at gmail.com diff --git a/src/USER-MDI/fix_mdi_engine.cpp b/src/USER-MDI/fix_mdi_engine.cpp index be71d32d1d..14abd1aa41 100644 --- a/src/USER-MDI/fix_mdi_engine.cpp +++ b/src/USER-MDI/fix_mdi_engine.cpp @@ -263,7 +263,7 @@ int FixMDIEngine::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,"max_eval = 0; } - + } else if (strcmp(command,"@COORDS") == 0 ) { strncpy(target_node, "@COORDS", MDI_COMMAND_LENGTH); local_exit_flag = true; @@ -484,7 +484,7 @@ void FixMDIEngine::receive_coordinates(Error* error) } // ensure atoms are in current box & update box via shrink-wrap - // has to be be done before invoking Irregular::migrate_atoms() + // 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); @@ -577,7 +577,7 @@ void FixMDIEngine::send_charges(Error* error) MPI_Reduce(charges, charges_reduced, atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - if (master) { + if (master) { 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"); @@ -689,7 +689,7 @@ void FixMDIEngine::send_types(Error* error) { int * const type = atom->type; - if (master) { + if (master) { 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"); @@ -709,7 +709,7 @@ void FixMDIEngine::send_labels(Error* error) strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); } - if (master) { + if (master) { 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"); @@ -935,7 +935,7 @@ void FixMDIEngine::send_cell(Error* error) celldata[icell] *= unit_conv; } - if (master) { + if (master) { ierr = MDI_Send((char*) celldata, 9, MDI_DOUBLE, driver_socket); if (ierr != 0) error->all(FLERR,"MDI: Unable to send cell dimensions to driver"); @@ -949,7 +949,7 @@ void FixMDIEngine::receive_cell(Error* error) double celldata[9]; // receive the new cell vector from the driver - if (master) { + if (master) { ierr = MDI_Recv((char*) celldata, 9, MDI_DOUBLE, driver_socket); if (ierr != 0) error->all(FLERR,"MDI: Unable to send cell dimensions to driver"); @@ -1007,7 +1007,7 @@ void FixMDIEngine::send_celldispl(Error* error) celldata[icell] *= unit_conv; } - if (master) { + if (master) { ierr = MDI_Send((char*) celldata, 3, MDI_DOUBLE, driver_socket); if (ierr != 0) error->all(FLERR,"MDI: Unable to send cell displacement to driver"); @@ -1020,7 +1020,7 @@ void FixMDIEngine::receive_celldispl(Error* error) { // receive the cell displacement from the driver double celldata[3]; - if (master) { + if (master) { ierr = MDI_Recv((char*) celldata, 3, MDI_DOUBLE, driver_socket); if (ierr != 0) error->all(FLERR,"MDI: Unable to receive cell displacement from driver"); diff --git a/src/USER-MDI/fix_mdi_engine.h b/src/USER-MDI/fix_mdi_engine.h index dc4126db9a..eede97b033 100644 --- a/src/USER-MDI/fix_mdi_engine.h +++ b/src/USER-MDI/fix_mdi_engine.h @@ -136,9 +136,9 @@ 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 +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_engine.cpp b/src/USER-MDI/mdi_engine.cpp index 06a8c03eb0..5cedfb65aa 100644 --- a/src/USER-MDI/mdi_engine.cpp +++ b/src/USER-MDI/mdi_engine.cpp @@ -210,20 +210,20 @@ void MDIEngine::command(int narg, char **arg) // 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, fmt::format("MDI node exited with " @@ -306,7 +306,7 @@ char *MDIEngine::mdi_optg() Minimize *minimizer = new Minimize(lmp); - // setup the minimizer in a way that ensures optimization + // setup the minimizer in a way that ensures optimization // will continue until MDI driver exits update->etol = std::numeric_limits::min();