51 #include <Xyce_config.h>
69 #include <N_ERH_ErrorMgr.h>
71 #include <N_LAS_Matrix.h>
72 #include <N_LAS_Vector.h>
74 #include <N_UTL_Expression.h>
159 :
DeviceInstance(IB, configuration.getInstanceParameters(), factory_block),
170 APosEquPosNodeOffset(-1),
171 APosEquNegNodeOffset(-1),
172 ANegEquPosNodeOffset(-1),
173 ANegEquNegNodeOffset(-1),
174 fPosEquPosNodePtr(0),
175 fPosEquNegNodePtr(0),
176 fNegEquPosNodePtr(0),
177 fNegEquNegNodePtr(0),
204 UserError0(*
this) <<
"Cannot specify both 'on' and off' for switch";
208 if (!
given(
"CONTROL"))
210 UserError0(*
this) <<
"Must specify 'control' for switch";
213 std::vector<Depend>::const_iterator d;
217 for (d = begin ; d != end ; ++d)
219 if (d->name ==
"CONTROL")
270 const std::vector<int> & extLIDVecRef)
305 li_ddt[i] = staLIDVecRef[i+1];
320 AssertLIDs(stoLIDVecRef.size() == getNumStoreVars());
322 if( loadLeadCurrent )
324 li_store_dev_i = stoLIDVecRef[0];
339 if( loadLeadCurrent && storeNameMap.empty ())
411 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
461 double current_state;
503 if (current_state >= 1.0)
510 else if ( current_state <= 0.0)
519 current_state = 2*current_state - 1;
521 0.25*
model_.
Lr*current_state*current_state*current_state);
634 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
646 else if (
getType() ==
"ISWITCH") {
649 else if (
getType() ==
"VSWITCH") {
706 if (del < 0 && del > -1e-12)
708 if (del >= 0 && del < 1e-12)
726 std::vector<Instance*>::iterator iter;
730 for (iter=first; iter!=last; ++iter)
732 (*iter)->processParams();
748 std::vector<Instance*>::iterator iter;
752 for (iter=first; iter!=last; ++iter)
766 std::vector<Instance*>::const_iterator iter;
772 os <<
" name model name Parameters" << std::endl;
773 for (i=0, iter=first; iter!=last; ++iter, ++i)
775 os <<
" " << i <<
": " << (*iter)->getName() <<
" ";
777 os <<
" R = " << (*iter)->R;
778 os <<
" G = " << (*iter)->G;
779 os <<
" State = " << (*iter)->SW_STATE;
804 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
823 bool bsuccess =
true;
830 bsuccess = bsuccess && btmp;
854 double current_state;
892 if (current_state >= 1.0)
899 else if ( current_state <= 0.0)
908 current_state = 2*current_state - 1;
910 0.25*si.
getModel().
Lr*current_state*current_state*current_state);
931 bool Master::loadDAEVectors (
double * solVec,
double * fVec,
double *qVec,
double * bVec,
double * storeLeadF,
double * storeLeadQ)
962 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1006 .registerDevice(
"s", 1)
1008 #ifdef Xyce_OLD_SWITCH
1009 .registerModelType(
"sw", 1)
1011 .registerModelType(
"switch", 1)
1012 .registerModelType(
"iswitch", 1)
1013 .registerModelType(
"vswitch", 1)