summaryrefslogtreecommitdiff
path: root/src/fracture.h
diff options
context:
space:
mode:
authorpants <jaron@kent-dobias.com>2016-09-09 14:33:56 -0400
committerpants <jaron@kent-dobias.com>2016-09-09 14:33:56 -0400
commit03de79b8c5ebcc206e3450dfbc701211d9c254b0 (patch)
treeea1882e66605bbfcf257692c53f45bf1c4d0d2db /src/fracture.h
parentbf525955316995a56b9fd1e66b9345cdf4ba3561 (diff)
downloadfuse_networks-03de79b8c5ebcc206e3450dfbc701211d9c254b0.tar.gz
fuse_networks-03de79b8c5ebcc206e3450dfbc701211d9c254b0.tar.bz2
fuse_networks-03de79b8c5ebcc206e3450dfbc701211d9c254b0.zip
more refactoring
Diffstat (limited to 'src/fracture.h')
-rw-r--r--src/fracture.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/fracture.h b/src/fracture.h
index 2401d25..5e1b3e4 100644
--- a/src/fracture.h
+++ b/src/fracture.h
@@ -29,6 +29,8 @@
#define CINT_MAX INT_MAX
#define CHOL_F(x) cholmod_##x
+#define GSL_RAND_GEN gsl_rng_mt19937
+
typedef enum lattice_t {
VORONOI_LATTICE,
SQUARE_LATTICE
@@ -111,16 +113,13 @@ int dual_edge_to_verts(unsigned int width, bool periodic, unsigned int edge,
double dual_vert_to_coord(unsigned int width, bool periodic, unsigned int vert,
bool index);
-bool update_factor(cholmod_factor *factor, unsigned int v1, unsigned int v2,
- cholmod_common *c);
-
-data_t *net_fracture(net_t *net, cholmod_common *c, double cutoff);
-
-double *get_current(const net_t *instance, cholmod_common *c);
-double *get_current_v(const net_t *instance, double *voltages, cholmod_common *c);
-double *get_voltage(const net_t *instance, cholmod_common *c);
+void factor_update(cholmod_factor *factor, uint_t v1, uint_t v2, 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);
@@ -174,10 +173,12 @@ data_t *data_create(uint_t num_edges);
void data_free(data_t *data);
void data_update(data_t *data, uint_t last_broke, double strength, double conductivity);
-double get_conductivity(net_t *inst, double *current, cholmod_common *c);
-
graph_t *graph_create(lattice_t lattice, bound_t bound, uint_t L, bool dual, cholmod_common *c);
uint_t find_cycles(uint_t num_edges, const bool *fuses, const uint_t *ev, const uint_t *vei, const uint_t *ve, int **cycles);
bool set_connected(const cholmod_sparse *laplacian, uint_t *marks, int vertex, int label, int stop_at, int exclude);
+
+unsigned long int rand_seed();
+
+double rand_dist_pow(const gsl_rng *r, double beta);