summaryrefslogtreecommitdiff
path: root/src/fracture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fracture.cpp')
-rw-r--r--src/fracture.cpp21
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';