Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Xyce::Device::Resistor::Instance Class Reference

Resistor device instance class. More...

#include <N_DEV_Resistor.h>

Inheritance diagram for Xyce::Device::Resistor::Instance:
Collaboration diagram for Xyce::Device::Resistor::Instance:

Public Member Functions

 Instance (const Configuration &configuration, const InstanceBlock &instance_block, Model &model, const FactoryBlock &factory_block)
 Construct a resistor instance. More...
 
 ~Instance ()
 Destroys this instance. More...
 
ModelgetModel ()
 Gets the resistor model that owns this instance. More...
 
virtual void registerLIDs (const std::vector< int > &intLIDVecRef, const std::vector< int > &extLIDVecRef)
 Register local IDs. More...
 
virtual void registerStateLIDs (const std::vector< int > &staLIDVecRef)
 Register the local state IDs. More...
 
virtual void registerStoreLIDs (const std::vector< int > &stoLIDVecRef)
 Register the local store IDs. More...
 
virtual void registerJacLIDs (const std::vector< std::vector< int > > &jacLIDVec)
 Register the Jacobian local IDs. More...
 
virtual std::map< int,
std::string > & 
getStoreNameMap ()
 Populates and returns the store name map. More...
 
virtual bool processParams ()
 Process parameters. More...
 
virtual bool updateTemperature (const double &temp_tmp)
 Update the parameters that depend on the temperature of the device. More...
 
virtual bool updateIntermediateVars ()
 Update the intermediate variables. More...
 
virtual bool updatePrimaryState ()
 Update the state variables. More...
 
virtual const std::vector
< std::vector< int > > & 
jacobianStamp () const
 Return Jacobian stamp that informs topology of the layout of the resistor jacobian. More...
 
virtual bool loadDAEFVector ()
 Load the DAE F vector. More...
 
virtual bool loadDAEdFdx ()
 Load the DAE the derivative of the F vector with respect to the solution vector x, dFdx. More...
 
virtual bool loadDAEQVector ()
 Load Q vector. More...
 
virtual bool loadDAEdQdx ()
 Load derivative of Q vector with respect to solution vector. More...
 
virtual void setupPointers ()
 Setup direct access pointer to solution matrix and vectors. More...
 
- Public Member Functions inherited from Xyce::Device::DeviceInstance
 DeviceInstance (const InstanceBlock &instance_block, ParametricData< void > &parametric_data, const FactoryBlock &factory_block)
 
virtual ~DeviceInstance ()
 
virtual void enableLeadCurrentCalc ()
 
virtual void registerGIDs (const std::list< index_pair > &intGIDListRef, const std::list< index_pair > &extGIDListRef)
 
virtual void registerStateGIDs (const std::list< index_pair > &staGIDListRef)
 
virtual void registerStoreGIDs (const std::list< index_pair > &stoGIDListRef)
 
virtual const std::vector
< std::string > & 
getDepSolnVars ()
 
virtual void registerDepSolnGIDs (const std::vector< std::vector< int > > &varList)
 
virtual const std::vector
< std::string > & 
getDepStateVars ()
 
virtual void registerDepStateGIDs (const std::vector< std::vector< int > > &varList)
 
virtual const std::vector
< std::string > & 
getDepStoreVars ()
 
virtual void registerDepStoreGIDs (const std::vector< std::vector< int > > &varList)
 
virtual void registerDepSolnLIDs (const std::vector< std::vector< int > > &depSolnLIDVecRef)
 
virtual void registerDepStateLIDs (const std::vector< std::vector< int > > &depStaLIDVecRef)
 
virtual void registerDepStoreLIDs (const std::vector< std::vector< int > > &depStoLIDVecRef)
 
virtual void registerGIDData (const std::vector< int > &counts, const std::vector< int > &GIDs, const std::vector< std::vector< int > > &jacGIDs)
 
virtual void getDepSolnGIDVec (std::vector< int > &depGIDVec)
 
virtual bool getIndexPairList (std::list< index_pair > &iplRef)
 
virtual bool getInstanceBreakPoints (std::vector< N_UTL_BreakPoint > &breakPointTimes)
 
virtual bool updateSource ()
 
virtual bool processInstanceParams ()
 
virtual bool isConverged ()
 
