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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2178 +/- ##
=======================================
Coverage 96.36% 96.36%
=======================================
Files 480 480
Lines 38230 38230
=======================================
Hits 36840 36840
Misses 1390 1390
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:
|
|
Thanks for taking care of this! Once you're ready, please mark this PR as ready for review and request one from me. |
ranocha
left a comment
There was a problem hiding this comment.
Thanks for working on this! Please find below some comments.
| @@ -1,5 +1,6 @@ | |||
| using OrdinaryDiffEq | |||
| using Trixi | |||
| import Trixi.Indexing | |||
There was a problem hiding this comment.
If the coupling stuff becomes non-experimental, we should export this from Trixi.jl.
| import Trixi.Indexing | |
| using Trixi: Indexing # coupling is an experimental feature |
There was a problem hiding this comment.
What not
| import Trixi.Indexing | |
| using Trixi: Indexing |
Not a big fan of import and it seems like the Julia community is slowly eschewing import. But it's not a big deal either IMHO, so we can also just leave it as it is.
| @@ -1,5 +1,6 @@ | |||
| using OrdinaryDiffEq | |||
| using Trixi | |||
| import Trixi.Indexing | |||
There was a problem hiding this comment.
| import Trixi.Indexing | |
| using Trixi: Indexing # coupling is an experimental feature |
| @@ -1,5 +1,6 @@ | |||
| using OrdinaryDiffEq | |||
| using Trixi | |||
| import Trixi.Indexing | |||
There was a problem hiding this comment.
| import Trixi.Indexing | |
| using Trixi: Indexing # coupling is an experimental feature |
| end # @muladd; put it up here because module definition below needs to be at top level | ||
|
|
||
| # For some mesh types, elements next to a surface may have local coordinate systems | ||
| # that are not aligned so the nodes may have to be indexed differently. | ||
| # `IndexInfo` is used to describe how the nodes should be indexed. | ||
| # For example, in 2d a `Tuple` with two `IndexInfo` objects, one for each dimension, | ||
| # would be used. | ||
| # `first` or `last` indicates that the corresponding index is constant and is either | ||
| # the first or the last one. This effectively encodes the position of the surface | ||
| # with respect to the local coordinate system. The other `IndexInfo` object(s) | ||
| # encode if the index in the corresponding dimension is running forward or backward. | ||
| # | ||
| # The Enum is wrapped in a module and exported so that the enum values do not pollute | ||
| # the global namespace and can only be accessed via `Indexing.value`. | ||
| module Indexing | ||
| @enum IndexInfo begin | ||
| first | ||
| last | ||
| i_forward | ||
| i_backward | ||
| j_forward | ||
| j_backward | ||
| end | ||
| export IndexInfo | ||
| end | ||
| using .Indexing |
There was a problem hiding this comment.
This is basically https://github.com/fredrikekre/EnumX.jl, so I think we should use that package instead. We should also discuss where to move this definition - https://github.com/trixi-framework/Trixi.jl/blob/main/src/basic_types.jl or auxiliary could also make sense.
There was a problem hiding this comment.
I tend to agree to use specialized packages wherever sensible. However, does it really improve anything except reducing our code by ~10 lines, at the cost of (ideally) having a comment explain what the @enumx does?
But I'm fine either way 🤷♂️
| u::Array{uEltype, NDIMSP2} # [primary/secondary, variable, i, j, interface] | ||
| neighbor_ids::Matrix{Int} # [primary/secondary, interface] | ||
| node_indices::Matrix{NTuple{NDIMS, Symbol}} # [primary/secondary, interface] | ||
| node_indices::Matrix{NTuple{NDIMS, IndexInfo}} # [primary/secondary, interface] |
There was a problem hiding this comment.
@sloede will tell you that you should consider using a consistent alignment of the comments here and in the other files below
|
After speaking with @maleadt in Lausanne and we decided that we might be able to permit Symbols being passed to the GPU JuliaGPU/GPUCompiler.jl#650 |
Some containers in Trixi.jl contain symbols, e.g.
node_indicesinP4estInterfaceContainer. Symbols are not isbits, which could e.g. prevent GPU offloading.