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<sDepend>::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;
332 std::string tmpstr(
getName()+
"_branch");
375 std::string modName(
getName());
378 tmpstr = modName+
":DEV_I";
402 li_ddt[i] = staLIDVecRef[i];
443 const std::vector< std::vector<int> > & jacLIDVec)
482 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
602 double maxMag = 1.0e+10;
605 static Report::MessageCode id;
607 Report::UserWarning(
id) <<
"Expression derivative |" <<
expVarDerivs[i] <<
"| exceeds " << maxMag <<
", value reduced";
630 double source(0.0), v_pos(0.0), v_neg(0.0), i_bra(0.0);
645 double c_tmp = i_bra;
646 double v_tmp = (v_pos-v_neg-source);
725 varTypeVec.resize(1);
744 :
DeviceModel(MB, configuration.getModelParameters(), factory_block)
758 std::vector<Instance*>::iterator iter;
762 for (iter=first; iter!=last; ++iter)
806 std::vector<Instance*>::const_iterator iter;
812 os <<
" name model name Parameters" << std::endl;
813 for (i=0, iter=first; iter!=last; ++iter, ++i)
815 os <<
" " << i <<
": " << (*iter)->getName() <<
" ";
841 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
925 double maxMag = 1.0e+10;
928 static Report::MessageCode id;
930 Report::UserWarning(
id) <<
"Expression derivative |" << bi.
expVarDerivs[k] <<
"| exceeds " << maxMag <<
", value reduced";
952 double v_pos(0.0), v_neg(0.0), i_bra(0.0);
953 double source = bi.
expVal;
959 v_pos = solVec[bi.
li_Pos];
960 v_neg = solVec[bi.
li_Neg];
961 i_bra = solVec[bi.
li_Bra];
963 double c_tmp = i_bra;
964 double v_tmp = (v_pos-v_neg-source);
967 fVec[bi.
li_Neg] += -c_tmp;
972 fVec[bi.
li_Pos] += source;
973 fVec[bi.
li_Neg] += -source;
1001 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1027 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1055 .registerDevice(
"b", 1)
1056 .registerDevice(
"f", 1)
1057 .registerDevice(
"h", 1);