From d903e680ddde543d4270086966225f3886ecdd97 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 10 Oct 2019 16:48:36 -0400 Subject: added some code to debug problematic asymmetry --- src/measurements.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/measurements.cpp b/src/measurements.cpp index ec40f0c..8613c27 100644 --- a/src/measurements.cpp +++ b/src/measurements.cpp @@ -96,7 +96,7 @@ tx1[i][1] * tx2[i][1]; fftw_reverse_in[i][1] = tx1[i][0] * tx2[i][1] - tx1[i][1] */ void autocorrelation2(double Lx, double Ly, unsigned Mx, unsigned My, std::vector& data, - const std::list& pos, std::array count) { + const std::list& pos, std::array count, bool debug = false) { for (std::list::const_iterator it1 = pos.begin(); it1 != pos.end(); it1++) { for (std::list::const_iterator it2 = it1; it2 != pos.end(); it2++) { double Δx_tmp = fabs(it1->x - it2->x); @@ -105,6 +105,12 @@ void autocorrelation2(double Lx, double Ly, unsigned Mx, unsigned My, std::vecto double Δy_tmp = fabs(it1->y - it2->y); double Δy = Δy_tmp < Ly / 2 ? Δy_tmp : Ly - Δy_tmp; + if (debug) { + if (Δx > 0 || Δy > 0) { + std::cout << Δx << " " << Δy << "\n"; + } + } + if (count[0] % 2 == 0) { data[(unsigned)((1 + 2 * (Mx / 2)) * (Δx / Lx)) + (Mx / 2 + 1) * (unsigned)((1 + 2 * (My / 2)) * (Δy / Ly))]++; } else { @@ -283,7 +289,7 @@ void ma::post_fracture(network& n) { sm[components[i].size() - 1]++; } autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cm, components[i], crack.first); - autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cp, components[i], {0, 1}); + autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cp, components[i], {0, 1}, true); } else { ss[components[i].size() - 1]++; autocorrelation2(n.G.L.x, n.G.L.y, Mx, My, cs, components[i], crack.first); -- cgit v1.2.3-54-g00ecf