51 #include <Xyce_config.h>
69 #include <N_LAS_Vector.h>
70 #include <N_LAS_Matrix.h>
71 #include <N_LAS_System.h>
72 #include <N_LAS_Builder.h>
74 #include <N_UTL_Expression.h>
88 .setDescription(
"Cross sectional area of the device.")
93 .setDescription(
"Acceptor doping level")
98 .setDescription(
"Donor doping level")
103 .setDescription(
"Junction width, if graded junction enabled.")
108 .setDescription(
"Temperature");
112 .setDescription(
"Length scalar; adjust to mitigate convergence problems. "
113 "The model will do all of its scaling automatically, so it is generally not "
114 "necessary to specify it manually.")
119 .setDescription(
"Device length")
124 .setDescription(
"Device width")
129 .setDescription(
"Time interval for tecplot output (if tecplot is enabled).")
133 .setDescription(
"This is a required field for a 2D simulation. If the user"
134 "specifies meshfile=internal.mesh, the model will create a"
135 "Cartesian mesh using the parameters L,W,NX and NY. If the user specifies "
136 "anything else (for example meshfile=diode.msh), the model will attempt to "
137 "read in a mesh file of that name. The format is assumed to be that "
138 "of the SG Framework.");
142 .setDescription(
"Flag for graded junction vs. abrupt junction. – (1/true=graded, 0/false=abrupt)")
146 .setDescription(
"Mobility model.");
149 .setDescription(
"Material of bulk material.");
151 #ifdef Xyce_OXIDE_ENABLED
152 p.
addPar(
"ALLOXIDE",
false, &TwoDPDE::Instance::allOxideFlag)
157 .setDescription(
"If true, displacement current is computed and output");
160 .setDescription(
"Setting for Tecplot output:\n"
161 "0 - no Tecplot files\n"
162 "1 - Tecplot files, each output in a separate file. 2 - Tecplot file, each output"
163 "appended to a single file.\n"
164 "Tecplot files will have the .dat suffix, and the prefix will be the name of the device instance")
168 .setDescription(
"Flag for sgplot output.\n"
169 "0 - no sgplot files.\n"
170 "1 - sgplot files.\n"
171 "sgplot is a plotting program that comes as part of the SG Framework. sgplot "
172 "files will have the *.res suffix, and the prefix will be the name of the "
177 .setDescription(
"Flag for gnuplot output.\n"
178 "0 - no gnuplot files.\n"
179 "1 - gnuplot files.\n"
180 "gnuplot is an open source plotting program that is usually installed on Linux "
181 "systems. gnuplot files will have the *Gnu.dat suffix, and the prefix will be the"
182 "name of the device instance.")
186 .setDescription(
"Flag for volume-averaged text output.\n"
187 "0 - no text files.\n"
189 "txtdataplot files will have the *.txt suffix, and the prefix will be the name of the device instance.")
193 .setDescription(
"Number of mesh points, x-direction.");
196 .setDescription(
"Number of mesh points, y-direction.");
200 .setDescription(
"Flag to enable cylindrical geometry")
205 .setDescription(
"Flag to determine if the results of the nonlinear Poisson "
206 "calculation is included in the output files. Normally, this calculation"
207 " is used to initialize a drift-diffusion calculation and isn't of interest.")
211 .setDescription(
"P-type or N-type - this is only relevant if using the default dopings");
217 .setDescription(
"Maximum voltage change used by two-level Newton algorithm.");
222 .setDescription(
"Flag for using old (inaccurate) intrinsic carrier calculation.");
286 useOldNiGiven(false),
289 usingInternalMesh(false),
291 deviceInitialized(false),
292 meshPerturbed (false),
293 dopingPerturbed (false),
297 deviceLength(1.0e-3),
301 #ifdef Xyce_OXIDE_ENABLED
305 gradedJunctionFlag(false),
306 calledBeforeSIGB(false),
313 displCurrentFlag(false),
314 constBoundaryFlag(false),
315 calcConductanceFlag(false),
319 outputNLPoisson(false),
320 lastOutputTime(-10.0),
327 useMatrixGIDFlag(false),
328 useVectorGIDFlag(false),
330 meshCopyContainerPtr(0),
371 boundaryNeighborSten(),
398 meshNeighborMultiMap(),
405 numInterfaceMeshPoints(0),
409 maxColsPerRow(MAX_COLS_PER_ROW),
413 pdTermsAllocated(false),
441 if (
given(
"PH.TYPE"))
443 if (photoString ==
"UNIFORM")
445 else if (photoString ==
"PULSE")
449 std::string msg =
"::: ph.type not recognized.\n";
450 N_ERH_ErrorMgr::report( N_ERH_ErrorMgr::DEV_FATAL_0,msg);
458 tmpTypeName.toUpper ();
462 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
463 Xyce::dout() <<
"Doing standard initialization of ."<< std::endl;
480 bs1 = setupPhotogen (); bsuccess = bsuccess && bs1;
509 std::map<std::string,DopeInfo *>::iterator iter;
510 std::map<std::string,DopeInfo *>::iterator begin =
dopeInfoMap.begin();
511 std::map<std::string,DopeInfo *>::iterator end =
dopeInfoMap.end ();
513 for(iter=begin;iter!=end;++iter)
515 if (iter->second != 0)
delete iter->second;
522 std::map<std::string, PDE_2DElectrode * >::iterator iterE;
523 std::map<std::string, PDE_2DElectrode * >::iterator beginE =
electrodeMap.begin();
524 std::map<std::string, PDE_2DElectrode * >::iterator endE =
electrodeMap.end ();
526 for(iterE=beginE;iterE!=endE;++iterE)
528 if (iterE->second != 0)
delete iterE->second;
543 if (compositeName ==
"DOPINGPROFILES" || compositeName ==
"REGION")
547 return (static_cast<CompositeParam *> (n));
549 if (compositeName ==
"NODE")
552 ExtendedString dIName = paramName;
555 dINode.
eName = dIName;
556 dINode.
nName = paramName;
565 return (static_cast<CompositeParam *> (n));
568 "Instance::constructComposite: unrecognized composite name: ";
569 msg += compositeName;
570 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
588 bool bsuccess =
true;
591 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
593 Xyce::dout() << section_divider <<
"\n";
594 Xyce::dout() <<
"updateIntermediateVars. name = " <<
getName() << std::endl;
603 bs1 =
calcEfield (); bsuccess = bsuccess && bs1;
613 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
615 Xyce::dout() << section_divider << std::endl;
632 bool bsuccess =
true;
634 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
636 Xyce::dout() << section_divider <<
"\n";
637 Xyce::dout() <<
"calcTerminalCurrents. name = " <<
getName() << std::endl;
641 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin ();
642 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
643 std::vector<DeviceInterfaceNode>::iterator iterDI;
646 for (iterDI=firstDI; iterDI!=lastDI; ++iterDI, ++ind)
654 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
655 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
656 std::vector<int>::iterator iterI;
658 iterDI->currentSum = 0.0;
661 for(nodeIndex=0,iterI=firstI;iterI!=lastI;++iterI,++nodeIndex)
667 std::vector<EDGEINFO>::iterator firstEI = nodePtr->
edgeInfoVector.begin();
668 std::vector<EDGEINFO>::iterator lastEI = nodePtr->
edgeInfoVector.end ();
669 std::vector<EDGEINFO>::iterator iterEI;
673 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
675 Xyce::dout() <<
" --------------- " << std::endl;
676 Xyce::dout() <<
"name = " << iterDI->eName;
677 Xyce::dout() <<
" node = " << *iterI << std::endl;
680 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
682 int iedge = iterEI->iedge;
683 int neighbor = iterEI->inode;
685 double ilen = edgePtr->
ilen;
687 double sign = (*iterI < neighbor) ? 1.0 : -1.0;
689 sum += (sign*
JnVec[iedge] + sign*
JpVec[iedge])*ilen;
694 Xyce::dout() <<
" sum*scalingVars.a0 = "<< sum*
scalingVars.
a0 << std::endl;
695 Xyce::dout() <<
" sum = " << sum << std::endl;
696 Xyce::dout() <<
" --------------- " << std::endl;
701 iterDI->currentSum += sum;
722 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
724 Xyce::dout().setf(std::ios::scientific);
725 Xyce::dout() <<
" " << iterDI->eName;
726 Xyce::dout() <<
" Ickt = " << iterDI->currentSum << std::endl;
731 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
733 Xyce::dout() << section_divider << std::endl;
779 bool bsuccess =
true;
781 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin ();
782 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
783 std::vector<DeviceInterfaceNode>::iterator iterDI;
797 double nodeArea,ilen,elen;
806 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
808 iterDI->dIdVckt = 0.0;
813 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
815 Xyce::dout() << Xyce::subsection_divider << std::endl;
818 if (iterDI->gid ==-1)
continue;
823 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
824 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
825 std::vector<int>::iterator iterI;
827 std::vector<EDGEINFO>::iterator firstEI;
828 std::vector<EDGEINFO>::iterator lastEI;
829 std::vector<EDGEINFO>::iterator iterEI;
838 for(nodeIndex=0,iterI=firstI;iterI!=lastI;++iterI,++nodeIndex)
846 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI)
848 iedge = iterEI->iedge;
849 inodeB = iterEI->inode;
851 ilen = edgePtr->
ilen;
858 sign = (*iterI < inodeB) ? 1.0 : -1.0;
871 coef += (sign* dJndV + sign* dJpdV)*ilen;
876 iterDI->dIdVckt += tmpsum;
880 Xyce::dout().setf(std::ios::left);
881 Xyce::dout() << iterDI->eName<<
":";
882 Xyce::dout() <<
" KCL pdTerminalCurrent row = " << iterDI->gid;
883 Xyce::dout() <<
" contrib = " << tmpsum;
884 Xyce::dout() <<
" dIdVckt = " << iterDI->dIdVckt << std::endl;
889 #endif // Xyce_NEW_BC
893 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
895 Xyce::dout() << Xyce::subsection_divider << std::endl;
897 #endif // Xyce_NEW_BC
901 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
906 int size = iterDI->dFdVckt.size();
907 for (itmp=0;itmp<size;++itmp)
909 iterDI->dFdVckt[itmp] = 0.0;
912 int numNeighbor = iterDI->neighborNodes.size();
916 for (iNeighbor=0;iNeighbor<numNeighbor;++iNeighbor)
918 int inode = iterDI->neighborNodes[iNeighbor];
921 nodeArea = nodePtr->
area;
925 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
945 iterDI->dFdVckt[dFdVindex] = coef;
950 if (inode>inodeB) { dJdV =
dJndV1Vec[iedge]; }
953 coef = ((inode<inodeB)?1.0:-1.0) * dJdV * ilen/nodeArea;
956 iterDI->dFdVckt[dFdVindex] = coef;
961 if (inode>inodeB) { dJdV =
dJpdV1Vec[iedge]; }
964 coef = -((inode<inodeB)?1.0:-1.0) * dJdV * ilen/nodeArea;
967 iterDI->dFdVckt[dFdVindex] = coef;
973 Xyce::dout() <<
"-----" << std::endl;
974 Xyce::dout() <<
"neighbor nodes for boundary: " << iterDI->eName << std::endl;
975 Xyce::dout() <<
"-----" << std::endl;
976 for (iNeighbor=0;iNeighbor<numNeighbor;++iNeighbor)
978 int inode = iterDI->neighborNodes[iNeighbor];
979 Xyce::dout() <<
"\t"<<iNeighbor<<
" "<< inode << std::endl;
982 Xyce::dout() <<
"-----" << std::endl;
983 Xyce::dout() <<
"dFdVckt vector for boundary: " << iterDI->eName << std::endl;
984 Xyce::dout() <<
"-----" << std::endl;
988 for (iNeighbor=0;iNeighbor<numNeighbor;++iNeighbor)
990 int inode = iterDI->neighborNodes[iNeighbor];
999 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
1010 dfdV = iterDI->dFdVckt[idf];
1011 Xyce::dout() <<
"\t"<<idf;
1012 Xyce::dout() <<
" \tv_"<<inode<<
"\t"<<Vrow<<
"\t"<<dfdV<< std::endl;
1015 dfdV = iterDI->dFdVckt[idf];
1016 Xyce::dout() <<
"\t"<<idf;
1017 Xyce::dout() <<
" \tn_"<<inode<<
"\t"<<Nrow<<
"\t"<<dfdV<< std::endl;
1020 dfdV = iterDI->dFdVckt[idf];
1021 Xyce::dout() <<
"\t"<<idf;
1022 Xyce::dout() <<
" \tp_"<<inode<<
"\t"<<Prow<<
"\t"<<dfdV<< std::endl;
1026 Xyce::dout() <<
"-----" << std::endl;
1029 #else // old BC not set up yet.
1031 #endif // Xyce_NEW_BC
1037 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
1042 int numdIdX = iterDI->dIdX.size ();
1043 for (
int j=0;j<numdIdX;++j)
1045 iterDI->dIdX[j] = 0.0;
1051 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
1052 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
1053 std::vector<int>::iterator iterI;
1055 std::vector<EDGEINFO>::iterator firstEI;
1056 std::vector<EDGEINFO>::iterator lastEI;
1057 std::vector<EDGEINFO>::iterator iterEI;
1065 for(nodeIndex=0,iterI=firstI;iterI!=lastI;++iterI,++nodeIndex)
1075 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI)
1077 iedge = iterEI->iedge;
1078 inodeB = iterEI->inode;
1079 sign = (*iterI < inodeB) ? 1.0 : -1.0;
1081 ilen = edgePtr->
ilen;
1098 Vcoef += (sign* dJndV + sign* dJpdV)*ilen;
1099 Ncoef += (sign* dJndn)*ilen;
1100 Pcoef += (sign* dJpdp)*ilen;
1104 col1 = iterDI->Vcol[iVcol];
1109 int size = iterDI->dIdXcols.size();
1110 for (cnt2=0;cnt2<size;++cnt2)
1112 if (iterDI->dIdXcols[cnt2] == col1)
1113 { bmatch =
true;
break; }
1117 msg =
"pdTerminalCurrents: Could not find a column match in dIdXcols";
1118 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
1123 Xyce::dout() << iterDI->eName;
1126 col1 = iterDI->Ncol[iNcol];
1131 int size = iterDI->dIdXcols.size();
1132 for (cnt2=0;cnt2<size;++cnt2)
1134 if (iterDI->dIdXcols[cnt2] == col1)
1135 { bmatch =
true;
break; }
1139 msg =
"pdTerminalCurrents: Could not find a column match in dIdXcols";
1140 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
1146 col1 = iterDI->Pcol[iPcol];
1151 int size = iterDI->dIdXcols.size();
1152 for (cnt2=0;cnt2<size;++cnt2)
1154 if (iterDI->dIdXcols[cnt2] == col1)
1155 { bmatch =
true;
break; }
1159 msg =
"pdTerminalCurrents: Could not find a column match in dIdXcols";
1160 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
1171 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI,++iVcol,++iNcol,++iPcol)
1173 iedge = iterEI->iedge;
1174 inodeB = iterEI->inode;
1175 sign = (*iterI < inodeB) ? 1.0 : -1.0;
1177 ilen = edgePtr->
ilen;
1194 Vcoef = (sign* dJndV + sign* dJpdV)*ilen;
1195 Ncoef = (sign* dJndn)*ilen;
1196 Pcoef = (sign* dJpdp)*ilen;
1198 col1 = iterDI->Vcol[iVcol];
1203 int size = iterDI->dIdXcols.size();
1204 for (cnt2=0;cnt2<size;++cnt2)
1206 if (iterDI->dIdXcols[cnt2] == col1)
1207 { bmatch =
true;
break; }
1211 msg =
"pdTerminalCurrents: Could not find a column match in dIdXcols";
1212 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
1218 col1 = iterDI->Ncol[iNcol];
1223 for (cnt2=0;cnt2<iterDI->dIdXcols.size();++cnt2)
1225 if (iterDI->dIdXcols[cnt2] == col1)
1226 { bmatch =
true;
break; }
1230 msg =
"pdTerminalCurrents: Could not find a column match in dIdXcols";
1231 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
1237 col1 = iterDI->Pcol[iPcol];
1242 int size = iterDI->dIdXcols.size();
1243 for (cnt2=0;cnt2<size;++cnt2)
1245 if (iterDI->dIdXcols[cnt2] == col1)
1246 { bmatch =
true;
break; }
1250 msg =
"pdTerminalCurrents: Could not find a column match in dIdXcols";
1251 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
1260 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1262 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
1264 int size = iterDI->dIdXcols.size();
1265 int size2= iterDI->dIdX.size ();
1266 Xyce::dout() <<
"dIdX for electrode: " << iterDI->eName << std::endl;
1267 for (
int ididx=0;ididx<size;++ididx)
1269 Xyce::dout() <<
"\t"<< iterDI->dIdXcols[ididx];
1270 Xyce::dout() <<
"\t"<< iterDI->dIdX[ididx] << std::endl;
1273 Xyce::dout() <<
"Done with Instance::pdTerminalCurrents" << std::endl;
1296 bool bsuccess =
true;
1298 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1300 Xyce::dout() << section_divider <<
"\n";
1301 Xyce::dout() <<
"calcTerminalCharges. name = " <<
getName() << std::endl;
1305 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin ();
1306 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
1307 std::vector<DeviceInterfaceNode>::iterator iterDI;
1309 for (iterDI=firstDI; iterDI!=lastDI; ++iterDI)
1317 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
1318 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
1319 std::vector<int>::iterator iterI;
1321 iterDI->chargeSum = 0.0;
1324 for(nodeIndex=0,iterI=firstI;iterI!=lastI;++iterI,++nodeIndex)
1330 std::vector<EDGEINFO>::iterator firstEI = nodePtr->
edgeInfoVector.begin();
1331 std::vector<EDGEINFO>::iterator lastEI = nodePtr->
edgeInfoVector.end ();
1332 std::vector<EDGEINFO>::iterator iterEI;
1336 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1338 Xyce::dout() <<
" --------------- " << std::endl;
1339 Xyce::dout() <<
"name = " << iterDI->eName;
1340 Xyce::dout() <<
" node = " << *iterI << std::endl;
1343 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
1345 int iedge = iterEI->iedge;
1346 int neighbor = iterEI->inode;
1349 double ilen = edgePtr->
ilen;
1351 double sign = (*iterI < neighbor) ? +1.0 : -1.0;
1358 Xyce::dout() <<
"neighbor = "<< neighbor;
1359 Xyce::dout() <<
" Efield = " <<
EfieldVec[iedge];
1360 Xyce::dout() <<
" contrib = " << contrib << std::endl;
1365 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1367 Xyce::dout() <<
" sum*scalingVars.a0 = "<< sum*tmp << std::endl;
1368 Xyce::dout() <<
" sum = " << sum << std::endl;
1369 Xyce::dout() <<
" --------------- " << std::endl;
1374 iterDI->chargeSum += sum;
1378 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1380 Xyce::dout().setf(std::ios::scientific);
1381 Xyce::dout() <<
" " << iterDI->eName;
1382 Xyce::dout() <<
" terminal charge = " << iterDI->chargeSum << std::endl;
1387 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1389 Xyce::dout() << section_divider << std::endl;
1424 bool bsuccess =
true;
1426 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin ();
1427 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
1428 std::vector<DeviceInterfaceNode>::iterator iterDI;
1446 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
1448 iterDI->dQdVckt = 0.0;
1453 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1455 Xyce::dout() << Xyce::subsection_divider << std::endl;
1458 if (iterDI->gid ==-1)
continue;
1463 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
1464 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
1465 std::vector<int>::iterator iterI;
1467 std::vector<EDGEINFO>::iterator firstEI;
1468 std::vector<EDGEINFO>::iterator lastEI;
1469 std::vector<EDGEINFO>::iterator iterEI;
1478 for(nodeIndex=0,iterI=firstI;iterI!=lastI;++iterI,++nodeIndex)
1486 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI)
1488 iedge = iterEI->iedge;
1489 inodeB = iterEI->inode;
1492 double elen = edgePtr->
elen;
1493 double ilen = edgePtr->
ilen;
1505 coef += sign* dEdV * ilen;
1510 iterDI->dQdVckt += tmpsum;
1514 Xyce::dout().setf(std::ios::left);
1515 Xyce::dout() << iterDI->eName<<
":";
1516 Xyce::dout() <<
" KCL pdTerminalCharges row = " << iterDI->gid;
1517 Xyce::dout() <<
" contrib = " << tmpsum;
1518 Xyce::dout() <<
" dQdVckt = " << iterDI->dQdVckt << std::endl;
1523 #endif // Xyce_NEW_BC
1528 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1530 Xyce::dout() << Xyce::subsection_divider << std::endl;
1532 #endif // Xyce_NEW_BC
1536 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
1540 int numdQdX = iterDI->dQdX.size ();
1541 for (
int j=0;j<numdQdX;++j)
1543 iterDI->dQdX[j] = 0.0;
1549 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
1550 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
1551 std::vector<int>::iterator iterI;
1553 std::vector<EDGEINFO>::iterator firstEI;
1554 std::vector<EDGEINFO>::iterator lastEI;
1555 std::vector<EDGEINFO>::iterator iterEI;
1563 for(nodeIndex=0,iterI=firstI;iterI!=lastI;++iterI,++nodeIndex)
1571 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI)
1573 iedge = iterEI->iedge;
1574 inodeB = iterEI->inode;
1579 double elen = edgePtr->
elen;
1580 double ilen = edgePtr->
ilen;
1583 Vcoef += sign* dEdV * ilen;
1587 col1 = iterDI->Vcol[iVcol];
1592 for (cnt2=0;cnt2<iterDI->dIdXcols.size();++cnt2)
1594 if (iterDI->dIdXcols[cnt2] == col1)
1595 { bmatch =
true;
break; }
1599 msg =
"pdTerminalCharges: Could not find a column match in dIdXcols";
1600 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
1609 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI,++iVcol,++iNcol,++iPcol)
1611 iedge = iterEI->iedge;
1612 inodeB = iterEI->inode;
1617 double elen = edgePtr->
elen;
1618 double ilen = edgePtr->
ilen;
1621 Vcoef = sign* dEdV * ilen;
1623 col1 = iterDI->Vcol[iVcol];
1628 for (cnt2=0;cnt2<iterDI->dIdXcols.size();++cnt2)
1630 if (iterDI->dIdXcols[cnt2] == col1)
1631 { bmatch =
true;
break; }
1635 msg =
"pdTerminalCharges: Could not find a column match in dIdXcols";
1636 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
1645 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1647 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
1649 int size = iterDI->dIdXcols.size();
1650 int size2= iterDI->dQdX.size ();
1651 Xyce::dout() <<
"dQdX for electrode: " << iterDI->eName << std::endl;
1652 for (
int ididx=0;ididx<size;++ididx)
1654 Xyce::dout() <<
"\t"<< iterDI->dIdXcols[ididx];
1655 Xyce::dout() <<
"\t"<< iterDI->dQdX[ididx] << std::endl;
1658 Xyce::dout() <<
"Done with Instance::pdTerminalCharges" << std::endl;
1689 bool bsuccess =
true;
1692 Linear::Vector & dfdv = *dfdvPtr;
1699 for (iNeighbor=0;iNeighbor<numNeighbor;++iNeighbor)
1709 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
1721 coef = dINode.
dFdVckt[dFdVindex];
1726 bs1 = dfdv.setElementByGlobalIndex(Vrow, -coef, 0);
1727 bsuccess = bsuccess && bs1;
1738 coef = dINode.
dFdVckt[dFdVindex];
1743 bs1 = dfdv.setElementByGlobalIndex(Nrow, -coef, 0);
1744 bsuccess = bsuccess && bs1;
1755 coef = dINode.
dFdVckt[dFdVindex];
1760 bs1 = dfdv.setElementByGlobalIndex(Prow, -coef, 0);
1761 bsuccess = bsuccess && bs1;
1816 bool bsuccess =
true;
1817 const Linear::Vector & dxdv = *dxdvPtr;
1821 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1823 Xyce::dout() << section_divider <<
"\n";
1824 Xyce::dout() <<
"calcConductances name = " <<
getName() << std::endl;
1825 Xyce::dout() <<
"electrode = " <<
dIVec[iElectrode].eName;
1826 Xyce::dout() <<
" dIdVckt = " <<
dIVec[iElectrode].dIdVckt;
1827 Xyce::dout() << std::endl;
1828 Xyce::dout() << std::endl;
1831 if (!(
dIVec[iElectrode].dxdvAllocated))
1834 dIVec[iElectrode].dxdvAllocated =
true;
1840 *(
dIVec[iElectrode].dxdvPtr) = *(dxdvPtr);
1847 double dIidVj = 0.0;
1848 double dIidVj_chain = 0.0;
1851 double dQidVj = 0.0;
1852 double dQidVj_chain = 0.0;
1868 if (iElectrode != iEqu)
1875 dIidVj =
dIVec[iEqu].dIdVckt;
1876 dQidVj =
dIVec[iEqu].dQdVckt;
1882 int DIDXSize =
dIVec[iEqu].dIdX.size();
1883 for (
int iDIDX=0;iDIDX<DIDXSize;++iDIDX)
1885 int index =
dIVec[iEqu].dIdXcols[iDIDX];
1886 double coefI =
dIVec[iEqu].dIdX[iDIDX];
1887 double coefQ =
dIVec[iEqu].dQdX[iDIDX];
1909 std::ostringstream oss;
1910 oss <<
"dIdX" << std::setw(2) << std::setfill(
'0') << iEqu <<
".txt";
1914 std::ostringstream oss;
1915 oss <<
"dQdX" << std::setw(2) << std::setfill(
'0') << iEqu <<
".txt";
1924 Gij = dIidVj_chain + dIidVj;
1925 condVec[iEqu][iElectrode] = Gij;
1932 Cij = dQidVj_chain + dQidVj;
1933 capVec[iEqu][iElectrode] = Cij;
1935 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1937 char outstring[128];
1938 double Itmp =
dIVec[iEqu].currentSum;
1939 double Vtmp =
dIVec[iEqu].Vckt -
dIVec[iElectrode].Vckt;
1941 double GV = Gij*Vtmp;
1942 for(
int i=0;i<128;++i) outstring[i] = static_cast<char>(0);
1944 "(%2d,%2d): dotPr=%12.4e G=%12.4e",
1945 iEqu,iElectrode,dIidVj_chain,Gij);
1946 Xyce::dout() << std::string(outstring) << std::endl;
1949 "(%2d,%2d): G=%12.4e G*V=%12.4e I=%12.4e V=%12.4e",
1950 iEqu,iElectrode,Gij,GV,Itmp,Vtmp);
1951 Xyce::dout() << std::string(outstring) << std::endl;
1955 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1957 Xyce::dout() << section_divider << std::endl;
1973 bool bsuccess =
true;
1977 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
1978 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
1979 std::vector<DeviceInterfaceNode>::iterator iterDI = firstDI;
1981 for (; iterDI!=lastDI;++iterDI)
1985 if (iterDI->stateC_owned)
1988 (staVectorPtr)->setElementByGlobalIndex( iterDI->stateC,
1989 iterDI->currentSum, 0);
1994 (*staVectorPtr)[iterDI->li_stateC] = iterDI->currentSum;
2001 #ifdef Xyce_OLD_DISPLACEMENT
2012 (staVectorPtr)->setElementByGlobalIndex(
stateDispl[i], D, 0);
2057 bool bsuccess =
true;
2065 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
2066 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
2067 std::vector<DeviceInterfaceNode>::iterator iterDI = firstDI;
2069 for (; iterDI!=lastDI;++iterDI)
2074 iterDI->currentSum =
2075 (staVectorPtr)->getElementByGlobalIndex( iterDI->stateC, 0);
2079 iterDI->currentSum = (*staVectorPtr)[iterDI->li_stateC];
2087 #ifdef Xyce_OLD_DISPLACEMENT
2127 int inodeA = edgePtr->
inodeA;
2128 int inodeB = edgePtr->
inodeB;
2129 double elen = edgePtr->
elen;
2139 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
2140 Xyce::dout() <<
" Maximum displacement current: " << dcmax << std::endl;
2167 bool bsuccess =
true;
2170 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
2172 Xyce::dout() <<
"Instance::setInitialGuess\n";
2224 bool bsuccess =
true;
2228 int Vrow, Nrow, Prow;
2233 double ilen, elen, nodeArea;
2239 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
2241 Xyce::dout() << section_divider <<
"\n";
2242 Xyce::dout() <<
"Instance::loadVecNLPoisson\n";
2243 Xyce::dout() <<
" name = " <<
getName() <<
"\n";
2245 Xyce::dout() <<
" Vt = " <<
Vt <<
"\n";
2246 Xyce::dout() <<
" Ut = " <<
Ut <<
"\n";
2247 Xyce::dout() <<
" scalingVars.V0 = " <<
scalingVars.
V0 <<
"\n";
2254 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
2256 Xyce::dout() <<
"--------" << std::endl;
2257 Xyce::dout() <<
"Mesh Point i = " << i;
2283 #else // "old" boundary condition:
2284 bool doneFlag =
false;
2294 int i1 =
dIVec[DIindex].meshGlobalToLocal[i];
2295 coef = vtmp -
dIVec[DIindex].VbcVec[i1];
2297 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
2299 Xyce::dout() <<
"BC load: Vrow = " << Vrow <<
" coef = " << coef << std::endl;
2300 Xyce::dout() <<
" vtmp = " << vtmp << std::endl;
2301 Xyce::dout() <<
" Vckt = " <<
dIVec[DIindex].Vckt << std::endl;
2305 bs1 = vecPtr->sumElementByGlobalIndex(Vrow, -scalar*coef, 0);
2306 bsuccess = bsuccess && bs1;
2307 bs1 = vecPtr->sumElementByGlobalIndex(Nrow, 0.0 , 0);
2308 bsuccess = bsuccess && bs1;
2309 bs1 = vecPtr->sumElementByGlobalIndex(Prow, 0.0 , 0);
2310 bsuccess = bsuccess && bs1;
2314 (*vecPtr)[Vrow] += -scalar*coef;
2315 (*vecPtr)[Nrow] += 0.0;
2316 (*vecPtr)[Prow] += 0.0;
2324 if (doneFlag)
continue;
2325 #endif // Xyce_NEW_BC
2329 nodeArea = nodePtr->
area;
2330 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
2332 Xyce::dout() <<
"--------" << std::endl;
2333 Xyce::dout() <<
"Interior: mesh point: " << i <<
" Vrow = " << Vrow;
2334 Xyce::dout() << std::endl;
2338 for (
int iNN=0;iNN<nodePtr->
cnode;++iNN)
2345 double efield_loc = (
VVec[i]-
VVec[inodeB])/elen;
2346 coef += -efield_loc * ilen ;
2349 Xyce::dout() <<
"----" << std::endl;
2350 Xyce::dout() <<
" iedge = " << iedge << std::endl;
2351 Xyce::dout() <<
" Vlocal = " <<
VVec[i] << std::endl;
2352 Xyce::dout() <<
" Vneigh = " <<
VVec[inodeB] << std::endl;
2353 Xyce::dout() <<
" efield = " << efield_loc << std::endl;
2354 Xyce::dout() <<
" elen = " << elen << std::endl;
2355 Xyce::dout() <<
" ilen = " << ilen << std::endl;
2356 Xyce::dout() <<
" inodeB = " << inodeB;
2359 Xyce::dout() << std::endl;
2366 coef2 = -(holeDens-elecDens+
CVec[i]);
2368 #ifdef Xyce_OXIDE_ENABLED
2379 Xyce::dout() <<
"--------" << std::endl;
2380 Xyce::dout() <<
" holeD = " << holeDens << std::endl;
2381 Xyce::dout() <<
" elecD = " << elecDens << std::endl;
2382 Xyce::dout() <<
" dopeD = " <<
CVec[i] << std::endl;
2383 Xyce::dout() <<
" coef2 = " << coef2 << std::endl;
2385 Xyce::dout() <<
" nodeArea = " << nodeArea << std::endl;
2386 Xyce::dout() <<
" coef = " << coef << std::endl;
2387 Xyce::dout() <<
"--------" << std::endl;
2392 bs1 = vecPtr->sumElementByGlobalIndex(Vrow, -scalar*coef, 0);
2393 bsuccess = bsuccess && bs1;
2394 bs1 = vecPtr->sumElementByGlobalIndex(Nrow, 0.0 , 0);
2395 bsuccess = bsuccess && bs1;
2396 bs1 = vecPtr->sumElementByGlobalIndex(Prow, 0.0 , 0);
2397 bsuccess = bsuccess && bs1;
2401 (*vecPtr)[Vrow] += -scalar*coef;
2402 (*vecPtr)[Nrow] += 0.0;
2403 (*vecPtr)[Prow] += 0.0;
2408 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
2409 Xyce::dout() << section_divider << std::endl;
2423 (
double scalar,
double dndtScalar, Linear::Vector * vecPtr)
2425 bool bsuccess =
true;
2427 std::string semi(bulkMaterial);
2430 int Vrow, Nrow, Prow;
2432 double ilen, elen, nodeArea;
2433 double holeDens, elecDens;
2440 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2442 Xyce::dout() <<
"\n"<<section_divider << std::endl;
2443 Xyce::dout() <<
"Instance::loadVecDDForm\n";
2444 Xyce::dout() <<
" name = " <<
getName() <<
"\n";
2448 std::vector<DeviceInterfaceNode>::iterator firstDI = dIVec.begin();
2449 std::vector<DeviceInterfaceNode>::iterator lastDI = dIVec.end ();
2450 std::vector<DeviceInterfaceNode>::iterator iterDI = firstDI;
2456 for (;iterDI!=lastDI;++iterDI)
2458 coef = iterDI->currentSum;
2460 if( useVectorGIDFlag )
2462 if (iterDI->gid != -1)
2464 bs1 = vecPtr->sumElementByGlobalIndex(iterDI->gid, -scalar*coef, 0);
2465 bsuccess = bsuccess && bs1;
2470 (*vecPtr)[iterDI->lid] += -scalar*coef;
2473 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2475 Xyce::dout() <<
"KCL for "<< iterDI->eName <<
":\n";
2476 Xyce::dout() <<
" row = " << iterDI->gid <<
"\n";
2477 Xyce::dout() <<
"coef = " << coef <<
"\n";
2484 for (i=0;i<numMeshPoints;++i)
2486 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2488 Xyce::dout() <<
"--------" << std::endl;
2489 Xyce::dout() <<
"Mesh Point i = " << i;
2490 Xyce::dout() <<
" x = " << xVec[i]*scalingVars.x0;
2491 Xyce::dout() <<
" y = " << yVec[i]*scalingVars.x0 << std::endl;
2494 if( useVectorGIDFlag )
2496 Vrow = Vrowarray[i];
2497 Nrow = Nrowarray[i];
2498 Prow = Prowarray[i];
2502 Vrow = li_Vrowarray[i];
2503 Nrow = li_Nrowarray[i];
2504 Prow = li_Prowarray[i];
2507 bool doneFlagV =
false;
2508 bool doneFlagN =
false;
2509 bool doneFlagP =
false;
2515 if (boundarySten[i])
continue;
2517 bool doneFlag =
false;
2524 if (boundarySten[i])
2526 int DIindex = labelDIMap[labelNameVector[i]];
2528 if (dIVec[DIindex].given)
2530 int ilocal = dIVec[DIindex].meshGlobalToLocal[i];
2532 if (dIVec[DIindex].neumannBCFlagV==
false)
2535 if (vOwnVec[i] == 1) vtmp = VVec[i];
2537 coef = vtmp - dIVec[DIindex].VbcVec[ilocal];
2539 if( useVectorGIDFlag )
2541 bs1 = vecPtr->sumElementByGlobalIndex(Vrow, -scalar*coef, 0);
2542 bsuccess = bsuccess && bs1;
2546 (*vecPtr)[Vrow] += -scalar*coef;
2549 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2551 Xyce::dout() <<
"BC load: Vrow = " << Vrow;
2552 Xyce::dout() <<
" coef = " << coef << std::endl;
2553 Xyce::dout() <<
" vtmp = " << vtmp << std::endl;
2554 Xyce::dout() <<
" Vckt = " << dIVec[DIindex].Vckt << std::endl;
2555 Xyce::dout() <<
" Vequ = " << dIVec[DIindex].VequVec[ilocal] << std::endl;
2560 if (dIVec[DIindex].neumannBCFlagN==
false)
2563 if (nnOwnVec[i] == 1) ntmp = nnVec[i];
2564 coef = ntmp - (dIVec[DIindex].nnbcVec[ilocal]);
2566 if( useVectorGIDFlag )
2568 bs1 = vecPtr->sumElementByGlobalIndex(Nrow, -scalar*coef , 0);
2569 bsuccess = bsuccess && bs1;
2573 (*vecPtr)[Nrow] += -scalar*coef;
2576 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2578 Xyce::dout() <<
"BC load: Nrow = ";
2579 Xyce::dout() << Nrow <<
" coef = " << coef << std::endl;
2580 Xyce::dout() <<
" ntmp = " << ntmp << std::endl;
2581 Xyce::dout() <<
" nnbc = " << dIVec[DIindex].nnbcVec[ilocal] << std::endl;
2587 if (dIVec[DIindex].neumannBCFlagP==
false)
2590 if (npOwnVec[i] == 1) ptmp = npVec[i];
2591 coef = ptmp - (dIVec[DIindex].npbcVec[ilocal]);
2593 if( useVectorGIDFlag )
2595 bs1 = vecPtr->sumElementByGlobalIndex(Prow, -scalar*coef , 0);
2596 bsuccess = bsuccess && bs1;
2600 (*vecPtr)[Prow] += -scalar*coef;
2603 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2605 Xyce::dout() <<
"BC load: Prow = ";
2606 Xyce::dout() << Prow <<
" coef = " << coef << std::endl;
2607 Xyce::dout() <<
" ptmp = " << ptmp << std::endl;
2608 Xyce::dout() <<
" npbc = " << dIVec[DIindex].npbcVec[ilocal] << std::endl;
2613 doneFlag = (doneFlagV && doneFlagN && doneFlagP);
2618 if (doneFlag)
continue;
2620 #endif // Xyce_NEW_BC
2624 mNode * nodePtr = meshContainerPtr->getNode(i);
2625 nodeArea = nodePtr->
area;
2626 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2628 Xyce::dout() <<
"--------" << std::endl;
2629 Xyce::dout() <<
"Interior: mesh point: " << i <<
" Vrow = " << Vrow;
2630 Xyce::dout() << std::endl;
2636 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2638 Xyce::dout() <<
"--------" << std::endl;
2639 Xyce::dout() <<
" Poisson equ:";
2643 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
2651 double efield_loc = (VVec[i]-VVec[inodeB])/elen;
2652 coef += -efield_loc * ilen ;
2653 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2655 Xyce::dout() <<
"----" << std::endl;
2656 Xyce::dout() <<
" iedge = " << iedge << std::endl;
2657 Xyce::dout() <<
" Vlocal = " << VVec[i] << std::endl;
2658 Xyce::dout() <<
" Vneigh = " << VVec[inodeB] << std::endl;
2659 Xyce::dout() <<
" efield = " << efield_loc << std::endl;
2660 Xyce::dout() <<
" elen = " << elen << std::endl;
2661 Xyce::dout() <<
" ilen = " << ilen << std::endl;
2662 Xyce::dout() <<
" inodeB = " << inodeB;
2663 Xyce::dout() <<
" x[b] = " << xVec[inodeB]*scalingVars.x0;
2664 Xyce::dout() <<
" y[b] = " << yVec[inodeB]*scalingVars.x0 << std::endl;
2665 Xyce::dout() << std::endl;
2670 holeDens = npVec[i];
2671 elecDens = nnVec[i];
2672 coef2 = -(holeDens-elecDens+CVec[i]);
2674 #ifdef Xyce_OXIDE_ENABLED
2683 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2685 Xyce::dout() <<
"--------" << std::endl;
2686 Xyce::dout() <<
" holeD = " << holeDens << std::endl;
2687 Xyce::dout() <<
" elecD = " << elecDens << std::endl;
2688 Xyce::dout() <<
" dopeD = " << CVec[i] << std::endl;
2689 Xyce::dout() <<
" coef2 = " << coef2 << std::endl;
2691 Xyce::dout() <<
" nodeArea = " << nodeArea << std::endl;
2692 Xyce::dout() <<
" coef = " << coef << std::endl;
2693 Xyce::dout() <<
"--------" << std::endl;
2695 if ( getSolverState().chargeHomotopy_ )
2697 coef *= getSolverState().chargeAlpha_;
2700 if( useVectorGIDFlag )
2702 bs1 = vecPtr->sumElementByGlobalIndex(Vrow, -scalar*coef, 0);
2703 bsuccess = bsuccess && bs1;
2707 (*vecPtr)[Vrow] += -scalar*coef;
2719 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2721 Xyce::dout() <<
"--------" << std::endl;
2722 Xyce::dout() <<
" Electron equ:";
2727 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
2734 coef += ((i<inodeB)?1.0:-1.0) * JnVec[iedge] * ilen ;
2736 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2738 Xyce::dout() <<
"----" << std::endl;
2739 Xyce::dout() <<
" iedge = " << iedge << std::endl;
2740 Xyce::dout() <<
" Jn = " << JnVec[iedge] << std::endl;
2741 Xyce::dout() <<
" nlocal = " << nnVec[i] << std::endl;
2742 Xyce::dout() <<
" nneigh = " << nnVec[inodeB] << std::endl;
2743 Xyce::dout() <<
" elen = " << elen << std::endl;
2744 Xyce::dout() <<
" ilen = " << ilen << std::endl;
2745 Xyce::dout() <<
" inodeB = " << inodeB;
2746 Xyce::dout() <<
" x[b] = " << xVec[inodeB]*scalingVars.x0;
2747 Xyce::dout() <<
" y[b] = " << yVec[inodeB]*scalingVars.x0 << std::endl;
2748 Xyce::dout() << std::endl;
2753 coef += - totSrcVec[i] - dndt;
2755 coef += - RVec[i] - dndt;
2758 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2760 Xyce::dout() <<
"--------" << std::endl;
2761 Xyce::dout().setf(std::ios::left);
2762 Xyce::dout() <<
" row = " << Nrow;
2763 Xyce::dout().setf(std::ios::scientific);
2764 Xyce::dout() <<
" coef=" << coef;
2765 Xyce::dout() <<
" nodeArea ="<<nodeArea;
2766 Xyce::dout() <<
" R[i]="<<RVec[i];
2767 Xyce::dout() <<
" dndt="<<dndt;
2768 Xyce::dout() <<
"\n";
2769 Xyce::dout() <<
"--------" << std::endl;
2772 if( useVectorGIDFlag )
2774 bs1 = vecPtr->setElementByGlobalIndex(Nrow,-scalar*coef,0);
2775 bsuccess = bsuccess && bs1;
2779 (*vecPtr)[Nrow] += -scalar*coef;
2790 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2792 Xyce::dout() <<
"--------" << std::endl;
2793 Xyce::dout() <<
" Hole equ:";
2798 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
2805 coef += ((i<inodeB)?1.0:-1.0) * JpVec[iedge] * ilen ;
2807 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2809 Xyce::dout() <<
"----" << std::endl;
2810 Xyce::dout() <<
" iedge = " << iedge << std::endl;
2811 Xyce::dout() <<
" Jp = " << JpVec[iedge] << std::endl;
2812 Xyce::dout() <<
" plocal = " << npVec[i] << std::endl;
2813 Xyce::dout() <<
" pneigh = " << npVec[inodeB] << std::endl;
2814 Xyce::dout() <<
" elen = " << elen << std::endl;
2815 Xyce::dout() <<
" ilen = " << ilen << std::endl;
2816 Xyce::dout() <<
" inodeB = " << inodeB;
2817 Xyce::dout() <<
" x[b] = " << xVec[inodeB]*scalingVars.x0;
2818 Xyce::dout() <<
" y[b] = " << yVec[inodeB]*scalingVars.x0 << std::endl;
2819 Xyce::dout() << std::endl;
2825 coef += - totSrcVec[i] - dpdt;
2827 coef += - RVec[i] - dpdt;
2830 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2832 Xyce::dout() <<
"--------" << std::endl;
2833 Xyce::dout().setf(std::ios::left);
2834 Xyce::dout() <<
" row = " << Prow;
2835 Xyce::dout().setf(std::ios::scientific);
2836 Xyce::dout() <<
" coef=" << coef;
2837 Xyce::dout() <<
" nodeArea ="<<nodeArea;
2838 Xyce::dout() <<
" RVec[i]="<<RVec[i];
2839 Xyce::dout() <<
" dpdt="<<dpdt;
2840 Xyce::dout() <<
"\n";
2841 Xyce::dout() <<
"--------" << std::endl;
2844 if( useVectorGIDFlag )
2846 bs1 = vecPtr->setElementByGlobalIndex(Prow,-scalar*coef,0);
2847 bsuccess = bsuccess && bs1;
2851 (*vecPtr)[Prow] += -scalar*coef;
2860 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
2861 Xyce::dout() << section_divider << std::endl;
2877 bool bsuccess =
true;
2880 int Vrow, Nrow, Prow;
2882 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
2884 Xyce::dout() << section_divider <<
"\n";
2885 Xyce::dout() <<
"Instance::loadJacNonlinPoisson" <<
"\n";
2886 Xyce::dout() <<
" name = " <<
getName() <<
"\n";
2887 Xyce::dout() <<
"\n";
2894 double pre = 1.0/
Ut;
2902 double ilen, elen, nodeArea;
2905 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
2907 Xyce::dout() <<
"pre = " << pre <<
"\n";
2908 Xyce::dout() <<
"Vt = " <<
Vt <<
"\n";
2909 Xyce::dout() <<
"eps = " <<
eps <<
"\n";
2910 Xyce::dout() <<
"q = " << q <<
"\n";
2911 Xyce::dout() <<
"Na = " <<
Na <<
"\n";
2912 Xyce::dout() <<
"Nd = " <<
Nd <<
"\n";
2913 Xyce::dout() <<
"NpMax = " <<
NpMax <<
"\n";
2914 Xyce::dout() <<
"NnMax = " <<
NnMax <<
"\n";
2918 int numCol =
cols.size();
2928 for (j=0;j<numCol;++j)
2934 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin ();
2935 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
2936 std::vector<DeviceInterfaceNode>::iterator iterDI;
2943 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
2945 if (iterDI->gid !=-1)
2947 cols[0] = iterDI->gid;
2948 bs1 = matPtr->putRow (iterDI->gid, 1, &
vals[0], &
cols[0]);
2949 bsuccess = bsuccess && bs1;
2958 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
2960 Xyce::dout() <<
"\nmesh point i = " << i << std::endl;
2962 for (j=0;j<numCol;++j)
2975 bool doneFlag =
false;
2992 if (
dIVec[DIindex].gid != -1)
3002 bs1 = matPtr->putRow (Vrow, count, &
vals[0], &
cols[0]);
3003 bsuccess = bsuccess && bs1;
3005 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3007 Xyce::dout() <<
"BC load: Vrow = " << Vrow << std::endl;
3008 for (
int eric=0;eric<count;++eric)
3010 Xyce::dout() <<
" cols["<<eric<<
"] = " <<
cols[eric];
3011 Xyce::dout() <<
" vals["<<eric<<
"] = " <<
vals[eric];
3012 Xyce::dout() << std::endl;
3022 bs1 = matPtr->putRow (Nrow, 1, &
vals[0], &
cols[0]);
3023 bsuccess = bsuccess && bs1;
3025 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3027 Xyce::dout() <<
"BC load: Nrow = " << Nrow;
3028 Xyce::dout() <<
" coef = " <<
vals[0] << std::endl;
3038 bs1 = matPtr->putRow (Prow, 1, &
vals[0], &
cols[0]);
3039 bsuccess = bsuccess && bs1;
3041 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3043 Xyce::dout() <<
"BC load: Prow = " << Vrow;
3044 Xyce::dout() <<
" coef = " <<
vals[0] << std::endl;
3053 if (doneFlag)
continue;
3054 #endif // Xyce_NEW_BC
3059 #ifdef Xyce_OXIDE_ENABLED
3071 nodeArea = nodePtr->
area;
3076 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
3087 #ifdef Xyce_OXIDE_ENABLED
3090 coef += pre*holeDens + pre*elecDens;
3093 coef += pre*holeDens + pre*elecDens;
3104 Xyce::dout() <<
" center point: i="<<i;
3105 Xyce::dout() <<
" xVec[i] = " <<
xVec[i];
3106 Xyce::dout() <<
" yVec[i] = " <<
yVec[i];
3107 Xyce::dout() << std::endl;
3109 Xyce::dout() <<
" boundarySten = " <<
boundarySten[i] << std::endl;
3110 Xyce::dout() <<
" Vcolarray[i][0] = ";
3111 Xyce::dout() <<
Vcolarray[i][0] << std::endl;
3116 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
3118 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3120 Xyce::dout() <<
"non-center point: i="<<i;
3121 Xyce::dout() <<
" Vcolarray[i]["<<iNN+1<<
"] = ";
3122 Xyce::dout() <<
Vcolarray[i][iNN+1] << std::endl;
3124 if (
Vcolarray[i][iNN+1] == -1)
continue;
3138 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3140 Xyce::dout() <<
"\n";
3141 Xyce::dout().setf(std::ios::left);
3142 Xyce::dout() <<
" POISSON LOAD: row = " << Vrow;
3143 Xyce::dout() <<
" count = " << count <<
"\n";
3144 Xyce::dout().setf(std::ios::scientific);
3145 for (j=0;j<count;++j)
3147 Xyce::dout() <<
" cols["<<j<<
"] = " <<
cols[j];
3148 Xyce::dout() <<
" vals["<<j<<
"] = " <<
vals[j];
3149 Xyce::dout() << std::endl;
3153 if (Vrow != -1 && count > 0)
3155 bs1 = matPtr->putRow (Vrow, count, &
vals[0], &
cols[0]);
3156 bsuccess = bsuccess && bs1;
3160 Report::DevelFatal() <<
"OOOPS!";
3167 bs1 = matPtr->putRow (Nrow, 1, &
vals[0], &
cols[0]);
3168 bsuccess = bsuccess && bs1;
3175 bs1 = matPtr->putRow (Prow, 1, &
vals[0], &
cols[0]);
3176 bsuccess = bsuccess && bs1;
3179 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3181 Xyce::dout() << subsection_divider <<
"\n";
3200 bool doneFlag =
false;
3213 (*matPtr)[Vrow][Voff[0]] = 1.0;
3217 (*matPtr)[Nrow][Noff[0]] = 1.0;
3220 (*matPtr)[Prow][Poff[0]] = 1.0;
3226 if (doneFlag)
continue;
3227 #endif // Xyce_NEW_BC
3232 #ifdef Xyce_OXIDE_ENABLED
3244 nodeArea = nodePtr->
area;
3249 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
3260 #ifdef Xyce_OXIDE_ENABLED
3263 coef += pre*holeDens + pre*elecDens;
3266 coef += pre*holeDens + pre*elecDens;
3269 (*matPtr)[Vrow][Voff[0]] += coef;
3273 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
3277 if (
Vcolarray[i][iNN+1] == -1)
continue;
3286 (*matPtr)[Vrow][Voff[iNN+1]] += coef;
3290 (*matPtr)[Nrow][Noff[0]] = 1.0;
3293 (*matPtr)[Prow][Poff[0]] = 1.0;
3298 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3300 Xyce::dout() << section_divider << std::endl;
3316 bool bsuccess =
true;
3321 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3323 Xyce::dout() <<
"Starting Instance::loadMatKCLDDForm" << std::endl;
3326 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin ();
3327 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
3328 std::vector<DeviceInterfaceNode>::iterator iterDI;
3332 int numCol =
cols.size();
3336 for (j=0;j<numCol;++j)
3342 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
3344 if (iterDI->gid ==-1)
continue;
3347 cols[count] = iterDI->gid;
3355 vals[0] = iterDI->dIdVckt;
3357 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3359 Xyce::dout() <<
"\n";
3360 Xyce::dout().setf(std::ios::left);
3361 Xyce::dout() <<
" KCL new BC LOAD: row = " << iterDI->gid;
3362 Xyce::dout() <<
" count = " << count;
3363 Xyce::dout() <<
" name = " << iterDI->eName <<
"\n";
3365 Xyce::dout().setf(std::ios::scientific);
3366 Xyce::dout() <<
" cols[0] = " <<
cols[0];
3367 Xyce::dout() <<
" vals[0] = " <<
vals[0];
3368 Xyce::dout() << std::endl;
3370 bs1 = matPtr->sumIntoRow (iterDI->gid, count, &
vals[0], &
cols[0]);
3371 bsuccess = bsuccess && bs1;
3372 #endif // Xyce_NEW_BC
3376 count = iterDI->dIdXcols.size();
3378 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3380 Xyce::dout() <<
"\n";
3381 Xyce::dout().setf(std::ios::left);
3382 Xyce::dout() <<
" KCL LOAD: row = " << iterDI->gid;
3383 Xyce::dout() <<
" count = " << count;
3384 Xyce::dout() <<
" name = " << iterDI->eName <<
"\n";
3386 Xyce::dout().setf(std::ios::scientific);
3387 for (j=0;j<count;++j)
3389 Xyce::dout() <<
" cols["<<j<<
"] = " << iterDI->dIdXcols[j];
3390 Xyce::dout() <<
" vals["<<j<<
"] = " << iterDI->dIdX[j];
3391 Xyce::dout() << std::endl;
3395 bs1 = matPtr->sumIntoRow
3396 (iterDI->gid, count, &(iterDI->dIdX[0]), &(iterDI->dIdXcols[0]));
3397 bsuccess = bsuccess && bs1;
3403 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
3407 int offset = iterDI->lidOffset;
3410 coef = iterDI->dIdVckt;
3411 #endif // Xyce_NEW_BC
3413 (*matPtr)[iterDI->lid][offset] += coef;
3417 int size = iterDI->dIdXcols.size();
3418 for (
int i=0;i<size;++i)
3420 coef = iterDI->dIdX[i];
3421 offset = iterDI->dIdXoffset[i];
3422 (*matPtr)[iterDI->lid][offset] += coef;
3423 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3425 Xyce::dout() <<
"dIdX["<<i<<
"] = " << iterDI->dIdX[i];
3426 Xyce::dout() <<
" dIdXcols["<<i<<
"] = " << iterDI->dIdXcols[i];
3427 Xyce::dout() <<
" dIdXoffset["<<i<<
"] = " << iterDI->dIdXoffset[i];
3428 Xyce::dout() << std::endl;
3434 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
3436 Xyce::dout() <<
"Done with Instance::loadMatKCLDDForm" << std::endl;
3456 bool bsuccess =
true;
3460 int numCol =
cols.size();
3463 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin ();
3464 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
3465 std::vector<DeviceInterfaceNode>::iterator iterDI;
3470 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
3472 if (iterDI->gid !=-1)
3474 cols[0] = iterDI->gid;
3475 bs1 = matPtr->putRow (iterDI->gid, 1, &
vals[0], &
cols[0]);
3476 bsuccess = bsuccess && bs1;
3482 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
3484 (*matPtr)[iterDI->lid][iterDI->lidOffset] = 1.0;
3500 (
double dndtScalar, Linear::Matrix * matPtr)
3502 bool bsuccess =
true;
3505 int Vrow, Nrow, Prow;
3507 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
3509 Xyce::dout() <<
"\n"<<section_divider <<
"\n";
3510 Xyce::dout() <<
"Instance::loadMatDDForm" <<
"\n";
3511 Xyce::dout() <<
" name = " <<
getName() <<
"\n";
3512 Xyce::dout() <<
"\n";
3524 double ilen, elen, nodeArea;
3527 int numCol = cols.size();
3528 if (vals.size () < cols.size()) numCol = vals.size();
3535 if (!(getSolverState().dcopFlag))
3537 dDNDTdn = getSolverState().pdt_*scalingVars.t0*dndtScalar;
3538 dDPDTdp = getSolverState().pdt_*scalingVars.t0*dndtScalar;
3547 for (j=0;j<numCol;++j) { cols[j] = -1; vals[j] = 0.0; }
3550 if( useMatrixGIDFlag )
3552 for (i=0;i<numMeshPoints;++i)
3554 Vrow = Vrowarray[i];
3555 Nrow = Nrowarray[i];
3556 Prow = Prowarray[i];
3558 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
3560 Xyce::dout() << subsection_divider <<
"\n";
3561 Xyce::dout() <<
"mesh point i = " << i;
3562 Xyce::dout() <<
" Vrow = " << Vrow;
3563 Xyce::dout() <<
" Nrow = " << Nrow;
3564 Xyce::dout() <<
" Prow = " << Prow;
3565 Xyce::dout() <<
"\n";
3568 bool doneFlagV =
false;
3569 bool doneFlagN =
false;
3570 bool doneFlagP =
false;
3571 bool doneFlag =
false;
3573 if (boundarySten[i])
continue;
3578 if (boundarySten[i])
3580 int DIindex = labelDIMap[labelNameVector[i]];
3582 if (dIVec[DIindex].given)
3584 if (dIVec[DIindex].neumannBCFlagV==
false)
3586 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
3588 Xyce::dout() <<
"BC load: Vrow = " << Vrow << std::endl;
3597 if (dIVec[DIindex].gid != -1)
3600 vals[1] = -scalingVars.rV0;
3601 cols[1] = dIVec[DIindex].gid;
3607 bs1 = matPtr->putRow (Vrow, count, &vals[0], &cols[0]);
3608 bsuccess = bsuccess && bs1;
3610 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
3612 Xyce::dout() <<
"BC load: Vrow = " << Vrow << std::endl;
3613 for (
int eric=0;eric<count;++eric)
3615 Xyce::dout() <<
" cols["<<eric<<
"] = " << cols[eric];
3616 Xyce::dout() <<
" vals["<<eric<<
"] = " << vals[eric];
3617 Xyce::dout() << std::endl;
3625 if (dIVec[DIindex].neumannBCFlagN==
false)
3632 bs1 = matPtr->putRow (Nrow, 1, &vals[0], &cols[0]);
3633 bsuccess = bsuccess && bs1;
3635 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
3637 Xyce::dout() <<
"BC load: Nrow = " << Nrow << std::endl;
3638 for (
int eric=0;eric<count;++eric)
3640 Xyce::dout() <<
" cols["<<eric<<
"] = " << cols[eric];
3641 Xyce::dout() <<
" vals["<<eric<<
"] = " << vals[eric];
3642 Xyce::dout() << std::endl;
3649 if (dIVec[DIindex].neumannBCFlagP==
false)
3656 bs1 = matPtr->putRow (Prow, 1, &vals[0], &cols[0]);
3657 bsuccess = bsuccess && bs1;
3659 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
3661 Xyce::dout() <<
"BC load: Prow = " << Prow << std::endl;
3662 for (
int eric=0;eric<count;++eric)
3664 Xyce::dout() <<
" cols["<<eric<<
"] = " << cols[eric];
3665 Xyce::dout() <<
" vals["<<eric<<
"] = " << vals[eric];
3666 Xyce::dout() << std::endl;
3673 doneFlag = (doneFlagV && doneFlagN && doneFlagP);
3677 if (doneFlag)
continue;
3679 #endif // Xyce_NEW_BC
3682 std::string semi(bulkMaterial);
3684 mNode * nodePtr = meshContainerPtr->getNode(i);
3685 nodeArea = nodePtr->
area;
3690 for (j=0;j<numCol;++j) { cols[j] = -1; vals[j] = 0.0; }
3696 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
3706 if (Vcolarray[i][0] != -1)
3708 cols[count] = Vcolarray[i][0];
3712 else if (DEBUG_DEVICE)
3714 Xyce::dout() <<
" center point: i="<<i;
3715 Xyce::dout() <<
" Vcolarray[i][0] = " << Vcolarray[i][0] << std::endl;
3721 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
3723 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
3725 Xyce::dout() <<
"non-center point: i="<<i;
3726 Xyce::dout() <<
" Vcolarray[i]["<<iNN+1<<
"] = ";
3727 Xyce::dout() << Vcolarray[i][iNN+1] << std::endl;
3729 int tmpCol = Vcolarray[i][iNN+1];
3731 if (tmpCol == -1)
continue;
3740 coef *= ((boundarySten[inodeB]==1)?(scalingVars.rV0):1.0);
3743 if (boundarySten[inodeB]==1)
3746 for (cnt2=0;cnt2<count;++cnt2)
3748 if (cols[cnt2] == tmpCol)
3749 { bmatch =
true;
break; }
3751 if (!bmatch) { cnt2 = count; ++count;}
3761 #endif // Xyce_NEW_BC
3762 cols[cnt2] = tmpCol;
3767 if (Ncolarray[i][0] != -1)
3769 cols[count] = Ncolarray[i][0];
3775 if (Pcolarray[i][0] != -1)
3777 cols[count] = Pcolarray[i][0];
3782 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
3784 Xyce::dout() <<
"\n";
3785 Xyce::dout().setf(std::ios::left);
3786 Xyce::dout() <<
" POISSON LOAD: row = " << Vrow;
3787 Xyce::dout() <<
" count = " << count <<
"\n";
3788 Xyce::dout().setf(std::ios::scientific);
3789 for (j=0;j<count;++j)
3791 Xyce::dout() <<
" cols["<<j<<
"] = " << cols[j];
3792 Xyce::dout() <<
" vals["<<j<<
"] = " << vals[j];
3793 Xyce::dout() << std::endl;
3797 if (Vrow != -1 && count > 0)
3799 bs1 = matPtr->sumIntoRow (Vrow, count, &vals[0], &cols[0]);
3800 bsuccess = bsuccess && bs1;
3804 Report::DevelFatal() <<
"OOOPS 1!";
3813 for (j=0;j<numCol;++j) { cols[j] = -1; vals[j] = 0.0; }
3819 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
3829 dJdn = dJndn1Vec[iedge];
3833 dJdn = dJndn2Vec[iedge];
3836 coef += ((i<inodeB)?1.0:-1.0) * dJdn * ilen;
3840 coef += - dRdnVec[i] - dDNDTdn;
3843 cols[count] = Ncolarray[i][0];
3848 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
3850 if (Ncolarray[i][iNN+1] == -1)
continue;
3860 dJdn = dJndn1Vec[iedge];
3864 dJdn = dJndn2Vec[iedge];
3867 coef = ((i<inodeB)?1.0:-1.0) * dJdn * ilen/nodeArea;
3870 cols[count] = Ncolarray[i][iNN+1];
3877 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
3887 dJdV = dJndV1Vec[iedge];
3891 dJdV = dJndV2Vec[iedge];
3894 coef += ((i<inodeB)?1.0:-1.0) * dJdV * ilen;
3898 if (Vcolarray[i][0] != -1)
3901 cols[count] = Vcolarray[i][0];
3907 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
3909 int tmpCol = Vcolarray[i][iNN+1];
3910 if (tmpCol == -1)
continue;
3921 dJdV = dJndV1Vec[iedge];
3925 dJdV = dJndV2Vec[iedge];
3928 coef = ((i<inodeB)?1.0:-1.0) * dJdV * ilen/nodeArea;
3930 coef *= ((boundarySten[inodeB]==1)?(scalingVars.rV0):1.0);
3933 if (boundarySten[inodeB]==1)
3936 for (cnt2=0;cnt2<count;++cnt2)
3938 if (cols[cnt2] == tmpCol)
3939 { bmatch =
true;
break; }
3941 if (!bmatch) { cnt2 = count; ++count;}
3951 #endif // Xyce_NEW_BC
3953 cols[cnt2] = tmpCol;
3957 if (Pcolarray[i][0] != -1)
3959 vals[count] = -dRdpVec[i];
3960 cols[count] = Pcolarray[i][0];
3964 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
3966 Xyce::dout() <<
"\n";
3967 Xyce::dout().setf(std::ios::left);
3968 Xyce::dout() <<
"ELECTRON LOAD: row = " << Nrow;
3969 Xyce::dout() <<
" count = " << count<<
"\n";
3970 Xyce::dout().setf(std::ios::scientific);
3971 for (j=0;j<count;++j)
3973 Xyce::dout() <<
" cols["<<j<<
"] = " << cols[j];
3974 Xyce::dout() <<
" vals["<<j<<
"] = " << vals[j];
3975 Xyce::dout() << std::endl;
3979 if (Nrow != -1 && count > 0)
3981 bs1 = matPtr->sumIntoRow (Nrow,count,&vals[0],&cols[0]);
3982 bsuccess = bsuccess && bs1;
3986 Report::DevelFatal() <<
"OOOPS 2!";
3996 for (j=0;j<numCol;++j) { cols[j] = -1; vals[j] = 0.0; }
4002 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4012 dJdp = dJpdn1Vec[iedge];
4016 dJdp = dJpdn2Vec[iedge];
4019 coef += - ((i<inodeB)?1.0:-1.0) * dJdp * ilen;
4023 coef += - dRdpVec[i] - dDPDTdp;
4026 cols[count] = Pcolarray[i][0];
4031 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4033 if (Pcolarray[i][iNN+1] == -1)
continue;
4043 dJdp = dJpdn1Vec[iedge];
4047 dJdp = dJpdn2Vec[iedge];
4050 coef =-((i<inodeB)?1.0:-1.0) * dJdp * ilen/nodeArea;
4053 cols[count] = Pcolarray[i][iNN+1];
4059 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4069 dJdV = dJpdV1Vec[iedge];
4073 dJdV = dJpdV2Vec[iedge];
4076 coef += -((i<inodeB)?1.0:-1.0) * dJdV * ilen;
4080 if (Vcolarray[i][0] != -1)
4083 cols[count] = Vcolarray[i][0];
4089 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4091 int tmpCol = Vcolarray[i][iNN+1];
4092 if (tmpCol == -1)
continue;
4103 dJdV = dJpdV1Vec[iedge];
4107 dJdV = dJpdV2Vec[iedge];
4110 coef =-((i<inodeB)?1.0:-1.0) * dJdV * ilen/nodeArea;
4112 coef *= ((boundarySten[inodeB]==1)?(scalingVars.rV0):1.0);
4115 if (boundarySten[inodeB]==1)
4118 for (cnt2=0;cnt2<count;++cnt2)
4120 if (cols[cnt2] == tmpCol)
4121 { bmatch =
true;
break; }
4123 if (!bmatch) { cnt2 = count; ++count;}
4133 #endif // Xyce_NEW_BC
4135 cols[cnt2] = tmpCol;
4139 if (Ncolarray[i][0] != -1)
4141 vals[count] = -dRdnVec[i];
4142 cols[count] = Ncolarray[i][0];
4146 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
4148 Xyce::dout() <<
"\n";
4149 Xyce::dout().setf(std::ios::left);
4150 Xyce::dout() <<
" HOLE LOAD: row = " << Prow;
4151 Xyce::dout() <<
" count = " << count<<
"\n";
4152 Xyce::dout().setf(std::ios::scientific);
4153 for (j=0;j<count;++j)
4155 Xyce::dout() <<
" cols["<<j<<
"] = " << cols[j];
4156 Xyce::dout() <<
" vals["<<j<<
"] = " << vals[j];
4157 Xyce::dout() << std::endl;
4161 if (Prow != -1 && count > 0)
4163 bs1 = matPtr->sumIntoRow (Prow,count,&vals[0],&cols[0]);
4164 bsuccess = bsuccess && bs1;
4168 Report::DevelFatal() <<
"OOOPS 3!";
4175 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
4177 Xyce::dout() << subsection_divider <<
"\n";
4183 for (i=0;i<numMeshPoints;++i)
4187 Vrow = li_Vrowarray[i];
4188 Nrow = li_Nrowarray[i];
4189 Prow = li_Prowarray[i];
4191 std::vector<int> & Voff = li_VoffsetArray[i];
4192 std::vector<int> & Noff = li_NoffsetArray[i];
4193 std::vector<int> & Poff = li_PoffsetArray[i];
4195 bool doneFlagV =
false;
4196 bool doneFlagN =
false;
4197 bool doneFlagP =
false;
4198 bool doneFlag =
false;
4200 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
4202 Xyce::dout() <<
"mesh point i = " << i << std::endl;
4206 if (boundarySten[i])
continue;
4211 if (boundarySten[i])
4213 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
4215 Xyce::dout() <<
" Doing BC load" << std::endl;
4217 int DIindex = labelDIMap[labelNameVector[i]];
4219 if (dIVec[DIindex].given)
4221 if (dIVec[DIindex].neumannBCFlagV==
false)
4226 (*matPtr)[Vrow][Voff[0]] = 1.0;
4227 (*matPtr)[Vrow][Voff[1]] = -scalingVars.rV0;
4232 if (dIVec[DIindex].neumannBCFlagN==
false)
4236 (*matPtr)[Nrow][Noff[0]] = 1.0;
4241 if (dIVec[DIindex].neumannBCFlagP==
false)
4245 (*matPtr)[Prow][Poff[0]] = 1.0;
4250 doneFlag = (doneFlagV && doneFlagN && doneFlagP);
4254 if (doneFlag)
continue;
4256 #endif // Xyce_NEW_BC
4261 mNode * nodePtr = meshContainerPtr->getNode(i);
4262 nodeArea = nodePtr->
area;
4268 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
4270 Xyce::dout() <<
" Doing Poisson load" << std::endl;
4272 std::string semi(bulkMaterial);
4275 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4285 (*matPtr)[Vrow][Voff[0]] += coef;
4288 coef = 0.0; iNN=0; ioffset=1;
4289 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4291 if (Vcolarray[i][iNN+1] == -1)
continue;
4299 #ifdef Xyce_NEW_BC // again CHECK the offset value.
4300 coef *= ((boundarySten[inodeB]==1)?(scalingVars.rV0):1.0);
4301 #endif // Xyce_NEW_BC
4302 (*matPtr)[Vrow][Voff[ioffset]] += coef;
4307 (*matPtr)[Vrow][Voff[ioffset]] += 1.0;
4311 (*matPtr)[Vrow][Voff[ioffset]] += -1.0;
4318 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
4320 Xyce::dout() <<
" Doing electron load" << std::endl;
4325 coef = 0.0; ioffset=0;
4327 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4337 dJdn = dJndn1Vec[iedge];
4341 dJdn = dJndn2Vec[iedge];
4344 coef += ((i<inodeB)?1.0:-1.0) * dJdn * ilen;
4348 coef += - dRdnVec[i] - dDNDTdn;
4350 (*matPtr)[Nrow][Noff[0]] += coef;
4353 coef = 0.0; ioffset=1;
4354 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4356 if (Ncolarray[i][iNN+1] == -1)
continue;
4366 dJdn = dJndn1Vec[iedge];
4370 dJdn = dJndn2Vec[iedge];
4373 coef = ((i<inodeB)?1.0:-1.0) * dJdn * ilen/nodeArea;
4375 (*matPtr)[Nrow][Noff[ioffset]] += coef;
4381 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4391 dJdV = dJndV1Vec[iedge];
4395 dJdV = dJndV2Vec[iedge];
4398 coef += ((i<inodeB)?1.0:-1.0) * dJdV * ilen;
4402 (*matPtr)[Nrow][Noff[ioffset]] += coef;
4407 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4409 if (Vcolarray[i][iNN+1] == -1)
continue;
4420 dJdV = dJndV1Vec[iedge];
4424 dJdV = dJndV2Vec[iedge];
4427 coef = ((i<inodeB)?1.0:-1.0) * dJdV * ilen/nodeArea;
4429 coef *= ((boundarySten[inodeB]==1)?(scalingVars.rV0):1.0);
4430 #endif // Xyce_NEW_BC
4431 (*matPtr)[Nrow][Noff[ioffset]] += coef;
4436 (*matPtr)[Nrow][Noff[ioffset]] += -dRdpVec[i];
4444 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
4446 Xyce::dout() <<
" Doing hole load" << std::endl;
4450 coef = 0.0; ioffset=0;
4452 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4462 dJdp = dJpdn1Vec[iedge];
4466 dJdp = dJpdn2Vec[iedge];
4469 coef += - ((i<inodeB)?1.0:-1.0) * dJdp * ilen;
4473 coef += - dRdpVec[i] - dDPDTdp;
4475 (*matPtr)[Prow][Poff[0]] += coef;
4478 coef = 0.0; ioffset=1;
4479 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4481 if (Pcolarray[i][iNN+1] == -1)
continue;
4491 dJdp = dJpdn1Vec[iedge];
4495 dJdp = dJpdn2Vec[iedge];
4498 coef =-((i<inodeB)?1.0:-1.0) * dJdp * ilen/nodeArea;
4500 (*matPtr)[Prow][Poff[ioffset]] += coef;
4506 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4516 dJdV = dJpdV1Vec[iedge];
4520 dJdV = dJpdV2Vec[iedge];
4523 coef += -((i<inodeB)?1.0:-1.0) * dJdV * ilen;
4527 (*matPtr)[Prow][Poff[ioffset]] += coef;
4532 for (iNN=0;iNN<nodePtr->
cnode;++iNN)
4534 if (Vcolarray[i][iNN+1] == -1)
continue;
4545 dJdV = dJpdV1Vec[iedge];
4549 dJdV = dJpdV2Vec[iedge];
4552 coef =-((i<inodeB)?1.0:-1.0) * dJdV * ilen/nodeArea;
4553 #ifdef Xyce_NEW_BC // CHECK!
4554 coef *= ((boundarySten[inodeB]==1)?(scalingVars.rV0):1.0);
4555 #endif // Xyce_NEW_BC
4556 (*matPtr)[Prow][Poff[ioffset]] += coef;
4561 (*matPtr)[Prow][Poff[ioffset]] += -dRdnVec[i];
4570 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
4572 Xyce::dout() << section_divider <<
"\n";
4589 bool bsuccess =
true;
4592 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
4594 Xyce::dout() << section_divider <<
"\n";
4595 Xyce::dout() <<
"Instance::calcLifetimes" <<
"\n";
4604 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
4608 Xyce::dout() <<
" tnVec["<<i<<
"] = " <<
tnVec[i];
4609 Xyce::dout() <<
" tpVec["<<i<<
"] = " <<
tpVec[i];
4610 Xyce::dout() <<
"\n";
4614 if (isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
4616 Xyce::dout() << section_divider <<
"\n";
4638 bool bsuccess =
true;
4641 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
4643 Xyce::dout() << section_divider <<
"\n";
4644 Xyce::dout() <<
"Instance::calcMobilities" <<
"\n";
4655 ci.
N = fabs(
CVec[i]);
4658 if (ci.
N == 0.0) ci.
N = 1.0;
4676 Xyce::dout() <<
"Nodal Mobilities:" << std::endl;
4679 Xyce::dout() <<
" unVec["<<i<<
"] = " <<
unVec[i];
4680 Xyce::dout() <<
" upVec["<<i<<
"] = " <<
upVec[i];
4681 Xyce::dout() <<
"\n";
4683 Xyce::dout() << std::endl;
4690 int inodeA = edgePtr->
inodeA;
4691 int inodeB = edgePtr->
inodeB;
4702 ci.
N = (fabs(
CVec[inodeA])+fabs(
CVec[inodeB]))*0.5;
4705 if (ci.
N == 0.0) ci.
N = 1.0;
4708 ci.
n = pow((fabs(
nnVec[inodeA])*fabs(
nnVec[inodeB])),0.5)*
4711 ci.
p = pow((fabs(
npVec[inodeA])*fabs(
npVec[inodeB])),0.5)*
4714 if (DEBUG_DEVICE && ci.
n != 0.0 && !(ci.
n > 0.0) && !(ci.
n < 0.0))
4716 Report::DevelFatal() <<
"ci.n is nan" << std::endl
4717 <<
"nnVec[A] = " <<
nnVec[inodeA] <<
"\n"
4718 <<
"nnVec[B] = " <<
nnVec[inodeB];
4734 Xyce::dout() <<
"Edge Mobilities" << std::endl;
4737 Xyce::dout() <<
" unE_Vec["<<i<<
"] = " <<
unE_Vec[i];
4738 Xyce::dout() <<
" upE_Vec["<<i<<
"] = " <<
upE_Vec[i];
4739 Xyce::dout() <<
"\n";
4743 if (isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
4745 Xyce::dout() << section_divider << std::endl;
4778 bool bsuccess =
true;
4816 bool bsuccess =
true;
4821 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
4823 Xyce::dout() << section_divider <<
"\n";
4824 Xyce::dout() <<
"Instance::calcVoltDepDensities\n";
4833 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
4835 Xyce::dout() << section_divider <<
"\n";
4852 bool bsuccess =
true;
4857 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
4859 Xyce::dout() << section_divider <<
"\n";
4860 Xyce::dout() <<
"Instance::calcDopingProfile\n";
4869 #ifdef Xyce_OXIDE_ENABLED
4870 if (allOxideFlag)
return bsuccess;
4885 double NaTmp = 1.0e+99;
4886 double NdTmp =-1.0e+99;
4890 if(NaTmp >
CVec[i]) NaTmp =
CVec[i];
4891 if(NdTmp <
CVec[i]) NdTmp =
CVec[i];
4910 XL = midpoint -
WJ/2.0;
4911 XR = midpoint +
WJ/2.0;
4920 XL = midpoint -
WJ/2.0;
4921 XR = midpoint +
WJ/2.0;
4926 Xyce::dout() <<
"deviceWidth = " <<
deviceWidth << std::endl;
4927 Xyce::dout() <<
"midpoint = " << midpoint << std::endl;
4928 Xyce::dout() <<
"XL = " <<
XL << std::endl;
4929 Xyce::dout() <<
"XR = " <<
XR << std::endl;
4930 Xyce::dout() <<
"WJ = " <<
WJ << std::endl;
4935 double yloc =
yVec[i];
4981 double Re = 0.5 * We;
4982 double Rb = 0.5 * Wad;
4992 Ae = log(Ne/Nb)/(Re*Re);
4993 Ab = log(Nb/Nc)/(Rb*Rb);
5012 Ae = log(Ne/Nb)/(Re*Re);
5013 Ab = log(Nb/Nc)/(Rb*Rb);
5035 double NaTmp = 1.0e+99;
5036 double NdTmp =-1.0e+99;
5040 if(NaTmp >
CVec[i]) NaTmp =
CVec[i];
5041 if(NdTmp <
CVec[i]) NdTmp =
CVec[i];
5079 double WDIFF = (WDEV-WOX)/2;
5081 double DT = 1.0e-11;
5110 double NaTmp = 1.0e+99;
5111 double NdTmp =-1.0e+99;
5115 if(NaTmp >
CVec[i]) NaTmp =
CVec[i];
5116 if(NdTmp <
CVec[i]) NdTmp =
CVec[i];
5132 std::map<std::string, DopeInfo *>::iterator iter;
5133 std::map<std::string, DopeInfo *>::iterator start =
dopeInfoMap.begin();
5134 std::map<std::string, DopeInfo *>::iterator end =
dopeInfoMap.end();
5136 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5138 Xyce::dout() <<
"dope info map:" << std::endl;
5140 for ( iter = start; iter != end; ++iter )
5144 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5164 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5166 Xyce::dout().width(20);
5167 Xyce::dout().precision(12);
5168 Xyce::dout().setf(std::ios::scientific);
5169 Xyce::dout() << std::endl;
5170 Xyce::dout() <<
"Na = " <<
Na << std::endl;
5171 Xyce::dout() <<
"Nd = " <<
Nd << std::endl<< std::endl;
5175 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5179 Xyce::dout() <<
xVec[inode];
5180 Xyce::dout() <<
" " <<
yVec[inode];
5181 Xyce::dout() <<
" CVec["<<inode<<
"] = " <<
CVec[inode] << std::endl;
5185 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5187 Xyce::dout() << section_divider << std::endl;
5225 bool bsuccess =
true;
5266 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5268 Xyce::dout() << std::endl
5303 bool bsuccess =
true;
5322 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
5323 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
5324 std::vector<DeviceInterfaceNode>::iterator iterDI = firstDI;
5326 for (;iterDI!=lastDI;++iterDI)
5328 for (i=0;i<iterDI->numBoundaryPoints;++i)
5339 int size = iterDI->areaVector.size();
5340 for (i = 0; i < size; ++i)
5361 #endif // Xyce_NEW_BC
5367 double Vtmp = (solVectorPtr)->getElementByGlobalIndex(
Vrowarray[i], 0);
5369 (solVectorPtr)->setElementByGlobalIndex(
Vrowarray[i], Vtmp, 0);
5373 double nntmp = (solVectorPtr)->getElementByGlobalIndex(
Nrowarray[i], 0);
5375 (solVectorPtr)->setElementByGlobalIndex(
Nrowarray[i], nntmp, 0);
5379 double nptmp = (solVectorPtr)->getElementByGlobalIndex(
Prowarray[i], 0);
5381 (solVectorPtr)->setElementByGlobalIndex(
Prowarray[i], nptmp, 0);
5419 bool bsuccess =
true;
5438 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
5439 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
5440 std::vector<DeviceInterfaceNode>::iterator iterDI = firstDI;
5442 for (;iterDI!=lastDI;++iterDI)
5444 for (i=0;i<iterDI->numBoundaryPoints;++i)
5455 int size = iterDI->areaVector.size();
5456 for (i = 0; i < size; ++i)
5477 #endif // Xyce_NEW_BC
5483 double Vtmp = (solVectorPtr)->getElementByGlobalIndex(
Vrowarray[i], 0);
5485 (solVectorPtr)->setElementByGlobalIndex(
Vrowarray[i], Vtmp, 0);
5489 double nntmp = (solVectorPtr)->getElementByGlobalIndex(
Nrowarray[i], 0);
5491 (solVectorPtr)->setElementByGlobalIndex(
Nrowarray[i], nntmp, 0);
5495 double nptmp = (solVectorPtr)->getElementByGlobalIndex(
Prowarray[i], 0);
5497 (solVectorPtr)->setElementByGlobalIndex(
Prowarray[i], nptmp, 0);
5537 bool bsuccess =
true;
5547 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
5548 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
5549 std::vector<DeviceInterfaceNode>::iterator iterDI = firstDI;
5551 for (;iterDI!=lastDI;++iterDI)
5553 for (i=0;i<iterDI->numBoundaryPoints;++i)
5602 bool bsuccess =
true;
5636 bool bsuccess =
true;
5640 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5642 Xyce::dout() << section_divider << std::endl;
5643 Xyce::dout() <<
"Instance::calcInitialGuess"<< std::endl;
5644 Xyce::dout() <<
" name = " <<
getName() << std::endl;
5653 double Cisq(0.0), Nisq(0.0);
5662 tmp = (fabs(Ci)+sqrt(Cisq+4*Nisq))/2.0;
5663 nnVec[i] = ((Ci>=0)?(tmp):(0.0)) + ((Ci<0)?(Nisq/tmp):(0.0));
5666 tmp = (fabs(Ci)+sqrt(Cisq+4*Nisq))/2.0;
5667 npVec[i] = ((Ci<=0)?(tmp):(0.0)) + ((Ci>0)?(Nisq/tmp):(0.0));
5669 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5671 Xyce::dout() <<
"nnVec[" << i <<
"] = " <<
nnVec[i];
5672 Xyce::dout() <<
" npVec[" << i <<
"] = " <<
npVec[i];
5673 Xyce::dout() << std::endl;
5690 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5692 Xyce::dout() <<
"VVec[" << i <<
"] = " <<
VVec[i] << std::endl;
5698 double VminTmp = +1.0e+99;
5699 double VmaxTmp = -1.0e+99;
5701 double VminBC = +1.0e+99;
5702 double VmaxBC = -1.0e+99;
5704 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
5705 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
5706 std::vector<DeviceInterfaceNode>::iterator iterDI;
5708 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
5711 std::vector<int>::iterator iterNode = labelPtr->
mNodeVector.begin();
5712 std::vector<int>::iterator lastNode = labelPtr->
mNodeVector.end ();
5714 for ( ;iterNode!=lastNode;++iterNode)
5716 if (VminTmp >
VVec[*iterNode]) VminTmp =
VVec[*iterNode];
5717 if (VmaxTmp <
VVec[*iterNode]) VmaxTmp =
VVec[*iterNode];
5719 int ilocal = iterDI->meshGlobalToLocal[*iterNode];
5720 if (VminBC > iterDI->VequVec[ilocal]) VminBC = iterDI->VequVec[ilocal];
5721 if (VmaxBC < iterDI->VequVec[ilocal]) VmaxBC = iterDI->VequVec[ilocal];
5725 double Voffset = -VminTmp;
5726 double VtotDiff = VmaxTmp-VminTmp;
5727 double VBCDiff = VmaxBC-VminBC;
5728 double Vscale = (VtotDiff!=0.0)?(VBCDiff/VtotDiff):1.0;
5730 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5732 Xyce::dout() <<
"Voffset = " << Voffset << std::endl;
5733 Xyce::dout() <<
"VtotDiff = " << VtotDiff << std::endl;
5734 Xyce::dout() <<
"VBCDiff = " << VBCDiff << std::endl;
5735 Xyce::dout() <<
"Vscale = " << Vscale << std::endl;
5752 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5754 Xyce::dout() <<
"VVec[" << i <<
"] = " <<
VVec[i] << std::endl;
5759 #endif // Xyce_NEW_BC
5766 (solVectorPtr)->setElementByGlobalIndex(
Vrowarray[i],
VVec[i], 0);
5768 (solVectorPtr)->setElementByGlobalIndex(
Nrowarray[i],
nnVec[i], 0);
5770 (solVectorPtr)->setElementByGlobalIndex(
Prowarray[i],
npVec[i], 0);
5791 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5793 Xyce::dout() << std::endl;
5794 Xyce::dout().setf(std::ios::scientific);
5795 Xyce::dout() <<
"Vmax = " <<
VmaxExp << std::endl;
5796 Xyce::dout() <<
"Vmin = " <<
VminExp << std::endl;
5797 Xyce::dout() << std::endl;
5800 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5802 Xyce::dout() << section_divider << std::endl;
5821 bool bsuccess =
true;
5824 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5826 Xyce::dout() << section_divider << std::endl;
5827 Xyce::dout() <<
"Instance::calcVequBCs"<< std::endl;
5828 Xyce::dout() <<
" name = " <<
getName() << std::endl;
5829 Xyce::dout() <<
" Na = "<<
Na << std::endl;
5830 Xyce::dout() <<
" Nd = "<<
Nd << std::endl;
5833 double VminBC =+1.0e+99;
5834 double VmaxBC =-1.0e+99;
5836 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
5837 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
5838 std::vector<DeviceInterfaceNode>::iterator iterDI;
5840 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
5842 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5844 Xyce::dout() <<
"DI name = " << iterDI->eName << std::endl;
5845 Xyce::dout() <<
"material = " << iterDI->material << std::endl;
5846 if (iterDI->materialGiven)
5848 Xyce::dout() <<
"material was given" << std::endl;
5852 Xyce::dout() <<
"material was NOT given" << std::endl;
5855 if (iterDI->oxideBndryFlag)
5857 Xyce::dout() <<
"This is a boundary WITH an oxide." << std::endl;
5861 Xyce::dout() <<
"This is a boundary WITHOUT an oxide." << std::endl;
5864 Xyce::dout().setf(std::ios::scientific);
5867 std::string insul =
"sio2";
5870 std::vector<int>::iterator iterNode = labelPtr->
mNodeVector.begin();
5871 std::vector<int>::iterator lastNode = labelPtr->
mNodeVector.end ();
5873 for (i=0;i<iterDI->numBoundaryPoints;++i,++iterNode)
5875 double Ci =
CVec[*iterNode];
5876 double ns =
nnVec[*iterNode];
5877 double Cisq = Ci*Ci;
5878 double Nisq =
Ni*
Ni;
5879 double tmp, nnTmp, npTmp;
5882 tmp = (fabs(Ci)+sqrt(Cisq+4*Nisq))/2.0;
5883 nnTmp = ((Ci>=0)?(tmp):(0.0)) + ((Ci<0)?(Nisq/tmp):(0.0));
5886 tmp = (fabs(Ci)+sqrt(Cisq+4*Nisq))/2.0;
5887 npTmp = ((Ci<=0)?(tmp):(0.0)) + ((Ci>0)?(Nisq/tmp):(0.0));
5889 ExtendedString mater = iterDI->material;
5892 if (mater==
"neutral")
5897 iterDI->VequVec[i] = +
Vt * log(nnTmp/Ni);
5902 iterDI->VequVec[i] = -
Vt * log(npTmp/Ni);
5913 + 2.0 *
Vt * log(nnTmp/Ni);
5920 - 2.0 *
Vt * log(npTmp/Ni);
5928 if (iterDI->oxideBndryFlag)
5930 iterDI->VequVec[i] += - iterDI->oxcharge *
charge *iterDI->oxthick/
5934 iterDI->VbcVec [i] = 0.0;
5936 if (VminBC > iterDI->VequVec[i]) VminBC = iterDI->VequVec[i];
5937 if (VmaxBC < iterDI->VequVec[i]) VmaxBC = iterDI->VequVec[i];
5939 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5941 Xyce::dout() <<
"Vequ["<<i<<
"]=" << iterDI->VequVec[i];
5942 Xyce::dout() << std::endl;
5947 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5949 Xyce::dout() <<
"After offset:" << std::endl;
5953 double Voffset = -VminBC;
5955 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
5957 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5959 Xyce::dout() <<
"DI name = " << iterDI->eName << std::endl;
5960 Xyce::dout().setf(std::ios::scientific);
5963 for (i=0;i<iterDI->numBoundaryPoints;++i)
5965 iterDI->VequVec[i] += Voffset;
5966 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5968 Xyce::dout() <<
"VequVec["<<i<<
"] = " << iterDI->VequVec[i] << std::endl;
5973 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
5975 Xyce::dout() << section_divider << std::endl;
5996 bool bsuccess =
true;
5997 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
5998 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
5999 std::vector<DeviceInterfaceNode>::iterator iterDI;
6001 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
6003 Xyce::dout() << section_divider<< std::endl;
6004 Xyce::dout() << std::endl <<
"In Instance::calcDensityBCs" << std::endl;
6013 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
6015 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
6017 Xyce::dout() << iterDI->eName<<
":" << std::endl;
6022 for (
int i=0;i<iterDI->numBoundaryPoints;++i)
6031 iterDI->nnbcVec[i] =
6034 iterDI->npbcVec[i] =
6035 0.5*(sqrt(
CVec[nIndex]*
CVec[nIndex]+4*Ni*Ni)-
CVec[nIndex]);
6037 if (NnMax < iterDI->nnbcVec[i])
NnMax = iterDI->nnbcVec[i];
6038 if (NpMax < iterDI->npbcVec[i])
NpMax = iterDI->npbcVec[i];
6040 if (
NnMin > iterDI->nnbcVec[i])
NnMin = iterDI->nnbcVec[i];
6041 if (
NpMin > iterDI->npbcVec[i])
NpMin = iterDI->npbcVec[i];
6043 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
6045 Xyce::dout() <<
"\tCVec["<<nIndex<<
"] = " <<
CVec[nIndex]<< std::endl;
6046 Xyce::dout() <<
"\tnnbc["<<i<<
"] = " << iterDI->nnbcVec[i] << std::endl;
6047 Xyce::dout() <<
"\tnpbc["<<i<<
"] = " << iterDI->npbcVec[i] << std::endl;
6054 std::vector<int>::iterator iterNode = labelPtr->
mNodeVector.begin();
6055 std::vector<int>::iterator lastNode = labelPtr->
mNodeVector.end ();
6057 for ( ;iterNode!=lastNode;++iterNode)
6059 int i1 = iterDI->meshGlobalToLocal[*iterNode];
6068 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
6070 Xyce::dout() << std::endl;
6071 Xyce::dout() <<
"NnMax = " <<
NnMax << std::endl;
6072 Xyce::dout() <<
"NpMax = " <<
NpMax << std::endl;
6073 Xyce::dout() <<
"NnMin = " <<
NnMin << std::endl;
6074 Xyce::dout() <<
"NpMin = " <<
NpMin << std::endl;
6075 Xyce::dout() << section_divider<< std::endl;
6098 bool bsuccess =
true;
6100 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
6101 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
6102 std::vector<DeviceInterfaceNode>::iterator iterDI;
6104 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
6106 Xyce::dout() << std::endl << section_divider << std::endl;
6107 Xyce::dout() << std::endl <<
"In Instance::calcBoundaryConditions" << std::endl;
6110 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
6114 for (i=0;i<iterDI->numBoundaryPoints;++i)
6116 iterDI->VbcVec[i] = iterDI->Vckt_ramp + iterDI->VequVec[i];
6121 for (i=0;i<iterDI->numBoundaryPoints;++i)
6123 iterDI->VbcVec[i] = iterDI->Vckt + iterDI->VequVec[i];
6131 std::vector<int>::iterator iterNode = labelPtr->
mNodeVector.begin();
6132 std::vector<int>::iterator lastNode = labelPtr->
mNodeVector.end ();
6134 for ( ;iterNode!=lastNode;++iterNode)
6136 int i1 = iterDI->meshGlobalToLocal[*iterNode];
6137 VVec[*iterNode] = iterDI->VbcVec [i1];
6138 nnVec[*iterNode] = iterDI->nnbcVec[i1];
6139 npVec[*iterNode] = iterDI->npbcVec[i1];
6141 #endif // Xyce_NEW_BC
6143 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
6145 Xyce::dout() << iterDI->eName <<
":" << std::endl;
6146 for (i=0;i<iterDI->numBoundaryPoints;++i)
6148 Xyce::dout()<<
"Vbc["<<i<<
"] = "<<iterDI->VbcVec[i]<<
", "<<iterDI->VbcVec[i]*
scalingVars.
V0;
6149 Xyce::dout() <<
" nnbc["<<i<<
"] = "<< iterDI->nnbcVec[i];
6151 Xyce::dout() <<
" npbc["<<i<<
"] = "<< iterDI->npbcVec[i];
6153 Xyce::dout() << std::endl;
6158 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6160 Xyce::dout() << section_divider << std::endl;
6186 bool bsuccess =
true;
6188 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
6190 Xyce::dout() << std::endl << section_divider << std::endl;
6191 Xyce::dout() << std::endl <<
"In Instance::obtainNodeVoltages" << std::endl;
6196 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
6197 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
6198 std::vector<DeviceInterfaceNode>::iterator iterDI;
6200 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
6205 if (iterDI->gid != -1)
6206 iterDI->Vckt = (solVectorPtr)->getElementByGlobalIndex(iterDI->gid, 0);
6212 iterDI->Vckt = (*solVectorPtr)[iterDI->lid];
6219 Xyce::dout() << iterDI->eName <<
" Vckt = " << iterDI->Vckt;
6220 Xyce::dout() <<
" Vckt*scalingVars.V0 = " << (iterDI->Vckt *
scalingVars.
V0) << std::endl;
6226 Xyce::dout() << section_divider << std::endl;
6247 bool bsuccess =
true;
6249 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
6250 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
6251 std::vector<DeviceInterfaceNode>::iterator iterDI;
6253 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6255 Xyce::dout() << std::endl << section_divider << std::endl;
6256 Xyce::dout() <<
"device: " <<
getName() << std::endl;
6259 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
6263 double v1_orig = v1;
6264 double delV1 = v1 - v1_old;
6266 if ( delV1 > 1.25 ) v1 = v1_old + 1.25;
6267 if ( delV1 < -0.75 ) v1 = v1_old - 0.75;
6269 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6271 Xyce::dout() <<
"electrode = " << iterDI->eName << std::endl;
6272 Xyce::dout() <<
"v1 = " << v1 << std::endl;
6273 Xyce::dout() <<
"v1_old = " << v1_old << std::endl;
6274 Xyce::dout() <<
"v1_orig = " << v1_orig << std::endl;
6275 Xyce::dout() <<
"v1/scalingVars.V0 = " << v1/
scalingVars.
V0 << std::endl;
6276 Xyce::dout() <<
"v1_old/scalingVars.V0 = " << v1_old/
scalingVars.
V0 << std::endl;
6277 Xyce::dout() <<
"v1_orig/scalingVars.V0 = " << v1_orig/
scalingVars.
V0 << std::endl;
6278 Xyce::dout() << std::endl;
6285 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6287 Xyce::dout() << section_divider << std::endl;
6304 bool bsuccess =
true;
6309 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6311 Xyce::dout() << section_divider <<
"\n";
6312 Xyce::dout() <<
"Instance::obtainSolution\n";
6313 Xyce::dout() <<
"solVectorPtr = " << solVectorPtr << std::endl;
6317 bsuccess = bsuccess && bs1;
6326 #endif // Xyce_NEW_BC
6334 VVec[i] = (solVectorPtr)->getElementByGlobalIndex(
Vrowarray[i], 0);
6347 Xyce::dout() <<
"VVec["<<i<<
"]=\t";
6348 Xyce::dout().width(20);
6349 Xyce::dout().precision(12);
6350 Xyce::dout().setf(std::ios::scientific);
6351 Xyce::dout() <<
VVec[i];
6353 Xyce::dout() <<
"\n";
6364 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6366 Xyce::dout() <<
" About to get the density.\n";
6367 if (
getSolverState().dcopFlag) Xyce::dout() <<
"DCOP load" << std::endl;
6368 else Xyce::dout() <<
"Transient load" << std::endl;
6380 #endif // Xyce_NEW_BC
6403 Xyce::dout()<<
" Obtaining densities from solution vector (not voltage dep.)\n";
6410 #endif // Xyce_NEW_BC
6417 nnVec[i] = (solVectorPtr)->getElementByGlobalIndex(
Nrowarray[i], 0);
6424 #ifdef Xyce_PDE_DENSITY_CONSTRAINT
6433 (solVectorPtr)->setElementByGlobalIndex(
Nrowarray[i], 0.0, 0);
6447 npVec[i] = (solVectorPtr)->getElementByGlobalIndex(
Prowarray[i], 0);
6455 #ifdef Xyce_PDE_DENSITY_CONSTRAINT
6463 (solVectorPtr)->setElementByGlobalIndex(
Prowarray[i], 0.0, 0);
6478 Xyce::dout() <<
"nnVec["<<i<<
"]=\t";
6479 Xyce::dout().width(14);
6480 Xyce::dout().precision(6);
6481 Xyce::dout().setf(std::ios::scientific);
6482 Xyce::dout() <<
nnVec[i];
6485 Xyce::dout() <<
" npVec["<<i<<
"]=\t";
6486 Xyce::dout().width(14);
6487 Xyce::dout().precision(6);
6488 Xyce::dout().setf(std::ios::scientific);
6489 Xyce::dout() <<
npVec[i];
6492 Xyce::dout() << std::endl;
6507 bsuccess = bsuccess && bs1;
6514 bsuccess = bsuccess && bs1;
6518 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6520 Xyce::dout() << section_divider << std::endl;
6536 bool bsuccess =
true;
6541 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6543 Xyce::dout() << section_divider <<
"\n";
6544 Xyce::dout() <<
"Instance::calcRecombination\n";
6545 Xyce::dout() <<
"\n";
6550 double n =
nnVec[i];
6551 double p =
npVec[i];
6552 double tn =
tnVec[i];
6553 double tp =
tpVec[i];
6559 RVec[i] = (Rsrh + Raug);
6563 Xyce::dout().precision(4);
6564 Xyce::dout() <<
" nnVec="<<n<<
" npVec="<<p;
6565 Xyce::dout() <<
" tnVec="<<tn<<
" tpVec="<<tp;
6566 Xyce::dout() <<
" Rsrh="<<Rsrh;
6567 Xyce::dout() <<
" Raug="<<Raug;
6568 Xyce::dout() <<
" RVec["<<i<<
"]="<<
RVec[i];
6569 Xyce::dout() <<
"\n";
6572 if (isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6574 Xyce::dout().precision(4);
6575 Xyce::dout() <<
" RVec["<<i<<
"]="<<
RVec[i];
6576 Xyce::dout() << std::endl;
6580 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6582 Xyce::dout() << section_divider << std::endl;
6603 bool bsuccess =
true;
6606 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6608 Xyce::dout() << section_divider <<
"\n";
6609 Xyce::dout() <<
"Instance::sumSources\n";
6610 Xyce::dout() <<
"\n";
6618 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6620 Xyce::dout() <<
"RVec["<<i<<
"] = " <<
RVec[i];
6621 Xyce::dout() <<
" SVec["<<i<<
"] = " << SVec[i];
6622 Xyce::dout() <<
" totSrcVec["<<i<<
"] = " <<
totSrcVec[i] <<
"\n";
6626 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6628 Xyce::dout() << section_divider << std::endl;
6645 bool bsuccess =
true;
6654 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6656 Xyce::dout() << section_divider <<
"\n";
6657 Xyce::dout() <<
"Instance::pdRecombination\n";
6658 Xyce::dout() <<
"\n";
6663 double n =
nnVec[i];
6664 double p =
npVec[i];
6665 double tn =
tnVec[i];
6666 double tp =
tpVec[i];
6674 dRdnVec[i] = (dRsrhdn + dRaugdn);
6675 dRdpVec[i] = (dRsrhdp + dRaugdp);
6679 Xyce::dout() <<
" dRdnVec["<<i<<
"] = " <<
dRdnVec[i];
6680 Xyce::dout() <<
" dRdpVec["<<i<<
"] = " <<
dRdpVec[i];
6681 Xyce::dout() <<
"\n";
6685 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6687 Xyce::dout() << section_divider << std::endl;
6703 bool bsuccess =
true;
6711 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6713 Xyce::dout() << section_divider <<
"\n";
6714 Xyce::dout() <<
"Instance::calcElectronCurrent\n";
6715 Xyce::dout() <<
"\n";
6722 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6724 Xyce::dout() <<
"\n";
6725 Xyce::dout() <<
"i="<<i<<
"\n";
6730 int inodeA = edgePtr->
inodeA;
6731 int inodeB = edgePtr->
inodeB;
6732 double elen = edgePtr->
elen;
6737 if (jnMax < fabs(
JnVec[i]) )
6740 jnMax = fabs(
JnVec[i]);
6743 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6750 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6752 double jScale = 1.0;
6753 double xScale = 1.0;
6756 Xyce::dout().setf(std::ios::scientific);
6757 Xyce::dout() <<
" Max Electron current = " << jnMax;
6758 Xyce::dout() <<
" jScale = " << jScale;
6759 Xyce::dout() <<
"\n";
6762 int inodeA = edgePtr->
inodeA;
6763 int inodeB = edgePtr->
inodeB;
6765 Xyce::dout() <<
" max locations A: (x,y) = (" <<
xVec[inodeA]*xScale<<
", ";
6766 Xyce::dout() <<
yVec[inodeA]*xScale<<
")\n";
6767 Xyce::dout() <<
" max locations B: (x,y) = (" <<
xVec[inodeB]*xScale<<
", ";
6768 Xyce::dout() <<
yVec[inodeB]*xScale<<
")\n";
6769 Xyce::dout() <<
" nodes: inodeA = "<<inodeA<<
" inodeB = " << inodeB<< std::endl;
6771 Xyce::dout() <<
" VVec["<<inodeA<<
"] = " <<
VVec[inodeA];
6772 Xyce::dout() <<
" VVec["<<inodeB<<
"] = " << VVec[inodeB] << std::endl;
6774 Xyce::dout() <<
" nnVec["<<inodeA<<
"] = " <<
nnVec[inodeA];
6775 Xyce::dout() <<
" nnVec["<<inodeB<<
"] = " << nnVec[inodeB] << std::endl;
6777 Xyce::dout() <<
" elen = " << edgePtr->
elen << std::endl;
6778 Xyce::dout() << section_divider << std::endl;
6795 bool bsuccess =
true;
6800 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6802 Xyce::dout() << section_divider <<
"\n";
6803 Xyce::dout() <<
"Instance::pdElectronCurrent\n";
6804 Xyce::dout() <<
"\n";
6810 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6812 Xyce::dout() << subsection_divider <<
"\n";
6813 Xyce::dout() <<
"i="<<i;
6817 int inodeA = edgePtr->
inodeA;
6818 int inodeB = edgePtr->
inodeB;
6819 double elen = edgePtr->
elen;
6833 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6835 Xyce::dout() <<
" dJndn1="<<
dJndn1Vec[i];
6836 Xyce::dout() <<
" dJndn2="<<
dJndn2Vec[i];
6837 Xyce::dout() <<
" dJndV1="<<
dJndV1Vec[i];
6838 Xyce::dout() <<
" dJndV2="<<
dJndV2Vec[i];
6839 Xyce::dout() <<
"\n";
6843 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6845 Xyce::dout() << section_divider << std::endl;
6861 bool bsuccess =
true;
6868 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6870 Xyce::dout() << section_divider <<
"\n";
6871 Xyce::dout() <<
"Instance::calcHoleCurrent\n";
6872 Xyce::dout() <<
"\n";
6878 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6880 Xyce::dout() <<
"\n";
6881 Xyce::dout() <<
"i="<<i<<
"\n";
6886 int inodeA = edgePtr->
inodeA;
6887 int inodeB = edgePtr->
inodeB;
6888 double elen = edgePtr->
elen;
6893 if (jpMax < fabs(
JpVec[i]) )
6896 jpMax = fabs(
JpVec[i]);
6899 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6906 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6908 double jScale = 1.0;
6909 double xScale = 1.0;
6912 Xyce::dout().setf(std::ios::scientific);
6913 Xyce::dout() <<
" Max Hole current = " << jpMax;
6914 Xyce::dout() <<
" jScale = " << jScale;
6915 Xyce::dout() <<
"\n";
6918 int inodeA = edgePtr->
inodeA;
6919 int inodeB = edgePtr->
inodeB;
6921 Xyce::dout() <<
" max locations A: (x,y) = (" <<
xVec[inodeA]*xScale<<
", ";
6922 Xyce::dout() <<
yVec[inodeA]*xScale<<
")\n";
6923 Xyce::dout() <<
" max locations B: (x,y) = (" <<
xVec[inodeB]*xScale<<
", ";
6924 Xyce::dout() <<
yVec[inodeB]*xScale<<
")\n";
6925 Xyce::dout() <<
" nodes: inodeA = "<<inodeA<<
" inodeB = " << inodeB<< std::endl;
6927 Xyce::dout() <<
" VVec["<<inodeA<<
"] = " <<
VVec[inodeA];
6928 Xyce::dout() <<
" VVec["<<inodeB<<
"] = " << VVec[inodeB] << std::endl;
6930 Xyce::dout() <<
" npVec["<<inodeA<<
"] = " <<
npVec[inodeA];
6931 Xyce::dout() <<
" npVec["<<inodeB<<
"] = " << npVec[inodeB] << std::endl;
6933 Xyce::dout() <<
" elen = " << edgePtr->
elen << std::endl;
6934 Xyce::dout() << section_divider << std::endl;
6951 bool bsuccess =
true;
6956 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6958 Xyce::dout() << section_divider <<
"\n";
6959 Xyce::dout() <<
"Instance::pdHoleCurrent\n";
6960 Xyce::dout() <<
"\n";
6967 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6969 Xyce::dout() << subsection_divider <<
"\n";
6970 Xyce::dout() <<
"i="<<i;
6971 Xyce::dout() <<
"\n";
6975 int inodeA = edgePtr->
inodeA;
6976 int inodeB = edgePtr->
inodeB;
6977 double elen = edgePtr->
elen;
6991 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
6993 Xyce::dout() <<
" dJpdn1="<<
dJpdn1Vec[i];
6994 Xyce::dout() <<
" dJpdn2="<<
dJpdn2Vec[i];
6995 Xyce::dout() <<
" dJpdV1="<<
dJpdV1Vec[i];
6996 Xyce::dout() <<
" dJpdV2="<<
dJpdV2Vec[i];
6997 Xyce::dout() <<
"\n" <<
"\n";
7002 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
7004 Xyce::dout() << section_divider << std::endl;
7027 bool bsuccess =
true;
7032 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
7034 Xyce::dout() << section_divider <<
"\n";
7035 Xyce::dout() <<
"Instance::calcEfield\n";
7036 Xyce::dout() <<
"\n";
7046 int inodeA = edgePtr->
inodeA;
7047 int inodeB = edgePtr->
inodeB;
7048 double elen = edgePtr->
elen;
7054 Xyce::dout() <<
" VV[A] = " <<
VVec[inodeA];
7055 Xyce::dout() <<
" VV[B] = " <<
VVec[inodeB];
7056 Xyce::dout() <<
" elen = " << elen;
7058 Xyce::dout() <<
" EfieldVec["<<i<<
"] = " <<
EfieldVec[i];
7059 Xyce::dout() <<
" E*scalingVars.E0 = " << EfieldVec[i]*
scalingVars.
E0;
7060 Xyce::dout() <<
"\n";
7064 Xyce::dout() <<
" edge = " << i;
7065 Xyce::dout() <<
" elen = " << elen;
7066 Report::DevelFatal() <<
"elen less than zero";
7070 if (absEfield >
Emax)
7079 else { eScale = 1.0; }
7083 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
7087 else { xScale = 1.0; }
7089 Xyce::dout().setf(std::ios::scientific);
7090 Xyce::dout() <<
" Max Efield = " <<
Emax;
7091 Xyce::dout() <<
" eScale = " << eScale;
7092 Xyce::dout() <<
"\n";
7095 int inodeA = edgePtr->
inodeA;
7096 int inodeB = edgePtr->
inodeB;
7098 Xyce::dout() <<
" max locations A: (x,y) = (" <<
xVec[inodeA]*xScale<<
", ";
7099 Xyce::dout() <<
yVec[inodeA]*xScale<<
")\n";
7100 Xyce::dout() <<
" max locations B: (x,y) = (" <<
xVec[inodeB]*xScale<<
", ";
7101 Xyce::dout() <<
yVec[inodeB]*xScale<<
")\n";
7102 Xyce::dout() <<
" nodes: inodeA = "<<inodeA<<
" inodeB = " << inodeB<< std::endl;
7103 Xyce::dout() <<
" VVec["<<inodeA<<
"] = " <<
VVec[inodeA];
7104 Xyce::dout() <<
" VVec["<<inodeB<<
"] = " << VVec[inodeB] << std::endl;
7105 Xyce::dout() <<
" elen = " << edgePtr->
elen << std::endl;
7106 Xyce::dout() << section_divider << std::endl;
7130 bool bnoChange =
true;
7132 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
7134 Xyce::dout() << section_divider <<
"\n";
7135 Xyce::dout() <<
"Instance::enableContinuation. " <<
outputName;
7136 Xyce::dout() << std::endl;
7141 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
7142 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
7143 std::vector<DeviceInterfaceNode>::iterator iterDI;
7153 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
7155 iterDI->Vckt_old = iterDI->Vckt;
7161 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
7163 iterDI->Vckt_final = iterDI->Vckt;
7164 iterDI->Vckt_orig = iterDI->Vckt;
7173 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
7175 double dV,tmp1V, tmp2V;
7176 tmp1V = iterDI->Vckt_final;
7177 tmp2V = iterDI->Vckt_old;
7180 iterDI->Vckt_delta = dV;
7182 iterDI->Vckt_deltaC = dV/
static_cast<double>(max_PDE_continuation_steps);
7188 if (fabs(iterDI->Vckt_deltaC) > maxDelta)
7190 int tmp_steps =
static_cast<int>(fabs(dV)/maxDelta) + 1;
7191 max_PDE_continuation_steps = tmp_steps;
7193 iterDI->Vckt_deltaC = dV/
static_cast<double>(max_PDE_continuation_steps);
7196 if (fabs(dV) > 1.0e-3) bnoChange =
false;
7200 Xyce::dout() << std::endl;
7202 Xyce::dout().width(10);
7203 Xyce::dout() << iterDI->eName;
7204 Xyce::dout().width(10); Xyce::dout().precision(2);
7205 Xyce::dout() <<
": dV = " << dV;
7206 Xyce::dout() <<
" Vckt_final = " << iterDI->Vckt_final;
7207 Xyce::dout() <<
" Vckt_old = " << iterDI->Vckt_old << std::endl;
7208 Xyce::dout() <<
" delta = " << iterDI->Vckt_delta;
7209 Xyce::dout() <<
" deltaC = " << iterDI->Vckt_deltaC;
7210 Xyce::dout() <<
" steps = " << max_PDE_continuation_steps;
7211 Xyce::dout() << std::endl;
7214 iterDI->Vckt_ramp = iterDI->Vckt_old;
7215 iterDI->Vckt_ramp_old = iterDI->Vckt_old;
7218 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
7220 if (bnoChange) Xyce::dout() <<
"bnoChange is TRUE" << std::endl;
7221 else Xyce::dout() <<
"bnoChange is FALSE" << std::endl;
7226 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
7228 Xyce::dout() << section_divider << std::endl;
7233 return (!bnoChange);
7250 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
7251 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
7252 std::vector<DeviceInterfaceNode>::iterator iterDI;
7254 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
7256 iterDI->Vckt_old = iterDI->Vckt_final;
7276 Xyce::dout() << section_divider << std::endl;
7277 Xyce::dout() <<
"Instance::setPDEContinuationAlpha" << std::endl;
7282 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
7283 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
7284 std::vector<DeviceInterfaceNode>::iterator iterDI;
7286 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
7288 iterDI->Vckt_ramp = iterDI->Vckt_old + (iterDI->Vckt_delta)*alpha;
7291 if ((iterDI->Vckt_delta > 0 && iterDI->Vckt_ramp > iterDI->Vckt_final) ||
7292 (iterDI->Vckt_delta <= 0 && iterDI->Vckt_ramp <= iterDI->Vckt_final) )
7294 iterDI->Vckt_ramp = iterDI->Vckt_final;
7296 #ifdef Xyce_NEW_PDE_CONTINUATION
7298 iterDI->Vckt_old = iterDI->Vckt_final;
7302 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
7305 Xyce::dout().width(10);
7306 Xyce::dout() <<iterDI->eName;
7307 Xyce::dout() <<
"\tVckt_ramp = " << iterDI->Vckt_ramp;
7308 Xyce::dout() <<
"\tVckt_old = " << iterDI->Vckt_old;
7309 Xyce::dout() <<
"\talpha = " << alpha;
7310 Xyce::dout() << std::endl;
7327 Xyce::dout() << section_divider << std::endl;
7328 Xyce::dout() <<
"Instance::setPDEContinuationBeta" << std::endl;
7332 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
7333 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
7334 std::vector<DeviceInterfaceNode>::iterator iterDI;
7336 for (iterDI=firstDI;iterDI!=lastDI;++iterDI)
7338 iterDI->Vckt_ramp = iterDI->Vckt*beta;
7341 Xyce::dout() <<
" " << iterDI->eName <<
" Vckt_ramp = " << iterDI->Vckt_ramp << std::endl;
7357 .registerDevice(
"pde", 2)
7358 .registerModelType(
"pde", 2)
7359 .registerModelType(
"zod", 2);
const InstanceName & getName() const
bool calcBoundaryConditions()
std::vector< double > RVec
std::vector< double > displPotential
double Jn(double n1, double n2, double E, double u, double h)
std::vector< int > neighborNodes
std::vector< int > li_stateDispl
bool updateDependentParameters()
double getNi_old(const std::string &material, double temp)
std::vector< int > stateDispl_owned
double dJndV2(double n1, double n2, double E, double u, double h)
const SolverState & solverState_
static double ngdep(double x, double y, double W, double ax, double ay)
std::vector< int > nnOwnVec
Descriptor & addPar(const char *parName, T default_value, T U::*varPtr)
Adds the parameter description to the parameter map.
Linear::System * lasSysPtr
static ParametricData< DopeInfo > & getParametricData()
bool scaleDopeVariables()
void setPDEContinuationAlpha(double alpha)
std::vector< double > CVec
bool enablePDEContinuation(int &max_PDE_continuation_steps)
Linear::Vector * nextSolVectorPtr
std::vector< int > devConMap
std::vector< double > & vals
std::vector< std::vector< int > > li_VoffsetArray
std::vector< int > li_Vrowarray
bool given(const std::string ¶meter_name) const
static double nsdep(double x, double W, double Dt)
Pure virtual class to augment a linear system.
std::vector< int > Vrowarray
std::vector< double > CdonorVec
double Jp(double p1, double p2, double E, double u, double h)
bool calcConductance(int iElectrode, const Linear::Vector *dxdvPtr)
bool loadMatKCLDDForm(Linear::Matrix *matPtr)
bool updateSecondaryState()
std::vector< double > upE_Vec
std::vector< double > dJndn1Vec
std::vector< int > npOwnVec
std::vector< double > totSrcVec
bool labelEdgeType(std::string &labelName)
double pdRaugN(const std::string &material, double ni, double n, double p)
std::vector< int > Nrowarray
std::vector< double > EfieldVec
std::vector< int > boundarySten
std::vector< double > dJpdn2Vec
Linear::Vector * tmpdQdXPtr
static ParametricData< PDE_2DElectrode > & getParametricData()
std::map< std::string, int > labelDIMap
bool checkForElectrodeOverlap()
double calcRaug(const std::string &material, double ni, double n, double p)
Linear::Vector * tmpdIdXPtr
double getRelPerm(const std::string &material)
double workfunc(std::string &metal)
double bandgap(const std::string &material, double temp)
bool scaleMesh(double xScale)
bool loadDFDV(int ielectrode, Linear::Vector *dfdvPtr)
PDE_2DMesh * meshCopyContainerPtr
std::vector< std::vector< int > > li_PoffsetArray
std::vector< double > dJpdn1Vec
const std::string & getName(const C *c)
Returns the name of the specified object.
CompositeParam * constructComposite(const std::string &compositeName, const std::string ¶mName)
double dJpdV2(double p1, double p2, double E, double u, double h)
std::vector< std::string > labelNameVector
void setParams(const std::vector< Param > ¶ms)
std::vector< std::vector< int > > Vcolarray
std::vector< double > xVec
The FactoryBlock contains parameters needed by the device, instance and model creation functions...
const DeviceOptions & getDeviceOptions() const
std::vector< int > li_Nrowarray
std::vector< double > dJndV1Vec
Instance(const Configuration &configuration, const InstanceBlock &IB, Model &model, const FactoryBlock &factory_block)
void addComposite(const char *comp_name, const ParametricData< U > &composite_pars, std::map< std::string, U * > V::*composite_map)
Adds a composite parameter to the parameter map.
std::vector< double > dJpdV2Vec
bool applyVoltageLimiting()
std::vector< double > nnVec
void setPDEContinuationBeta(double beta)
const DeviceOptions & deviceOptions_
std::vector< std::vector< double > > condVec
std::vector< double > tnVec
bool loadVecNLPoisson(double scalar, Linear::Vector *vecPtr)
std::vector< double > VVec
bool updateTemperature(const double &temp_tmp)
bool updatePrimaryState()
Linear::Vector * nextStaVectorPtr
bool pdTerminalCurrents()
static Config< T > & addConfiguration()
Adds the device to the Xyce device configuration.
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
std::vector< double > displCurrent
bool calcTerminalCharges()
void setupInfo2d(std::vector< double > &CVec, std::vector< double > &CdonorVec, std::vector< double > &CacceptorVec, std::vector< double > &xVec, std::vector< double > &yVec, DeviceSupport &devSup)
std::vector< double > unVec
double getVoltDepElecDens(double Vmax, double V, double Nd)
double dJndn2(double n1, double n2, double E, double u, double h)
double calcRsrh(const std::string &material, double ni, double n, double p, double tn, double tp)
The Device class is an interface for device implementations.
bool unScaleDopeVariables()
double dJpdn2(double p1, double p2, double E, double u, double h)
bool obtainNodeVoltages()
std::vector< double > dJndn2Vec
std::vector< double > CacceptorVec
bool disablePDEContinuation()
std::vector< double > dRdnVec
std::map< std::string, PDE_2DElectrode * > electrodeMap
std::vector< int > stateDispl
std::vector< DeviceInterfaceNode > dIVec
bool updateIntermediateVars()
double calcLt(bool holeFlag, double conc, std::string material="si")
Class Configuration contains device configuration data.
double pdRsrhN(const std::string &material, double ni, double n, double p, double tn, double tp)
double pdRaugP(const std::string &material, double ni, double n, double p)
static void loadInstanceParameters(ParametricData< Instance > &instance_parameters)
std::vector< double > dJndV2Vec
bool loadVecDDForm(double scalar, double dndtScalar, Linear::Vector *vecPtr)
std::vector< double > JpVec
std::vector< double > dFdVckt
const SolverState & getSolverState() const
std::map< std::string, DopeInfo * > dopeInfoMap
double affin(const std::string &material)
double dJpdV1(double p1, double p2, double E, double u, double h)
std::vector< double > yVec
std::vector< double > npVec
double dJndV1(double n1, double n2, double E, double u, double h)
bool loadMatNLPoisson(Linear::Matrix *matPtr)
PDE_2DMesh * meshContainerPtr
std::vector< int > mNodeVector
std::vector< double > unE_Vec
bool loadMatCktTrivial(Linear::Matrix *matPtr)
ScalarT calcMob(MobInfo< ScalarT > &min)
std::vector< int > li_Prowarray
std::vector< int > vOwnVec
double dJpdn1(double p1, double p2, double E, double u, double h)
static const int MAX_COLS_PER_ROW
std::vector< double > upVec
bool outputTecplotVectors()
double getVoltDepHoleDens(double Vmin, double V, double Na)
const ExternData & extData
bool calcElectronCurrent()
bool setupMiscConstants()
double getNi(const std::string &material, double temp)
Manages parameter binding for class C.
std::vector< int > Prowarray
bool setupBoundaryStencil()
bool loadMatDDForm(double dndtScalar, Linear::Matrix *matPtr)
InstanceBlock represent a device instance line from the netlist.
Util::Param temp
operating temperature of ckt.
std::vector< Param > params
std::vector< double > dRdpVec
std::vector< int > & cols
double pdRsrhP(const std::string &material, double ni, double n, double p, double tn, double tp)
std::vector< std::vector< double > > capVec
bool calcTerminalCurrents()
std::vector< std::vector< int > > li_NoffsetArray
std::vector< double > SVec
CompositeParam is the base class for classes that wish to only manage the processing of parameter dat...
Linear::Vector * nextStaDerivVectorPtr
bool getDopingVector(std::vector< double > &cvec_tmp)
std::vector< double > JnVec
std::vector< double > tpVec
double dJndn1(double n1, double n2, double E, double u, double h)
bool calcVoltDepDensities()
bool enableContinuationCalled
std::vector< EDGEINFO > edgeInfoVector
std::vector< double > dJpdV1Vec