diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp index 7d1861afd710663b515590c102a4c73a63b2ba26..63b749a556f541205cbec757ed28ad9a9966c305 100644 --- a/src/KOKKOS/fix_langevin_kokkos.cpp +++ b/src/KOKKOS/fix_langevin_kokkos.cpp @@ -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); } diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index e9b6527725df1569db3af1a1c229628eec3d990c..6e0857e80da3e47884df57ea3dff962db8a318e2 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -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) ); diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index 2dcb3e62962f43f6a1e9fc35aa75ffaa969557dc..806e4f3a14d5c77652713f9a82919aeefe790ab2 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -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++) diff --git a/src/USER-LB/fix_lb_fluid.cpp b/src/USER-LB/fix_lb_fluid.cpp index 222b0eea3c2b338bdd46a950692d2bb4f230bf91..864bb02f3f69be6555cb708f1379d489c33a0bc3 100644 --- a/src/USER-LB/fix_lb_fluid.cpp +++ b/src/USER-LB/fix_lb_fluid.cpp @@ -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; diff --git a/src/USER-LB/fix_lb_pc.cpp b/src/USER-LB/fix_lb_pc.cpp index 30b7059c740dc79766f3fb2a5a0f3b1c58aa6ef9..ce6ca0c9a1ff67ffe9a2b02c22060b79830345f3 100644 --- a/src/USER-LB/fix_lb_pc.cpp +++ b/src/USER-LB/fix_lb_pc.cpp @@ -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.; diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index 14dbeb0f1df0714e1b62c7f973bd7ea3b13cd4e9..a950fffdf0d9ca495db36e6084574d70f408e7b9 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -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.; diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index 423ec788c560d2c57445641c06cbce71e12186cc..a34c2eb42ff5468efd59f22e33d7e718e088f711 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -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); diff --git a/src/USER-MISC/pair_srp.cpp b/src/USER-MISC/pair_srp.cpp index 93ef09386a26dd4192b17028054b6ec7d1b5e951..97b3aa6c4396d7bcc3088412a7a2dd44791be0e7 100644 --- a/src/USER-MISC/pair_srp.cpp +++ b/src/USER-MISC/pair_srp.cpp @@ -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"); diff --git a/src/USER-OMP/reaxc_nonbonded_omp.cpp b/src/USER-OMP/reaxc_nonbonded_omp.cpp index 9ad238f79c288dd11fea1cd01864386bf2004643..194f433634990023a3494c55fd17b55223fa3a6d 100644 --- a/src/USER-OMP/reaxc_nonbonded_omp.cpp +++ b/src/USER-OMP/reaxc_nonbonded_omp.cpp @@ -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 ); diff --git a/src/USER-OMP/reaxc_valence_angles_omp.cpp b/src/USER-OMP/reaxc_valence_angles_omp.cpp index cf89cf8095f93371c2650e4fd60926b5710f4b06..a9c9d8ebfd4596c8c0c76a9e77d9ed6411e02b79 100644 --- a/src/USER-OMP/reaxc_valence_angles_omp.cpp +++ b/src/USER-OMP/reaxc_valence_angles_omp.cpp @@ -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 ); diff --git a/src/USER-REAXC/reaxc_ffield.cpp b/src/USER-REAXC/reaxc_ffield.cpp index 66acb6ea9a471baeca00b1f32f3463797ec3ff65..d060b866d3a524a04f6ce311319b854e0fa95e5a 100644 --- a/src/USER-REAXC/reaxc_ffield.cpp +++ b/src/USER-REAXC/reaxc_ffield.cpp @@ -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++ ) { diff --git a/src/USER-REAXC/reaxc_forces.cpp b/src/USER-REAXC/reaxc_forces.cpp index dfcc9fd4ae4e11bc6351f549bc9c7b0a4a941ee0..e5a8fa2e93211f260920c139d532d087c163d9c0 100644 --- a/src/USER-REAXC/reaxc_forces.cpp +++ b/src/USER-REAXC/reaxc_forces.cpp @@ -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; diff --git a/src/USER-REAXC/reaxc_nonbonded.cpp b/src/USER-REAXC/reaxc_nonbonded.cpp index b44632ec29d8e387ba0669d2a693ccaa78ad6065..6e4582364f45f610095d9c5ac1c3bfc1f11898ae 100644 --- a/src/USER-REAXC/reaxc_nonbonded.cpp +++ b/src/USER-REAXC/reaxc_nonbonded.cpp @@ -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) ); diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp index 8a8de2707cfaf80f626cef0b6a5b455278f9082d..63a31b95776639b22032cce5b4bfb81047210af3 100644 --- a/src/USER-REAXC/reaxc_traj.cpp +++ b/src/USER-REAXC/reaxc_traj.cpp @@ -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 ) { diff --git a/src/USER-REAXC/reaxc_valence_angles.cpp b/src/USER-REAXC/reaxc_valence_angles.cpp index bc844fdb1cb74adcd00882a1825c58c1464e52e9..df51d1034c4009806d0eface3dc654b78b73d2b5 100644 --- a/src/USER-REAXC/reaxc_valence_angles.cpp +++ b/src/USER-REAXC/reaxc_valence_angles.cpp @@ -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 ); diff --git a/src/region.cpp b/src/region.cpp index c52c0181aaf6e6dbeef9c204f60f7f4f796a661b..6b49a2819b5f88bf30829e2ee9322c3544bbde88 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -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); diff --git a/src/region_block.cpp b/src/region_block.cpp index eeca1323786390c43e434cb0cf89817c5b5ecb52..e55c4811898f0b084b8bf52c6615ab9e81526ee9 100644 --- a/src/region_block.cpp +++ b/src/region_block.cpp @@ -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; diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index 0bc567ff4f87c2b331d1f2ab95265ae451b0f374..7709c57aab296a9c97bf037f8d111c7d1c8db686 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -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]); }