git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5250 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -16,6 +16,7 @@
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
|
#include "string.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "angle_class2.h"
|
#include "angle_class2.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
@ -259,15 +260,14 @@ void AngleClass2::allocate()
|
|||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
set coeffs for one or more types
|
set coeffs for one or more types
|
||||||
which = 0 -> Angle coeffs
|
arg1 = "bb" -> BondBond coeffs
|
||||||
which = 1 -> BondBond coeffs
|
arg1 = "ba" -> BondAngle coeffs
|
||||||
which = 2 -> BondAngle coeffs
|
else -> Angle coeffs
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void AngleClass2::coeff(int which, int narg, char **arg)
|
void AngleClass2::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which < 0 || which > 2)
|
if (narg < 2) error->all("Incorrect args for angle coefficients");
|
||||||
error->all("Invalid coeffs for this angle style");
|
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
int ilo,ihi;
|
int ilo,ihi;
|
||||||
@ -275,7 +275,39 @@ void AngleClass2::coeff(int which, int narg, char **arg)
|
|||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (which == 0) {
|
if (strcmp(arg[1],"bb") == 0) {
|
||||||
|
if (narg != 5) error->all("Incorrect args for angle coefficients");
|
||||||
|
|
||||||
|
double bb_k_one = force->numeric(arg[2]);
|
||||||
|
double bb_r1_one = force->numeric(arg[3]);
|
||||||
|
double bb_r2_one = force->numeric(arg[4]);
|
||||||
|
|
||||||
|
for (int i = ilo; i <= ihi; i++) {
|
||||||
|
bb_k[i] = bb_k_one;
|
||||||
|
bb_r1[i] = bb_r1_one;
|
||||||
|
bb_r2[i] = bb_r2_one;
|
||||||
|
setflag_bb[i] = 1;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (strcmp(arg[1],"ba") == 0) {
|
||||||
|
if (narg != 6) error->all("Incorrect args for angle coefficients");
|
||||||
|
|
||||||
|
double ba_k1_one = force->numeric(arg[2]);
|
||||||
|
double ba_k2_one = force->numeric(arg[3]);
|
||||||
|
double ba_r1_one = force->numeric(arg[4]);
|
||||||
|
double ba_r2_one = force->numeric(arg[5]);
|
||||||
|
|
||||||
|
for (int i = ilo; i <= ihi; i++) {
|
||||||
|
ba_k1[i] = ba_k1_one;
|
||||||
|
ba_k2[i] = ba_k2_one;
|
||||||
|
ba_r1[i] = ba_r1_one;
|
||||||
|
ba_r2[i] = ba_r2_one;
|
||||||
|
setflag_ba[i] = 1;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
if (narg != 5) error->all("Incorrect args for angle coefficients");
|
if (narg != 5) error->all("Incorrect args for angle coefficients");
|
||||||
|
|
||||||
double theta0_one = force->numeric(arg[1]);
|
double theta0_one = force->numeric(arg[1]);
|
||||||
@ -295,40 +327,6 @@ void AngleClass2::coeff(int which, int narg, char **arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (which == 1) {
|
|
||||||
if (narg != 4) error->all("Incorrect args for angle coefficients");
|
|
||||||
|
|
||||||
double bb_k_one = force->numeric(arg[1]);
|
|
||||||
double bb_r1_one = force->numeric(arg[2]);
|
|
||||||
double bb_r2_one = force->numeric(arg[3]);
|
|
||||||
|
|
||||||
for (int i = ilo; i <= ihi; i++) {
|
|
||||||
bb_k[i] = bb_k_one;
|
|
||||||
bb_r1[i] = bb_r1_one;
|
|
||||||
bb_r2[i] = bb_r2_one;
|
|
||||||
setflag_bb[i] = 1;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (which == 2) {
|
|
||||||
if (narg != 5) error->all("Incorrect args for angle coefficients");
|
|
||||||
|
|
||||||
double ba_k1_one = force->numeric(arg[1]);
|
|
||||||
double ba_k2_one = force->numeric(arg[2]);
|
|
||||||
double ba_r1_one = force->numeric(arg[3]);
|
|
||||||
double ba_r2_one = force->numeric(arg[4]);
|
|
||||||
|
|
||||||
for (int i = ilo; i <= ihi; i++) {
|
|
||||||
ba_k1[i] = ba_k1_one;
|
|
||||||
ba_k2[i] = ba_k2_one;
|
|
||||||
ba_r1[i] = ba_r1_one;
|
|
||||||
ba_r2[i] = ba_r2_one;
|
|
||||||
setflag_ba[i] = 1;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count == 0) error->all("Incorrect args for angle coefficients");
|
if (count == 0) error->all("Incorrect args for angle coefficients");
|
||||||
|
|
||||||
for (int i = ilo; i <= ihi; i++)
|
for (int i = ilo; i <= ihi; i++)
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class AngleClass2 : public Angle {
|
|||||||
AngleClass2(class LAMMPS *);
|
AngleClass2(class LAMMPS *);
|
||||||
~AngleClass2();
|
~AngleClass2();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
double equilibrium_angle(int);
|
double equilibrium_angle(int);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
|
#include "string.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "dihedral_class2.h"
|
#include "dihedral_class2.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
@ -644,18 +645,17 @@ void DihedralClass2::allocate()
|
|||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
set coeffs for one or more types
|
set coeffs for one or more types
|
||||||
which = 0 -> Dihedral coeffs
|
arg1 = "mbt" -> MiddleBondTorsion coeffs
|
||||||
which = 1 -> MiddleBondTorsion coeffs
|
arg1 = "ebt" -> EndBondTorsion coeffs
|
||||||
which = 2 -> EndBondTorsion coeffs
|
arg1 = "at" -> AngleTorsion coeffs
|
||||||
which = 3 -> AngleTorsion coeffs
|
arg1 = "aat" -> AngleAngleTorsion coeffs
|
||||||
which = 4 -> AngleAngleTorsion coeffs
|
arg1 = "bb13" -> BondBond13Torsion coeffs
|
||||||
which = 5 -> BondBond13Torsion coeffs
|
arg1 -> Dihedral coeffs
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DihedralClass2::coeff(int which, int narg, char **arg)
|
void DihedralClass2::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which < 0 || which > 5)
|
if (narg < 2) error->all("Invalid coeffs for this dihedral style");
|
||||||
error->all("Invalid coeffs for this dihedral style");
|
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
int ilo,ihi;
|
int ilo,ihi;
|
||||||
@ -663,7 +663,108 @@ void DihedralClass2::coeff(int which, int narg, char **arg)
|
|||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (which == 0) {
|
if (strcmp(arg[1],"mbt") == 0) {
|
||||||
|
if (narg != 6) error->all("Incorrect args for dihedral coefficients");
|
||||||
|
|
||||||
|
double f1_one = force->numeric(arg[2]);
|
||||||
|
double f2_one = force->numeric(arg[3]);
|
||||||
|
double f3_one = force->numeric(arg[4]);
|
||||||
|
double r0_one = force->numeric(arg[5]);
|
||||||
|
|
||||||
|
for (int i = ilo; i <= ihi; i++) {
|
||||||
|
mbt_f1[i] = f1_one;
|
||||||
|
mbt_f2[i] = f2_one;
|
||||||
|
mbt_f3[i] = f3_one;
|
||||||
|
mbt_r0[i] = r0_one;
|
||||||
|
setflag_mbt[i] = 1;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (strcmp(arg[1],"ebt") == 0) {
|
||||||
|
if (narg != 10) error->all("Incorrect args for dihedral coefficients");
|
||||||
|
|
||||||
|
double f1_1_one = force->numeric(arg[2]);
|
||||||
|
double f2_1_one = force->numeric(arg[3]);
|
||||||
|
double f3_1_one = force->numeric(arg[4]);
|
||||||
|
double f1_2_one = force->numeric(arg[5]);
|
||||||
|
double f2_2_one = force->numeric(arg[6]);
|
||||||
|
double f3_2_one = force->numeric(arg[7]);
|
||||||
|
double r0_1_one = force->numeric(arg[8]);
|
||||||
|
double r0_2_one = force->numeric(arg[9]);
|
||||||
|
|
||||||
|
for (int i = ilo; i <= ihi; i++) {
|
||||||
|
ebt_f1_1[i] = f1_1_one;
|
||||||
|
ebt_f2_1[i] = f2_1_one;
|
||||||
|
ebt_f3_1[i] = f3_1_one;
|
||||||
|
ebt_f1_2[i] = f1_2_one;
|
||||||
|
ebt_f2_2[i] = f2_2_one;
|
||||||
|
ebt_f3_2[i] = f3_2_one;
|
||||||
|
ebt_r0_1[i] = r0_1_one;
|
||||||
|
ebt_r0_2[i] = r0_2_one;
|
||||||
|
setflag_ebt[i] = 1;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (strcmp(arg[1],"at") == 0) {
|
||||||
|
if (narg != 10) error->all("Incorrect args for dihedral coefficients");
|
||||||
|
|
||||||
|
double f1_1_one = force->numeric(arg[2]);
|
||||||
|
double f2_1_one = force->numeric(arg[3]);
|
||||||
|
double f3_1_one = force->numeric(arg[4]);
|
||||||
|
double f1_2_one = force->numeric(arg[5]);
|
||||||
|
double f2_2_one = force->numeric(arg[6]);
|
||||||
|
double f3_2_one = force->numeric(arg[7]);
|
||||||
|
double theta0_1_one = force->numeric(arg[8]);
|
||||||
|
double theta0_2_one = force->numeric(arg[9]);
|
||||||
|
|
||||||
|
// convert theta0's from degrees to radians
|
||||||
|
|
||||||
|
for (int i = ilo; i <= ihi; i++) {
|
||||||
|
at_f1_1[i] = f1_1_one;
|
||||||
|
at_f2_1[i] = f2_1_one;
|
||||||
|
at_f3_1[i] = f3_1_one;
|
||||||
|
at_f1_2[i] = f1_2_one;
|
||||||
|
at_f2_2[i] = f2_2_one;
|
||||||
|
at_f3_2[i] = f3_2_one;
|
||||||
|
at_theta0_1[i] = theta0_1_one/180.0 * PI;
|
||||||
|
at_theta0_2[i] = theta0_2_one/180.0 * PI;
|
||||||
|
setflag_at[i] = 1;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (strcmp(arg[1],"aat") == 0) {
|
||||||
|
if (narg != 5) error->all("Incorrect args for dihedral coefficients");
|
||||||
|
|
||||||
|
double k_one = force->numeric(arg[2]);
|
||||||
|
double theta0_1_one = force->numeric(arg[3]);
|
||||||
|
double theta0_2_one = force->numeric(arg[4]);
|
||||||
|
|
||||||
|
// convert theta0's from degrees to radians
|
||||||
|
|
||||||
|
for (int i = ilo; i <= ihi; i++) {
|
||||||
|
aat_k[i] = k_one;
|
||||||
|
aat_theta0_1[i] = theta0_1_one/180.0 * PI;
|
||||||
|
aat_theta0_2[i] = theta0_2_one/180.0 * PI;
|
||||||
|
setflag_aat[i] = 1;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (strcmp(arg[1],"bb13") == 0) {
|
||||||
|
if (narg != 5) error->all("Incorrect args for dihedral coefficients");
|
||||||
|
|
||||||
|
double k_one = force->numeric(arg[2]);
|
||||||
|
double r10_one = force->numeric(arg[3]);
|
||||||
|
double r30_one = force->numeric(arg[4]);
|
||||||
|
|
||||||
|
for (int i = ilo; i <= ihi; i++) {
|
||||||
|
bb13t_k[i] = k_one;
|
||||||
|
bb13t_r10[i] = r10_one;
|
||||||
|
bb13t_r30[i] = r30_one;
|
||||||
|
setflag_bb13t[i] = 1;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
if (narg != 7) error->all("Incorrect args for dihedral coefficients");
|
if (narg != 7) error->all("Incorrect args for dihedral coefficients");
|
||||||
|
|
||||||
double k1_one = force->numeric(arg[1]);
|
double k1_one = force->numeric(arg[1]);
|
||||||
@ -687,112 +788,6 @@ void DihedralClass2::coeff(int which, int narg, char **arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (which == 1) {
|
|
||||||
if (narg != 5) error->all("Incorrect args for dihedral coefficients");
|
|
||||||
|
|
||||||
double f1_one = force->numeric(arg[1]);
|
|
||||||
double f2_one = force->numeric(arg[2]);
|
|
||||||
double f3_one = force->numeric(arg[3]);
|
|
||||||
double r0_one = force->numeric(arg[4]);
|
|
||||||
|
|
||||||
for (int i = ilo; i <= ihi; i++) {
|
|
||||||
mbt_f1[i] = f1_one;
|
|
||||||
mbt_f2[i] = f2_one;
|
|
||||||
mbt_f3[i] = f3_one;
|
|
||||||
mbt_r0[i] = r0_one;
|
|
||||||
setflag_mbt[i] = 1;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (which == 2) {
|
|
||||||
if (narg != 9) error->all("Incorrect args for dihedral coefficients");
|
|
||||||
|
|
||||||
double f1_1_one = force->numeric(arg[1]);
|
|
||||||
double f2_1_one = force->numeric(arg[2]);
|
|
||||||
double f3_1_one = force->numeric(arg[3]);
|
|
||||||
double f1_2_one = force->numeric(arg[4]);
|
|
||||||
double f2_2_one = force->numeric(arg[5]);
|
|
||||||
double f3_2_one = force->numeric(arg[6]);
|
|
||||||
double r0_1_one = force->numeric(arg[7]);
|
|
||||||
double r0_2_one = force->numeric(arg[8]);
|
|
||||||
|
|
||||||
for (int i = ilo; i <= ihi; i++) {
|
|
||||||
ebt_f1_1[i] = f1_1_one;
|
|
||||||
ebt_f2_1[i] = f2_1_one;
|
|
||||||
ebt_f3_1[i] = f3_1_one;
|
|
||||||
ebt_f1_2[i] = f1_2_one;
|
|
||||||
ebt_f2_2[i] = f2_2_one;
|
|
||||||
ebt_f3_2[i] = f3_2_one;
|
|
||||||
ebt_r0_1[i] = r0_1_one;
|
|
||||||
ebt_r0_2[i] = r0_2_one;
|
|
||||||
setflag_ebt[i] = 1;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (which == 3) {
|
|
||||||
if (narg != 9) error->all("Incorrect args for dihedral coefficients");
|
|
||||||
|
|
||||||
double f1_1_one = force->numeric(arg[1]);
|
|
||||||
double f2_1_one = force->numeric(arg[2]);
|
|
||||||
double f3_1_one = force->numeric(arg[3]);
|
|
||||||
double f1_2_one = force->numeric(arg[4]);
|
|
||||||
double f2_2_one = force->numeric(arg[5]);
|
|
||||||
double f3_2_one = force->numeric(arg[6]);
|
|
||||||
double theta0_1_one = force->numeric(arg[7]);
|
|
||||||
double theta0_2_one = force->numeric(arg[8]);
|
|
||||||
|
|
||||||
// convert theta0's from degrees to radians
|
|
||||||
|
|
||||||
for (int i = ilo; i <= ihi; i++) {
|
|
||||||
at_f1_1[i] = f1_1_one;
|
|
||||||
at_f2_1[i] = f2_1_one;
|
|
||||||
at_f3_1[i] = f3_1_one;
|
|
||||||
at_f1_2[i] = f1_2_one;
|
|
||||||
at_f2_2[i] = f2_2_one;
|
|
||||||
at_f3_2[i] = f3_2_one;
|
|
||||||
at_theta0_1[i] = theta0_1_one/180.0 * PI;
|
|
||||||
at_theta0_2[i] = theta0_2_one/180.0 * PI;
|
|
||||||
setflag_at[i] = 1;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (which == 4) {
|
|
||||||
if (narg != 4) error->all("Incorrect args for dihedral coefficients");
|
|
||||||
|
|
||||||
double k_one = force->numeric(arg[1]);
|
|
||||||
double theta0_1_one = force->numeric(arg[2]);
|
|
||||||
double theta0_2_one = force->numeric(arg[3]);
|
|
||||||
|
|
||||||
// convert theta0's from degrees to radians
|
|
||||||
|
|
||||||
for (int i = ilo; i <= ihi; i++) {
|
|
||||||
aat_k[i] = k_one;
|
|
||||||
aat_theta0_1[i] = theta0_1_one/180.0 * PI;
|
|
||||||
aat_theta0_2[i] = theta0_2_one/180.0 * PI;
|
|
||||||
setflag_aat[i] = 1;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (which == 5) {
|
|
||||||
if (narg != 4) error->all("Incorrect args for dihedral coefficients");
|
|
||||||
|
|
||||||
double k_one = force->numeric(arg[1]);
|
|
||||||
double r10_one = force->numeric(arg[2]);
|
|
||||||
double r30_one = force->numeric(arg[3]);
|
|
||||||
|
|
||||||
for (int i = ilo; i <= ihi; i++) {
|
|
||||||
bb13t_k[i] = k_one;
|
|
||||||
bb13t_r10[i] = r10_one;
|
|
||||||
bb13t_r30[i] = r30_one;
|
|
||||||
setflag_bb13t[i] = 1;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count == 0) error->all("Incorrect args for dihedral coefficients");
|
if (count == 0) error->all("Incorrect args for dihedral coefficients");
|
||||||
|
|
||||||
for (int i = ilo; i <= ihi; i++)
|
for (int i = ilo; i <= ihi; i++)
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class DihedralClass2 : public Dihedral {
|
|||||||
DihedralClass2(class LAMMPS *);
|
DihedralClass2(class LAMMPS *);
|
||||||
~DihedralClass2();
|
~DihedralClass2();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
|
#include "string.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "improper_class2.h"
|
#include "improper_class2.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
@ -522,14 +523,13 @@ void ImproperClass2::allocate()
|
|||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
set coeffs for one or more types
|
set coeffs for one or more types
|
||||||
which = 0 -> improper coeffs
|
arg1 = "aa" -> AngleAngle coeffs
|
||||||
which = 1 -> AngleAngle coeffs
|
else arg1 -> improper coeffs
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void ImproperClass2::coeff(int which, int narg, char **arg)
|
void ImproperClass2::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which < 0 || which > 1)
|
if (narg < 2) error->all("Incorrect args for improper coefficients");
|
||||||
error->all("Invalid coeffs for this improper style");
|
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
int ilo,ihi;
|
int ilo,ihi;
|
||||||
@ -537,31 +537,15 @@ void ImproperClass2::coeff(int which, int narg, char **arg)
|
|||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (which == 0) {
|
if (strcmp(arg[1],"aa") == 0) {
|
||||||
if (narg != 3) error->all("Incorrect args for improper coefficients");
|
if (narg != 8) error->all("Incorrect args for improper coefficients");
|
||||||
|
|
||||||
double k0_one = force->numeric(arg[1]);
|
double k1_one = force->numeric(arg[2]);
|
||||||
double chi0_one = force->numeric(arg[2]);
|
double k2_one = force->numeric(arg[3]);
|
||||||
|
double k3_one = force->numeric(arg[4]);
|
||||||
// convert chi0 from degrees to radians
|
double theta0_1_one = force->numeric(arg[5]);
|
||||||
|
double theta0_2_one = force->numeric(arg[6]);
|
||||||
for (int i = ilo; i <= ihi; i++) {
|
double theta0_3_one = force->numeric(arg[7]);
|
||||||
k0[i] = k0_one;
|
|
||||||
chi0[i] = chi0_one/180.0 * PI;
|
|
||||||
setflag_i[i] = 1;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (which == 1) {
|
|
||||||
if (narg != 7) error->all("Incorrect args for improper coefficients");
|
|
||||||
|
|
||||||
double k1_one = force->numeric(arg[1]);
|
|
||||||
double k2_one = force->numeric(arg[2]);
|
|
||||||
double k3_one = force->numeric(arg[3]);
|
|
||||||
double theta0_1_one = force->numeric(arg[4]);
|
|
||||||
double theta0_2_one = force->numeric(arg[5]);
|
|
||||||
double theta0_3_one = force->numeric(arg[6]);
|
|
||||||
|
|
||||||
// convert theta0's from degrees to radians
|
// convert theta0's from degrees to radians
|
||||||
|
|
||||||
@ -575,6 +559,21 @@ void ImproperClass2::coeff(int which, int narg, char **arg)
|
|||||||
setflag_aa[i] = 1;
|
setflag_aa[i] = 1;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (narg != 3) error->all("Incorrect args for improper coefficients");
|
||||||
|
|
||||||
|
double k0_one = force->numeric(arg[1]);
|
||||||
|
double chi0_one = force->numeric(arg[2]);
|
||||||
|
|
||||||
|
// convert chi0 from degrees to radians
|
||||||
|
|
||||||
|
for (int i = ilo; i <= ihi; i++) {
|
||||||
|
k0[i] = k0_one;
|
||||||
|
chi0[i] = chi0_one/180.0 * PI;
|
||||||
|
setflag_i[i] = 1;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 0) error->all("Incorrect args for improper coefficients");
|
if (count == 0) error->all("Incorrect args for improper coefficients");
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class ImproperClass2 : public Improper {
|
|||||||
ImproperClass2(class LAMMPS *);
|
ImproperClass2(class LAMMPS *);
|
||||||
~ImproperClass2();
|
~ImproperClass2();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|
||||||
|
|||||||
@ -191,9 +191,8 @@ void AngleCharmm::allocate()
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void AngleCharmm::coeff(int which, int narg, char **arg)
|
void AngleCharmm::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 5) error->all("Incorrect args for angle coefficients");
|
if (narg != 5) error->all("Incorrect args for angle coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class AngleCharmm : public Angle {
|
|||||||
AngleCharmm(class LAMMPS *);
|
AngleCharmm(class LAMMPS *);
|
||||||
~AngleCharmm();
|
~AngleCharmm();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
double equilibrium_angle(int);
|
double equilibrium_angle(int);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|||||||
@ -150,9 +150,8 @@ void AngleCosine::allocate()
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void AngleCosine::coeff(int which, int narg, char **arg)
|
void AngleCosine::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 2) error->all("Incorrect args for angle coefficients");
|
if (narg != 2) error->all("Incorrect args for angle coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class AngleCosine : public Angle {
|
|||||||
AngleCosine(class LAMMPS *);
|
AngleCosine(class LAMMPS *);
|
||||||
~AngleCosine();
|
~AngleCosine();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
double equilibrium_angle(int);
|
double equilibrium_angle(int);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|||||||
@ -198,9 +198,8 @@ void AngleCosinePeriodic::allocate()
|
|||||||
set coeffs for one or more types
|
set coeffs for one or more types
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void AngleCosinePeriodic::coeff(int which, int narg, char **arg)
|
void AngleCosinePeriodic::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 4) error->all("Incorrect args for angle coefficients");
|
if (narg != 4) error->all("Incorrect args for angle coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class AngleCosinePeriodic : public Angle {
|
|||||||
AngleCosinePeriodic(class LAMMPS *);
|
AngleCosinePeriodic(class LAMMPS *);
|
||||||
~AngleCosinePeriodic();
|
~AngleCosinePeriodic();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
double equilibrium_angle(int);
|
double equilibrium_angle(int);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|||||||
@ -162,9 +162,8 @@ void AngleCosineSquared::allocate()
|
|||||||
set coeffs for one or more types
|
set coeffs for one or more types
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void AngleCosineSquared::coeff(int which, int narg, char **arg)
|
void AngleCosineSquared::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 3) error->all("Incorrect args for angle coefficients");
|
if (narg != 3) error->all("Incorrect args for angle coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class AngleCosineSquared : public Angle {
|
|||||||
AngleCosineSquared(class LAMMPS *);
|
AngleCosineSquared(class LAMMPS *);
|
||||||
virtual ~AngleCosineSquared();
|
virtual ~AngleCosineSquared();
|
||||||
virtual void compute(int, int);
|
virtual void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
double equilibrium_angle(int);
|
double equilibrium_angle(int);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|||||||
@ -162,9 +162,8 @@ void AngleHarmonic::allocate()
|
|||||||
set coeffs for one or more types
|
set coeffs for one or more types
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void AngleHarmonic::coeff(int which, int narg, char **arg)
|
void AngleHarmonic::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 3) error->all("Incorrect args for angle coefficients");
|
if (narg != 3) error->all("Incorrect args for angle coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class AngleHarmonic : public Angle {
|
|||||||
AngleHarmonic(class LAMMPS *);
|
AngleHarmonic(class LAMMPS *);
|
||||||
~AngleHarmonic();
|
~AngleHarmonic();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
double equilibrium_angle(int);
|
double equilibrium_angle(int);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|||||||
@ -234,7 +234,7 @@ void AngleHybrid::settings(int narg, char **arg)
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void AngleHybrid::coeff(int which, int narg, char **arg)
|
void AngleHybrid::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ void AngleHybrid::coeff(int which, int narg, char **arg)
|
|||||||
|
|
||||||
// invoke sub-style coeff() starting with 1st arg
|
// invoke sub-style coeff() starting with 1st arg
|
||||||
|
|
||||||
if (!none) styles[m]->coeff(which,narg-1,&arg[1]);
|
if (!none) styles[m]->coeff(narg-1,&arg[1]);
|
||||||
|
|
||||||
// set setflag and which type maps to which sub-style
|
// set setflag and which type maps to which sub-style
|
||||||
// if sub-style is none: set hybrid setflag, wipe out map
|
// if sub-style is none: set hybrid setflag, wipe out map
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class AngleHybrid : public Angle {
|
|||||||
~AngleHybrid();
|
~AngleHybrid();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void settings(int, char **);
|
void settings(int, char **);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
double equilibrium_angle(int);
|
double equilibrium_angle(int);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|||||||
@ -211,9 +211,8 @@ void AngleTable::settings(int narg, char **arg)
|
|||||||
set coeffs for one or more type pairs
|
set coeffs for one or more type pairs
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void AngleTable::coeff(int which, int narg, char **arg)
|
void AngleTable::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 3) error->all("Illegal angle_coeff command");
|
if (narg != 3) error->all("Illegal angle_coeff command");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class AngleTable : public Angle {
|
|||||||
~AngleTable();
|
~AngleTable();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void settings(int, char **);
|
void settings(int, char **);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
double equilibrium_angle(int);
|
double equilibrium_angle(int);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|||||||
@ -325,9 +325,8 @@ void DihedralCharmm::allocate()
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DihedralCharmm::coeff(int which, int narg, char **arg)
|
void DihedralCharmm::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 5) error->all("Incorrect args for dihedral coefficients");
|
if (narg != 5) error->all("Incorrect args for dihedral coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class DihedralCharmm : public Dihedral {
|
|||||||
DihedralCharmm(class LAMMPS *);
|
DihedralCharmm(class LAMMPS *);
|
||||||
~DihedralCharmm();
|
~DihedralCharmm();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void init_style();
|
void init_style();
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|||||||
@ -272,9 +272,8 @@ void DihedralHarmonic::allocate()
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DihedralHarmonic::coeff(int which, int narg, char **arg)
|
void DihedralHarmonic::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 4) error->all("Incorrect args for dihedral coefficients");
|
if (narg != 4) error->all("Incorrect args for dihedral coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class DihedralHarmonic : public Dihedral {
|
|||||||
DihedralHarmonic(class LAMMPS *);
|
DihedralHarmonic(class LAMMPS *);
|
||||||
~DihedralHarmonic();
|
~DihedralHarmonic();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|
||||||
|
|||||||
@ -281,9 +281,8 @@ void DihedralHelix::allocate()
|
|||||||
set coeffs from one line in input script
|
set coeffs from one line in input script
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DihedralHelix::coeff(int which, int narg, char **arg)
|
void DihedralHelix::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 4) error->all("Incorrect args for dihedral coefficients");
|
if (narg != 4) error->all("Incorrect args for dihedral coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class DihedralHelix : public Dihedral {
|
|||||||
DihedralHelix(class LAMMPS *);
|
DihedralHelix(class LAMMPS *);
|
||||||
~DihedralHelix();
|
~DihedralHelix();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|
||||||
|
|||||||
@ -184,7 +184,7 @@ void DihedralHybrid::settings(int narg, char **arg)
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DihedralHybrid::coeff(int which, int narg, char **arg)
|
void DihedralHybrid::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ void DihedralHybrid::coeff(int which, int narg, char **arg)
|
|||||||
|
|
||||||
// invoke sub-style coeff() starting with 1st arg
|
// invoke sub-style coeff() starting with 1st arg
|
||||||
|
|
||||||
if (!none) styles[m]->coeff(which,narg-1,&arg[1]);
|
if (!none) styles[m]->coeff(narg-1,&arg[1]);
|
||||||
|
|
||||||
// set setflag and which type maps to which sub-style
|
// set setflag and which type maps to which sub-style
|
||||||
// if sub-style is none: set hybrid setflag, wipe out map
|
// if sub-style is none: set hybrid setflag, wipe out map
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class DihedralHybrid : public Dihedral {
|
|||||||
~DihedralHybrid();
|
~DihedralHybrid();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void settings(int, char **);
|
void settings(int, char **);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void init_style();
|
void init_style();
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|||||||
@ -270,9 +270,8 @@ void DihedralMultiHarmonic::allocate()
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DihedralMultiHarmonic::coeff(int which, int narg, char **arg)
|
void DihedralMultiHarmonic::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 6) error->all("Incorrect args for dihedral coefficients");
|
if (narg != 6) error->all("Incorrect args for dihedral coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class DihedralMultiHarmonic : public Dihedral {
|
|||||||
DihedralMultiHarmonic(class LAMMPS *);
|
DihedralMultiHarmonic(class LAMMPS *);
|
||||||
~DihedralMultiHarmonic();
|
~DihedralMultiHarmonic();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|
||||||
|
|||||||
@ -283,9 +283,8 @@ void DihedralOPLS::allocate()
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DihedralOPLS::coeff(int which, int narg, char **arg)
|
void DihedralOPLS::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 5) error->all("Incorrect args for dihedral coefficients");
|
if (narg != 5) error->all("Incorrect args for dihedral coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class DihedralOPLS : public Dihedral {
|
|||||||
DihedralOPLS(class LAMMPS *);
|
DihedralOPLS(class LAMMPS *);
|
||||||
~DihedralOPLS();
|
~DihedralOPLS();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|
||||||
|
|||||||
@ -292,9 +292,8 @@ void ImproperCvff::allocate()
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void ImproperCvff::coeff(int which, int narg, char **arg)
|
void ImproperCvff::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 4) error->all("Incorrect args for improper coefficients");
|
if (narg != 4) error->all("Incorrect args for improper coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class ImproperCvff : public Improper {
|
|||||||
ImproperCvff(class LAMMPS *);
|
ImproperCvff(class LAMMPS *);
|
||||||
~ImproperCvff();
|
~ImproperCvff();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|
||||||
|
|||||||
@ -230,9 +230,8 @@ void ImproperHarmonic::allocate()
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void ImproperHarmonic::coeff(int which, int narg, char **arg)
|
void ImproperHarmonic::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 3) error->all("Incorrect args for improper coefficients");
|
if (narg != 3) error->all("Incorrect args for improper coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class ImproperHarmonic : public Improper {
|
|||||||
ImproperHarmonic(class LAMMPS *);
|
ImproperHarmonic(class LAMMPS *);
|
||||||
~ImproperHarmonic();
|
~ImproperHarmonic();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|
||||||
|
|||||||
@ -184,7 +184,7 @@ void ImproperHybrid::settings(int narg, char **arg)
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void ImproperHybrid::coeff(int which, int narg, char **arg)
|
void ImproperHybrid::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ void ImproperHybrid::coeff(int which, int narg, char **arg)
|
|||||||
|
|
||||||
// invoke sub-style coeff() starting with 1st arg
|
// invoke sub-style coeff() starting with 1st arg
|
||||||
|
|
||||||
if (!none) styles[m]->coeff(which,narg-1,&arg[1]);
|
if (!none) styles[m]->coeff(narg-1,&arg[1]);
|
||||||
|
|
||||||
// set setflag and which type maps to which sub-style
|
// set setflag and which type maps to which sub-style
|
||||||
// if sub-style is none: set hybrid setflag, wipe out map
|
// if sub-style is none: set hybrid setflag, wipe out map
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class ImproperHybrid : public Improper {
|
|||||||
~ImproperHybrid();
|
~ImproperHybrid();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void settings(int, char **);
|
void settings(int, char **);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
double memory_usage();
|
double memory_usage();
|
||||||
|
|||||||
@ -250,9 +250,8 @@ void ImproperUmbrella::allocate()
|
|||||||
set coeffs for one type
|
set coeffs for one type
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void ImproperUmbrella::coeff(int which, int narg, char **arg)
|
void ImproperUmbrella::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 3) error->all("Incorrect args for improper coefficients");
|
if (narg != 3) error->all("Incorrect args for improper coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class ImproperUmbrella : public Improper {
|
|||||||
ImproperUmbrella(class LAMMPS *);
|
ImproperUmbrella(class LAMMPS *);
|
||||||
~ImproperUmbrella();
|
~ImproperUmbrella();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|
||||||
|
|||||||
@ -295,9 +295,8 @@ void AngleCGCMM::allocate()
|
|||||||
set coeffs for one or more types
|
set coeffs for one or more types
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void AngleCGCMM::coeff(int which, int narg, char **arg)
|
void AngleCGCMM::coeff(int narg, char **arg)
|
||||||
{
|
{
|
||||||
if (which > 0) return;
|
|
||||||
if (narg != 6) error->all("Incorrect args for angle coefficients");
|
if (narg != 6) error->all("Incorrect args for angle coefficients");
|
||||||
if (!allocated) allocate();
|
if (!allocated) allocate();
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class AngleCGCMM : public Angle, public CGCMMParms {
|
|||||||
AngleCGCMM(class LAMMPS *);
|
AngleCGCMM(class LAMMPS *);
|
||||||
~AngleCGCMM();
|
~AngleCGCMM();
|
||||||
void compute(int, int);
|
void compute(int, int);
|
||||||
void coeff(int, int, char **);
|
void coeff(int, char **);
|
||||||
double equilibrium_angle(int);
|
double equilibrium_angle(int);
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void read_restart(FILE *);
|
void read_restart(FILE *);
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class Angle : protected Pointers {
|
|||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void compute(int, int) = 0;
|
virtual void compute(int, int) = 0;
|
||||||
virtual void settings(int, char **) {}
|
virtual void settings(int, char **) {}
|
||||||
virtual void coeff(int, int, char **) = 0;
|
virtual void coeff(int, char **) = 0;
|
||||||
virtual double equilibrium_angle(int) = 0;
|
virtual double equilibrium_angle(int) = 0;
|
||||||
virtual void write_restart(FILE *) = 0;
|
virtual void write_restart(FILE *) = 0;
|
||||||
virtual void read_restart(FILE *) = 0;
|
virtual void read_restart(FILE *) = 0;
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class Dihedral : protected Pointers {
|
|||||||
virtual void init_style() {}
|
virtual void init_style() {}
|
||||||
virtual void compute(int, int) = 0;
|
virtual void compute(int, int) = 0;
|
||||||
virtual void settings(int, char **) {}
|
virtual void settings(int, char **) {}
|
||||||
virtual void coeff(int, int, char **) = 0;
|
virtual void coeff(int, char **) = 0;
|
||||||
virtual void write_restart(FILE *) = 0;
|
virtual void write_restart(FILE *) = 0;
|
||||||
virtual void read_restart(FILE *) = 0;
|
virtual void read_restart(FILE *) = 0;
|
||||||
virtual double memory_usage();
|
virtual double memory_usage();
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class Improper : protected Pointers {
|
|||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void compute(int, int) = 0;
|
virtual void compute(int, int) = 0;
|
||||||
virtual void settings(int, char **) {}
|
virtual void settings(int, char **) {}
|
||||||
virtual void coeff(int, int, char **) = 0;
|
virtual void coeff(int, char **) = 0;
|
||||||
virtual void write_restart(FILE *) = 0;
|
virtual void write_restart(FILE *) = 0;
|
||||||
virtual void read_restart(FILE *) = 0;
|
virtual void read_restart(FILE *) = 0;
|
||||||
virtual double memory_usage();
|
virtual double memory_usage();
|
||||||
|
|||||||
@ -727,7 +727,7 @@ void Input::angle_coeff()
|
|||||||
error->all("Angle_coeff command before angle_style is defined");
|
error->all("Angle_coeff command before angle_style is defined");
|
||||||
if (atom->avec->angles_allow == 0)
|
if (atom->avec->angles_allow == 0)
|
||||||
error->all("Angle_coeff command when no angles allowed");
|
error->all("Angle_coeff command when no angles allowed");
|
||||||
force->angle->coeff(0,narg,arg);
|
force->angle->coeff(narg,arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -830,7 +830,7 @@ void Input::dihedral_coeff()
|
|||||||
error->all("Dihedral_coeff command before dihedral_style is defined");
|
error->all("Dihedral_coeff command before dihedral_style is defined");
|
||||||
if (atom->avec->dihedrals_allow == 0)
|
if (atom->avec->dihedrals_allow == 0)
|
||||||
error->all("Dihedral_coeff command when no dihedrals allowed");
|
error->all("Dihedral_coeff command when no dihedrals allowed");
|
||||||
force->dihedral->coeff(0,narg,arg);
|
force->dihedral->coeff(narg,arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -917,7 +917,7 @@ void Input::improper_coeff()
|
|||||||
error->all("Improper_coeff command before improper_style is defined");
|
error->all("Improper_coeff command before improper_style is defined");
|
||||||
if (atom->avec->impropers_allow == 0)
|
if (atom->avec->impropers_allow == 0)
|
||||||
error->all("Improper_coeff command when no impropers allowed");
|
error->all("Improper_coeff command when no impropers allowed");
|
||||||
force->improper->coeff(0,narg,arg);
|
force->improper->coeff(narg,arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -36,7 +36,7 @@ using namespace LAMMPS_NS;
|
|||||||
#define MAXLINE 256
|
#define MAXLINE 256
|
||||||
#define LB_FACTOR 1.1
|
#define LB_FACTOR 1.1
|
||||||
#define CHUNK 1024
|
#define CHUNK 1024
|
||||||
#define DELTA 4
|
#define DELTA 4 // must be 2 or larger
|
||||||
|
|
||||||
#define NSECTIONS 22 // change when add to header::section_keywords
|
#define NSECTIONS 22 // change when add to header::section_keywords
|
||||||
|
|
||||||
@ -813,7 +813,7 @@ void ReadData::paircoeffs()
|
|||||||
|
|
||||||
for (i = 0; i < atom->ntypes; i++) {
|
for (i = 0; i < atom->ntypes; i++) {
|
||||||
m = strlen(buf) + 1;
|
m = strlen(buf) + 1;
|
||||||
parse_coeffs(1,buf);
|
parse_coeffs(buf,NULL,1);
|
||||||
force->pair->coeff(narg,arg);
|
force->pair->coeff(narg,arg);
|
||||||
buf += m;
|
buf += m;
|
||||||
}
|
}
|
||||||
@ -844,7 +844,7 @@ void ReadData::bondcoeffs()
|
|||||||
|
|
||||||
for (i = 0; i < atom->nbondtypes; i++) {
|
for (i = 0; i < atom->nbondtypes; i++) {
|
||||||
m = strlen(buf) + 1;
|
m = strlen(buf) + 1;
|
||||||
parse_coeffs(0,buf);
|
parse_coeffs(buf,NULL,0);
|
||||||
force->bond->coeff(narg,arg);
|
force->bond->coeff(narg,arg);
|
||||||
buf += m;
|
buf += m;
|
||||||
}
|
}
|
||||||
@ -875,8 +875,10 @@ void ReadData::anglecoeffs(int which)
|
|||||||
|
|
||||||
for (i = 0; i < atom->nangletypes; i++) {
|
for (i = 0; i < atom->nangletypes; i++) {
|
||||||
m = strlen(buf) + 1;
|
m = strlen(buf) + 1;
|
||||||
parse_coeffs(0,buf);
|
if (which == 0) parse_coeffs(buf,NULL,0);
|
||||||
force->angle->coeff(which,narg,arg);
|
else if (which == 1) parse_coeffs(buf,"bb",0);
|
||||||
|
else if (which == 2) parse_coeffs(buf,"ba",0);
|
||||||
|
force->angle->coeff(narg,arg);
|
||||||
buf += m;
|
buf += m;
|
||||||
}
|
}
|
||||||
delete [] original;
|
delete [] original;
|
||||||
@ -906,8 +908,13 @@ void ReadData::dihedralcoeffs(int which)
|
|||||||
|
|
||||||
for (i = 0; i < atom->ndihedraltypes; i++) {
|
for (i = 0; i < atom->ndihedraltypes; i++) {
|
||||||
m = strlen(buf) + 1;
|
m = strlen(buf) + 1;
|
||||||
parse_coeffs(0,buf);
|
if (which == 0) parse_coeffs(buf,NULL,0);
|
||||||
force->dihedral->coeff(which,narg,arg);
|
else if (which == 1) parse_coeffs(buf,"mbt",0);
|
||||||
|
else if (which == 2) parse_coeffs(buf,"ebt",0);
|
||||||
|
else if (which == 3) parse_coeffs(buf,"at",0);
|
||||||
|
else if (which == 4) parse_coeffs(buf,"aat",0);
|
||||||
|
else if (which == 5) parse_coeffs(buf,"bb13",0);
|
||||||
|
force->dihedral->coeff(narg,arg);
|
||||||
buf += m;
|
buf += m;
|
||||||
}
|
}
|
||||||
delete [] original;
|
delete [] original;
|
||||||
@ -937,8 +944,9 @@ void ReadData::impropercoeffs(int which)
|
|||||||
|
|
||||||
for (i = 0; i < atom->nimpropertypes; i++) {
|
for (i = 0; i < atom->nimpropertypes; i++) {
|
||||||
m = strlen(buf) + 1;
|
m = strlen(buf) + 1;
|
||||||
parse_coeffs(0,buf);
|
if (which == 0) parse_coeffs(buf,NULL,0);
|
||||||
force->improper->coeff(which,narg,arg);
|
else if (which == 1) parse_coeffs(buf,"aa",0);
|
||||||
|
force->improper->coeff(narg,arg);
|
||||||
buf += m;
|
buf += m;
|
||||||
}
|
}
|
||||||
delete [] original;
|
delete [] original;
|
||||||
@ -1314,10 +1322,11 @@ void ReadData::skip_lines(int n)
|
|||||||
parse a line of coeffs into words, storing them in narg,arg
|
parse a line of coeffs into words, storing them in narg,arg
|
||||||
trim anything from '#' onward
|
trim anything from '#' onward
|
||||||
word strings remain in line, are not copied
|
word strings remain in line, are not copied
|
||||||
if addflag, duplicate 1st word, so pair_coeff "2" looks like "2 2"
|
if addstr != NULL, add addstr as 2nd arg for class2 angle/dihedral/improper
|
||||||
|
if dupflag, duplicate 1st word, so pair_coeff "2" becomes "2 2"
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void ReadData::parse_coeffs(int addflag, char *line)
|
void ReadData::parse_coeffs(char *line, char *addstr, int dupflag)
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
if (ptr = strchr(line,'#')) *ptr = '\0';
|
if (ptr = strchr(line,'#')) *ptr = '\0';
|
||||||
@ -1331,7 +1340,8 @@ void ReadData::parse_coeffs(int addflag, char *line)
|
|||||||
memory->srealloc(arg,maxarg*sizeof(char *),"read_data:arg");
|
memory->srealloc(arg,maxarg*sizeof(char *),"read_data:arg");
|
||||||
}
|
}
|
||||||
arg[narg++] = word;
|
arg[narg++] = word;
|
||||||
if (addflag && narg == 1) continue;
|
if (addstr && narg == 1) arg[narg++] = addstr;
|
||||||
|
if (dupflag && narg == 1) arg[narg++] = word;
|
||||||
word = strtok(NULL," \t\n\r\f");
|
word = strtok(NULL," \t\n\r\f");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class ReadData : protected Pointers {
|
|||||||
void header(int);
|
void header(int);
|
||||||
void parse_keyword(int, int);
|
void parse_keyword(int, int);
|
||||||
void skip_lines(int);
|
void skip_lines(int);
|
||||||
void parse_coeffs(int, char *);
|
void parse_coeffs(char *, char *, int);
|
||||||
|
|
||||||
void atoms();
|
void atoms();
|
||||||
void velocities();
|
void velocities();
|
||||||
|
|||||||
Reference in New Issue
Block a user