change name of 2 new fixes to include amoeba
This commit is contained in:
@ -14,10 +14,10 @@ improper_style amoeba
|
||||
# per-atom properties required by AMOEBA or HIPPO
|
||||
|
||||
fix amtype all property/atom i_amtype ghost yes
|
||||
fix pitorsion all pitorsion
|
||||
fix_modify pitorsion energy yes
|
||||
fix bitorsion all bitorsion bitorsion.ubiquitin.data
|
||||
fix_modify bitorsion energy yes
|
||||
fix pit all amoeba/pitorsion
|
||||
fix_modify pit energy yes
|
||||
fix bit all amoeba/bitorsion bitorsion.ubiquitin.data
|
||||
fix_modify bit energy yes
|
||||
|
||||
fix extra all property/atom &
|
||||
i_amgroup i_ired i_xaxis i_yaxis i_zaxis d_pval ghost yes
|
||||
@ -25,9 +25,9 @@ fix extra2 all property/atom i_polaxe
|
||||
|
||||
#read_data data.ubiquitin fix amtype NULL "Tinker Types"
|
||||
read_data data.ubiquitin fix amtype NULL "Tinker Types" &
|
||||
fix pitorsion "pitorsion types" "PiTorsion Coeffs" &
|
||||
fix pitorsion pitorsions PiTorsions &
|
||||
fix bitorsion bitorsions BiTorsions
|
||||
fix pit "pitorsion types" "PiTorsion Coeffs" &
|
||||
fix pit pitorsions PiTorsions &
|
||||
fix bit bitorsions BiTorsions
|
||||
|
||||
pair_style amoeba exclude bitorsion
|
||||
pair_coeff * * amoeba_ubiquitin.prm amoeba_ubiquitin.key
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "fix_bitorsion.h"
|
||||
#include "fix_amoeba_bitorsion.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@ -78,13 +78,13 @@ void bcuint1(double *ftt, double *ft1, double *ft2, double *ft12,
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixBiTorsion::FixBiTorsion(LAMMPS *lmp, int narg, char **arg) :
|
||||
FixAmoebaBiTorsion::FixAmoebaBiTorsion(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg),
|
||||
bitorsion_list(nullptr), num_bitorsion(nullptr), bitorsion_type(nullptr),
|
||||
bitorsion_atom1(nullptr), bitorsion_atom2(nullptr), bitorsion_atom3(nullptr),
|
||||
bitorsion_atom4(nullptr), bitorsion_atom5(nullptr)
|
||||
{
|
||||
if (narg != 4) error->all(FLERR,"Illegal fix bitorsion command");
|
||||
if (narg != 4) error->all(FLERR,"Illegal fix amoeba/bitorsion command");
|
||||
|
||||
restart_global = 1;
|
||||
restart_peratom = 1;
|
||||
@ -139,7 +139,7 @@ FixBiTorsion::FixBiTorsion(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
FixBiTorsion::~FixBiTorsion()
|
||||
FixAmoebaBiTorsion::~FixAmoebaBiTorsion()
|
||||
{
|
||||
// unregister callbacks to this fix from Atom class
|
||||
|
||||
@ -171,7 +171,7 @@ FixBiTorsion::~FixBiTorsion()
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int FixBiTorsion::setmask()
|
||||
int FixAmoebaBiTorsion::setmask()
|
||||
{
|
||||
int mask = 0;
|
||||
mask |= PRE_NEIGHBOR;
|
||||
@ -184,7 +184,7 @@ int FixBiTorsion::setmask()
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::init()
|
||||
void FixAmoebaBiTorsion::init()
|
||||
{
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
ilevel_respa = ((Respa *) update->integrate)->nlevels-1;
|
||||
@ -209,7 +209,7 @@ void FixBiTorsion::init()
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::setup(int vflag)
|
||||
void FixAmoebaBiTorsion::setup(int vflag)
|
||||
{
|
||||
pre_neighbor();
|
||||
|
||||
@ -224,21 +224,21 @@ void FixBiTorsion::setup(int vflag)
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::setup_pre_neighbor()
|
||||
void FixAmoebaBiTorsion::setup_pre_neighbor()
|
||||
{
|
||||
pre_neighbor();
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::setup_pre_reverse(int eflag, int vflag)
|
||||
void FixAmoebaBiTorsion::setup_pre_reverse(int eflag, int vflag)
|
||||
{
|
||||
pre_reverse(eflag,vflag);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::min_setup(int vflag)
|
||||
void FixAmoebaBiTorsion::min_setup(int vflag)
|
||||
{
|
||||
pre_neighbor();
|
||||
post_force(vflag);
|
||||
@ -250,7 +250,7 @@ void FixBiTorsion::min_setup(int vflag)
|
||||
this proc lists the bitorsion exactly once
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::pre_neighbor()
|
||||
void FixAmoebaBiTorsion::pre_neighbor()
|
||||
{
|
||||
int i,m,atom1,atom2,atom3,atom4,atom5;
|
||||
|
||||
@ -313,14 +313,14 @@ void FixBiTorsion::pre_neighbor()
|
||||
store eflag, so can use it in post_force to tally per-atom energies
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::pre_reverse(int eflag, int /*vflag*/)
|
||||
void FixAmoebaBiTorsion::pre_reverse(int eflag, int /*vflag*/)
|
||||
{
|
||||
eflag_caller = eflag;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::post_force(int vflag)
|
||||
void FixAmoebaBiTorsion::post_force(int vflag)
|
||||
{
|
||||
if (disable) return;
|
||||
|
||||
@ -667,14 +667,14 @@ void FixBiTorsion::post_force(int vflag)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::post_force_respa(int vflag, int ilevel, int /*iloop*/)
|
||||
void FixAmoebaBiTorsion::post_force_respa(int vflag, int ilevel, int /*iloop*/)
|
||||
{
|
||||
if (ilevel == ilevel_respa) post_force(vflag);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::min_post_force(int vflag)
|
||||
void FixAmoebaBiTorsion::min_post_force(int vflag)
|
||||
{
|
||||
post_force(vflag);
|
||||
}
|
||||
@ -683,7 +683,7 @@ void FixBiTorsion::min_post_force(int vflag)
|
||||
energy of BiTorision term
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double FixBiTorsion::compute_scalar()
|
||||
double FixAmoebaBiTorsion::compute_scalar()
|
||||
{
|
||||
double all;
|
||||
MPI_Allreduce(&ebitorsion,&all,1,MPI_DOUBLE,MPI_SUM,world);
|
||||
@ -696,7 +696,7 @@ double FixBiTorsion::compute_scalar()
|
||||
// ----------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void FixBiTorsion::read_grid_data(char *bitorsion_file)
|
||||
void FixAmoebaBiTorsion::read_grid_data(char *bitorsion_file)
|
||||
{
|
||||
char line[MAXLINE];
|
||||
char *eof;
|
||||
@ -705,19 +705,20 @@ void FixBiTorsion::read_grid_data(char *bitorsion_file)
|
||||
if (me == 0) {
|
||||
fp = utils::open_potential(bitorsion_file,lmp,nullptr);
|
||||
if (fp == nullptr)
|
||||
error->one(FLERR,"Cannot open fix bitorsion file {}: {}",
|
||||
error->one(FLERR,"Cannot open fix amoeba/bitorsion file {}: {}",
|
||||
bitorsion_file, utils::getsyserror());
|
||||
|
||||
eof = fgets(line,MAXLINE,fp);
|
||||
eof = fgets(line,MAXLINE,fp);
|
||||
eof = fgets(line,MAXLINE,fp);
|
||||
if (eof == nullptr) error->one(FLERR,"Unexpected end of fix bitorsion file");
|
||||
if (eof == nullptr)
|
||||
error->one(FLERR,"Unexpected end of fix amoeba/bitorsion file");
|
||||
|
||||
sscanf(line,"%d",&ntypes);
|
||||
}
|
||||
|
||||
MPI_Bcast(&ntypes,1,MPI_INT,0,world);
|
||||
if (ntypes == 0) error->all(FLERR,"Fix bitorsion file has no types");
|
||||
if (ntypes == 0) error->all(FLERR,"Fix amoeba/bitorsion file has no types");
|
||||
|
||||
btgrid = new double***[ntypes+1];
|
||||
nxgrid = new int[ntypes+1];
|
||||
@ -733,7 +734,7 @@ void FixBiTorsion::read_grid_data(char *bitorsion_file)
|
||||
eof = fgets(line,MAXLINE,fp);
|
||||
eof = fgets(line,MAXLINE,fp);
|
||||
if (eof == nullptr)
|
||||
error->one(FLERR,"Unexpected end of fix bitorsion file");
|
||||
error->one(FLERR,"Unexpected end of fix amoeba/bitorsion file");
|
||||
sscanf(line,"%d %d %d",&tmp,&nx,&ny);
|
||||
}
|
||||
|
||||
@ -751,7 +752,7 @@ void FixBiTorsion::read_grid_data(char *bitorsion_file)
|
||||
for (int ix = 0; ix < nx; ix++) {
|
||||
eof = fgets(line,MAXLINE,fp);
|
||||
if (eof == nullptr)
|
||||
error->one(FLERR,"Unexpected end of fix bitorsion file");
|
||||
error->one(FLERR,"Unexpected end of fix amoeba/bitorsion file");
|
||||
sscanf(line,"%lg %lg %lg",&xgrid,&ygrid,&value);
|
||||
btgrid[itype][ix][iy][0] = xgrid;
|
||||
btgrid[itype][ix][iy][1] = ygrid;
|
||||
@ -772,11 +773,12 @@ void FixBiTorsion::read_grid_data(char *bitorsion_file)
|
||||
// ----------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void FixBiTorsion::read_data_header(char *line)
|
||||
void FixAmoebaBiTorsion::read_data_header(char *line)
|
||||
{
|
||||
if (strstr(line,"bitorsions")) {
|
||||
sscanf(line,BIGINT_FORMAT,&nbitorsions);
|
||||
} else error->all(FLERR,"Invalid read data header line for fix bitorsion");
|
||||
} else error->all(FLERR,
|
||||
"Invalid read data header line for fix amoeba/bitorsion");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -784,7 +786,7 @@ void FixBiTorsion::read_data_header(char *line)
|
||||
id_offset is applied to atomID fields if multiple data files are read
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::read_data_section(char *keyword, int n, char *buf,
|
||||
void FixAmoebaBiTorsion::read_data_section(char *keyword, int n, char *buf,
|
||||
tagint id_offset)
|
||||
{
|
||||
int m,tmp,itype;
|
||||
@ -882,7 +884,7 @@ void FixBiTorsion::read_data_section(char *keyword, int n, char *buf,
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
bigint FixBiTorsion::read_data_skip_lines(char * /*keyword*/)
|
||||
bigint FixAmoebaBiTorsion::read_data_skip_lines(char * /*keyword*/)
|
||||
{
|
||||
return nbitorsions;
|
||||
}
|
||||
@ -892,7 +894,7 @@ bigint FixBiTorsion::read_data_skip_lines(char * /*keyword*/)
|
||||
only called by proc 0
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::write_data_header(FILE *fp, int /*mth*/)
|
||||
void FixAmoebaBiTorsion::write_data_header(FILE *fp, int /*mth*/)
|
||||
{
|
||||
fprintf(fp,BIGINT_FORMAT " bitorsions\n",nbitorsions);
|
||||
}
|
||||
@ -905,7 +907,7 @@ void FixBiTorsion::write_data_header(FILE *fp, int /*mth*/)
|
||||
// ny = 6 columns = type + 5 atom IDs
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::write_data_section_size(int /*mth*/, int &nx, int &ny)
|
||||
void FixAmoebaBiTorsion::write_data_section_size(int /*mth*/, int &nx, int &ny)
|
||||
{
|
||||
int i,m;
|
||||
|
||||
@ -925,7 +927,7 @@ void FixBiTorsion::write_data_section_size(int /*mth*/, int &nx, int &ny)
|
||||
buf allocated by caller as owned BiTorsions by 6
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::write_data_section_pack(int /*mth*/, double **buf)
|
||||
void FixAmoebaBiTorsion::write_data_section_pack(int /*mth*/, double **buf)
|
||||
{
|
||||
int i,m;
|
||||
|
||||
@ -956,7 +958,7 @@ void FixBiTorsion::write_data_section_pack(int /*mth*/, double **buf)
|
||||
only called by proc 0
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::write_data_section_keyword(int /*mth*/, FILE *fp)
|
||||
void FixAmoebaBiTorsion::write_data_section_keyword(int /*mth*/, FILE *fp)
|
||||
{
|
||||
fprintf(fp,"\nBiTorsions\n\n");
|
||||
}
|
||||
@ -968,7 +970,7 @@ void FixBiTorsion::write_data_section_keyword(int /*mth*/, FILE *fp)
|
||||
only called by proc 0
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::write_data_section(int /*mth*/, FILE *fp,
|
||||
void FixAmoebaBiTorsion::write_data_section(int /*mth*/, FILE *fp,
|
||||
int n, double **buf, int index)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
@ -989,7 +991,7 @@ void FixBiTorsion::write_data_section(int /*mth*/, FILE *fp,
|
||||
pack entire state of Fix into one write
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::write_restart(FILE *fp)
|
||||
void FixAmoebaBiTorsion::write_restart(FILE *fp)
|
||||
{
|
||||
if (comm->me == 0) {
|
||||
int size = sizeof(bigint);
|
||||
@ -1002,7 +1004,7 @@ void FixBiTorsion::write_restart(FILE *fp)
|
||||
use state info from restart file to restart the Fix
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::restart(char *buf)
|
||||
void FixAmoebaBiTorsion::restart(char *buf)
|
||||
{
|
||||
nbitorsions = *((bigint *) buf);
|
||||
}
|
||||
@ -1011,7 +1013,7 @@ void FixBiTorsion::restart(char *buf)
|
||||
pack values in local atom-based arrays for restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixBiTorsion::pack_restart(int i, double *buf)
|
||||
int FixAmoebaBiTorsion::pack_restart(int i, double *buf)
|
||||
{
|
||||
int n = 1;
|
||||
for (int m = 0; m < num_bitorsion[i]; m++) {
|
||||
@ -1031,7 +1033,7 @@ int FixBiTorsion::pack_restart(int i, double *buf)
|
||||
unpack values from atom->extra array to restart the fix
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::unpack_restart(int nlocal, int nth)
|
||||
void FixAmoebaBiTorsion::unpack_restart(int nlocal, int nth)
|
||||
{
|
||||
double **extra = atom->extra;
|
||||
|
||||
@ -1058,7 +1060,7 @@ void FixBiTorsion::unpack_restart(int nlocal, int nth)
|
||||
maxsize of any atom's restart data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixBiTorsion::maxsize_restart()
|
||||
int FixAmoebaBiTorsion::maxsize_restart()
|
||||
{
|
||||
return 1 + BITORSIONMAX*6;
|
||||
}
|
||||
@ -1067,7 +1069,7 @@ int FixBiTorsion::maxsize_restart()
|
||||
size of atom nlocal's restart data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixBiTorsion::size_restart(int nlocal)
|
||||
int FixAmoebaBiTorsion::size_restart(int nlocal)
|
||||
{
|
||||
return 1 + num_bitorsion[nlocal]*6;
|
||||
}
|
||||
@ -1076,7 +1078,7 @@ int FixBiTorsion::size_restart(int nlocal)
|
||||
allocate atom-based array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::grow_arrays(int nmax)
|
||||
void FixAmoebaBiTorsion::grow_arrays(int nmax)
|
||||
{
|
||||
num_bitorsion = memory->grow(num_bitorsion,nmax,"cmap:num_bitorsion");
|
||||
bitorsion_type = memory->grow(bitorsion_type,nmax,BITORSIONMAX,
|
||||
@ -1103,7 +1105,7 @@ void FixBiTorsion::grow_arrays(int nmax)
|
||||
copy values within local atom-based array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::copy_arrays(int i, int j, int /*delflag*/)
|
||||
void FixAmoebaBiTorsion::copy_arrays(int i, int j, int /*delflag*/)
|
||||
{
|
||||
num_bitorsion[j] = num_bitorsion[i];
|
||||
|
||||
@ -1121,7 +1123,7 @@ void FixBiTorsion::copy_arrays(int i, int j, int /*delflag*/)
|
||||
initialize one atom's array values, called when atom is created
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBiTorsion::set_arrays(int i)
|
||||
void FixAmoebaBiTorsion::set_arrays(int i)
|
||||
{
|
||||
num_bitorsion[i] = 0;
|
||||
}
|
||||
@ -1130,7 +1132,7 @@ void FixBiTorsion::set_arrays(int i)
|
||||
pack values in local atom-based array for exchange with another proc
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixBiTorsion::pack_exchange(int i, double *buf)
|
||||
int FixAmoebaBiTorsion::pack_exchange(int i, double *buf)
|
||||
{
|
||||
int n = 0;
|
||||
buf[n++] = ubuf(num_bitorsion[i]).d;
|
||||
@ -1149,7 +1151,7 @@ int FixBiTorsion::pack_exchange(int i, double *buf)
|
||||
unpack values in local atom-based array from exchange with another proc
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixBiTorsion::unpack_exchange(int nlocal, double *buf)
|
||||
int FixAmoebaBiTorsion::unpack_exchange(int nlocal, double *buf)
|
||||
{
|
||||
int n = 0;
|
||||
num_bitorsion[nlocal] = (int) ubuf(buf[n++]).i;
|
||||
@ -1168,7 +1170,7 @@ int FixBiTorsion::unpack_exchange(int nlocal, double *buf)
|
||||
memory usage of local atom-based arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double FixBiTorsion::memory_usage()
|
||||
double FixAmoebaBiTorsion::memory_usage()
|
||||
{
|
||||
int nmax = atom->nmax;
|
||||
double bytes = (double)nmax * sizeof(int); // num_bitorsion
|
||||
@ -13,20 +13,20 @@
|
||||
|
||||
#ifdef FIX_CLASS
|
||||
// clang-format off
|
||||
FixStyle(bitorsion,FixBiTorsion);
|
||||
FixStyle(amoeba/bitorsion,FixAmoebaBiTorsion);
|
||||
// clang-format on
|
||||
#else
|
||||
|
||||
#ifndef LMP_FIX_BITORSION_H
|
||||
#define LMP_FIX_BITORSION_H
|
||||
#ifndef LMP_FIX_AMOEBA_BITORSION_H
|
||||
#define LMP_FIX_AMOEBA_BITORSION_H
|
||||
|
||||
#include "fix.h"
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class FixBiTorsion : public Fix {
|
||||
class FixAmoebaBiTorsion : public Fix {
|
||||
public:
|
||||
FixBiTorsion(class LAMMPS *, int, char **);
|
||||
~FixBiTorsion();
|
||||
FixAmoebaBiTorsion(class LAMMPS *, int, char **);
|
||||
~FixAmoebaBiTorsion();
|
||||
int setmask();
|
||||
void init();
|
||||
void setup(int);
|
||||
@ -12,7 +12,7 @@
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "fix_pitorsion.h"
|
||||
#include "fix_amoeba_pitorsion.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@ -36,16 +36,15 @@ using namespace MathConst;
|
||||
#define LISTDELTA 8196
|
||||
#define LB_FACTOR 1.5
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixPiTorsion::FixPiTorsion(LAMMPS *lmp, int narg, char **arg) :
|
||||
FixAmoebaPiTorsion::FixAmoebaPiTorsion(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg),
|
||||
pitorsion_list(nullptr), num_pitorsion(nullptr), pitorsion_type(nullptr),
|
||||
pitorsion_atom1(nullptr), pitorsion_atom2(nullptr), pitorsion_atom3(nullptr),
|
||||
pitorsion_atom4(nullptr), pitorsion_atom5(nullptr), pitorsion_atom6(nullptr)
|
||||
{
|
||||
if (narg != 3) error->all(FLERR,"Illegal fix pitorsion command");
|
||||
if (narg != 3) error->all(FLERR,"Illegal fix amoeba/pitorsion command");
|
||||
|
||||
// settings for this fix
|
||||
|
||||
@ -103,7 +102,7 @@ FixPiTorsion::FixPiTorsion(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
FixPiTorsion::~FixPiTorsion()
|
||||
FixAmoebaPiTorsion::~FixAmoebaPiTorsion()
|
||||
{
|
||||
// unregister callbacks to this fix from Atom class
|
||||
|
||||
@ -132,7 +131,7 @@ FixPiTorsion::~FixPiTorsion()
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int FixPiTorsion::setmask()
|
||||
int FixAmoebaPiTorsion::setmask()
|
||||
{
|
||||
int mask = 0;
|
||||
mask |= PRE_NEIGHBOR;
|
||||
@ -145,7 +144,7 @@ int FixPiTorsion::setmask()
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::init()
|
||||
void FixAmoebaPiTorsion::init()
|
||||
{
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
ilevel_respa = ((Respa *) update->integrate)->nlevels-1;
|
||||
@ -170,7 +169,7 @@ void FixPiTorsion::init()
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::setup(int vflag)
|
||||
void FixAmoebaPiTorsion::setup(int vflag)
|
||||
{
|
||||
pre_neighbor();
|
||||
|
||||
@ -185,21 +184,21 @@ void FixPiTorsion::setup(int vflag)
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::setup_pre_neighbor()
|
||||
void FixAmoebaPiTorsion::setup_pre_neighbor()
|
||||
{
|
||||
pre_neighbor();
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::setup_pre_reverse(int eflag, int vflag)
|
||||
void FixAmoebaPiTorsion::setup_pre_reverse(int eflag, int vflag)
|
||||
{
|
||||
pre_reverse(eflag,vflag);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::min_setup(int vflag)
|
||||
void FixAmoebaPiTorsion::min_setup(int vflag)
|
||||
{
|
||||
pre_neighbor();
|
||||
post_force(vflag);
|
||||
@ -211,7 +210,7 @@ void FixPiTorsion::min_setup(int vflag)
|
||||
this proc lists the pitorsion exactly once
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::pre_neighbor()
|
||||
void FixAmoebaPiTorsion::pre_neighbor()
|
||||
{
|
||||
int i,m,atom1,atom2,atom3,atom4,atom5,atom6;
|
||||
|
||||
@ -278,7 +277,7 @@ void FixPiTorsion::pre_neighbor()
|
||||
store eflag, so can use it in post_force to tally per-atom energies
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::pre_reverse(int eflag, int /*vflag*/)
|
||||
void FixAmoebaPiTorsion::pre_reverse(int eflag, int /*vflag*/)
|
||||
{
|
||||
eflag_caller = eflag;
|
||||
}
|
||||
@ -287,7 +286,7 @@ void FixPiTorsion::pre_reverse(int eflag, int /*vflag*/)
|
||||
compute PiTorsion terms
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::post_force(int vflag)
|
||||
void FixAmoebaPiTorsion::post_force(int vflag)
|
||||
{
|
||||
if (disable) return;
|
||||
|
||||
@ -568,14 +567,14 @@ void FixPiTorsion::post_force(int vflag)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::post_force_respa(int vflag, int ilevel, int /*iloop*/)
|
||||
void FixAmoebaPiTorsion::post_force_respa(int vflag, int ilevel, int /*iloop*/)
|
||||
{
|
||||
if (ilevel == ilevel_respa) post_force(vflag);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::min_post_force(int vflag)
|
||||
void FixAmoebaPiTorsion::min_post_force(int vflag)
|
||||
{
|
||||
post_force(vflag);
|
||||
}
|
||||
@ -584,7 +583,7 @@ void FixPiTorsion::min_post_force(int vflag)
|
||||
energy of PiTorsion term
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double FixPiTorsion::compute_scalar()
|
||||
double FixAmoebaPiTorsion::compute_scalar()
|
||||
{
|
||||
double all;
|
||||
MPI_Allreduce(&epitorsion,&all,1,MPI_DOUBLE,MPI_SUM,world);
|
||||
@ -597,13 +596,14 @@ double FixPiTorsion::compute_scalar()
|
||||
// ----------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void FixPiTorsion::read_data_header(char *line)
|
||||
void FixAmoebaPiTorsion::read_data_header(char *line)
|
||||
{
|
||||
if (strstr(line,"pitorsions")) {
|
||||
sscanf(line,BIGINT_FORMAT,&npitorsions);
|
||||
} else if (strstr(line,"pitorsion types")) {
|
||||
sscanf(line,"%d",&npitorsion_types);
|
||||
} else error->all(FLERR,"Invalid read data header line for fix pitorsion");
|
||||
} else error->all(FLERR,
|
||||
"Invalid read data header line for amoeba/fix pitorsion");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -611,7 +611,7 @@ void FixPiTorsion::read_data_header(char *line)
|
||||
id_offset is applied to atomID fields if multiple data files are read
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::read_data_section(char *keyword, int n, char *buf,
|
||||
void FixAmoebaPiTorsion::read_data_section(char *keyword, int n, char *buf,
|
||||
tagint id_offset)
|
||||
{
|
||||
int which;
|
||||
@ -622,7 +622,7 @@ void FixPiTorsion::read_data_section(char *keyword, int n, char *buf,
|
||||
} else if (strstr(keyword,"PiTorsion Coeffs")) {
|
||||
sscanf(keyword,"%d",&npitorsion_types);
|
||||
which = 1;
|
||||
} else error->all(FLERR,"Invalid read data section for fix pitorsion");
|
||||
} else error->all(FLERR,"Invalid read data section for fix amoeba/pitorsion");
|
||||
|
||||
// loop over lines of PiTorsion Coeffs
|
||||
// tokenize the line into values
|
||||
@ -640,7 +640,7 @@ void FixPiTorsion::read_data_section(char *keyword, int n, char *buf,
|
||||
*next = '\0';
|
||||
sscanf(buf,"%d %lg",&itype,&value);
|
||||
if (itype <= 0 || itype > npitorsion_types)
|
||||
error->all(FLERR,"Incorrect args for pitorsion coefficients");
|
||||
error->all(FLERR,"Incorrect args for fix amoeba/pitorsion coeffs");
|
||||
kpit[itype] = value;
|
||||
buf = next + 1;
|
||||
}
|
||||
@ -763,7 +763,7 @@ void FixPiTorsion::read_data_section(char *keyword, int n, char *buf,
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
bigint FixPiTorsion::read_data_skip_lines(char *keyword)
|
||||
bigint FixAmoebaPiTorsion::read_data_skip_lines(char *keyword)
|
||||
{
|
||||
if (strcmp(keyword,"PiTorsions") == 0) return npitorsions;
|
||||
if (strcmp(keyword,"PiTorsion Coeffs") == 0) return (bigint) npitorsion_types;
|
||||
@ -775,7 +775,7 @@ bigint FixPiTorsion::read_data_skip_lines(char *keyword)
|
||||
only called by proc 0
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::write_data_header(FILE *fp, int mth)
|
||||
void FixAmoebaPiTorsion::write_data_header(FILE *fp, int mth)
|
||||
{
|
||||
if (mth == 0) fprintf(fp,BIGINT_FORMAT " pitorsions\n",npitorsions);
|
||||
else if (mth == 1)
|
||||
@ -787,7 +787,7 @@ void FixPiTorsion::write_data_header(FILE *fp, int mth)
|
||||
# of data sections = 2 for this fix
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::write_data_section_size(int mth, int &nx, int &ny)
|
||||
void FixAmoebaPiTorsion::write_data_section_size(int mth, int &nx, int &ny)
|
||||
{
|
||||
int i,m;
|
||||
|
||||
@ -824,7 +824,7 @@ void FixPiTorsion::write_data_section_size(int mth, int &nx, int &ny)
|
||||
buf allocated by caller as owned PiTorsions by 7
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::write_data_section_pack(int mth, double **buf)
|
||||
void FixAmoebaPiTorsion::write_data_section_pack(int mth, double **buf)
|
||||
{
|
||||
int i,m;
|
||||
|
||||
@ -875,7 +875,7 @@ void FixPiTorsion::write_data_section_pack(int mth, double **buf)
|
||||
only called by proc 0
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::write_data_section_keyword(int mth, FILE *fp)
|
||||
void FixAmoebaPiTorsion::write_data_section_keyword(int mth, FILE *fp)
|
||||
{
|
||||
if (mth == 0) fprintf(fp,"\nPiTorsions\n\n");
|
||||
else if (mth == 1) fprintf(fp,"\nPiTorsion Coeffs\n\n");
|
||||
@ -888,7 +888,7 @@ void FixPiTorsion::write_data_section_keyword(int mth, FILE *fp)
|
||||
only called by proc 0
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::write_data_section(int mth, FILE *fp,
|
||||
void FixAmoebaPiTorsion::write_data_section(int mth, FILE *fp,
|
||||
int n, double **buf, int index)
|
||||
{
|
||||
// PiTorsions section
|
||||
@ -921,7 +921,7 @@ void FixPiTorsion::write_data_section(int mth, FILE *fp,
|
||||
pack entire state of Fix into one write
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::write_restart(FILE *fp)
|
||||
void FixAmoebaPiTorsion::write_restart(FILE *fp)
|
||||
{
|
||||
if (comm->me == 0) {
|
||||
int size = sizeof(bigint);
|
||||
@ -934,7 +934,7 @@ void FixPiTorsion::write_restart(FILE *fp)
|
||||
use state info from restart file to restart the Fix
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::restart(char *buf)
|
||||
void FixAmoebaPiTorsion::restart(char *buf)
|
||||
{
|
||||
npitorsions = *((bigint *) buf);
|
||||
}
|
||||
@ -943,7 +943,7 @@ void FixPiTorsion::restart(char *buf)
|
||||
pack values in local atom-based arrays for restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixPiTorsion::pack_restart(int i, double *buf)
|
||||
int FixAmoebaPiTorsion::pack_restart(int i, double *buf)
|
||||
{
|
||||
int n = 1;
|
||||
for (int m = 0; m < num_pitorsion[i]; m++) {
|
||||
@ -964,7 +964,7 @@ int FixPiTorsion::pack_restart(int i, double *buf)
|
||||
unpack values from atom->extra array to restart the fix
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::unpack_restart(int nlocal, int nth)
|
||||
void FixAmoebaPiTorsion::unpack_restart(int nlocal, int nth)
|
||||
{
|
||||
double **extra = atom->extra;
|
||||
|
||||
@ -992,7 +992,7 @@ void FixPiTorsion::unpack_restart(int nlocal, int nth)
|
||||
maxsize of any atom's restart data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixPiTorsion::maxsize_restart()
|
||||
int FixAmoebaPiTorsion::maxsize_restart()
|
||||
{
|
||||
return 1 + PITORSIONMAX*6;
|
||||
}
|
||||
@ -1001,7 +1001,7 @@ int FixPiTorsion::maxsize_restart()
|
||||
size of atom nlocal's restart data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixPiTorsion::size_restart(int nlocal)
|
||||
int FixAmoebaPiTorsion::size_restart(int nlocal)
|
||||
{
|
||||
return 1 + num_pitorsion[nlocal]*7;
|
||||
}
|
||||
@ -1010,7 +1010,7 @@ int FixPiTorsion::size_restart(int nlocal)
|
||||
allocate atom-based arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::grow_arrays(int nmax)
|
||||
void FixAmoebaPiTorsion::grow_arrays(int nmax)
|
||||
{
|
||||
num_pitorsion = memory->grow(num_pitorsion,nmax,"pitorsion:num_pitorsion");
|
||||
pitorsion_type = memory->grow(pitorsion_type,nmax,PITORSIONMAX,
|
||||
@ -1039,7 +1039,7 @@ void FixPiTorsion::grow_arrays(int nmax)
|
||||
copy values within local atom-based array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::copy_arrays(int i, int j, int /*delflag*/)
|
||||
void FixAmoebaPiTorsion::copy_arrays(int i, int j, int /*delflag*/)
|
||||
{
|
||||
num_pitorsion[j] = num_pitorsion[i];
|
||||
|
||||
@ -1058,7 +1058,7 @@ void FixPiTorsion::copy_arrays(int i, int j, int /*delflag*/)
|
||||
initialize one atom's array values, called when atom is created
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPiTorsion::set_arrays(int i)
|
||||
void FixAmoebaPiTorsion::set_arrays(int i)
|
||||
{
|
||||
num_pitorsion[i] = 0;
|
||||
}
|
||||
@ -1067,7 +1067,7 @@ void FixPiTorsion::set_arrays(int i)
|
||||
pack values in local atom-based array for exchange with another proc
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixPiTorsion::pack_exchange(int i, double *buf)
|
||||
int FixAmoebaPiTorsion::pack_exchange(int i, double *buf)
|
||||
{
|
||||
int n = 0;
|
||||
buf[n++] = ubuf(num_pitorsion[i]).d;
|
||||
@ -1087,7 +1087,7 @@ int FixPiTorsion::pack_exchange(int i, double *buf)
|
||||
unpack values in local atom-based array from exchange with another proc
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixPiTorsion::unpack_exchange(int nlocal, double *buf)
|
||||
int FixAmoebaPiTorsion::unpack_exchange(int nlocal, double *buf)
|
||||
{
|
||||
int n = 0;
|
||||
num_pitorsion[nlocal] = (int) ubuf(buf[n++]).i;
|
||||
@ -1107,7 +1107,7 @@ int FixPiTorsion::unpack_exchange(int nlocal, double *buf)
|
||||
memory usage of local atom-based arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double FixPiTorsion::memory_usage()
|
||||
double FixAmoebaPiTorsion::memory_usage()
|
||||
{
|
||||
int nmax = atom->nmax;
|
||||
double bytes = (double)nmax * sizeof(int); // num_pitorsion
|
||||
@ -13,20 +13,20 @@
|
||||
|
||||
#ifdef FIX_CLASS
|
||||
// clang-format off
|
||||
FixStyle(pitorsion,FixPiTorsion);
|
||||
FixStyle(amoeba/pitorsion,FixAmoebaPiTorsion);
|
||||
// clang-format on
|
||||
#else
|
||||
|
||||
#ifndef LMP_FIX_PITORSION_H
|
||||
#define LMP_FIX_PITORSION_H
|
||||
#ifndef LMP_FIX_AMOEBA_PITORSION_H
|
||||
#define LMP_FIX_AMOEBA_PITORSION_H
|
||||
|
||||
#include "fix.h"
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class FixPiTorsion : public Fix {
|
||||
class FixAmoebaPiTorsion : public Fix {
|
||||
public:
|
||||
FixPiTorsion(class LAMMPS *, int, char **);
|
||||
~FixPiTorsion();
|
||||
FixAmoebaPiTorsion(class LAMMPS *, int, char **);
|
||||
~FixAmoebaPiTorsion();
|
||||
int setmask();
|
||||
void init();
|
||||
void setup(int);
|
||||
@ -810,7 +810,8 @@ Fix *Modify::add_fix(int narg, char **arg, int trysuffix)
|
||||
|
||||
const char *exceptions[] =
|
||||
{"GPU", "OMP", "INTEL", "property/atom", "cmap", "cmap3", "rx",
|
||||
"deprecated", "STORE/KIM", "pitorsion", "bitorsion", nullptr};
|
||||
"deprecated", "STORE/KIM", "amoeba/pitorsion", "amoeba/bitorsion",
|
||||
nullptr};
|
||||
|
||||
if (domain->box_exist == 0) {
|
||||
int m;
|
||||
|
||||
Reference in New Issue
Block a user