[Commits] [svn:einsteintoolkit] IllinoisGRMHD/trunk/ (Rev. 5)

zachetie at gmail.com zachetie at gmail.com
Tue Oct 1 18:35:07 CDT 2013


User: zetienne
Date: 2013/10/01 06:35 PM

Added:
 /trunk/
  configuration.ccl, interface.ccl, param.ccl, schedule.ccl

Log:
 Move to trunk, part 2.

File Changes:

Directory: /trunk/
==================

File [added]: configuration.ccl
Delta lines: +9 -0
===================================================================
--- trunk/configuration.ccl	                        (rev 0)
+++ trunk/configuration.ccl	2013-10-01 23:35:07 UTC (rev 5)
@@ -0,0 +1,9 @@
+# Configuration definition for thorn IllinoisGRMHD
+PROVIDES IllinoisGRMHD
+{
+  SCRIPT
+  LANG
+}
+
+# A list of thorns that must be compiled with this one. (Incomplete, but okay if you use the appropriate ThornList)
+REQUIRES CartGrid3D excision bssn

File [added]: interface.ccl
Delta lines: +138 -0
===================================================================
--- trunk/interface.ccl	                        (rev 0)
+++ trunk/interface.ccl	2013-10-01 23:35:07 UTC (rev 5)
@@ -0,0 +1,138 @@
+# Interface definition for thorn IllinoisGRMHD
+
+implements: IllinoisGRMHD
+inherits: grid
+
+USES INCLUDE: Symmetry.h
+friend: BSSN
+friend: lapse
+friend: shift
+friend: excision
+friend: fisheye
+
+protected:
+
+#vvvvvvvv EVOLVED VARIABLES vvvvvvvv#
+cctk_real grmhd_conservatives type = GF TAGS='prolongation="Lag3"' Timelevels=3
+{
+  rho_star,tau,mhd_st_x,mhd_st_y,mhd_st_z
+} "Evolved mhd variables"
+
+# These variables are semi-staggered:
+# Ax is defined on the semi-staggered grid (i,j+1/2,k+1/2)
+cctk_real em_Ax type = GF Timelevels=3 tags='Prolongation="STAGGER011"'
+{
+  Ax
+} "x-component of the vector potential, evolved when constrained_transport_scheme==3"
+# Ay is defined on the semi-staggered grid (i+1/2,j,k+1/2)
+cctk_real em_Ay type = GF Timelevels=3 tags='Prolongation="STAGGER101"'
+{
+  Ay
+} "y-component of the vector potential, evolved when constrained_transport_scheme==3"
+# Az is defined on the semi-staggered grid (i+1/2,j+1/2,k)
+cctk_real em_Az type = GF Timelevels=3 tags='Prolongation="STAGGER110"'
+{
+  Az
+} "z-component of the vector potential, evolved when constrained_transport_scheme==3"
+
+# psi6phi is defined on the staggered grid (i+1/2,j+1/2,k+1/2)
+cctk_real em_psi6phi type = GF Timelevels=3 tags='Prolongation="STAGGER111"'
+{
+  psi6phi 
+} "\sqrt{\gamma} \Phi, where Phi is the em scalar potential"
+#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
+
+
+#vvvvvvv PRIMITIVE VARIABLES vvvvvvv#
+cctk_real grmhd_primitives_allbutBi type = GF TAGS='InterpNumTimelevels=1 prolongation="none"'
+{
+  rho_b,P,vx,vy,vz,u0
+}
+cctk_real grmhd_primitives_Bi type = GF TAGS='InterpNumTimelevels=1 prolongation="none"'
+{
+  Bx,By,Bz,Bx_stagger,By_stagger,Bz_stagger
+}
+#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
+
+#vvvvvvv EQUATION OF STATE VARIABLES vvvvvvv#
+REAL eos_params_arrays1 TYPE=ARRAY DISTRIB=CONSTANT DIM=1 SIZE=10
+{
+  rho_tab,P_tab,eps_tab
+} "eos_parameters"
+
+REAL eos_params_arrays2 TYPE=ARRAY DISTRIB=CONSTANT DIM=1 SIZE=11
+{
+  k_tab,gamma_tab
+} "eos_parameters"
+
+REAL eos_params_scalar TYPE = SCALAR 
+{
+  n_poly
+} "polytropic index"
+#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
+
+
+private:
+
+#vvvvvvv TEMPORARY VARIABLES FOR RECONSTRUCTION vvvvvvv#
+cctk_real grmhd_primitives_reconstructed_temps type = GF TAGS='Checkpoint="no"'
+{
+  ftilde_gf,temporary,
+  rho_br,Pr,vxr,vyr,vzr,Bxr,Byr,Bzr,Bx_staggerr,By_staggerr,Bz_staggerr,
+  rho_bl,Pl,vxl,vyl,vzl,Bxl,Byl,Bzl,Bx_staggerl,By_staggerl,Bz_staggerl,
+  vxrr,vxrl,vyrr,vyrl,vzrr,vzrl,vxlr,vxll,vylr,vyll,vzlr,vzll
+}
+#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
+
+#vvvvvvv RHS VARIABLES vvvvvvv#
+cctk_real grmhd_conservatives_rhs type = GF TAGS='Checkpoint="no"'
+{
+  rho_star_rhs,tau_rhs,st_x_rhs,st_y_rhs,st_z_rhs
+}
+
+cctk_real em_Ax_rhs type = GF TAGS='Checkpoint="no"'
+{ 
+  Ax_rhs 
+}
+cctk_real em_Ay_rhs type = GF TAGS='Checkpoint="no"'
+{
+  Ay_rhs 
+}
+cctk_real em_Az_rhs type = GF TAGS='Checkpoint="no"'
+{ 
+  Az_rhs 
+}
+cctk_real em_psi6phi_rhs type = GF TAGS='Checkpoint="no"'
+{
+  psi6phi_rhs 
+}
+#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
+
+#vvvvvvv TEMPORARY VARIABLES USEFUL FOR A-FIELD EVOLUTION vvvvvvv#
+cctk_real grmhd_cmin_cmax_temps type = GF TAGS='Checkpoint="no"'
+{
+  cmin_x,cmax_x,
+  cmin_y,cmax_y,
+  cmin_z,cmax_z
+}
+#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
+
+#vvvvvvv TEMPORARY VARIABLES USEFUL FOR FLUX COMPUTATION vvvvvvv#
+cctk_real grmhd_flux_temps type = GF TAGS='Checkpoint="no"'
+{
+  rho_star_flux,tau_flux,st_x_flux,st_y_flux,st_z_flux
+}
+#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
+
+#vvvvvvv T^{\mu \nu}, stored to avoid expensive recomputation vvvvvvv#
+cctk_real TUPmunu type = GF TAGS='Checkpoint="no"'
+{
+  TUPtt,TUPtx,TUPty,TUPtz,TUPxx,TUPxy,TUPxz,TUPyy,TUPyz,TUPzz
+}
+
+###########################################################################
+# Following needed for MoL (timestepping):
+CCTK_INT FUNCTION MoLRegisterEvolvedGroup(CCTK_INT IN EvolvedIndex, \
+                                          CCTK_INT IN RHSIndex)
+REQUIRES FUNCTION MoLRegisterEvolvedGroup
+###########################################################################

