From 737c083a4f3f4aef9ce9a806803ebbbf698bb467 Mon Sep 17 00:00:00 2001 From: athomps Date: Thu, 25 Feb 2016 23:12:38 +0000 Subject: [PATCH] Enabled triclinic cells git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14678 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/MC/fix_gcmc.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 35ec836ccc..da8b5bc974 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -645,8 +645,8 @@ void FixGCMC::pre_exchange() if (random_equal->uniform() < 0.5) attempt_molecule_translation_full(); else attempt_molecule_rotation_full(); } else { - if (random_equal->uniform() < 0.5) attempt_molecule_deletion_full(); - else attempt_molecule_insertion_full(); + if (random_equal->uniform() < 0.5) attempt_molecule_deletion_full(); + else attempt_molecule_insertion_full(); } } } else { @@ -656,8 +656,8 @@ void FixGCMC::pre_exchange() if (random_int_fraction <= nmcmoves) { attempt_atomic_translation_full(); } else { - if (random_equal->uniform() < 0.5) attempt_atomic_deletion_full(); - else attempt_atomic_insertion_full(); + if (random_equal->uniform() < 0.5) attempt_atomic_deletion_full(); + else attempt_atomic_insertion_full(); } } } @@ -679,7 +679,7 @@ void FixGCMC::pre_exchange() else attempt_molecule_rotation(); } else { if (random_equal->uniform() < 0.5) attempt_molecule_deletion(); - else attempt_molecule_insertion(); + else attempt_molecule_insertion(); } } } else { @@ -689,8 +689,8 @@ void FixGCMC::pre_exchange() if (random_int_fraction <= nmcmoves) { attempt_atomic_translation(); } else { - if (random_equal->uniform() < 0.5) attempt_atomic_deletion(); - else attempt_atomic_insertion(); + if (random_equal->uniform() < 0.5) attempt_atomic_deletion(); + else attempt_atomic_insertion(); } } } @@ -799,7 +799,9 @@ void FixGCMC::attempt_atomic_deletion() if (atom->map_style) atom->map_init(); } atom->nghost = 0; + if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); ndeletion_successes += 1.0; } @@ -906,7 +908,9 @@ void FixGCMC::attempt_atomic_insertion() if (atom->map_style) atom->map_init(); } atom->nghost = 0; + if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); ninsertion_successes += 1.0; } @@ -1132,7 +1136,9 @@ void FixGCMC::attempt_molecule_deletion() atom->natoms -= natoms_per_molecule; if (atom->map_style) atom->map_init(); atom->nghost = 0; + if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); ndeletion_successes += 1.0; } @@ -1315,7 +1321,9 @@ void FixGCMC::attempt_molecule_insertion() atom->nimpropers += onemols[imol]->nimpropers; if (atom->map_style) atom->map_init(); atom->nghost = 0; + if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); update_gas_atoms_list(); ninsertion_successes += 1.0; } @@ -1541,7 +1549,9 @@ void FixGCMC::attempt_atomic_insertion_full() if (atom->map_style) atom->map_init(); } atom->nghost = 0; + if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); if (force->kspace) force->kspace->qsum_qsq(); double energy_after = energy_full(); @@ -1964,7 +1974,9 @@ void FixGCMC::attempt_molecule_insertion_full() atom->nimpropers += onemols[imol]->nimpropers; if (atom->map_style) atom->map_init(); atom->nghost = 0; + if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); if (force->kspace) force->kspace->qsum_qsq(); double energy_after = energy_full();