virtual bool testDAEMatrices (std::vector< std::string > &nameVec)
 
virtual bool loadTrivialDAE_FMatrixStamp ()
 
bool trivialStampLoader (N_LAS_Matrix *matPtr)
 
bool zeroMatrixDiagonal (N_LAS_Matrix *matPtr)
 
virtual bool updateSecondaryState ()
 
virtual bool setIC ()
 
virtual bool plotfileFlag ()
 
virtual bool loadDeviceMask ()
 
virtual void acceptStep ()
 
int getNumIntVars () const
 
int getNumExtVars () const
 
int getNumStateVars () const
 
int getNumStoreVars () const
 
void setNumStoreVars (int num_store_vars)
 
virtual void getDevConMap (std::vector< int > &)
 
virtual DeviceStategetInternalState ()
 
virtual bool setInternalState (const DeviceState &state)
 
virtual bool loadDFDV (int iElectrode, N_LAS_Vector *dfdvPtr)
 
virtual bool calcConductance (int iElectrode, const N_LAS_Vector *dxdvPtr)
 
virtual std::map< int,
std::string > & 
getIntNameMap ()
 
virtual std::map< int,
std::string > & 
getStateNameMap ()
 
void spiceInternalName (std::string &tmpname)
 
virtual bool outputPlotFiles ()
 
virtual bool enablePDEContinuation ()
 
virtual bool disablePDEContinuation ()
 
virtual void setPDEContinuationAlpha (double alpha)
 
virtual void setPDEContinuationBeta (double beta)
 
virtual bool setInitialGuess ()
 
virtual double getMaxTimeStepSize ()
 
virtual void varTypes (std::vector< char > &varTypeVec)
 
bool getOrigFlag () const
 
void setOrigFlag (bool origFlag_local)
 
const std::vector< int > & getDevLIDs () const
 
const std::vector< std::vector
< int > > & 
getDevJacLIDs () const
 
const std::vector< int > & getStaLIDVec () const
 
bool getMergeRowColChecked () const
 
void setMergeRowColChecked (bool mergeRowColChecked_local)
 
const MatrixLoadDatagetMatrixLoadData () const
 
MatrixLoadDatagetMatrixLoadData ()
 
- Public Member Functions inherited from Xyce::Device::DeviceEntity
 DeviceEntity (const char *const entity_type, const std::string &device_name, ParametricData< void > &parametric_data, const SolverState &solver_state, const DeviceOptions &device_options, const std::string &netlist_path, int netlist_line)
 
virtual ~DeviceEntity ()
 
virtual CompositeParamconstructComposite (const std::string &composite_name, const std::string &param_name)
 
bool setDefaultParam (double val)
 
double getDefaultParam ()
 
bool scaleParam (const std::string &paramName, double val, double val0)
 
bool scaleParam (const std::string &paramName, double val)
 
bool scaleDefaultParam (double val)
 
bool setParam (const std::string &paramName, double val)
 
bool getParam (const std::string &paramName, double &result)
 
bool getParamBreakpoints (std::vector< Util::BreakPoint > &)
 
bool updateDependentParameters (N_LAS_Vector &vars)
 
bool updateDependentParameters (double temp_tmp)
 
bool updateGlobalParameters (std::map< std::string, double > &)
 
bool updateDependentParameters ()
 
double setDependentParameter (Util::Param &, double *, ParameterType::ExprAccess)
 
double setDependentParameter (Util::Param &, std::vector< double > *, int, ParameterType::ExprAccess)
 
void setDependentParameter (Util::Param &par, Depend &dependentParam, ParameterType::ExprAccess depend)
 
void setDefaultParams ()
 
void setParams (const std::vector< Param > &params)
 
bool given (const std::string &parameter_name) const
 
const char * getEntityType () const
 
const std::string & getName () const
 
void setDefaultParamName (const std::string &default_param_name)
 
const std::vector< Depend > & getDependentParams ()
 
const DeviceOptionsgetDeviceOptions () const
 
const SolverStategetSolverState () const
 
const NetlistLocation & netlistLocation () const
 
const ParameterMapgetParameterMap () const
 
- Public Member Functions inherited from Xyce::Device::ParameterBase
 ParameterBase ()
 
double getOriginalValue (int serial_number)
 
