From 5e661dafe7f659025d3417df36ba702ab183e825 Mon Sep 17 00:00:00 2001 From: diener Date: Fri, 16 May 2003 15:31:37 +0000 Subject: Changed the upwinding scheme to strictly upwind in the direction of the characteristics. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/EHFinder/trunk@107 2a26948c-0e4f-0410-aee8-f1d3e353619c --- src/include/upwind_characteristic_second2.h | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/include/upwind_characteristic_second2.h b/src/include/upwind_characteristic_second2.h index e851859..25c317d 100644 --- a/src/include/upwind_characteristic_second2.h +++ b/src/include/upwind_characteristic_second2.h @@ -67,11 +67,11 @@ if ( eh_mask(i,j,k) .ge. 0 ) then ! Choose the stencil, that gives the smalles second derivative. ! If it happens to be the centered, do not do anything since we have ! already calculated the centered derivative. - if ( f(i-2,j,k) - two * f(i-1,j,k) + f(i,j,k) .le. & - f(i-1,j,k) - two * f(i,j,k) + f(i+1,j,k) ) then +! if ( f(i-2,j,k) - two * f(i-1,j,k) + f(i,j,k) .le. & +! f(i-1,j,k) - two * f(i,j,k) + f(i+1,j,k) ) then dfx(i,j,k) = idx * ( three * f(i,j,k) - & four * f(i-1,j,k) + f(i-2,j,k) ) - end if +! end if end if else if ( cdx(1) .lt. zero ) then ! Choose the stencil to the right. @@ -85,11 +85,11 @@ if ( eh_mask(i,j,k) .ge. 0 ) then ! Choose the stencil, that gives the smalles second derivative. ! If it happens to be the centered, do not do anything since we have ! already calculated the centered derivative. - if ( f(i-1,j,k) - two * f(i,j,k) + f(i+1,j,k) .ge. & - f(i,j,k) - two * f(i+1,j,k) + f(i+2,j,k) ) then +! if ( f(i-1,j,k) - two * f(i,j,k) + f(i+1,j,k) .ge. & +! f(i,j,k) - two * f(i+1,j,k) + f(i+2,j,k) ) then dfx(i,j,k) = idx * ( -three * f(i,j,k) + & four * f(i+1,j,k) - f(i+2,j,k) ) - end if +! end if end if end if end if @@ -100,19 +100,19 @@ if ( eh_mask(i,j,k) .ge. 0 ) then if ( cdx(2) .gt. zero ) then ! Choose the stencil to the left. if ( eh_mask(i,j-1,k) .eq. 0 ) then - if ( f(i,j-2,k) - two * f(i,j-1,k) + f(i,j,k) .le. & - f(i,j-1,k) - two * f(i,j,k) + f(i,j+1,k) ) then +! if ( f(i,j-2,k) - two * f(i,j-1,k) + f(i,j,k) .le. & +! f(i,j-1,k) - two * f(i,j,k) + f(i,j+1,k) ) then dfy(i,j,k) = idy * ( three * f(i,j,k) - & four * f(i,j-1,k) + f(i,j-2,k) ) - end if +! end if end if else if ( cdx(2) .lt. zero ) then ! Choose the stencil to the left. if ( eh_mask(i,j+1,k) .eq. 0 ) then - if ( f(i,j-1,k) - two * f(i,j,k) + f(i,j+1,k) .ge. & - f(i,j,k) - two * f(i,j+1,k) + f(i,j+2,k) ) then +! if ( f(i,j-1,k) - two * f(i,j,k) + f(i,j+1,k) .ge. & +! f(i,j,k) - two * f(i,j+1,k) + f(i,j+2,k) ) then dfy(i,j,k) = idy * ( -three * f(i,j,k) + & four * f(i,j+1,k) - f(i,j+2,k) ) - end if +! end if end if end if end if @@ -123,19 +123,19 @@ if ( eh_mask(i,j,k) .ge. 0 ) then if ( cdx(3) .gt. zero ) then if ( eh_mask(i,j,k-1) .eq. 0 ) then - if ( f(i,j,k-2) - two * f(i,j,k-1) + f(i,j,k) .le. & - f(i,j,k-1) - two * f(i,j,k) + f(i,j,k+1) ) then +! if ( f(i,j,k-2) - two * f(i,j,k-1) + f(i,j,k) .le. & +! f(i,j,k-1) - two * f(i,j,k) + f(i,j,k+1) ) then dfz(i,j,k) = idz * ( three * f(i,j,k) - & four * f(i,j,k-1) + f(i,j,k-2) ) - end if +! end if end if else if ( cdx(3) .lt. zero ) then if ( eh_mask(i,j,k+1) .eq. 0 ) then - if ( f(i,j,k-1) - two * f(i,j,k) + f(i,j,k+1) .ge. & - f(i,j,k) - two * f(i,j,k+1) + f(i,j,k+2) ) then +! if ( f(i,j,k-1) - two * f(i,j,k) + f(i,j,k+1) .ge. & +! f(i,j,k) - two * f(i,j,k+1) + f(i,j,k+2) ) then dfz(i,j,k) = idz * ( -three * f(i,j,k) + & four * f(i,j,k+1) - f(i,j,k+2) ) - end if +! end if end if end if end if -- cgit v1.2.3