From 5e03188816a13247fb480e3b1f36f1b0425ac9cb Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Thu, 17 Sep 2026 09:37:35 -0400 Subject: [PATCH] Test reduced Newton equivalence within the intended root basin --- tests/solver/gravity_reduction.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/solver/gravity_reduction.cpp b/tests/solver/gravity_reduction.cpp index b4fe0f2..485ea16 100644 --- a/tests/solver/gravity_reduction.cpp +++ b/tests/solver/gravity_reduction.cpp @@ -311,9 +311,17 @@ TEST_CASE("The projected full inverse preconditions the reduced Schur operator", } TEST_CASE("Reduced and monolithic Newton converge to the same curved-system equilibrium", "[solver][gravity_reduction]") { - auto reducedState = manifoldState(0.6, 0.2); + // This system has a second equilibrium near (0.713, 0.171). The old + // (0.6, 0.2) seed lay near the intervening fold and selected that root. + // Test local Newton equivalence in the known root's basin, rather than + // assuming uniqueness or comparing a fixed iteration count at two rates. + auto reducedState = manifoldState(0.52, 0.24); auto monolithicState = reducedState; for (int iteration = 0; iteration < 8; ++iteration) { + if (fullResidual(reducedState).Norml2() < 2.0e-14 && + fullResidual(monolithicState).Norml2() < 2.0e-14) { + break; + } DenseGravitySubsystem subsystem(fullJacobian(reducedState), testPartition()); GravityReducedOperator operation(subsystem, innerControl); auto rhs = fullResidual(reducedState); @@ -333,6 +341,10 @@ TEST_CASE("Reduced and monolithic Newton converge to the same curved-system equi mfem::Vector fullCorrection(4); fullInverse.Mult(monolithicRhs, fullCorrection); monolithicState += fullCorrection; + CHECK(reducedState(1) > 0.45); + CHECK(reducedState(1) < 0.55); + CHECK(monolithicState(1) > 0.45); + CHECK(monolithicState(1) < 0.55); } const auto expected = manifoldState(0.5, 0.25); CHECK(fullResidual(reducedState).Norml2() < 2.0e-14);