@@ -284,6 +284,22 @@ constexpr auto output_result(Component const& power_or_current_sensor, MainModel
284
284
return power_or_current_sensor.template get_null_output <sym>();
285
285
}
286
286
287
+ auto const get_current_or_power_branch_f = [&solver_output, &obj_math_id]<power_or_current_sensor_c Sensor>() {
288
+ if constexpr (std::derived_from<Sensor, GenericPowerSensor>) {
289
+ return solver_output[obj_math_id.group ].branch [obj_math_id.pos ].s_f ;
290
+ } else if constexpr (std::derived_from<Sensor, GenericCurrentSensor>) {
291
+ return solver_output[obj_math_id.group ].branch [obj_math_id.pos ].i_f ;
292
+ }
293
+ };
294
+
295
+ auto const get_current_or_power_branch_t = [&solver_output, &obj_math_id]<power_or_current_sensor_c Sensor>() {
296
+ if constexpr (std::derived_from<Sensor, GenericPowerSensor>) {
297
+ return solver_output[obj_math_id.group ].branch [obj_math_id.pos ].s_t ;
298
+ } else if constexpr (std::derived_from<Sensor, GenericCurrentSensor>) {
299
+ return solver_output[obj_math_id.group ].branch [obj_math_id.pos ].i_t ;
300
+ }
301
+ };
302
+
287
303
switch (terminal_type) {
288
304
using enum MeasuredTerminalType;
289
305
@@ -296,10 +312,10 @@ constexpr auto output_result(Component const& power_or_current_sensor, MainModel
296
312
[[fallthrough]];
297
313
case branch3_3:
298
314
return power_or_current_sensor.template get_output <sym>(
299
- solver_output[obj_math_id. group ]. branch [obj_math_id. pos ]. s_f );
315
+ get_current_or_power_branch_f. template operator ()<Component>() );
300
316
case branch_to:
301
317
return power_or_current_sensor.template get_output <sym>(
302
- solver_output[obj_math_id. group ]. branch [obj_math_id. pos ]. s_t );
318
+ get_current_or_power_branch_t . template operator ()<Component>() );
303
319
case source:
304
320
return power_or_current_sensor.template get_output <sym>(
305
321
solver_output[obj_math_id.group ].source [obj_math_id.pos ].s );
@@ -405,7 +421,8 @@ constexpr ResIt output_result(MainModelState<ComponentContainer> const& state,
405
421
MathOutput<std::vector<SolverOutputType>> const & math_output, ResIt res_it) {
406
422
return detail::produce_output<Component, Idx2D>(
407
423
state, res_it, [&state, &math_output](Component const & component, Idx2D const math_id) {
408
- return output_result<Component>(component, state, math_output.solver_output , math_id);
424
+ return output_result<Component>(component, state, math_output.solver_output ,
425
+ math_id); // probably here is where all the math_id things are called
409
426
});
410
427
}
411
428
template <std::derived_from<Base> Component, class ComponentContainer , solver_output_type SolverOutputType,
@@ -414,7 +431,8 @@ template <std::derived_from<Base> Component, class ComponentContainer, solver_ou
414
431
requires (Component const & component, MainModelState<ComponentContainer> const & state,
415
432
std::vector<SolverOutputType> const & solver_output, Idx obj_seq) {
416
433
{
417
- output_result<Component>(component, state, solver_output, obj_seq)
434
+ output_result<Component>(component, state, solver_output,
435
+ obj_seq) // probably here is where the sensors things are called
418
436
} -> detail::assignable_to<std::add_lvalue_reference_t <std::iter_value_t <ResIt>>>;
419
437
}
420
438
constexpr ResIt output_result (MainModelState<ComponentContainer> const & state,
0 commit comments