summaryrefslogtreecommitdiff
path: root/lib/wolff.h
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-09 14:29:16 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-09 14:29:16 -0400
commit88086fc222e1802d2a68edf5f1097cf9685ec42c (patch)
tree46a6830da96fa213ac93c6a952af9f9cb9f403b3 /lib/wolff.h
parent466812e61e2ccec7750c791835111b402938411c (diff)
downloadc++-88086fc222e1802d2a68edf5f1097cf9685ec42c.tar.gz
c++-88086fc222e1802d2a68edf5f1097cf9685ec42c.tar.bz2
c++-88086fc222e1802d2a68edf5f1097cf9685ec42c.zip
removed some references to the specific form of the magnetization for vector models from wolff.h
Diffstat (limited to 'lib/wolff.h')
-rw-r--r--lib/wolff.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/wolff.h b/lib/wolff.h
index 81830ee..caf413b 100644
--- a/lib/wolff.h
+++ b/lib/wolff.h
@@ -40,7 +40,7 @@ void wolff(count_t N, D_t D, L_t L, double T, std::function <double(X_t, X_t)> J
if (!silent) printf("\n");
for (count_t steps = 0; steps < N; steps++) {
- if (!silent) printf("\033[F\033[JWOLFF: sweep %" PRIu64 " / %" PRIu64 ": E = %.2f, M_0 = %.2f, S = %" PRIv "\n", steps, N, s.E, s.M.x[0], cluster_size);
+ if (!silent) printf("\033[F\033[JWOLFF: sweep %" PRIu64 " / %" PRIu64 ": E = %.2f, S = %" PRIv "\n", steps, N, s.E, cluster_size);
v_t v0 = gsl_rng_uniform_int(r, s.nv);
@@ -51,15 +51,18 @@ void wolff(count_t N, D_t D, L_t L, double T, std::function <double(X_t, X_t)> J
free_spin(step);
- fwrite(&(s.E), sizeof(double), 1, outfile_E);
- fwrite(s.M.x, sizeof(double), 2, outfile_M);
+ {
+ float smaller_E = (float)s.E;
+ fwrite(&smaller_E, sizeof(float), 1, outfile_E);
+ }
+ write_magnetization(s.M, outfile_M);
fwrite(&cluster_size, sizeof(uint32_t), 1, outfile_S);
}
if (!silent) {
printf("\033[F\033[J");
}
- printf("WOLFF: sweep %" PRIu64 " / %" PRIu64 ": E = %.2f, M_0 = %.2f, S = %" PRIv "\n", N, N, s.E, s.M.x[0], cluster_size);
+ printf("WOLFF: sweep %" PRIu64 " / %" PRIu64 ": E = %.2f, S = %" PRIv "\n", N, N, s.E, cluster_size);
fclose(outfile_M);
fclose(outfile_E);