aboutsummaryrefslogtreecommitdiff
path: root/src/EHFinder_SetSym.F90
blob: 0a734b01408979f7a9a7a9ac181e984e57c998c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
! Registration of symmetries for the necessary grid functions.
! $Header$

#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "cctk_Functions.h"

subroutine EHFinder_SetSym(CCTK_ARGUMENTS)

  use EHFinder_mod

  implicit none

  DECLARE_CCTK_ARGUMENTS
  DECLARE_CCTK_PARAMETERS

  CCTK_INT, dimension(3) :: sym

! All grid functions have even symmetries in all directions.
  sym = 1

! 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

  return
end subroutine EHFinder_SetSym


subroutine EHFinder_ApplySymAll(CCTK_ARGUMENTS)

  use EHFinder_mod

  implicit none

  DECLARE_CCTK_ARGUMENTS
  DECLARE_CCTK_PARAMETERS
  DECLARE_CCTK_FUNCTIONS

  character(len=80) :: warn_message

! 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

! 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


subroutine EHFinder_ApplySymF(CCTK_ARGUMENTS)

  use EHFinder_mod

  implicit none

  DECLARE_CCTK_ARGUMENTS
  DECLARE_CCTK_PARAMETERS
  DECLARE_CCTK_FUNCTIONS

  character(len=80) :: warn_message

! 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

  return
end subroutine EHFinder_ApplySymF


subroutine EHFinder_ApplySymMask(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

  return
end subroutine EHFinder_ApplySymMask


subroutine EHFinder_ApplySymSC(CCTK_ARGUMENTS)

  use EHFinder_mod

  implicit none

  DECLARE_CCTK_ARGUMENTS
  DECLARE_CCTK_PARAMETERS
  DECLARE_CCTK_FUNCTIONS

  character(len=80) :: warn_message

! 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) )
  end if

  return
end subroutine EHFinder_ApplySymSC