summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/measurements.cpp11
-rw-r--r--src/measurements.hpp3
2 files changed, 13 insertions, 1 deletions
diff --git a/src/measurements.cpp b/src/measurements.cpp
index 368902a..81b13a2 100644
--- a/src/measurements.cpp
+++ b/src/measurements.cpp
@@ -120,9 +120,11 @@ ma::ma(double Lx, double Ly, unsigned Mx, unsigned My, double beta, unsigned Ncu
Lx(Lx), Ly(Ly), Mx(Mx), My(My), beta(beta), G(2 * (unsigned)ceil(Lx * Ly / 2)),
sc(2 * (unsigned)ceil(Lx * Ly / 2), 0),
sa(2 * (unsigned)ceil(Lx * Ly / 2), 0),
+ ss(2 * (unsigned)ceil(Lx * Ly / 2), 0),
sC(2 * (unsigned)ceil(Lx * Ly / 2), 0),
sA(2 * (unsigned)ceil(Lx * Ly / 2), 0),
sd(3 * (unsigned)ceil(Lx * Ly / 2), 0),
+ sD(3 * (unsigned)ceil(Lx * Ly / 2), 0),
Ccc(Ncum),
Css(Ncum),
Cmm(Ncum),
@@ -176,9 +178,11 @@ ma::~ma() {
update_distribution_file("sa", sa, Na, Lx, Ly, beta);
update_distribution_file("sc", sc, Nc, Lx, Ly, beta);
+ update_distribution_file("ss", ss, N, Lx, Ly, beta);
update_distribution_file("sA", sA, NA, Lx, Ly, beta);
update_distribution_file("sC", sC, NC, Lx, Ly, beta);
update_distribution_file("sd", sd, N, Lx, Ly, beta);
+ update_distribution_file("sD", sD, N, Lx, Ly, beta);
update_field_file("Ccc", Ccc, Nc, Lx, Ly, beta, Mx, My);
update_field_file("Css", Css, N, Lx, Ly, beta, Mx, My);
@@ -238,6 +242,8 @@ void ma::post_fracture(network &n) {
fftw_forward_in[edge_r_to_ind(n.G.dual_vertices[n.G.dual_edges[edge].v[1]].r, Lx, Ly, Mx, My)] = 0.5;
}
+ ss[crack.size()]++;
+
fftw_complex *tss = data_transform(Mx, My, forward_plan, fftw_forward_in, fftw_forward_out);
correlation(Mx, My, Css, tss, tss, reverse_plan, fftw_reverse_in, fftw_reverse_out);
@@ -298,14 +304,19 @@ void ma::post_fracture(network &n) {
/// damage at end
std::fill_n(fftw_forward_in, Mx * My, 0.0);
+ unsigned final_broken = 0;
+
for (unsigned i = 0; i < n.G.edges.size(); i++) {
if (n.fuses[i]) {
+ final_broken++;
fftw_forward_in[edge_r_to_ind(n.G.edges[i].r, Lx, Ly, Mx, My)] += 1.0;
}
}
fftw_complex *tDD = data_transform(Mx, My, forward_plan, fftw_forward_in, fftw_forward_out);
+ sD[final_broken]++;
+
correlation(Mx, My, CDD, tDD, tDD, reverse_plan, fftw_reverse_in, fftw_reverse_out);
correlation(Mx, My, CsD, tss, tDD, reverse_plan, fftw_reverse_in, fftw_reverse_out);
diff --git a/src/measurements.hpp b/src/measurements.hpp
index a8251dd..aca6dce 100644
--- a/src/measurements.hpp
+++ b/src/measurements.hpp
@@ -37,10 +37,11 @@ class ma : public hooks {
// measurement storage
std::vector<uint64_t> sc; // cluster size distribution
std::vector<uint64_t> sa; // avalanche size distribution
+ std::vector<uint64_t> ss; // avalanche size distribution
std::vector<uint64_t> sC; // cluster size distribution
std::vector<uint64_t> sA; // avalanche size distribution
std::vector<uint64_t> sd; // avalanche size distribution
- std::vector<uint64_t> sb; // bin size distribution
+ std::vector<uint64_t> sD; // avalanche size distribution
std::vector<std::vector<uint64_t>> Ccc; // cluster-cluster correlations
std::vector<std::vector<uint64_t>> Css; // surface-surface correlations
std::vector<std::vector<uint64_t>> Cmm; // surface-surface correlations