From ff7f1cea07f88346babda8a4987844fcc78587ce Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 6 Nov 2018 18:16:04 -0500 Subject: css now measures the crack surface correlations --- src/measurements.cpp | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/src/measurements.cpp b/src/measurements.cpp index 1159fd6..578c70a 100644 --- a/src/measurements.cpp +++ b/src/measurements.cpp @@ -243,23 +243,17 @@ void ma::post_fracture(network &n) { class find_cycle : public boost::default_dfs_visitor { public: unsigned int end; - std::list& V; std::list& E; struct done{}; - find_cycle(std::list& V, std::list& E, unsigned int end) : V(V), E(E), end(end) {} + find_cycle(std::list& E, unsigned int end) : E(E), end(end) {} void discover_vertex(boost::graph_traits::vertex_descriptor v, const Graph& g) { - V.push_back(v); if (v == end) { throw done{}; } } - void finish_vertex(boost::graph_traits::vertex_descriptor v, const Graph& g) { - V.remove(v); - } - void examine_edge(boost::graph_traits::edge_descriptor e, const Graph& g) { E.push_back(g[e].index); } @@ -269,23 +263,11 @@ void ma::post_fracture(network &n) { } }; - if (removed_edges.size() == 0) { - std::pair> currents = n.currents(); - std::cout << currents.first << "\n"; - for (unsigned int i = 0; i < L; i++) { - for (unsigned int j = 0; j < L; j++) { - std::cout << n.fuses[i * L + j] << " "; - } - std::cout << "\n"; - } - } - std::list> cycles; for (auto edge : removed_edges) { std::list cycle = {edge}; - std::list vcycle = {}; - find_cycle vis(vcycle, cycle, n.G.dual_edges[edge][1]); + find_cycle vis(cycle, n.G.dual_edges[edge][1]); std::vector new_color_map(boost::num_vertices(Gtmp)); try { boost::depth_first_visit(Gtmp, n.G.dual_edges[edge][0], vis, boost::make_iterator_property_map(new_color_map.begin(), boost::get(boost::vertex_index, Gtmp), new_color_map[0])); @@ -344,12 +326,6 @@ void ma::post_fracture(network &n) { crack = cycles.front(); } - for (auto edge : crack) { - std::cout << edge << " "; - } - std::cout << "\n"; -// std::cout << max_size << " " << boost::num_edges(Gtmp) << " " << removed_edges.size() << "\n"; - for (unsigned int be = 0; be < log2(L); be++) { unsigned int bin = pow(2, be); @@ -374,12 +350,8 @@ void ma::post_fracture(network &n) { // crack surface correlations std::vector crack_damage(pow(L, 2), 0.0); - double damage_tot = 0; - for (unsigned int i = 0; i < pow(L, 2); i++) { - if (!n.fuses[i] && max_i == component[n.G.dual_edges[i][0]]) { - damage_tot++; - crack_damage[i] = 1.0; - } + for (auto edge : crack) { + crack_damage[edge] = 1.0; } std::vector t_crack_damage = data_transform(L, crack_damage, forward_plan, fftw_forward_in, fftw_forward_out); -- cgit v1.2.3-70-g09d2