add clang-format support to plugin examples

This commit is contained in:
Axel Kohlmeyer
2021-05-05 23:51:12 -04:00
parent 5fcd0d8b79
commit 49a7bb57de
21 changed files with 376 additions and 326 deletions

View File

@ -36,16 +36,14 @@ ImproperZero2::ImproperZero2(LAMMPS *lmp) : Improper(lmp), coeffflag(1)
ImproperZero2::~ImproperZero2()
{
if (allocated && !copymode) {
memory->destroy(setflag);
}
if (allocated && !copymode) { memory->destroy(setflag); }
}
/* ---------------------------------------------------------------------- */
void ImproperZero2::compute(int eflag, int vflag)
{
ev_init(eflag,vflag);
ev_init(eflag, vflag);
}
/* ---------------------------------------------------------------------- */
@ -53,11 +51,13 @@ void ImproperZero2::compute(int eflag, int vflag)
void ImproperZero2::settings(int narg, char **arg)
{
if ((narg != 0) && (narg != 1))
error->all(FLERR,"Illegal improper_style command");
error->all(FLERR, "Illegal improper_style command");
if (narg == 1) {
if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0;
else error->all(FLERR,"Illegal improper_style command");
if (strcmp("nocoeff", arg[0]) == 0)
coeffflag = 0;
else
error->all(FLERR, "Illegal improper_style command");
}
}
@ -68,7 +68,7 @@ void ImproperZero2::allocate()
allocated = 1;
int n = atom->nimpropertypes;
memory->create(setflag,n+1,"improper:setflag");
memory->create(setflag, n + 1, "improper:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
}
@ -79,12 +79,12 @@ void ImproperZero2::allocate()
void ImproperZero2::coeff(int narg, char **arg)
{
if ((narg < 1) || (coeffflag && narg > 1))
error->all(FLERR,"Incorrect args for improper coefficients");
error->all(FLERR, "Incorrect args for improper coefficients");
if (!allocated) allocate();
int ilo,ihi;
utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error);
int ilo, ihi;
utils::bounds(FLERR, arg[0], 1, atom->nimpropertypes, ilo, ihi, error);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -92,7 +92,7 @@ void ImproperZero2::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all(FLERR,"Incorrect args for improper coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for improper coefficients");
}
/* ----------------------------------------------------------------------
@ -115,8 +115,7 @@ void ImproperZero2::read_restart(FILE * /*fp*/)
proc 0 writes to data file
------------------------------------------------------------------------- */
void ImproperZero2::write_data(FILE *fp) {
for (int i = 1; i <= atom->nimpropertypes; i++)
fprintf(fp,"%d\n",i);
void ImproperZero2::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nimpropertypes; i++) fprintf(fp, "%d\n", i);
}