summaryrefslogtreecommitdiff
path: root/pureMorse.cpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2023-04-04 12:31:06 +0200
committerJaron Kent-Dobias <jaron@kent-dobias.com>2023-04-04 12:31:06 +0200
commit1d30476d67b1dcfaa4240dc8569a05c6caa84fed (patch)
tree4e07b700610c7c360f3fb2644f048079aac755d1 /pureMorse.cpp
parent383c5e41a33b17d49e7524089eea3b940008bade (diff)
downloadcode-1d30476d67b1dcfaa4240dc8569a05c6caa84fed.tar.gz
code-1d30476d67b1dcfaa4240dc8569a05c6caa84fed.tar.bz2
code-1d30476d67b1dcfaa4240dc8569a05c6caa84fed.zip
Added utilities for the study of real Morse lines.
Made real analogues of the library collectStokesData.hpp and pureStokes.cpp (now titled collectMorseData.hpp and pureMorse.cpp) for the study of Morse lines on ordinary (real) p-spin models.
Diffstat (limited to 'pureMorse.cpp')
-rw-r--r--pureMorse.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/pureMorse.cpp b/pureMorse.cpp
new file mode 100644
index 0000000..f157c35
--- /dev/null
+++ b/pureMorse.cpp
@@ -0,0 +1,56 @@
+#include <getopt.h>
+#include <chrono>
+
+#include "collectMorseData.hpp"
+
+#include "pcg-cpp/include/pcg_random.hpp"
+#include "randutils/randutils.hpp"
+
+using Rng = randutils::random_generator<pcg32>;
+
+int main(int argc, char* argv[]) {
+ // model parameters
+ unsigned N = 10; // number of spins
+ // simulation parameters
+ Real ε = 1e-15;
+ Real δz₀ = 1e-3;
+ unsigned n = 10;
+ bool useMinima = false;
+ bool useSpike = false;
+
+ int opt;
+
+ while ((opt = getopt(argc, argv, "N:e:d:n:ms")) != -1) {
+ switch (opt) {
+ case 'N':
+ N = (unsigned)atof(optarg);
+ break;
+ case 'e':
+ ε = atof(optarg);
+ break;
+ case 'd':
+ δz₀ = atof(optarg);
+ break;
+ case 'n':
+ n = atof(optarg);
+ break;
+ case 'm':
+ useMinima = true;
+ break;
+ case 's':
+ useSpike = true;
+ break;
+ default:
+ exit(1);
+ }
+ }
+
+ Rng r;
+
+ for (unsigned i = 0; i < n; i++) {
+ auto tag = std::chrono::high_resolution_clock::now();
+ collectMorseData<3>(std::to_string(tag.time_since_epoch().count()), N, r.engine(), ε, δz₀, useMinima, useSpike, 1.0);
+ }
+
+ return 0;
+}