apply clang-format

This commit is contained in:
Axel Kohlmeyer
2024-07-22 23:58:10 -04:00
parent 70ee5495a2
commit b459d0c9b9
26 changed files with 69 additions and 80 deletions

View File

@ -1687,7 +1687,7 @@ void AtomVec::data_atom(double *coord, imageint imagetmp, const std::vector<std:
ivalue += cols;
continue;
}
for (m = 0; m < cols; m++) \
for (m = 0; m < cols; m++)
array[nlocal][m] = utils::numeric(FLERR, values[ivalue++], true, lmp);
}
} else if (datatype == Atom::INT) {

View File

@ -123,8 +123,7 @@ class AtomVec : protected Pointers {
virtual void create_atom(int, double *);
virtual void create_atom_post(int) {}
virtual void data_atom(double *, imageint, const std::vector<std::string> &,
std::string &);
virtual void data_atom(double *, imageint, const std::vector<std::string> &, std::string &);
virtual void data_atom_post(int) {}
virtual void data_atom_bonus(int, const std::vector<std::string> &) {}
virtual void data_body(int, int, int, int *, double *) {}

View File

@ -74,10 +74,8 @@ ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) :
// error checks
if (!atom->omega_flag)
error->all(FLERR,"Compute temp/sphere requires atom attribute omega");
if (!atom->radius_flag)
error->all(FLERR,"Compute temp/sphere requires atom attribute radius");
if (!atom->omega_flag) error->all(FLERR, "Compute temp/sphere requires atom attribute omega");
if (!atom->radius_flag) error->all(FLERR, "Compute temp/sphere requires atom attribute radius");
}
/* ---------------------------------------------------------------------- */

View File

@ -14,8 +14,8 @@
#ifndef LMP_ERROR_H
#define LMP_ERROR_H
#include "pointers.h"
#include "exceptions.h"
#include "pointers.h"
namespace LAMMPS_NS {

View File

@ -33,7 +33,8 @@ static constexpr int DELTA = 8192;
/* ---------------------------------------------------------------------- */
FixBondHistory::FixBondHistory(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg), bondstore(nullptr), bondtype_orig(nullptr), bondstore_comp(nullptr), bondstore_orig(nullptr), id_fix(nullptr), id_array(nullptr)
Fix(lmp, narg, arg), bondstore(nullptr), bondtype_orig(nullptr), bondstore_comp(nullptr),
bondstore_orig(nullptr), id_fix(nullptr), id_array(nullptr)
{
if (narg != 5) error->all(FLERR, "Illegal fix bond/history command");
@ -259,8 +260,7 @@ void FixBondHistory::post_neighbor()
if (hybrid_flag) {
nbondlist_orig = nbondlist;
for (n = 0; n < nbondlist; n++)
bondtype_orig[n] = bondlist[n][2];
for (n = 0; n < nbondlist; n++) bondtype_orig[n] = bondlist[n][2];
}
updated_bond_flag = 1;
@ -328,8 +328,7 @@ void FixBondHistory::compress_history()
if (type <= 0) continue;
if (!setflag[type]) continue;
for (int m = 0; m < ndata; m++)
bondstore_comp[ncomp][m] = bondstore[n][m];
for (int m = 0; m < ndata; m++) bondstore_comp[ncomp][m] = bondstore[n][m];
ncomp += 1;
}
}
@ -352,8 +351,7 @@ void FixBondHistory::uncompress_history()
if (type <= 0) continue;
if (!setflag[type]) continue;
for (int m = 0; m < ndata; m++)
bondstore_orig[n][m] = bondstore[ncomp][m];
for (int m = 0; m < ndata; m++) bondstore_orig[n][m] = bondstore[ncomp][m];
ncomp += 1;
}
}

View File

