summaryrefslogtreecommitdiff
path: root/soft_spheres.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'soft_spheres.cpp')
-rw-r--r--soft_spheres.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/soft_spheres.cpp b/soft_spheres.cpp
index a71a472..cdd6f31 100644
--- a/soft_spheres.cpp
+++ b/soft_spheres.cpp
@@ -4,7 +4,7 @@ int main(int argc, char* argv[]) {
const unsigned n = 12;
unsigned N = 1200;
- double R = 0.024;
+ double R = 0.023;
double ε = 0.01;
unsigned steps = 1e6;
double β = 1;
@@ -28,16 +28,28 @@ int main(int argc, char* argv[]) {
Δxi = r.variate<double, std::normal_distribution>(0, ε);
}
- m.metropolis(β, s, Δx, r);
+ for (unsigned j = 0; j < N; j++)
+ m.metropolis(β, s, Δx, r);
SoftSphere<2, n>& s1 = r.pick(m.particles);
SoftSphere<2, n>& s2 = r.pick(m.particles);
-
- m.swap(β, s1, s2, r);
- if (i % (N * 3) == 0) {
- draw(m);
- }
+ Vector<2> t1 = s1.x;
+ Vector<2> t2 = s2.x;
+ Vector<2> t = (t1 + t2) / 2;
+
+ Matrix<2> mat;
+
+ mat(0, 0) = -1;
+ mat(1, 1) = -1;
+ mat(0, 1) = 0;
+ mat(1, 0) = 0;
+
+ Euclidean<2> g(t - mat * t, mat);
+
+ std::cout << m.clusterFlip(1, g, s1, r) << std::endl;
+
+ draw(m);
}
return 0;