Skip to content

Commit 54e66bc

Browse files
committed
Add case_validator check for files_dir/file_extension when using extrusion hcids
1 parent 99cd729 commit 54e66bc

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

toolchain/mfc/case_validator.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@
183183
"category": "Acoustic Sources",
184184
"explanation": ("Dimension-specific support types. Pulse type in {1,2,3,4}. Non-planar sources require foc_length and aperture."),
185185
},
186+
# IC Extrusion
187+
"check_ic_extrusion": {
188+
"title": "IC Extrusion File Parameters",
189+
"category": "IC Extrusion",
190+
"explanation": "Extrusion hcids (170, 270, 271, 272, 370) read initial condition data from files. Both files_dir and file_extension must be set.",
191+
},
186192
# Post-Processing
187193
"check_vorticity": {
188194
"title": "Vorticity Output",
@@ -2037,6 +2043,26 @@ def check_geometry_precision_simulation(self):
20372043

20382044
# Main Validation Entry Points
20392045

2046+
def check_ic_extrusion(self):
2047+
"""Checks that files_dir and file_extension are set for extrusion hcids."""
2048+
extrusion_hcids = {170, 270, 271, 272, 370}
2049+
num_patches = self.get("num_patches", 0)
2050+
if not self._is_numeric(num_patches) or num_patches <= 0:
2051+
return
2052+
2053+
for i in range(1, num_patches + 1):
2054+
hcid = self.get(f"patch_icpp({i})%hcid")
2055+
if hcid not in extrusion_hcids:
2056+
continue
2057+
self.prohibit(
2058+
not self.is_set("files_dir"),
2059+
f"patch_icpp({i})%hcid={hcid} requires files_dir to be set",
2060+
)
2061+
self.prohibit(
2062+
not self.is_set("file_extension"),
2063+
f"patch_icpp({i})%hcid={hcid} requires file_extension to be set",
2064+
)
2065+
20402066
def validate_common(self):
20412067
"""Validate parameters common to all stages"""
20422068
self.check_parameter_types() # Type validation first
@@ -2101,6 +2127,7 @@ def validate_pre_process(self):
21012127
self.check_patch_within_domain()
21022128
self.check_velocity_components()
21032129
self.check_bc_patches()
2130+
self.check_ic_extrusion()
21042131

21052132
def validate_post_process(self):
21062133
"""Validate post-process-specific parameters"""

0 commit comments

Comments
 (0)