From 7f7bfc7789c7c0d5b8a8daeda82b349ee1ea52a0 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Sat, 27 Apr 2019 18:02:58 -0400 Subject: fixed problems with the current cutoff --- src/measurements.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/measurements.cpp b/src/measurements.cpp index 5a79bd7..bf053e9 100644 --- a/src/measurements.cpp +++ b/src/measurements.cpp @@ -187,6 +187,9 @@ void ma::post_fracture(network &n) { auto post_cracks = find_minimal_crack(G, n); std::vector component(boost::num_vertices(G)); unsigned num = boost::connected_components(G, &component[0]); + if (post_cracks.size() > 2 || post_cracks.size() == 0) { + throw badcycleex; + } unsigned crack_component = component[n.G.dual_edges[post_cracks.front().second.front()].v[0]]; std::vector> components(num); -- cgit v1.2.3-70-g09d2