Skip to content

Commit 096a968

Browse files
Removed python-size upper limit to number of immersed boundaries
1 parent a6e5784 commit 096a968

4 files changed

Lines changed: 13 additions & 16 deletions

File tree

toolchain/mfc/case_validator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from typing import Any, Dict, List, Set
1919

2020
from .common import MFCException
21-
from .params.definitions import CONSTRAINTS, NI
21+
from .params.definitions import CONSTRAINTS
2222
from .state import CFG
2323

2424
# Physics documentation for check methods.
@@ -559,7 +559,7 @@ def check_ibm(self):
559559
ib_state_wrt = self.get("ib_state_wrt", "F") == "T"
560560

561561
self.prohibit(ib and n <= 0, "Immersed Boundaries do not work in 1D (requires n > 0)")
562-
self.prohibit(ib and (num_ibs <= 0 or num_ibs > NI), f"num_ibs must be between 1 and {NI}")
562+
self.prohibit(ib and num_ibs <= 0, "num_ibs must be >= 1 when ib is enabled")
563563
self.prohibit(not ib and num_ibs > 0, "num_ibs is set, but ib is not enabled")
564564
self.prohibit(ib_state_wrt and not ib, "ib_state_wrt requires ib to be enabled")
565565

toolchain/mfc/params/definitions.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def get_value_label(param_name: str, value: int) -> str:
639639
# Counts (must be positive)
640640
"num_fluids": {"min": 1, "max": 10},
641641
"num_patches": {"min": 0, "max": 10},
642-
"num_ibs": {"min": 0, "max": NI},
642+
"num_ibs": {"min": 0},
643643
"num_source": {"min": 1},
644644
"num_probes": {"min": 1},
645645
"num_integrals": {"min": 1},
@@ -1157,9 +1157,13 @@ def _load():
11571157
for j in range(1, 4):
11581158
_ib_attrs[f"vel({j})"] = (A_REAL, _ib_tags)
11591159
_ib_attrs[f"angular_vel({j})"] = (A_REAL, _ib_tags)
1160-
REGISTRY.register_family(IndexedFamily(
1161-
base_name="patch_ib", attrs=_ib_attrs, tags=_ib_tags, max_index=NI,
1162-
))
1160+
REGISTRY.register_family(
1161+
IndexedFamily(
1162+
base_name="patch_ib",
1163+
attrs=_ib_attrs,
1164+
tags=_ib_tags,
1165+
)
1166+
)
11631167

11641168
# acoustic sources (4 sources)
11651169
for i in range(1, NA + 1):

toolchain/mfc/params/registry.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ def __init__(
9898
for fam in families.values():
9999
for attr_name, (ptype, tags) in fam.attrs.items():
100100
key = f"{fam.base_name}(1)%{attr_name}"
101-
self._examples[key] = ParamDef(
102-
name=key, param_type=ptype, tags=set(tags)
103-
)
101+
self._examples[key] = ParamDef(name=key, param_type=ptype, tags=set(tags))
104102

105103
def _resolve_family(self, name: str) -> Optional[ParamDef]:
106104
"""Try to resolve a name against indexed families. Returns ParamDef or None."""
@@ -196,9 +194,7 @@ def freeze(self) -> None:
196194
"""
197195
if not self._frozen:
198196
self._frozen = True
199-
self._all_params_view = _FamilyAwareMapping(
200-
self._params, self._families
201-
)
197+
self._all_params_view = _FamilyAwareMapping(self._params, self._families)
202198

203199
@property
204200
def is_frozen(self) -> bool:
@@ -393,9 +389,7 @@ def get_json_schema(self) -> Dict[str, Any]:
393389
for attr_name, (ptype, _tags) in fam.attrs.items():
394390
# Escape the attr name but replace sub-indices with \(\d+\)
395391
attr_pattern = re.sub(r"\(\d+\)", "__IDX__", attr_name)
396-
attr_pattern = re.escape(attr_pattern).replace(
397-
"__IDX__", r"\(\d+\)"
398-
)
392+
attr_pattern = re.escape(attr_pattern).replace("__IDX__", r"\(\d+\)")
399393
pattern = f"^{base_esc}\\(\\d+\\)%{attr_pattern}$"
400394
if pattern not in pattern_props:
401395
pattern_props[pattern] = ptype.json_schema

toolchain/mfc/viz/interactive.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,6 @@ def _get_cached_3d_mesh(
434434
return _mesh3_cache.get(key)
435435

436436

437-
438437
# (PyVista code removed — server-side rendering uses kaleido on Linux)
439438

440439

0 commit comments

Comments
 (0)