From 4f4cf365eae07e04298459bf8f9e27ad0cfcc834 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Wed, 5 Dec 2018 19:16:28 -0500 Subject: now takes Lx and Ly for anisotropic fracture --- lib/src/network.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/src/network.cpp') diff --git a/lib/src/network.cpp b/lib/src/network.cpp index 9f6cb0d..bc7a0c6 100644 --- a/lib/src/network.cpp +++ b/lib/src/network.cpp @@ -7,7 +7,7 @@ network::network(const graph& G, cholmod_common *c) : c(c), G(G), fuses(G.edges. double v0y = G.vertices[G.edges[i][0]].r.y; double v1y = G.vertices[G.edges[i][1]].r.y; - if (fabs(v0y - v1y) > 0.5) { + if (fabs(v0y - v1y) > G.L.y / 2) { bool ind = v0y < v1y ? 0 : 1; ((double *)b->x)[G.edges[i][ind]] += 1.0; @@ -138,7 +138,7 @@ void network::break_edge(unsigned int e, bool unbreak) { double v0y = G.vertices[v0].r.y; double v1y = G.vertices[v1].r.y; - if (fabs(v0y - v1y) > 0.5) { + if (fabs(v0y - v1y) > G.L.y / 2) { bool ind = v0y < v1y ? unbreak : !unbreak; ((double *)b->x)[G.edges[e][ind]] -= 1.0; @@ -172,7 +172,7 @@ current_info network::get_current_info() { double v0y = G.vertices[G.edges[i][0]].r.y; double v1y = G.vertices[G.edges[i][1]].r.y; - if (fabs(v0y - v1y) > 0.5) { + if (fabs(v0y - v1y) > G.L.y / 2) { if (v0y > v1y) { currents[i] += 1.0; total_current += currents[i]; -- cgit v1.2.3-70-g09d2