Xyce  6.1
N_DEV_Vcvs.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2015 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-------------------------------------------------------------------------
26 // Filename : $RCSfile: N_DEV_Vcvs.C,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
33 //
34 // Creation Date : 02/28/00
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.142 $
40 //
41 // Revision Date : $Date: 2015/04/23 21:46:53 $
42 //
43 // Current Owner : $Author: peshola $
44 //-------------------------------------------------------------------------
45 #include <Xyce_config.h>
46 
47 // ---------- Standard Includes ----------
48 
49 // ---------- Xyce Includes ----------
50 #include <N_DEV_DeviceOptions.h>
51 #include <N_DEV_ExternData.h>
52 #include <N_DEV_MatrixLoadData.h>
53 #include <N_DEV_SolverState.h>
54 #include <N_DEV_Vcvs.h>
55 #include <N_DEV_Message.h>
56 #include <N_ERH_ErrorMgr.h>
57 
58 #include <N_LAS_Vector.h>
59 #include <N_LAS_Matrix.h>
60 #include <N_UTL_FeatureTest.h>
61 
62 namespace Xyce {
63 namespace Device {
64 
65 namespace Vcvs {
66 
68 {
69 // Set up double precision variables:
70  p.addPar ("G",0.0,&Vcvs::Instance::Gain)
71  .setUnit(U_NONE)
72  .setCategory(CAT_NONE)
73  .setDescription("Gain");
74 }
75 
77 {
78 }
79 
80 std::vector< std::vector<int> > Instance::jacStamp;
81 
82 //-----------------------------------------------------------------------------
83 // Function : Instance::Instance
84 // Purpose : "instance block" constructor
85 // Special Notes :
86 // Scope : public
87 // Creator : Tom Russo, SNL, Component Information and Models
88 // Creation Date : 12/20/00
89 //-----------------------------------------------------------------------------
91  const Configuration & configuration,
92  const InstanceBlock & IBref,
93  Model & Viter,
94  const FactoryBlock & factory_block)
95  : DeviceInstance(IBref, configuration.getInstanceParameters(), factory_block),
96  IB(IBref),
97  model_(Viter),
98  Gain(1.0),
99  li_Pos(-1),
100  li_Neg(-1),
101  li_Bra(-1),
102  li_ContPos(-1),
103  li_ContNeg(-1),
104  li_branch_data(0),
105  ABraEquPosNodeOffset(-1),
106  ABraEquNegNodeOffset(-1),
107  ABraEquContPosNodeOffset(-1),
108  ABraEquContNegNodeOffset(-1),
109  APosEquBraVarOffset(-1),
110  ANegEquBraVarOffset(-1),
111 
112  f_BraEquPosNodePtr(0),
113  f_BraEquNegNodePtr(0),
114  f_BraEquContPosNodePtr(0),
115  f_BraEquContNegNodePtr(0),
116  f_PosEquBraVarPtr(0),
117  f_NegEquBraVarPtr(0)
118 {
119  numIntVars = 1;
120  numExtVars = 4;
121  numStateVars = 0;
122  setNumBranchDataVars(0); // by default don't allocate space in branch vectors
123  numBranchDataVarsIfAllocated = 1; // this is the space to allocate if lead current or power is needed.
124 
125  if( jacStamp.empty() )
126  {
127  jacStamp.resize(5);
128  jacStamp[0].resize(1);
129  jacStamp[0][0]=4;
130  jacStamp[1].resize(1);
131  jacStamp[1][0]=4;
132  jacStamp[4].resize(4);
133  jacStamp[4][0]=0;
134  jacStamp[4][1]=1;
135  jacStamp[4][2]=2;
136  jacStamp[4][3]=3;
137  }
138 
139 
140  // Set params to constant default values:
141  setDefaultParams ();
142 
143  // Set params according to instance line and constant defaults from metadata:
144  setParams (IB.params);
145 
146  // Set any non-constant parameter defaults:
147  if (!given("G"))
148  {
149  UserError0(*this) << "Could not find Gain parameter in instance.";
150  }
151 }
152 
153 //-----------------------------------------------------------------------------
154 // Function : Instance::~Instance
155 // Purpose : destructor
156 // Special Notes :
157 // Scope : public
158 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
159 // Creation Date : 3/16/00
160 //-----------------------------------------------------------------------------
162 {
163 
164 }
165 
166 //-----------------------------------------------------------------------------
167 // Function : Instance::registerLIDs
168 // Purpose :
169 // Special Notes :
170 // Scope : public
171 // Creator : Robert Hoekstra, SNL, Computational Science
172 // Creation Date : 6/21/02
173 //-----------------------------------------------------------------------------
174 void Instance::registerLIDs ( const std::vector<int> & intLIDVecRef,
175  const std::vector<int> & extLIDVecRef )
176 {
177  std::string msg;
178 
179  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
180  {
181  Xyce::dout() << std::endl << section_divider << std::endl;
182  Xyce::dout() << " VcvsInstance::registerLIDs" << std::endl;
183  Xyce::dout() << " name = " << getName() << std::endl;
184  }
185 
186  // Check if the size of the ID lists corresponds to the
187  // proper number of internal and external variables.
188  int numInt = intLIDVecRef.size();
189  int numExt = extLIDVecRef.size();
190 
191  if (numInt != numIntVars)
192  {
193  msg = "Instance::registerLIDs:";
194  msg += "numInt != numIntVars";
195  N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
196  }
197 
198  if (numExt != numExtVars)
199  {
200  msg = "Instance::registerLIDs:";
201  msg += "numExt != numExtVars";
202  N_ERH_ErrorMgr::report ( N_ERH_ErrorMgr::DEV_FATAL,msg);
203  }
204 
205  // copy over the global ID lists.
206  intLIDVec = intLIDVecRef;
207  extLIDVec = extLIDVecRef;
208 
209  // Now use these lists to obtain the indices into the
210  // linear algebra entities. This assumes an order.
211  // For the matrix indices, first do the rows.
212 
213  li_Pos = extLIDVec[0];
214  li_Neg = extLIDVec[1];
215  li_ContPos = extLIDVec[2];
216  li_ContNeg = extLIDVec[3];
217 
218  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
219  {
220  Xyce::dout() << " li_Pos = " << li_Pos << std::endl;
221  Xyce::dout() << " li_Neg = " << li_Neg << std::endl;
222  Xyce::dout() << " li_ContPos = " << li_ContPos << std::endl;
223  Xyce::dout() << " li_ContNeg = " << li_ContNeg << std::endl;
224  }
225 
226  li_Bra = intLIDVec[0];
227 
228  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
229  Xyce::dout() << " li_Bra = " << li_Bra << std::endl;
230 
231  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
232  Xyce::dout() << section_divider << std::endl;
233 }
234 
235 //-----------------------------------------------------------------------------
236 // Function : Instance::registerBranchDataLIDs
237 // Purpose :
238 // Special Notes :
239 // Scope : public
240 // Creator : Richard Schiek, Electrical Systems Modeling
241 // Creation Date : 12/18/2012
242 //-----------------------------------------------------------------------------
243 /// Register the local store IDs
244 ///
245 /// In addition to state vector, Xyce maintains a separate datastructure
246 /// called a "branch data" vector. As with other such vectors, the device
247 /// declares at construction time how many branch vector entries it needs,
248 /// and later Topology assigns locations for devices, returning LIDs.
249 ///
250 /// These LIDs are stored in this method for later use.
251 ///
252 /// The Resistor device uses exactly one "branch data vector" element, where
253 ///
254 /// @param stoLIDVecRef Store variable local IDs
255 ///
256 /// @author Richard Schiek, Electrical Systems Modeling
257 /// @date 12/18/2012
258 
259 void Instance::registerBranchDataLIDs(const std::vector<int> & branchLIDVecRef)
260 {
261  AssertLIDs(branchLIDVecRef.size() == getNumBranchDataVars());
262 
263  if (loadLeadCurrent)
264  {
265  li_branch_data= branchLIDVecRef[0];
266  }
267 }
268 
269 //-----------------------------------------------------------------------------
270 // Function : Instance::loadNodeSymbols
271 // Purpose :
272 // Special Notes :
273 // Scope : public
274 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
275 // Creation Date : 05/13/05
276 //-----------------------------------------------------------------------------
277 void Instance::loadNodeSymbols(Util::SymbolTable &symbol_table) const
278 {
279  addInternalNode(symbol_table, li_Bra, getName(), "branch");
280 
281  if (loadLeadCurrent)
282  {
283  addBranchDataNode( symbol_table, li_branch_data, getName(), "BRANCH_D");
284  }
285 }
286 
287 //-----------------------------------------------------------------------------
288 // Function : Instance::registerStateGIDs
289 // Purpose :
290 // Special Notes :
291 // Scope : public
292 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
293 // Creation Date : 6/21/02
294 //-----------------------------------------------------------------------------
295 void Instance::registerStateLIDs( const std::vector<int> & staLIDVecRef )
296 {
297  AssertLIDs(staLIDVecRef.size() == numStateVars);
298 }
299 
300 //-----------------------------------------------------------------------------
301 // Function : Instance::jacobianStamp
302 // Purpose :
303 // Special Notes :
304 // Scope : public
305 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
306 // Creation Date : 9/2/02
307 //-----------------------------------------------------------------------------
308 const std::vector< std::vector<int> > & Instance::jacobianStamp() const
309 {
310  return jacStamp;
311 }
312 
313 //-----------------------------------------------------------------------------
314 // Function : Instance::registerJacLIDs
315 // Purpose :
316 // Special Notes :
317 // Scope : public
318 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
319 // Creation Date : 9/2/02
320 //-----------------------------------------------------------------------------
321 void Instance::registerJacLIDs( const std::vector< std::vector<int> > & jacLIDVec )
322 {
323  DeviceInstance::registerJacLIDs( jacLIDVec );
324 
325  APosEquBraVarOffset = jacLIDVec[0][0];
326  ANegEquBraVarOffset = jacLIDVec[1][0];
327  ABraEquPosNodeOffset = jacLIDVec[4][0];
328  ABraEquNegNodeOffset = jacLIDVec[4][1];
329  ABraEquContPosNodeOffset = jacLIDVec[4][2];
330  ABraEquContNegNodeOffset = jacLIDVec[4][3];
331 }
332 
333 //-----------------------------------------------------------------------------
334 // Function : Instance::setupPointers
335 // Purpose :
336 // Special Notes :
337 // Scope : public
338 // Creator : Eric Keiter, SNL
339 // Creation Date : 12/12/08
340 //-----------------------------------------------------------------------------
342 {
343 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
344  Linear::Matrix & dFdx = *(extData.dFdxMatrixPtr);
345 
352 #endif
353 }
354 
355 //-----------------------------------------------------------------------------
356 // Function : Instance::updatePrimaryState
357 // Purpose :
358 // Special Notes :
359 // Scope : public
360 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
361 // Creation Date : 01/29/01
362 //-----------------------------------------------------------------------------
364 {
365  return true;
366 }
367 
368 //-----------------------------------------------------------------------------
369 // Function : Instance::loadDAEFVector
370 //
371 // Purpose : Loads the F-vector contributions for a single
372 // Vcvs instance.
373 //
374 // Special Notes :
375 //
376 // Scope : public
377 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
378 // Creation Date : 02/19/05
379 //-----------------------------------------------------------------------------
381 {
382  double * fVec = extData.daeFVectorRawPtr;
383  double * solVec = extData.nextSolVectorRawPtr;
384 
385  double v_pos = solVec[li_Pos];
386  double v_neg = solVec[li_Neg];
387  double v_cont_pos = solVec[li_ContPos];
388  double v_cont_neg = solVec[li_ContNeg];
389 
390  double i_bra = solVec[li_Bra];
391 
392  double c_tmp = i_bra;
393  double v_tmp = (v_pos-v_neg);
394 
395  fVec[li_Pos] += i_bra;
396  fVec[li_Neg] += -i_bra;
397 
398  double src = Gain * ( v_cont_pos - v_cont_neg ) - v_pos + v_neg;
399  fVec[li_Bra] += -src;
400 
401  if( loadLeadCurrent )
402  {
403  double * leadF = extData.nextLeadCurrFCompRawPtr;
404  leadF[li_branch_data] = c_tmp;
405  double * junctionV = extData.nextJunctionVCompRawPtr;
406  junctionV[li_branch_data] = v_tmp;
407  }
408 
409  return true;
410 }
411 
412 //-----------------------------------------------------------------------------
413 // Function : Instance::loadDAEdFdx ()
414 //
415 // Purpose : Loads the F-vector contributions for a single
416 // resistor instance.
417 //
418 // Special Notes : The F-vector is an algebraic constaint.
419 //
420 // Scope : public
421 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
422 // Creation Date : 02/19/05
423 //-----------------------------------------------------------------------------
425 {
426  Linear::Matrix & dFdx = *(extData.dFdxMatrixPtr);
427 
428  dFdx[li_Pos][APosEquBraVarOffset] += 1.0;
429  dFdx[li_Neg][ANegEquBraVarOffset] -= 1.0;
430 
431  dFdx[li_Bra][ABraEquPosNodeOffset] += 1.0;
432  dFdx[li_Bra][ABraEquNegNodeOffset] -= 1.0;
435 
436  return true;
437 }
438 
439 //-----------------------------------------------------------------------------
440 // Function : Instance::varTypes
441 // Purpose :
442 // Special Notes :
443 // Scope : public
444 // Creator : Rob Hoekstra, SNL, Parallel Computational Sciences
445 // Creation Date : 02/17/04
446 //-----------------------------------------------------------------------------
447 void Instance::varTypes( std::vector<char> & varTypeVec )
448 {
449  varTypeVec.resize(1);
450  varTypeVec[0] = 'I';
451 }
452 
453 // Class Model
454 
455 //-----------------------------------------------------------------------------
456 // Function : Model::Model
457 // Purpose : "Model block" constructor
458 // Special Notes :
459 // Scope : public
460 // Creator : Tom Russo, SNL, Component Information and Models
461 // Creation Date : 12/21/00
462 //-----------------------------------------------------------------------------
464  const Configuration & configuration,
465  const ModelBlock & MB,
466  const FactoryBlock & factory_block)
467  : DeviceModel(MB, configuration.getModelParameters(), factory_block)
468 {
469 }
470 
471 //-----------------------------------------------------------------------------
472 // Function : Model::~Model
473 // Purpose : destructor
474 // Special Notes :
475 // Scope : public
476 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
477 // Creation Date : 3/16/00
478 //-----------------------------------------------------------------------------
480 {
481  std::vector<Instance*>::iterator iter;
482  std::vector<Instance*>::iterator first = instanceContainer.begin();
483  std::vector<Instance*>::iterator last = instanceContainer.end();
484 
485  for (iter=first; iter!=last; ++iter)
486  {
487  delete (*iter);
488  }
489 }
490 
491 //-----------------------------------------------------------------------------
492 // Function : Model::printOutInstances
493 // Purpose : debugging tool.
494 // Special Notes :
495 // Scope : public
496 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
497 // Creation Date : 4/03/00
498 //-----------------------------------------------------------------------------
499 std::ostream &Model::printOutInstances(std::ostream &os) const
500 {
501  std::vector<Instance*>::const_iterator iter;
502  std::vector<Instance*>::const_iterator first = instanceContainer.begin();
503  std::vector<Instance*>::const_iterator last = instanceContainer.end();
504 
505  int i;
506  os << std::endl;
507  os << " name model name Parameters" << std::endl;
508  for (i=0, iter=first; iter!=last; ++iter, ++i)
509  {
510  os << " " << i << ": " << (*iter)->getName() << " ";
511  os << getName();
512  os << std::endl;
513  }
514 
515  os << std::endl;
516 
517  return os;
518 }
519 
520 //-----------------------------------------------------------------------------
521 // Function : Model::forEachInstance
522 // Purpose :
523 // Special Notes :
524 // Scope : public
525 // Creator : David Baur
526 // Creation Date : 2/4/2014
527 //-----------------------------------------------------------------------------
528 /// Apply a device instance "op" to all instances associated with this
529 /// model
530 ///
531 /// @param[in] op Operator to apply to all instances.
532 ///
533 ///
534 void Model::forEachInstance(DeviceInstanceOp &op) const /* override */
535 {
536  for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
537  op(*it);
538 }
539 
540 
541 // Vcvs Master functions:
542 
543 //-----------------------------------------------------------------------------
544 // Function : Master::updateState
545 // Purpose :
546 // Special Notes :
547 // Scope : public
548 // Creator : Eric Keiter, SNL
549 // Creation Date : 11/26/08
550 //-----------------------------------------------------------------------------
551 bool Master::updateState (double * solVec, double * staVec, double * stoVec)
552 {
553  return true;
554 }
555 
556 //-----------------------------------------------------------------------------
557 // Function : Master::loadDAEVectors
558 // Purpose :
559 // Special Notes :
560 // Scope : public
561 // Creator : Eric Keiter, SNL
562 // Creation Date : 11/26/08
563 //-----------------------------------------------------------------------------
564 bool Master::loadDAEVectors (double * solVec, double * fVec, double *qVec, double * bVec, double * storeLeadF, double * storeLeadQ, double * leadF, double * leadQ, double * junctionV)
565 {
566 #ifdef _OMP
567 #pragma omp parallel for
568 #endif
569  for (InstanceVector::const_iterator it = getInstanceBegin(); it != getInstanceEnd(); ++it)
570  {
571  Instance & vi = *(*it);
572 
573  double v_pos = solVec[vi.li_Pos];
574  double v_neg = solVec[vi.li_Neg];
575  double v_cont_pos = solVec[vi.li_ContPos];
576  double v_cont_neg = solVec[vi.li_ContNeg];
577 
578  double i_bra = solVec[vi.li_Bra];
579 
580  fVec[vi.li_Pos] += i_bra;
581  fVec[vi.li_Neg] += -i_bra;
582 
583  double src = vi.Gain * ( v_cont_pos - v_cont_neg ) - v_pos + v_neg;
584  fVec[vi.li_Bra] += -src;
585 
586  if( vi.loadLeadCurrent )
587  {
588  leadF[vi.li_branch_data] = i_bra;
589  junctionV[vi.li_branch_data] = v_pos-v_neg;
590  }
591 
592  }
593 
594  return true;
595 }
596 
597 //-----------------------------------------------------------------------------
598 // Function : Master::loadDAEMatrices
599 // Purpose :
600 // Special Notes :
601 // Scope : public
602 // Creator : Eric Keiter, SNL
603 // Creation Date : 11/26/08
604 //-----------------------------------------------------------------------------
605 bool Master::loadDAEMatrices (Linear::Matrix & dFdx, Linear::Matrix & dQdx)
606 {
607  for (InstanceVector::const_iterator it = getInstanceBegin(); it != getInstanceEnd(); ++it)
608  {
609  Instance & vi = *(*it);
610 
611 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
612 
613  *vi.f_PosEquBraVarPtr += 1.0;
614  *vi.f_NegEquBraVarPtr -= 1.0;
615 
616  *vi.f_BraEquPosNodePtr += 1.0;
617  *vi.f_BraEquNegNodePtr -= 1.0;
618  *vi.f_BraEquContPosNodePtr -= vi.Gain;
619  *vi.f_BraEquContNegNodePtr += vi.Gain;
620 #else
621 
622  dFdx[vi.li_Pos][vi.APosEquBraVarOffset] += 1.0;
623  dFdx[vi.li_Neg][vi.ANegEquBraVarOffset] -= 1.0;
624 
625  dFdx[vi.li_Bra][vi.ABraEquPosNodeOffset] += 1.0;
626  dFdx[vi.li_Bra][vi.ABraEquNegNodeOffset] -= 1.0;
627  dFdx[vi.li_Bra][vi.ABraEquContPosNodeOffset] -= vi.Gain;
628  dFdx[vi.li_Bra][vi.ABraEquContNegNodeOffset] += vi.Gain;
629 #endif
630  }
631  return true;
632 }
633 
634 Device *Traits::factory(const Configuration &configuration, const FactoryBlock &factory_block)
635 {
636 
637  return new Master(configuration, factory_block, factory_block.solverState_, factory_block.deviceOptions_);
638 }
639 
641 {
643  .registerDevice("e", 1)
644  .registerModelType("e", 1);
645 }
646 
647 } // namespace Vcvs
648 } // namespace Device
649 } // namespace Xyce
Instance(const Configuration &configuration, const InstanceBlock &IBref, Model &Viter, const FactoryBlock &factory_block)
Definition: N_DEV_Vcvs.C:90
const InstanceName & getName() const
const DeviceOptions & deviceOptions_
Descriptor & addPar(const char *parName, T default_value, T U::*varPtr)
Adds the parameter description to the parameter map.
Definition: N_DEV_Pars.h:1429
void registerStateLIDs(const std::vector< int > &staLIDVecRef)
Definition: N_DEV_Vcvs.C:295
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.
Definition: N_DEV_Vcvs.C:564
bool given(const std::string &parameter_name) const
Pure virtual class to augment a linear system.
void addInternalNode(Util::SymbolTable &symbol_table, int index, const InstanceName &instance_name, const std::string &lead_name)
static void loadInstanceParameters(ParametricData< Instance > &instance_parameters)
Definition: N_DEV_Vcvs.C:67
static std::vector< std::vector< int > > jacStamp
Definition: N_DEV_Vcvs.h:140
virtual bool updateState(double *solVec, double *staVec, double *stoVec)
Updates the devices state information.
Definition: N_DEV_Vcvs.C:551
void addBranchDataNode(Util::SymbolTable &symbol_table, int index, const InstanceName &instance_name, const std::string &lead_name)
InstanceVector::const_iterator getInstanceEnd() const
Returns an iterator to the ending of the vector of all instances created for this device...
#define AssertLIDs(cmp)
void registerJacLIDs(const std::vector< std::vector< int > > &jacLIDVec)
Definition: N_DEV_Vcvs.C:321
virtual void registerJacLIDs(const JacobianStamp &jacLIDVec)
const std::vector< std::vector< int > > & jacobianStamp() const
Definition: N_DEV_Vcvs.C:308
void registerBranchDataLIDs(const std::vector< int > &branchLIDVecRef)
Register the local store IDs.
Definition: N_DEV_Vcvs.C:259
virtual void forEachInstance(DeviceInstanceOp &op) const
Apply a device instance "op" to all instances associated with this model.
Definition: N_DEV_Vcvs.C:534
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 > &params)
const std::string & getName() const
static void loadModelParameters(ParametricData< Model > &model_parameters)
Definition: N_DEV_Vcvs.C:76
The FactoryBlock contains parameters needed by the device, instance and model creation functions...
void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
Definition: N_DEV_Vcvs.C:277
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
Definition: N_DEV_Vcvs.C:634
static Config< T > & addConfiguration()
Adds the device to the Xyce device configuration.
void registerLIDs(const std::vector< int > &intLIDVecRef, const std::vector< int > &extLIDVecRef)
Definition: N_DEV_Vcvs.C:174
void varTypes(std::vector< char > &varTypeVec)
Definition: N_DEV_Vcvs.C:447
Linear::Matrix * dFdxMatrixPtr
The Device class is an interface for device implementations.
Definition: N_DEV_Device.h:101
const SolverState & solverState_
Class Configuration contains device configuration data.
int li_branch_data
Index for lead current and junction voltage (for power calculations)
Definition: N_DEV_Vcvs.h:159
virtual bool loadDAEMatrices(Linear::Matrix &dFdx, Linear::Matrix &dQdx)
Populates the device's Jacobian object with these pointers.
Definition: N_DEV_Vcvs.C:605
void setNumBranchDataVars(int num_branch_data_vars)
virtual std::ostream & printOutInstances(std::ostream &os) const
Definition: N_DEV_Vcvs.C:499
ModelBlock represents a .MODEL line from the netlist.
Manages parameter binding for class C.
Definition: N_DEV_Pars.h:214
InstanceBlock represent a device instance line from the netlist.
std::vector< Param > params
std::vector< Instance * > instanceContainer
Definition: N_DEV_Vcvs.h:228