consistent formatting: adjust cases of "dangling else", add curly braces

This commit is contained in:
Axel Kohlmeyer
2018-12-29 14:47:50 -05:00
parent c588b44cf1
commit 991ca25dd7
18 changed files with 127 additions and 196 deletions

View File

@ -195,8 +195,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else{
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,1,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -204,8 +203,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,1,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,1,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -214,8 +212,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,0,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -223,8 +220,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,0,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else{
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,0,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -234,8 +230,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,1,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -243,8 +238,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,1,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,1,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -253,8 +247,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,0,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -262,8 +255,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,0,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,0,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -274,8 +266,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,1,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -283,8 +274,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,1,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,1,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -293,8 +283,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,0,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -302,8 +291,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,0,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,0,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -313,8 +301,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,1,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -322,8 +309,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,1,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,1,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -332,8 +318,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,0,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -341,8 +326,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,0,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,0,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -354,8 +338,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,1,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -363,8 +346,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,1,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,1,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -373,8 +355,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,0,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -382,8 +363,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,0,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,0,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -393,8 +373,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,1,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -402,8 +381,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,1,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,1,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -412,8 +390,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,0,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -421,8 +398,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,0,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,0,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -433,8 +409,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,1,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -442,8 +417,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,1,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,1,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -452,8 +426,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,0,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -461,8 +434,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,0,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,0,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -472,8 +444,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,1,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -481,8 +452,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,1,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,1,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -491,8 +461,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,0,1,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}
@ -500,8 +469,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,0,0,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
}
else {
} else {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,0,0,0> post_functor(this);
Kokkos::parallel_for(nlocal,post_functor);
}

View File

