From dc52bec178cb054fef8a62ab744ed58f166f0ffa Mon Sep 17 00:00:00 2001 From: diener Date: Wed, 7 Apr 2004 20:57:04 +0000 Subject: Change to the new (well fairly new) SymBase interface. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/EHFinder/trunk@170 2a26948c-0e4f-0410-aee8-f1d3e353619c --- interface.ccl | 9 ++++++++ schedule.ccl | 55 +++++++++++++++++++++++++++++++++++++--------- src/EHFinder_SetSym.F90 | 58 ++++++++++++++++++++++++++----------------------- 3 files changed, 85 insertions(+), 37 deletions(-) diff --git a/interface.ccl b/interface.ccl index 9d887be..0f2a066 100644 --- a/interface.ccl +++ b/interface.ccl @@ -10,6 +10,15 @@ CCTK_INT FUNCTION MoLRegisterEvolvedGroup(CCTK_INT IN EvolvedIndex, \ CCTK_INT IN RHSIndex) USES FUNCTION MoLRegisterEvolvedGroup +CCTK_INT FUNCTION Boundary_SelectGroupForBC(CCTK_POINTER_TO_CONST IN GH, \ + CCTK_INT IN faces, \ + CCTK_INT IN boundary_width, \ + CCTK_INT IN table_handle, \ + CCTK_STRING IN var_name, \ + CCTK_STRING IN bc_name) + +USES FUNCTION Boundary_SelectGroupForBC + public: # The scalar level set functions that defines the null surfaces. diff --git a/schedule.ccl b/schedule.ccl index f522f5c..77c3d91 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -181,7 +181,11 @@ schedule EHFinder_ApplySymSC in EHFinder_MarkPoints after EHFinder_MarkSurfaces LANG: Fortran TRIGGERS: eh_area, eh_centroid_x, eh_centroid_y, eh_centroid_z TRIGGERS: eh_circ_eq, eh_circ_pol -} "Apply symmetries of the surface counter grid function" +} "Select the surface counter grid function for boundary conditions" + +schedule GROUP ApplyBCs as EHFinderSC_ApplyBSc in EHFinder_MarkPoints after EHFinder_ApplySymSC +{ +} "Apply boundary conditions (symmetries)" schedule EHFinder_InfoSurfaces in EHFinder_Surfaces after EHFinder_CountMarkSurfaces { @@ -385,7 +389,11 @@ if (CCTK_Equals(mode,"normal")) { LANG: Fortran SYNC: f - } "Apply symmetry boundaries" + } "Select f for boundary conditions" + + schedule GROUP ApplyBCs as EHFinderF_ApplyBCs in EHFinder_PostStep after EHFinder_ApplySymF +{ +} "Apply boundary conditions (Symmetries)" # Set up the schedule group for re-initialization @@ -435,8 +443,12 @@ if (CCTK_Equals(mode,"normal")) { LANG: Fortran SYNC: f - } "Apply symmetry boundaries and sync" + } "Select f for boundary conditions" + schedule GROUP ApplyBCs as EHFinderF_ApplyBCs in Euler_ReInitialize after EHFinder_ApplySymF + { + } "Apply boundary conditions (symmetries)" + schedule EHFinder_ReInitialize_Check in EHFinder_ReInitialize AFTER Euler_ReInitialize { LANG: Fortran @@ -471,7 +483,11 @@ if (CCTK_Equals(mode,"normal")) { LANG: Fortran SYNC: f - } "Apply symmetry boundaries and sync" + } "Select f for boundary conditions" + + schedule GROUP ApplyBCs as EHFinderRK2_1_ApplyBCs in RK2_ReInitialize after Sym_RK2_1 + { + } "Apply boundary conditions (symmetries)" # Schedule the routine that does the second RK2 step @@ -490,9 +506,13 @@ if (CCTK_Equals(mode,"normal")) { LANG: Fortran SYNC: f - } "Apply symmetry boundaries and sync" + } "Select f for boundary conditions" } + schedule GROUP ApplyBCs as EHFinderRK2_2_ApplyBCs in RK2_ReInitialize after Sym_RK2_2 + { + } "Apply boundary conditions (symmetries)" + # Schedule modifications of the mask in group EHFinder_SetMask schedule GROUP EHFinder_SetMask at CCTK_POSTSTEP after EHFinder_ReInitialize @@ -514,12 +534,15 @@ if (CCTK_Equals(mode,"normal")) schedule EHFinder_ApplySymAll in EHFinder_SetMask after EHFinder_SetMask1 { LANG: Fortran - } "Apply symmetry boundaries" + } "Select both f and eh_mask for boundary conditions" + schedule GROUP ApplyBCs as EHFinderAll_ApplyBCs in EHFinder_SetMask after EHFinder_ApplySymAll + { + } "Apply boundary conditions (symmetries)" # Finally locate the mask boundary and add values to distinguish different # directions. - schedule EHFinder_SetMask2 in EHFinder_SetMask after EHFinder_ApplySymAll + schedule EHFinder_SetMask2 in EHFinder_SetMask after EHFinderAll_ApplyBCs { LANG: Fortran SYNC: eh_mask, tm_mask @@ -528,7 +551,11 @@ if (CCTK_Equals(mode,"normal")) schedule EHFinder_ApplySymMask as ASM1 in EHFinder_SetMask after EHFinder_SetMask2 { LANG: Fortran - } "Apply symmetry boundaries" + } "Select eh_mask for boundary conditions" + + schedule GROUP ApplyBCs as EHFinderMask1_ApplyBCs in EHFinder_SetMask after ASM1 + { + } "Apply boundary conditions (symmetries)" schedule EHFinder_SetMask3 in EHFinder_SetMask after EHFinder_ASM1 { @@ -539,8 +566,12 @@ if (CCTK_Equals(mode,"normal")) schedule EHFinder_ApplySymMask as ASM2 in EHFinder_SetMask after EHFinder_SetMask3 { LANG: Fortran - } "Apply symmetry boundaries" + } "Select eh_mask for boundary conditions" + schedule GROUP ApplyBCs as EHFinderMask2_ApplyBCs in EHFinder_SetMask after ASM2 + { + } "Apply boundary conditions (symmetries)" + schedule EHFinder_SetMask2 as SM2 in EHFinder_SetMask after ASM2 { LANG: Fortran @@ -550,7 +581,11 @@ if (CCTK_Equals(mode,"normal")) schedule EHFinder_ApplySymMask as ASM3 in EHFinder_SetMask after SM2 { LANG: Fortran - } "Apply symmetry boundaries" + } "Select eh_mask for boundary conditions" + + schedule GROUP ApplyBCs as EHFinderMask3_ApplyBCs in EHFinder_SetMask after ASM3 + { + } "Apply boundary conditions (symmetries)" # if ( evolve_generators) # { diff --git a/src/EHFinder_SetSym.F90 b/src/EHFinder_SetSym.F90 index 0a734b0..f130a5e 100644 --- a/src/EHFinder_SetSym.F90 +++ b/src/EHFinder_SetSym.F90 @@ -52,20 +52,21 @@ subroutine EHFinder_ApplySymAll(CCTK_ARGUMENTS) DECLARE_CCTK_PARAMETERS DECLARE_CCTK_FUNCTIONS - character(len=80) :: warn_message + CCTK_INT :: ierr -! Apply symmetry for the level set function. - call CartSymGN ( ierr, cctkGH, 'ehfinder::f' ) - if ( ierr .gt. 0 ) then - warn_message = 'Failed to perform symmetry operation on the level ' - warn_message = trim(warn_message)//'set function' - call CCTK_WARN( 1, trim(warn_message) ) - end if +! Select the variable groups for the None boundary condition. When the +! physical boundary condition (a noop in this case) is applied the +! symmetry boundary conditions will be applied automatically. -! Apply symmetry for the mask function. - call CartSymGN ( ierr, cctkGH, 'ehfinder::eh_mask' ) - if ( ierr .gt. 0 ) then - call CCTK_WARN( 1, 'Failed to perform symmetry operation on the mask') + ierr = Boundary_SelectGroupForBC ( cctkGH, CCTK_ALL_FACES, 1, -1, & + 'ehfinder::f', 'None' ) + if ( ierr /= 0 ) then + call CCTK_WARN ( 0, 'Could not select f for boundary condition' ) + end if + ierr = Boundary_SelectGroupForBC ( cctkGH, CCTK_ALL_FACES, 1, -1, & + 'ehfinder::eh_mask', 'None' ) + if ( ierr /= 0 ) then + call CCTK_WARN ( 0, 'Could not select eh_mask for boundary condition' ) end if return @@ -83,13 +84,12 @@ subroutine EHFinder_ApplySymF(CCTK_ARGUMENTS) DECLARE_CCTK_FUNCTIONS character(len=80) :: warn_message + CCTK_INT :: ierr -! Apply symmetry for the level set function. - call CartSymGN ( ierr, cctkGH, 'ehfinder::f' ) - if ( ierr .gt. 0 ) then - warn_message = 'Failed to perform symmetry operation on the level ' - warn_message = trim(warn_message)//'set function' - call CCTK_WARN( 1, trim(warn_message) ) + ierr = Boundary_SelectGroupForBC ( cctkGH, CCTK_ALL_FACES, 1, -1, & + 'ehfinder::f', 'None' ) + if ( ierr /= 0 ) then + call CCTK_WARN ( 0, 'Could not select f for boundary condition' ) end if return @@ -106,10 +106,13 @@ subroutine EHFinder_ApplySymMask(CCTK_ARGUMENTS) DECLARE_CCTK_PARAMETERS DECLARE_CCTK_FUNCTIONS -! Apply symmetry for the mask function. - call CartSymGN ( ierr, cctkGH, 'ehfinder::eh_mask' ) - if ( ierr .gt. 0 ) then - call CCTK_WARN( 1, 'Failed to perform symmetry operation on the mask') + CCTK_INT :: ierr + + ierr = Boundary_SelectGroupForBC ( cctkGH, CCTK_ALL_FACES, 1, -1, & + 'ehfinder::eh_mask', 'None' ) + + if ( ierr /= 0 ) then + call CCTK_WARN ( 0, 'Could not select eh_mask for boundary condition' ) end if return @@ -127,12 +130,13 @@ subroutine EHFinder_ApplySymSC(CCTK_ARGUMENTS) DECLARE_CCTK_FUNCTIONS character(len=80) :: warn_message + CCTK_INT :: ierr -! Apply the symmetry for the surface index function. - call CartSymGN ( ierr, cctkGH, 'ehfinder::surface_index' ) - if ( ierr .gt. 0 ) then - warn_message = 'Failed to perform symmetry operation on the surface index' - call CCTK_WARN( 1, trim(warn_message) ) + ierr = Boundary_SelectGroupForBC ( cctkGH, CCTK_ALL_FACES, 1, -1, & + 'ehfinder::surface_index', 'None' ) + + if ( ierr /= 0 ) then + call CCTK_WARN ( 0, 'Could not select sc for boundary condition' ) end if return -- cgit v1.2.3