From 31d513d57c00383bde8b814b5a3ae9ece0eee693 Mon Sep 17 00:00:00 2001 From: Brian Taylor Date: Sat, 26 Oct 2024 19:08:43 -0700 Subject: [PATCH] Fix bug 483 again. Faulty merges of KLU changes for cider were introduced in ngspice 42. These broke the fix. --- src/ciderlib/twod/twocont.c | 126 ++++++++++++++++------------------- src/ciderlib/twod/twoncont.c | 67 ++++++++----------- src/ciderlib/twod/twopcont.c | 67 ++++++++----------- 3 files changed, 114 insertions(+), 146 deletions(-) diff --git a/src/ciderlib/twod/twocont.c b/src/ciderlib/twod/twocont.c index a92955578..40d75add5 100644 --- a/src/ciderlib/twod/twocont.c +++ b/src/ciderlib/twod/twocont.c @@ -758,76 +758,62 @@ void } } else { /* Horizontal Slice */ -// <<<<<<< HEAD -// if ( nIndex == 0 || nIndex == 3 ) { /* Left (Top?) Side : bug 483 */ -// pNode->fNPsiIn = spGetElement( matrix, nEqn, psiEqnInM ); -// pNode->fNPsiInP1 = spGetElement( matrix, nEqn, psiEqnInP ); -// pNode->fNPsiOx = spGetElement( matrix, nEqn, psiEqnOxM ); -// pNode->fNPsiOxP1 = spGetElement( matrix, nEqn, psiEqnOxP ); -// pNode->fPPsiIn = spGetElement( matrix, pEqn, psiEqnInM ); -// pNode->fPPsiInP1 = spGetElement( matrix, pEqn, psiEqnInP ); -// pNode->fPPsiOx = spGetElement( matrix, pEqn, psiEqnOxM ); -// pNode->fPPsiOxP1 = spGetElement( matrix, pEqn, psiEqnOxP ); -// ======= - if ( nIndex <= 1 ) { /* Top Side */ -// -// #ifdef KLU -// pNode->fNPsiIn = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnInM) ; -// pNode->fNPsiInBinding = NULL ; -// #else -// pNode->fNPsiIn = SMPmakeElt(matrix, nEqn, psiEqnInM); -// #endif -// -// #ifdef KLU -// pNode->fNPsiInP1 = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnInP) ; -// pNode->fNPsiInP1Binding = NULL ; -// #else -// pNode->fNPsiInP1 = SMPmakeElt(matrix, nEqn, psiEqnInP); -// #endif -// -// #ifdef KLU -// pNode->fNPsiOx = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnOxM) ; -// pNode->fNPsiOxBinding = NULL ; -// #else -// pNode->fNPsiOx = SMPmakeElt(matrix, nEqn, psiEqnOxM); -// #endif -// -// #ifdef KLU -// pNode->fNPsiOxP1 = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnOxP) ; -// pNode->fNPsiOxP1Binding = NULL ; -// #else -// pNode->fNPsiOxP1 = SMPmakeElt(matrix, nEqn, psiEqnOxP); -// #endif -// -// #ifdef KLU -// pNode->fPPsiIn = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnInM) ; -// pNode->fPPsiInBinding = NULL ; -// #else -// pNode->fPPsiIn = SMPmakeElt(matrix, pEqn, psiEqnInM); -// #endif -// -// #ifdef KLU -// pNode->fPPsiInP1 = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnInP) ; -// pNode->fPPsiInP1Binding = NULL ; -// #else -// pNode->fPPsiInP1 = SMPmakeElt(matrix, pEqn, psiEqnInP); -// #endif -// -// #ifdef KLU -// pNode->fPPsiOx = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnOxM) ; -// pNode->fPPsiOxBinding = NULL ; -// #else -// pNode->fPPsiOx = SMPmakeElt(matrix, pEqn, psiEqnOxM); -// #endif -// -// #ifdef KLU -// pNode->fPPsiOxP1 = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnOxP) ; -// pNode->fPPsiOxP1Binding = NULL ; -// #else -// pNode->fPPsiOxP1 = SMPmakeElt(matrix, pEqn, psiEqnOxP); -// #endif -// -// >>>>>>> First KLU support of CIDER TWOD simulations + if ( nIndex == 0 || nIndex == 3 ) { /* Left (Top?) Side : bug 483 */ +#ifdef KLU + pNode->fNPsiIn = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnInM) ; + pNode->fNPsiInBinding = NULL ; +#else + pNode->fNPsiIn = SMPmakeElt(matrix, nEqn, psiEqnInM); +#endif + +#ifdef KLU + pNode->fNPsiInP1 = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnInP) ; + pNode->fNPsiInP1Binding = NULL ; +#else + pNode->fNPsiInP1 = SMPmakeElt(matrix, nEqn, psiEqnInP); +#endif + +#ifdef KLU + pNode->fNPsiOx = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnOxM) ; + pNode->fNPsiOxBinding = NULL ; +#else + pNode->fNPsiOx = SMPmakeElt(matrix, nEqn, psiEqnOxM); +#endif + +#ifdef KLU + pNode->fNPsiOxP1 = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnOxP) ; + pNode->fNPsiOxP1Binding = NULL ; +#else + pNode->fNPsiOxP1 = SMPmakeElt(matrix, nEqn, psiEqnOxP); +#endif + +#ifdef KLU + pNode->fPPsiIn = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnInM) ; + pNode->fPPsiInBinding = NULL ; +#else + pNode->fPPsiIn = SMPmakeElt(matrix, pEqn, psiEqnInM); +#endif + +#ifdef KLU + pNode->fPPsiInP1 = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnInP) ; + pNode->fPPsiInP1Binding = NULL ; +#else + pNode->fPPsiInP1 = SMPmakeElt(matrix, pEqn, psiEqnInP); +#endif + +#ifdef KLU + pNode->fPPsiOx = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnOxM) ; + pNode->fPPsiOxBinding = NULL ; +#else + pNode->fPPsiOx = SMPmakeElt(matrix, pEqn, psiEqnOxM); +#endif + +#ifdef KLU + pNode->fPPsiOxP1 = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnOxP) ; + pNode->fPPsiOxP1Binding = NULL ; +#else + pNode->fPPsiOxP1 = SMPmakeElt(matrix, pEqn, psiEqnOxP); +#endif } else { /* Bottom Side */ #ifdef KLU diff --git a/src/ciderlib/twod/twoncont.c b/src/ciderlib/twod/twoncont.c index 066a12e71..fe78f17d8 100644 --- a/src/ciderlib/twod/twoncont.c +++ b/src/ciderlib/twod/twoncont.c @@ -493,44 +493,35 @@ void } } else { /* Horizontal Slice */ -// <<<<<<< HEAD -// if ( nIndex == 0 || nIndex == 3 ) { /* Left (Top?) Side : bug 483 */ -// pNode->fNPsiIn = spGetElement( matrix, nEqn, psiEqnInM ); -// pNode->fNPsiInP1 = spGetElement( matrix, nEqn, psiEqnInP ); -// pNode->fNPsiOx = spGetElement( matrix, nEqn, psiEqnOxM ); -// pNode->fNPsiOxP1 = spGetElement( matrix, nEqn, psiEqnOxP ); -// ======= - if ( nIndex <= 1 ) { /* Top Side */ -// -// #ifdef KLU -// pNode->fNPsiIn = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnInM) ; -// pNode->fNPsiInBinding = NULL ; -// #else -// pNode->fNPsiIn = SMPmakeElt(matrix, nEqn, psiEqnInM); -// #endif -// -// #ifdef KLU -// pNode->fNPsiInP1 = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnInP) ; -// pNode->fNPsiInP1Binding = NULL ; -// #else -// pNode->fNPsiInP1 = SMPmakeElt(matrix, nEqn, psiEqnInP); -// #endif -// -// #ifdef KLU -// pNode->fNPsiOx = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnOxM) ; -// pNode->fNPsiOxBinding = NULL ; -// #else -// pNode->fNPsiOx = SMPmakeElt(matrix, nEqn, psiEqnOxM); -// #endif -// -// #ifdef KLU -// pNode->fNPsiOxP1 = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnOxP) ; -// pNode->fNPsiOxP1Binding = NULL ; -// #else -// pNode->fNPsiOxP1 = SMPmakeElt(matrix, nEqn, psiEqnOxP); -// #endif -// -// >>>>>>> First KLU support of CIDER TWOD simulations + if ( nIndex == 0 || nIndex == 3 ) { /* Left (Top?) Side : bug 483 */ +#ifdef KLU + pNode->fNPsiIn = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnInM) ; + pNode->fNPsiInBinding = NULL ; +#else + pNode->fNPsiIn = SMPmakeElt(matrix, nEqn, psiEqnInM); +#endif + +#ifdef KLU + pNode->fNPsiInP1 = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnInP) ; + pNode->fNPsiInP1Binding = NULL ; +#else + pNode->fNPsiInP1 = SMPmakeElt(matrix, nEqn, psiEqnInP); +#endif + +#ifdef KLU + pNode->fNPsiOx = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnOxM) ; + pNode->fNPsiOxBinding = NULL ; +#else + pNode->fNPsiOx = SMPmakeElt(matrix, nEqn, psiEqnOxM); +#endif + +#ifdef KLU + pNode->fNPsiOxP1 = SMPmakeEltKLUforCIDER (matrix, nEqn, psiEqnOxP) ; + pNode->fNPsiOxP1Binding = NULL ; +#else + pNode->fNPsiOxP1 = SMPmakeElt(matrix, nEqn, psiEqnOxP); +#endif + } else { /* Bottom Side */ #ifdef KLU diff --git a/src/ciderlib/twod/twopcont.c b/src/ciderlib/twod/twopcont.c index f64726d44..b8af9a399 100644 --- a/src/ciderlib/twod/twopcont.c +++ b/src/ciderlib/twod/twopcont.c @@ -493,44 +493,35 @@ void } } else { /* Horizontal Slice */ -// <<<<<<< HEAD -// if ( nIndex == 0 || nIndex == 3 ) { /* Left (Top?) Side : bug 483 */ -// pNode->fPPsiIn = spGetElement( matrix, pEqn, psiEqnInM ); -// pNode->fPPsiInP1 = spGetElement( matrix, pEqn, psiEqnInP ); -// pNode->fPPsiOx = spGetElement( matrix, pEqn, psiEqnOxM ); -// pNode->fPPsiOxP1 = spGetElement( matrix, pEqn, psiEqnOxP ); -// ======= - if ( nIndex <= 1 ) { /* Top Side */ -// -// #ifdef KLU -// pNode->fPPsiIn = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnInM) ; -// pNode->fPPsiInBinding = NULL ; -// #else -// pNode->fPPsiIn = SMPmakeElt(matrix, pEqn, psiEqnInM); -// #endif -// -// #ifdef KLU -// pNode->fPPsiInP1 = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnInP) ; -// pNode->fPPsiInP1Binding = NULL ; -// #else -// pNode->fPPsiInP1 = SMPmakeElt(matrix, pEqn, psiEqnInP); -// #endif -// -// #ifdef KLU -// pNode->fPPsiOx = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnOxM) ; -// pNode->fPPsiOxBinding = NULL ; -// #else -// pNode->fPPsiOx = SMPmakeElt(matrix, pEqn, psiEqnOxM); -// #endif -// -// #ifdef KLU -// pNode->fPPsiOxP1 = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnOxP) ; -// pNode->fPPsiOxP1Binding = NULL ; -// #else -// pNode->fPPsiOxP1 = SMPmakeElt(matrix, pEqn, psiEqnOxP); -// #endif -// -// >>>>>>> First KLU support of CIDER TWOD simulations + if ( nIndex == 0 || nIndex == 3 ) { /* Left (Top?) Side : bug 483 */ +#ifdef KLU + pNode->fPPsiIn = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnInM) ; + pNode->fPPsiInBinding = NULL ; +#else + pNode->fPPsiIn = SMPmakeElt(matrix, pEqn, psiEqnInM); +#endif + +#ifdef KLU + pNode->fPPsiInP1 = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnInP) ; + pNode->fPPsiInP1Binding = NULL ; +#else + pNode->fPPsiInP1 = SMPmakeElt(matrix, pEqn, psiEqnInP); +#endif + +#ifdef KLU + pNode->fPPsiOx = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnOxM) ; + pNode->fPPsiOxBinding = NULL ; +#else + pNode->fPPsiOx = SMPmakeElt(matrix, pEqn, psiEqnOxM); +#endif + +#ifdef KLU + pNode->fPPsiOxP1 = SMPmakeEltKLUforCIDER (matrix, pEqn, psiEqnOxP) ; + pNode->fPPsiOxP1Binding = NULL ; +#else + pNode->fPPsiOxP1 = SMPmakeElt(matrix, pEqn, psiEqnOxP); +#endif + } else { /* Bottom Side */ #ifdef KLU