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

Pressure solvers for everything! #589

Merged
merged 44 commits into from
Jan 14, 2020
Merged

Conversation

ali-ramadhan
Copy link
Member

This PR is a stab at implementing the pressure solvers plan/overhaul outlined in #586. So far it implements pressure solvers for all types of domains (triply/doubly periodic, channels, and boxes) on regular grids (except boxes on GPUs for now).

Equally important, it refactors and cleans up the pressure solvers so that we can now easily add in pressure solvers for vertically stretched grids and distributed models.

A lot of cleanup was done in the process as well. Pressure solver code and kernels have been fully moved from the TimeSteppers submodule to the Solvers submodule. Different parts have been reorganized into multiple files and the index permutation business has been abstracted away a bit so we have fewer ugly kernels (and fewer kernels!).

I could have gone much further in condensing the code base and number of pressure solvers. You'll notice quite a bit of code repetition, but I think for now and the forseeable future this is actually a good thing. The pressure solver code is nontrivial and keeping it as simple as possible will improve the readability and longevity of the code base.

It's also easier to add and modify pressure solvers now. For example, if @sandreza wants to implement a fast pressure solve that only works for horizontally periodic domains (Kleiser-Schumann?), it's now much easier to do that.

I should probably add some benchmarks.

@ali-ramadhan ali-ramadhan added feature 🌟 Something new and shiny cleanup 🧹 Paying off technical debt abstractions 🎨 Whatever that means labels Jan 6, 2020
@ali-ramadhan ali-ramadhan added the numerics 🧮 So things don't blow up and boil the lobsters alive label Jan 6, 2020
@ali-ramadhan ali-ramadhan changed the title [WIP] Pressure solvers for everything! Pressure solvers for everything! Jan 10, 2020
@codecov
Copy link

codecov bot commented Jan 13, 2020

Codecov Report

Merging #589 into master will increase coverage by 4.78%.
The diff coverage is 68.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #589      +/-   ##
==========================================
+ Coverage   71.64%   76.42%   +4.78%     
==========================================
  Files          77      124      +47     
  Lines        2095     2117      +22     
==========================================
+ Hits         1501     1618     +117     
+ Misses        594      499      -95
Impacted Files Coverage Δ
src/Forcing/simple_forcing.jl 50% <ø> (ø)
src/Solvers/Solvers.jl 100% <ø> (ø) ⬆️
src/OutputWriters/netcdf_output_writer.jl 86.53% <ø> (ø) ⬆️
src/Models/clock.jl 50% <ø> (ø)
src/Models/model.jl 91.66% <ø> (ø)
...c/Solvers/horizontally_periodic_pressure_solver.jl 98.11% <ø> (+56.6%) ⬆️
src/TimeSteppers/TimeSteppers.jl 73.68% <ø> (ø) ⬆️
src/Solvers/channel_pressure_solver.jl 98.63% <ø> (+68.49%) ⬆️
src/OutputWriters/jld2_output_writer.jl 84.61% <ø> (ø) ⬆️
src/AbstractOperations/AbstractOperations.jl 33.33% <ø> (ø) ⬆️
... and 137 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77a22ef...4b78751. Read the comment docs.

@ali-ramadhan ali-ramadhan merged commit 2ed4024 into master Jan 14, 2020
@ali-ramadhan ali-ramadhan deleted the ar/refactor-poisson-solvers branch January 14, 2020 13:21
@ali-ramadhan ali-ramadhan restored the ar/refactor-poisson-solvers branch January 14, 2020 13:21
@ali-ramadhan ali-ramadhan deleted the ar/refactor-poisson-solvers branch January 14, 2020 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abstractions 🎨 Whatever that means cleanup 🧹 Paying off technical debt feature 🌟 Something new and shiny numerics 🧮 So things don't blow up and boil the lobsters alive
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant