Skip to content

Add optional callback performed before step to gsDynamicBase.h#28

Merged
mhodzelmans merged 3 commits into
mainfrom
prestep-callback
Jun 23, 2026
Merged

Add optional callback performed before step to gsDynamicBase.h#28
mhodzelmans merged 3 commits into
mainfrom
prestep-callback

Conversation

@mhodzelmans

Copy link
Copy Markdown
Contributor

I have some boundary DOFs with prescribed velocities. Every Newmark timestep, I needed to compute consistens accelerations/positions, and resulting internal forces. This change enables that by making it possible to inject a callback.

Also, a #pragma once was missing.

@mhodzelmans mhodzelmans requested a review from hverhelst June 23, 2026 07:12
@mhodzelmans mhodzelmans self-assigned this Jun 23, 2026

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

Thanks! Small change (did not compile it) for clarity

Comment thread src/gsDynamicSolvers/gsDynamicBase.h Outdated

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

Enables users of gsDynamicBase time integrators (e.g., Newmark) to run custom logic immediately before each non-const timestep, supporting workflows like enforcing prescribed boundary velocities and recomputing consistent states.

Changes:

  • Added a configurable pre-step callback API to gsDynamicBase and invoked it at the start of step(T dt).
  • Ensured m_status is updated with the result of _step(...) in step(T dt).
  • Added missing #pragma once to gsStructuralAnalysisTypes.h.

Reviewed changes

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

File Description
src/gsStructuralAnalysisTools/gsStructuralAnalysisTypes.h Adds #pragma once to avoid multiple-inclusion issues.
src/gsDynamicSolvers/gsDynamicBase.h Adds pre-step callback support and updates step status bookkeeping.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/gsDynamicSolvers/gsDynamicBase.h
Comment thread src/gsDynamicSolvers/gsDynamicBase.h Outdated
@mhodzelmans mhodzelmans merged commit c6d0688 into main Jun 23, 2026
4 of 6 checks passed
@mhodzelmans mhodzelmans deleted the prestep-callback branch June 25, 2026 10:09
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.

3 participants