summaryrefslogtreecommitdiff
path: root/pureStokes.cpp
blob: b1ed1dc3b85b7776f1e0b8007d5c267198946fe3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <getopt.h>
#include <chrono>

#include "collectStokesData.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();
    collectStokesData<3>(std::to_string(tag.time_since_epoch().count()), N, r.engine(), ε, δz₀, useMinima, useSpike, 1.0);
  }

  return 0;
}