diff --git a/doc/src/Bibliography.rst b/doc/src/Bibliography.rst index 2d27d2e6f9..e9ea8b0925 100644 --- a/doc/src/Bibliography.rst +++ b/doc/src/Bibliography.rst @@ -203,7 +203,7 @@ Bibliography A Caro, DA Crowson, M Caro; Phys Rev Lett, 95, 075702 (2005) **(CasP)** - CasP webpage: https://www.helmholtz-berlin.de/people/gregor-schiwietz/casp_en.html + CasP webpage: http://www.casp-program.org/ **(Cawkwell2012)** A.\ M. N. Niklasson, M. J. Cawkwell, Phys. Rev. B, 86 (17), 174308 (2012). diff --git a/doc/src/fix_electron_stopping.rst b/doc/src/fix_electron_stopping.rst index 681a000321..990e4203f4 100644 --- a/doc/src/fix_electron_stopping.rst +++ b/doc/src/fix_electron_stopping.rst @@ -204,7 +204,7 @@ The default is no limitation by region, and minneigh = 1. .. _CasP: -**(CasP)** CasP webpage: https://www.helmholtz-berlin.de/people/gregor-schiwietz/casp_en.html +**(CasP)** CasP webpage: http://www.casp-program.org/ .. _PASS: diff --git a/doc/utils/sphinx-config/LAMMPSLexer.py b/doc/utils/sphinx-config/LAMMPSLexer.py index c8826a9ed6..9a4a1e2bc6 100644 --- a/doc/utils/sphinx-config/LAMMPSLexer.py +++ b/doc/utils/sphinx-config/LAMMPSLexer.py @@ -2,14 +2,15 @@ from pygments.lexer import RegexLexer, words, include, default from pygments.token import * LAMMPS_COMMANDS = ("angle_coeff", "angle_style", "atom_modify", - "atom_style", "balance", "bond_coeff", "bond_style", - "bond_write", "boundary", "clear", "comm_modify", - "comm_style", "compute_modify", "create_atoms", - "create_bonds", "create_box", "delete_atoms", - "delete_bonds", "dielectric", "dihedral_coeff", - "dihedral_style", "dimension", "displace_atoms", - "dump_modify", "dynamical_matrix", "echo", "elif", - "else", "fix_modify", "group2ndx", "hyper", "if", + "atom_style", "angle_write", "balance", "bond_coeff", + "bond_style", "bond_write", "boundary", "clear", + "comm_modify", "comm_style", "compute_modify", + "create_atoms", "create_bonds", "create_box", + "delete_atoms", "delete_bonds", "dielectric", + "dihedral_coeff", "dihedral_style", "dihedral_write", + "dimension", "displace_atoms", "dump_modify", + "dynamical_matrix", "echo", "elif", "else", "fitpod", + "fix_modify", "group2ndx", "hyper", "if", "improper_coeff", "improper_style", "include", "info", "jump", "kim", "kspace_modify", "kspace_style", "label", "labelmap", "lattice", diff --git a/examples/ASPHERE/ellipsoid/in.ellipsoid b/examples/ASPHERE/ellipsoid/in.ellipsoid index 5e9a20f6e0..1ee59597da 100644 --- a/examples/ASPHERE/ellipsoid/in.ellipsoid +++ b/examples/ASPHERE/ellipsoid/in.ellipsoid @@ -1,23 +1,23 @@ # SRD diffusion demo - ellipsoids -units lj -atom_style ellipsoid -atom_modify first big -dimension 2 +units lj +atom_style ellipsoid +atom_modify first big +dimension 2 # create big ellipsoidal particles -lattice sq 0.14 -region box block 0 10 0 10 -0.5 0.5 -create_box 2 box -create_atoms 1 region box +lattice sq 0.14 +region box block 0 10 0 10 -0.5 0.5 +create_box 2 box +create_atoms 1 region box -set type 1 mass 1.0 -set type 1 shape 3.0 1.0 1.0 -group big type 1 -set group big quat/random 29898 +set type 1 mass 1.0 +set type 1 shape 3.0 1.0 1.0 +group big type 1 +set group big quat/random 29898 -velocity big create 1.44 87287 loop geom +velocity big create 1.44 87287 loop geom # equilibrate big particles @@ -26,57 +26,59 @@ pair_coeff 1 1 1.0 1.0 1 1 1 1 1 1 pair_coeff 1 2 1.0 1.0 1 1 1 1 1 1 0.0 pair_coeff 2 2 1.0 1.0 1 1 1 1 1 1 0.0 -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes -fix 1 big nve/asphere -fix 2 all enforce2d +fix 1 big nve/asphere +fix 2 all enforce2d -compute rot big temp/asphere +compute rot big temp/asphere +compute 0 all property/atom quatw quati quatj quatk shapex shapey shapez -#dump 1 all custom 10 dump.ellipsoid.equil id type x y z & -# quatw quati quatj quatk +#dump 1 all custom 10 dump.ellipsoid.equil id type x y z c_0[*] +#dump_modify 1 colname c_0[1] quatw colname c_0[2] quati colname c_0[3] quatj colname c_0[4] quatk & +# colname c_0[5] shapex colname c_0[6] shapey colname c_0[7] shapez -thermo_style custom step temp c_rot epair etotal press -thermo 100 +thermo_style custom step temp c_rot epair etotal press +thermo 100 -run 1000 +run 1000 -#undump 1 -unfix 1 -unfix 2 +#undump 1 +unfix 1 +unfix 2 # add small particles as hi density lattice -region plane block INF INF INF INF -0.001 0.001 units box -lattice sq 120.0 -create_atoms 2 region plane +region plane block INF INF INF INF -0.001 0.001 units box +lattice sq 120.0 +create_atoms 2 region plane -set type 2 mass 0.01 -group small type 2 -velocity small create 1.0 593849 loop geom +set type 2 mass 0.01 +group small type 2 +velocity small create 1.0 593849 loop geom # delete overlaps # must set 1-2 cutoff to non-zero value -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 -pair_coeff 2 2 0.0 1.0 0.0 -pair_coeff 1 2 0.0 1.0 2.0 +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 +pair_coeff 2 2 0.0 1.0 0.0 +pair_coeff 1 2 0.0 1.0 2.0 -neigh_modify one 10000 +neigh_modify one 10000 -delete_atoms overlap 1.6 small big +delete_atoms overlap 1.6 small big # SRD run -reset_timestep 0 +reset_timestep 0 -neighbor 0.3 multi -neigh_modify delay 0 every 1 check yes +neighbor 0.3 multi +neigh_modify delay 0 every 1 check yes -comm_modify mode multi group big vel yes -neigh_modify include big +comm_modify mode multi group big vel yes +neigh_modify include big # no pairwise interactions with small particles @@ -88,29 +90,30 @@ pair_coeff 2 2 1.0 1.0 1 1 1 1 1 1 0.0 # use fix SRD to push small particles out from inside big ones # if comment out, big particles won't see SRD particles -timestep 0.0005 +timestep 0.0005 -fix 1 big nve/asphere -fix 2 small srd 20 big 1.0 0.25 49894 shift yes 54979 & - collision noslip search 0.2 inside ignore exact no bounce 50 -fix 3 all enforce2d +fix 1 big nve/asphere +fix 2 small srd 20 big 1.0 0.25 49894 shift yes 54979 & + collision noslip search 0.2 inside ignore exact no bounce 50 +fix 3 all enforce2d # diagnostics -compute tbig big temp/asphere -variable pebig equal pe*atoms/count(big) -variable ebig equal etotal*atoms/count(big) -thermo_style custom step temp c_rot f_2[9] etotal v_pebig v_ebig press & - f_2[1] f_2[2] f_2[3] f_2[4] f_2[5] & - f_2[6] f_2[7] f_2[8] f_2[9] f_2[10] f_2[11] f_2[12] +compute tbig big temp/asphere +variable pebig equal pe*atoms/count(big) +variable ebig equal etotal*atoms/count(big) +thermo_style custom step temp c_rot f_2[9] etotal v_pebig v_ebig press & + f_2[1] f_2[2] f_2[3] f_2[4] f_2[5] & + f_2[6] f_2[7] f_2[8] f_2[9] f_2[10] f_2[11] f_2[12] -thermo_modify temp tbig -thermo 1000 +thermo_modify temp tbig +thermo 1000 -#dump 1 all custom 1000 dump.ellipsoid id type x y z & -# quatw quati quatj quatk +#dump 1 all custom 1000 dump.ellipsoid id type x y z c_0[*] +#dump_modify 1 colname c_0[1] quatw colname c_0[2] quati colname c_0[3] quatj colname c_0[4] quatk & +# colname c_0[5] shapex colname c_0[6] shapey colname c_0[7] shapez -#dump 1 all image 1000 image.*.jpg type type zoom 1.6 -#dump_modify 1 pad 6 adiam 1 1 adiam 2 0.2 +#dump 2 all image 1000 image.*.jpg type type zoom 1.6 +#dump_modify 2 pad 6 adiam 1 1 adiam 2 0.2 -run 100000 +run 100000 diff --git a/examples/ASPHERE/ellipsoid/in.ellipsoid.mp b/examples/ASPHERE/ellipsoid/in.ellipsoid.mp index 7ce01ad4e1..31fe79eb58 100644 --- a/examples/ASPHERE/ellipsoid/in.ellipsoid.mp +++ b/examples/ASPHERE/ellipsoid/in.ellipsoid.mp @@ -1,23 +1,23 @@ # SRD viscosity demo - ellipsoids -units lj -atom_style ellipsoid -atom_modify first big -dimension 2 +units lj +atom_style ellipsoid +atom_modify first big +dimension 2 # create big ellipsoidal particles -lattice sq 0.14 -region box block 0 10 0 10 -0.5 0.5 -create_box 2 box -create_atoms 1 region box +lattice sq 0.14 +region box block 0 10 0 10 -0.5 0.5 +create_box 2 box +create_atoms 1 region box -set type 1 mass 1.0 -set type 1 shape 3.0 1.0 1.0 -group big type 1 -set group big quat/random 29898 +set type 1 mass 1.0 +set type 1 shape 3.0 1.0 1.0 +group big type 1 +set group big quat/random 29898 -velocity big create 1.44 87287 loop geom +velocity big create 1.44 87287 loop geom # equilibrate big particles @@ -26,57 +26,59 @@ pair_coeff 1 1 1.0 1.0 1 1 1 1 1 1 pair_coeff 1 2 1.0 1.0 1 1 1 1 1 1 0.0 pair_coeff 2 2 1.0 1.0 1 1 1 1 1 1 0.0 -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes -fix 1 big nve/asphere -fix 2 all enforce2d +fix 1 big nve/asphere +fix 2 all enforce2d -compute rot big temp/asphere +compute rot big temp/asphere +compute 0 all property/atom quatw quati quatj quatk shapex shapey shapez -#dump 1 all custom 10 dump.ellipsoid.equil id type x y z & -# quatw quati quatj quatk +#dump 1 all custom 10 dump.ellipsoid.equil id type x y z c_0[*] +#dump_modify 1 colname c_0[1] quatw colname c_0[2] quati colname c_0[3] quatj colname c_0[4] quatk & +# colname c_0[5] shapex colname c_0[6] shapey colname c_0[7] shapez -thermo_style custom step temp c_rot epair etotal press -thermo 100 +thermo_style custom step temp c_rot epair etotal press +thermo 100 -run 1000 +run 1000 -#undump 1 -unfix 1 -unfix 2 +#undump 1 +unfix 1 +unfix 2 # add small particles as hi density lattice -region plane block INF INF INF INF -0.001 0.001 units box -lattice sq 120.0 -create_atoms 2 region plane +region plane block INF INF INF INF -0.001 0.001 units box +lattice sq 120.0 +create_atoms 2 region plane -set type 2 mass 0.01 -group small type 2 -velocity small create 1.0 593849 loop geom +set type 2 mass 0.01 +group small type 2 +velocity small create 1.0 593849 loop geom # delete overlaps # must set 1-2 cutoff to non-zero value -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 -pair_coeff 2 2 0.0 1.0 0.0 -pair_coeff 1 2 0.0 1.0 2.0 +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 +pair_coeff 2 2 0.0 1.0 0.0 +pair_coeff 1 2 0.0 1.0 2.0 -neigh_modify one 10000 +neigh_modify one 10000 -delete_atoms overlap 1.6 small big +delete_atoms overlap 1.6 small big # SRD run -reset_timestep 0 +reset_timestep 0 -neighbor 0.3 multi -neigh_modify delay 0 every 1 check yes +neighbor 0.3 multi +neigh_modify delay 0 every 1 check yes -comm_modify mode multi group big vel yes -neigh_modify include big +comm_modify mode multi group big vel yes +neigh_modify include big # no pairwise interactions with small particles @@ -88,30 +90,31 @@ pair_coeff 2 2 1.0 1.0 1 1 1 1 1 1 0.0 # use fix SRD to push small particles out from inside big ones # if comment out, big particles won't see SRD particles -timestep 0.0005 +timestep 0.0005 -fix 1 big nve/asphere -fix 2 small srd 20 big 1.0 0.25 49894 shift yes 54979 & +fix 1 big nve/asphere +fix 2 small srd 20 big 1.0 0.25 49894 shift yes 54979 & collision noslip search 0.2 inside ignore exact no bounce 50 -fix 3 small viscosity 20 x y 50 -fix 4 all enforce2d +fix 3 small viscosity 20 x y 50 +fix 4 all enforce2d # diagnostics -compute tbig big temp/asphere -variable pebig equal pe*atoms/count(big) -variable ebig equal etotal*atoms/count(big) -thermo_style custom step temp c_rot f_2[9] etotal v_pebig v_ebig press & - f_2[1] f_2[2] f_2[3] f_2[4] f_2[5] & - f_2[6] f_2[7] f_2[8] f_2[9] f_2[10] f_2[11] f_2[12] +compute tbig big temp/asphere +variable pebig equal pe*atoms/count(big) +variable ebig equal etotal*atoms/count(big) +thermo_style custom step temp c_rot f_2[9] etotal v_pebig v_ebig press & + f_2[1] f_2[2] f_2[3] f_2[4] f_2[5] & + f_2[6] f_2[7] f_2[8] f_2[9] f_2[10] f_2[11] f_2[12] -thermo_modify temp tbig -thermo 1000 +thermo_modify temp tbig +thermo 1000 -#dump 1 all custom 500 dump.ellipsoid.mp id type x y z & -# quatw quati quatj quatk +#dump 1 all custom 500 dump.ellipsoid id type x y z c_0[*] +#dump_modify 1 colname c_0[1] quatw colname c_0[2] quati colname c_0[3] quatj colname c_0[4] quatk & +# colname c_0[5] shapex colname c_0[6] shapey colname c_0[7] shapez -#dump 1 all image 500 image.*.jpg type type zoom 1.6 -#dump_modify 1 pad 6 adiam 1 1 adiam 2 0.2 +#dump 1 all image 500 image.*.jpg type type zoom 1.6 +#dump_modify 1 pad 6 adiam 1 1 adiam 2 0.2 -run 50000 +run 50000 diff --git a/examples/ellipse/in.ellipse.gayberne b/examples/ellipse/in.ellipse.gayberne index fe783ac6de..0e6b21797a 100644 --- a/examples/ellipse/in.ellipse.gayberne +++ b/examples/ellipse/in.ellipse.gayberne @@ -1,23 +1,23 @@ # GayBerne ellipsoids in LJ background fluid -units lj +units lj atom_style ellipsoid dimension 2 -lattice sq 0.02 -region box block 0 20 0 20 -0.5 0.5 +lattice sq 0.02 +region box block 0 20 0 20 -0.5 0.5 create_box 2 box create_atoms 1 box -set group all type/fraction 2 0.1 95392 -set type 1 mass 1.0 -set type 2 mass 1.5 -set type 1 shape 1 1 1 -set type 2 shape 3 1 1 -set group all quat/random 18238 +set group all type/fraction 2 0.1 95392 +set type 1 mass 1.0 +set type 2 mass 1.5 +set type 1 shape 1 1 1 +set type 2 shape 3 1 1 +set group all quat/random 18238 -compute rot all temp/asphere -group spheroid type 1 +compute rot all temp/asphere +group spheroid type 1 variable dof equal count(spheroid)+2 compute_modify rot extra/dof ${dof} @@ -31,36 +31,37 @@ pair_coeff 2 2 1.0 1.0 1 1 0.2 0 0 0 neighbor 0.8 bin thermo_style custom step c_rot epair etotal press vol -thermo 100 +thermo 100 timestep 0.002 -compute q all property/atom quatw quati quatj quatk +compute 0 all property/atom quatw quati quatj quatk shapex shapey shapez -#dump 1 all custom 100 dump.ellipse.gayberne & -# id type x y z c_q[1] c_q[2] c_q[3] c_q[4] +dump 1 all custom 100 dump.ellipse.gayberne id type x y z c_0[*] +dump_modify 1 colname c_0[1] quatw colname c_0[2] quati colname c_0[3] quatj colname c_0[4] quatk & + colname c_0[5] shapex colname c_0[6] shapey colname c_0[7] shapez -#dump 2 all image 100 image.*.jpg type type & -# zoom 1.6 center d 0.5 0.5 0.5 +#dump 2 all image 100 image.*.jpg type type & +# zoom 1.6 center d 0.5 0.5 0.5 #dump_modify 2 pad 4 adiam 1 1.0 adiam 2 2.0 -#dump 3 all movie 100 movie.mpg type type & -# zoom 1.6 center d 0.5 0.5 0.5 +#dump 3 all movie 100 movie.mpg type type & +# zoom 1.6 center d 0.5 0.5 0.5 #dump_modify 3 pad 4 adiam 1 1.0 adiam 2 2.0 -fix 1 all npt/asphere temp 2.0 2.0 0.1 iso 0.0 1.0 1.0 & - mtk no pchain 0 tchain 1 -fix 2 all enforce2d +fix 1 all npt/asphere temp 2.0 2.0 0.1 iso 0.0 1.0 1.0 & + mtk no pchain 0 tchain 1 +fix 2 all enforce2d compute_modify 1_temp extra/dof ${dof} # equilibrate to shrink box around dilute system -run 2000 +run 2000 # run dynamics on dense system -unfix 1 -fix 1 all nve/asphere +unfix 1 +fix 1 all nve/asphere -run 2000 +run 2000 diff --git a/examples/ellipse/in.ellipse.resquared b/examples/ellipse/in.ellipse.resquared index 82398987f8..d5bc8897cb 100644 --- a/examples/ellipse/in.ellipse.resquared +++ b/examples/ellipse/in.ellipse.resquared @@ -1,23 +1,23 @@ # RESquared ellipsoids in LJ background fluid -units lj +units lj atom_style ellipsoid dimension 2 -lattice sq 0.02 -region box block 0 20 0 20 -0.5 0.5 +lattice sq 0.02 +region box block 0 20 0 20 -0.5 0.5 create_box 2 box create_atoms 1 box -set group all type/fraction 2 0.1 95392 -set type 1 mass 1.0 -set type 2 mass 1.5 -set type 1 shape 1 1 1 -set type 2 shape 3 1 1 -set group all quat/random 18238 +set group all type/fraction 2 0.1 95392 +set type 1 mass 1.0 +set type 2 mass 1.5 +set type 1 shape 1 1 1 +set type 2 shape 3 1 1 +set group all quat/random 18238 -compute rot all temp/asphere -group spheroid type 1 +compute rot all temp/asphere +group spheroid type 1 variable dof equal count(spheroid)+2 compute_modify rot extra/dof ${dof} @@ -31,36 +31,40 @@ pair_coeff 2 2 1.0 1 1 1 0.2 0 0 0 neighbor 0.8 bin thermo_style custom step c_rot epair etotal press vol -thermo 100 +thermo 100 timestep 0.002 -compute q all property/atom quatw quati quatj quatk +compute 0 all property/atom quatw quati quatj quatk shapex shapey shapez -#dump 1 all custom 100 dump.ellipse.resquared & -# id type x y z c_q[1] c_q[2] c_q[3] c_q[4] +dump 1 all custom 100 dump.ellipse.resquared id type x y z c_0[*] +dump_modify 1 colname c_0[1] quatw colname c_0[2] quati colname c_0[3] quatj colname c_0[4] quatk & + colname c_0[5] shapex colname c_0[6] shapey colname c_0[7] shapez -#dump 2 all image 100 image.*.jpg type type & -# zoom 1.6 center d 0.5 0.5 0.5 +#dump 1 all custom 100 dump.ellipse.resquared & +# id type x y z c_q[1] c_q[2] c_q[3] c_q[4] + +#dump 2 all image 100 image.*.jpg type type & +# zoom 1.6 center d 0.5 0.5 0.5 #dump_modify 2 pad 4 adiam 1 1.0 adiam 2 2.0 -#dump 3 all movie 100 movie.mpg type type & -# zoom 1.6 center d 0.5 0.5 0.5 +#dump 3 all movie 100 movie.mpg type type & +# zoom 1.6 center d 0.5 0.5 0.5 #dump_modify 3 pad 4 adiam 1 1.0 adiam 2 2.0 -fix 1 all npt/asphere temp 2.0 2.0 0.1 iso 0.0 1.0 1.0 & - mtk no pchain 0 tchain 1 -fix 2 all enforce2d +fix 1 all npt/asphere temp 2.0 2.0 0.1 iso 0.0 1.0 1.0 & + mtk no pchain 0 tchain 1 +fix 2 all enforce2d compute_modify 1_temp extra/dof ${dof} # equilibrate to shrink box around dilute system -run 2000 +run 2000 # run dynamics on dense system -unfix 1 -fix 1 all nve/asphere +unfix 1 +fix 1 all nve/asphere -run 2000 +run 2000 diff --git a/src/DIELECTRIC/fix_polarize_bem_gmres.cpp b/src/DIELECTRIC/fix_polarize_bem_gmres.cpp index 3945b76641..40f7d0c853 100644 --- a/src/DIELECTRIC/fix_polarize_bem_gmres.cpp +++ b/src/DIELECTRIC/fix_polarize_bem_gmres.cpp @@ -350,7 +350,6 @@ void FixPolarizeBEMGMRES::compute_induced_charges() double *ed = atom->ed; double *em = atom->em; double *epsilon = atom->epsilon; - int *mask = atom->mask; int nlocal = atom->nlocal; int eflag = 1; int vflag = 0; diff --git a/src/DIELECTRIC/fix_polarize_functional.cpp b/src/DIELECTRIC/fix_polarize_functional.cpp index ab039f9c48..dd0c0eb648 100644 --- a/src/DIELECTRIC/fix_polarize_functional.cpp +++ b/src/DIELECTRIC/fix_polarize_functional.cpp @@ -55,9 +55,9 @@ using namespace LAMMPS_NS; using namespace FixConst; -using namespace MathExtra; -using namespace MathConst; -using namespace MathSpecial; +using MathConst::MY_PI; +using MathConst::MY_PIS; +using MathSpecial::square; //#define _POLARIZE_DEBUG @@ -378,10 +378,7 @@ void FixPolarizeFunctional::update_induced_charges() // assign charges to the particles in the group double *q_scaled = atom->q_scaled; - double *q = atom->q; - double *epsilon = atom->epsilon; int nlocal = atom->nlocal; - double tmp = 0; for (int i = 0; i < nlocal; i++) { if (induced_charge_idx[i] < 0) continue; diff --git a/src/EFF/pair_eff_cut.cpp b/src/EFF/pair_eff_cut.cpp index 1cfe5cd1dd..5f32de9912 100644 --- a/src/EFF/pair_eff_cut.cpp +++ b/src/EFF/pair_eff_cut.cpp @@ -921,13 +921,13 @@ void PairEffCut::coeff(int narg, char **arg) } else { int ecp; ecp = utils::inumeric(FLERR,arg[0],false,lmp); - if (strcmp(arg[1],"s") ==0) { + if (strcmp(arg[1],"s") == 0) { PAULI_CORE_A[ecp_type[ecp]] = utils::numeric(FLERR,arg[2],false,lmp); PAULI_CORE_B[ecp_type[ecp]] = utils::numeric(FLERR,arg[3],false,lmp); PAULI_CORE_C[ecp_type[ecp]] = utils::numeric(FLERR,arg[4],false,lmp); PAULI_CORE_D[ecp_type[ecp]] = 0.0; PAULI_CORE_E[ecp_type[ecp]] = 0.0; - } else if (strcmp(arg[1],"p") ==0) { + } else if (strcmp(arg[1],"p") == 0) { PAULI_CORE_A[ecp_type[ecp]] = utils::numeric(FLERR,arg[2],false,lmp); PAULI_CORE_B[ecp_type[ecp]] = utils::numeric(FLERR,arg[3],false,lmp); PAULI_CORE_C[ecp_type[ecp]] = utils::numeric(FLERR,arg[4],false,lmp); diff --git a/src/EXTRA-DUMP/dump_xtc.cpp b/src/EXTRA-DUMP/dump_xtc.cpp index ba3f740cf7..798bdcb391 100644 --- a/src/EXTRA-DUMP/dump_xtc.cpp +++ b/src/EXTRA-DUMP/dump_xtc.cpp @@ -740,7 +740,7 @@ static void receiveints(int buf[], const int num_of_ints, int num_of_bits, } for (i = num_of_ints-1; i > 0; i--) { num = 0; - for (j = num_of_bytes-1; j >=0; j--) { + for (j = num_of_bytes-1; j >= 0; j--) { num = (num << 8) | bytes[j]; p = num / sizes[i]; bytes[j] = p; diff --git a/src/EXTRA-FIX/fix_wall_reflect_stochastic.cpp b/src/EXTRA-FIX/fix_wall_reflect_stochastic.cpp index c0b44530e8..c435cc14ae 100644 --- a/src/EXTRA-FIX/fix_wall_reflect_stochastic.cpp +++ b/src/EXTRA-FIX/fix_wall_reflect_stochastic.cpp @@ -109,7 +109,7 @@ FixWallReflectStochastic(LAMMPS *lmp, int narg, char **arg) : for (int dir = 0; dir < 3; dir++) { wallvel[nwall][dir]= utils::numeric(FLERR,arg[iarg+dir+3],false,lmp); int dim = wallwhich[nwall] / 2; - if ((wallvel[nwall][dir] !=0) & (dir == dim)) + if ((wallvel[nwall][dir] != 0) & (dir == dim)) error->all(FLERR,"The wall velocity must be tangential"); // DIFFUSIVE = no accommodation coeffs diff --git a/src/EXTRA-PAIR/pair_lj_relres.cpp b/src/EXTRA-PAIR/pair_lj_relres.cpp index 85d0a04bf9..1826f3f1db 100644 --- a/src/EXTRA-PAIR/pair_lj_relres.cpp +++ b/src/EXTRA-PAIR/pair_lj_relres.cpp @@ -453,7 +453,7 @@ double PairLJRelRes::init_one(int i, int j) offset[i][j] = 0.0; } - if (epsilonf[i][j] != 0 ) { // fg (cut=cutf coefficients) + if (epsilonf[i][j] != 0) { // fg (cut=cutf coefficients) ljf1[i][j] = 48.0 * epsilonf[i][j] * pow(sigmaf[i][j],12.0); ljf2[i][j] = 24.0 * epsilonf[i][j] * pow(sigmaf[i][j],6.0); ljf3[i][j] = 4.0 * epsilonf[i][j] * pow(sigmaf[i][j],12.0); diff --git a/src/GRANULAR/gran_sub_mod_heat.cpp b/src/GRANULAR/gran_sub_mod_heat.cpp index dc6d50f7ec..5378a72fd4 100644 --- a/src/GRANULAR/gran_sub_mod_heat.cpp +++ b/src/GRANULAR/gran_sub_mod_heat.cpp @@ -49,6 +49,7 @@ GranSubModHeatRadius::GranSubModHeatRadius(GranularModel *gm, LAMMPS *lmp) : Gra { num_coeffs = 1; contact_radius_flag = 1; + conductivity = 0.0; } /* ---------------------------------------------------------------------- */ @@ -76,6 +77,7 @@ GranSubModHeatArea::GranSubModHeatArea(GranularModel *gm, LAMMPS *lmp) : GranSub { num_coeffs = 1; contact_radius_flag = 1; + heat_transfer_coeff = 0.0; } /* ---------------------------------------------------------------------- */ diff --git a/src/INTEL/fix_intel.cpp b/src/INTEL/fix_intel.cpp index 4c46608677..0a3d27a978 100644 --- a/src/INTEL/fix_intel.cpp +++ b/src/INTEL/fix_intel.cpp @@ -430,7 +430,7 @@ void FixIntel::pair_init_check(const bool cdmessage) double *time1 = off_watch_pair(); double *time2 = off_watch_neighbor(); int *overflow = get_off_overflow_flag(); - if (_offload_balance !=0.0) { + if (_offload_balance != 0.0) { #pragma offload_transfer target(mic:_cop) \ nocopy(time1,time2:length(1) alloc_if(1) free_if(0)) \ in(overflow:length(5) alloc_if(1) free_if(0)) diff --git a/src/INTERLAYER/pair_ilp_tmd.cpp b/src/INTERLAYER/pair_ilp_tmd.cpp index fd3a2f8c6f..8b08de39c0 100644 --- a/src/INTERLAYER/pair_ilp_tmd.cpp +++ b/src/INTERLAYER/pair_ilp_tmd.cpp @@ -481,11 +481,11 @@ void PairILPTMD::calc_normal() jH2 = atom->map(tag[i] - 2); iH1 = map[type[jH1]]; iH2 = map[type[jH2]]; - if (strcmp(elements[iH1], "Ow") == 0 ) { + if (strcmp(elements[iH1], "Ow") == 0) { vect[0][0] = x[jH1][0] - xtp; vect[0][1] = x[jH1][1] - ytp; vect[0][2] = x[jH1][2] - ztp; - } else if (strcmp(elements[iH2], "Ow") == 0 ) { + } else if (strcmp(elements[iH2], "Ow") == 0) { vect[0][0] = x[jH2][0] - xtp; vect[0][1] = x[jH2][1] - ytp; vect[0][2] = x[jH2][2] - ztp; diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 8ac6fe1f75..e0fc90ea46 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -198,8 +198,7 @@ PairKIM::~PairKIM() void PairKIM::set_contributing() { int const nall = atom->nlocal + atom->nghost; - for (int i = 0; i < nall; ++i) - kim_particleContributing[i] = ( (i < atom->nlocal) ? 1 : 0 ); + for (int i = 0; i < nall; ++i) kim_particleContributing[i] = (i < atom->nlocal) ? 1 : 0; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/mliap_so3_kokkos.cpp b/src/KOKKOS/mliap_so3_kokkos.cpp index 128e0f0a0c..bfdf4af0aa 100644 --- a/src/KOKKOS/mliap_so3_kokkos.cpp +++ b/src/KOKKOS/mliap_so3_kokkos.cpp @@ -856,7 +856,7 @@ void MLIAP_SO3Kokkos::spectrum_dxdr(int nlocal, DAT::tdual_int_1d nu memoryKK->create_kokkos(m_clisttot_i, nlocal, m_nmax, m_numYlms, "MLIAP_SO3Kokkos:m_clisttot_i"); int num_of_temp = std::min(nlocal, m_chunk_size); int delta=num_of_temp-m_ulist_r.extent(0); - if (delta > 0 ){ + if (delta > 0){ memoryKK->destroy_kokkos(m_ulist_r); memoryKK->create_kokkos(m_ulist_r, num_of_temp, m_idxu_count, "MLIAP_SO3Kokkos:m_ulist_r"); memoryKK->destroy_kokkos(m_ulist_i); diff --git a/src/KOKKOS/neigh_bond_kokkos.cpp b/src/KOKKOS/neigh_bond_kokkos.cpp index 9067284426..4cfe440b1f 100644 --- a/src/KOKKOS/neigh_bond_kokkos.cpp +++ b/src/KOKKOS/neigh_bond_kokkos.cpp @@ -266,7 +266,7 @@ void NeighBondKokkos::bond_all() int all; MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world); - if (all && me ==0) + if (all && me == 0) error->warning(FLERR,"Bond atoms missing at step {}", update->ntimestep); k_bondlist.modify(); @@ -345,7 +345,7 @@ void NeighBondKokkos::bond_partial() int all; MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world); - if (all && me ==0) + if (all && me == 0) error->warning(FLERR,"Bond atoms missing at step {}", update->ntimestep); k_bondlist.modify(); diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index ac1ac0ea62..a6a6ed37fd 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -593,9 +593,9 @@ void PairComb3::read_file(char *file) if (params[nparams].lambda < 0.0 || params[nparams].powern < 0.0 || params[nparams].beta < 0.0 || params[nparams].alpha1 < 0.0 || - params[nparams].bigB1< 0.0 || params[nparams].bigA< 0.0 || - params[nparams].bigB2< 0.0 || params[nparams].alpha2 <0.0 || - params[nparams].bigB3< 0.0 || params[nparams].alpha3 <0.0 || + params[nparams].bigB1 < 0.0 || params[nparams].bigA < 0.0 || + params[nparams].bigB2 < 0.0 || params[nparams].alpha2 < 0.0 || + params[nparams].bigB3 < 0.0 || params[nparams].alpha3 < 0.0 || params[nparams].bigr < 0.0 || params[nparams].bigd < 0.0 || params[nparams].bigd > params[nparams].bigr || params[nparams].powerm - params[nparams].powermint != 0.0 || diff --git a/src/MANYBODY/pair_gw.cpp b/src/MANYBODY/pair_gw.cpp index be2a1e41f3..1fd98b80f0 100644 --- a/src/MANYBODY/pair_gw.cpp +++ b/src/MANYBODY/pair_gw.cpp @@ -73,7 +73,8 @@ PairGW::~PairGW() void PairGW::compute(int eflag, int vflag) { int i,j,k,ii,jj,kk,inum,jnum; - int itag,jtag,itype,jtype,ktype,iparam_ij,iparam_ijk; + int itype,jtype,ktype,iparam_ij,iparam_ijk; + tagint itag,jtag; double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair; double rsq,rsq1,rsq2; double delr1[3],delr2[3],fi[3],fj[3],fk[3]; diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp index 65191ae85e..ed085c4b98 100644 --- a/src/MANYBODY/pair_lcbop.cpp +++ b/src/MANYBODY/pair_lcbop.cpp @@ -115,7 +115,7 @@ void PairLCBOP::allocate() ------------------------------------------------------------------------- */ void PairLCBOP::settings(int narg, char **/*arg*/) { - if (narg != 0 ) error->all(FLERR,"Illegal pair_style command"); + if (narg != 0) error->all(FLERR,"Illegal pair_style command"); } /* ---------------------------------------------------------------------- diff --git a/src/MGPT/pair_mgpt.cpp b/src/MGPT/pair_mgpt.cpp index 5c4b889f8a..c924cbea84 100644 --- a/src/MGPT/pair_mgpt.cpp +++ b/src/MGPT/pair_mgpt.cpp @@ -589,8 +589,7 @@ void PairMGPT::compute_x(const int *nnei,const int * const *nlist, double *e_s,double *e_p,double *e_t,double *e_q, int evflag,int newton_pair) { Hash bond_hash(100000); - int i,j,k,m,ix,jx,kx,mx,itag,jtag,p; - + int i,j,k,m,ix,jx,kx,mx,p; double e_single,e_pair,e_triplet,e_triplet_c,e_quad; double volvir2; diff --git a/src/MISC/fix_ipi.cpp b/src/MISC/fix_ipi.cpp index 9411fa763d..69e0f2a7f3 100644 --- a/src/MISC/fix_ipi.cpp +++ b/src/MISC/fix_ipi.cpp @@ -284,17 +284,17 @@ void FixIPI::initial_integrate(int /*vflag*/) // while i-PI just asks for status, signal we are ready and wait readbuffer(ipisock, header, MSGLEN, error); header[MSGLEN]=0; - if (strcmp(header,"STATUS ") == 0 ) + if (strcmp(header,"STATUS ") == 0) writebuffer(ipisock,"READY ",MSGLEN, error); else break; } - if (strcmp(header,"EXIT ") == 0 ) + if (strcmp(header,"EXIT ") == 0) error->one(FLERR, "Got EXIT message from i-PI. Now leaving!"); // when i-PI signals it has positions to evaluate new forces, // read positions and cell data - if (strcmp(header,"POSDATA ") == 0 ) { + if (strcmp(header,"POSDATA ") == 0) { readbuffer(ipisock, (char*) cellh, 9*8, error); readbuffer(ipisock, (char*) cellih, 9*8, error); readbuffer(ipisock, (char*) &nat, 4, error); @@ -454,15 +454,15 @@ void FixIPI::final_integrate() while (true) { readbuffer(ipisock, header, MSGLEN, error); header[MSGLEN]=0; - if (strcmp(header,"STATUS ") == 0 ) + if (strcmp(header,"STATUS ") == 0) writebuffer(ipisock,"HAVEDATA ",MSGLEN, error); else break; } - if (strcmp(header,"EXIT ") == 0 ) + if (strcmp(header,"EXIT ") == 0) error->one(FLERR, "Got EXIT message from i-PI. Now leaving!"); - if (strcmp(header,"GETFORCE ") == 0 ) { + if (strcmp(header,"GETFORCE ") == 0) { writebuffer(ipisock,"FORCEREADY ",MSGLEN, error); writebuffer(ipisock,(char*) &pot,8, error); writebuffer(ipisock,(char*) &nat,4, error); diff --git a/src/MISC/pair_agni.cpp b/src/MISC/pair_agni.cpp index 539c0ca00f..8597e5db93 100644 --- a/src/MISC/pair_agni.cpp +++ b/src/MISC/pair_agni.cpp @@ -347,7 +347,7 @@ void PairAGNI::read_file(char *filename) curparam = -1; } else error->warning(FLERR,"Ignoring unknown tag '{}' in AGNI potential file.",tag); } else { - if (params && wantdata >=0) { + if (params && wantdata >= 0) { if ((int)values.count() == params[wantdata].numeta + 2) { for (k = 0; k < params[wantdata].numeta; ++k) params[wantdata].xU[k][fp_counter] = values.next_double(); diff --git a/src/OPENMP/npair_full_bin_ghost_omp.cpp b/src/OPENMP/npair_full_bin_ghost_omp.cpp index 5723a418f5..0825d61b49 100644 --- a/src/OPENMP/npair_full_bin_ghost_omp.cpp +++ b/src/OPENMP/npair_full_bin_ghost_omp.cpp @@ -114,7 +114,7 @@ void NPairFullBinGhostOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_full_bin_omp.cpp b/src/OPENMP/npair_full_bin_omp.cpp index 94668002a9..65af519850 100644 --- a/src/OPENMP/npair_full_bin_omp.cpp +++ b/src/OPENMP/npair_full_bin_omp.cpp @@ -108,7 +108,7 @@ void NPairFullBinOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_full_nsq_ghost_omp.cpp b/src/OPENMP/npair_full_nsq_ghost_omp.cpp index 05f402a99d..c1270d9fdc 100644 --- a/src/OPENMP/npair_full_nsq_ghost_omp.cpp +++ b/src/OPENMP/npair_full_nsq_ghost_omp.cpp @@ -108,7 +108,7 @@ void NPairFullNsqGhostOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_full_nsq_omp.cpp b/src/OPENMP/npair_full_nsq_omp.cpp index 6349906771..695cb1bc48 100644 --- a/src/OPENMP/npair_full_nsq_omp.cpp +++ b/src/OPENMP/npair_full_nsq_omp.cpp @@ -108,7 +108,7 @@ void NPairFullNsqOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_bin_newtoff_ghost_omp.cpp b/src/OPENMP/npair_half_bin_newtoff_ghost_omp.cpp index 2255033204..e10d181a8c 100644 --- a/src/OPENMP/npair_half_bin_newtoff_ghost_omp.cpp +++ b/src/OPENMP/npair_half_bin_newtoff_ghost_omp.cpp @@ -122,7 +122,7 @@ void NPairHalfBinNewtoffGhostOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_bin_newtoff_omp.cpp b/src/OPENMP/npair_half_bin_newtoff_omp.cpp index 36997d9bcb..9d32cc7e2b 100644 --- a/src/OPENMP/npair_half_bin_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_bin_newtoff_omp.cpp @@ -113,7 +113,7 @@ void NPairHalfBinNewtoffOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_bin_newton_omp.cpp b/src/OPENMP/npair_half_bin_newton_omp.cpp index 1663a2f14c..d2da12962c 100644 --- a/src/OPENMP/npair_half_bin_newton_omp.cpp +++ b/src/OPENMP/npair_half_bin_newton_omp.cpp @@ -114,7 +114,7 @@ void NPairHalfBinNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); @@ -145,7 +145,7 @@ void NPairHalfBinNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_bin_newton_tri_omp.cpp b/src/OPENMP/npair_half_bin_newton_tri_omp.cpp index e754456ef1..4d93d06d75 100644 --- a/src/OPENMP/npair_half_bin_newton_tri_omp.cpp +++ b/src/OPENMP/npair_half_bin_newton_tri_omp.cpp @@ -119,7 +119,7 @@ void NPairHalfBinNewtonTriOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_multi_old_newtoff_omp.cpp b/src/OPENMP/npair_half_multi_old_newtoff_omp.cpp index ac5e9dae04..4447b4414e 100644 --- a/src/OPENMP/npair_half_multi_old_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_multi_old_newtoff_omp.cpp @@ -120,7 +120,7 @@ void NPairHalfMultiOldNewtoffOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_multi_old_newton_omp.cpp b/src/OPENMP/npair_half_multi_old_newton_omp.cpp index baa9dd0724..29c551f17d 100644 --- a/src/OPENMP/npair_half_multi_old_newton_omp.cpp +++ b/src/OPENMP/npair_half_multi_old_newton_omp.cpp @@ -116,7 +116,7 @@ void NPairHalfMultiOldNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); @@ -153,7 +153,7 @@ void NPairHalfMultiOldNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_multi_old_newton_tri_omp.cpp b/src/OPENMP/npair_half_multi_old_newton_tri_omp.cpp index e4895ff1a9..1d906b1fa5 100644 --- a/src/OPENMP/npair_half_multi_old_newton_tri_omp.cpp +++ b/src/OPENMP/npair_half_multi_old_newton_tri_omp.cpp @@ -129,7 +129,7 @@ void NPairHalfMultiOldNewtonTriOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_nsq_newtoff_ghost_omp.cpp b/src/OPENMP/npair_half_nsq_newtoff_ghost_omp.cpp index 388e51e1af..54de8b9607 100644 --- a/src/OPENMP/npair_half_nsq_newtoff_ghost_omp.cpp +++ b/src/OPENMP/npair_half_nsq_newtoff_ghost_omp.cpp @@ -117,7 +117,7 @@ void NPairHalfNsqNewtoffGhostOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_nsq_newtoff_omp.cpp b/src/OPENMP/npair_half_nsq_newtoff_omp.cpp index 002ea37e6b..54a90d9f2b 100644 --- a/src/OPENMP/npair_half_nsq_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_nsq_newtoff_omp.cpp @@ -109,7 +109,7 @@ void NPairHalfNsqNewtoffOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_nsq_newton_omp.cpp b/src/OPENMP/npair_half_nsq_newton_omp.cpp index cb08cb7f7a..c010a3b024 100644 --- a/src/OPENMP/npair_half_nsq_newton_omp.cpp +++ b/src/OPENMP/npair_half_nsq_newton_omp.cpp @@ -49,8 +49,8 @@ void NPairHalfNsqNewtonOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,n,itype,jtype,itag,jtag,which,imol,iatom; - tagint tagprev; + int i,j,n,itype,jtype,which,imol,iatom; + tagint itag,jtag,tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; int *neighptr; @@ -127,7 +127,7 @@ void NPairHalfNsqNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_respa_bin_newtoff_omp.cpp b/src/OPENMP/npair_half_respa_bin_newtoff_omp.cpp index c6be04419d..e1d4ee59b1 100644 --- a/src/OPENMP/npair_half_respa_bin_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_respa_bin_newtoff_omp.cpp @@ -144,7 +144,7 @@ void NPairHalfRespaBinNewtoffOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_respa_bin_newton_omp.cpp b/src/OPENMP/npair_half_respa_bin_newton_omp.cpp index 51fc7a2ed8..ce8a103170 100644 --- a/src/OPENMP/npair_half_respa_bin_newton_omp.cpp +++ b/src/OPENMP/npair_half_respa_bin_newton_omp.cpp @@ -146,7 +146,7 @@ void NPairHalfRespaBinNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); @@ -190,7 +190,7 @@ void NPairHalfRespaBinNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_respa_bin_newton_tri_omp.cpp b/src/OPENMP/npair_half_respa_bin_newton_tri_omp.cpp index c998f71290..73f2102dba 100644 --- a/src/OPENMP/npair_half_respa_bin_newton_tri_omp.cpp +++ b/src/OPENMP/npair_half_respa_bin_newton_tri_omp.cpp @@ -151,7 +151,7 @@ void NPairHalfRespaBinNewtonTriOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_respa_nsq_newtoff_omp.cpp b/src/OPENMP/npair_half_respa_nsq_newtoff_omp.cpp index 1167a7601b..428ca778e8 100644 --- a/src/OPENMP/npair_half_respa_nsq_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_respa_nsq_newtoff_omp.cpp @@ -141,7 +141,7 @@ void NPairHalfRespaNsqNewtoffOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_respa_nsq_newton_omp.cpp b/src/OPENMP/npair_half_respa_nsq_newton_omp.cpp index 6604861f74..4bcba0fbef 100644 --- a/src/OPENMP/npair_half_respa_nsq_newton_omp.cpp +++ b/src/OPENMP/npair_half_respa_nsq_newton_omp.cpp @@ -55,8 +55,8 @@ void NPairHalfRespaNsqNewtonOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,n,itype,jtype,itag,jtag,n_inner,n_middle,imol,iatom; - tagint tagprev; + int i,j,n,itype,jtype,n_inner,n_middle,imol,iatom; + tagint itag,jtag,tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; int *neighptr,*neighptr_inner,*neighptr_middle; @@ -159,7 +159,7 @@ void NPairHalfRespaNsqNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_size_bin_newtoff_omp.cpp b/src/OPENMP/npair_half_size_bin_newtoff_omp.cpp index c205b67539..478e28a5f4 100644 --- a/src/OPENMP/npair_half_size_bin_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_size_bin_newtoff_omp.cpp @@ -125,7 +125,7 @@ void NPairHalfSizeBinNewtoffOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_size_bin_newton_omp.cpp b/src/OPENMP/npair_half_size_bin_newton_omp.cpp index 628057d41d..dba392781e 100644 --- a/src/OPENMP/npair_half_size_bin_newton_omp.cpp +++ b/src/OPENMP/npair_half_size_bin_newton_omp.cpp @@ -126,7 +126,7 @@ void NPairHalfSizeBinNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); @@ -161,7 +161,7 @@ void NPairHalfSizeBinNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_size_bin_newton_tri_omp.cpp b/src/OPENMP/npair_half_size_bin_newton_tri_omp.cpp index c320296442..160cf64194 100644 --- a/src/OPENMP/npair_half_size_bin_newton_tri_omp.cpp +++ b/src/OPENMP/npair_half_size_bin_newton_tri_omp.cpp @@ -132,7 +132,7 @@ void NPairHalfSizeBinNewtonTriOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_size_multi_newtoff_omp.cpp b/src/OPENMP/npair_half_size_multi_newtoff_omp.cpp index 73564a150c..ba0dfc16be 100644 --- a/src/OPENMP/npair_half_size_multi_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_newtoff_omp.cpp @@ -124,7 +124,7 @@ void NPairHalfSizeMultiNewtoffOmp::build(NeighList *list) for (k = 0; k < ns; k++) { js = binhead_multi[jcollection][jbin + s[k]]; - for (j = js; j >=0; j = bins[j]) { + for (j = js; j >= 0; j = bins[j]) { if (j <= i) continue; jtype = type[j]; @@ -145,7 +145,7 @@ void NPairHalfSizeMultiNewtoffOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_size_multi_newton_omp.cpp b/src/OPENMP/npair_half_size_multi_newton_omp.cpp index 0ed843ea0b..4bc17f911c 100644 --- a/src/OPENMP/npair_half_size_multi_newton_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_newton_omp.cpp @@ -155,7 +155,7 @@ void NPairHalfSizeMultiNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); @@ -198,7 +198,7 @@ void NPairHalfSizeMultiNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_size_multi_newton_tri_omp.cpp b/src/OPENMP/npair_half_size_multi_newton_tri_omp.cpp index 9a0ead482b..73e11a2745 100644 --- a/src/OPENMP/npair_half_size_multi_newton_tri_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_newton_tri_omp.cpp @@ -160,7 +160,7 @@ void NPairHalfSizeMultiNewtonTriOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_size_multi_old_newtoff_omp.cpp b/src/OPENMP/npair_half_size_multi_old_newtoff_omp.cpp index c368e71095..e4169482bc 100644 --- a/src/OPENMP/npair_half_size_multi_old_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_old_newtoff_omp.cpp @@ -132,7 +132,7 @@ void NPairHalfSizeMultiOldNewtoffOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_size_multi_old_newton_omp.cpp b/src/OPENMP/npair_half_size_multi_old_newton_omp.cpp index 187efe04d1..7d6a3de871 100644 --- a/src/OPENMP/npair_half_size_multi_old_newton_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_old_newton_omp.cpp @@ -127,7 +127,7 @@ void NPairHalfSizeMultiOldNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); @@ -170,7 +170,7 @@ void NPairHalfSizeMultiOldNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.cpp b/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.cpp index c74b191f66..caa993ed38 100644 --- a/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.cpp @@ -140,7 +140,7 @@ void NPairHalfSizeMultiOldNewtonTriOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_size_nsq_newtoff_omp.cpp b/src/OPENMP/npair_half_size_nsq_newtoff_omp.cpp index 020551bd8e..2982586a18 100644 --- a/src/OPENMP/npair_half_size_nsq_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_size_nsq_newtoff_omp.cpp @@ -122,7 +122,7 @@ void NPairHalfSizeNsqNewtoffOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/OPENMP/npair_half_size_nsq_newton_omp.cpp b/src/OPENMP/npair_half_size_nsq_newton_omp.cpp index 35dc42ec5b..0a80da9422 100644 --- a/src/OPENMP/npair_half_size_nsq_newton_omp.cpp +++ b/src/OPENMP/npair_half_size_nsq_newton_omp.cpp @@ -58,8 +58,8 @@ void NPairHalfSizeNsqNewtonOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,jh,n,itag,jtag,which,imol,iatom; - tagint tagprev; + int i,j,jh,n,which,imol,iatom; + tagint itag,jtag,tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; @@ -140,7 +140,7 @@ void NPairHalfSizeNsqNewtonOmp::build(NeighList *list) if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) + else if (imol >= 0) which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], tag[j]-tagprev); diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index 8e4f8557a2..c2ba34c4c2 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -365,7 +365,7 @@ void DynamicalMatrix::calculateMatrix() delete [] fdynmat[i]; delete [] fdynmat; - if (screen && me ==0 ) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); + if (screen && me == 0) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); } /* ---------------------------------------------------------------------- diff --git a/src/PHONON/third_order.cpp b/src/PHONON/third_order.cpp index 4a8948de77..c31aae0086 100644 --- a/src/PHONON/third_order.cpp +++ b/src/PHONON/third_order.cpp @@ -412,7 +412,7 @@ void ThirdOrder::calculateMatrix() delete [] dynmat; delete [] fdynmat; - if (screen && me ==0) + if (screen && me == 0) fprintf(screen,"Finished Calculating Third Order Tensor\n"); } diff --git a/src/REACTION/fix_bond_react.cpp b/src/REACTION/fix_bond_react.cpp index cf99efd099..d124b06dc2 100644 --- a/src/REACTION/fix_bond_react.cpp +++ b/src/REACTION/fix_bond_react.cpp @@ -412,7 +412,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"modify_create") == 0) { if (iarg++ > narg) error->all(FLERR,"Illegal fix bond/react command: " "'modify_create' has too few arguments"); - while (iarg < narg && strcmp(arg[iarg],"react") != 0 ) { + while (iarg < narg && strcmp(arg[iarg],"react") != 0) { if (strcmp(arg[iarg],"fit") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " "'modify_create' has too few arguments"); @@ -1394,7 +1394,7 @@ void FixBondReact::superimpose_algorithm() } for (int i = 0; i < onemol->natoms; i++) { - if (glove[i][0] !=0 && pioneer_count[i] < onemol_nxspecial[i][0] && edge[i][rxnID] == 0) { + if (glove[i][0] != 0 && pioneer_count[i] < onemol_nxspecial[i][0] && edge[i][rxnID] == 0) { pioneers[i] = 1; } } @@ -1837,7 +1837,7 @@ void FixBondReact::inner_crosscheck_loop() for (int i=1; i < num_choices; ++i) { tagint hold = tag_choices[i]; int j = i - 1; - while ((j >=0) && (tag_choices[j] > hold)) { + while ((j >= 0) && (tag_choices[j] > hold)) { tag_choices[j+1] = tag_choices[j]; --j; } diff --git a/src/REAXFF/fix_reaxff_bonds.cpp b/src/REAXFF/fix_reaxff_bonds.cpp index 393e22930f..8bd7ed0020 100644 --- a/src/REAXFF/fix_reaxff_bonds.cpp +++ b/src/REAXFF/fix_reaxff_bonds.cpp @@ -295,7 +295,7 @@ void FixReaxFFBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local, MPI_Isend(&buf[0],nbuf_local,MPI_DOUBLE,0,0,world,&irequest2); MPI_Wait(&irequest2,MPI_STATUS_IGNORE); } - if (me ==0) fputs("# \n",fp); + if (me == 0) fputs("# \n",fp); } diff --git a/src/SMTBQ/pair_smtbq.cpp b/src/SMTBQ/pair_smtbq.cpp index fdef0b6043..4f924a6fca 100644 --- a/src/SMTBQ/pair_smtbq.cpp +++ b/src/SMTBQ/pair_smtbq.cpp @@ -446,7 +446,7 @@ void PairSMTBQ::read_file(char *file) params[i].chi = values.next_double(); params[i].dj = values.next_double(); - if (strcmp(params[i].nom, "O") !=0) { + if (strcmp(params[i].nom, "O") != 0) { params[i].R = values.next_double(); if ((comm->me == 0) && VERBOSE) utils::logmesg(lmp, " {} {} {} {} {}\n",label,params[i].ne,params[i].chi, @@ -782,7 +782,7 @@ void PairSMTBQ::read_file(char *file) if (intparams[m].intsm == 0) continue; intparams[m].neig_cut = 1.2*intparams[m].r0; - if (strcmp(intparams[m].typepot,"second_moment") == 0 ) + if (strcmp(intparams[m].typepot,"second_moment") == 0) if ((comm->me == 0) && VERBOSE) utils::logmesg(lmp, " Rc 1er voisin, typepot {} -> {} Ang\n", intparams[m].typepot,intparams[m].neig_cut); @@ -1020,7 +1020,7 @@ void PairSMTBQ::compute(int eflag, int vflag) // ---------------------------------------------- if ( strcmp(intparams[m].typepot,"buck") == 0 || - strcmp(intparams[m].typepot,"buckPlusAttr") ==0) { + strcmp(intparams[m].typepot,"buckPlusAttr") == 0) { // ---------------------------------------------- evdwl = 0.0; fpair =0.0; @@ -1070,7 +1070,7 @@ void PairSMTBQ::compute(int eflag, int vflag) // ----------------------------------------------------------------- - if (strcmp(intparams[m].typepot,"second_moment") != 0 ) continue; + if (strcmp(intparams[m].typepot,"second_moment") != 0) continue; // ----------------------------------------------------------------- @@ -2575,7 +2575,7 @@ void PairSMTBQ::Charge() if (me == 0 && strcmp(Bavard,"false") != 0) { for (gp = 0; gp < nteam+1; gp++) { printf (" ++++ Groupe %d - Nox %d Ncat %d\n",gp,nQEqaall[gp],nQEqcall[gp]); - if (nQEqcall[gp] !=0 && nQEqaall[gp] !=0 ) + if (nQEqcall[gp] != 0 && nQEqaall[gp] !=0 ) printf (" neutralite des charges %f\n qtotc %f qtota %f\n", qtotll,qtotcll[gp]/nQEqcall[gp],qtotall[gp]/nQEqaall[gp]); printf (" ---------------------------- \n");} @@ -2641,7 +2641,7 @@ void PairSMTBQ::Charge() for (i = 0; i < nteam+1; i++) { - if (nQEqall[i] !=0) TransfAll[i] /= static_cast(nQEqall[i]); + if (nQEqall[i] != 0) TransfAll[i] /= static_cast(nQEqall[i]); enegchk[i] = enegmax[i] = 0.0; } @@ -2665,7 +2665,7 @@ void PairSMTBQ::Charge() for (gp = 0; gp < nteam+1; gp++) { - if (nQEqall[gp] !=0) { + if (nQEqall[gp] != 0) { enegchk[gp] = enegchkall[gp]/static_cast(nQEqall[gp]); enegmax[gp] = enegmaxall[gp]; } @@ -2729,7 +2729,7 @@ void PairSMTBQ::Charge() // Statistique (ecart type) // ------------------------ for (i=0; i(nQEqcall[i]) ; TransfAll[i+2*cluster] /= static_cast(nQEqaall[i]) ;} sigmaa[i] = sigmac[i] = 0.0; diff --git a/src/VTK/dump_vtk.cpp b/src/VTK/dump_vtk.cpp index 3667180bc9..a77f5b2e11 100644 --- a/src/VTK/dump_vtk.cpp +++ b/src/VTK/dump_vtk.cpp @@ -1933,7 +1933,7 @@ void DumpVTK::identify_vectors() // assume components are grouped together and in correct order if (name.count(it->first + 1) && name.count(it->first + 2)) { // more attributes? if (it->second.compare(0,it->second.length()-3,name[it->first + 1],0,it->second.length()-3) == 0 && // same attributes? - it->second.compare(0,it->second.length()-3,name[it->first + 2],0,it->second.length()-3) == 0 ) + it->second.compare(0,it->second.length()-3,name[it->first + 2],0,it->second.length()-3) == 0) { it->second.erase(it->second.length()-1); std::ostringstream oss; diff --git a/src/atom.cpp b/src/atom.cpp index 08e9639440..6b014fc9c8 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -966,10 +966,10 @@ void Atom::bonus_check() bigint local_bodies = 0, num_global; for (int i = 0; i < nlocal; ++i) { - if (ellipsoid && (ellipsoid[i] >=0)) ++local_ellipsoids; - if (line && (line[i] >=0)) ++local_lines; - if (tri && (tri[i] >=0)) ++local_tris; - if (body && (body[i] >=0)) ++local_bodies; + if (ellipsoid && (ellipsoid[i] >= 0)) ++local_ellipsoids; + if (line && (line[i] >= 0)) ++local_lines; + if (tri && (tri[i] >= 0)) ++local_tris; + if (body && (body[i] >= 0)) ++local_bodies; } MPI_Allreduce(&local_ellipsoids,&num_global,1,MPI_LMP_BIGINT,MPI_SUM,world); diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index fc7089fa01..c3c101b995 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -376,7 +376,7 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) : index[i] = atom->avec->property_atom(arg[iarg]); if (index[i] < 0) error->all(FLERR,"Invalid keyword {} for atom style {} in compute property/atom command ", - atom->get_style(), arg[iarg]); + arg[iarg], atom->get_style()); pack_choice[i] = &ComputePropertyAtom::pack_atom_style; } } @@ -1268,7 +1268,7 @@ void ComputePropertyAtom::pack_shapex(int n) for (int i = 0; i < nlocal; i++) { if ((mask[i] & groupbit) && ellipsoid[i] >= 0) buf[n] = 2.0*bonus[ellipsoid[i]].shape[0]; - else buf[n] = 0.0; + else buf[n] = 1.0; n += nvalues; } } @@ -1285,7 +1285,7 @@ void ComputePropertyAtom::pack_shapey(int n) for (int i = 0; i < nlocal; i++) { if ((mask[i] & groupbit) && ellipsoid[i] >= 0) buf[n] = 2.0*bonus[ellipsoid[i]].shape[1]; - else buf[n] = 0.0; + else buf[n] = 1.0; n += nvalues; } } @@ -1302,7 +1302,7 @@ void ComputePropertyAtom::pack_shapez(int n) for (int i = 0; i < nlocal; i++) { if ((mask[i] & groupbit) && ellipsoid[i] >= 0) buf[n] = 2.0*bonus[ellipsoid[i]].shape[2]; - else buf[n] = 0.0; + else buf[n] = 1.0; n += nvalues; } } @@ -1320,7 +1320,7 @@ void ComputePropertyAtom::pack_quatw(int n) for (int i = 0; i < nlocal; i++) { if ((mask[i] & groupbit) && ellipsoid[i] >= 0) buf[n] = bonus[ellipsoid[i]].quat[0]; - else buf[n] = 0.0; + else buf[n] = 1.0; n += nvalues; } diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index 157e43610a..0a2975bb2e 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -590,7 +590,7 @@ void FixAveHisto::end_of_step() } else if (kind == PERATOM) { if (j == 0) bin_atoms(val.val.f->vector_atom,1); else if (val.val.f->array_atom) - bin_atoms(val.val.f->array_atom[j-1],val.val.f->size_peratom_cols); + bin_atoms(&val.val.f->array_atom[0][j-1],val.val.f->size_peratom_cols); } else if (kind == LOCAL) { if (j == 0) bin_vector(val.val.f->size_local_rows,val.val.f->vector_local,1); diff --git a/src/fix_ave_histo_weight.cpp b/src/fix_ave_histo_weight.cpp index 17dd00440e..181aa2a79d 100644 --- a/src/fix_ave_histo_weight.cpp +++ b/src/fix_ave_histo_weight.cpp @@ -212,7 +212,7 @@ void FixAveHistoWeight::end_of_step() weights = val.val.f->vector_atom; stride = 1; } else if (val.val.f->array_atom) { - weights = val.val.f->array_atom[j-1]; + weights = &val.val.f->array_atom[0][j-1]; stride = val.val.f->size_peratom_cols; } } else if (kind == LOCAL) { @@ -339,7 +339,7 @@ void FixAveHistoWeight::end_of_step() if (j == 0) bin_atoms_weights(val.val.f->vector_atom,1,weights,stride); else if (val.val.f->array_atom) - bin_atoms_weights(val.val.f->array_atom[j-1],val.val.f->size_peratom_cols, + bin_atoms_weights(&val.val.f->array_atom[0][j-1],val.val.f->size_peratom_cols, weights,stride); diff --git a/src/library.cpp b/src/library.cpp index 872b59693f..8cec7c4505 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -2328,7 +2328,7 @@ void *lammps_extract_variable(void *handle, const char *name, const char *group) } else if (lmp->input->variable->vectorstyle(ivar)) { double *values = nullptr; int nvector = lmp->input->variable->compute_vector(ivar, &values); - if ( group != nullptr && strcmp(group,"LMP_SIZE_VECTOR") == 0 ) { + if (group != nullptr && strcmp(group,"LMP_SIZE_VECTOR") == 0) { int* nvecptr = (int *) malloc(sizeof(int)); *nvecptr = nvector; return (void *) nvecptr; @@ -2372,7 +2372,7 @@ int lammps_extract_variable_datatype(void *handle, const char *name) BEGIN_CAPTURE { int ivar = lmp->input->variable->find(name); - if ( ivar < 0 ) return -1; + if (ivar < 0) return -1; if (lmp->input->variable->equalstyle(ivar)) return LMP_VAR_EQUAL; @@ -5199,7 +5199,7 @@ int lammps_find_pair_neighlist(void *handle, const char *style, int exact, int n // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList *list = lmp->neighbor->lists[i]; - if ( (list->requestor_type == NeighList::PAIR) + if ((list->requestor_type == NeighList::PAIR) && (pair == list->requestor) && (list->id == reqid) ) return i; } @@ -5229,7 +5229,7 @@ int lammps_find_fix_neighlist(void *handle, const char *id, int reqid) { // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList *list = lmp->neighbor->lists[i]; - if ( (list->requestor_type == NeighList::FIX) + if ((list->requestor_type == NeighList::FIX) && (fix == list->requestor) && (list->id == reqid) ) return i; } @@ -5258,7 +5258,7 @@ int lammps_find_compute_neighlist(void *handle, const char *id, int reqid) { // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList * list = lmp->neighbor->lists[i]; - if ( (list->requestor_type == NeighList::COMPUTE) + if ((list->requestor_type == NeighList::COMPUTE) && (compute == list->requestor) && (list->id == reqid) ) return i; } @@ -5709,7 +5709,7 @@ int lammps_style_name(void *handle, const char *category, int idx, Info info(lmp); auto styles = info.get_available_styles(category); - if ((idx >=0) && (idx < (int) styles.size())) { + if ((idx >= 0) && (idx < (int) styles.size())) { strncpy(buffer, styles[idx].c_str(), buf_size); return 1; } @@ -5844,23 +5844,23 @@ int lammps_id_name(void *handle, const char *category, int idx, char *buffer, in return 1; } } else if (strcmp(category,"group") == 0) { - if ((idx >=0) && (idx < lmp->group->ngroup)) { + if ((idx >= 0) && (idx < lmp->group->ngroup)) { strncpy(buffer, lmp->group->names[idx], buf_size); return 1; } } else if (strcmp(category,"molecule") == 0) { - if ((idx >=0) && (idx < lmp->atom->nmolecule)) { + if ((idx >= 0) && (idx < lmp->atom->nmolecule)) { strncpy(buffer, lmp->atom->molecules[idx]->id, buf_size); return 1; } } else if (strcmp(category,"region") == 0) { auto regions = lmp->domain->get_region_list(); - if ((idx >=0) && (idx < (int) regions.size())) { + if ((idx >= 0) && (idx < (int) regions.size())) { strncpy(buffer, regions[idx]->id, buf_size); return 1; } } else if (strcmp(category,"variable") == 0) { - if ((idx >=0) && (idx < lmp->input->variable->nvar)) { + if ((idx >= 0) && (idx < lmp->input->variable->nvar)) { strncpy(buffer, lmp->input->variable->names[idx], buf_size); return 1; } diff --git a/src/npair_half_respa_nsq_newton.cpp b/src/npair_half_respa_nsq_newton.cpp index 77d6af141f..d231cddb87 100644 --- a/src/npair_half_respa_nsq_newton.cpp +++ b/src/npair_half_respa_nsq_newton.cpp @@ -38,9 +38,9 @@ NPairHalfRespaNsqNewton::NPairHalfRespaNsqNewton(LAMMPS *lmp) : NPair(lmp) {} void NPairHalfRespaNsqNewton::build(NeighList *list) { - int i,j,n,itype,jtype,itag,jtag,n_inner,n_middle,bitmask; + int i,j,n,itype,jtype,n_inner,n_middle,bitmask; int imol,iatom,moltemplate; - tagint tagprev; + tagint itag,jtag,tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; int *neighptr,*neighptr_inner,*neighptr_middle; diff --git a/src/npair_half_size_nsq_newton.cpp b/src/npair_half_size_nsq_newton.cpp index 8b596e6968..93d65c7a45 100644 --- a/src/npair_half_size_nsq_newton.cpp +++ b/src/npair_half_size_nsq_newton.cpp @@ -39,8 +39,8 @@ NPairHalfSizeNsqNewton::NPairHalfSizeNsqNewton(LAMMPS *lmp) : NPair(lmp) {} void NPairHalfSizeNsqNewton::build(NeighList *list) { - int i,j,jh,n,itag,jtag,bitmask,which,imol,iatom,moltemplate; - tagint tagprev; + int i,j,jh,n,bitmask,which,imol,iatom,moltemplate; + tagint itag,jtag,tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; diff --git a/src/read_restart.cpp b/src/read_restart.cpp index aa9f5fe8ee..0de36ebe1e 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -768,7 +768,7 @@ void ReadRestart::header() for (int i = 0; i < nargcopy; i++) argcopy[i] = read_string(); atom->create_avec(style,nargcopy,argcopy,1); - if (comm->me ==0) + if (comm->me == 0) utils::logmesg(lmp," restoring atom style {} from restart\n",atom->atom_style); for (int i = 0; i < nargcopy; i++) delete[] argcopy[i]; delete[] argcopy; @@ -921,14 +921,14 @@ void ReadRestart::force_fields() style = read_string(); force->create_pair(style,1); delete[] style; - if (comm->me ==0) + if (comm->me == 0) utils::logmesg(lmp," restoring pair style {} from restart\n", force->pair_style); force->pair->read_restart(fp); } else if (flag == NO_PAIR) { style = read_string(); - if (comm->me ==0) + if (comm->me == 0) utils::logmesg(lmp," pair style {} stores no restart info\n", style); force->create_pair("none",0); force->pair_restart = style; @@ -937,7 +937,7 @@ void ReadRestart::force_fields() style = read_string(); force->create_bond(style,1); delete[] style; - if (comm->me ==0) + if (comm->me == 0) utils::logmesg(lmp," restoring bond style {} from restart\n", force->bond_style); force->bond->read_restart(fp); @@ -946,7 +946,7 @@ void ReadRestart::force_fields() style = read_string(); force->create_angle(style,1); delete[] style; - if (comm->me ==0) + if (comm->me == 0) utils::logmesg(lmp," restoring angle style {} from restart\n", force->angle_style); force->angle->read_restart(fp); @@ -955,7 +955,7 @@ void ReadRestart::force_fields() style = read_string(); force->create_dihedral(style,1); delete[] style; - if (comm->me ==0) + if (comm->me == 0) utils::logmesg(lmp," restoring dihedral style {} from restart\n", force->dihedral_style); force->dihedral->read_restart(fp); @@ -964,7 +964,7 @@ void ReadRestart::force_fields() style = read_string(); force->create_improper(style,1); delete[] style; - if (comm->me ==0) + if (comm->me == 0) utils::logmesg(lmp," restoring improper style {} from restart\n", force->improper_style); force->improper->read_restart(fp); diff --git a/src/variable.cpp b/src/variable.cpp index 4d07a9e3c2..3264cfa1ee 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -2726,7 +2726,7 @@ double Variable::collapse_tree(Tree *tree) if (tree->first->type != VALUE || tree->second->type != VALUE || tree->extra[0]->type != VALUE) return 0.0; tree->type = VALUE; - if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 ) + if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0) error->all(FLERR,"Invalid math function in variable formula"); if (update->ntimestep < ivalue1) tree->value = ivalue1; else { @@ -3097,7 +3097,7 @@ double Variable::eval_tree(Tree *tree, int i) auto ivalue1 = static_cast (eval_tree(tree->first,i)); auto ivalue2 = static_cast (eval_tree(tree->second,i)); auto ivalue3 = static_cast (eval_tree(tree->extra[0],i)); - if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 ) + if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0) error->all(FLERR,"Invalid math function in variable formula"); if (update->ntimestep < ivalue1) arg = ivalue1; else { @@ -3628,7 +3628,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, Tree **tree auto ivalue1 = static_cast (value1); auto ivalue2 = static_cast (value2); auto ivalue3 = static_cast (values[0]); - if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 ) + if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0) print_var_error(FLERR,"Invalid math function in variable formula",ivar); double value; if (update->ntimestep < ivalue1) value = ivalue1;