@@ -43,15 +43,11 @@ contains
4343 y_boundary%end = y_centroid + 0.5_wp * length_y
4444
4545 ! Patch is a vertical line at x_beg and x_beg is a domain boundary
46- #:for BOUND, X, LOC in [(' beg' , ' -i' , - 1 ), (' end' , ' m+i' , 1 )]
46+ #:for BOUND, X, LOC, IDX in [(' beg' , ' -i' , - 1 , 1 ), (' end' , ' m+i' , 1 , 2 )]
4747 if (patch_bc(patch_id)%loc == ${LOC}$ .and. bc_x%${BOUND}$ < 0 ) then
4848 do j = 0 , n
4949 if (y_cc(j) > y_boundary%beg .and. y_cc(j) < y_boundary%end) then
50- if (${LOC}$ == - 1 ) then
51- bc_type(1 , 1 )%sf(0 , j, 0 ) = patch_bc(patch_id)%type
52- else
53- bc_type(1 , 2 )%sf(0 , j, 0 ) = patch_bc(patch_id)%type
54- end if
50+ bc_type(1 , ${IDX}$)%sf(0 , j, 0 ) = patch_bc(patch_id)%type
5551 end if
5652 end do
5753 end if
@@ -67,15 +63,11 @@ contains
6763 x_boundary%end = x_centroid + 0.5_wp * length_x
6864
6965 ! Patch is a vertical line at x_beg and x_beg is a domain boundary
70- #:for BOUND, Y, LOC in [(' beg' , ' -i' , - 1 ), (' end' , ' n+i' , 1 )]
66+ #:for BOUND, Y, LOC, IDX in [(' beg' , ' -i' , - 1 , 1 ), (' end' , ' n+i' , 1 , 2 )]
7167 if (patch_bc(patch_id)%loc == ${LOC}$ .and. bc_y%${BOUND}$ < 0 ) then
7268 do j = 0 , m
7369 if (x_cc(j) > x_boundary%beg .and. x_cc(j) < x_boundary%end) then
74- if (${LOC}$ == - 1 ) then
75- bc_type(2 , 1 )%sf(j, 0 , 0 ) = patch_bc(patch_id)%type
76- else
77- bc_type(2 , 2 )%sf(j, 0 , 0 ) = patch_bc(patch_id)%type
78- end if
70+ bc_type(2 , ${IDX}$)%sf(j, 0 , 0 ) = patch_bc(patch_id)%type
7971 end if
8072 end do
8173 end if
@@ -96,13 +88,13 @@ contains
9688 z_centroid = patch_bc(patch_id)%centroid(3 )
9789 radius = patch_bc(patch_id)%radius
9890 ! Patch is a circle at x_beg and x_beg is a domain boundary
99- #:for BOUND, X, LOC in [(' beg' , ' -i' , - 1 ), (' end' , ' m+i' , 1 )]
91+ #:for BOUND, X, LOC, IDX in [(' beg' , ' -i' , - 1 , 1 ), (' end' , ' m+i' , 1 , 2 )]
10092 if (patch_bc(patch_id)%loc == ${LOC}$ .and. bc_x%${BOUND}$ < 0 ) then
10193 do k = 0 , p
10294 do j = 0 , n
10395 if ((z_cc(k) - z_centroid)** 2._wp + &
10496 (y_cc(j) - y_centroid)** 2._wp <= radius** 2._wp ) then
105- bc_type(1 , 1 )%sf(0 , j, k) = patch_bc(patch_id)%type
97+ bc_type(1 , ${IDX}$ )%sf(0 , j, k) = patch_bc(patch_id)%type
10698 end if
10799 end do
108100 end do
@@ -114,13 +106,13 @@ contains
114106 z_centroid = patch_bc(patch_id)%centroid(3 )
115107 radius = patch_bc(patch_id)%radius
116108 ! Patch is a circle at y_beg and y_beg is a domain boundary
117- #:for BOUND, Y, LOC in [(' beg' , ' -i' , - 1 ), (' end' , ' n+i' , 1 )]
109+ #:for BOUND, Y, LOC, IDX in [(' beg' , ' -i' , - 1 , 1 ), (' end' , ' n+i' , 1 , 2 )]
118110 if (patch_bc(patch_id)%loc == ${LOC}$ .and. bc_y%${BOUND}$ < 0 ) then
119111 do k = 0 , p
120112 do j = 0 , m
121113 if ((z_cc(k) - z_centroid)** 2._wp + &
122114 (x_cc(j) - x_centroid)** 2._wp <= radius** 2._wp ) then
123- bc_type(2 , 1 )%sf(j, 0 , k) = patch_bc(patch_id)%type
115+ bc_type(2 , ${IDX}$ )%sf(j, 0 , k) = patch_bc(patch_id)%type
124116 end if
125117 end do
126118 end do
@@ -131,13 +123,13 @@ contains
131123 x_centroid = patch_bc(patch_id)%centroid(1 )
132124 y_centroid = patch_bc(patch_id)%centroid(2 )
133125 radius = patch_bc(patch_id)%radius
134- #:for BOUND, Z, LOC in [(' beg' , ' -i' , - 1 ), (' end' , ' p+i' , 1 )]
126+ #:for BOUND, Z, LOC, IDX in [(' beg' , ' -i' , - 1 , 1 ), (' end' , ' p+i' , 1 , 2 )]
135127 if (patch_bc(patch_id)%loc == ${LOC}$ .and. bc_z%${BOUND}$ < 0 ) then
136128 do k = 0 , n
137129 do j = 0 , m
138130 if ((y_cc(k) - y_centroid)** 2._wp + &
139131 (x_cc(j) - x_centroid)** 2._wp <= radius** 2._wp ) then
140- bc_type(3 , 1 )%sf(j, k, 0 ) = patch_bc(patch_id)%type
132+ bc_type(3 , ${IDX}$ )%sf(j, k, 0 ) = patch_bc(patch_id)%type
141133 end if
142134 end do
143135 end do
@@ -165,15 +157,15 @@ contains
165157 z_boundary%beg = z_centroid - 0.5_wp * length_z
166158 z_boundary%end = z_centroid + 0.5_wp * length_z
167159 ! Patch is a circle at x_beg and x_beg is a domain boundary
168- #:for BOUND, X, LOC in [(' beg' , ' -i' , - 1 ), (' end' , ' m+i' , 1 )]
160+ #:for BOUND, X, LOC, IDX in [(' beg' , ' -i' , - 1 , 1 ), (' end' , ' m+i' , 1 , 2 )]
169161 if (patch_bc(patch_id)%loc == ${LOC}$ .and. bc_x%${BOUND}$ < 0 ) then
170162 do k = 0 , p
171163 do j = 0 , n
172164 if (y_boundary%beg <= y_cc(j) .and. &
173165 y_boundary%end >= y_cc(j) .and. &
174166 z_boundary%beg <= z_cc(k) .and. &
175167 z_boundary%end >= z_cc(k)) then
176- bc_type(1 , 1 )%sf(0 , j, k) = patch_bc(patch_id)%type
168+ bc_type(1 , ${IDX}$ )%sf(0 , j, k) = patch_bc(patch_id)%type
177169 end if
178170 end do
179171 end do
@@ -192,15 +184,15 @@ contains
192184 z_boundary%beg = z_centroid - 0.5_wp * length_z
193185 z_boundary%end = z_centroid + 0.5_wp * length_z
194186 ! Patch is a circle at y_beg and y_beg is a domain boundary
195- #:for BOUND, Y, LOC in [(' beg' , ' -i' , - 1 ), (' end' , ' n+i' , 1 )]
187+ #:for BOUND, Y, LOC, IDX in [(' beg' , ' -i' , - 1 , 1 ), (' end' , ' n+i' , 1 , 2 )]
196188 if (patch_bc(patch_id)%loc == ${LOC}$ .and. bc_y%${BOUND}$ < 0 ) then
197189 do k = 0 , p
198190 do j = 0 , m
199191 if (x_boundary%beg <= x_cc(j) .and. &
200192 x_boundary%end >= x_cc(j) .and. &
201193 z_boundary%beg <= z_cc(k) .and. &
202194 z_boundary%end >= z_cc(k)) then
203- bc_type(2 , 1 )%sf(j, 0 , k) = patch_bc(patch_id)%type
195+ bc_type(2 , ${IDX}$ )%sf(j, 0 , k) = patch_bc(patch_id)%type
204196 end if
205197 end do
206198 end do
@@ -218,15 +210,15 @@ contains
218210
219211 y_boundary%beg = y_centroid - 0.5_wp * length_y
220212 y_boundary%end = y_centroid + 0.5_wp * length_y
221- #:for BOUND, Z, LOC in [(' beg' , ' -i' , - 1 ), (' end' , ' p+i' , 1 )]
213+ #:for BOUND, Z, LOC, IDX in [(' beg' , ' -i' , - 1 , 1 ), (' end' , ' p+i' , 1 , 2 )]
222214 if (patch_bc(patch_id)%loc == ${LOC}$ .and. bc_z%${BOUND}$ < 0 ) then
223215 do k = 0 , n
224216 do j = 0 , m
225217 if (x_boundary%beg <= x_cc(j) .and. &
226218 x_boundary%end >= x_cc(j) .and. &
227219 y_boundary%beg <= y_cc(k) .and. &
228220 y_boundary%end >= y_cc(k)) then
229- bc_type(3 , 1 )%sf(j, k, 0 ) = patch_bc(patch_id)%type
221+ bc_type(3 , ${IDX}$ )%sf(j, k, 0 ) = patch_bc(patch_id)%type
230222 end if
231223 end do
232224 end do
0 commit comments