diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2019-06-29 23:54:37 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2019-06-29 23:54:37 -0400 |
commit | 492419f0ae1b32c1d4bc60997ca8eb7daba22182 (patch) | |
tree | 9b6d60d10cf7f3ae22cbb8cf2f4d233b71eff501 /src/fracture.cpp | |
parent | 948f90b6493da83d10e18f30b0fbb8e937e29c0b (diff) | |
download | fuse_networks-492419f0ae1b32c1d4bc60997ca8eb7daba22182.tar.gz fuse_networks-492419f0ae1b32c1d4bc60997ca8eb7daba22182.tar.bz2 fuse_networks-492419f0ae1b32c1d4bc60997ca8eb7daba22182.zip |
more fixes, and updating the interface
Diffstat (limited to 'src/fracture.cpp')
-rw-r--r-- | src/fracture.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/fracture.cpp b/src/fracture.cpp index 483a3d2..5ba60e2 100644 --- a/src/fracture.cpp +++ b/src/fracture.cpp @@ -38,9 +38,10 @@ int main(int argc, char* argv[]) { unsigned n = 128; double a = 1.0; bool use_aN = false; + bool one_side = false; double w = 0.5; - while ((opt = getopt(argc, argv, "N:X:Y:b:n:a:w:")) != -1) { + while ((opt = getopt(argc, argv, "N:X:Y:b:n:a:w:o")) != -1) { switch (opt) { case 'N': N = (unsigned)atof(optarg); @@ -65,6 +66,9 @@ int main(int argc, char* argv[]) { case 'w': w = atof(optarg); break; + case 'o': + one_side = true; + break; default: exit(1); } @@ -77,10 +81,7 @@ int main(int argc, char* argv[]) { std::mt19937 rng{seeds}; if (use_aN) { - unsigned Mx = (unsigned)4*sqrt(2*n*a); - unsigned My = (unsigned)4*sqrt(2*n/a); - - ma meas(n, a, beta); + ma meas(n, a, beta, w, one_side); for (unsigned trial = 0; trial < N; trial++) { while (true) { @@ -88,7 +89,7 @@ int main(int argc, char* argv[]) { graph G(n, a, rng); elastic_network fuse_network(G, &c, w); fuse_network.set_thresholds(beta, rng); - fuse_network.fracture(meas, false); + fuse_network.fracture(meas, one_side); break; } catch (std::exception &e) { std::cout << e.what() << '\n'; @@ -99,11 +100,7 @@ int main(int argc, char* argv[]) { break; } } else { - // fourier transforms of powers of two are faster - unsigned Mx = pow(2, ceil(log2(4*Lx))); - unsigned My = pow(2, ceil(log2(4*Ly))); - - ma meas(Lx, Ly, beta); + ma meas(Lx, Ly, beta, w, one_side); for (unsigned trial = 0; trial < N; trial++) { while (true) { @@ -111,7 +108,7 @@ int main(int argc, char* argv[]) { graph G(Lx, Ly); elastic_network fuse_network(G, &c, w); fuse_network.set_thresholds(beta, rng); - fuse_network.fracture(meas, false); + fuse_network.fracture(meas, one_side); break; } catch (std::exception &e) { std::cout << e.what() << '\n'; |