From e4e9fe66f237b0f3091c7d433876997c97844cf2 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 19 Nov 2019 22:35:16 -0500 Subject: some work --- src/measurements.cpp | 42 ++---------------------------------------- src/measurements.hpp | 2 -- 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/src/measurements.cpp b/src/measurements.cpp index 446d29c..15658d2 100644 --- a/src/measurements.cpp +++ b/src/measurements.cpp @@ -171,7 +171,7 @@ ma::ma(unsigned n, double a, double beta, double weight) cm(pow(1 + 2 * (unsigned)ceil(sqrt(n)), 2)), cl(pow(1 + 2 * (unsigned)ceil(sqrt(n)), 2)), cb(pow(1 + 2 * (unsigned)ceil(sqrt(n)), 2)), ca(pow(1 + 2 * (unsigned)ceil(sqrt(n)), 2)), cA(pow(1 + 2 * (unsigned)ceil(sqrt(n)), 2)), cq(pow(1 + 2 * (unsigned)ceil(sqrt(n)), 2)), - cS(pow(4 * (unsigned)ceil(sqrt(n)), 2) / 2), NS(pow(4 * (unsigned)ceil(sqrt(n)), 2) / 2), cT(pow(4 * (unsigned)ceil(sqrt(n)), 2) / 2), NT(pow(4 * (unsigned)ceil(sqrt(n)), 2) / 2),last_clusters(2 * n) { + cS(pow(4 * (unsigned)ceil(sqrt(n)), 2) / 2), NS(pow(4 * (unsigned)ceil(sqrt(n)), 2) / 2), last_clusters(2 * n) { if (beta != 0.0) { model_string = "fracture_" + std::to_string(n) + "_" + std::to_string(a) + "_" + std::to_string(beta) + "_" + std::to_string(weight) + "_"; @@ -199,7 +199,7 @@ ma::ma(unsigned Lx, unsigned Ly, double beta, double weight) 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)), - cq((Lx / 2 + 1) * (Ly / 2 + 1)), cS(Lx * Ly / 2), NS(Lx * Ly / 2), cT(Lx * Ly / 2), NT(Lx * Ly / 2), last_clusters(Lx * Ly / 2) { + cq((Lx / 2 + 1) * (Ly / 2 + 1)), cS(Lx * Ly / 2), NS(Lx * Ly / 2), last_clusters(Lx * Ly / 2) { if (beta != 0.0) { model_string = "fracture_" + std::to_string(Lx) + "_" + std::to_string(Ly) + "_" + std::to_string(beta) + "_" + std::to_string(weight) + "_"; @@ -244,8 +244,6 @@ ma::~ma() { update_field_file("cq", Nq, cq, model_string); update_field_file("cS", 0, cS, model_string); update_field_file("NS", 0, NS, model_string); - update_field_file("cT", 0, cT, model_string); - update_field_file("NT", 0, NT, model_string); } void ma::pre_fracture(const network&) { @@ -533,42 +531,6 @@ void ma::post_fracture(network& n) { sp[0]++; } - for (unsigned i = 0; i < n.G.dual_edges.size(); i++) { - if (!last_backbone[i]) { - for (unsigned j = 0; j < n.G.dual_edges.size(); j++) { - if (!last_backbone[j]) { - double Δx_tmpl, Δy_tmpl, Δx_tmpr, Δy_tmpr, Δxr, Δxl, Δyr, Δyl; - - if (crack.first[0] % 2 == 1) { - Δx_tmpl = fabs(n.G.dual_edges[j].r.x - n.G.dual_edges[i].r.x); - Δxl = Δx_tmpl > n.G.L.x / 2 ? n.G.L.x - Δx_tmpl : Δx_tmpl; - - Δy_tmpl = fabs(n.G.dual_edges[j].r.y - n.G.dual_edges[i].r.y); - Δyl = Δy_tmpl > n.G.L.y / 2 ? n.G.L.y - Δy_tmpl : Δy_tmpl; - } else { - Δx_tmpl = fabs(n.G.dual_edges[j].r.y - n.G.dual_edges[i].r.y); - Δxl = Δx_tmpl > n.G.L.y / 2 ? n.G.L.y - Δx_tmpl : Δx_tmpl; - - Δy_tmpl = fabs(n.G.dual_edges[j].r.x - n.G.dual_edges[i].r.x); - Δyl = Δy_tmpl > n.G.L.x / 2 ? n.G.L.x - Δy_tmpl : Δy_tmpl; - - } - - cS[(unsigned)floor(Mx * (Δyl / n.G.L.y)) + - (Mx / 2) * (unsigned)floor(My * (Δxl / n.G.L.x))] += - last_currents.currents[i] / last_currents.conductivity[crack.first[0] % 2]; - NS[(unsigned)floor(Mx * (Δyl / n.G.L.y)) + - (Mx / 2) * (unsigned)floor(My * (Δxl / n.G.L.x))]++; - NS[(unsigned)floor(Mx * (Δyr / n.G.L.y)) + - (Mx / 2) * (unsigned)floor(My * (Δxr / n.G.L.x))]++; - cS[(unsigned)floor(Mx * (Δyr / n.G.L.y)) + - (Mx / 2) * (unsigned)floor(My * (Δxr / n.G.L.x))] += - last_currents.currents[i] / last_currents.conductivity[crack.first[0] % 2]; - } - } - } - } - aG.push_back(last_currents.conductivity); } diff --git a/src/measurements.hpp b/src/measurements.hpp index 0786cf8..7bc8137 100644 --- a/src/measurements.hpp +++ b/src/measurements.hpp @@ -57,8 +57,6 @@ class ma : public hooks { std::list> aG; std::vector cS; std::vector NS; - std::vector cT; - std::vector NT; std::vector sp; ClusterTree last_clusters; -- cgit v1.2.3-54-g00ecf