add write_data() support to 4 more dihedral styles, which completes the set
This commit is contained in:
@ -332,3 +332,13 @@ void DihedralHelix::read_restart(FILE *fp)
|
||||
|
||||
for (int i = 1; i <= atom->ndihedraltypes; i++) setflag[i] = 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void DihedralHelix::write_data(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ndihedraltypes; i++)
|
||||
fprintf(fp,"%d %g %g %g\n",i,aphi[i],bphi[i],cphi[i]);
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ class DihedralHelix : public Dihedral {
|
||||
void coeff(int, char **);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_data(FILE *);
|
||||
|
||||
protected:
|
||||
double *aphi,*bphi,*cphi;
|
||||
|
||||
@ -331,3 +331,13 @@ void DihedralMultiHarmonic::read_restart(FILE *fp)
|
||||
|
||||
for (int i = 1; i <= atom->ndihedraltypes; i++) setflag[i] = 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void DihedralMultiHarmonic::write_data(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ndihedraltypes; i++)
|
||||
fprintf(fp,"%d %g %g %g %g %g\n",i,a1[i],a2[i],a3[i],a4[i],a5[i]);
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ class DihedralMultiHarmonic : public Dihedral {
|
||||
void coeff(int, char **);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_data(FILE *);
|
||||
|
||||
protected:
|
||||
double *a1,*a2,*a3,*a4,*a5;
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
#include "force.h"
|
||||
#include "update.h"
|
||||
#include "memory.h"
|
||||
#include "math_const.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
@ -285,9 +286,9 @@ void DihedralCosineShiftExp::coeff(int narg, char **arg)
|
||||
doExpansion[i]=(fabs(a_)<0.001);
|
||||
umin[i] = umin_;
|
||||
a[i] = a_;
|
||||
cost[i] = cos(theta0_*3.14159265/180);
|
||||
sint[i] = sin(theta0_*3.14159265/180);
|
||||
theta[i] = theta0_*3.14159265/180;
|
||||
cost[i] = cos(theta0_*MathConst::MY_PI/180.0);
|
||||
sint[i] = sin(theta0_*MathConst::MY_PI/180.0);
|
||||
theta[i] = theta0_*MathConst::MY_PI/180.0;
|
||||
|
||||
if (!doExpansion[i]) opt1[i]=umin_/(exp(a_)-1);
|
||||
|
||||
@ -338,3 +339,14 @@ void DihedralCosineShiftExp::read_restart(FILE *fp)
|
||||
if (!doExpansion[i]) opt1[i]=umin[i]/(exp(a[i])-1);
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void DihedralCosineShiftExp::write_data(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ndihedraltypes; i++)
|
||||
fprintf(fp,"%d %g %g %g\n",i,umin[i],
|
||||
theta[i]*180.0/MathConst::MY_PI,a[i]);
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ class DihedralCosineShiftExp : public Dihedral {
|
||||
void coeff(int, char **);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_data(FILE *);
|
||||
|
||||
protected:
|
||||
bool *doExpansion;
|
||||
|
||||
@ -333,3 +333,12 @@ void DihedralQuadratic::read_restart(FILE *fp)
|
||||
for (int i = 1; i <= atom->ndihedraltypes; i++) setflag[i] = 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void DihedralQuadratic::write_data(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ndihedraltypes; i++)
|
||||
fprintf(fp,"%d %g %g \n",i,k[i],phi0[i]*180.0/MY_PI);
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ class DihedralQuadratic : public Dihedral {
|
||||
void coeff(int, char **);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_data(FILE *);
|
||||
|
||||
protected:
|
||||
double *k,*phi0;
|
||||
|
||||
Reference in New Issue
Block a user