From e3b663588a30ec4f05afe50c260982bd44a1bb2b Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 24 Jan 2019 19:01:18 -0500 Subject: style changes --- src/animate.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/animate.cpp') diff --git a/src/animate.cpp b/src/animate.cpp index 4f10e0a..5bae15e 100644 --- a/src/animate.cpp +++ b/src/animate.cpp @@ -1,10 +1,10 @@ #include "animate.hpp" -animate::animate(double Lx, double Ly, unsigned int window_size, int argc, char *argv[]) : G(2 * (unsigned int)ceil(Lx * Ly / 2)) { +animate::animate(double Lx, double Ly, unsigned window_size, int argc, char *argv[]) : G(2 * (unsigned)ceil(Lx * Ly / 2)) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); - glutInitWindowSize((unsigned int)(Lx / Ly * window_size), window_size); + glutInitWindowSize((unsigned)(Lx / Ly * window_size), window_size); glutCreateWindow("wolff"); glClearColor(0.0,0.0,0.0,0.0); glMatrixMode(GL_PROJECTION); @@ -21,7 +21,7 @@ void animate::pre_fracture(const network &n) { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); - for (unsigned int i = 0; i < n.G.edges.size(); i++) { + for (unsigned i = 0; i < n.G.edges.size(); i++) { graph::coordinate r1 = n.G.vertices[n.G.edges[i].v[0]].r; graph::coordinate r2 = n.G.vertices[n.G.edges[i].v[1]].r; @@ -47,7 +47,7 @@ void animate::pre_fracture(const network &n) { glFlush(); } -void animate::bond_broken(const network& n, const current_info& cur, unsigned int i) { +void animate::bond_broken(const network& n, const current_info& cur, unsigned i) { long double c = logl(cur.conductivity / fabs(cur.currents[i])) + n.thresholds[i]; if (c > lv && avalanches.back().size() > 0) { lv = c; @@ -85,15 +85,15 @@ void animate::bond_broken(const network& n, const current_info& cur, unsigned in } void animate::post_fracture(network &n) { - std::vector component(boost::num_vertices(G)); - unsigned int num = boost::connected_components(G, &component[0]); + std::vector component(boost::num_vertices(G)); + unsigned num = boost::connected_components(G, &component[0]); - std::list crack = find_minimal_crack(G, n); - unsigned int crack_component = component[n.G.dual_edges[crack.front()].v[0]]; + std::list crack = find_minimal_crack(G, n); + unsigned crack_component = component[n.G.dual_edges[crack.front()].v[0]]; - std::vector> components(num); + std::vector> components(num); - for (unsigned int i = 0; i < n.G.dual_vertices.size(); i++) { + for (unsigned i = 0; i < n.G.dual_vertices.size(); i++) { components[component[i]].push_back(i); } @@ -106,7 +106,7 @@ void animate::post_fracture(network &n) { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); - for (unsigned int i = 0; i < n.G.edges.size(); i++) { + for (unsigned i = 0; i < n.G.edges.size(); i++) { if (!n.fuses[i]) { graph::coordinate r1 = n.G.vertices[n.G.edges[i].v[0]].r; graph::coordinate r2 = n.G.vertices[n.G.edges[i].v[1]].r; @@ -151,7 +151,7 @@ void animate::post_fracture(network &n) { break; case 'c' : - for (unsigned int i = 0; i < num; i++) { + for (unsigned i = 0; i < num; i++) { if (i == crack_component) { glColor3d(1.0, 0.0, 0.0); } else { @@ -170,7 +170,7 @@ void animate::post_fracture(network &n) { break; case 'C' : - for (unsigned int i = 0; i < num; i++) { + for (unsigned i = 0; i < num; i++) { if (components[i].size() > 1) { if (i == crack_component) { glColor3d(1.0, 0.0, 0.0); -- cgit v1.2.3-70-g09d2