apply changes suggested by clang-tidy

This commit is contained in:
Axel Kohlmeyer
2023-01-27 11:49:43 -05:00
parent e7ea5e8bf5
commit 34e8a74989
12 changed files with 11 additions and 30 deletions

View File

@ -202,14 +202,14 @@ bool AtomT::add_fields(const bool charge, const bool rot,
if (extra_fields > 0 && _extra_fields==0) { if (extra_fields > 0 && _extra_fields==0) {
_extra_fields=extra_fields; _extra_fields=extra_fields;
_other=true; _other=true;
if (_host_view==false) { if (!_host_view) {
success=success && (extra.alloc(_max_atoms*_extra_fields,*dev,UCL_WRITE_ONLY, success=success && (extra.alloc(_max_atoms*_extra_fields,*dev,UCL_WRITE_ONLY,
UCL_READ_ONLY)==UCL_SUCCESS); UCL_READ_ONLY)==UCL_SUCCESS);
gpu_bytes+=extra.device.row_bytes(); gpu_bytes+=extra.device.row_bytes();
} }
} }
if (bonds && _bonds==false) { if (bonds && !_bonds) {
_bonds=true; _bonds=true;
if (_bonds && _gpu_nbor>0) { if (_bonds && _gpu_nbor>0) {
success=success && (dev_tag.alloc(_max_atoms,*dev, success=success && (dev_tag.alloc(_max_atoms,*dev,

View File

@ -356,7 +356,7 @@ void PPPMDielectric::make_rho()
// (mx,my,mz) = global coords of moving stencil pt // (mx,my,mz) = global coords of moving stencil pt
double *q = atom->q_scaled; double *q = atom->q_scaled;
if (use_qscaled == false) q = atom->q; if (!use_qscaled) q = atom->q;
double **x = atom->x; double **x = atom->x;
int nlocal = atom->nlocal; int nlocal = atom->nlocal;

View File

@ -636,7 +636,7 @@ void PPPMDispDielectric::make_rho_c()
// (mx,my,mz) = global coords of moving stencil pt // (mx,my,mz) = global coords of moving stencil pt
double *q = atom->q_scaled; double *q = atom->q_scaled;
if (use_qscaled == false) q = atom->q; if (!use_qscaled) q = atom->q;
double **x = atom->x; double **x = atom->x;
int nlocal = atom->nlocal; int nlocal = atom->nlocal;

View File

@ -917,7 +917,7 @@ std::vector<double> FixElectrodeConp::gather_ngroup(std::vector<double> x_local)
std::vector<double> FixElectrodeConp::constraint_correction(std::vector<double> x) std::vector<double> FixElectrodeConp::constraint_correction(std::vector<double> x)
{ {
return constraint_projection(x); return constraint_projection(std::move(x));
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -37,13 +37,6 @@ AtomVecKokkos(lmp), AtomVecHybrid(lmp)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
AtomVecHybridKokkos::~AtomVecHybridKokkos()
{
}
/* ---------------------------------------------------------------------- */
void AtomVecHybridKokkos::grow(int n) void AtomVecHybridKokkos::grow(int n)
{ {
for (int k = 0; k < nstyles; k++) styles[k]->grow(n); for (int k = 0; k < nstyles; k++) styles[k]->grow(n);

View File

@ -32,7 +32,6 @@ namespace LAMMPS_NS {
class AtomVecHybridKokkos : public AtomVecKokkos, public AtomVecHybrid { class AtomVecHybridKokkos : public AtomVecKokkos, public AtomVecHybrid {
public: public:
AtomVecHybridKokkos(class LAMMPS *); AtomVecHybridKokkos(class LAMMPS *);
~AtomVecHybridKokkos() override;
void grow(int) override; void grow(int) override;

View File

@ -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 (!Kokkos::is_initialized()) {
if (is_finalized) if (is_finalized)

View File

@ -56,7 +56,7 @@ class KokkosLMP : protected Pointers {
KokkosLMP(class LAMMPS *, int, char **); KokkosLMP(class LAMMPS *, int, char **);
static void initialize(Kokkos::InitializationSettings, Error *); static void initialize(const Kokkos::InitializationSettings&, Error *);
static void finalize(); static void finalize();
void accelerator(int, char **); void accelerator(int, char **);
int neigh_count(int); int neigh_count(int);

View File

@ -46,13 +46,6 @@ MLIAPDescriptorSO3Kokkos<DeviceType>::MLIAPDescriptorSO3Kokkos(LAMMPS *lmp, char
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
template <class DeviceType>
MLIAPDescriptorSO3Kokkos<DeviceType>::~MLIAPDescriptorSO3Kokkos()
{
}
/* ---------------------------------------------------------------------- */
template <class DeviceType> template <class DeviceType>
void MLIAPDescriptorSO3Kokkos<DeviceType>::compute_descriptors(class MLIAPData *data_) void MLIAPDescriptorSO3Kokkos<DeviceType>::compute_descriptors(class MLIAPData *data_)
{ {

View File

@ -29,7 +29,6 @@ class MLIAPDescriptorSO3Kokkos :
public MLIAPDescriptorKokkos<DeviceType> { public MLIAPDescriptorKokkos<DeviceType> {
public: public:
MLIAPDescriptorSO3Kokkos(LAMMPS *, char *); MLIAPDescriptorSO3Kokkos(LAMMPS *, char *);
~MLIAPDescriptorSO3Kokkos() override;
void compute_descriptors(class MLIAPData *) override; void compute_descriptors(class MLIAPData *) override;
void compute_forces(class MLIAPData *) override; void compute_forces(class MLIAPData *) override;

View File

@ -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 // What follows is the second rejection test for the variance-constrained
// semi-grandcanonical method. // semi-grandcanonical method.
@ -472,7 +472,7 @@ void FixSemiGrandCanonicalMC::doMC()
// For (parallelized) semi-grandcanonical MC we have to determine the current concentrations now. // 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. // 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; const int *type = atom->type;
std::vector<int> localSpeciesCounts(atom->ntypes+1, 0); std::vector<int> localSpeciesCounts(atom->ntypes+1, 0);
for (int i = 0; i < atom->nlocal; i++, ++type) { for (int i = 0; i < atom->nlocal; i++, ++type) {

View File

@ -1360,11 +1360,8 @@ bool utils::is_double(const std::string &str)
{ {
if (str.empty()) return false; if (str.empty()) return false;
if (strmatch(str, "^[+-]?\\d+\\.?\\d*$") || strmatch(str, "^[+-]?\\d+\\.?\\d*[eE][+-]?\\d+$") || return strmatch(str, "^[+-]?\\d+\\.?\\d*$") || strmatch(str, "^[+-]?\\d+\\.?\\d*[eE][+-]?\\d+$") ||
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;
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------