Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steady state callback #601

Merged
merged 21 commits into from
Nov 19, 2024
Merged

Conversation

LasNikas
Copy link
Collaborator

I tested the callback with the pipe_flow_2d.jl example. It terminates after ~0.8sec.
I consider the change in kinetic energy in a 0.002*10 interval.

pp_callback = PostprocessCallback(; dt=0.02, kinetic_energy)

steady_state = SteadyStateCallback(; dt=0.002, interval_size=10, abstol=1.0e-8, reltol=1.0e-6)

image

Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 52.94118% with 32 lines in your changes missing coverage. Please review.

Project coverage is 68.47%. Comparing base (c744cad) to head (3618976).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/callbacks/steady_state_reached.jl 45.76% 32 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #601      +/-   ##
==========================================
- Coverage   68.71%   68.47%   -0.25%     
==========================================
  Files          86       87       +1     
  Lines        5299     5360      +61     
==========================================
+ Hits         3641     3670      +29     
- Misses       1658     1690      +32     
Flag Coverage Δ
unit 68.47% <52.94%> (-0.25%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Collaborator

@svchb svchb left a comment

Choose a reason for hiding this comment

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

There is one mistake in the condition since you pop/push the current ekin one value is always 0.0 which will effectively reduce the interval size by one.

src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
Copy link
Member

@efaulhaber efaulhaber left a comment

Choose a reason for hiding this comment

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

Please use terminate! and then we wait for the next release of StrideArrays.jl to be able to use the latest version of DiffEqCallbacks.jl, which fixes the error.

Also, this PR is missing a test. I think it should be sufficient to run the hydrostatic water column with the steady state callback, once with interval and once with dt.

src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state.jl Outdated Show resolved Hide resolved
test/callbacks/steady_state_reached.jl Outdated Show resolved Hide resolved
@LasNikas LasNikas requested a review from svchb November 19, 2024 08:37
svchb
svchb previously approved these changes Nov 19, 2024
src/callbacks/steady_state_reached.jl Outdated Show resolved Hide resolved
src/callbacks/steady_state_reached.jl Outdated Show resolved Hide resolved
@LasNikas LasNikas merged commit a56be22 into trixi-framework:main Nov 19, 2024
12 of 14 checks passed
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