git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14088 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -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,15 +5395,9 @@ 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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
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;
|
||||
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");
|
||||
|
||||
@ -3292,10 +3292,11 @@ 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
|
||||
|
||||
pack_flag = 1;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -249,11 +249,12 @@ 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;
|
||||
size_vector = n;
|
||||
|
||||
@ -230,11 +230,12 @@ 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");
|
||||
memory->create(store_tmp,3*size_array_rows,"xrd:store_tmp");
|
||||
@ -343,11 +344,12 @@ 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;
|
||||
|
||||
|
||||
@ -156,10 +156,11 @@ 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));
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
if order > 0 : set up per thread storage for PPPM
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
24
src/info.cpp
24
src/info.cpp
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user