diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-02-26 09:14:04 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-02-26 09:14:04 -0500 |
commit | 468c25eabd1aaac7d02988fef97b66bb378988b3 (patch) | |
tree | 9e457e7f68af65729b32354584423153c8799164 /spheres_infinite.cpp | |
parent | 6461165f4daea01c5baa1d969ee5c726fb4c559e (diff) | |
download | space_wolff-468c25eabd1aaac7d02988fef97b66bb378988b3.tar.gz space_wolff-468c25eabd1aaac7d02988fef97b66bb378988b3.tar.bz2 space_wolff-468c25eabd1aaac7d02988fef97b66bb378988b3.zip |
More cleanup and temperary saving routines for presentation
Diffstat (limited to 'spheres_infinite.cpp')
-rw-r--r-- | spheres_infinite.cpp | 57 |
1 files changed, 45 insertions, 12 deletions
diff --git a/spheres_infinite.cpp b/spheres_infinite.cpp index af91427..3fd6da2 100644 --- a/spheres_infinite.cpp +++ b/spheres_infinite.cpp @@ -10,6 +10,46 @@ const unsigned D = 2; typedef Model<double, D, Euclidean<double, D>, double> model; +class SaveFlip : public measurement<double, D, Euclidean<double, D>, Radius> { + std::ofstream snapfile; + unsigned n; + + public: + SaveFlip() {} + + void pre_cluster(const Model<double, D, Euclidean<double, D>, Radius>& m, unsigned, + const Transformation<double, D, Euclidean<double, D>, Radius>* t) override { + snapfile.open("sphere_flip.dat"); + n = 0; + for (const Sphere<D>* s : m.s) { + snapfile << s << " " << s->s << " " << s->x.transpose() << " "; + } + snapfile << "\n"; + } + + void plain_site_transformed(const Model<double, D, Euclidean<double, D>, Radius>& m, + const Transformation<double, D, Euclidean<double, D>, Radius>& t) override { + for (const Sphere<D>* s : t.current()) { + snapfile << s << " "; + } + snapfile << "\n"; + n++; + } + + void post_cluster(const Model<double, D, Euclidean<double, D>, Radius>& m) override { + for (const Sphere<D>* s : m.s) { + snapfile << s << " " << s->s << " " << s->x.transpose() << " "; + } + snapfile << "\n"; + snapfile.close(); + std::cout << n << "\n"; + if (2 < n && n < 20) { + getchar(); + } + } + +}; + int main(int argc, char* argv[]) { const unsigned D = 2; @@ -65,7 +105,7 @@ int main(int argc, char* argv[]) { }; auto g1 = nudgeGen<D, Radius>(1); - auto g2 = swapGen<D, Radius>(0.1); + auto g2 = swapGen<D, Radius>(0.01); auto g3 = accrossGen<D, Radius>(0.1); auto g4 = centerGen<D, Radius>(0); @@ -93,20 +133,13 @@ int main(int argc, char* argv[]) { sphere.dict.insert(ss); } - sphere.wolff(T, {g1, g2, g3, g4}, A, N); - - file.close(); + measurement<double, D, Euclidean<double, D>, Radius> A_tmp; - std::ofstream snapfile; - snapfile.open("sphere_snap.dat"); + sphere.wolff(T, {g1, g2, g3, g4}, A_tmp, N); - for (Spin<double, D, double>* s : sphere.s) { - Spin<double, D, double> rs = sphere.s0.inverse().act(*s); - snapfile << rs.s << " " << rs.x.transpose() << "\n"; - delete s; - } + SaveFlip A_new; + sphere.wolff(T, {g2}, A_new, 10000); - snapfile.close(); return 0; } |