summaryrefslogtreecommitdiff
path: root/src/fracture.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fracture.c')
-rw-r--r--src/fracture.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/fracture.c b/src/fracture.c
index 81d755b..dbe9ff5 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;
}