Skip to content

Improve BTS mortar checks#1919

Merged
isteinbrecher merged 1 commit into
4C-multiphysics:mainfrom
isteinbrecher:improve-bts-mortar-checks
Apr 1, 2026
Merged

Improve BTS mortar checks#1919
isteinbrecher merged 1 commit into
4C-multiphysics:mainfrom
isteinbrecher:improve-bts-mortar-checks

Conversation

@isteinbrecher

Copy link
Copy Markdown
Contributor

Description and Context

Improve some checks in beam-to-solid mortar applications.

Related Issues and Pull Requests

#1909

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.

Pull request overview

Improves robustness of beam-to-solid (and related) mortar coupling by adding stronger runtime validation around Lagrange-multiplier (LM) DOF/GID bookkeeping, helping catch inconsistent mortar-manager mappings early (notably relevant after introducing constant LM shape functions in #1909).

Changes:

  • Add FOUR_C_ASSERT_ALWAYS size checks to ensure extracted LM GID vectors match the expected mortar DOF counts before assembling/extracting values.
  • Tighten BeamToSolidMortarManager::location_vector() assumptions for beam elements (boundary node handling + clearer assertions/throws).
  • Add an LM GID size assertion in beam-to-beam point coupling selection logic.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/beaminteraction/src/contact/beam_to_solid/volume/4C_beaminteraction_contact_beam_to_solid_volume_meshtying_pair_mortar.cpp Assert positional LM GID vector size matches Mortar::n_dof_ before extracting values.
src/beaminteraction/src/contact/beam_to_solid/volume/4C_beaminteraction_contact_beam_to_solid_volume_meshtying_pair_mortar_rotation.cpp Assert rotational LM GID vector size matches MortarRot::n_dof_ before assembly/extraction.
src/beaminteraction/src/contact/beam_to_solid/volume/4C_beaminteraction_contact_beam_to_solid_volume_meshtying_pair_2d-3d_mortar.cpp Add LM GID vector size assertions at multiple extraction/assembly sites.
src/beaminteraction/src/contact/beam_to_solid/surface/4C_beaminteraction_contact_beam_to_solid_surface_pair_mortar.cpp Add LM GID vector size assertions for contact mortar assembly and visualization/extraction paths.
src/beaminteraction/src/contact/beam_to_solid/surface/4C_beaminteraction_contact_beam_to_solid_surface_meshtying_pair_mortar_FAD.cpp Add LM GID vector size assertions for (FAD) meshtying positional/rotational paths.
src/beaminteraction/src/contact/beam_to_solid/surface/4C_beaminteraction_contact_beam_to_solid_surface_meshtying_pair_mortar_base.cpp Assert LM GID vector size matches Mortar::n_dof_ before extracting discrete LM values for visualization.
src/beaminteraction/src/contact/beam_to_solid/4C_beaminteraction_contact_beam_to_solid_utils.cpp Add LM GID vector size assertion in shared local mortar assembly helper; include exceptions header.
src/beaminteraction/src/contact/beam_to_solid/4C_beaminteraction_contact_beam_to_solid_mortar_manager.cpp Strengthen location_vector() invariants (beam element check, boundary node assumptions, clearer error paths).
src/beaminteraction/src/contact/beam_to_beam/4C_beaminteraction_contact_beam_to_beam_point_coupling_pair.cpp Add assertion on LM GID list size before selecting an available LM triplet.

@isteinbrecher isteinbrecher force-pushed the improve-bts-mortar-checks branch from 5dc08aa to bb7ac07 Compare March 31, 2026 16:20

@maxfirmbach maxfirmbach 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.

Looks good for me. I just have a remark on two fixed "magic numbers", which we might want to explain.

maxfirmbach
maxfirmbach previously approved these changes Mar 31, 2026
dharinib98
dharinib98 previously approved these changes Apr 1, 2026
maxfirmbach
maxfirmbach previously approved these changes Apr 1, 2026

@maxfirmbach maxfirmbach 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.

LGTM 👍.

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.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

@isteinbrecher

Copy link
Copy Markdown
Contributor Author

@maxfirmbach I fixed one small thing, could you please reapprove?

@isteinbrecher isteinbrecher merged commit 46d1dc2 into 4C-multiphysics:main Apr 1, 2026
29 checks passed
@isteinbrecher isteinbrecher deleted the improve-bts-mortar-checks branch April 1, 2026 11:43
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.

6 participants