From 456d748b8cbf141e1fe6e82a7c0106f469e28ba6 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 7 May 2019 14:05:32 -0400 Subject: added measurements of spanning cluster sizes and conducting backbone sizes --- src/measurements.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/measurements.cpp b/src/measurements.cpp index 407048d..33056ef 100644 --- a/src/measurements.cpp +++ b/src/measurements.cpp @@ -148,7 +148,9 @@ ma::ma(unsigned n, double a, unsigned Mx, unsigned My, double beta) : sm(2 * n), sa(3 * n), sl(2 * n), - sn(2 * n) + sn(2 * n), + ss(2 * n), + sb(3 * n) { if (beta != 0.0) { model_string = "fracture_" + std::to_string(n) + "_" + std::to_string(a) + "_" + std::to_string(beta) + "_"; @@ -178,6 +180,8 @@ ma::~ma() { update_distribution_file("sa", sa, model_string); update_distribution_file("sl", sl, model_string); update_distribution_file("sn", sn, model_string); + update_distribution_file("ss", ss, model_string); + update_distribution_file("sb", sb, model_string); } void ma::pre_fracture(const network&) { @@ -219,6 +223,8 @@ void ma::post_fracture(network &n) { for (unsigned i = 0; i < num; i++) { if (i != crack_component) { sm[components[i].size() - 1]++; + } else { + ss[components[i].size() - 1]++; } sn[components[i].size() - 1]++; } @@ -228,7 +234,7 @@ void ma::post_fracture(network &n) { while (true) { for (unsigned e : *av_it) { boost::remove_edge(n.G.dual_edges[e].v[0], n.G.dual_edges[e].v[1], G); - n.fuses[e] = false; + n.break_edge(e, true); } auto cracks = find_minimal_crack(G, n); @@ -252,6 +258,18 @@ void ma::post_fracture(network &n) { sc[new_components[i].size() - 1]++; } + current_info ct = n.get_current_info(); + + unsigned conducting_backbone_size = 0; + + for (unsigned i = 0; i < n.G.edges.size(); i++) { + if (ct.currents[i] > 1.0 / n.G.edges.size()) { + conducting_backbone_size++; + } + } + + sb[conducting_backbone_size - 1]++; + av_it++; while (av_it != avalanches.rend()) { -- cgit v1.2.3-70-g09d2