| 743 | } |
| 744 | |
| 745 | void fields::log(const char *prefix) { |
| 746 | master_printf("%sFields State:\n", prefix); |
| 747 | master_printf("%s a = %g, dt = %g\n", prefix, a, dt); |
| 748 | master_printf("%s m = %g, beta = %g\n", prefix, m, beta); |
| 749 | master_printf("%s t = %d, phasein_time = %d, is_real = %d\n", prefix, t, phasein_time, is_real); |
| 750 | master_printf("\n"); |
| 751 | master_printf("%s num_chunks = %d (shared=%d)\n", prefix, num_chunks, shared_chunks); |
| 752 | } |
| 753 | |
| 754 | /* implement mirror boundary conditions for i outside 0..n-1: */ |
| 755 | int mirrorindex(int i, int n) { return i >= n ? 2 * n - 1 - i : (i < 0 ? -1 - i : i); } |
no test coverage detected