summaryrefslogtreecommitdiff
path: root/src/compare_voronoi_fracture.c
diff options
context:
space:
mode:
authorpants <jaron@kent-dobias.com>2016-09-06 15:05:27 -0400
committerpants <jaron@kent-dobias.com>2016-09-06 15:05:27 -0400
commit4c4ebb87ead363d6d6e11a8b95b07a0f93af5c88 (patch)
tree9cdaaf27917c2b1562740dec501d013e47a25dd1 /src/compare_voronoi_fracture.c
parentfd14c5e39d962be94a1f68b0d4cacb7a4aa9c3e7 (diff)
downloadfuse_networks-4c4ebb87ead363d6d6e11a8b95b07a0f93af5c88.tar.gz
fuse_networks-4c4ebb87ead363d6d6e11a8b95b07a0f93af5c88.tar.bz2
fuse_networks-4c4ebb87ead363d6d6e11a8b95b07a0f93af5c88.zip
finished implementing embedded systems, refactored a bunch
Diffstat (limited to 'src/compare_voronoi_fracture.c')
-rw-r--r--src/compare_voronoi_fracture.c34
1 files changed, 17 insertions, 17 deletions
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],