# Interface definition for thorn Refluxing IMPLEMENTS: Refluxing INHERITS: GRHydro USES INCLUDE HEADER: loopcontrol.h USES INCLUDE HEADER: dh.hh USES INCLUDE HEADER: gh.hh USES INCLUDE HEADER: operator_prototypes_3d.hh USES INCLUDE HEADER: vect.hh USES INCLUDE HEADER: carpet.hh # Register evolved variables CCTK_INT FUNCTION \ MoLRegisterEvolvedGroup \ (CCTK_INT IN EvolvedIndex, \ CCTK_INT IN RHSIndex) REQUIRES FUNCTION MoLRegisterEvolvedGroup CCTK_INT FUNCTION \ MoLRegisterEvolvedGroupSlow \ (CCTK_INT IN EvolvedIndex, \ CCTK_INT IN RHSIndex) USES FUNCTION MoLRegisterEvolvedGroupSlow # Get pointer to grid variable for a specific map and refinement level CCTK_POINTER FUNCTION \ VarDataPtrI \ (CCTK_POINTER_TO_CONST IN cctkGH, \ CCTK_INT IN map, \ CCTK_INT IN reflevel, \ CCTK_INT IN component, \ CCTK_INT IN timelevel, \ CCTK_INT IN varindex) REQUIRES FUNCTION VarDataPtrI # Get current refinement level and number of refinement levels CCTK_INT FUNCTION \ GetRegriddingEpoch \ (CCTK_POINTER_TO_CONST IN cctkGH) REQUIRES FUNCTION GetRegriddingEpoch CCTK_INT FUNCTION \ GetRefinementLevel \ (CCTK_POINTER_TO_CONST IN cctkGH) REQUIRES FUNCTION GetRefinementLevel CCTK_INT FUNCTION \ GetRefinementLevels \ (CCTK_POINTER_TO_CONST IN cctkGH) REQUIRES FUNCTION GetRefinementLevels # Convenient way to determine boundary sizes CCTK_INT FUNCTION GetBoundarySizesAndTypes \ (CCTK_POINTER_TO_CONST IN cctkGH, \ CCTK_INT IN size, \ CCTK_INT OUT ARRAY bndsize, \ CCTK_INT OUT ARRAY is_ghostbnd, \ CCTK_INT OUT ARRAY is_symbnd, \ CCTK_INT OUT ARRAY is_physbnd) REQUIRES FUNCTION GetBoundarySizesAndTypes # Flux weight functions (shows where refluxing happens; for debugging only) CCTK_REAL restrict_weight_fine TYPE=gf TAGS='Prolongation="none" Checkpoint="no" tensortypealias="D" tensorweight=+1.0' "Fine grid restriction weight" CCTK_REAL restrict_weight_coarse TYPE=gf TAGS='Prolongation="none" Checkpoint="no" tensortypealias="D" tensorweight=+1.0' "Coarse grid restriction weight" CCTK_REAL flux_weight_fine[3] TYPE=gf TAGS='Prolongation="none" Checkpoint="no" tensortypealias="D" tensorweight=+1.0' "Fine grid refluxing weight" CCTK_REAL flux_weight_coarse[3] TYPE=gf TAGS='Prolongation="none" Checkpoint="no" tensortypealias="D" tensorweight=+1.0' "Coarse grid refluxing weight" # Flux registers, where the fluxes are integrated in time # There are separate registers for each direction # There are separeate registers for coarse and fine grids, # and their differences determines the correction # Stored fluxes, just capturing what GRHydro calculates # These are used as RHS for the flux registers # Correction terms # These are temporary variables, only used # to calculate the difference between the coarse and fine grid registers # Time-summed corrections, just for debugging # All these variables exist for all conserved quantites # There are: # 5 conserved quantities # 3 directions # fluxes, coarse and fine registers with 2 time levels each # make altogether for 5 * 3 * (1 + 2 + 2) = 75 additional time levels # refluxing is expensive memory-wise; # this could be optimised since these need only be stored # on the refinement boundaries, not in the whole volume # Density CCTK_REAL densflux_register_fine[3] TYPE=gf TIMELEVELS=2 TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Register for fine grid density flux" CCTK_REAL densflux_register_coarse[3] TYPE=gf TIMELEVELS=2 TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Register for coarse grid density flux" CCTK_REAL densflux_stored[3] TYPE=gf TAGS='Prolongation="none" Checkpoint="no" tensortypealias="D" tensorweight=+1.0' "Density flux" CCTK_REAL densflux_correction[3] TYPE=gf TAGS='Prolongation="restrict" Checkpoint="no" tensortypealias="D" tensorweight=+1.0' "Correction for density flux" CCTK_REAL densflux_delayed_correction[3] TYPE=gf TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Delayed correction for density flux" CCTK_REAL dens_correction_total[3] TYPE=gf TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Accumulated correction for density flux" # Momenta CCTK_REAL sconflux_register_fine[3] TYPE=gf TIMELEVELS=2 TAGS='Prolongation="none" tensortypealias="DD" tensorweight=+1.0' { sxflux_register_fine syflux_register_fine szflux_register_fine } "Register for fine grid momentum flux" CCTK_REAL sconflux_register_coarse[3] TYPE=gf TIMELEVELS=2 TAGS='Prolongation="none" tensortypealias="DD" tensorweight=+1.0' { sxflux_register_coarse syflux_register_coarse szflux_register_coarse } "Register for coarse grid momentum flux" CCTK_REAL sconflux_stored[3] TYPE=gf TAGS='Prolongation="none" Checkpoint="no" tensortypealias="DD" tensorweight=+1.0' { sxflux_stored syflux_stored szflux_stored } "Momentum flux" CCTK_REAL sconflux_correction[3] TYPE=gf TAGS='Prolongation="restrict" Checkpoint="no" tensortypealias="DD" tensorweight=+1.0' { sxflux_correction syflux_correction szflux_correction } "Correction for momentum flux" CCTK_REAL sconflux_delayed_correction[3] TYPE=gf TAGS='Prolongation="none" tensortypealias="DD" tensorweight=+1.0' { sxflux_delayed_correction syflux_delayed_correction szflux_delayed_correction } "Delayed correction for momentum flux" CCTK_REAL scon_correction_total[3] TYPE=gf TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' { sx_correction_total sy_correction_total sz_correction_total } "Accumulated correction for momentum flux" # Energy CCTK_REAL tauflux_register_fine[3] TYPE=gf TIMELEVELS=2 TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Register for fine grid energy flux" CCTK_REAL tauflux_register_coarse[3] TYPE=gf TIMELEVELS=2 TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Register for coarse grid energy flux" CCTK_REAL tauflux_stored[3] TYPE=gf TAGS='Prolongation="none" Checkpoint="no" tensortypealias="D" tensorweight=+1.0' "Energy flux" CCTK_REAL tauflux_correction[3] TYPE=gf TAGS='Prolongation="restrict" Checkpoint="no" tensortypealias="D" tensorweight=+1.0' "Correction for energy flux" CCTK_REAL tauflux_delayed_correction[3] TYPE=gf TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Delayed correction for energy flux" CCTK_REAL tau_correction_total[3] TYPE=gf TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Accumulated correction for energy flux" # Electron fraction CCTK_REAL yeflux_register_fine[3] TYPE=gf TIMELEVELS=2 TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Register for fine grid electron fraction flux" CCTK_REAL yeflux_register_coarse[3] TYPE=gf TIMELEVELS=2 TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Register for coarse grid electron fraction flux" CCTK_REAL yeflux_stored[3] TYPE=gf TAGS='Prolongation="none" Checkpoint="no" tensortypealias="D" tensorweight=+1.0' "Electron fraction flux" CCTK_REAL yeflux_correction[3] TYPE=gf TAGS='Prolongation="restrict" Checkpoint="no" tensortypealias="D" tensorweight=+1.0' "Correction for electron fraction flux" CCTK_REAL yeflux_delayed_correction[3] TYPE=gf TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Delayed correction for electron fraction flux" CCTK_REAL ye_correction_total[3] TYPE=gf TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' "Accumulated correction for electron fraction flux" # Magnetic field CCTK_REAL Bconsflux_register_fine[3] TYPE=gf TIMELEVELS=2 TAGS='Prolongation="none" tensortypealias="UU" tensorweight=+1.0' { Bconsxflux_register_fine Bconsyflux_register_fine Bconszflux_register_fine } "Register for fine grid magnetic field flux" CCTK_REAL Bconsflux_register_coarse[3] TYPE=gf TIMELEVELS=2 TAGS='Prolongation="none" tensortypealias="UU" tensorweight=+1.0' { Bconsxflux_register_coarse Bconsyflux_register_coarse Bconszflux_register_coarse } "Register for coarse grid magnetic field flux" CCTK_REAL Bconsflux_stored[3] TYPE=gf TAGS='Prolongation="none" Checkpoint="no" tensortypealias="UU" tensorweight=+1.0' { Bconsxflux_stored Bconsyflux_stored Bconszflux_stored } "magnetic field flux" CCTK_REAL Bconsflux_correction[3] TYPE=gf TAGS='Prolongation="restrict" Checkpoint="no" tensortypealias="UU" tensorweight=+1.0' { Bconsxflux_correction Bconsyflux_correction Bconszflux_correction } "Correction for magnetic field flux" CCTK_REAL Bconsflux_delayed_correction[3] TYPE=gf TAGS='Prolongation="none" tensortypealias="UU" tensorweight=+1.0' { Bconsxflux_delayed_correction Bconsyflux_delayed_correction Bconszflux_delayed_correction } "Delayed correction for magnetic field flux" CCTK_REAL Bcons_correction_total[3] TYPE=gf TAGS='Prolongation="none" tensortypealias="D" tensorweight=+1.0' { Bconsx_correction_total Bconsy_correction_total Bconsz_correction_total } "Accumulated correction for magnetic field flux" # Atmosphere mask CCTK_REAL face_atmosphere_mask[3] TYPE=gf TAGS='Prolongation="none" tensortypealias="D"' "Atmosphere mask for cell faces" CCTK_REAL face_atmosphere_mask_restricted[3] TYPE=gf TAGS='Prolongation="restrict" tensortypealias="D"' "Atmosphere mask for cell faces, restricted to the coarse grid" # Values: 0 for a normal point, non-zero for atmosphere