diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2017-01-16 01:31:10 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2017-01-16 01:31:10 -0500 |
commit | 1e1fdfc2e3892667bccaf317a01defd8832041c7 (patch) | |
tree | cc5ef9adbfe4a8f11744f4b7afd23a37cfdd74d4 /src/graph_genfunc.c | |
parent | 57857b9ebfb2c0a78c2eb1128d3fb4ed8d597ec4 (diff) | |
download | fuse_networks-1e1fdfc2e3892667bccaf317a01defd8832041c7.tar.gz fuse_networks-1e1fdfc2e3892667bccaf317a01defd8832041c7.tar.bz2 fuse_networks-1e1fdfc2e3892667bccaf317a01defd8832041c7.zip |
fixed voltage and torus conditions, current and free boundaries and broken right now
Diffstat (limited to 'src/graph_genfunc.c')
-rw-r--r-- | src/graph_genfunc.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/graph_genfunc.c b/src/graph_genfunc.c index 8dcd0df..d396206 100644 --- a/src/graph_genfunc.c +++ b/src/graph_genfunc.c @@ -1,26 +1,18 @@ #include "fracture.h" -double *genfunc_uniform(unsigned int L, bound_t boundary, gsl_rng *r, unsigned int *num) { - *num = 2 * pow(L / 2, 2); +double *genfunc_uniform(uint_t num, gsl_rng *r) { + double *lattice = (double *)malloc(2 * num * sizeof(double)); - double *lattice = (double *)malloc(2 * (*num) * sizeof(double)); - for (unsigned int i = 0; i < (*num); i++) { - lattice[2*i] = gsl_ran_flat(r, 0, 1); - lattice[2*i+1] = gsl_ran_flat(r, 0, 1); + for (uint_t i = 0; i < 2 * num; i++) { + lattice[i] = gsl_rng_uniform(r); } return lattice; } -double g(double rho, double dist) { - return 1 - gsl_sf_exp(-M_PI * rho * dist); -} - -double *genfunc_hyperuniform(unsigned int L, bound_t boundary, gsl_rng *r, unsigned int *num) { - *num = 2 * pow(L / 2, 2); - - double *lattice = spheres(*num, 0.8, 0.5, 0.9, 100, 100000); +double *genfunc_hyperuniform(uint_t num, gsl_rng *r) { + double *lattice = spheres(num, 0.8, 0.5, 0.9, 100, 100000); return lattice; } |