Merge links into nodes: hook link algorithm - #1536
Open
figueroa1395 wants to merge 13 commits into
Open
Conversation
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
mgovers
reviewed
Aug 20, 2026
mgovers
reviewed
Aug 20, 2026
mgovers
reviewed
Aug 20, 2026
mgovers
reviewed
Aug 20, 2026
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
|
figueroa1395
marked this pull request as ready for review
August 21, 2026 09:32
mgovers
reviewed
Aug 21, 2026
Comment on lines
+38
to
+48
| template <typename Callable> Callable unwrap_callable(Callable callable) { return callable; } | ||
|
|
||
| template <typename Callable> Callable& unwrap_callable(std::reference_wrapper<Callable> callable_ref) { | ||
| return callable_ref.get(); | ||
| } | ||
|
|
||
| template <typename AddToTarget, typename ComponentType, typename SolverOutputType> | ||
| concept flow_accumulator_c = requires(AddToTarget accumulator, Idx2D const& user_topo_id, | ||
| ComplexValue<decode_symmetry_v<SolverOutputType>> const& injection) { | ||
| unwrap_callable(accumulator).template operator()<ComponentType>(user_topo_id, injection); | ||
| }; |
Member
There was a problem hiding this comment.
unwrap_callable probably can be removed
Comment on lines
+181
to
+188
| for (Idx phase = 0; phase < phase_number; ++phase) { | ||
| injection_per_phase[phase].emplace_back(node_injection(phase)); | ||
| } | ||
| } | ||
|
|
||
| auto const links = super_node_solver_input.links | std::ranges::to<std::vector>(); | ||
| auto result = ComplexValueVector<asymmetric_t>(links.size()); | ||
| for (Idx phase = 0; phase < phase_number; ++phase) { |
Member
There was a problem hiding this comment.
nitpick
Suggested change
| for (Idx phase = 0; phase < phase_number; ++phase) { | |
| injection_per_phase[phase].emplace_back(node_injection(phase)); | |
| } | |
| } | |
| auto const links = super_node_solver_input.links | std::ranges::to<std::vector>(); | |
| auto result = ComplexValueVector<asymmetric_t>(links.size()); | |
| for (Idx phase = 0; phase < phase_number; ++phase) { | |
| for (Idx phase : IdxRange{phase_number}) { | |
| injection_per_phase[phase].emplace_back(node_injection(phase)); | |
| } | |
| } | |
| auto const links = super_node_solver_input.links | std::ranges::to<std::vector>(); | |
| auto result = ComplexValueVector<asymmetric_t>(links.size()); | |
| for (Idx phase : IdxRange{phase_number}) { |
| for (auto const& result : link_solver_result) { | ||
| if constexpr (std::same_as<BranchSolverOutputType, | ||
| BranchSolverOutput<decode_symmetry_v<BranchSolverOutputType>>>) { | ||
| link_output.emplace_back(BranchSolverOutputType{.s_f = result, .s_t = -result}); // i conversion missing |
Member
There was a problem hiding this comment.
TODO (for reference, so that we don't accidentally merge this without this being present)
Comment on lines
+231
to
+233
| return {.links = std::span(topo_node.user_links), | ||
| .node_injection = ComplexValueVector<sym>(node_number), | ||
| .node_flow_from_branch = std::vector<ComplexValue<sym>>(node_number)}; |
Member
There was a problem hiding this comment.
nitpick
Suggested change
| return {.links = std::span(topo_node.user_links), | |
| .node_injection = ComplexValueVector<sym>(node_number), | |
| .node_flow_from_branch = std::vector<ComplexValue<sym>>(node_number)}; | |
| return {.links = std::span{topo_node.user_links}, | |
| .node_injection = ComplexValueVector<sym>(node_number), | |
| .node_flow_from_branch = ComplexValueVector<sym>(node_number)}; |
Member
|
reviewed. after open comments are resolved can be merged on monday. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Part of #35
Follow up of #1520
This PR activates the link solver but it doesn't hook up the output yet.