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

This commit is contained in:
sjplimp
2015-10-05 15:13:56 +00:00
parent 6f038ab6d0
commit 56ee1b670b
13 changed files with 32 additions and 58 deletions

View File

@ -913,10 +913,6 @@ void PairBOP::gneigh()
if(i12>=npairs) {
error->one(FLERR,"Too many atom pairs for pair bop");
}
ps=rij[temp_ij];
ps=rdr[i12];
ps=pBetaS1[i12][ks-1];
ps=pBetaS[i12][ks-1];
ps=rij[temp_ij]*rdr[i12]+1.0;
ks=(int)ps;
if(nr-1<ks)
@ -1052,10 +1048,6 @@ void PairBOP::theta()
neigh_flag3[temp_ij]=1;
else
neigh_flag3[temp_ij]=0;
ps=rij[temp_ij];
ps=rdr[i12];
ps=pBetaS1[i12][ks-1];
ps=pBetaS[i12][ks-1];
ps=rij[temp_ij]*rdr[i12]+1.0;
ks=(int)ps;
if(nr-1<ks)
@ -4966,8 +4958,8 @@ double PairBOP::PiBo(int itmp, int jtmp)
}
}
}
return(piB);
destroy_pi();
return(piB);
}
/* ----------------------------------------------------------------------
@ -5403,14 +5395,8 @@ void PairBOP::read_table(char *filename)
gfunc6[j][i][k][n]=gfunc6[k][i][j][n];
}
} else {
if(nws==3) {
for(n=0;n<npower+1;n++) {
gpara[j][i][k][n]=gpara[k][i][j][n];
}
} else {
for(n=0;n<npower+1;n++) {
gpara[j][i][k][n]=gpara[k][i][j][n];
}
for(n=0;n<npower+1;n++) {
gpara[j][i][k][n]=gpara[k][i][j][n];
}
}
}
@ -5762,11 +5748,8 @@ double PairBOP::memory_usage()
void PairBOP::memory_theta_create()
{
if(maxneigh<8)
neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
else
neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
if(neigh_ct<0) neigh_ct=0;
neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
if(neigh_ct<1) neigh_ct=1;
memory->create(itypeSigBk,neigh_ct,"itypeSigBk");
memory->create(itypePiBk,neigh_ct,"itypePiBk");
memory->create(neigh_flag,neigh_total,"neigh_flag");
@ -5792,11 +5775,8 @@ void PairBOP::memory_theta_create()
void PairBOP::memory_theta_grow()
{
if(maxneigh<8)
neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
else
neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
if(neigh_ct<0) neigh_ct=0;
neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
if(neigh_ct<1) neigh_ct=1;
memory->grow(itypeSigBk,neigh_ct,"itypeSigBk");
memory->grow(itypePiBk,neigh_ct,"itypePiBk");
memory->grow(neigh_flag,neigh_total,"neigh_flag");

View File

@ -3292,9 +3292,10 @@ double PairComb3::combqeq(double *qf_fix, int &igroup)
qf = qf_fix;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
if (mask[i] & groupbit)
if (mask[i] & groupbit) {
qf[i] = 0.0;
dpl[i][0] = dpl[i][1] = dpl[i][2] = 0.0;
}
}
// communicating charge force to all nodes, first forward then reverse

View File

@ -435,7 +435,7 @@ void FixOrientFCC::post_force(int vflag)
if (nstats && update->ntimestep % nstats == 0) {
int total;
MPI_Allreduce(&count,&total,1,MPI_INT,MPI_SUM,world);
double ave = total/atom->natoms;
double ave = static_cast<double>(total)/atom->natoms;
int min,max;
MPI_Allreduce(&mincount,&min,1,MPI_INT,MPI_MIN,world);

View File

@ -85,8 +85,8 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[iarg],"rmin0") == 0) {
if (iarg+2 > narg)
error->all(FLERR,"Illegal compute snad/atom command");
rmin0 = atof(arg[iarg+1]);
iarg += 2;
rmin0 = atof(arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"switchflag") == 0) {
if (iarg+2 > narg)
error->all(FLERR,"Illegal compute snad/atom command");

View File

@ -374,7 +374,7 @@ void AngleSDK::ev_tally13(int i, int j, int nlocal, int newton_bond,
}
if (eflag_atom) {
if (newton_bond || i < nlocal) eatom[i] += 0.5*evdwl;
if (newton_bond || j < nlocal) eatom[i] += 0.5*evdwl;
if (newton_bond || j < nlocal) eatom[j] += 0.5*evdwl;
}
}

View File

@ -249,10 +249,11 @@ ComputeSAED::ComputeSAED(LAMMPS *lmp, int narg, char **arg) :
}
if (me == 0) {
if (screen && echo)
if (screen && echo) {
fprintf(screen,"-----\nCompute SAED id:%s, # of atoms:%d, # of relp:%d\n",id,natoms,n);
fprintf(screen,"Reciprocal point spacing in k1,k2,k3 = %g %g %g\n-----\n",
dK[0], dK[1], dK[2]);
}
}
nRows = n;

View File

@ -230,10 +230,11 @@ ComputeXRD::ComputeXRD(LAMMPS *lmp, int narg, char **arg) :
size_array_cols = 2;
if (me == 0) {
if (screen && echo)
if (screen && echo) {
fprintf(screen,"-----\nCompute XRD id:%s, # of atoms:%d, # of relp:%d\n",id,natoms,nRows);
fprintf(screen,"Reciprocal point spacing in k1,k2,k3 = %g %g %g\n-----\n",
dK[0], dK[1], dK[2]);
}
}
memory->create(array,size_array_rows,size_array_cols,"xrd:array");
@ -343,10 +344,11 @@ void ComputeXRD::compute_array()
#endif
if (me == 0 && echo) {
if (screen)
if (screen) {
fprintf(screen,"\n");
if (LP == 1)
fprintf(screen,"Applying Lorentz-Polarization Factor During XRD Calculation 2\n");
}
}
int m = 0;
double frac = 0.1;

View File

@ -156,9 +156,10 @@ void ThrData::init_eim(int nall, double *rho, double *fp)
{
init_eam(nall, rho);
if (nall >= 0 && fp)
if (nall >= 0 && fp) {
_fp = fp + _tid*nall;
memset(_fp,0,nall*sizeof(double));
}
}
/* ----------------------------------------------------------------------

View File

@ -782,7 +782,7 @@ void ThrOMP::ev_tally_thr(Bond * const bond, const int i, const int j, const int
v_tally(thr->vatom_bond[i],v);
v_tally(thr->vatom_bond[j],v);
} else {
if (j < nlocal)
if (i < nlocal)
v_tally(thr->vatom_bond[i],v);
if (j < nlocal)
v_tally(thr->vatom_bond[j],v);
@ -862,7 +862,7 @@ void ThrOMP::ev_tally_thr(Angle * const angle, const int i, const int j, const i
v_tally(thr->vatom_angle[j],v);
v_tally(thr->vatom_angle[k],v);
} else {
if (j < nlocal) v_tally(thr->vatom_angle[i],v);
if (i < nlocal) v_tally(thr->vatom_angle[i],v);
if (j < nlocal) v_tally(thr->vatom_angle[j],v);
if (k < nlocal) v_tally(thr->vatom_angle[k],v);
}

View File

@ -544,13 +544,13 @@ bool Info::is_available(const char *category, const char *name)
{
if ((category == NULL) || (name == NULL)) return false;
const int len = strlen(name);
int match = 0;
if (strcmp(category,"command") == 0) {
int match = 0;
return (input->command_map->find(name) != input->command_map->end());
if (input->command_map->find(name) != input->command_map->end());
match = 1;
} else if (strcmp(category,"compute") == 0) {
int match = 0;
if (modify->compute_map->find(name) != modify->compute_map->end())
match = 1;
@ -570,10 +570,7 @@ bool Info::is_available(const char *category, const char *name)
delete[] name_w_suffix;
}
}
return match ? true : false;
} else if (strcmp(category,"fix") == 0) {
int match = 0;
if (modify->fix_map->find(name) != modify->fix_map->end())
match = 1;
@ -593,10 +590,7 @@ bool Info::is_available(const char *category, const char *name)
delete[] name_w_suffix;
}
}
return match ? true : false;
} else if (strcmp(category,"pair_style") == 0) {
int match = 0;
if (force->pair_map->find(name) != force->pair_map->end())
match = 1;
@ -616,9 +610,9 @@ bool Info::is_available(const char *category, const char *name)
delete[] name_w_suffix;
}
}
return match ? true : false;
} else error->all(FLERR,"Unknown category for is_available()");
return match ? true : false;
}
/* ---------------------------------------------------------------------- */
@ -639,7 +633,6 @@ bool Info::is_defined(const char *category, const char *name)
if (strcmp(compute[i]->id,name) == 0)
return true;
}
return false;
} else if (strcmp(category,"dump") == 0) {
int ndump = output->ndump;
Dump **dump = output->dump;
@ -647,7 +640,6 @@ bool Info::is_defined(const char *category, const char *name)
if (strcmp(dump[i]->id,name) == 0)
return true;
}
return false;
} else if (strcmp(category,"fix") == 0) {
int nfix = modify->nfix;
Fix **fix = modify->fix;
@ -655,7 +647,6 @@ bool Info::is_defined(const char *category, const char *name)
if (strcmp(fix[i]->id,name) == 0)
return true;
}
return false;
} else if (strcmp(category,"group") == 0) {
int ngroup = group->ngroup;
char **names = group->names;
@ -663,7 +654,6 @@ bool Info::is_defined(const char *category, const char *name)
if (strcmp(names[i],name) == 0)
return true;
}
return false;
} else if (strcmp(category,"region") == 0) {
int nreg = domain->nregion;
Region **regs = domain->regions;
@ -671,7 +661,6 @@ bool Info::is_defined(const char *category, const char *name)
if (strcmp(regs[i]->id,name) == 0)
return true;
}
return false;
} else if (strcmp(category,"variable") == 0) {
int nvar = input->variable->nvar;
char **names = input->variable->names;
@ -679,6 +668,7 @@ bool Info::is_defined(const char *category, const char *name)
if (strcmp(names[i],name) == 0)
return true;
}
return false;
} else error->all(FLERR,"Unknown category for is_defined()");
return false;
}

