# Schedule definitions for thorn Refluxing if (refluxing_debug_variables) { STORAGE: restrict_weight_fine STORAGE: restrict_weight_coarse STORAGE: flux_weight_fine STORAGE: flux_weight_coarse } STORAGE: densflux_register_fine[2] STORAGE: densflux_register_coarse[2] STORAGE: densflux_stored STORAGE: densflux_correction if (delayed_refluxing) { STORAGE: densflux_delayed_correction } STORAGE: sconflux_register_fine[2] STORAGE: sconflux_register_coarse[2] STORAGE: sconflux_stored STORAGE: sconflux_correction if (delayed_refluxing) { STORAGE: sconflux_delayed_correction } STORAGE: tauflux_register_fine[2] STORAGE: tauflux_register_coarse[2] STORAGE: tauflux_stored STORAGE: tauflux_correction if (delayed_refluxing) { STORAGE: tauflux_delayed_correction } if (CCTK_Equals(Y_e_evolution_method, "GRHydro")) { STORAGE: yeflux_register_fine[2] STORAGE: yeflux_register_coarse[2] STORAGE: yeflux_stored STORAGE: yeflux_correction if (delayed_refluxing) { STORAGE: yeflux_delayed_correction } } if (CCTK_Equals(Bvec_evolution_method, "GRHydro")) { STORAGE: Bconsflux_register_fine[2] STORAGE: Bconsflux_register_coarse[2] STORAGE: Bconsflux_stored STORAGE: Bconsflux_correction if (delayed_refluxing) { STORAGE: Bconsflux_delayed_correction } } if (suppress_refluxing_in_atmosphere) { STORAGE: face_atmosphere_mask STORAGE: face_atmosphere_mask_restricted } if (refluxing_debug_variables) { STORAGE: dens_correction_total STORAGE: scon_correction_total STORAGE: tau_correction_total if (CCTK_Equals(Y_e_evolution_method, "GRHydro")) { STORAGE: ye_correction_total } if (CCTK_Equals(Bvec_evolution_method, "GRHydro")) { STORAGE: Bcons_correction_total } } SCHEDULE Refluxing_Register IN MoL_Register { LANG: C } "Register evolved variables" SCHEDULE Refluxing_ParamCheck AT paramcheck { LANG: C } "Check parameters" SCHEDULE Refluxing_Init AT basegrid { LANG: Fortran } "Initialise refluxing variables" if (delayed_refluxing && delayed_refluxing_sources) { SCHEDULE Refluxing_DelayedCorrectionReduction AT evol AFTER MoL_Evolution { LANG: Fortran } "Decrease delayed correction amount" } if (delayed_refluxing) { SCHEDULE Refluxing_DelayedCorrectionBoundaries AT postregrid { LANG: C } "Set boundaries of delayed correction to zero" } SCHEDULE Refluxing_Reset AT postregrid { LANG: C OPTIONS: level } "Reset refluxing variables after regridding" SCHEDULE Refluxing_Output AT postregrid AFTER Refluxing_Reset { LANG: C OPTIONS: level } "Output debug variables" # Capture the fluxes inside GRHydro's RHS calculation SCHEDULE Refluxing_CaptureFluxes IN FluxTerms AFTER Riemann BEFORE UpdateCalcul { LANG: Fortran } "Possibly modify, then capture and store the flux terms" # Sychronize the captured fluxes SCHEDULE Refluxing_Sync IN GRHydroRHS AFTER FluxTerms { LANG: Fortran SYNC: densflux_stored SYNC: sconflux_stored SYNC: tauflux_stored SYNC: yeflux_stored SYNC: Bconsflux_stored SYNC: face_atmosphere_mask } "Dummy routine for sync" if (suppress_refluxing_in_atmosphere) { # TODO: These should not be necessary, except maybe the last one in # postrestrict # Capture atmosphere again (in case atmosphere flag is set) SCHEDULE Refluxing_CaptureAtmosphere IN HydroBase_PostStep BEFORE GRHydro_AtmosphereReset AFTER GRHydroPostSyncAtmosphereMask IF GRHydro::InLastMoLPostStep { LANG: Fortran } "Capture GRHydro's atmosphere flags" # Capture atmosphere again (in case atmosphere flag is set) SCHEDULE Refluxing_CaptureAtmosphere IN MoL_PostStep AFTER HydroBase_PostStep IF GRHydro::execute_MoL_PostStep { LANG: Fortran } "Capture GRHydro's atmosphere flags" # Capture atmosphere again (in case atmosphere flag is set) SCHEDULE Refluxing_CaptureAtmosphere AT postrestrict BEFORE Refluxing_CorrectState { LANG: Fortran } "Capture GRHydro's atmosphere flags" } # Schedule refluxing before MoL_PostStep, because MoL_PostStep calls # con2prim, which has to happen after refluxing # TODO: Schedule all boundary conditions etc. after this routine # Turn on/off storage for correction variables based on a parameter # without having to use very many nested if statements. It relies on the # (undocumented) fact that everything that is not a SCHEDULE block is # copied verbose into the resulting C code. int Y_e_correction_storage = CCTK_Equals(Y_e_evolution_method, "GRHydro"); int Bcons_correction_storage = CCTK_Equals(Bvec_evolution_method, "GRHydro"); SCHEDULE Refluxing_CorrectState AT postrestrict BEFORE MoL_PostStep { LANG: C OPTIONS: level STORAGE: densflux_correction STORAGE: sconflux_correction STORAGE: tauflux_correction STORAGE: yeflux_correction[Y_e_correction_storage] STORAGE: Bconsflux_correction[Bcons_correction_storage] SYNC: GRHydro::dens SYNC: GRHydro::scon SYNC: GRHydro::tau SYNC: GRHydro::Y_e_con SYNC: GRHydro::Bcons SYNC: restrict_weight_fine SYNC: restrict_weight_coarse SYNC: flux_weight_fine SYNC: flux_weight_coarse #SYNC: densflux_correction #SYNC: sconflux_correction #SYNC: tauflux_correction #SYNC: yeflux_correction #SYNC: Bconsflux_correction SYNC: dens_correction_total SYNC: scon_correction_total SYNC: tau_correction_total SYNC: ye_correction_total SYNC: Bcons_correction_total } "Correct coarse grid state"