57 #include <Xyce_config.h>
99 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
101 Xyce::dout() <<
"In Instance::doSensMeshResize." << std::endl;
131 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
134 Xyce::dout() <<
" deviceWidth = " <<
deviceWidth << std::endl;
135 Xyce::dout() <<
" old_width = " << old_width << std::endl;
136 Xyce::dout() <<
" widthRatio = " << widthRatio << std::endl;
137 Xyce::dout() <<
" deviceLength = " <<
deviceLength << std::endl;
138 Xyce::dout() <<
" old_length = " << old_length << std::endl;
139 Xyce::dout() <<
" lengthRatio = " << lengthRatio << std::endl;
149 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
153 Xyce::dout() <<
" x["<<i<<
"] = " <<
xVec[i];
154 Xyce::dout() <<
" y["<<i<<
"] = " <<
yVec[i];
155 Xyce::dout() << std::endl;
163 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
165 Xyce::dout() <<
"Done with Instance::doSensMeshResize." << std::endl;
184 bool bsuccess =
true;
222 bool bsuccess =
true;
228 std::vector<DeviceInterfaceNode>::iterator first =
dIVec.begin ();
229 std::vector<DeviceInterfaceNode>::iterator last =
dIVec.end ();
230 std::vector<DeviceInterfaceNode>::iterator iterV;
235 for (iterV=first;iterV!=last; ++iterV)
237 if (!(iterV->given))
continue;
245 std::string msg =
"Instance::doMeshBasedInitializations."
246 "can't find " + iterV->nName +
" in the electrode Map\n";
247 N_ERH_ErrorMgr::report( N_ERH_ErrorMgr::DEV_FATAL_0,msg);
251 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
253 Xyce::dout() <<
"list of user-specified electrodes:" << std::endl;
254 std::map<std::string, PDE_2DElectrode*>::iterator mapIter;
255 std::map<std::string, PDE_2DElectrode*>::iterator mapStart =
electrodeMap.begin();
256 std::map<std::string, PDE_2DElectrode*>::iterator mapEnd =
electrodeMap.end();
269 if (!
given(
"MESHFILE"))
271 lout() <<
"No mesh file specified. Setting meshfile=internal.msh\n" << std::endl;
278 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
280 Xyce::dout() << std::endl;
281 Xyce::dout() <<
"Reading mesh file..." << std::endl;
289 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
291 Xyce::dout() << std::endl;
292 Xyce::dout() <<
"Generating internal mesh..." << std::endl;
296 std::string outputMeshFileName =
outputName +
".msh";
314 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
316 Xyce::dout() <<
"\n";
317 Xyce::dout() <<
"Done setting up the mesh." << std::endl;
318 Xyce::dout() <<
" numMeshPoints = " <<
numMeshPoints <<
"\n";
319 Xyce::dout() <<
" numMeshEdges = " <<
numMeshEdges <<
"\n";
320 Xyce::dout() <<
" numMeshCells = " <<
numMeshCells <<
"\n";
340 bool bsuccess =
true;
342 std::vector<DeviceInterfaceNode>::iterator first =
dIVec.begin ();
343 std::vector<DeviceInterfaceNode>::iterator last =
dIVec.end ();
344 std::vector<DeviceInterfaceNode>::iterator iterV;
349 for (iterV=first;iterV!=last; ++iterV)
351 ExtendedString tmpName = iterV->eName;
362 if ( !(edgeLabelExist) )
365 std::string msg =
"Instance::setupDINodes: "
366 "The boundary condition label "+tmpName+
367 " doesn't exist in the mesh file.\n";
368 N_ERH_ErrorMgr::report( N_ERH_ErrorMgr::DEV_FATAL_0,msg);
376 if ( !(edgeLabelExist) )
378 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
379 Xyce::dout() <<
"Erasing DI: " << iterV->eName << std::endl;
390 for (iterV=first;iterV!=last; ++iterV)
392 if (!(iterV->given))
continue;
398 iterV->materialGiven =
electrodeMap[iterV->nName]->materialGiven;
399 iterV->oxideBndryFlag =
electrodeMap[iterV->nName]->oxideBndryFlag;
405 std::string msg =
"Instance::doMeshBasedInitializations."
406 "can't find " + iterV->nName +
" in the electrode Map\n";
407 N_ERH_ErrorMgr::report( N_ERH_ErrorMgr::DEV_FATAL_0,msg);
409 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
411 Xyce::dout() << std::endl;
412 Xyce::dout() <<
"name = " << iterV->eName << std::endl;
413 Xyce::dout() <<
" material = " << iterV->material << std::endl;
414 Xyce::dout() <<
" mat. given = " << iterV->materialGiven << std::endl;
415 Xyce::dout() <<
" oxide boundary flag = " << iterV->oxideBndryFlag << std::endl;
416 Xyce::dout() <<
" oxide thickness = " << iterV->oxthick << std::endl;
417 Xyce::dout() <<
" oxide charge = " << iterV->oxcharge << std::endl;
424 first =
dIVec.begin ();
426 for (iterV=first;iterV!=last; ++iterV)
428 ExtendedString tmpName = iterV->nName;
431 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
432 Xyce::dout() <<
"Testing the neumann stuff. Name = " << tmpName << std::endl;
438 iterV->neumannBCFlagV =
true;
439 iterV->neumannBCFlagN =
true;
440 iterV->neumannBCFlagP =
true;
445 iterV->neumannBCFlagV =
false;
446 iterV->neumannBCFlagN =
true;
447 iterV->neumannBCFlagP =
true;
450 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
452 Xyce::dout() <<
"Setting the neumann flags of " << tmpName <<
":\n";
453 Xyce::dout() <<
" Vflag = " << iterV->neumannBCFlagV << std::endl;
454 Xyce::dout() <<
" Nflag = " << iterV->neumannBCFlagN << std::endl;
455 Xyce::dout() <<
" Pflag = " << iterV->neumannBCFlagP << std::endl;
460 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
462 first =
dIVec.begin ();
464 Xyce::dout() <<
"Final DI list: " << std::endl;
465 for (iterV=first;iterV!=last; ++iterV)
467 Xyce::dout() <<
"DI name:" << iterV->eName;
468 Xyce::dout() <<
" The neumann flags are:" << std::endl;
469 Xyce::dout() <<
" Vflag =";
470 if (iterV->neumannBCFlagV) Xyce::dout() <<
" true." << std::endl;
471 else Xyce::dout() <<
" false." << std::endl;
472 Xyce::dout() <<
" Nflag =";
473 if (iterV->neumannBCFlagN) Xyce::dout() <<
" true." << std::endl;
474 else Xyce::dout() <<
" false." << std::endl;
475 Xyce::dout() <<
" Pflag =";
476 if (iterV->neumannBCFlagP) Xyce::dout() <<
" true." << std::endl;
477 else Xyce::dout() <<
" false." << std::endl;
495 bool bsuccess =
true;
502 condVec[iE].resize(numElectrodes,0.0);
503 capVec[iE].resize(numElectrodes,0.0);
510 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
514 Xyce::dout() <<
" x["<<i<<
"] = " <<
xVec[i];
515 Xyce::dout() <<
" y["<<i<<
"] = " <<
yVec[i];
516 Xyce::dout() << std::endl;
589 std::vector<DeviceInterfaceNode>::iterator first =
dIVec.begin ();
590 std::vector<DeviceInterfaceNode>::iterator last =
dIVec.end ();
591 std::vector<DeviceInterfaceNode>::iterator iterV;
593 for (iterV=first;iterV!=last; ++iterV)
597 iterV->numBoundaryPoints = numPoints;
598 iterV->VequVec.resize (numPoints,0.0);
599 iterV->VbcVec.resize (numPoints,0.0);
600 iterV->nnbcVec.resize (numPoints,0.0);
601 iterV->npbcVec.resize (numPoints,0.0);
603 for (
int i=0;i<iterV->numBoundaryPoints;++i)
607 iterV->meshGlobalToLocal[nodeIndex] = i;
619 for (
int i1=0;i1<numLabels;++i1)
622 if (lPtr->
name ==
"NOFLUX")
635 UINT uLabel = edgePtr->
uLabel;
641 if(uLabel != nofluxIndex)
695 std::vector<int>::iterator firstL;
696 std::vector<int>::iterator lastL;
697 std::vector<int>::iterator iterL;
707 for (iterL=firstL; iterL!=lastL; ++iterL)
725 for (iterL=firstL; iterL!=lastL; ++iterL)
737 int size =
dIVec.size();
738 for (i = 0;i < size; ++i)
743 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
745 Xyce::dout() << section_divider << std::endl;
746 Xyce::dout() <<
"In the Intance::setupLabelIndex ";
747 Xyce::dout() <<
" name = "<<
getName() << std::endl;
751 std::vector<std::string>::iterator iterM;
753 for (i=0, iterM=firstM;iterM!=lastM;++i,++iterM)
755 Xyce::dout() <<
" i = "<<i<<
" name = " << *iterM << std::endl;
757 std::map<std::string,int>::iterator firstDIM =
labelDIMap.begin ();
758 std::map<std::string,int>::iterator lastDIM =
labelDIMap.end ();
759 std::map<std::string,int>::iterator iterDIM;
760 for(iterDIM=firstDIM;iterDIM!=lastDIM;++iterDIM)
762 Xyce::dout() <<
" DI index = "<< iterDIM->second;
763 Xyce::dout() <<
" name = " << iterDIM->first << std::endl;
767 if (isActive(Diag::DEVICE_PARAMETERS))
772 Xyce::dout() <<
" labelIndex["<<i<<
"] = " <<
labelIndex[i];
773 Xyce::dout() <<
" name = " << labelPtr->
name << std::endl;
777 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
779 Xyce::dout() << section_divider << std::endl;
813 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
814 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
815 std::vector<DeviceInterfaceNode>::iterator iterDI;
817 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
819 Xyce::dout() <<
"In Instance::setupBoundaryStencil." << std::endl;
823 for (iterDI = firstDI; iterDI!=lastDI; ++iterDI)
833 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
834 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
835 std::vector<int>::iterator iterI;
837 for(iterI=firstI;iterI!=lastI;++iterI)
839 int nodeIndex = *iterI;
847 if (!(iterDI->neumannBCFlagV) &&
848 !(iterDI->neumannBCFlagN) && !(iterDI->neumannBCFlagP))
875 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
877 Xyce::dout() <<
"In Instance::checkForElectrodeOverlap." << std::endl;
880 for (
int iDI=0;iDI<
dIVec.size();++iDI)
890 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
891 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
892 std::vector<int>::iterator iterI;
894 for(iterI=firstI;iterI!=lastI;++iterI)
896 int nodeIndex = *iterI;
900 std::string msg =
"Electrodes " +
dIVec[iDI].eName +
" and " +
902 N_ERH_ErrorMgr::report( N_ERH_ErrorMgr::DEV_FATAL_0,msg);
925 bool bsuccess =
true;
938 int totalDirchlet = 0;
946 std::vector<DeviceInterfaceNode>::iterator first =
dIVec.begin ();
947 std::vector<DeviceInterfaceNode>::iterator last =
dIVec.end ();
948 std::vector<DeviceInterfaceNode>::iterator iterV;
949 for (iterV=first;iterV!=last; ++iterV)
953 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
955 Xyce::dout() << iterV->eName;
956 Xyce::dout() <<
": numInterfaceMeshPoints = ";
958 Xyce::dout() << std::endl;
963 for (iterV=first;iterV!=last; ++iterV)
970 if (!(iterV->neumannBCFlagV)) mult += 1;
971 if (!(iterV->neumannBCFlagN)) mult += 1;
972 if (!(iterV->neumannBCFlagP)) mult += 1;
974 totalDirchlet += (mult * numPoints);
979 #endif // Xyce_NEW_BC
981 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
983 Xyce::dout() <<
"\n";
985 Xyce::dout() <<
" numMeshPoints = " << numMeshPoints<< std::endl;
986 Xyce::dout() <<
" numElectrodes = " <<
numElectrodes<< std::endl;
987 Xyce::dout() <<
" numIntVars = " <<
numIntVars<< std::endl;
988 Xyce::dout() <<
" 3*numMeshPoints = " << 3*numMeshPoints<< std::endl;
990 Xyce::dout() <<
" totalDirchlet = " << totalDirchlet<< std::endl;
991 Xyce::dout() << std::endl;
1015 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
1016 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
1017 std::vector<DeviceInterfaceNode>::iterator iterDI;
1019 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
1026 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
1027 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
1028 std::vector<int>::iterator iterI;
1030 std::vector<EDGEINFO>::iterator firstEI;
1031 std::vector<EDGEINFO>::iterator lastEI;
1032 std::vector<EDGEINFO>::iterator iterEI;
1039 for(nodeIndex=0,iterI=firstI;iterI!=lastI;++iterI,++nodeIndex)
1047 col1 = iterDI->Vcol[iVcol];
1052 for (cnt2=0;cnt2<iterDI->dIdXcols.size();++cnt2)
1054 if (iterDI->dIdXcols[cnt2] == col1)
1055 { bmatch =
true;
break; }
1059 iterDI->dIdXcols.push_back(col1);
1060 iterDI->dIdX.push_back(0.0);
1061 iterDI->dQdX.push_back(0.0);
1067 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI,++iVcol)
1069 col1 = iterDI->Vcol[iVcol];
1074 for (cnt2=0;cnt2<iterDI->dIdXcols.size();++cnt2)
1076 if (iterDI->dIdXcols[cnt2] == col1)
1077 { bmatch =
true;
break; }
1081 iterDI->dIdXcols.push_back(col1);
1082 iterDI->dIdX.push_back(0.0);
1083 iterDI->dQdX.push_back(0.0);
1090 for(nodeIndex=0,iterI=firstI;iterI!=lastI;++iterI,++nodeIndex)
1098 col1 = iterDI->Ncol[iNcol];
1103 for (cnt2=0;cnt2<iterDI->dIdXcols.size();++cnt2)
1105 if (iterDI->dIdXcols[cnt2] == col1)
1106 { bmatch =
true;
break; }
1110 iterDI->dIdXcols.push_back(col1);
1111 iterDI->dIdX.push_back(0.0);
1112 iterDI->dQdX.push_back(0.0);
1118 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI,++iNcol)
1120 col1 = iterDI->Ncol[iNcol];
1125 for (cnt2=0;cnt2<iterDI->dIdXcols.size();++cnt2)
1127 if (iterDI->dIdXcols[cnt2] == col1)
1128 { bmatch =
true;
break; }
1132 iterDI->dIdXcols.push_back(col1);
1133 iterDI->dIdX.push_back(0.0);
1134 iterDI->dQdX.push_back(0.0);
1141 for(nodeIndex=0,iterI=firstI;iterI!=lastI;++iterI,++nodeIndex)
1149 col1 = iterDI->Pcol[iPcol];
1154 for (cnt2=0;cnt2<iterDI->dIdXcols.size();++cnt2)
1156 if (iterDI->dIdXcols[cnt2] == col1)
1157 { bmatch =
true;
break; }
1161 iterDI->dIdXcols.push_back(col1);
1162 iterDI->dIdX.push_back(0.0);
1163 iterDI->dQdX.push_back(0.0);
1169 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI,++iPcol)
1171 col1 = iterDI->Pcol[iPcol];
1176 for (cnt2=0;cnt2<iterDI->dIdXcols.size();++cnt2)
1178 if (iterDI->dIdXcols[cnt2] == col1)
1179 { bmatch =
true;
break; }
1183 iterDI->dIdXcols.push_back(col1);
1184 iterDI->dIdX.push_back(0.0);
1185 iterDI->dQdX.push_back(0.0);
1195 for(nodeIndex=0,iterI=firstI;iterI!=lastI;++iterI,++nodeIndex)
1202 col1 = iterDI->Pcol[iPcol];
1203 int meshNode = *iterI;
1209 for (cnt2=0;cnt2<iterDI->neighborNodes.size();++cnt2)
1211 if (iterDI->neighborNodes[cnt2] == meshNode)
1212 { bmatch =
true;
break; }
1216 iterDI->neighborNodes.push_back(meshNode);
1224 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI,++iPcol)
1226 col1 = iterDI->Pcol[iPcol];
1227 int meshNode = iterEI->inode;
1233 for (cnt2=0;cnt2<iterDI->neighborNodes.size();++cnt2)
1235 if (iterDI->neighborNodes[cnt2] == meshNode)
1236 { bmatch =
true;
break; }
1240 iterDI->neighborNodes.push_back(meshNode);
1246 int size1 = iterDI->neighborNodes.size();
1247 int size3 = iterDI->dIdX.size();
1248 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1250 Xyce::dout() << std::endl;
1251 Xyce::dout() <<
"number of neighbor nodes for " << iterDI->eName;
1252 Xyce::dout() <<
" is " << size1 << std::endl;
1254 for (i=0;i<size1;++i)
1256 Xyce::dout() <<
"neighborNodes["<<i<<
"] = " << iterDI->neighborNodes[i] << std::endl;
1258 Xyce::dout() << std::endl;
1259 Xyce::dout() <<
"dIdX size for " << iterDI->eName <<
" is " << size3 << std::endl;
1260 for (i=0;i<size3;++i)
1262 Xyce::dout() <<
"dIdX["<<i<<
"] = " << iterDI->dIdXcols[i] << std::endl;
1269 int numNeighbor = iterDI->neighborNodes.size();
1272 for (iNeighbor=0;iNeighbor<numNeighbor;++iNeighbor)
1274 int inode = iterDI->neighborNodes[iNeighbor];
1277 for (
int iNN=0;iNN<nodePtr->
cnode;++iNN)
1288 iterDI->dFdVckt.push_back(0.0); ++dFdVindex;
1289 iterDI->dFdVckt.push_back(0.0); ++dFdVindex;
1290 iterDI->dFdVckt.push_back(0.0); ++dFdVindex;
1294 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1296 Xyce::dout() << iterDI->eName <<
": size of dFdVckt = " << dFdVindex << std::endl;
1300 UserWarning0(*
this) <<
"NEW_BC must be turned on to use TWO_LEVEL_NEWTON";
1301 #endif // Xyce_NEW_BC
1333 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1335 Xyce::dout() << section_divider <<
"\n";
1336 Xyce::dout() <<
"setupBCEdgeAreas. name = " <<
getName() << std::endl;
1337 Xyce::dout().setf(std::ios::scientific);
1343 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
1344 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
1345 std::vector<DeviceInterfaceNode>::iterator iterDI;
1347 for (iterDI = firstDI; iterDI!=lastDI; ++iterDI)
1355 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
1356 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
1357 std::vector<int>::iterator iterI;
1361 for(iterI=firstI;iterI!=lastI;++iterI)
1366 std::vector<EDGEINFO>::iterator firstEI = nodePtr->
edgeInfoVector.begin();
1367 std::vector<EDGEINFO>::iterator lastEI = nodePtr->
edgeInfoVector.end ();
1368 std::vector<EDGEINFO>::iterator iterEI;
1370 double areaLocal = 0.0;
1371 double areaTmp = 0.0;
1373 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1375 Xyce::dout() <<
" --------------- " << std::endl;
1376 Xyce::dout() <<
"name = " << iterDI->eName;
1377 Xyce::dout() <<
" node = " << *iterI << std::endl;
1380 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
1382 int neighbor = iterEI->inode;
1393 if (labelPtr->
name == iterDI->eName)
1399 double x1 =
xVec[*iterI];
1400 double y1 =
yVec[*iterI];
1402 double x2 =
xVec[neighbor];
1403 double y2 =
yVec[neighbor];
1405 double dx = x2-x1; dx *= 0.5;
1406 double dy = y2-y1; dy *= 0.5;
1412 areaLocal += areaTmp;
1416 areaTmp = 0.5 * iterEI->elen;
1417 areaLocal += 0.5 * iterEI->elen;
1420 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1422 Xyce::dout() <<
" neighbor node = " << neighbor << std::endl;
1423 Xyce::dout() <<
" areaTmp = " << areaTmp << std::endl;
1424 Xyce::dout() <<
" areaLocal = " << areaLocal << std::endl;
1425 Xyce::dout() <<
" elen = " << iterEI->elen << std::endl;
1426 Xyce::dout() <<
" label name = " << labelPtr->
name << std::endl;
1427 Xyce::dout() <<
" DI eName = " << iterDI->eName << std::endl;
1428 Xyce::dout() <<
"---" << std::endl;
1432 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1434 Xyce::dout() <<
" --------------- " << std::endl;
1436 iterDI->area += areaLocal;
1437 iterDI->areaVector.push_back(areaLocal);
1442 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1444 Xyce::dout().setf(std::ios::scientific);
1445 Xyce::dout() <<
" Total area for edge: " << iterDI->area << std::endl;
1449 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
1451 Xyce::dout() << section_divider <<
"\n";
1474 std::vector<EDGEINFO>::iterator firstEI = nodePtr->
edgeInfoVector.begin();
1475 std::vector<EDGEINFO>::iterator lastEI = nodePtr->
edgeInfoVector.end ();
1476 std::vector<EDGEINFO>::iterator iterEI;
1478 double tmpDX = +1.0e99;
1479 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
1481 if (tmpDX > iterEI->elen) tmpDX = iterEI->elen;
1483 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1485 Xyce::dout() <<
"i = " << i <<
" minDX = " << tmpDX; Xyce::dout() << std::endl;
1514 bool bsuccess =
true;
1517 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1519 Xyce::dout() <<
"In Instance::setupJacStamp" << std::endl;
1520 Xyce::dout() <<
"numIntVars = " <<
numIntVars << std::endl;
1521 Xyce::dout() <<
"numMeshPoints = " <<
numMeshPoints << std::endl;
1541 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1543 Xyce::dout() <<
"size of jacStamp = " <<
jacStamp.size() << std::endl;
1547 int LIDcounter = numPossibleElectrodes;
1553 #endif // Xyce_NEW_BC
1574 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
1575 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
1576 std::vector<DeviceInterfaceNode>::iterator iterDI;
1577 int DIsize =
dIVec.size ();
1578 firstDI =
dIVec.begin();
1579 lastDI =
dIVec.end ();
1584 for(index=0,iterDI=firstDI;iterDI!=lastDI;++iterDI,++index)
1596 dIVec[index].numCrossTerms = 0;
1600 for (
int ind2=0;ind2<DIsize;++ind2)
1602 if (ind2==index)
continue;
1605 ++(
dIVec[index].numCrossTerms);
1614 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
1615 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
1616 std::vector<int>::iterator iterI;
1618 std::vector<EDGEINFO>::iterator firstEI;
1619 std::vector<EDGEINFO>::iterator lastEI;
1620 std::vector<EDGEINFO>::iterator iterEI;
1624 for(iterI=firstI;iterI!=lastI;++iterI)
1636 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI)
1638 imesh = iterEI->inode;
1644 for(iterI=firstI;iterI!=lastI;++iterI)
1656 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI)
1658 imesh = iterEI->inode;
1664 for(iterI=firstI;iterI!=lastI;++iterI)
1675 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI)
1677 imesh = iterEI->inode;
1690 #endif // Xyce_NEW_BC
1692 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1694 Xyce::dout() <<
" mesh point i = " << i << std::endl;
1698 std::vector<EDGEINFO>::iterator firstEI = nodePtr->
edgeInfoVector.begin ();
1699 std::vector<EDGEINFO>::iterator lastEI = nodePtr->
edgeInfoVector.end ();
1700 std::vector<EDGEINFO>::iterator iterEI;
1707 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1709 Xyce::dout() <<
" Vrow = " << Vrow << std::endl;
1710 Xyce::dout() <<
" Nrow = " << Nrow << std::endl;
1711 Xyce::dout() <<
" Prow = " << Prow << std::endl;
1721 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
1731 jacStamp[Vrow].push_back (DIindex);
1735 int imesh = iterEI->inode;
1739 #else // Xyce_NEW_BC
1740 int imesh = iterEI->inode;
1743 #endif // Xyce_NEW_BC
1755 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
1757 int imesh = iterEI->inode;
1767 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
1777 jacStamp[Nrow].push_back (DIindex);
1781 int imesh = iterEI->inode;
1785 #else // Xyce_NEW_BC
1786 int imesh = iterEI->inode;
1789 #endif // Xyce_NEW_BC
1799 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
1801 int imesh = iterEI->inode;
1810 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
1820 jacStamp[Prow].push_back (DIindex);
1824 int imesh = iterEI->inode;
1828 #else // Xyce_NEW_BC
1829 int imesh = iterEI->inode;
1832 #endif // Xyce_NEW_BC
1845 firstDI =
dIVec.begin();
1846 lastDI =
dIVec.end ();
1848 for(index=0,iterDI=firstDI;iterDI!=lastDI;++iterDI,++index)
1862 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
1863 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
1864 std::vector<int>::iterator iterI;
1870 for(iterI=firstI;iterI!=lastI;++iterI)
1877 #endif // Xyce_NEW_BC
1879 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1882 for(irow=0;irow<
jacStamp.size();++irow)
1884 Xyce::dout() <<
"irow = " << irow;
1885 if (irow <
dIVec.size())
1886 Xyce::dout() <<
" " <<
dIVec[irow].eName <<
" KCL";
1887 Xyce::dout() << std::endl;
1888 for (icol=0;icol<
jacStamp[irow].size();++icol)
1891 Xyce::dout() <<
" jacStamp["<<irow<<
"]["<<icol<<
"] = "<<jsTmp;
1892 Xyce::dout() << std::endl;
1909 const IndexPairVector & intGIDListRef,
1910 const IndexPairVector & extGIDListRef)
1915 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1917 Xyce::dout() << section_divider << std::endl;
1918 Xyce::dout() <<
"In the Instance::registerGIDs function. ";
1919 Xyce::dout() <<
" name = "<<
getName() << std::endl;
1920 Xyce::dout() <<
"numInt = " <<
numIntVars <<
"\n";
1921 Xyce::dout() <<
"numExt = " <<
numExtVars <<
"\n";
1922 Xyce::dout() <<
"numMeshPoints = " <<
numMeshPoints <<
"\n";
1926 intGIDList.assign(intGIDListRef.begin(), intGIDListRef.end());
1927 extGIDList.assign(extGIDListRef.begin(), extGIDListRef.end());
1933 IndexPairVector::iterator it1 =
extGIDList.begin();
1935 IndexPairVector::iterator first =
extGIDList.begin();
1936 IndexPairVector::iterator last =
extGIDList.end ();
1937 IndexPairVector::iterator iter;
1940 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1942 Xyce::dout() <<
"Setting up the indices for the external circuit nodes:" << std::endl;
1943 Xyce::dout() <<
"External node list:" << std::endl;
1946 int numExtNodes = 0;
1947 for(iter=first;iter!=last;++iter)
1949 if ( (iter->col) && (iter->row != -1) )
1954 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1956 Xyce::dout() <<
"node = " << iter->row <<
" col = ";
1957 Xyce::dout() << iter->col <<
" numExtNodes = " << numExtNodes << std::endl;
1961 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1962 Xyce::dout() <<
" number of owned external nodes = " << numExtNodes << std::endl;
1964 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
1965 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
1966 std::vector<DeviceInterfaceNode>::iterator iterDI;
1968 for(iterDI=firstDI;iterDI!=lastDI;++iterDI)
1970 if (iterDI->given) ++numRealDIs;
1973 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1975 Xyce::dout() <<
" number of user specified boundary conditions = ";
1976 Xyce::dout() << numRealDIs << std::endl;
1979 if (numRealDIs < numExtNodes)
1981 DevelFatal(*this).in(
"Instance::registerGIDs")
1982 <<
"Number of boundary conditions < number of external nodes";
1985 int isizeDI =
dIVec.size();
1987 for(index=0, iter=first; (iter!=last && index < isizeDI); ++iter, ++index)
1989 dIVec[index].gid = iter->row;
1990 if ( !(iter->col) )
dIVec[index].gid = -1;
1992 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
1994 Xyce::dout() <<
" name = "<<
dIVec[index].eName<<
" gid = ";
1995 Xyce::dout() <<
dIVec[index].gid;
1996 Xyce::dout() << std::endl;
2002 std::vector<int>::iterator iterTmp = labelPtr->
mNodeVector.begin();
2004 dIVec[index].firstMeshNodeIndex = *iterTmp;
2008 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2010 Xyce::dout() <<
"doing internal vars, row arrays:"<< std::endl;
2014 IndexPairVector::iterator intEnd =
intGIDList.end();
2015 IndexPairVector::iterator it2 =
intGIDList.begin();
2032 if ( !(it2->col) ) Vrow = -1;
2040 if ( !(it2->col) ) Nrow = -1;
2048 if ( !(it2->col) ) Prow = -1;
2053 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2055 Xyce::dout() <<
"doing row arrays for mesh point " << i << std::endl;
2057 Xyce::dout() <<
" Vrow = " << Vrow << std::endl;
2060 Xyce::dout() <<
" Nrow = " << Nrow << std::endl;
2063 Xyce::dout() <<
" Prow = " << Prow << std::endl;
2069 if ( !(it2->col) ) Vrow = -1;
2074 if ( !(it2->col) ) Nrow = -1;
2079 if ( !(it2->col) ) Prow = -1;
2083 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2085 Xyce::dout() <<
"doing row arrays for mesh point " << i << std::endl;
2086 Xyce::dout() <<
" Vrow = " << Vrow << std::endl;
2087 Xyce::dout() <<
" Nrow = " << Nrow << std::endl;
2088 Xyce::dout() <<
" Prow = " << Prow << std::endl;
2090 #endif // Xyce_NEW_BC
2102 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2104 Xyce::dout() <<
"maxColsPerRow = " <<
maxColsPerRow << std::endl;
2107 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2109 Xyce::dout() << section_divider << std::endl;
2130 #endif // Xyce_NEW_BC
2132 int Vrow, Nrow, Prow;
2139 std::ostringstream oss;
2146 std::ostringstream oss;
2153 std::ostringstream oss;
2180 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
2181 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
2182 std::vector<DeviceInterfaceNode>::iterator iterDI;
2184 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2186 Xyce::dout() <<
"Instance::setupRowColPairs ()" << std::endl;
2187 Xyce::dout() <<
" doing internal vars, col arrays:"<< std::endl;
2197 #endif // Xyce_NEW_BC
2199 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2201 Xyce::dout() <<
"doing col arrays for mesh point " << i<< std::endl;
2205 std::vector<EDGEINFO>::iterator firstEI = nodePtr->
edgeInfoVector.begin ();
2206 std::vector<EDGEINFO>::iterator lastEI = nodePtr->
edgeInfoVector.end ();
2207 std::vector<EDGEINFO>::iterator iterEI;
2213 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
2231 #endif // Xyce_NEW_BC
2237 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2239 Xyce::dout() <<
"size of vcolarray["<<i<<
"] = " <<
Vcolarray[i].size() << std::endl;
2240 for(
int eric=0;eric<
Vcolarray[i].size();++eric)
2241 Xyce::dout() <<
" col["<<eric<<
"] = " <<
Vcolarray[i][eric] << std::endl;
2247 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
2253 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
2271 #endif // Xyce_NEW_BC
2278 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
2283 for (iterEI=firstEI;iterEI!=lastEI;++iterEI)
2301 #endif // Xyce_NEW_BC
2307 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2309 Xyce::dout() <<
"doing some boundary condition vars:"<< std::endl;
2318 firstDI =
dIVec.begin();
2319 lastDI =
dIVec.end ();
2323 for(index=0,iterDI=firstDI;iterDI!=lastDI;++iterDI,++index)
2331 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2333 Xyce::dout() <<
"Device Interface: " <<
dIVec[index].eName << std::endl;
2342 std::vector<int>::iterator firstI = labelPtr->
mNodeVector.begin();
2343 std::vector<int>::iterator lastI = labelPtr->
mNodeVector.end ();
2344 std::vector<int>::iterator iterI;
2351 for(iterI=firstI;iterI!=lastI;++iterI)
2355 #endif // Xyce_NEW_BC
2374 std::vector<EDGEINFO>::iterator firstEI;
2375 std::vector<EDGEINFO>::iterator lastEI;
2376 std::vector<EDGEINFO>::iterator iterEI;
2378 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2380 Xyce::dout() <<
"V edge and edge neighbor gids:" << std::endl;
2384 for(iterI=firstI;iterI!=lastI;++iterI)
2387 dIVec[index].Vcol.push_back(itmp);
2389 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2391 int ind1 =
dIVec[index].Vcol.size()-1;
2392 Xyce::dout() <<
" 1Vcol["<<ind1<<
"] = " << itmp << std::endl;
2400 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI)
2403 dIVec[index].Vcol.push_back(itmp);
2405 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2407 int ind1 =
dIVec[index].Vcol.size()-1;
2408 Xyce::dout() <<
" 2Vcol["<<ind1<<
"] = " << itmp << std::endl;
2413 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2415 Xyce::dout() <<
"N edge and edge neighbor gids:" << std::endl;
2419 for(iterI=firstI;iterI!=lastI;++iterI)
2422 dIVec[index].Ncol.push_back(itmp);
2424 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2426 int ind1 =
dIVec[index].Ncol.size()-1;
2427 Xyce::dout() <<
" 1Ncol["<<ind1<<
"] = " << itmp << std::endl;
2435 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI)
2438 dIVec[index].Ncol.push_back(itmp);
2440 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2442 int ind1 =
dIVec[index].Ncol.size()-1;
2443 Xyce::dout() <<
" 2Ncol["<<ind1<<
"] = " << itmp << std::endl;
2448 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2450 Xyce::dout() <<
"P edge and edge neighbor gids:" << std::endl;
2453 for(iterI=firstI;iterI!=lastI;++iterI)
2456 dIVec[index].Pcol.push_back(itmp);
2458 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2460 int ind1 =
dIVec[index].Pcol.size()-1;
2461 Xyce::dout() <<
" 1Pcol["<<ind1<<
"] = " << itmp << std::endl;
2469 for (iterEI=firstEI; iterEI!=lastEI; ++iterEI)
2472 dIVec[index].Pcol.push_back(itmp);
2474 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2476 int ind1 =
dIVec[index].Pcol.size()-1;
2477 Xyce::dout() <<
" 2Pcol["<<ind1<<
"] = " << itmp << std::endl;
2483 (
dIVec[index].Vcol.size() +
2484 dIVec[index].Ncol.size() +
2485 dIVec[index].Pcol.size() + 10)
2489 (
dIVec[index].Vcol.size() +
2490 dIVec[index].Ncol.size() +
2491 dIVec[index].Pcol.size() + 10);
2495 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2497 Xyce::dout() <<
"Setting up the index pairs."<< std::endl;
2507 firstDI =
dIVec.begin();
2508 lastDI =
dIVec.end ();
2509 for(index=0,iterDI=firstDI;iterDI!=lastDI;++iterDI,++index)
2511 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2512 Xyce::dout() <<
"device interface name: " << iterDI->eName << std::endl;
2518 if (
dIVec[index].gid == -1)
continue;
2522 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2523 Xyce::dout() <<
"index = " << index<<
" gid = " <<
dIVec[index].gid << std::endl;
2526 IP.row =
dIVec[index].gid;
2527 IP.col =
dIVec[index].gid;
2532 int size2 =
dIVec.size();
2533 for (
int ind2=0;ind2<size2;++ind2)
2535 if (index == ind2)
continue;
2536 IP.row =
dIVec[index].gid;
2537 IP.col =
dIVec[ind2].gid;
2543 nn =
dIVec[index].Vcol.size();
2547 if (
dIVec[index].Vcol[j] != -1)
2549 IP.row =
dIVec[index].gid;
2550 IP.col =
dIVec[index].Vcol[j];
2552 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2554 Xyce::dout() <<
"Vcol["<<j<<
"] = " <<
dIVec[index].Vcol[j] << std::endl;
2562 if (
dIVec[index].Ncol[j] != -1)
2564 IP.row =
dIVec[index].gid;
2565 IP.col =
dIVec[index].Ncol[j];
2567 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2569 Xyce::dout() <<
"Ncol["<<j<<
"] = " <<
dIVec[index].Ncol[j] << std::endl;
2577 if (
dIVec[index].Pcol[j] != -1)
2579 IP.row =
dIVec[index].gid;
2580 IP.col =
dIVec[index].Pcol[j];
2582 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2584 Xyce::dout() <<
"Pcol["<<j<<
"] = " <<
dIVec[index].Pcol[j] << std::endl;
2593 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2595 Xyce::dout() <<
"Mesh Index: i = " << i <<
" label = ";
2607 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2609 Xyce::dout() <<
" V row,col = " <<
Vrowarray[i] <<
", ";
2610 Xyce::dout() <<
Vcolarray[i][j] <<
"\n";
2623 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2625 Xyce::dout() <<
" N row,col = " <<
Nrowarray[i] <<
", ";
2626 Xyce::dout() <<
Ncolarray[i][j] <<
"\n";
2639 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2641 Xyce::dout() <<
" P row,col = " <<
Prowarray[i] <<
", ";
2642 Xyce::dout() <<
Pcolarray[i][j] <<
"\n";
2648 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2650 Xyce::dout() << std::endl;
2655 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2657 IndexPairVector::iterator ip_iter;
2663 Xyce::dout() <<
"i="<<i<<
": (";
2664 Xyce::dout().width(6);
2665 Xyce::dout() << ip_iter->row;
2666 Xyce::dout() <<
", ";
2667 Xyce::dout().width(6);
2668 Xyce::dout() << ip_iter->col;
2669 Xyce::dout() <<
")\n";
2685 const IndexPairVector & staGIDListRef)
2689 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2691 Xyce::dout() <<
"\n";
2692 Xyce::dout() << section_divider <<
"\n";
2693 Xyce::dout() <<
" In Instance::registerStateGIDs\n\n";
2694 Xyce::dout() <<
" name = " <<
getName() <<
"\n";
2695 Xyce::dout() <<
" Number of State GIDs: " <<
numStateVars <<
"\n";
2699 staGIDList.assign(staGIDListRef.begin(), staGIDListRef.end());
2701 IndexPairVector::iterator it1 =
staGIDList.begin();
2702 IndexPairVector::iterator last1 =
staGIDList.end ();
2704 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
2705 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
2706 std::vector<DeviceInterfaceNode>::iterator iterDI = firstDI;
2709 for (; (iterDI!=lastDI && it1!=last1);++iterDI,++it1,++i)
2711 iterDI->stateC = (*it1).row;
2712 iterDI->stateC_owned = (it1->col == 1);
2722 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2724 Xyce::dout() <<
" State indices:" <<
"\n";
2725 Xyce::dout() <<
"\n";
2726 for (iterDI=firstDI; iterDI!=lastDI;++iterDI)
2728 Xyce::dout() <<
" ";
2729 Xyce::dout().width(12);
2730 Xyce::dout().setf(std::ios::right);
2731 Xyce::dout() << iterDI->eName;
2732 Xyce::dout().setf(std::ios::left);
2733 Xyce::dout() <<
" stateC = " << iterDI->stateC;
2734 Xyce::dout() <<
" stateC_owned = " << iterDI->stateC_owned <<
"\n";
2737 Xyce::dout() << section_divider << std::endl;
2751 const std::vector<int> & extLIDVecRef)
2756 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2758 Xyce::dout() << section_divider << std::endl;
2759 Xyce::dout() <<
"In the Intance::registerLIDs function. ";
2760 Xyce::dout() <<
" name = "<<
getName() << std::endl;
2761 Xyce::dout() <<
"numInt = " <<
numIntVars << std::endl;
2762 Xyce::dout() <<
"numExt = " <<
numExtVars << std::endl;
2763 Xyce::dout() <<
"numMeshPoints = " <<
numMeshPoints << std::endl;
2774 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2776 Xyce::dout() <<
"Setting up the indices for the external circuit nodes:" << std::endl;
2777 Xyce::dout() <<
"External node list:" << std::endl;
2780 int isizeDI =
dIVec.size();
2783 for(index=0; index < isizeDI; ++index)
2787 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2789 Xyce::dout() <<
" name = "<<
dIVec[index].eName<<
" lid = ";
2790 Xyce::dout() <<
dIVec[index].lid;
2791 Xyce::dout() << std::endl;
2796 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2798 Xyce::dout() <<
"Doing internal vars, row arrays:"<< std::endl;
2829 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2831 Xyce::dout() <<
"doing lid row arrays for mesh point " << i << std::endl;
2833 Xyce::dout() <<
" li_Vrow = " <<
li_Vrowarray[i] << std::endl;
2836 Xyce::dout() <<
" li_Nrow = " <<
li_Nrowarray[i] << std::endl;
2839 Xyce::dout() <<
" li_Prow = " <<
li_Prowarray[i] << std::endl;
2852 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2854 Xyce::dout() <<
"doing lid row arrays for mesh point " << i << std::endl;
2855 Xyce::dout() <<
" li_Vrow = " <<
li_Vrowarray[i] << std::endl;
2856 Xyce::dout() <<
" li_Nrow = " <<
li_Nrowarray[i] << std::endl;
2857 Xyce::dout() <<
" li_Prow = " <<
li_Prowarray[i] << std::endl;
2859 #endif // Xyce_NEW_BC
2863 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2865 Xyce::dout() << section_divider << std::endl;
2883 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2885 Xyce::dout() <<
"\n";
2886 Xyce::dout() << section_divider <<
"\n";
2887 Xyce::dout() <<
" In Instance::registerStateLIDs\n\n";
2888 Xyce::dout() <<
" name = " <<
getName() <<
"\n";
2889 Xyce::dout() <<
" Number of State LIDs: " <<
numStateVars <<
"\n";
2895 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
2896 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
2897 std::vector<DeviceInterfaceNode>::iterator iterDI = firstDI;
2900 for (; iterDI!=lastDI;++iterDI,++i)
2911 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2913 Xyce::dout() <<
" State indices:" <<
"\n";
2914 Xyce::dout() <<
"\n";
2915 for (iterDI=firstDI; iterDI!=lastDI;++iterDI)
2917 Xyce::dout() <<
" ";
2918 Xyce::dout().width(12);
2919 Xyce::dout().setf(std::ios::right);
2920 Xyce::dout() << iterDI->eName;
2921 Xyce::dout().setf(std::ios::left);
2922 Xyce::dout() <<
" li_stateC = " << iterDI->li_stateC;
2923 Xyce::dout() << std::endl;
2926 Xyce::dout() <<
" Displacement state indices:\n";
2929 Xyce::dout() <<
" edge: " << j <<
" li_stateDispl = " <<
li_stateDispl[j];
2930 Xyce::dout() << std::endl;
2933 Xyce::dout() << section_divider << std::endl;
2968 (
const std::vector< std::vector<int> > & jacLIDVec )
2974 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2976 Xyce::dout() <<
"In Instance::registerJacLIDs" << std::endl;
2982 std::vector<DeviceInterfaceNode>::iterator firstDI = dIVec.begin();
2983 std::vector<DeviceInterfaceNode>::iterator lastDI = dIVec.end ();
2984 std::vector<DeviceInterfaceNode>::iterator iterDI;
2985 int DIsize = dIVec.size ();
2986 firstDI = dIVec.begin();
2987 lastDI = dIVec.end ();
2990 for(index=0,iterDI=firstDI;iterDI!=lastDI;++iterDI,++index)
2992 int jacRowSize = jacLIDVec[index].size();
2993 dIVec[index].dIdXoffset.resize(jacRowSize-dIVec[index].numCrossTerms-1);
2994 dIVec[index].lidOffset = jacLIDVec[index][0];
2996 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
2998 Xyce::dout() <<
"index = " << index;
2999 Xyce::dout() <<
" jacRowSize = " << jacRowSize;
3000 Xyce::dout() <<
" name = " << dIVec[index].eName << std::endl;
3001 Xyce::dout() <<
" lidOffset = ";
3002 Xyce::dout() << dIVec[index].lidOffset << std::endl;
3005 int nCT = dIVec[index].numCrossTerms;
3007 dIVec[index].crossOffsets.resize(nCT);
3009 for(
int itmp=0;itmp<nCT;++itmp)
3011 dIVec[index].crossOffsets[itmp] = jacLIDVec[index][itmp+1];
3012 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
3014 Xyce::dout() <<
" crossOffsets["<<itmp<<
"] = ";
3015 Xyce::dout() << dIVec[index].crossOffsets[itmp] << std::endl;
3019 for (
int ioff=nCT+1;ioff<jacRowSize;++ioff)
3021 int tmpIndex = ioff - (nCT+1);
3022 dIVec[index].dIdXoffset[tmpIndex] = jacLIDVec[index][ioff];
3024 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
3026 Xyce::dout() <<
" dIdXoffset["<<tmpIndex<<
"] = ";
3027 Xyce::dout() << dIVec[index].dIdXoffset[tmpIndex] << std::endl;
3034 li_VoffsetArray.resize(numMeshPoints);
3035 li_NoffsetArray.resize(numMeshPoints);
3036 li_PoffsetArray.resize(numMeshPoints);
3037 for(i=0;i<numMeshPoints;++i)
3040 if (boundarySten[i])
continue;
3041 #endif // Xyce_NEW_BC
3043 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
3045 Xyce::dout() <<
" mesh point i = " << i << std::endl;
3048 mNode * nodePtr = meshContainerPtr->getNode(i);
3049 std::vector<EDGEINFO>::iterator firstEI = nodePtr->
edgeInfoVector.begin ();
3050 std::vector<EDGEINFO>::iterator lastEI = nodePtr->
edgeInfoVector.end ();
3053 int Vrow = MESHtoLID_V[i];
3054 int Nrow = MESHtoLID_N[i];
3055 int Prow = MESHtoLID_P[i];
3057 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
3059 Xyce::dout() <<
" Vrow = " << Vrow << std::endl;
3060 Xyce::dout() <<
" Nrow = " << Nrow << std::endl;
3061 Xyce::dout() <<
" Prow = " << Prow << std::endl;
3068 int VrowSize = jacLIDVec[Vrow].size();
3069 li_VoffsetArray[i].resize(VrowSize);
3070 for (ioff=0;ioff<VrowSize;++ioff)
3072 li_VoffsetArray[i][ioff] = jacLIDVec[Vrow][ioff];
3073 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
3075 Xyce::dout() <<
" li_Voffset["<<i<<
"]["<<ioff<<
"] = ";
3076 Xyce::dout() << li_VoffsetArray[i][ioff] << std::endl;
3084 int NrowSize = jacLIDVec[Nrow].size();
3085 li_NoffsetArray[i].resize(NrowSize);
3086 for (ioff=0;ioff<NrowSize;++ioff)
3088 li_NoffsetArray[i][ioff] = jacLIDVec[Nrow][ioff];
3089 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
3091 Xyce::dout() <<
" li_Noffset["<<i<<
"]["<<ioff<<
"] = ";
3092 Xyce::dout() << li_NoffsetArray[i][ioff] << std::endl;
3100 int ProwSize = jacLIDVec[Prow].size();
3101 li_PoffsetArray[i].resize(ProwSize);
3102 for (ioff=0;ioff<ProwSize;++ioff)
3104 li_PoffsetArray[i][ioff] = jacLIDVec[Prow][ioff];
3105 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
3107 Xyce::dout() <<
" li_Poffset["<<i<<
"]["<<ioff<<
"] = ";
3108 Xyce::dout() << li_PoffsetArray[i][ioff] << std::endl;
const InstanceName & getName() const
std::vector< double > RVec
std::vector< double > displPotential
std::vector< int > li_stateDispl
std::vector< int > stateDispl_owned
std::vector< int > nnOwnVec
IndexPairVector intGIDList
const std::vector< std::vector< int > > & jacobianStamp() const
std::vector< int > MESHtoLID_P
bool initializeInternalMesh(int nx, int ny, double xlength, double ylength, int numElectrodes, std::string &outputMeshFileName, std::map< std::string, PDE_2DElectrode * > &elMap, bool cylFlag)
std::vector< double > CVec
std::vector< int > boundaryStenN
std::vector< int > li_Vrowarray
bool given(const std::string ¶meter_name) const
std::vector< double > outputVec
Pure virtual class to augment a linear system.
std::vector< int > Vrowarray
void addInternalNode(Util::SymbolTable &symbol_table, int index, const InstanceName &instance_name, const std::string &lead_name)
std::vector< double > upE_Vec
IndexPairVector extGIDList
bool undoSensMeshResize()
std::vector< double > dJndn1Vec
std::vector< int > npOwnVec
std::vector< double > totSrcVec
bool labelEdgeType(std::string &labelName)
void registerStateGIDs(const IndexPairVector &staGIDListRef)
bool getXVector(std::vector< double > &xvec_tmp)
std::vector< int > Nrowarray
std::vector< double > EfieldVec
bool getYVector(std::vector< double > &yvec_tmp)
std::vector< int > boundarySten
std::vector< double > dJpdn2Vec
virtual void registerJacLIDs(const JacobianStamp &jacLIDVec)
void registerLIDs(const std::vector< int > &intLIDVecRef, const std::vector< int > &extLIDVecRef)
std::vector< double > minDXVec
IndexPairVector staGIDList
std::map< std::string, int > labelDIMap
bool checkForElectrodeOverlap()
const MatrixLoadData & getMatrixLoadData() const
std::vector< UINT > aiEdge
PDE_2DMesh * meshCopyContainerPtr
IndexPairVector indexPairList
std::vector< double > dJpdn1Vec
std::vector< std::vector< int > > Ncolarray
std::vector< std::string > labelNameVector
std::vector< std::vector< int > > Vcolarray
std::vector< double > xVec
std::vector< std::vector< int > > jacStamp
void registerJacLIDs(const std::vector< std::vector< int > > &jacLIDVec)
const DeviceOptions & getDeviceOptions() const
std::vector< int > li_Nrowarray
std::vector< double > dJndV1Vec
std::vector< double > dJpdV2Vec
std::vector< double > nnVec
void registerStateLIDs(const std::vector< int > &staLIDVecRef)
std::vector< int > boundaryStenV
std::vector< std::vector< double > > condVec
std::vector< int > MESHtoLID_V
std::vector< double > tnVec
std::vector< double > VVec
std::vector< int > boundaryTest
std::vector< double > displCurrent
std::vector< double > unVec
std::vector< double > dJndn2Vec
std::vector< int > labelIndex
std::vector< double > dRdnVec
std::map< std::string, PDE_2DElectrode * > electrodeMap
int numInterfaceMeshPoints
std::vector< int > stateDispl
std::vector< DeviceInterfaceNode > dIVec
std::vector< double > dJndV2Vec
std::vector< double > JpVec
const SolverState & getSolverState() const
void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
std::vector< std::vector< int > > Pcolarray
std::vector< double > yVec
std::vector< UINT > aiEdge_nf
std::vector< double > npVec
bool initializeAll(int isizeTmp=100)
bool initializeMesh(const std::string &meshFileName_tmp)
PDE_2DMesh * meshContainerPtr
std::vector< int > mNodeVector
std::vector< double > unE_Vec
void registerGIDs(const IndexPairVector &intGIDListRef, const IndexPairVector &extGIDListRef)
std::vector< int > li_Prowarray
std::vector< int > vOwnVec
bool resizeMesh(double xlength, double ylength)
double lengthAdjust(double x1, double y1, double x2, double y2)
std::vector< double > upVec
std::vector< int > MESHtoLID_N
std::vector< int > Prowarray
bool setupBoundaryStencil()
std::map< std::string, std::string > tmpBCmap
std::vector< double > dRdpVec
std::vector< std::vector< double > > capVec
std::vector< int > boundaryStenP
std::vector< double > SVec
std::vector< double > areaVec
std::vector< double > JnVec
std::vector< double > tpVec
std::vector< EDGEINFO > edgeInfoVector
bool labelNameExist(std::string &labelName)
std::vector< double > dJpdV1Vec