From b272c3f5e01c4cbbffddc1e75c27f221255236c1 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Wed, 12 Jun 2019 11:10:21 -0400 Subject: fixed calling a square lattice in the fracture problem --- src/fracture.cpp | 14 +++++++------- src/measurements.cpp | 2 +- src/measurements.hpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/fracture.cpp b/src/fracture.cpp index fb51d3e..7df3f67 100644 --- a/src/fracture.cpp +++ b/src/fracture.cpp @@ -31,8 +31,8 @@ int main(int argc, char* argv[]) { int opt; unsigned N = 1; - double Lx = 16; - double Ly = 16; + unsigned Lx = 16; + unsigned Ly = 16; double beta = 0.5; unsigned n = 128; @@ -45,10 +45,10 @@ int main(int argc, char* argv[]) { N = (unsigned)atof(optarg); break; case 'X': - Lx = atof(optarg); + Lx = atoi(optarg); break; case 'Y': - Ly = atof(optarg); + Ly = atoi(optarg); break; case 'b': beta = atof(optarg); @@ -76,7 +76,7 @@ int main(int argc, char* argv[]) { unsigned Mx = (unsigned)4*sqrt(2*n*a); unsigned My = (unsigned)4*sqrt(2*n/a); - ma meas(n, a, Mx, My, beta); + ma meas(n, a, beta); for (unsigned trial = 0; trial < N; trial++) { while (true) { @@ -99,12 +99,12 @@ int main(int argc, char* argv[]) { unsigned Mx = pow(2, ceil(log2(4*Lx))); unsigned My = pow(2, ceil(log2(4*Ly))); - ma meas(Lx, Ly, Mx, My, beta); + ma meas(Lx, Ly, beta); for (unsigned trial = 0; trial < N; trial++) { while (true) { try { - graph G(Lx, Ly, rng); + graph G(Lx, Ly); elastic_network fuse_network(G, &c); fuse_network.set_thresholds(beta, rng); fuse_network.fracture(meas); diff --git a/src/measurements.cpp b/src/measurements.cpp index eaa34ee..969f487 100644 --- a/src/measurements.cpp +++ b/src/measurements.cpp @@ -142,7 +142,7 @@ unsigned edge_r_to_ind(graph::coordinate r, double Lx, double Ly, unsigned Mx, u return floor((Mx * r.x) / Lx) + Mx * floor((My * r.y) / Ly); } -ma::ma(unsigned n, double a, unsigned Mx, unsigned My, double beta) : +ma::ma(unsigned n, double a, double beta) : G(2 * n), sn(2 * n), ss(2 * n), diff --git a/src/measurements.hpp b/src/measurements.hpp index 51f7080..961ad7a 100644 --- a/src/measurements.hpp +++ b/src/measurements.hpp @@ -42,7 +42,7 @@ class ma : public hooks { std::string model_string; ma(unsigned Lx, unsigned Ly, double beta); - ma(unsigned n, double a, unsigned Mx, unsigned My, double beta); + ma(unsigned n, double a, double beta); ~ma(); void pre_fracture(const network &) override; -- cgit v1.2.3-70-g09d2