summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2019-06-12 11:10:21 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2019-06-12 11:10:21 -0400
commitb272c3f5e01c4cbbffddc1e75c27f221255236c1 (patch)
tree830837eff8106f907cb211cefa0dca2eca474b8b /src
parentbfb1bb5d9172fea3fd6bd28a4ad388dbdcbe8200 (diff)
downloadfuse_networks-b272c3f5e01c4cbbffddc1e75c27f221255236c1.tar.gz
fuse_networks-b272c3f5e01c4cbbffddc1e75c27f221255236c1.tar.bz2
fuse_networks-b272c3f5e01c4cbbffddc1e75c27f221255236c1.zip
fixed calling a square lattice in the fracture problem
Diffstat (limited to 'src')
-rw-r--r--src/fracture.cpp14
-rw-r--r--src/measurements.cpp2
-rw-r--r--src/measurements.hpp2
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;