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