forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10289 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
fd39535f88
commit
2584cbe902
|
@ -52,6 +52,7 @@ PairLJCharmmCoulLong::PairLJCharmmCoulLong(LAMMPS *lmp) : Pair(lmp)
|
|||
ftable = NULL;
|
||||
implicit = 0;
|
||||
mix_flag = ARITHMETIC;
|
||||
writedata = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
@ -920,6 +921,30 @@ void PairLJCharmmCoulLong::read_restart_settings(FILE *fp)
|
|||
MPI_Bcast(&tabinner,1,MPI_DOUBLE,0,world);
|
||||
}
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairLJCharmmCoulLong::write_data(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
fprintf(fp,"%d %g %g %g %g\n",
|
||||
i,epsilon[i][i],sigma[i][i],eps14[i][i],sigma14[i][i]);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes all pairs to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairLJCharmmCoulLong::write_data_all(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
for (int j = i; j <= atom->ntypes; j++)
|
||||
fprintf(fp,"%d %d %g %g %g %g %g\n",i,j,
|
||||
epsilon[i][j],sigma[i][j],eps14[i][j],sigma14[i][j]);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
double PairLJCharmmCoulLong::single(int i, int j, int itype, int jtype,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
/* -*- c++ -*- ----------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
@ -39,6 +39,8 @@ class PairLJCharmmCoulLong : public Pair {
|
|||
void read_restart(FILE *);
|
||||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
void write_data(FILE *);
|
||||
void write_data_all(FILE *);
|
||||
virtual double single(int, int, int, int, double, double, double, double &);
|
||||
|
||||
void compute_inner();
|
||||
|
|
|
@ -41,6 +41,7 @@ using namespace MathConst;
|
|||
DihedralCharmm::DihedralCharmm(LAMMPS *lmp) : Dihedral(lmp)
|
||||
{
|
||||
weightflag = 0;
|
||||
writedata = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
@ -394,6 +395,7 @@ void DihedralCharmm::write_restart(FILE *fp)
|
|||
fwrite(&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp);
|
||||
fwrite(&shift[1],sizeof(int),atom->ndihedraltypes,fp);
|
||||
fwrite(&weight[1],sizeof(double),atom->ndihedraltypes,fp);
|
||||
fwrite(&weightflag,sizeof(int),1,fp);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
@ -409,11 +411,13 @@ void DihedralCharmm::read_restart(FILE *fp)
|
|||
fread(&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp);
|
||||
fread(&shift[1],sizeof(int),atom->ndihedraltypes,fp);
|
||||
fread(&weight[1],sizeof(double),atom->ndihedraltypes,fp);
|
||||
fread(&weightflag,sizeof(int),1,fp);
|
||||
}
|
||||
MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&multiplicity[1],atom->ndihedraltypes,MPI_INT,0,world);
|
||||
MPI_Bcast(&shift[1],atom->ndihedraltypes,MPI_INT,0,world);
|
||||
MPI_Bcast(&weight[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&weightflag,1,MPI_INT,0,world);
|
||||
|
||||
for (int i = 1; i <= atom->ndihedraltypes; i++) {
|
||||
setflag[i] = 1;
|
||||
|
@ -421,3 +425,14 @@ void DihedralCharmm::read_restart(FILE *fp)
|
|||
sin_shift[i] = sin(MY_PI*shift[i]/180.0);
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void DihedralCharmm::write_data(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ndihedraltypes; i++)
|
||||
fprintf(fp,"%d %g %d %d %g\n",i,k[i],multiplicity[i],shift[i],weight[i]);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
/* -*- c++ -*- ----------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
@ -34,6 +34,7 @@ class DihedralCharmm : public Dihedral {
|
|||
void init_style();
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_data(FILE *);
|
||||
|
||||
protected:
|
||||
double *k,*weight,*cos_shift,*sin_shift;
|
||||
|
|
|
@ -36,6 +36,7 @@ PairLJCharmmCoulCharmm::PairLJCharmmCoulCharmm(LAMMPS *lmp) : Pair(lmp)
|
|||
{
|
||||
implicit = 0;
|
||||
mix_flag = ARITHMETIC;
|
||||
writedata = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
@ -104,6 +105,7 @@ void PairLJCharmmCoulCharmm::compute(int eflag, int vflag)
|
|||
|
||||
for (jj = 0; jj < jnum; jj++) {
|
||||
j = jlist[jj];
|
||||
jtype = type[j];
|
||||
factor_lj = special_lj[sbmask(j)];
|
||||
factor_coul = special_coul[sbmask(j)];
|
||||
j &= NEIGHMASK;
|
||||
|
@ -129,7 +131,6 @@ void PairLJCharmmCoulCharmm::compute(int eflag, int vflag)
|
|||
|
||||
if (rsq < cut_ljsq) {
|
||||
r6inv = r2inv*r2inv*r2inv;
|
||||
jtype = type[j];
|
||||
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
|
||||
if (rsq > cut_lj_innersq) {
|
||||
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
|
||||
|
@ -392,6 +393,29 @@ void PairLJCharmmCoulCharmm::read_restart(FILE *fp)
|
|||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairLJCharmmCoulCharmm::write_data(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
fprintf(fp,"%d %g %g %g %g\n",
|
||||
i,epsilon[i][i],sigma[i][i],eps14[i][i],sigma14[i][i]);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes all pairs to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairLJCharmmCoulCharmm::write_data_all(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
for (int j = i; j <= atom->ntypes; j++)
|
||||
fprintf(fp,"%d %d %g %g %g %g\n",i,j,
|
||||
epsilon[i][j],sigma[i][j],eps14[i][j],sigma14[i][j]);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
/* -*- c++ -*- ----------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
@ -37,6 +37,8 @@ class PairLJCharmmCoulCharmm : public Pair {
|
|||
void read_restart(FILE *);
|
||||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
void write_data(FILE *);
|
||||
void write_data_all(FILE *);
|
||||
virtual double single(int, int, int, int, double, double, double, double &);
|
||||
virtual void *extract(const char *, int &);
|
||||
|
||||
|
|
Loading…
Reference in New Issue