45 #include <Xyce_config.h>
48 #include <N_UTL_Math.h>
61 #include <N_ERH_ErrorMgr.h>
63 #include <N_LAS_Vector.h>
64 #include <N_LAS_Matrix.h>
65 #include <N_UTL_FeatureTest.h>
76 .setDescription(
"Inductance")
77 .setAnalyticSensitivityAvailable(
true)
78 .setSensitivityFunctor(&
indSens);
83 .setDescription(
"Initial current through device");
90 .setDescription(
"Device temperature");
95 .setDescription(
"Linear Temperature Coefficient");
100 .setDescription(
"Quadratic Temperature Coefficient");
113 .setDescription(
"Inductance Multiplier");
117 .setDescription(
"Initial current through device");
122 .setDescription(
"Reference temperature");
127 .setDescription(
"First order temperature coeff.");
132 .setDescription(
"Second order temperature coeff.");
189 :
DeviceInstance(instance_block, configuration.getInstanceParameters(), factory_block),
195 temp(getDeviceOptions().temp.getImmutableValue<double>()),
199 tempCoeff1Given(false),
200 tempCoeff2Given(false),
206 ABraEquPosNodeOffset(-1),
207 ABraEquNegNodeOffset(-1),
208 ABraEquBraVarOffset(-1),
209 APosEquBraVarOffset(-1),
210 ANegEquBraVarOffset(-1)
215 fBraEquPosNodePtr(0),
216 fBraEquNegNodePtr(0),
252 UserError0(*
this) <<
"Could not find L parameter in instance.";
298 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
322 const std::vector<int> & extLIDVecRef)
339 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
341 Xyce::dout() << section_divider << std::endl;
343 Xyce::dout() <<
"::registerLIDs:\n";
344 Xyce::dout() <<
" name = " <<
getName() << std::endl;
346 Xyce::dout() <<
"\nlocal solution indices:\n";
347 Xyce::dout() <<
" li_Pos = "<<
li_Pos << std::endl;
348 Xyce::dout() <<
" li_Neg = "<<
li_Neg << std::endl;
349 Xyce::dout() <<
" li_Bra = "<<
li_Bra << std::endl;
351 Xyce::dout() << section_divider << std::endl;
469 double current = solVec[
li_Bra];
536 double v_pos = solVec[
li_Pos];
537 double v_neg = solVec[
li_Neg];
538 double vind = v_pos-v_neg;
657 varTypeVec.resize(1);
684 std::vector<Instance*>::iterator iter;
688 for (iter=first; iter!=last; ++iter)
690 (*iter)->processParams();
708 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
709 inductanceMultiplier(1.0),
713 tnom(getDeviceOptions().tnom),
745 std::vector<Instance*>::iterator iter;
749 for (iter=first; iter!=last; ++iter)
766 std::vector<Instance*>::const_iterator iter;
774 os <<
"Number of Inductor instances: " << isize << std::endl;
775 os <<
" name=\t\tmodelName\tParameters" << std::endl;
776 for (i=0, iter=first; iter!=last; ++iter, ++i)
778 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
780 os <<
"\t\tL = " << (*iter)->L;
781 os <<
"\tIC = " << (*iter)->IC;
806 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
827 double current = solVec[inst.
li_Bra];
832 inst.
f0 = inst.
L*current;
860 bool Master::loadDAEVectors (
double * solVec,
double * fVec,
double *qVec,
double * bVec,
double * storeLeadF,
double * storeLeadQ,
double * leadF,
double * leadQ,
double * junctionV)
866 double current = 0.0;
869 double v_pos = solVec[inst.
li_Pos];
870 double v_neg = solVec[inst.
li_Neg];
871 double vind = v_pos-v_neg;
879 solVec[inst.
li_Bra] = current;
884 current = solVec[inst.
li_Bra];
889 fVec[inst.
li_Pos] += current;
890 fVec[inst.
li_Neg] += -current;
891 fVec[inst.
li_Bra] += coef;
921 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
929 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
942 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
960 .registerDevice(
"l", 1)
961 .registerModelType(
"l", 1)
962 .registerModelType(
"ind", 1);
975 const std::string & name,
976 std::vector<double> & dfdp,
977 std::vector<double> & dqdp,
978 std::vector<double> & dbdp,
979 std::vector<int> & Findices,
980 std::vector<int> & Qindices,
981 std::vector<int> & Bindices
988 double current = solVec[in->
li_Bra];
994 double dqdpLoc = current;
1000 Qindices[0] = in->
li_Bra;
const InstanceName & getName() const
double * fBraEquNegNodePtr
bool updateDependentParameters()
const DeviceOptions & deviceOptions_
int li_branch_data
Index for lead current and junction voltage (for power calculations)
Descriptor & addPar(const char *parName, T default_value, T U::*varPtr)
Adds the parameter description to the parameter map.
double * daeQVectorRawPtr
void registerBranchDataLIDs(const std::vector< int > &branchLIDVecRef)
Register the local store IDs.
static void loadInstanceParameters(ParametricData< Instance > &instance_parameters)
bool given(const std::string ¶meter_name) const
Pure virtual class to augment a linear system.
Parameter may be specified as time dependent expression from netlist.
void addInternalNode(Util::SymbolTable &symbol_table, int index, const InstanceName &instance_name, const std::string &lead_name)
double * currStaVectorRawPtr
void addBranchDataNode(Util::SymbolTable &symbol_table, int index, const InstanceName &instance_name, const std::string &lead_name)
void makeVector(const std::string &cname, int len)
Allows the parameter to be specified as a vector.
InstanceVector::const_iterator getInstanceEnd() const
Returns an iterator to the ending of the vector of all instances created for this device...
Base class for all parameters.
virtual void forEachInstance(DeviceInstanceOp &op) const
Apply a device instance "op" to all instances associated with this model.
const std::vector< std::vector< int > > & jacobianStamp() const
virtual void registerJacLIDs(const JacobianStamp &jacLIDVec)
bool updateSecondaryState()
static std::vector< std::vector< int > > jacStamp_BASE
virtual bool loadDAEVectors(double *solVec, double *fVec, double *qVec, double *bVec, double *storeLeadF, double *storeLeadQ, double *leadF, double *leadQ, double *junctionV)
Populates the device's ExternData object with these pointers.
void registerJacLIDs(const std::vector< std::vector< int > > &jacLIDVec)
InstanceVector::const_iterator getInstanceBegin() const
Returns an iterator to the beginning of the vector of all instances created for this device...
void varTypes(std::vector< char > &varTypeVec)
std::vector< Param > params
Parameters from the line.
void setParams(const std::vector< Param > ¶ms)
double * fBraEquPosNodePtr
const std::string & getName() const
double * daeFVectorRawPtr
void registerLIDs(const std::vector< int > &intLIDVecRef, const std::vector< int > &extLIDVecRef)
The FactoryBlock contains parameters needed by the device, instance and model creation functions...
virtual bool processParams()
processParams
const DeviceOptions & getDeviceOptions() const
void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
Instance(const Configuration &configuration, const InstanceBlock &instance_block, Model &model, const FactoryBlock &factory_block)
int numBranchDataVarsIfAllocated
virtual bool loadDAEMatrices(Linear::Matrix &dFdx, Linear::Matrix &dQdx)
Populates the device's Jacobian object with these pointers.
virtual std::ostream & printOutInstances(std::ostream &os) const
static Config< T > & addConfiguration()
Adds the device to the Xyce device configuration.
Linear::Matrix * dFdxMatrixPtr
The Device class is an interface for device implementations.
void registerStateLIDs(const std::vector< int > &staLIDVecRef)
double * fPosEquBraVarPtr
bool updateTemperature(const double &temp_tmp)
bool updatePrimaryState()
static indSensitivity indSens
const SolverState & solverState_
Class Configuration contains device configuration data.
double * qBraEquBraVarPtr
static void loadModelParameters(ParametricData< Model > &model_parameters)
const SolverState & getSolverState() const
void setNumBranchDataVars(int num_branch_data_vars)
double * nextStaVectorRawPtr
#define Xyce_NONPOINTER_MATRIX_LOAD
double inductanceMultiplier
double * fBraEquBraVarPtr
double * currSolVectorRawPtr
const ExternData & extData
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
ModelBlock represents a .MODEL line from the netlist.
Manages parameter binding for class C.
double * fNegEquBraVarPtr
virtual bool updateSecondaryState(double *staDeriv, double *stoVec)
Updates the devices secondary state information.
InstanceBlock represent a device instance line from the netlist.
virtual bool updateState(double *solVec, double *staVec, double *stoVec)
Updates the devices state information.
std::vector< Param > params
Linear::Matrix * dQdxMatrixPtr
virtual void operator()(const ParameterBase &entity, const std::string &name, std::vector< double > &dfdp, std::vector< double > &dqdp, std::vector< double > &dbdp, std::vector< int > &Findices, std::vector< int > &Qindices, std::vector< int > &Bindices) const
std::vector< Instance * > instanceContainer
virtual bool processInstanceParams()
processInstanceParams
int getNumBranchDataVars() const
const SolverState & getSolverState() const
Returns the solver state given during device construction.
void setModParams(const std::vector< Param > ¶ms)
double * nextSolVectorRawPtr