summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2019-10-02 11:27:19 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2019-10-02 11:27:19 -0400
commitea1fabde9c6522209bf88b722b64a4bce1248cec (patch)
tree20e11e446b4a6b0828ea510bd8f44a315aef1bef /src
parent2de471524c9e281e1b83049183d5a4deecd8b7b3 (diff)
downloadfuse_networks-ea1fabde9c6522209bf88b722b64a4bce1248cec.tar.gz
fuse_networks-ea1fabde9c6522209bf88b722b64a4bce1248cec.tar.bz2
fuse_networks-ea1fabde9c6522209bf88b722b64a4bce1248cec.zip
fixed square lattice fracture
Diffstat (limited to 'src')
-rw-r--r--src/measurements.cpp26
-rw-r--r--src/measurements.hpp2
2 files changed, 17 insertions, 11 deletions
diff --git a/src/measurements.cpp b/src/measurements.cpp
index 1a937be..8b1c9d6 100644
--- a/src/measurements.cpp
+++ b/src/measurements.cpp
@@ -170,12 +170,14 @@ ma::ma(unsigned n, double a, double beta, double weight)
model_string = "fracture_" + std::to_string(n) + "_" + std::to_string(a) + "_INF_" +
std::to_string(weight) + "_";
}
+ Mx = 2 * sqrt(n) * a;
+ My = 2 * sqrt(n) / a;
}
ma::ma(unsigned Lx, unsigned Ly, double beta, double weight)
: sn(Lx * Ly / 2), ss(Lx * Ly / 2), sm(Lx * Ly / 2), sl(Lx * Ly / 2), sb(Lx * Ly / 2 + 1),
- sd(Lx * Ly), sa(Lx * Ly), sA(Lx * Ly), si(10000), sI(10000), cn(Lx * Ly), cs(Lx * Ly),
- cm(Lx * Ly), cl(Lx * Ly), cb(Lx * Ly), ca(Lx * Ly), cA(Lx * Ly), cp(Lx * Ly), cq(Lx * Ly) {
+ sd(Lx * Ly), sa(Lx * Ly), sA(Lx * Ly), si(10000), sI(10000), cn((Lx / 2 + 1) * (Ly / 2 + 1)), cs((Lx / 2 + 1) * (Ly / 2 + 1)),
+ cm((Lx / 2 + 1) * (Ly / 2 + 1)), cl((Lx / 2 + 1) * (Ly / 2 + 1)), cb((Lx / 2 + 1) * (Ly / 2 + 1)), ca((Lx / 2 + 1) * (Ly / 2 + 1)), cA((Lx / 2 + 1) * (Ly / 2 + 1)), cp((Lx / 2 + 1) * (Ly / 2 + 1)), cq((Lx / 2 + 1) * (Ly / 2 + 1)) {
if (beta != 0.0) {
model_string = "fracture_" + std::to_string(Lx) + "_" + std::to_string(Ly) + "_" +
std::to_string(beta) + "_" + std::to_string(weight) + "_";
@@ -183,6 +185,8 @@ ma::ma(unsigned Lx, unsigned Ly, double beta, double weight)
model_string = "fracture_" + std::to_string(Lx) + "_" + std::to_string(Ly) + "_INF_" +
std::to_string(weight) + "_";
}
+ Mx = Lx;
+ My = Ly;
}
ma::~ma() {
@@ -243,7 +247,7 @@ void ma::post_fracture(network& n) {
for (unsigned e : crack.second) {
cl_cs.push_back(n.G.dual_edges[e].r);
}
- autocorrelation2(n.G.L.x, n.G.L.y, 2 * sqrt(cl.size()), 2 * sqrt(cl.size()), cl, cl_cs,
+ autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cl, cl_cs,
crack.first);
std::vector<std::list<graph::coordinate>> components(n.G.dual_vertices.size());
@@ -258,17 +262,17 @@ void ma::post_fracture(network& n) {
if (components[i].size() > 0) {
if (i != crack_component) {
sm[components[i].size() - 1]++;
- autocorrelation2(n.G.L.x, n.G.L.y, 2 * sqrt(cm.size()), 2 * sqrt(cm.size()), cm,
+ autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cm,
components[i], crack.first);
- autocorrelation2(n.G.L.x, n.G.L.y, 2 * sqrt(cp.size()), 2 * sqrt(cp.size()), cp,
+ autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cp,
components[i], {0, 1});
} else {
ss[components[i].size() - 1]++;
- autocorrelation2(n.G.L.x, n.G.L.y, 2 * sqrt(cs.size()), 2 * sqrt(cs.size()), cs,
+ autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cs,
components[i], crack.first);
}
sn[components[i].size() - 1]++;
- autocorrelation2(n.G.L.x, n.G.L.y, 2 * sqrt(cn.size()), 2 * sqrt(cn.size()), cn,
+ autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cn,
components[i], crack.first);
}
}
@@ -294,7 +298,7 @@ void ma::post_fracture(network& n) {
}
sb[bb_size]++;
- autocorrelation2(n.G.L.x, n.G.L.y, 2 * sqrt(cb.size()), 2 * sqrt(cb.size()), cb, cb_co,
+ autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cb, cb_co,
crack.first);
auto av_it = avalanches.rbegin();
@@ -306,9 +310,9 @@ void ma::post_fracture(network& n) {
for (unsigned e : (*av_it)) {
ca_co.push_back(n.G.edges[e].r);
}
- autocorrelation2(n.G.L.x, n.G.L.y, 2 * sqrt(ca.size()), 2 * sqrt(ca.size()), ca, ca_co,
+ autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, ca, ca_co,
crack.first);
- autocorrelation2(n.G.L.x, n.G.L.y, 2 * sqrt(cq.size()), 2 * sqrt(cq.size()), cq, ca_co, {0, 1});
+ autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cq, ca_co, {0, 1});
av_it++;
}
@@ -317,7 +321,7 @@ void ma::post_fracture(network& n) {
for (unsigned e : avalanches.back()) {
cA_co.push_back(n.G.edges[e].r);
}
- autocorrelation2(n.G.L.x, n.G.L.y, 2 * sqrt(cA.size()), 2 * sqrt(cA.size()), cA, cA_co,
+ autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cA, cA_co,
crack.first);
sd[num - 1]++;
diff --git a/src/measurements.hpp b/src/measurements.hpp
index 4fbd9fc..135f312 100644
--- a/src/measurements.hpp
+++ b/src/measurements.hpp
@@ -17,6 +17,8 @@ class ma : public hooks {
// - interface for turning on and off specific measurements
//
private:
+ unsigned Mx;
+ unsigned My;
unsigned num;
// measurement storage