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

Make max/min prevent moves already outside the bounds

Previously allowed free movement outside the bounds until they were reached.
Now forces movement towards the bounds
parent a75f8433
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -269,7 +269,7 @@ void FixGCMC::options(int narg, char **arg)
  overlap_cutoffsq = 0.0;
  overlap_flag = 0;
  min_ngas = -1;
  max_ngas = -1;
  max_ngas = INT_MAX;

  int iarg = 0;
  while (iarg < narg) {
@@ -903,7 +903,7 @@ void FixGCMC::attempt_atomic_deletion()
{
  ndeletion_attempts += 1.0;

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

  int i = pick_random_gas_atom();

@@ -944,7 +944,7 @@ void FixGCMC::attempt_atomic_insertion()

  ninsertion_attempts += 1.0;

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

@@ -1260,7 +1260,7 @@ void FixGCMC::attempt_molecule_deletion()
{
  ndeletion_attempts += 1.0;

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

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

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

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

  ndeletion_attempts += 1.0;

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

  double energy_before = energy_stored;

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

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

@@ -1930,7 +1930,7 @@ void FixGCMC::attempt_molecule_deletion_full()
{
  ndeletion_attempts += 1.0;

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

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

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

  if (ngas == max_ngas) return;
  if (ngas >= max_ngas) return;

  double energy_before = energy_stored;