whitespace
This commit is contained in:
@ -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: <ENERGY, <FORCES, <KE,
|
||||
The *mdi plugin* command is used to make LAMMPS operate as an MDI
|
||||
driver which loads an MDI engine as a plugin library. It is typically
|
||||
used in an input script after LAMMPS has setup the system it is going
|
||||
to model consistent with the engine code.
|
||||
to model consistent with the engine code.
|
||||
|
||||
The *name* argument specifies which plugin library to load. A name
|
||||
like "lammps" is converted to a filename liblammps.so. The path for
|
||||
|
||||
@ -551,13 +551,13 @@ 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
|
||||
// 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");
|
||||
MDI_Register_callback("@FORCES",">+FORCES");
|
||||
MDI_Register_command("@FORCES","<@");
|
||||
MDI_Register_command("@FORCES","<@");
|
||||
MDI_Register_command("@FORCES","<COORDS");
|
||||
MDI_Register_command("@FORCES","<ENERGY");
|
||||
MDI_Register_command("@FORCES","<FORCES");
|
||||
@ -614,7 +614,7 @@ void MDIEngine::mdi_md()
|
||||
// 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;
|
||||
|
||||
@ -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<int> (params[2]);
|
||||
max_eval = static_cast<int> (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;
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user