summaryrefslogtreecommitdiff
path: root/src/perc_meas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/perc_meas.cpp')
-rw-r--r--src/perc_meas.cpp62
1 files changed, 0 insertions, 62 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<std::vector<uint
}
pm::pm(unsigned n, double a) :
- G(2 * n),
- rank(2 * n),
- parent(2 * n),
- ds(&rank[0], &parent[0]),
sn(3 * n),
sN(3 * n),
ss(2 * n),
@@ -96,10 +92,6 @@ pm::pm(unsigned n, double a) :
}
pm::pm(unsigned Lx, unsigned Ly) :
- G(Lx * Ly / 2),
- rank(Lx * Ly / 2),
- parent(Lx * Ly / 2),
- ds(&rank[0], &parent[0]),
sn(Lx * Ly),
sN(Lx * Ly),
ss(Lx * Ly / 2),
@@ -131,32 +123,11 @@ pm::~pm() {
}
void pm::pre_fracture(const network&) {
- boost::remove_edge_if(trivial, G);
- initialize_incremental_components(G, ds);
- incremental_components(G, ds);
r = 0;
sN_tmp.clear();
}
void pm::bond_broken(const network& net, const current_info& cur, unsigned i) {
- boost::add_edge(net.G.dual_edges[i].v[0], net.G.dual_edges[i].v[1], {i}, G);
- ds.union_set(net.G.dual_edges[i].v[0], net.G.dual_edges[i].v[1]);
-
- boost::component_index<VertexIndex> components(parent.begin(), parent.end());
- std::vector<unsigned> 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<bool> 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<unsigned> 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<std::list<graph::coordinate>> 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<unsigned> l : sN_tmp) {
- for (unsigned size : l) {
- sN[dr][size]++;
- }
- dr++;
- }
-
sd[r - 1]++;
}