Skip to content

Commit 7cb0512

Browse files
sbryngelsonclaude
andcommitted
Prohibit hyper_cleaning in 2D simulations (p == 0)
The psi field used by hyperbolic cleaning is initialized with a 3D loop that accesses z_cc, which is out-of-bounds when p == 0. The 1D prohibition already existed; extend it to 2D. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3b87205 commit 7cb0512

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

toolchain/mfc/case_validator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,7 @@ def check_mhd_simulation(self):
10301030
relativity = self.get('relativity', 'F') == 'T'
10311031
hyper_cleaning = self.get('hyper_cleaning', 'F') == 'T'
10321032
n = self.get('n', 0)
1033+
p = self.get('p', 0)
10331034

10341035
self.prohibit(mhd and riemann_solver is not None and riemann_solver not in [1, 4],
10351036
"MHD simulations require riemann_solver = 1 (HLL) or riemann_solver = 4 (HLLD)")
@@ -1041,6 +1042,8 @@ def check_mhd_simulation(self):
10411042
"Hyperbolic cleaning requires mhd to be enabled")
10421043
self.prohibit(hyper_cleaning and n is not None and n == 0,
10431044
"Hyperbolic cleaning is not supported for 1D simulations")
1045+
self.prohibit(hyper_cleaning and p is not None and p == 0,
1046+
"Hyperbolic cleaning is not supported for 2D simulations")
10441047

10451048

10461049
def check_igr_simulation(self): # pylint: disable=too-many-locals

0 commit comments

Comments
 (0)