diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-11-14 19:29:03 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-11-14 19:29:03 -0500 |
commit | ab2e85e008cb4e00aea81fa57e0887e3f5a7f465 (patch) | |
tree | 56a1219f93ca9679ff03705323deea73240eb707 /src | |
parent | 386856afbb6ca347221c13cd606e25b204317929 (diff) | |
download | fuse_networks-ab2e85e008cb4e00aea81fa57e0887e3f5a7f465.tar.gz fuse_networks-ab2e85e008cb4e00aea81fa57e0887e3f5a7f465.tar.bz2 fuse_networks-ab2e85e008cb4e00aea81fa57e0887e3f5a7f465.zip |
fixed avalanche size measurement
Diffstat (limited to 'src')
-rw-r--r-- | src/measurements.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/measurements.cpp b/src/measurements.cpp index ed96855..cc4188a 100644 --- a/src/measurements.cpp +++ b/src/measurements.cpp @@ -265,8 +265,8 @@ ma::~ma() { fftw_destroy_plan(reverse_plan); fftw_cleanup(); - update_distribution_file("sa", sa, N, L, beta); - update_distribution_file("sc", sc, N, L, beta); + update_distribution_file("sa", sa, Na, L, beta); + update_distribution_file("sc", sc, Nc, L, beta); update_distribution_file("sd", sd, N, L, beta); update_distribution_file("sb", sb, N, L, beta); @@ -287,8 +287,8 @@ void ma::pre_fracture(const network &) { void ma::bond_broken(const network& net, const current_info& cur, unsigned int i) { double c = cur.conductivity / fabs(cur.currents[i]) * net.thresholds[i]; - if (c > lv) { - sa[avalanches.back().size()]++; + if (c > lv && avalanches.back().size() > 0) { + sa[avalanches.back().size() - 1]++; Na++; memset(fftw_forward_in, 0.0, net.G.edges.size()); |