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),
287 || (
given(
"HEATCAPACITY") &&
given(
"RESISTIVITY")) )
298 if ( !(
given(
"HEATCAPACITY")) && !(
given(
"RESISTIVITY")) &&
312 int dpSize = model_dp.size();
314 for (
int i=0;i<dpSize;++i)
317 dpTmp.
name = model_dp[i].name;
318 dpTmp.
vals = model_dp[i].vals;
320 dpTmp.
n_vars = model_dp[i].n_vars;
321 dpTmp.
lo_var = model_dp[i].lo_var;
325 dpTmp.
expr =
new Util::Expression( *(model_dp[i].expr) );
328 if (dpTmp.
name==
"RESISTIVITY")
336 if (dpTmp.
name==
"HEATCAPACITY")
391 const std::vector<int> & extLIDVecRef )
396 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
398 Xyce::dout() << std::endl << section_divider << std::endl;
399 Xyce::dout() <<
" ResistorInstance::registerLIDs" << std::endl;
400 Xyce::dout() <<
" name = " <<
getName() << std::endl;
410 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
412 Xyce::dout() <<
" li_Pos = " <<
li_Pos << std::endl;
413 Xyce::dout() <<
" li_Neg = " <<
li_Neg << std::endl;
416 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
418 Xyce::dout() << section_divider << std::endl;
537 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
588 double v_pos = solVec[
li_Pos];
589 double v_neg = solVec[
li_Neg];
592 i0 = (v_pos-v_neg)*
G;
614 double dissipation =
i0*
i0*
R;
634 bool bsuccess =
true;
638 Xyce::dout().width(28); Xyce::dout().precision(20); Xyce::dout().setf(std::ios::scientific);
715 double difference, factor;
731 G = 1.0/(
R * factor);
762 std::vector<Instance*>::iterator iter;
766 for (iter=first; iter!=last; ++iter)
768 (*iter)->processParams();
786 :
DeviceModel(MB, configuration.getModelParameters(), factory_block),
790 resistanceMultiplier(1.0),
793 tnom(getDeviceOptions().tnom)
809 if (!
given(
"THERMAL_HEATCAPACITY"))
826 std::vector<Instance*>::iterator iter;
830 for (iter=first; iter!=last; ++iter)
846 std::vector<Instance*>::const_iterator iter;
853 os <<
"Number of Resistor Instances: " << isize << std::endl;
854 os <<
" name model name Parameters" << std::endl;
855 for (i=0, iter=first; iter!=last; ++iter, ++i)
857 os <<
" " << i <<
": " << (*iter)->getName() <<
"\t";
859 os <<
"\t\tR(Tnom) = " << (*iter)->R;
860 os <<
"\tG(T) = " << (*iter)->G;
885 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
902 bool bsuccess =
true;
908 bsuccess = bsuccess && btmp;
914 double dissipation = ri.
i0*ri.
i0*ri.
R;
935 bool Master::loadDAEVectors (
double * solVec,
double * fVec,
double *qVec,
double * bVec,
double * storeLeadF,
double * storeLeadQ,
double * leadF,
double * leadQ,
double * junctionV)
964 #pragma omp parallel for
969 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1004 .registerDevice(
"r", 2)
1005 .registerModelType(
"r", 2);
const InstanceName & getName() const
int li_branch_data
Index for Lead Current and junction voltage (for power calculations)
virtual void registerBranchDataLIDs(const std::vector< int > &branchLIDVecRef)
Register the local store IDs.
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)
double currTimeStep_
Region, BJT, Digital, ThermalResistor, ROM, Charon, Others.
bool given(const std::string ¶meter_name) const
void G(const ScalarT &V1, const ScalarT &V2, const ScalarT &Ap, const ScalarT &An, ScalarT &Vp, ScalarT &Vn, ScalarT &fval)
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)
void addBranchDataNode(Util::SymbolTable &symbol_table, int index, const InstanceName &instance_name, const std::string &lead_name)
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)
double * nextJunctionVCompRawPtr
bool processInstanceParams()
processInstanceParams
double tnom
nominal temperature for device params.
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
int numBranchDataVarsIfAllocated
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.
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
double * nextLeadCurrFCompRawPtr
void addDependentParameter(const Depend ¶m)
double * f_NegEquNegNodePtr
bool updateTemperature(const double &temp_tmp)
void setNumBranchDataVars(int num_branch_data_vars)
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.
double currTime_
DeviceEntity for expression time, breakpoints DeviceMgr for dependent parameters, breakpoints...
Util::Param temp
operating temperature of ckt.
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
bool outputPlotFiles(bool force_final_output)
int getNumBranchDataVars() const
void setModParams(const std::vector< Param > ¶ms)
double * nextSolVectorRawPtr
int numLeadCurrentStoreVars