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<sDepend>::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 ())
343 std::string modName(getName());
344 spiceInternalName(modName);
346 tmpstr = modName+
":DEV_I";
347 storeNameMap[ li_store_dev_i ] = tmpstr;
417 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
467 double current_state;
509 if (current_state >= 1.0)
516 else if ( current_state <= 0.0)
525 current_state = 2*current_state - 1;
527 0.25*
model_.
Lr*current_state*current_state*current_state);
640 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
652 else if (
getType() ==
"ISWITCH") {
655 else if (
getType() ==
"VSWITCH") {
712 if (del < 0 && del > -1e-12)
714 if (del >= 0 && del < 1e-12)
732 std::vector<Instance*>::iterator iter;
736 for (iter=first; iter!=last; ++iter)
738 (*iter)->processParams();
754 std::vector<Instance*>::iterator iter;
758 for (iter=first; iter!=last; ++iter)
772 std::vector<Instance*>::const_iterator iter;
778 os <<
" name model name Parameters" << std::endl;
779 for (i=0, iter=first; iter!=last; ++iter, ++i)
781 os <<
" " << i <<
": " << (*iter)->getName() <<
" ";
783 os <<
" R = " << (*iter)->R;
784 os <<
" G = " << (*iter)->G;
785 os <<
" State = " << (*iter)->SW_STATE;
810 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
829 bool bsuccess =
true;
836 bsuccess = bsuccess && btmp;
860 double current_state;
898 if (current_state >= 1.0)
905 else if ( current_state <= 0.0)
914 current_state = 2*current_state - 1;
916 0.25*si.
getModel().
Lr*current_state*current_state*current_state);
968 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1012 .registerDevice(
"s", 1)
1014 #ifdef Xyce_OLD_SWITCH
1015 .registerModelType(
"sw", 1)
1017 .registerModelType(
"switch", 1)
1018 .registerModelType(
"iswitch", 1)
1019 .registerModelType(
"vswitch", 1)