summaryrefslogtreecommitdiff
path: root/spheres.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'spheres.cpp')
-rw-r--r--spheres.cpp46
1 files changed, 37 insertions, 9 deletions
diff --git a/spheres.cpp b/spheres.cpp
index 4b2237d..8165403 100644
--- a/spheres.cpp
+++ b/spheres.cpp
@@ -3,6 +3,7 @@
#include <fstream>
#include <iostream>
+#include "title.hpp"
#include "space_wolff.hpp"
#include "torus_symmetries.hpp"
#include "animation.hpp"
@@ -10,6 +11,12 @@
const unsigned D = 2;
typedef Model<double, D, TorusGroup<double, D>, Radius> model;
+std::function<double(const Spin<double, D, double>&)> sphereTitle(double L, double H) {
+ return [L, H](const Spin<double, D, double>& s) -> double {
+ return 1e8 * critical[(320+(511 - unsigned(s.x(1) * 512 / L))) % 512][unsigned(s.x(0) * 512 / L)] + H * s.x(1);
+ };
+}
+
int main(int argc, char* argv[]) {
const unsigned D = 2;
@@ -18,10 +25,14 @@ int main(int argc, char* argv[]) {
double T = 2.0 / log(1.0 + sqrt(2.0));
double H = 1.0;
unsigned n = 25;
+ double ε = 0.1;
+
+ double k = 1e8;
+ double a = 0.0;
int opt;
- while ((opt = getopt(argc, argv, "n:N:L:T:H:")) != -1) {
+ while ((opt = getopt(argc, argv, "n:N:L:T:H:e:k:a:")) != -1) {
switch (opt) {
case 'n':
n = (unsigned)atof(optarg);
@@ -38,14 +49,20 @@ int main(int argc, char* argv[]) {
case 'H':
H = atof(optarg);
break;
+ case 'e':
+ ε = atof(optarg);
+ break;
+ case 'k':
+ k = atof(optarg);
+ break;
+ case 'a':
+ a = atof(optarg);
+ break;
default:
exit(1);
}
}
- double k = 1e8;
- double a = 0.0;
-
std::function<double(const Spin<double, D, double>&, const Spin<double, D, double>&)> Z =
[L, a, k](const Spin<double, D, double>& s1, const Spin<double, D, double>& s2) -> double {
Vector<double, D> d = diff(L, s1.x, s2.x);
@@ -62,14 +79,17 @@ int main(int argc, char* argv[]) {
}
};
+ /*
std::function<double(Spin<double, D, double>)> B = [L, H](Spin<double, D, double> s) -> double {
return H * s.x(1);
};
+ */
- auto g = uniformGenTorus<D, Radius>(L);
- std::ofstream ofile("test.dat");
- Animation<double, D, TorusGroup<double, D>, Radius> A(L, 750, argc, argv, 1000, true);
- model sphere(L, Z, B);
+ auto g1 = rotateSwapTorus<D, Radius>(L, ε);
+ auto g2 = nudgeGenTorus<D, Radius>(L, ε);
+ auto g3 = uniformGenTorus<D, Radius>(L);
+ Animation<double, D, TorusGroup<double, D>, Radius> A(L, 750, argc, argv, 1e7, true);
+ model sphere(L, Z, sphereTitle(L, H));
randutils::mt19937_rng rng;
@@ -84,7 +104,15 @@ int main(int argc, char* argv[]) {
sphere.dict.insert(ss);
}
- sphere.wolff(T, {g}, A, N);
+ sphere.wolff(T, {g1, g2, g3}, A, N);
+
+ std::ofstream ofile("sphere_snap.dat");
+
+ for (const Spin<double, 2, double>* ss : sphere.s) {
+ Vector<double, 2> sx = sphere.s0.inverse().act(ss->x);
+ ofile << ss->s << " " << sx(0) << " " << sx(1) << "\n";
+ }
+
ofile.close();
return 0;