@ -40,8 +40,8 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), estr(nullptr),
pstr(nullptr), idregion(nullptr), region(nullptr), efield(nullptr)
Fix(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), estr(nullptr), pstr(nullptr),
idregion(nullptr), region(nullptr), efield(nullptr)
{
if (narg < 6) utils::missing_cmd_args(FLERR, std::string("fix ") + style, error);

View File

@ -127,7 +127,8 @@ void FixWallRegion::init()
// ensure all particles in group are extended particles
if (style == COLLOID) {
if (!atom->radius_flag) error->all(FLERR, "Fix wall/region colloid requires atom attribute radius");
if (!atom->radius_flag)
error->all(FLERR, "Fix wall/region colloid requires atom attribute radius");
double *radius = atom->radius;
int *mask = atom->mask;

View File

@ -88,11 +88,10 @@ Grid2d::Grid2d(LAMMPS *lmp, MPI_Comm gcomm, int gnx, int gny) :
Grid2d::Grid2d(LAMMPS *lmp, MPI_Comm gcomm, int gnx, int gny, int ixlo, int ixhi, int iylo,
int iyhi, int oxlo, int oxhi, int oylo, int oyhi) :
Pointers(lmp),
swap(nullptr), requests(nullptr), srequest(nullptr), rrequest(nullptr), sresponse(nullptr),
rresponse(nullptr), send(nullptr), recv(nullptr), copy(nullptr), send_remap(nullptr),
recv_remap(nullptr), overlap_procs(nullptr), xsplit(nullptr), ysplit(nullptr), zsplit(nullptr),
grid2proc(nullptr), rcbinfo(nullptr), overlap_list(nullptr)
Pointers(lmp), swap(nullptr), requests(nullptr), srequest(nullptr), rrequest(nullptr),
sresponse(nullptr), rresponse(nullptr), send(nullptr), recv(nullptr), copy(nullptr),
send_remap(nullptr), recv_remap(nullptr), overlap_procs(nullptr), xsplit(nullptr),
ysplit(nullptr), zsplit(nullptr), grid2proc(nullptr), rcbinfo(nullptr), overlap_list(nullptr)
{
gridcomm = gcomm;
MPI_Comm_rank(gridcomm, &me);

View File

@ -40,8 +40,7 @@ static const char cite_type_label_framework[] =
LabelMap::LabelMap(LAMMPS *_lmp, int _natomtypes, int _nbondtypes, int _nangletypes,
int _ndihedraltypes, int _nimpropertypes) :
Pointers(_lmp),
natomtypes(_natomtypes), nbondtypes(_nbondtypes), nangletypes(_nangletypes),
Pointers(_lmp), natomtypes(_natomtypes), nbondtypes(_nbondtypes), nangletypes(_nangletypes),
ndihedraltypes(_ndihedraltypes), nimpropertypes(_nimpropertypes)
{
if (lmp->citeme) lmp->citeme->add(cite_type_label_framework);

View File

@ -115,12 +115,11 @@ class Modify : protected Pointers {
int find_fix(const std::string &);
// new API
Fix *get_fix_by_id(const std::string &) const;
Fix *get_fix_by_index(int idx) const {
return ((idx >= 0) && (idx < nfix)) ? fix[idx] : nullptr;
}
Fix *get_fix_by_index(int idx) const { return ((idx >= 0) && (idx < nfix)) ? fix[idx] : nullptr; }
const std::vector<Fix *> get_fix_by_style(const std::string &) const;
const std::vector<Fix *> &get_fix_list();
int get_fix_mask(Fix *ifix) const {
int get_fix_mask(Fix *ifix) const
{
for (int i = 0; i < nfix; ++i) {
if (fix[i] == ifix) return fmask[i];
}

View File

@ -62,8 +62,7 @@ double PairHybridMolecular::init_one(int i, int j)
// plus I,I and J,J need the same number of substyles
if (setflag[i][j] == 0) {
if (nmap[i][i] != nmap[j][j])
error->one(FLERR,"All pair coeffs are not set");
if (nmap[i][i] != nmap[j][j]) error->one(FLERR, "All pair coeffs are not set");
int num = 0;
for (int k = 0; k < nmap[i][i]; ++k) {
for (int l = 0; l < nmap[j][j]; ++l) {
@ -74,8 +73,7 @@ double PairHybridMolecular::init_one(int i, int j)
}
}
}
if (nmap[i][i] != nmap[i][j])
error->one(FLERR,"All pair coeffs are not set");
if (nmap[i][i] != nmap[i][j]) error->one(FLERR, "All pair coeffs are not set");
}
nmap[j][i] = nmap[i][j];
@ -133,8 +131,7 @@ double PairHybridMolecular::init_one(int i, int j)
double PairHybridMolecular::single(int i, int j, int itype, int jtype, double rsq,
double factor_coul, double factor_lj, double &fforce)
{
if (nmap[itype][jtype] == 0)
error->one(FLERR,"Invoked pair single() on sub-style none");
if (nmap[itype][jtype] == 0) error->one(FLERR, "Invoked pair single() on sub-style none");
double fone;
fforce = 0.0;
@ -149,7 +146,8 @@ double PairHybridMolecular::single(int i, int j, int itype, int jtype, double rs
keywords[mystyle]);
if ((special_lj[mystyle] != nullptr) || (special_coul[mystyle] != nullptr))
error->one(FLERR,"Pair hybrid/molecular single() calls do not support per sub-style "
error->one(FLERR,
"Pair hybrid/molecular single() calls do not support per sub-style "
"special bond values");
esum += styles[mystyle]->single(i, j, itype, jtype, rsq, factor_coul, factor_lj, fone);

View File

@ -47,8 +47,7 @@ using namespace LAMMPS_NS;
PotentialFileReader::PotentialFileReader(LAMMPS *lmp, const std::string &filename,
const std::string &potential_name,
const std::string &name_suffix, const int auto_convert) :
Pointers(lmp),
reader(nullptr), filename(filename), filetype(potential_name + name_suffix),
Pointers(lmp), reader(nullptr), filename(filename), filetype(potential_name + name_suffix),
unit_convert(auto_convert)
{
if (comm->me != 0) { error->one(FLERR, "FileReader should only be called by proc 0!"); }

View File

@ -33,8 +33,9 @@ static constexpr double BIG = 1.0e20;
/* ---------------------------------------------------------------------- */
RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg), lo(0.0), hi(0.0),
c1str(nullptr), c2str(nullptr), rlostr(nullptr), rhistr(nullptr), lostr(nullptr), histr(nullptr)
RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
Region(lmp, narg, arg), lo(0.0), hi(0.0), c1str(nullptr), c2str(nullptr), rlostr(nullptr),
rhistr(nullptr), lostr(nullptr), histr(nullptr)
{
options(narg - 9, &arg[9]);
@ -172,7 +173,6 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg), lo
radiushi = xscale * utils::numeric(FLERR, arg[6], false, lmp);
rhistyle = CONSTANT;
}
}
lostyle = CONSTANT;

View File

@ -237,7 +237,6 @@ class Thermo : protected Pointers {
void compute_nbuild();
void compute_ndanger();
};
} // namespace LAMMPS_NS