drop `NIL' macro
This commit is contained in:
parent
f973e7107f
commit
ccb600f3c1
|
|
@ -32,54 +32,54 @@ BDRYcheck(BDRYcard *cardList, DOMNdomain *domnList)
|
||||||
int error = OK;
|
int error = OK;
|
||||||
char ebuf[512]; /* error message buffer */
|
char ebuf[512]; /* error message buffer */
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(BDRYcard); card = card->BDRYnextCard ) {
|
for ( card = cardList; card != NULL; card = card->BDRYnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
if (card->BDRYxLowGiven && card->BDRYixLowGiven) {
|
if (card->BDRYxLowGiven && card->BDRYixLowGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"boundary card %d uses both location and index - location ignored",
|
"boundary card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->BDRYxLowGiven = FALSE;
|
card->BDRYxLowGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (card->BDRYxHighGiven && card->BDRYixHighGiven) {
|
if (card->BDRYxHighGiven && card->BDRYixHighGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"boundary card %d uses both location and index - location ignored",
|
"boundary card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->BDRYxHighGiven = FALSE;
|
card->BDRYxHighGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (card->BDRYyLowGiven && card->BDRYiyLowGiven) {
|
if (card->BDRYyLowGiven && card->BDRYiyLowGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"boundary card %d uses both location and index - location ignored",
|
"boundary card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->BDRYyLowGiven = FALSE;
|
card->BDRYyLowGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (card->BDRYyHighGiven && card->BDRYiyHighGiven) {
|
if (card->BDRYyHighGiven && card->BDRYiyHighGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"boundary card %d uses both location and index - location ignored",
|
"boundary card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->BDRYyHighGiven = FALSE;
|
card->BDRYyHighGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (!card->BDRYdomainGiven) {
|
if (!card->BDRYdomainGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"boundary card %d is missing a domain index",
|
"boundary card %d is missing a domain index",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
} else {
|
} else {
|
||||||
/* Make sure the domain exists */
|
/* Make sure the domain exists */
|
||||||
for ( domn = domnList; domn != NIL(DOMNdomain); domn = domn->next ) {
|
for ( domn = domnList; domn != NULL; domn = domn->next ) {
|
||||||
if ( card->BDRYdomain == domn->id ) {
|
if ( card->BDRYdomain == domn->id ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (domn == NIL(DOMNdomain)) {
|
if (domn == NULL) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"boundary card %d specifies a non-existent domain",
|
"boundary card %d specifies a non-existent domain",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -88,16 +88,16 @@ BDRYcheck(BDRYcard *cardList, DOMNdomain *domnList)
|
||||||
card->BDRYneighbor = card->BDRYdomain;
|
card->BDRYneighbor = card->BDRYdomain;
|
||||||
} else {
|
} else {
|
||||||
/* Make sure the neighbor exists */
|
/* Make sure the neighbor exists */
|
||||||
for ( domn = domnList; domn != NIL(DOMNdomain); domn = domn->next ) {
|
for ( domn = domnList; domn != NULL; domn = domn->next ) {
|
||||||
if ( card->BDRYneighbor == domn->id ) {
|
if ( card->BDRYneighbor == domn->id ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (domn == NIL(DOMNdomain)) {
|
if (domn == NULL) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"interface card %d specifies a non-existent domain",
|
"interface card %d specifies a non-existent domain",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -150,7 +150,7 @@ BDRYsetup(BDRYcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList,DOMNdom
|
||||||
MESHiBounds( yMeshList, &iyMin, &iyMax );
|
MESHiBounds( yMeshList, &iyMin, &iyMax );
|
||||||
|
|
||||||
error = OK;
|
error = OK;
|
||||||
for ( card = cardList; card != NIL(BDRYcard); card = card->BDRYnextCard ) {
|
for ( card = cardList; card != NULL; card = card->BDRYnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
|
|
||||||
if (card->BDRYixLowGiven) {
|
if (card->BDRYixLowGiven) {
|
||||||
|
|
@ -175,7 +175,7 @@ BDRYsetup(BDRYcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList,DOMNdom
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"boundary card %d has low x index (%d) > high x index (%d)",
|
"boundary card %d has low x index (%d) > high x index (%d)",
|
||||||
cardNum, card->BDRYixHigh, card->BDRYixLow );
|
cardNum, card->BDRYixHigh, card->BDRYixLow );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
if (card->BDRYiyLowGiven) {
|
if (card->BDRYiyLowGiven) {
|
||||||
|
|
@ -200,7 +200,7 @@ BDRYsetup(BDRYcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList,DOMNdom
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"boundary card %d has low y index (%d) > high y index (%d)",
|
"boundary card %d has low y index (%d) > high y index (%d)",
|
||||||
cardNum, card->BDRYiyHigh, card->BDRYiyLow );
|
cardNum, card->BDRYiyHigh, card->BDRYiyLow );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,13 +32,13 @@ CONTcheck(CONTcard *cardList)
|
||||||
int error = OK;
|
int error = OK;
|
||||||
char ebuf[512]; /* error message buffer */
|
char ebuf[512]; /* error message buffer */
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(CONTcard); card = card->CONTnextCard ) {
|
for ( card = cardList; card != NULL; card = card->CONTnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
if (!card->CONTnumberGiven) {
|
if (!card->CONTnumberGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"contact card %d is missing an electrode index",
|
"contact card %d is missing an electrode index",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,10 +69,10 @@ CONTsetup(CONTcard *cardList, ELCTelectrode *electrodeList)
|
||||||
/* Check the card list */
|
/* Check the card list */
|
||||||
if ((error = CONTcheck( cardList )) != 0) return( error );
|
if ((error = CONTcheck( cardList )) != 0) return( error );
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(CONTcard); card = card->CONTnextCard ) {
|
for ( card = cardList; card != NULL; card = card->CONTnextCard ) {
|
||||||
|
|
||||||
/* Copy workfunction to all matching electrodes */
|
/* Copy workfunction to all matching electrodes */
|
||||||
for ( electrode = electrodeList; electrode != NIL(ELCTelectrode);
|
for ( electrode = electrodeList; electrode != NULL;
|
||||||
electrode = electrode->next ) {
|
electrode = electrode->next ) {
|
||||||
if ( card->CONTnumber == electrode->id ) {
|
if ( card->CONTnumber == electrode->id ) {
|
||||||
if ( card->CONTworkfunGiven ) {
|
if ( card->CONTworkfunGiven ) {
|
||||||
|
|
|
||||||
|
|
@ -37,54 +37,54 @@ DOMNcheck(DOMNcard *cardList, MaterialInfo *matlList)
|
||||||
int error = OK;
|
int error = OK;
|
||||||
char ebuf[512]; /* error message buffer */
|
char ebuf[512]; /* error message buffer */
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(DOMNcard); card = card->DOMNnextCard ) {
|
for ( card = cardList; card != NULL; card = card->DOMNnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
if (card->DOMNxLowGiven && card->DOMNixLowGiven) {
|
if (card->DOMNxLowGiven && card->DOMNixLowGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"domain card %d uses both location and index - location ignored",
|
"domain card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->DOMNxLowGiven = FALSE;
|
card->DOMNxLowGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (card->DOMNxHighGiven && card->DOMNixHighGiven) {
|
if (card->DOMNxHighGiven && card->DOMNixHighGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"domain card %d uses both location and index - location ignored",
|
"domain card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->DOMNxHighGiven = FALSE;
|
card->DOMNxHighGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (card->DOMNyLowGiven && card->DOMNiyLowGiven) {
|
if (card->DOMNyLowGiven && card->DOMNiyLowGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"domain card %d uses both location and index - location ignored",
|
"domain card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->DOMNyLowGiven = FALSE;
|
card->DOMNyLowGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (card->DOMNyHighGiven && card->DOMNiyHighGiven) {
|
if (card->DOMNyHighGiven && card->DOMNiyHighGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"domain card %d uses both location and index - location ignored",
|
"domain card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->DOMNyHighGiven = FALSE;
|
card->DOMNyHighGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (!card->DOMNmaterialGiven) {
|
if (!card->DOMNmaterialGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"domain card %d is missing a material index",
|
"domain card %d is missing a material index",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
} else {
|
} else {
|
||||||
/* Make sure the material exists */
|
/* Make sure the material exists */
|
||||||
for ( matl = matlList; matl != NIL(MATLmaterial); matl = matl->next ) {
|
for ( matl = matlList; matl != NULL; matl = matl->next ) {
|
||||||
if ( card->DOMNmaterial == matl->id ) {
|
if ( card->DOMNmaterial == matl->id ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (matl == NIL(MATLmaterial)) {
|
if (matl == NULL) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"domain card %d specifies a non-existent material",
|
"domain card %d specifies a non-existent material",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -92,7 +92,7 @@ DOMNcheck(DOMNcard *cardList, MaterialInfo *matlList)
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"domain card %d is missing an ID number",
|
"domain card %d is missing an ID number",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,7 +127,7 @@ DOMNsetup(DOMNcard *cardList, DOMNdomain **domainList, MESHcoord *xMeshList,
|
||||||
char ebuf[512]; /* error message buffer */
|
char ebuf[512]; /* error message buffer */
|
||||||
|
|
||||||
/* Initialize list of domains */
|
/* Initialize list of domains */
|
||||||
*domainList = NIL(DOMNdomain);
|
*domainList = NULL;
|
||||||
|
|
||||||
/* Check the card list */
|
/* Check the card list */
|
||||||
if ((error = DOMNcheck( cardList, materialList )) != 0) return( error );
|
if ((error = DOMNcheck( cardList, materialList )) != 0) return( error );
|
||||||
|
|
@ -137,10 +137,10 @@ DOMNsetup(DOMNcard *cardList, DOMNdomain **domainList, MESHcoord *xMeshList,
|
||||||
MESHiBounds( yMeshList, &iyMin, &iyMax );
|
MESHiBounds( yMeshList, &iyMin, &iyMax );
|
||||||
|
|
||||||
error = OK;
|
error = OK;
|
||||||
for ( card = cardList; card != NIL(DOMNcard); card = card->DOMNnextCard ) {
|
for ( card = cardList; card != NULL; card = card->DOMNnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
|
|
||||||
if (*domainList == NIL(DOMNdomain)) {
|
if (*domainList == NULL) {
|
||||||
RALLOC( newDomain, DOMNdomain, 1 );
|
RALLOC( newDomain, DOMNdomain, 1 );
|
||||||
*domainList = newDomain;
|
*domainList = newDomain;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -150,7 +150,7 @@ DOMNsetup(DOMNcard *cardList, DOMNdomain **domainList, MESHcoord *xMeshList,
|
||||||
|
|
||||||
newDomain->id = card->DOMNnumber;
|
newDomain->id = card->DOMNnumber;
|
||||||
newDomain->material = card->DOMNmaterial;
|
newDomain->material = card->DOMNmaterial;
|
||||||
newDomain->next = NIL(DOMNdomain);
|
newDomain->next = NULL;
|
||||||
|
|
||||||
if (card->DOMNixLowGiven) {
|
if (card->DOMNixLowGiven) {
|
||||||
newDomain->ixLo = MAX(card->DOMNixLow, ixMin);
|
newDomain->ixLo = MAX(card->DOMNixLow, ixMin);
|
||||||
|
|
@ -174,7 +174,7 @@ DOMNsetup(DOMNcard *cardList, DOMNdomain **domainList, MESHcoord *xMeshList,
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"domain card %d has low x index (%d) > high x index (%d)",
|
"domain card %d has low x index (%d) > high x index (%d)",
|
||||||
cardNum, newDomain->ixLo, newDomain->ixHi );
|
cardNum, newDomain->ixLo, newDomain->ixHi );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
if (card->DOMNiyLowGiven) {
|
if (card->DOMNiyLowGiven) {
|
||||||
|
|
@ -199,7 +199,7 @@ DOMNsetup(DOMNcard *cardList, DOMNdomain **domainList, MESHcoord *xMeshList,
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"domain card %d has low y index (%d) > high y index (%d)",
|
"domain card %d has low y index (%d) > high y index (%d)",
|
||||||
cardNum, newDomain->iyLo, newDomain->iyHi );
|
cardNum, newDomain->iyLo, newDomain->iyHi );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,17 +37,17 @@ DOPcheck(DOPcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList)
|
||||||
int error = OK;
|
int error = OK;
|
||||||
char ebuf[512]; /* error message buffer */
|
char ebuf[512]; /* error message buffer */
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(DOPcard); card = card->DOPnextCard ) {
|
for ( card = cardList; card != NULL; card = card->DOPnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
if (!card->DOPdomainsGiven) {
|
if (!card->DOPdomainsGiven) {
|
||||||
card->DOPnumDomains = 0;
|
card->DOPnumDomains = 0;
|
||||||
card->DOPdomains = NIL(int);
|
card->DOPdomains = NULL;
|
||||||
}
|
}
|
||||||
if (!card->DOPprofileTypeGiven) {
|
if (!card->DOPprofileTypeGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"doping card %d does not specify profile type",
|
"doping card %d does not specify profile type",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
} else switch (card->DOPprofileType) {
|
} else switch (card->DOPprofileType) {
|
||||||
case DOP_UNIF:
|
case DOP_UNIF:
|
||||||
|
|
@ -55,7 +55,7 @@ DOPcheck(DOPcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList)
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"doping card %d needs conc of uniform distribution",
|
"doping card %d needs conc of uniform distribution",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -64,7 +64,7 @@ DOPcheck(DOPcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList)
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"doping card %d needs peak conc of linear distribution",
|
"doping card %d needs peak conc of linear distribution",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -73,7 +73,7 @@ DOPcheck(DOPcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList)
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"doping card %d needs peak conc of gaussian distribution",
|
"doping card %d needs peak conc of gaussian distribution",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -82,7 +82,7 @@ DOPcheck(DOPcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList)
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"doping card %d needs peak conc of error-function distribution",
|
"doping card %d needs peak conc of error-function distribution",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -91,7 +91,7 @@ DOPcheck(DOPcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList)
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"doping card %d needs peak conc of exponential distribution",
|
"doping card %d needs peak conc of exponential distribution",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -101,7 +101,7 @@ DOPcheck(DOPcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList)
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"doping card %d needs input-file name of suprem3 data",
|
"doping card %d needs input-file name of suprem3 data",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -110,7 +110,7 @@ DOPcheck(DOPcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList)
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"doping card %d needs input-file name of ascii data",
|
"doping card %d needs input-file name of ascii data",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -118,7 +118,7 @@ DOPcheck(DOPcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList)
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"doping card %d has unrecognized profile type",
|
"doping card %d has unrecognized profile type",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_FATAL, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_FATAL, ebuf, NULL );
|
||||||
error = E_NOTFOUND;
|
error = E_NOTFOUND;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -203,7 +203,7 @@ DOPsetup(DOPcard *cardList, DOPprofile **profileList, DOPtable **tableList,
|
||||||
int error, xProfUnif, yProfUnif;
|
int error, xProfUnif, yProfUnif;
|
||||||
|
|
||||||
/* Initialize list of profiles */
|
/* Initialize list of profiles */
|
||||||
*profileList = endProfile = NIL(DOPprofile);
|
*profileList = endProfile = NULL;
|
||||||
|
|
||||||
/* Check the card list */
|
/* Check the card list */
|
||||||
if ((error = DOPcheck( cardList, xMeshList, yMeshList )) != 0) return( error );
|
if ((error = DOPcheck( cardList, xMeshList, yMeshList )) != 0) return( error );
|
||||||
|
|
@ -212,9 +212,9 @@ DOPsetup(DOPcard *cardList, DOPprofile **profileList, DOPtable **tableList,
|
||||||
MESHlBounds( xMeshList, &xMin, &xMax );
|
MESHlBounds( xMeshList, &xMin, &xMax );
|
||||||
MESHlBounds( yMeshList, &yMin, &yMax );
|
MESHlBounds( yMeshList, &yMin, &yMax );
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(DOPcard); card = card->DOPnextCard ) {
|
for ( card = cardList; card != NULL; card = card->DOPnextCard ) {
|
||||||
|
|
||||||
if (*profileList == NIL(DOPprofile)) {
|
if (*profileList == NULL) {
|
||||||
RALLOC( newProfile, DOPprofile, 1 );
|
RALLOC( newProfile, DOPprofile, 1 );
|
||||||
*profileList = newProfile;
|
*profileList = newProfile;
|
||||||
}
|
}
|
||||||
|
|
@ -222,7 +222,7 @@ DOPsetup(DOPcard *cardList, DOPprofile **profileList, DOPtable **tableList,
|
||||||
RALLOC( newProfile->next, DOPprofile, 1 );
|
RALLOC( newProfile->next, DOPprofile, 1 );
|
||||||
newProfile = newProfile->next;
|
newProfile = newProfile->next;
|
||||||
}
|
}
|
||||||
newProfile->next = NIL(DOPprofile);
|
newProfile->next = NULL;
|
||||||
|
|
||||||
newProfile->numDomains = card->DOPnumDomains;
|
newProfile->numDomains = card->DOPnumDomains;
|
||||||
if ( newProfile->numDomains > 0 ) {
|
if ( newProfile->numDomains > 0 ) {
|
||||||
|
|
@ -233,7 +233,7 @@ DOPsetup(DOPcard *cardList, DOPprofile **profileList, DOPtable **tableList,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
newProfile->domains = NIL(int);
|
newProfile->domains = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( card->DOPimpurityType == IMP_P_TYPE ) {
|
if ( card->DOPimpurityType == IMP_P_TYPE ) {
|
||||||
|
|
|
||||||
|
|
@ -34,34 +34,34 @@ ELCTcheck(ELCTcard *cardList)
|
||||||
int error = OK;
|
int error = OK;
|
||||||
char ebuf[512]; /* error message buffer */
|
char ebuf[512]; /* error message buffer */
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(ELCTcard); card = card->ELCTnextCard ) {
|
for ( card = cardList; card != NULL; card = card->ELCTnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
if (card->ELCTxLowGiven && card->ELCTixLowGiven) {
|
if (card->ELCTxLowGiven && card->ELCTixLowGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"electrode card %d uses both location and index - location ignored",
|
"electrode card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->ELCTxLowGiven = FALSE;
|
card->ELCTxLowGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (card->ELCTxHighGiven && card->ELCTixHighGiven) {
|
if (card->ELCTxHighGiven && card->ELCTixHighGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"electrode card %d uses both location and index - location ignored",
|
"electrode card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->ELCTxHighGiven = FALSE;
|
card->ELCTxHighGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (card->ELCTyLowGiven && card->ELCTiyLowGiven) {
|
if (card->ELCTyLowGiven && card->ELCTiyLowGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"electrode card %d uses both location and index - location ignored",
|
"electrode card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->ELCTyLowGiven = FALSE;
|
card->ELCTyLowGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (card->ELCTyHighGiven && card->ELCTiyHighGiven) {
|
if (card->ELCTyHighGiven && card->ELCTiyHighGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"electrode card %d uses both location and index - location ignored",
|
"electrode card %d uses both location and index - location ignored",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, ebuf, NULL );
|
||||||
card->ELCTyHighGiven = FALSE;
|
card->ELCTyHighGiven = FALSE;
|
||||||
}
|
}
|
||||||
if (!card->ELCTnumberGiven) {
|
if (!card->ELCTnumberGiven) {
|
||||||
|
|
@ -98,7 +98,7 @@ ELCTsetup(ELCTcard *cardList, ELCTelectrode **electrodeList,
|
||||||
char ebuf[512]; /* error message buffer */
|
char ebuf[512]; /* error message buffer */
|
||||||
|
|
||||||
/* Initialize list of electrodes */
|
/* Initialize list of electrodes */
|
||||||
*electrodeList = NIL(ELCTelectrode);
|
*electrodeList = NULL;
|
||||||
|
|
||||||
/* Check the card list */
|
/* Check the card list */
|
||||||
if ((error = ELCTcheck( cardList )) != 0) return( error );
|
if ((error = ELCTcheck( cardList )) != 0) return( error );
|
||||||
|
|
@ -108,17 +108,17 @@ ELCTsetup(ELCTcard *cardList, ELCTelectrode **electrodeList,
|
||||||
MESHiBounds( yMeshList, &iyMin, &iyMax );
|
MESHiBounds( yMeshList, &iyMin, &iyMax );
|
||||||
|
|
||||||
error = OK;
|
error = OK;
|
||||||
for ( card = cardList; card != NIL(ELCTcard); card = card->ELCTnextCard ) {
|
for ( card = cardList; card != NULL; card = card->ELCTnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
|
|
||||||
if (*electrodeList == NIL(ELCTelectrode)) {
|
if (*electrodeList == NULL) {
|
||||||
RALLOC( newElectrode, ELCTelectrode, 1 );
|
RALLOC( newElectrode, ELCTelectrode, 1 );
|
||||||
*electrodeList = newElectrode;
|
*electrodeList = newElectrode;
|
||||||
} else {
|
} else {
|
||||||
RALLOC( newElectrode->next, ELCTelectrode, 1 );
|
RALLOC( newElectrode->next, ELCTelectrode, 1 );
|
||||||
newElectrode = newElectrode->next;
|
newElectrode = newElectrode->next;
|
||||||
}
|
}
|
||||||
newElectrode->next = NIL(ELCTelectrode);
|
newElectrode->next = NULL;
|
||||||
newElectrode->id = card->ELCTnumber;
|
newElectrode->id = card->ELCTnumber;
|
||||||
newElectrode->workf = 4.10 /* electron volts */;
|
newElectrode->workf = 4.10 /* electron volts */;
|
||||||
|
|
||||||
|
|
@ -144,7 +144,7 @@ ELCTsetup(ELCTcard *cardList, ELCTelectrode **electrodeList,
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"electrode card %d has low x index (%d) > high x index (%d)",
|
"electrode card %d has low x index (%d) > high x index (%d)",
|
||||||
cardNum, newElectrode->ixLo, newElectrode->ixHi );
|
cardNum, newElectrode->ixLo, newElectrode->ixHi );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
if (card->ELCTiyLowGiven) {
|
if (card->ELCTiyLowGiven) {
|
||||||
|
|
@ -169,7 +169,7 @@ ELCTsetup(ELCTcard *cardList, ELCTelectrode **electrodeList,
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"electrode card %d has low y index (%d) > high y index (%d)",
|
"electrode card %d has low y index (%d) > high y index (%d)",
|
||||||
cardNum, newElectrode->iyLo, newElectrode->iyHi );
|
cardNum, newElectrode->iyLo, newElectrode->iyHi );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ int
|
||||||
int error = OK;
|
int error = OK;
|
||||||
char ebuf[512]; /* error message buffer */
|
char ebuf[512]; /* error message buffer */
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(MATLcard); card = card->MATLnextCard ) {
|
for ( card = cardList; card != NULL; card = card->MATLnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
|
|
||||||
if( !card->MATLmaterialGiven ) {
|
if( !card->MATLmaterialGiven ) {
|
||||||
|
|
@ -43,7 +43,7 @@ int
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"material card %d is missing an id number",
|
"material card %d is missing an id number",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ int
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"material cards %d and %d use same id %d",
|
"material cards %d and %d use same id %d",
|
||||||
cardNum2, cardNum, card->MATLnumber );
|
cardNum2, cardNum, card->MATLnumber );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -87,14 +87,14 @@ int
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
/* Initialize list of electrodes */
|
/* Initialize list of electrodes */
|
||||||
*materialList = NIL(MATLmaterial);
|
*materialList = NULL;
|
||||||
|
|
||||||
/* Check the card list */
|
/* Check the card list */
|
||||||
if ((error = MATLcheck( cardList )) != 0) return( error );
|
if ((error = MATLcheck( cardList )) != 0) return( error );
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(MATLcard); card = card->MATLnextCard ) {
|
for ( card = cardList; card != NULL; card = card->MATLnextCard ) {
|
||||||
|
|
||||||
if (*materialList == NIL(MATLmaterial)) {
|
if (*materialList == NULL) {
|
||||||
RALLOC( newMaterial, MATLmaterial, 1 );
|
RALLOC( newMaterial, MATLmaterial, 1 );
|
||||||
*materialList = newMaterial;
|
*materialList = newMaterial;
|
||||||
}
|
}
|
||||||
|
|
@ -102,7 +102,7 @@ int
|
||||||
RALLOC( newMaterial->next, MATLmaterial, 1 );
|
RALLOC( newMaterial->next, MATLmaterial, 1 );
|
||||||
newMaterial = newMaterial->next;
|
newMaterial = newMaterial->next;
|
||||||
}
|
}
|
||||||
newMaterial->next = NIL(MATLmaterial);
|
newMaterial->next = NULL;
|
||||||
newMaterial->id = card->MATLnumber;
|
newMaterial->id = card->MATLnumber;
|
||||||
newMaterial->material = card->MATLmaterial;
|
newMaterial->material = card->MATLmaterial;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ MESHmkArray(MESHcoord *coordList, int numCoords)
|
||||||
|
|
||||||
if ( numCoords <= 0 ) {
|
if ( numCoords <= 0 ) {
|
||||||
numCoords = 0;
|
numCoords = 0;
|
||||||
for ( coord = coordList; coord != NIL(MESHcoord); coord = coord->next ) {
|
for ( coord = coordList; coord != NULL; coord = coord->next ) {
|
||||||
numCoords++;
|
numCoords++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -62,13 +62,13 @@ MESHmkArray(MESHcoord *coordList, int numCoords)
|
||||||
numCoords = 0;
|
numCoords = 0;
|
||||||
array[ 0 ] = (double) numCoords;
|
array[ 0 ] = (double) numCoords;
|
||||||
numCoords = 1;
|
numCoords = 1;
|
||||||
for ( coord = coordList; coord != NIL(MESHcoord); coord = coord->next ) {
|
for ( coord = coordList; coord != NULL; coord = coord->next ) {
|
||||||
array[ numCoords++ ] = coord->location;
|
array[ numCoords++ ] = coord->location;
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return NIL(double);
|
return NULL;
|
||||||
}
|
}
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
@ -91,7 +91,7 @@ MESHiBounds(MESHcoord *coordList, int *ixMin, int *ixMax)
|
||||||
|
|
||||||
if (coordList) {
|
if (coordList) {
|
||||||
*ixMin = coordList->number;
|
*ixMin = coordList->number;
|
||||||
for ( last = coordList; last->next != NIL(MESHcoord); last = last->next )
|
for ( last = coordList; last->next != NULL; last = last->next )
|
||||||
;
|
;
|
||||||
*ixMax = last->number;
|
*ixMax = last->number;
|
||||||
}
|
}
|
||||||
|
|
@ -118,7 +118,7 @@ MESHlBounds(MESHcoord *coordList, double *lcMin, double *lcMax)
|
||||||
|
|
||||||
if (coordList) {
|
if (coordList) {
|
||||||
*lcMin = coordList->location;
|
*lcMin = coordList->location;
|
||||||
for ( last = coordList; last->next != NIL(MESHcoord); last = last->next )
|
for ( last = coordList; last->next != NULL; last = last->next )
|
||||||
;
|
;
|
||||||
*lcMax = last->location;
|
*lcMax = last->location;
|
||||||
}
|
}
|
||||||
|
|
@ -140,11 +140,11 @@ MESHlBounds(MESHcoord *coordList, double *lcMin, double *lcMax)
|
||||||
int
|
int
|
||||||
MESHlocate(MESHcoord *coordList, double location)
|
MESHlocate(MESHcoord *coordList, double location)
|
||||||
{
|
{
|
||||||
MESHcoord *coord, *prevCoord = NIL(MESHcoord);
|
MESHcoord *coord, *prevCoord = NULL;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
/* Find the coordinates which flank the location. */
|
/* Find the coordinates which flank the location. */
|
||||||
for ( coord = coordList; coord != NIL(MESHcoord); coord = coord->next ) {
|
for ( coord = coordList; coord != NULL; coord = coord->next ) {
|
||||||
if ( coord->location > location ) break;
|
if ( coord->location > location ) break;
|
||||||
prevCoord = coord;
|
prevCoord = coord;
|
||||||
}
|
}
|
||||||
|
|
@ -191,16 +191,16 @@ MESHcheck(char dim, MESHcard *cardList)
|
||||||
int error = OK;
|
int error = OK;
|
||||||
char errBuf[512];
|
char errBuf[512];
|
||||||
|
|
||||||
if ( cardList == NIL(MESHcard) ) {
|
if ( cardList == NULL ) {
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card list is empty",
|
"%c.mesh card list is empty",
|
||||||
dim );
|
dim );
|
||||||
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NULL );
|
||||||
locEnd = locStart;
|
locEnd = locStart;
|
||||||
return( E_PRIVATE );
|
return( E_PRIVATE );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(MESHcard); card = card->MESHnextCard ) {
|
for ( card = cardList; card != NULL; card = card->MESHnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
|
|
||||||
/* Am I trying to find number of nodes directly & indirectly? */
|
/* Am I trying to find number of nodes directly & indirectly? */
|
||||||
|
|
@ -208,7 +208,7 @@ MESHcheck(char dim, MESHcard *cardList)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d uses both number and ratio - number ignored",
|
"%c.mesh card %d uses both number and ratio - number ignored",
|
||||||
dim, cardNum );
|
dim, cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, errBuf, NULL );
|
||||||
|
|
||||||
card->MESHnumberGiven = FALSE;
|
card->MESHnumberGiven = FALSE;
|
||||||
}
|
}
|
||||||
|
|
@ -218,7 +218,7 @@ MESHcheck(char dim, MESHcard *cardList)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d has no distances",
|
"%c.mesh card %d has no distances",
|
||||||
dim, cardNum );
|
dim, cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NULL );
|
||||||
locEnd = locStart;
|
locEnd = locStart;
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
|
|
@ -226,7 +226,7 @@ MESHcheck(char dim, MESHcard *cardList)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d uses both location and width - location ignored",
|
"%c.mesh card %d uses both location and width - location ignored",
|
||||||
dim, cardNum );
|
dim, cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, errBuf, NULL );
|
||||||
|
|
||||||
card->MESHlocationGiven = FALSE;
|
card->MESHlocationGiven = FALSE;
|
||||||
locEnd = locStart + card->MESHwidth;
|
locEnd = locStart + card->MESHwidth;
|
||||||
|
|
@ -244,7 +244,7 @@ MESHcheck(char dim, MESHcard *cardList)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d uses negative width",
|
"%c.mesh card %d uses negative width",
|
||||||
dim, cardNum );
|
dim, cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -254,7 +254,7 @@ MESHcheck(char dim, MESHcard *cardList)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d has negligible width - ignored",
|
"%c.mesh card %d has negligible width - ignored",
|
||||||
dim, cardNum );
|
dim, cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, errBuf, NULL );
|
||||||
locStart = locEnd;
|
locStart = locEnd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -270,7 +270,7 @@ MESHcheck(char dim, MESHcard *cardList)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d has ratio out of range - reset to 1.0",
|
"%c.mesh card %d has ratio out of range - reset to 1.0",
|
||||||
dim, cardNum );
|
dim, cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_INFO, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_INFO, errBuf, NULL );
|
||||||
ratio = 1.0;
|
ratio = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -281,7 +281,7 @@ MESHcheck(char dim, MESHcard *cardList)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d wants to use a non-positive spacing",
|
"%c.mesh card %d wants to use a non-positive spacing",
|
||||||
dim, cardNum );
|
dim, cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -292,7 +292,7 @@ MESHcheck(char dim, MESHcard *cardList)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d needs to use one of h.start or h.end with h.max",
|
"%c.mesh card %d needs to use one of h.start or h.end with h.max",
|
||||||
dim, cardNum );
|
dim, cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
else if (card->MESHhMaxGiven && card->MESHhStartGiven) {
|
else if (card->MESHhMaxGiven && card->MESHhStartGiven) {
|
||||||
|
|
@ -300,7 +300,7 @@ MESHcheck(char dim, MESHcard *cardList)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d wants h.start > h.max",
|
"%c.mesh card %d wants h.start > h.max",
|
||||||
dim, cardNum );
|
dim, cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -312,7 +312,7 @@ MESHcheck(char dim, MESHcard *cardList)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d wants h.end > h.max",
|
"%c.mesh card %d wants h.end > h.max",
|
||||||
dim, cardNum );
|
dim, cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -385,7 +385,7 @@ addCoord(MESHcoord **head, MESHcoord **tail, int number, double location)
|
||||||
{
|
{
|
||||||
MESHcoord *newCoord;
|
MESHcoord *newCoord;
|
||||||
|
|
||||||
if (*head == NIL(MESHcoord)) {
|
if (*head == NULL) {
|
||||||
RALLOC( *tail, MESHcoord, 1 );
|
RALLOC( *tail, MESHcoord, 1 );
|
||||||
newCoord = *head = *tail;
|
newCoord = *head = *tail;
|
||||||
}
|
}
|
||||||
|
|
@ -393,7 +393,7 @@ addCoord(MESHcoord **head, MESHcoord **tail, int number, double location)
|
||||||
RALLOC( (*tail)->next, MESHcoord, 1 );
|
RALLOC( (*tail)->next, MESHcoord, 1 );
|
||||||
newCoord = *tail = (*tail)->next;
|
newCoord = *tail = (*tail)->next;
|
||||||
}
|
}
|
||||||
newCoord->next = NIL(MESHcoord);
|
newCoord->next = NULL;
|
||||||
newCoord->number = number;
|
newCoord->number = number;
|
||||||
newCoord->location = location * UM_TO_CM;
|
newCoord->location = location * UM_TO_CM;
|
||||||
return(OK);
|
return(OK);
|
||||||
|
|
@ -428,7 +428,7 @@ MESHsetup(char dim, MESHcard *cardList, MESHcoord **coordList, int *numCoords)
|
||||||
char errBuf[512];
|
char errBuf[512];
|
||||||
|
|
||||||
/* Initialize list of coordinates. */
|
/* Initialize list of coordinates. */
|
||||||
*coordList = endCoord = NIL(MESHcoord);
|
*coordList = endCoord = NULL;
|
||||||
*numCoords = totCoords = 0;
|
*numCoords = totCoords = 0;
|
||||||
|
|
||||||
/* Check the card list. */
|
/* Check the card list. */
|
||||||
|
|
@ -442,7 +442,7 @@ MESHsetup(char dim, MESHcard *cardList, MESHcoord **coordList, int *numCoords)
|
||||||
"n.s", "n.m", "n.e", "l.e", "h.s", "h.e", "h.m", "r.s", "r.e" );
|
"n.s", "n.m", "n.e", "l.e", "h.s", "h.e", "h.m", "r.s", "r.e" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(MESHcard); card = card->MESHnextCard ) {
|
for ( card = cardList; card != NULL; card = card->MESHnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
locStart = card->MESHlocStart;
|
locStart = card->MESHlocStart;
|
||||||
locEnd = card->MESHlocEnd;
|
locEnd = card->MESHlocEnd;
|
||||||
|
|
@ -463,7 +463,7 @@ MESHsetup(char dim, MESHcard *cardList, MESHcoord **coordList, int *numCoords)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d has out-of-order node numbers ( %d > %d )",
|
"%c.mesh card %d has out-of-order node numbers ( %d > %d )",
|
||||||
dim, cardNum, numStart, numEnd );
|
dim, cardNum, numStart, numEnd );
|
||||||
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -495,7 +495,7 @@ MESHsetup(char dim, MESHcard *cardList, MESHcoord **coordList, int *numCoords)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d can't be spaced automatically",
|
"%c.mesh card %d can't be spaced automatically",
|
||||||
dim, cardNum );
|
dim, cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NULL );
|
||||||
return( error );
|
return( error );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -507,7 +507,7 @@ MESHsetup(char dim, MESHcard *cardList, MESHcoord **coordList, int *numCoords)
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"%c.mesh card %d results in out-of-order node numbers ( %d > %d )",
|
"%c.mesh card %d results in out-of-order node numbers ( %d > %d )",
|
||||||
dim, cardNum, numStart, numEnd );
|
dim, cardNum, numStart, numEnd );
|
||||||
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_FATAL, errBuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -578,7 +578,7 @@ MESHsetup(char dim, MESHcard *cardList, MESHcoord **coordList, int *numCoords)
|
||||||
* If the mesh is not empty, then the loop above has exited before
|
* If the mesh is not empty, then the loop above has exited before
|
||||||
* adding the final coord to the list. So we need to do that now.
|
* adding the final coord to the list. So we need to do that now.
|
||||||
*/
|
*/
|
||||||
if (*coordList != NIL(MESHcoord)) {
|
if (*coordList != NULL) {
|
||||||
error = addCoord( coordList, &endCoord, ++totCoords, locEnd );
|
error = addCoord( coordList, &endCoord, ++totCoords, locEnd );
|
||||||
if (error) return(error);
|
if (error) return(error);
|
||||||
#ifdef NOTDEF
|
#ifdef NOTDEF
|
||||||
|
|
@ -722,7 +722,7 @@ oneSideSpacing(double width, double spacing, double rWanted, double *rFound,
|
||||||
if ( width < spacing ) {
|
if ( width < spacing ) {
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"one-sided spacing can't find an acceptable solution\n");
|
"one-sided spacing can't find an acceptable solution\n");
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, errBuf, NULL );
|
||||||
*rFound = 0.0;
|
*rFound = 0.0;
|
||||||
*nFound = 0;
|
*nFound = 0;
|
||||||
return(E_PRIVATE);
|
return(E_PRIVATE);
|
||||||
|
|
@ -749,7 +749,7 @@ oneSideSpacing(double width, double spacing, double rWanted, double *rFound,
|
||||||
if ( (rTemp1 == 0.0) && (rTemp2 == 0.0) ) {
|
if ( (rTemp1 == 0.0) && (rTemp2 == 0.0) ) {
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"one-sided spacing can't find an acceptable solution\n");
|
"one-sided spacing can't find an acceptable solution\n");
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, errBuf, NULL );
|
||||||
*rFound = 0.0;
|
*rFound = 0.0;
|
||||||
*nFound = 0;
|
*nFound = 0;
|
||||||
return(E_PRIVATE);
|
return(E_PRIVATE);
|
||||||
|
|
@ -927,7 +927,7 @@ twoSideSpacing(double width, double hStart, double hEnd, double rWanted,
|
||||||
if (remaining < 0.0) {
|
if (remaining < 0.0) {
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"two-sided spacing can't find an acceptable solution\n");
|
"two-sided spacing can't find an acceptable solution\n");
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, errBuf, NULL );
|
||||||
*rSfound = *rEfound = 0.0;
|
*rSfound = *rEfound = 0.0;
|
||||||
*nSfound = *nEfound = 0;
|
*nSfound = *nEfound = 0;
|
||||||
return(E_PRIVATE);
|
return(E_PRIVATE);
|
||||||
|
|
@ -1067,7 +1067,7 @@ twoSideSpacing(double width, double hStart, double hEnd, double rWanted,
|
||||||
if (rSaveS == 0.0) {
|
if (rSaveS == 0.0) {
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"two-sided spacing can't find an acceptable solution\n");
|
"two-sided spacing can't find an acceptable solution\n");
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, errBuf, NULL );
|
||||||
*rSfound = *rEfound = 0.0;
|
*rSfound = *rEfound = 0.0;
|
||||||
*nSfound = *nEfound = 0;
|
*nSfound = *nEfound = 0;
|
||||||
return(E_PRIVATE);
|
return(E_PRIVATE);
|
||||||
|
|
@ -1290,7 +1290,7 @@ maxLimSpacing(double width, double hStart, double hMax, double rWanted,
|
||||||
if (rSaveS == 0.0) {
|
if (rSaveS == 0.0) {
|
||||||
sprintf( errBuf,
|
sprintf( errBuf,
|
||||||
"max-limited spacing can't find an acceptable solution\n");
|
"max-limited spacing can't find an acceptable solution\n");
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, errBuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, errBuf, NULL );
|
||||||
*rFound = 0.0;
|
*rFound = 0.0;
|
||||||
*nSfound = *nMfound = 0;
|
*nSfound = *nMfound = 0;
|
||||||
return(E_PRIVATE);
|
return(E_PRIVATE);
|
||||||
|
|
|
||||||
|
|
@ -34,26 +34,26 @@ MOBcheck(MOBcard *cardList, MaterialInfo *matlList)
|
||||||
int error = OK;
|
int error = OK;
|
||||||
char ebuf[512]; /* error message buffer */
|
char ebuf[512]; /* error message buffer */
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(MOBcard); card = card->MOBnextCard ) {
|
for ( card = cardList; card != NULL; card = card->MOBnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
if (!card->MOBmaterialGiven) {
|
if (!card->MOBmaterialGiven) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"mobility card %d is missing a material index",
|
"mobility card %d is missing a material index",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
} else {
|
} else {
|
||||||
/* Make sure the material exists */
|
/* Make sure the material exists */
|
||||||
for ( matl = matlList; matl != NIL(MATLmaterial); matl = matl->next ) {
|
for ( matl = matlList; matl != NULL; matl = matl->next ) {
|
||||||
if ( card->MOBmaterial == matl->id ) {
|
if ( card->MOBmaterial == matl->id ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (matl == NIL(MATLmaterial)) {
|
if (matl == NULL) {
|
||||||
sprintf( ebuf,
|
sprintf( ebuf,
|
||||||
"mobility card %d specifies a non-existent material",
|
"mobility card %d specifies a non-existent material",
|
||||||
cardNum );
|
cardNum );
|
||||||
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NIL(IFuid) );
|
SPfrontEnd->IFerror( ERR_WARNING, ebuf, NULL );
|
||||||
error = E_PRIVATE;
|
error = E_PRIVATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -94,10 +94,10 @@ MOBsetup(MOBcard *cardList, MaterialInfo *materialList)
|
||||||
/* Check the card list */
|
/* Check the card list */
|
||||||
if ((error = MOBcheck( cardList, materialList )) != 0) return( error );
|
if ((error = MOBcheck( cardList, materialList )) != 0) return( error );
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(MOBcard); card = card->MOBnextCard ) {
|
for ( card = cardList; card != NULL; card = card->MOBnextCard ) {
|
||||||
|
|
||||||
/* Find the right material */
|
/* Find the right material */
|
||||||
for ( matl = materialList; matl != NIL(MATLmaterial); matl = matl->next ) {
|
for ( matl = materialList; matl != NULL; matl = matl->next ) {
|
||||||
if ( card->MOBmaterial == matl->id ) {
|
if ( card->MOBmaterial == matl->id ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ int
|
||||||
MODLcard *card;
|
MODLcard *card;
|
||||||
int cardNum = 0;
|
int cardNum = 0;
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(MODLcard); card = card->MODLnextCard ) {
|
for ( card = cardList; card != NULL; card = card->MODLnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
|
|
||||||
if ( !card->MODLbandGapNarrowingGiven ) {
|
if ( !card->MODLbandGapNarrowingGiven ) {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ int
|
||||||
OUTPcard *card;
|
OUTPcard *card;
|
||||||
int cardNum = 0;
|
int cardNum = 0;
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(OUTPcard); card = card->OUTPnextCard ) {
|
for ( card = cardList; card != NULL; card = card->OUTPnextCard ) {
|
||||||
cardNum++;
|
cardNum++;
|
||||||
|
|
||||||
card->OUTPnumVars = -1;
|
card->OUTPnumVars = -1;
|
||||||
|
|
|
||||||
|
|
@ -418,7 +418,7 @@ ONEsorSolve(ONEdevice *pDevice, double *xReal, double *xImag, double omega)
|
||||||
rhsSOR[index] += pDevice->rhs[index];
|
rhsSOR[index] += pDevice->rhs[index];
|
||||||
}
|
}
|
||||||
/* compute xReal(k+1). solution stored in rhsSOR */
|
/* compute xReal(k+1). solution stored in rhsSOR */
|
||||||
spSolve(pDevice->matrix, rhsSOR, rhsSOR, NIL(spREAL), NIL(spREAL));
|
spSolve(pDevice->matrix, rhsSOR, rhsSOR, NULL, NULL);
|
||||||
|
|
||||||
/* modify solution when wRelax is not 1 */
|
/* modify solution when wRelax is not 1 */
|
||||||
if (wRelax != 1) {
|
if (wRelax != 1) {
|
||||||
|
|
@ -455,7 +455,7 @@ ONEsorSolve(ONEdevice *pDevice, double *xReal, double *xImag, double omega)
|
||||||
}
|
}
|
||||||
/* compute xImag(k+1) */
|
/* compute xImag(k+1) */
|
||||||
spSolve(pDevice->matrix, rhsSOR, rhsSOR,
|
spSolve(pDevice->matrix, rhsSOR, rhsSOR,
|
||||||
NIL(spREAL), NIL(spREAL));
|
NULL, NULL);
|
||||||
/* modify solution when wRelax is not 1 */
|
/* modify solution when wRelax is not 1 */
|
||||||
if (wRelax != 1) {
|
if (wRelax != 1) {
|
||||||
for (index = 1; index <= numEqns; index++) {
|
for (index = 1; index <= numEqns; index++) {
|
||||||
|
|
@ -665,7 +665,7 @@ computeAdmittance(ONEnode *pNode, BOOLEAN delVContact, double *xReal,
|
||||||
|
|
||||||
for (i = 0; i <= 1; i++) {
|
for (i = 0; i <= 1; i++) {
|
||||||
pElem = pNode->pElems[i];
|
pElem = pNode->pElems[i];
|
||||||
if (pElem != NIL(ONEelem)) {
|
if (pElem != NULL) {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0:
|
case 0:
|
||||||
/* the right node of the element */
|
/* the right node of the element */
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ NUMDconductance(ONEdevice *pDevice, BOOLEAN tranAnalysis,
|
||||||
pDevice->rhs[pNode->pEqn] = -pEdge->dJpDpsiP1;
|
pDevice->rhs[pNode->pEqn] = -pEdge->dJpDpsiP1;
|
||||||
}
|
}
|
||||||
incVpn = pDevice->dcDeltaSolution;
|
incVpn = pDevice->dcDeltaSolution;
|
||||||
spSolve(pDevice->matrix, pDevice->rhs, incVpn, NIL(spREAL), NIL(spREAL));
|
spSolve(pDevice->matrix, pDevice->rhs, incVpn, NULL, NULL);
|
||||||
|
|
||||||
pElem = pDevice->elemArray[1];
|
pElem = pDevice->elemArray[1];
|
||||||
pNode = pElem->pRightNode;
|
pNode = pElem->pRightNode;
|
||||||
|
|
@ -95,7 +95,7 @@ NBJTconductance(ONEdevice *pDevice, BOOLEAN tranAnalysis, double *intCoeff,
|
||||||
pDevice->rhs[pNode->pEqn] = -pEdge->dJpDpsiP1;
|
pDevice->rhs[pNode->pEqn] = -pEdge->dJpDpsiP1;
|
||||||
}
|
}
|
||||||
incVce = pDevice->dcDeltaSolution;
|
incVce = pDevice->dcDeltaSolution;
|
||||||
spSolve(pDevice->matrix, pDevice->rhs, incVce, NIL(spREAL), NIL(spREAL));
|
spSolve(pDevice->matrix, pDevice->rhs, incVce, NULL, NULL);
|
||||||
|
|
||||||
/* zero the rhs before loading in the new rhs base contribution */
|
/* zero the rhs before loading in the new rhs base contribution */
|
||||||
for (index = 1; index <= pDevice->numEqns; index++) {
|
for (index = 1; index <= pDevice->numEqns; index++) {
|
||||||
|
|
@ -114,7 +114,7 @@ NBJTconductance(ONEdevice *pDevice, BOOLEAN tranAnalysis, double *intCoeff,
|
||||||
}
|
}
|
||||||
|
|
||||||
incVbe = pDevice->copiedSolution;
|
incVbe = pDevice->copiedSolution;
|
||||||
spSolve(pDevice->matrix, pDevice->rhs, incVbe, NIL(spREAL), NIL(spREAL));
|
spSolve(pDevice->matrix, pDevice->rhs, incVbe, NULL, NULL);
|
||||||
|
|
||||||
pElem = pDevice->elemArray[1];/* first element */
|
pElem = pDevice->elemArray[1];/* first element */
|
||||||
pEdge = pElem->pEdge;
|
pEdge = pElem->pEdge;
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ ONE_jacLoad(ONEdevice *pDevice)
|
||||||
|
|
||||||
|
|
||||||
/* first compute the currents and their derivatives */
|
/* first compute the currents and their derivatives */
|
||||||
ONE_commonTerms(pDevice, FALSE, FALSE, NIL(ONEtranInfo));
|
ONE_commonTerms(pDevice, FALSE, FALSE, NULL);
|
||||||
|
|
||||||
/* zero the matrix */
|
/* zero the matrix */
|
||||||
spClear(pDevice->matrix);
|
spClear(pDevice->matrix);
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ ONEdopingValue(DOPprofile *pProfile, DOPtable *pTable, double x)
|
||||||
|
|
||||||
/* Find the appropriate lookup table if necessary */
|
/* Find the appropriate lookup table if necessary */
|
||||||
if (pProfile->type == LOOKUP) {
|
if (pProfile->type == LOOKUP) {
|
||||||
while (pTable != NIL(DOPtable)) {
|
while (pTable != NULL) {
|
||||||
if (pTable->impId == pProfile->IMPID) {
|
if (pTable->impId == pProfile->IMPID) {
|
||||||
/* Found it */
|
/* Found it */
|
||||||
break;
|
break;
|
||||||
|
|
@ -33,7 +33,7 @@ ONEdopingValue(DOPprofile *pProfile, DOPtable *pTable, double x)
|
||||||
pTable = pTable->next;
|
pTable = pTable->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pTable == NIL(DOPtable)) {
|
if (pTable == NULL) {
|
||||||
fprintf(stderr, "Error: unknown impurity profile %d\n",
|
fprintf(stderr, "Error: unknown impurity profile %d\n",
|
||||||
((int)pProfile->IMPID));
|
((int)pProfile->IMPID));
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
@ -129,7 +129,7 @@ ONEsetDoping(ONEdevice *pDevice, DOPprofile *pProfile, DOPtable *pTable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Now compute the contribution to the total doping from each profile. */
|
/* Now compute the contribution to the total doping from each profile. */
|
||||||
for (pP = pProfile; pP != NIL(DOPprofile); pP = pP->next) {
|
for (pP = pProfile; pP != NULL; pP = pP->next) {
|
||||||
for (eIndex = 1; eIndex < pDevice->numNodes; eIndex++) {
|
for (eIndex = 1; eIndex < pDevice->numNodes; eIndex++) {
|
||||||
pElem = pDevice->elemArray[eIndex];
|
pElem = pDevice->elemArray[eIndex];
|
||||||
if (pElem->elemType == SEMICON) {
|
if (pElem->elemType == SEMICON) {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ ONEbuildMesh(ONEdevice *pDevice, ONEcoord *pCoord, ONEdomain *pDomain,
|
||||||
/* generate the work array for setting up nodes and elements */
|
/* generate the work array for setting up nodes and elements */
|
||||||
XCALLOC(nodeArray, ONEnode *, 1 + pDevice->numNodes);
|
XCALLOC(nodeArray, ONEnode *, 1 + pDevice->numNodes);
|
||||||
|
|
||||||
for (pC = pCoord; pC != NIL(ONEcoord); pC = pC->next) {
|
for (pC = pCoord; pC != NULL; pC = pC->next) {
|
||||||
xPos = pC->location;
|
xPos = pC->location;
|
||||||
XCALLOC(pNode, ONEnode, 1);
|
XCALLOC(pNode, ONEnode, 1);
|
||||||
pNode->x = xPos;
|
pNode->x = xPos;
|
||||||
|
|
@ -46,12 +46,12 @@ ONEbuildMesh(ONEdevice *pDevice, ONEcoord *pCoord, ONEdomain *pDomain,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mark the domain info on the nodes */
|
/* mark the domain info on the nodes */
|
||||||
if (pDomain == NIL(ONEdomain)) {
|
if (pDomain == NULL) {
|
||||||
fprintf(stderr, "Error: domains not defined for device\n");
|
fprintf(stderr, "Error: domains not defined for device\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
for (pD = pDomain; pD != NIL(ONEdomain); pD = pD->next) {
|
for (pD = pDomain; pD != NULL; pD = pD->next) {
|
||||||
for (pM = pMaterial; pM != NIL(ONEmaterial); pM = pM->next) {
|
for (pM = pMaterial; pM != NULL; pM = pM->next) {
|
||||||
if (pD->material == pM->id) {
|
if (pD->material == pM->id) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -109,8 +109,8 @@ ONEbuildMesh(ONEdevice *pDevice, ONEcoord *pCoord, ONEdomain *pDomain,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mark the domain info on the elements */
|
/* mark the domain info on the elements */
|
||||||
for (pD = pDomain; pD != NIL(ONEdomain); pD = pD->next) {
|
for (pD = pDomain; pD != NULL; pD = pD->next) {
|
||||||
for (pM = pMaterial; pM != NIL(ONEmaterial); pM = pM->next) {
|
for (pM = pMaterial; pM != NULL; pM = pM->next) {
|
||||||
if (pD->material == pM->id) {
|
if (pD->material == pM->id) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ NUMDproject(ONEdevice *pDevice, double delV)
|
||||||
pDevice->rhs[pNode->pEqn] = -pEdge->dJpDpsiP1;
|
pDevice->rhs[pNode->pEqn] = -pEdge->dJpDpsiP1;
|
||||||
}
|
}
|
||||||
incVpn = pDevice->dcDeltaSolution;
|
incVpn = pDevice->dcDeltaSolution;
|
||||||
spSolve(pDevice->matrix, pDevice->rhs, incVpn, NIL(spREAL), NIL(spREAL));
|
spSolve(pDevice->matrix, pDevice->rhs, incVpn, NULL, NULL);
|
||||||
|
|
||||||
for (index = 1; index < pDevice->numNodes; index++) {
|
for (index = 1; index < pDevice->numNodes; index++) {
|
||||||
pElem = pDevice->elemArray[index];
|
pElem = pDevice->elemArray[index];
|
||||||
|
|
@ -128,7 +128,7 @@ NBJTproject(ONEdevice *pDevice, double delVce, double delVbe,
|
||||||
pDevice->rhs[pNode->pEqn] = -pEdge->dJpDpsiP1;
|
pDevice->rhs[pNode->pEqn] = -pEdge->dJpDpsiP1;
|
||||||
}
|
}
|
||||||
incVce = pDevice->dcDeltaSolution;
|
incVce = pDevice->dcDeltaSolution;
|
||||||
spSolve(pDevice->matrix, pDevice->rhs, incVce, NIL(spREAL), NIL(spREAL));
|
spSolve(pDevice->matrix, pDevice->rhs, incVce, NULL, NULL);
|
||||||
|
|
||||||
for (index = 1; index < pDevice->numNodes; index++) {
|
for (index = 1; index < pDevice->numNodes; index++) {
|
||||||
pElem = pDevice->elemArray[index];
|
pElem = pDevice->elemArray[index];
|
||||||
|
|
@ -179,7 +179,7 @@ NBJTproject(ONEdevice *pDevice, double delVce, double delVbe,
|
||||||
}
|
}
|
||||||
|
|
||||||
incVbe = pDevice->copiedSolution;
|
incVbe = pDevice->copiedSolution;
|
||||||
spSolve(pDevice->matrix, pDevice->rhs, incVbe, NIL(spREAL), NIL(spREAL));
|
spSolve(pDevice->matrix, pDevice->rhs, incVbe, NULL, NULL);
|
||||||
|
|
||||||
for (index = 1; index < pDevice->numNodes; index++) {
|
for (index = 1; index < pDevice->numNodes; index++) {
|
||||||
pElem = pDevice->elemArray[index];
|
pElem = pDevice->elemArray[index];
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ ONEcopyBCinfo(ONEdevice *pDevice, ONEelem *pElem, BDRYcard *bdry, int index)
|
||||||
length = 0.0;
|
length = 0.0;
|
||||||
for (eIndex = 0; eIndex <= 3; eIndex++) {
|
for (eIndex = 0; eIndex <= 3; eIndex++) {
|
||||||
pNElem = pNode->pElems[eIndex];
|
pNElem = pNode->pElems[eIndex];
|
||||||
if ((pNElem != NIL(ONEelem)) && (pElem->elemType == SEMICON)) {
|
if ((pNElem != NULL) && (pElem->elemType == SEMICON)) {
|
||||||
length += 0.5 * pElem->dx;
|
length += 0.5 * pElem->dx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -158,10 +158,10 @@ ONEsetBCparams(ONEdevice *pDevice, BDRYcard *bdryList, CONTcard *contList)
|
||||||
BDRYcard *bdry;
|
BDRYcard *bdry;
|
||||||
CONTcard *cont;
|
CONTcard *cont;
|
||||||
|
|
||||||
for (bdry = bdryList; bdry != NIL(BDRYcard); bdry = bdry->BDRYnextCard) {
|
for (bdry = bdryList; bdry != NULL; bdry = bdry->BDRYnextCard) {
|
||||||
for (xIndex = bdry->BDRYixLow; xIndex < bdry->BDRYixHigh; xIndex++) {
|
for (xIndex = bdry->BDRYixLow; xIndex < bdry->BDRYixHigh; xIndex++) {
|
||||||
pElem = pDevice->elemArray[xIndex];
|
pElem = pDevice->elemArray[xIndex];
|
||||||
if (pElem != NIL(ONEelem)) {
|
if (pElem != NULL) {
|
||||||
if (pElem->domain == bdry->BDRYdomain) {
|
if (pElem->domain == bdry->BDRYdomain) {
|
||||||
for (index = 0; index <= 1; index++) {
|
for (index = 0; index <= 1; index++) {
|
||||||
if (pElem->evalNodes[index]) {
|
if (pElem->evalNodes[index]) {
|
||||||
|
|
@ -183,7 +183,7 @@ ONEsetBCparams(ONEdevice *pDevice, BDRYcard *bdryList, CONTcard *contList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (cont = contList; cont != NIL(CONTcard); cont = cont->CONTnextCard) {
|
for (cont = contList; cont != NULL; cont = cont->CONTnextCard) {
|
||||||
if (!cont->CONTworkfunGiven) {
|
if (!cont->CONTworkfunGiven) {
|
||||||
cont->CONTworkfun = PHI_METAL;
|
cont->CONTworkfun = PHI_METAL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ ONEdcSolve(ONEdevice *pDevice, int iterationLimit, BOOLEAN newSolver,
|
||||||
}
|
}
|
||||||
/* SOLVE */
|
/* SOLVE */
|
||||||
startTime = SPfrontEnd->IFseconds();
|
startTime = SPfrontEnd->IFseconds();
|
||||||
spSolve(pDevice->matrix, rhs, delta, NIL(spREAL), NIL(spREAL));
|
spSolve(pDevice->matrix, rhs, delta, NULL, NULL);
|
||||||
solveTime += SPfrontEnd->IFseconds() - startTime;
|
solveTime += SPfrontEnd->IFseconds() - startTime;
|
||||||
|
|
||||||
/* UPDATE */
|
/* UPDATE */
|
||||||
|
|
@ -1000,7 +1000,7 @@ ONEnuNorm(ONEdevice *pDevice)
|
||||||
{
|
{
|
||||||
/* The LU Decomposed matrix is available. Use it to calculate x. */
|
/* The LU Decomposed matrix is available. Use it to calculate x. */
|
||||||
spSolve(pDevice->matrix, pDevice->rhs, pDevice->rhsImag,
|
spSolve(pDevice->matrix, pDevice->rhs, pDevice->rhsImag,
|
||||||
NIL(spREAL), NIL(spREAL));
|
NULL, NULL);
|
||||||
|
|
||||||
/* Compute L2-norm of the solution vector (stored in rhsImag) */
|
/* Compute L2-norm of the solution vector (stored in rhsImag) */
|
||||||
return (l2Norm(pDevice->rhsImag, pDevice->numEqns));
|
return (l2Norm(pDevice->rhsImag, pDevice->numEqns));
|
||||||
|
|
@ -1043,12 +1043,12 @@ ONEjacCheck(ONEdevice *pDevice, BOOLEAN tranAnalysis, ONEtranInfo *info)
|
||||||
diff = (pDevice->rhsImag[rIndex] - pDevice->rhs[rIndex]) / del;
|
diff = (pDevice->rhsImag[rIndex] - pDevice->rhs[rIndex]) / del;
|
||||||
dptr = spFindElement(pDevice->matrix, rIndex, index);
|
dptr = spFindElement(pDevice->matrix, rIndex, index);
|
||||||
/*
|
/*
|
||||||
* if ( dptr ISNOT NIL(double) ) { fprintf( stderr, "[%d][%d]: FD =
|
* if ( dptr ISNOT NULL ) { fprintf( stderr, "[%d][%d]: FD =
|
||||||
* %11.4e, AJ = %11.4e\n", rIndex, index, diff, *dptr ); } else {
|
* %11.4e, AJ = %11.4e\n", rIndex, index, diff, *dptr ); } else {
|
||||||
* fprintf( stderr, "[%d][%d]: FD = %11.4e, AJ = %11.4e\n", rIndex,
|
* fprintf( stderr, "[%d][%d]: FD = %11.4e, AJ = %11.4e\n", rIndex,
|
||||||
* index, diff, 0.0 ); }
|
* index, diff, 0.0 ); }
|
||||||
*/
|
*/
|
||||||
if (dptr != NIL(double)) {
|
if (dptr != NULL) {
|
||||||
tol = (1e-4 * pDevice->abstol) + (1e-2 * MAX(ABS(diff), ABS(*dptr)));
|
tol = (1e-4 * pDevice->abstol) + (1e-2 * MAX(ABS(diff), ABS(*dptr)));
|
||||||
if ((diff != 0.0) && (ABS(diff - *dptr) > tol)) {
|
if ((diff != 0.0) && (ABS(diff - *dptr) > tol)) {
|
||||||
fprintf(stderr, "Mismatch[%d][%d]: FD = %11.4e, AJ = %11.4e\n\t FD-AJ = %11.4e vs. %11.4e\n",
|
fprintf(stderr, "Mismatch[%d][%d]: FD = %11.4e, AJ = %11.4e\n\t FD-AJ = %11.4e vs. %11.4e\n",
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ void printCoordInfo(CoordInfo *pFirstCoord)
|
||||||
{
|
{
|
||||||
CoordInfo *pCoord;
|
CoordInfo *pCoord;
|
||||||
|
|
||||||
for ( pCoord = pFirstCoord; pCoord != NIL(CoordInfo);
|
for ( pCoord = pFirstCoord; pCoord != NULL;
|
||||||
pCoord = pCoord->next ) {
|
pCoord = pCoord->next ) {
|
||||||
fprintf(stderr, "mesh number=%4d location=%11.4e\n",
|
fprintf(stderr, "mesh number=%4d location=%11.4e\n",
|
||||||
pCoord->number, pCoord->location );
|
pCoord->number, pCoord->location );
|
||||||
|
|
@ -25,7 +25,7 @@ void killCoordInfo(CoordInfo *pFirstCoord)
|
||||||
{
|
{
|
||||||
CoordInfo *pCoord, *pKill;
|
CoordInfo *pCoord, *pKill;
|
||||||
|
|
||||||
for ( pCoord = pFirstCoord; pCoord != NIL(CoordInfo); ) {
|
for ( pCoord = pFirstCoord; pCoord != NULL; ) {
|
||||||
pKill = pCoord;
|
pKill = pCoord;
|
||||||
pCoord = pCoord->next;
|
pCoord = pCoord->next;
|
||||||
FREE( pKill );
|
FREE( pKill );
|
||||||
|
|
@ -36,7 +36,7 @@ void ONEprintDomainInfo(DomainInfo *pFirstDomain)
|
||||||
{
|
{
|
||||||
DomainInfo *pDomain;
|
DomainInfo *pDomain;
|
||||||
|
|
||||||
for ( pDomain = pFirstDomain; pDomain != NIL(DomainInfo);
|
for ( pDomain = pFirstDomain; pDomain != NULL;
|
||||||
pDomain = pDomain->next ) {
|
pDomain = pDomain->next ) {
|
||||||
fprintf( stderr, "domain id=%4d mat=%4d ixLo=%4d ixHi=%4d\n",
|
fprintf( stderr, "domain id=%4d mat=%4d ixLo=%4d ixHi=%4d\n",
|
||||||
pDomain->id, pDomain->material, pDomain->ixLo, pDomain->ixHi );
|
pDomain->id, pDomain->material, pDomain->ixLo, pDomain->ixHi );
|
||||||
|
|
@ -47,7 +47,7 @@ void TWOprintDomainInfo(DomainInfo *pFirstDomain)
|
||||||
{
|
{
|
||||||
DomainInfo *pDomain;
|
DomainInfo *pDomain;
|
||||||
|
|
||||||
for ( pDomain = pFirstDomain; pDomain != NIL(DomainInfo);
|
for ( pDomain = pFirstDomain; pDomain != NULL;
|
||||||
pDomain = pDomain->next ) {
|
pDomain = pDomain->next ) {
|
||||||
fprintf( stderr,
|
fprintf( stderr,
|
||||||
"domain id=%4d mat=%4d ixLo=%4d ixHi=%4d iyLo=%4d iyHi=%4d\n",
|
"domain id=%4d mat=%4d ixLo=%4d ixHi=%4d iyLo=%4d iyHi=%4d\n",
|
||||||
|
|
@ -61,7 +61,7 @@ void killDomainInfo(DomainInfo *pFirstDomain)
|
||||||
{
|
{
|
||||||
DomainInfo *pDomain, *pKill;
|
DomainInfo *pDomain, *pKill;
|
||||||
|
|
||||||
for ( pDomain = pFirstDomain; pDomain != NIL(DomainInfo); ) {
|
for ( pDomain = pFirstDomain; pDomain != NULL; ) {
|
||||||
pKill = pDomain;
|
pKill = pDomain;
|
||||||
pDomain = pDomain->next;
|
pDomain = pDomain->next;
|
||||||
FREE( pKill );
|
FREE( pKill );
|
||||||
|
|
@ -72,7 +72,7 @@ void ONEprintBoundaryInfo(BoundaryInfo *pFirstBoundary)
|
||||||
{
|
{
|
||||||
BoundaryInfo *pBoundary;
|
BoundaryInfo *pBoundary;
|
||||||
|
|
||||||
for ( pBoundary = pFirstBoundary; pBoundary != NIL(BoundaryInfo);
|
for ( pBoundary = pFirstBoundary; pBoundary != NULL;
|
||||||
pBoundary = pBoundary->next ) {
|
pBoundary = pBoundary->next ) {
|
||||||
fprintf( stderr,
|
fprintf( stderr,
|
||||||
"boundary dom=%4d nbr=%4d ixLo=%4d ixHi=%4d\n",
|
"boundary dom=%4d nbr=%4d ixLo=%4d ixHi=%4d\n",
|
||||||
|
|
@ -85,7 +85,7 @@ void TWOprintBoundaryInfo(BoundaryInfo *pFirstBoundary)
|
||||||
{
|
{
|
||||||
BoundaryInfo *pBoundary;
|
BoundaryInfo *pBoundary;
|
||||||
|
|
||||||
for ( pBoundary = pFirstBoundary; pBoundary != NIL(BoundaryInfo);
|
for ( pBoundary = pFirstBoundary; pBoundary != NULL;
|
||||||
pBoundary = pBoundary->next ) {
|
pBoundary = pBoundary->next ) {
|
||||||
fprintf( stderr,
|
fprintf( stderr,
|
||||||
"boundary dom=%4d nbr=%4d ixLo=%4d ixHi=%4d iyLo=%4d iyHi=%4d\n",
|
"boundary dom=%4d nbr=%4d ixLo=%4d ixHi=%4d iyLo=%4d iyHi=%4d\n",
|
||||||
|
|
@ -99,7 +99,7 @@ void killBoundaryInfo(BoundaryInfo *pFirstBoundary)
|
||||||
{
|
{
|
||||||
BoundaryInfo *pBoundary, *pKill;
|
BoundaryInfo *pBoundary, *pKill;
|
||||||
|
|
||||||
for ( pBoundary = pFirstBoundary; pBoundary != NIL(BoundaryInfo); ) {
|
for ( pBoundary = pFirstBoundary; pBoundary != NULL; ) {
|
||||||
pKill = pBoundary;
|
pKill = pBoundary;
|
||||||
pBoundary = pBoundary->next;
|
pBoundary = pBoundary->next;
|
||||||
FREE( pKill );
|
FREE( pKill );
|
||||||
|
|
@ -110,7 +110,7 @@ void TWOprintElectrodeInfo(ElectrodeInfo *pFirstElectrode)
|
||||||
{
|
{
|
||||||
ElectrodeInfo *pElectrode;
|
ElectrodeInfo *pElectrode;
|
||||||
|
|
||||||
for ( pElectrode = pFirstElectrode; pElectrode != NIL(ElectrodeInfo);
|
for ( pElectrode = pFirstElectrode; pElectrode != NULL;
|
||||||
pElectrode = pElectrode->next ) {
|
pElectrode = pElectrode->next ) {
|
||||||
fprintf( stderr,
|
fprintf( stderr,
|
||||||
"electrode id=%4d ixLo=%4d ixHi=%4d iyLo=%4d iyHi=%4d\n",
|
"electrode id=%4d ixLo=%4d ixHi=%4d iyLo=%4d iyHi=%4d\n",
|
||||||
|
|
@ -123,7 +123,7 @@ void killElectrodeInfo(ElectrodeInfo *pFirstElectrode)
|
||||||
{
|
{
|
||||||
ElectrodeInfo *pElectrode, *pKill;
|
ElectrodeInfo *pElectrode, *pKill;
|
||||||
|
|
||||||
for ( pElectrode = pFirstElectrode; pElectrode != NIL(ElectrodeInfo); ) {
|
for ( pElectrode = pFirstElectrode; pElectrode != NULL; ) {
|
||||||
pKill = pElectrode;
|
pKill = pElectrode;
|
||||||
pElectrode = pElectrode->next;
|
pElectrode = pElectrode->next;
|
||||||
FREE( pKill );
|
FREE( pKill );
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ void GLOBcomputeGlobals(GLOBvalues *pGlobals, double temp)
|
||||||
|
|
||||||
void GLOBputGlobals(GLOBvalues *values)
|
void GLOBputGlobals(GLOBvalues *values)
|
||||||
{
|
{
|
||||||
if ( values == NIL(GLOBvalues) ) {
|
if ( values == NULL ) {
|
||||||
fprintf( stderr, "Error: tried to get from NIL GLOBvalues\n");
|
fprintf( stderr, "Error: tried to get from NIL GLOBvalues\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
@ -106,7 +106,7 @@ void GLOBputGlobals(GLOBvalues *values)
|
||||||
*/
|
*/
|
||||||
void GLOBgetGlobals(GLOBvalues *values)
|
void GLOBgetGlobals(GLOBvalues *values)
|
||||||
{
|
{
|
||||||
if ( values == NIL(GLOBvalues) ) {
|
if ( values == NULL ) {
|
||||||
fprintf( stderr, "Error: tried to get from NIL GLOBvalues\n");
|
fprintf( stderr, "Error: tried to get from NIL GLOBvalues\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
@ -135,7 +135,7 @@ void GLOBprnGlobals(FILE *file, GLOBvalues *values)
|
||||||
static const char tabformat[] = "%12s: % .4e %-12s\t";
|
static const char tabformat[] = "%12s: % .4e %-12s\t";
|
||||||
static const char newformat[] = "%12s: % .4e %-12s\n";
|
static const char newformat[] = "%12s: % .4e %-12s\n";
|
||||||
|
|
||||||
if ( values == NIL( GLOBvalues ) ) {
|
if ( values == NULL ) {
|
||||||
fprintf( stderr, "Error: tried to print NIL GLOBvalues\n");
|
fprintf( stderr, "Error: tried to print NIL GLOBvalues\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ printMaterialInfo(MaterialInfo *info)
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
|
|
||||||
if (info == NIL(MaterialInfo)) {
|
if (info == NULL) {
|
||||||
fprintf(stderr, "Error: tried to print NIL MaterialInfo\n");
|
fprintf(stderr, "Error: tried to print NIL MaterialInfo\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,11 @@ readAsciiData( char *fileName, int impType, DOPtable **ppTable )
|
||||||
|
|
||||||
/* Now create a new lookup table */
|
/* Now create a new lookup table */
|
||||||
XCALLOC( tmpTable, DOPtable, 1 );
|
XCALLOC( tmpTable, DOPtable, 1 );
|
||||||
if ( *ppTable == NIL(DOPtable) ) {
|
if ( *ppTable == NULL ) {
|
||||||
/* First Entry */
|
/* First Entry */
|
||||||
tmpTable->impId = 1;
|
tmpTable->impId = 1;
|
||||||
tmpTable->dopData = profileData;
|
tmpTable->dopData = profileData;
|
||||||
tmpTable->next = NIL(DOPtable);
|
tmpTable->next = NULL;
|
||||||
*ppTable = tmpTable;
|
*ppTable = tmpTable;
|
||||||
} else {
|
} else {
|
||||||
tmpTable->impId = (*ppTable)->impId + 1;
|
tmpTable->impId = (*ppTable)->impId + 1;
|
||||||
|
|
@ -142,11 +142,11 @@ readSupremData(char *fileName, int fileType, int impType, DOPtable **ppTable)
|
||||||
|
|
||||||
/* Now create a new lookup table */
|
/* Now create a new lookup table */
|
||||||
XCALLOC( tmpTable, DOPtable, 1 );
|
XCALLOC( tmpTable, DOPtable, 1 );
|
||||||
if ( *ppTable == NIL(DOPtable) ) {
|
if ( *ppTable == NULL ) {
|
||||||
/* First Entry */
|
/* First Entry */
|
||||||
tmpTable->impId = 1;
|
tmpTable->impId = 1;
|
||||||
tmpTable->dopData = profileData;
|
tmpTable->dopData = profileData;
|
||||||
tmpTable->next = NIL(DOPtable);
|
tmpTable->next = NULL;
|
||||||
*ppTable = tmpTable;
|
*ppTable = tmpTable;
|
||||||
} else {
|
} else {
|
||||||
tmpTable->impId = (*ppTable)->impId + 1;
|
tmpTable->impId = (*ppTable)->impId + 1;
|
||||||
|
|
@ -172,7 +172,7 @@ main(ac, av)
|
||||||
char **av;
|
char **av;
|
||||||
{
|
{
|
||||||
void readSupremData();
|
void readSupremData();
|
||||||
DOPtable *supTable = NIL(DOPtable);
|
DOPtable *supTable = NULL;
|
||||||
double **supInput;
|
double **supInput;
|
||||||
int numPoints, index;
|
int numPoints, index;
|
||||||
char *impName;
|
char *impName;
|
||||||
|
|
@ -192,7 +192,7 @@ char **av;
|
||||||
readSupremData( av[index], 1, impType, &supTable );
|
readSupremData( av[index], 1, impType, &supTable );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for ( ; supTable ISNOT NIL(DOPtable); supTable = supTable->next ) {
|
for ( ; supTable ISNOT NULL; supTable = supTable->next ) {
|
||||||
fprintf( stdout, "\"Impurity Number: %d\n", supTable->impId );
|
fprintf( stdout, "\"Impurity Number: %d\n", supTable->impId );
|
||||||
supInput = supTable->dopData;
|
supInput = supTable->dopData;
|
||||||
numPoints = supInput[0][0];
|
numPoints = supInput[0][0];
|
||||||
|
|
|
||||||
|
|
@ -687,7 +687,7 @@ TWOsorSolve(TWOdevice *pDevice, double *xReal, double *xImag,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* compute xReal(k+1). solution stored in rhsImag */
|
/* compute xReal(k+1). solution stored in rhsImag */
|
||||||
spSolve(pDevice->matrix, rhsSOR, rhsSOR, NIL(spREAL), NIL(spREAL));
|
spSolve(pDevice->matrix, rhsSOR, rhsSOR, NULL, NULL);
|
||||||
/* modify solution when wRelax is not 1 */
|
/* modify solution when wRelax is not 1 */
|
||||||
if (wRelax != 1) {
|
if (wRelax != 1) {
|
||||||
for (index = 1; index <= numEqns; index++) {
|
for (index = 1; index <= numEqns; index++) {
|
||||||
|
|
@ -729,7 +729,7 @@ TWOsorSolve(TWOdevice *pDevice, double *xReal, double *xImag,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* compute xImag(k+1) */
|
/* compute xImag(k+1) */
|
||||||
spSolve(pDevice->matrix, rhsSOR, rhsSOR, NIL(spREAL), NIL(spREAL));
|
spSolve(pDevice->matrix, rhsSOR, rhsSOR, NULL, NULL);
|
||||||
/* modify solution when wRelax is not 1 */
|
/* modify solution when wRelax is not 1 */
|
||||||
if (wRelax != 1) {
|
if (wRelax != 1) {
|
||||||
for (index = 1; index <= numEqns; index++) {
|
for (index = 1; index <= numEqns; index++) {
|
||||||
|
|
@ -775,7 +775,7 @@ contactAdmittance(TWOdevice *pDevice, TWOcontact *pContact, BOOLEAN delVContact,
|
||||||
pNode = pContact->pNodes[index];
|
pNode = pContact->pNodes[index];
|
||||||
for (i = 0; i <= 3; i++) {
|
for (i = 0; i <= 3; i++) {
|
||||||
pElem = pNode->pElems[i];
|
pElem = pNode->pElems[i];
|
||||||
if (pElem != NIL(TWOelem)) {
|
if (pElem != NULL) {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0:
|
case 0:
|
||||||
/* the TL element */
|
/* the TL element */
|
||||||
|
|
@ -976,7 +976,7 @@ oxideAdmittance(TWOdevice *pDevice, TWOcontact *pContact, BOOLEAN delVContact,
|
||||||
pNode = pContact->pNodes[index];
|
pNode = pContact->pNodes[index];
|
||||||
for (i = 0; i <= 3; i++) {
|
for (i = 0; i <= 3; i++) {
|
||||||
pElem = pNode->pElems[i];
|
pElem = pNode->pElems[i];
|
||||||
if (pElem != NIL(TWOelem)) {
|
if (pElem != NULL) {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0:
|
case 0:
|
||||||
/* the TL element */
|
/* the TL element */
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,10 @@ TWOavalanche(TWOelem *pElem, TWOnode *pNode)
|
||||||
pElemBR = pNode->pBRElem;
|
pElemBR = pNode->pBRElem;
|
||||||
|
|
||||||
/* Null edge pointers */
|
/* Null edge pointers */
|
||||||
pEdgeT = pEdgeB = pEdgeL = pEdgeR = NIL(TWOedge);
|
pEdgeT = pEdgeB = pEdgeL = pEdgeR = NULL;
|
||||||
|
|
||||||
/* Find edges next to node */
|
/* Find edges next to node */
|
||||||
if ( pElemTL != NIL(TWOelem) ) {
|
if ( pElemTL != NULL ) {
|
||||||
if (pElemTL->evalEdges[1]) {
|
if (pElemTL->evalEdges[1]) {
|
||||||
pEdgeT = pElemTL->pRightEdge;
|
pEdgeT = pElemTL->pRightEdge;
|
||||||
materT = pElemTL->elemType;
|
materT = pElemTL->elemType;
|
||||||
|
|
@ -51,7 +51,7 @@ TWOavalanche(TWOelem *pElem, TWOnode *pNode)
|
||||||
dxL = pElemTL->dx;
|
dxL = pElemTL->dx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( pElemTR != NIL(TWOelem) ) {
|
if ( pElemTR != NULL ) {
|
||||||
if (pElemTR->evalEdges[3]) {
|
if (pElemTR->evalEdges[3]) {
|
||||||
pEdgeT = pElemTR->pLeftEdge;
|
pEdgeT = pElemTR->pLeftEdge;
|
||||||
materT = pElemTR->elemType;
|
materT = pElemTR->elemType;
|
||||||
|
|
@ -63,7 +63,7 @@ TWOavalanche(TWOelem *pElem, TWOnode *pNode)
|
||||||
dxR = pElemTR->dx;
|
dxR = pElemTR->dx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( pElemBR != NIL(TWOelem) ) {
|
if ( pElemBR != NULL ) {
|
||||||
if (pElemBR->evalEdges[3]) {
|
if (pElemBR->evalEdges[3]) {
|
||||||
pEdgeB = pElemBR->pLeftEdge;
|
pEdgeB = pElemBR->pLeftEdge;
|
||||||
materB = pElemBR->elemType;
|
materB = pElemBR->elemType;
|
||||||
|
|
@ -75,7 +75,7 @@ TWOavalanche(TWOelem *pElem, TWOnode *pNode)
|
||||||
dxR = pElemBR->dx;
|
dxR = pElemBR->dx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( pElemBL != NIL(TWOelem) ) {
|
if ( pElemBL != NULL ) {
|
||||||
if (pElemBL->evalEdges[1]) {
|
if (pElemBL->evalEdges[1]) {
|
||||||
pEdgeB = pElemBL->pRightEdge;
|
pEdgeB = pElemBL->pRightEdge;
|
||||||
materB = pElemBL->elemType;
|
materB = pElemBL->elemType;
|
||||||
|
|
@ -91,7 +91,7 @@ TWOavalanche(TWOelem *pElem, TWOnode *pNode)
|
||||||
/* compute horizontal vector components */
|
/* compute horizontal vector components */
|
||||||
/* No more than one of Left Edge or Right Edge is absent */
|
/* No more than one of Left Edge or Right Edge is absent */
|
||||||
/* If one is absent the other is guaranteed to be from silicon */
|
/* If one is absent the other is guaranteed to be from silicon */
|
||||||
if (pEdgeL == NIL(TWOedge)) {
|
if (pEdgeL == NULL) {
|
||||||
if ( pNode->nodeType == CONTACT ) {
|
if ( pNode->nodeType == CONTACT ) {
|
||||||
enx = -(pEdgeR->dPsi + pEdgeR->dCBand) / dxR;
|
enx = -(pEdgeR->dPsi + pEdgeR->dCBand) / dxR;
|
||||||
epx = -(pEdgeR->dPsi - pEdgeR->dVBand) / dxR;
|
epx = -(pEdgeR->dPsi - pEdgeR->dVBand) / dxR;
|
||||||
|
|
@ -103,7 +103,7 @@ TWOavalanche(TWOelem *pElem, TWOnode *pNode)
|
||||||
jnx = 0.0;
|
jnx = 0.0;
|
||||||
jpx = 0.0;
|
jpx = 0.0;
|
||||||
}
|
}
|
||||||
} else if (pEdgeR == NIL(TWOedge)) {
|
} else if (pEdgeR == NULL) {
|
||||||
if ( pNode->nodeType == CONTACT ) {
|
if ( pNode->nodeType == CONTACT ) {
|
||||||
enx = -(pEdgeL->dPsi + pEdgeL->dCBand) / dxL;
|
enx = -(pEdgeL->dPsi + pEdgeL->dCBand) / dxL;
|
||||||
epx = -(pEdgeL->dPsi - pEdgeL->dVBand) / dxL;
|
epx = -(pEdgeL->dPsi - pEdgeL->dVBand) / dxL;
|
||||||
|
|
@ -136,7 +136,7 @@ TWOavalanche(TWOelem *pElem, TWOnode *pNode)
|
||||||
/* compute vertical vector components */
|
/* compute vertical vector components */
|
||||||
/* No more than one of Top Edge or Bottom Edge is absent */
|
/* No more than one of Top Edge or Bottom Edge is absent */
|
||||||
/* If one is absent the other is guaranteed to be from silicon */
|
/* If one is absent the other is guaranteed to be from silicon */
|
||||||
if (pEdgeT == NIL(TWOedge)) {
|
if (pEdgeT == NULL) {
|
||||||
if ( pNode->nodeType == CONTACT ) {
|
if ( pNode->nodeType == CONTACT ) {
|
||||||
eny = -(pEdgeB->dPsi + pEdgeB->dCBand) / dyB;
|
eny = -(pEdgeB->dPsi + pEdgeB->dCBand) / dyB;
|
||||||
epy = -(pEdgeB->dPsi - pEdgeB->dVBand) / dyB;
|
epy = -(pEdgeB->dPsi - pEdgeB->dVBand) / dyB;
|
||||||
|
|
@ -148,7 +148,7 @@ TWOavalanche(TWOelem *pElem, TWOnode *pNode)
|
||||||
jny = 0.0;
|
jny = 0.0;
|
||||||
jpy = 0.0;
|
jpy = 0.0;
|
||||||
}
|
}
|
||||||
} else if (pEdgeB == NIL(TWOedge)) {
|
} else if (pEdgeB == NULL) {
|
||||||
if ( pNode->nodeType == CONTACT ) {
|
if ( pNode->nodeType == CONTACT ) {
|
||||||
eny = -(pEdgeT->dPsi + pEdgeT->dCBand) / dyT;
|
eny = -(pEdgeT->dPsi + pEdgeT->dCBand) / dyT;
|
||||||
epy = -(pEdgeT->dPsi - pEdgeT->dVBand) / dyT;
|
epy = -(pEdgeT->dPsi - pEdgeT->dVBand) / dyT;
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ void
|
||||||
*/
|
*/
|
||||||
incVpn = pDevice->dcDeltaSolution;
|
incVpn = pDevice->dcDeltaSolution;
|
||||||
storeNewRhs( pDevice, pDevice->pLastContact );
|
storeNewRhs( pDevice, pDevice->pLastContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVpn, NIL(spREAL), NIL(spREAL));
|
spSolve( pDevice->matrix, pDevice->rhs, incVpn, NULL, NULL);
|
||||||
|
|
||||||
incVpn = pDevice->dcDeltaSolution;
|
incVpn = pDevice->dcDeltaSolution;
|
||||||
*gd = contactConductance( pDevice, pContact, deltaVContact, incVpn,
|
*gd = contactConductance( pDevice, pContact, deltaVContact, incVpn,
|
||||||
|
|
@ -58,9 +58,9 @@ void
|
||||||
incVce = pDevice->dcDeltaSolution;
|
incVce = pDevice->dcDeltaSolution;
|
||||||
incVbe = pDevice->copiedSolution;
|
incVbe = pDevice->copiedSolution;
|
||||||
storeNewRhs( pDevice, pColContact );
|
storeNewRhs( pDevice, pColContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVce, NIL(spREAL), NIL(spREAL));
|
spSolve( pDevice->matrix, pDevice->rhs, incVce, NULL, NULL);
|
||||||
storeNewRhs( pDevice, pBaseContact );
|
storeNewRhs( pDevice, pBaseContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVbe, NIL(spREAL), NIL(spREAL));
|
spSolve( pDevice->matrix, pDevice->rhs, incVbe, NULL, NULL);
|
||||||
|
|
||||||
*dIeDVce = contactConductance( pDevice, pEmitContact, FALSE, incVce,
|
*dIeDVce = contactConductance( pDevice, pEmitContact, FALSE, incVce,
|
||||||
tranAnalysis, intCoeff );
|
tranAnalysis, intCoeff );
|
||||||
|
|
@ -96,11 +96,11 @@ void
|
||||||
incVsb = pDevice->copiedSolution;
|
incVsb = pDevice->copiedSolution;
|
||||||
incVgb = pDevice->rhsImag;
|
incVgb = pDevice->rhsImag;
|
||||||
storeNewRhs( pDevice, pDContact );
|
storeNewRhs( pDevice, pDContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVdb, NIL(spREAL), NIL(spREAL));
|
spSolve( pDevice->matrix, pDevice->rhs, incVdb, NULL, NULL);
|
||||||
storeNewRhs( pDevice, pSContact );
|
storeNewRhs( pDevice, pSContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVsb, NIL(spREAL), NIL(spREAL));
|
spSolve( pDevice->matrix, pDevice->rhs, incVsb, NULL, NULL);
|
||||||
storeNewRhs( pDevice, pGContact );
|
storeNewRhs( pDevice, pGContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVgb, NIL(spREAL), NIL(spREAL));
|
spSolve( pDevice->matrix, pDevice->rhs, incVgb, NULL, NULL);
|
||||||
|
|
||||||
dIdV->dIdDVdb = contactConductance( pDevice, pDContact, TRUE,
|
dIdV->dIdDVdb = contactConductance( pDevice, pDContact, TRUE,
|
||||||
incVdb, tranAnalysis, intCoeff );
|
incVdb, tranAnalysis, intCoeff );
|
||||||
|
|
@ -149,7 +149,7 @@ double
|
||||||
pNode = pContact->pNodes[ index ];
|
pNode = pContact->pNodes[ index ];
|
||||||
for ( i = 0; i <= 3; i++ ) {
|
for ( i = 0; i <= 3; i++ ) {
|
||||||
pElem = pNode->pElems[ i ];
|
pElem = pNode->pElems[ i ];
|
||||||
if ( pElem != NIL(TWOelem) ) {
|
if ( pElem != NULL ) {
|
||||||
dx = 0.5 * pElem->dx;
|
dx = 0.5 * pElem->dx;
|
||||||
dy = 0.5 * pElem->dy;
|
dy = 0.5 * pElem->dy;
|
||||||
switch ( i ) {
|
switch ( i ) {
|
||||||
|
|
@ -222,7 +222,7 @@ double
|
||||||
pNode = pContact->pNodes[ index ];
|
pNode = pContact->pNodes[ index ];
|
||||||
for ( i = 0; i <= 3; i++ ) {
|
for ( i = 0; i <= 3; i++ ) {
|
||||||
pElem = pNode->pElems[ i ];
|
pElem = pNode->pElems[ i ];
|
||||||
if ( pElem != NIL(TWOelem) ) {
|
if ( pElem != NULL ) {
|
||||||
dx = 0.5 * pElem->dx;
|
dx = 0.5 * pElem->dx;
|
||||||
dy = 0.5 * pElem->dy;
|
dy = 0.5 * pElem->dy;
|
||||||
switch ( i ) {
|
switch ( i ) {
|
||||||
|
|
@ -290,7 +290,7 @@ double
|
||||||
pNode = pContact->pNodes[ index ];
|
pNode = pContact->pNodes[ index ];
|
||||||
for ( i = 0; i <= 3; i++ ) {
|
for ( i = 0; i <= 3; i++ ) {
|
||||||
pElem = pNode->pElems[ i ];
|
pElem = pNode->pElems[ i ];
|
||||||
if ( pElem != NIL(TWOelem) ) {
|
if ( pElem != NULL ) {
|
||||||
switch ( i ) {
|
switch ( i ) {
|
||||||
case 0:
|
case 0:
|
||||||
/* the TL element */
|
/* the TL element */
|
||||||
|
|
@ -445,7 +445,7 @@ double
|
||||||
pNode = pContact->pNodes[ index ];
|
pNode = pContact->pNodes[ index ];
|
||||||
for ( i = 0; i <= 3; i++ ) {
|
for ( i = 0; i <= 3; i++ ) {
|
||||||
pElem = pNode->pElems[ i ];
|
pElem = pNode->pElems[ i ];
|
||||||
if ( pElem != NIL(TWOelem) ) {
|
if ( pElem != NULL ) {
|
||||||
switch ( i ) {
|
switch ( i ) {
|
||||||
case 0:
|
case 0:
|
||||||
/* the TL element */
|
/* the TL element */
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ void
|
||||||
* Don't need these pointers if SurfaceMobility isn't set.
|
* Don't need these pointers if SurfaceMobility isn't set.
|
||||||
*/
|
*/
|
||||||
if ( MobDeriv && SurfaceMobility ) {
|
if ( MobDeriv && SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel; pCh != NIL(TWOchannel);
|
for ( pCh = pDevice->pChannel; pCh != NULL;
|
||||||
pCh = pCh->next ) {
|
pCh = pCh->next ) {
|
||||||
pElem = pCh->pNElem;
|
pElem = pCh->pNElem;
|
||||||
switch (pCh->type) {
|
switch (pCh->type) {
|
||||||
|
|
@ -481,7 +481,7 @@ void
|
||||||
|
|
||||||
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
||||||
if ( MobDeriv && SurfaceMobility ) {
|
if ( MobDeriv && SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel; pCh != NIL(TWOchannel);
|
for ( pCh = pDevice->pChannel; pCh != NULL;
|
||||||
pCh = pCh->next ) {
|
pCh = pCh->next ) {
|
||||||
/* Find effective height of oxide element at interface. */
|
/* Find effective height of oxide element at interface. */
|
||||||
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
||||||
|
|
@ -495,7 +495,7 @@ void
|
||||||
TWO_mobDeriv( pElem, pCh->type, ds );
|
TWO_mobDeriv( pElem, pCh->type, ds );
|
||||||
pElem = pElem->pElems[ nextIndex ];
|
pElem = pElem->pElems[ nextIndex ];
|
||||||
}
|
}
|
||||||
} /* endfor pCh != NIL */
|
} /* endfor pCh != NULL */
|
||||||
} /* endif MobDeriv and SurfaceMobility */
|
} /* endif MobDeriv and SurfaceMobility */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -518,7 +518,7 @@ void
|
||||||
double ds;
|
double ds;
|
||||||
|
|
||||||
/* first compute the currents and derivatives */
|
/* first compute the currents and derivatives */
|
||||||
TWO_commonTerms( pDevice, FALSE, FALSE, NIL(TWOtranInfo) );
|
TWO_commonTerms( pDevice, FALSE, FALSE, NULL );
|
||||||
|
|
||||||
/* zero the matrix */
|
/* zero the matrix */
|
||||||
spClear( pDevice->matrix );
|
spClear( pDevice->matrix );
|
||||||
|
|
@ -641,7 +641,7 @@ void
|
||||||
|
|
||||||
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
||||||
if ( MobDeriv && SurfaceMobility ) {
|
if ( MobDeriv && SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel; pCh != NIL(TWOchannel);
|
for ( pCh = pDevice->pChannel; pCh != NULL;
|
||||||
pCh = pCh->next ) {
|
pCh = pCh->next ) {
|
||||||
/* Find effective height of oxide element at interface. */
|
/* Find effective height of oxide element at interface. */
|
||||||
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
||||||
|
|
@ -655,7 +655,7 @@ void
|
||||||
TWO_mobDeriv( pElem, pCh->type, ds );
|
TWO_mobDeriv( pElem, pCh->type, ds );
|
||||||
pElem = pElem->pElems[ nextIndex ];
|
pElem = pElem->pElems[ nextIndex ];
|
||||||
}
|
}
|
||||||
} /* endfor pCh != NIL */
|
} /* endfor pCh != NULL */
|
||||||
} /* endif MobDeriv and SurfaceMobility */
|
} /* endif MobDeriv and SurfaceMobility */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -920,7 +920,7 @@ void
|
||||||
/* DAG: calculate mobilities for channel elems */
|
/* DAG: calculate mobilities for channel elems */
|
||||||
if ( SurfaceMobility ) {
|
if ( SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel;
|
for ( pCh = pDevice->pChannel;
|
||||||
pCh != NIL(TWOchannel); pCh = pCh->next ) {
|
pCh != NULL; pCh = pCh->next ) {
|
||||||
pElem = pCh->pNElem;
|
pElem = pCh->pNElem;
|
||||||
switch (pCh->type) {
|
switch (pCh->type) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -951,7 +951,7 @@ void
|
||||||
TWO_mobility( pElem, eSurf );
|
TWO_mobility( pElem, eSurf );
|
||||||
pElem = pElem->pElems[ nextIndex ];
|
pElem = pElem->pElems[ nextIndex ];
|
||||||
}
|
}
|
||||||
} /* endfor pCH != NIL */
|
} /* endfor pCH != NULL */
|
||||||
} /* endif SurfaceMobility */
|
} /* endif SurfaceMobility */
|
||||||
|
|
||||||
/* calculate the current densities assuming mobility value depend on Ex,Ey*/
|
/* calculate the current densities assuming mobility value depend on Ex,Ey*/
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,13 @@ nodeCurrents(TWOelem *pElem, TWOnode *pNode, double *mun, double *mup,
|
||||||
pElemBR = pNode->pBRElem;
|
pElemBR = pNode->pBRElem;
|
||||||
|
|
||||||
/* Null edge pointers */
|
/* Null edge pointers */
|
||||||
pEdgeT = pEdgeB = pEdgeL = pEdgeR = NIL(TWOedge);
|
pEdgeT = pEdgeB = pEdgeL = pEdgeR = NULL;
|
||||||
|
|
||||||
/* Zero mobilities */
|
/* Zero mobilities */
|
||||||
*mun = *mup = 0.0;
|
*mun = *mup = 0.0;
|
||||||
|
|
||||||
/* Find edges next to node */
|
/* Find edges next to node */
|
||||||
if (pElemTL != NIL(TWOelem)) {
|
if (pElemTL != NULL) {
|
||||||
numFound++;
|
numFound++;
|
||||||
*mun += pElemTL->mun0;
|
*mun += pElemTL->mun0;
|
||||||
*mup += pElemTL->mup0;
|
*mup += pElemTL->mup0;
|
||||||
|
|
@ -57,7 +57,7 @@ nodeCurrents(TWOelem *pElem, TWOnode *pNode, double *mun, double *mup,
|
||||||
epsL = pElemTL->epsRel;
|
epsL = pElemTL->epsRel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pElemTR != NIL(TWOelem)) {
|
if (pElemTR != NULL) {
|
||||||
numFound++;
|
numFound++;
|
||||||
*mun += pElemTR->mun0;
|
*mun += pElemTR->mun0;
|
||||||
*mup += pElemTR->mup0;
|
*mup += pElemTR->mup0;
|
||||||
|
|
@ -73,7 +73,7 @@ nodeCurrents(TWOelem *pElem, TWOnode *pNode, double *mun, double *mup,
|
||||||
epsR = pElemTR->epsRel;
|
epsR = pElemTR->epsRel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pElemBR != NIL(TWOelem)) {
|
if (pElemBR != NULL) {
|
||||||
numFound++;
|
numFound++;
|
||||||
*mun += pElemBR->mun0;
|
*mun += pElemBR->mun0;
|
||||||
*mup += pElemBR->mup0;
|
*mup += pElemBR->mup0;
|
||||||
|
|
@ -90,7 +90,7 @@ nodeCurrents(TWOelem *pElem, TWOnode *pNode, double *mun, double *mup,
|
||||||
epsR = pElemBR->epsRel;
|
epsR = pElemBR->epsRel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pElemBL != NIL(TWOelem)) {
|
if (pElemBL != NULL) {
|
||||||
numFound++;
|
numFound++;
|
||||||
*mun += pElemBL->mun0;
|
*mun += pElemBL->mun0;
|
||||||
*mup += pElemBL->mup0;
|
*mup += pElemBL->mup0;
|
||||||
|
|
@ -112,7 +112,7 @@ nodeCurrents(TWOelem *pElem, TWOnode *pNode, double *mun, double *mup,
|
||||||
/* compute horizontal vector components */
|
/* compute horizontal vector components */
|
||||||
/* No more than one of Left Edge or Right Edge is absent */
|
/* No more than one of Left Edge or Right Edge is absent */
|
||||||
/* If one is absent the other is guaranteed to be from silicon */
|
/* If one is absent the other is guaranteed to be from silicon */
|
||||||
if (pEdgeL == NIL(TWOedge)) {
|
if (pEdgeL == NULL) {
|
||||||
if (pNode->nodeType == CONTACT) {
|
if (pNode->nodeType == CONTACT) {
|
||||||
*jnx = pEdgeR->jn;
|
*jnx = pEdgeR->jn;
|
||||||
*jpx = pEdgeR->jp;
|
*jpx = pEdgeR->jp;
|
||||||
|
|
@ -122,7 +122,7 @@ nodeCurrents(TWOelem *pElem, TWOnode *pNode, double *mun, double *mup,
|
||||||
*jpx = 0.0;
|
*jpx = 0.0;
|
||||||
*jdx = 0.0;
|
*jdx = 0.0;
|
||||||
}
|
}
|
||||||
} else if (pEdgeR == NIL(TWOedge)) {
|
} else if (pEdgeR == NULL) {
|
||||||
if (pNode->nodeType == CONTACT) {
|
if (pNode->nodeType == CONTACT) {
|
||||||
*jnx = pEdgeL->jn;
|
*jnx = pEdgeL->jn;
|
||||||
*jpx = pEdgeL->jp;
|
*jpx = pEdgeL->jp;
|
||||||
|
|
@ -149,7 +149,7 @@ nodeCurrents(TWOelem *pElem, TWOnode *pNode, double *mun, double *mup,
|
||||||
/* compute vertical vector components */
|
/* compute vertical vector components */
|
||||||
/* No more than one of Top Edge or Bottom Edge is absent */
|
/* No more than one of Top Edge or Bottom Edge is absent */
|
||||||
/* If one is absent the other is guaranteed to be from silicon */
|
/* If one is absent the other is guaranteed to be from silicon */
|
||||||
if (pEdgeT == NIL(TWOedge)) {
|
if (pEdgeT == NULL) {
|
||||||
if (pNode->nodeType == CONTACT) {
|
if (pNode->nodeType == CONTACT) {
|
||||||
*jny = pEdgeB->jn;
|
*jny = pEdgeB->jn;
|
||||||
*jpy = pEdgeB->jp;
|
*jpy = pEdgeB->jp;
|
||||||
|
|
@ -159,7 +159,7 @@ nodeCurrents(TWOelem *pElem, TWOnode *pNode, double *mun, double *mup,
|
||||||
*jpy = 0.0;
|
*jpy = 0.0;
|
||||||
*jdy = 0.0;
|
*jdy = 0.0;
|
||||||
}
|
}
|
||||||
} else if (pEdgeB == NIL(TWOedge)) {
|
} else if (pEdgeB == NULL) {
|
||||||
if (pNode->nodeType == CONTACT) {
|
if (pNode->nodeType == CONTACT) {
|
||||||
*jny = pEdgeT->jn;
|
*jny = pEdgeT->jn;
|
||||||
*jpy = pEdgeT->jp;
|
*jpy = pEdgeT->jp;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ TWOdopingValue(DOPprofile *pProfile, DOPtable *pTable, double x,
|
||||||
|
|
||||||
/* Find the appropriate lookup table if necessary */
|
/* Find the appropriate lookup table if necessary */
|
||||||
if (pProfile->type == LOOKUP) {
|
if (pProfile->type == LOOKUP) {
|
||||||
while ( pTable != NIL(DOPtable) ) {
|
while ( pTable != NULL ) {
|
||||||
if (pTable->impId == pProfile->IMPID) {
|
if (pTable->impId == pProfile->IMPID) {
|
||||||
/* Found it */
|
/* Found it */
|
||||||
break;
|
break;
|
||||||
|
|
@ -34,7 +34,7 @@ TWOdopingValue(DOPprofile *pProfile, DOPtable *pTable, double x,
|
||||||
pTable = pTable->next;
|
pTable = pTable->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( pTable == NIL(DOPtable) ) {
|
if ( pTable == NULL ) {
|
||||||
fprintf( stderr, "Error: unknown impurity profile %d\n",
|
fprintf( stderr, "Error: unknown impurity profile %d\n",
|
||||||
((int)pProfile->IMPID) );
|
((int)pProfile->IMPID) );
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
@ -194,7 +194,7 @@ TWOsetDoping(TWOdevice *pDevice, DOPprofile *pProfile, DOPtable *pTable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Now compute the contribution to the total doping from each profile. */
|
/* Now compute the contribution to the total doping from each profile. */
|
||||||
for ( pP = pProfile; pP != NIL(DOPprofile); pP = pP->next ) {
|
for ( pP = pProfile; pP != NULL; pP = pP->next ) {
|
||||||
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
||||||
pElem = pDevice->elements[ eIndex ];
|
pElem = pDevice->elements[ eIndex ];
|
||||||
if ( pElem->elemType == SEMICON ) {
|
if ( pElem->elemType == SEMICON ) {
|
||||||
|
|
|
||||||
|
|
@ -51,12 +51,12 @@ checkElectrodes(TWOelectrode *pElectrode, int idHigh)
|
||||||
*/
|
*/
|
||||||
pElectrode = TWOsortElectrodes( pElectrode, TWOcmpElectrode );
|
pElectrode = TWOsortElectrodes( pElectrode, TWOcmpElectrode );
|
||||||
id = 1;
|
id = 1;
|
||||||
for (pE = pElectrode; pE != NIL(TWOelectrode); pE = pE->next) {
|
for (pE = pElectrode; pE != NULL; pE = pE->next) {
|
||||||
if (pE->id == -1) pE->id = id++;
|
if (pE->id == -1) pE->id = id++;
|
||||||
}
|
}
|
||||||
pElectrode = TWOsortElectrodes( pElectrode, TWOcmpElectrode );
|
pElectrode = TWOsortElectrodes( pElectrode, TWOcmpElectrode );
|
||||||
|
|
||||||
for (pE = pElectrode, id = 1; pE != NIL(TWOelectrode); pE = pE->next) {
|
for (pE = pElectrode, id = 1; pE != NULL; pE = pE->next) {
|
||||||
/* Check id's */
|
/* Check id's */
|
||||||
if ( pE->id < 1 || pE->id > idHigh) {
|
if ( pE->id < 1 || pE->id > idHigh) {
|
||||||
fprintf(stderr, "Error: electrode %d out of range\n",pE->id);
|
fprintf(stderr, "Error: electrode %d out of range\n",pE->id);
|
||||||
|
|
@ -105,7 +105,7 @@ setupContacts(TWOdevice *pDevice, TWOelectrode *pElectrode,
|
||||||
* 2. Compute number of nodes in each electrode
|
* 2. Compute number of nodes in each electrode
|
||||||
* 3. Overwrite SEMICON or INSULATOR nodeType at electrodes
|
* 3. Overwrite SEMICON or INSULATOR nodeType at electrodes
|
||||||
*/
|
*/
|
||||||
for ( pE = pElectrode; pE != NIL(TWOelectrode); pE = pE->next ) {
|
for ( pE = pElectrode; pE != NULL; pE = pE->next ) {
|
||||||
if (pE->id != id) { /* Found the next electrode */
|
if (pE->id != id) { /* Found the next electrode */
|
||||||
id = pE->id;
|
id = pE->id;
|
||||||
electrodeSize[id] = 0;
|
electrodeSize[id] = 0;
|
||||||
|
|
@ -114,7 +114,7 @@ setupContacts(TWOdevice *pDevice, TWOelectrode *pElectrode,
|
||||||
for ( xIndex = pE->ixLo; xIndex <= pE->ixHi; xIndex++ ) {
|
for ( xIndex = pE->ixLo; xIndex <= pE->ixHi; xIndex++ ) {
|
||||||
for ( yIndex = pE->iyLo; yIndex <= pE->iyHi; yIndex++ ) {
|
for ( yIndex = pE->iyLo; yIndex <= pE->iyHi; yIndex++ ) {
|
||||||
pNode = nodeArray[ xIndex ][ yIndex ];
|
pNode = nodeArray[ xIndex ][ yIndex ];
|
||||||
if ( pNode != NIL( TWOnode ) ) {
|
if ( pNode != NULL ) {
|
||||||
pNode->nodeType = CONTACT;
|
pNode->nodeType = CONTACT;
|
||||||
|
|
||||||
/* Assign each node to an electrode only once */
|
/* Assign each node to an electrode only once */
|
||||||
|
|
@ -144,17 +144,17 @@ setupContacts(TWOdevice *pDevice, TWOelectrode *pElectrode,
|
||||||
printElectrodes( pDevice->pFirstContact );
|
printElectrodes( pDevice->pFirstContact );
|
||||||
*/
|
*/
|
||||||
id = 0;
|
id = 0;
|
||||||
pDevice->pFirstContact = pTail = NIL(TWOcontact);
|
pDevice->pFirstContact = pTail = NULL;
|
||||||
for ( pE = pElectrode; pE != NIL(TWOelectrode); pE = pE->next ) {
|
for ( pE = pElectrode; pE != NULL; pE = pE->next ) {
|
||||||
if (pE->id != id) { /* Found the next electrode */
|
if (pE->id != id) { /* Found the next electrode */
|
||||||
if ( pDevice->pFirstContact == NIL(TWOcontact) ) {
|
if ( pDevice->pFirstContact == NULL ) {
|
||||||
XCALLOC( pNew, TWOcontact, 1 );
|
XCALLOC( pNew, TWOcontact, 1 );
|
||||||
pDevice->pFirstContact = pTail = pNew;
|
pDevice->pFirstContact = pTail = pNew;
|
||||||
} else {
|
} else {
|
||||||
XCALLOC( pNew->next, TWOcontact, 1 );
|
XCALLOC( pNew->next, TWOcontact, 1 );
|
||||||
pTail = pNew = pNew->next;
|
pTail = pNew = pNew->next;
|
||||||
}
|
}
|
||||||
pNew->next = NIL(TWOcontact);
|
pNew->next = NULL;
|
||||||
id = pNew->id = pE->id;
|
id = pNew->id = pE->id;
|
||||||
pNew->workf = pE->workf;
|
pNew->workf = pE->workf;
|
||||||
pNew->numNodes = electrodeSize[id];
|
pNew->numNodes = electrodeSize[id];
|
||||||
|
|
@ -164,7 +164,7 @@ setupContacts(TWOdevice *pDevice, TWOelectrode *pElectrode,
|
||||||
for ( xIndex = pE->ixLo; xIndex <= pE->ixHi; xIndex++ ) {
|
for ( xIndex = pE->ixLo; xIndex <= pE->ixHi; xIndex++ ) {
|
||||||
for ( yIndex = pE->iyLo; yIndex <= pE->iyHi; yIndex++ ) {
|
for ( yIndex = pE->iyLo; yIndex <= pE->iyHi; yIndex++ ) {
|
||||||
pNode = nodeArray[ xIndex ][ yIndex ];
|
pNode = nodeArray[ xIndex ][ yIndex ];
|
||||||
if ( pNode != NIL( TWOnode ) ) {
|
if ( pNode != NULL ) {
|
||||||
/* Make sure node belongs to this electrode, then
|
/* Make sure node belongs to this electrode, then
|
||||||
* clear ELCT_ID so that it is not grabbed again.
|
* clear ELCT_ID so that it is not grabbed again.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,10 @@ nodeFields(TWOelem *pElem, TWOnode *pNode, double *ex, double *ey)
|
||||||
pElemBR = pNode->pBRElem;
|
pElemBR = pNode->pBRElem;
|
||||||
|
|
||||||
/* Null edge pointers */
|
/* Null edge pointers */
|
||||||
pEdgeT = pEdgeB = pEdgeL = pEdgeR = NIL(TWOedge);
|
pEdgeT = pEdgeB = pEdgeL = pEdgeR = NULL;
|
||||||
|
|
||||||
/* Find edges next to node */
|
/* Find edges next to node */
|
||||||
if (pElemTL != NIL(TWOelem)) {
|
if (pElemTL != NULL) {
|
||||||
if (pElemTL->evalEdges[1]) {
|
if (pElemTL->evalEdges[1]) {
|
||||||
pEdgeT = pElemTL->pRightEdge;
|
pEdgeT = pElemTL->pRightEdge;
|
||||||
materT = pElemTL->elemType;
|
materT = pElemTL->elemType;
|
||||||
|
|
@ -45,7 +45,7 @@ nodeFields(TWOelem *pElem, TWOnode *pNode, double *ex, double *ey)
|
||||||
dxL = pElemTL->dx;
|
dxL = pElemTL->dx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pElemTR != NIL(TWOelem)) {
|
if (pElemTR != NULL) {
|
||||||
if (pElemTR->evalEdges[3]) {
|
if (pElemTR->evalEdges[3]) {
|
||||||
pEdgeT = pElemTR->pLeftEdge;
|
pEdgeT = pElemTR->pLeftEdge;
|
||||||
materT = pElemTR->elemType;
|
materT = pElemTR->elemType;
|
||||||
|
|
@ -57,7 +57,7 @@ nodeFields(TWOelem *pElem, TWOnode *pNode, double *ex, double *ey)
|
||||||
dxR = pElemTR->dx;
|
dxR = pElemTR->dx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pElemBR != NIL(TWOelem)) {
|
if (pElemBR != NULL) {
|
||||||
if (pElemBR->evalEdges[3]) {
|
if (pElemBR->evalEdges[3]) {
|
||||||
pEdgeB = pElemBR->pLeftEdge;
|
pEdgeB = pElemBR->pLeftEdge;
|
||||||
materB = pElemBR->elemType;
|
materB = pElemBR->elemType;
|
||||||
|
|
@ -69,7 +69,7 @@ nodeFields(TWOelem *pElem, TWOnode *pNode, double *ex, double *ey)
|
||||||
dxR = pElemBR->dx;
|
dxR = pElemBR->dx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pElemBL != NIL(TWOelem)) {
|
if (pElemBL != NULL) {
|
||||||
if (pElemBL->evalEdges[1]) {
|
if (pElemBL->evalEdges[1]) {
|
||||||
pEdgeB = pElemBL->pRightEdge;
|
pEdgeB = pElemBL->pRightEdge;
|
||||||
materB = pElemBL->elemType;
|
materB = pElemBL->elemType;
|
||||||
|
|
@ -83,13 +83,13 @@ nodeFields(TWOelem *pElem, TWOnode *pNode, double *ex, double *ey)
|
||||||
}
|
}
|
||||||
/* compute horizontal vector components */
|
/* compute horizontal vector components */
|
||||||
/* No more than one of Left Edge or Right Edge is absent */
|
/* No more than one of Left Edge or Right Edge is absent */
|
||||||
if (pEdgeL == NIL(TWOedge)) {
|
if (pEdgeL == NULL) {
|
||||||
if (pNode->nodeType == CONTACT) {
|
if (pNode->nodeType == CONTACT) {
|
||||||
*ex = -pEdgeR->dPsi / dxR;
|
*ex = -pEdgeR->dPsi / dxR;
|
||||||
} else {
|
} else {
|
||||||
*ex = 0.0;
|
*ex = 0.0;
|
||||||
}
|
}
|
||||||
} else if (pEdgeR == NIL(TWOedge)) {
|
} else if (pEdgeR == NULL) {
|
||||||
if (pNode->nodeType == CONTACT) {
|
if (pNode->nodeType == CONTACT) {
|
||||||
*ex = -pEdgeL->dPsi / dxL;
|
*ex = -pEdgeL->dPsi / dxL;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -105,13 +105,13 @@ nodeFields(TWOelem *pElem, TWOnode *pNode, double *ex, double *ey)
|
||||||
|
|
||||||
/* compute vertical vector components */
|
/* compute vertical vector components */
|
||||||
/* No more than one of Top Edge or Bottom Edge is absent */
|
/* No more than one of Top Edge or Bottom Edge is absent */
|
||||||
if (pEdgeT == NIL(TWOedge)) {
|
if (pEdgeT == NULL) {
|
||||||
if (pNode->nodeType == CONTACT) {
|
if (pNode->nodeType == CONTACT) {
|
||||||
*ey = -pEdgeB->dPsi / dyB;
|
*ey = -pEdgeB->dPsi / dyB;
|
||||||
} else {
|
} else {
|
||||||
*ey = 0.0;
|
*ey = 0.0;
|
||||||
}
|
}
|
||||||
} else if (pEdgeB == NIL(TWOedge)) {
|
} else if (pEdgeB == NULL) {
|
||||||
if (pNode->nodeType == CONTACT) {
|
if (pNode->nodeType == CONTACT) {
|
||||||
*ey = -pEdgeT->dPsi / dyT;
|
*ey = -pEdgeT->dPsi / dyT;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -62,12 +62,12 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark the semiconductor/insulator domains. */
|
/* Mark the semiconductor/insulator domains. */
|
||||||
if (pDomain == NIL(TWOdomain)) {
|
if (pDomain == NULL) {
|
||||||
fprintf(stderr, "Error: domains not defined for device\n");
|
fprintf(stderr, "Error: domains not defined for device\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
for (pD = pDomain; pD != NIL(TWOdomain); pD = pD->next) {
|
for (pD = pDomain; pD != NULL; pD = pD->next) {
|
||||||
for (pM = pMaterial; pM != NIL(TWOmaterial); pM = pM->next) {
|
for (pM = pMaterial; pM != NULL; pM = pM->next) {
|
||||||
if (pD->material == pM->id) {
|
if (pD->material == pM->id) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +81,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Now mark all the metallic domains */
|
/* Now mark all the metallic domains */
|
||||||
for (pE = pElectrode; pE != NIL(TWOelectrode); pE = pE->next) {
|
for (pE = pElectrode; pE != NULL; pE = pE->next) {
|
||||||
for (xIndex = pE->ixLo; xIndex <= pE->ixHi; xIndex++) {
|
for (xIndex = pE->ixLo; xIndex <= pE->ixHi; xIndex++) {
|
||||||
for (yIndex = pE->iyLo; yIndex <= pE->iyHi; yIndex++) {
|
for (yIndex = pE->iyLo; yIndex <= pE->iyHi; yIndex++) {
|
||||||
pNode = nodeArray[xIndex][yIndex];
|
pNode = nodeArray[xIndex][yIndex];
|
||||||
|
|
@ -140,7 +140,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
pNode = nodeArray[xIndex][yIndex];
|
pNode = nodeArray[xIndex][yIndex];
|
||||||
if (pNode->nodeType == 0) {
|
if (pNode->nodeType == 0) {
|
||||||
/* This node doesn't belong to a domain so delete it. */
|
/* This node doesn't belong to a domain so delete it. */
|
||||||
nodeArray[xIndex][yIndex] = NIL(TWOnode);
|
nodeArray[xIndex][yIndex] = NULL;
|
||||||
FREE(pNode);
|
FREE(pNode);
|
||||||
} else {
|
} else {
|
||||||
numNodes++;
|
numNodes++;
|
||||||
|
|
@ -164,8 +164,8 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
||||||
pNode = nodeArray[xIndex][yIndex];
|
pNode = nodeArray[xIndex][yIndex];
|
||||||
pNextHNode = nodeArray[xIndex + 1][yIndex];
|
pNextHNode = nodeArray[xIndex + 1][yIndex];
|
||||||
if (pNode != NIL(TWOnode) &&
|
if (pNode != NULL &&
|
||||||
pNextHNode != NIL(TWOnode)) {
|
pNextHNode != NULL) {
|
||||||
XCALLOC(pEdge, TWOedge, 1);
|
XCALLOC(pEdge, TWOedge, 1);
|
||||||
numEdges++;
|
numEdges++;
|
||||||
edgeArrayH[xIndex][yIndex] = pEdge;
|
edgeArrayH[xIndex][yIndex] = pEdge;
|
||||||
|
|
@ -182,8 +182,8 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
||||||
pNode = nodeArray[xIndex][yIndex];
|
pNode = nodeArray[xIndex][yIndex];
|
||||||
pNextVNode = nodeArray[xIndex][yIndex + 1];
|
pNextVNode = nodeArray[xIndex][yIndex + 1];
|
||||||
if (pNode != NIL(TWOnode) &&
|
if (pNode != NULL &&
|
||||||
pNextVNode != NIL(TWOnode)) {
|
pNextVNode != NULL) {
|
||||||
XCALLOC(pEdge, TWOedge, 1);
|
XCALLOC(pEdge, TWOedge, 1);
|
||||||
numEdges++;
|
numEdges++;
|
||||||
edgeArrayV[xIndex][yIndex] = pEdge;
|
edgeArrayV[xIndex][yIndex] = pEdge;
|
||||||
|
|
@ -200,10 +200,10 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
pNextHNode = nodeArray[xIndex + 1][yIndex];
|
pNextHNode = nodeArray[xIndex + 1][yIndex];
|
||||||
pNextVNode = nodeArray[xIndex][yIndex + 1];
|
pNextVNode = nodeArray[xIndex][yIndex + 1];
|
||||||
pNextDNode = nodeArray[xIndex + 1][yIndex + 1];
|
pNextDNode = nodeArray[xIndex + 1][yIndex + 1];
|
||||||
if (pNode != NIL(TWOnode) &&
|
if (pNode != NULL &&
|
||||||
pNextHNode != NIL(TWOnode) &&
|
pNextHNode != NULL &&
|
||||||
pNextVNode != NIL(TWOnode) &&
|
pNextVNode != NULL &&
|
||||||
pNextDNode != NIL(TWOnode)) {
|
pNextDNode != NULL) {
|
||||||
numElem++;
|
numElem++;
|
||||||
XCALLOC(pElem, TWOelem, 1);
|
XCALLOC(pElem, TWOelem, 1);
|
||||||
pElem->pTLNode = pNode;
|
pElem->pTLNode = pNode;
|
||||||
|
|
@ -216,7 +216,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
pElem->pRightEdge = edgeArrayV[xIndex + 1][yIndex];
|
pElem->pRightEdge = edgeArrayV[xIndex + 1][yIndex];
|
||||||
pDevice->elemArray[xIndex][yIndex] = pElem;
|
pDevice->elemArray[xIndex][yIndex] = pElem;
|
||||||
} else {
|
} else {
|
||||||
pDevice->elemArray[xIndex][yIndex] = NIL(TWOelem);
|
pDevice->elemArray[xIndex][yIndex] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -228,7 +228,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
||||||
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
||||||
pElem = pDevice->elemArray[xIndex][yIndex];
|
pElem = pDevice->elemArray[xIndex][yIndex];
|
||||||
if (pElem != NIL(TWOelem)) {
|
if (pElem != NULL) {
|
||||||
pDevice->elements[numElem++] = pElem;
|
pDevice->elements[numElem++] = pElem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -238,7 +238,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
||||||
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
||||||
pElem = pDevice->elemArray[xIndex][yIndex];
|
pElem = pDevice->elemArray[xIndex][yIndex];
|
||||||
if (pElem != NIL(TWOelem)) {
|
if (pElem != NULL) {
|
||||||
pElem->pTLNode->pBRElem = pElem;
|
pElem->pTLNode->pBRElem = pElem;
|
||||||
pElem->pTRNode->pBLElem = pElem;
|
pElem->pTRNode->pBLElem = pElem;
|
||||||
pElem->pBLNode->pTRElem = pElem;
|
pElem->pBLNode->pTRElem = pElem;
|
||||||
|
|
@ -260,8 +260,8 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Establish the element types using domain info. */
|
/* Establish the element types using domain info. */
|
||||||
for (pD = pDomain; pD != NIL(TWOdomain); pD = pD->next) {
|
for (pD = pDomain; pD != NULL; pD = pD->next) {
|
||||||
for (pM = pMaterial; pM != NIL(TWOmaterial); pM = pM->next) {
|
for (pM = pMaterial; pM != NULL; pM = pM->next) {
|
||||||
if (pD->material == pM->id) {
|
if (pD->material == pM->id) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -270,7 +270,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
for (yIndex = pD->iyLo; yIndex < pD->iyHi; yIndex++) {
|
for (yIndex = pD->iyLo; yIndex < pD->iyHi; yIndex++) {
|
||||||
for (xIndex = pD->ixLo; xIndex < pD->ixHi; xIndex++) {
|
for (xIndex = pD->ixLo; xIndex < pD->ixHi; xIndex++) {
|
||||||
pElem = pDevice->elemArray[xIndex][yIndex];
|
pElem = pDevice->elemArray[xIndex][yIndex];
|
||||||
if (pElem != NIL(TWOelem)) {
|
if (pElem != NULL) {
|
||||||
pElem->domain = pD->id;
|
pElem->domain = pD->id;
|
||||||
pElem->elemType = elemType;
|
pElem->elemType = elemType;
|
||||||
pElem->matlInfo = pM;
|
pElem->matlInfo = pM;
|
||||||
|
|
@ -283,7 +283,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
||||||
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
||||||
pElem = pDevice->elemArray[xIndex][yIndex];
|
pElem = pDevice->elemArray[xIndex][yIndex];
|
||||||
if (pElem != NIL(TWOelem)) {
|
if (pElem != NULL) {
|
||||||
for (index = 0; index <= 3; index++) {
|
for (index = 0; index <= 3; index++) {
|
||||||
pEdge = pElem->pEdges[index];
|
pEdge = pElem->pEdges[index];
|
||||||
pNode = pElem->pNodes[index];
|
pNode = pElem->pNodes[index];
|
||||||
|
|
@ -298,7 +298,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
pNode1->nodeType == SCHOTTKY) {
|
pNode1->nodeType == SCHOTTKY) {
|
||||||
/* Schottky edge */
|
/* Schottky edge */
|
||||||
pEdge->edgeType = SCHOTTKY;
|
pEdge->edgeType = SCHOTTKY;
|
||||||
} else if (pElem1 == NIL(TWOelem)) {
|
} else if (pElem1 == NULL) {
|
||||||
/* Neumann edge */
|
/* Neumann edge */
|
||||||
pEdge->edgeType = pElem->elemType;
|
pEdge->edgeType = pElem->elemType;
|
||||||
} else if (pElem->elemType != pElem1->elemType) {
|
} else if (pElem->elemType != pElem1->elemType) {
|
||||||
|
|
@ -319,7 +319,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
||||||
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
||||||
pElem = pDevice->elemArray[xIndex][yIndex];
|
pElem = pDevice->elemArray[xIndex][yIndex];
|
||||||
if (pElem != NIL(TWOelem)) {
|
if (pElem != NULL) {
|
||||||
pElem->dx = xScale[xIndex + 1] - xScale[xIndex];
|
pElem->dx = xScale[xIndex + 1] - xScale[xIndex];
|
||||||
pElem->dy = yScale[yIndex + 1] - yScale[yIndex];
|
pElem->dy = yScale[yIndex + 1] - yScale[yIndex];
|
||||||
pElem->dxOverDy = pElem->dx / pElem->dy;
|
pElem->dxOverDy = pElem->dx / pElem->dy;
|
||||||
|
|
@ -358,7 +358,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain,
|
||||||
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
for (yIndex = 1; yIndex < numYNodes; yIndex++) {
|
||||||
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
for (xIndex = 1; xIndex < numXNodes; xIndex++) {
|
||||||
pElem = pDevice->elemArray[xIndex][yIndex];
|
pElem = pDevice->elemArray[xIndex][yIndex];
|
||||||
if (pElem != NIL(TWOelem)) {
|
if (pElem != NULL) {
|
||||||
pElem->direction = 0;
|
pElem->direction = 0;
|
||||||
pElem->channel = 0;
|
pElem->channel = 0;
|
||||||
pElem->surface = FALSE;
|
pElem->surface = FALSE;
|
||||||
|
|
@ -573,7 +573,7 @@ doMobCoeffs(TWOelem *pElem, int index)
|
||||||
pEdge = pElem->pEdges[ index ];
|
pEdge = pElem->pEdges[ index ];
|
||||||
|
|
||||||
/* If neighbor is not SEMICON, assign and return */
|
/* If neighbor is not SEMICON, assign and return */
|
||||||
if ( (pNElem == NIL(TWOelem)) || (pNElem->elemType == INSULATOR) ) {
|
if ( (pNElem == NULL) || (pNElem->elemType == INSULATOR) ) {
|
||||||
if ( index == 0 || index == 3 ) {
|
if ( index == 0 || index == 3 ) {
|
||||||
pEdge->kNeg = 0.0;
|
pEdge->kNeg = 0.0;
|
||||||
pEdge->kPos = 1.0;
|
pEdge->kPos = 1.0;
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ void
|
||||||
* Don't need these pointers if SurfaceMobility isn't set.
|
* Don't need these pointers if SurfaceMobility isn't set.
|
||||||
*/
|
*/
|
||||||
if ( MobDeriv && SurfaceMobility ) {
|
if ( MobDeriv && SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel; pCh != NIL(TWOchannel);
|
for ( pCh = pDevice->pChannel; pCh != NULL;
|
||||||
pCh = pCh->next ) {
|
pCh = pCh->next ) {
|
||||||
pElem = pCh->pNElem;
|
pElem = pCh->pNElem;
|
||||||
switch (pCh->type) {
|
switch (pCh->type) {
|
||||||
|
|
@ -392,7 +392,7 @@ void
|
||||||
|
|
||||||
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
||||||
if ( MobDeriv && SurfaceMobility ) {
|
if ( MobDeriv && SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel; pCh != NIL(TWOchannel);
|
for ( pCh = pDevice->pChannel; pCh != NULL;
|
||||||
pCh = pCh->next ) {
|
pCh = pCh->next ) {
|
||||||
/* Find effective height of oxide element at interface. */
|
/* Find effective height of oxide element at interface. */
|
||||||
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
||||||
|
|
@ -406,7 +406,7 @@ void
|
||||||
TWONmobDeriv( pElem, pCh->type, ds );
|
TWONmobDeriv( pElem, pCh->type, ds );
|
||||||
pElem = pElem->pElems[ nextIndex ];
|
pElem = pElem->pElems[ nextIndex ];
|
||||||
}
|
}
|
||||||
} /* endfor pCh != NIL */
|
} /* endfor pCh != NULL */
|
||||||
} /* endif MobDeriv and SurfaceMobility */
|
} /* endif MobDeriv and SurfaceMobility */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -431,7 +431,7 @@ void
|
||||||
double pConc;
|
double pConc;
|
||||||
|
|
||||||
/* first compute the currents and derivatives */
|
/* first compute the currents and derivatives */
|
||||||
TWONcommonTerms( pDevice, FALSE, FALSE, NIL(TWOtranInfo) );
|
TWONcommonTerms( pDevice, FALSE, FALSE, NULL );
|
||||||
|
|
||||||
/* zero the matrix */
|
/* zero the matrix */
|
||||||
spClear( pDevice->matrix );
|
spClear( pDevice->matrix );
|
||||||
|
|
@ -530,7 +530,7 @@ void
|
||||||
|
|
||||||
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
||||||
if ( MobDeriv && SurfaceMobility ) {
|
if ( MobDeriv && SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel; pCh != NIL(TWOchannel);
|
for ( pCh = pDevice->pChannel; pCh != NULL;
|
||||||
pCh = pCh->next ) {
|
pCh = pCh->next ) {
|
||||||
/* Find effective height of oxide element at interface. */
|
/* Find effective height of oxide element at interface. */
|
||||||
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
||||||
|
|
@ -544,7 +544,7 @@ void
|
||||||
TWONmobDeriv( pElem, pCh->type, ds );
|
TWONmobDeriv( pElem, pCh->type, ds );
|
||||||
pElem = pElem->pElems[ nextIndex ];
|
pElem = pElem->pElems[ nextIndex ];
|
||||||
}
|
}
|
||||||
} /* endfor pCh != NIL */
|
} /* endfor pCh != NULL */
|
||||||
} /* endif MobDeriv and SurfaceMobility */
|
} /* endif MobDeriv and SurfaceMobility */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -780,7 +780,7 @@ void
|
||||||
/* DAG: calculate mobilities for channel elems */
|
/* DAG: calculate mobilities for channel elems */
|
||||||
if ( SurfaceMobility ) {
|
if ( SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel;
|
for ( pCh = pDevice->pChannel;
|
||||||
pCh != NIL(TWOchannel); pCh = pCh->next ) {
|
pCh != NULL; pCh = pCh->next ) {
|
||||||
pElem = pCh->pNElem;
|
pElem = pCh->pNElem;
|
||||||
switch (pCh->type) {
|
switch (pCh->type) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -811,7 +811,7 @@ void
|
||||||
TWONmobility( pElem, eSurf );
|
TWONmobility( pElem, eSurf );
|
||||||
pElem = pElem->pElems[ nextIndex ];
|
pElem = pElem->pElems[ nextIndex ];
|
||||||
}
|
}
|
||||||
} /* endfor pCH != NIL */
|
} /* endfor pCH != NULL */
|
||||||
} /* endif SurfaceMobility */
|
} /* endif SurfaceMobility */
|
||||||
|
|
||||||
/* calculate the current densities assuming mobility value depend on Ex,Ey*/
|
/* calculate the current densities assuming mobility value depend on Ex,Ey*/
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ void
|
||||||
* Don't need these pointers if SurfaceMobility isn't set.
|
* Don't need these pointers if SurfaceMobility isn't set.
|
||||||
*/
|
*/
|
||||||
if ( MobDeriv && SurfaceMobility ) {
|
if ( MobDeriv && SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel; pCh != NIL(TWOchannel);
|
for ( pCh = pDevice->pChannel; pCh != NULL;
|
||||||
pCh = pCh->next ) {
|
pCh = pCh->next ) {
|
||||||
pElem = pCh->pNElem;
|
pElem = pCh->pNElem;
|
||||||
switch (pCh->type) {
|
switch (pCh->type) {
|
||||||
|
|
@ -391,7 +391,7 @@ void
|
||||||
|
|
||||||
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
||||||
if ( MobDeriv && SurfaceMobility ) {
|
if ( MobDeriv && SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel; pCh != NIL(TWOchannel);
|
for ( pCh = pDevice->pChannel; pCh != NULL;
|
||||||
pCh = pCh->next ) {
|
pCh = pCh->next ) {
|
||||||
/* Find effective height of oxide element at interface. */
|
/* Find effective height of oxide element at interface. */
|
||||||
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
||||||
|
|
@ -405,7 +405,7 @@ void
|
||||||
TWOPmobDeriv( pElem, pCh->type, ds );
|
TWOPmobDeriv( pElem, pCh->type, ds );
|
||||||
pElem = pElem->pElems[ nextIndex ];
|
pElem = pElem->pElems[ nextIndex ];
|
||||||
}
|
}
|
||||||
} /* endfor pCh != NIL */
|
} /* endfor pCh != NULL */
|
||||||
} /* endif MobDeriv and SurfaceMobility */
|
} /* endif MobDeriv and SurfaceMobility */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -429,7 +429,7 @@ void
|
||||||
double nConc;
|
double nConc;
|
||||||
|
|
||||||
/* first compute the currents and derivatives */
|
/* first compute the currents and derivatives */
|
||||||
TWOPcommonTerms( pDevice, FALSE, FALSE, NIL(TWOtranInfo) );
|
TWOPcommonTerms( pDevice, FALSE, FALSE, NULL );
|
||||||
|
|
||||||
/* zero the matrix */
|
/* zero the matrix */
|
||||||
spClear( pDevice->matrix );
|
spClear( pDevice->matrix );
|
||||||
|
|
@ -528,7 +528,7 @@ void
|
||||||
|
|
||||||
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
/* Calculate the Inversion-Layer Mobility Dependent Terms in Jac. */
|
||||||
if ( MobDeriv && SurfaceMobility ) {
|
if ( MobDeriv && SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel; pCh != NIL(TWOchannel);
|
for ( pCh = pDevice->pChannel; pCh != NULL;
|
||||||
pCh = pCh->next ) {
|
pCh = pCh->next ) {
|
||||||
/* Find effective height of oxide element at interface. */
|
/* Find effective height of oxide element at interface. */
|
||||||
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
if ( pCh->type%2 == 0 ) { /* Vertical slice */
|
||||||
|
|
@ -542,7 +542,7 @@ void
|
||||||
TWOPmobDeriv( pElem, pCh->type, ds );
|
TWOPmobDeriv( pElem, pCh->type, ds );
|
||||||
pElem = pElem->pElems[ nextIndex ];
|
pElem = pElem->pElems[ nextIndex ];
|
||||||
}
|
}
|
||||||
} /* endfor pCh != NIL */
|
} /* endfor pCh != NULL */
|
||||||
} /* endif MobDeriv and SurfaceMobility */
|
} /* endif MobDeriv and SurfaceMobility */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -779,7 +779,7 @@ void
|
||||||
/* DAG: calculate mobilities for channel elems */
|
/* DAG: calculate mobilities for channel elems */
|
||||||
if ( SurfaceMobility ) {
|
if ( SurfaceMobility ) {
|
||||||
for ( pCh = pDevice->pChannel;
|
for ( pCh = pDevice->pChannel;
|
||||||
pCh != NIL(TWOchannel); pCh = pCh->next ) {
|
pCh != NULL; pCh = pCh->next ) {
|
||||||
pElem = pCh->pNElem;
|
pElem = pCh->pNElem;
|
||||||
switch (pCh->type) {
|
switch (pCh->type) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -810,7 +810,7 @@ void
|
||||||
TWOPmobility( pElem, eSurf );
|
TWOPmobility( pElem, eSurf );
|
||||||
pElem = pElem->pElems[ nextIndex ];
|
pElem = pElem->pElems[ nextIndex ];
|
||||||
}
|
}
|
||||||
} /* endfor pCH != NIL */
|
} /* endfor pCH != NULL */
|
||||||
} /* endif SurfaceMobility */
|
} /* endif SurfaceMobility */
|
||||||
|
|
||||||
/* calculate the current densities assuming mobility value depend on Ex,Ey*/
|
/* calculate the current densities assuming mobility value depend on Ex,Ey*/
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ TWOprnSolution(FILE *file, TWOdevice *pDevice, OUTPcard *output)
|
||||||
for (xIndex = 1; xIndex < pDevice->numXNodes; xIndex++) {
|
for (xIndex = 1; xIndex < pDevice->numXNodes; xIndex++) {
|
||||||
for (yIndex = 1; yIndex < pDevice->numYNodes; yIndex++) {
|
for (yIndex = 1; yIndex < pDevice->numYNodes; yIndex++) {
|
||||||
TWOelem *pElem = pDevice->elemArray[xIndex][yIndex];
|
TWOelem *pElem = pDevice->elemArray[xIndex][yIndex];
|
||||||
if (pElem != NIL(TWOelem)) {
|
if (pElem != NULL) {
|
||||||
if (refPsi == 0.0 && pElem->matlInfo->type == SEMICON) {
|
if (refPsi == 0.0 && pElem->matlInfo->type == SEMICON) {
|
||||||
refPsi = pElem->matlInfo->refPsi;
|
refPsi = pElem->matlInfo->refPsi;
|
||||||
}
|
}
|
||||||
|
|
@ -210,12 +210,12 @@ TWOprnSolution(FILE *file, TWOdevice *pDevice, OUTPcard *output)
|
||||||
for (xIndex = 1; xIndex <= pDevice->numXNodes; xIndex++) {
|
for (xIndex = 1; xIndex <= pDevice->numXNodes; xIndex++) {
|
||||||
for (yIndex = 1; yIndex <= pDevice->numYNodes; yIndex++) {
|
for (yIndex = 1; yIndex <= pDevice->numYNodes; yIndex++) {
|
||||||
pNode = nodeArray[xIndex][yIndex];
|
pNode = nodeArray[xIndex][yIndex];
|
||||||
if (pNode != NIL(TWOnode)) {
|
if (pNode != NULL) {
|
||||||
TWOelem *pElem = NULL;
|
TWOelem *pElem = NULL;
|
||||||
/* Find the element to which this node belongs. */
|
/* Find the element to which this node belongs. */
|
||||||
for (index = 0; index < 4; index++) {
|
for (index = 0; index < 4; index++) {
|
||||||
pElem = pNode->pElems[index];
|
pElem = pNode->pElems[index];
|
||||||
if (pElem != NIL(TWOelem) && pElem->evalNodes[(index + 2) % 4])
|
if (pElem != NULL && pElem->evalNodes[(index + 2) % 4])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
nodeFields(pElem, pNode, &ex, &ey);
|
nodeFields(pElem, pNode, &ex, &ey);
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ void NUMD2project(TWOdevice *pDevice, double delV)
|
||||||
}
|
}
|
||||||
incVpn = pDevice->dcDeltaSolution;
|
incVpn = pDevice->dcDeltaSolution;
|
||||||
storeNewRhs( pDevice, pContact );
|
storeNewRhs( pDevice, pContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVpn, NIL(spREAL), NIL(spREAL) );
|
spSolve( pDevice->matrix, pDevice->rhs, incVpn, NULL, NULL );
|
||||||
|
|
||||||
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
||||||
pElem = pDevice->elements[ eIndex ];
|
pElem = pDevice->elements[ eIndex ];
|
||||||
|
|
@ -131,7 +131,7 @@ void NBJT2project(TWOdevice *pDevice, double delVce, double delVbe)
|
||||||
if ( ABS( delVce ) > MIN_DELV ) {
|
if ( ABS( delVce ) > MIN_DELV ) {
|
||||||
incVce = pDevice->dcDeltaSolution;
|
incVce = pDevice->dcDeltaSolution;
|
||||||
storeNewRhs( pDevice, pColContact );
|
storeNewRhs( pDevice, pColContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVce, NIL(spREAL), NIL(spREAL));
|
spSolve( pDevice->matrix, pDevice->rhs, incVce, NULL, NULL);
|
||||||
|
|
||||||
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
||||||
pElem = pDevice->elements[ eIndex ];
|
pElem = pDevice->elements[ eIndex ];
|
||||||
|
|
@ -175,7 +175,7 @@ void NBJT2project(TWOdevice *pDevice, double delVce, double delVbe)
|
||||||
if ( ABS( delVbe ) > MIN_DELV ) {
|
if ( ABS( delVbe ) > MIN_DELV ) {
|
||||||
incVbe = pDevice->copiedSolution;
|
incVbe = pDevice->copiedSolution;
|
||||||
storeNewRhs( pDevice, pBaseContact );
|
storeNewRhs( pDevice, pBaseContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVbe, NIL(spREAL), NIL(spREAL));
|
spSolve( pDevice->matrix, pDevice->rhs, incVbe, NULL, NULL);
|
||||||
|
|
||||||
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
||||||
pElem = pDevice->elements[ eIndex ];
|
pElem = pDevice->elements[ eIndex ];
|
||||||
|
|
@ -265,7 +265,7 @@ void NUMOSproject(TWOdevice *pDevice, double delVdb, double delVsb,
|
||||||
|
|
||||||
incVdb = pDevice->dcDeltaSolution;
|
incVdb = pDevice->dcDeltaSolution;
|
||||||
storeNewRhs( pDevice, pDContact );
|
storeNewRhs( pDevice, pDContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVdb, NIL(spREAL), NIL(spREAL));
|
spSolve( pDevice->matrix, pDevice->rhs, incVdb, NULL, NULL);
|
||||||
|
|
||||||
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
||||||
pElem = pDevice->elements[ eIndex ];
|
pElem = pDevice->elements[ eIndex ];
|
||||||
|
|
@ -310,7 +310,7 @@ void NUMOSproject(TWOdevice *pDevice, double delVdb, double delVsb,
|
||||||
|
|
||||||
incVsb = pDevice->dcDeltaSolution;
|
incVsb = pDevice->dcDeltaSolution;
|
||||||
storeNewRhs( pDevice, pSContact );
|
storeNewRhs( pDevice, pSContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVsb, NIL(spREAL), NIL(spREAL));
|
spSolve( pDevice->matrix, pDevice->rhs, incVsb, NULL, NULL);
|
||||||
|
|
||||||
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
||||||
pElem = pDevice->elements[ eIndex ];
|
pElem = pDevice->elements[ eIndex ];
|
||||||
|
|
@ -354,7 +354,7 @@ void NUMOSproject(TWOdevice *pDevice, double delVdb, double delVsb,
|
||||||
|
|
||||||
incVgb = pDevice->dcDeltaSolution;
|
incVgb = pDevice->dcDeltaSolution;
|
||||||
storeNewRhs( pDevice, pGContact );
|
storeNewRhs( pDevice, pGContact );
|
||||||
spSolve( pDevice->matrix, pDevice->rhs, incVgb, NIL(spREAL), NIL(spREAL));
|
spSolve( pDevice->matrix, pDevice->rhs, incVgb, NULL, NULL);
|
||||||
|
|
||||||
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) {
|
||||||
pElem = pDevice->elements[ eIndex ];
|
pElem = pDevice->elements[ eIndex ];
|
||||||
|
|
@ -610,7 +610,7 @@ void storeNewRhs(TWOdevice *pDevice, TWOcontact *pContact)
|
||||||
pNode = pContact->pNodes[ index ];
|
pNode = pContact->pNodes[ index ];
|
||||||
for ( i = 0; i <= 3; i++ ) {
|
for ( i = 0; i <= 3; i++ ) {
|
||||||
pElem = pNode->pElems[ i ];
|
pElem = pNode->pElems[ i ];
|
||||||
if ( pElem != NIL(TWOelem)) {
|
if ( pElem != NULL) {
|
||||||
/* found an element to which this node belongs */
|
/* found an element to which this node belongs */
|
||||||
switch ( i ) {
|
switch ( i ) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ TWOreadState(TWOdevice *pDevice, char *fileName, int numVolts, double *pV1,
|
||||||
for (xIndex = 1; xIndex < pDevice->numXNodes; xIndex++) {
|
for (xIndex = 1; xIndex < pDevice->numXNodes; xIndex++) {
|
||||||
for (yIndex = 1; yIndex < pDevice->numYNodes; yIndex++) {
|
for (yIndex = 1; yIndex < pDevice->numYNodes; yIndex++) {
|
||||||
pElem = pDevice->elemArray[xIndex][yIndex];
|
pElem = pDevice->elemArray[xIndex][yIndex];
|
||||||
if (pElem != NIL(TWOelem)) {
|
if (pElem != NULL) {
|
||||||
if (refPsi == 0.0 && pElem->matlInfo->type == SEMICON) {
|
if (refPsi == 0.0 && pElem->matlInfo->type == SEMICON) {
|
||||||
refPsi = pElem->matlInfo->refPsi;
|
refPsi = pElem->matlInfo->refPsi;
|
||||||
}
|
}
|
||||||
|
|
@ -94,7 +94,7 @@ TWOreadState(TWOdevice *pDevice, char *fileName, int numVolts, double *pV1,
|
||||||
for (yIndex = 1; yIndex <= pDevice->numYNodes; yIndex++) {
|
for (yIndex = 1; yIndex <= pDevice->numYNodes; yIndex++) {
|
||||||
pNode = nodeArray[xIndex][yIndex];
|
pNode = nodeArray[xIndex][yIndex];
|
||||||
index++;
|
index++;
|
||||||
if (pNode != NIL(TWOnode)) {
|
if (pNode != NULL) {
|
||||||
pNode->psi = psiData[index-1]/VNorm + refPsi;
|
pNode->psi = psiData[index-1]/VNorm + refPsi;
|
||||||
pNode->nConc = nData[index-1]/NNorm;
|
pNode->nConc = nData[index-1]/NNorm;
|
||||||
pNode->pConc = pData[index-1]/NNorm;
|
pNode->pConc = pData[index-1]/NNorm;
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ static void
|
||||||
/* Find this node's owner element. */
|
/* Find this node's owner element. */
|
||||||
for ( i = 0; i <= 3; i++ ) {
|
for ( i = 0; i <= 3; i++ ) {
|
||||||
pElem = pNode->pElems[ i ];
|
pElem = pNode->pElems[ i ];
|
||||||
if ( pElem != NIL(TWOelem) && pElem->evalNodes[ (i+2)%4 ] ) {
|
if ( pElem != NULL && pElem->evalNodes[ (i+2)%4 ] ) {
|
||||||
break; /* got it */
|
break; /* got it */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ void TWOsetup(TWOdevice *pDevice)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( pC = pDevice->pFirstContact; pC != NIL(TWOcontact); pC = pC->next ) {
|
for ( pC = pDevice->pFirstContact; pC != NULL; pC = pC->next ) {
|
||||||
numContactNodes = pC->numNodes;
|
numContactNodes = pC->numNodes;
|
||||||
for ( index = 0; index < numContactNodes; index++ ) {
|
for ( index = 0; index < numContactNodes; index++ ) {
|
||||||
pNode = pC->pNodes[ index ];
|
pNode = pC->pNodes[ index ];
|
||||||
|
|
@ -169,7 +169,7 @@ TWOcopyBCinfo(TWOdevice *pDevice, TWOelem *pElem, BDRYcard *card, int index )
|
||||||
area = 0.0;
|
area = 0.0;
|
||||||
for (eIndex = 0; eIndex <= 3; eIndex++) {
|
for (eIndex = 0; eIndex <= 3; eIndex++) {
|
||||||
pNElem = pNode->pElems[eIndex];
|
pNElem = pNode->pElems[eIndex];
|
||||||
if (pNElem != NIL(TWOelem) && pElem->elemType == SEMICON) {
|
if (pNElem != NULL && pElem->elemType == SEMICON) {
|
||||||
area += 0.25 * pElem->dx * pElem->dy;
|
area += 0.25 * pElem->dx * pElem->dy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -205,12 +205,12 @@ TWOcopyBCinfo(TWOdevice *pDevice, TWOelem *pElem, BDRYcard *card, int index )
|
||||||
newChannel->pSeed = pElem;
|
newChannel->pSeed = pElem;
|
||||||
newChannel->pNElem = pNElem;
|
newChannel->pNElem = pNElem;
|
||||||
newChannel->type = index;
|
newChannel->type = index;
|
||||||
if (pDevice->pChannel != NIL(TWOchannel)) {
|
if (pDevice->pChannel != NULL) {
|
||||||
newChannel->id = pDevice->pChannel->id + 1;
|
newChannel->id = pDevice->pChannel->id + 1;
|
||||||
newChannel->next = pDevice->pChannel;
|
newChannel->next = pDevice->pChannel;
|
||||||
} else {
|
} else {
|
||||||
newChannel->id = 1;
|
newChannel->id = 1;
|
||||||
newChannel->next = NIL(TWOchannel);
|
newChannel->next = NULL;
|
||||||
}
|
}
|
||||||
pDevice->pChannel = newChannel;
|
pDevice->pChannel = newChannel;
|
||||||
|
|
||||||
|
|
@ -252,11 +252,11 @@ void TWOsetBCparams(TWOdevice *pDevice, BDRYcard *cardList)
|
||||||
TWOelem *pElem, *pNElem;
|
TWOelem *pElem, *pNElem;
|
||||||
BDRYcard *card;
|
BDRYcard *card;
|
||||||
|
|
||||||
for ( card = cardList; card != NIL(BDRYcard); card = card->BDRYnextCard ) {
|
for ( card = cardList; card != NULL; card = card->BDRYnextCard ) {
|
||||||
for (xIndex = card->BDRYixLow; xIndex < card->BDRYixHigh; xIndex++) {
|
for (xIndex = card->BDRYixLow; xIndex < card->BDRYixHigh; xIndex++) {
|
||||||
for (yIndex = card->BDRYiyLow; yIndex < card->BDRYiyHigh; yIndex++) {
|
for (yIndex = card->BDRYiyLow; yIndex < card->BDRYiyHigh; yIndex++) {
|
||||||
pElem = pDevice->elemArray[ xIndex ][ yIndex ];
|
pElem = pDevice->elemArray[ xIndex ][ yIndex ];
|
||||||
if (pElem != NIL(TWOelem)) {
|
if (pElem != NULL) {
|
||||||
if (pElem->domain == card->BDRYdomain) {
|
if (pElem->domain == card->BDRYdomain) {
|
||||||
for (index = 0; index <= 3; index++) {
|
for (index = 0; index <= 3; index++) {
|
||||||
if (pElem->evalEdges[index]) {
|
if (pElem->evalEdges[index]) {
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ TWOdcSolve(TWOdevice *pDevice, int iterationLimit, BOOLEAN newSolver,
|
||||||
|
|
||||||
/* SOLVE */
|
/* SOLVE */
|
||||||
startTime = SPfrontEnd->IFseconds();
|
startTime = SPfrontEnd->IFseconds();
|
||||||
spSolve(pDevice->matrix, rhs, delta, NIL(spREAL), NIL(spREAL));
|
spSolve(pDevice->matrix, rhs, delta, NULL, NULL);
|
||||||
solveTime += SPfrontEnd->IFseconds() - startTime;
|
solveTime += SPfrontEnd->IFseconds() - startTime;
|
||||||
|
|
||||||
/* UPDATE */
|
/* UPDATE */
|
||||||
|
|
@ -1120,7 +1120,7 @@ TWOnuNorm(TWOdevice *pDevice)
|
||||||
/* the LU Decomposed matrix is available. use it to calculate x */
|
/* the LU Decomposed matrix is available. use it to calculate x */
|
||||||
|
|
||||||
spSolve(pDevice->matrix, pDevice->rhs, pDevice->rhsImag,
|
spSolve(pDevice->matrix, pDevice->rhs, pDevice->rhsImag,
|
||||||
NIL(spREAL), NIL(spREAL));
|
NULL, NULL);
|
||||||
|
|
||||||
/* the solution is in the rhsImag vector */
|
/* the solution is in the rhsImag vector */
|
||||||
/* compute L2-norm of the rhsImag vector */
|
/* compute L2-norm of the rhsImag vector */
|
||||||
|
|
@ -1179,7 +1179,7 @@ TWOjacCheck(TWOdevice *pDevice, BOOLEAN tranAnalysis, TWOtranInfo *info)
|
||||||
for (rIndex = 1; rIndex <= pDevice->numEqns; rIndex++) {
|
for (rIndex = 1; rIndex <= pDevice->numEqns; rIndex++) {
|
||||||
diff = (pDevice->rhsImag[rIndex] - pDevice->rhs[rIndex]) / del;
|
diff = (pDevice->rhsImag[rIndex] - pDevice->rhs[rIndex]) / del;
|
||||||
dptr = spFindElement(pDevice->matrix, rIndex, index);
|
dptr = spFindElement(pDevice->matrix, rIndex, index);
|
||||||
if (dptr != NIL(double)) {
|
if (dptr != NULL) {
|
||||||
tol = (1e-4 * pDevice->abstol) + (1e-2 * MAX(ABS(diff), ABS(*dptr)));
|
tol = (1e-4 * pDevice->abstol) + (1e-2 * MAX(ABS(diff), ABS(*dptr)));
|
||||||
if ((diff != 0.0) && (ABS(diff - *dptr) > tol)) {
|
if ((diff != 0.0) && (ABS(diff - *dptr) > tol)) {
|
||||||
fprintf(stderr, "Mismatch[%d][%d]: FD = %11.4e, AJ = %11.4e\n\t FD-AJ = %11.4e vs. %11.4e\n",
|
fprintf(stderr, "Mismatch[%d][%d]: FD = %11.4e, AJ = %11.4e\n\t FD-AJ = %11.4e vs. %11.4e\n",
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@
|
||||||
#define SWAP(type, a, b) {type swapx; swapx = a; a = b; b = swapx;}
|
#define SWAP(type, a, b) {type swapx; swapx = a; a = b; b = swapx;}
|
||||||
|
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
#define ABORT() fflush(stderr);fflush(stdout);abort();
|
#define ABORT() fflush(stderr);fflush(stdout);abort();
|
||||||
|
|
||||||
#define MERROR(CODE, MESSAGE) \
|
#define MERROR(CODE, MESSAGE) \
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
#include "ngspice/meshext.h"
|
#include "ngspice/meshext.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
#define TSCALLOC(var, size, type)\
|
#define TSCALLOC(var, size, type)\
|
||||||
if (size && (var =(type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
if (size && (var =(type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
||||||
return(E_NOMEM);\
|
return(E_NOMEM);\
|
||||||
|
|
@ -40,11 +39,11 @@ NBJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
int error;
|
int error;
|
||||||
int xMeshSize;
|
int xMeshSize;
|
||||||
ONEdevice *pDevice;
|
ONEdevice *pDevice;
|
||||||
ONEcoord *xCoordList = NIL(ONEcoord);
|
ONEcoord *xCoordList = NULL;
|
||||||
ONEdomain *domainList = NIL(ONEdomain);
|
ONEdomain *domainList = NULL;
|
||||||
DOPprofile *profileList = NIL(DOPprofile);
|
DOPprofile *profileList = NULL;
|
||||||
DOPtable *dopTableList = NIL(DOPtable);
|
DOPtable *dopTableList = NULL;
|
||||||
ONEmaterial *pM, *pMaterial = NULL, *materialList = NIL(ONEmaterial);
|
ONEmaterial *pM, *pMaterial = NULL, *materialList = NULL;
|
||||||
double startTime;
|
double startTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -134,15 +133,15 @@ NBJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
if ((error = MESHsetup('x', model->NBJTxMeshes, &xCoordList, &xMeshSize)) != 0)
|
if ((error = MESHsetup('x', model->NBJTxMeshes, &xCoordList, &xMeshSize)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
if ((error = DOMNsetup(model->NBJTdomains, &domainList,
|
if ((error = DOMNsetup(model->NBJTdomains, &domainList,
|
||||||
xCoordList, NIL(ONEcoord), materialList)) != 0)
|
xCoordList, NULL, materialList)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
if ((error = BDRYsetup(model->NBJTboundaries,
|
if ((error = BDRYsetup(model->NBJTboundaries,
|
||||||
xCoordList, NIL(ONEcoord), domainList)) != 0)
|
xCoordList, NULL, domainList)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
if ((error = CONTsetup(model->NBJTcontacts, NULL)) != 0)
|
if ((error = CONTsetup(model->NBJTcontacts, NULL)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
if ((error = DOPsetup(model->NBJTdopings, &profileList,
|
if ((error = DOPsetup(model->NBJTdopings, &profileList,
|
||||||
&dopTableList, xCoordList, NIL(ONEcoord))) != 0)
|
&dopTableList, xCoordList, NULL)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
model->NBJTmatlInfo = materialList;
|
model->NBJTmatlInfo = materialList;
|
||||||
model->NBJTprofiles = profileList;
|
model->NBJTprofiles = profileList;
|
||||||
|
|
@ -187,13 +186,13 @@ NBJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
pDevice->numNodes = xMeshSize;
|
pDevice->numNodes = xMeshSize;
|
||||||
pDevice->abstol = methods->METHdabstol;
|
pDevice->abstol = methods->METHdabstol;
|
||||||
pDevice->reltol = methods->METHdreltol;
|
pDevice->reltol = methods->METHdreltol;
|
||||||
pDevice->rhsImag = NIL(double);
|
pDevice->rhsImag = NULL;
|
||||||
TSCALLOC(pDevice->elemArray, pDevice->numNodes, ONEelem *);
|
TSCALLOC(pDevice->elemArray, pDevice->numNodes, ONEelem *);
|
||||||
|
|
||||||
/* Create a copy of material data that can change with temperature. */
|
/* Create a copy of material data that can change with temperature. */
|
||||||
pDevice->pMaterials = NIL(ONEmaterial);
|
pDevice->pMaterials = NULL;
|
||||||
for (pM = materialList; pM != NIL(ONEmaterial); pM = pM->next) {
|
for (pM = materialList; pM != NULL; pM = pM->next) {
|
||||||
if (pDevice->pMaterials == NIL(ONEmaterial)) {
|
if (pDevice->pMaterials == NULL) {
|
||||||
TSCALLOC(pMaterial, 1, ONEmaterial);
|
TSCALLOC(pMaterial, 1, ONEmaterial);
|
||||||
pDevice->pMaterials = pMaterial;
|
pDevice->pMaterials = pMaterial;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -202,7 +201,7 @@ NBJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
}
|
}
|
||||||
/* Copy everything, then fix the incorrect pointer. */
|
/* Copy everything, then fix the incorrect pointer. */
|
||||||
bcopy(pM, pMaterial, sizeof(ONEmaterial));
|
bcopy(pM, pMaterial, sizeof(ONEmaterial));
|
||||||
pMaterial->next = NIL(ONEmaterial);
|
pMaterial->next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* generate the mesh structure for the device */
|
/* generate the mesh structure for the device */
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ Author: 1992 David A. Gates, U. C. Berkeley CAD Group
|
||||||
#include "ngspice/cidersupt.h"
|
#include "ngspice/cidersupt.h"
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
extern int ONEdcDebug;
|
extern int ONEdcDebug;
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -45,7 +44,7 @@ NBJTtemp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
if (!options->OPTNtnomGiven) {
|
if (!options->OPTNtnomGiven) {
|
||||||
options->OPTNtnom = ckt->CKTnomTemp;
|
options->OPTNtnom = ckt->CKTnomTemp;
|
||||||
}
|
}
|
||||||
for (pM = model->NBJTmatlInfo; pM != NIL(ONEmaterial); pM = pM->next) {
|
for (pM = model->NBJTmatlInfo; pM != NULL; pM = pM->next) {
|
||||||
pM->tnom = options->OPTNtnom;
|
pM->tnom = options->OPTNtnom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group
|
||||||
#include "ngspice/cidersupt.h"
|
#include "ngspice/cidersupt.h"
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
#define TSCALLOC(var, size, type)\
|
#define TSCALLOC(var, size, type)\
|
||||||
if (size && (var = (type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
if (size && (var = (type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
||||||
return(E_NOMEM);\
|
return(E_NOMEM);\
|
||||||
|
|
@ -41,13 +40,13 @@ NBJT2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
int error, xIndex;
|
int error, xIndex;
|
||||||
int xMeshSize, yMeshSize;
|
int xMeshSize, yMeshSize;
|
||||||
TWOdevice *pDevice;
|
TWOdevice *pDevice;
|
||||||
TWOcoord *xCoordList = NIL(TWOcoord);
|
TWOcoord *xCoordList = NULL;
|
||||||
TWOcoord *yCoordList = NIL(TWOcoord);
|
TWOcoord *yCoordList = NULL;
|
||||||
TWOdomain *domainList = NIL(TWOdomain);
|
TWOdomain *domainList = NULL;
|
||||||
TWOelectrode *electrodeList = NIL(TWOelectrode);
|
TWOelectrode *electrodeList = NULL;
|
||||||
TWOmaterial *pM, *pMaterial = NIL(TWOmaterial), *materialList = NIL(TWOmaterial);
|
TWOmaterial *pM, *pMaterial = NULL, *materialList = NULL;
|
||||||
DOPprofile *profileList = NIL(DOPprofile);
|
DOPprofile *profileList = NULL;
|
||||||
DOPtable *dopTableList = NIL(DOPtable);
|
DOPtable *dopTableList = NULL;
|
||||||
double startTime;
|
double startTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -206,16 +205,16 @@ NBJT2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
pDevice->yScale = MESHmkArray(yCoordList, yMeshSize);
|
pDevice->yScale = MESHmkArray(yCoordList, yMeshSize);
|
||||||
pDevice->abstol = methods->METHdabstol;
|
pDevice->abstol = methods->METHdabstol;
|
||||||
pDevice->reltol = methods->METHdreltol;
|
pDevice->reltol = methods->METHdreltol;
|
||||||
pDevice->rhsImag = NIL(double);
|
pDevice->rhsImag = NULL;
|
||||||
TSCALLOC(pDevice->elemArray, pDevice->numXNodes, TWOelem **);
|
TSCALLOC(pDevice->elemArray, pDevice->numXNodes, TWOelem **);
|
||||||
for (xIndex = 1; xIndex < pDevice->numXNodes; xIndex++) {
|
for (xIndex = 1; xIndex < pDevice->numXNodes; xIndex++) {
|
||||||
TSCALLOC(pDevice->elemArray[xIndex], pDevice->numYNodes, TWOelem *);
|
TSCALLOC(pDevice->elemArray[xIndex], pDevice->numYNodes, TWOelem *);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a copy of material data that can change with temperature. */
|
/* Create a copy of material data that can change with temperature. */
|
||||||
pDevice->pMaterials = NIL(TWOmaterial);
|
pDevice->pMaterials = NULL;
|
||||||
for (pM = materialList; pM != NIL(TWOmaterial); pM = pM->next) {
|
for (pM = materialList; pM != NULL; pM = pM->next) {
|
||||||
if (pDevice->pMaterials == NIL(TWOmaterial)) {
|
if (pDevice->pMaterials == NULL) {
|
||||||
TSCALLOC(pMaterial, 1, TWOmaterial);
|
TSCALLOC(pMaterial, 1, TWOmaterial);
|
||||||
pDevice->pMaterials = pMaterial;
|
pDevice->pMaterials = pMaterial;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -224,7 +223,7 @@ NBJT2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
}
|
}
|
||||||
/* Copy everything, then fix the incorrect pointer. */
|
/* Copy everything, then fix the incorrect pointer. */
|
||||||
bcopy(pM, pMaterial, sizeof(TWOmaterial));
|
bcopy(pM, pMaterial, sizeof(TWOmaterial));
|
||||||
pMaterial->next = NIL(TWOmaterial);
|
pMaterial->next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate the mesh structure for the device. */
|
/* Generate the mesh structure for the device. */
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ Author: 1992 David A. Gates, U. C. Berkeley CAD Group
|
||||||
#include "ngspice/cidersupt.h"
|
#include "ngspice/cidersupt.h"
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
|
|
||||||
int
|
int
|
||||||
NBJT2temp(GENmodel *inModel, CKTcircuit *ckt)
|
NBJT2temp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
@ -43,7 +42,7 @@ NBJT2temp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
if (!options->OPTNtnomGiven) {
|
if (!options->OPTNtnomGiven) {
|
||||||
options->OPTNtnom = ckt->CKTnomTemp;
|
options->OPTNtnom = ckt->CKTnomTemp;
|
||||||
}
|
}
|
||||||
for (pM = model->NBJT2matlInfo; pM != NIL(TWOmaterial);
|
for (pM = model->NBJT2matlInfo; pM != NULL;
|
||||||
pM = pM->next) {
|
pM = pM->next) {
|
||||||
pM->tnom = options->OPTNtnom;
|
pM->tnom = options->OPTNtnom;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ University of Science and Technology of China
|
||||||
#include "ngspice/sperror.h"
|
#include "ngspice/sperror.h"
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
#define TSCALLOC(var, size, type)\
|
#define TSCALLOC(var, size, type)\
|
||||||
if (size && (var =(type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
if (size && (var =(type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
||||||
return(E_NOMEM);\
|
return(E_NOMEM);\
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ Author: 1992 David A. Gates, U. C. Berkeley CAD Group
|
||||||
#include "ngspice/sperror.h"
|
#include "ngspice/sperror.h"
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
|
|
||||||
int
|
int
|
||||||
NDEVtemp(
|
NDEVtemp(
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
#include "ngspice/meshext.h"
|
#include "ngspice/meshext.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
#define TSCALLOC(var, size, type)\
|
#define TSCALLOC(var, size, type)\
|
||||||
if (size && (var =(type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
if (size && (var =(type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
||||||
return(E_NOMEM);\
|
return(E_NOMEM);\
|
||||||
|
|
@ -41,11 +40,11 @@ NUMDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
int error;
|
int error;
|
||||||
int xMeshSize;
|
int xMeshSize;
|
||||||
ONEdevice *pDevice;
|
ONEdevice *pDevice;
|
||||||
ONEcoord *xCoordList = NIL(ONEcoord);
|
ONEcoord *xCoordList = NULL;
|
||||||
ONEdomain *domainList = NIL(ONEdomain);
|
ONEdomain *domainList = NULL;
|
||||||
ONEmaterial *pM, *pMaterial = NIL(ONEmaterial), *materialList = NIL(ONEmaterial);
|
ONEmaterial *pM, *pMaterial = NULL, *materialList = NULL;
|
||||||
DOPprofile *profileList = NIL(DOPprofile);
|
DOPprofile *profileList = NULL;
|
||||||
DOPtable *dopTableList = NIL(DOPtable);
|
DOPtable *dopTableList = NULL;
|
||||||
double startTime;
|
double startTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -129,15 +128,15 @@ NUMDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
if ((error = MESHsetup('x', model->NUMDxMeshes, &xCoordList, &xMeshSize)) != 0)
|
if ((error = MESHsetup('x', model->NUMDxMeshes, &xCoordList, &xMeshSize)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
if ((error = DOMNsetup(model->NUMDdomains, &domainList,
|
if ((error = DOMNsetup(model->NUMDdomains, &domainList,
|
||||||
xCoordList, NIL(ONEcoord), materialList)) != 0)
|
xCoordList, NULL, materialList)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
if ((error = BDRYsetup(model->NUMDboundaries,
|
if ((error = BDRYsetup(model->NUMDboundaries,
|
||||||
xCoordList, NIL(ONEcoord), domainList)) != 0)
|
xCoordList, NULL, domainList)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
if ((error = CONTsetup(model->NUMDcontacts, NULL)) != 0)
|
if ((error = CONTsetup(model->NUMDcontacts, NULL)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
if ((error = DOPsetup(model->NUMDdopings, &profileList,
|
if ((error = DOPsetup(model->NUMDdopings, &profileList,
|
||||||
&dopTableList, xCoordList, NIL(ONEcoord))) != 0)
|
&dopTableList, xCoordList, NULL)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
model->NUMDmatlInfo = materialList;
|
model->NUMDmatlInfo = materialList;
|
||||||
model->NUMDprofiles = profileList;
|
model->NUMDprofiles = profileList;
|
||||||
|
|
@ -182,13 +181,13 @@ NUMDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
pDevice->numNodes = xMeshSize;
|
pDevice->numNodes = xMeshSize;
|
||||||
pDevice->abstol = methods->METHdabstol;
|
pDevice->abstol = methods->METHdabstol;
|
||||||
pDevice->reltol = methods->METHdreltol;
|
pDevice->reltol = methods->METHdreltol;
|
||||||
pDevice->rhsImag = NIL(double);
|
pDevice->rhsImag = NULL;
|
||||||
TSCALLOC(pDevice->elemArray, pDevice->numNodes, ONEelem *);
|
TSCALLOC(pDevice->elemArray, pDevice->numNodes, ONEelem *);
|
||||||
|
|
||||||
/* Create a copy of material data that can change with temperature. */
|
/* Create a copy of material data that can change with temperature. */
|
||||||
pDevice->pMaterials = NIL(ONEmaterial);
|
pDevice->pMaterials = NULL;
|
||||||
for (pM = materialList; pM != NIL(ONEmaterial); pM = pM->next) {
|
for (pM = materialList; pM != NULL; pM = pM->next) {
|
||||||
if (pDevice->pMaterials == NIL(ONEmaterial)) {
|
if (pDevice->pMaterials == NULL) {
|
||||||
TSCALLOC(pMaterial, 1, ONEmaterial);
|
TSCALLOC(pMaterial, 1, ONEmaterial);
|
||||||
pDevice->pMaterials = pMaterial;
|
pDevice->pMaterials = pMaterial;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -197,7 +196,7 @@ NUMDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
}
|
}
|
||||||
/* Copy everything, then fix the incorrect pointer. */
|
/* Copy everything, then fix the incorrect pointer. */
|
||||||
bcopy(pM, pMaterial, sizeof(ONEmaterial));
|
bcopy(pM, pMaterial, sizeof(ONEmaterial));
|
||||||
pMaterial->next = NIL(ONEmaterial);
|
pMaterial->next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* generate the mesh structure for the device */
|
/* generate the mesh structure for the device */
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ Author: 1992 David A. Gates, U. C. Berkeley CAD Group
|
||||||
#include "ngspice/cidersupt.h"
|
#include "ngspice/cidersupt.h"
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
|
|
||||||
int
|
int
|
||||||
NUMDtemp(GENmodel *inModel, CKTcircuit *ckt)
|
NUMDtemp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
@ -42,7 +41,7 @@ NUMDtemp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
if (!options->OPTNtnomGiven) {
|
if (!options->OPTNtnomGiven) {
|
||||||
options->OPTNtnom = ckt->CKTnomTemp;
|
options->OPTNtnom = ckt->CKTnomTemp;
|
||||||
}
|
}
|
||||||
for (pM = model->NUMDmatlInfo; pM != NIL(ONEmaterial); pM = pM->next) {
|
for (pM = model->NUMDmatlInfo; pM != NULL; pM = pM->next) {
|
||||||
pM->tnom = options->OPTNtnom;
|
pM->tnom = options->OPTNtnom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group
|
||||||
#include "ngspice/ciderinp.h"
|
#include "ngspice/ciderinp.h"
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
#define TSCALLOC(var, size, type)\
|
#define TSCALLOC(var, size, type)\
|
||||||
if (size && (var =(type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
if (size && (var =(type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
||||||
return(E_NOMEM);\
|
return(E_NOMEM);\
|
||||||
|
|
@ -41,13 +40,13 @@ NUMD2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
int error, xIndex;
|
int error, xIndex;
|
||||||
int xMeshSize, yMeshSize;
|
int xMeshSize, yMeshSize;
|
||||||
TWOdevice *pDevice;
|
TWOdevice *pDevice;
|
||||||
TWOcoord *xCoordList = NIL(TWOcoord);
|
TWOcoord *xCoordList = NULL;
|
||||||
TWOcoord *yCoordList = NIL(TWOcoord);
|
TWOcoord *yCoordList = NULL;
|
||||||
TWOdomain *domainList = NIL(TWOdomain);
|
TWOdomain *domainList = NULL;
|
||||||
TWOelectrode *electrodeList = NIL(TWOelectrode);
|
TWOelectrode *electrodeList = NULL;
|
||||||
TWOmaterial *pM, *pMaterial = NIL(TWOmaterial), *materialList = NIL(TWOmaterial);
|
TWOmaterial *pM, *pMaterial = NULL, *materialList = NULL;
|
||||||
DOPprofile *profileList = NIL(DOPprofile);
|
DOPprofile *profileList = NULL;
|
||||||
DOPtable *dopTableList = NIL(DOPtable);
|
DOPtable *dopTableList = NULL;
|
||||||
double startTime;
|
double startTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -211,9 +210,9 @@ NUMD2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a copy of material data that can change with temperature. */
|
/* Create a copy of material data that can change with temperature. */
|
||||||
pDevice->pMaterials = NIL(TWOmaterial);
|
pDevice->pMaterials = NULL;
|
||||||
for (pM = materialList; pM != NIL(TWOmaterial); pM = pM->next) {
|
for (pM = materialList; pM != NULL; pM = pM->next) {
|
||||||
if (pDevice->pMaterials == NIL(TWOmaterial)) {
|
if (pDevice->pMaterials == NULL) {
|
||||||
TSCALLOC(pMaterial, 1, TWOmaterial);
|
TSCALLOC(pMaterial, 1, TWOmaterial);
|
||||||
pDevice->pMaterials = pMaterial;
|
pDevice->pMaterials = pMaterial;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -222,7 +221,7 @@ NUMD2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
}
|
}
|
||||||
/* Copy everything, then fix the incorrect pointer. */
|
/* Copy everything, then fix the incorrect pointer. */
|
||||||
bcopy(pM, pMaterial, sizeof(TWOmaterial));
|
bcopy(pM, pMaterial, sizeof(TWOmaterial));
|
||||||
pMaterial->next = NIL(TWOmaterial);
|
pMaterial->next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate the mesh structure for the device. */
|
/* Generate the mesh structure for the device. */
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ Author: 1992 David A. Gates, U. C. Berkeley CAD Group
|
||||||
#include "ngspice/cidersupt.h"
|
#include "ngspice/cidersupt.h"
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
|
|
||||||
int
|
int
|
||||||
NUMD2temp(GENmodel *inModel, CKTcircuit *ckt)
|
NUMD2temp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
@ -42,7 +41,7 @@ NUMD2temp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
if (!options->OPTNtnomGiven) {
|
if (!options->OPTNtnomGiven) {
|
||||||
options->OPTNtnom = ckt->CKTnomTemp;
|
options->OPTNtnom = ckt->CKTnomTemp;
|
||||||
}
|
}
|
||||||
for (pM = model->NUMD2matlInfo; pM != NIL(TWOmaterial);
|
for (pM = model->NUMD2matlInfo; pM != NULL;
|
||||||
pM = pM->next) {
|
pM = pM->next) {
|
||||||
pM->tnom = options->OPTNtnom;
|
pM->tnom = options->OPTNtnom;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group
|
||||||
#include "ngspice/ciderinp.h"
|
#include "ngspice/ciderinp.h"
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
#define TSCALLOC(var, size, type)\
|
#define TSCALLOC(var, size, type)\
|
||||||
if (size && (var = (type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
if (size && (var = (type *)calloc(1, (unsigned)(size)*sizeof(type))) == NULL) {\
|
||||||
return(E_NOMEM);\
|
return(E_NOMEM);\
|
||||||
|
|
@ -41,13 +40,13 @@ NUMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
int error, xIndex;
|
int error, xIndex;
|
||||||
int xMeshSize, yMeshSize;
|
int xMeshSize, yMeshSize;
|
||||||
TWOdevice *pDevice;
|
TWOdevice *pDevice;
|
||||||
TWOcoord *xCoordList = NIL(TWOcoord);
|
TWOcoord *xCoordList = NULL;
|
||||||
TWOcoord *yCoordList = NIL(TWOcoord);
|
TWOcoord *yCoordList = NULL;
|
||||||
TWOdomain *domainList = NIL(TWOdomain);
|
TWOdomain *domainList = NULL;
|
||||||
TWOelectrode *electrodeList = NIL(TWOelectrode);
|
TWOelectrode *electrodeList = NULL;
|
||||||
TWOmaterial *pM, *pMaterial = NIL(TWOmaterial), *materialList = NIL(TWOmaterial);
|
TWOmaterial *pM, *pMaterial = NULL, *materialList = NULL;
|
||||||
DOPprofile *profileList = NIL(DOPprofile);
|
DOPprofile *profileList = NULL;
|
||||||
DOPtable *dopTableList = NIL(DOPtable);
|
DOPtable *dopTableList = NULL;
|
||||||
double startTime;
|
double startTime;
|
||||||
|
|
||||||
/* loop through all the models */
|
/* loop through all the models */
|
||||||
|
|
@ -210,9 +209,9 @@ NUMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a copy of material data that can change with temperature. */
|
/* Create a copy of material data that can change with temperature. */
|
||||||
pDevice->pMaterials = NIL(TWOmaterial);
|
pDevice->pMaterials = NULL;
|
||||||
for (pM = materialList; pM != NIL(TWOmaterial); pM = pM->next) {
|
for (pM = materialList; pM != NULL; pM = pM->next) {
|
||||||
if (pDevice->pMaterials == NIL(TWOmaterial)) {
|
if (pDevice->pMaterials == NULL) {
|
||||||
TSCALLOC(pMaterial, 1, TWOmaterial);
|
TSCALLOC(pMaterial, 1, TWOmaterial);
|
||||||
pDevice->pMaterials = pMaterial;
|
pDevice->pMaterials = pMaterial;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -221,7 +220,7 @@ NUMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
}
|
}
|
||||||
/* Copy everything, then fix the incorrect pointer. */
|
/* Copy everything, then fix the incorrect pointer. */
|
||||||
bcopy(pM, pMaterial, sizeof(TWOmaterial));
|
bcopy(pM, pMaterial, sizeof(TWOmaterial));
|
||||||
pMaterial->next = NIL(TWOmaterial);
|
pMaterial->next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate the mesh structure for the device. */
|
/* Generate the mesh structure for the device. */
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ Author: 1991 David A. Gates, U. C. Berkeley CAD Group
|
||||||
#include "ngspice/cidersupt.h"
|
#include "ngspice/cidersupt.h"
|
||||||
#include "ngspice/suffix.h"
|
#include "ngspice/suffix.h"
|
||||||
|
|
||||||
#define NIL(type) ((type *)0)
|
|
||||||
|
|
||||||
int
|
int
|
||||||
NUMOStemp(GENmodel *inModel, CKTcircuit *ckt)
|
NUMOStemp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
@ -43,7 +42,7 @@ NUMOStemp(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
if (!options->OPTNtnomGiven) {
|
if (!options->OPTNtnomGiven) {
|
||||||
options->OPTNtnom = ckt->CKTnomTemp;
|
options->OPTNtnom = ckt->CKTnomTemp;
|
||||||
}
|
}
|
||||||
for (pM = model->NUMOSmatlInfo; pM != NIL(TWOmaterial);
|
for (pM = model->NUMOSmatlInfo; pM != NULL;
|
||||||
pM = pM->next) {
|
pM = pM->next) {
|
||||||
pM->tnom = options->OPTNtnom;
|
pM->tnom = options->OPTNtnom;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue