summaryrefslogtreecommitdiff
path: root/src/animate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/animate.cpp')
-rw-r--r--src/animate.cpp26
1 files changed, 13 insertions, 13 deletions
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<unsigned int> component(boost::num_vertices(G));
- unsigned int num = boost::connected_components(G, &component[0]);
+ std::vector<unsigned> component(boost::num_vertices(G));
+ unsigned num = boost::connected_components(G, &component[0]);
- std::list<unsigned int> crack = find_minimal_crack(G, n);
- unsigned int crack_component = component[n.G.dual_edges[crack.front()].v[0]];
+ std::list<unsigned> crack = find_minimal_crack(G, n);
+ unsigned crack_component = component[n.G.dual_edges[crack.front()].v[0]];
- std::vector<std::list<unsigned int>> components(num);
+ std::vector<std::list<unsigned>> 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);