47 #include <Xyce_config.h>
52 #include <N_UTL_Math.h>
62 #include <N_LAS_Vector.h>
63 #include <N_LAS_Matrix.h>
64 #include <N_LAS_System.h>
65 #include <N_LAS_Builder.h>
68 #define NUM_MESH_POINTS 11
71 #define MAX_COLS_PER_ROW 10
90 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) &&
getSolverState().debugTimeFlag)
93 if (
getSolverState().dcopFlag) Xyce::dout() <<
" DCOP load" << std::endl;
94 else Xyce::dout() <<
" Transient load" << std::endl;
117 std::string msg =
"Instance::loadDAEFVector."
118 "Invalid coupling Mode";
119 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
123 return (bsuccess && bs1);
183 for (iBC=0;iBC<
bcVec.size();++iBC, ++iRow)
185 coef =
bcVec[iBC].currentSum;
187 if (iBC==1) coef *= -1.0;
189 double voltLimFac = 0.0;
195 if (
bcVec[iCol].gid == -1)
continue;
197 double vdiff =
bcVec[iCol].Vckt_final -
bcVec[iCol].Vckt_orig;
201 voltLimFac += vdiff *
condVec[iRow][iCol];
205 fVec[
bcVec[iBC].lid] += -coef + voltLimFac;
209 for (
int i=0;i<
NX;++i)
229 bool bsuccess =
true;
255 std::string msg =
"Instance::loadDAEQVector."
256 "Invalid coupling Mode";
257 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
261 return (bsuccess && bs1);
334 Report::DevelFatal().in(
"Instance::loadDAEdFdx") <<
"Invalid coupling Mode" <<
numElectrodes;
380 bool bsuccess =
true;
404 bs1 = mat.putLocalRow(iRow,1, valsLID, colsLID);
405 bsuccess = bsuccess && bs1;
412 bs1 = mat.putLocalRow(iRow,1, valsLID, colsLID);
413 bsuccess = bsuccess && bs1;
420 bs1 = mat.putLocalRow(iRow,1, valsLID, colsLID);
421 bsuccess = bsuccess && bs1;
429 int iRowLID =
bcVec[iRow].gid;
431 if (iRowLID == -1)
continue;
437 if (
bcVec[iCol].gid == -1)
continue;
439 colsLID[count] =
bcVec[iCol].gid;
440 valsLID[count] =
condVec[iRow][iCol];
444 bs1 = mat.sumIntoLocalRow (iRowLID, count, valsLID, colsLID);
445 bsuccess = bsuccess && bs1;
448 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
451 char tmpString[128];
for (
int i=0;i<128;++i) tmpString[i] = 0;
453 Xyce::dout() << std::endl;
454 sprintf(tmpString,
"ConArray:\t "); Xyce::dout() << std::string(tmpString);
457 sprintf(tmpString,
"\t%14s",
bcVec[iE2].eName.c_str()); Xyce::dout() << std::string(tmpString);
459 Xyce::dout() << std::endl;
463 sprintf(tmpString,
"ConArray:\t%14s",
bcVec[iE1].eName.c_str()); Xyce::dout() << std::string(tmpString);
466 sprintf(tmpString,
"\t%14.4e",
condVec[iE1][iE2]); Xyce::dout() << std::string(tmpString);
468 Xyce::dout() << std::endl;
470 Xyce::dout() << std::endl;
506 Report::DevelFatal().in(
"Instance::loadDAEdQdx") <<
"Invalid coupling Mode " <<
numElectrodes;
523 bool bsuccess =
true;
529 for (
int i=1;i<
NX-1;++i)
559 bool bsuccess =
true;
bool loadVecDDForm(double *rhs)
bool loadDAEFExtractedConductance()
std::vector< int > li_Vrowarray
bool loadDAEQDDFormulation()
Linear::Vector * daeQVectorPtr
Pure virtual class to augment a linear system.
bool loadDAEFDDFormulation()
bool loadMatDDForm(Linear::Matrix &mat)
bool loadDAEQExtractedConductance()
std::vector< int > li_Prowarray
std::vector< double > npVec
bool loadDAEdFdxExtractedConductance()
Nonlinear::TwoLevelNewtonMode twoLevelNewtonCouplingMode
bool loadMatNLPoisson(Linear::Matrix &mat)
bool loadDAEdFdxDDFormulation()
double * daeFVectorRawPtr
const DeviceOptions & getDeviceOptions() const
bool loadDAEdQdxDDFormulation()
std::vector< bcData > bcVec
bool loadDAEdFdxNonlinPoisson()
Linear::Matrix * dFdxMatrixPtr
std::vector< std::vector< int > > li_Pcolarray
std::vector< double > nnVec
const SolverState & getSolverState() const
std::vector< std::vector< double > > condVec
Linear::Vector * daeFVectorPtr
bool loadVecNLPoisson(double *rhs)
const ExternData & extData
bool loadDAEFNonlinPoisson()
std::vector< std::vector< int > > li_Ncolarray
Linear::Matrix * dQdxMatrixPtr
bool loadDAEdQdxExtractedConductance()
std::vector< int > li_Nrowarray