void setOriginalValue (int serial_number, double value)
 
bool wasValueGiven (int serial_number) const
 
void setValueGiven (int serial_number, bool value)
 

Private Member Functions

 Instance (const Instance &)
 
Instanceoperator= (const Instance &)
 

Static Private Member Functions

static void initializeJacobianStamp ()
 Common Jacobian stamp initializer for all Resistor devices. More...
 

Private Attributes

Modelmodel_
 Owning model. More...
 
double R
 Resistance (ohms) More...
 
double length
 Resistor length. More...
 
double width
 Resistor width. More...
 
double temp
 Temperature of this instance. More...
 
double tempCoeff1
 First order temperature coeff. More...
 
double tempCoeff2
 Second order temperature coeff. More...
 
double dtemp
 Externally specified device temperature. More...
 
bool tempCoeff1Given
 First order temperation value was given in netlist. More...
 
bool tempCoeff2Given
 Second order temperature coeff was given in netlist. More...
 
bool dtempGiven
 Externally specified device temperature was given in netlist. More...
 
double G
 Conductance(1.0/ohms) More...
 
double i0
 Current(ohms) More...
 
int li_Pos
 Index for Positive Node. More...
 
int li_Neg
 Index for Negative Node. More...
 
int li_store_dev_i
 Index for Lead Current. More...
 
int APosEquPosNodeOffset
 Column index into force matrix of Pos/Pos conductance. More...
 
int APosEquNegNodeOffset
 Column index into force matrix of Pos/Neg conductance. More...
 
int ANegEquPosNodeOffset
 Column index into force matrix of Neg/Pos conductance. More...
 
int ANegEquNegNodeOffset
 Column index into force matrix of Neg/Neg conductance. More...
 
double * f_PosEquPosNodePtr
 
double * f_PosEquNegNodePtr
 
double * f_NegEquPosNodePtr
 
double * f_NegEquNegNodePtr
 

Static Private Attributes

static std::vector
< std::vector< int > > 
jacStamp
 All Resistor instances have a common Jacobian Stamp. More...
 

Friends

class ParametricData< Instance >
 Allow ParametricData to changes member values. More...
 
class Model
 
class Traits
 
class Master
 

Additional Inherited Members

- Public Attributes inherited from Xyce::Device::DeviceInstance
std::vector< int > & cols
 
std::vector< double > & vals
 
NumericalJacobiannumJacPtr
 
bool psLoaded
 
bool ssLoaded
 
bool rhsLoaded
 
bool origFlag
 
int numIntVars
 
int numExtVars
 
int numStateVars
 
int numStoreVars
 
int numLeadCurrentStoreVars
 
bool loadLeadCurrent
 
std::vector< int > devConMap
 
bool mergeRowColChecked
 
- Protected Member Functions inherited from Xyce::Device::DeviceInstance
void jacStampMap (std::vector< std::vector< int > > &stamp_parent, std::vector< int > &map_parent, std::vector< std::vector< int > > &map2_parent, std::vector< std::vector< int > > &stamp, std::vector< int > &map, std::vector< std::vector< int > > &map2, int from, int to, int original_size)
 
void jacStampMap_fixOrder (std::vector< std::vector< int > > &stamp_parent, std::vector< std::vector< int > > &map2_parent, std::vector< std::vector< int > > &stamp, std::vector< std::vector< int > > &map2)
 
void outputJacStamp (const std::vector< std::vector< int > > &jac)
 
void outputJacMaps (const std::vector< int > &jacMap, const std::vector< std::vector< int > > &jacMap2)
 
- Protected Attributes inherited from Xyce::Device::DeviceInstance
const ExternDataextData
 
std::list< index_pair > intGIDList
 
std::list< index_pair > extGIDList
 
std::list< index_pair > indexPairList
 
std::list< index_pair > staGIDList
 
std::vector< int > intLIDVec
 
std::vector< int > extLIDVec
 
std::vector< int > staLIDVec
 
std::vector< int > stoLIDVec
 
std::vector< int > devLIDs
 
std::vector< std::vector< int > > devJacLIDs
 
std::map< int, std::string > intNameMap
 
std::map< int, std::string > stateNameMap
 
std::map< int, std::string > storeNameMap
 
DeviceSupport devSupport
 

