User: rhaas Date: 2012/06/20 11:18 AM
Modified: /trunk/ interface.ccl, schedule.ccl /trunk/src/ GRHydro_Boundaries.F90, GRHydro_UpdateMask.F90
Log: * improve handling of cs2 < 0 in the "standard" (non-MHD, non-hot EOS) eigenvalue routine.
Patch by Christian Ott.
File Changes:
Directory: /trunk/src/ ======================
File [modified]: GRHydro_Boundaries.F90 Delta lines: +6 -1 =================================================================== --- trunk/src/GRHydro_Boundaries.F90 2012-06-20 16:17:32 UTC (rev 358) +++ trunk/src/GRHydro_Boundaries.F90 2012-06-20 16:18:04 UTC (rev 359) @@ -99,6 +99,8 @@ !endif endif
+ call SetCartSymVN(ierr, cctkGH, sym, "GRHydro::atmosphere_mask_real") + sym(1) = -1 sym(2) = 1 sym(3) = 1 @@ -210,6 +212,8 @@ "GRHydro::tau", "Flat") ierr = ierr + Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & "GRHydro::scon", "Flat") + ierr = ierr + Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & + "GRHydro::GRHydro_atmosphere_mask_real", "Flat") if (sync_conserved_only .eq. 0) then ierr = ierr + Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & "HydroBase::w_lorentz", "Flat") @@ -282,7 +286,8 @@ "GRHydro::tau", "None") ierr = ierr + Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & "GRHydro::scon", "None") - + ierr = ierr + Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & + "GRHydro::GRHydro_atmosphere_mask_real", "None") if (sync_conserved_only .eq. 0) then ierr = ierr + Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & "HydroBase::w_lorentz", "None")
File [modified]: GRHydro_UpdateMask.F90 Delta lines: +35 -2 =================================================================== --- trunk/src/GRHydro_UpdateMask.F90 2012-06-20 16:17:32 UTC (rev 358) +++ trunk/src/GRHydro_UpdateMask.F90 2012-06-20 16:18:04 UTC (rev 359) @@ -48,7 +48,9 @@ densrhs(i,j,k) = 0.0d0 srhs(i,j,k,:) = 0.0d0 taurhs(i,j,k) = 0.0d0 - atmosphere_mask(i,j,k) = 1 + ! Set real-valued mask! This will be sync'ed and right after syncing translated to + ! our standard integer based mask (so that atmosphere_mask is still valid!). + atmosphere_mask_real(i,j,k) = 1 end if end do end do @@ -67,7 +69,9 @@ densrhs(i,j,k) = 0.0d0 srhs(i,j,k,:) = 0.0d0 taurhs(i,j,k) = 0.0d0 - atmosphere_mask(i,j,k) = 1 + ! Set real-valued mask! This will be sync'ed and right after syncing translated to + ! our standard integer based mask (so that atmosphere_mask is still valid!). + atmosphere_mask_real(i,j,k) = 1 end if end do end do @@ -77,6 +81,33 @@
end subroutine GRHydroUpdateAtmosphereMask
+ +subroutine GRHydroPostSyncAtmosphereMask(CCTK_ARGUMENTS) + + implicit none + + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + CCTK_INT :: i,j,k + +!! This sets the integer atmo mask based on the real-valued (and sync'ed) atmo mask + + !$OMP PARALLEL DO PRIVATE(k,j,i) + do k = 1, cctk_lsh(3) + do j = 1, cctk_lsh(2) + do i = 1, cctk_lsh(1) + if ( atmosphere_mask_real(i,j,k) .ne. 0) then + atmosphere_mask(i,j,k) = 1 + end if + end do + end do + end do + !$OMP END PARALLEL DO + +end subroutine GRHydroPostSyncAtmosphereMask + + /*@@ @routine GRHydro_SetupMask @date Thu Jun 20 13:27:28 2002 @@ -116,6 +147,7 @@ endif
atmosphere_mask = 0 + atmosphere_mask_real = 0
call CCTK_INFO("Setting up the atmosphere mask: all points are not_atmosphere")
@@ -263,6 +295,7 @@ velz(i,j,k), eps(i,j,k), press(i,j,k), w_lorentz(i,j,k)) if (wk_atmosphere .eq. 0) then atmosphere_mask(i, j, k) = 0 + atmosphere_mask_real(i, j, k) = 0 end if endif
Directory: /trunk/ ==================
File [modified]: interface.ccl Delta lines: +9 -0 =================================================================== --- trunk/interface.ccl 2012-06-20 16:17:32 UTC (rev 358) +++ trunk/interface.ccl 2012-06-20 16:18:04 UTC (rev 359) @@ -424,6 +424,15 @@ atmosphere_mask } "Flags to say whether a point needs to be reset to the atmosphere"
+# This real mask is set during UpdateAtmosphereMask and sync'ed afterwards (including possible interpatch interpolation) +# After syn'ing and before any con2prim fun, we set the integer mask above based on the real-valued mask. +# This ensures that any routine using the int mask is still correctly working. +real GRHydro_atmosphere_mask_real type = GF Timelevels = 1 tags='Prolongation="copy"' +{ + atmosphere_mask_real +} "Flags to say whether a point needs to be reset to the atmosphere. This is sync'ed (and possibly interpolated)!" + + int GRHydro_atmosphere_descriptors type=SCALAR { atmosphere_field_descriptor
File [modified]: schedule.ccl Delta lines: +11 -7 =================================================================== --- trunk/schedule.ccl 2012-06-20 16:17:32 UTC (rev 358) +++ trunk/schedule.ccl 2012-06-20 16:18:04 UTC (rev 359) @@ -477,6 +477,7 @@ if (CCTK_EQUALS(evolution_method, "GRHydro")) {
STORAGE:GRHydro_atmosphere_mask +STORAGE:GRHydro_atmosphere_mask_real STORAGE:GRHydro_atmosphere_descriptors
schedule GRHydro_SetupMask AT CCTK_Initial BEFORE HydroBase_Initial @@ -1024,6 +1025,7 @@ SYNC: Y_e_con SYNC: lvel SYNC: lBvec + SYNC: GRHydro_atmosphere_mask_real # Must be synced otherwise we get inconsistent results when using multiple procs } "Select GRHydro boundary conditions" } else @@ -1039,6 +1041,7 @@ SYNC: psidc SYNC: GRHydro_cons_tracers SYNC: Y_e_con + SYNC: GRHydro_atmosphere_mask_real # Must be synced otherwise we get inconsistent results when using multiple procs } "Select GRHydro boundary conditions"
# after a regrid Cactus relies on the boundary thorns to fill in the outer @@ -1050,11 +1053,6 @@ { } "Apply boundary conditions to primitives"
- # This is necessary to provide initial guesses for Con2Prim after atmo reset (which happens only at last MoL post-step)! - schedule group GRHydro_PrimitiveBoundaries IN HydroBase_PostStep BEFORE HydroBase_Boundaries IF GRHydro::InLastMoLPostStep - { - } "Apply boundary conditions to primitives" -
if(CCTK_IsImplementationActive("Coordinates")) {
@@ -1160,14 +1158,20 @@ ### This is executed in the last MoL_PosStep ### ################################################################
+# First we need to convert real (and synchronized mask) to an integer mask! +schedule GRHydroPostSyncAtmosphereMask IN HydroBase_PostStep AFTER HydroBase_Boundaries +{ + LANG: Fortran +} "Set integer atmosphere mask from synchronized real atmosphere mask" + if (CCTK_Equals(Bvec_evolution_method,"GRHydro")) { - schedule GRHydro_AtmosphereResetM IN MoL_PostStep AFTER ADMBase_SetADMVars AFTER GRHydro_SetLastMoLPostStep BEFORE HydroBase_PostStep IF GRHydro::InLastMoLPostStep + schedule GRHydro_AtmosphereResetM IN HydroBase_PostStep BEFORE HydroBase_Con2Prim IF GRHydro::InLastMoLPostStep { LANG: Fortran } "Reset the atmosphere - MHD version" } else { - schedule GRHydro_AtmosphereReset IN MoL_PostStep AFTER ADMBase_SetADMVars BEFORE HydroBase_PostStep IF GRHydro::InLastMoLPostStep + schedule GRHydro_AtmosphereReset IN HydroBase_PostStep BEFORE HydroBase_Con2Prim IF GRHydro::InLastMoLPostStep { LANG: Fortran } "Reset the atmosphere"
commits@lists.einsteintoolkit.org