Xyce  6.1
N_DEV_Synapse2.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_Synapse2.C,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Christy Warrender, SNL, Cognitive Modeling
33 //
34 // Creation Date : 11/18/10
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.40.2.1 $
40 //
41 // Revision Date : $Date: 2015/04/02 18:29:38 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //----------------------------------------------------------------------------
45 
46 #include <Xyce_config.h>
47 
48 
49 // ---------- Standard Includes ----------
50 
51 // ---------- Xyce Includes ----------
52 //
53 #include <N_DEV_Const.h>
54 #include <N_DEV_DeviceOptions.h>
55 #include <N_DEV_DeviceMaster.h>
56 #include <N_DEV_ExternData.h>
57 #include <N_DEV_MatrixLoadData.h>
58 #include <N_DEV_SolverState.h>
59 #include <N_DEV_Synapse2.h>
60 #include <N_DEV_Message.h>
61 #include <N_ERH_ErrorMgr.h>
62 
63 #include <N_DEV_Synapse.h>
64 
65 #include <N_LAS_Matrix.h>
66 #include <N_LAS_Vector.h>
67 #include <N_UTL_FeatureTest.h>
68 
69 namespace Xyce {
70 namespace Device {
71 
72 
73 namespace Synapse2 {
74 
75 
77 {
78  // Set up configuration constants:
79 }
80 
82 {
83  // Set up map for double precision variables:
84  // Default values are taken from Destexhe 98, values for AMPA receptor
85  // although since this Synapse2::Model is different, those values may not have the same meaning
86  p.addPar ("GMAX", 1.0E-9, &Synapse2::Model::gMax)
87  .setUnit(U_OHMM1)
88  .setDescription("Maximal Synaptic Conductance");
89 
90  p.addPar ("EREV", 0.0, &Synapse2::Model::eRev)
91  .setUnit(U_VOLT)
92  .setDescription("Reversal Potential");
93 
94  p.addPar ("ALPHA", 1.1E-6, &Synapse2::Model::alpha)
95  .setUnit(U_SECM1)
96  .setDescription("Forward rate constant for receptor opening");
97 
98  p.addPar ("BETA", 190.0, &Synapse2::Model::beta)
99  .setUnit(U_SECM1)
100  .setDescription("Backward rate constant for receptor opening");
101 
102  p.addPar ("VP", 0.002, &Synapse2::Model::vP)
103  .setUnit(U_VOLT)
104  .setDescription("Presynaptic voltage that activates postsynaptic current");
105 
106  p.addPar ("TMAX", 0.001, &Synapse2::Model::tMax)
107  .setDescription("Maximal neurotransmitter concentration");
108 
109  // NOTE: not including concentration units - TMAX should be in moles/liter, and
110  // alpha has concentration in the denominator; they cancel out
111 }
112 
113 
114 std::vector< std::vector<int> > Instance::jacStamp;
115 
116 // Class Instance
117 //-----------------------------------------------------------------------------
118 // Function : Instance::processParams
119 // Purpose :
120 // Special Notes :
121 // Scope : public
122 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
123 // Creation Date : 6/03/02
124 //-----------------------------------------------------------------------------
126 {
127  // now set the temperature related stuff.
128  //updateTemperature(temp);
129 
130  return true;
131 }
132 
133 //-----------------------------------------------------------------------------
134 // Function : Instance::Instance
135 // Purpose : instance block constructor
136 // Special Notes :
137 // Scope : public
138 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
139 // Creation Date : 3/16/00
140 //-----------------------------------------------------------------------------
142  const Configuration & configuration,
143  const InstanceBlock & IB,
144  Model & Riter,
145  const FactoryBlock & factory_block)
146 
147  : DeviceInstance(IB, configuration.getInstanceParameters(), factory_block),
148  model_(Riter),
149  li_Prev(-1),
150  li_Post(-1),
151  APostEquPostNodeOffset(-1),
152  APostEquRNodeOffset(-1),
153  AREquPostNodeOffset(-1),
154  AREquRNodeOffset(-1),
155  f_PostEquPostNodePtr(0),
156  f_PostEquRNodePtr(0),
157  f_REquPostNodePtr(0),
158  f_REquRNodePtr(0)
159 {
160  numIntVars = 1;
161  numExtVars = 2;
162  numStateVars = 0;
163 
164  if( jacStamp.empty() )
165  {
166  // Vpre, Vpost, r
167  jacStamp.resize(3);
168  jacStamp[0].resize(0);
169  jacStamp[1].resize(2);
170  jacStamp[2].resize(2);
171  jacStamp[1][0] = 1; // Vpost PostPostVar
172  jacStamp[1][1] = 2; // r PostRVar
173  jacStamp[2][0] = 0; // Vpre RVpre
174  jacStamp[2][1] = 2; // r RR
175  }
176 
177 
178  // Set up mapping from param names to class variables:
179 
180  // Set params to constant default values:
181  setDefaultParams ();
182 
183  // Set params according to instance line and constant defaults from metadata:
184  setParams (IB.params);
185 
186  // Set any non-constant parameter defaults:
187 
188  // Calculate any parameters specified as expressions:
190 
191  // calculate dependent (ie computed) params and check for errors:
192  processParams ();
193 }
194 
195 //-----------------------------------------------------------------------------
196 // Function : Instance::~Instance
197 // Purpose : destructor
198 // Special Notes :
199 // Scope : public
200 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
201 // Creation Date : 3/16/00
202 //-----------------------------------------------------------------------------
204 {
205 }
206 
207 //-----------------------------------------------------------------------------
208 // Function : Instance::registerLIDs
209 // Purpose :
210 // Special Notes :
211 // Scope : public
212 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
213 // Creation Date : 6/12/02
214 //-----------------------------------------------------------------------------
215 void Instance::registerLIDs( const std::vector<int> & intLIDVecRef,
216  const std::vector<int> & extLIDVecRef )
217 {
218  AssertLIDs(intLIDVecRef.size() == numIntVars);
219  AssertLIDs(extLIDVecRef.size() == numExtVars);
220 
221  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
222  {
223  Xyce::dout() << std::endl << section_divider << std::endl;
224  Xyce::dout() << " SynapseInstance::registerLIDs" << std::endl;
225  Xyce::dout() << " name = " << getName() << std::endl;
226  }
227 
228  // copy over the global ID lists.
229  intLIDVec = intLIDVecRef;
230  extLIDVec = extLIDVecRef;
231 
232  li_Prev = extLIDVec[0];
233  li_Post = extLIDVec[1];
234 
235  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
236  {
237  Xyce::dout() << " li_Prev = " << li_Prev << std::endl;
238  Xyce::dout() << " li_Post = " << li_Post << std::endl;
239  }
240 
241  li_rVar = intLIDVec[0];
242 
243  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
244  {
245  Xyce::dout() << section_divider << std::endl;
246  }
247 }
248 
249 //-----------------------------------------------------------------------------
250 // Function : Instance::loadNodeSymbols
251 // Purpose :
252 // Special Notes :
253 // Scope : public
254 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
255 // Creation Date : 05/13/05
256 //-----------------------------------------------------------------------------
257 void Instance::loadNodeSymbols(Util::SymbolTable &symbol_table) const
258 {
259  addInternalNode(symbol_table, li_rVar, getName(), "r");
260 }
261 
262 //-----------------------------------------------------------------------------
263 // Function : Instance::registerStateLIDs
264 // Purpose : Note that the Synapse2 does not have any state vars.
265 // Special Notes :
266 // Scope : public
267 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
268 // Creation Date : 06/12/02
269 //-----------------------------------------------------------------------------
270 void Instance::registerStateLIDs(const std::vector<int> & staLIDVecRef )
271 {
272  AssertLIDs(staLIDVecRef.size() == numStateVars);
273 }
274 
275 //-----------------------------------------------------------------------------
276 // Function : Instance::jacobianStamp
277 // Purpose :
278 // Special Notes :
279 // Scope : public
280 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
281 // Creation Date : 08/20/01
282 //-----------------------------------------------------------------------------
283 const std::vector< std::vector<int> > & Instance::jacobianStamp() const
284 {
285  return jacStamp;
286 }
287 
288 //-----------------------------------------------------------------------------
289 // Function : Instance::registerJacLIDs
290 // Purpose :
291 // Special Notes :
292 // Scope : public
293 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
294 // Creation Date : 08/27/01
295 //-----------------------------------------------------------------------------
296 void Instance::registerJacLIDs( const std::vector< std::vector<int> > & jacLIDVec )
297 {
298  DeviceInstance::registerJacLIDs( jacLIDVec );
299 
300  APostEquPostNodeOffset = jacLIDVec[1][0];
301  APostEquRNodeOffset = jacLIDVec[1][1];
302  AREquPostNodeOffset = jacLIDVec[2][0];
303  AREquRNodeOffset = jacLIDVec[2][1];
304 }
305 
306 //-----------------------------------------------------------------------------
307 // Function : Instance::setupPointers
308 // Purpose :
309 // Special Notes :
310 // Scope : public
311 // Creator : Eric Keiter, SNL
312 // Creation Date : 11/30/08
313 //-----------------------------------------------------------------------------
315 {
316 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
317  Linear::Matrix & dFdx = *(extData.dFdxMatrixPtr);
322 #endif
323 }
324 
325 //-----------------------------------------------------------------------------
326 // Function : Instance::updateIntermediateVars
327 // Purpose : update intermediate variables for one diode instance
328 // Special Notes :
329 // Scope : public
330 // Creator : Eric R. Keiter, Dept. 9233.
331 // Creation Date : 3/05/04
332 //-----------------------------------------------------------------------------
334 {
335  bool bsuccess = true;
336 
337  Linear::Vector * solVecPtr = extData.nextSolVectorPtr;
338 
339  if( getSolverState().dcopFlag )
340  {
341  // no firing during DCOP; r=0, so postsynaptic current is 0 and unchanging
342  ipost = 0.0;
343  didVpost = 0.0;
344  didr = 0.0;
345  rFval = 0.0;
346  drFdVpre = 0.0;
347  drFdr = 0.0;
348  }
349  else
350  {
351  double vPre = (*solVecPtr)[li_Prev];
352  double vPost = (*solVecPtr)[li_Post];
353  double rVar = (*solVecPtr)[li_rVar];
354 
355  // Load RHS vector element for the positive circuit node KCL equ.
356  {
357  Sacado::Fad::SFad<double,2> vPostVar( 2, 0, vPost );
358  Sacado::Fad::SFad<double,2> rVarS( 2, 1, rVar);
359 
360  // parameters
361  Sacado::Fad::SFad<double,2> gMaxVar( model_.gMax );
362  Sacado::Fad::SFad<double,2> eRevVar( model_.eRev );
363 
364  Sacado::Fad::SFad<double,2> resultFad;
365  resultFad = PostCurrentEqu( vPostVar, rVarS, gMaxVar, eRevVar );
366  ipost = resultFad.val();
367  didVpost = resultFad.dx(0);
368  didr = resultFad.dx(1);
369  }
370  {
371  Sacado::Fad::SFad<double,2> vPreVar( 2, 0, vPre );
372  Sacado::Fad::SFad<double,2> rVarS( 2, 1, rVar);
373 
374  // parameters
375  Sacado::Fad::SFad<double,2> alphaVar( model_.alpha );
376  Sacado::Fad::SFad<double,2> betaVar( model_.beta );
377  Sacado::Fad::SFad<double,2> tMaxVar( model_.tMax );
378  Sacado::Fad::SFad<double,2> vPVar( model_.vP );
379 
380  Sacado::Fad::SFad<double,2> resultFad;
381  resultFad = rEquF( vPreVar, rVarS, alphaVar, betaVar, tMaxVar, vPVar);
382  rFval = resultFad.val();
383  drFdVpre = resultFad.dx(0);
384  drFdr = resultFad.dx(1);
385  }
386  }
387 
388  return bsuccess;
389 }
390 
391 //-----------------------------------------------------------------------------
392 // Function : Instance::updatePrimaryState
393 // Purpose :
394 // Special Notes :
395 // Scope : public
396 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
397 // Creation Date : 01/29/01
398 //-----------------------------------------------------------------------------
400 {
401  bool bsuccess = updateIntermediateVars();
402  return bsuccess;
403 }
404 
405 //-----------------------------------------------------------------------------
406 // Function : Instance::updateSecondaryState
407 // Purpose :
408 // Special Notes :
409 // Scope : public
410 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
411 // Creation Date : 01/29/01
412 //-----------------------------------------------------------------------------
414 {
415  return true;
416 }
417 
418 //-----------------------------------------------------------------------------
419 // Function : Instance::loadDAEQVector
420 //
421 // Purpose : Loads the Q-vector contributions for a single
422 // Synapse2
423 //
424 // Special Notes : The "Q" vector is part of a standard DAE formalism in
425 // which the system of equations is represented as:
426 //
427 // f(x) = dQ(x)/dt + F(x) - B(t) = 0
428 //
429 // Scope : public
430 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
431 // Creation Date : 8/31/2010
432 //-----------------------------------------------------------------------------
434 {
435  Linear::Vector * qVecPtr = extData.daeQVectorPtr;
436  Linear::Vector * solVecPtr = extData.nextSolVectorPtr;
437  double rVar = (*solVecPtr)[li_rVar];
438  (*qVecPtr)[li_rVar] -= rVar;
439 
440  return true;
441 }
442 //-----------------------------------------------------------------------------
443 // Function : Instance::loadDAEFVector
444 //
445 // Purpose : Loads the F-vector contributions for a single
446 // Synapse2 instance.
447 //
448 // Special Notes : This is an algebraic constaint, and as such the Synapse2
449 // does make a contribution to it.
450 //
451 // Scope : public
452 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
453 // Creation Date : 01/24/03
454 //-----------------------------------------------------------------------------
456 {
457  Linear::Vector * fVecPtr = extData.daeFVectorPtr;
458  (*fVecPtr)[li_Prev] += 0.0;
459  (*fVecPtr)[li_Post] += ipost;
460  (*fVecPtr)[li_rVar] += rFval;
461  return true;
462 }
463 
464 //-----------------------------------------------------------------------------
465 // Function : Instance::loadDAEdQdx
466 //
467 // Purpose : Loads the dQdx-matrix contributions for a single
468 // Synapse2 instance.
469 //
470 // Special Notes : The "Q" vector is part of a standard DAE formalism in
471 // which the system of equations is represented as:
472 //
473 // f(x) = dQ(x)/dt + F(x) - B(t) = 0
474 //
475 // The "Q" vector contains charges and fluxes, mostly.
476 // However, it is ordered like the solution vector, and as
477 // it is part of the KCL formulation, the terms in Q will
478 // actually be *sums* of charges, rather than single
479 // distinct charges.
480 //
481 // This function assumes that updatePrimaryState has been
482 // called recently enough for the contents of q0 to be
483 // valid.
484 //
485 // Scope : public
486 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
487 // Creation Date : 03/05/04
488 //-----------------------------------------------------------------------------
490 {
491  Linear::Matrix & dQdx = *(extData.dQdxMatrixPtr);
492  dQdx[li_rVar][AREquRNodeOffset] += -1.0;
493 
494  return true;
495 }
496 
497 //-----------------------------------------------------------------------------
498 // Function : Instance::loadDAEdFdx ()
499 //
500 // Purpose : Loads the F-vector contributions for a single
501 // Synapse2 instance.
502 //
503 // Special Notes : This is an algebraic constaint, and as such the Synapse2
504 // does make a contribution to it.
505 //
506 // Scope : public
507 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
508 // Creation Date : 03/05/04
509 //-----------------------------------------------------------------------------
511 {
512  Linear::Matrix & dFdx = *(extData.dFdxMatrixPtr);
514  dFdx[li_Post][APostEquRNodeOffset] += didr;
516  dFdx[li_rVar][AREquRNodeOffset] += drFdr;
517 
518  return true;
519 }
520 
521 //-----------------------------------------------------------------------------
522 // Function : Instance::updateTemperature
523 // Purpose :
524 // Special Notes :
525 // Scope : public
526 // Creator : Tom Russo, Component Information and Models
527 // Creation Date : 02/27/01
528 //-----------------------------------------------------------------------------
529 bool Instance::updateTemperature ( const double & temp_tmp)
530 {
531  bool bsuccess = true;
532  return bsuccess;
533 }
534 
535 //-----------------------------------------------------------------------------
536 // Function : Model::processParams
537 // Purpose :
538 // Special Notes :
539 // Scope : public
540 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
541 // Creation Date : 6/03/02
542 //-----------------------------------------------------------------------------
544 {
545 
546  return true;
547 }
548 
549 //----------------------------------------------------------------------------
550 // Function : Model::processInstanceParams
551 // Purpose :
552 // Special Notes :
553 // Scope : public
554 // Creator : Dave Shirely, PSSI
555 // Creation Date : 03/23/06
556 //----------------------------------------------------------------------------
558 {
559 
560  std::vector<Instance*>::iterator iter;
561  std::vector<Instance*>::iterator first = instanceContainer.begin();
562  std::vector<Instance*>::iterator last = instanceContainer.end();
563 
564  for (iter=first; iter!=last; ++iter)
565  {
566  (*iter)->processParams();
567  }
568 
569  return true;
570 }
571 
572 //-----------------------------------------------------------------------------
573 // Function : Model::Model
574 // Purpose : model block constructor
575 // Special Notes :
576 // Scope : public
577 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
578 // Creation Date : 5/16/00
579 //-----------------------------------------------------------------------------
581  const Configuration & configuration,
582  const ModelBlock & MB,
583  const FactoryBlock & factory_block)
584  : DeviceModel(MB, configuration.getModelParameters(), factory_block),
585  gMax(0.0),
586  eRev(0.0),
587  alpha(0.0),
588  beta(0.0),
589  vP(0.0),
590  tMax(0.0)
591 {
592 
593  // Set up mapping from param names to class variables:
594 
595  // Set params to constant default values:
596  setDefaultParams ();
597 
598  // Set params according to .model line and constant defaults from metadata:
599  setModParams (MB.params);
600 
601  // Set any non-constant parameter defaults:
602 
603  // Calculate any parameters specified as expressions:
605 
606  // calculate dependent (ie computed) params and check for errors:
607  processParams();
608 }
609 
610 //-----------------------------------------------------------------------------
611 // Function : Model::~Model
612 // Purpose : destructor
613 // Special Notes :
614 // Scope : public
615 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
616 // Creation Date : 3/16/00
617 //-----------------------------------------------------------------------------
619 {
620  std::vector<Instance*>::iterator iter;
621  std::vector<Instance*>::iterator first = instanceContainer.begin();
622  std::vector<Instance*>::iterator last = instanceContainer.end();
623 
624  for (iter=first; iter!=last; ++iter)
625  {
626  delete (*iter);
627  }
628 }
629 
630 //-----------------------------------------------------------------------------
631 // Function : Model::printOutInstances
632 // Purpose : debugging tool.
633 // Special Notes :
634 // Scope : public
635 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
636 // Creation Date : 4/03/00
637 //-----------------------------------------------------------------------------
638 std::ostream &Model::printOutInstances(std::ostream &os) const
639 {
640  std::vector<Instance*>::const_iterator iter;
641  std::vector<Instance*>::const_iterator first = instanceContainer.begin();
642  std::vector<Instance*>::const_iterator last = instanceContainer.end();
643 
644  int i,isize;
645  isize = instanceContainer.size();
646  os << std::endl;
647  os << "Number of Synapse2 Instances: " << isize << std::endl;
648  os << " name model name Parameters" << std::endl;
649  for (i=0, iter=first; iter!=last; ++iter, ++i)
650  {
651  os << " " << i << ": " << (*iter)->getName() << "\t";
652  os << getName();
653  os << std::endl;
654  }
655 
656  os << std::endl;
657  return os;
658 }
659 
660 //-----------------------------------------------------------------------------
661 // Function : Model::forEachInstance
662 // Purpose :
663 // Special Notes :
664 // Scope : public
665 // Creator : David Baur
666 // Creation Date : 2/4/2014
667 //-----------------------------------------------------------------------------
668 /// Apply a device instance "op" to all instances associated with this
669 /// model
670 ///
671 /// @param[in] op Operator to apply to all instances.
672 ///
673 ///
674 void Model::forEachInstance(DeviceInstanceOp &op) const /* override */
675 {
676  for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
677  op(*it);
678 }
679 
680 
681 // Synapse2 Master functions:
682 
683 //-----------------------------------------------------------------------------
684 // Function : Master::updateState
685 // Purpose :
686 // Special Notes :
687 // Scope : public
688 // Creator : Eric Keiter, SNL
689 // Creation Date : 11/26/08
690 //-----------------------------------------------------------------------------
691 bool Master::updateState (double * solVec, double * staVec, double * stoVec)
692 {
693  for (InstanceVector::const_iterator it = getInstanceBegin(); it != getInstanceEnd(); ++it)
694  {
695  (*it)->updateIntermediateVars();
696  }
697 
698  return true;
699 }
700 
701 //-----------------------------------------------------------------------------
702 // Function : Master::updateSecondaryState
703 // Purpose :
704 // Special Notes :
705 // Scope : public
706 // Creator : Eric Keiter, SNL
707 // Creation Date : 11/26/08
708 //-----------------------------------------------------------------------------
709 bool Master::updateSecondaryState ( double * staDerivVec, double * stoVec )
710 {
711  return true;
712 }
713 
714 Device *Traits::factory(const Configuration &configuration, const FactoryBlock &factory_block)
715 {
716 
717  return new Master(configuration, factory_block, factory_block.solverState_, factory_block.deviceOptions_);
718 }
719 
721 {
723  .registerDevice("synapse", 2)
724  .registerModelType("synapse", 2);
725 }
726 
727 } // namespace Synapse2
728 } // namespace Device
729 } // namespace Xyce
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
static void loadInstanceParameters(ParametricData< Instance > &instance_parameters)
void registerLIDs(const std::vector< int > &intLIDVecRef, const std::vector< int > &extLIDVecRef)
Linear::Vector * nextSolVectorPtr
bool processParams()
processParams
Linear::Vector * daeQVectorPtr
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)
std::vector< Instance * > instanceContainer
void registerJacLIDs(const std::vector< std::vector< int > > &jacLIDVec)
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
InstanceVector::const_iterator getInstanceEnd() const
Returns an iterator to the ending of the vector of all instances created for this device...
#define AssertLIDs(cmp)
virtual bool updateState(double *solVec, double *staVec, double *stoVec)
Updates the devices state information.
virtual void registerJacLIDs(const JacobianStamp &jacLIDVec)
static ScalarT PostCurrentEqu(const ScalarT Vpost, const ScalarT r, const ScalarT g, const ScalarT Erev)
void registerStateLIDs(const std::vector< int > &staLIDVecRef)
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.
Instance(const Configuration &configuration, const InstanceBlock &IB, Model &Riter, const FactoryBlock &factory_block)
void setParams(const std::vector< Param > &params)
const std::string & getName() const
The FactoryBlock contains parameters needed by the device, instance and model creation functions...
bool processInstanceParams()
processInstanceParams
static ScalarT rEquF(const ScalarT V, const ScalarT r, const ScalarT alpha, const ScalarT beta, const ScalarT Tmax, const ScalarT Vthres)
static Config< T > & addConfiguration()
Adds the device to the Xyce device configuration.
Linear::Matrix * dFdxMatrixPtr
The Device class is an interface for device implementations.
Definition: N_DEV_Device.h:101
virtual bool updateSecondaryState(double *staDeriv, double *stoVec)
Updates the devices secondary state information.
virtual std::ostream & printOutInstances(std::ostream &os) const
const SolverState & solverState_
Class Configuration contains device configuration data.
static std::vector< std::vector< int > > jacStamp
const SolverState & getSolverState() const
Linear::Vector * daeFVectorPtr
static void loadModelParameters(ParametricData< Model > &model_parameters)
ModelBlock represents a .MODEL line from the netlist.
const std::vector< std::vector< int > > & jacobianStamp() const
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
void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
Linear::Matrix * dQdxMatrixPtr
bool updateTemperature(const double &temp_tmp)
virtual void forEachInstance(DeviceInstanceOp &op) const
Apply a device instance "op" to all instances associated with this model.
void setModParams(const std::vector< Param > &params)