View File

@ -211,7 +211,7 @@ void Min::setup()
// ndoftotal = total dof for entire minimization problem
// dof for atoms, extra per-atom, extra global
bigint ndofme = 3*atom->nlocal;
bigint ndofme = 3 * static_cast<bigint>(atom->nlocal);
for (int m = 0; m < nextra_atom; m++)
ndofme += extra_peratom[m]*atom->nlocal;
MPI_Allreduce(&ndofme,&ndoftotal,1,MPI_LMP_BIGINT,MPI_SUM,world);

View File

@ -47,7 +47,7 @@ void Minimize::command(int narg, char **arg)
update->whichflag = 2;
update->beginstep = update->firststep = update->ntimestep;
update->endstep = update->laststep = update->firststep + update->nsteps;
if (update->laststep < 0 || update->laststep > MAXBIGINT)
if (update->laststep < 0)
error->all(FLERR,"Too many iterations");
lmp->init();

View File

@ -421,7 +421,6 @@ void Update::reset_timestep(bigint newstep)
{
ntimestep = newstep;
if (ntimestep < 0) error->all(FLERR,"Timestep must be >= 0");
if (ntimestep > MAXBIGINT) error->all(FLERR,"Too big a timestep");
// set atimestep to new timestep
// so future update_time() calls will be correct