tdisregard backward euler estimate in first iteration - sphere - GPU-based 3D d… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 577e781f0a7d37a8e713288a710ed44773c25b9e | |
parent ef0c5c667eeab770245e87f4d4664aacee5c9081 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Wed, 26 Nov 2014 11:34:44 +0100 | |
disregard backward euler estimate in first iteration | |
Diffstat: | |
M src/darcy.cuh | 10 ++++++---- | |
1 file changed, 6 insertions(+), 4 deletions(-) | |
--- | |
diff --git a/src/darcy.cuh b/src/darcy.cuh | |
t@@ -440,11 +440,13 @@ __global__ void findDarcyPorosities( | |
// Forwards Euler | |
//Float dphi = phi_new - phi; | |
- // Central difference | |
- Float dphi = 0.5*(phi_new - phi_0); | |
+ // Central difference after first iteration | |
+ Float dphi; | |
+ if (iteration > 0) | |
+ dphi = phi_new - phi; | |
+ else | |
+ dphi = 0.5*(phi_new - phi_0); | |
- /*if (iteration == 0) | |
- dphi = 0.0;*/ | |
// report values to stdout for debugging | |
//printf("%d,%d,%d\tphi = %f dphi = %f\n", x,y,z, phi, dphi); |