45 #include <Xyce_config.h>
61 #include <N_ERH_ErrorMgr.h>
63 #include <N_LAS_Vector.h>
64 #include <N_LAS_Matrix.h>
102 :
DeviceInstance(IBref, configuration.getInstanceParameters(), factory_block),
111 ABraEquPosNodeOffset(-1),
112 ABraEquNegNodeOffset(-1),
113 ABraEquContPosNodeOffset(-1),
114 ABraEquContNegNodeOffset(-1),
115 APosEquBraVarOffset(-1),
116 ANegEquBraVarOffset(-1),
118 f_BraEquPosNodePtr(0),
119 f_BraEquNegNodePtr(0),
120 f_BraEquContPosNodePtr(0),
121 f_BraEquContNegNodePtr(0),
122 f_PosEquBraVarPtr(0),
129 std::string prefix(
getName() +
"-");
132 name2 = prefix +
"I_branch";
159 UserError0(*
this) <<
"Could not find Gain parameter in instance.";
185 const std::vector<int> & extLIDVecRef )
189 #ifdef Xyce_DEBUG_DEVICE
192 Xyce::dout() << std::endl << section_divider << std::endl;
193 Xyce::dout() <<
" VcvsInstance::registerLIDs" << std::endl;
194 Xyce::dout() <<
" name = " <<
getName() << std::endl;
200 int numInt = intLIDVecRef.size();
201 int numExt = extLIDVecRef.size();
205 msg =
"Instance::registerLIDs:";
206 msg +=
"numInt != numIntVars";
207 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
212 msg =
"Instance::registerLIDs:";
213 msg +=
"numExt != numExtVars";
214 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
230 #ifdef Xyce_DEBUG_DEVICE
233 Xyce::dout() <<
" li_Pos = " <<
li_Pos << std::endl;
234 Xyce::dout() <<
" li_Neg = " <<
li_Neg << std::endl;
235 Xyce::dout() <<
" li_ContPos = " <<
li_ContPos << std::endl;
236 Xyce::dout() <<
" li_ContNeg = " <<
li_ContNeg << std::endl;
242 #ifdef Xyce_DEBUG_DEVICE
244 Xyce::dout() <<
" li_Bra = " <<
li_Bra << std::endl;
247 #ifdef Xyce_DEBUG_DEVICE
249 Xyce::dout() << section_divider << std::endl;
267 std::string tmpstr(
getName()+
"_branch");
331 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
373 double v_pos = solVec[
li_Pos];
374 double v_neg = solVec[
li_Neg];
378 double i_bra = solVec[
li_Bra];
383 double src =
Gain * ( v_cont_pos - v_cont_neg ) - v_pos + v_neg;
426 varTypeVec.resize(1);
444 :
DeviceModel(MB, configuration.getModelParameters(), factory_block)
458 std::vector<Instance*>::iterator iter;
462 for (iter=first; iter!=last; ++iter)
478 std::vector<Instance*>::const_iterator iter;
484 os <<
" name model name Parameters" << std::endl;
485 for (i=0, iter=first; iter!=last; ++iter, ++i)
487 os <<
" " << i <<
": " << (*iter)->getName() <<
" ";
513 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
544 #pragma omp parallel for
550 double v_pos = solVec[vi.
li_Pos];
551 double v_neg = solVec[vi.
li_Neg];
555 double i_bra = solVec[vi.
li_Bra];
558 fVec[vi.
li_Neg] += -i_bra;
560 double src = vi.
Gain * ( v_cont_pos - v_cont_neg ) - v_pos + v_neg;
582 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
614 .registerDevice(
"e", 1)
615 .registerModelType(
"e", 1);