summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2019-06-12 10:34:51 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2019-06-12 10:34:51 -0400
commite76333883d3620622ac616b7ca68a8baf459c640 (patch)
treef9a878d2f74defacc2175633386c20bbb96ebead
parent749247d24cca4657570e6c2a974321a94a49a0cc (diff)
downloadfuse_networks-e76333883d3620622ac616b7ca68a8baf459c640.tar.gz
fuse_networks-e76333883d3620622ac616b7ca68a8baf459c640.tar.bz2
fuse_networks-e76333883d3620622ac616b7ca68a8baf459c640.zip
fixed the current cutoff is the percolation measurements
-rw-r--r--lib/include/network.hpp2
-rw-r--r--lib/src/network.cpp2
-rw-r--r--src/perc_meas.cpp4
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/include/network.hpp b/lib/include/network.hpp
index 1ffe742..62e27d6 100644
--- a/lib/include/network.hpp
+++ b/lib/include/network.hpp
@@ -14,6 +14,8 @@
#include "current_info.hpp"
#include "array_hash.hpp"
+#define CURRENT_CUTOFF 1e-11
+
class network {
public:
const graph& G;
diff --git a/lib/src/network.cpp b/lib/src/network.cpp
index 05a208f..3424b94 100644
--- a/lib/src/network.cpp
+++ b/lib/src/network.cpp
@@ -1,8 +1,6 @@
#include "network.hpp"
-#define CURRENT_CUTOFF 1e-11
-
class nofuseException: public std::exception
{
virtual const char* what() const throw()
diff --git a/src/perc_meas.cpp b/src/perc_meas.cpp
index 23b46b3..e400982 100644
--- a/src/perc_meas.cpp
+++ b/src/perc_meas.cpp
@@ -147,7 +147,7 @@ void pm::bond_broken(const network& net, const current_info& cur, unsigned i) {
std::vector<bool> vertex_in(net.G.vertices.size());
for (unsigned i = 0; i < net.G.edges.size(); i++) {
- if (cur.currents[i] > 1.0 / pow(net.G.edges.size(), 2)) {
+ if (cur.currents[i] > CURRENT_CUTOFF) {
vertex_in[net.G.edges[i].v[0]] = true;
vertex_in[net.G.edges[i].v[1]] = true;
}
@@ -198,7 +198,7 @@ void pm::post_fracture(network &n) {
std::vector<bool> vertex_in(n.G.vertices.size());
for (unsigned i = 0; i < n.G.edges.size(); i++) {
- if (last_cur.currents[i] > 1.0 / n.G.edges.size()) {
+ if (last_cur.currents[i] > CURRENT_CUTOFF) {
vertex_in[n.G.edges[i].v[0]] = true;
vertex_in[n.G.edges[i].v[1]] = true;
}