diff options
author | pants <jaron@kent-dobias.com> | 2016-09-08 11:54:06 -0400 |
---|---|---|
committer | pants <jaron@kent-dobias.com> | 2016-09-08 11:54:06 -0400 |
commit | b74bf87fd7eb2e75e71f6b667bd12b0ca7a31c11 (patch) | |
tree | c3fa46f10f6ae8604c4e784febc3eaa49b51b821 /src/compare_voronoi_fracture.c | |
parent | a264723b23d9ad6c3cb13450a6cf4b131f8d7338 (diff) | |
download | fuse_networks-b74bf87fd7eb2e75e71f6b667bd12b0ca7a31c11.tar.gz fuse_networks-b74bf87fd7eb2e75e71f6b667bd12b0ca7a31c11.tar.bz2 fuse_networks-b74bf87fd7eb2e75e71f6b667bd12b0ca7a31c11.zip |
cleaned up old files that don't matter
Diffstat (limited to 'src/compare_voronoi_fracture.c')
-rw-r--r-- | src/compare_voronoi_fracture.c | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/src/compare_voronoi_fracture.c b/src/compare_voronoi_fracture.c deleted file mode 100644 index 91fdcea..0000000 --- a/src/compare_voronoi_fracture.c +++ /dev/null @@ -1,124 +0,0 @@ - - -#include "fracture.h" - -int main(int argc, char *argv[]) { - int opt; - - // defining variables to be (potentially) set by command line flags - unsigned int N, L, filename_len; - double beta, inf, cutoff; - bound_t boundary; - - filename_len = 100; - - N = 100; - L = 16; - beta = .3; - inf = 1e10; - cutoff = 1e-10; - boundary = FREE_BOUND; - - int boundary_int; - char boundc2 = 'f'; - - while ((opt = getopt(argc, argv, "n:L:b:B:dcoNsCrt")) != -1) { - switch (opt) { - case 'n': - N = atoi(optarg); - break; - case 'L': - L = atoi(optarg); - break; - case 'b': - beta = atof(optarg); - break; - case 'B': - boundary_int = atoi(optarg); - switch (boundary_int) { - case 0: - boundary = FREE_BOUND; - boundc2 = 'f'; - break; - case 1: - boundary = CYLINDER_BOUND; - boundc2 = 'c'; - break; - default: - printf("boundary specifier must be 0 (FREE_BOUND) or 1 (CYLINDER_BOUND).\n"); - } - break; - default: /* '?' */ - exit(EXIT_FAILURE); - } - } - - char *break_filename = (char *)malloc(filename_len * sizeof(char)); - snprintf(break_filename, filename_len, "breaks_v_vc_%c_%u_%g.txt", boundc2, L, beta); - FILE *break_out = fopen(break_filename, "a"); - free(break_filename); - - - // start cholmod - cholmod_common c; - CHOL_F(start)(&c); - - (&c)->supernodal = CHOLMOD_SIMPLICIAL; - - - graph_t *network = ini_voro_graph(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->ex, 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); - free_instance(perm_current_instance, &c); - free(fuse_thres); - - FILE *net_out = fopen("network.txt", "w"); - for (unsigned int j = 0; j < network->nv; j++) { - fprintf(net_out, "%f %f ", network->vx[2 * j], - network->vx[2 * j + 1]); - } - fprintf(net_out, "\n"); - 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->dnv; j++) { - fprintf(net_out, "%f %f ", network->dvx[2 * j], - network->dvx[2 * j + 1]); - } - fprintf(net_out, "\n"); - for (unsigned int j = 0; j < network->ne; j++) { - fprintf(net_out, "%u %u ", network->dev[2 * j], - network->dev[2 * j + 1]); - } - - 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], - breaking_data_voltage->extern_field[j], breaking_data_voltage->conductivity[j]); - } - fprintf(break_out, "\n"); - for (unsigned int j = 0; j < breaking_data_current->num_broken; j++) { - fprintf(break_out, "%u %g %g ", breaking_data_current->break_list[j], - breaking_data_current->extern_field[j], breaking_data_current->conductivity[j]); - } - fprintf(break_out, "\n"); - - free_break_data(breaking_data_voltage); - free_break_data(breaking_data_current); - fclose(break_out); - - CHOL_F(finish)(&c); - - return 0; -} |