Perform topological sort to order components#428
Conversation
|
This is nearly done. Remaining tasks:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #428 +/- ##
==========================================
+ Coverage 49.09% 53.56% +4.46%
==========================================
Files 96 97 +1
Lines 10037 10217 +180
Branches 1452 1485 +33
==========================================
+ Hits 4928 5473 +545
+ Misses 4604 4220 -384
- Partials 505 524 +19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
a75b2ce to
8d049e2
Compare
c31490e to
e650c1c
Compare
e650c1c to
9dbeed5
Compare
9dbeed5 to
04a8977
Compare
04a8977 to
8fc17e0
Compare
|
I missed this in #421, but I see that you added a long-needed feature - a better way to determine species type which is based on the charge: hermes-3/src/component_scheduler.cxx Lines 339 to 352 in 8fc17e0 There is already a function that does the same in hermes-3/include/hermes_utils.hxx Lines 61 to 70 in 053c9bb Ideally there should be only one tool to do this, and your new one seems more robust. Is there any reason not to replace the one in |
Probably not. I just wasn't sure if people would be happy about me changing that bit of code. Note that this will require changing the function signature of |
|
I went through the sorting algorithm and I see that you have left a good amount of comments on the individual bits. However, I found it difficult to get my head around what's going on just because of the amount of steps involved. It would be very useful to have a paragraph describing how the algorithm works step-by-step, either in the docs or in the comments (or both) |
|
There are some places (e.g., when writing tests) where it was convenient to just be able to have a list of species names and use the old heuristics to categorise them. Probably not a good enough reason to keep that though. |
ZedThree
left a comment
There was a problem hiding this comment.
LGTM, thanks @cmacmackin!
There's some trivial bits that I'm happy to fix myself
8fc17e0 to
73593b7
Compare
ae0b58e to
533ec9f
Compare
Explicitly evaluate BinaryExpr expressions into fields when needed.
PetscLib throws if `type` exists in the `petsc` section. This was created by iterating over all sections and checking `options["type"].isValue()`. Instead use `options.isSet()`.
Contains: - Fix for uninitialised dt in SNES - PETSc preconditioner for CVODE - BinaryExpr performance improvements
Note that components still aren't setting up any permissions, so there would be runtime errors when executing the transform methods. Furthermore, there are some missing methods I realise I need for GuardedOptions. The unit tests are also failing to compile, although I don't understand what the problem is for them, yet.
533ec9f to
14d5c62
Compare
Not completed for all components, which have dummy-data in the meantime.
As a nice side-effect, this also adds tests for instantiating all Components.
…cal_sort_components
|
I've merged in the changes from #596 as they are useful to writing error messages during the topological sort process. |
Using the access control information introduced in #421, this PR makes it possible for Hermes-3 to work out the order of components at run-time. This will make things far simpler and more robust for users. It will also fail faster if there is an unsatisfiable or circular dependency.
Closes #384.