aboutsummaryrefslogtreecommitdiff
path: root/src/EHFinder_SetSym.F90
diff options
context:
space:
mode:
Diffstat (limited to 'src/EHFinder_SetSym.F90')
-rw-r--r--src/EHFinder_SetSym.F90151
1 files changed, 51 insertions, 100 deletions
diff --git a/src/EHFinder_SetSym.F90 b/src/EHFinder_SetSym.F90
index b04672d..7811406 100644
--- a/src/EHFinder_SetSym.F90
+++ b/src/EHFinder_SetSym.F90
@@ -1,4 +1,4 @@
-! Initialisation of the level set function
+! Registration of symmetries for the necessary grid functions.
! $Header$
#include "cctk.h"
@@ -15,33 +15,28 @@ subroutine EHFinder_SetSym(CCTK_ARGUMENTS)
DECLARE_CCTK_PARAMETERS
CCTK_INT, dimension(3) :: sym
- CCTK_INT :: l
- character(len=14) :: fname
+! All grid functions have even symmetries in all directions.
sym = 1
- do l = 0, eh_number_level_sets - 1
- write(fname,'(a12,i1,a1)') 'ehfinder::f[', l, ']'
- call SetCartSymVN(ierr,cctkGH,sym,fname)
- if ( ierr .gt. 0 ) then
- call CCTK_WARN(1,'Failed to register symmetry for the level set function')
- end if
-! call SetCartSymVN(ierr,cctkGH,sym,'ehfinder::f[2]')
-! if ( ierr .gt. 0 ) then
-! call CCTK_WARN(1,'Failed to register symmetry for the level set function')
-! end if
- end do
+! Set up symmetries for the level set function.
+ call SetCartSymGN ( ierr, cctkGH, sym, 'ehfinder::f' )
+ if ( ierr .gt. 0 ) then
+ call CCTK_WARN(1,'Failed to register symmetry for the level set function')
+ end if
+
+! Set up symmetries for the mask function.
+ call SetCartSymGN( ierr, cctkGH, sym, 'ehfinder::eh_mask' )
+ if ( ierr .gt. 0 ) then
+ call CCTK_WARN(1,'Failed to register symmetry for eh_mask')
+ end if
+! Set up symmetries for the surface index function.
call SetCartSymGN(ierr,cctkGH,sym,'ehfinder::surface_index')
if ( ierr .gt. 0 ) then
call CCTK_WARN(1,'Failed to register symmetry for sc')
end if
-! call SetCartSymVN(ierr,cctkGH,sym,'ehfinder::rep_mask')
-! if ( ierr .gt. 0 ) then
-! call CCTK_WARN(1,'Failed to register symmetry for the level reparametrization mask')
-! end if
-
return
end subroutine EHFinder_SetSym
@@ -56,28 +51,22 @@ subroutine EHFinder_ApplySymAll(CCTK_ARGUMENTS)
DECLARE_CCTK_PARAMETERS
DECLARE_CCTK_FUNCTIONS
- CCTK_INT :: l
- character(len=14) :: fname
-
- do l = 0, eh_number_level_sets - 1
- write(fname,'(a12,i1,a1)') 'ehfinder::f[', l, ']'
- call CartSymVN(ierr,cctkGH,fname)
- end do
+ character(len=80) :: warn_message
-# include "include/physical_part.h"
-
- if ( symx ) then
- eh_mask(ngx:1:-1,:,:,:) = eh_mask(ngx+1:ngx+ngx,:,:,:)
-! rep_mask(ngx:1:-1,:,:,:) = rep_mask(ngx+1:ngx+ngx,:,:,:)
- end if
- if ( symy ) then
- eh_mask(:,ngy:1:-1,:,:) = eh_mask(:,ngy+1:ngy+ngy,:,:)
-! rep_mask(:,ngy:1:-1,:,:) = rep_mask(:,ngy+1:ngy+ngy,:,:)
+! 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 = warn_message//'set function'
+ call CCTK_WARN( 1, warn_message )
end if
- if ( symz ) then
- eh_mask(:,:,ngz:1:-1,:) = eh_mask(:,:,ngz+1:ngz+ngz,:)
-! rep_mask(:,:,ngz:1:-1,:) = rep_mask(:,:,ngz+1:ngz+ngz,:)
+
+! 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')
end if
+
return
end subroutine EHFinder_ApplySymAll
@@ -92,19 +81,21 @@ subroutine EHFinder_ApplySymF(CCTK_ARGUMENTS)
DECLARE_CCTK_PARAMETERS
DECLARE_CCTK_FUNCTIONS
- CCTK_INT :: l
- character(len=14) :: fname
+ character(len=80) :: warn_message
- do l = 0, eh_number_level_sets - 1
- write(fname,'(a12,i1,a1)') 'ehfinder::f[', l, ']'
- call CartSymVN(ierr,cctkGH,fname)
- end do
+! 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 = warn_message//'set function'
+ call CCTK_WARN( 1, warn_message )
+ end if
return
end subroutine EHFinder_ApplySymF
-subroutine EHFinder_ApplySymRep(CCTK_ARGUMENTS)
+subroutine EHFinder_ApplySymMask(CCTK_ARGUMENTS)
use EHFinder_mod
@@ -114,55 +105,17 @@ subroutine EHFinder_ApplySymRep(CCTK_ARGUMENTS)
DECLARE_CCTK_PARAMETERS
DECLARE_CCTK_FUNCTIONS
-# include "include/physical_part.h"
-
-! if ( symx ) then
-! rep_mask(ngx:1:-1,:,:,:) = rep_mask(ngx+1:ngx+ngx,:,:,:)
-! end if
-! if ( symy ) then
-! rep_mask(:,ngy:1:-1,:,:) = rep_mask(:,ngy+1:ngy+ngy,:,:)
-! end if
-! if ( symz ) then
-! rep_mask(:,:,ngz:1:-1,:) = rep_mask(:,:,ngz+1:ngz+ngz,:)
-! end if
- return
-end subroutine EHFinder_ApplySymRep
-
-
-subroutine EHFinder_ApplySymFRep(CCTK_ARGUMENTS)
-
- use EHFinder_mod
-
- implicit none
-
- DECLARE_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')
+ end if
- CCTK_INT :: l
- character(len=14) :: fname
-
-# include "include/physical_part.h"
-
- do l = 0, eh_number_level_sets - 1
- write(fname,'(a12,i1,a1)') 'ehfinder::f[', l, ']'
- call CartSymVN(ierr,cctkGH,fname)
- end do
-
-! if ( symx ) then
-! rep_mask(ngx:1:-1,:,:,:) = rep_mask(ngx+1:ngx+ngx,:,:,:)
-! end if
-! if ( symy ) then
-! rep_mask(:,ngy:1:-1,:,:) = rep_mask(:,ngy+1:ngy+ngy,:,:)
-! end if
-! if ( symz ) then
-! rep_mask(:,:,ngz:1:-1,:) = rep_mask(:,:,ngz+1:ngz+ngz,:)
-! end if
return
-end subroutine EHFinder_ApplySymFRep
+end subroutine EHFinder_ApplySymMask
-subroutine EHFinder_ApplySymMask(CCTK_ARGUMENTS)
+subroutine EHFinder_ApplySymSC(CCTK_ARGUMENTS)
use EHFinder_mod
@@ -172,16 +125,14 @@ subroutine EHFinder_ApplySymMask(CCTK_ARGUMENTS)
DECLARE_CCTK_PARAMETERS
DECLARE_CCTK_FUNCTIONS
-# include "include/physical_part.h"
+ character(len=80) :: warn_message
- if ( symx ) then
- eh_mask(ngx:1:-1,:,:,:) = eh_mask(ngx+1:ngx+ngx,:,:,:)
- end if
- if ( symy ) then
- eh_mask(:,ngy:1:-1,:,:) = eh_mask(:,ngy+1:ngy+ngy,:,:)
- end if
- if ( symz ) then
- eh_mask(:,:,ngz:1:-1,:) = eh_mask(:,:,ngz+1:ngz+ngz,:)
+! 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, warn_message )
end if
+
return
-end subroutine EHFinder_ApplySymMask
+end subroutine EHFinder_ApplySymSC