45 #include <Xyce_config.h>
57 #include <N_ERH_ErrorMgr.h>
61 #include <N_LAS_Matrix.h>
62 #include <N_LAS_Vector.h>
64 #include <N_UTL_Expression.h>
65 #include <N_UTL_FeatureTest.h>
70 namespace ThermalResistor {
78 .setDescription(
"Resistance");
83 .setDescription(
"Length of conductor");
88 .setDescription(
"Width of conductor");
93 .setDescription(
"Area of conductor");
98 .setDescription(
"Length of material thermally coupled to conductor");
103 .setDescription(
"Area of material thermally coupled to conductor");
109 .setDescription(
"Resistor material resistivity");
114 .setDescription(
"Resistor material density (unused)");
119 .setDescription(
"Resistor material volumetric heat capacity");
124 .setDescription(
"Volumetric heat capacity of material thermally coupled to conductor");
129 .setDescription(
"Device temperature");
135 .setDescription(
"Debug Output switch");
143 .setDescription(
"Linear Temperature Coefficient");
148 .setDescription(
"Quadratic Temperature Coefficient");
153 .setDescription(
"Sheet Resistance");
157 .setDescription(
"Resistance Multiplier");
162 .setDescription(
"Resistor material resistivity");
167 .setDescription(
"Resistor material density (unused)");
172 .setDescription(
"Resistor material volumetric heat capacity");
177 .setDescription(
"Volumetric heat capacity of material thermally coupled to conductor");
182 .setDescription(
"Default Instance Width");
187 .setDescription(
"Narrowing due to side etching");
192 .setDescription(
"Parameter Measurement Temperature");
229 :
DeviceInstance(IB, configuration.getInstanceParameters(), factory_block),
235 temp(getDeviceOptions().temp.getImmutableValue<double>()),
238 APosEquPosNodeOffset(-1),
239 APosEquNegNodeOffset(-1),
240 ANegEquPosNodeOffset(-1),
241 ANegEquNegNodeOffset(-1),
242 f_PosEquPosNodePtr(0),
243 f_PosEquNegNodePtr(0),
244 f_NegEquPosNodePtr(0),
245 f_NegEquNegNodePtr(0),
246 tempModelEnabled(false),
247 outputInternalVarsFlag(false),
284 || (
given(
"HEATCAPACITY") &&
given(
"RESISTIVITY")) )
295 if ( !(
given(
"HEATCAPACITY")) && !(
given(
"RESISTIVITY")) &&
309 int dpSize = model_dp.size();
311 for (
int i=0;i<dpSize;++i)
314 dpTmp.
name = model_dp[i].name;
315 dpTmp.
vals = model_dp[i].vals;
317 dpTmp.
n_vars = model_dp[i].n_vars;
318 dpTmp.
lo_var = model_dp[i].lo_var;
322 dpTmp.
expr =
new Util::Expression( *(model_dp[i].expr) );
325 if (dpTmp.
name==
"RESISTIVITY")
333 if (dpTmp.
name==
"HEATCAPACITY")
388 const std::vector<int> & extLIDVecRef )
393 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
395 Xyce::dout() << std::endl << section_divider << std::endl;
396 Xyce::dout() <<
" ResistorInstance::registerLIDs" << std::endl;
397 Xyce::dout() <<
" name = " <<
getName() << std::endl;
407 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
409 Xyce::dout() <<
" li_Pos = " <<
li_Pos << std::endl;
410 Xyce::dout() <<
" li_Neg = " <<
li_Neg << std::endl;
413 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
415 Xyce::dout() << section_divider << std::endl;
498 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
548 double v_pos = solVec[
li_Pos];
549 double v_neg = solVec[
li_Neg];
552 i0 = (v_pos-v_neg)*
G;
574 double dissipation =
i0*
i0*
R;
594 bool bsuccess =
true;
598 Xyce::dout().width(28); Xyce::dout().precision(20); Xyce::dout().setf(std::ios::scientific);
670 double difference, factor;
686 G = 1.0/(
R * factor);
717 std::vector<Instance*>::iterator iter;
721 for (iter=first; iter!=last; ++iter)
723 (*iter)->processParams();
741 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
745 resistanceMultiplier(1.0),
748 tnom(getDeviceOptions().tnom)
764 if (!
given(
"THERMAL_HEATCAPACITY"))
781 std::vector<Instance*>::iterator iter;
785 for (iter=first; iter!=last; ++iter)
801 std::vector<Instance*>::const_iterator iter;
808 os <<
"Number of Resistor Instances: " << isize << std::endl;
809 os <<
" name model name Parameters" << std::endl;
810 for (i=0, iter=first; iter!=last; ++iter, ++i)
812 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
814 os <<
"\t\tR(Tnom) = " << (*iter)->R;
815 os <<
"\tG(T) = " << (*iter)->G;
840 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
857 bool bsuccess =
true;
863 bsuccess = bsuccess && btmp;
869 double dissipation = ri.
i0*ri.
i0*ri.
R;
890 bool Master::loadDAEVectors (
double * solVec,
double * fVec,
double *qVec,
double * bVec,
double * storeLeadF,
double * storeLeadQ,
double * leadF,
double * leadQ,
double * junctionV)
917 #pragma omp parallel for
922 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
957 .registerDevice(
"r", 2)
958 .registerModelType(
"r", 2);
const InstanceName & getName() const
bool updateDependentParameters()
virtual void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
const DeviceOptions & deviceOptions_
Descriptor & addPar(const char *parName, T default_value, T U::*varPtr)
Adds the parameter description to the parameter map.
void registerStoreLIDs(const std::vector< int > &stoLIDVecRef)
bool given(const std::string ¶meter_name) const
virtual void forEachInstance(DeviceInstanceOp &op) const
Apply a device instance "op" to all instances associated with this model.
Pure virtual class to augment a linear system.
void registerStateLIDs(const std::vector< int > &staLIDVecRef)
static std::vector< std::vector< int > > jacStamp
void registerLIDs(const std::vector< int > &intLIDVecRef, const std::vector< int > &extLIDVecRef)
InstanceVector::const_iterator getInstanceEnd() const
Returns an iterator to the ending of the vector of all instances created for this device...
const std::vector< Depend > & getDependentParams()
double thermalHeatCapacity
virtual void registerJacLIDs(const JacobianStamp &jacLIDVec)
bool processInstanceParams()
processInstanceParams
double resistanceMultiplier
int getNumStoreVars() const
InstanceVector::const_iterator getInstanceBegin() const
Returns an iterator to the beginning of the vector of all instances created for this device...
std::vector< Param > params
Parameters from the line.
void setParams(const std::vector< Param > ¶ms)
const std::string & getName() const
double * daeFVectorRawPtr
std::vector< double > vals
The FactoryBlock contains parameters needed by the device, instance and model creation functions...
static void loadModelParameters(ParametricData< Model > &model_parameters)
Instance(const Configuration &configuration, const InstanceBlock &IB, Model &Riter, const FactoryBlock &factory_block)
const DeviceOptions & getDeviceOptions() const
double * f_NegEquPosNodePtr
double * nextStoVectorRawPtr
virtual std::ostream & printOutInstances(std::ostream &os) const
union Xyce::Device::Depend::resUnion resultU
bool outputInternalVarsFlag
Linear::Vector * nextStaVectorPtr
std::vector< std::string > global_params
static Config< T > & addConfiguration()
Adds the device to the Xyce device configuration.
bool updateIntermediateVars()
Linear::Matrix * dFdxMatrixPtr
The Device class is an interface for device implementations.
void addStoreNode(Util::SymbolTable &symbol_table, int index, const InstanceName &instance_name, const std::string &lead_name)
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.
static void loadInstanceParameters(ParametricData< Instance > &instance_parameters)
const SolverState & solverState_
bool processParams()
processParams
Class Configuration contains device configuration data.
virtual bool updateState(double *solVec, double *staVec, double *stoVec)
Updates the devices state information.
virtual bool loadDAEMatrices(Linear::Matrix &dFdx, Linear::Matrix &dQdx)
Populates the device's Jacobian object with these pointers.
const SolverState & getSolverState() const
void addDependentParameter(const Depend ¶m)
double * f_NegEquNegNodePtr
bool updateTemperature(const double &temp_tmp)
Linear::Vector * currStaVectorPtr
double * nextStaVectorRawPtr
bool updatePrimaryState()
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
double * f_PosEquPosNodePtr
const ExternData & extData
ModelBlock represents a .MODEL line from the netlist.
double thermalHeatCapacity
Manages parameter binding for class C.
double * f_PosEquNegNodePtr
InstanceBlock represent a device instance line from the netlist.
std::vector< Param > params
void registerJacLIDs(const std::vector< std::vector< int > > &jacLIDVec)
std::vector< Instance * > instanceContainer
const std::vector< std::vector< int > > & jacobianStamp() const
void setModParams(const std::vector< Param > ¶ms)
double * nextSolVectorRawPtr
int numLeadCurrentStoreVars