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.42 $
40 //
41 // Revision Date : $Date: 2015/10/20 22:32:48 $
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  return true;
128 }
129 
130 //-----------------------------------------------------------------------------
131 // Function : Instance::Instance
132 // Purpose : instance block constructor
133 // Special Notes :
134 // Scope : public
135 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
136 // Creation Date : 3/16/00
137 //-----------------------------------------------------------------------------
139  const Configuration & configuration,
140  const InstanceBlock & IB,
141  Model & Riter,
142  const FactoryBlock & factory_block)
143 
144  : DeviceInstance(IB, configuration.getInstanceParameters(), factory_block),
145  model_(Riter),
146  li_Prev(-1),
147  li_Post(-1),
148  APostEquPostNodeOffset(-1),
149  APostEquRNodeOffset(-1),
150  AREquPostNodeOffset(-1),
151  AREquRNodeOffset(-1),
152  f_PostEquPostNodePtr(0),
153  f_PostEquRNodePtr(0),
154  f_REquPostNodePtr(0),
155  f_REquRNodePtr(0)
156 {
157  numIntVars = 1;
158  numExtVars = 2;
159  numStateVars = 0;
160 
161  if( jacStamp.empty() )
162  {
163  // Vpre, Vpost, r
164  jacStamp.resize(3);
165  jacStamp[0].resize(0);
166  jacStamp[1].resize(2);
167  jacStamp[2].resize(2);
168  jacStamp[1][0] = 1; // Vpost PostPostVar
169  jacStamp[1][1] = 2; // r PostRVar
170  jacStamp[2][0] = 0; // Vpre RVpre
171  jacStamp[2][1] = 2; // r RR
172  }
173 
174 
175  // Set up mapping from param names to class variables:
176 
177  // Set params to constant default values:
178  setDefaultParams ();
179 
180  // Set params according to instance line and constant defaults from metadata:
181  setParams (IB.params);
182 
183  // Calculate any parameters specified as expressions:
185 
186  // calculate dependent (ie computed) params and check for errors:
187  processParams ();
188 }
189 
190 //-----------------------------------------------------------------------------
191 // Function : Instance::~Instance
192 // Purpose : destructor
193 // Special Notes :
194 // Scope : public
195 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
196 // Creation Date : 3/16/00
197 //-----------------------------------------------------------------------------
199 {
200 }
201 
202 //-----------------------------------------------------------------------------
203 // Function : Instance::registerLIDs
204 // Purpose :
205 // Special Notes :
206 // Scope : public
207 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
208 // Creation Date : 6/12/02
209 //-----------------------------------------------------------------------------
210 void Instance::registerLIDs( const std::vector<int> & intLIDVecRef,
211  const std::vector<int> & extLIDVecRef )
212 {
213  AssertLIDs(intLIDVecRef.size() == numIntVars);
214  AssertLIDs(extLIDVecRef.size() == numExtVars);
215 
216  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
217  {
218  Xyce::dout() << std::endl << section_divider << std::endl;
219  Xyce::dout() << " SynapseInstance::registerLIDs" << std::endl;
220  Xyce::dout() << " name = " << getName() << std::endl;
221  }
222 
223  // copy over the global ID lists.
224  intLIDVec = intLIDVecRef;
225  extLIDVec = extLIDVecRef;
226 
227  li_Prev = extLIDVec[0];
228  li_Post = extLIDVec[1];
229 
230  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
231  {
232  Xyce::dout() << " li_Prev = " << li_Prev << std::endl;
233  Xyce::dout() << " li_Post = " << li_Post << std::endl;
234  }
235 
236  li_rVar = intLIDVec[0];
237 
238  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) )
239  {
240  Xyce::dout() << section_divider << std::endl;
241  }
242 }
243 
244 //-----------------------------------------------------------------------------
245 // Function : Instance::loadNodeSymbols
246 // Purpose :
247 // Special Notes :
248 // Scope : public
249 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
250 // Creation Date : 05/13/05
251 //-----------------------------------------------------------------------------
252 void Instance::loadNodeSymbols(Util::SymbolTable &symbol_table) const
253 {
254  addInternalNode(symbol_table, li_rVar, getName(), "r");
255 }
256 
257 //-----------------------------------------------------------------------------
258 // Function : Instance::registerStateLIDs
259 // Purpose : Note that the Synapse2 does not have any state vars.
260 // Special Notes :
261 // Scope : public
262 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
263 // Creation Date : 06/12/02
264 //-----------------------------------------------------------------------------
265 void Instance::registerStateLIDs(const std::vector<int> & staLIDVecRef )
266 {
267  AssertLIDs(staLIDVecRef.size() == numStateVars);
268 }
269 
270 //-----------------------------------------------------------------------------
271 // Function : Instance::jacobianStamp
272 // Purpose :
273 // Special Notes :
274 // Scope : public
275 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
276 // Creation Date : 08/20/01
277 //-----------------------------------------------------------------------------
278 const std::vector< std::vector<int> > & Instance::jacobianStamp() const
279 {
280  return jacStamp;
281 }
282 
283 //-----------------------------------------------------------------------------
284 // Function : Instance::registerJacLIDs
285 // Purpose :
286 // Special Notes :
287 // Scope : public
288 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
289 // Creation Date : 08/27/01
290 //-----------------------------------------------------------------------------
291 void Instance::registerJacLIDs( const std::vector< std::vector<int> > & jacLIDVec )
292 {
293  DeviceInstance::registerJacLIDs( jacLIDVec );
294 
295  APostEquPostNodeOffset = jacLIDVec[1][0];
296  APostEquRNodeOffset = jacLIDVec[1][1];
297  AREquPostNodeOffset = jacLIDVec[2][0];
298  AREquRNodeOffset = jacLIDVec[2][1];
299 }
300 
301 //-----------------------------------------------------------------------------
302 // Function : Instance::setupPointers
303 // Purpose :
304 // Special Notes :
305 // Scope : public
306 // Creator : Eric Keiter, SNL
307 // Creation Date : 11/30/08
308 //-----------------------------------------------------------------------------
310 {
311 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
312  Linear::Matrix & dFdx = *(extData.dFdxMatrixPtr);
317 #endif
318 }
319 
320 //-----------------------------------------------------------------------------
321 // Function : Instance::updateIntermediateVars
322 // Purpose : update intermediate variables for one diode instance
323 // Special Notes :
324 // Scope : public
325 // Creator : Eric R. Keiter, Dept. 9233.
326 // Creation Date : 3/05/04
327 //-----------------------------------------------------------------------------
329 {
330  bool bsuccess = true;
331 
332  Linear::Vector * solVecPtr = extData.nextSolVectorPtr;
333 
334  if( getSolverState().dcopFlag )
335  {
336  // no firing during DCOP; r=0, so postsynaptic current is 0 and unchanging
337  ipost = 0.0;
338  didVpost = 0.0;
339  didr = 0.0;
340  rFval = 0.0;
341  drFdVpre = 0.0;
342  drFdr = 0.0;
343  }
344  else
345  {
346  double vPre = (*solVecPtr)[li_Prev];
347  double vPost = (*solVecPtr)[li_Post];
348  double rVar = (*solVecPtr)[li_rVar];
349 
350  // Load RHS vector element for the positive circuit node KCL equ.
351  {
352  Sacado::Fad::SFad<double,2> vPostVar( 2, 0, vPost );
353  Sacado::Fad::SFad<double,2> rVarS( 2, 1, rVar);
354 
355  // parameters
356  Sacado::Fad::SFad<double,2> gMaxVar( model_.gMax );
357  Sacado::Fad::SFad<double,2> eRevVar( model_.eRev );
358 
359  Sacado::Fad::SFad<double,2> resultFad;
360  resultFad = PostCurrentEqu( vPostVar, rVarS, gMaxVar, eRevVar );
361  ipost = resultFad.val();
362  didVpost = resultFad.dx(0);
363  didr = resultFad.dx(1);
364  }
365  {
366  Sacado::Fad::SFad<double,2> vPreVar( 2, 0, vPre );
367  Sacado::Fad::SFad<double,2> rVarS( 2, 1, rVar);
368 
369  // parameters
370  Sacado::Fad::SFad<double,2> alphaVar( model_.alpha );
371  Sacado::Fad::SFad<double,2> betaVar( model_.beta );
372  Sacado::Fad::SFad<double,2> tMaxVar( model_.tMax );
373  Sacado::Fad::SFad<double,2> vPVar( model_.vP );
374 
375  Sacado::Fad::SFad<double,2> resultFad;
376  resultFad = rEquF( vPreVar, rVarS, alphaVar, betaVar, tMaxVar, vPVar);
377  rFval = resultFad.val();
378  drFdVpre = resultFad.dx(0);
379  drFdr = resultFad.dx(1);
380  }
381  }
382 
383  return bsuccess;
384 }
385 
386 //-----------------------------------------------------------------------------
387 // Function : Instance::updatePrimaryState
388 // Purpose :
389 // Special Notes :
390 // Scope : public
391 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
392 // Creation Date : 01/29/01
393 //-----------------------------------------------------------------------------
395 {
396  bool bsuccess = updateIntermediateVars();
397  return bsuccess;
398 }
399 
400 //-----------------------------------------------------------------------------
401 // Function : Instance::updateSecondaryState
402 // Purpose :
403 // Special Notes :
404 // Scope : public
405 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
406 // Creation Date : 01/29/01
407 //-----------------------------------------------------------------------------
409 {
410  return true;
411 }
412 
413 //-----------------------------------------------------------------------------
414 // Function : Instance::loadDAEQVector
415 //
416 // Purpose : Loads the Q-vector contributions for a single
417 // Synapse2
418 //
419 // Special Notes : The "Q" vector is part of a standard DAE formalism in
420 // which the system of equations is represented as:
421 //
422 // f(x) = dQ(x)/dt + F(x) - B(t) = 0
423 //
424 // Scope : public
425 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
426 // Creation Date : 8/31/2010
427 //-----------------------------------------------------------------------------
429 {
430  Linear::Vector * qVecPtr = extData.daeQVectorPtr;
431  Linear::Vector * solVecPtr = extData.nextSolVectorPtr;
432  double rVar = (*solVecPtr)[li_rVar];
433  (*qVecPtr)[li_rVar] -= rVar;
434 
435  return true;
436 }
437 //-----------------------------------------------------------------------------
438 // Function : Instance::loadDAEFVector
439 //
440 // Purpose : Loads the F-vector contributions for a single
441 // Synapse2 instance.
442 //
443 // Special Notes : This is an algebraic constaint, and as such the Synapse2
444 // does make a contribution to it.
445 //
446 // Scope : public
447 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
448 // Creation Date : 01/24/03
449 //-----------------------------------------------------------------------------
451 {
452  Linear::Vector * fVecPtr = extData.daeFVectorPtr;
453  (*fVecPtr)[li_Prev] += 0.0;
454  (*fVecPtr)[li_Post] += ipost;
455  (*fVecPtr)[li_rVar] += rFval;
456  return true;
457 }
458 
459 //-----------------------------------------------------------------------------
460 // Function : Instance::loadDAEdQdx
461 //
462 // Purpose : Loads the dQdx-matrix contributions for a single
463 // Synapse2 instance.
464 //
465 // Special Notes : The "Q" vector is part of a standard DAE formalism in
466 // which the system of equations is represented as:
467 //
468 // f(x) = dQ(x)/dt + F(x) - B(t) = 0
469 //
470 // The "Q" vector contains charges and fluxes, mostly.
471 // However, it is ordered like the solution vector, and as
472 // it is part of the KCL formulation, the terms in Q will
473 // actually be *sums* of charges, rather than single
474 // distinct charges.
475 //
476 // This function assumes that updatePrimaryState has been
477 // called recently enough for the contents of q0 to be
478 // valid.
479 //
480 // Scope : public
481 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
482 // Creation Date : 03/05/04
483 //-----------------------------------------------------------------------------
485 {
486  Linear::Matrix & dQdx = *(extData.dQdxMatrixPtr);
487  dQdx[li_rVar][AREquRNodeOffset] += -1.0;
488 
489  return true;
490 }
491 
492 //-----------------------------------------------------------------------------
493 // Function : Instance::loadDAEdFdx ()
494 //
495 // Purpose : Loads the F-vector contributions for a single
496 // Synapse2 instance.
497 //
498 // Special Notes : This is an algebraic constaint, and as such the Synapse2
499 // does make a contribution to it.
500 //
501 // Scope : public
502 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
503 // Creation Date : 03/05/04
504 //-----------------------------------------------------------------------------
506 {
507  Linear::Matrix & dFdx = *(extData.dFdxMatrixPtr);
509  dFdx[li_Post][APostEquRNodeOffset] += didr;
511  dFdx[li_rVar][AREquRNodeOffset] += drFdr;
512 
513  return true;
514 }
515 
516 //-----------------------------------------------------------------------------
517 // Function : Instance::updateTemperature
518 // Purpose :
519 // Special Notes :
520 // Scope : public
521 // Creator : Tom Russo, Component Information and Models
522 // Creation Date : 02/27/01
523 //-----------------------------------------------------------------------------
524 bool Instance::updateTemperature ( const double & temp_tmp)
525 {
526  bool bsuccess = true;
527  return bsuccess;
528 }
529 
530 //-----------------------------------------------------------------------------
531 // Function : Model::processParams
532 // Purpose :
533 // Special Notes :
534 // Scope : public
535 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
536 // Creation Date : 6/03/02
537 //-----------------------------------------------------------------------------
539 {
540 
541  return true;
542 }
543 
544 //----------------------------------------------------------------------------
545 // Function : Model::processInstanceParams
546 // Purpose :
547 // Special Notes :
548 // Scope : public
549 // Creator : Dave Shirely, PSSI
550 // Creation Date : 03/23/06
551 //----------------------------------------------------------------------------
553 {
554 
555  std::vector<Instance*>::iterator iter;
556  std::vector<Instance*>::iterator first = instanceContainer.begin();
557  std::vector<Instance*>::iterator last = instanceContainer.end();
558 
559  for (iter=first; iter!=last; ++iter)
560  {
561  (*iter)->processParams();
562  }
563 
564  return true;
565 }
566 
567 //-----------------------------------------------------------------------------
568 // Function : Model::Model
569 // Purpose : model block constructor
570 // Special Notes :
571 // Scope : public
572 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
573 // Creation Date : 5/16/00
574 //-----------------------------------------------------------------------------
576  const Configuration & configuration,
577  const ModelBlock & MB,
578  const FactoryBlock & factory_block)
579  : DeviceModel(MB, configuration.getModelParameters(), factory_block),
580  gMax(0.0),
581  eRev(0.0),
582  alpha(0.0),
583  beta(0.0),
584  vP(0.0),
585  tMax(0.0)
586 {
587 
588  // Set up mapping from param names to class variables:
589 
590  // Set params to constant default values:
591  setDefaultParams ();
592 
593  // Set params according to .model line and constant defaults from metadata:
594  setModParams (MB.params);
595 
596  // Set any non-constant parameter defaults:
597 
598  // Calculate any parameters specified as expressions:
600 
601  // calculate dependent (ie computed) params and check for errors:
602  processParams();
603 }
604 
605 //-----------------------------------------------------------------------------
606 // Function : Model::~Model
607 // Purpose : destructor
608 // Special Notes :
609 // Scope : public
610 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
611 // Creation Date : 3/16/00
612 //-----------------------------------------------------------------------------
614 {
615  std::vector<Instance*>::iterator iter;
616  std::vector<Instance*>::iterator first = instanceContainer.begin();
617  std::vector<Instance*>::iterator last = instanceContainer.end();
618 
619  for (iter=first; iter!=last; ++iter)
620  {
621  delete (*iter);
622  }
623 }
624 
625 //-----------------------------------------------------------------------------
626 // Function : Model::printOutInstances
627 // Purpose : debugging tool.
628 // Special Notes :
629 // Scope : public
630 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
631 // Creation Date : 4/03/00
632 //-----------------------------------------------------------------------------
633 std::ostream &Model::printOutInstances(std::ostream &os) const
634 {
635  std::vector<Instance*>::const_iterator iter;
636  std::vector<Instance*>::const_iterator first = instanceContainer.begin();
637  std::vector<Instance*>::const_iterator last = instanceContainer.end();
638 
639  int i,isize;
640  isize = instanceContainer.size();
641  os << std::endl;
642  os << "Number of Synapse2 Instances: " << isize << std::endl;
643  os << " name model name Parameters" << std::endl;
644  for (i=0, iter=first; iter!=last; ++iter, ++i)
645  {
646  os << " " << i << ": " << (*iter)->getName() << "\t";
647  os << getName();
648  os << std::endl;
649  }
650 
651  os << std::endl;
652  return os;
653 }
654 
655 //-----------------------------------------------------------------------------
656 // Function : Model::forEachInstance
657 // Purpose :
658 // Special Notes :
659 // Scope : public
660 // Creator : David Baur
661 // Creation Date : 2/4/2014
662 //-----------------------------------------------------------------------------
663 /// Apply a device instance "op" to all instances associated with this
664 /// model
665 ///
666 /// @param[in] op Operator to apply to all instances.
667 ///
668 ///
669 void Model::forEachInstance(DeviceInstanceOp &op) const /* override */
670 {
671  for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
672  op(*it);
673 }
674 
675 
676 // Synapse2 Master functions:
677 
678 //-----------------------------------------------------------------------------
679 // Function : Master::updateState
680 // Purpose :
681 // Special Notes :
682 // Scope : public
683 // Creator : Eric Keiter, SNL
684 // Creation Date : 11/26/08
685 //-----------------------------------------------------------------------------
686 bool Master::updateState (double * solVec, double * staVec, double * stoVec)
687 {
688  for (InstanceVector::const_iterator it = getInstanceBegin(); it != getInstanceEnd(); ++it)
689  {
690  (*it)->updateIntermediateVars();
691  }
692 
693  return true;
694 }
695 
696 //-----------------------------------------------------------------------------
697 // Function : Master::updateSecondaryState
698 // Purpose :
699 // Special Notes :
700 // Scope : public
701 // Creator : Eric Keiter, SNL
702 // Creation Date : 11/26/08
703 //-----------------------------------------------------------------------------
704 bool Master::updateSecondaryState ( double * staDerivVec, double * stoVec )
705 {
706  return true;
707 }
708 
709 Device *Traits::factory(const Configuration &configuration, const FactoryBlock &factory_block)
710 {
711 
712  return new Master(configuration, factory_block, factory_block.solverState_, factory_block.deviceOptions_);
713 }
714 
716 {
718  .registerDevice("synapse", 2)
719  .registerModelType("synapse", 2);
720 }
721 
722 } // namespace Synapse2
723 } // namespace Device
724 } // 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)