Skip to content

Algebraic multigrid with filtering contact (AMGFContact) preconditioner for contact linear systems#1542

Merged
thartland merged 26 commits intodevelopfrom
hartland1/feature/amgf
Mar 11, 2026
Merged

Algebraic multigrid with filtering contact (AMGFContact) preconditioner for contact linear systems#1542
thartland merged 26 commits intodevelopfrom
hartland1/feature/amgf

Conversation

@thartland
Copy link
Copy Markdown
Contributor

@thartland thartland commented Feb 16, 2026

This PR adds the capability of using AMGF (algebraic multigrid with filtering arXiv preprint)-preconditioned Krylov-subspace linear solvers for the Newton linear solves that arise in outer loop solves of contact problems.

  • Obtain list of contact dofs via ContactData::addContactInteraction calls.
  • Create a boundary_dof --> subspace transfer operator (mfem::HypreParMatrix) call. Much of this infastructure is in the utilities of continuationsolvers but a version most suitable for usage in smith would be best for less complex code.
  • Obtain subspace transfer (displacement dofs --> contact dofs) operator via the list of contact dofs in appropriate place for passing the subspace transfer operator to the preconditioner provided that said linear solver preconditioner is AMGF.
  • Resolve usage errors conflating print_level and preconditioner_print_level from linear solver options in the buildPreconditioner method.
  • Test.

For future investigation/potential PR(s)
(1) Make AMGFContact robust to indefiniteness issues stemming from using exact Hessians in Newton solves.
(2) More careful consideration for setting outer/inner tolerances (as well as norms used) for Newton-Krylov.

Note -- AMGFContact preconditioned Krylov-subspace methods will fails unless the problem is a contact problem. The failure is indicated by mfem generated error messages indicating that the subspace transfer operator has not been set.

@thartland thartland added the WIP Work in progress label Feb 16, 2026
@thartland thartland changed the title WIP: AMGF WIP: Algebraic multigrid with filtering (AMGF) preconditioner for contact linear systems Feb 25, 2026
@thartland thartland removed WIP Work in progress labels Feb 27, 2026
@thartland thartland changed the title WIP: Algebraic multigrid with filtering (AMGF) preconditioner for contact linear systems Algebraic multigrid with filtering (AMGF) preconditioner for contact linear systems Feb 27, 2026
@thartland thartland requested review from ebchin and tupek2 February 27, 2026 22:38
@thartland thartland changed the title Algebraic multigrid with filtering (AMGF) preconditioner for contact linear systems Algebraic multigrid with filtering contact (AMGFContact) preconditioner for contact linear systems Mar 3, 2026
…n error in the gcc Release build due to a potential null pointer deference warning (error) in the body of the iterative solver GetComm method. Replacing the iterative solver GetComm call with a HypreParMatrix GetComm call, should serve the same purpose
@thartland thartland added the ready for review Ready for active inspection by reviewers label Mar 5, 2026
Copy link
Copy Markdown
Member

@ebchin ebchin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @thartland, looking forward to using it!

Comment thread src/smith/numerics/solver_config.hpp Outdated
Comment thread src/smith/numerics/solver_config.hpp
Comment thread src/smith/physics/contact/contact_data.cpp Outdated
// number of rows of the restriction
// operator owned by the local MPI process
int nrows_loc = contact_dofs_.Size();
// should nrows_glb be of type HYPRE_BigInt?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, yes. this would limit us to 2 billions dofs, max. There are likely other places we'd need to fix this though.

Comment thread src/smith/numerics/solver_config.hpp Outdated
Comment thread src/smith/numerics/solver_config.hpp
Comment thread src/smith/physics/tests/contact_beam_amgf.cpp Outdated
Comment thread src/smith/physics/tests/contact_beam_amgf.cpp
Comment thread src/smith/physics/solid_mechanics_contact.hpp Outdated
Copy link
Copy Markdown
Collaborator

@tupek2 tupek2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these subspace transfers being computed once up front, or would they occur every time a new Jacobian is assembled (say in a Newton iteration loop). Maybe the performance if not so bad, but something to consider down the line perhaps.

Comment thread src/smith/physics/tests/contact_beam_amgf.cpp
std::unique_ptr<mfem::HypreParMatrix> ContactData::contactSubspaceTransferOperator()
{
// TODO: if there is no tribol contact what should be done here?
std::unique_ptr<mfem::HypreParMatrix> transfer_operator = nullptr;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presumably we error out. maybe that is already happening elsewhere?

@thartland
Copy link
Copy Markdown
Contributor Author

Are these subspace transfers being computed once up front, or would they occur every time a new Jacobian is assembled (say in a Newton iteration loop). Maybe the performance if not so bad, but something to consider down the line perhaps.

Good point. The subspace transfer operator is computed once every time SolidMechanicsContact::warmStartDisplacementContact is called which seems to be once per time-step. This does seem like too much and don't see a case for which the set of potential contact dofs would evolve in time.

@thartland
Copy link
Copy Markdown
Contributor Author

Are these subspace transfers being computed once up front, or would they occur every time a new Jacobian is assembled (say in a Newton iteration loop). Maybe the performance if not so bad, but something to consider down the line perhaps.

This has now been updated and the subspace transfer operator is computed once per contact simulation.

@thartland
Copy link
Copy Markdown
Contributor Author

thartland commented Mar 11, 2026

@white238 -- regarding the guarding against usage of the contact_beam_amgf.cpp test in non-Tribol/non-Strumpack builds. Currently it is guarded against usage in Tribol and similar Tribol contact test cases have similar error messages when using non-Strumpack builds. See here. Do any of the mfem TPLs that we test against have non STRUMPACK builds?

Nonetheless I put STRUMPACK specific guards for including this test in non strumpack builds.

@white238
Copy link
Copy Markdown
Member

@white238 -- regarding the guarding against usage of the contact_beam_amgf.cpp test in non-Tribol/non-Strumpack builds. Currently it is guarded against usage in Tribol and similar Tribol contact test cases have similar error messages when using non-Strumpack builds. See here. Do any of the mfem TPLs that we test against have non STRUMPACK builds?

Nonetheless I put STRUMPACK specific guards for including this test in non strumpack builds.

Thanks for putting the check in.. we should verify turning off our optional TPLs to see if they are properly guarded but that is outside the scope of this PR.

@thartland thartland merged commit c705ed0 into develop Mar 11, 2026
10 checks passed
@thartland thartland deleted the hartland1/feature/amgf branch March 11, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Ready for active inspection by reviewers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants