@@ -54,20 +54,14 @@ contains
5454 ! Constraints on the geometric initial condition patch parameters
5555 if (patch_icpp(i)%geometry == 1 ) then
5656 call s_check_line_segment_patch_geometry(i)
57- else if (patch_icpp(i)%geometry == 2 ) then
57+ else if (patch_icpp(i)%geometry == 2 .or. patch_icpp(i)%geometry == 8 .or. patch_icpp(i)%geometry == 10 ) then
5858 call s_check_circle_patch_geometry(i)
59- else if (patch_icpp(i)%geometry == 3 ) then
59+ else if (patch_icpp(i)%geometry == 3 .or. patch_icpp(i)%geometry == 9 ) then
6060 call s_check_rectangle_patch_geometry(i)
6161 else if (patch_icpp(i)%geometry == 4 ) then
6262 call s_check_line_sweep_patch_geometry(i)
6363 else if (patch_icpp(i)%geometry == 5 ) then
6464 call s_check_ellipse_patch_geometry(i)
65- else if (patch_icpp(i)%geometry == 8 ) then
66- call s_check_sphere_patch_geometry(i)
67- else if (patch_icpp(i)%geometry == 9 ) then
68- call s_check_cuboid_patch_geometry(i)
69- else if (patch_icpp(i)%geometry == 10 ) then
70- call s_check_cylinder_patch_geometry(i)
7165 else if (patch_icpp(i)%geometry == 11 ) then
7266 call s_check_plane_sweep_patch_geometry(i)
7367 else if (patch_icpp(i)%geometry == 12 ) then
@@ -147,11 +141,30 @@ contains
147141
148142 call s_int_to_str(patch_id, iStr)
149143
150- @:PROHIBIT(n == 0 , " Circle patch " // trim (iStr)// " : n must be zero" )
151- @:PROHIBIT(p > 0 , " Circle patch " // trim (iStr)// " : p must be greater than zero" )
152- @:PROHIBIT(patch_icpp(patch_id)%radius <= 0._wp , " Circle patch " // trim (iStr)// " : radius must be greater than zero" )
153- @:PROHIBIT(f_is_default(patch_icpp(patch_id)%x_centroid), " Circle patch " // trim (iStr)// " : x_centroid must be set" )
154- @:PROHIBIT(f_is_default(patch_icpp(patch_id)%y_centroid), " Circle patch " // trim (iStr)// " : y_centroid must be set" )
144+ ! Core checks for all (Circle, Sphere, Cylinder)
145+ @:PROHIBIT(f_is_default(patch_icpp(patch_id)%x_centroid), &
146+ & " Circle/Sphere/Cylinder patch " // trim (iStr)// " : x_centroid must be set" )
147+ @:PROHIBIT(f_is_default(patch_icpp(patch_id)%y_centroid), &
148+ & " Circle/Sphere/Cylinder patch " // trim (iStr)// " : y_centroid must be set" )
149+ @:PROHIBIT(patch_icpp(patch_id)%radius <= 0._wp , &
150+ & " Circle/Sphere/Cylinder patch " // trim (iStr)// " : radius must be greater than zero" )
151+
152+ ! 3D - specific checks (Spheres and Cylinders)
153+ if (p > 0 ) then
154+ @:PROHIBIT(f_is_default(patch_icpp(patch_id)%z_centroid), &
155+ & " 3D Sphere/Cylinder patch " // trim (iStr)// " : z_centroid must be set" )
156+
157+ ! If any extrusion length is set, it' s a Cylinder. Verify exactly ONE length axis is defined.
158+ if (patch_icpp(patch_id)%length_x > 0._wp .or. patch_icpp(patch_id)%length_y > 0._wp &
159+ & .or. patch_icpp(patch_id)%length_z > 0._wp) then
160+ @:PROHIBIT((patch_icpp(patch_id)%length_x > 0._wp .and. ((.not. f_is_default(patch_icpp(patch_id)%length_y)) &
161+ & .or. (.not. f_is_default(patch_icpp(patch_id)%length_z)))) &
162+ & .or. (patch_icpp(patch_id)%length_y > 0._wp .and. ((.not. f_is_default(patch_icpp(patch_id)%length_x) &
163+ & ) .or. (.not. f_is_default(patch_icpp(patch_id)%length_z)))) &
164+ & .or. (patch_icpp(patch_id)%length_z > 0._wp .and. ((.not. f_is_default(patch_icpp(patch_id)%length_x) &
165+ & ) .or. (.not. f_is_default(patch_icpp(patch_id)%length_y)))), ' in cylinder patch ' // trim(iStr))
166+ end if
167+ end if
155168
156169 end subroutine s_check_circle_patch_geometry
157170
@@ -163,12 +176,18 @@ contains
163176 call s_int_to_str(patch_id, iStr)
164177
165178 @:PROHIBIT(n == 0, "Rectangle patch "//trim(iStr)//": n must be greater than zero")
166- @:PROHIBIT(p > 0 , " Rectangle patch " // trim (iStr)// " : p must be zero" )
167179 @:PROHIBIT(f_is_default(patch_icpp(patch_id)%x_centroid), "Rectangle patch "//trim(iStr)//": x_centroid must be set")
168180 @:PROHIBIT(f_is_default(patch_icpp(patch_id)%y_centroid), "Rectangle patch "//trim(iStr)//": y_centroid must be set")
169181 @:PROHIBIT(patch_icpp(patch_id)%length_x <= 0._wp, "Rectangle patch "//trim(iStr)//": length_x must be greater than zero")
170182 @:PROHIBIT(patch_icpp(patch_id)%length_y <= 0._wp, "Rectangle patch "//trim(iStr)//": length_y must be greater than zero")
171183
184+ ! 3D checks:
185+ if (p > 0) then
186+ @:PROHIBIT(f_is_default(patch_icpp(patch_id)%z_centroid), "3D Cuboid patch "//trim(iStr)//": z_centroid must be set")
187+ @:PROHIBIT(patch_icpp(patch_id)%length_z <= 0._wp, &
188+ & "3D Cuboid patch "//trim(iStr)//": length_z must be greater than zero")
189+ end if
190+
172191 end subroutine s_check_rectangle_patch_geometry
173192
174193 !> Check the line sweep patch input
@@ -228,21 +247,6 @@ contains
228247
229248 end subroutine s_check_2D_TaylorGreen_vortex_patch_geometry
230249
231- !> Check the model patch input
232- impure subroutine s_check_sphere_patch_geometry (patch_id )
233-
234- integer , intent (in ) :: patch_id
235-
236- call s_int_to_str(patch_id, iStr)
237-
238- @:PROHIBIT(p == 0 , " Sphere patch " // trim (iStr)// " : p must be greater than zero" )
239- @:PROHIBIT(patch_icpp(patch_id)%radius <= 0._wp , " Sphere patch " // trim (iStr)// " : radius must be greater than zero" )
240- @:PROHIBIT(f_is_default(patch_icpp(patch_id)%x_centroid), " Sphere patch " // trim (iStr)// " : x_centroid must be set" )
241- @:PROHIBIT(f_is_default(patch_icpp(patch_id)%y_centroid), " Sphere patch " // trim (iStr)// " : y_centroid must be set" )
242- @:PROHIBIT(f_is_default(patch_icpp(patch_id)%z_centroid), " Sphere patch " // trim (iStr)// " : z_centroid must be set" )
243-
244- end subroutine s_check_sphere_patch_geometry
245-
246250 !> Validate geometry parameters for a 2D modal (Fourier) patch
247251 impure subroutine s_check_2d_modal_patch_geometry(patch_id)
248252
@@ -277,52 +281,6 @@ contains
277281
278282 end subroutine s_check_3d_spherical_harmonic_patch_geometry
279283
280- !> Check the model patch input
281- impure subroutine s_check_cuboid_patch_geometry (patch_id )
282-
283- ! Patch identifier
284- integer , intent (in ) :: patch_id
285-
286- call s_int_to_str(patch_id, iStr)
287-
288- @:PROHIBIT(p == 0 , " Cuboid patch " // trim (iStr)// " : p must be greater than zero" )
289- @:PROHIBIT(f_is_default(patch_icpp(patch_id)%x_centroid), " Cuboid patch " // trim (iStr)// " : x_centroid must be set" )
290- @:PROHIBIT(f_is_default(patch_icpp(patch_id)%y_centroid), " Cuboid patch " // trim (iStr)// " : y_centroid must be set" )
291- @:PROHIBIT(f_is_default(patch_icpp(patch_id)%z_centroid), " Cuboid patch " // trim (iStr)// " : z_centroid must be set" )
292- @:PROHIBIT(patch_icpp(patch_id)%length_x <= 0._wp , " Cuboid patch " // trim (iStr)// " : length_x must be greater than zero" )
293- @:PROHIBIT(patch_icpp(patch_id)%length_y <= 0._wp , " Cuboid patch " // trim (iStr)// " : length_y must be greater than zero" )
294- @:PROHIBIT(patch_icpp(patch_id)%length_z <= 0._wp , " Cuboid patch " // trim (iStr)// " : length_z must be greater than zero" )
295-
296- end subroutine s_check_cuboid_patch_geometry
297-
298- !> Check the model patch input
299- impure subroutine s_check_cylinder_patch_geometry (patch_id )
300-
301- ! Patch identifier
302- integer , intent (in ) :: patch_id
303-
304- call s_int_to_str(patch_id, iStr)
305-
306- @:PROHIBIT(p == 0 , " Cylinder patch " // trim (iStr)// " : p must be greater than zero" )
307- @:PROHIBIT(f_is_default(patch_icpp(patch_id)%x_centroid), " Cylinder patch " // trim (iStr)// " : x_centroid must be set" )
308- @:PROHIBIT(f_is_default(patch_icpp(patch_id)%y_centroid), " Cylinder patch " // trim (iStr)// " : y_centroid must be set" )
309- @:PROHIBIT(f_is_default(patch_icpp(patch_id)%z_centroid), " Cylinder patch " // trim (iStr)// " : z_centroid must be set" )
310- @:PROHIBIT(patch_icpp(patch_id)%radius <= 0._wp , " Cylinder patch " // trim (iStr)// " : radius must be greater than zero" )
311-
312- ! Check if exactly one length is defined
313- @:PROHIBIT(count ([patch_icpp(patch_id)%length_x > 0._wp , patch_icpp(patch_id)%length_y > 0._wp , &
314- & patch_icpp(patch_id)%length_z > 0._wp ]) /= 1 , &
315- & " Cylinder patch " // trim (iStr) &
316- & // " : Exactly one of length_x, length_y, or length_z must be defined and positive" )
317-
318- ! Ensure the defined length is positive
319- @:PROHIBIT((.not. f_is_default(patch_icpp(patch_id)%length_x) .and. patch_icpp(patch_id)%length_x <= 0._wp ) &
320- & .or. (.not. f_is_default(patch_icpp(patch_id)%length_y) .and. patch_icpp(patch_id)%length_y <= 0._wp ) &
321- & .or. (.not. f_is_default(patch_icpp(patch_id)%length_z) .and. patch_icpp(patch_id)%length_z <= 0._wp ), &
322- & " Cylinder patch " // trim (iStr) // " : The defined length_{} must be greater than zero" )
323-
324- end subroutine s_check_cylinder_patch_geometry
325-
326284 !> Check the model patch input
327285 impure subroutine s_check_plane_sweep_patch_geometry(patch_id)
328286
0 commit comments