Skip to content

Energy mortar quadrature point gap enforcement - #1642

Open
ebchin wants to merge 31 commits into
developfrom
feature/ebchin/quad-point-gap
Open

ebchin wants to merge 31 commits into
developfrom
feature/ebchin/quad-point-gap

Conversation

@ebchin

@ebchin ebchin commented Aug 6, 2026

Copy link
Copy Markdown
Member

Also add FD testing to test_adjoint_workflow and finding related bugs.

Comment thread cmake/thirdparty/SetupSmithThirdParty.cmake Outdated
Comment thread src/smith/physics/tests/test_adjoint_workflow.cpp Outdated
Comment thread src/smith/physics/solid_mechanics_contact.hpp
@ebchin
ebchin marked this pull request as ready for review September 4, 2026 16:21
@ebchin ebchin self-assigned this Sep 4, 2026
@ebchin ebchin added the ready for review Ready for active inspection by reviewers label Sep 4, 2026
@white238
white238 requested a lite review from Copilot September 9, 2026 17:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A user-facing CLI/behavior change needs an [Unreleased] entry in RELEASE-NOTES.md (and there are a couple of small correctness/cleanup issues to address).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds support and coverage for EnergyMortar gap enforcement at quadrature points (vs nodal), strengthens adjoint correctness checks via finite differences, and refactors a few numerics/contact internals to support these workflows.

Changes:

  • Parameterized multiple contact/Tribol tests (and an example) to run with both nodal and quadrature-point gap evaluation.
  • Updated contact reference-coordinate handling to use a shape-displaced reference mesh for EnergyMortar exact Jacobians, and adjusted pressure/state handling accordingly.
  • Extracted dogleg-step selection into steihaug_toint_cg utilities and added robustness when a preconditioner is not positive-definite.
File summaries
File Description
src/smith/physics/tests/tribol_finite_diff.cpp Parameterize EnergyMortar FD test by gap enforcement location.
src/smith/physics/tests/test_adjoint_workflow.cpp Add finite-difference adjoint validation and expand contact test cases.
src/smith/physics/tests/energy_mortar_patch.cpp Parameterize EnergyMortar patch test by gap enforcement location.
src/smith/physics/tests/contact_finite_diff.cpp Parameterize 2D EnergyMortar FD test by gap enforcement location.
src/smith/physics/solid_mechanics_contact.hpp Refactor/extend adjoint-load assembly for per-interaction contact-force seeds and shape sensitivity.
src/smith/physics/contact/contact_interaction.hpp Update ContactInteraction API/docs for shaped-reference coordinates.
src/smith/physics/contact/contact_interaction.cpp Register shaped reference coords for EnergyMortar exact Jacobian path.
src/smith/physics/contact/contact_data.hpp Add stored shaped-reference coordinate field.
src/smith/physics/contact/contact_data.cpp Maintain shaped reference coords, and avoid pressure-state resets/sets where EnergyMortar doesn’t expose an independent pressure state.
src/smith/numerics/tests/test_steihaug_toint_cg.cpp Add tests for non-positive preconditioner fallback and dogleg selection behavior.
src/smith/numerics/steihaug_toint_cg.hpp Expose doglegStep helper in numerics API.
src/smith/numerics/steihaug_toint_cg.cpp Implement doglegStep and add CG fallback when the preconditioner yields non-positive inner products.
src/smith/numerics/equation_solver.cpp Switch TrustRegion dogleg selection to the shared smith::doglegStep utility.
examples/contact/ironing_2D.cpp Add CLI flag to select EnergyMortar gap mode and propagate to Tribol enforcement location.
Review details
  • Files reviewed: 15/15 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread examples/contact/ironing_2D.cpp
Comment on lines 50 to 51
* @param contact_opts Defines contact method, enforcement, type, and penalty
* coordinates

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, I think the stray "coordinates" was orphaned from the previous function parameter. That is, it belongs on the end of line 49. @ebchin, can you confirm?

Comment on lines 29 to +33
#include "smith/physics/materials/solid_material.hpp"
#include "smith/smith_config.hpp"
#include "smith/infrastructure/application_manager.hpp"
#include "tribol/mesh/CouplingScheme.hpp"
#include "tribol/interface/tribol.hpp"

@btalamini btalamini left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This changes the behavior of our core solver. Please don't merge this until we've talked about it.

Comment thread src/smith/numerics/equation_solver.cpp
Comment thread src/smith/physics/contact/contact_data.cpp
Comment on lines 50 to 51
* @param contact_opts Defines contact method, enforcement, type, and penalty
* coordinates

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, I think the stray "coordinates" was orphaned from the previous function parameter. That is, it belongs on the end of line 49. @ebchin, can you confirm?

Comment thread src/smith/numerics/steihaug_toint_cg.cpp Outdated
Comment thread src/smith/numerics/tests/test_steihaug_toint_cg.cpp Outdated
@btalamini btalamini removed the ready for review Ready for active inspection by reviewers label Sep 16, 2026
@ebchin
ebchin force-pushed the feature/ebchin/quad-point-gap branch from fa70f4a to 2cca592 Compare September 17, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants