From 614575bb88a2cadc9e35b684d0f1712de822ef0d Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 14 Jan 2020 18:00:07 -0500 Subject: generalized code somewhat to accomodate simulation of infinite space, sample central field sim --- spheres.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'spheres.cpp') diff --git a/spheres.cpp b/spheres.cpp index f3dde42..97c1e18 100644 --- a/spheres.cpp +++ b/spheres.cpp @@ -3,9 +3,9 @@ #include const unsigned D = 2; -typedef Model, double> model; +typedef Model, double> model; -class animation : public measurement, double> { +class animation : public measurement, double> { private: uint64_t t1; uint64_t t2; @@ -27,7 +27,7 @@ class animation : public measurement, double> { gluOrtho2D(-1, L + 1, -1 , L + 1); } - void pre_cluster(const model&, unsigned, const Euclidean&) override { + void pre_cluster(const model&, unsigned, const TorusGroup&) override { tmp = 0; } @@ -65,8 +65,8 @@ class animation : public measurement, double> { } }; -std::function(const model&, randutils::mt19937_rng&)> eGen(const std::vector>& mats, const std::vector>& vecs, double ε, double L) { - return [&mats, &vecs, L, ε] (const model& M, randutils::mt19937_rng& rng) -> Euclidean { +std::function(const model&, randutils::mt19937_rng&)> eGen(const std::vector>& mats, const std::vector>& vecs, double ε, double L) { + return [&mats, &vecs, L, ε] (const model& M, randutils::mt19937_rng& rng) -> TorusGroup { Vector t; Matrix m; unsigned flip = rng.uniform((unsigned)0, (unsigned)(mats.size() + vecs.size() - 1)); @@ -91,7 +91,7 @@ std::function(const model&, randutils::mt19937_rng&)> eGen( t = vecs[flip - mats.size()]; } - Euclidean g(M.L, t, m); + TorusGroup g(M.L, t, m); return g; }; @@ -130,8 +130,8 @@ int main(int argc, char* argv[]) { } } - double k = 100.0; - double a = 0.2; + double k = 1e2; + double a = 0.05; std::function&, const Spin&)> Z = [L, a, k] (const Spin& s1, const Spin& s2) -> double { @@ -158,7 +158,7 @@ int main(int argc, char* argv[]) { std::vector> vecs = torus_vecs(L); auto g = eGen(mats, vecs, L, L); animation A(L, 750, argc, argv); - model sphere(L, Z, B, std::floor(log2(L)), 2); + model sphere(L, Z, B); randutils::mt19937_rng rng; -- cgit v1.2.3-70-g09d2