-
Notifications
You must be signed in to change notification settings - Fork 132
More abstract containers #2632
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
base: main
Are you sure you want to change the base?
More abstract containers #2632
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2632 +/- ##
=======================================
Coverage 96.83% 96.83%
=======================================
Files 540 540
Lines 42885 42889 +4
=======================================
+ Hits 41527 41531 +4
Misses 1358 1358
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ixi.jl into MoreAbstractContainers
|
So this Trixi.jl/test/test_unstructured_2d.jl Line 31 in 82efbc7
now crashes due to the inheritance/derivation of the https://github.com/search?q=repo%3Atrixi-framework%2FTrixi.jl%20adapt_structure&type=code (in contrast to the Trixi.jl/src/solvers/dgsem_p4est/containers.jl Lines 167 to 214 in 82efbc7
|
| semi32 = Trixi.trixi_adapt(Array, Float32, semi) | ||
| @test real(semi32.solver) == Float32 | ||
| @test real(semi32.solver.basis) == Float32 | ||
| @test real(semi32.solver.mortar) == Float32 | ||
| # TODO: remake ignores the mesh as well | ||
| @test real(semi32.mesh) == Float64 |
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.
benegee
left a comment
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.
I think @DanielDoehring's analysis is correct.
This fall-through
Trixi.jl/src/auxiliary/containers.jl
Lines 318 to 325 in e6496e2
| # Trixi storage types must implement these two Adapt.jl methods | |
| function Adapt.adapt_structure(to, c::AbstractContainer) | |
| error("Interface: Must implement Adapt.adapt_structure(to, ::$(typeof(c)))") | |
| end | |
| function Adapt.parent_type(C::Type{<:AbstractContainer}) | |
| error("Interface: Must implement Adapt.parent_type(::Type{$C}") | |
| end |
tells users to implement Adapt methods in case they want to use Adapt for their solver/mesh.
So far, only P4estMesh has Adapt methods, so either this test is supposed to fail or the fall-through is not required because Adapt itself can already figure out what to with the struct.
Closes #2622