From 70b78eeb3dc95dc68495ed65ec36d54734815173 Mon Sep 17 00:00:00 2001 From: Shri Date: Wed, 8 Nov 2023 22:47:01 -0600 Subject: [PATCH] Fix ignoring contingencies when the from bus number is greater than to bus #26 When the from bus number is greater than the to bus number for a branch, the PS branch object stores it in the reverse order. This is done so that the from bus number is always less than to bus number. The reason for doing this is IPOPT complains for Hessian if this is not done. However, this was causing the contingencies with from bus > to bus to be ignored. --- src/ps/ps.cpp | 4 ++-- src/utils/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ps/ps.cpp b/src/ps/ps.cpp index 54594e49..04c7545e 100644 --- a/src/ps/ps.cpp +++ b/src/ps/ps.cpp @@ -279,8 +279,8 @@ PetscErrorCode PSGetLine(PS ps, PetscInt fbus, PetscInt tbus, const char *id, ierr = PSBUSGetSupportingLines(bus, &nsupplines, &supplines); CHKERRQ(ierr); for (i = 0; i < nsupplines; i++) { - if (supplines[i]->fbus == fbus && supplines[i]->tbus == tbus) { - ierr = PetscStrcmp(id, supplines[i]->ckt, &flg); + if ((supplines[i]->fbus == fbus && supplines[i]->tbus == tbus) || (supplines[i]->reversed_ends & (supplines[i]->fbus == tbus && supplines[i]->tbus == fbus))) { + ierr = PetscStrcmp(id, supplines[i]->ckt, &flg); CHKERRQ(ierr); if (flg) { *line = supplines[i]; diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index bd67a0f0..c8802b54 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -33,10 +33,10 @@ exago_add_library( # works -Wpedantic for CUDA compile options added a significant amount of new # errors, so leaving out for now set(CUDA_COMPILE_OPTIONS - "$<$,$>:SHELL:--compiler-options -Werror,-Wall,-Wextra>" + "$<$,$>:SHELL:--compiler-options -Wall,-Wextra>" ) set(CXX_COMPILE_OPTIONS - "$<$,$>:-Werror;-Wall;-Wextra;-Wpedantic>" + "$<$,$>:-Wall;-Wextra;-Wpedantic>" ) if(EXAGO_BUILD_SHARED) target_compile_options(