diff --git a/lib/gpu/lal_atom.cpp b/lib/gpu/lal_atom.cpp index 72cb59a912..3d1a1cc963 100644 --- a/lib/gpu/lal_atom.cpp +++ b/lib/gpu/lal_atom.cpp @@ -202,14 +202,14 @@ bool AtomT::add_fields(const bool charge, const bool rot, if (extra_fields > 0 && _extra_fields==0) { _extra_fields=extra_fields; _other=true; - if (_host_view==false) { + if (!_host_view) { success=success && (extra.alloc(_max_atoms*_extra_fields,*dev,UCL_WRITE_ONLY, UCL_READ_ONLY)==UCL_SUCCESS); gpu_bytes+=extra.device.row_bytes(); } } - if (bonds && _bonds==false) { + if (bonds && !_bonds) { _bonds=true; if (_bonds && _gpu_nbor>0) { success=success && (dev_tag.alloc(_max_atoms,*dev, diff --git a/src/DIELECTRIC/pppm_dielectric.cpp b/src/DIELECTRIC/pppm_dielectric.cpp index ca87964e76..b9ae1d65ff 100644 --- a/src/DIELECTRIC/pppm_dielectric.cpp +++ b/src/DIELECTRIC/pppm_dielectric.cpp @@ -356,7 +356,7 @@ void PPPMDielectric::make_rho() // (mx,my,mz) = global coords of moving stencil pt double *q = atom->q_scaled; - if (use_qscaled == false) q = atom->q; + if (!use_qscaled) q = atom->q; double **x = atom->x; int nlocal = atom->nlocal; diff --git a/src/DIELECTRIC/pppm_disp_dielectric.cpp b/src/DIELECTRIC/pppm_disp_dielectric.cpp index e8a954616b..2c4de6ada1 100644 --- a/src/DIELECTRIC/pppm_disp_dielectric.cpp +++ b/src/DIELECTRIC/pppm_disp_dielectric.cpp @@ -636,7 +636,7 @@ void PPPMDispDielectric::make_rho_c() // (mx,my,mz) = global coords of moving stencil pt double *q = atom->q_scaled; - if (use_qscaled == false) q = atom->q; + if (!use_qscaled) q = atom->q; double **x = atom->x; int nlocal = atom->nlocal; diff --git a/src/ELECTRODE/fix_electrode_conp.cpp b/src/ELECTRODE/fix_electrode_conp.cpp index dbb508a033..beecc18f68 100644 --- a/src/ELECTRODE/fix_electrode_conp.cpp +++ b/src/ELECTRODE/fix_electrode_conp.cpp @@ -917,7 +917,7 @@ std::vector FixElectrodeConp::gather_ngroup(std::vector x_local) std::vector FixElectrodeConp::constraint_correction(std::vector x) { - return constraint_projection(x); + return constraint_projection(std::move(x)); } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp index 4dfbf22fae..fce0b3b337 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp @@ -37,13 +37,6 @@ AtomVecKokkos(lmp), AtomVecHybrid(lmp) /* ---------------------------------------------------------------------- */ -AtomVecHybridKokkos::~AtomVecHybridKokkos() -{ - -} - -/* ---------------------------------------------------------------------- */ - void AtomVecHybridKokkos::grow(int n) { for (int k = 0; k < nstyles; k++) styles[k]->grow(n); diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.h b/src/KOKKOS/atom_vec_hybrid_kokkos.h index 2a725577ba..f3aad18937 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.h +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.h @@ -32,7 +32,6 @@ namespace LAMMPS_NS { class AtomVecHybridKokkos : public AtomVecKokkos, public AtomVecHybrid { public: AtomVecHybridKokkos(class LAMMPS *); - ~AtomVecHybridKokkos() override; void grow(int) override; diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index 9bbfb4157f..33890e4040 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -342,7 +342,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) /* ---------------------------------------------------------------------- */ -void KokkosLMP::initialize(Kokkos::InitializationSettings args, Error *error) +void KokkosLMP::initialize(const Kokkos::InitializationSettings& args, Error *error) { if (!Kokkos::is_initialized()) { if (is_finalized) diff --git a/src/KOKKOS/kokkos.h b/src/KOKKOS/kokkos.h index 02189e6c4a..4fa294e497 100644 --- a/src/KOKKOS/kokkos.h +++ b/src/KOKKOS/kokkos.h @@ -56,7 +56,7 @@ class KokkosLMP : protected Pointers { KokkosLMP(class LAMMPS *, int, char **); - static void initialize(Kokkos::InitializationSettings, Error *); + static void initialize(const Kokkos::InitializationSettings&, Error *); static void finalize(); void accelerator(int, char **); int neigh_count(int); diff --git a/src/KOKKOS/mliap_descriptor_so3_kokkos.cpp b/src/KOKKOS/mliap_descriptor_so3_kokkos.cpp index 6518cccaa8..de6404b691 100644 --- a/src/KOKKOS/mliap_descriptor_so3_kokkos.cpp +++ b/src/KOKKOS/mliap_descriptor_so3_kokkos.cpp @@ -46,13 +46,6 @@ MLIAPDescriptorSO3Kokkos::MLIAPDescriptorSO3Kokkos(LAMMPS *lmp, char /* ---------------------------------------------------------------------- */ -template -MLIAPDescriptorSO3Kokkos::~MLIAPDescriptorSO3Kokkos() -{ -} - -/* ---------------------------------------------------------------------- */ - template void MLIAPDescriptorSO3Kokkos::compute_descriptors(class MLIAPData *data_) { diff --git a/src/KOKKOS/mliap_descriptor_so3_kokkos.h b/src/KOKKOS/mliap_descriptor_so3_kokkos.h index aea4540632..2d15924fe8 100644 --- a/src/KOKKOS/mliap_descriptor_so3_kokkos.h +++ b/src/KOKKOS/mliap_descriptor_so3_kokkos.h @@ -29,7 +29,6 @@ class MLIAPDescriptorSO3Kokkos : public MLIAPDescriptorKokkos { public: MLIAPDescriptorSO3Kokkos(LAMMPS *, char *); - ~MLIAPDescriptorSO3Kokkos() override; void compute_descriptors(class MLIAPData *) override; void compute_forces(class MLIAPData *) override; diff --git a/src/MC/fix_sgcmc.cpp b/src/MC/fix_sgcmc.cpp index 7dd50a2792..a70f3240db 100644 --- a/src/MC/fix_sgcmc.cpp +++ b/src/MC/fix_sgcmc.cpp @@ -406,7 +406,7 @@ void FixSemiGrandCanonicalMC::doMC() } } - if (kappa != 0.0 && serialMode == false) { + if (kappa != 0.0 && !serialMode) { // What follows is the second rejection test for the variance-constrained // semi-grandcanonical method. @@ -472,7 +472,7 @@ void FixSemiGrandCanonicalMC::doMC() // For (parallelized) semi-grandcanonical MC we have to determine the current concentrations now. // For the serial version and variance-constrained MC it has already been done in the loop. - if (kappa == 0.0 && serialMode == false) { + if (kappa == 0.0 && !serialMode) { const int *type = atom->type; std::vector localSpeciesCounts(atom->ntypes+1, 0); for (int i = 0; i < atom->nlocal; i++, ++type) { diff --git a/src/utils.cpp b/src/utils.cpp index 31a14a352a..bc4eee7385 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1360,11 +1360,8 @@ bool utils::is_double(const std::string &str) { if (str.empty()) return false; - if (strmatch(str, "^[+-]?\\d+\\.?\\d*$") || strmatch(str, "^[+-]?\\d+\\.?\\d*[eE][+-]?\\d+$") || - strmatch(str, "^[+-]?\\d*\\.?\\d+$") || strmatch(str, "^[+-]?\\d*\\.?\\d+[eE][+-]?\\d+$")) - return true; - else - return false; + return strmatch(str, "^[+-]?\\d+\\.?\\d*$") || strmatch(str, "^[+-]?\\d+\\.?\\d*[eE][+-]?\\d+$") || + strmatch(str, "^[+-]?\\d*\\.?\\d+$") || strmatch(str, "^[+-]?\\d*\\.?\\d+[eE][+-]?\\d+$"); } /* ----------------------------------------------------------------------