52 #include <Xyce_config.h>
66 #include <N_LAS_Vector.h>
67 #include <N_LAS_Matrix.h>
68 #include <N_LAS_System.h>
69 #include <N_LAS_Builder.h>
88 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
93 Xyce::dout() <<
" DCOP load" <<std::endl;
97 Xyce::dout() <<
" Transient load" <<std::endl;
121 std::string msg =
"Instance::loadDAEFVector."
122 "Invalid coupling Mode";
123 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
127 return (bsuccess && bs1);
175 bool bsuccess =
true;
177 int Vrow, Nrow, Prow;
181 std::vector<DeviceInterfaceNode>::iterator firstDI =
dIVec.begin();
182 std::vector<DeviceInterfaceNode>::iterator lastDI =
dIVec.end ();
183 std::vector<DeviceInterfaceNode>::iterator iterDI = firstDI;
186 for (;iterDI!=lastDI;++iterDI, ++iRow)
188 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
190 Xyce::dout() <<
"name = " << iterDI->eName;
191 Xyce::dout() <<
" iRow = " << iRow << std::endl;
194 coef = iterDI->currentSum;
196 double voltLimFac = 0.0;
202 if (
dIVec[iCol].gid == -1)
continue;
204 double vdiff =
dIVec[iCol].Vckt_final -
dIVec[iCol].Vckt_orig;
208 voltLimFac += vdiff *
condVec[iRow][iCol];
210 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
212 Xyce::dout() <<
"iCol = " << iCol;
213 Xyce::dout() <<
" vdiff = " << vdiff;
214 Xyce::dout() <<
" cond = " << condVec[iRow][iCol];
215 Xyce::dout() <<
" voltLimFac = " << voltLimFac << std::endl;
222 if (iterDI->gid != -1)
225 (iterDI->gid, coef - voltLimFac, 0);
226 bsuccess = bsuccess && bs1;
231 (iterDI->gid, voltLimFac, 0);
232 bsuccess = bsuccess && bs1;
246 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
248 Xyce::dout() <<
"KCL for "<< iterDI->eName <<
":\n";
249 Xyce::dout() <<
" row = " << iterDI->gid <<
"\n";
250 Xyce::dout() <<
"currentSum = " << coef <<
"\n";
251 Xyce::dout() <<
"voltLimFac = " << voltLimFac << std::endl;
260 #endif // Xyce_NEW_BC
271 bsuccess = bsuccess && bs1;
284 bsuccess = bsuccess && bs1;
297 bsuccess = bsuccess && bs1;
319 bool bsuccess =
true;
322 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
325 if (
getSolverState().dcopFlag) Xyce::dout() <<
" DCOP load" <<std::endl;
326 else Xyce::dout() <<
" Transient load" <<std::endl;
349 std::string msg =
"Instance::loadDAEQVector."
350 "Invalid coupling Mode";
351 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
355 return (bsuccess && bs1);
369 bool bsuccess =
true;
390 bsuccess = bsuccess && bs1;
393 bsuccess = bsuccess && bs1;
440 Report::DevelFatal().in(
"Instance::loadDAEdFdx") <<
"Invalid coupling Mode" <<
numElectrodes;
473 bool bsuccess =
true;
484 bsuccess = bsuccess && bs1;
489 bsuccess = bsuccess && bs1;
493 bsuccess = bsuccess && bs1;
508 bool bsuccess =
true;
516 Xyce::dout() << std::endl;
517 Xyce::dout() << section_divider << std::endl;
518 Xyce::dout() <<
"Instance::loadDAEdFdxExtractedConductance" << std::endl;
537 #endif // Xyce_NEW_BC
545 bs1 = dFdx.putRow(iRow,1, valsGID, colsGID);
546 bsuccess = bsuccess && bs1;
553 bs1 = dFdx.putRow(iRow,1, valsGID, colsGID);
554 bsuccess = bsuccess && bs1;
561 bs1 = dFdx.putRow(iRow,1, valsGID, colsGID);
562 bsuccess = bsuccess && bs1;
569 int iRowGID =
dIVec[iRow].gid;
571 if (iRowGID == -1)
continue;
577 if (
dIVec[iCol].gid == -1)
continue;
579 colsGID[count] =
dIVec[iCol].gid;
580 valsGID[count] =
condVec[iRow][iCol];
584 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
586 Xyce::dout() <<
"\niRowGID = " << iRowGID;
587 Xyce::dout() <<
"\tcount = " << count << std::endl;
588 for (
int itmp=0;itmp<count;++itmp)
590 Xyce::dout() <<
" colsGID["<<itmp<<
"] = " << colsGID[itmp];
591 Xyce::dout() <<
" valsGID["<<itmp<<
"] = " << valsGID[itmp] << std::endl;
595 bs1 = dFdx.sumIntoRow (iRowGID, count, valsGID, colsGID);
596 bsuccess = bsuccess && bs1;
599 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
602 char tmpString[128];
for (
int i=0;i<128;++i) tmpString[i] = 0;
604 Xyce::dout() << std::endl;
605 sprintf(tmpString,
"ConArray:\t ");
606 Xyce::dout() << std::string(tmpString);
609 sprintf(tmpString,
"\t%14s",
dIVec[iE2].eName.c_str());
610 Xyce::dout() << std::string(tmpString);
612 Xyce::dout() << std::endl;
616 sprintf(tmpString,
"ConArray:\t%14s",
dIVec[iE1].eName.c_str());
617 Xyce::dout() << std::string(tmpString);
620 sprintf(tmpString,
"\t%14.4e",
condVec[iE1][iE2]); Xyce::dout() << std::string(tmpString);
622 Xyce::dout() << std::endl;
624 Xyce::dout() << std::endl;
661 Report::DevelFatal().in(
"Instance::loadDAEdQdx") <<
"Invalid coupling Mode" <<
numElectrodes;
678 bool bsuccess =
true;
683 int numCol =
cols.size();
699 for (j=0;j<numCol;++j) {
cols[j] = -1;
vals[j] = 0.0; }
707 if (Nrow != -1 && count > 0)
709 bs1 = QMatrix.sumIntoRow (Nrow,count,&
vals[0],&
cols[0]);
710 bsuccess = bsuccess && bs1;
714 Report::DevelFatal() <<
"OOOPS 1!";
718 for (j=0;j<numCol;++j) {
cols[j] = -1;
vals[j] = 0.0; }
726 if (Prow != -1 && count > 0)
728 bs1 = QMatrix.sumIntoRow (Prow,count,&
vals[0],&
cols[0]);
729 bsuccess = bsuccess && bs1;
733 Report::DevelFatal() <<
"OOOPS 2!";
bool loadDAEFExtractedConductance()
std::vector< double > & vals
bool loadDAEdFdxDDFormulation()
Linear::Vector * daeQVectorPtr
Pure virtual class to augment a linear system.
std::vector< int > Vrowarray
bool loadMatKCLDDForm(Linear::Matrix *matPtr)
std::vector< int > Nrowarray
std::vector< int > boundarySten
std::vector< std::vector< int > > li_PoffsetArray
std::vector< std::vector< int > > Ncolarray
const DeviceOptions & getDeviceOptions() const
std::vector< int > li_Nrowarray
Linear::Vector * JdxpVectorPtr
std::vector< double > nnVec
bool loadDAEdFdxExtractedConductance()
std::vector< std::vector< double > > condVec
bool loadDAEdQdxDDFormulation()
bool loadVecNLPoisson(double scalar, Linear::Vector *vecPtr)
bool loadDAEFNonlinPoisson()
bool pdTerminalCurrents()
Linear::Matrix * dFdxMatrixPtr
std::vector< DeviceInterfaceNode > dIVec
bool loadDAEdFdxNonlinPoisson()
bool loadVecDDForm(double scalar, double dndtScalar, Linear::Vector *vecPtr)
const SolverState & getSolverState() const
std::vector< std::vector< int > > Pcolarray
bool loadDAEFDDFormulation()
std::vector< double > npVec
Linear::Vector * daeFVectorPtr
bool loadMatNLPoisson(Linear::Matrix *matPtr)
bool loadMatCktTrivial(Linear::Matrix *matPtr)
std::vector< int > li_Prowarray
const ExternData & extData
std::vector< int > Prowarray
bool loadMatDDForm(double dndtScalar, Linear::Matrix *matPtr)
Linear::Matrix * dQdxMatrixPtr
bool loadDAEQDDFormulation()
std::vector< int > & cols
bool calcTerminalCurrents()
bool loadDAEQExtractedConductance()
std::vector< std::vector< int > > li_NoffsetArray
bool loadDAEdQdxExtractedConductance()