summaryrefslogtreecommitdiff
path: root/src/homo_voronoi_fracture.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/homo_voronoi_fracture.c')
-rw-r--r--src/homo_voronoi_fracture.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/homo_voronoi_fracture.c b/src/homo_voronoi_fracture.c
index 26ceed4..6171480 100644
--- a/src/homo_voronoi_fracture.c
+++ b/src/homo_voronoi_fracture.c
@@ -211,11 +211,11 @@ int main(int argc, char *argv[]) {
for (uint32_t i = 0; i < N; i++) {
printf("\033[F\033[JFRACTURE: %0*d / %d\n", (uint8_t)log10(N) + 1, i + 1, N);
- fnet *network = ini_voronoi_network(L, boundary, use_dual, genfunc_hyperuniform, &c);
- finst *perm_instance = create_instance(network, inf, use_voltage_boundaries, true, &c);
- double *fuse_thres = gen_fuse_thres(network->num_edges, network->edge_coords, beta, beta_scaling_flat);
- finst *instance = copy_instance(perm_instance, &c);
- break_data *breaking_data = fracture_network(instance, fuse_thres, &c, cutoff);
+ graph_t *network = ini_voronoi_network(L, boundary, use_dual, genfunc_hyperuniform, &c);
+ net_t *perm_instance = create_instance(network, inf, use_voltage_boundaries, true, &c);
+ double *fuse_thres = gen_fuse_thres(network->ne, network->edge_coords, beta, beta_scaling_flat);
+ net_t *instance = copy_instance(perm_instance, &c);
+ data_t *breaking_data = fracture_network(instance, fuse_thres, &c, cutoff);
free_instance(instance, &c);
free(fuse_thres);
@@ -236,7 +236,7 @@ int main(int argc, char *argv[]) {
breaking_data->extern_field[max_pos];
}
- finst *tmp_instance = copy_instance(perm_instance, &c);
+ net_t *tmp_instance = copy_instance(perm_instance, &c);
uint_t av_size = 0;
double cur_val = 0;
@@ -260,7 +260,7 @@ int main(int argc, char *argv[]) {
if (save_conductivity) {
if (!use_voltage_boundaries) {
double *tmp_voltage = get_voltage(tmp_instance, &c);
- conductivity[i] = 1/fabs(tmp_voltage[tmp_instance->network->num_verts + 1] - tmp_voltage[tmp_instance->network->num_verts]);
+ conductivity[i] = 1/fabs(tmp_voltage[tmp_instance->graph->nv + 1] - tmp_voltage[tmp_instance->graph->nv]);
free(tmp_voltage);
} else {
conductivity[i] = breaking_data->conductivity[max_pos];
@@ -290,7 +290,7 @@ int main(int argc, char *argv[]) {
if (save_cluster_dist) {
uint_t *tmp_cluster_dist = get_cluster_dist(tmp_instance, &c);
- for (uint_t j = 0; j < tmp_instance->network->num_dual_verts; j++) {
+ for (uint_t j = 0; j < tmp_instance->graph->dnv; j++) {
cluster_size_dist[j] += tmp_cluster_dist[j];
}
free(tmp_cluster_dist);
@@ -298,27 +298,27 @@ int main(int argc, char *argv[]) {
if (save_network) {
FILE *net_out = fopen("network.txt", "w");
- for (uint_t j = 0; j < network->num_verts; j++) {
+ for (uint_t j = 0; j < network->nv; j++) {
fprintf(net_out, "%f %f ", network->vert_coords[2 * j],
- tmp_instance->network->vert_coords[2 * j + 1]);
+ tmp_instance->graph->vert_coords[2 * j + 1]);
}
fprintf(net_out, "\n");
- for (uint_t j = 0; j < tmp_instance->network->num_edges; j++) {
- fprintf(net_out, "%u %u ", tmp_instance->network->edges_to_verts[2 * j],
- tmp_instance->network->edges_to_verts[2 * j + 1]);
+ for (uint_t j = 0; j < tmp_instance->graph->ne; j++) {
+ fprintf(net_out, "%u %u ", tmp_instance->graph->ev[2 * j],
+ tmp_instance->graph->ev[2 * j + 1]);
}
fprintf(net_out, "\n");
- for (uint_t j = 0; j < tmp_instance->network->num_dual_verts; j++) {
- fprintf(net_out, "%f %f ", tmp_instance->network->dual_vert_coords[2 * j],
- tmp_instance->network->dual_vert_coords[2 * j + 1]);
+ for (uint_t j = 0; j < tmp_instance->graph->dnv; j++) {
+ fprintf(net_out, "%f %f ", tmp_instance->graph->dual_vert_coords[2 * j],
+ tmp_instance->graph->dual_vert_coords[2 * j + 1]);
}
fprintf(net_out, "\n");
- for (uint_t j = 0; j < tmp_instance->network->num_edges; j++) {
- fprintf(net_out, "%u %u ", tmp_instance->network->dual_edges_to_verts[2 * j],
- tmp_instance->network->dual_edges_to_verts[2 * j + 1]);
+ for (uint_t j = 0; j < tmp_instance->graph->ne; j++) {
+ fprintf(net_out, "%u %u ", tmp_instance->graph->dev[2 * j],
+ tmp_instance->graph->dev[2 * j + 1]);
}
fprintf(net_out, "\n");
- for (uint_t j = 0; j < tmp_instance->network->num_edges; j++) {
+ for (uint_t j = 0; j < tmp_instance->graph->ne; j++) {
fprintf(net_out, "%d ", tmp_instance->fuses[j]);
}
fclose(net_out);
@@ -326,7 +326,7 @@ int main(int argc, char *argv[]) {
free_instance(tmp_instance, &c);
free_instance(perm_instance, &c);
- free_fnet(network, &c);
+ free_net(network, &c);
if (include_breaking) {
for (uint_t j = 0; j < breaking_data->num_broken; j++) {