Skip to content

Merge links into nodes: hook link algorithm - #1536

Open
figueroa1395 wants to merge 13 commits into
mainfrom
pgm/feature/link-supernode-output
Open

Merge links into nodes: hook link algorithm#1536
figueroa1395 wants to merge 13 commits into
mainfrom
pgm/feature/link-supernode-output

Conversation

@figueroa1395

@figueroa1395 figueroa1395 commented Aug 14, 2026

Copy link
Copy Markdown
Member

Part of #35

Follow up of #1520

This PR activates the link solver but it doesn't hook up the output yet.

Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
@figueroa1395 figueroa1395 self-assigned this Aug 14, 2026
@figueroa1395 figueroa1395 added feature New feature or request do-not-merge This should not be merged labels Aug 14, 2026
figueroa1395 and others added 4 commits August 19, 2026 13:18
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 and others added 7 commits August 20, 2026 09:20
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
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>
Signed-off-by: Santiago Figueroa Manrique <santiago.figueroa.manrique@alliander.com>
@sonarqubecloud

Copy link
Copy Markdown

@figueroa1395 figueroa1395 removed the do-not-merge This should not be merged label Aug 21, 2026
@figueroa1395
figueroa1395 marked this pull request as ready for review August 21, 2026 09:32
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);
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)};

@mgovers mgovers added the do-not-merge This should not be merged label Aug 21, 2026
@mgovers

mgovers commented Aug 21, 2026

Copy link
Copy Markdown
Member

reviewed. after open comments are resolved can be merged on monday.

@figueroa1395 figueroa1395 changed the title Merge links into nodes: Create link output from link solver algorithm Merge links into nodes: hook link algorithm Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge This should not be merged feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants