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

This commit is contained in:
sjplimp
2014-08-25 16:01:17 +00:00
parent 508ea4a575
commit 4ea728dc80
18 changed files with 73 additions and 52 deletions

View File

@ -1428,6 +1428,9 @@ void MSM::particle_map()
int flag = 0; int flag = 0;
if (!isfinite(boxlo[0]) || !isfinite(boxlo[1]) || !isfinite(boxlo[2]))
error->one(FLERR,"Non-numeric box dimensions. Simulation unstable.");
for (int i = 0; i < nlocal; i++) { for (int i = 0; i < nlocal; i++) {
// (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (nx,ny,nz) = global coords of grid pt to "lower left" of charge

View File

@ -309,6 +309,9 @@ void MSMCG::particle_map()
int flag = 0; int flag = 0;
int i; int i;
if (!isfinite(boxlo[0]) || !isfinite(boxlo[1]) || !isfinite(boxlo[2]))
error->one(FLERR,"Non-numeric box dimensions. Simulation unstable.");
for (int j = 0; j < num_charged; j++) { for (int j = 0; j < num_charged; j++) {
i = is_charged[j]; i = is_charged[j];

View File

@ -1875,6 +1875,10 @@ void PPPM::particle_map()
int nlocal = atom->nlocal; int nlocal = atom->nlocal;
int flag = 0; int flag = 0;
if (!isfinite(boxlo[0]) || !isfinite(boxlo[1]) || !isfinite(boxlo[2]))
error->one(FLERR,"Non-numeric box dimensions. Simulation unstable.");
for (int i = 0; i < nlocal; i++) { for (int i = 0; i < nlocal; i++) {
// (nx,ny,nz) = global coords of grid pt to "lower left" of charge // (nx,ny,nz) = global coords of grid pt to "lower left" of charge

View File

@ -282,6 +282,9 @@ void PPPMCG::particle_map()
double **x = atom->x; double **x = atom->x;
if (!isfinite(boxlo[0]) || !isfinite(boxlo[1]) || !isfinite(boxlo[2]))
error->one(FLERR,"Non-numeric box dimensions. Simulation unstable.");
int flag = 0; int flag = 0;
for (int j = 0; j < num_charged; j++) { for (int j = 0; j < num_charged; j++) {
int i = is_charged[j]; int i = is_charged[j];

View File

@ -4209,6 +4209,9 @@ void PPPMDisp::particle_map(double delx, double dely, double delz,
double **x = atom->x; double **x = atom->x;
int nlocal = atom->nlocal; int nlocal = atom->nlocal;
if (!isfinite(boxlo[0]) || !isfinite(boxlo[1]) || !isfinite(boxlo[2]))
error->one(FLERR,"Non-numeric box dimensions. Simulation unstable.");
int flag = 0; int flag = 0;
for (int i = 0; i < nlocal; i++) { for (int i = 0; i < nlocal; i++) {

View File

@ -78,6 +78,9 @@ void PPPMDispTIP4P::particle_map_c(double delx, double dely, double delz,
double **x = atom->x; double **x = atom->x;
int nlocal = atom->nlocal; int nlocal = atom->nlocal;
if (!isfinite(boxlo[0]) || !isfinite(boxlo[1]) || !isfinite(boxlo[2]))
error->one(FLERR,"Non-numeric box dimensions. Simulation unstable.");
int flag = 0; int flag = 0;
for (int i = 0; i < nlocal; i++) { for (int i = 0; i < nlocal; i++) {
if (type[i] == typeO) { if (type[i] == typeO) {

View File

@ -679,6 +679,9 @@ void PPPMStagger::particle_map()
double **x = atom->x; double **x = atom->x;
int nlocal = atom->nlocal; int nlocal = atom->nlocal;
if (!isfinite(boxlo[0]) || !isfinite(boxlo[1]) || !isfinite(boxlo[2]))
error->one(FLERR,"Non-numeric box dimensions. Simulation unstable.");
int flag = 0; int flag = 0;
for (int i = 0; i < nlocal; i++) { for (int i = 0; i < nlocal; i++) {

View File

@ -73,6 +73,9 @@ void PPPMTIP4P::particle_map()
double **x = atom->x; double **x = atom->x;
int nlocal = atom->nlocal; int nlocal = atom->nlocal;
if (!isfinite(boxlo[0]) || !isfinite(boxlo[1]) || !isfinite(boxlo[2]))
error->one(FLERR,"Non-numeric box dimensions. Simulation unstable.");
int flag = 0; int flag = 0;
for (int i = 0; i < nlocal; i++) { for (int i = 0; i < nlocal; i++) {
if (type[i] == typeO) { if (type[i] == typeO) {

View File

@ -57,16 +57,16 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) :
// 1 = Group ID (e.g., all) // 1 = Group ID (e.g., all)
// 2 = gld (name of this fix) // 2 = gld (name of this fix)
// 3 = t_start (Starting target temperature) // 3 = t_start (Starting target temperature)
t_start = atof(arg[3]); t_start = force->numeric(FLERR,arg[3]);
// 4 = t_stop (Stopping target temperature) // 4 = t_stop (Stopping target temperature)
t_stop = atof(arg[4]); t_stop = force->numeric(FLERR,arg[4]);
// 5 = prony_terms (number of terms in Prony series) // 5 = prony_terms (number of terms in Prony series)
prony_terms = atoi(arg[5]); prony_terms = force->inumeric(FLERR,arg[5]);
// 6 = seed (random seed) // 6 = seed (random seed)
int seed = atoi(arg[6]); int seed = force->inumeric(FLERR,arg[6]);
// 7 = series type // 7 = series type
if(strcmp(arg[7],"pprony") == 0) { if(strcmp(arg[7],"pprony") == 0) {
@ -101,8 +101,8 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) :
int iarg = narg_min; int iarg = narg_min;
int icoeff = 0; int icoeff = 0;
while (iarg < narg && icoeff < prony_terms) { while (iarg < narg && icoeff < prony_terms) {
double pc = atof(arg[iarg]); double pc = force->numeric(FLERR,arg[iarg]);
double ptau = atof(arg[iarg+1]); double ptau = force->numeric(FLERR,arg[iarg+1]);
if (pc < 0) if (pc < 0)
error->all(FLERR,"Fix gld c coefficients must be >= 0"); error->all(FLERR,"Fix gld c coefficients must be >= 0");

View File

@ -135,14 +135,7 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) :
// setup scaling // setup scaling
double xscale,yscale,zscale; const double zscale = (scaleflag) ? domain->lattice->zlattice : 1.0;
if (scaleflag) {
xscale = domain->lattice->xlattice;
yscale = domain->lattice->ylattice;
zscale = domain->lattice->zlattice;
}
else xscale = yscale = zscale = 1.0;
vz *= zscale; vz *= zscale;
z0 *= zscale; z0 *= zscale;
roughdist *= zscale; roughdist *= zscale;

View File

@ -354,6 +354,9 @@ void PPPMDispOMP::particle_map(double dxinv, double dyinv,
const int nyhi_out = nyhi_o; const int nyhi_out = nyhi_o;
const int nzhi_out = nzhi_o; const int nzhi_out = nzhi_o;
if (!isfinite(boxlo[0]) || !isfinite(boxlo[1]) || !isfinite(boxlo[2]))
error->one(FLERR,"Non-numeric box dimensions. Simulation unstable.");
int i, flag = 0; int i, flag = 0;
#if defined(_OPENMP) #if defined(_OPENMP)
#pragma omp parallel for private(i) default(none) reduction(+:flag) schedule(static) #pragma omp parallel for private(i) default(none) reduction(+:flag) schedule(static)

View File

@ -775,11 +775,10 @@ void CommTiled::exchange()
void CommTiled::borders() void CommTiled::borders()
{ {
int i,m,n,irecv,nlast,nsend,nrecv,ngroup,ncount,ncountall; int i,m,n,nlast,nsend,nrecv,ngroup,ncount,ncountall;
double xlo,xhi,ylo,yhi,zlo,zhi; double xlo,xhi,ylo,yhi,zlo,zhi;
double *bbox; double *bbox;
double **x; double **x;
MPI_Status status;
AtomVec *avec = atom->avec; AtomVec *avec = atom->avec;
// send/recv max one = max # of atoms in single send/recv for any swap // send/recv max one = max # of atoms in single send/recv for any swap
@ -1371,7 +1370,7 @@ void CommTiled::reverse_comm_dump(Dump *dump)
void CommTiled::forward_comm_array(int nsize, double **array) void CommTiled::forward_comm_array(int nsize, double **array)
{ {
int i,j,k,m,n,iatom,last,irecv,nsend,nrecv; int i,j,k,m,iatom,last,irecv,nsend,nrecv;
MPI_Status status; MPI_Status status;
// insure send/recv bufs are big enough for nsize // insure send/recv bufs are big enough for nsize
@ -1732,7 +1731,6 @@ int CommTiled::point_drop_tiled(int idim, double *x)
if (!done) proc = point_drop_tiled_recurse(xnew,0,nprocs-1); if (!done) proc = point_drop_tiled_recurse(xnew,0,nprocs-1);
} }
} else if (idim == 1) { } else if (idim == 1) {
int done = 1;
if (rcbinfo[proc].mysplit[2][0] == rcbinfo[me].mysplit[2][1]) { if (rcbinfo[proc].mysplit[2][0] == rcbinfo[me].mysplit[2][1]) {
xnew[2] -= EPSILON * (subhi[2]-sublo[2]); xnew[2] -= EPSILON * (subhi[2]-sublo[2]);
proc = point_drop_tiled_recurse(xnew,0,nprocs-1); proc = point_drop_tiled_recurse(xnew,0,nprocs-1);

View File

@ -38,9 +38,9 @@ ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) :
tempflag = 1; tempflag = 1;
tempbias = 1; tempbias = 1;
xflag = atoi(arg[3]); xflag = force->inumeric(FLERR,arg[3]);
yflag = atoi(arg[4]); yflag = force->inumeric(FLERR,arg[4]);
zflag = atoi(arg[5]); zflag = force->inumeric(FLERR,arg[5]);
if (zflag && domain->dimension == 2) if (zflag && domain->dimension == 2)
error->all(FLERR,"Compute temp/partial cannot use vz for 2d systemx"); error->all(FLERR,"Compute temp/partial cannot use vz for 2d systemx");

View File

@ -41,9 +41,9 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
tempflag = 1; tempflag = 1;
tempbias = 1; tempbias = 1;
xflag = atoi(arg[3]); xflag = force->inumeric(FLERR,arg[3]);
yflag = atoi(arg[4]); yflag = force->inumeric(FLERR,arg[4]);
zflag = atoi(arg[5]); zflag = force->inumeric(FLERR,arg[5]);
if (zflag && domain->dimension == 2) if (zflag && domain->dimension == 2)
error->all(FLERR,"Compute temp/profile cannot use vz for 2d systemx"); error->all(FLERR,"Compute temp/profile cannot use vz for 2d systemx");
@ -59,44 +59,44 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
int iarg = 6; int iarg = 6;
if (strcmp(arg[iarg],"x") == 0) { if (strcmp(arg[iarg],"x") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command");
nbinx = atoi(arg[iarg+1]); nbinx = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"y") == 0) { } else if (strcmp(arg[iarg],"y") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command");
nbiny = atoi(arg[iarg+1]); nbiny = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"z") == 0) { } else if (strcmp(arg[iarg],"z") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command");
if (domain->dimension == 2) if (domain->dimension == 2)
error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems");
nbinz = atoi(arg[iarg+1]); nbinz = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"xy") == 0) { } else if (strcmp(arg[iarg],"xy") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command");
nbinx = atoi(arg[iarg+1]); nbinx = force->inumeric(FLERR,arg[iarg+1]);
nbiny = atoi(arg[iarg+2]); nbiny = force->inumeric(FLERR,arg[iarg+2]);
iarg += 3; iarg += 3;
} else if (strcmp(arg[iarg],"yz") == 0) { } else if (strcmp(arg[iarg],"yz") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command");
if (domain->dimension == 2) if (domain->dimension == 2)
error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems");
nbiny = atoi(arg[iarg+1]); nbiny = force->inumeric(FLERR,arg[iarg+1]);
nbinz = atoi(arg[iarg+2]); nbinz = force->inumeric(FLERR,arg[iarg+2]);
iarg += 3; iarg += 3;
} else if (strcmp(arg[iarg],"xz") == 0) { } else if (strcmp(arg[iarg],"xz") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command");
if (domain->dimension == 2) if (domain->dimension == 2)
error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems");
nbinx = atoi(arg[iarg+1]); nbinx = force->inumeric(FLERR,arg[iarg+1]);
nbinz = atoi(arg[iarg+2]); nbinz = force->inumeric(FLERR,arg[iarg+2]);
iarg += 3; iarg += 3;
} else if (strcmp(arg[iarg],"xyz") == 0) { } else if (strcmp(arg[iarg],"xyz") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (iarg+4 > narg) error->all(FLERR,"Illegal compute temp/profile command");
if (domain->dimension == 2) if (domain->dimension == 2)
error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems");
nbinx = atoi(arg[iarg+1]); nbinx = force->inumeric(FLERR,arg[iarg+1]);
nbiny = atoi(arg[iarg+2]); nbiny = force->inumeric(FLERR,arg[iarg+2]);
nbinz = atoi(arg[iarg+3]); nbinz = force->inumeric(FLERR,arg[iarg+3]);
iarg += 4; iarg += 4;
} else error->all(FLERR,"Illegal compute temp/profile command"); } else error->all(FLERR,"Illegal compute temp/profile command");

View File

@ -74,14 +74,14 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) :
else error->all(FLERR,"Illegal compute temp/ramp command"); else error->all(FLERR,"Illegal compute temp/ramp command");
if (v_dim == 0) { if (v_dim == 0) {
v_lo = xscale*atof(arg[4]); v_lo = xscale*force->numeric(FLERR,arg[4]);
v_hi = xscale*atof(arg[5]); v_hi = xscale*force->numeric(FLERR,arg[5]);
} else if (v_dim == 1) { } else if (v_dim == 1) {
v_lo = yscale*atof(arg[4]); v_lo = yscale*force->numeric(FLERR,arg[4]);
v_hi = yscale*atof(arg[5]); v_hi = yscale*force->numeric(FLERR,arg[5]);
} else if (v_dim == 2) { } else if (v_dim == 2) {
v_lo = zscale*atof(arg[4]); v_lo = zscale*force->numeric(FLERR,arg[4]);
v_hi = zscale*atof(arg[5]); v_hi = zscale*force->numeric(FLERR,arg[5]);
} }
if (strcmp(arg[6],"x") == 0) coord_dim = 0; if (strcmp(arg[6],"x") == 0) coord_dim = 0;
@ -90,14 +90,14 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) :
else error->all(FLERR,"Illegal compute temp/ramp command"); else error->all(FLERR,"Illegal compute temp/ramp command");
if (coord_dim == 0) { if (coord_dim == 0) {
coord_lo = xscale*atof(arg[7]); coord_lo = xscale*force->numeric(FLERR,arg[7]);
coord_hi = xscale*atof(arg[8]); coord_hi = xscale*force->numeric(FLERR,arg[8]);
} else if (coord_dim == 1) { } else if (coord_dim == 1) {
coord_lo = yscale*atof(arg[7]); coord_lo = yscale*force->numeric(FLERR,arg[7]);
coord_hi = yscale*atof(arg[8]); coord_hi = yscale*force->numeric(FLERR,arg[8]);
} else if (coord_dim == 2) { } else if (coord_dim == 2) {
coord_lo = zscale*atof(arg[7]); coord_lo = zscale*force->numeric(FLERR,arg[7]);
coord_hi = zscale*atof(arg[8]); coord_hi = zscale*force->numeric(FLERR,arg[8]);
} }
maxbias = 0; maxbias = 0;

View File

@ -25,6 +25,8 @@
#include "special.h" #include "special.h"
#include "error.h" #include "error.h"
#include <stdlib.h>
using namespace LAMMPS_NS; using namespace LAMMPS_NS;
enum{MULTI,ATOM,BOND,ANGLE,DIHEDRAL,IMPROPER,STATS}; enum{MULTI,ATOM,BOND,ANGLE,DIHEDRAL,IMPROPER,STATS};
@ -80,7 +82,6 @@ void DeleteBonds::command(int narg, char **arg)
int *tlist = NULL; int *tlist = NULL;
int iarg = 2; int iarg = 2;
int which;
if (style != MULTI && style != STATS) { if (style != MULTI && style != STATS) {
if (narg < 3) error->all(FLERR,"Illegal delete_bonds command"); if (narg < 3) error->all(FLERR,"Illegal delete_bonds command");

View File

@ -176,7 +176,6 @@ void RCB::compute(int dimension, int n, double **x, double *wt,
// procmid = 1st proc in upper half of partition // procmid = 1st proc in upper half of partition
int procpartner,procpartner2; int procpartner,procpartner2;
int readnumber;
int procmid; int procmid;
int proclower = 0; int proclower = 0;
@ -656,7 +655,6 @@ void median_merge(void *in, void *inout, int *len, MPI_Datatype *dptr)
void RCB::invert(int sortflag) void RCB::invert(int sortflag)
{ {
Invert *sbuf,*rbuf;
// only create Irregular if not previously created // only create Irregular if not previously created
// allows Irregular to persist for multiple RCB calls by fix balance // allows Irregular to persist for multiple RCB calls by fix balance

View File

@ -459,7 +459,10 @@ void ReadRestart::command(int narg, char **arg)
// in case read by different proc than wrote restart file // in case read by different proc than wrote restart file
// first do map_init() since irregular->migrate_atoms() will do map_clear() // first do map_init() since irregular->migrate_atoms() will do map_clear()
if (atom->map_style) atom->map_init(); if (atom->map_style) {
atom->map_init();
atom->map_set();
}
if (domain->triclinic) domain->x2lamda(atom->nlocal); if (domain->triclinic) domain->x2lamda(atom->nlocal);
Irregular *irregular = new Irregular(lmp); Irregular *irregular = new Irregular(lmp);
irregular->migrate_atoms(1); irregular->migrate_atoms(1);