aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/prolongate_3d_real8_eno.F90
diff options
context:
space:
mode:
authorcott <cott@otto.(none)>2008-10-08 08:38:09 -0700
committercott <cott@otto.(none)>2008-10-08 08:38:09 -0700
commitc73e059d6c07eabf7b728b8588f50d98c6371338 (patch)
tree9f82cda5f58678ae5e7104e2f046c93c645f5f61 /Carpet/CarpetLib/src/prolongate_3d_real8_eno.F90
parentf091cf09cc7b6dbc8284915a6b093a0a9f82e646 (diff)
* add additional check to eno1d: We want to interpolate
quadratically only if the sign of the curvature of the interpolating polynomial does not change. * add a few more comments / explanations.
Diffstat (limited to 'Carpet/CarpetLib/src/prolongate_3d_real8_eno.F90')
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_real8_eno.F9012
1 files changed, 10 insertions, 2 deletions
diff --git a/Carpet/CarpetLib/src/prolongate_3d_real8_eno.F90 b/Carpet/CarpetLib/src/prolongate_3d_real8_eno.F90
index b29b21580..4b5be092e 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_real8_eno.F90
+++ b/Carpet/CarpetLib/src/prolongate_3d_real8_eno.F90
@@ -40,6 +40,8 @@ function eno1d(q)
CCTK_REAL8 :: diffleft, diffright
!!$ Directly find the second undivided differences
+!!$ We need to pick between discrete values at
+!!$ 1 2 3 4 for the interpolation between 2 and 3.
diffleft = q(1) + q(3) - two * q(2)
diffright = q(2) + q(4) - two * q(3)
@@ -58,9 +60,15 @@ function eno1d(q)
end if
-!!$ Check that the quadratic is reasonable
+!!$ Check that the quadratic is reasonable:
+!!$ Check 1: interpolated value between
+!!$ values at interpolation points
+!!$ Check 2: sign of the curvature of the interpolating
+!!$ polynomial does not change.
- if ( (eno1d-q(2)) * (q(3)-eno1d) .lt. zero ) then
+ if ( ((eno1d-q(2)) * (q(3)-eno1d) .lt. zero) &
+ .or. &
+ (diffleft*diffright .le. zero) ) then
!!$ Not reasonable. Linear interpolation