summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/measurements.cpp8
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());