diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-02-14 17:04:17 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-02-14 17:04:17 -0500 |
commit | 9437ed889390e04a1e693a5dfa5290cd90ae150e (patch) | |
tree | a930ae46b30a340f1782394530ea3466abfe3f81 /space_wolff.hpp | |
parent | 452600249b16eb1239931b49f3d0fa795a611f5a (diff) | |
download | space_wolff-9437ed889390e04a1e693a5dfa5290cd90ae150e.tar.gz space_wolff-9437ed889390e04a1e693a5dfa5290cd90ae150e.tar.bz2 space_wolff-9437ed889390e04a1e693a5dfa5290cd90ae150e.zip |
Dynamic pairing method appears to be working with spheres, needs to be cleaned up and ising code needs to be updated with new transformation interfaces
Diffstat (limited to 'space_wolff.hpp')
-rw-r--r-- | space_wolff.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/space_wolff.hpp b/space_wolff.hpp index 141396a..63bf118 100644 --- a/space_wolff.hpp +++ b/space_wolff.hpp @@ -50,19 +50,23 @@ public: queue.push(t0); std::set<Spin<U, D, S>*> visited; + std::set<Spin<U, D, S>*> fused; while (!queue.empty()) { Transformation<U, D, R, S>* t = queue.front(); queue.pop(); std::set<Spin<U, D, S>*> c = t->current(); - if (!std::any_of(c.begin(), c.end(), [&visited](Spin<U, D, S>* s) { return visited.contains(s); })) { + if (!std::any_of(c.begin(), c.end(), [&visited](Spin<U, D, S>* s) { return visited.contains(s); }) && !(c.size() == 1 && std::any_of(c.begin(), c.end(), [&fused](Spin<U, D, S>* s) { return fused.contains(s); }))) { visited.insert(c.begin(), c.end()); + fused.insert(c.begin(), c.end()); for (Spin<U, D, S>* s : t->toConsider()) { + if (!fused.contains(s)) { double ΔE = t->ΔE(s); if (ΔE > 0 && 1.0 - exp(-ΔE / T) > rng.uniform<double>(0, 1)) { - queue.push(t->createNew(T, visited, s, rng)); + queue.push(t->createNew(T, fused, s, rng)); + } } } |