Detailed Description

Resistor device instance class.

An instance is created for each occurance of the device in the netlist.

It contains "unique" resistor information - ie stuff that will be true of only one resistor in the circuit, such as the nodes to which it is connected. A resistor is connected to only two circuit nodes.

This class does not directly contain information about its node indices. It contains indices into the 5 parts (dFdx, dQdx, dx, F, and Q) of the matrix problem A*dx = b, and also the solution vector x. A is the Jacobian matrix that will be formed from dFdx and d(dQ/dt)dx, dx is the update to x, and b is right hand side function vector that will be formed from F and dQ/dt. These indices are global, and determined by topology during the initialization stage of execution.

Definition at line 102 of file N_DEV_Resistor.h.

Constructor & Destructor Documentation

Xyce::Device::Resistor::Instance::Instance ( const Configuration configuration,
const InstanceBlock instance_block,
Model model,
const FactoryBlock factory_block 
)

Construct a resistor instance.

Parameters
[in]configurationDevice configuration and traits.
[in]instance_blockInstance information from parser.
[in]modelResistor Model to which we should add this instance.
[in]factory_blockDevice options defined in netlist.
Note
The parameter member variable values from the initializers are immediately replaced with the values from the parameter definitions by the setDefaultParams() function.

Definition at line 270 of file N_DEV_Resistor.C.

Xyce::Device::Resistor::Instance::~Instance ( )
inline

Destroys this instance.

Author
Eric Keiter, SNL
Date
3/16/00

Definition at line 129 of file N_DEV_Resistor.h.

Xyce::Device::Resistor::Instance::Instance ( const Instance )
private

Member Function Documentation

Model& Xyce::Device::Resistor::Instance::getModel ( )
inline

Gets the resistor model that owns this instance.

Returns
reference to the owning Resistor::Model
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Mon Aug 12 08:36:37 2013

Definition at line 152 of file N_DEV_Resistor.h.

std::map< int, std::string > & Xyce::Device::Resistor::Instance::getStoreNameMap ( )
virtual

Populates and returns the store name map.

If the DeviceInstance::storeNameMap is empty, populate it.

Returns
reference to the DeviceInstance::storeNameMap

For the purpose of lead currents, store vector elements must be given names that can be used to locate lead currents at print time. When a netlist attempts to print, say, "I(R1)" the output code looks for an entry in the store vector named R1:DEV_I.

This method does the assignment of names to store vector elements.

Author
Richard Schiek, Electrical Systems Modeling
Date
12/18/2012

Reimplemented from Xyce::Device::DeviceInstance.

Definition at line 529 of file N_DEV_Resistor.C.

void Xyce::Device::Resistor::Instance::initializeJacobianStamp ( )
staticprivate

Common Jacobian stamp initializer for all Resistor devices.

The Jacobian stamp is a sparse-matrix representation of the pattern of non-zero elements that a device will put into the Jacobian matrix.

The Jacobian stamp is used by the Topology package to determine indices into the full Jacobian matrix for elements that correspond to this device.

There is one row of the Jacobian stamp for each equation associated with a device. The number of elements in a row are the number of non-zero elements in that row of the device's contribution to the Jacobian. The values of the elements are numbers local to the device that represent the column in which the non-zero element appears.

For the resistor, there are two external nodes (the positive and negative terminals of the device). The positive node is referred to as the 0th node of the device, and the negative node the 1st node. Considering positive current flow from the positive node to the negative node, current out of the positive node is $(V_+-V_-)*G$, and current out of the negative node is $-(V_+-V_-)*G$. Thus, the Jacobian matrix contribution for the resistor is:

\[ \left[\begin{array}{cc} G& -G\\ -G& G \end{array} \right] \]

This is a dense Jacobian with two rows. The first row is the row for the positive node's KCL, the second row is the row for the negative node KCL. Each row has two non-zero elements. The columns correspond to the nodes of the device: the first column is the positive node, the second the negative node. The element of the jacobian is the dependence of the equation associated with the row on the variable associated with the column.

The Jacobian stamp therefore has two rows, and each row has two elements. In this trivial device (because the matrix is small and fully dense), the stamp values are 0 ("positive node") for the first nonzero in each row, and 1 ("negative node") for the second nonzero.

