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/graph_genfunc.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/graph_genfunc.c') 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; } -- cgit v1.2.3-70-g09d2