From e500d46fa8276d8a93eb3f21da7c02879ee8094e Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Sun, 3 Feb 2019 22:37:52 -0500 Subject: added measurements for final damage and crack backbone length distributions, to compute disconnected correlation function correctly --- src/measurements.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/measurements.cpp') 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); -- cgit v1.2.3-70-g09d2