Commit a75f8433 authored by Jared Wood's avatar Jared Wood
Browse files

Merge branch 'stable' of gitlab.com:jared.wood13/lammps into stable

parents d08d6b5f 475e8875
Loading
Loading
Loading
Loading
+22 −4
Original line number Diff line number Diff line
@@ -268,6 +268,8 @@ void FixGCMC::options(int narg, char **arg)
  tfac_insert = 1.0;
  overlap_cutoffsq = 0.0;
  overlap_flag = 0;
  min_ngas = -1;
  max_ngas = -1;

  int iarg = 0;
  while (iarg < narg) {
@@ -387,6 +389,14 @@ void FixGCMC::options(int narg, char **arg)
      overlap_cutoffsq = rtmp*rtmp;
      overlap_flag = 1;
      iarg += 2;
    } else if (strcmp(arg[iarg],"min") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command");
      min_ngas = force->numeric(FLERR,arg[iarg+1]);
      iarg += 2;
    } else if (strcmp(arg[iarg],"max") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command");
      max_ngas = force->numeric(FLERR,arg[iarg+1]);
      iarg += 2;
    } else error->all(FLERR,"Illegal fix gcmc command");
  }
}
@@ -893,7 +903,7 @@ void FixGCMC::attempt_atomic_deletion()
{
  ndeletion_attempts += 1.0;

  if (ngas == 0) return;
  if (ngas == 0 || ngas == min_ngas) return;

  int i = pick_random_gas_atom();

@@ -934,6 +944,8 @@ void FixGCMC::attempt_atomic_insertion()

  ninsertion_attempts += 1.0;

  if (ngas == max_ngas) return;
  
  // pick coordinates for insertion point

  double coord[3];
@@ -1248,7 +1260,7 @@ void FixGCMC::attempt_molecule_deletion()
{
  ndeletion_attempts += 1.0;

  if (ngas == 0) return;
  if (ngas == 0 || ngas == min_ngas) return;

  // work-around to avoid n=0 problem with fix rigid/nvt/small

@@ -1287,6 +1299,8 @@ void FixGCMC::attempt_molecule_insertion()
  double lamda[3];
  ninsertion_attempts += 1.0;

  if (ngas == max_ngas) return;
  
  double com_coord[3];
  if (regionflag) {
    int region_attempt = 0;
@@ -1570,7 +1584,7 @@ void FixGCMC::attempt_atomic_deletion_full()

  ndeletion_attempts += 1.0;

  if (ngas == 0) return;
  if (ngas == 0 || ngas == min_ngas) return;

  double energy_before = energy_stored;

@@ -1619,6 +1633,8 @@ void FixGCMC::attempt_atomic_insertion_full()
  double lamda[3];
  ninsertion_attempts += 1.0;

  if (ngas == max_ngas) return;
  
  double energy_before = energy_stored;

  double coord[3];
@@ -1914,7 +1930,7 @@ void FixGCMC::attempt_molecule_deletion_full()
{
  ndeletion_attempts += 1.0;

  if (ngas == 0) return;
  if (ngas == 0 || ngas == min_ngas) return;

  // work-around to avoid n=0 problem with fix rigid/nvt/small

@@ -1997,6 +2013,8 @@ void FixGCMC::attempt_molecule_insertion_full()
  double lamda[3];
  ninsertion_attempts += 1.0;

  if (ngas == max_ngas) return;

  double energy_before = energy_stored;

  tagint maxmol = 0;
+2 −0
Original line number Diff line number Diff line
@@ -119,6 +119,8 @@ class FixGCMC : public Fix {
  imageint imagezero;
  double overlap_cutoffsq; // square distance cutoff for overlap
  int overlap_flag;
  int max_ngas;
  int min_ngas;

  double energy_intra;