From d944bcc3df0a8d7a10b755b5858c85e61a835a35 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 21 Feb 2019 14:01:24 -0500 Subject: simplified and sped up measurementsn substantially, correlation functions and some distributions again incompatible --- src/sample_fracture.cpp | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/sample_fracture.cpp (limited to 'src/sample_fracture.cpp') diff --git a/src/sample_fracture.cpp b/src/sample_fracture.cpp new file mode 100644 index 0000000..42a6a5a --- /dev/null +++ b/src/sample_fracture.cpp @@ -0,0 +1,65 @@ + +#include +#include + +#include + +#include "randutils/randutils.hpp" + +#include +#include +#include +#include "sample.hpp" + +#include +#include +#include + +int main(int argc, char* argv[]) { + + int opt; + + unsigned N = 1; + double Lx = 16; + double Ly = 16; + double beta = 0.5; + + while ((opt = getopt(argc, argv, "N:X:Y:b:")) != -1) { + switch (opt) { + case 'N': + N = (unsigned)atof(optarg); + break; + case 'X': + Lx = atof(optarg); + break; + case 'Y': + Ly = atof(optarg); + break; + case 'b': + beta = atof(optarg); + break; + default: + exit(1); + } + } + + cholmod_common c; + CHOL_F(start)(&c); + + sample meas(Lx, Ly, beta); + + randutils::auto_seed_128 seeds; + std::mt19937 rng{seeds}; + + for (unsigned trial = 0; trial < N; trial++) { + graph G(Lx, Ly, rng); + network network(G, &c); + network.set_thresholds(beta, rng); + network.fracture(meas); + } + + CHOL_F(finish)(&c); + + return 0; +} + -- cgit v1.2.3-70-g09d2