45 #include <Xyce_config.h>
58 #include <N_ERH_ErrorMgr.h>
62 #include <N_LAS_Vector.h>
63 #include <N_LAS_Matrix.h>
64 #include <N_UTL_FeatureTest.h>
76 .setDescription(
"Resistance");
81 .setDescription(
"Length");
86 .setDescription(
"Width");
92 .setDescription(
"Device temperature");
98 .setDescription(
"Linear Temperature Coefficient");
104 .setDescription(
"Quadratic Temperature Coefficient");
115 .setDescription(
"Device Temperature -- For compatibility only. Parameter is NOT used");
139 :
DeviceInstance(IB, configuration.getInstanceParameters(), factory_block),
152 tempCoeff1Given(false),
153 tempCoeff2Given(false),
156 ABraEquPosNodeOffset(-1),
157 ABraEquNegNodeOffset(-1),
158 APosEquBraVarOffset(-1),
159 ANegEquBraVarOffset(-1),
160 ABraEquBraVarOffset(-1),
161 APosEquPosNodeOffset(-1),
162 ANegEquNegNodeOffset(-1),
165 fBraEquPosNodePtr(0),
166 fBraEquNegNodePtr(0),
169 fPosEquPosNodePtr(0),
170 fNegEquNegNodePtr(0),
258 const std::vector<int> & extLIDVecRef)
262 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
264 Xyce::dout() << std::endl << section_divider << std::endl;
265 Xyce::dout() <<
" Instance::registerLIDs" << std::endl;
266 Xyce::dout() <<
" name = " <<
getName() << std::endl;
271 int numInt = intLIDVecRef.size();
272 int numExt = extLIDVecRef.size();
276 msg =
"Instance::registerLIDs:";
277 msg +=
"numInt != numIntVars";
278 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL_0,msg);
283 msg =
"Instance::registerLIDs:";
284 msg +=
"numExt != numExtVars";
285 N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL_0,msg);
300 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
302 Xyce::dout() <<
" li_Pos = " <<
li_Pos << std::endl;
303 Xyce::dout() <<
" li_Neg = " <<
li_Neg << std::endl;
304 Xyce::dout() <<
" li_Bra = " <<
li_Bra << std::endl;
305 Xyce::dout() << section_divider << std::endl;
389 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
524 double maxStep = 1.0e99;
538 varTypeVec.resize(1);
556 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
571 std::vector<Instance*>::iterator iter;
575 for (iter=first; iter!=last; ++iter)
593 std::vector<Instance*>::const_iterator iter;
599 os <<
" name model name Parameters" << std::endl;
600 for (i=0, iter=first; iter!=last; ++iter, ++i)
602 os <<
" " << i <<
": " << (*iter)->getName() <<
" ";
628 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
697 bool Master::loadDAEVectors (
double * solVec,
double * fVec,
double *qVec,
double * bVec,
double * storeLeadF,
double * storeLeadQ,
double * leadF,
double * leadQ,
double * junctionV)
730 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
764 .registerDevice(
"r", 3)
765 .registerModelType(
"r", 3);
const InstanceName & getName() const
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
bool updateDependentParameters()
double getMaxTimeStepSize()
const DeviceOptions & deviceOptions_
Descriptor & addPar(const char *parName, T default_value, T U::*varPtr)
Adds the parameter description to the parameter map.
const std::vector< std::vector< int > > & jacobianStamp() const
bool updatePrimaryState()
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)
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...
virtual void registerJacLIDs(const JacobianStamp &jacLIDVec)
static std::vector< std::vector< int > > jacStampPDE
virtual bool updateState(double *solVec, double *staVec, double *stoVec)
Updates the devices state information.
void varTypes(std::vector< char > &varTypeVec)
Instance(const Configuration &configuration, const InstanceBlock &IB, Model &Viter, const FactoryBlock &factory_block)
static void loadInstanceParameters(ParametricData< Instance > &instance_parameters)
InstanceVector::const_iterator getInstanceBegin() const
Returns an iterator to the beginning of the vector of all instances created for this device...
void setParams(const std::vector< Param > ¶ms)
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...
const DeviceOptions & getDeviceOptions() const
virtual void forEachInstance(DeviceInstanceOp &op) const
Apply a device instance "op" to all instances associated with this model.
bool updateIntermediateVars()
double * fBraEquNegNodePtr
static Config< T > & addConfiguration()
Adds the device to the Xyce device configuration.
Linear::Matrix * dFdxMatrixPtr
const DeviceOptions & getDeviceOptions() const
Returns the device options given during device construction.
void registerStateLIDs(const std::vector< int > &staLIDVecRef)
The Device class is an interface for device implementations.
void registerJacLIDs(const std::vector< std::vector< int > > &jacLIDVec)
const SolverState & solverState_
Class Configuration contains device configuration data.
const SolverState & getSolverState() const
std::vector< Instance * > instanceContainer
#define Xyce_NONPOINTER_MATRIX_LOAD
double * fNegEquBraVarPtr
virtual bool loadDAEMatrices(Linear::Matrix &dFdx, Linear::Matrix &dQdx)
Populates the device's Jacobian object with these pointers.
double * fBraEquPosNodePtr
const ExternData & extData
ModelBlock represents a .MODEL line from the netlist.
virtual std::ostream & printOutInstances(std::ostream &os) const
Manages parameter binding for class C.
double * fPosEquBraVarPtr
InstanceBlock represent a device instance line from the netlist.
std::vector< Param > params
static void loadModelParameters(ParametricData< Model > &model_parameters)
void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
static std::vector< std::vector< int > > jacStamp
const SolverState & getSolverState() const
Returns the solver state given during device construction.
double * nextSolVectorRawPtr
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.