From 4740abed9fcd40359a9ced3a97ac1b9f56e379a0 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Mon, 20 Jul 2020 13:35:48 -0400 Subject: Thesis work. --- ising_animate.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'ising_animate.cpp') diff --git a/ising_animate.cpp b/ising_animate.cpp index f3ab314..2ea6500 100644 --- a/ising_animate.cpp +++ b/ising_animate.cpp @@ -1,4 +1,5 @@ #include "animation.hpp" +#include #include "ising.hpp" int main(int argc, char* argv[]) { @@ -65,5 +66,27 @@ int main(int argc, char* argv[]) { ising.wolff(T, {g}, A, N); + std::vector> finalState(L); + + for (std::vector& v : finalState) { + v.resize(L); + } + + for (const isingSpin* s: ising.s) { + Vector v = ising.s0.inverse().act(s->x); + finalState[v[0]][v[1]] = s->s; + } + + std::ofstream outfile("ising_snap.dat"); + + for (const std::vector& v : finalState) { + for (int s : v) { + outfile << s << " "; + } + outfile << "\n"; + } + + outfile.close(); + return 0; } -- cgit v1.2.3-54-g00ecf