Skip to content

Commit

Permalink
Fix ignoring contingencies when the from bus number is greater than t…
Browse files Browse the repository at this point in the history
…o 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.
  • Loading branch information
abhyshr committed Nov 9, 2023
1 parent 1e63e8d commit 70b78ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ps/ps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
"$<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<CONFIG:DEBUG>>:SHELL:--compiler-options -Werror,-Wall,-Wextra>"
"$<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<CONFIG:DEBUG>>:SHELL:--compiler-options -Wall,-Wextra>"
)
set(CXX_COMPILE_OPTIONS
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>:-Werror;-Wall;-Wextra;-Wpedantic>"
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>:-Wall;-Wextra;-Wpedantic>"
)
if(EXAGO_BUILD_SHARED)
target_compile_options(
Expand Down

0 comments on commit 70b78ee

Please sign in to comment.