summaryrefslogtreecommitdiff
path: root/src/cracking_ini.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cracking_ini.c')
-rw-r--r--src/cracking_ini.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cracking_ini.c b/src/cracking_ini.c
index 988af5b..93e5765 100644
--- a/src/cracking_ini.c
+++ b/src/cracking_ini.c
@@ -31,18 +31,18 @@ double *gen_fuse_thres(unsigned int num_edges, double *edge_coords, double beta,
return fuse_thres;
}
-void gen_voro_crack(finst *instance, double crack_len, cholmod_common *c) {
- for (uint_t i = 0; i < instance->network->num_edges; i++) {
+void gen_voro_crack(net_t *instance, double crack_len, cholmod_common *c) {
+ for (uint_t i = 0; i < instance->graph->ne; i++) {
uint_t v1, v2;
double v1x, v1y, v2x, v2y, dx, dy;
- v1 = instance->network->edges_to_verts[2 * i];
- v2 = instance->network->edges_to_verts[2 * i + 1];
+ v1 = instance->graph->ev[2 * i];
+ v2 = instance->graph->ev[2 * i + 1];
- v1x = instance->network->vert_coords[2 * v1];
- v1y = instance->network->vert_coords[2 * v1 + 1];
- v2x = instance->network->vert_coords[2 * v2];
- v2y = instance->network->vert_coords[2 * v2 + 1];
+ v1x = instance->graph->vert_coords[2 * v1];
+ v1y = instance->graph->vert_coords[2 * v1 + 1];
+ v2x = instance->graph->vert_coords[2 * v2];
+ v2y = instance->graph->vert_coords[2 * v2 + 1];
dx = v1x - v2x;
dy = v1y - v2y;
@@ -55,13 +55,13 @@ void gen_voro_crack(finst *instance, double crack_len, cholmod_common *c) {
}
}
-bool gen_crack(finst *instance, double crack_len, double crack_width,
+bool gen_crack(net_t *instance, double crack_len, double crack_width,
cholmod_common *c) {
assert(instance != NULL);
bool *fuses = instance->fuses;
assert(fuses != NULL);
- const fnet *network = instance->network;
- unsigned int num_edges = network->num_edges;
+ const graph_t *network = instance->graph;
+ unsigned int num_edges = network->ne;
double *edge_coords = network->edge_coords;
for (unsigned int j = 0; j < num_edges; j++) {