Commits

Alexander Konovalov committed 5fddefd

Fixed compilation errors.

Comments (0)

Files changed (1)

 
 ModelData data;
 
-void AdvanceVelocity(Particle const& particle, double dt) {
-    particle.v += particle.w * dt + particle.w1 * dt * dt / 2 + particle.w2 * dt * dt * dt / 6;
+void AdvanceVelocity(Particle* particle, double dt) {
+    particle->v += particle->w * dt + particle->w1 * dt * dt / 2 + particle->w2 * dt * dt * dt / 6;
 }
 
 // FIXME[alexknvl]: A better name?
-void AdvancePosition(Particle const& particle, double dt) {
-    particle.p += particle.w * dt * dt / 2 + particle.w1 * dt * dt * dt / 6
-        + particle.w2 * dt * dt * dt * dt / 24;
+void AdvancePosition(Particle* particle, double dt) {
+    particle->p += particle->w * dt * dt / 2 + particle->w1 * dt * dt * dt / 6
+        + particle->w2 * dt * dt * dt * dt / 24;
 }
 
 void FindNearest99Neighbours(size_t j) {
         particles[nmax].w1 = wn1;
         particles[nmax].w2 = wn2;
 
-        particles[nmax].AdvancePosition(dt);
-        particles[nmax].AdvanceVelocity(dt);
+        AdvancePosition(&particles[nmax], dt);
+        AdvanceVelocity(&particles[nmax], dt);
     }
 
-    particles[numi].AdvancePosition(dt);
-    particles[numi].AdvanceVelocity(dt);
+    AdvancePosition(&particles[numi], dt);
+    AdvanceVelocity(&particles[numi], dt);
 
     data.time += dt;
 }