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

variable bathymetry Serre-Green-Naghdi equations #135

Merged
merged 36 commits into from
Aug 17, 2024

Conversation

ranocha
Copy link
Collaborator

@ranocha ranocha commented Aug 15, 2024

This is the next step of #129

@ranocha ranocha requested a review from JoshuaLampert August 15, 2024 15:47
@ranocha ranocha mentioned this pull request Aug 15, 2024
6 tasks
Copy link

codecov bot commented Aug 15, 2024

Codecov Report

Attention: Patch coverage is 99.66887% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.57%. Comparing base (8fcba88) to head (d4f9dd6).
Report is 1 commits behind head on main.

Files Patch % Lines
src/equations/serre_green_naghdi_1d.jl 99.64% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #135      +/-   ##
==========================================
+ Coverage   97.00%   97.57%   +0.57%     
==========================================
  Files          18       20       +2     
  Lines        1369     1569     +200     
==========================================
+ Hits         1328     1531     +203     
+ Misses         41       38       -3     

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

Copy link
Owner

@JoshuaLampert JoshuaLampert left a comment

Choose a reason for hiding this comment

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

Only a preliminary review with a question regarding the use of eta and h.

src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
@JoshuaLampert
Copy link
Owner

JoshuaLampert commented Aug 16, 2024

Another question, which just came into my mind: What do we do if you pass bathymetry_flat to the equation, but then set a non-constant bathymetry in the initial condition. I haven't thought about that before. Should this raise a warning or an error or nothing?

Copy link
Owner

@JoshuaLampert JoshuaLampert left a comment

Choose a reason for hiding this comment

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

Can you please also add a well-balancedness test?

test/test_serre_green_naghdi_1d.jl Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
@ranocha
Copy link
Collaborator Author

ranocha commented Aug 16, 2024

Another question, which just came into my mind: What do we do if you pass bathymetry_flat to the equation, but then set a non-constant bathymetry in the initial condition. I haven't thought about that before. Should this raise a warning or an error or nothing?

Where could we add such a check? My first idea was to look at create_cache, but that doesn't have the initial condition

src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
@JoshuaLampert
Copy link
Owner

Another question, which just came into my mind: What do we do if you pass bathymetry_flat to the equation, but then set a non-constant bathymetry in the initial condition. I haven't thought about that before. Should this raise a warning or an error or nothing?

Where could we add such a check? My first idea was to look at create_cache, but that doesn't have the initial condition

It could live in Semidiscretization, but then I would only add such a check when all equations have a field bathymetry (or bathymetry_type), i.e. after finishing #130.

@ranocha ranocha requested a review from JoshuaLampert August 16, 2024 17:07
@JoshuaLampert
Copy link
Owner

Now we have a bunch of conflicts to solve... 🙄

@ranocha
Copy link
Collaborator Author

ranocha commented Aug 16, 2024

Now we have a bunch of conflicts to solve... 🙄

Done

@JoshuaLampert
Copy link
Owner

Thanks!

@ranocha
Copy link
Collaborator Author

ranocha commented Aug 17, 2024

In general we have some code duplication. Would it be possible and wise to put some recurring patterns into functions, e.g., thing like

        if equations.bathymetry_type isa BathymetryMildSlope
            factor = 0.75
        else # equations.bathymetry_type isa BathymetryVariable
            factor = 1.0
        end

Done in c7ff29a and 0062720

@ranocha ranocha requested a review from JoshuaLampert August 17, 2024 09:28
ranocha and others added 2 commits August 17, 2024 11:30
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Owner

@JoshuaLampert JoshuaLampert left a comment

Choose a reason for hiding this comment

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

Final iteration. This looks already very nice!

src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
test/test_serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
Copy link
Owner

@JoshuaLampert JoshuaLampert left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks a lot!

@JoshuaLampert
Copy link
Owner

Now we only have this nasty codecov error on MacOS. But since it seems to fail consistently, I would like to find a fix before merging this PR.

src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
src/equations/serre_green_naghdi_1d.jl Outdated Show resolved Hide resolved
JoshuaLampert
JoshuaLampert previously approved these changes Aug 17, 2024
@ranocha ranocha enabled auto-merge (squash) August 17, 2024 17:36
@ranocha ranocha disabled auto-merge August 17, 2024 17:36
@ranocha ranocha enabled auto-merge (squash) August 17, 2024 17:36
@ranocha ranocha disabled auto-merge August 17, 2024 18:04
@ranocha ranocha requested a review from JoshuaLampert August 17, 2024 18:09
Copy link
Owner

@JoshuaLampert JoshuaLampert left a comment

Choose a reason for hiding this comment

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

Thanks!

@JoshuaLampert JoshuaLampert enabled auto-merge (squash) August 17, 2024 18:14
@JoshuaLampert JoshuaLampert merged commit 935081c into main Aug 17, 2024
14 checks passed
@JoshuaLampert JoshuaLampert deleted the hr/serre_green_naghdi branch August 17, 2024 18:26
@ranocha ranocha mentioned this pull request Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants