Fixes bug 483

prevent crash when surface mobility (surfmob) has been
selected in 2D simulation.
The patch is provided by Brian Taylor (see
https://sourceforge.net/p/ngspice/mailman/ngspice-devel/thread/e6e921a3-677c-f513-7410-df8568c4bdad%40comcast.net/#msg37318450
)
This commit is contained in:
Holger Vogt 2021-07-16 10:26:11 +02:00
parent 1c5e0d11dd
commit 85b07e35bf
3 changed files with 3 additions and 3 deletions

View File

@ -253,7 +253,7 @@ void
pNode->fPPsiOx = spGetElement( matrix, pEqn, psiEqnOxP ); pNode->fPPsiOx = spGetElement( matrix, pEqn, psiEqnOxP );
} }
} else { /* Horizontal Slice */ } else { /* Horizontal Slice */
if ( nIndex <= 1 ) { /* Top Side */ if ( nIndex == 0 || nIndex == 3 ) { /* Left (Top?) Side : bug 483 */
pNode->fNPsiIn = spGetElement( matrix, nEqn, psiEqnInM ); pNode->fNPsiIn = spGetElement( matrix, nEqn, psiEqnInM );
pNode->fNPsiInP1 = spGetElement( matrix, nEqn, psiEqnInP ); pNode->fNPsiInP1 = spGetElement( matrix, nEqn, psiEqnInP );
pNode->fNPsiOx = spGetElement( matrix, nEqn, psiEqnOxM ); pNode->fNPsiOx = spGetElement( matrix, nEqn, psiEqnOxM );

View File

@ -211,7 +211,7 @@ void
pNode->fNPsiOx = spGetElement( matrix, nEqn, psiEqnOxP ); pNode->fNPsiOx = spGetElement( matrix, nEqn, psiEqnOxP );
} }
} else { /* Horizontal Slice */ } else { /* Horizontal Slice */
if ( nIndex <= 1 ) { /* Top Side */ if ( nIndex == 0 || nIndex == 3 ) { /* Left (Top?) Side : bug 483 */
pNode->fNPsiIn = spGetElement( matrix, nEqn, psiEqnInM ); pNode->fNPsiIn = spGetElement( matrix, nEqn, psiEqnInM );
pNode->fNPsiInP1 = spGetElement( matrix, nEqn, psiEqnInP ); pNode->fNPsiInP1 = spGetElement( matrix, nEqn, psiEqnInP );
pNode->fNPsiOx = spGetElement( matrix, nEqn, psiEqnOxM ); pNode->fNPsiOx = spGetElement( matrix, nEqn, psiEqnOxM );

View File

@ -210,7 +210,7 @@ void
pNode->fPPsiOx = spGetElement( matrix, pEqn, psiEqnOxP ); pNode->fPPsiOx = spGetElement( matrix, pEqn, psiEqnOxP );
} }
} else { /* Horizontal Slice */ } else { /* Horizontal Slice */
if ( nIndex <= 1 ) { /* Top Side */ if ( nIndex == 0 || nIndex == 3 ) { /* Left (Top?) Side : bug 483 */
pNode->fPPsiIn = spGetElement( matrix, pEqn, psiEqnInM ); pNode->fPPsiIn = spGetElement( matrix, pEqn, psiEqnInM );
pNode->fPPsiInP1 = spGetElement( matrix, pEqn, psiEqnInP ); pNode->fPPsiInP1 = spGetElement( matrix, pEqn, psiEqnInP );
pNode->fPPsiOx = spGetElement( matrix, pEqn, psiEqnOxM ); pNode->fPPsiOx = spGetElement( matrix, pEqn, psiEqnOxM );