update .clang-format file from src and update files
This commit is contained in:
@ -16,7 +16,7 @@ BraceWrapping:
|
||||
BreakBeforeBraces: Custom
|
||||
BreakConstructorInitializers: AfterColon
|
||||
BreakInheritanceList: AfterColon
|
||||
ColumnLimit: 80
|
||||
ColumnLimit: 100
|
||||
IndentCaseLabels: true
|
||||
IndentWidth: 2
|
||||
NamespaceIndentation: Inner
|
||||
|
||||
@ -53,8 +53,7 @@ void AngleZero2::compute(int eflag, int vflag)
|
||||
|
||||
void AngleZero2::settings(int narg, char **arg)
|
||||
{
|
||||
if ((narg != 0) && (narg != 1))
|
||||
error->all(FLERR, "Illegal angle_style command");
|
||||
if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal angle_style command");
|
||||
|
||||
if (narg == 1) {
|
||||
if (strcmp("nocoeff", arg[0]) == 0)
|
||||
@ -91,8 +90,7 @@ void AngleZero2::coeff(int narg, char **arg)
|
||||
utils::bounds(FLERR, arg[0], 1, atom->nangletypes, ilo, ihi, error);
|
||||
|
||||
double theta0_one = 0.0;
|
||||
if (coeffflag && (narg == 2))
|
||||
theta0_one = utils::numeric(FLERR, arg[1], false, lmp);
|
||||
if (coeffflag && (narg == 2)) theta0_one = utils::numeric(FLERR, arg[1], false, lmp);
|
||||
|
||||
// convert theta0 from degrees to radians
|
||||
|
||||
@ -131,8 +129,7 @@ void AngleZero2::read_restart(FILE *fp)
|
||||
allocate();
|
||||
|
||||
if (comm->me == 0) {
|
||||
utils::sfread(FLERR, &theta0[1], sizeof(double), atom->nangletypes, fp,
|
||||
nullptr, error);
|
||||
utils::sfread(FLERR, &theta0[1], sizeof(double), atom->nangletypes, fp, nullptr, error);
|
||||
}
|
||||
MPI_Bcast(&theta0[1], atom->nangletypes, MPI_DOUBLE, 0, world);
|
||||
|
||||
@ -144,8 +141,7 @@ void AngleZero2::read_restart(FILE *fp)
|
||||
|
||||
void AngleZero2::write_data(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->nangletypes; i++)
|
||||
fprintf(fp, "%d %g\n", i, theta0[i] / MY_PI * 180.0);
|
||||
for (int i = 1; i <= atom->nangletypes; i++) fprintf(fp, "%d %g\n", i, theta0[i] / MY_PI * 180.0);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -51,8 +51,7 @@ void BondZero2::compute(int eflag, int vflag)
|
||||
|
||||
void BondZero2::settings(int narg, char **arg)
|
||||
{
|
||||
if ((narg != 0) && (narg != 1))
|
||||
error->all(FLERR, "Illegal bond_style command");
|
||||
if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal bond_style command");
|
||||
|
||||
if (narg == 1) {
|
||||
if (strcmp("nocoeff", arg[0]) == 0)
|
||||
@ -89,8 +88,7 @@ void BondZero2::coeff(int narg, char **arg)
|
||||
utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error);
|
||||
|
||||
double r0_one = 0.0;
|
||||
if (coeffflag && (narg == 2))
|
||||
r0_one = utils::numeric(FLERR, arg[1], false, lmp);
|
||||
if (coeffflag && (narg == 2)) r0_one = utils::numeric(FLERR, arg[1], false, lmp);
|
||||
|
||||
int count = 0;
|
||||
for (int i = ilo; i <= ihi; i++) {
|
||||
@ -129,8 +127,7 @@ void BondZero2::read_restart(FILE *fp)
|
||||
allocate();
|
||||
|
||||
if (comm->me == 0) {
|
||||
utils::sfread(FLERR, &r0[1], sizeof(double), atom->nbondtypes, fp, nullptr,
|
||||
error);
|
||||
utils::sfread(FLERR, &r0[1], sizeof(double), atom->nbondtypes, fp, nullptr, error);
|
||||
}
|
||||
MPI_Bcast(&r0[1], atom->nbondtypes, MPI_DOUBLE, 0, world);
|
||||
|
||||
@ -148,8 +145,7 @@ void BondZero2::write_data(FILE *fp)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
double BondZero2::single(int /*type*/, double /*rsq*/, int /*i*/, int /*j*/,
|
||||
double & /*fforce*/)
|
||||
double BondZero2::single(int /*type*/, double /*rsq*/, int /*i*/, int /*j*/, double & /*fforce*/)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@ -50,8 +50,7 @@ void DihedralZero2::compute(int eflag, int vflag)
|
||||
|
||||
void DihedralZero2::settings(int narg, char **arg)
|
||||
{
|
||||
if ((narg != 0) && (narg != 1))
|
||||
error->all(FLERR, "Illegal dihedral_style command");
|
||||
if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal dihedral_style command");
|
||||
|
||||
if (narg == 1) {
|
||||
if (strcmp("nocoeff", arg[0]) == 0)
|
||||
|
||||
@ -26,8 +26,7 @@ using namespace FixConst;
|
||||
|
||||
FixNVE2::FixNVE2(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
|
||||
{
|
||||
if (strcmp(style, "nve/sphere") != 0 && narg < 3)
|
||||
error->all(FLERR, "Illegal fix nve command");
|
||||
if (strcmp(style, "nve/sphere") != 0 && narg < 3) error->all(FLERR, "Illegal fix nve command");
|
||||
|
||||
dynamic_group_allow = 1;
|
||||
time_integrate = 1;
|
||||
@ -52,8 +51,7 @@ void FixNVE2::init()
|
||||
dtv = update->dt;
|
||||
dtf = 0.5 * update->dt * force->ftm2v;
|
||||
|
||||
if (strstr(update->integrate_style, "respa"))
|
||||
step_respa = ((Respa *) update->integrate)->step;
|
||||
if (strstr(update->integrate_style, "respa")) step_respa = ((Respa *) update->integrate)->step;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -50,8 +50,7 @@ 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");
|
||||
if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal improper_style command");
|
||||
|
||||
if (narg == 1) {
|
||||
if (strcmp("nocoeff", arg[0]) == 0)
|
||||
|
||||
@ -110,14 +110,11 @@ void PairMorse2::compute(int eflag, int vflag)
|
||||
}
|
||||
|
||||
if (eflag) {
|
||||
evdwl = d0[itype][jtype] * (dexp * dexp - 2.0 * dexp) -
|
||||
offset[itype][jtype];
|
||||
evdwl = d0[itype][jtype] * (dexp * dexp - 2.0 * dexp) - offset[itype][jtype];
|
||||
evdwl *= factor_lj;
|
||||
}
|
||||
|
||||
if (evflag)
|
||||
ev_tally(i, j, nlocal, newton_pair, evdwl, 0.0, fpair, delx, dely,
|
||||
delz);
|
||||
if (evflag) ev_tally(i, j, nlocal, newton_pair, evdwl, 0.0, fpair, delx, dely, delz);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -174,8 +171,7 @@ void PairMorse2::settings(int narg, char **arg)
|
||||
|
||||
void PairMorse2::coeff(int narg, char **arg)
|
||||
{
|
||||
if (narg < 5 || narg > 6)
|
||||
error->all(FLERR, "Incorrect args for pair coefficients");
|
||||
if (narg < 5 || narg > 6) error->all(FLERR, "Incorrect args for pair coefficients");
|
||||
if (!allocated) allocate();
|
||||
|
||||
int ilo, ihi, jlo, jhi;
|
||||
@ -264,20 +260,14 @@ void PairMorse2::read_restart(FILE *fp)
|
||||
int me = comm->me;
|
||||
for (i = 1; i <= atom->ntypes; i++)
|
||||
for (j = i; j <= atom->ntypes; j++) {
|
||||
if (me == 0)
|
||||
utils::sfread(FLERR, &setflag[i][j], sizeof(int), 1, fp, nullptr,
|
||||
error);
|
||||
if (me == 0) utils::sfread(FLERR, &setflag[i][j], sizeof(int), 1, fp, nullptr, error);
|
||||
MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world);
|
||||
if (setflag[i][j]) {
|
||||
if (me == 0) {
|
||||
utils::sfread(FLERR, &d0[i][j], sizeof(double), 1, fp, nullptr,
|
||||
error);
|
||||
utils::sfread(FLERR, &alpha[i][j], sizeof(double), 1, fp, nullptr,
|
||||
error);
|
||||
utils::sfread(FLERR, &r0[i][j], sizeof(double), 1, fp, nullptr,
|
||||
error);
|
||||
utils::sfread(FLERR, &cut[i][j], sizeof(double), 1, fp, nullptr,
|
||||
error);
|
||||
utils::sfread(FLERR, &d0[i][j], sizeof(double), 1, fp, nullptr, error);
|
||||
utils::sfread(FLERR, &alpha[i][j], sizeof(double), 1, fp, nullptr, error);
|
||||
utils::sfread(FLERR, &r0[i][j], sizeof(double), 1, fp, nullptr, error);
|
||||
utils::sfread(FLERR, &cut[i][j], sizeof(double), 1, fp, nullptr, error);
|
||||
}
|
||||
MPI_Bcast(&d0[i][j], 1, MPI_DOUBLE, 0, world);
|
||||
MPI_Bcast(&alpha[i][j], 1, MPI_DOUBLE, 0, world);
|
||||
@ -332,15 +322,13 @@ void PairMorse2::write_data_all(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
for (int j = i; j <= atom->ntypes; j++)
|
||||
fprintf(fp, "%d %d %g %g %g %g\n", i, j, d0[i][j], alpha[i][j], r0[i][j],
|
||||
cut[i][j]);
|
||||
fprintf(fp, "%d %d %g %g %g %g\n", i, j, d0[i][j], alpha[i][j], r0[i][j], cut[i][j]);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
double PairMorse2::single(int /*i*/, int /*j*/, int itype, int jtype,
|
||||
double rsq, double /*factor_coul*/, double factor_lj,
|
||||
double &fforce)
|
||||
double PairMorse2::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq,
|
||||
double /*factor_coul*/, double factor_lj, double &fforce)
|
||||
{
|
||||
double r, dr, dexp, phi;
|
||||
|
||||
|
||||
@ -27,8 +27,7 @@ using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairMorse2OMP::PairMorse2OMP(LAMMPS *lmp) :
|
||||
PairMorse2(lmp), ThrOMP(lmp, THR_PAIR)
|
||||
PairMorse2OMP::PairMorse2OMP(LAMMPS *lmp) : PairMorse2(lmp), ThrOMP(lmp, THR_PAIR)
|
||||
{
|
||||
suffix_flag |= Suffix::OMP;
|
||||
respa_enable = 0;
|
||||
@ -140,14 +139,12 @@ void PairMorse2OMP::eval(int iifrom, int iito, ThrData *const thr)
|
||||
}
|
||||
|
||||
if (EFLAG) {
|
||||
evdwl = d0[itype][jtype] * (dexp * dexp - 2.0 * dexp) -
|
||||
offset[itype][jtype];
|
||||
evdwl = d0[itype][jtype] * (dexp * dexp - 2.0 * dexp) - offset[itype][jtype];
|
||||
evdwl *= factor_lj;
|
||||
}
|
||||
|
||||
if (EVFLAG)
|
||||
ev_tally_thr(this, i, j, nlocal, NEWTON_PAIR, evdwl, 0.0, fpair, delx,
|
||||
dely, delz, thr);
|
||||
ev_tally_thr(this, i, j, nlocal, NEWTON_PAIR, evdwl, 0.0, fpair, delx, dely, delz, thr);
|
||||
}
|
||||
}
|
||||
f[i].x += fxtmp;
|
||||
|
||||
@ -85,8 +85,7 @@ void PairZero2::allocate()
|
||||
|
||||
void PairZero2::settings(int narg, char **arg)
|
||||
{
|
||||
if ((narg != 1) && (narg != 2))
|
||||
error->all(FLERR, "Illegal pair_style command");
|
||||
if ((narg != 1) && (narg != 2)) error->all(FLERR, "Illegal pair_style command");
|
||||
|
||||
cut_global = utils::numeric(FLERR, arg[0], false, lmp);
|
||||
if (narg == 2) {
|
||||
@ -121,8 +120,7 @@ void PairZero2::coeff(int narg, char **arg)
|
||||
utils::bounds(FLERR, arg[1], 1, atom->ntypes, jlo, jhi, error);
|
||||
|
||||
double cut_one = cut_global;
|
||||
if (coeffflag && (narg == 3))
|
||||
cut_one = utils::numeric(FLERR, arg[2], false, lmp);
|
||||
if (coeffflag && (narg == 3)) cut_one = utils::numeric(FLERR, arg[2], false, lmp);
|
||||
|
||||
int count = 0;
|
||||
for (int i = ilo; i <= ihi; i++) {
|
||||
@ -176,15 +174,10 @@ void PairZero2::read_restart(FILE *fp)
|
||||
int me = comm->me;
|
||||
for (i = 1; i <= atom->ntypes; i++)
|
||||
for (j = i; j <= atom->ntypes; j++) {
|
||||
if (me == 0)
|
||||
utils::sfread(FLERR, &setflag[i][j], sizeof(int), 1, fp, nullptr,
|
||||
error);
|
||||
if (me == 0) utils::sfread(FLERR, &setflag[i][j], sizeof(int), 1, fp, nullptr, error);
|
||||
MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world);
|
||||
if (setflag[i][j]) {
|
||||
if (me == 0) {
|
||||
utils::sfread(FLERR, &cut[i][j], sizeof(double), 1, fp, nullptr,
|
||||
error);
|
||||
}
|
||||
if (me == 0) { utils::sfread(FLERR, &cut[i][j], sizeof(double), 1, fp, nullptr, error); }
|
||||
MPI_Bcast(&cut[i][j], 1, MPI_DOUBLE, 0, world);
|
||||
}
|
||||
}
|
||||
@ -231,15 +224,13 @@ void PairZero2::write_data(FILE *fp)
|
||||
void PairZero2::write_data_all(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
for (int j = i; j <= atom->ntypes; j++)
|
||||
fprintf(fp, "%d %d %g\n", i, j, cut[i][j]);
|
||||
for (int j = i; j <= atom->ntypes; j++) fprintf(fp, "%d %d %g\n", i, j, cut[i][j]);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
double PairZero2::single(int /*i*/, int /*j*/, int /* itype */, int /* jtype */,
|
||||
double /* rsq */, double /*factor_coul*/,
|
||||
double /* factor_lj */, double &fforce)
|
||||
double PairZero2::single(int /*i*/, int /*j*/, int /* itype */, int /* jtype */, double /* rsq */,
|
||||
double /*factor_coul*/, double /* factor_lj */, double &fforce)
|
||||
{
|
||||
fforce = 0.0;
|
||||
return 0.0;
|
||||
|
||||
Reference in New Issue
Block a user