@@ -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
@@ -141,17 +135,31 @@ contains
141135 end subroutine s_check_line_segment_patch_geometry
142136
143137 !> Check the circle patch input
144- impure subroutine s_check_circle_patch_geometry (patch_id )
138+ impure subroutine s_check_circle_patch_geometry (patch_id )
145139
146140 integer , intent (in ) :: patch_id
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), " Circle/Sphere/Cylinder patch " // trim (iStr)// " : x_centroid must be set" )
146+ @:PROHIBIT(f_is_default(patch_icpp(patch_id)%y_centroid), " Circle/Sphere/Cylinder patch " // trim (iStr)// " : y_centroid must be set" )
147+ @:PROHIBIT(patch_icpp(patch_id)%radius <= 0._wp , " Circle/Sphere/Cylinder patch " // trim (iStr)// " : radius must be greater than zero" )
148+
149+ ! 3D - specific checks (Spheres and Cylinders)
150+ if (p > 0 ) then
151+ @:PROHIBIT(f_is_default(patch_icpp(patch_id)%z_centroid), " 3D Sphere/Cylinder patch " // trim (iStr)// " : z_centroid must be set" )
152+
153+ ! If any extrusion length is set, it' s a Cylinder. Verify exactly ONE length axis is defined.
154+ if (patch_icpp(patch_id)%length_x > 0._wp .or. patch_icpp(patch_id)%length_y > 0._wp .or. patch_icpp(patch_id)%length_z > 0._wp) then
155+ @:PROHIBIT((patch_icpp(patch_id)%length_x > 0._wp .and. ((.not. f_is_default(patch_icpp(patch_id)%length_y)) &
156+ & .or. (.not. f_is_default(patch_icpp(patch_id)%length_z)))) .or. (patch_icpp(patch_id)%length_y > 0._wp &
157+ & .and. ((.not. f_is_default(patch_icpp(patch_id)%length_x)) &
158+ & .or. (.not. f_is_default(patch_icpp(patch_id)%length_z)))) .or. (patch_icpp(patch_id)%length_z > 0._wp &
159+ & .and. ((.not. f_is_default(patch_icpp(patch_id)%length_x)) &
160+ & .or. (.not. f_is_default(patch_icpp(patch_id)%length_y)))), ' in cylinder patch ' // trim(iStr))
161+ end if
162+ end if
155163
156164 end subroutine s_check_circle_patch_geometry
157165
@@ -163,12 +171,17 @@ contains
163171 call s_int_to_str(patch_id, iStr)
164172
165173 @: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" )
167174 @:PROHIBIT(f_is_default(patch_icpp(patch_id)%x_centroid), "Rectangle patch "//trim(iStr)//": x_centroid must be set")
168175 @:PROHIBIT(f_is_default(patch_icpp(patch_id)%y_centroid), "Rectangle patch "//trim(iStr)//": y_centroid must be set")
169176 @:PROHIBIT(patch_icpp(patch_id)%length_x <= 0._wp, "Rectangle patch "//trim(iStr)//": length_x must be greater than zero")
170177 @:PROHIBIT(patch_icpp(patch_id)%length_y <= 0._wp, "Rectangle patch "//trim(iStr)//": length_y must be greater than zero")
171178
179+ ! 3D checks:
180+ if(p > 0) then
181+ @:PROHIBIT(f_is_default(patch_icpp(patch_id)%z_centroid), "3D Cuboid patch "//trim(iStr)//": z_centroid must be set")
182+ @:PROHIBIT(patch_icpp(patch_id)%length_z <= 0._wp, "3D Cuboid patch "//trim(iStr)//": length_z must be greater than zero")
183+ end if
184+
172185 end subroutine s_check_rectangle_patch_geometry
173186
174187 !> Check the line sweep patch input
@@ -228,20 +241,6 @@ contains
228241
229242 end subroutine s_check_2D_TaylorGreen_vortex_patch_geometry
230243
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
245244
246245 !> Validate geometry parameters for a 2D modal (Fourier) patch
247246 impure subroutine s_check_2d_modal_patch_geometry(patch_id)
@@ -277,51 +276,7 @@ contains
277276
278277 end subroutine s_check_3d_spherical_harmonic_patch_geometry
279278
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)
305279
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
325280
326281 !> Check the model patch input
327282 impure subroutine s_check_plane_sweep_patch_geometry(patch_id)
0 commit comments