summaryrefslogtreecommitdiff
path: root/src/measurements.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/measurements.cpp')
-rw-r--r--src/measurements.cpp3
1 files changed, 3 insertions, 0 deletions
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<unsigned> 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<std::list<graph::coordinate>> components(num);