Skip to content

Comments

added error warning to KdV#232

Merged
JoshuaLampert merged 7 commits intoNumericalMathematics:mainfrom
cwittens:patch-1
Aug 26, 2025
Merged

added error warning to KdV#232
JoshuaLampert merged 7 commits intoNumericalMathematics:mainfrom
cwittens:patch-1

Conversation

@cwittens
Copy link
Member

not sure if I should also have a test for this third error case but I just realised if D3 == nothing KdV will make strange stuff

@github-actions
Copy link
Contributor

github-actions bot commented Jul 29, 2025

Benchmark Results (Julia v1.10)

Time benchmarks
main 189696e... main / 189696e...
bbm_1d/bbm_1d_basic.jl - rhs!: 13.9 ± 0.29 μs 14.1 ± 0.47 μs 0.987 ± 0.039
bbm_1d/bbm_1d_fourier.jl - rhs!: 0.53 ± 0.0099 ms 0.527 ± 0.31 ms 1 ± 0.59
bbm_bbm_1d/bbm_bbm_1d_basic_reflecting.jl - rhs!: 0.0814 ± 0.0011 ms 0.0809 ± 0.00044 ms 1.01 ± 0.015
bbm_bbm_1d/bbm_bbm_1d_dg.jl - rhs!: 0.0343 ± 0.0005 ms 0.034 ± 0.00044 ms 1.01 ± 0.02
bbm_bbm_1d/bbm_bbm_1d_relaxation.jl - rhs!: 28.4 ± 0.86 μs 27.2 ± 0.39 μs 1.04 ± 0.035
bbm_bbm_1d/bbm_bbm_1d_upwind_relaxation.jl - rhs!: 0.0486 ± 0.00054 ms 0.0484 ± 0.00057 ms 1 ± 0.016
hyperbolic_serre_green_naghdi_1d/hyperbolic_serre_green_naghdi_dingemans.jl - rhs!: 4.29 ± 0.03 μs 4.37 ± 0.049 μs 0.981 ± 0.013
kdv_1d/kdv_1d_basic.jl - rhs!: 1.46 ± 0.02 μs 1.4 ± 0.011 μs 1.04 ± 0.016
kdv_1d/kdv_1d_implicit.jl - rhs!: 1.47 ± 0.02 μs 1.41 ± 0.011 μs 1.04 ± 0.016
serre_green_naghdi_1d/serre_green_naghdi_well_balanced.jl - rhs!: 0.197 ± 0.0084 ms 0.199 ± 0.008 ms 0.991 ± 0.058
svaerd_kalisch_1d/svaerd_kalisch_1d_dingemans_relaxation.jl - rhs!: 0.145 ± 0.0039 ms 0.147 ± 0.0039 ms 0.987 ± 0.037
time_to_load 1.91 ± 0.01 s 1.9 ± 0.0079 s 1 ± 0.0067
Memory benchmarks
main 189696e... main / 189696e...
bbm_1d/bbm_1d_basic.jl - rhs!: 1 allocs: 4.12 kB 1 allocs: 4.12 kB 1
bbm_1d/bbm_1d_fourier.jl - rhs!: 1 allocs: 4.12 kB 1 allocs: 4.12 kB 1
bbm_bbm_1d/bbm_bbm_1d_basic_reflecting.jl - rhs!: 5 allocs: 1.17 kB 5 allocs: 1.17 kB 1
bbm_bbm_1d/bbm_bbm_1d_dg.jl - rhs!: 10 allocs: 8.62 kB 10 allocs: 8.62 kB 1
bbm_bbm_1d/bbm_bbm_1d_relaxation.jl - rhs!: 2 allocs: 8.25 kB 2 allocs: 8.25 kB 1
bbm_bbm_1d/bbm_bbm_1d_upwind_relaxation.jl - rhs!: 2 allocs: 8.25 kB 2 allocs: 8.25 kB 1
hyperbolic_serre_green_naghdi_1d/hyperbolic_serre_green_naghdi_dingemans.jl - rhs!: 0 allocs: 0 B 0 allocs: 0 B
kdv_1d/kdv_1d_basic.jl - rhs!: 0 allocs: 0 B 0 allocs: 0 B
kdv_1d/kdv_1d_implicit.jl - rhs!: 0 allocs: 0 B 0 allocs: 0 B
serre_green_naghdi_1d/serre_green_naghdi_well_balanced.jl - rhs!: 0.075 k allocs: 0.66 MB 0.075 k allocs: 0.66 MB 1
svaerd_kalisch_1d/svaerd_kalisch_1d_dingemans_relaxation.jl - rhs!: 0.042 k allocs: 0.315 MB 0.042 k allocs: 0.315 MB 1
time_to_load 0.153 k allocs: 14.5 kB 0.153 k allocs: 14.5 kB 1

@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coveralls
Copy link
Collaborator

coveralls commented Jul 29, 2025

Pull Request Test Coverage Report for Build 17209599772

Details

  • 14 of 14 (100.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 98.333%

Totals Coverage Status
Change from base Build 17155945350: 0.01%
Covered Lines: 2300
Relevant Lines: 2339

💛 - Coveralls

@JoshuaLampert
Copy link
Member

That's a good idea. What about the other equations? What happens if we do not pass a second-order operator? Maybe it makes sense to check this in general and also already during the creation of the Semidiscretization. We could add a check_solver(equations, solver) (or similar) function called within Semidiscretization that dispatches on equations and throws an error if an operator is not defined, which is needed.

@cwittens
Copy link
Member Author

Yes thats a good idea!

@JoshuaLampert
Copy link
Member

What is the status of this PR?

@cwittens
Copy link
Member Author

I currently dont have the time to do

That's a good idea. What about the other equations? What happens if we do not pass a second-order operator? Maybe it makes sense to check this in general and also already during the creation of the Semidiscretization. We could add a check_solver(equations, solver) (or similar) function called within Semidiscretization that dispatches on equations and throws an error if an operator is not defined, which is needed.

Should I close this PR and open an issue so that it is not forgotten?

@JoshuaLampert
Copy link
Member

Ok, no worries. I would also be fine with keeping this PR open. I think then we also won't forget about it :)

@JoshuaLampert
Copy link
Member

I introduced a new function check_solver defined for each equations, which need D2 or D3. Does this look good to you, @cwittens?

Copy link
Member Author

@cwittens cwittens left a comment

Choose a reason for hiding this comment

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

LGTM.
Does this need a News.md entry or not because it is internal only?

Co-authored-by: Collin Wittenstein <126870995+cwittens@users.noreply.github.com>
@JoshuaLampert
Copy link
Member

Does this need a News.md entry or not because it is internal only?

I would say it's fine without because it's internal.

@JoshuaLampert JoshuaLampert requested a review from ranocha August 25, 2025 13:01
@ranocha
Copy link
Member

ranocha commented Aug 26, 2025

I guess this can be merged, @JoshuaLampert?

@JoshuaLampert JoshuaLampert merged commit 7b422e9 into NumericalMathematics:main Aug 26, 2025
10 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.

5 participants