Test reduced Newton equivalence within the intended root basin

This commit is contained in:
2026-09-17 09:37:35 -04:00
parent fc944c1bfe
commit 5e03188816

View File

@@ -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);