Definition at line 120 of file N_DEV_Resistor.C.

virtual const std::vector< std::vector<int> >& Xyce::Device::Resistor::Instance::jacobianStamp ( ) const
inlinevirtual

Return Jacobian stamp that informs topology of the layout of the resistor jacobian.

The Jacobian stamp describes the shape of the Jacobian to the Topology subsystem. The Topology subsystem, in turn, returns the offsets into the matrix and solution vectors where this instance data is located.

Returns
const reference to a std::vector of std::vector of integers describing Jacobian stamp shape
Author
Robert Hoekstra
Date
8/20/2001

Reimplemented from Xyce::Device::DeviceInstance.

Definition at line 187 of file N_DEV_Resistor.h.

bool Xyce::Device::Resistor::Instance::loadDAEdFdx ( )
virtual

Load the DAE the derivative of the F vector with respect to the solution vector x, dFdx.

Loads the contributions for a single resistor instance to the dFdx matrix (the F contribution to the Jacobian).

This method uses the Jacobian LIDs (row offsets) that were stored by registerJacLIDs.

See Also
Xyce::Device::Resistor::Instance::registerJacLIDs
Note
This method is called by the default implementation of the loadDAEMatrices master function. Since the Resistor class reimplements the "Master" "loadDAEMatrices" function that loads the contributions from all resistor devices in a single loop, THIS FUNCTION IS NOT ACTUALLY USED. The loadDAEdFdx method is only called when a device class does not re-implement the master class. This can be a source of confusion when attempting to modify the Resistor device, or any other device that reimplements the Master classes.
See Also
Xyce::Device::Resistor::Master::loadDAEMatrices
Returns
true on success
Author
Eric Keiter, SNL, Parallel Computational Sciences
Date
03/05/04

Implements Xyce::Device::DeviceInstance.

Definition at line 811 of file N_DEV_Resistor.C.

virtual bool Xyce::Device::Resistor::Instance::loadDAEdQdx ( )
inlinevirtual

Load derivative of Q vector with respect to solution vector.

Returns
true on success

Since the Resistor does no charge storage, this is a no-op.

Author
Eric Keiter
Date
1/24/03

Implements Xyce::Device::DeviceInstance.

Definition at line 233 of file N_DEV_Resistor.h.

bool Xyce::Device::Resistor::Instance::loadDAEFVector ( )
virtual

Load the DAE F vector.

Returns
true on success

The Xyce DAE formulation solves the differential-algebraic equations $F(x)+dQ(x)/dt=0$ These are vector equations resulting from the modified nodal analysis of the circuit.

This method loads the F-vector contributions for a single resistor instance.

In this method, the offsets defined in registerLIDs are used to store the device's F contributions into the F vector.

The Q vector is used for devices that store charge or magnetic energy, and since the resistor does none of that, the F vector contributions are the whole of the resistor's contribution to the full set of DAEs.

Note
This method is called by the default implementation of the loadDAEVectors master function. Since the Resistor class reimplements the "Master" "loadDAEVectors" function that loads the contributions from all resistor devices in a single loop, THIS FUNCTION IS NOT ACTUALLY USED. The loadDAEFVector method is only called when a device class does not re-implement the master class. This can be a source of confusion when attempting to modify the Resistor device, or any other device that reimplements the Master classes.
See Also
Xyce::Device::Resistor::Master::loadDAEVectors
Author
Eric Keiter, SNL, Parallel Computational Sciences
Date
01/24/03

Implements Xyce::Device::DeviceInstance.

Definition at line 760 of file N_DEV_Resistor.C.

virtual bool Xyce::Device::Resistor::Instance::loadDAEQVector ( )
inlinevirtual

Load Q vector.

Returns
true on success

Since the Resistor does no charge storage, this is a no-op.

Author
Eric Keiter
Date
1/24/03

Implements Xyce::Device::DeviceInstance.

Definition at line 211 of file N_DEV_Resistor.h.

Instance& Xyce::Device::Resistor::Instance::operator= ( const Instance )
private
bool Xyce::Device::Resistor::Instance::processParams ( )
virtual

Process parameters.

Returns
true on success

In general, the processParams method is intended as a place for complex manipulation of parameters that must happen if temperature or other external changes happen. In the resistor device it does nothing other than call updateTemperature.

