From 9e7ca428aade7fdfad8254c63833a390e2f983a7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 3 Nov 2019 10:57:18 -0500 Subject: [PATCH] whitespace cleanup: remove (evil) tabs --- src/BODY/body_rounded_polygon.cpp | 8 +- src/BODY/body_rounded_polyhedron.cpp | 4 +- src/CLASS2/pair_lj_class2.cpp | 20 +- src/CLASS2/pair_lj_class2_coul_long.cpp | 36 +-- src/KOKKOS/atom_vec_sphere_kokkos.cpp | 144 ++++++------ src/KOKKOS/fix_enforce2d_kokkos.cpp | 4 +- src/KOKKOS/fix_neigh_history_kokkos.cpp | 44 ++-- src/KOKKOS/npair_kokkos.cpp | 208 +++++++++--------- src/KOKKOS/pair_gran_hooke_history_kokkos.cpp | 148 ++++++------- src/KOKKOS/verlet_kokkos.cpp | 4 +- src/KSPACE/ewald_disp.cpp | 2 +- src/KSPACE/pppm_disp.cpp | 4 +- src/SPIN/atom_vec_spin.h | 12 +- src/SPIN/fix_langevin_spin.h | 16 +- src/SPIN/fix_neb_spin.h | 24 +- src/SPIN/fix_nve_spin.cpp | 8 +- src/SPIN/fix_nve_spin.h | 36 +-- src/SPIN/fix_precession_spin.cpp | 8 +- src/SPIN/fix_precession_spin.h | 14 +- src/SPIN/min_spin.cpp | 6 +- src/SPIN/min_spin_cg.cpp | 12 +- src/SPIN/min_spin_cg.h | 30 +-- src/SPIN/min_spin_lbfgs.cpp | 8 +- src/SPIN/min_spin_lbfgs.h | 32 +-- src/SPIN/neb_spin.cpp | 108 ++++----- src/SPIN/pair_spin.h | 4 +- src/SPIN/pair_spin_dipole_cut.cpp | 42 ++-- src/SPIN/pair_spin_dipole_cut.h | 14 +- src/SPIN/pair_spin_dipole_long.h | 14 +- src/SPIN/pair_spin_dmi.h | 10 +- src/SPIN/pair_spin_exchange.h | 8 +- src/SPIN/pair_spin_magelec.h | 8 +- src/SPIN/pair_spin_neel.h | 12 +- src/USER-MISC/compute_hma.cpp | 2 +- src/USER-MISC/fix_bond_react.cpp | 12 +- src/USER-MISC/pair_ilp_graphene_hbn.cpp | 14 +- src/USER-MISC/pair_kolmogorov_crespi_full.cpp | 28 +-- src/USER-MISC/pair_lj_expand_coul_long.cpp | 4 +- src/USER-MISC/pair_local_density.cpp | 88 ++++---- src/USER-MISC/pair_local_density.h | 12 +- src/USER-OMP/reaxc_init_md_omp.cpp | 4 +- src/USER-REAXC/reaxc_ffield.cpp | 2 +- src/force.cpp | 6 +- src/min.h | 8 +- src/min_cg.cpp | 8 +- src/min_fire.cpp | 6 +- src/min_sd.cpp | 6 +- 47 files changed, 626 insertions(+), 626 deletions(-) diff --git a/src/BODY/body_rounded_polygon.cpp b/src/BODY/body_rounded_polygon.cpp index d60372781a..d855c5aea7 100644 --- a/src/BODY/body_rounded_polygon.cpp +++ b/src/BODY/body_rounded_polygon.cpp @@ -116,7 +116,7 @@ double BodyRoundedPolygon::enclosing_radius(struct AtomVecBody::Bonus *bonus) { int nvertices = bonus->ivalue[0]; if (nvertices == 1 || nvertices == 2) - return *(bonus->dvalue+3*nsub(bonus)+2); + return *(bonus->dvalue+3*nsub(bonus)+2); return *(bonus->dvalue + 3*nsub(bonus) + 2*nsub(bonus)); } @@ -126,7 +126,7 @@ double BodyRoundedPolygon::rounded_radius(struct AtomVecBody::Bonus *bonus) { int nvertices = bonus->ivalue[0]; if (nvertices == 1 || nvertices == 2) - return *(bonus->dvalue+3*nsub(bonus)+2+1); + return *(bonus->dvalue+3*nsub(bonus)+2+1); return *(bonus->dvalue + 3*nsub(bonus) + 2*nsub(bonus)+1); } @@ -156,7 +156,7 @@ int BodyRoundedPolygon::unpack_border_body(AtomVecBody::Bonus *bonus, ------------------------------------------------------------------------- */ void BodyRoundedPolygon::data_body(int ibonus, int ninteger, int ndouble, - int *ifile, double *dfile) + int *ifile, double *dfile) { AtomVecBody::Bonus *bonus = &avec->bonus[ibonus]; @@ -327,7 +327,7 @@ void BodyRoundedPolygon::data_body(int ibonus, int ninteger, int ndouble, ------------------------------------------------------------------------- */ double BodyRoundedPolygon::radius_body(int /*ninteger*/, int ndouble, - int *ifile, double *dfile) + int *ifile, double *dfile) { int nsub = ifile[0]; if (nsub < 1) diff --git a/src/BODY/body_rounded_polyhedron.cpp b/src/BODY/body_rounded_polyhedron.cpp index 49ec6f1d78..a82404ab15 100644 --- a/src/BODY/body_rounded_polyhedron.cpp +++ b/src/BODY/body_rounded_polyhedron.cpp @@ -134,7 +134,7 @@ double BodyRoundedPolyhedron::enclosing_radius(struct AtomVecBody::Bonus *bonus) { int nvertices = bonus->ivalue[0]; if (nvertices == 1 || nvertices == 2) - return *(bonus->dvalue+3*nsub(bonus)+2); + return *(bonus->dvalue+3*nsub(bonus)+2); return *(bonus->dvalue+3*nsub(bonus) + 2*nedges(bonus) + MAX_FACE_SIZE*nfaces(bonus)); } @@ -385,7 +385,7 @@ void BodyRoundedPolyhedron::data_body(int ibonus, int ninteger, int ndouble, ------------------------------------------------------------------------- */ double BodyRoundedPolyhedron::radius_body(int /*ninteger*/, int ndouble, - int *ifile, double *dfile) + int *ifile, double *dfile) { int nsub = ifile[0]; int ned = ifile[1]; diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp index 641ca67226..c930173864 100644 --- a/src/CLASS2/pair_lj_class2.cpp +++ b/src/CLASS2/pair_lj_class2.cpp @@ -188,8 +188,8 @@ void PairLJClass2::compute_inner() if (rsq < cut_out_off_sq) { r2inv = 1.0/rsq; - rinv = sqrt(r2inv); - r3inv = r2inv*rinv; + rinv = sqrt(r2inv); + r3inv = r2inv*rinv; r6inv = r3inv*r3inv; jtype = type[j]; forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]); @@ -268,8 +268,8 @@ void PairLJClass2::compute_middle() if (rsq < cut_out_off_sq && rsq > cut_in_off_sq) { r2inv = 1.0/rsq; - rinv = sqrt(r2inv); - r3inv = r2inv*rinv; + rinv = sqrt(r2inv); + r3inv = r2inv*rinv; r6inv = r3inv*r3inv; jtype = type[j]; forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]); @@ -352,8 +352,8 @@ void PairLJClass2::compute_outer(int eflag, int vflag) if (rsq < cutsq[itype][jtype]) { if (rsq > cut_in_off_sq) { r2inv = 1.0/rsq; - rinv = sqrt(r2inv); - r3inv = r2inv*rinv; + rinv = sqrt(r2inv); + r3inv = r2inv*rinv; r6inv = r3inv*r3inv; forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]); fpair = factor_lj*forcelj*r2inv; @@ -374,8 +374,8 @@ void PairLJClass2::compute_outer(int eflag, int vflag) if (eflag) { r2inv = 1.0/rsq; - rinv = sqrt(r2inv); - r3inv = r2inv*rinv; + rinv = sqrt(r2inv); + r3inv = r2inv*rinv; r6inv = r3inv*r3inv; evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) - offset[itype][jtype]; @@ -385,8 +385,8 @@ void PairLJClass2::compute_outer(int eflag, int vflag) if (vflag) { if (rsq <= cut_in_off_sq) { r2inv = 1.0/rsq; - rinv = sqrt(r2inv); - r3inv = r2inv*rinv; + rinv = sqrt(r2inv); + r3inv = r2inv*rinv; r6inv = r3inv*r3inv; forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]); fpair = factor_lj*forcelj*r2inv; diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index 5487878f27..c2b127fa58 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -262,8 +262,8 @@ void PairLJClass2CoulLong::compute_inner() jtype = type[j]; if (rsq < cut_ljsq[itype][jtype]) { - rinv = sqrt(r2inv); - r3inv = r2inv*rinv; + rinv = sqrt(r2inv); + r3inv = r2inv*rinv; r6inv = r3inv*r3inv; forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]); } else forcelj = 0.0; @@ -354,8 +354,8 @@ void PairLJClass2CoulLong::compute_middle() jtype = type[j]; if (rsq < cut_ljsq[itype][jtype]) { - rinv = sqrt(r2inv); - r3inv = r2inv*rinv; + rinv = sqrt(r2inv); + r3inv = r2inv*rinv; r6inv = r3inv*r3inv; forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]); } else forcelj = 0.0; @@ -487,9 +487,9 @@ void PairLJClass2CoulLong::compute_outer(int eflag, int vflag) } else forcecoul = 0.0; if (rsq < cut_ljsq[itype][jtype] && rsq > cut_in_off_sq) { - rinv = sqrt(r2inv); - r3inv = r2inv*rinv; - r6inv = r3inv*r3inv; + rinv = sqrt(r2inv); + r3inv = r2inv*rinv; + r6inv = r3inv*r3inv; forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]); if (rsq < cut_in_on_sq) { rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; @@ -525,9 +525,9 @@ void PairLJClass2CoulLong::compute_outer(int eflag, int vflag) } else ecoul = 0.0; if (rsq < cut_ljsq[itype][jtype]) { - rinv = sqrt(r2inv); - r3inv = r2inv*rinv; - r6inv = r3inv*r3inv; + rinv = sqrt(r2inv); + r3inv = r2inv*rinv; + r6inv = r3inv*r3inv; evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) - offset[itype][jtype]; evdwl *= factor_lj; @@ -552,13 +552,13 @@ void PairLJClass2CoulLong::compute_outer(int eflag, int vflag) if (rsq <= cut_in_off_sq) { rinv = sqrt(r2inv); - r3inv = r2inv*rinv; - r6inv = r3inv*r3inv; + r3inv = r2inv*rinv; + r6inv = r3inv*r3inv; forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]); } else if (rsq <= cut_in_on_sq) { - rinv = sqrt(r2inv); - r3inv = r2inv*rinv; - r6inv = r3inv*r3inv; + rinv = sqrt(r2inv); + r3inv = r2inv*rinv; + r6inv = r3inv*r3inv; forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]); } fpair = (forcecoul + factor_lj*forcelj) * r2inv; @@ -672,14 +672,14 @@ void PairLJClass2CoulLong::init_style() if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; - if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; + if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; } irequest = neighbor->request(this,instance_me); if (respa >= 1) { neighbor->requests[irequest]->respaouter = 1; - neighbor->requests[irequest]->respainner = 1; + neighbor->requests[irequest]->respainner = 1; } if (respa == 2) neighbor->requests[irequest]->respamiddle = 1; @@ -690,7 +690,7 @@ void PairLJClass2CoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = NULL; // insure use of KSpace long-range solver, set g_ewald diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.cpp b/src/KOKKOS/atom_vec_sphere_kokkos.cpp index 7e217df2a6..67aaa32c21 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.cpp +++ b/src/KOKKOS/atom_vec_sphere_kokkos.cpp @@ -247,13 +247,13 @@ struct AtomVecSphereKokkos_PackComm { _buf(i,2) = _x(j,2); } else { if (TRICLINIC == 0) { - _buf(i,0) = _x(j,0) + _pbc[0]*_xprd; - _buf(i,1) = _x(j,1) + _pbc[1]*_yprd; - _buf(i,2) = _x(j,2) + _pbc[2]*_zprd; + _buf(i,0) = _x(j,0) + _pbc[0]*_xprd; + _buf(i,1) = _x(j,1) + _pbc[1]*_yprd; + _buf(i,2) = _x(j,2) + _pbc[2]*_zprd; } else { - _buf(i,0) = _x(j,0) + _pbc[0]*_xprd + _pbc[5]*_xy + _pbc[4]*_xz; - _buf(i,1) = _x(j,1) + _pbc[1]*_yprd + _pbc[3]*_yz; - _buf(i,2) = _x(j,2) + _pbc[2]*_zprd; + _buf(i,0) = _x(j,0) + _pbc[0]*_xprd + _pbc[5]*_xy + _pbc[4]*_xz; + _buf(i,1) = _x(j,1) + _pbc[1]*_yprd + _pbc[3]*_yz; + _buf(i,2) = _x(j,2) + _pbc[2]*_zprd; } } _buf(i,3) = _radius(j); @@ -419,13 +419,13 @@ struct AtomVecSphereKokkos_PackCommVel { _buf(i,2) = _x(j,2); } else { if (TRICLINIC == 0) { - _buf(i,0) = _x(j,0) + _pbc[0]*_xprd; - _buf(i,1) = _x(j,1) + _pbc[1]*_yprd; - _buf(i,2) = _x(j,2) + _pbc[2]*_zprd; + _buf(i,0) = _x(j,0) + _pbc[0]*_xprd; + _buf(i,1) = _x(j,1) + _pbc[1]*_yprd; + _buf(i,2) = _x(j,2) + _pbc[2]*_zprd; } else { - _buf(i,0) = _x(j,0) + _pbc[0]*_xprd + _pbc[5]*_xy + _pbc[4]*_xz; - _buf(i,1) = _x(j,1) + _pbc[1]*_yprd + _pbc[3]*_yz; - _buf(i,2) = _x(j,2) + _pbc[2]*_zprd; + _buf(i,0) = _x(j,0) + _pbc[0]*_xprd + _pbc[5]*_xy + _pbc[4]*_xz; + _buf(i,1) = _x(j,1) + _pbc[1]*_yprd + _pbc[3]*_yz; + _buf(i,2) = _x(j,2) + _pbc[2]*_zprd; } } if (DEFORM_VREMAP == 0) { @@ -772,13 +772,13 @@ struct AtomVecSphereKokkos_PackCommSelf { _xw(i+_nfirst,2) = _x(j,2); } else { if (TRICLINIC == 0) { - _xw(i+_nfirst,0) = _x(j,0) + _pbc[0]*_xprd; - _xw(i+_nfirst,1) = _x(j,1) + _pbc[1]*_yprd; - _xw(i+_nfirst,2) = _x(j,2) + _pbc[2]*_zprd; + _xw(i+_nfirst,0) = _x(j,0) + _pbc[0]*_xprd; + _xw(i+_nfirst,1) = _x(j,1) + _pbc[1]*_yprd; + _xw(i+_nfirst,2) = _x(j,2) + _pbc[2]*_zprd; } else { - _xw(i+_nfirst,0) = _x(j,0) + _pbc[0]*_xprd + _pbc[5]*_xy + _pbc[4]*_xz; - _xw(i+_nfirst,1) = _x(j,1) + _pbc[1]*_yprd + _pbc[3]*_yz; - _xw(i+_nfirst,2) = _x(j,2) + _pbc[2]*_zprd; + _xw(i+_nfirst,0) = _x(j,0) + _pbc[0]*_xprd + _pbc[5]*_xy + _pbc[4]*_xz; + _xw(i+_nfirst,1) = _x(j,1) + _pbc[1]*_yprd + _pbc[3]*_yz; + _xw(i+_nfirst,2) = _x(j,2) + _pbc[2]*_zprd; } } _radius(i+_nfirst) = _radius(j); @@ -799,39 +799,39 @@ int AtomVecSphereKokkos::pack_comm_self( atomKK->modified(Host,X_MASK|RADIUS_MASK|RMASS_MASK); if(pbc_flag) { if(domain->triclinic) { - struct AtomVecSphereKokkos_PackCommSelf f( + struct AtomVecSphereKokkos_PackCommSelf f( atomKK->k_x, - atomKK->k_radius,atomKK->k_rmass, - nfirst,list,iswap, - domain->xprd,domain->yprd,domain->zprd, - domain->xy,domain->xz,domain->yz,pbc); - Kokkos::parallel_for(n,f); + atomKK->k_radius,atomKK->k_rmass, + nfirst,list,iswap, + domain->xprd,domain->yprd,domain->zprd, + domain->xy,domain->xz,domain->yz,pbc); + Kokkos::parallel_for(n,f); } else { - struct AtomVecSphereKokkos_PackCommSelf f( + struct AtomVecSphereKokkos_PackCommSelf f( atomKK->k_x, - atomKK->k_radius,atomKK->k_rmass, - nfirst,list,iswap, - domain->xprd,domain->yprd,domain->zprd, - domain->xy,domain->xz,domain->yz,pbc); - Kokkos::parallel_for(n,f); + atomKK->k_radius,atomKK->k_rmass, + nfirst,list,iswap, + domain->xprd,domain->yprd,domain->zprd, + domain->xy,domain->xz,domain->yz,pbc); + Kokkos::parallel_for(n,f); } } else { if(domain->triclinic) { - struct AtomVecSphereKokkos_PackCommSelf f( + struct AtomVecSphereKokkos_PackCommSelf f( atomKK->k_x, - atomKK->k_radius,atomKK->k_rmass, - nfirst,list,iswap, - domain->xprd,domain->yprd,domain->zprd, - domain->xy,domain->xz,domain->yz,pbc); - Kokkos::parallel_for(n,f); + atomKK->k_radius,atomKK->k_rmass, + nfirst,list,iswap, + domain->xprd,domain->yprd,domain->zprd, + domain->xy,domain->xz,domain->yz,pbc); + Kokkos::parallel_for(n,f); } else { - struct AtomVecSphereKokkos_PackCommSelf f( + struct AtomVecSphereKokkos_PackCommSelf f( atomKK->k_x, - atomKK->k_radius,atomKK->k_rmass, - nfirst,list,iswap, - domain->xprd,domain->yprd,domain->zprd, - domain->xy,domain->xz,domain->yz,pbc); - Kokkos::parallel_for(n,f); + atomKK->k_radius,atomKK->k_rmass, + nfirst,list,iswap, + domain->xprd,domain->yprd,domain->zprd, + domain->xy,domain->xz,domain->yz,pbc); + Kokkos::parallel_for(n,f); } } } else { @@ -839,39 +839,39 @@ int AtomVecSphereKokkos::pack_comm_self( atomKK->modified(Device,X_MASK|RADIUS_MASK|RMASS_MASK); if(pbc_flag) { if(domain->triclinic) { - struct AtomVecSphereKokkos_PackCommSelf f( + struct AtomVecSphereKokkos_PackCommSelf f( atomKK->k_x, - atomKK->k_radius,atomKK->k_rmass, - nfirst,list,iswap, - domain->xprd,domain->yprd,domain->zprd, - domain->xy,domain->xz,domain->yz,pbc); - Kokkos::parallel_for(n,f); + atomKK->k_radius,atomKK->k_rmass, + nfirst,list,iswap, + domain->xprd,domain->yprd,domain->zprd, + domain->xy,domain->xz,domain->yz,pbc); + Kokkos::parallel_for(n,f); } else { - struct AtomVecSphereKokkos_PackCommSelf f( + struct AtomVecSphereKokkos_PackCommSelf f( atomKK->k_x, - atomKK->k_radius,atomKK->k_rmass, - nfirst,list,iswap, - domain->xprd,domain->yprd,domain->zprd, - domain->xy,domain->xz,domain->yz,pbc); - Kokkos::parallel_for(n,f); + atomKK->k_radius,atomKK->k_rmass, + nfirst,list,iswap, + domain->xprd,domain->yprd,domain->zprd, + domain->xy,domain->xz,domain->yz,pbc); + Kokkos::parallel_for(n,f); } } else { if(domain->triclinic) { - struct AtomVecSphereKokkos_PackCommSelf f( + struct AtomVecSphereKokkos_PackCommSelf f( atomKK->k_x, - atomKK->k_radius,atomKK->k_rmass, - nfirst,list,iswap, - domain->xprd,domain->yprd,domain->zprd, - domain->xy,domain->xz,domain->yz,pbc); - Kokkos::parallel_for(n,f); + atomKK->k_radius,atomKK->k_rmass, + nfirst,list,iswap, + domain->xprd,domain->yprd,domain->zprd, + domain->xy,domain->xz,domain->yz,pbc); + Kokkos::parallel_for(n,f); } else { - struct AtomVecSphereKokkos_PackCommSelf f( + struct AtomVecSphereKokkos_PackCommSelf f( atomKK->k_x, - atomKK->k_radius,atomKK->k_rmass, - nfirst,list,iswap, - domain->xprd,domain->yprd,domain->zprd, - domain->xy,domain->xz,domain->yz,pbc); - Kokkos::parallel_for(n,f); + atomKK->k_radius,atomKK->k_rmass, + nfirst,list,iswap, + domain->xprd,domain->yprd,domain->zprd, + domain->xy,domain->xz,domain->yz,pbc); + Kokkos::parallel_for(n,f); } } } @@ -1037,7 +1037,7 @@ void AtomVecSphereKokkos::unpack_comm_vel_kokkos( /* ---------------------------------------------------------------------- */ int AtomVecSphereKokkos::pack_comm(int n, int *list, double *buf, - int pbc_flag, int *pbc) + int pbc_flag, int *pbc) { int i,j,m; double dx,dy,dz; @@ -1109,7 +1109,7 @@ int AtomVecSphereKokkos::pack_comm(int n, int *list, double *buf, /* ---------------------------------------------------------------------- */ int AtomVecSphereKokkos::pack_comm_vel(int n, int *list, double *buf, - int pbc_flag, int *pbc) + int pbc_flag, int *pbc) { int i,j,m; double dx,dy,dz,dvx,dvy,dvz; @@ -1926,7 +1926,7 @@ struct AtomVecSphereKokkos_UnpackBorder { /* ---------------------------------------------------------------------- */ void AtomVecSphereKokkos::unpack_border_kokkos(const int &n, const int &first, - const DAT::tdual_xfloat_2d &buf,ExecutionSpace space) { + const DAT::tdual_xfloat_2d &buf,ExecutionSpace space) { while (first+n >= nmax) grow(0); if(space==Host) { struct AtomVecSphereKokkos_UnpackBorder f(buf.view(), @@ -1943,7 +1943,7 @@ void AtomVecSphereKokkos::unpack_border_kokkos(const int &n, const int &first, } atomKK->modified(space,X_MASK|TAG_MASK|TYPE_MASK|MASK_MASK| - RADIUS_MASK|RMASS_MASK); + RADIUS_MASK|RMASS_MASK); } /* ---------------------------------------------------------------------- */ @@ -2053,7 +2053,7 @@ void AtomVecSphereKokkos::unpack_border_vel_kokkos( } atomKK->modified(space,X_MASK|TAG_MASK|TYPE_MASK|MASK_MASK| - RADIUS_MASK|RMASS_MASK|V_MASK|OMEGA_MASK); + RADIUS_MASK|RMASS_MASK|V_MASK|OMEGA_MASK); } /* ---------------------------------------------------------------------- */ @@ -2496,7 +2496,7 @@ int AtomVecSphereKokkos::unpack_restart(double *buf) atomKK->modified(Host,X_MASK | TAG_MASK | TYPE_MASK | MASK_MASK | IMAGE_MASK | V_MASK | - RADIUS_MASK | RMASS_MASK | OMEGA_MASK); + RADIUS_MASK | RMASS_MASK | OMEGA_MASK); atom->nlocal++; return m; diff --git a/src/KOKKOS/fix_enforce2d_kokkos.cpp b/src/KOKKOS/fix_enforce2d_kokkos.cpp index bf2a882539..205451d96f 100644 --- a/src/KOKKOS/fix_enforce2d_kokkos.cpp +++ b/src/KOKKOS/fix_enforce2d_kokkos.cpp @@ -34,10 +34,10 @@ FixEnforce2DKokkos::FixEnforce2DKokkos(LAMMPS *lmp, int narg, char * execution_space = ExecutionSpaceFromDevice::space; datamask_read = V_MASK | F_MASK | OMEGA_MASK | MASK_MASK - | TORQUE_MASK | ANGMOM_MASK; + | TORQUE_MASK | ANGMOM_MASK; datamask_modify = V_MASK | F_MASK | OMEGA_MASK - | TORQUE_MASK | ANGMOM_MASK; + | TORQUE_MASK | ANGMOM_MASK; } diff --git a/src/KOKKOS/fix_neigh_history_kokkos.cpp b/src/KOKKOS/fix_neigh_history_kokkos.cpp index 8cfe7111dd..7906d37cc3 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.cpp +++ b/src/KOKKOS/fix_neigh_history_kokkos.cpp @@ -122,21 +122,21 @@ void FixNeighHistoryKokkos::pre_exchange_item(const int &ii) const j &= NEIGHMASK; int m = Kokkos::atomic_fetch_add(&d_npartner[i],1); if (m < maxpartner) { - d_partner(i,m) = tag[j]; - for (int k = 0; k < dnum; k++) - d_valuepartner(i,dnum*m+k) = d_firstvalue(i,dnum*jj+k); + d_partner(i,m) = tag[j]; + for (int k = 0; k < dnum; k++) + d_valuepartner(i,dnum*m+k) = d_firstvalue(i,dnum*jj+k); } else { - d_resize() = 1; + d_resize() = 1; } if (j < nlocal_neigh) { - m = Kokkos::atomic_fetch_add(&d_npartner[j],1); - if (m < maxpartner) { - d_partner(j,m) = tag[i]; - for (int k = 0; k < dnum; k++) - d_valuepartner(j,dnum*m+k) = d_firstvalue(i,dnum*jj+k); - } else { - d_resize() = 1; - } + m = Kokkos::atomic_fetch_add(&d_npartner[j],1); + if (m < maxpartner) { + d_partner(j,m) = tag[i]; + for (int k = 0; k < dnum; k++) + d_valuepartner(j,dnum*m+k) = d_firstvalue(i,dnum*jj+k); + } else { + d_resize() = 1; + } } } } @@ -205,22 +205,22 @@ void FixNeighHistoryKokkos::post_neighbor_item(const int &ii) const if (rflag) { int jtag = tag(j); for (m = 0; m < np; m++) - if (d_partner(i, m) == jtag) break; + if (d_partner(i, m) == jtag) break; if (m < np) { - d_firstflag(i,jj) = 1; - for (int k = 0; k < dnum; k++) { - d_firstvalue(i, dnum*jj+k) = d_valuepartner(i, dnum*m+k); - } + d_firstflag(i,jj) = 1; + for (int k = 0; k < dnum; k++) { + d_firstvalue(i, dnum*jj+k) = d_valuepartner(i, dnum*m+k); + } } else { - d_firstflag(i,jj) = 0; - for (int k = 0; k < dnum; k++) { - d_firstvalue(i, dnum*jj+k) = 0; - } + d_firstflag(i,jj) = 0; + for (int k = 0; k < dnum; k++) { + d_firstvalue(i, dnum*jj+k) = 0; + } } } else { d_firstflag(i,jj) = 0; for (int k = 0; k < dnum; k++) { - d_firstvalue(i, dnum*jj+k) = 0; + d_firstvalue(i, dnum*jj+k) = 0; } } } diff --git a/src/KOKKOS/npair_kokkos.cpp b/src/KOKKOS/npair_kokkos.cpp index 4daf4b84c5..5470001967 100644 --- a/src/KOKKOS/npair_kokkos.cpp +++ b/src/KOKKOS/npair_kokkos.cpp @@ -224,49 +224,49 @@ void NPairKokkos::build(NeighList *list_) Kokkos::parallel_for(nall, f); } else { if (newton_pair) { - if (SIZE) { - NPairKokkosBuildFunctorSize f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); + if (SIZE) { + NPairKokkosBuildFunctorSize f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); #ifdef KOKKOS_ENABLE_CUDA - if (ExecutionSpaceFromDevice::space == Device) - Kokkos::parallel_for(config, f); - else - Kokkos::parallel_for(nall, f); + if (ExecutionSpaceFromDevice::space == Device) + Kokkos::parallel_for(config, f); + else + Kokkos::parallel_for(nall, f); #else - Kokkos::parallel_for(nall, f); + Kokkos::parallel_for(nall, f); #endif - } else { - NPairKokkosBuildFunctor f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); + } else { + NPairKokkosBuildFunctor f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); #ifdef KOKKOS_ENABLE_CUDA - if (ExecutionSpaceFromDevice::space == Device) - Kokkos::parallel_for(config, f); - else - Kokkos::parallel_for(nall, f); + if (ExecutionSpaceFromDevice::space == Device) + Kokkos::parallel_for(config, f); + else + Kokkos::parallel_for(nall, f); #else - Kokkos::parallel_for(nall, f); + Kokkos::parallel_for(nall, f); #endif - } + } } else { - if (SIZE) { - NPairKokkosBuildFunctorSize f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); + if (SIZE) { + NPairKokkosBuildFunctorSize f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); #ifdef KOKKOS_ENABLE_CUDA - if (ExecutionSpaceFromDevice::space == Device) - Kokkos::parallel_for(config, f); - else - Kokkos::parallel_for(nall, f); + if (ExecutionSpaceFromDevice::space == Device) + Kokkos::parallel_for(config, f); + else + Kokkos::parallel_for(nall, f); #else - Kokkos::parallel_for(nall, f); + Kokkos::parallel_for(nall, f); #endif - } else { - NPairKokkosBuildFunctor f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); + } else { + NPairKokkosBuildFunctor f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); #ifdef KOKKOS_ENABLE_CUDA - if (ExecutionSpaceFromDevice::space == Device) - Kokkos::parallel_for(config, f); - else - Kokkos::parallel_for(nall, f); + if (ExecutionSpaceFromDevice::space == Device) + Kokkos::parallel_for(config, f); + else + Kokkos::parallel_for(nall, f); #else - Kokkos::parallel_for(nall, f); + Kokkos::parallel_for(nall, f); #endif - } + } } } Kokkos::deep_copy(h_scalars, d_scalars); @@ -871,8 +871,8 @@ void NeighborKokkosExecute:: if(rsq <= cutsq) { if(n:: if(HalfNeigh && !Newton && (j < i)) continue; if(!HalfNeigh && j==i) continue; if(Tri) { - if (x(j,2) < ztmp) continue; - if (x(j,2) == ztmp) { - if (x(j,1) < ytmp) continue; - if (x(j,1) == ytmp) { - if (x(j,0) < xtmp) continue; - if (x(j,0) == xtmp && j <= i) continue; - } - } + if (x(j,2) < ztmp) continue; + if (x(j,2) == ztmp) { + if (x(j,1) < ytmp) continue; + if (x(j,1) == ytmp) { + if (x(j,0) < xtmp) continue; + if (x(j,0) == xtmp && j <= i) continue; + } + } } if(exclude && exclusion(i,j,itype,jtype)) continue; @@ -911,11 +911,11 @@ void NeighborKokkosExecute:: const X_FLOAT cutsq = (radsum + skin) * (radsum + skin); if(rsq <= cutsq) { - if(n::build_ItemSizeCuda(typename Kokkos::Team if(i >= 0 && i < nlocal) { #pragma unroll 4 for(int m = 0; m < bincount_current; m++) { - int j = other_id[m]; - const int jtype = other_x[m + 3 * atoms_per_bin]; + int j = other_id[m]; + const int jtype = other_x[m + 3 * atoms_per_bin]; - //for same bin as atom i skip j if i==j and skip atoms "below and to the left" if using halfneighborlists - if((j == i) || - (HalfNeigh && !Newton && (j < i)) || - (HalfNeigh && Newton && + //for same bin as atom i skip j if i==j and skip atoms "below and to the left" if using halfneighborlists + if((j == i) || + (HalfNeigh && !Newton && (j < i)) || + (HalfNeigh && Newton && ((j < i) || - ((j >= nlocal) && ((x(j, 2) < ztmp) || (x(j, 2) == ztmp && x(j, 1) < ytmp) || - (x(j, 2) == ztmp && x(j, 1) == ytmp && x(j, 0) < xtmp))))) - ) continue; + ((j >= nlocal) && ((x(j, 2) < ztmp) || (x(j, 2) == ztmp && x(j, 1) < ytmp) || + (x(j, 2) == ztmp && x(j, 1) == ytmp && x(j, 0) < xtmp))))) + ) continue; if(Tri) { if (x(j,2) < ztmp) continue; if (x(j,2) == ztmp) { @@ -1011,21 +1011,21 @@ void NeighborKokkosExecute::build_ItemSizeCuda(typename Kokkos::Team } } } - if(exclude && exclusion(i,j,itype,jtype)) continue; - const X_FLOAT delx = xtmp - other_x[m]; - const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin]; - const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin]; - const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; - const X_FLOAT radsum = radi + other_x[m + 4 * atoms_per_bin]; - const X_FLOAT cutsq = (radsum + skin) * (radsum + skin); + if(exclude && exclusion(i,j,itype,jtype)) continue; + const X_FLOAT delx = xtmp - other_x[m]; + const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin]; + const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin]; + const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; + const X_FLOAT radsum = radi + other_x[m + 4 * atoms_per_bin]; + const X_FLOAT cutsq = (radsum + skin) * (radsum + skin); - if(rsq <= cutsq) { - if(n::build_ItemSizeCuda(typename Kokkos::Team int j = MY_II < bincount_current ? c_bins(jbin, MY_II) : -1; if(j >= 0) { - other_x[MY_II] = x(j, 0); - other_x[MY_II + atoms_per_bin] = x(j, 1); - other_x[MY_II + 2 * atoms_per_bin] = x(j, 2); - other_x[MY_II + 3 * atoms_per_bin] = type(j); - other_x[MY_II + 4 * atoms_per_bin] = radius(j); + other_x[MY_II] = x(j, 0); + other_x[MY_II + atoms_per_bin] = x(j, 1); + other_x[MY_II + 2 * atoms_per_bin] = x(j, 2); + other_x[MY_II + 3 * atoms_per_bin] = type(j); + other_x[MY_II + 4 * atoms_per_bin] = radius(j); } other_id[MY_II] = j; @@ -1054,40 +1054,40 @@ void NeighborKokkosExecute::build_ItemSizeCuda(typename Kokkos::Team if(i >= 0 && i < nlocal) { #pragma unroll 8 - for(int m = 0; m < bincount_current; m++) { - const int j = other_id[m]; - const int jtype = other_x[m + 3 * atoms_per_bin]; + for(int m = 0; m < bincount_current; m++) { + const int j = other_id[m]; + const int jtype = other_x[m + 3 * atoms_per_bin]; - if(HalfNeigh && (j < i)) continue; - if(HalfNeigh && !Newton && (j < i)) continue; - if(!HalfNeigh && j==i) continue; - if(Tri) { - if (x(j,2) < ztmp) continue; - if (x(j,2) == ztmp) { - if (x(j,1) < ytmp) continue; - if (x(j,1) == ytmp) { - if (x(j,0) < xtmp) continue; - if (x(j,0) == xtmp && j <= i) continue; - } - } - } - if(exclude && exclusion(i,j,itype,jtype)) continue; + if(HalfNeigh && (j < i)) continue; + if(HalfNeigh && !Newton && (j < i)) continue; + if(!HalfNeigh && j==i) continue; + if(Tri) { + if (x(j,2) < ztmp) continue; + if (x(j,2) == ztmp) { + if (x(j,1) < ytmp) continue; + if (x(j,1) == ytmp) { + if (x(j,0) < xtmp) continue; + if (x(j,0) == xtmp && j <= i) continue; + } + } + } + if(exclude && exclusion(i,j,itype,jtype)) continue; - const X_FLOAT delx = xtmp - other_x[m]; - const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin]; - const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin]; - const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; - const X_FLOAT radsum = radi + other_x[m + 4 * atoms_per_bin]; - const X_FLOAT cutsq = (radsum + skin) * (radsum + skin); + const X_FLOAT delx = xtmp - other_x[m]; + const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin]; + const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin]; + const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; + const X_FLOAT radsum = radi + other_x[m + 4 * atoms_per_bin]; + const X_FLOAT cutsq = (radsum + skin) * (radsum + skin); - if(rsq <= cutsq) { - if(n::compute(int eflag_in, int vflag_in) if (lmp->kokkos->neighflag == HALF) { if (force->newton_pair) { if (vflag_atom) { - if (shearupdate) { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } else { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } + if (shearupdate) { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } } else if (vflag_global) { - if (shearupdate) { - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); - } else { - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); - } + if (shearupdate) { + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); + } else { + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); + } } else { - if (shearupdate) { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } else { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } + if (shearupdate) { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } } } else { if (vflag_atom) { - if (shearupdate) { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } else { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } + if (shearupdate) { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } } else if (vflag_global) { - if (shearupdate) { - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); - } else { - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); - } + if (shearupdate) { + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); + } else { + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); + } } else { - if (shearupdate) { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } else { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } + if (shearupdate) { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } } } } else { // HALFTHREAD if (force->newton_pair) { if (vflag_atom) { - if (shearupdate) { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } else { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } + if (shearupdate) { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } } else if (vflag_global) { - if (shearupdate) { - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); - } else { - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); - } + if (shearupdate) { + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); + } else { + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); + } } else { - if (shearupdate) { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } else { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } + if (shearupdate) { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } } } else { if (vflag_atom) { - if (shearupdate) { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } else { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } + if (shearupdate) { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } } else if (vflag_global) { - if (shearupdate) { - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); - } else { - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); - } + if (shearupdate) { + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); + } else { + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this, ev); + } } else { - if (shearupdate) { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } else { - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); - } + if (shearupdate) { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + } } } } @@ -408,7 +408,7 @@ void PairGranHookeHistoryKokkos::operator()(TagPairGranHookeHistoryC shear3 += vtr3*dt; } X_FLOAT shrmag = sqrt(shear1*shear1 + shear2*shear2 + - shear3*shear3); + shear3*shear3); // rotate shear displacements @@ -433,15 +433,15 @@ void PairGranHookeHistoryKokkos::operator()(TagPairGranHookeHistoryC if (fs > fn) { if (shrmag != 0.0) { - shear1 = (fn/fs) * (shear1 + meff*gammat*vtr1/kt) - - meff*gammat*vtr1/kt; - shear2 = (fn/fs) * (shear2 + meff*gammat*vtr2/kt) - - meff*gammat*vtr2/kt; - shear3 = (fn/fs) * (shear3 + meff*gammat*vtr3/kt) - - meff*gammat*vtr3/kt; - fs1 *= fn/fs; - fs2 *= fn/fs; - fs3 *= fn/fs; + shear1 = (fn/fs) * (shear1 + meff*gammat*vtr1/kt) - + meff*gammat*vtr1/kt; + shear2 = (fn/fs) * (shear2 + meff*gammat*vtr2/kt) - + meff*gammat*vtr2/kt; + shear3 = (fn/fs) * (shear3 + meff*gammat*vtr3/kt) - + meff*gammat*vtr3/kt; + fs1 *= fn/fs; + fs2 *= fn/fs; + fs3 *= fn/fs; } else fs1 = fs2 = fs3 = 0.0; } @@ -503,8 +503,8 @@ template template KOKKOS_INLINE_FUNCTION void PairGranHookeHistoryKokkos::ev_tally_xyz(EV_FLOAT &ev, int i, int j, - F_FLOAT fx, F_FLOAT fy, F_FLOAT fz, - X_FLOAT delx, X_FLOAT dely, X_FLOAT delz) const + F_FLOAT fx, F_FLOAT fy, F_FLOAT fz, + X_FLOAT delx, X_FLOAT dely, X_FLOAT delz) const { F_FLOAT v[6]; @@ -546,8 +546,8 @@ template template KOKKOS_INLINE_FUNCTION void PairGranHookeHistoryKokkos::ev_tally_xyz_atom(EV_FLOAT &ev, int i, int j, - F_FLOAT fx, F_FLOAT fy, F_FLOAT fz, - X_FLOAT delx, X_FLOAT dely, X_FLOAT delz) const + F_FLOAT fx, F_FLOAT fy, F_FLOAT fz, + X_FLOAT delx, X_FLOAT dely, X_FLOAT delz) const { Kokkos::View::value> > v_vatom = k_vatom.view(); diff --git a/src/KOKKOS/verlet_kokkos.cpp b/src/KOKKOS/verlet_kokkos.cpp index 23952b71d8..3367e97c6d 100644 --- a/src/KOKKOS/verlet_kokkos.cpp +++ b/src/KOKKOS/verlet_kokkos.cpp @@ -614,8 +614,8 @@ void VerletKokkos::force_clear() atomKK->modified(Device,F_MASK); if (torqueflag) { - Kokkos::parallel_for(range, Zero::t_f_array>(atomKK->k_torque.view())); - atomKK->modified(Device,TORQUE_MASK); + Kokkos::parallel_for(range, Zero::t_f_array>(atomKK->k_torque.view())); + atomKK->modified(Device,TORQUE_MASK); } } } diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp index a24ee4203c..a7f0698c0c 100644 --- a/src/KSPACE/ewald_disp.cpp +++ b/src/KSPACE/ewald_disp.cpp @@ -131,7 +131,7 @@ void EwaldDisp::init() else if (ewald_mix==Pair::ARITHMETIC) { k = 2; break; } error->all(FLERR, "Unsupported mixing rule in kspace_style ewald/disp"); - break; + break; default: error->all(FLERR,"Unsupported order in kspace_style ewald/disp"); } diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index abc33b90fa..0d0d4c7eb2 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -320,8 +320,8 @@ void PPPMDisp::init() mixflag == 1) && mixflag!= 2) { k = 1; break; } else if (ewald_mix==Pair::ARITHMETIC && mixflag!=2) { k = 2; break; } else if (mixflag == 2) { k = 3; break; } - else error->all(FLERR,"Unsupported mixing rule in kspace_style pppm/disp"); - break; + else error->all(FLERR,"Unsupported mixing rule in kspace_style pppm/disp"); + break; default: sprintf(str, "Unsupported order in kspace_style " "pppm/disp, pair_style %s", force->pair_style); diff --git a/src/SPIN/atom_vec_spin.h b/src/SPIN/atom_vec_spin.h index 1f1c34df52..a31e57bb48 100644 --- a/src/SPIN/atom_vec_spin.h +++ b/src/SPIN/atom_vec_spin.h @@ -67,13 +67,13 @@ class AtomVecSpin : public AtomVec { tagint *tag; int *type,*mask; imageint *image; - double **x,**v,**f; // lattice quantities + double **x,**v,**f; // lattice quantities - // spin quantities - double **sp; // sp[i][0-2] direction of the spin i - // sp[i][3] atomic magnetic moment of the spin i - double **fm; // fm[i][0-2] direction of magnetic precession - double **fm_long; // storage of long-range spin prec. components + // spin quantities + double **sp; // sp[i][0-2] direction of the spin i + // sp[i][3] atomic magnetic moment of the spin i + double **fm; // fm[i][0-2] direction of magnetic precession + double **fm_long; // storage of long-range spin prec. components }; } diff --git a/src/SPIN/fix_langevin_spin.h b/src/SPIN/fix_langevin_spin.h index 5358438396..b581b70d34 100644 --- a/src/SPIN/fix_langevin_spin.h +++ b/src/SPIN/fix_langevin_spin.h @@ -32,17 +32,17 @@ class FixLangevinSpin : public Fix { void init(); void setup(int); void post_force_respa(int, int, int); - void add_tdamping(double spi[3], double fmi[3]); // add transverse damping - void add_temperature(double fmi[3]); // add temperature - int tdamp_flag, ldamp_flag, temp_flag; // damping and temperature flags + void add_tdamping(double spi[3], double fmi[3]); // add transverse damping + void add_temperature(double fmi[3]); // add temperature + int tdamp_flag, ldamp_flag, temp_flag; // damping and temperature flags protected: double *spi, *fmi; - double alpha_t; // transverse mag. damping - double dts; // magnetic timestep - double temp; // spin bath temperature - double D,sigma; // bath intensity var. - double gil_factor; // gilbert's prefactor + double alpha_t; // transverse mag. damping + double dts; // magnetic timestep + double temp; // spin bath temperature + double D,sigma; // bath intensity var. + double gil_factor; // gilbert's prefactor char *id_temp; class Compute *temperature; diff --git a/src/SPIN/fix_neb_spin.h b/src/SPIN/fix_neb_spin.h index 7ac83ddce7..9646684a3a 100644 --- a/src/SPIN/fix_neb_spin.h +++ b/src/SPIN/fix_neb_spin.h @@ -60,20 +60,20 @@ class FixNEBSpin : public Fix { double **spprev,**spnext,**fmnext; double **springF; double **tangent; - double **xsend,**xrecv; // coords to send/recv to/from other replica - double **fsend,**frecv; // coords to send/recv to/from other replica - double **spsend,**sprecv; // sp to send/recv to/from other replica - double **fmsend,**fmrecv; // fm to send/recv to/from other replica - tagint *tagsend,*tagrecv; // ditto for atom IDs + double **xsend,**xrecv; // coords to send/recv to/from other replica + double **fsend,**frecv; // coords to send/recv to/from other replica + double **spsend,**sprecv; // sp to send/recv to/from other replica + double **fmsend,**fmrecv; // fm to send/recv to/from other replica + tagint *tagsend,*tagrecv; // ditto for atom IDs - // info gathered from all procs in my replica - double **xsendall,**xrecvall; // coords to send/recv to/from other replica - double **fsendall,**frecvall; // force to send/recv to/from other replica - double **spsendall,**sprecvall; // sp to send/recv to/from other replica - double **fmsendall,**fmrecvall; // fm to send/recv to/from other replica - tagint *tagsendall,*tagrecvall; // ditto for atom IDs + // info gathered from all procs in my replica + double **xsendall,**xrecvall; // coords to send/recv to/from other replica + double **fsendall,**frecvall; // force to send/recv to/from other replica + double **spsendall,**sprecvall; // sp to send/recv to/from other replica + double **fmsendall,**fmrecvall; // fm to send/recv to/from other replica + tagint *tagsendall,*tagrecvall; // ditto for atom IDs - int *counts,*displacements; // used for MPI_Gather + int *counts,*displacements; // used for MPI_Gather double geodesic_distance(double *, double *); void inter_replica_comm(); diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index 9b4f1916ae..87546ba9da 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -307,7 +307,7 @@ void FixNVESpin::initial_integrate(int /*vflag*/) ComputeInteractionsSpin(i); AdvanceSingleSpin(i); i = forward_stacks[i]; - } + } } } for (int j = nsectors-1; j >= 0; j--) { // advance quarter s for nlocal @@ -318,7 +318,7 @@ void FixNVESpin::initial_integrate(int /*vflag*/) ComputeInteractionsSpin(i); AdvanceSingleSpin(i); i = backward_stacks[i]; - } + } } } } else if (sector_flag == 0) { // serial seq. update @@ -360,7 +360,7 @@ void FixNVESpin::initial_integrate(int /*vflag*/) ComputeInteractionsSpin(i); AdvanceSingleSpin(i); i = forward_stacks[i]; - } + } } } for (int j = nsectors-1; j >= 0; j--) { // advance quarter s for nlocal @@ -371,7 +371,7 @@ void FixNVESpin::initial_integrate(int /*vflag*/) ComputeInteractionsSpin(i); AdvanceSingleSpin(i); i = backward_stacks[i]; - } + } } } } else if (sector_flag == 0) { // serial seq. update diff --git a/src/SPIN/fix_nve_spin.h b/src/SPIN/fix_nve_spin.h index 5871f721be..5aa6b8e4e4 100644 --- a/src/SPIN/fix_nve_spin.h +++ b/src/SPIN/fix_nve_spin.h @@ -34,30 +34,30 @@ friend class PairSpin; virtual void initial_integrate(int); virtual void final_integrate(); - void ComputeInteractionsSpin(int); // compute and advance single spin functions + void ComputeInteractionsSpin(int); // compute and advance single spin functions void AdvanceSingleSpin(int); - void sectoring(); // sectoring operation functions + void sectoring(); // sectoring operation functions int coords2sector(double *); void setup_pre_neighbor(); void pre_neighbor(); - int lattice_flag; // lattice_flag = 0 if spins only - // lattice_flag = 1 if spin-lattice calc. + int lattice_flag; // lattice_flag = 0 if spins only + // lattice_flag = 1 if spin-lattice calc. protected: - int sector_flag; // sector_flag = 0 if serial algorithm - // sector_flag = 1 if parallel algorithm + int sector_flag; // sector_flag = 0 if serial algorithm + // sector_flag = 1 if parallel algorithm - double dtv, dtf, dts; // velocity, force, and spin timesteps + double dtv, dtf, dts; // velocity, force, and spin timesteps - int nlocal_max; // max value of nlocal (for size of lists) + int nlocal_max; // max value of nlocal (for size of lists) - int pair_spin_flag; // magnetic pair flags - int long_spin_flag; // magnetic long-range flag - int precession_spin_flag; // magnetic precession flags - int maglangevin_flag; // magnetic langevin flags + int pair_spin_flag; // magnetic pair flags + int long_spin_flag; // magnetic long-range flag + int precession_spin_flag; // magnetic precession flags + int maglangevin_flag; // magnetic langevin flags int tdamp_flag, temp_flag; int setforce_spin_flag; @@ -69,9 +69,9 @@ friend class PairSpin; // pointers to magnetic pair styles - int npairs, npairspin; // # of pairs, and # of spin pairs + int npairs, npairspin; // # of pairs, and # of spin pairs class Pair *pair; - class PairSpin **spin_pairs; // vector of spin pairs + class PairSpin **spin_pairs; // vector of spin pairs // sectoring variables @@ -80,10 +80,10 @@ friend class PairSpin; // stacking variables for sectoring algorithm - int *stack_head; // index of first atom in backward_stacks - int *stack_foot; // index of first atom in forward_stacks - int *backward_stacks; // index of next atom in backward stack - int *forward_stacks; // index of next atom in forward stack + int *stack_head; // index of first atom in backward_stacks + int *stack_foot; // index of first atom in forward_stacks + int *backward_stacks; // index of next atom in backward stack + int *forward_stacks; // index of next atom in forward stack }; diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index 3296b28228..97dbe7ba6f 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -236,7 +236,7 @@ void FixPrecessionSpin::post_force(int /* vflag */) if (varflag != CONSTANT) { modify->clearstep_compute(); modify->addstep_compute(update->ntimestep + 1); - set_magneticprecession(); // update mag. field if time-dep. + set_magneticprecession(); // update mag. field if time-dep. } int *mask = atom->mask; @@ -265,9 +265,9 @@ void FixPrecessionSpin::post_force(int /* vflag */) epreci -= compute_anisotropy_energy(spi); } - if (cubic_flag) { // compute cubic anisotropy - compute_cubic(spi,fmi); - epreci -= compute_cubic_energy(spi); + if (cubic_flag) { // compute cubic anisotropy + compute_cubic(spi,fmi); + epreci -= compute_cubic_energy(spi); } eprec += epreci; diff --git a/src/SPIN/fix_precession_spin.h b/src/SPIN/fix_precession_spin.h index 0037784a48..96d89e004e 100644 --- a/src/SPIN/fix_precession_spin.h +++ b/src/SPIN/fix_precession_spin.h @@ -54,7 +54,7 @@ class FixPrecessionSpin : public Fix { double compute_cubic_energy(double *); protected: - int style; // style of the magnetic precession + int style; // style of the magnetic precession double degree2rad; double hbar; @@ -72,19 +72,19 @@ class FixPrecessionSpin : public Fix { double H_field; double nhx, nhy, nhz; - double hx, hy, hz; // temp. force variables + double hx, hy, hz; // temp. force variables // magnetic anisotropy intensity and direction - double Ka; // aniso const. in eV - double Kah; // aniso const. in rad.THz + double Ka; // aniso const. in eV + double Kah; // aniso const. in rad.THz double nax, nay, naz; - double Kax, Kay, Kaz; // temp. force variables + double Kax, Kay, Kaz; // temp. force variables // cubic anisotropy intensity - double k1c,k2c; // cubic const. in eV - double k1ch,k2ch; // cubic const. in rad.THz + double k1c,k2c; // cubic const. in eV + double k1ch,k2ch; // cubic const. in rad.THz double nc1x,nc1y,nc1z; double nc2x,nc2y,nc2z; double nc3x,nc3y,nc3z; diff --git a/src/SPIN/min_spin.cpp b/src/SPIN/min_spin.cpp index 7315aca056..e39eb18744 100644 --- a/src/SPIN/min_spin.cpp +++ b/src/SPIN/min_spin.cpp @@ -165,9 +165,9 @@ int MinSpin::iterate(int maxiter) fmdotfm = fmsq = 0.0; if (update->ftol > 0.0) { - if (normstyle == MAX) fmsq = max_torque(); // max torque norm - else if (normstyle == INF) fmsq = inf_torque(); // inf torque norm - else if (normstyle == TWO) fmsq = total_torque(); // Euclidean torque 2-norm + if (normstyle == MAX) fmsq = max_torque(); // max torque norm + else if (normstyle == INF) fmsq = inf_torque(); // inf torque norm + else if (normstyle == TWO) fmsq = total_torque(); // Euclidean torque 2-norm else error->all(FLERR,"Illegal min_modify command"); fmdotfm = fmsq*fmsq; if (update->multireplica == 0) { diff --git a/src/SPIN/min_spin_cg.cpp b/src/SPIN/min_spin_cg.cpp index 95bbcf437b..9c8c814bc4 100644 --- a/src/SPIN/min_spin_cg.cpp +++ b/src/SPIN/min_spin_cg.cpp @@ -270,9 +270,9 @@ int MinSpinCG::iterate(int maxiter) fmdotfm = fmsq = 0.0; if (update->ftol > 0.0) { - if (normstyle == MAX) fmsq = max_torque(); // max torque norm - else if (normstyle == INF) fmsq = inf_torque(); // inf torque norm - else if (normstyle == TWO) fmsq = total_torque(); // Euclidean torque 2-norm + if (normstyle == MAX) fmsq = max_torque(); // max torque norm + else if (normstyle == INF) fmsq = inf_torque(); // inf torque norm + else if (normstyle == TWO) fmsq = total_torque(); // Euclidean torque 2-norm else error->all(FLERR,"Illegal min_modify command"); fmdotfm = fmsq*fmsq; if (update->multireplica == 0) { @@ -347,12 +347,12 @@ void MinSpinCG::calc_search_direction() factor = 0.0; - if (local_iter == 0 || local_iter % 5 == 0){ // steepest descent direction + if (local_iter == 0 || local_iter % 5 == 0){ // steepest descent direction for (int i = 0; i < 3 * nlocal; i++) { p_s[i] = -g_cur[i] * factor; g_old[i] = g_cur[i] * factor; } - } else { // conjugate direction + } else { // conjugate direction for (int i = 0; i < 3 * nlocal; i++) { g2old += g_old[i] * g_old[i]; g2 += g_cur[i] * g_cur[i]; @@ -394,7 +394,7 @@ void MinSpinCG::advance_spins() { int nlocal = atom->nlocal; double **sp = atom->sp; - double rot_mat[9]; // exponential of matrix made of search direction + double rot_mat[9]; // exponential of matrix made of search direction double s_new[3]; // loop on all spins on proc. diff --git a/src/SPIN/min_spin_cg.h b/src/SPIN/min_spin_cg.h index 0eed7a61e6..640721b8ef 100644 --- a/src/SPIN/min_spin_cg.h +++ b/src/SPIN/min_spin_cg.h @@ -35,21 +35,21 @@ class MinSpinCG: public Min { int iterate(int); private: - int local_iter; // for neb - int nlocal_max; // max value of nlocal (for size of lists) - int use_line_search; // use line search or not. - int ireplica,nreplica; // for neb - double dt; // global timestep - double dts; // spin timestep - double discrete_factor; // factor for spin timestep evaluation - double der_e_cur; // current derivative along search dir. - double der_e_pr; // previous derivative along search dir. - double *spvec; // variables for atomic dof, as 1d vector - double *fmvec; // variables for atomic dof, as 1d vector - double *g_old; // gradient vector at previous step - double *g_cur; // current gradient vector - double *p_s; // search direction vector - double **sp_copy; // copy of the spins + int local_iter; // for neb + int nlocal_max; // max value of nlocal (for size of lists) + int use_line_search; // use line search or not. + int ireplica,nreplica; // for neb + double dt; // global timestep + double dts; // spin timestep + double discrete_factor; // factor for spin timestep evaluation + double der_e_cur; // current derivative along search dir. + double der_e_pr; // previous derivative along search dir. + double *spvec; // variables for atomic dof, as 1d vector + double *fmvec; // variables for atomic dof, as 1d vector + double *g_old; // gradient vector at previous step + double *g_cur; // current gradient vector + double *p_s; // search direction vector + double **sp_copy; // copy of the spins void advance_spins(); void calc_gradient(); diff --git a/src/SPIN/min_spin_lbfgs.cpp b/src/SPIN/min_spin_lbfgs.cpp index f86bdd5d48..a1ee010f3f 100644 --- a/src/SPIN/min_spin_lbfgs.cpp +++ b/src/SPIN/min_spin_lbfgs.cpp @@ -285,9 +285,9 @@ int MinSpinLBFGS::iterate(int maxiter) fmdotfm = fmsq = 0.0; if (update->ftol > 0.0) { - if (normstyle == MAX) fmsq = max_torque(); // max torque norm - else if (normstyle == INF) fmsq = inf_torque(); // inf torque norm - else if (normstyle == TWO) fmsq = total_torque(); // Euclidean torque 2-norm + if (normstyle == MAX) fmsq = max_torque(); // max torque norm + else if (normstyle == INF) fmsq = inf_torque(); // inf torque norm + else if (normstyle == TWO) fmsq = total_torque(); // Euclidean torque 2-norm else error->all(FLERR,"Illegal min_modify command"); fmdotfm = fmsq*fmsq; if (update->multireplica == 0) { @@ -372,7 +372,7 @@ void MinSpinLBFGS::calc_search_direction() factor = 1.0; } - if (local_iter == 0){ // steepest descent direction + if (local_iter == 0){ // steepest descent direction //if no line search then calculate maximum rotation if (use_line_search == 0) diff --git a/src/SPIN/min_spin_lbfgs.h b/src/SPIN/min_spin_lbfgs.h index cead605b32..8b470b5d23 100644 --- a/src/SPIN/min_spin_lbfgs.h +++ b/src/SPIN/min_spin_lbfgs.h @@ -35,18 +35,18 @@ class MinSpinLBFGS: public Min { int iterate(int); private: - int local_iter; // for neb - int use_line_search; // use line search or not. - int nlocal_max; // max value of nlocal (for size of lists) - int ireplica,nreplica; // for neb - double der_e_cur; // current derivative along search dir. - double der_e_pr; // previous derivative along search dir. + int local_iter; // for neb + int use_line_search; // use line search or not. + int nlocal_max; // max value of nlocal (for size of lists) + int ireplica,nreplica; // for neb + double der_e_cur; // current derivative along search dir. + double der_e_pr; // previous derivative along search dir. double maxepsrot; - double *spvec; // variables for atomic dof, as 1d vector - double *fmvec; // variables for atomic dof, as 1d vector - double *g_old; // gradient vector at previous step - double *g_cur; // current gradient vector - double *p_s; // search direction vector + double *spvec; // variables for atomic dof, as 1d vector + double *fmvec; // variables for atomic dof, as 1d vector + double *g_old; // gradient vector at previous step + double *g_cur; // current gradient vector + double *p_s; // search direction vector void advance_spins(); void calc_gradient(); @@ -58,11 +58,11 @@ class MinSpinLBFGS: public Min { int adescent(double, double); double maximum_rotation(double *); - double *rho; // estimation of curvature - double **ds; // change in rotation matrix between two iterations, da - double **dy; // change in gradients between two iterations, dg - double **sp_copy; // copy of the spins - int num_mem; // number of stored steps + double *rho; // estimation of curvature + double **ds; // change in rotation matrix between two iterations, da + double **dy; // change in gradients between two iterations, dg + double **sp_copy; // copy of the spins + int num_mem; // number of stored steps bigint last_negative; }; diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index 559fd1cb49..075850d1af 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -179,7 +179,7 @@ void NEBSpin::run() update->whichflag = 2; update->etol = etol; - update->ftol = ttol; // update->ftol is a torque tolerance + update->ftol = ttol; // update->ftol is a torque tolerance update->multireplica = 1; lmp->init(); @@ -214,7 +214,7 @@ void NEBSpin::run() fprintf(uscreen,"Step MaxReplicaTorque MaxAtomTorque " "GradV0 GradV1 GradVc EBF EBR RDT " "RD1 PE1 RD2 PE2 ... RDN PEN " - "GradV0dottan DN0 ... GradVNdottan DNN\n"); + "GradV0dottan DN0 ... GradVNdottan DNN\n"); } else { fprintf(uscreen,"Step MaxReplicaTorque MaxAtomTorque " "GradV0 GradV1 GradVc EBF EBR RDT RD1 PE1 RD2 PE2 ... " @@ -224,10 +224,10 @@ void NEBSpin::run() if (ulogfile) { if (verbose) { - fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque " - "GradV0 GradV1 GradVc EBF EBR RDT " - "RD1 PE1 RD2 PE2 ... RDN PEN " - "GradV0dottan DN0 ... GradVNdottan DNN\n"); + fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque " + "GradV0 GradV1 GradVc EBF EBR RDT " + "RD1 PE1 RD2 PE2 ... RDN PEN " + "GradV0dottan DN0 ... GradVNdottan DNN\n"); } else { fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque " "GradV0 GradV1 GradVc EBF EBR RDT RD1 PE1 RD2 PE2 ... " @@ -301,7 +301,7 @@ void NEBSpin::run() fprintf(uscreen,"Step MaxReplicaTorque MaxAtomTorque " "GradV0 GradV1 GradVc EBF EBR RDT " "RD1 PE1 RD2 PE2 ... RDN PEN " - "GradV0dottan DN0... GradVNdottan DNN\n"); + "GradV0dottan DN0... GradVNdottan DNN\n"); } else { fprintf(uscreen,"Step MaxReplicaTorque MaxAtomTorque " "GradV0 GradV1 GradVc " @@ -311,10 +311,10 @@ void NEBSpin::run() } if (ulogfile) { if (verbose) { - fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque " - "GradV0 GradV1 GradVc EBF EBR RDT " - "RD1 PE1 RD2 PE2 ... RDN PEN " - "GradV0dottan DN0 ... GradVNdottan DNN\n"); + fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque " + "GradV0 GradV1 GradVc EBF EBR RDT " + "RD1 PE1 RD2 PE2 ... RDN PEN " + "GradV0dottan DN0 ... GradVNdottan DNN\n"); } else { fprintf(ulogfile,"Step MaxReplicaTorque MaxAtomTorque " "GradV0 GradV1 GradVc " @@ -472,8 +472,8 @@ void NEBSpin::readfile(char *file, int flag) m = atom->map(tag); if (m >= 0 && m < nlocal) { ncount++; - musp = atof(values[1]); - xx = atof(values[2]); + musp = atof(values[1]); + xx = atof(values[2]); yy = atof(values[3]); zz = atof(values[4]); spx = atof(values[5]); @@ -482,39 +482,39 @@ void NEBSpin::readfile(char *file, int flag) if (flag == 0) { - spinit[0] = sp[m][0]; - spinit[1] = sp[m][1]; - spinit[2] = sp[m][2]; - spfinal[0] = spx; - spfinal[1] = spy; - spfinal[2] = spz; + spinit[0] = sp[m][0]; + spinit[1] = sp[m][1]; + spinit[2] = sp[m][2]; + spfinal[0] = spx; + spfinal[1] = spy; + spfinal[2] = spz; - // interpolate intermediate spin states + // interpolate intermediate spin states - sp[m][3] = musp; - if (fraction == 0.0) { - sp[m][0] = spinit[0]; - sp[m][1] = spinit[1]; - sp[m][2] = spinit[2]; - } else if (fraction == 1.0) { - sp[m][0] = spfinal[0]; - sp[m][1] = spfinal[1]; - sp[m][2] = spfinal[2]; - } else { + sp[m][3] = musp; + if (fraction == 0.0) { + sp[m][0] = spinit[0]; + sp[m][1] = spinit[1]; + sp[m][2] = spinit[2]; + } else if (fraction == 1.0) { + sp[m][0] = spfinal[0]; + sp[m][1] = spfinal[1]; + sp[m][2] = spfinal[2]; + } else { temp_flag = initial_rotation(spinit,spfinal,fraction); rot_flag = MAX(temp_flag,rot_flag); - sp[m][0] = spfinal[0]; - sp[m][1] = spfinal[1]; - sp[m][2] = spfinal[2]; - } + sp[m][0] = spfinal[0]; + sp[m][1] = spfinal[1]; + sp[m][2] = spfinal[2]; + } } else { sp[m][3] = musp; - x[m][0] = xx; + x[m][0] = xx; x[m][1] = yy; x[m][2] = zz; - sp[m][0] = spx; - sp[m][1] = spy; - sp[m][2] = spz; + sp[m][0] = spx; + sp[m][1] = spy; + sp[m][2] = spz; } } @@ -602,24 +602,24 @@ int NEBSpin::initial_rotation(double *spi, double *sploc, double fraction) // Rodrigues' formula breaks, needs to define another axis k if (knormsq == 0.0) { - if (sidotsf > 0.0) { // spins aligned and in same direction + if (sidotsf > 0.0) { // spins aligned and in same direction return 0; - } else if (sidotsf < 0.0) { // spins aligned and in opposite directions + } else if (sidotsf < 0.0) { // spins aligned and in opposite directions // defining a rotation axis // first guess, k = spi x [100] // second guess, k = spi x [010] if (spiy*spiy + spiz*spiz != 0.0) { // spin not along [100] - kx = 0.0; - ky = spiz; - kz = -spiy; - knormsq = ky*ky + kz*kz; + kx = 0.0; + ky = spiz; + kz = -spiy; + knormsq = ky*ky + kz*kz; } else if (spix*spix + spiz*spiz != 0.0) { // spin not along [010] - kx = -spiz; - ky = 0.0; - kz = spix; - knormsq = kx*kx + kz*kz; + kx = -spiz; + ky = 0.0; + kz = spix; + knormsq = kx*kx + kz*kz; } else error->all(FLERR,"Incorrect initial rotation operation"); rot_flag = 1; } @@ -822,9 +822,9 @@ void NEBSpin::print_status() for (int i = 0; i < nreplica; i++) fprintf(uscreen,"%12.8g %12.8g ",rdist[i],all[i][0]); if (verbose) { - for (int i = 0; i < nreplica-1; i++) - fprintf(uscreen,"%12.8g %12.8g ",all[i][2],all[i][5]); - fprintf(uscreen,"%12.8g %12.8g ",NAN,all[nreplica-1][5]); + for (int i = 0; i < nreplica-1; i++) + fprintf(uscreen,"%12.8g %12.8g ",all[i][2],all[i][5]); + fprintf(uscreen,"%12.8g %12.8g ",NAN,all[nreplica-1][5]); } fprintf(uscreen,"\n"); } @@ -838,9 +838,9 @@ void NEBSpin::print_status() for (int i = 0; i < nreplica; i++) fprintf(ulogfile,"%12.8g %12.8g ",rdist[i],all[i][0]); if (verbose) { - for (int i = 0; i < nreplica-1; i++) - fprintf(ulogfile,"%12.8g %12.8g ",all[i][2],all[i][5]); - fprintf(ulogfile,"%12.8g %12.8g ",NAN,all[nreplica-1][5]); + for (int i = 0; i < nreplica-1; i++) + fprintf(ulogfile,"%12.8g %12.8g ",all[i][2],all[i][5]); + fprintf(ulogfile,"%12.8g %12.8g ",NAN,all[nreplica-1][5]); } fprintf(ulogfile,"\n"); fflush(ulogfile); diff --git a/src/SPIN/pair_spin.h b/src/SPIN/pair_spin.h index 0111814c72..34f12d8d59 100644 --- a/src/SPIN/pair_spin.h +++ b/src/SPIN/pair_spin.h @@ -33,8 +33,8 @@ friend class FixNVESpin; virtual void compute_single_pair(int, double *) {} protected: - double hbar; // Planck constant (eV.ps.rad-1) - int lattice_flag; // flag for mech force computation + double hbar; // Planck constant (eV.ps.rad-1) + int lattice_flag; // flag for mech force computation virtual void allocate() {} }; diff --git a/src/SPIN/pair_spin_dipole_cut.cpp b/src/SPIN/pair_spin_dipole_cut.cpp index 4ff90323f2..bae09689de 100644 --- a/src/SPIN/pair_spin_dipole_cut.cpp +++ b/src/SPIN/pair_spin_dipole_cut.cpp @@ -46,11 +46,11 @@ PairSpinDipoleCut::PairSpinDipoleCut(LAMMPS *lmp) : PairSpin(lmp) { spinflag = 1; - hbar = force->hplanck/MY_2PI; // eV/(rad.THz) + hbar = force->hplanck/MY_2PI; // eV/(rad.THz) mub = 9.274e-4; // in A.Ang^2 mu_0 = 785.15; // in eV/Ang/A^2 mub2mu0 = mub * mub * mu_0 / (4.0*MY_PI); // in eV.Ang^3 - //mub2mu0 = mub * mub * mu_0 / (4.0*MY_PI); // in eV + //mub2mu0 = mub * mub * mu_0 / (4.0*MY_PI); // in eV mub2mu0hbinv = mub2mu0 / hbar; // in rad.THz } @@ -178,7 +178,7 @@ void PairSpinDipoleCut::compute(int eflag, int vflag) double **x = atom->x; double **f = atom->f; double **fm = atom->fm; - double **sp = atom->sp; + double **sp = atom->sp; inum = list->inum; ilist = list->ilist; @@ -228,36 +228,36 @@ void PairSpinDipoleCut::compute(int eflag, int vflag) if (rsq < local_cut2) { r2inv = 1.0/rsq; - r3inv = r2inv*rinv; - - compute_dipolar(i,j,eij,fmi,spi,spj,r3inv); - if (lattice_flag) compute_dipolar_mech(i,j,eij,fi,spi,spj,r2inv); + r3inv = r2inv*rinv; + + compute_dipolar(i,j,eij,fmi,spi,spj,r3inv); + if (lattice_flag) compute_dipolar_mech(i,j,eij,fi,spi,spj,r2inv); } // force accumulation f[i][0] += fi[0]; - f[i][1] += fi[1]; + f[i][1] += fi[1]; f[i][2] += fi[2]; fm[i][0] += fmi[0]; fm[i][1] += fmi[1]; fm[i][2] += fmi[2]; if (newton_pair || j < nlocal) { - f[j][0] -= fi[0]; - f[j][1] -= fi[1]; + f[j][0] -= fi[0]; + f[j][1] -= fi[1]; f[j][2] -= fi[2]; } if (eflag) { - if (rsq <= local_cut2) { - evdwl -= (spi[0]*fmi[0] + spi[1]*fmi[1] + spi[2]*fmi[2]); - evdwl *= hbar; - } + if (rsq <= local_cut2) { + evdwl -= (spi[0]*fmi[0] + spi[1]*fmi[1] + spi[2]*fmi[2]); + evdwl *= hbar; + } } else evdwl = 0.0; if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair, - evdwl,ecoul,fi[0],fi[1],fi[2],rij[0],rij[1],rij[2]); + evdwl,ecoul,fi[0],fi[1],fi[2],rij[0],rij[1],rij[2]); } } @@ -277,7 +277,7 @@ void PairSpinDipoleCut::compute_single_pair(int ii, double fmi[3]) int k,locflag; int *type = atom->type; double **x = atom->x; - double **sp = atom->sp; + double **sp = atom->sp; numneigh = list->numneigh; firstneigh = list->firstneigh; @@ -427,7 +427,7 @@ void PairSpinDipoleCut::write_restart(FILE *fp) for (j = i; j <= atom->ntypes; j++) { fwrite(&setflag[i][j],sizeof(int),1,fp); if (setflag[i][j]) { - fwrite(&cut_spin_long[i][j],sizeof(int),1,fp); + fwrite(&cut_spin_long[i][j],sizeof(int),1,fp); } } } @@ -450,10 +450,10 @@ void PairSpinDipoleCut::read_restart(FILE *fp) if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) { - utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,NULL,error); - } - MPI_Bcast(&cut_spin_long[i][j],1,MPI_INT,0,world); + if (me == 0) { + utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,NULL,error); + } + MPI_Bcast(&cut_spin_long[i][j],1,MPI_INT,0,world); } } } diff --git a/src/SPIN/pair_spin_dipole_cut.h b/src/SPIN/pair_spin_dipole_cut.h index f9159a629f..33f62d1633 100644 --- a/src/SPIN/pair_spin_dipole_cut.h +++ b/src/SPIN/pair_spin_dipole_cut.h @@ -49,16 +49,16 @@ class PairSpinDipoleCut : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_long_global; // global long cutoff distance + double cut_spin_long_global; // global long cutoff distance protected: - double hbar; // reduced Planck's constant - double mub; // Bohr's magneton - double mu_0; // vacuum permeability - double mub2mu0; // prefactor for mech force - double mub2mu0hbinv; // prefactor for mag force + double hbar; // reduced Planck's constant + double mub; // Bohr's magneton + double mu_0; // vacuum permeability + double mub2mu0; // prefactor for mech force + double mub2mu0hbinv; // prefactor for mag force - double **cut_spin_long; // cutoff distance long + double **cut_spin_long; // cutoff distance long double g_ewald; int ewald_order; diff --git a/src/SPIN/pair_spin_dipole_long.h b/src/SPIN/pair_spin_dipole_long.h index 1997cbbc55..56fd4c7126 100644 --- a/src/SPIN/pair_spin_dipole_long.h +++ b/src/SPIN/pair_spin_dipole_long.h @@ -50,16 +50,16 @@ class PairSpinDipoleLong : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_long_global; // global long cutoff distance + double cut_spin_long_global; // global long cutoff distance protected: - double hbar; // reduced Planck's constant - double mub; // Bohr's magneton - double mu_0; // vacuum permeability - double mub2mu0; // prefactor for mech force - double mub2mu0hbinv; // prefactor for mag force + double hbar; // reduced Planck's constant + double mub; // Bohr's magneton + double mu_0; // vacuum permeability + double mub2mu0; // prefactor for mech force + double mub2mu0hbinv; // prefactor for mag force - double **cut_spin_long; // cutoff distance long + double **cut_spin_long; // cutoff distance long double g_ewald; int ewald_order; diff --git a/src/SPIN/pair_spin_dmi.h b/src/SPIN/pair_spin_dmi.h index ac2aa387b3..01022623ec 100644 --- a/src/SPIN/pair_spin_dmi.h +++ b/src/SPIN/pair_spin_dmi.h @@ -44,13 +44,13 @@ class PairSpinDmi : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_dmi_global; // short range pair cutoff + double cut_spin_dmi_global; // short range pair cutoff protected: - double **DM; // dmi coeff in eV - double **v_dmx, **v_dmy, **v_dmz; // dmi direction - double **vmech_dmx, **vmech_dmy, **vmech_dmz; // dmi mech direction - double **cut_spin_dmi; // cutoff distance dmi + double **DM; // dmi coeff in eV + double **v_dmx, **v_dmy, **v_dmz; // dmi direction + double **vmech_dmx, **vmech_dmy, **vmech_dmz; // dmi mech direction + double **cut_spin_dmi; // cutoff distance dmi void allocate(); }; diff --git a/src/SPIN/pair_spin_exchange.h b/src/SPIN/pair_spin_exchange.h index 5feb99210f..19eafeb5ca 100644 --- a/src/SPIN/pair_spin_exchange.h +++ b/src/SPIN/pair_spin_exchange.h @@ -44,13 +44,13 @@ class PairSpinExchange : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_exchange_global; // global exchange cutoff distance + double cut_spin_exchange_global; // global exchange cutoff distance protected: - double **J1_mag; // exchange coeffs in eV - double **J1_mech; // mech exchange coeffs in + double **J1_mag; // exchange coeffs in eV + double **J1_mech; // mech exchange coeffs in double **J2, **J3; // J1 in eV, J2 adim, J3 in Ang - double **cut_spin_exchange; // cutoff distance exchange + double **cut_spin_exchange; // cutoff distance exchange void allocate(); }; diff --git a/src/SPIN/pair_spin_magelec.h b/src/SPIN/pair_spin_magelec.h index b9e820b1d1..4df0078bea 100644 --- a/src/SPIN/pair_spin_magelec.h +++ b/src/SPIN/pair_spin_magelec.h @@ -44,12 +44,12 @@ class PairSpinMagelec : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_magelec_global; // global me cutoff + double cut_spin_magelec_global; // global me cutoff protected: - double **ME, **ME_mech; // magelec coeff in eV - double **v_mex, **v_mey, **v_mez; // magelec direction - double **cut_spin_magelec; // magelec cutoff distance + double **ME, **ME_mech; // magelec coeff in eV + double **v_mex, **v_mey, **v_mez; // magelec direction + double **cut_spin_magelec; // magelec cutoff distance void allocate(); }; diff --git a/src/SPIN/pair_spin_neel.h b/src/SPIN/pair_spin_neel.h index 796d8b53f0..5261a7f746 100644 --- a/src/SPIN/pair_spin_neel.h +++ b/src/SPIN/pair_spin_neel.h @@ -44,17 +44,17 @@ class PairSpinNeel : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_neel_global; // global neel cutoff distance + double cut_spin_neel_global; // global neel cutoff distance protected: // pseudo-dipolar and pseudo-quadrupolar coeff. - double **g1, **g1_mech; // neel coeffs gij - double **g2, **g3; // g1 in eV, g2 adim, g3 in Ang - double **q1, **q1_mech; // neel coeffs qij - double **q2, **q3; // q1 in eV, q2 adim, q3 in Ang - double **cut_spin_neel; // cutoff distance exchange + double **g1, **g1_mech; // neel coeffs gij + double **g2, **g3; // g1 in eV, g2 adim, g3 in Ang + double **q1, **q1_mech; // neel coeffs qij + double **q2, **q3; // q1 in eV, q2 adim, q3 in Ang + double **cut_spin_neel; // cutoff distance exchange void allocate(); }; diff --git a/src/USER-MISC/compute_hma.cpp b/src/USER-MISC/compute_hma.cpp index f1c2e9ba3a..56103a42b0 100644 --- a/src/USER-MISC/compute_hma.cpp +++ b/src/USER-MISC/compute_hma.cpp @@ -457,7 +457,7 @@ double ComputeHMA::virial_compute(int n) /* ---------------------------------------------------------------------- */ int ComputeHMA::pack_forward_comm(int n, int *list, double *buf, - int /* pbc_flag */, int * /* pbc */) + int /* pbc_flag */, int * /* pbc */) { int m = 0; for (int ii = 0; ii < n; ii++) { diff --git a/src/USER-MISC/fix_bond_react.cpp b/src/USER-MISC/fix_bond_react.cpp index bfa93e178c..33aab5b4ad 100644 --- a/src/USER-MISC/fix_bond_react.cpp +++ b/src/USER-MISC/fix_bond_react.cpp @@ -259,12 +259,12 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : "probability seed must be positive"); iarg += 3; } else if (strcmp(arg[iarg],"max_rxn") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " - "'max_rxn' has too few arguments"); - max_rxn[rxn] = force->inumeric(FLERR,arg[iarg+1]); - if (max_rxn[rxn] < 0) error->all(FLERR,"Illegal fix bond/react command: " - "'max_rxn' cannot be negative"); - iarg += 2; + if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " + "'max_rxn' has too few arguments"); + max_rxn[rxn] = force->inumeric(FLERR,arg[iarg+1]); + if (max_rxn[rxn] < 0) error->all(FLERR,"Illegal fix bond/react command: " + "'max_rxn' cannot be negative"); + iarg += 2; } else if (strcmp(arg[iarg],"stabilize_steps") == 0) { if (stabilization_flag == 0) error->all(FLERR,"Stabilize_steps keyword " "used without stabilization keyword"); diff --git a/src/USER-MISC/pair_ilp_graphene_hbn.cpp b/src/USER-MISC/pair_ilp_graphene_hbn.cpp index e09287ae23..9faa350468 100644 --- a/src/USER-MISC/pair_ilp_graphene_hbn.cpp +++ b/src/USER-MISC/pair_ilp_graphene_hbn.cpp @@ -523,7 +523,7 @@ void PairILPGrapheneHBN::calc_FvdW(int eflag, int /* vflag */) // derivatives fpair = -6.0*p.C6*r8inv/TSvdw + p.C6*p.d/p.seff*(TSvdw-1.0)*TSvdw2inv*r8inv*r; - fsum = fpair*Tap - Vilp*dTap/r; + fsum = fpair*Tap - Vilp*dTap/r; f[i][0] += fsum*delx; f[i][1] += fsum*dely; @@ -634,12 +634,12 @@ void PairILPGrapheneHBN::calc_FRep(int eflag, int /* vflag */) dprodnorm1[0] = dnormdri[0][0][i]*delx + dnormdri[1][0][i]*dely + dnormdri[2][0][i]*delz; dprodnorm1[1] = dnormdri[0][1][i]*delx + dnormdri[1][1][i]*dely + dnormdri[2][1][i]*delz; dprodnorm1[2] = dnormdri[0][2][i]*delx + dnormdri[1][2][i]*dely + dnormdri[2][2][i]*delz; - fp1[0] = prodnorm1*normal[i][0]*fpair1; - fp1[1] = prodnorm1*normal[i][1]*fpair1; - fp1[2] = prodnorm1*normal[i][2]*fpair1; - fprod1[0] = prodnorm1*dprodnorm1[0]*fpair1; - fprod1[1] = prodnorm1*dprodnorm1[1]*fpair1; - fprod1[2] = prodnorm1*dprodnorm1[2]*fpair1; + fp1[0] = prodnorm1*normal[i][0]*fpair1; + fp1[1] = prodnorm1*normal[i][1]*fpair1; + fp1[2] = prodnorm1*normal[i][2]*fpair1; + fprod1[0] = prodnorm1*dprodnorm1[0]*fpair1; + fprod1[1] = prodnorm1*dprodnorm1[1]*fpair1; + fprod1[2] = prodnorm1*dprodnorm1[2]*fpair1; fkcx = (delx*fsum - fp1[0])*Tap - Vilp*dTap*delx/r; fkcy = (dely*fsum - fp1[1])*Tap - Vilp*dTap*dely/r; diff --git a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp index 8ba3dc9db3..d0d8517550 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp @@ -519,11 +519,11 @@ void PairKolmogorovCrespiFull::calc_FvdW(int eflag, int /* vflag */) dTap = calc_dTap(r,Rcut); } else {Tap = 1.0; dTap = 0.0;} - Vkc = -p.A*p.z06*r6inv; + Vkc = -p.A*p.z06*r6inv; // derivatives fpair = -6.0*p.A*p.z06*r8inv; - fsum = fpair*Tap - Vkc*dTap/r; + fsum = fpair*Tap - Vkc*dTap/r; f[i][0] += fsum*delx; f[i][1] += fsum*dely; @@ -607,11 +607,11 @@ void PairKolmogorovCrespiFull::calc_FRep(int eflag, int /* vflag */) r = sqrt(rsq); - // turn on/off taper function - if (tap_flag) { - Tap = calc_Tap(r,sqrt(cutsq[itype][jtype])); - dTap = calc_dTap(r,sqrt(cutsq[itype][jtype])); - } else {Tap = 1.0; dTap = 0.0;} + // turn on/off taper function + if (tap_flag) { + Tap = calc_Tap(r,sqrt(cutsq[itype][jtype])); + dTap = calc_dTap(r,sqrt(cutsq[itype][jtype])); + } else {Tap = 1.0; dTap = 0.0;} // Calculate the transverse distance prodnorm1 = normal[i][0]*delx + normal[i][1]*dely + normal[i][2]*delz; @@ -626,7 +626,7 @@ void PairKolmogorovCrespiFull::calc_FRep(int eflag, int /* vflag */) sumC11 = (p.C2 + 2.0*p.C4*rho_ij)*p.delta2inv; frho_ij = exp1*sumC1; sumCff = 0.5*p.C + frho_ij; - Vkc = exp0*sumCff; + Vkc = exp0*sumCff; // derivatives fpair = p.lambda*exp0/r*sumCff; @@ -653,10 +653,10 @@ void PairKolmogorovCrespiFull::calc_FRep(int eflag, int /* vflag */) f[j][1] -= fkcy; f[j][2] -= fkcz; - // calculate the forces acted on the neighbors of atom i from atom j - KC_neighs_i = KC_firstneigh[i]; - for (kk = 0; kk < KC_numneigh[i]; kk++) { - k = KC_neighs_i[kk]; + // calculate the forces acted on the neighbors of atom i from atom j + KC_neighs_i = KC_firstneigh[i]; + for (kk = 0; kk < KC_numneigh[i]; kk++) { + k = KC_neighs_i[kk]; if (k == i) continue; // derivatives of the product of rij and ni respect to rk, k=0,1,2, where atom k is the neighbors of atom i dprodnorm1[0] = dnormal[0][0][kk][i]*delx + dnormal[1][0][kk][i]*dely + dnormal[2][0][kk][i]*delz; @@ -672,7 +672,7 @@ void PairKolmogorovCrespiFull::calc_FRep(int eflag, int /* vflag */) delkj[1] = x[k][1] - x[j][1]; delkj[2] = x[k][2] - x[j][2]; if (evflag) ev_tally_xyz(k,j,nlocal,newton_pair,0.0,0.0,fk[0],fk[1],fk[2],delkj[0],delkj[1],delkj[2]); - } + } if (eflag) { if (tap_flag) pvector[1] += evdwl = Tap*Vkc; @@ -790,7 +790,7 @@ void PairKolmogorovCrespiFull::calc_normal() memory->create(dnormal,3,3,3,nmax,"KolmogorovCrespiFull:dnormal"); } - inum = list->inum; + inum = list->inum; ilist = list->ilist; //Calculate normals for (ii = 0; ii < inum; ii++) { diff --git a/src/USER-MISC/pair_lj_expand_coul_long.cpp b/src/USER-MISC/pair_lj_expand_coul_long.cpp index 957173bf7f..f52e427c18 100644 --- a/src/USER-MISC/pair_lj_expand_coul_long.cpp +++ b/src/USER-MISC/pair_lj_expand_coul_long.cpp @@ -786,9 +786,9 @@ double PairLJExpandCoulLong::init_one(int i, int j) (1.0/3.0 + 2.0*shift1/(4.0*rc1) + shift2/(5.0*rc2))/rc3); ptail_ij = 16.0*MY_PI*all[0]*all[1]*epsilon[i][j] * sig6 * ((1.0/9.0 + 3.0*shift1/(10.0*rc1) + - 3.0*shift2/(11.0*rc2) + shift3/(12.0*rc3))*2.0*sig6/rc9 - + 3.0*shift2/(11.0*rc2) + shift3/(12.0*rc3))*2.0*sig6/rc9 - (1.0/3.0 + 3.0*shift1/(4.0*rc1) + - 3.0*shift2/(5.0*rc2) + shift3/(6.0*rc3))/rc3); + 3.0*shift2/(5.0*rc2) + shift3/(6.0*rc3))/rc3); } return cut; diff --git a/src/USER-MISC/pair_local_density.cpp b/src/USER-MISC/pair_local_density.cpp index 97aa3dcaca..1e4ad3edf6 100644 --- a/src/USER-MISC/pair_local_density.cpp +++ b/src/USER-MISC/pair_local_density.cpp @@ -61,7 +61,7 @@ static const char cite_pair_local_density[] = PairLocalDensity::PairLocalDensity(LAMMPS *lmp) : Pair(lmp) { restartinfo = 0; - one_coeff = 1; + one_coeff = 1; single_enable = 1; // stuff read from tabulated file @@ -117,7 +117,7 @@ PairLocalDensity::~PairLocalDensity() memory->destroy(rho_min); memory->destroy(rho_max); - memory->destroy(delta_rho); + memory->destroy(delta_rho); memory->destroy(c0); memory->destroy(c2); memory->destroy(c4); @@ -144,7 +144,7 @@ void PairLocalDensity::compute(int eflag, int vflag) double p, *coeff; int *ilist,*jlist,*numneigh,**firstneigh; - phi = uLD = evdwl = fpair = rsqinv = 0.0; + phi = uLD = evdwl = fpair = rsqinv = 0.0; if (eflag || vflag) ev_setup(eflag,vflag); else evflag = vflag_fdotr = eflag_global = eflag_atom = 0; @@ -180,11 +180,11 @@ void PairLocalDensity::compute(int eflag, int vflag) if (newton_pair) { m = nlocal + atom->nghost; for (k = 0; k < nLD; k++) { - for (i = 0; i < m; i++) { + for (i = 0; i < m; i++) { localrho[k][i] = 0.0; fp[k][i] = 0.0; } - } + } } else { for (k = 0; k < nLD; k++){ @@ -209,14 +209,14 @@ void PairLocalDensity::compute(int eflag, int vflag) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; j &= NEIGHMASK; - jtype = type[j]; + jtype = type[j]; // calculate distance-squared between i,j atom-types delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; + rsq = delx*delx + dely*dely + delz*delz; // calculating LDs based on central and neigh filters @@ -239,7 +239,7 @@ void PairLocalDensity::compute(int eflag, int vflag) localrho[k][j] += (phi * b[k][itype]); } } - } + } } // communicate and sum LDs over all procs @@ -247,10 +247,10 @@ void PairLocalDensity::compute(int eflag, int vflag) // - for (ii = 0; ii < inum; ii++) { + for (ii = 0; ii < inum; ii++) { i = ilist[ii]; itype = type[i]; - uLD = 0.0; + uLD = 0.0; for (k = 0; k < nLD; k++) { @@ -284,7 +284,7 @@ void PairLocalDensity::compute(int eflag, int vflag) if (eflag) { if (eflag_global) eng_vdwl += uLD; - if (eflag_atom) eatom[i] += uLD; + if (eflag_atom) eatom[i] += uLD; } } @@ -306,7 +306,7 @@ void PairLocalDensity::compute(int eflag, int vflag) jnum = numneigh[i]; for (jj = 0; jj < jnum; jj++) { - j = jlist[jj]; + j = jlist[jj]; j &= NEIGHMASK; jtype = type[j]; @@ -326,7 +326,7 @@ void PairLocalDensity::compute(int eflag, int vflag) dphi = rsq * (2.0*c2[k] + rsq * (4.0*c4[k] + 6.0*c6[k]*rsq)); fpair += -(a[k][itype]*b[k][jtype]*fp[k][i] + a[k][jtype]*b[k][itype]*fp[k][j]) * dphi; } - } + } fpair *= rsqinv; f[i][0] += delx*fpair; @@ -459,8 +459,8 @@ double PairLocalDensity::init_one(int /* i */, int /* j */) ---------------------------------------------------------------------------*/ double PairLocalDensity::single(int /* i */, int /* j */, int itype, int jtype, - double rsq, double /* factor_coul */, - double /* factor_lj */, double &fforce) + double rsq, double /* factor_coul */, + double /* factor_lj */, double &fforce) { int m, k, index; double rsqinv, p, uLD; @@ -473,7 +473,7 @@ double PairLocalDensity::single(int /* i */, int /* j */, int itype, int jtype, for (k = 0; k < nLD; k++) { LD[k][1] = 0.0; // itype:- 1 LD[k][2] = 0.0; // jtype:- 2 - } + } rsqinv = 1.0/rsq; for (k = 0; k < nLD; k++) { @@ -556,24 +556,24 @@ void PairLocalDensity::interpolate_cbspl(int n, double delta, { /* inputs: n number of interpolating points - - f array containing function values to - be interpolated; f[i] is the function - value corresponding to x[i] - ('x' refers to the independent var) - - delta difference in tabulated values of x + + f array containing function values to + be interpolated; f[i] is the function + value corresponding to x[i] + ('x' refers to the independent var) + + delta difference in tabulated values of x - outputs: (packaged as columns of the coeff matrix) - coeff_b coeffs of linear terms - coeff_c coeffs of quadratic terms - coeff_d coeffs of cubic terms + outputs: (packaged as columns of the coeff matrix) + coeff_b coeffs of linear terms + coeff_c coeffs of quadratic terms + coeff_d coeffs of cubic terms spline matrix that collects b,c,d - - other parameters: - fpa derivative of function at x=a - fpb derivative of function at x=b + + other parameters: + fpa derivative of function at x=a + fpb derivative of function at x=b */ double *dl, *dd, *du; @@ -684,12 +684,12 @@ void PairLocalDensity::parse_file(char *filename) { // broadcast number of LD potentials and number of (rho,frho) pairs if (me == 0) { - // first 2 comment lines ignored + // first 2 comment lines ignored utils::sfgets(FLERR,line,MAXLINE,fptr,filename,error); utils::sfgets(FLERR,line,MAXLINE,fptr,filename,error); // extract number of potentials and number of (frho, rho) points - utils::sfgets(FLERR,line,MAXLINE,fptr,filename,error); + utils::sfgets(FLERR,line,MAXLINE,fptr,filename,error); sscanf(line, "%d %d", &nLD, &nrho); utils::sfgets(FLERR,line,MAXLINE,fptr,filename,error); } @@ -711,9 +711,9 @@ void PairLocalDensity::parse_file(char *filename) { memory->create(delta_rho, nLD,"pairLD:delta_rho"); memory->create(ftmp, nrho*nLD, "pairLD:ftmp"); - // setting up central and neighbor atom filters + // setting up central and neighbor atom filters memory->create(a, nLD, atom->ntypes+1 , "pairLD:a"); - memory->create(b, nLD, atom->ntypes+1, "pairLD:b"); + memory->create(b, nLD, atom->ntypes+1, "pairLD:b"); if (me == 0) { for (n = 1; n <= atom->ntypes; n++){ for (k = 0; k < nLD; k++) { @@ -721,14 +721,14 @@ void PairLocalDensity::parse_file(char *filename) { b[k][n] = 0; } } - } + } // read file block by block if (me == 0) { for (k = 0; k < nLD; k++) { - // parse upper and lower cut values + // parse upper and lower cut values if (fgets(line,MAXLINE,fptr)==NULL) break; sscanf(line, "%lf %lf", &lowercut[k], &uppercut[k]); @@ -743,7 +743,7 @@ void PairLocalDensity::parse_file(char *filename) { // parse neighbor atom filter utils::sfgets(FLERR,line, MAXLINE, fptr,filename,error); tmp = strtok(line, " /t/n/r/f"); - while (tmp != NULL) { + while (tmp != NULL) { b[k][atoi(tmp)] = 1; tmp = strtok(NULL, " /t/n/r/f"); } @@ -778,7 +778,7 @@ void PairLocalDensity::parse_file(char *filename) { } } - // Broadcast all parsed arrays + // Broadcast all parsed arrays MPI_Bcast(&lowercut[0], nLD, MPI_DOUBLE, 0, world); MPI_Bcast(&uppercut[0], nLD, MPI_DOUBLE, 0, world); MPI_Bcast(&lowercutsq[0], nLD, MPI_DOUBLE, 0, world); @@ -818,16 +818,16 @@ void PairLocalDensity::parse_file(char *filename) { ------------------------------------------------------------------------- */ int PairLocalDensity::pack_comm(int n, int *list, double *buf, - int /* pbc_flag */, int * /* pbc */) { + int /* pbc_flag */, int * /* pbc */) { int i,j,k; - int m; + int m; m = 0; for (i = 0; i < n; i++) { j = list[i]; for (k = 0; k < nLD; k++) { buf[m++] = fp[k][j]; - } + } } return nLD; @@ -845,7 +845,7 @@ void PairLocalDensity::unpack_comm(int n, int first, double *buf) { for (k = 0; k < nLD; k++) { fp[k][i] = buf[m++]; } - } + } } /* ---------------------------------------------------------------------- */ @@ -876,7 +876,7 @@ void PairLocalDensity::unpack_reverse_comm(int n, int *list, double *buf) { j = list[i]; for (k = 0; k < nLD; k++) { localrho[k][j] += buf[m++]; - } + } } } diff --git a/src/USER-MISC/pair_local_density.h b/src/USER-MISC/pair_local_density.h index 77aab1399b..5e37376ece 100644 --- a/src/USER-MISC/pair_local_density.h +++ b/src/USER-MISC/pair_local_density.h @@ -72,13 +72,13 @@ class PairLocalDensity : public Pair { void allocate(); - // read tabulated input file - void parse_file(char *); + // read tabulated input file + void parse_file(char *); - // convert array to spline - void array2spline(); - - // cubic spline interpolation + // convert array to spline + void array2spline(); + + // cubic spline interpolation void interpolate_cbspl(int, double, double *, double **); }; diff --git a/src/USER-OMP/reaxc_init_md_omp.cpp b/src/USER-OMP/reaxc_init_md_omp.cpp index fce23c645f..66f1acf91c 100644 --- a/src/USER-OMP/reaxc_init_md_omp.cpp +++ b/src/USER-OMP/reaxc_init_md_omp.cpp @@ -46,8 +46,8 @@ extern int Init_Workspace(reax_system*, control_params*, storage*, char*); /* ---------------------------------------------------------------------- */ int Init_ListsOMP(reax_system *system, control_params *control, - simulation_data * /* data */, storage * /* workspace */, - reax_list **lists, mpi_datatypes * /* mpi_data */, char * /* msg */) + simulation_data * /* data */, storage * /* workspace */, + reax_list **lists, mpi_datatypes * /* mpi_data */, char * /* msg */) { int i, total_hbonds, total_bonds, bond_cap, num_3body, cap_3body, Htop; int *hb_top, *bond_top; diff --git a/src/USER-REAXC/reaxc_ffield.cpp b/src/USER-REAXC/reaxc_ffield.cpp index e3a6645fc2..a44c7d5cbd 100644 --- a/src/USER-REAXC/reaxc_ffield.cpp +++ b/src/USER-REAXC/reaxc_ffield.cpp @@ -154,7 +154,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax, /* Sanity checks */ if (c == 2 && !lgflag) - control->error_ptr->all(FLERR, "Force field file requires using 'lgvdw yes'"); + control->error_ptr->all(FLERR, "Force field file requires using 'lgvdw yes'"); if (c < 9) { snprintf (errmsg, 1024, "Missing parameter(s) in line %s", s); diff --git a/src/force.cpp b/src/force.cpp index cc121a5f80..63d1fcbe31 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -204,17 +204,17 @@ void Force::init() if (!bond && (atom->nbonds > 0)) { error->warning(FLERR,"Bonds are defined but no bond style is set"); if ((special_lj[1] != 1.0) || (special_coul[1] != 1.0)) - error->warning(FLERR,"Likewise 1-2 special neighbor interactions != 1.0"); + error->warning(FLERR,"Likewise 1-2 special neighbor interactions != 1.0"); } if (!angle && (atom->nangles > 0)) { error->warning(FLERR,"Angles are defined but no angle style is set"); if ((special_lj[2] != 1.0) || (special_coul[2] != 1.0)) - error->warning(FLERR,"Likewise 1-3 special neighbor interactions != 1.0"); + error->warning(FLERR,"Likewise 1-3 special neighbor interactions != 1.0"); } if (!dihedral && (atom->ndihedrals > 0)) { error->warning(FLERR,"Dihedrals are defined but no dihedral style is set"); if ((special_lj[3] != 1.0) || (special_coul[3] != 1.0)) - error->warning(FLERR,"Likewise 1-4 special neighbor interactions != 1.0"); + error->warning(FLERR,"Likewise 1-4 special neighbor interactions != 1.0"); } if (!improper && (atom->nimpropers > 0)) error->warning(FLERR,"Impropers are defined but no improper style is set"); diff --git a/src/min.h b/src/min.h index 61f9ce0bda..6f3e10d048 100644 --- a/src/min.h +++ b/src/min.h @@ -64,11 +64,11 @@ class Min : protected Pointers { int virial_style; // compute virial explicitly or implicitly int external_force_clear; // clear forces locally or externally - double dmax; // max dist to move any atom in one step - int linestyle; // 0 = backtrack, 1 = quadratic, 2 = forcezero - // 3 = spin_cubic, 4 = spin_none + double dmax; // max dist to move any atom in one step + int linestyle; // 0 = backtrack, 1 = quadratic, 2 = forcezero + // 3 = spin_cubic, 4 = spin_none - int normstyle; // TWO, MAX or INF flag for force norm evaluation + int normstyle; // TWO, MAX or INF flag for force norm evaluation int nelist_global,nelist_atom; // # of PE,virial computes to check int nvlist_global,nvlist_atom; diff --git a/src/min_cg.cpp b/src/min_cg.cpp index 80dde25f51..7b7046ea00 100644 --- a/src/min_cg.cpp +++ b/src/min_cg.cpp @@ -100,7 +100,7 @@ int MinCG::iterate(int maxiter) for (i = 0; i < n; i++) { dot[0] += fatom[i]*fatom[i]; dot[1] += fatom[i]*gatom[i]; - fmax = MAX(fmax,fatom[i]*fatom[i]); + fmax = MAX(fmax,fatom[i]*fatom[i]); } } MPI_Allreduce(dot,dotall,2,MPI_DOUBLE,MPI_SUM,world); @@ -111,13 +111,13 @@ int MinCG::iterate(int maxiter) } fmax = 0.0; - if (normstyle == MAX) { // max force norm + if (normstyle == MAX) { // max force norm fmax = fnorm_max(); if (fmax < update->ftol*update->ftol) return FTOL; - } else if (normstyle == INF) { // infinite force norm + } else if (normstyle == INF) { // infinite force norm fmax = fnorm_inf(); if (fmax < update->ftol*update->ftol) return FTOL; - } else if (normstyle == TWO) { // Euclidean force 2-norm + } else if (normstyle == TWO) { // Euclidean force 2-norm if (dotall[0] < update->ftol*update->ftol) return FTOL; } else error->all(FLERR,"Illegal min_modify command"); diff --git a/src/min_fire.cpp b/src/min_fire.cpp index b4b0f14534..3449f431c9 100644 --- a/src/min_fire.cpp +++ b/src/min_fire.cpp @@ -251,9 +251,9 @@ int MinFire::iterate(int maxiter) // sync across replicas if running multi-replica minimization if (update->ftol > 0.0) { - if (normstyle == MAX) fdotf = fnorm_max(); // max force norm - else if (normstyle == INF) fdotf = fnorm_inf(); // inf force norm - else if (normstyle == TWO) fdotf = fnorm_sqr(); // Euclidean force 2-norm + if (normstyle == MAX) fdotf = fnorm_max(); // max force norm + else if (normstyle == INF) fdotf = fnorm_inf(); // inf force norm + else if (normstyle == TWO) fdotf = fnorm_sqr(); // Euclidean force 2-norm else error->all(FLERR,"Illegal min_modify command"); if (update->multireplica == 0) { if (fdotf < update->ftol*update->ftol) return FTOL; diff --git a/src/min_sd.cpp b/src/min_sd.cpp index 627a3b3cf3..b89682ab5c 100644 --- a/src/min_sd.cpp +++ b/src/min_sd.cpp @@ -78,9 +78,9 @@ int MinSD::iterate(int maxiter) // force tolerance criterion - if (normstyle == MAX) fdotf = fnorm_max(); // max force norm - else if (normstyle == INF) fdotf = fnorm_inf(); // infinite force norm - else if (normstyle == TWO) fdotf = fnorm_sqr(); // Euclidean force 2-norm + if (normstyle == MAX) fdotf = fnorm_max(); // max force norm + else if (normstyle == INF) fdotf = fnorm_inf(); // infinite force norm + else if (normstyle == TWO) fdotf = fnorm_sqr(); // Euclidean force 2-norm else error->all(FLERR,"Illegal min_modify command"); if (fdotf < update->ftol*update->ftol) return FTOL;