@ -530,9 +530,7 @@ int PairReaxCKokkos<DeviceType>::Init_Lookup_Tables()
Natural_Cubic_Spline( &h[1], &fCEclmb[1],
&(LR[i][j].CEclmb[1]), control->tabulate+1,
world );
}// else{
// LR[i][j].n = 0;
//}//
}
}
free(h);
free(fh);
@ -622,7 +620,7 @@ void PairReaxCKokkos<DeviceType>::LR_vdW_Coulomb( int i, int j, double r_ij, LR_
lr->CEvd = dTap * twbp->D * (exp1 - 2.0 * exp2) -
Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13;
}
else{ // no shielding
else { // no shielding
exp1 = exp( twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
exp2 = exp( 0.5 * twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );

View File

@ -274,13 +274,12 @@ void PairAWPMDCut::compute(int eflag, int vflag)
int i = ilist[ii];
if(gmap[i]<0) // this particle was filtered out
continue;
if(spin[i]==0){ // this is an ion, copying forces
if (spin[i]==0) { // this is an ion, copying forces
int ion=gmap[i];
f[i][0]=fi[ion][0];
f[i][0]=fi[ion][1];
f[i][0]=fi[ion][2];
}
else { // electron
} else { // electron
int iel=gmap[i];
int s=spin[i] >0 ? 0 : 1;
wpmd->get_wp_force(s,iel,(Vector_3 *)f[i],(Vector_3 *)(atom->vforce+3*i),atom->erforce+i,atom->ervelforce+i,(Vector_2 *)(atom->csforce+2*i));
@ -304,12 +303,11 @@ void PairAWPMDCut::compute(int eflag, int vflag)
if (eflag_atom) {
// transfer per-atom energies here
for (int i = 0; i < ntot; i++) {
if(gmap[i]<0) // this particle was filtered out
if (gmap[i]<0) // this particle was filtered out
continue;
if(spin[i]==0){
if (spin[i]==0) {
eatom[i]=wpmd->Eiep[gmap[i]]+wpmd->Eiip[gmap[i]];
}
else {
} else {
int s=spin[i] >0 ? 0 : 1;
eatom[i]=wpmd->Eep[s][gmap[i]]+wpmd->Eeip[s][gmap[i]]+wpmd->Eeep[s][gmap[i]]+wpmd->Ewp[s][gmap[i]];
}
@ -474,9 +472,9 @@ void PairAWPMDCut::coeff(int narg, char **arg)
if(cut_global<0)
cut_global=half_box_length;
if (!allocated)
if (!allocated) {
allocate();
else{
} else {
int i,j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++)

View File

@ -1017,9 +1017,9 @@ void FixLbFluid::peskin_interpolation(int i)
for(ii=-1; ii<3; ii++){
rsq=(-dx1+ii)*(-dx1+ii);
if(rsq>=4)
if(rsq>=4) {
weightx=0.0;
else{
} else {
r=sqrt(rsq);
if(rsq>1){
weightx=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.;
@ -1029,9 +1029,9 @@ void FixLbFluid::peskin_interpolation(int i)
}
for(jj=-1; jj<3; jj++){
rsq=(-dy1+jj)*(-dy1+jj);
if(rsq>=4)
if(rsq>=4) {
weighty=0.0;
else{
} else {
r=sqrt(rsq);
if(rsq>1){
weighty=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.;
@ -1041,9 +1041,9 @@ void FixLbFluid::peskin_interpolation(int i)
}
for(kk=-1; kk<3; kk++){
rsq=(-dz1+kk)*(-dz1+kk);
if(rsq>=4)
if(rsq>=4) {
weightz=0.0;
else{
} else {
r=sqrt(rsq);
if(rsq>1){
weightz=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.;
@ -1090,8 +1090,7 @@ require more frequent neighborlist rebuilds");
massone = massone/dm_lb;
gammavalue = 2.0*(mnode*massone)*dtoverdtcollision/(mnode+massone);
}
else{
} else {
gammavalue = Gamma[type[i]];
}
@ -2836,8 +2835,7 @@ void FixLbFluid::update_full15(void)
}
}
}
}
else{
} else {
update_periodic(1,subNbx-1,1,subNby-1,subNbz-2,subNbz-1);
}
}
@ -2866,8 +2864,7 @@ void FixLbFluid::update_full15(void)
if(typeLB == 1){
fnew[i][j][k][5]=fnew[i][j][k-1][6];
tmp1=fnew[i][j][k-1][11]+fnew[i][j][k-1][12]+fnew[i][j][k-1][13]+fnew[i][j][k-1][14];
}
else{
} else {
fnew[i][j][k][5]=fnew[i][j][k-1][6] + (0.5-Dcoeff*(tau+0.5))*feqn[i][j][k+1][5];
tmp1=fnew[i][j][k-1][11]+fnew[i][j][k-1][12]+fnew[i][j][k-1][13]+fnew[i][j][k-1][14] +
(0.5-Dcoeff*(tau+0.5))*(feqn[i-1][j-1][k+1][7] + feqn[i+1][j-1][k+1][8] +
@ -2908,8 +2905,7 @@ void FixLbFluid::update_full15(void)
if(typeLB == 1){
fnew[i][j][k][6]=fnew[i][j][k+1][5];
tmp1=fnew[i][j][k+1][7]+fnew[i][j][k+1][8]+fnew[i][j][k+1][9]+fnew[i][j][k+1][10];
}
else{
} else {
fnew[i][j][k][6]=fnew[i][j][k+1][5] + (0.5-Dcoeff*(tau+0.5))*feqn[i][j][k-1][6];
tmp1=fnew[i][j][k+1][7]+fnew[i][j][k+1][8]+fnew[i][j][k+1][9]+fnew[i][j][k+1][10] +
(0.5-Dcoeff*(tau+0.5))*(feqn[i-1][j-1][k-1][11] + feqn[i+1][j-1][k-1][12] +
@ -2941,7 +2937,7 @@ void FixLbFluid::update_full15(void)
//--------------------------------------------------------------------------
// Periodic z boundary conditions.
//--------------------------------------------------------------------------
}else {
} else {
for(i=0; i<numrequests; i++)
requests[i]=MPI_REQUEST_NULL;
@ -3193,8 +3189,7 @@ void FixLbFluid::update_full19(void)
}
}
}
}
else{
} else {
update_periodic(1,subNbx-1,1,subNby-1,subNbz-2,subNbz-1);
}
}
@ -3224,8 +3219,7 @@ void FixLbFluid::update_full19(void)
if(typeLB == 1){
fnew[i][j][k][5]=fnew[i][j][k-1][6];
tmp1=fnew[i][j][k-1][12]+fnew[i][j][k-1][14]+fnew[i][j][k-1][16]+fnew[i][j][k-1][18];
}
else{
} else {
fnew[i][j][k][5]=fnew[i][j][k-1][6] + (0.5-Dcoeff*(tau+0.5))*feqn[i][j][k+1][5];
tmp1=fnew[i][j][k-1][12]+fnew[i][j][k-1][14]+fnew[i][j][k-1][16]+fnew[i][j][k-1][18] +
(0.5-Dcoeff*(tau+0.5))*(feqn[i-1][j][k+1][11] + feqn[i+1][j][k+1][13] +
@ -3261,8 +3255,7 @@ void FixLbFluid::update_full19(void)
if(typeLB == 1){
fnew[i][j][k][6]=fnew[i][j][k+1][5];
tmp1=fnew[i][j][k+1][11]+fnew[i][j][k+1][13]+fnew[i][j][k+1][15]+fnew[i][j][k+1][17];
}
else{
} else {
fnew[i][j][k][6]=fnew[i][j][k+1][5] + (0.5-Dcoeff*(tau+0.5))*feqn[i][j][k-1][6];
tmp1=fnew[i][j][k+1][11]+fnew[i][j][k+1][13]+fnew[i][j][k+1][15]+fnew[i][j][k+1][17] +
(0.5-Dcoeff*(tau+0.5))*(feqn[i-1][j][k-1][12] + feqn[i+1][j][k-1][14] +
@ -3290,7 +3283,7 @@ void FixLbFluid::update_full19(void)
//--------------------------------------------------------------------------
// Periodic z boundary conditions.
//--------------------------------------------------------------------------
}else {
} else {
for(i=0; i<numrequests; i++)
requests[i]=MPI_REQUEST_NULL;

View File

@ -387,9 +387,9 @@ int FixLbPC::unpack_exchange(int nlocal, double *buf)
for(ii=-1; ii<3; ii++){
rsq=(-dx1+ii)*(-dx1+ii);
if(rsq>=4)
if(rsq>=4) {
weightx=0.0;
else{
} else {
r=sqrt(rsq);
if(rsq>1){
weightx=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.;
@ -399,9 +399,9 @@ int FixLbPC::unpack_exchange(int nlocal, double *buf)
}
for(jj=-1; jj<3; jj++){
rsq=(-dy1+jj)*(-dy1+jj);
if(rsq>=4)
if(rsq>=4) {
weighty=0.0;
else{
} else {
r=sqrt(rsq);
if(rsq>1){
weighty=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.;
@ -411,9 +411,9 @@ int FixLbPC::unpack_exchange(int nlocal, double *buf)
}
for(kk=-1; kk<3; kk++){
rsq=(-dz1+kk)*(-dz1+kk);
if(rsq>=4)
if(rsq>=4) {
weightz=0.0;
else{
} else {
r=sqrt(rsq);
if(rsq>1){
weightz=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.;

View File

@ -328,7 +328,7 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) :
MPI_Allreduce(ncount,nrigid,nbody,MPI_INT,MPI_SUM,world);
//count the number of atoms in the shell.
if(inner_nodes == 1){
if (inner_nodes == 1) {
int *mask = atom->mask;
for(ibody=0; ibody<nbody; ibody++) ncount[ibody] = 0;
for(i=0; i<nlocal; i++){
@ -338,7 +338,7 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) :
}
MPI_Allreduce(ncount,nrigid_shell,nbody,MPI_INT,MPI_SUM,world);
}else {
} else {
for(ibody=0; ibody < nbody; ibody++) nrigid_shell[ibody]=nrigid[ibody];
}
@ -1336,8 +1336,9 @@ void FixLbRigidPCSphere::pre_neighbor()
original = imagebody[ibody];
domain->remap(xcm[ibody],imagebody[ibody]);
if (original == imagebody[ibody]) remapflag[ibody][3] = 0;
else {
if (original == imagebody[ibody]) {
remapflag[ibody][3] = 0;
} else {
oldimage = original & IMGMASK;
newimage = imagebody[ibody] & IMGMASK;
remapflag[ibody][0] = newimage - oldimage;
@ -1608,9 +1609,9 @@ double FixLbRigidPCSphere::compute_array(int i, int j)
for(ii=-1; ii<3; ii++){
rsq=(-dx1+ii)*(-dx1+ii);
if(rsq>=4)
if(rsq>=4) {
weightx=0.0;
else{
} else {
r=sqrt(rsq);
if(rsq>1){
weightx=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.;
@ -1620,9 +1621,9 @@ double FixLbRigidPCSphere::compute_array(int i, int j)
}
for(jj=-1; jj<3; jj++){
rsq=(-dy1+jj)*(-dy1+jj);
if(rsq>=4)
if(rsq>=4) {
weighty=0.0;
else{
} else {
r=sqrt(rsq);
if(rsq>1){
weighty=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.;
@ -1632,9 +1633,9 @@ double FixLbRigidPCSphere::compute_array(int i, int j)
}
for(kk=-1; kk<3; kk++){
rsq=(-dz1+kk)*(-dz1+kk);
if(rsq>=4)
if(rsq>=4) {
weightz=0.0;
else{
} else {
r=sqrt(rsq);
if(rsq>1){
weightz=(5.0-2.0*r-sqrt(-7.0+12.0*r-4.0*rsq))/8.;

View File

@ -346,9 +346,9 @@ void FixTTMMod::init()
void FixTTMMod::setup(int vflag)
{
if (strstr(update->integrate_style,"verlet"))
if (strstr(update->integrate_style,"verlet")) {
post_force_setup(vflag);
else {
} else {
((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1);
post_force_respa_setup(vflag,nlevels_respa-1,0);
((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1);
@ -428,8 +428,7 @@ void FixTTMMod::post_force(int /*vflag*/)
flangevin[i][1] -= pres_factor/ionic_density/dy*(C_iu*T_iu-C_i*T_i);
flangevin[i][2] -= pres_factor/ionic_density/dz*(C_if*T_if-C_i*T_i);
}
}
else{
} else {
flangevin[i][0] -= pres_factor/ionic_density/dx*(C_ir*T_ir-C_i*T_i);
flangevin[i][1] -= pres_factor/ionic_density/dy*(C_iu*T_iu-C_i*T_i);
flangevin[i][2] -= pres_factor/ionic_density/dz*(C_if*T_if-C_i*T_i);

View File

@ -258,8 +258,7 @@ void PairSRP::compute(int eflag, int vflag)
}
}
}
}
else{
} else {
// using min distance option
for (ii = 0; ii < inum; ii++) {
@ -361,9 +360,9 @@ void PairSRP::settings(int narg, char **arg)
cut_global = force->numeric(FLERR,arg[0]);
// wildcard
if (strcmp(arg[1],"*") == 0)
if (strcmp(arg[1],"*") == 0) {
btype = 0;
else {
} else {
btype = force->inumeric(FLERR,arg[1]);
if ((btype > atom->nbondtypes) || (btype <= 0))
error->all(FLERR,"Illegal pair_style command");

View File

@ -162,7 +162,7 @@ void vdW_Coulomb_Energy_OMP( reax_system *system, control_params *control,
CEvd = dTap * e_vdW -
Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13;
}
else{ // no shielding
else { // no shielding
exp1 = exp( twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
exp2 = exp( 0.5 * twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
@ -222,8 +222,7 @@ void vdW_Coulomb_Energy_OMP( reax_system *system, control_params *control,
rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec );
rvec_ScaledAdd( workspace->forceReduction[reductionOffset+j],
+(CEvd + CEclmb), nbr_pj->dvec );
}
else { /* NPT, iNPT or sNPT */
} else { /* NPT, iNPT or sNPT */
/* for pressure coupling, terms not related to bond order
derivatives are added directly into pressure vector/tensor */
@ -362,8 +361,7 @@ void Tabulated_vdW_Coulomb_Energy_OMP(reax_system *system,control_params *contro
rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec );
rvec_ScaledAdd( workspace->forceReduction[froffset+j],
+(CEvd + CEclmb), nbr_pj->dvec );
}
else { // NPT, iNPT or sNPT
} else { // NPT, iNPT or sNPT
/* for pressure coupling, terms not related to bond order derivatives
are added directly into pressure vector/tensor */
rvec_Scale( temp, CEvd + CEclmb, nbr_pj->dvec );

View File

@ -311,8 +311,7 @@ void Valence_AnglesOMP( reax_system *system, control_params *control,
if (workspace->vlpex[j] >= 0) {
vlpadj = 0;
dSBO2 = prod_SBO - 1;
}
else{
} else {
vlpadj = workspace->nlp[j];
dSBO2 = (prod_SBO - 1) * (1 - p_val8 * workspace->dDelta_lp[j]);
}
@ -543,8 +542,7 @@ void Valence_AnglesOMP( reax_system *system, control_params *control,
CEval8, p_ijk->dcos_di );
rvec_ScaledAdd( workspace->forceReduction[reductionOffset+k],
CEval8, p_ijk->dcos_dk );
}
else {
} else {
/* terms not related to bond order derivatives are
added directly into forces and pressure vector/tensor */
rvec_Scale( force, CEval8, p_ijk->dcos_di );

View File

@ -273,8 +273,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax,
} else {
reax->gp.vdw_type = 3;
}
}
else { // No shielding vdWaals parameters present
} else { // No shielding vdWaals parameters present
if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 2 ) {
if (me == 0)
fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n" \
@ -288,8 +287,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax,
reax->gp.vdw_type = 2;
}
}
}
else{ // No Inner wall parameters present
} else { // No Inner wall parameters present
if (reax->sbp[i].gamma_w>0.5) { // Shielding vdWaals
if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 1 ) {
if (me == 0)
@ -642,8 +640,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax,
reax->fbp[j][k][m][n].prm[0].p_cot1 = val;
reax->fbp[n][m][k][j].prm[0].p_cot1 = val;
}
}
else { /* This means the entry is of the form 0-X-Y-0 */
} else { /* This means the entry is of the form 0-X-Y-0 */
if( k < reax->num_atom_types && m < reax->num_atom_types )
for( p = 0; p < reax->num_atom_types; p++ )
for( o = 0; o < reax->num_atom_types; o++ ) {

View File

@ -215,8 +215,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control,
if( i < system->n ) {
local = 1;
cutoff = MAX( control->hbond_cut, control->bond_cut );
}
else {
} else {
local = 0;
cutoff = control->bond_cut;
}
@ -240,8 +239,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control,
if( nbr_pj->d <= cutoff )
flag = 1;
else flag = 0;
}
else{
} else {
nbr_pj->dvec[0] = atom_j->x[0] - atom_i->x[0];
nbr_pj->dvec[1] = atom_j->x[1] - atom_i->x[1];
nbr_pj->dvec[2] = atom_j->x[2] - atom_i->x[2];
@ -249,8 +247,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control,
if( nbr_pj->d <= SQR(cutoff) ) {
nbr_pj->d = sqrt(nbr_pj->d);
flag = 1;
}
else {
} else {
flag = 0;
}
}
@ -357,8 +354,7 @@ void Estimate_Storages( reax_system *system, control_params *control,
cutoff = control->nonb_cut;
++(*Htop);
ihb = sbp_i->p_hbond;
}
else {
} else {
local = 0;
cutoff = control->bond_cut;
ihb = -1;

View File

@ -127,7 +127,7 @@ void vdW_Coulomb_Energy( reax_system *system, control_params *control,
CEvd = dTap * e_vdW -
Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13;
}
else{ // no shielding
else { // no shielding
exp1 = exp( twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
exp2 = exp( 0.5 * twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
@ -184,8 +184,7 @@ void vdW_Coulomb_Energy( reax_system *system, control_params *control,
if( control->virial == 0 ) {
rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec );
rvec_ScaledAdd( workspace->f[j], +(CEvd + CEclmb), nbr_pj->dvec );
}
else { /* NPT, iNPT or sNPT */
} else { /* NPT, iNPT or sNPT */
rvec_Scale( temp, CEvd + CEclmb, nbr_pj->dvec );
rvec_ScaledAdd( workspace->f[i], -1., temp );
@ -297,8 +296,7 @@ void Tabulated_vdW_Coulomb_Energy( reax_system *system,control_params *control,
if( control->virial == 0 ) {
rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec );
rvec_ScaledAdd( workspace->f[j], +(CEvd + CEclmb), nbr_pj->dvec );
}
else { // NPT, iNPT or sNPT
} else { // NPT, iNPT or sNPT
rvec_Scale( temp, CEvd + CEclmb, nbr_pj->dvec );
rvec_ScaledAdd( workspace->f[i], -1., temp );
@ -388,7 +386,7 @@ void LR_vdW_Coulomb( reax_system *system, storage *workspace,
lr->CEvd = dTap * twbp->D * (exp1 - 2.0 * exp2) -
Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13;
}
else{ // no shielding
else { // no shielding
exp1 = exp( twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
exp2 = exp( 0.5 * twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );

View File

@ -291,10 +291,10 @@ int Write_Init_Desc( reax_system *system, control_params * /*control*/,
out_control->line, INIT_DESC_LEN+1 );
}
if( me != MASTER_NODE )
if (me != MASTER_NODE) {
MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
np * INIT_DESCS + me, mpi_data->world );
else{
} else {
buffer_len = system->n * INIT_DESC_LEN;
for( i = 0; i < np; ++i )
if( i != MASTER_NODE ) {
@ -344,8 +344,7 @@ int Init_Traj( reax_system *system, control_params *control,
if( out_control->traj_method == REG_TRAJ) {
if( system->my_rank == MASTER_NODE )
out_control->strj = fopen( fname, "w" );
}
else {
} else {
strcpy( msg, "init_traj: unknown trajectory option" );
return FAILURE;
}
@ -540,10 +539,10 @@ int Write_Atoms( reax_system *system, control_params * /*control*/,
strncpy( out_control->buffer + i*line_len, out_control->line, line_len+1 );
}
if( me != MASTER_NODE )
if (me != MASTER_NODE) {
MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
np*ATOM_LINES+me, mpi_data->world );
else{
} else {
buffer_len = system->n * line_len;
for( i = 0; i < np; ++i )
if( i != MASTER_NODE ) {
@ -630,10 +629,10 @@ int Write_Bonds(reax_system *system, control_params *control, reax_list *bonds,
}
}
if( me != MASTER_NODE )
i(f me != MASTER_NODE) {
MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
np*BOND_LINES+me, mpi_data->world );
else{
} else {
buffer_len = my_bonds * line_len;
for( i = 0; i < np; ++i )
if( i != MASTER_NODE ) {
@ -725,10 +724,10 @@ int Write_Angles( reax_system *system, control_params *control,
}
}
if( me != MASTER_NODE )
if (me != MASTER_NODE) {
MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
np*ANGLE_LINES+me, mpi_data->world );
else{
} else {
buffer_len = my_angles * line_len;
for( i = 0; i < np; ++i )
if( i != MASTER_NODE ) {

View File

@ -143,8 +143,7 @@ void Valence_Angles( reax_system *system, control_params *control,
if (workspace->vlpex[j] >= 0) {
vlpadj = 0;
dSBO2 = prod_SBO - 1;
}
else{
} else {
vlpadj = workspace->nlp[j];
dSBO2 = (prod_SBO - 1) * (1 - p_val8 * workspace->dDelta_lp[j]);
}
@ -359,8 +358,7 @@ void Valence_Angles( reax_system *system, control_params *control,
rvec_ScaledAdd( workspace->f[i], CEval8, p_ijk->dcos_di );
rvec_ScaledAdd( workspace->f[j], CEval8, p_ijk->dcos_dj );
rvec_ScaledAdd( workspace->f[k], CEval8, p_ijk->dcos_dk );
}
else {
} else {
rvec_Scale( force, CEval8, p_ijk->dcos_di );
rvec_Add( workspace->f[i], force );
rvec_iMultiply( ext_press, pbond_ij->rel_box, force );

View File

@ -174,8 +174,7 @@ int Region::surface(double x, double y, double z, double cutoff)
if (!openflag) {
if (interior) ncontact = surface_interior(xnear,cutoff);
else ncontact = surface_exterior(xnear,cutoff);
}
else{
} else {
// one of surface_int/ext() will return 0
// so no need to worry about offset of contact indices
ncontact = surface_exterior(xnear,cutoff) + surface_interior(xnear,cutoff);

View File

@ -308,7 +308,7 @@ int RegBlock::surface_exterior(double *x, double cutoff)
// could be edge or corner pt of block
// do not add contact point if r >= cutoff
if (!openflag){
if (!openflag) {
if (x[0] < xlo) xp = xlo;
else if (x[0] > xhi) xp = xhi;
else xp = x[0];
@ -318,13 +318,12 @@ int RegBlock::surface_exterior(double *x, double cutoff)
if (x[2] < zlo) zp = zlo;
else if (x[2] > zhi) zp = zhi;
else zp = x[2];
}
else{
} else {
mindist = BIG;
for (int i = 0; i < 6; i++){
if (open_faces[i]) continue;
dist = find_closest_point(i,x,xc,yc,zc);
if (dist < mindist){
if (dist < mindist) {
xp = xc;
yp = yc;
zp = zc;

View File

@ -471,14 +471,14 @@ int RegCylinder::surface_exterior(double *x, double cutoff)
if (x[0] < lo) xp = lo;
else if (x[0] > hi) xp = hi;
else xp = x[0];
}
} else {
// closest point on curved surface
else {
dr = r - radius;
dr2 = dr*dr;
if (!open_faces[2]){
if (!open_faces[2]) {
yp = c1 + del1*radius/r;
zp = c2 + del2*radius/r;
if (x[0] < lo) {
@ -504,7 +504,7 @@ int RegCylinder::surface_exterior(double *x, double cutoff)
else d2 = dr2 + dx*dx;
if (d2 < d2prev) {
xp = lo;
if (r < radius){
if (r < radius) {
yp = x[1];
zp = x[2];
}
@ -565,11 +565,11 @@ int RegCylinder::surface_exterior(double *x, double cutoff)
if (x[1] < lo) yp = lo;
else if (x[1] > hi) yp = hi;
else yp = x[1];
}
} else {
// closest point on curved surface
else {
dr = r - radius;
dr2 = dr*dr;
if (!open_faces[2]){
@ -659,25 +659,23 @@ int RegCylinder::surface_exterior(double *x, double cutoff)
if (x[2] < lo) zp = lo;
else if (x[2] > hi) zp = hi;
else zp = x[2];
}
} else {
// closest point on curved surface
else {
dr = r - radius;
dr2 = dr*dr;
if (!open_faces[2]){
if (!open_faces[2]) {
xp = c1 + del1*radius/r;
yp = c2 + del2*radius/r;
if (x[2] < lo) {
dx = lo-x[2];
zp = lo;
}
else if (x[2] > hi) {
} else if (x[2] > hi) {
dx = x[2]-hi;
zp = hi;
}
else {
} else {
dx = 0;
zp = x[2];
}
@ -795,17 +793,15 @@ void RegCylinder::variable_check()
void RegCylinder::set_velocity_shape()
{
if (axis == 'x'){
if (axis == 'x') {
xcenter[0] = 0;
xcenter[1] = c1;
xcenter[2] = c2;
}
else if (axis == 'y'){
} else if (axis == 'y') {
xcenter[0] = c1;
xcenter[1] = 0;
xcenter[2] = c2;
}
else{
} else {
xcenter[0] = c1;
xcenter[1] = c2;
xcenter[2] = 0;
@ -825,17 +821,15 @@ void RegCylinder::set_velocity_shape()
void RegCylinder::velocity_contact_shape(double *vwall, double *xc)
{
double delx, dely, delz; // Displacement of contact point in x,y,z
if (axis == 'x'){
if (axis == 'x') {
delx = 0;
dely = (xc[1] - xcenter[1])*(1 - rprev/radius);
delz = (xc[2] - xcenter[2])*(1 - rprev/radius);
}
else if (axis == 'y'){
} else if (axis == 'y') {
delx = (xc[0] - xcenter[0])*(1 - rprev/radius);
dely = 0;
delz = (xc[2] - xcenter[2])*(1 - rprev/radius);
}
else{
} else {
delx = (xc[0] - xcenter[0])*(1 - rprev/radius);
dely = (xc[1] - xcenter[1])*(1 - rprev/radius);
delz = 0;
@ -843,6 +837,5 @@ void RegCylinder::velocity_contact_shape(double *vwall, double *xc)
vwall[0] += delx/update->dt;
vwall[1] += dely/update->dt;
vwall[2] += delz/update->dt;
//printf ("R is %g, prev %g, velocity of wall at %g %g %g is %g %g %g\n",radius,rprev,xc[0],xc[1],xc[2],vwall[0],vwall[1],vwall[2]);
}