summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2019-10-10 16:48:36 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2019-10-10 16:48:36 -0400
commitd903e680ddde543d4270086966225f3886ecdd97 (patch)
treee2c71a3907e89edf7f01ce9b5fe56d6f9bc18138
parente1167e6253da1c2d046573a6b5a49804983312c2 (diff)
downloadfuse_networks-debug.tar.gz
fuse_networks-debug.tar.bz2
fuse_networks-debug.zip
added some code to debug problematic asymmetrydebug
-rw-r--r--src/measurements.cpp10
1 files 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<uint64_t>& data,
- const std::list<graph::coordinate>& pos, std::array<unsigned, 2> count) {
+ const std::list<graph::coordinate>& pos, std::array<unsigned, 2> count, bool debug = false) {
for (std::list<graph::coordinate>::const_iterator it1 = pos.begin(); it1 != pos.end(); it1++) {
for (std::list<graph::coordinate>::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);