Skip to content

Commit 8597a46

Browse files
committed
change size retrieval to component query
Signed-off-by: Nitish Bharambe <[email protected]>
1 parent dd65f3b commit 8597a46

File tree

1 file changed

+5
-5
lines changed
  • power_grid_model_c/power_grid_model/include/power_grid_model/main_core

1 file changed

+5
-5
lines changed

power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topology.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ ComponentTopology construct_topology(main_model_state_c auto const& state) {
202202

203203
ComponentConnections construct_components_connections(main_model_state_c auto const& state) {
204204
ComponentConnections comp_conn;
205-
comp_conn.branch_connected.resize(state.comp_topo->branch_node_idx.size());
206-
comp_conn.branch_phase_shift.resize(state.comp_topo->branch_node_idx.size());
207-
comp_conn.branch3_connected.resize(state.comp_topo->branch3_node_idx.size());
208-
comp_conn.branch3_phase_shift.resize(state.comp_topo->branch3_node_idx.size());
209-
comp_conn.source_connected.resize(state.comp_topo->source_node_idx.size());
205+
comp_conn.branch_connected.resize(get_component_size<Branch>(state.components));
206+
comp_conn.branch_phase_shift.resize(get_component_size<Branch>(state.components));
207+
comp_conn.branch3_connected.resize(get_component_size<Branch3>(state.components));
208+
comp_conn.branch3_phase_shift.resize(get_component_size<Branch3>(state.components));
209+
comp_conn.source_connected.resize(get_component_size<Source>(state.components));
210210
std::ranges::transform(
211211
state.components.template citer<Branch>(), comp_conn.branch_connected.begin(), [](Branch const& branch) {
212212
return BranchConnected{static_cast<IntS>(branch.from_status()), static_cast<IntS>(branch.to_status())};

0 commit comments

Comments
 (0)