46 #ifndef Xyce_N_DEV_Diode_h
47 #define Xyce_N_DEV_Diode_h
67 typedef Sacado::Fad::SFad<double, 1>
fadType;
70 template <
typename ScalarT>
71 inline ScalarT
Xycemax ( ScalarT f1, ScalarT f2) {
return f1 > f2 ? f1 : f2; }
73 template <
typename ScalarT>
74 inline ScalarT
Xycemin ( ScalarT f1, ScalarT f2) {
return f1 < f2 ? f1 : f2; }
87 const std::string ¶m,
88 std::vector<double> & dfdp,
89 std::vector<double> & dqdp,
90 std::vector<double> & dbdp,
91 std::vector<int> & Findices,
92 std::vector<int> & Qindices,
93 std::vector<int> & Bindices
101 static const char *
name() {
return "Diode";}
113 template <
typename ScalarT>
124 template <
typename ScalarT>
144 const ScalarT & TNOM,
153 const ScalarT & COND,
157 const ScalarT & TIKF,
161 const bool & BVGiven,
162 const ScalarT & TBV1,
163 const ScalarT & TBV2,
164 const ScalarT & TRS1,
165 const ScalarT & TRS2,
171 template <
typename ScalarT>
181 const ScalarT & Temp,
182 const ScalarT & tJctCap,
183 const ScalarT & tJctPot,
184 const ScalarT & tDepCap,
186 const ScalarT & tSatCur,
187 const ScalarT & tSatCurR,
188 const ScalarT & tVcrit,
190 const ScalarT & tCOND,
191 const ScalarT & tIRF,
192 const ScalarT & tIKF,
193 const ScalarT & tBrkdwnV,
196 const ScalarT & Area,
197 const int & lambertWFlag,
223 template <
typename ScalarT>
234 const ScalarT & tVcrit,
241 const ScalarT & currVd_old,
242 const ScalarT & nextVd_old,
244 const double InitCond,
245 const bool InitCondGiven,
252 const bool dotICapplies,
255 const int & newtonIter,
256 const bool initJctFlag,
257 const bool voltageLimiterFlag,
259 const bool locaEnabledFlag
300 void registerLIDs(
const std::vector<int> & intLIDVecRef,
301 const std::vector<int> & extLIDVecRef );
307 const std::vector< std::vector<int> > &
jacobianStamp()
const;
308 void registerJacLIDs(
const std::vector< std::vector<int> > & jacLIDVec );
349 static std::vector< std::vector<int> >
jacMap2;
421 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
552 virtual bool updateState (
double * solVec,
double * staVec,
double * stoVec);
556 virtual bool loadDAEVectors (
double * solVec,
double * fVec,
double * qVec,
double * bVec,
double * storeLeadF,
double * storeLeadQ,
double * leadF,
double * leadQ,
double * junctionV);
559 virtual bool loadDAEMatrices (Linear::Matrix & dFdx, Linear::Matrix & dQdx);
static std::vector< int > jacMap
static bool modelRequired()
bool updateIntermediateVars()
double * qPriEquPosNodePtr
static std::vector< int > jacMap_RS
bool lambertWBreakdownCurrent(double Isat, double Vte, double RS)
double * qPriEquNegNodePtr
Model & operator=(const Model &)
double * fPriEquPriNodePtr
std::vector< Instance * > InstanceVector
double * fPosEquPriNodePtr
static std::vector< std::vector< int > > jacStamp_RS
double * fPriEquNegNodePtr
static const char * deviceTypeName()
Pure virtual class to augment a linear system.
double * qNegEquNegNodePtr
void registerLIDs(const std::vector< int > &intLIDVecRef, const std::vector< int > &extLIDVecRef)
Master(const Configuration &configuration, const FactoryBlock &factory_block, const SolverState &ss1, const DeviceOptions &do1)
void registerStateLIDs(const std::vector< int > &staLIDVecRef)
Sacado::Fad::SFad< double, 1 > fadType
double * qPriEquPriNodePtr
Base class for all parameters.
ScalarT Xycemax(ScalarT f1, ScalarT f2)
virtual void operator()(const ParameterBase &entity, const std::string ¶m, 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
bool processParams(ScalarT &M, ScalarT &EG, ScalarT &FC, const ScalarT &RS, ScalarT &COND, ScalarT &F2, ScalarT &F3)
Instance(const Configuration &configuration, const InstanceBlock &instance_block, Model &model, const FactoryBlock &factory_block)
Instance & operator=(const Instance &)
double * fNegEquNegNodePtr
static void loadModelParameters(ParametricData< Model > &model_parameters)
double * qNegEquPriNodePtr
void registerBranchDataLIDs(const std::vector< int > &branchLIDVecRef)
In addition to state vector, Xyce maintains a separate datastructure called a "branch data" vector...
std::vector< Instance * > instanceContainer
DeviceMaster instantiates a device as described by the device traits T.
static diodeSensitivity diodeSens
virtual ~diodeSensitivity()
double * fPriEquPosNodePtr
The FactoryBlock contains parameters needed by the device, instance and model creation functions...
general sensitivity functor for all model params.
bool updateTemperature(const double &temp=-999.0)
void getNoiseSources(Xyce::Analysis::NoiseData &noiseData)
bool processInstanceParams()
processInstanceParams
static std::vector< std::vector< int > > jacStamp
The Device class is an interface for device implementations.
void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
bool updatePrimaryState()
bool processParams()
processParams
static const char * name()
const std::vector< std::vector< int > > & jacobianStamp() const
bool lambertWLinearReverseBias(double Isat, double Vte, double RS)
virtual std::ostream & printOutInstances(std::ostream &os) const
void setupNoiseSources(Xyce::Analysis::NoiseData &noiseData)
Class Configuration contains device configuration data.
static std::vector< std::vector< int > > jacMap2_RS
bool updateIntermediateVars(const ScalarT &Vp, const ScalarT &Vpp, const ScalarT &Vn, const ScalarT &Vd, const ScalarT &Temp, const ScalarT &tJctCap, const ScalarT &tJctPot, const ScalarT &tDepCap, const ScalarT &tF1, const ScalarT &tSatCur, const ScalarT &tSatCurR, const ScalarT &tVcrit, const ScalarT &tRS, const ScalarT &tCOND, const ScalarT &tIRF, const ScalarT &tIKF, const ScalarT &tBrkdwnV, const ScalarT &Area, const int &lambertWFlag, const double &gmin, const ScalarT M, const ScalarT BV, const ScalarT IBV, const ScalarT NBV, const ScalarT IBVL, const ScalarT NBVL, const ScalarT N, const ScalarT NR, const ScalarT TT, const ScalarT F2, const ScalarT F3, const int level, ScalarT &Id, ScalarT &Gd, ScalarT &Qd, ScalarT &Cd, ScalarT &Gspr)
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
static bool isLinearDevice()
double * qPosEquPriNodePtr
virtual bool loadDAEMatrices(Linear::Matrix &dFdx, Linear::Matrix &dQdx)
Populates the device's Jacobian object with these pointers.
virtual bool updateState(double *solVec, double *staVec, double *stoVec)
Updates the devices state information.
static void loadInstanceParameters(ParametricData< Instance > &instance_parameters)
static std::vector< std::vector< int > > jacMap2
double * qPosEquPosNodePtr
Base sensitivity functor.
ModelBlock represents a .MODEL line from the netlist.
bool lambertWCurrent(double Isat, double Vte, double RS)
The DeviceTraits template describes the configuration of a device.
Manages parameter binding for class C.
double * fNegEquPriNodePtr
InstanceBlock represent a device instance line from the netlist.
void registerJacLIDs(const std::vector< std::vector< int > > &jacLIDVec)
bool applyLimiters(DeviceSupport &devSupport, const ScalarT &Vp, const ScalarT &Vpp, const ScalarT &Vn, const ScalarT &tVcrit, ScalarT &Vd, ScalarT &Vd_orig, ScalarT &Vd_old, const ScalarT &currVd_old, const ScalarT &nextVd_old, const double InitCond, const bool InitCondGiven, const bool BVGiven, const int off, bool &origFlag, const bool dotICapplies, const int &newtonIter, const bool initJctFlag, const bool voltageLimiterFlag, const bool dcopFlag, const bool locaEnabledFlag)
virtual void forEachInstance(DeviceInstanceOp &op) const
Apply a device instance "op" to all instances associated with this model.
void addInstance(Instance *instance)
int li_branch_data
Index for Lead Current and junction voltage (for power calculations)
ScalarT Xycemin(ScalarT f1, ScalarT f2)
int getNumNoiseSources() const
double * fPosEquPosNodePtr
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.
bool updateTemperature( ScalarT &Temp, ScalarT &tJctCap, ScalarT &tJctPot, ScalarT &tDepCap, ScalarT &tF1, ScalarT &tSatCur, ScalarT &tSatCurR, ScalarT &tVcrit, ScalarT &tRS, ScalarT &tCOND, ScalarT &tIRF, ScalarT &tIKF, ScalarT &tBrkdwnV, const ScalarT &TNOM, const ScalarT &VJ, const ScalarT &CJO, const ScalarT &M, const ScalarT &N, const ScalarT &IS, const ScalarT &EG, const ScalarT &XTI, const ScalarT &RS, const ScalarT &COND, const ScalarT &IRF, const ScalarT &NR, const ScalarT &IKF, const ScalarT &TIKF, const ScalarT &ISR, const ScalarT &IBV, const ScalarT &BV, const bool &BVGiven, const ScalarT &TBV1, const ScalarT &TBV2, const ScalarT &TRS1, const ScalarT &TRS2, const ScalarT &FC, const int level)
void registerStoreLIDs(const std::vector< int > &stoLIDVecRef)