diff options
author | pants <jaron@kent-dobias.com> | 2016-09-19 15:51:16 -0400 |
---|---|---|
committer | pants <jaron@kent-dobias.com> | 2016-09-19 15:51:16 -0400 |
commit | 2969d1ef1352b22252c766372388cc3998997a72 (patch) | |
tree | ba1c7a5d13d6344b7bb55884ccb45d1b4ef25f98 /src/fracture.c | |
parent | a235904d571652e99edcc9ff9639ec39c8fbc456 (diff) | |
download | fuse_networks-2969d1ef1352b22252c766372388cc3998997a72.tar.gz fuse_networks-2969d1ef1352b22252c766372388cc3998997a72.tar.bz2 fuse_networks-2969d1ef1352b22252c766372388cc3998997a72.zip |
added some features
Diffstat (limited to 'src/fracture.c')
-rw-r--r-- | src/fracture.c | 20 |
1 files changed, 14 insertions, 6 deletions
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; } |