From 2969d1ef1352b22252c766372388cc3998997a72 Mon Sep 17 00:00:00 2001 From: pants Date: Mon, 19 Sep 2016 15:51:16 -0400 Subject: added some features --- src/fracture.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/fracture.c') diff --git a/src/fracture.c b/src/fracture.c index 718fc05..260f04f 100644 --- a/src/fracture.c +++ b/src/fracture.c @@ -300,24 +300,32 @@ int main(int argc, char *argv[]) { uint_t av_size = 0; double cur_val = 0; - uint_t notch_edge; + uint_t notch_mark = 0; if (crack_growth_crit) { - for (uint_t i = 0; i < net->graph->ne; i++) { - if (net->fuses[i]) { - notch_edge = i; + uint_t n_edge = UINT_MAX; + for (uint_t j = 0; j < g->ne; j++) { + // right now the only fuses broken are from a notch + if (net->fuses[j]) { + n_edge = j; break; } } + + if (n_edge < UINT_MAX) { + uint_t n_vert = g->dev[2 * n_edge]; + notch_mark = net->dual_marks[n_vert]; + } } for (uint_t j = 0; j < max_pos; j++) { uint_t next_broken = data->break_list[j]; - bool attached_to_notch = net->dual_marks[next_broken] == net->dual_marks[notch_edge]; - bool grew_forward = net->graph->ex[2 * next_broken] > crack_len; + bool attached_to_notch = net->dual_marks[g->dev[2*next_broken]] == notch_mark; + bool grew_forward = g->ex[2 * next_broken] > crack_len; if (crack_growth_crit && attached_to_notch && grew_forward) { + printf("whoops\n\n"); max_pos = j; break; } -- cgit v1.2.3-70-g09d2