tnormal force >= 0 to avoid attractive forces - sphere - GPU-based 3D discrete … | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit acfb51a80f5db56f5fd790c3265c105a9f7a506b | |
parent 4bc599379dd9e96126e869a43c6f1fe54de039d5 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 19 Jun 2014 09:59:57 +0200 | |
normal force >= 0 to avoid attractive forces | |
Diffstat: | |
M src/contactmodels.cuh | 4 +++- | |
1 file changed, 3 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/src/contactmodels.cuh b/src/contactmodels.cuh | |
t@@ -206,7 +206,9 @@ __device__ void contactLinearViscous(Float3* F, Float3* T, | |
//f_n = -devC_params.k_n * delta_ab * n_ab; | |
// Normal force component: Elastic - viscous damping | |
- f_n = (-devC_params.k_n * delta_ab - devC_params.gamma_n * vel_n_ab) * n_a… | |
+ f_n = fmax(0.0, | |
+ (-devC_params.k_n * delta_ab | |
+ - devC_params.gamma_n * vel_n_ab) * n_ab); | |
// Make sure the viscous damping doesn't exceed the elastic component, | |
// i.e. the damping factor doesn't exceed the critical damping, 2*sqrt(m*k… |