summaryrefslogtreecommitdiff
path: root/src/fracture.h
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-11-01 12:33:37 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-11-01 12:33:37 -0400
commit07906baa42470bad14d2c40f57967691f6118969 (patch)
tree416ae624829967861c7c799103b3ff795e9e36b4 /src/fracture.h
parent8c4c42d81745ea33c31150fe22e834d97e29ede6 (diff)
downloadfuse_networks-07906baa42470bad14d2c40f57967691f6118969.tar.gz
fuse_networks-07906baa42470bad14d2c40f57967691f6118969.tar.bz2
fuse_networks-07906baa42470bad14d2c40f57967691f6118969.zip
revamped and simplied fracture code with c++
Diffstat (limited to 'src/fracture.h')
-rw-r--r--src/fracture.h123
1 files changed, 0 insertions, 123 deletions
diff --git a/src/fracture.h b/src/fracture.h
deleted file mode 100644
index 5eb0a1d..0000000
--- a/src/fracture.h
+++ /dev/null
@@ -1,123 +0,0 @@
-
-#pragma once
-
-#include <assert.h>
-#include <cholmod.h>
-#include <float.h>
-#include <getopt.h>
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_randist.h>
-#include <gsl/gsl_rng.h>
-#include <gsl/gsl_sf_erf.h>
-#include <gsl/gsl_sf_exp.h>
-#include <gsl/gsl_sf_log.h>
-#include <inttypes.h>
-#include <math.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <jst/graph.h>
-#include <jst/rand.h>
-
-// these defs allow me to switch to long int cholmod in a sitch
-#define int_t int
-#define uint_t unsigned int
-#define CINT_MAX INT_MAX
-#define CHOL_F(x) cholmod_##x
-
-#define GSL_RAND_GEN gsl_rng_mt19937
-
-typedef struct {
- const graph_t *graph;
- bool *fuses;
- long double *thres;
- double inf;
- cholmod_dense *boundary_cond;
- cholmod_factor *factor;
- bool voltage_bound;
- uint_t num_broken;
- uint_t dim;
- uint_t nep;
- uint_t *evp;
- cholmod_sparse *voltcurmat;
-} net_t;
-
-typedef struct {
- uint_t num_broken;
- uint_t *break_list;
- double *conductivity;
- long double *extern_field;
-} data_t;
-
-intptr_t *run_voronoi(uint_t num_coords, double *coords, bool periodic,
- double xmin, double xmax, double ymin, double ymax);
-
-cholmod_sparse *gen_adjacency(const net_t *net, bool dual, bool use_gp,
- bool symmetric, cholmod_common *c);
-
-cholmod_sparse *gen_laplacian(const net_t *net, cholmod_common *c);
-
-int edge_to_verts(uint_t width, bool periodic, uint_t edge, bool index);
-
-int dual_edge_to_verts(uint_t width, bool periodic, uint_t edge, bool index);
-
-double dual_vert_to_coord(uint_t width, bool periodic, uint_t vert, bool index);
-
-void factor_update(cholmod_factor *factor, uint_t v1, uint_t v2,
- cholmod_common *c);
-void factor_update2(cholmod_factor *factor, uint_t v1, cholmod_common *c);
-
-void net_notch(net_t *net, double notch_len, cholmod_common *c);
-data_t *net_fracture(net_t *net, cholmod_common *c, double cutoff);
-double *net_voltages(const net_t *net, cholmod_common *c);
-double *net_currents(const net_t *net, const double *voltages,
- cholmod_common *c);
-double net_conductivity(const net_t *net, const double *voltages);
-
-void update_boundary(net_t *instance, const double *avg_field);
-
-FILE *get_file(const char *prefix, uint_t width, uint_t crack, double beta,
- uint_t iter, uint_t num_iter, uint_t num, bool read);
-
-double update_beta(double beta, uint_t width, const double *stress,
- const double *damage, double bound_total);
-
-cholmod_sparse *gen_voltcurmat(uint_t num_edges, uint_t num_verts,
- uint_t *edges_to_verts, cholmod_common *c);
-
-net_t *net_copy(const net_t *net, cholmod_common *c);
-
-void net_free(net_t *instance, cholmod_common *c);
-
-net_t *net_create(const graph_t *g, double inf, double beta, double notch_len,
- bool vb, cholmod_common *c);
-
-bool break_edge(net_t *instance, uint_t edge, cholmod_common *c);
-
-components_t *get_clusters(net_t *instance);
-
-uint_t *get_cluster_dist(net_t *instance);
-
-void randfunc_flat(gsl_rng *r, double *x, double *y);
-void randfunc_gaus(gsl_rng *r, double *x, double *y);
-
-double *get_corr(net_t *instance, uint_t **dists, cholmod_common *c);
-
-double *bin_values(graph_t *network, uint_t width, double *values);
-
-cholmod_dense *bound_set(const graph_t *g, bool vb, double notch_len,
- cholmod_common *c);
-
-data_t *data_create(uint_t num_edges);
-void data_free(data_t *data);
-void data_update(data_t *data, uint_t last_broke, long double strength,
- double conductivity);
-
-long double rand_dist_pow(const gsl_rng *r, double beta);
-
-bool is_in(uint_t len, uint_t *list, uint_t element);