Skip to content

Commit a8f0d84

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 22304a1 commit a8f0d84

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
@@ -1029,6 +1029,7 @@ def check_mhd_simulation(self):
10291029
relativity = self.get('relativity', 'F') == 'T'
10301030
hyper_cleaning = self.get('hyper_cleaning', 'F') == 'T'
10311031
n = self.get('n', 0)
1032+
p = self.get('p', 0)
10321033

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

10441047

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

0 commit comments

Comments
 (0)