rename old version to old in filename
This commit is contained in:
@ -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];
|
||||
@ -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();
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#define LAMMPS_LIB_MPI 1
|
||||
#include "library.h"
|
||||
|
||||
#include "fix_mdi_engine.h"
|
||||
#include "fix_mdi_engine_old.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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<FixMDIEngine *>(modify->fix[ifix]);
|
||||
ifix = modify->find_fix_by_style("mdi/engine/old");
|
||||
mdi_fix = static_cast<FixMDIEngineOld *>(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
|
||||
@ -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();
|
||||
Reference in New Issue
Block a user