From e3115e4d2a55bafac9ee4920449efaeac9454a1f Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Mon, 26 Feb 2024 17:25:49 +0100
Subject: [PATCH] [T/M] Fix corner case in Hertz contact bisection

---
 .../Mechanics/Linear/PythonHertzContact/hertz_contact_bc.py   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Tests/Data/Mechanics/Linear/PythonHertzContact/hertz_contact_bc.py b/Tests/Data/Mechanics/Linear/PythonHertzContact/hertz_contact_bc.py
index c8ee12b98e3..1743830dd9a 100644
--- a/Tests/Data/Mechanics/Linear/PythonHertzContact/hertz_contact_bc.py
+++ b/Tests/Data/Mechanics/Linear/PythonHertzContact/hertz_contact_bc.py
@@ -45,6 +45,10 @@ class HertzContactBC(OpenGeoSys.BoundaryCondition):
                 # BCs for the current nonlinear solver iteration, i.e., the
                 # applied BCs and the information based on which the BCs are
                 # applied are off by one iteration.
+
+                # Reset left side to x_with_y_excess value, which in some cases
+                # might be lower
+                self._a_range[0] = min(self._a_range[0], self._max_x_with_y_excess)
                 self._a_range[1] = self._max_x_with_y_excess
                 assert self._a_range[0] <= self._a_range[1]
                 self._tendency_is_up = False
-- 
GitLab