Author
Eric Keiter, SNL, Parallel Computational Sciences
Date
6/03/02

Reimplemented from Xyce::Device::DeviceInstance.

Definition at line 374 of file N_DEV_Resistor.C.

void Xyce::Device::Resistor::Instance::registerJacLIDs ( const std::vector< std::vector< int > > &  jacLIDVec)
virtual

Register the Jacobian local IDs.

Parameters
jacLIDVecJacobian local Ids
See Also
Xyce::Device::Resistor::Instance::initializeJacobianStamp

Having established local IDs for the solution variables, Topology must also assign local IDs for the elements of the Jacobian matrix.

For each non-zero element that was identified in the jacobianStamp, Topology will assign a Jacobian LID. The jacLIDVec will have the same structure as the JacStamp, but the values in the jacLIDVec will be offsets into the row of the sparse Jacobian matrix corresponding to the non-zero identified in the stamp.

These offsets are stored in this method for use later when we load the Jacobian.

Author
Robert Hoekstra, SNL, Parallel Computational Sciences
Date
08/27/01

Reimplemented from Xyce::Device::DeviceInstance.

Definition at line 576 of file N_DEV_Resistor.C.

void Xyce::Device::Resistor::Instance::registerLIDs ( const std::vector< int > &  intLIDVecRef,
const std::vector< int > &  extLIDVecRef 
)
virtual

Register local IDs.

Register the local internal and external node IDs.

Parameters
intLIDVecRefinternal local IDs from topology package
extLIDVecRefexternal local IDs from topology package

Instantiation (calling the device constructor) of the device sets up variables numIntVars and numExtVars, the numbers of internal and external variables associated with the device. This information is then used by the Topology package to assign locations in the solution vector (and all other vectors of the same shape) for those variables. The "Local IDs" (LIDs) of these locations are provided by Topology so the device can know where to load its data.

This method saves the LIDs from Topology and associates each one with a particular local name for the internal or external variable. They are then used when we load the F and Q vectors.

The resistor device has no internal variables, so this method makes no use of the intLIDVecRef array.

Author
Robert Hoekstra, SNL, Parallel Computational Sciences
Date
6/12/02

Reimplemented from Xyce::Device::DeviceInstance.

Definition at line 413 of file N_DEV_Resistor.C.

void Xyce::Device::Resistor::Instance::registerStateLIDs ( const std::vector< int > &  staLIDVecRef)
virtual

Register the local state IDs.

Note
The resistor does not have any state vars, so this function does nothing.
Parameters
staLIDVecRefState variable local IDs

In general, devices may declare at construction that they require storage locations in the "state vector." Topology assigns locations in the state vector and returns "Local IDs" (LIDs) for devices to use for their state vector entries. If a device uses state vector entries, it uses the registerStateLIDs method to save the local IDs for later use.

Author
Robert Hoekstra, SNL, Parallel Computational Sciences
Date
06/12/02

Reimplemented from Xyce::Device::DeviceInstance.

Definition at line 464 of file N_DEV_Resistor.C.

void Xyce::Device::Resistor::Instance::registerStoreLIDs ( const std::vector< int > &  stoLIDVecRef)
virtual

Register the local store IDs.

In addition to state vector, Xyce maintains a separate datastructure called a "store" vector. As with other such vectors, the device declares at construction time how many store vector entries it needs, and later Topology assigns locations for devices, returning LIDs.

These LIDs are stored in this method for later use.

The Resistor device uses exactly one "store vector" element, where it keeps the "lead current" that may be used on .PRINT lines as "I(R1)" for the current through resistor R1.

Parameters
stoLIDVecRefStore variable local IDs
Author
Richard Schiek, Electrical Systems Modeling
Date
12/18/2012

Reimplemented from Xyce::Device::DeviceInstance.

Definition at line 495 of file N_DEV_Resistor.C.

void Xyce::Device::Resistor::Instance::setupPointers ( )
virtual

Setup direct access pointer to solution matrix and vectors.

See Also
Xyce::Device::Resistor::Instance::registerJacLIDs

As an alternative to the row offsets defined in registerJacLIDs, it is also possible to obtain direct pointers of the Jacobian elements.

This method uses the offsets obtained in registerJacLIDs to retrieve the pointers.

