From 7ff906b9cd27a44472b40e78e5d595ea41df1482 Mon Sep 17 00:00:00 2001 From: pants Date: Wed, 31 Aug 2016 14:04:55 -0400 Subject: can generate voronoi networks with regular boundaries --- src/fracture_network.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/fracture_network.c') diff --git a/src/fracture_network.c b/src/fracture_network.c index 148b08c..fe520fd 100644 --- a/src/fracture_network.c +++ b/src/fracture_network.c @@ -39,9 +39,11 @@ break_data *fracture_network(finst *instance, double *fuse_thres, } int last_broke = inc_break_fuses(instance, fuse_thres, field, cutoff); - if (last_broke > num_edges || last_broke < -1) { - printf("%g \n", conductivity); - getchar(); + if (last_broke > num_edges || last_broke < -1 || conductivity < 1e-8) { + printf("whoops %u\n\n", breaking_data->num_broken); + free(voltages); + free(field); + break; } update_break_data(breaking_data, last_broke, fabs(conductivity * fuse_thres[last_broke] / field[last_broke]), conductivity); -- cgit v1.2.3-70-g09d2