From 660bced187f2784f62d4c32f0138e862dc0652cc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 13 Oct 2021 19:17:42 -0400 Subject: [PATCH] whitespace, pointer initializer, and permission fixes --- examples/mc/data.bead | 0 examples/mc/in.mixed | 8 ++++---- examples/mc/in.pure | 8 ++++---- src/MC/fix_mol_swap.cpp | 8 ++++---- src/MC/fix_mol_swap.h | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) mode change 100755 => 100644 examples/mc/data.bead mode change 100755 => 100644 examples/mc/in.mixed mode change 100755 => 100644 examples/mc/in.pure diff --git a/examples/mc/data.bead b/examples/mc/data.bead old mode 100755 new mode 100644 diff --git a/examples/mc/in.mixed b/examples/mc/in.mixed old mode 100755 new mode 100644 index ddf42d4ca4..318bb1312c --- a/examples/mc/in.mixed +++ b/examples/mc/in.mixed @@ -13,7 +13,7 @@ neigh_modify delay 0 pair_style lj/cut 1.1224620483 bond_style fene angle_style cosine -special_bonds lj 0.0 1.0 1.0 +special_bonds lj 0.0 1.0 1.0 read_data data.bead @@ -21,7 +21,7 @@ pair_coeff * * 1.0 1.0 1.1224620483 pair_coeff 1 2 1.02 1.0 1.1224620483 bond_coeff 1 30.0 1.5 1.0 1.0 angle_coeff 1 1.500 -pair_modify shift yes +pair_modify shift yes variable vt1 atom type==1 variable vt2 atom type==2 @@ -30,8 +30,8 @@ group g2 dynamic all var vt2 every 100 variable count1 equal count(g1) variable count2 equal count(g2) -timestep 0.010 - +timestep 0.010 + fix 1 all langevin 1.0 1.0 100.0 702547 fix 2 all nve fix 3 all mol/swap 100 1 1 2 482794 1.0 diff --git a/examples/mc/in.pure b/examples/mc/in.pure old mode 100755 new mode 100644 index a3796c979f..b12d2f7891 --- a/examples/mc/in.pure +++ b/examples/mc/in.pure @@ -13,7 +13,7 @@ neigh_modify delay 0 pair_style lj/cut 1.1224620483 bond_style fene angle_style cosine -special_bonds lj 0.0 1.0 1.0 +special_bonds lj 0.0 1.0 1.0 read_data data.bead @@ -21,7 +21,7 @@ pair_coeff * * 1.0 1.0 1.1224620483 pair_coeff 1 2 1.1 1.0 1.1224620483 bond_coeff 1 30.0 1.5 1.0 1.0 angle_coeff 1 1.500 -pair_modify shift yes +pair_modify shift yes variable vt1 atom type==1 variable vt2 atom type==2 @@ -30,8 +30,8 @@ group g2 dynamic all var vt2 every 100 variable count1 equal count(g1) variable count2 equal count(g2) -timestep 0.010 - +timestep 0.010 + fix 1 all langevin 1.0 1.0 100.0 702547 fix 2 all nve fix 3 all mol/swap 100 1 1 2 482794 1.0 diff --git a/src/MC/fix_mol_swap.cpp b/src/MC/fix_mol_swap.cpp index cd4d9d3cb8..8d7c2bf367 100644 --- a/src/MC/fix_mol_swap.cpp +++ b/src/MC/fix_mol_swap.cpp @@ -40,7 +40,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixMolSwap::FixMolSwap(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) + Fix(lmp, narg, arg), random(nullptr), c_pe(nullptr) { if (narg < 9) error->all(FLERR,"Illegal fix mol/swap command"); @@ -83,7 +83,7 @@ FixMolSwap::FixMolSwap(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix mol/swap atom types are invalid"); if (seed <= 0) error->all(FLERR,"Illegal fix mol/swap command"); if (temperature <= 0.0) error->all(FLERR,"Illegal fix mol/swap command"); - if (ke_flag && atom->rmass) + if (ke_flag && atom->rmass) error->all(FLERR,"Cannot conserve kinetic energy with fix mol/swap " "unless per-type masses"); @@ -211,7 +211,7 @@ void FixMolSwap::init() MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_MAX,world); if (flagall) qflag = 0; - if (!qflag && comm->me == 0) + if (!qflag && comm->me == 0) error->warning(FLERR,"Cannot swap charges in fix mol/swap"); } @@ -277,7 +277,7 @@ int FixMolSwap::attempt_swap() // pick a random molecule // swap properties of all its eligible itype & jtype atoms - tagint molID = + tagint molID = minmol + static_cast (random->uniform() * (maxmol-minmol+1)); if (molID > maxmol) molID = maxmol; diff --git a/src/MC/fix_mol_swap.h b/src/MC/fix_mol_swap.h index 6c91d27b91..3197cbd832 100644 --- a/src/MC/fix_mol_swap.h +++ b/src/MC/fix_mol_swap.h @@ -44,7 +44,7 @@ class FixMolSwap : public Fix { int ke_flag; // 1 if kinetic energy is also swapped double i2j_vscale; // scale factors for velocity to keep KE constant - double j2i_vscale; + double j2i_vscale; int qflag; // 1 if charge is also swapped double iq,jq; // charge values for all itype,jtype atoms