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