summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2019-06-15 18:16:42 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2019-06-15 18:16:42 -0400
commit117476f964c8700d16294e06bafc7e8491482620 (patch)
treeba56175f53d0c8d1adc07d6b8529bf765a9b04fb /src
parent466c8554b301016cb810a1328212a84374bfc001 (diff)
downloadfuse_networks-117476f964c8700d16294e06bafc7e8491482620.tar.gz
fuse_networks-117476f964c8700d16294e06bafc7e8491482620.tar.bz2
fuse_networks-117476f964c8700d16294e06bafc7e8491482620.zip
added maesurement of current histograms
Diffstat (limited to 'src')
-rw-r--r--src/measurements.cpp13
-rw-r--r--src/measurements.hpp2
2 files changed, 13 insertions, 2 deletions
diff --git a/src/measurements.cpp b/src/measurements.cpp
index 969f487..0732d24 100644
--- a/src/measurements.cpp
+++ b/src/measurements.cpp
@@ -152,7 +152,8 @@ ma::ma(unsigned n, double a, double beta) :
sd(3 * n),
sc(2 * n),
sa(3 * n),
- sA(3 * n)
+ sA(3 * n),
+ si(10000)
{
if (beta != 0.0) {
model_string = "fracture_" + std::to_string(n) + "_" + std::to_string(a) + "_" + std::to_string(beta) + "_";
@@ -171,7 +172,8 @@ ma::ma(unsigned Lx, unsigned Ly, double beta) :
sd(Lx * Ly),
sc(Lx * Ly / 2),
sa(Lx * Ly),
- sA(Lx * Ly)
+ sA(Lx * Ly),
+ si(10000)
{
if (beta != 0.0) {
model_string = "fracture_" + std::to_string(Lx) + "_" + std::to_string(Ly) + "_" + std::to_string(beta) + "_";
@@ -190,6 +192,7 @@ ma::~ma() {
update_distribution_file("sc", sc, model_string);
update_distribution_file("sa", sa, model_string);
update_distribution_file("sA", sA, model_string);
+ update_distribution_file("si", si, model_string);
}
void ma::pre_fracture(const network&) {
@@ -208,6 +211,12 @@ void ma::bond_broken(const network& net, const current_info& cur, unsigned i) {
avalanches.back().push_back(i);
}
+ for (unsigned j = 0; j < cur.currents.size(); j++) {
+ if (logl(cur.currents[j]) >= -100 && logl(cur.currents[j]) < 0) {
+ si[(unsigned)(10000 * (logl(cur.currents[j]) + 100) / 100)]++;
+ }
+ }
+
boost::add_edge(net.G.dual_edges[i].v[0], net.G.dual_edges[i].v[1], {i}, G);
num++;
}
diff --git a/src/measurements.hpp b/src/measurements.hpp
index 961ad7a..5b76e26 100644
--- a/src/measurements.hpp
+++ b/src/measurements.hpp
@@ -34,6 +34,8 @@ class ma : public hooks {
std::vector<uint64_t> sa; // non-final avalanche size distribution
std::vector<uint64_t> sA; // non-final avalanche size distribution
+ std::vector<uint64_t> si;
+
public:
long double lv;