summaryrefslogtreecommitdiff
path: root/src/measurements.hpp
blob: 51f7080ba6b1603f85dc552c12c838077d6a4283 (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

#include <cstring>
#include <fstream>
#include <string>
#include <cinttypes>
#include <sstream>
#include <functional>
#include <iostream>
#include <array>

#include <fftw3.h>

#include <hooks.hpp>

#include "analysis_tools.hpp"

class ma : public hooks {
  // need:
  //  - interface for turning on and off specific measurements
  //
  private:
    Graph G;

    unsigned num;
    
    // measurement storage
    std::vector<uint64_t> sn; // non-spanning cluster size distribution
    std::vector<uint64_t> ss; // minimal spanning cluster size distribution
    std::vector<uint64_t> sm; // spanning cluster size distribution
    std::vector<uint64_t> sl; // final avalanche size distribution
    std::vector<uint64_t> sb; // final avalanche size distribution
    std::vector<uint64_t> sd; // final avalanche size distribution
    std::vector<uint64_t> sc; // non-spanning cluster size distribution
    std::vector<uint64_t> sa; // non-final avalanche size distribution
    std::vector<uint64_t> sA; // non-final avalanche size distribution

  public:
    long double lv;

    std::list<std::list<unsigned>> avalanches;
    std::list<unsigned> last_avalanche;
    std::string model_string;

    ma(unsigned Lx, unsigned Ly, double beta);
    ma(unsigned n, double a, unsigned Mx, unsigned My, double beta);
    ~ma();

    void pre_fracture(const network &) override;
    void bond_broken(const network& net, const current_info& cur, unsigned i) override;
    void post_fracture(network &n) override;
};