git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3023 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2009-08-08 20:06:53 +00:00
parent efea2a1835
commit eb63ce2377
63 changed files with 369 additions and 329 deletions

View File

@ -259,10 +259,10 @@ void PairGayBerne::settings(int narg, char **arg)
{
if (narg != 4) error->all("Illegal pair_style command");
gamma = atof(arg[0]);
upsilon = atof(arg[1])/2.0;
mu = atof(arg[2]);
cut_global = atof(arg[3]);
gamma = force->numeric(arg[0]);
upsilon = force->numeric(arg[1])/2.0;
mu = force->numeric(arg[2]);
cut_global = force->numeric(arg[3]);
// reset cutoffs that have been explicitly set
@ -288,17 +288,17 @@ void PairGayBerne::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double eia_one = atof(arg[4]);
double eib_one = atof(arg[5]);
double eic_one = atof(arg[6]);
double eja_one = atof(arg[7]);
double ejb_one = atof(arg[8]);
double ejc_one = atof(arg[9]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double eia_one = force->numeric(arg[4]);
double eib_one = force->numeric(arg[5]);
double eic_one = force->numeric(arg[6]);
double eja_one = force->numeric(arg[7]);
double ejb_one = force->numeric(arg[8]);
double ejc_one = force->numeric(arg[9]);
double cut_one = cut_global;
if (narg == 11) cut_one = atof(arg[10]);
if (narg == 11) cut_one = force->numeric(arg[10]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -251,7 +251,7 @@ void PairRESquared::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
@ -277,17 +277,17 @@ void PairRESquared::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double eia_one = atof(arg[4]);
double eib_one = atof(arg[5]);
double eic_one = atof(arg[6]);
double eja_one = atof(arg[7]);
double ejb_one = atof(arg[8]);
double ejc_one = atof(arg[9]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double eia_one = force->numeric(arg[4]);
double eib_one = force->numeric(arg[5]);
double eic_one = force->numeric(arg[6]);
double eja_one = force->numeric(arg[7]);
double ejb_one = force->numeric(arg[8]);
double ejc_one = force->numeric(arg[9]);
double cut_one = cut_global;
if (narg == 11) cut_one = atof(arg[10]);
if (narg == 11) cut_one = force->numeric(arg[10]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -278,10 +278,10 @@ void AngleClass2::coeff(int which, int narg, char **arg)
if (which == 0) {
if (narg != 5) error->all("Incorrect args for angle coefficients");
double theta0_one = atof(arg[1]);
double k2_one = atof(arg[2]);
double k3_one = atof(arg[3]);
double k4_one = atof(arg[4]);
double theta0_one = force->numeric(arg[1]);
double k2_one = force->numeric(arg[2]);
double k3_one = force->numeric(arg[3]);
double k4_one = force->numeric(arg[4]);
// convert theta0 from degrees to radians
@ -298,9 +298,9 @@ 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 = atof(arg[1]);
double bb_r1_one = atof(arg[2]);
double bb_r2_one = atof(arg[3]);
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;
@ -314,10 +314,10 @@ void AngleClass2::coeff(int which, int narg, char **arg)
if (which == 2) {
if (narg != 5) error->all("Incorrect args for angle coefficients");
double ba_k1_one = atof(arg[1]);
double ba_k2_one = atof(arg[2]);
double ba_r1_one = atof(arg[3]);
double ba_r2_one = atof(arg[4]);
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;

View File

@ -135,10 +135,10 @@ void BondClass2::coeff(int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nbondtypes,ilo,ihi);
double r0_one = atof(arg[1]);
double k2_one = atof(arg[2]);
double k3_one = atof(arg[3]);
double k4_one = atof(arg[4]);
double r0_one = force->numeric(arg[1]);
double k2_one = force->numeric(arg[2]);
double k3_one = force->numeric(arg[3]);
double k4_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -666,12 +666,12 @@ void DihedralClass2::coeff(int which, int narg, char **arg)
if (which == 0) {
if (narg != 7) error->all("Incorrect args for dihedral coefficients");
double k1_one = atof(arg[1]);
double phi1_one = atof(arg[2]);
double k2_one = atof(arg[3]);
double phi2_one = atof(arg[4]);
double k3_one = atof(arg[5]);
double phi3_one = atof(arg[6]);
double k1_one = force->numeric(arg[1]);
double phi1_one = force->numeric(arg[2]);
double k2_one = force->numeric(arg[3]);
double phi2_one = force->numeric(arg[4]);
double k3_one = force->numeric(arg[5]);
double phi3_one = force->numeric(arg[6]);
// convert phi's from degrees to radians
@ -690,10 +690,10 @@ 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 = atof(arg[1]);
double f2_one = atof(arg[2]);
double f3_one = atof(arg[3]);
double r0_one = atof(arg[4]);
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;
@ -708,14 +708,14 @@ void DihedralClass2::coeff(int which, int narg, char **arg)
if (which == 2) {
if (narg != 9) error->all("Incorrect args for dihedral coefficients");
double f1_1_one = atof(arg[1]);
double f2_1_one = atof(arg[2]);
double f3_1_one = atof(arg[3]);
double f1_2_one = atof(arg[4]);
double f2_2_one = atof(arg[5]);
double f3_2_one = atof(arg[6]);
double r0_1_one = atof(arg[7]);
double r0_2_one = atof(arg[8]);
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;
@ -734,14 +734,14 @@ void DihedralClass2::coeff(int which, int narg, char **arg)
if (which == 3) {
if (narg != 9) error->all("Incorrect args for dihedral coefficients");
double f1_1_one = atof(arg[1]);
double f2_1_one = atof(arg[2]);
double f3_1_one = atof(arg[3]);
double f1_2_one = atof(arg[4]);
double f2_2_one = atof(arg[5]);
double f3_2_one = atof(arg[6]);
double theta0_1_one = atof(arg[7]);
double theta0_2_one = atof(arg[8]);
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
@ -762,9 +762,9 @@ void DihedralClass2::coeff(int which, int narg, char **arg)
if (which == 4) {
if (narg != 4) error->all("Incorrect args for dihedral coefficients");
double k_one = atof(arg[1]);
double theta0_1_one = atof(arg[2]);
double theta0_2_one = atof(arg[3]);
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
@ -780,9 +780,9 @@ void DihedralClass2::coeff(int which, int narg, char **arg)
if (which == 5) {
if (narg != 4) error->all("Incorrect args for dihedral coefficients");
double k_one = atof(arg[1]);
double r10_one = atof(arg[2]);
double r30_one = atof(arg[3]);
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;

View File

@ -540,8 +540,8 @@ void ImproperClass2::coeff(int which, int narg, char **arg)
if (which == 0) {
if (narg != 3) error->all("Incorrect args for improper coefficients");
double k0_one = atof(arg[1]);
double chi0_one = atof(arg[2]);
double k0_one = force->numeric(arg[1]);
double chi0_one = force->numeric(arg[2]);
// convert chi0 from degrees to radians
@ -556,12 +556,12 @@ void ImproperClass2::coeff(int which, int narg, char **arg)
if (which == 1) {
if (narg != 7) error->all("Incorrect args for improper coefficients");
double k1_one = atof(arg[1]);
double k2_one = atof(arg[2]);
double k3_one = atof(arg[3]);
double theta0_1_one = atof(arg[4]);
double theta0_2_one = atof(arg[5]);
double theta0_3_one = atof(arg[6]);
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

View File

@ -168,7 +168,7 @@ void PairLJClass2::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
@ -193,11 +193,11 @@ void PairLJClass2::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_one = cut_global;
if (narg == 5) cut_one = atof(arg[4]);
if (narg == 5) cut_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -194,9 +194,9 @@ void PairLJClass2CoulCut::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
cut_lj_global = atof(arg[0]);
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul_global = cut_lj_global;
else cut_coul_global = atof(arg[1]);
else cut_coul_global = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
@ -224,13 +224,13 @@ void PairLJClass2CoulCut::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_lj_one = cut_lj_global;
double cut_coul_one = cut_coul_global;
if (narg >= 5) cut_coul_one = cut_lj_one = atof(arg[4]);
if (narg == 6) cut_coul_one = atof(arg[5]);
if (narg >= 5) cut_coul_one = cut_lj_one = force->numeric(arg[4]);
if (narg == 6) cut_coul_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -209,9 +209,9 @@ void PairLJClass2CoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
cut_lj_global = atof(arg[0]);
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
else cut_coul = atof(arg[1]);
else cut_coul = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
@ -236,11 +236,11 @@ void PairLJClass2CoulLong::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_lj_one = cut_lj_global;
if (narg == 5) cut_lj_one = atof(arg[4]);
if (narg == 5) cut_lj_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -249,7 +249,7 @@ void PairColloid::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
@ -274,13 +274,13 @@ void PairColloid::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a12_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double d1_one = atof(arg[4]);
double d2_one = atof(arg[5]);
double a12_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double d1_one = force->numeric(arg[4]);
double d2_one = force->numeric(arg[5]);
double cut_one = cut_global;
if (narg == 7) cut_one = atof(arg[6]);
if (narg == 7) cut_one = force->numeric(arg[6]);
if (d1_one < 0.0 || d2_one < 0.0)
error->all("Invalid d1 or d2 value for pair colloid coeff");

View File

@ -320,18 +320,19 @@ void PairLubricate::settings(int narg, char **arg)
{
if (narg != 9) error->all("Illegal pair_style command");
mu = atof(arg[0]);
flag1 = atoi(arg[1]);
flag2 = atoi(arg[2]);
flag3 = atoi(arg[3]);
flag4 = atoi(arg[4]);
cut_inner_global = atof(arg[5]);
cut_global = atof(arg[6]);
t_target = atof(arg[7]);
seed = atoi(arg[8]);
mu = force->numeric(arg[0]);
flag1 = force->inumeric(arg[1]);
flag2 = force->inumeric(arg[2]);
flag3 = force->inumeric(arg[3]);
flag4 = force->inumeric(arg[4]);
cut_inner_global = force->numeric(arg[5]);
cut_global = force->numeric(arg[6]);
t_target = force->numeric(arg[7]);
seed = force->inumeric(arg[8]);
// initialize Marsaglia RNG with processor-unique seed
if (seed <= 0) error->all("Illegal pair_style command");
delete random;
random = new RanMars(lmp,seed + comm->me);
@ -366,8 +367,8 @@ void PairLubricate::coeff(int narg, char **arg)
double cut_inner_one = cut_inner_global;
double cut_one = cut_global;
if (narg == 4) {
cut_inner_one = atof(arg[2]);
cut_one = atof(arg[3]);
cut_inner_one = force->numeric(arg[2]);
cut_one = force->numeric(arg[3]);
}
int count = 0;

View File

@ -302,9 +302,9 @@ void PairDipoleCut::settings(int narg, char **arg)
if (narg < 1 || narg > 2)
error->all("Incorrect args in pair_style command");
cut_lj_global = atof(arg[0]);
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul_global = cut_lj_global;
else cut_coul_global = atof(arg[1]);
else cut_coul_global = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
@ -333,13 +333,13 @@ void PairDipoleCut::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_lj_one = cut_lj_global;
double cut_coul_one = cut_coul_global;
if (narg >= 5) cut_coul_one = cut_lj_one = atof(arg[4]);
if (narg == 6) cut_coul_one = atof(arg[5]);
if (narg >= 5) cut_coul_one = cut_lj_one = force->numeric(arg[4]);
if (narg == 6) cut_coul_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -192,14 +192,14 @@ void PairDPD::settings(int narg, char **arg)
{
if (narg != 3) error->all("Illegal pair_style command");
temperature = atof(arg[0]);
cut_global = atof(arg[1]);
seed = atoi(arg[2]);
temperature = force->numeric(arg[0]);
cut_global = force->numeric(arg[1]);
seed = force->inumeric(arg[2]);
// initialize Marsaglia RNG with processor-unique seed
if (seed <= 0) error->all("Illegal fix pair_style command");
if (random) delete random;
if (seed <= 0) error->all("Illegal pair_style command");
delete random;
random = new RanMars(lmp,seed + comm->me);
// reset cutoffs that have been explicitly set
@ -225,11 +225,11 @@ void PairDPD::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a0_one = atof(arg[2]);
double gamma_one = atof(arg[3]);
double a0_one = force->numeric(arg[2]);
double gamma_one = force->numeric(arg[3]);
double cut_one = cut_global;
if (narg == 5) cut_one = atof(arg[4]);
if (narg == 5) cut_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -251,16 +251,16 @@ void PairGranHertzHistory::settings(int narg, char **arg)
{
if (narg != 6) error->all("Illegal pair_style command");
kn = atof(arg[0]);
kn = force->numeric(arg[0]);
if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0;
else kt = atof(arg[1]);
else kt = force->numeric(arg[1]);
gamman = atof(arg[2]);
gamman = force->numeric(arg[2]);
if (strcmp(arg[3],"NULL") == 0) gammat = 0.5 * gamman;
else gammat = atof(arg[3]);
else gammat = force->numeric(arg[3]);
xmu = atof(arg[4]);
dampflag = atoi(arg[5]);
xmu = force->numeric(arg[4]);
dampflag = force->inumeric(arg[5]);
if (dampflag == 0) gammat = 0.0;
if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 ||

View File

@ -290,16 +290,16 @@ void PairGranHookeHistory::settings(int narg, char **arg)
{
if (narg != 6) error->all("Illegal pair_style command");
kn = atof(arg[0]);
kn = force->numeric(arg[0]);
if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0;
else kt = atof(arg[1]);
else kt = force->numeric(arg[1]);
gamman = atof(arg[2]);
gamman = force->numeric(arg[2]);
if (strcmp(arg[3],"NULL") == 0) gammat = 0.5 * gamman;
else gammat = atof(arg[3]);
else gammat = force->numeric(arg[3]);
xmu = atof(arg[4]);
dampflag = atoi(arg[5]);
xmu = force->numeric(arg[4]);
dampflag = force->inumeric(arg[5]);
if (dampflag == 0) gammat = 0.0;
if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 ||

View File

@ -220,9 +220,9 @@ void PairBornCoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
cut_lj_global = atof(arg[0]);
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
else cut_coul = atof(arg[1]);
else cut_coul = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
@ -247,15 +247,15 @@ void PairBornCoulLong::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = atof(arg[2]);
double rho_one = atof(arg[3]);
double sigma_one = atof(arg[4]);
double a_one = force->numeric(arg[2]);
double rho_one = force->numeric(arg[3]);
double sigma_one = force->numeric(arg[4]);
if (rho_one <= 0) error->all("Incorrect args for pair coefficients");
double c_one = atof(arg[5]);
double d_one = atof(arg[6]);
double c_one = force->numeric(arg[5]);
double d_one = force->numeric(arg[6]);
double cut_lj_one = cut_lj_global;
if (narg == 8) cut_lj_one = atof(arg[7]);
if (narg == 8) cut_lj_one = force->numeric(arg[7]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -209,9 +209,9 @@ void PairBuckCoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
cut_lj_global = atof(arg[0]);
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
else cut_coul = atof(arg[1]);
else cut_coul = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
@ -236,13 +236,13 @@ void PairBuckCoulLong::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = atof(arg[2]);
double rho_one = atof(arg[3]);
double a_one = force->numeric(arg[2]);
double rho_one = force->numeric(arg[3]);
if (rho_one <= 0) error->all("Incorrect args for pair coefficients");
double c_one = atof(arg[4]);
double c_one = force->numeric(arg[4]);
double cut_lj_one = cut_lj_global;
if (narg == 6) cut_lj_one = atof(arg[5]);
if (narg == 6) cut_lj_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -198,7 +198,7 @@ void PairCoulLong::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
cut_coul = atof(arg[0]);
cut_coul = force->numeric(arg[0]);
}
/* ----------------------------------------------------------------------

View File

@ -673,10 +673,10 @@ void PairLJCharmmCoulLong::settings(int narg, char **arg)
{
if (narg != 2 && narg != 3) error->all("Illegal pair_style command");
cut_lj_inner = atof(arg[0]);
cut_lj = atof(arg[1]);
cut_lj_inner = force->numeric(arg[0]);
cut_lj = force->numeric(arg[1]);
if (narg == 2) cut_coul = cut_lj;
else cut_coul = atof(arg[2]);
else cut_coul = force->numeric(arg[2]);
}
/* ----------------------------------------------------------------------
@ -692,13 +692,13 @@ void PairLJCharmmCoulLong::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double eps14_one = epsilon_one;
double sigma14_one = sigma_one;
if (narg == 6) {
eps14_one = atof(arg[4]);
sigma14_one = atof(arg[5]);
eps14_one = force->numeric(arg[4]);
sigma14_one = force->numeric(arg[5]);
}
int count = 0;

View File

@ -613,9 +613,9 @@ void PairLJCutCoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
cut_lj_global = atof(arg[0]);
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
else cut_coul = atof(arg[1]);
else cut_coul = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
@ -640,11 +640,11 @@ void PairLJCutCoulLong::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_lj_one = cut_lj_global;
if (narg == 5) cut_lj_one = atof(arg[4]);
if (narg == 5) cut_lj_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -362,15 +362,15 @@ void PairLJCutCoulLongTIP4P::settings(int narg, char **arg)
{
if (narg < 6 || narg > 7) error->all("Illegal pair_style command");
typeO = atoi(arg[0]);
typeH = atoi(arg[1]);
typeB = atoi(arg[2]);
typeA = atoi(arg[3]);
qdist = atof(arg[4]);
typeO = force->inumeric(arg[0]);
typeH = force->inumeric(arg[1]);
typeB = force->inumeric(arg[2]);
typeA = force->inumeric(arg[3]);
qdist = force->numeric(arg[4]);
cut_lj_global = atof(arg[5]);
cut_lj_global = force->numeric(arg[5]);
if (narg == 6) cut_coul = cut_lj_global;
else cut_coul = atof(arg[6]);
else cut_coul = force->numeric(arg[6]);
// reset cutoffs that have been explicitly set

View File

@ -135,12 +135,12 @@ void PairAIREBO::settings(int narg, char **arg)
{
if (narg != 1 && narg != 3) error->all("Illegal pair_style command");
cutlj = atof(arg[0]);
cutlj = force->numeric(arg[0]);
ljflag = torflag = 1;
if (narg == 3) {
ljflag = atoi(arg[1]);
torflag = atoi(arg[2]);
ljflag = force->inumeric(arg[1]);
torflag = force->inumeric(arg[2]);
}
}

View File

@ -200,10 +200,10 @@ void AngleCharmm::coeff(int which, int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nangletypes,ilo,ihi);
double k_one = atof(arg[1]);
double theta0_one = atof(arg[2]);
double k_ub_one = atof(arg[3]);
double r_ub_one = atof(arg[4]);
double k_one = force->numeric(arg[1]);
double theta0_one = force->numeric(arg[2]);
double k_ub_one = force->numeric(arg[3]);
double r_ub_one = force->numeric(arg[4]);
// convert theta0 from degrees to radians

View File

@ -159,7 +159,7 @@ void AngleCosine::coeff(int which, int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nangletypes,ilo,ihi);
double k_one = atof(arg[1]);
double k_one = force->numeric(arg[1]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -171,8 +171,8 @@ void AngleCosineSquared::coeff(int which, int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nangletypes,ilo,ihi);
double k_one = atof(arg[1]);
double theta0_one = atof(arg[2]);
double k_one = force->numeric(arg[1]);
double theta0_one = force->numeric(arg[2]);
// convert theta0 from degrees to radians

View File

@ -171,8 +171,8 @@ void AngleHarmonic::coeff(int which, int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nangletypes,ilo,ihi);
double k_one = atof(arg[1]);
double theta0_one = atof(arg[2]);
double k_one = force->numeric(arg[1]);
double theta0_one = force->numeric(arg[2]);
// convert theta0 from degrees to radians

View File

@ -156,10 +156,10 @@ void BondFENE::coeff(int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nbondtypes,ilo,ihi);
double k_one = atof(arg[1]);
double r0_one = atof(arg[2]);
double epsilon_one = atof(arg[3]);
double sigma_one = atof(arg[4]);
double k_one = force->numeric(arg[1]);
double r0_one = force->numeric(arg[2]);
double epsilon_one = force->numeric(arg[3]);
double sigma_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -162,11 +162,11 @@ void BondFENEExpand::coeff(int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nbondtypes,ilo,ihi);
double k_one = atof(arg[1]);
double r0_one = atof(arg[2]);
double epsilon_one = atof(arg[3]);
double sigma_one = atof(arg[4]);
double shift_one = atof(arg[5]);
double k_one = force->numeric(arg[1]);
double r0_one = force->numeric(arg[2]);
double epsilon_one = force->numeric(arg[3]);
double sigma_one = force->numeric(arg[4]);
double shift_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -124,8 +124,8 @@ void BondHarmonic::coeff(int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nbondtypes,ilo,ihi);
double k_one = atof(arg[1]);
double r0_one = atof(arg[2]);
double k_one = force->numeric(arg[1]);
double r0_one = force->numeric(arg[2]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -129,9 +129,9 @@ void BondMorse::coeff(int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nbondtypes,ilo,ihi);
double d0_one = atof(arg[1]);
double alpha_one = atof(arg[2]);
double r0_one = atof(arg[3]);
double d0_one = force->numeric(arg[1]);
double alpha_one = force->numeric(arg[2]);
double r0_one = force->numeric(arg[3]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -126,9 +126,9 @@ void BondNonlinear::coeff(int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nbondtypes,ilo,ihi);
double epsilon_one = atof(arg[1]);
double r0_one = atof(arg[2]);
double lamda_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[1]);
double r0_one = force->numeric(arg[2]);
double lamda_one = force->numeric(arg[3]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -206,11 +206,11 @@ void BondQuartic::coeff(int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nbondtypes,ilo,ihi);
double k_one = atof(arg[1]);
double b1_one = atof(arg[2]);
double b2_one = atof(arg[3]);
double rc_one = atof(arg[4]);
double u0_one = atof(arg[5]);
double k_one = force->numeric(arg[1]);
double b1_one = force->numeric(arg[2]);
double b2_one = force->numeric(arg[3]);
double rc_one = force->numeric(arg[4]);
double u0_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -338,10 +338,10 @@ void DihedralCharmm::coeff(int which, int narg, char **arg)
// arbitrary phase angle shift could be allowed, but would break
// backwards compatibility and is probably not needed
double k_one = atof(arg[1]);
int multiplicity_one = atoi(arg[2]);
int shift_one = atoi(arg[3]);
double weight_one = atof(arg[4]);
double k_one = force->numeric(arg[1]);
int multiplicity_one = force->inumeric(arg[2]);
int shift_one = force->inumeric(arg[3]);
double weight_one = force->numeric(arg[4]);
if (multiplicity_one < 0)
error->all("Incorrect multiplicity arg for dihedral coefficients");

View File

@ -281,9 +281,9 @@ void DihedralHarmonic::coeff(int which, int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->ndihedraltypes,ilo,ihi);
double k_one = atof(arg[1]);
int sign_one = atoi(arg[2]);
int multiplicity_one = atoi(arg[3]);
double k_one = force->numeric(arg[1]);
int sign_one = force->inumeric(arg[2]);
int multiplicity_one = force->inumeric(arg[3]);
// require sign = +/- 1 for backwards compatibility
// arbitrary phase angle shift could be allowed, but would break

View File

@ -290,9 +290,9 @@ void DihedralHelix::coeff(int which, int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->ndihedraltypes,ilo,ihi);
double aphi_one = atof(arg[1]);
double bphi_one = atof(arg[2]);
double cphi_one = atof(arg[3]);
double aphi_one = force->numeric(arg[1]);
double bphi_one = force->numeric(arg[2]);
double cphi_one = force->numeric(arg[3]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -279,11 +279,11 @@ void DihedralMultiHarmonic::coeff(int which, int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->ndihedraltypes,ilo,ihi);
double a1_one = atof(arg[1]);
double a2_one = atof(arg[2]);
double a3_one = atof(arg[3]);
double a4_one = atof(arg[4]);
double a5_one = atof(arg[5]);
double a1_one = force->numeric(arg[1]);
double a2_one = force->numeric(arg[2]);
double a3_one = force->numeric(arg[3]);
double a4_one = force->numeric(arg[4]);
double a5_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -292,10 +292,10 @@ void DihedralOPLS::coeff(int which, int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->ndihedraltypes,ilo,ihi);
double k1_one = atof(arg[1]);
double k2_one = atof(arg[2]);
double k3_one = atof(arg[3]);
double k4_one = atof(arg[4]);
double k1_one = force->numeric(arg[1]);
double k2_one = force->numeric(arg[2]);
double k3_one = force->numeric(arg[3]);
double k4_one = force->numeric(arg[4]);
// store 1/2 factor with prefactor

View File

@ -301,9 +301,9 @@ void ImproperCvff::coeff(int which, int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nimpropertypes,ilo,ihi);
double k_one = atof(arg[1]);
int sign_one = atoi(arg[2]);
int multiplicity_one = atoi(arg[3]);
double k_one = force->numeric(arg[1]);
int sign_one = force->inumeric(arg[2]);
int multiplicity_one = force->inumeric(arg[3]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -239,8 +239,8 @@ void ImproperHarmonic::coeff(int which, int narg, char **arg)
int ilo,ihi;
force->bounds(arg[0],atom->nimpropertypes,ilo,ihi);
double k_one = atof(arg[1]);
double chi_one = atof(arg[2]);
double k_one = force->numeric(arg[1]);
double chi_one = force->numeric(arg[2]);
// convert chi from degrees to radians

View File

@ -231,14 +231,14 @@ void PairLJCharmmCoulCharmm::settings(int narg, char **arg)
if (narg != 2 && narg != 4)
error->all("Illegal pair_style command");
cut_lj_inner = atof(arg[0]);
cut_lj = atof(arg[1]);
cut_lj_inner = force->numeric(arg[0]);
cut_lj = force->numeric(arg[1]);
if (narg == 2) {
cut_coul_inner = cut_lj_inner;
cut_coul = cut_lj;
} else {
cut_coul_inner = atof(arg[2]);
cut_coul = atof(arg[3]);
cut_coul_inner = force->numeric(arg[2]);
cut_coul = force->numeric(arg[3]);
}
}
@ -256,13 +256,13 @@ void PairLJCharmmCoulCharmm::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double eps14_one = epsilon_one;
double sigma14_one = sigma_one;
if (narg == 6) {
eps14_one = atof(arg[4]);
sigma14_one = atof(arg[5]);
eps14_one = force->numeric(arg[4]);
sigma14_one = force->numeric(arg[5]);
}
int count = 0;

View File

@ -171,4 +171,4 @@ package-update:
package-overwrite:
@for p in $(PACKAGEUC); do csh -f Package.csh $$p overwrite; done
@echo ''
@for p in $(PACKUSERUC); do csh -f Package.csh $$p overwrite
@for p in $(PACKUSERUC); do csh -f Package.csh $$p overwrite; done

View File

@ -322,10 +322,10 @@ void PairPeriPMB::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double kspring_one = atof(arg[2]);
double cut_one = atof(arg[3]);
double s00_one = atof(arg[4]);
double alpha_one = atof(arg[5]);
double kspring_one = force->numeric(arg[2]);
double cut_one = force->numeric(arg[3]);
double s00_one = force->numeric(arg[4]);
double alpha_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -458,8 +458,8 @@ void PairREAX::settings(int narg, char **arg)
if (narg != 0 && narg !=2) error->all("Illegal pair_style command");
if (narg == 2) {
hbcut = atof(arg[0]);
precision = atof(arg[1]);
hbcut = force->numeric(arg[0]);
precision = force->numeric(arg[1]);
if (hbcut <= 0.0 || precision <= 0.0)
error->all("Illegal pair_style command");
@ -495,7 +495,7 @@ void PairREAX::coeff(int narg, char **arg)
map[i-2] = -1;
continue;
}
map[i-2] = atoi(arg[i]);
map[i-2] = force->inumeric(arg[i]);
}
int n = atom->ntypes;

View File

@ -102,13 +102,13 @@ void PairCMMCommon::settings(int narg, char **arg)
{
if ((narg < 1) || (narg > 3)) error->all("Illegal pair_style command");
cut_lj_global = atof(arg[0]);
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul_global = cut_lj_global;
else cut_coul_global = atof(arg[1]);
else cut_coul_global = force->numeric(arg[1]);
cut_coulsq_global = cut_coul_global*cut_coul_global;
// exponential coulomb screening (optional)
if (narg == 3) kappa = atof(arg[2]);
if (narg == 3) kappa = force->numeric(arg[2]);
if (fabs(kappa) < SMALL) kappa=0.0;
// reset cutoffs that have been explicitly set
@ -145,13 +145,13 @@ void PairCMMCommon::coeff(int narg, char **arg)
int cg_type_one=find_cg_type(arg[2]);
if (cg_type_one == CG_NOT_SET) error->all("Error reading CG type flag.");
double epsilon_one = atof(arg[3]);
double sigma_one = atof(arg[4]);
double epsilon_one = force->numeric(arg[3]);
double sigma_one = force->numeric(arg[4]);
double cut_lj_one = cut_lj_global;
double cut_coul_one = cut_coul_global;
if (narg >= 6) cut_lj_one = atof(arg[5]);
if (narg == 7) cut_coul_one = atof(arg[6]);
if (narg >= 6) cut_lj_one = force->numeric(arg[5]);
if (narg == 7) cut_coul_one = force->numeric(arg[6]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -95,9 +95,9 @@ void PairBuckCoul::settings(int narg, char **arg)
if (!*(++arg)) error->all(PAIR_MISSING);
if (ewald_off&(1<<6)) error->all(PAIR_LJ_OFF);
if (!((ewald_order^ewald_off)&(1<<1))) error->all(PAIR_COUL_CUT);
cut_buck_global = atof(*(arg++));
cut_buck_global = force->numeric(*(arg++));
if (*arg&&(ewald_order&0x42==0x42)) error->all(PAIR_CUTOFF);
cut_coul = *arg ? atof(*(arg++)) : cut_buck_global;
cut_coul = *arg ? force->numeric(*(arg++)) : cut_buck_global;
if (*arg) error->all(PAIR_MANY);
if (allocated) { // reset explicit cuts
@ -196,12 +196,12 @@ void PairBuckCoul::coeff(int narg, char **arg)
force->bounds(*(arg++),atom->ntypes,ilo,ihi);
force->bounds(*(arg++),atom->ntypes,jlo,jhi);
double buck_a_one = atof(*(arg++));
double buck_rho_one = atof(*(arg++));
double buck_c_one = atof(*(arg++));
double buck_a_one = force->numeric(*(arg++));
double buck_rho_one = force->numeric(*(arg++));
double buck_c_one = force->numeric(*(arg++));
double cut_buck_one = cut_buck_global;
if (narg == 6) cut_buck_one = atof(*(arg++));
if (narg == 6) cut_buck_one = force->numeric(*(arg++));
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -93,9 +93,9 @@ void PairLJCoul::settings(int narg, char **arg)
if (!comm->me && ewald_order==((1<<1)|(1<<6))) error->warning(PAIR_LARGEST);
if (!*(++arg)) error->all(PAIR_MISSING);
if (!((ewald_order^ewald_off)&(1<<1))) error->all(PAIR_COUL_CUT);
cut_lj_global = atof(*(arg++));
cut_lj_global = force->numeric(*(arg++));
if (*arg&&(ewald_order&0x42==0x42)) error->all(PAIR_CUTOFF);
cut_coul = *arg ? atof(*(arg++)) : cut_lj_global;
cut_coul = *arg ? force->numeric(*(arg++)) : cut_lj_global;
if (*arg) error->all(PAIR_MANY);
if (allocated) { // reset explicit cuts
@ -192,11 +192,11 @@ void PairLJCoul::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_lj_one = cut_lj_global;
if (narg == 5) cut_lj_one = atof(arg[4]);
if (narg == 5) cut_lj_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -13,6 +13,7 @@
#include "stdlib.h"
#include "string.h"
#include "ctype.h"
#include "force.h"
#include "atom.h"
#include "comm.h"
@ -460,6 +461,42 @@ void Force::bounds(char *str, int nmax, int &nlo, int &nhi)
}
}
/* ----------------------------------------------------------------------
read a floating point value from a string
generate an error if not a legitimate floating point value
called by force fields to check validity of their arguments
------------------------------------------------------------------------- */
double Force::numeric(char *str)
{
int n = strlen(str);
for (int i = 0; i < n; i++) {
if (isdigit(str[i])) continue;
if (str[i] == '-' || str[i] == '.') continue;
if (str[i] == 'e' || str[i] == 'E') continue;
error->all("Expecting floating point argument in input script");
}
return atof(str);
}
/* ----------------------------------------------------------------------
read an integer value from a string
generate an error if not a legitimate integer value
called by force fields to check validity of their arguments
------------------------------------------------------------------------- */
int Force::inumeric(char *str)
{
int n = strlen(str);
for (int i = 0; i < n; i++) {
if (isdigit(str[i]) || str[i] == '-') continue;
error->all("Expecting integer argument in input script");
}
return atoi(str);
}
/* ----------------------------------------------------------------------
memory usage of force classes
------------------------------------------------------------------------- */

View File

@ -82,6 +82,8 @@ class Force : protected Pointers {
void set_special(int, char **);
void bounds(char *, int, int &, int &);
double numeric(char *);
int inumeric(char *);
double memory_usage();
};

View File

@ -169,7 +169,7 @@ void PairBuck::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
@ -194,13 +194,13 @@ void PairBuck::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = atof(arg[2]);
double rho_one = atof(arg[3]);
double a_one = force->numeric(arg[2]);
double rho_one = force->numeric(arg[3]);
if (rho_one <= 0) error->all("Incorrect args for pair coefficients");
double c_one = atof(arg[4]);
double c_one = force->numeric(arg[4]);
double cut_one = cut_global;
if (narg == 6) cut_one = atof(arg[5]);
if (narg == 6) cut_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -198,9 +198,9 @@ void PairBuckCoulCut::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
cut_lj_global = atof(arg[0]);
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul_global = cut_lj_global;
else cut_coul_global = atof(arg[1]);
else cut_coul_global = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
@ -228,15 +228,15 @@ void PairBuckCoulCut::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = atof(arg[2]);
double rho_one = atof(arg[3]);
double a_one = force->numeric(arg[2]);
double rho_one = force->numeric(arg[3]);
if (rho_one <= 0) error->all("Incorrect args for pair coefficients");
double c_one = atof(arg[4]);
double c_one = force->numeric(arg[4]);
double cut_lj_one = cut_lj_global;
double cut_coul_one = cut_coul_global;
if (narg >= 6) cut_coul_one = cut_lj_one = atof(arg[5]);
if (narg == 7) cut_coul_one = atof(arg[6]);
if (narg >= 6) cut_coul_one = cut_lj_one = force->numeric(arg[5]);
if (narg == 7) cut_coul_one = force->numeric(arg[6]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -153,7 +153,7 @@ void PairCoulCut::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
@ -179,7 +179,7 @@ void PairCoulCut::coeff(int narg, char **arg)
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double cut_one = cut_global;
if (narg == 3) cut_one = atof(arg[2]);
if (narg == 3) cut_one = force->numeric(arg[2]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -124,8 +124,8 @@ void PairCoulDebye::settings(int narg, char **arg)
{
if (narg != 2) error->all("Illegal pair_style command");
kappa = atof(arg[0]);
cut_global = atof(arg[1]);
kappa = force->numeric(arg[0]);
cut_global = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set

View File

@ -449,7 +449,7 @@ void PairLJCut::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
@ -474,11 +474,11 @@ void PairLJCut::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_one = cut_global;
if (narg == 5) cut_one = atof(arg[4]);
if (narg == 5) cut_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -192,9 +192,9 @@ void PairLJCutCoulCut::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
cut_lj_global = atof(arg[0]);
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul_global = cut_lj_global;
else cut_coul_global = atof(arg[1]);
else cut_coul_global = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
@ -222,13 +222,13 @@ void PairLJCutCoulCut::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_lj_one = cut_lj_global;
double cut_coul_one = cut_coul_global;
if (narg >= 5) cut_coul_one = cut_lj_one = atof(arg[4]);
if (narg == 6) cut_coul_one = atof(arg[5]);
if (narg >= 5) cut_coul_one = cut_lj_one = force->numeric(arg[4]);
if (narg == 6) cut_coul_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -138,10 +138,10 @@ void PairLJCutCoulDebye::settings(int narg, char **arg)
{
if (narg < 2 || narg > 3) error->all("Illegal pair_style command");
kappa = atof(arg[0]);
cut_lj_global = atof(arg[1]);
kappa = force->numeric(arg[0]);
cut_lj_global = force->numeric(arg[1]);
if (narg == 2) cut_coul_global = cut_lj_global;
else cut_coul_global = atof(arg[2]);
else cut_coul_global = force->numeric(arg[2]);
// reset cutoffs that were previously set from data file

View File

@ -172,7 +172,7 @@ void PairLJExpand::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
@ -197,12 +197,12 @@ void PairLJExpand::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double shift_one = atof(arg[4]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double shift_one = force->numeric(arg[4]);
double cut_one = cut_global;
if (narg == 6) cut_one = atof(arg[5]);
if (narg == 6) cut_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -196,8 +196,8 @@ void PairLJGromacs::settings(int narg, char **arg)
{
if (narg != 2) error->all("Illegal pair_style command");
cut_inner_global = atof(arg[0]);
cut_global = atof(arg[1]);
cut_inner_global = force->numeric(arg[0]);
cut_global = force->numeric(arg[1]);
if (cut_inner_global <= 0.0 || cut_inner_global > cut_global)
error->all("Illegal pair_style command");
@ -229,14 +229,14 @@ void PairLJGromacs::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_inner_one = cut_inner_global;
double cut_one = cut_global;
if (narg == 6) {
cut_inner_one = atof(arg[4]);
cut_one = atof(arg[5]);
cut_inner_one = force->numeric(arg[4]);
cut_one = force->numeric(arg[5]);
}
if (cut_inner_one <= 0.0 || cut_inner_one > cut_one)

View File

@ -224,14 +224,14 @@ void PairLJGromacsCoulGromacs::settings(int narg, char **arg)
if (narg != 2 && narg != 4)
error->all("Illegal pair_style command");
cut_lj_inner = atof(arg[0]);
cut_lj = atof(arg[1]);
cut_lj_inner = force->numeric(arg[0]);
cut_lj = force->numeric(arg[1]);
if (narg == 2) {
cut_coul_inner = cut_lj_inner;
cut_coul = cut_lj;
} else {
cut_coul_inner = atof(arg[2]);
cut_coul = atof(arg[3]);
cut_coul_inner = force->numeric(arg[2]);
cut_coul = force->numeric(arg[3]);
}
if (cut_lj_inner <= 0.0 || cut_coul_inner < 0.0)
@ -253,8 +253,8 @@ void PairLJGromacsCoulGromacs::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -200,8 +200,8 @@ void PairLJSmooth::settings(int narg, char **arg)
{
if (narg != 2) error->all("Illegal pair_style command");
cut_inner_global = atof(arg[0]);
cut_global = atof(arg[1]);
cut_inner_global = force->numeric(arg[0]);
cut_global = force->numeric(arg[1]);
if (cut_inner_global <= 0.0 || cut_inner_global > cut_global)
error->all("Illegal pair_style command");
@ -233,14 +233,14 @@ void PairLJSmooth::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(arg[2]);
double sigma_one = force->numeric(arg[3]);
double cut_inner_one = cut_inner_global;
double cut_one = cut_global;
if (narg == 6) {
cut_inner_one = atof(arg[4]);
cut_one = atof(arg[5]);
cut_inner_one = force->numeric(arg[4]);
cut_one = force->numeric(arg[5]);
}
if (cut_inner_one <= 0.0 || cut_inner_one > cut_one)

View File

@ -162,7 +162,7 @@ void PairMorse::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
@ -187,12 +187,12 @@ void PairMorse::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double d0_one = atof(arg[2]);
double alpha_one = atof(arg[3]);
double r0_one = atof(arg[4]);
double d0_one = force->numeric(arg[2]);
double alpha_one = force->numeric(arg[3]);
double r0_one = force->numeric(arg[4]);
double cut_one = cut_global;
if (narg == 6) cut_one = atof(arg[5]);
if (narg == 6) cut_one = force->numeric(arg[5]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -185,7 +185,7 @@ void PairSoft::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(arg[0]);
// reset cutoffs that have been explicitly set
@ -210,11 +210,11 @@ void PairSoft::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double prestart_one = atof(arg[2]);
double prestop_one = atof(arg[3]);
double prestart_one = force->numeric(arg[2]);
double prestop_one = force->numeric(arg[3]);
double cut_one = cut_global;
if (narg == 5) cut_one = atof(arg[4]);
if (narg == 5) cut_one = force->numeric(arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -220,7 +220,7 @@ void PairTable::settings(int narg, char **arg)
else if (strcmp(arg[0],"bitmap") == 0) tabstyle = BITMAP;
else error->all("Unknown table style in pair_style command");
n = atoi(arg[1]);
n = force->inumeric(arg[1]);
nm1 = n - 1;
// delete old tables, since cannot just change settings
@ -263,7 +263,7 @@ void PairTable::coeff(int narg, char **arg)
// set table cutoff
if (narg == 5) tb->cut = atof(arg[4]);
if (narg == 5) tb->cut = force->numeric(arg[4]);
else if (tb->rflag) tb->cut = tb->rhi;
else tb->cut = tb->rfile[tb->ninput-1];

View File

@ -157,8 +157,8 @@ void PairYukawa::settings(int narg, char **arg)
{
if (narg != 2) error->all("Illegal pair_style command");
kappa = atof(arg[0]);
cut_global = atof(arg[1]);
kappa = force->numeric(arg[0]);
cut_global = force->numeric(arg[1]);
// reset cutoffs that have been explicitly set
@ -183,10 +183,10 @@ void PairYukawa::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = atof(arg[2]);
double a_one = force->numeric(arg[2]);
double cut_one = cut_global;
if (narg == 4) cut_one = atof(arg[3]);
if (narg == 4) cut_one = force->numeric(arg[3]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {