Fix bug when Edge or Plate is in a positive halo

Edges and plates are no longer built in the positive halo as they are
not needed. Previously this caused a memory corruption as the cython
functions were performing out of bounds memory access in the rigidE
and rigidH arrays.
这个提交包含在:
Nathan Mannall
2025-02-21 10:37:20 +00:00
父节点 2c7c07885b
当前提交 6fbb94f058

查看文件

@@ -173,7 +173,7 @@ class MainGridUserInput(UserInput[GridType]):
lower_within_grid, lower_point = self.check_point(p1, cmd_str, "lower")
upper_within_grid, upper_point = self.check_point(p2, cmd_str, "upper")
if np.greater(lower_point, upper_point).any():
if np.greater(lower_point, upper_point).any() or np.equal(lower_point, upper_point).all():
raise ValueError(
f"'{cmd_str}' the lower coordinates should be less than the upper coordinates."
)
@@ -296,7 +296,11 @@ class MPIUserInput(MainGridUserInput[MPIGrid]):
lower_point = np.where(lower_point < 0, 0, lower_point)
upper_point = np.where(upper_point > self.grid.size, self.grid.size, upper_point)
return all(lower_point <= upper_point), lower_point, upper_point
return (
all(lower_point <= upper_point) and all(lower_point < self.grid.size),
lower_point,
upper_point,
)
class SubgridUserInput(MainGridUserInput[SubGridBaseGrid]):