Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1615 +/- ##
==========================================
- Coverage 97.52% 97.52% -0.01%
==========================================
Files 190 190
Lines 16104 16219 +115
==========================================
+ Hits 15705 15817 +112
- Misses 399 402 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
reneSchm
left a comment
There was a problem hiding this comment.
A nice addition, though I'd like to discuss some changes.
| // compute first column of kt, i.e. kt_0 for each y in yt_eval | ||
| f(m_yt_eval, t, m_kt_values.col(0)); | ||
| if (m_record_stages) { | ||
| m_stage_values.col(0) = m_yt_eval; |
There was a problem hiding this comment.
I wonder if it wouldn't be better to add a step to m_stage_history, and write into its columns directly, similar to how we (sometimes) use TimeSeries.
Should avoid one copy of the matrix, though still allocates the same space, probably.
| m_yt_eval = yt; | ||
|
|
||
| if (!m_tab_final.is_adaptive()) { | ||
| compute_stages(f, t, dt, ytp1); |
There was a problem hiding this comment.
Step calculation should happen after the step size asserts and checks (522-529)
| /// @brief Runge-Kutta matrix a of the method (S x S). | ||
| const Eigen::MatrixX<FP>& get_a() const | ||
| { | ||
| return m_a; | ||
| } | ||
|
|
||
| /// @brief Weights b of the propagated solution. | ||
| const Eigen::VectorX<FP>& get_b() const | ||
| { | ||
| return m_b; | ||
| } | ||
|
|
||
| /// @brief Nodes c of the method. | ||
| const Eigen::VectorX<FP>& get_c() const | ||
| { | ||
| return m_c; | ||
| } |
There was a problem hiding this comment.
a, b, c are awful names, and the documentation gives little information either. Can you either give proper descriptive names to the variables, or give context on each function, i.e., butcher tableau for non-adaptive method with
c A
0 b^T
| void set_tableaus(const Tableau<FP>& tab, const TableauFinal<FP>& final_tab) | ||
| { |
There was a problem hiding this comment.
At this point, maybe refactor Tableau/TableauFinal to a single Tableau class containing entries in this form ([[c A][0 b^T]]) already?
The integration only uses Eigen operations on the high/low entries, the main tableau (A) is used element-wise. So the changes there should be minimal.
This would also make the get_a etc redundant, as the Tableau can provide them. I think you don't need to store the Tableau in this class, anyways.
It also avoids the "use with Tableau::xxx" comments. One possible source of errors less.
|
|
||
| m_yt_eval = yt; | ||
|
|
||
| if (!m_tab_final.is_adaptive()) { |
There was a problem hiding this comment.
| if (!m_tab_final.is_adaptive()) { | |
| // step calculation for direct methods | |
| if (!m_tab_final.is_adaptive()) { |
| /// @brief Remove all steps from the stage history. | ||
| void reset_stage_history() | ||
| { | ||
| m_stage_history.set_tableaus(m_tab, m_tab_final); | ||
| } | ||
|
|
||
| /** | ||
| * @brief Access the stage values of the recorded steps. | ||
| * @{ | ||
| */ | ||
| const RungeKuttaStageHistory<FP>& get_stage_history() const | ||
| { | ||
| return m_stage_history; | ||
| } | ||
| RungeKuttaStageHistory<FP>& get_stage_history() | ||
| { | ||
| return m_stage_history; | ||
| } | ||
| /** @} */ |
There was a problem hiding this comment.
Since we usually pass the IntegratorCore's as unique_ptr, I am not sure that this is interface is usable (without dynamic casting a IntegratorCore*). Maybe ask for an (optional?) shared_ptr<RungeKuttaStageHistory> in the constructor instead?
Changes and Information
Please briefly list the changes (main added features, changed items, or corrected bugs) made:
If need be, add additional information and what the reviewer should look out for in particular:
Merge Request - Guideline Checklist
Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.
Checks by code author
Checks by code reviewer(s)