JoshuaLampert / DispersiveShallowWater.jl

Structure-preserving numerical methods for dispersive shallow water models
https://joshualampert.github.io/DispersiveShallowWater.jl/
MIT License
15 stars 3 forks source link

Only one BBM-BBM equation struct for flat and variable bathymetry #147

Closed JoshuaLampert closed 2 months ago

JoshuaLampert commented 2 months ago

This PR merges the two equation structs for the BBM-BBM equations into only one that holds a bathymetry_type as we did for the other equations. This also simplifies many things by allowing to define many functions for AbstractShallowWaterEquations instead of for all equations separately. As discussed in https://github.com/JoshuaLampert/DispersiveShallowWater.jl/issues/130#issuecomment-2293818956, I also included a check if the bathymetry is constant for a given bathymetry_flat. In addition, the default bathymetry_type for Serre-Green-Naghdi equations is set to bathymetry_variable (see https://github.com/JoshuaLampert/DispersiveShallowWater.jl/issues/130#issuecomment-2293818956) to be consistent with the other equations. Finally, I made some changes for more consistency with the other equations and I eliminated some allocations in the hyperbolic parts of the BBM-BBM equations.

TODO:

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 98.88889% with 3 lines in your changes missing coverage. Please review.

Project coverage is 97.67%. Comparing base (b66b412) to head (16c7158). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/equations/bbm_bbm_1d.jl 98.95% 2 Missing :warning:
src/equations/equations.jl 98.46% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #147 +/- ## ========================================== - Coverage 97.92% 97.67% -0.26% ========================================== Files 23 18 -5 Lines 1784 1676 -108 ========================================== - Hits 1747 1637 -110 - Misses 37 39 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JoshuaLampert commented 2 months ago

Tests are passing. This is ready for a review @ranocha (sorry for the big PR).

JoshuaLampert commented 2 months ago

Thanks for the review @ranocha! Do you have any other breaking changes in mind? If not, I would merge this and release v0.5.0.

ranocha commented 2 months ago

Releasing the new version is fine with me :+1: