aboutsummaryrefslogtreecommitdiff
path: root/src/EHFinder_SetSym.F90
blob: 79dda89edb50bcc583a26a9d763c95529b774976 (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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
! 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 temporary source function.
  call SetCartSymGN ( ierr, cctkGH, sym, 'ehfinder::sftmp' )
  if ( ierr .gt. 0 ) then
    call CCTK_WARN(1,'Failed to register symmetry for the temp source 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

! 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.

  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
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

  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
end subroutine EHFinder_ApplySymF


subroutine EHFinder_ApplySymFSFTMP(CCTK_ARGUMENTS)

  use EHFinder_mod

  implicit none

  DECLARE_CCTK_ARGUMENTS
  DECLARE_CCTK_PARAMETERS
  DECLARE_CCTK_FUNCTIONS

  character(len=80) :: 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

  ierr = Boundary_SelectGroupForBC ( cctkGH, CCTK_ALL_FACES, 1, -1, &
                                                 'ehfinder::sftmp', 'None' )
  if ( ierr /= 0 ) then
    call CCTK_WARN ( 0, 'Could not select sftmp for boundary condition' )
  end if

  return
end subroutine EHFinder_ApplySymFSFTMP

subroutine EHFinder_ApplySymMask(CCTK_ARGUMENTS)

  use EHFinder_mod

  implicit none

  DECLARE_CCTK_ARGUMENTS
  DECLARE_CCTK_PARAMETERS
  DECLARE_CCTK_FUNCTIONS

  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
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

  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
end subroutine EHFinder_ApplySymSC