technically everything works, but CoM is not preserved

This commit is contained in:
2019-07-12 21:51:24 +02:00
parent c52fbe796d
commit dba5664cf3
3 changed files with 38 additions and 34 deletions

View File

@@ -115,10 +115,11 @@ interaction_ufunc_float2D
// Update the momenta.
delta_p_x = delta_x_e * interaction_force_function(r, coefficients);
delta_p_y = delty_y_e * interaction_force_function(r, coefficients);
*(float *)(p_x_new + i*p_x_new_steps) -= delta_p_x;
*(float *)(p_y_new + i*p_y_new_steps) -= delta_p_y;
*(float *)(p_x_new + j*p_x_new_steps) += delta_p_x;
*(float *)(p_y_new + j*p_y_new_steps) += delta_p_y;
//printf("%d, %d: %f, %f\n", i, j, delta_p_x, delta_p_y);
*(float *)(p_x_new + i*p_x_new_steps) += delta_p_x;
*(float *)(p_y_new + i*p_y_new_steps) += delta_p_y;
*(float *)(p_x_new + j*p_x_new_steps) -= delta_p_x;
*(float *)(p_y_new + j*p_y_new_steps) -= delta_p_y;
}
}
}