summaryrefslogtreecommitdiff
path: root/src/measurements.hpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-11-01 12:33:37 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-11-01 12:33:37 -0400
commit07906baa42470bad14d2c40f57967691f6118969 (patch)
tree416ae624829967861c7c799103b3ff795e9e36b4 /src/measurements.hpp
parent8c4c42d81745ea33c31150fe22e834d97e29ede6 (diff)
downloadfuse_networks-07906baa42470bad14d2c40f57967691f6118969.tar.gz
fuse_networks-07906baa42470bad14d2c40f57967691f6118969.tar.bz2
fuse_networks-07906baa42470bad14d2c40f57967691f6118969.zip
revamped and simplied fracture code with c++
Diffstat (limited to 'src/measurements.hpp')
-rw-r--r--src/measurements.hpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/measurements.hpp b/src/measurements.hpp
new file mode 100644
index 0000000..817481b
--- /dev/null
+++ b/src/measurements.hpp
@@ -0,0 +1,54 @@
+
+#include <vector>
+#include <algorithm>
+#include <cmath>
+#include <list>
+#include <fstream>
+#include <string>
+#include <cinttypes>
+#include <sstream>
+
+#include <boost/graph/adjacency_list.hpp>
+#include <boost/graph/connected_components.hpp>
+
+#include <fftw3.h>
+
+#include <network.hpp>
+#include <hooks.hpp>
+
+class ma : public hooks {
+ // need:
+ // - measurements for correlation functions (nice looking?)
+ // - interface for reading and writing from files (nice looking?)
+ // - interface for turning on and off specific measurements
+ //
+ private:
+ double *fftw_forward_in;
+ fftw_complex *fftw_forward_out;
+ fftw_complex *fftw_reverse_in;
+ double *fftw_reverse_out;
+ fftw_plan forward_plan;
+ fftw_plan reverse_plan;
+ boost::adjacency_list <boost::listS, boost::vecS, boost::undirectedS> G;
+
+ public:
+ unsigned int N;
+ unsigned int L;
+ unsigned int as;
+ double lv;
+ double beta;
+
+
+ std::vector<unsigned int> ad;
+ std::vector<unsigned int> cd;
+ std::vector<unsigned int> bin_counts;
+ std::list<std::list<unsigned int>> avalanches;;
+
+ ma(unsigned int N, unsigned int L, double beta);
+ ~ma();
+
+ void pre_fracture(const network &) override;
+ void bond_broken(const network& net, const std::pair<double, std::vector<double>>& cur, unsigned int i) override;
+ void post_fracture(network &n) override;
+};
+