File [added]: param.ccl
Delta lines: +103 -0
===================================================================
--- trunk/param.ccl	                        (rev 0)
+++ trunk/param.ccl	2013-10-01 23:35:07 UTC (rev 5)
@@ -0,0 +1,103 @@
+# Parameter definitions for thorn IllinoisGRMHD
+shares: bssn
+USES KEYWORD zero_out_matter_source_terms
+
+#########################################################
+# Timestepping (MoL) stuff
+shares: MethodOfLines
+
+USES CCTK_INT MoL_Num_Evolved_Vars
+
+restricted:
+CCTK_INT IllinoisGRMHD_MaxNumEvolvedVars "The maximum number of evolved variables used by BSSN" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Evolved_Vars
+{
+  9:9           :: "Just 9: rho_star,tau,mhd_st_x,mhd_st_y,mhd_st_z,Ax,Ay,Az, and psi6phi"
+} 9
+#########################################################
+
+restricted:
+
+#########################################################
+# CONSERV TO PRIMS PARAMETERS
+INT tau_stildefix_enable "tau<0 fix in primitive_vars_hybrid2 to reduce number of Font fixes, especially in puncture+matter evolutions" STEERABLE=ALWAYS
+{
+ 0:3 :: "zero (disable), one (enable everywhere), or two (enable only where Psi6 > 50.0 [i.e., inside the horizon, where B's are set to zero], or three (kludge: set B=0 if tau<0 inside horizon))"
+} 0
+
+REAL tau_atm "Parameter used only when tau_stildefix_enable==1.  Should be set by your initial data thorn!  If you need to change this parameter mid-run, you'll need to set STEERABLE=ALWAYS!"
+{
+ 0:* :: "Positive"
+} 100.000
+
+REAL rho_b_atm "Atmosphere value of rho_b.  Should be set by your initial data thorn!  If you need to change this parameter mid-run, you'll need to set STEERABLE=ALWAYS!" STEERABLE=ALWAYS
+{
+ *:* :: "Allow for negative values.  This enables us to debug the code and verify if rho_b_atm is properly set."
+} 100.000
+
+INT conserv_to_prims_debug "0: no, 1: yes" STEERABLE=ALWAYS
+{
+ 0:1 :: "zero (no) or one (yes)"
+} 0
+
+REAL Psi6threshold "Where Psi^6 > Psi6threshold, we assume we're inside the horizon in the primitives solver, and certain limits are relaxed or imposed" STEERABLE=ALWAYS
+{
+ *:* :: "Can set to anything"
+} 1e100
+#########################################################
+
+#########################################################
+# EQUATION OF STATE PARAMS, LOOK FOR MORE IN interface.ccl!
+INT neos "number of parameters in EOS table. If you want to increase from the default max value, you MUST also set eos_params_arrays1 and eos_params_arrays2 in interface.ccl to be consistent!"
+{
+ 1:10 :: "Any integer between 1 and 10"
+} 1
+
+REAL gamma_th "thermal gamma parameter"
+{
+ *:* :: "Any real"
+} 1.3
+
+REAL K_poly "initial polytropic constant"
+{
+ 0:* :: "Positive"
+} 1.0
+#########################################################
+
+#########################################################
+# BOUNDARY CONDITION PARAMS
+INT Matter_BC "Chosen Matter boundary condition: OUTFLOW = 1,FREEZE = 2,COPY = 3,LINEAR = 4,QUADRATIC = 5,PLANAR = 6"
+{
+ *:* :: "Any integer"
+} 1
+
+INT EM_BC "EM field boundary condition"
+{
+ 1:5 :: "COPY=1, FREEZE=2, EXTRAP=3, QUAD=4, PLANAR=5"
+} 1
+
+REAL Sym_Bz "Symmetry parameter across z axis for magnetic fields = +/- 1"
+{
+ -1.0:1.0 :: "Set to +1 or -1."
+} 1.0
+#########################################################
+
+###############################################################################################
+
+private:
+
+#########################################################
+# EVOLUTION PARAMS
+REAL damp_lorenz "Damping factor for Lorenz gauge. Has units of 1/length = 1/M. Try using the same value as used for the eta parameter, or smaller! Brian tried 0.1 with ADM mass of 1." STEERABLE=ALWAYS
+{
+ *:* :: "any real"
+} 0.0
+#########################################################
+
+#########################################################
+# SANITY CHECK, 
+#   (to ensure equation of state is properly set up)
+INT really_want_gamma_th_of_1_point_3 "Show gamma_th error message if gamma_th has not been reset from its default value (of 1.3).  You must set gamma_th to the appropriate value in your initial data thorn or your .par file!"
+{
+ 0:1 :: "zero (no) or one (yes)"
+} 0
+#########################################################

