summaryrefslogtreecommitdiff
path: root/ising_animate.cpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2020-07-20 13:35:48 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2020-07-20 13:35:48 -0400
commit4740abed9fcd40359a9ced3a97ac1b9f56e379a0 (patch)
tree5a49c24fa4421b77c6d8e7def524379233013cc5 /ising_animate.cpp
parent468c25eabd1aaac7d02988fef97b66bb378988b3 (diff)
downloadspace_wolff-master.tar.gz
space_wolff-master.tar.bz2
space_wolff-master.zip
Thesis work.HEADmaster
Diffstat (limited to 'ising_animate.cpp')
-rw-r--r--ising_animate.cpp23
1 files changed, 23 insertions, 0 deletions
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 <fstream>
#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<std::vector<int>> finalState(L);
+
+ for (std::vector<int>& v : finalState) {
+ v.resize(L);
+ }
+
+ for (const isingSpin* s: ising.s) {
+ Vector<int, 2> v = ising.s0.inverse().act(s->x);
+ finalState[v[0]][v[1]] = s->s;
+ }
+
+ std::ofstream outfile("ising_snap.dat");
+
+ for (const std::vector<int>& v : finalState) {
+ for (int s : v) {
+ outfile << s << " ";
+ }
+ outfile << "\n";
+ }
+
+ outfile.close();
+
return 0;
}