From 2de471524c9e281e1b83049183d5a4deecd8b7b3 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Wed, 2 Oct 2019 10:52:05 -0400 Subject: Updated percolation and sample, percolation measurements presently gutted --- src/perc_meas.cpp | 62 ------------------------------------------------- src/perc_meas.hpp | 13 ----------- src/percolation.cpp | 4 ++-- src/sample_fracture.cpp | 2 +- 4 files changed, 3 insertions(+), 78 deletions(-) diff --git a/src/perc_meas.cpp b/src/perc_meas.cpp index f0d7cbb..4029204 100644 --- a/src/perc_meas.cpp +++ b/src/perc_meas.cpp @@ -71,10 +71,6 @@ void update_distribution_file(std::string id, const std::vector components(parent.begin(), parent.end()); - std::vector counts(components.size()); - - sN_tmp.push_front({}); - - BOOST_FOREACH(VertexIndex current_index, components) { - unsigned comp_size = 0; - BOOST_FOREACH(VertexIndex child_index, components[current_index]) { - comp_size++; - } - - sn[r][comp_size - 1]++; - sN_tmp.front().push_back(comp_size - 1); - } - std::vector vertex_in(net.G.vertices.size()); for (unsigned i = 0; i < net.G.edges.size(); i++) { @@ -179,39 +150,6 @@ void pm::bond_broken(const network& net, const current_info& cur, unsigned i) { } void pm::post_fracture(network &n) { - auto post_cracks = find_minimal_crack(G, n); - std::vector component(boost::num_vertices(G)); - unsigned num = boost::connected_components(G, &component[0]); - 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> components(num); - - for (unsigned i = 0; i < n.G.dual_vertices.size(); i++) { - components[component[i]].push_back(n.G.dual_vertices[i].r); - } - - for (unsigned i = 0; i < num; i++) { - if (i != crack_component) { - sm[components[i].size() - 1]++; - } else { - ss[components[i].size() - 1]++; - } - } - - unsigned dr = 0; - for (std::list l : sN_tmp) { - for (unsigned size : l) { - sN[dr][size]++; - } - dr++; - } - sd[r - 1]++; } diff --git a/src/perc_meas.hpp b/src/perc_meas.hpp index 75ef61a..b19b4a4 100644 --- a/src/perc_meas.hpp +++ b/src/perc_meas.hpp @@ -8,27 +8,14 @@ #include #include -#include - -#include -#include -#include -#include -#include #include "analysis_tools.hpp" -typedef boost::graph_traits::vertex_descriptor Vertex; -typedef boost::graph_traits::vertices_size_type VertexIndex; class pm : public hooks { private: unsigned r; current_info last_cur; - Graph G; - std::vector rank; - std::vector parent; - boost::disjoint_sets ds; // measurement storage std::vector> sn; // non-spanning cluster size distribution diff --git a/src/percolation.cpp b/src/percolation.cpp index b9f278e..0b1d0ad 100644 --- a/src/percolation.cpp +++ b/src/percolation.cpp @@ -81,7 +81,7 @@ int main(int argc, char* argv[]) { graph G(n, a, rng); percolation_network fuse_network(G, &c); fuse_network.set_thresholds(beta, rng); - fuse_network.fracture(meas, true); + fuse_network.fracture(meas); break; } catch (std::exception &e) { std::cout << e.what() << '\n'; @@ -99,7 +99,7 @@ int main(int argc, char* argv[]) { graph G(Lx, Ly); percolation_network fuse_network(G, &c); fuse_network.set_thresholds(beta, rng); - fuse_network.fracture(meas, true); + fuse_network.fracture(meas); break; } catch (std::exception &e) { std::cout << e.what() << '\n'; diff --git a/src/sample_fracture.cpp b/src/sample_fracture.cpp index 417e7ec..eaba69e 100644 --- a/src/sample_fracture.cpp +++ b/src/sample_fracture.cpp @@ -56,7 +56,7 @@ int main(int argc, char* argv[]) { graph G(Lx, 1.0, rng); elastic_network network(G, &c); network.set_thresholds(beta, rng); - network.fracture(meas, true); + network.fracture(meas); /*graph G2 = G.rotate(); class network network2(G2, &c); -- cgit v1.2.3-54-g00ecf