In the resistor device the pointers to the matrix are only saved (and are only used for matrix access) if Xyce_NONPOINTER_MATRIX_LOAD is NOT defined at compile time. For some devices the use of pointers instead of array indexing can be a performance enhancement.

Use of pointers in this device is disabled by defining Xyce_NONPOINTER_MATRIX_LOAD at compile time. When disabled, array indexing with the offsets from registerJacLIDs is used in the matrix load methods.

Author
Eric Keiter, SNL
Date
11/30/08

Reimplemented from Xyce::Device::DeviceInstance.

Definition at line 621 of file N_DEV_Resistor.C.

bool Xyce::Device::Resistor::Instance::updateIntermediateVars ( )
virtual

Update the intermediate variables.

Returns
true on success

The bulk of any device's computation is handled in the instance class' updateIntermediateVars method. For the resistor, this is merely the computation of the current through the resistor given the voltage difference between its terminals.

Intermediate variables computed here are used in the methods that load data into the F, Q, dFdX and dQdX data structures.

Note
This method is called by the updatePrimaryState method. Since the Resistor class reimplements the "Master" "loadState" function that loads the contributions from all resistor devices in a single loop, THIS FUNCTION IS NOT ACTUALLY USED!
See Also
Xyce::Device::Resistor::Instance::loadDAEFVector Xyce::Device::Resistor::Instance::loadDAEQVector Xyce::Device::Resistor::Instance::loadDAEdFdx Xyce::Device::Resistor::Instance::loadDAEdQdx Xyce::Device::Resistor::Instance::updatePrimaryState
Author
Eric R. Keiter, Dept. 9233.
Date
3/05/04

Implements Xyce::Device::DeviceInstance.

Definition at line 663 of file N_DEV_Resistor.C.

bool Xyce::Device::Resistor::Instance::updatePrimaryState ( )
virtual

Update the state variables.

Returns
true on success

This function is the function that is called from the device manager each time a load of vectors and Jacobian is required. Its first job is to call updateIntermediateVars.

After calling updateIntermediateVars, the updatePrimaryState method may load state vector elements as needed.

The resistor device has no state vector elements, so all this method does in the resistor instance class is call updateIntermediateVars.

There is no longer a "secondary" state. The "primary" in this method's name is purely historical.

Note
This method is called by the default implementation of the loadState master function. Since the Resistor class reimplements the "Master" "loadState" function that loads the contributions from all resistor devices in a single loop, THIS FUNCTION IS NOT ACTUALLY USED, NOR is the updateIntermediateVars method it calls! The updatePrimaryState method is only called when a device class does not re-implement the master class. This can be a source of confusion when attempting to modify the Resistor device, or any other device That reimplements the Master classes.
See Also
Xyce::Device::Resistor::Master::updateState
Author
Eric Keiter, SNL, Parallel Computational Sciences
Date
01/29/01

Reimplemented from Xyce::Device::DeviceInstance.

Definition at line 713 of file N_DEV_Resistor.C.

bool Xyce::Device::Resistor::Instance::updateTemperature ( const double &  temp_tmp)
virtual

Update the parameters that depend on the temperature of the device.

Parameters
temp_tmptemperature

Xyce has a number of mechanisms that allow temperature to be changed after a device has been instantiated. These include .STEP loops over temperature. When temperature is changed, any device that has parameters that depend on temperature must be updated. That updating happens here.

The Resistor device supports temperature-dependent resistance through its TC1 (linear dependence) and TC2 (quadratic dependence) parameters. If these parameters are specified, the resistance must be updated.

Returns
true on success
Author
Tom Russo, Component Information and Models
Date
02/27/01

Reimplemented from Xyce::Device::DeviceInstance.

Definition at line 847 of file N_DEV_Resistor.C.

Friends And Related Function Documentation

friend class Master
friend

Definition at line 107 of file N_DEV_Resistor.h.

friend class Model
friend

Definition at line 105 of file N_DEV_Resistor.h.

friend class ParametricData< Instance >
friend

Allow ParametricData to changes member values.

Definition at line 104 of file N_DEV_Resistor.h.

friend class Traits
friend

Definition at line 106 of file N_DEV_Resistor.h.

Member Data Documentation

