From 1e1fdfc2e3892667bccaf317a01defd8832041c7 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Mon, 16 Jan 2017 01:31:10 -0500 Subject: fixed voltage and torus conditions, current and free boundaries and broken right now --- src/fracture.h | 58 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 25 deletions(-) (limited to 'src/fracture.h') diff --git a/src/fracture.h b/src/fracture.h index 8f883bc..0a3a687 100644 --- a/src/fracture.h +++ b/src/fracture.h @@ -48,26 +48,35 @@ typedef struct { uint_t ne; uint_t nv; uint_t dnv; - uint_t nv_break; - uint_t num_bounds; + uint_t *ev; + uint_t *dev; + double *vx; + double *dvx; +} frame_t; + +typedef struct { + uint_t L; + bound_t boundary; + uint_t ne; + uint_t nv; + uint_t dnv; + uint_t nb; uint_t *ev; - uint_t *ev_break; + uint_t *dev; + double *vx; + double *dvx; uint_t *vei; uint_t *ve; - uint_t *bound_inds; - uint_t *bound_verts; - double *vx; - double *ex; - uint_t *dev; uint_t *dvei; uint_t *dve; - double *dvx; - uint_t num_spanning_edges; + uint_t *bi; + uint_t *b; + uint_t *nbi; + uint_t *bni; + bool *bq; uint_t *spanning_edges; - uint_t L; - uint_t break_dim; + uint_t num_spanning_edges; cholmod_sparse *voltcurmat; - bound_t boundary; } graph_t; typedef struct { @@ -77,14 +86,11 @@ typedef struct { double inf; cholmod_dense *boundary_cond; cholmod_factor *factor; - uint_t *marks; - uint_t *dual_marks; bool voltage_bound; - uint_t num_components; - cholmod_sparse *adjacency; - cholmod_sparse *dual_adjacency; - bool debug_stop; uint_t num_broken; + uint_t dim; + uint_t nep; + uint_t *evp; } net_t; typedef struct { @@ -101,11 +107,9 @@ int update_components(const cholmod_sparse *laplacian, uint_t *marks, uint_t *find_components(const cholmod_sparse *laplacian, uint_t skip); -cholmod_sparse *gen_adjacency(const net_t *instance, bool dual, bool breakv, - uint_t pad, cholmod_common *c); +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 *instance, cholmod_common *c, - bool symmetric); +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); @@ -160,8 +164,8 @@ uint_t *get_clusters(net_t *instance, cholmod_common *c); uint_t *get_cluster_dist(net_t *instance, cholmod_common *c); -double *genfunc_uniform(uint_t L, bound_t boundary, gsl_rng *r, uint_t *num); -double *genfunc_hyperuniform(uint_t L, bound_t boundary, gsl_rng *r, uint_t *num); +double *genfunc_uniform(uint_t num, gsl_rng *r); +double *genfunc_hyperuniform(uint_t num, gsl_rng *r); void randfunc_flat(gsl_rng *r, double *x, double *y); void randfunc_gaus(gsl_rng *r, double *x, double *y); @@ -188,3 +192,7 @@ unsigned long int rand_seed(); long double rand_dist_pow(const gsl_rng *r, double beta); double *spheres(int N, double bidispersityratio, double bidispersityfraction, double maxpf, double maxpressure, double maxcollisionrate); + +frame_t *frame_create(lattice_t lattice, uint_t L, bool dual); +void frame_free(frame_t *frame); +bool is_in(uint_t len, uint_t *list, uint_t element); -- cgit v1.2.3-70-g09d2