summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2019-05-06 15:00:10 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2019-05-06 15:00:10 -0400
commita9275adce368caaeaabc54bf0ca62a20a074e568 (patch)
tree7a1c4cc79dcb08cbeb8c35885866d9cf71035130 /src
parentd8f56eb5e7dfa41a21eb67503e570fd768d52109 (diff)
downloadfuse_networks-a9275adce368caaeaabc54bf0ca62a20a074e568.tar.gz
fuse_networks-a9275adce368caaeaabc54bf0ca62a20a074e568.tar.bz2
fuse_networks-a9275adce368caaeaabc54bf0ca62a20a074e568.zip
changed the way cutoffs function to prevent erros, and added measurement for path length
Diffstat (limited to 'src')
-rw-r--r--src/measurements.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/measurements.cpp b/src/measurements.cpp
index 841e61a..baead2c 100644
--- a/src/measurements.cpp
+++ b/src/measurements.cpp
@@ -146,7 +146,8 @@ ma::ma(unsigned n, double a, unsigned Mx, unsigned My, double beta) :
G(2 * n),
sc(2 * n),
sm(2 * n),
- sa(3 * n)
+ sa(3 * n),
+ sl(2 * n)
{
if (beta != 0.0) {
model_string = "fracture_" + std::to_string(n) + "_" + std::to_string(a) + "_" + std::to_string(beta) + "_";
@@ -157,9 +158,10 @@ ma::ma(unsigned n, double a, unsigned Mx, unsigned My, double beta) :
ma::ma(unsigned Lx, unsigned Ly, double beta) :
G(Lx * Ly / 2),
- sc(Lx * Ly / 2, 0),
- sm(Lx * Ly / 2, 0),
- sa(Lx * Ly, 0)
+ sc(Lx * Ly / 2),
+ sm(Lx * Ly / 2),
+ sa(Lx * Ly),
+ sl(Lx * Ly / 2)
{
if (beta != 0.0) {
model_string = "fracture_" + std::to_string(Lx) + "_" + std::to_string(Ly) + "_" + std::to_string(beta) + "_";
@@ -172,6 +174,7 @@ ma::~ma() {
update_distribution_file("sc", sc, model_string);
update_distribution_file("sm", sm, model_string);
update_distribution_file("sa", sa, model_string);
+ update_distribution_file("sl", sl, model_string);
}
void ma::pre_fracture(const network&) {
@@ -199,6 +202,9 @@ void ma::post_fracture(network &n) {
if (post_cracks.size() > 2 || post_cracks.size() == 0) {
throw badcycleex;
}
+ for (auto c : post_cracks) {
+ sl[c.second.size() - 1]++;
+ }
unsigned crack_component = component[n.G.dual_edges[post_cracks.front().second.front()].v[0]];
std::vector<std::list<graph::coordinate>> components(num);