diff --git a/cmake/Modules/Packages/USER-SMD.cmake b/cmake/Modules/Packages/USER-SMD.cmake index 158df83712..67f4aae99d 100644 --- a/cmake/Modules/Packages/USER-SMD.cmake +++ b/cmake/Modules/Packages/USER-SMD.cmake @@ -9,8 +9,8 @@ if(DOWNLOAD_EIGEN3) message(STATUS "Eigen3 download requested - we will build our own") include(ExternalProject) ExternalProject_Add(Eigen3_build - URL https://bitbucket.org/eigen/eigen/get/3.3.7.tar.gz - URL_MD5 f2a417d083fe8ca4b8ed2bc613d20f07 + URL https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz + URL_MD5 9e30f67e8531477de4117506fe44669b CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" ) ExternalProject_get_property(Eigen3_build SOURCE_DIR) diff --git a/lib/smd/Install.py b/lib/smd/Install.py index 40a8bca523..16dd3038a8 100644 --- a/lib/smd/Install.py +++ b/lib/smd/Install.py @@ -22,12 +22,10 @@ tarball = "eigen.tar.gz" # known checksums for different Eigen versions. used to validate the download. checksums = { \ - '3.3.4' : '1a47e78efe365a97de0c022d127607c3', \ - '3.3.5' : 'ee48cafede2f51fe33984ff5c9f48026', \ - '3.3.6' : 'd1be14064b50310b0eb2b49e402c64d7', \ - '3.3.7' : 'f2a417d083fe8ca4b8ed2bc613d20f07' \ + '3.3.7' : '9e30f67e8531477de4117506fe44669b' \ } + # help message HELP = """ @@ -36,7 +34,7 @@ Syntax from src dir: make lib-smd args="-b" Syntax from lib dir: python Install.py -b or: python Install.py -p /usr/include/eigen3" - or: python Install.py -v 3.3.4 -b + or: python Install.py -v 3.3.7 -b Example: @@ -78,7 +76,7 @@ if pathflag: if buildflag: print("Downloading Eigen ...") eigentar = os.path.join(homepath, tarball) - url = "https://bitbucket.org/eigen/eigen/get/%s.tar.gz" % version + url = "https://gitlab.com/libeigen/eigen/-/archive/%s/eigen-%s.tar.gz" % (version,version) geturl(url, eigentar) # verify downloaded archive integrity via md5 checksum, if known. @@ -89,7 +87,7 @@ if buildflag: print("Cleaning up old folders ...") - edir = glob.glob(os.path.join(homepath, "eigen-eigen-*")) + edir = glob.glob(os.path.join(homepath, "eigen-*")) edir.append(eigenpath) for one in edir: if os.path.isdir(one): @@ -102,8 +100,8 @@ if buildflag: os.remove(eigentar) else: sys.exit("File %s is not a supported archive" % eigentar) - edir = glob.glob(os.path.join(homepath, "eigen-eigen-*")) - os.rename(edir[0], eigenpath) + edir = os.path.join(homepath, "eigen-%s" % version) + os.rename(edir, eigenpath) # create link in lib/smd to Eigen src dir diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 1784f4562c..80f208a1a2 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -1460,7 +1460,7 @@ double PairGranular::single(int i, int j, int itype, int jtype, damp_normal = a*meff; } else if (damping_model[itype][jtype] == TSUJI) { damp_normal = sqrt(meff*knfac); - } + } else damp_normal = 0.0; damp_normal_prefactor = normal_coeffs[itype][jtype][1]*damp_normal; Fdamp = -damp_normal_prefactor*vnnr; diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index 87be2a4e7e..a91c615d09 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -256,7 +256,7 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con std::string key = words[1]; std::string filename = words[2]; std::vector species(words.begin()+3,words.end()); - if (species.size() != atom->ntypes) + if ((int)species.size() != atom->ntypes) error->one(FLERR,"Incorrect args for KIM_SET_TYPE_PARAMETERS command"); FILE *fp; diff --git a/src/KIM/kim_units.cpp b/src/KIM/kim_units.cpp index 8db1eeff17..c0c1aee07c 100644 --- a/src/KIM/kim_units.cpp +++ b/src/KIM/kim_units.cpp @@ -1016,10 +1016,8 @@ double get_torque_conversion_factor(units from_unit_enum, units to_unit_enum) double get_temperature_conversion_factor(units from_unit_enum, units to_unit_enum) { map > conv; - double to_si; conv[kelvin][kelvin] = 1.0; - return conv[from_unit_enum][to_unit_enum]; } diff --git a/src/MISC/dump_xtc.cpp b/src/MISC/dump_xtc.cpp index a28d6acdfa..022591839f 100644 --- a/src/MISC/dump_xtc.cpp +++ b/src/MISC/dump_xtc.cpp @@ -555,7 +555,7 @@ static int sizeofint(const int size) unsigned int num = 1; int num_of_bits = 0; - while (size >= num && num_of_bits < 32) { + while (size >= (int) num && num_of_bits < 32) { num_of_bits++; num <<= 1; } @@ -596,7 +596,7 @@ static int sizeofints( const int num_of_ints, unsigned int sizes[]) } num = 1; num_of_bytes--; - while (bytes[num_of_bytes] >= num) { + while ((int)bytes[num_of_bytes] >= num) { num_of_bits++; num *= 2; } @@ -650,13 +650,13 @@ static void sendints(int buf[], const int num_of_ints, const int num_of_bits, } num_of_bytes = bytecnt; } - if (num_of_bits >= num_of_bytes * 8) { - for (i = 0; i < num_of_bytes; i++) { + if (num_of_bits >= (int)num_of_bytes * 8) { + for (i = 0; i < (int)num_of_bytes; i++) { sendbits(buf, 8, bytes[i]); } sendbits(buf, num_of_bits - num_of_bytes * 8, 0); } else { - for (i = 0; i < num_of_bytes-1; i++) { + for (i = 0; i < (int)num_of_bytes-1; i++) { sendbits(buf, 8, bytes[i]); } sendbits(buf, num_of_bits- (num_of_bytes -1) * 8, bytes[i]); @@ -691,7 +691,7 @@ static int receivebits(int buf[], int num_of_bits) num_of_bits -=8; } if (num_of_bits > 0) { - if (lastbits < num_of_bits) { + if ((int)lastbits < num_of_bits) { lastbits += 8; lastbyte = (lastbyte << 8) | cbuf[cnt++]; } @@ -931,11 +931,11 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) lip = ip; luip = (unsigned int *) ip; smallidx = FIRSTIDX; - while (smallidx < LASTIDX && magicints[smallidx] < mindiff) { + while (smallidx < (int)LASTIDX && magicints[smallidx] < mindiff) { smallidx++; } xdr_int(xdrs, &smallidx); - maxidx = MYMIN(LASTIDX, smallidx + 8) ; + maxidx = MYMIN((int)LASTIDX, smallidx + 8) ; minidx = maxidx - 8; /* often this equal smallidx */ smaller = magicints[MYMAX(FIRSTIDX, smallidx-1)] / 2; small = magicints[smallidx] / 2; @@ -1111,7 +1111,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) } xdr_int(xdrs, &smallidx); - maxidx = MYMIN(LASTIDX, smallidx + 8) ; + maxidx = MYMIN((int)LASTIDX, smallidx + 8) ; minidx = maxidx - 8; /* often this equal smallidx */ smaller = magicints[MYMAX(FIRSTIDX, smallidx-1)] / 2; small = magicints[smallidx] / 2; diff --git a/src/USER-DPD/fix_rx.cpp b/src/USER-DPD/fix_rx.cpp index cfa309d053..77efd1842b 100644 --- a/src/USER-DPD/fix_rx.cpp +++ b/src/USER-DPD/fix_rx.cpp @@ -318,7 +318,7 @@ void FixRX::post_constructor() error->all(FLERR,"Exceeded the maximum number of species permitted in fix rx."); tmpspecies[nUniqueSpecies] = new char[strlen(word)+1]; strcpy(tmpspecies[nUniqueSpecies],word); - tmpmaxstrlen = MAX(tmpmaxstrlen,strlen(word)); + tmpmaxstrlen = MAX(tmpmaxstrlen,(int)strlen(word)); nUniqueSpecies++; } word = strtok(NULL, " \t\n\r\f"); @@ -543,7 +543,7 @@ void FixRX::initSparse() if (SparseKinetics_enableIntegralReactions){ sparseKinetics_inu[i][idx] = (int)sparseKinetics_nu[i][idx]; if (isIntegral_i){ - if (sparseKinetics_inu[i][idx] >= nu_bin.size()) + if (sparseKinetics_inu[i][idx] >= (int)nu_bin.size()) nu_bin.resize( sparseKinetics_inu[i][idx] ); nu_bin[ sparseKinetics_inu[i][idx] ] ++; @@ -561,7 +561,7 @@ void FixRX::initSparse() if (SparseKinetics_enableIntegralReactions){ sparseKinetics_inu[i][idx] = (int) sparseKinetics_nu[i][idx]; if (isIntegral_i){ - if (sparseKinetics_inu[i][idx] >= nu_bin.size()) + if (sparseKinetics_inu[i][idx] >= (int)nu_bin.size()) nu_bin.resize( sparseKinetics_inu[i][idx] ); nu_bin[ sparseKinetics_inu[i][idx] ] ++; diff --git a/src/USER-MANIFOLD/manifold_thylakoid.cpp b/src/USER-MANIFOLD/manifold_thylakoid.cpp index e473f00a03..ee86a50bf2 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid.cpp @@ -25,7 +25,7 @@ manifold_thylakoid::manifold_thylakoid( LAMMPS *lmp, int /*narg*/, char ** /*arg manifold_thylakoid::~manifold_thylakoid() { - for( std::size_t i = 0; i < parts.size(); ++i ){ + for(std::size_t i = 0; i < parts.size(); ++i) { delete parts[i]; } } @@ -60,7 +60,7 @@ void manifold_thylakoid::checkup() if (comm->me == 0 ) { fprintf(screen,"This is checkup of thylakoid %p\n", this); fprintf(screen,"I have %ld parts. They are:\n", parts.size()); - for( int i = 0; i < parts.size(); ++i ){ + for( int i = 0; i < (int)parts.size(); ++i ){ fprintf(screen, "[%f, %f] x [%f, %f] x [%f, %f]\n", parts[i]->xlo, parts[i]->xhi, parts[i]->ylo, parts[i]->yhi, diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp index 6c734d482e..31ebbaa406 100644 --- a/src/USER-MISC/bond_special.cpp +++ b/src/USER-MISC/bond_special.cpp @@ -163,7 +163,7 @@ void BondSpecial::coeff(int narg, char **arg) return an equilbrium bond length ------------------------------------------------------------------------- */ -double BondSpecial::equilibrium_distance(int i) +double BondSpecial::equilibrium_distance(int /*i*/) { return 0.; } diff --git a/src/USER-REAXC/reaxc_lookup.cpp b/src/USER-REAXC/reaxc_lookup.cpp index 562cbe995f..5ca4a30b8c 100644 --- a/src/USER-REAXC/reaxc_lookup.cpp +++ b/src/USER-REAXC/reaxc_lookup.cpp @@ -37,7 +37,7 @@ void Tridiagonal_Solve( const double *a, const double *b, c[0] /= b[0]; /* Division by zero risk. */ d[0] /= b[0]; /* Division by zero would imply a singular matrix. */ - for(i = 1; i < n; i++){ + for(i = 1; i < (int)n; i++){ id = (b[i] - c[i-1] * a[i]); /* Division by zero risk. */ c[i] /= id; /* Last value calculated is redundant. */ d[i] = (d[i] - d[i-1] * a[i])/id; @@ -64,26 +64,26 @@ void Natural_Cubic_Spline( LAMMPS_NS::Error* error_ptr, const double *h, const d /* build the linear system */ a[0] = a[1] = a[n-1] = 0; - for( i = 2; i < n-1; ++i ) + for( i = 2; i < (int)n-1; ++i ) a[i] = h[i-1]; b[0] = b[n-1] = 0; - for( i = 1; i < n-1; ++i ) + for( i = 1; i < (int)n-1; ++i ) b[i] = 2 * (h[i-1] + h[i]); c[0] = c[n-2] = c[n-1] = 0; - for( i = 1; i < n-2; ++i ) + for( i = 1; i < (int)n-2; ++i ) c[i] = h[i]; d[0] = d[n-1] = 0; - for( i = 1; i < n-1; ++i ) + for( i = 1; i < (int)n-1; ++i ) d[i] = 6 * ((f[i+1]-f[i])/h[i] - (f[i]-f[i-1])/h[i-1]); v[0] = 0; v[n-1] = 0; Tridiagonal_Solve( &(a[1]), &(b[1]), &(c[1]), &(d[1]), &(v[1]), n-2 ); - for( i = 1; i < n; ++i ){ + for( i = 1; i < (int)n; ++i ){ coef[i-1].d = (v[i] - v[i-1]) / (6*h[i-1]); coef[i-1].c = v[i]/2; coef[i-1].b = (f[i]-f[i-1])/h[i-1] + h[i-1]*(2*v[i] + v[i-1])/6; @@ -114,25 +114,25 @@ void Complete_Cubic_Spline( LAMMPS_NS::Error* error_ptr, const double *h, const /* build the linear system */ a[0] = 0; - for( i = 1; i < n; ++i ) + for( i = 1; i < (int)n; ++i ) a[i] = h[i-1]; b[0] = 2*h[0]; - for( i = 1; i < n; ++i ) + for( i = 1; i < (int)n; ++i ) b[i] = 2 * (h[i-1] + h[i]); c[n-1] = 0; - for( i = 0; i < n-1; ++i ) + for( i = 0; i < (int)n-1; ++i ) c[i] = h[i]; d[0] = 6 * (f[1]-f[0])/h[0] - 6 * v0; d[n-1] = 6 * vlast - 6 * (f[n-1]-f[n-2]/h[n-2]); - for( i = 1; i < n-1; ++i ) + for( i = 1; i < (int)n-1; ++i ) d[i] = 6 * ((f[i+1]-f[i])/h[i] - (f[i]-f[i-1])/h[i-1]); Tridiagonal_Solve( &(a[0]), &(b[0]), &(c[0]), &(d[0]), &(v[0]), n ); - for( i = 1; i < n; ++i ){ + for( i = 1; i < (int)n; ++i ){ coef[i-1].d = (v[i] - v[i-1]) / (6*h[i-1]); coef[i-1].c = v[i]/2; coef[i-1].b = (f[i]-f[i-1])/h[i-1] + h[i-1]*(2*v[i] + v[i-1])/6; diff --git a/src/USER-TALLY/README b/src/USER-TALLY/README index 8cb9bcdd6b..afdf638154 100644 --- a/src/USER-TALLY/README +++ b/src/USER-TALLY/README @@ -22,6 +22,5 @@ at Temple University with a little help and inspiration from Loris Ercole (SISSA/ISAS Trieste), who contributed compute heat/flux/tally. Additional contributed compute styles for this package are welcome. -Please contact Axel, if you have questions about the implementation. diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index 4be3ad7e76..c9b0617f5e 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -543,10 +543,10 @@ void ComputeVoronoi::processCell(voronoicell_neighbor &c, int i) c.vertices(vcell); c.face_vertices(vlist); // for each face: vertex count followed list of vertex indices (n_1,v1_1,v2_1,v3_1,..,vn_1,n_2,v2_1,...) double dx, dy, dz, r2, t2 = ethresh*ethresh; - for( j=0; jnprocs+2; // pRNG state per proc + nprocs + energy - double *list; - if (comm->me == 0) list = new double[nsize]; - list[0] = energy; - list[1] = comm->nprocs; + double *list = nullptr; + if (comm->me == 0) { + list = new double[nsize]; + list[0] = energy; + list[1] = comm->nprocs; + } double state[103]; random->get_state(state); MPI_Gather(state,103,MPI_DOUBLE,list+2,103*comm->nprocs,MPI_DOUBLE,0,world); @@ -318,8 +320,8 @@ void FixTempCSLD::write_restart(FILE *fp) int size = nsize * sizeof(double); fwrite(&size,sizeof(int),1,fp); fwrite(list,sizeof(double),nsize,fp); + delete[] list; } - if (comm->me == 0) delete[] list; } /* ---------------------------------------------------------------------- diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index 54fc820927..90200e2566 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -339,10 +339,12 @@ double FixTempCSVR::compute_scalar() void FixTempCSVR::write_restart(FILE *fp) { int nsize = (98+2+3)*comm->nprocs+2; // pRNG state per proc + nprocs + energy - double *list; - if (comm->me == 0) list = new double[nsize]; - list[0] = energy; - list[1] = comm->nprocs; + double *list = nullptr; + if (comm->me == 0) { + list = new double[nsize]; + list[0] = energy; + list[1] = comm->nprocs; + } double state[103]; random->get_state(state); MPI_Gather(state,103,MPI_DOUBLE,list+2,103*comm->nprocs,MPI_DOUBLE,0,world); @@ -351,8 +353,8 @@ void FixTempCSVR::write_restart(FILE *fp) int size = nsize * sizeof(double); fwrite(&size,sizeof(int),1,fp); fwrite(list,sizeof(double),nsize,fp); + delete[] list; } - if (comm->me == 0) delete[] list; } /* ---------------------------------------------------------------------- diff --git a/unittest/commands/test_lattice_region.cpp b/unittest/commands/test_lattice_region.cpp index 4f1e858324..d5d6f070f7 100644 --- a/unittest/commands/test_lattice_region.cpp +++ b/unittest/commands/test_lattice_region.cpp @@ -577,8 +577,6 @@ TEST_F(LatticeRegionTest, region_cone) lmp->input->one("write_dump all atom init.lammpstrj"); if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_EQ(lmp->domain->triclinic, 0); - - auto x = lmp->atom->x; ASSERT_EQ(lmp->atom->natoms, 42); } @@ -591,8 +589,6 @@ TEST_F(LatticeRegionTest, region_cylinder) lmp->input->one("create_atoms 1 region box"); if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_EQ(lmp->domain->triclinic, 0); - - auto x = lmp->atom->x; ASSERT_EQ(lmp->atom->natoms, 114); } @@ -605,8 +601,6 @@ TEST_F(LatticeRegionTest, region_prism) lmp->input->one("create_atoms 1 box"); if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_EQ(lmp->domain->triclinic, 1); - - auto x = lmp->atom->x; ASSERT_EQ(lmp->atom->natoms, 16); } @@ -619,8 +613,6 @@ TEST_F(LatticeRegionTest, region_sphere) lmp->input->one("create_atoms 1 region box"); if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_EQ(lmp->domain->triclinic, 0); - - auto x = lmp->atom->x; ASSERT_EQ(lmp->atom->natoms, 14); } @@ -635,8 +627,6 @@ TEST_F(LatticeRegionTest, region_union) lmp->input->one("create_atoms 1 region box"); if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_EQ(lmp->domain->triclinic, 0); - - auto x = lmp->atom->x; ASSERT_EQ(lmp->atom->natoms, 67); } @@ -651,8 +641,6 @@ TEST_F(LatticeRegionTest, region_intersect) lmp->input->one("create_atoms 1 region box"); if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_EQ(lmp->domain->triclinic, 0); - - auto x = lmp->atom->x; ASSERT_EQ(lmp->atom->natoms, 21); } @@ -669,8 +657,6 @@ TEST_F(LatticeRegionTest, region_plane) lmp->input->one("write_dump all atom init.lammpstrj"); if (!verbose) ::testing::internal::GetCapturedStdout(); ASSERT_EQ(lmp->domain->triclinic, 0); - - auto x = lmp->atom->x; ASSERT_EQ(lmp->atom->natoms, 16); } diff --git a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml index 96caf3150f..631be6b3d6 100644 --- a/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_charmm_coul_long_soft.yaml @@ -1,7 +1,7 @@ --- lammps_version: 21 Jul 2020 date_generated: Mon Aug 10 15:02:20 202 -epsilon: 7.5e-14 +epsilon: 2.5e-13 prerequisites: ! | atom full pair lj/charmm/coul/long/soft