File [added]: schedule.ccl
Delta lines: +190 -0
===================================================================
--- trunk/schedule.ccl	                        (rev 0)
+++ trunk/schedule.ccl	2013-10-01 23:35:07 UTC (rev 5)
@@ -0,0 +1,190 @@
+# Scheduler setup for IllinoisGRMHD
+
+STORAGE: bssn::BSSN_vars[3], bssn::BSSN_rhs, have_global_bdry
+STORAGE: bssn::BSSN_diag_restrict, bssn::BSSN_gupij, bssn::BSSN_matter, bssn::BSSN_aux_restrict2, phi_derivs, bssn::BSSN_aux_private,bssn::BSSN_AH
+STORAGE: bssn::BSSN_refbd[3]
+
+STORAGE: lapse::lapse_vars[3]
+STORAGE: shift::shift_vars[3]
+STORAGE: grmhd_conservatives[3],em_Ax[3],em_Ay[3],em_Az[3],em_psi6phi[3] 
+STORAGE: grmhd_primitives_allbutBi,grmhd_primitives_Bi,grmhd_primitives_reconstructed_temps,grmhd_conservatives_rhs,em_Ax_rhs,em_Ay_rhs,em_Az_rhs,em_psi6phi_rhs,grmhd_cmin_cmax_temps,grmhd_flux_temps,TUPmunu
+STORAGE: eos_params_arrays1,eos_params_arrays2,eos_params_scalar
+STORAGE: fisheye::fisheye_vars
+STORAGE: excision::excision_int_gfs
+
+####################
+# RUN INITIALLY ONLY
+schedule IllinoisGRMHD_RegisterVars in MoL_Register after BSSN_RegisterVars after lapse_RegisterVars
+{
+  LANG: C
+  OPTIONS: META
+} "Register evolved, rhs variables in IllinoisGRMHD for MoL"
+
+# Tells the symmetry thorn how to apply symmetries on each gridfunction:
+schedule IllinoisGRMHD_InitSymBound at BASEGRID after Lapse_InitSymBound
+{
+  LANG: C
+} "Schedule symmetries"
+
+schedule compute_B_and_Bstagger_from_A in ABE_PostInitial as compute_b after postid after empostid after lapsepostid
+{
+  OPTIONS: GLOBAL,loop-local
+  SYNC: grmhd_primitives_Bi
+  LANG: C
+} "Compute B and B_stagger from A SYNC: grmhd_primitives_Bi"
+
+#FIXME:
+# Probably want to add this, so that initial data thorns don't need to set conservative variables...
+#schedule driver_prims_to_conserv in ABE_PostInitial as p2c after compute_b
+#{
+#  OPTIONS: GLOBAL,loop-local
+#  LANG: C
+#} "Compute conservative variables from primitive variables. This is simple and algebraic, unlike the inverse operation!"
+
+schedule IllinoisGRMHD_PostInitialData in ABE_PostInitial as mhdpostid after compute_b after p2c
+{
+  LANG: C
+  OPTIONS: GLOBAL,loop-local
+} "Compute post-initialdata quantities"
+####################
+
+####################
+# RHS EVALUATION
+schedule driver_evaluate_MHD_rhs in MoL_CalcRHS as IllinoisGRMHD_RHS_eval after bssn_rhs after shift_rhs
+{
+  LANG: C
+#FIXME: Not sure these SYNC's are necessary...
+  SYNC: grmhd_conservatives,em_Ax,em_Ay,em_Az,em_psi6phi
+} "Evaluate RHSs of GR Hydro & GRMHD equations"
+####################
+
+
+##############################################
+# AFTER TIMELEVEL SWITCH, RECOMPUTE PRIMITIVES
+
+schedule GROUP IllinoisGRMHD_Recompute_Primitives_MoLPostStep at CCTK_EVOL after MoL_Evolution
+{
+} "Recompute MHD primitive variables right after flipping gridfunction timelevels. We must do this because primitives are defined only on 1 timelevel and conservs on 3."
+
+schedule IllinoisGRMHD_InitSymBound in IllinoisGRMHD_Recompute_Primitives_MoLPostStep as mhd_mol_post_step before compute_b_poststep
+{
+  OPTIONS: LEVEL,LOOP-LOCAL
+  SYNC: grmhd_conservatives,em_Ax,em_Ay,em_Az,em_psi6phi
+  LANG: C
+} "Schedule symmetries"
+
+schedule compute_B_and_Bstagger_from_A in IllinoisGRMHD_Recompute_Primitives_MoLPostStep as compute_b_poststep
+{
+  SYNC: grmhd_primitives_Bi
+  LANG: C
+} "Compute B and B_stagger from A"
+
+schedule conserv_to_prims in IllinoisGRMHD_Recompute_Primitives_MoLPostStep as mhd_conserv2prims_poststep after compute_b_poststep
+{
+  LANG: C
+} "Compute primitive variables from conservatives. This is non-trivial, requiring a Newton-Raphson root-finder."
+##############################################
+
+
+##########################################################
+# AFTER REGRID, COMPUTE B FROM A & RE-SOLVE FOR PRIMITIVES
+
+schedule IllinoisGRMHD_InitSymBound at CCTK_POSTREGRID as prolong_stuff after MoL_PostStep after fish_postregrid_update before compute_B_postregrid
+{
+ OPTIONS: LEVEL,LOOP-LOCAL
+  SYNC: grmhd_conservatives,em_Ax,em_Ay,em_Az,em_psi6phi
+  LANG: C
+} "Schedule symmetries -- Actually just a placeholder function to ensure prolongation / processor syncs are done BEFORE the primitives solver."
+
+schedule compute_B_and_Bstagger_from_A at CCTK_POSTREGRID as compute_B_postregrid after fish_postregrid_update
+{
+  OPTIONS: LEVEL,LOOP-LOCAL
+  SYNC: grmhd_primitives_Bi
+  LANG: C
+} "Compute B and B_stagger from A"
+
+schedule conserv_to_prims at CCTK_POSTREGRID as mhd_conserv2prims_postregrid after compute_B_postregrid before bssn_postregrid before MaskZero
+{
+  OPTIONS: LEVEL,LOOP-LOCAL
+  LANG: C
+} "Compute primitive variables from conservatives. This is non-trivial, requiring a Newton-Raphson root-finder."
+##########################################################
+
+
+##########################################################
+# AFTER RESTRICT, COMPUTE B FROM A & RE-SOLVE FOR PRIMITIVES
+
+schedule IllinoisGRMHD_InitSymBound at CCTK_POSTRESTRICT as post_restrict_SYNCs before compute_B_postrestrict after fish_postregrid_update0 after MoL_PostStep
+{
+  OPTIONS: LEVEL,LOOP-LOCAL
+  SYNC: grmhd_conservatives,em_Ax,em_Ay,em_Az,em_psi6phi
+  LANG: C
+} "Schedule symmetries -- Actually just a placeholder function to ensure prolongation / processor syncs are done BEFORE the primitives solver."
+
+schedule compute_B_and_Bstagger_from_A at CCTK_POSTRESTRICT as compute_B_postrestrict after fish_update
+{
+  OPTIONS: LEVEL,LOOP-LOCAL
+  SYNC: grmhd_primitives_Bi
+  LANG: C
+} "Compute B and B_stagger from A"
+
+schedule conserv_to_prims at CCTK_POSTRESTRICT as mhd_conserv2prims_postrestrict after compute_B_postrestrict before bssn_postregrid
+{
+  OPTIONS: LEVEL,LOOP-LOCAL
+  LANG: C
+} "Compute primitive variables from conservatives. This is non-trivial, requiring a Newton-Raphson root-finder."
+##########################################################
+
+####################################################
+# APPLY BOUNDARY CONDITIONS & RE-SOLVE FOR PRIMITIVES
+schedule IllinoisGRMHD_InitSymBound in ABE_PostStep as poststep_SYNCs before A_bc after iter_count_update after lapse_postbc after shift_update_bc
+{
+  OPTIONS: LEVEL,LOOP-LOCAL
+  SYNC: grmhd_conservatives,em_Ax,em_Ay,em_Az,em_psi6phi
+  LANG: C
+} "Schedule symmetries -- Actually just a placeholder function to ensure prolongation / processor syncs are done BEFORE the primitives solver."
+
+# Since compute_B_and_Bstagger_from_A depends on Bi's being defined everywhere, we must first
+#  apply boundary conditions to Ai's:
+if(Matter_BC!=2 && EM_BC!=2) {
+# I removed this ugly bit of FORTRAN code, as it seems more reasonable to simply move to the nice BC interface in ET.
+#		schedule IllinoisGRMHD_driver_bcs_on_A in ABE_PostStep as A_bc after iter_count_update after lapse_postbc after shift_update_bc after poststep_SYNCs
+#	     	{
+#	     	  SYNC: em_Ax,em_Ay,em_Az,em_psi6phi
+#	     	  LANG:   FORTRAN
+#	     	} "Apply BC on Ai"
+		schedule output_BC_error as BC_error after iter_count_update after lapse_postbc after shift_update_bc after poststep_SYNCs
+		{
+		  LANG: C
+		} "Output error if BC type is set to something other than FROZEN, until we are able to use the nice ET boundary condition interface"
+} else 	     	{
+	     	schedule apply_frozen_boundary_condition in ABE_PostStep as A_bc after iter_count_update after lapse_postbc after shift_update_bc after poststep_SYNCs
+	     	{
+	     	  SYNC: grmhd_conservatives,em_Ax,em_Ay,em_Az,em_psi6phi
+	     	  LANG:   C
+	     	} "Apply FROZEN BCs on Ai AND conservatives!"
+}
+
+schedule compute_B_and_Bstagger_from_A in ABE_PostStep as compute_b after A_bc
+{
+  SYNC: grmhd_primitives_Bi
+  LANG: C
+} "Compute B and B_stagger from A"
+
+schedule conserv_to_prims in ABE_PostStep as conserv2prims after compute_b
+{
+  LANG: C
+} "Compute primitive variables from conservatives. This is non-trivial, requiring a Newton-Raphson root-finder."
+
+# I removed this ugly bit of FORTRAN code, as it seems more reasonable to simply move to the nice BC interface in ET.
+#if(Matter_BC!=2 && EM_BC!=2) {
+#		schedule IllinoisGRMHD_driver_bcs in ABE_PostStep as mhd_bc after conserv2prims
+#		{
+#		  #Note that the SYNC's here are only processor syncs, and are only intended for the coarsest level; no prolongation is done inside the MoL substepping!
+#		  SYNC: grmhd_primitives_allbutBi
+#		  # Eventually we'll want to try applying BCs on conservatives only. For now, BCs are applied to prims, then we recompute conservs
+#		  SYNC: grmhd_conservatives,em_Ax,em_Ay,em_Az,em_psi6phi
+#		  LANG:   FORTRAN
+#		} "Update boundaries on GRMHD conservatives"
+#}
+####################################################



More information about the Commits mailing list