tFix velocity-constraint nan-output when initial forcing is below yield - cngf-… | |
git clone git://src.adamsgaard.dk/cngf-pf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 7aae935b8bcbc846acbc37ef0a279042061b2e51 | |
parent d2352ce3b61f0effffb1ffff16888e00b66cb013 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Wed, 21 Aug 2019 10:42:09 +0200 | |
Fix velocity-constraint nan-output when initial forcing is below yield | |
Diffstat: | |
M main.c | 4 ++-- | |
1 file changed, 2 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/main.c b/main.c | |
t@@ -313,12 +313,12 @@ main(int argc, char* argv[]) | |
if (!isnan(sim.v_x_limit) || !isnan(sim.v_x_fix)) { | |
if (!isnan(sim.v_x_limit)) { | |
res_norm = (sim.v_x_limit - sim.v_x[si… | |
- /sim.v_x[sim.nz-1]; | |
+ /(sim.v_x[sim.nz-1] + 1e-12… | |
if (res_norm > 0.0) | |
res_norm = 0.0; | |
} else { | |
res_norm = (sim.v_x_fix - sim.v_x[sim.… | |
- /sim.v_x[sim.nz-1]; | |
+ /(sim.v_x[sim.nz-1] + 1e-12… | |
} | |
sim.mu_wall *= 1.0 + (res_norm*1e-2); | |
} |