From 4c4ebb87ead363d6d6e11a8b95b07a0f93af5c88 Mon Sep 17 00:00:00 2001 From: pants Date: Tue, 6 Sep 2016 15:05:27 -0400 Subject: finished implementing embedded systems, refactored a bunch --- src/compare_voronoi_fracture.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/compare_voronoi_fracture.c') diff --git a/src/compare_voronoi_fracture.c b/src/compare_voronoi_fracture.c index bdb9423..2edcae2 100644 --- a/src/compare_voronoi_fracture.c +++ b/src/compare_voronoi_fracture.c @@ -66,14 +66,14 @@ int main(int argc, char *argv[]) { (&c)->supernodal = CHOLMOD_SIMPLICIAL; - fnet *network = ini_voronoi_network(L, false, boundary, genfunc_hyperuniform, &c); - finst *perm_voltage_instance = create_instance(network, inf, true, true, &c); - finst *perm_current_instance = create_instance(network, inf, false, true, &c); - double *fuse_thres = gen_fuse_thres(network->num_edges, network->edge_coords, beta, beta_scaling_flat); - finst *voltage_instance = copy_instance(perm_voltage_instance, &c); - finst *current_instance = copy_instance(perm_current_instance, &c); - break_data *breaking_data_voltage = fracture_network(voltage_instance, fuse_thres, &c, cutoff); - break_data *breaking_data_current = fracture_network(current_instance, fuse_thres, &c, cutoff); + graph_t *network = ini_voronoi_network(L, false, boundary, genfunc_hyperuniform, &c); + net_t *perm_voltage_instance = create_instance(network, inf, true, true, &c); + net_t *perm_current_instance = create_instance(network, inf, false, true, &c); + double *fuse_thres = gen_fuse_thres(network->ne, network->edge_coords, beta, beta_scaling_flat); + net_t *voltage_instance = copy_instance(perm_voltage_instance, &c); + net_t *current_instance = copy_instance(perm_current_instance, &c); + data_t *breaking_data_voltage = fracture_network(voltage_instance, fuse_thres, &c, cutoff); + data_t *breaking_data_current = fracture_network(current_instance, fuse_thres, &c, cutoff); free_instance(voltage_instance, &c); free_instance(current_instance, &c); free_instance(perm_voltage_instance, &c); @@ -81,27 +81,27 @@ int main(int argc, char *argv[]) { free(fuse_thres); FILE *net_out = fopen("network.txt", "w"); - for (unsigned int j = 0; j < network->num_verts; j++) { + for (unsigned int j = 0; j < network->nv; j++) { fprintf(net_out, "%f %f ", network->vert_coords[2 * j], network->vert_coords[2 * j + 1]); } fprintf(net_out, "\n"); - for (unsigned int j = 0; j < network->num_edges; j++) { - fprintf(net_out, "%u %u ", network->edges_to_verts[2 * j], - network->edges_to_verts[2 * j + 1]); + for (unsigned int j = 0; j < network->ne; j++) { + fprintf(net_out, "%u %u ", network->ev[2 * j], + network->ev[2 * j + 1]); } fprintf(net_out, "\n"); - for (unsigned int j = 0; j < network->num_dual_verts; j++) { + for (unsigned int j = 0; j < network->dnv; j++) { fprintf(net_out, "%f %f ", network->dual_vert_coords[2 * j], network->dual_vert_coords[2 * j + 1]); } fprintf(net_out, "\n"); - for (unsigned int j = 0; j < network->num_edges; j++) { - fprintf(net_out, "%u %u ", network->dual_edges_to_verts[2 * j], - network->dual_edges_to_verts[2 * j + 1]); + for (unsigned int j = 0; j < network->ne; j++) { + fprintf(net_out, "%u %u ", network->dev[2 * j], + network->dev[2 * j + 1]); } - free_fnet(network, &c); + free_net(network, &c); for (unsigned int j = 0; j < breaking_data_voltage->num_broken; j++) { fprintf(break_out, "%u %g %g ", breaking_data_voltage->break_list[j], -- cgit v1.2.3-70-g09d2