git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6651 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
|
||||
#include "math.h"
|
||||
#include "stdlib.h"
|
||||
#include "angle_cosineshift.h"
|
||||
#include "angle_cosine_shift.h"
|
||||
#include "atom.h"
|
||||
#include "neighbor.h"
|
||||
#include "domain.h"
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
#include "math.h"
|
||||
#include "stdlib.h"
|
||||
#include "angle_cosineshiftexp.h"
|
||||
#include "angle_cosine_shift_exp.h"
|
||||
#include "atom.h"
|
||||
#include "neighbor.h"
|
||||
#include "domain.h"
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
#include "mpi.h"
|
||||
#include "math.h"
|
||||
#include "stdlib.h"
|
||||
#include "dihedral_cosineshiftexp.h"
|
||||
#include "dihedral_cosine_shift_exp.h"
|
||||
#include "atom.h"
|
||||
#include "comm.h"
|
||||
#include "neighbor.h"
|
||||
@ -36,11 +36,11 @@ using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
DihedralCosShiftExp::DihedralCosShiftExp(LAMMPS *lmp) : Dihedral(lmp) {}
|
||||
DihedralCosineShiftExp::DihedralCosineShiftExp(LAMMPS *lmp) : Dihedral(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
DihedralCosShiftExp::~DihedralCosShiftExp()
|
||||
DihedralCosineShiftExp::~DihedralCosineShiftExp()
|
||||
{
|
||||
if (allocated) {
|
||||
memory->destroy(setflag);
|
||||
@ -56,7 +56,7 @@ DihedralCosShiftExp::~DihedralCosShiftExp()
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void DihedralCosShiftExp::compute(int eflag, int vflag)
|
||||
void DihedralCosineShiftExp::compute(int eflag, int vflag)
|
||||
{
|
||||
int i1,i2,i3,i4,i,m,n,type;
|
||||
double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,vb2xm,vb2ym,vb2zm;
|
||||
@ -250,7 +250,7 @@ void DihedralCosShiftExp::compute(int eflag, int vflag)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void DihedralCosShiftExp::allocate()
|
||||
void DihedralCosineShiftExp::allocate()
|
||||
{
|
||||
allocated = 1;
|
||||
int n = atom->ndihedraltypes;
|
||||
@ -271,7 +271,7 @@ void DihedralCosShiftExp::allocate()
|
||||
set coeffs for one type
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void DihedralCosShiftExp::coeff(int narg, char **arg)
|
||||
void DihedralCosineShiftExp::coeff(int narg, char **arg)
|
||||
{
|
||||
if (narg != 4) error->all("Incorrect args for dihedral coefficients");
|
||||
if (!allocated) allocate();
|
||||
@ -305,7 +305,7 @@ void DihedralCosShiftExp::coeff(int narg, char **arg)
|
||||
proc 0 writes out coeffs to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void DihedralCosShiftExp::write_restart(FILE *fp)
|
||||
void DihedralCosineShiftExp::write_restart(FILE *fp)
|
||||
{
|
||||
fwrite(&umin[1],sizeof(double),atom->ndihedraltypes,fp);
|
||||
fwrite(&a[1],sizeof(double),atom->ndihedraltypes,fp);
|
||||
@ -318,7 +318,7 @@ void DihedralCosShiftExp::write_restart(FILE *fp)
|
||||
proc 0 reads coeffs from restart file, bcasts them
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void DihedralCosShiftExp::read_restart(FILE *fp)
|
||||
void DihedralCosineShiftExp::read_restart(FILE *fp)
|
||||
{
|
||||
allocate();
|
||||
|
||||
|
||||
@ -11,45 +11,24 @@
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
The torsion angle is defined such that a straight bond has costheta=180.
|
||||
|
||||
U(theta,theta0,umin,a) = -Umin[Exp(-a U)-1]/[[Exp(a)-1]]
|
||||
with U = (-1-cos[theta-theta0])/2 = -Cos((theta-theta0)/2)^2
|
||||
|
||||
potential has minimum at theta=theta0 where U() = -Umin
|
||||
potential has maximum at theta=theta0+180 where U() = 0
|
||||
|
||||
The spring constant around the minimum is controlled by a and
|
||||
is given by k = a exp(a) Umin/[ 2(Exp[a]-1) ] for a=0
|
||||
the spring constant is k=Umin/2 and the potential reduces to
|
||||
the cosineshifted potential.
|
||||
|
||||
The potential is implemented such that for a<0.001 a series
|
||||
expansion to linear order is used instead of the expression
|
||||
above. This ensures a precision of about 1e-5 or better for
|
||||
energies and forces, and ensures the potential is well
|
||||
behaved for a=0
|
||||
*/
|
||||
|
||||
#ifdef DIHEDRAL_CLASS
|
||||
|
||||
DihedralStyle(cosineshiftexp,DihedralCosShiftExp)
|
||||
DihedralStyle(cosine/shift/exp,DihedralCosShiftExp)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_DIHEDRAL_COSINESHIFTEDEXP_H
|
||||
#define LMP_DIHEDRAL_COSINESHIFTEDEXP_H
|
||||
#ifndef LMP_DIHEDRAL_COSINE_SHIFT_EXP_H
|
||||
#define LMP_DIHEDRAL_COSINE_SHIFT_EXP_H
|
||||
|
||||
#include "stdio.h"
|
||||
#include "dihedral.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class DihedralCosShiftExp : public Dihedral {
|
||||
class DihedralCosineShiftExp : public Dihedral {
|
||||
public:
|
||||
DihedralCosShiftExp(class LAMMPS *);
|
||||
~DihedralCosShiftExp();
|
||||
DihedralCosineShiftExp(class LAMMPS *);
|
||||
~DihedralCosineShiftExp();
|
||||
void compute(int, int);
|
||||
void coeff(int, char **);
|
||||
void write_restart(FILE *);
|
||||
|
||||
Reference in New Issue
Block a user