-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add numerical support of other real types (Float32
)
#1909
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your contribution. Please find below some comments/suggestions.
General question here: Is it better to conduct unit testing while making changes, or to perform the tests after completing all the changes? Are there any good examples of testing from this repository? Thanks! |
When you're working on numerical fluxes, you can add some unit tests, e.g., to parts like Lines 633 to 660 in 1745df4
for the compressible Euler equations. Here, you could add additional tests using inputs with eltype(u) == Float32 .
We should also add some full integration tests once something works completely - maybe by adding one or two new example elixirs showing how to run simulations with |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1909 +/- ##
==========================================
+ Coverage 96.11% 96.12% +0.01%
==========================================
Files 460 460
Lines 36926 36952 +26
==========================================
+ Hits 35490 35520 +30
+ Misses 1436 1432 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hi @ranocha I have revised the code based on our discussion. Please review it once more, and if this version is satisfactory, I will apply similar revisions to the subsequent tasks. For dual numbers, I have no idea whether it will be copied to the GPU and I think CUDA.jl does not directly support this type. If they are to be executed on GPUs, I will explore alternative methods (probably through For documentation, are you referring to a general overview that explains the purpose of using a function like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! I just have some minor suggestions.
For documentation, are you referring to a general overview that explains the purpose of using a function like oftype, or to detailed documentation that points to each specific instance in the code?
I had something in mind like adding a new section to https://trixi-framework.github.io/Trixi.jl/stable/conventions/ where we explain
- why we use
0.5f0 *
instead of0.5 *
- why we use patterns such as
RealT = eltype(x)
andv1_prime = zero(RealT)
orA = convert(RealT, 0.2)
There is no need to point to specific code lines from my point of view.
@sloede Could you please have a look as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Let's please wait for a review by @sloede before you start modifying more files.
Co-authored-by: Hendrik Ranocha <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
I left a message in slack - Please check and collaborate as otherwise there will be more and more bugs in the long run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! The checkbox "unit tests for above" in the first ost is still open. Do you want to add more unit tests to this PR?
If not, I think it would be nice to go ahead and merge this PR soon so that others can use the infrastructure for adding new unit tests (and using the existing tests) in other PRs
Could you please run the formatter, e.g., like this? import Pkg
Pkg.activate(temp = true)
Pkg.add(PackageSpec(name = "JuliaFormatter", version="1.0.45"))
using JuliaFormatter
format(["benchmark", "examples", "ext", "src", "test", "utils"]) (when executed in the main directory of your clone of Trixi.jl) |
Please review again - already formatted and added 3D test Sorry that I am extremely busy until next Wednesday (including the weekends) please wait and take your time :) |
Please help me rerun CI as I have no rights to do so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nearly ready to merge from my side, just a few small questions 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
Address parts of #591 and redo #1604.
Tasks: