45 #include <Xyce_config.h>
48 #include <N_UTL_Misc.h>
69 #include <N_ERH_ErrorMgr.h>
71 #include <N_LAS_Vector.h>
72 #include <N_LAS_Matrix.h>
74 #include <N_UTL_Expression.h>
75 #include <N_UTL_BreakPoint.h>
91 .setDescription(
"Current for current source");
96 .setDescription(
"Voltage for voltage source");
103 #define Xyce_NONPOINTER_MATRIX_LOAD 1
119 :
DeviceInstance(IB, configuration.getInstanceParameters(), factory_block),
126 ABraEquPosNodeOffset(-1),
127 ABraEquNegNodeOffset(-1),
128 APosEquBraVarOffset(-1),
129 ANegEquBraVarOffset(-1),
130 fBraEquPosNodePtr(0),
131 fBraEquNegNodePtr(0),
167 UserError0(*
this) <<
"Must supply one of V= or I=";
179 std::vector<Depend>::const_iterator d;
183 for (d = begin ; d != end ; ++d)
185 if (d->name ==
"I" || d->name ==
"V")
275 const std::vector<int> & extLIDVecRef )
280 #ifdef Xyce_DEBUG_DEVICE
281 Xyce::dout() << std::endl << section_divider << std::endl;
282 Xyce::dout() <<
" BsrcInstance::registerLIDs" << std::endl;
283 Xyce::dout() <<
" name = " <<
getName() << std::endl;
297 #ifdef Xyce_DEBUG_DEVICE
298 Xyce::dout() <<
" li_Pos = " <<
li_Pos << std::endl;
299 Xyce::dout() <<
" li_Neg = " <<
li_Neg << std::endl;
306 #ifdef Xyce_DEBUG_DEVICE
307 Xyce::dout() <<
" li_Bra = " <<
li_Bra << std::endl;
311 #ifdef Xyce_DEBUG_DEVICE
312 Xyce::dout() << section_divider << std::endl;
393 li_ddt[i] = staLIDVecRef[i];
434 const std::vector< std::vector<int> > & jacLIDVec)
473 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
593 double maxMag = 1.0e+10;
596 static Report::MessageCode id;
598 Report::UserWarning(
id) <<
"Expression derivative |" <<
expVarDerivs[i] <<
"| exceeds " << maxMag <<
", value reduced";
621 double source(0.0), v_pos(0.0), v_neg(0.0), i_bra(0.0);
636 double c_tmp = i_bra;
637 double v_tmp = (v_pos-v_neg-source);
716 varTypeVec.resize(1);
735 :
DeviceModel(MB, configuration.getModelParameters(), factory_block)
749 std::vector<Instance*>::iterator iter;
753 for (iter=first; iter!=last; ++iter)
797 std::vector<Instance*>::const_iterator iter;
803 os <<
" name model name Parameters" << std::endl;
804 for (i=0, iter=first; iter!=last; ++iter, ++i)
806 os <<
" " << i <<
": " << (*iter)->getName() <<
" ";
832 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
916 double maxMag = 1.0e+10;
919 static Report::MessageCode id;
921 Report::UserWarning(
id) <<
"Expression derivative |" << bi.
expVarDerivs[k] <<
"| exceeds " << maxMag <<
", value reduced";
938 bool Master::loadDAEVectors (
double * solVec,
double * fVec,
double *qVec,
double * bVec,
double * storeLeadF,
double * storeLeadQ)
943 double v_pos(0.0), v_neg(0.0), i_bra(0.0);
944 double source = bi.
expVal;
950 v_pos = solVec[bi.
li_Pos];
951 v_neg = solVec[bi.
li_Neg];
952 i_bra = solVec[bi.
li_Bra];
954 double c_tmp = i_bra;
955 double v_tmp = (v_pos-v_neg-source);
958 fVec[bi.
li_Neg] += -c_tmp;
963 fVec[bi.
li_Pos] += source;
964 fVec[bi.
li_Neg] += -source;
992 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1018 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1045 .registerDevice(
"b", 1)
1046 .registerDevice(
"f", 1)
1047 .registerDevice(
"h", 1);