diff options
Diffstat (limited to 'src/measurements.cpp')
-rw-r--r-- | src/measurements.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/measurements.cpp b/src/measurements.cpp index 969f487..0732d24 100644 --- a/src/measurements.cpp +++ b/src/measurements.cpp @@ -152,7 +152,8 @@ ma::ma(unsigned n, double a, double beta) : sd(3 * n), sc(2 * n), sa(3 * n), - sA(3 * n) + sA(3 * n), + si(10000) { if (beta != 0.0) { model_string = "fracture_" + std::to_string(n) + "_" + std::to_string(a) + "_" + std::to_string(beta) + "_"; @@ -171,7 +172,8 @@ ma::ma(unsigned Lx, unsigned Ly, double beta) : sd(Lx * Ly), sc(Lx * Ly / 2), sa(Lx * Ly), - sA(Lx * Ly) + sA(Lx * Ly), + si(10000) { if (beta != 0.0) { model_string = "fracture_" + std::to_string(Lx) + "_" + std::to_string(Ly) + "_" + std::to_string(beta) + "_"; @@ -190,6 +192,7 @@ ma::~ma() { update_distribution_file("sc", sc, model_string); update_distribution_file("sa", sa, model_string); update_distribution_file("sA", sA, model_string); + update_distribution_file("si", si, model_string); } void ma::pre_fracture(const network&) { @@ -208,6 +211,12 @@ void ma::bond_broken(const network& net, const current_info& cur, unsigned i) { avalanches.back().push_back(i); } + for (unsigned j = 0; j < cur.currents.size(); j++) { + if (logl(cur.currents[j]) >= -100 && logl(cur.currents[j]) < 0) { + si[(unsigned)(10000 * (logl(cur.currents[j]) + 100) / 100)]++; + } + } + boost::add_edge(net.G.dual_edges[i].v[0], net.G.dual_edges[i].v[1], {i}, G); num++; } |