Repository: einsteintoolkit/Cactus — pull request #19 (cpp)
Title: Add missing GRHydro_RiemannSolveAM.F90 in EinsteinEvolve/GRHydro

This PR adds the missing source file GRHydro_RiemannSolveAM.F90 to complete the EinsteinEvolve/GRHydro thorn implementation.

Resolved issues:
title: Implement the full functionality of GRHydro
body: Please implement the full functionality of `GRHydro` by finishing the code in `GRHydro_RiemannSolveAM.F90`.

## Thorn Information:
- Name: GRHydro
- Target file: GRHydro_RiemannSolveAM.F90

## Interface Definition in interface.ccl:

## Schedule Definition in schedule.ccl:

## Parameters Definition in param.ccl:

## Configuration Definition in configuration.ccl:

## Documentation Context in readme.md and doc/documentation.tex

## Related Code Context in src folder



Hints:

Fix patch:
diff --git a/arrangements/EinsteinEvolve/GRHydro/src/GRHydro_RiemannSolveAM.F90 b/arrangements/EinsteinEvolve/GRHydro/src/GRHydro_RiemannSolveAM.F90
new file mode 100644
index 0000000..0000000
--- /dev/null
+++ b/arrangements/EinsteinEvolve/GRHydro/src/GRHydro_RiemannSolveAM.F90
@@ -0,0 +1,142 @@
+ /*@@
+   @file      GRHydro_RiemannSolveAM.F90
+   @date      Sep 1, 2010
+   @author    
+   @desc 
+   A wrapper routine to call the correct Riemann solver
+   @enddesc 
+ @@*/
+
+#include "cctk.h"
+#include "cctk_Parameters.h"
+#include "cctk_Arguments.h"
+#include "cctk_Functions.h"
+#include "GRHydro_Macros.h"
+
+ /*@@
+   @routine    RiemannSolveAM
+   @date       Sep 1, 2010
+   @author     Joshua Faber, Scott Noble, Bruno Mundim, Pedro Montero, Ian Hawke
+   @desc 
+   A wrapper routine to switch between the different Riemann solvers.
+   @enddesc 
+   @calls     
+   @calledby   
+   @history 
+ 
+   @endhistory 
+
+@@*/
+
+subroutine RiemannSolveAM(CCTK_ARGUMENTS)
+
+  implicit none
+  
+  DECLARE_CCTK_ARGUMENTS
+  DECLARE_CCTK_PARAMETERS
+  DECLARE_CCTK_FUNCTIONS
+
+  if (CCTK_EQUALS(riemann_solver,"HLLE").or.CCTK_EQUALS(riemann_solver,"LLF")) then
+     
+     call GRHydro_HLLE_AM(CCTK_PASS_FTOF)
+     
+     if (evolve_tracer .ne. 0) then
+        
+!!$ There are no special calls for tracers, which care not one whit about B-fields!    
+!!$ Just call the standard version...
+        
+        call GRHydro_HLLE_Tracer(CCTK_PASS_FTOF)
+        
+     end if
+     
+!!$  else if (CCTK_EQUALS(riemann_solver,"Roe")) then   
+!!$    
+!!$    call GRHydro_RoeSolveAM(CCTK_PASS_FTOF)
+!!$
+!!$    if (evolve_tracer .ne. 0) then
+!!$    
+!!$      call GRHydro_HLLE_Tracer(CCTK_PASS_FTOF)
+!!$
+!!$    end if
+!!$    
+!!$  else if (CCTK_EQUALS(riemann_solver,"Marquina")) then   
+!!$   
+!!$    call GRHydro_MarquinaM(CCTK_PASS_FTOF)
+     
+!!$    Tracers are built directly in to the Marquina solver
+     
+  else
+     
+     call CCTK_ERROR("Roe and Marquina not implemented in MHD yet!!!")
+     STOP
+     
+  end if
+  
+end subroutine RiemannSolveAM
+
+ /*@@
+   @routine    RiemannSolvePolytypeAM
+   @date       Sep 1, 2010
+   @author     Joshua Faber, Scott Noble, Bruno Mundim, Ian Hawke
+   @desc 
+   The same as above, just specializing to polytropic type EOS.
+   Currently there is no point to this routine right now.
+   @enddesc 
+   @calls     
+   @calledby   
+   @history 
+ 
+   @endhistory 
+
+@@*/
+
+
+subroutine RiemannSolvePolytypeAM(CCTK_ARGUMENTS)
+
+  implicit none
+  
+  DECLARE_CCTK_ARGUMENTS
+  DECLARE_CCTK_PARAMETERS
+  DECLARE_CCTK_FUNCTIONS
+
+  if (CCTK_EQUALS(riemann_solver,"HLLE")) then
+    
+     call GRHydro_HLLE_AM(CCTK_PASS_FTOF)
+     
+     if (evolve_tracer .ne. 0) then
+        
+!!$ Call the non-MHD version - see above
+        
+        call GRHydro_HLLE_Tracer(CCTK_PASS_FTOF)
+        
+     end if
+     
+!!$  else if (CCTK_EQUALS(riemann_solver,"Roe")) then   
+!!$    
+!!$    call GRHydro_RoeSolve(CCTK_PASS_FTOF)
+!!$
+!!$    if (evolve_tracer .ne. 0) then
+!!$    
+!!$      call GRHydro_HLLE_Tracer(CCTK_PASS_FTOF)
+!!$
+!!$    end if
+!!$    
+!!$  else if (CCTK_EQUALS(riemann_solver,"Marquina")) then   
+!!$    
+!!$    call GRHydro_Marquina(CCTK_PASS_FTOF)
+     
+!!$    Tracers are built directly in to the Marquina solver
+     
+  else
+     
+     call CCTK_ERROR("Roe and Marquina not implemented in MHD yet!!!")
+     STOP
+
+  end if
+  
+end subroutine RiemannSolvePolytypeAM
+
+
+
+
+

Test patch:
diff --git a/all_tests.txt b/all_tests.txt
new file mode 100644
index 0000000..0000000
--- /dev/null
+++ b/all_tests.txt
@@ -0,0 +1,10 @@
+GRHydro_test_shock
+GRHydro_test_shock_mp5
+GRHydro_test_shock_ppm
+GRHydro_test_tov_ppm_ML
+GRHydro_test_tov_ppm_ML_disable_internal_excision
+GRHydro_test_tov_ppm_no_trp_ML
+test_one_hybrid
+tov_carpetevolutionmask
+tov_carpetevolutionmask2
+tov_slowsector