int Xyce::Device::Resistor::Instance::ANegEquNegNodeOffset
private

Column index into force matrix of Neg/Neg conductance.

Definition at line 278 of file N_DEV_Resistor.h.

int Xyce::Device::Resistor::Instance::ANegEquPosNodeOffset
private

Column index into force matrix of Neg/Pos conductance.

Definition at line 277 of file N_DEV_Resistor.h.

int Xyce::Device::Resistor::Instance::APosEquNegNodeOffset
private

Column index into force matrix of Pos/Neg conductance.

Definition at line 276 of file N_DEV_Resistor.h.

int Xyce::Device::Resistor::Instance::APosEquPosNodeOffset
private

Column index into force matrix of Pos/Pos conductance.

Definition at line 275 of file N_DEV_Resistor.h.

double Xyce::Device::Resistor::Instance::dtemp
private

Externally specified device temperature.

NOT used, only here for compatibility in parsing netlist from simulators that support it

Definition at line 257 of file N_DEV_Resistor.h.

bool Xyce::Device::Resistor::Instance::dtempGiven
private

Externally specified device temperature was given in netlist.

Definition at line 264 of file N_DEV_Resistor.h.

double* Xyce::Device::Resistor::Instance::f_NegEquNegNodePtr
private

Definition at line 285 of file N_DEV_Resistor.h.

double* Xyce::Device::Resistor::Instance::f_NegEquPosNodePtr
private

Definition at line 284 of file N_DEV_Resistor.h.

double* Xyce::Device::Resistor::Instance::f_PosEquNegNodePtr
private

Definition at line 283 of file N_DEV_Resistor.h.

double* Xyce::Device::Resistor::Instance::f_PosEquPosNodePtr
private

Definition at line 282 of file N_DEV_Resistor.h.

double Xyce::Device::Resistor::Instance::G
private

Conductance(1.0/ohms)

Definition at line 267 of file N_DEV_Resistor.h.

double Xyce::Device::Resistor::Instance::i0
private

Current(ohms)

Definition at line 268 of file N_DEV_Resistor.h.

std::vector< std::vector< int > > Xyce::Device::Resistor::Instance::jacStamp
staticprivate

All Resistor instances have a common Jacobian Stamp.

Common Jacobian Stamp for all Resistor devices.

Because all resistors have identical Jacobian stamps, this data is declared static and is shared by all resistor instances.

Definition at line 241 of file N_DEV_Resistor.h.

double Xyce::Device::Resistor::Instance::length
private

Resistor length.

Definition at line 250 of file N_DEV_Resistor.h.

int Xyce::Device::Resistor::Instance::li_Neg
private

Index for Negative Node.

Definition at line 271 of file N_DEV_Resistor.h.

int Xyce::Device::Resistor::Instance::li_Pos
private

Index for Positive Node.

Definition at line 270 of file N_DEV_Resistor.h.

int Xyce::Device::Resistor::Instance::li_store_dev_i
private

Index for Lead Current.

Definition at line 272 of file N_DEV_Resistor.h.

Model& Xyce::Device::Resistor::Instance::model_
private

Owning model.

Definition at line 244 of file N_DEV_Resistor.h.

double Xyce::Device::Resistor::Instance::R
private

Resistance (ohms)

Definition at line 247 of file N_DEV_Resistor.h.

double Xyce::Device::Resistor::Instance::temp
private

Temperature of this instance.

Definition at line 252 of file N_DEV_Resistor.h.

double Xyce::Device::Resistor::Instance::tempCoeff1
private

First order temperature coeff.

Definition at line 255 of file N_DEV_Resistor.h.

bool Xyce::Device::Resistor::Instance::tempCoeff1Given
private

First order temperation value was given in netlist.

Definition at line 262 of file N_DEV_Resistor.h.

double Xyce::Device::Resistor::Instance::tempCoeff2
private

Second order temperature coeff.

Definition at line 256 of file N_DEV_Resistor.h.

bool Xyce::Device::Resistor::Instance::tempCoeff2Given
private

Second order temperature coeff was given in netlist.

Definition at line 263 of file N_DEV_Resistor.h.

double Xyce::Device::Resistor::Instance::width
private

Resistor width.

Definition at line 251 of file N_DEV_Resistor.h.


The documentation for this class was generated from the following files: