Merge remote-tracking branch 'lammps-ro/master' into lammps-icms
Resolved Conflicts: doc/Manual.txt src/USER-MISC/dihedral_nharmonic.cpp src/USER-MISC/pair_lj_sf_dipole_sf.h
This commit is contained in:
@ -59,7 +59,7 @@ void DihedralNHarmonic::compute(int eflag, int vflag)
|
||||
double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,vb2xm,vb2ym,vb2zm;
|
||||
double edihedral,f1[3],f2[3],f3[3],f4[3];
|
||||
double sb1,sb2,sb3,rb1,rb3,c0,b1mag2,b1mag,b2mag2;
|
||||
double b2mag,b3mag2,b3mag,ctmp,r12c1,c1mag,r12c2;
|
||||
double b2mag,b3mag2,b3mag,ctmp,c_,r12c1,c1mag,r12c2;
|
||||
double c2mag,sc1,sc2,s1,s12,c,p,pd,a11,a22;
|
||||
double a33,a12,a13,a23,sx2,sy2,sz2;
|
||||
double s2,sin2;
|
||||
@ -177,14 +177,15 @@ void DihedralNHarmonic::compute(int eflag, int vflag)
|
||||
// force & energy
|
||||
// p = sum (i=1,n) a_i * c**(i-1)
|
||||
// pd = dp/dc
|
||||
p = a[type][0];
|
||||
pd = a[type][1];
|
||||
c_ = c;
|
||||
p = this->a[type][0];
|
||||
pd = this->a[type][1];
|
||||
for (int i = 1; i < nterms[type]-1; i++) {
|
||||
p += c * a[type][i];
|
||||
pd += c * static_cast<double>(i+1) * a[type][i+1];
|
||||
c *= c;
|
||||
p += c_ * this->a[type][i];
|
||||
pd += c_ * static_cast<double>(i+1) * this->a[type][i+1];
|
||||
c_ *= c;
|
||||
}
|
||||
p += c * a[type][nterms[type]-1];
|
||||
p += c_ * this->a[type][nterms[type]-1];
|
||||
|
||||
if (eflag) edihedral = p;
|
||||
|
||||
@ -284,7 +285,7 @@ void DihedralNHarmonic::coeff(int narg, char **arg)
|
||||
a[i] = new double [n];
|
||||
nterms[i] = n;
|
||||
for (int j = 0; j < n; j++ ) {
|
||||
a[i][j] = force->numeric(FLERR,arg[2+i]);
|
||||
a[i][j] = force->numeric(FLERR,arg[2+j]);
|
||||
setflag[i] = 1;
|
||||
}
|
||||
count++;
|
||||
|
||||
@ -1,54 +1,54 @@
|
||||
/* -*- c++ -*------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
|
||||
PairStyle(lj/sf/dipole/sf,PairLJSFDipoleSF)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_PAIR_LJ_SF_DIPOLE_SF_H
|
||||
#define LMP_PAIR_LJ_SF_DIPOLE_SF_H
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairLJSFDipoleSF : public Pair {
|
||||
public:
|
||||
PairLJSFDipoleSF(class LAMMPS *);
|
||||
virtual ~PairLJSFDipoleSF();
|
||||
virtual void compute(int, int);
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
void init_style();
|
||||
double init_one(int, int);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
|
||||
protected:
|
||||
double cut_lj_global,cut_coul_global;
|
||||
double **cut_lj,**cut_ljsq;
|
||||
double **cut_coul,**cut_coulsq;
|
||||
double **epsilon,**sigma;
|
||||
double **lj1,**lj2,**lj3,**lj4;
|
||||
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
|
||||
PairStyle(lj/sf/dipole/sf,PairLJSFDipoleSF)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_PAIR_LJ_SF_DIPOLE_SF_H
|
||||
#define LMP_PAIR_LJ_SF_DIPOLE_SF_H
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairLJSFDipoleSF : public Pair {
|
||||
public:
|
||||
PairLJSFDipoleSF(class LAMMPS *);
|
||||
virtual ~PairLJSFDipoleSF();
|
||||
virtual void compute(int, int);
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
void init_style();
|
||||
double init_one(int, int);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
|
||||
protected:
|
||||
double cut_lj_global,cut_coul_global;
|
||||
double **cut_lj,**cut_ljsq;
|
||||
double **cut_coul,**cut_coulsq;
|
||||
double **epsilon,**sigma;
|
||||
double **lj1,**lj2,**lj3,**lj4;
|
||||
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user