aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhaas <rhaas@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45>2012-06-05 20:51:49 +0000
committerrhaas <rhaas@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45>2012-06-05 20:51:49 +0000
commit371c696bd27528e9ddf7de9cc69a2cda14d97dca (patch)
treee3b33288336cc30e58cf9b1abd2d6020703d70dd
parentbe144e41a258ad2e841e5af871a31ad10c2937ce (diff)
GRHydro: Fix slope limiters and get rid of broken cases;
there is a related patch in TRAC at the moment Patch by Josh Faber. Some additional checks by Roland Haas. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEvolve/GRHydro/trunk@351 c83d129a-5a75-4d5a-9c4d-ed3a5855bf45
-rw-r--r--param.ccl3
-rw-r--r--src/GRHydro_PreLoop.F909
-rw-r--r--src/GRHydro_Scalars.F902
-rw-r--r--src/GRHydro_TVDReconstruct.F9032
-rw-r--r--src/make.code.defn1
5 files changed, 19 insertions, 28 deletions
diff --git a/param.ccl b/param.ccl
index df6d9ae..cd9756e 100644
--- a/param.ccl
+++ b/param.ccl
@@ -116,10 +116,7 @@ keyword recon_vars "Which type of variables to reconstruct"
keyword tvd_limiter "Which slope limiter to use"
{
"minmod" :: "Minmod"
- "vanleerMC" :: "Van Leer MC - Ian"
"vanleerMC2" :: "Van Leer MC - Luca"
- "minmod2" :: "Minmod - Ian"
- "minmod3" :: "Minmod - Luca (or vice versa). Expect I've made a typo"
"Superbee" :: "Superbee"
} "minmod"
diff --git a/src/GRHydro_PreLoop.F90 b/src/GRHydro_PreLoop.F90
index bd15d1d..819bc0e 100644
--- a/src/GRHydro_PreLoop.F90
+++ b/src/GRHydro_PreLoop.F90
@@ -39,9 +39,6 @@ subroutine GRHydro_Scalar_Setup(CCTK_ARGUMENTS)
DECLARE_CCTK_FUNCTIONS
MINMOD = .false.
- MINMOD2 = .false.
- MINMOD3 = .false.
- MC1 = .false.
MC2 = .false.
SUPERBEE = .false.
HLLE = .false.
@@ -49,12 +46,6 @@ subroutine GRHydro_Scalar_Setup(CCTK_ARGUMENTS)
if (CCTK_EQUALS(tvd_limiter,"minmod")) then
MINMOD = .true.
- else if (CCTK_EQUALS(tvd_limiter,"minmod2")) then
- MINMOD2 = .true.
- else if (CCTK_EQUALS(tvd_limiter,"minmod3")) then
- MINMOD3 = .true.
- else if (CCTK_EQUALS(tvd_limiter,"vanleerMC")) then
- MC1 = .true.
else if (CCTK_EQUALS(tvd_limiter,"vanleerMC2")) then
MC2 = .true.
else if (CCTK_EQUALS(tvd_limiter,"Superbee")) then
diff --git a/src/GRHydro_Scalars.F90 b/src/GRHydro_Scalars.F90
index e62671a..37d4626 100644
--- a/src/GRHydro_Scalars.F90
+++ b/src/GRHydro_Scalars.F90
@@ -16,7 +16,7 @@
implicit none
- LOGICAL :: MINMOD, MINMOD2, MINMOD3, MC1, MC2, SUPERBEE, PPM3, PPM4
+ LOGICAL :: MINMOD, MC2, SUPERBEE, PPM3, PPM4
LOGICAL :: ANALYTICAL
LOGICAL :: FAST
LOGICAL :: HLLE, LLF
diff --git a/src/GRHydro_TVDReconstruct.F90 b/src/GRHydro_TVDReconstruct.F90
index 9abc8f2..526999d 100644
--- a/src/GRHydro_TVDReconstruct.F90
+++ b/src/GRHydro_TVDReconstruct.F90
@@ -79,22 +79,26 @@ subroutine tvdreconstruct(nx, ny, nz, xoffset, yoffset, zoffset, &
dloc = orig(i+xoffset, j+yoffset, k+zoffset) - orig(i, j, k)
if (MINMOD) then
- delta = minmod_func(dupw,dloc)
+ delta = minmod_func(dupw,dloc)
else if (MC2) then
-!!$ This is an alternative equivalent implementation
-!!$ of vanLeeer MC slopelimiter
- if (dupw*dloc < 0.d0) then
- delta=0.d0
- else
- delta=sign(min(2.d0*abs(dupw),2.d0*abs(dloc),&
- 0.5d0*(abs(dupw)+abs(dloc))),dupw+dloc)
- end if
+!!$ This is the van Leer MC slope limiter
+ if (dupw*dloc < 0.d0) then
+ delta=0.d0
+ else
+ delta=sign(min(2.d0*abs(dupw),2.d0*abs(dloc),&
+ 0.5d0*(abs(dupw)+abs(dloc))),dupw+dloc)
+ end if
+ else if (SUPERBEE) then
+ if (dupw*dloc < 0.d0) then
+ delta=0.d0
+ else
+ delta=sign(max(min(2.d0*abs(dupw),abs(dloc)),&
+ min(2.d0*abs(dloc),abs(dupw))),dupw+dloc)
+ end if
else
- delta = 0.5d0*(dupw + dloc)
- if (abs(dupw) < myfloor ) dupw = myfloor*sign(1.d0, dupw)
- if (abs(dloc) < myfloor ) dloc = myfloor*sign(1.d0, dloc)
- ratio = dupw / dloc
- call slopelimiter(ratio, delta)
+ call CCTK_WARN(0, "Type of limiter not recognized")
+ ! NOTREACHED
+ delta = 0d0
end if
hdelta = 0.5d0 * delta
bextm(i, j, k) = orig(i, j, k) - hdelta
diff --git a/src/make.code.defn b/src/make.code.defn
index 395ff82..25b0aa1 100644
--- a/src/make.code.defn
+++ b/src/make.code.defn
@@ -35,7 +35,6 @@ SRCS = Utils.F90 \
GRHydro_RoeSolver.F90 \
GRHydro_Scalars.F90 \
GRHydro_Shift.F90 \
- GRHydro_SlopeLimiter.F90 \
GRHydro_Source.F90 \
GRHydro_Startup.F90 \
GRHydro_TVDReconstruct.F90 \