Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_DeviceMaster.h
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-2014 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_DeviceMaster.h,v $
27 //
28 // Purpose : Provides templated versions of some boilerplate functions
29 // that are device-specific (so they can't easily be included
30 // in the base device, instance, or model classes).
31 //
32 // Special Notes : Much of the functionality of the device classes, like
33 // N_DEV_Capacitor, is simply to manage STL containers
34 // of model and instance pointers. That management is pretty
35 // generic, so templating that functionality makes sense.
36 //
37 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
38 //
39 // Creation Date : 01/31/06
40 //
41 // Revision Information:
42 // ---------------------
43 //
44 // Revision Number: $Revision: 1.14 $
45 //
46 // Revision Date : $Date: 2014/05/22 17:40:27 $
47 //
48 // Current Owner : $Author: erkeite $
49 //-------------------------------------------------------------------------
50 
51 #ifndef Xyce_N_DEV_Device_Template_h
52 #define Xyce_N_DEV_Device_Template_h
53 
54 #include <map>
55 #include <string>
56 #include <vector>
57 
58 #include <N_DEV_Device.h>
59 #include <N_DEV_DeviceModel.h>
60 #include <N_DEV_DeviceBlock.h>
61 #include <N_DEV_Configuration.h>
62 
63 namespace Xyce {
64 namespace Device {
65 
66 void instance_must_reference_model_error(const Device &device, const std::string &name, const NetlistLocation &netlist_location);
67 void could_not_find_model_error(const Device &device, const std::string &model_name, const std::string &instance_name, const NetlistLocation &netlist_location);
68 void duplicate_model_warning(const Device &device, const DeviceModel &model, const NetlistLocation &netlist_location);
69 void duplicate_instance_warning(const Device &device, const DeviceInstance &instance, const NetlistLocation &netlist_location);
70 void duplicate_entity_warning(const Device &device, const DeviceEntity &entity, const NetlistLocation &netlist_location);
71 
72 //-----------------------------------------------------------------------------
73 // Class : DeviceMaster
74 //
75 // Purpose : This class contains a lot of boilerplate functions, such
76 // as addInstance, which are needed by every device. However,
77 // as functions of this nature are device-specific, they
78 // didn't naturally fit as base class Device functions.
79 //
80 // This class is a template, which takes 2 typenames;
81 // model, instance and model-ptr STL vector. A specific
82 // example of these would be CapacitorModel and
83 // CapacitorInstance
84 //
85 // Each derived device class will need to set up its own
86 // version of this template.
87 //
88 // Special Notes :
89 // Creator : Eric Keiter, SNL
90 // Creation Date : 1/31/06
91 //-----------------------------------------------------------------------------
92 
93 /**
94  * DeviceMaster instantiates a device as described by the device traits T.
95  *
96  * The Device Traits are described in in the device configuration.
97  *
98  * @see Xyce::Device::Configuration
99  *
100  * @param T device traits class
101  *
102  * @author David G. Baur Raytheon Sandia National Laboratories 1355
103  * @date Tue Feb 4 10:33:44 2014
104  */
105 template<class T>
106 class DeviceMaster : public Device
107 {
108 public:
109  typedef typename T::ModelType ModelType; ///< Make the model begin defined available
110  typedef typename T::InstanceType InstanceType; ///< Make the instance being define available
111 
112 protected:
113  typedef std::vector<InstanceType *> InstanceVector;
114  typedef std::map<std::string, ModelType *, LessNoCase> ModelMap;
115  typedef std::map<std::string, InstanceType *, LessNoCase> InstanceMap;
116 
117 public:
118  /**
119  * Constructs a device
120  *
121  * When a device is constructed, a default model is created.
122  *
123  * @param configuration const reference to device configuration
124  * @param factory_block const reference to the factory provided parameters
125  * @param solver_state const reference to the solver state to use for the device
126  * @param device_options const reference to the device options to use for the device
127  *
128  * @author David G. Baur Raytheon Sandia National Laboratories 1355
129  * @date Tue Feb 4 10:20:40 2014
130  */
132  const Configuration & configuration,
133  const FactoryBlock & factory_block,
134  const SolverState & solver_state,
135  const DeviceOptions & device_options)
136  : Device(),
137  deviceName_(T::name()),
138  defaultModelName_(std::string(T::deviceTypeName()) + " (" + T::name() + ")"),
139  configuration_(configuration),
140  deviceOptions_(device_options),
141  solverState_(solver_state),
142  modelMap_(),
143  instanceVector_(),
144  instanceMap_()
145  {}
146 
147  /**
148  * Destroys the device
149  *
150  * Delete the models created by this device. The model will handle deleting the instances.
151  *
152  * @return
153  *
154  * @author David G. Baur Raytheon Sandia National Laboratories 1355
155  * @date Tue Feb 4 10:23:31 2014
156  */
157  virtual ~DeviceMaster()
158  {
159  for (typename ModelMap::iterator model_it = modelMap_.begin(); model_it != modelMap_.end(); ++model_it)
160  {
161  delete (*model_it).second;
162  }
163  }
164 
165 private:
166  DeviceMaster(const DeviceMaster &right); ///< No copying
167  DeviceMaster(const Device &); ///< Eh?
168  DeviceMaster &operator=(const DeviceMaster &right); ///< No assignments
169 
170 public:
171  /**
172  * Returns the name of this device
173  *
174  * @return const reference to the device's name
175  *
176  * @author David G. Baur Raytheon Sandia National Laboratories 1355
177  * @date Tue Feb 4 10:25:37 2014
178  */
179  virtual const std::string &getName() const /* override */
180  {
181  return deviceName_;
182  }
183 
184  /**
185  * Returns the default model name to use if the instance being created does not specify one
186  *
187  * @return const reference to the default model name
188  *
189  * @author David G. Baur Raytheon Sandia National Laboratories 1355
190  * @date Tue Feb 4 10:26:10 2014
191  */
192  virtual const std::string &getDefaultModelName() const /* override */
193  {
194  return defaultModelName_;
195  }
196 
197  /**
198  * Returns a pointer to the model or model model with the specified name
199  *
200  * @param model_name const reference to the model name
201  *
202  * @return pointer to the model or 0 is not found
203  *
204  * @author David G. Baur Raytheon Sandia National Laboratories 1355
205  * @date Tue Feb 4 10:36:44 2014
206  */
207  virtual DeviceModel *findModel(const ModelName &model_name) /* override */
208  {
209  typename ModelMap::iterator it = modelMap_.find(model_name);
210  if (it != modelMap_.end())
211  return (*it).second;
212 
213  return 0;
214  }
215 
216  /**
217  * Returns a pointer to the model or model model with the specified name
218  *
219  * @param model_name const reference to the model name
220  *
221  * @return const pointer to the model or 0 is not found
222  *
223  * @author David G. Baur Raytheon Sandia National Laboratories 1355
224  * @date Tue Feb 4 10:36:44 2014
225  */
226  virtual const DeviceModel *findModel(const ModelName &model_name) const /* override */
227  {
228  typename ModelMap::const_iterator it = modelMap_.find(model_name);
229  if (it != modelMap_.end())
230  return (*it).second;
231 
232  return 0;
233  }
234 
235  /**
236  * Returns a pointer to the model or instance entity with the specified name
237  *
238  * @param instance_name const reference to the entity name
239  *
240  * @return pointer to the entity or 0 is not found
241  *
242  * @author David G. Baur Raytheon Sandia National Laboratories 1355
243  * @date Tue Feb 4 10:36:44 2014
244  */
245  virtual DeviceEntity *findInstance(const InstanceName &instance_name) /* override */
246  {
247  typename InstanceMap::iterator it = instanceMap_.find(instance_name.getEncodedName());
248  if (it != instanceMap_.end())
249  return (*it).second;
250 
251  return 0;
252  }
253 
254  /**
255  * Returns a pointer to the model or instance entity with the specified name
256  *
257  * @param instance_name const reference to the entity name
258  *
259  * @return const pointer to the entity or 0 is not found
260  *
261  * @author David G. Baur Raytheon Sandia National Laboratories 1355
262  * @date Tue Feb 4 10:36:44 2014
263  */
264  virtual const DeviceEntity *findInstance(const InstanceName &instance_name) const /* override */
265  {
266  typename InstanceMap::const_iterator it = instanceMap_.find(instance_name.getEncodedName());
267  if (it != instanceMap_.end())
268  return (*it).second;
269 
270  return 0;
271  }
272 
273  /**
274  * Returns true if this device is a linear device
275  *
276  * @return the device is linear value provided via the device trait.
277  *
278  * @author David G. Baur Raytheon Sandia National Laboratories 1355
279  * @date Tue Feb 4 10:51:52 2014
280  */
281  virtual bool isLinearDevice() const /* override */
282  {
283  return T::isLinearDevice();
284  }
285 
286  /**
287  * Returns true if this device is a PDE device
288  *
289  * @return the device is PDE value provided via the device trait.
290  *
291  * @author David G. Baur Raytheon Sandia National Laboratories 1355
292  * @date Tue Feb 4 10:53:10 2014
293  */
294  virtual bool isPDEDevice() const /* override */
295  {
296  return T::isPDEDevice();
297  }
298 
299  /**
300  * Executes operator op, passing its DeviceModel pointer, for each device model
301  *
302  * Since the model information is managed in a map of ModelType pointers, it is not possible to return the map as an
303  * association to DeviceModel pointers. This function iterates over the models and passes it the DeviceModel
304  * pointer for each.
305  *
306  * @param op functor taking a DeviceModel pointer as an argument
307  *
308  * @author David G. Baur Raytheon Sandia National Laboratories 1355
309  * @date Tue Feb 4 10:53:45 2014
310  */
311  virtual void forEachModel(DeviceModelOp &op) const /* override */
312  {
313  for (typename ModelMap::const_iterator it = modelMap_.begin(); it != modelMap_.end(); ++it)
314  op((*it).second);
315  }
316 
317  /**
318  * Executes operator op, passing its DeviceInstance pointer, for each device instance
319  *
320  * Since the instance information is managed in a map of InstanceType pointers, it is not possible to return the map as an
321  * association to DeviceInstance pointers. This function iterates over the instances and passes it the DeviceInstance
322  * pointer for each.
323  *
324  * @param op functor taking a DeviceInstance pointer as an argument
325  *
326  * @author David G. Baur Raytheon Sandia National Laboratories 1355
327  * @date Tue Feb 4 10:53:45 2014
328  */
329  virtual void forEachInstance(DeviceInstanceOp &op) const /* override */
330  {
331  for (typename InstanceVector::const_iterator it = instanceVector_.begin(); it != instanceVector_.end(); ++it)
332  op(*it);
333  }
334 
335  // virtual bool deleteInstance(DeviceInstance *instance) /* override */;
336 
337  virtual ModelType *addModel(const ModelBlock & MB, const FactoryBlock &factory_block) /* override */;
338  virtual InstanceType *addInstance(const InstanceBlock &instance_block, const FactoryBlock &factory_block); /* override */
339 
340  virtual bool updateSources() /* override */;
341  virtual bool updateState (double * solVec, double * staVec, double * stoVec)/* override */;
342  virtual bool updateSecondaryState (double * staDerivVec, double * stoVec) /* override */;
343  virtual bool loadDAEVectors (double * solVec, double * fVec, double * qVec, double * bVec, double * storeLeadF, double * storeLeadQ) /* override */;
344  virtual bool loadDAEMatrices (N_LAS_Matrix & dFdx, N_LAS_Matrix & dQdx) /* override */;
345 
346 protected:
347  /**
348  * Returns the solver state given during device construction
349  *
350  * @return const reference to the solver state
351  *
352  * @author David G. Baur Raytheon Sandia National Laboratories 1355
353  * @date Tue Feb 4 10:27:14 2014
354  */
355  const SolverState &getSolverState() const
356  {
357  return solverState_;
358  }
359 
360  /**
361  * Returns the device options given during device construction
362  *
363  * @return const reference to the device options
364  *
365  * @author David G. Baur Raytheon Sandia National Laboratories 1355
366  * @date Tue Feb 4 10:27:48 2014
367  */
369  {
370  return deviceOptions_;
371  }
372 
373  /**
374  * Returns an iterator to the beginning of the vector of all instances created for this device
375  *
376  * While a device instance is created, the device model owns the pointer to the device. The instanceVector_ gets a
377  * copy so that all instances of this device may be iterated over without needing to go through the model.
378  *
379  * @return iterator to the beginning of the device instance vector
380  *
381  * @author David G. Baur Raytheon Sandia National Laboratories 1355
382  * @date Tue Feb 4 10:28:29 2014
383  */
384  typename InstanceVector::const_iterator getInstanceBegin() const
385  {
386  return instanceVector_.begin();
387  }
388 
389  /**
390  * Returns an iterator to the ending of the vector of all instances created for this device
391  *
392  * While a device instance is created, the device model owns the pointer to the device. The instanceVector_ gets a
393  * copy so that all instances of this device may be iterated over without needing to go through the model.
394  *
395  * @return iterator to the ending of the device instance vector
396  *
397  * @author David G. Baur Raytheon Sandia National Laboratories 1355
398  * @date Tue Feb 4 10:28:29 2014
399  */
400  typename InstanceVector::const_iterator getInstanceEnd() const
401  {
402  return instanceVector_.end();
403  }
404 
405  /**
406  * Returns true if the model name must be specified for each instance
407  *
408  * @return the device model required value provided via the device trait.
409  *
410  * @author David G. Baur Raytheon Sandia National Laboratories 1355
411  * @date Tue Feb 4 10:32:10 2014
412  */
413  bool isModelRequired() const
414  {
415  return T::modelRequired();
416  }
417 
418 private:
419  virtual bool getBreakPoints(std::vector<Util::BreakPoint> & breakPointTimes);
420 
421 private:
422  const std::string deviceName_;
423  const std::string defaultModelName_;
430 };
431 
432 //-----------------------------------------------------------------------------
433 // Function : DeviceMaster::addInstance
434 // Purpose : This function adds an instance to the list of instances.
435 //
436 // Special Notes : All device instances are contained in one of many lists.
437 // Each model owns exactly one list of instances. If
438 // an instance is added which does not reference a model, or
439 // that references a model that does not exist, then a new
440 // model has to be added.
441 //
442 // For now, this function will only add a model for instances
443 // that do not specifically reference one. If an instance
444 // references a non-existant model, this function will return a
445 // fatal error. (This function should only be called from the
446 // device manager function, AddDeviceInstance, and that
447 // function will not call this one if the instance refers to a
448 // non-existant model.)
449 //
450 // Scope : public
451 // Creator : Eric Keiter, SNL
452 // Creation Date : 1/31/06
453 //-----------------------------------------------------------------------------
454 template<class T>
457  const InstanceBlock & instance_block,
458  const FactoryBlock & factory_block)
459 {
460  std::string model_name = instance_block.getModelName();
461 
462  if (model_name.empty()) // If no model name, use the default model.
463  {
464  if (isModelRequired())
465  {
466  instance_must_reference_model_error(*this, model_name, instance_block.getNetlistLocation());
467  return 0;
468  }
469  else
470  {
471  typename ModelMap::iterator it = modelMap_.find(defaultModelName_);
472  if (it == modelMap_.end())
473  {
474  addModel(ModelBlock(defaultModelName_), factory_block);
475  }
476  model_name = defaultModelName_;
477  }
478  }
479 
480  typename ModelMap::iterator it = modelMap_.find(model_name);
481  if (it == modelMap_.end())
482  {
483  could_not_find_model_error(*this, model_name, instance_block.getInstanceName().getDeviceName(), instance_block.getNetlistLocation());
484  return 0;
485  }
486 
487  ModelType &model = *(*it).second;
488 
489  std::pair<typename InstanceMap::iterator, bool> result = instanceMap_.insert(typename InstanceMap::value_type(instance_block.getInstanceName().getEncodedName(), typename InstanceMap::mapped_type(0)));
490  if (result.second)
491  {
492  InstanceType *instance = new InstanceType(configuration_, instance_block, model, factory_block);
493  instance->setDefaultParamName(T::instanceDefaultParameter());
494 
495  (*result.first).second = instance;
496 
497  model.addInstance(instance);
498 
499  instanceVector_.push_back(instance);
500 
501  if (modelMap_.find(instance_block.getInstanceName().getDeviceName()) != modelMap_.end())
502  duplicate_entity_warning(*this, *instance, instance_block.getNetlistLocation());
503  }
504  else
505  {
506  duplicate_instance_warning(*this, *(*result.first).second, instance_block.getNetlistLocation());
507  }
508 
509  return (*result.first).second;
510 }
511 
512 //-----------------------------------------------------------------------------
513 // Function : DeviceMaster::addModel
514 // Purpose : This function adds a model to the list of device models.
515 //
516 // Special Notes : This is the "public" version of the function, meaning that
517 // it returns a bool to indicate success or failure (rather
518 // than a pointer to the model). Also, it checks to see if the
519 // model being added is already part of the list. If the model
520 // already exists, it generates an error.
521 //
522 // Scope : public
523 // Creator : Eric Keiter, SNL
524 // Creation Date : 1/31/06
525 //-----------------------------------------------------------------------------
526 template<class T>
529  const ModelBlock & model_block,
530  const FactoryBlock & factory_block)
531 {
532  // Check to make sure that there doesn't already exist a model of this name.
533  std::pair<typename ModelMap::iterator, bool> result = modelMap_.insert(typename ModelMap::value_type(model_block.getName(), typename ModelMap::mapped_type(0)));
534  if (result.second)
535  {
536  ModelType *model = new ModelType(configuration_, model_block, factory_block);
537 
538  (*result.first).second = model;
539 
540  if (instanceMap_.find(model_block.getName()) != instanceMap_.end())
541  duplicate_entity_warning(*this, *model, model_block.getNetlistLocation());
542  }
543  else
544  {
545  duplicate_model_warning(*this, *(*result.first).second, model_block.getNetlistLocation());
546  }
547 
548  return (*result.first).second;
549 }
550 
551 // //-----------------------------------------------------------------------------
552 // // Function : DeviceMaster::deleteInstance
553 // // Purpose :
554 // // Special Notes :
555 // // Scope : public
556 // // Creator : Eric Keiter, SNL
557 // // Creation Date : 2/03/06
558 // //-----------------------------------------------------------------------------
559 // template<class T>
560 // bool DeviceMaster<T>::deleteInstance(const std::string & instance_name)
561 // {
562 // for (typename ModelMap::iterator it_model = modelMap_.begin(); it_model != modelMap_.end(); ++it_model)
563 // {
564 // InstanceVector &instance_list = (*it_model).second->getInstanceVector();
565 
566 // for (typename InstanceVector::iterator it_instance = instance_list.begin(); it_instance != instance_list.end(); ++it_instance)
567 // {
568 // if (equal_nocase(instance_name, (*it_instance)->getName()))
569 // {
570 // delete *it_instance;
571 // instance_list.erase(it_instance);
572 
573 // return true;
574 // }
575 // }
576 // }
577 
578 // return false;
579 // }
580 
581 //-----------------------------------------------------------------------------
582 // Function : DeviceMaster::getBreakPoints
583 // Purpose : This function adds break points to a vector of breakpoints.
584 //
585 // Special Notes : For most devices, this function won't get called. The
586 // device manager only calls getBreakPoints for certain
587 // pre-selected devices. Ultimately, this function probably
588 // isn't neccessary, as the device manager usually accesses
589 // device instances directly, rather than going through a
590 // device class middleman.
591 //
592 // Scope : public
593 // Creator : Eric Keiter, SNL
594 // Creation Date : 2/05/06
595 //-----------------------------------------------------------------------------
596 template<class T>
597 bool DeviceMaster<T>::getBreakPoints( std::vector<Util::BreakPoint> & breakPointTimes )
598 {
599  bool bsuccess = true;
600 
601  for (typename InstanceVector::iterator it = instanceVector_.begin(); it != instanceVector_.end(); ++it)
602  bsuccess = (*it)->getInstanceBreakPoints(breakPointTimes) && bsuccess;
603 
604  return bsuccess;
605 }
606 
607 //-----------------------------------------------------------------------------
608 // Function : DeviceMaster::updateSources
609 //
610 // Purpose :
611 //
612 // Special Notes : Just like for the getBreakPoints function, for most devices,
613 // this function won't get called. The
614 // device manager only calls updateSources for certain
615 // pre-selected devices. Ultimately, this function probably
616 // isn't neccessary, as the device manager usually accesses
617 // device instances directly, rather than going through a
618 // device class middleman.
619 //
620 // Scope : public
621 // Creator : Eric Keiter, SNL
622 // Creation Date : 02/05/06
623 //-----------------------------------------------------------------------------
624 template<class T>
626 {
627  bool bsuccess = true;
628 
629  for (typename InstanceVector::iterator it = instanceVector_.begin(); it != instanceVector_.end(); ++it)
630  bsuccess = (*it)->updateSource() && bsuccess;
631 
632  return bsuccess;
633 }
634 
635 //-----------------------------------------------------------------------------
636 // Function : DeviceMaster::updateState
637 // Purpose :
638 // Special Notes :
639 // Scope : public
640 // Creator : Eric Keiter, SNL
641 // Creation Date : 11/25/08
642 //-----------------------------------------------------------------------------
643 template<class T>
644 bool DeviceMaster<T>::updateState (double * solVec, double * staVec, double * stoVec)
645 {
646  bool bsuccess = true;
647  for (typename InstanceVector::const_iterator it = instanceVector_.begin(); it != instanceVector_.end(); ++it)
648  {
649  bool tmpBool = (*it)->updatePrimaryState();
650  bsuccess = bsuccess && tmpBool;
651  }
652 
653  return bsuccess;
654 }
655 
656 //-----------------------------------------------------------------------------
657 // Function : DeviceMaster::updateSecondaryState
658 // Purpose :
659 // Special Notes :
660 // Scope : public
661 // Creator : Eric Keiter, SNL
662 // Creation Date : 11/25/08
663 //-----------------------------------------------------------------------------
664 template<class T>
665 bool DeviceMaster<T>::updateSecondaryState (double * staDerivVec, double * stoVec)
666 {
667  bool bsuccess = true;
668  for (typename InstanceVector::const_iterator it = instanceVector_.begin(); it != instanceVector_.end(); ++it)
669  {
670  bool tmpBool = (*it)->updateSecondaryState ();
671  bsuccess = bsuccess && tmpBool;
672  }
673 
674  return bsuccess;
675 }
676 
677 //-----------------------------------------------------------------------------
678 // Function : DeviceMaster::loadDAEVectors
679 // Purpose :
680 // Special Notes :
681 // Scope : public
682 // Creator : Eric Keiter, SNL
683 // Creation Date : 11/25/08
684 //-----------------------------------------------------------------------------
685 template<class T>
686 bool DeviceMaster<T>::loadDAEVectors(double * solVec, double * fVec, double * qVec, double * bVec, double * storeLeadF, double * storeLeadQ)
687 {
688  bool bsuccess = true;
689  for (typename InstanceVector::const_iterator it = instanceVector_.begin(); it != instanceVector_.end(); ++it)
690  {
691  bool tmpBool = (*it)->loadDAEFVector();
692  bsuccess = bsuccess && tmpBool;
693  tmpBool = (*it)->loadDAEQVector();
694  bsuccess = bsuccess && tmpBool;
695 #ifdef SEPARATE_F_AND_B
696  tmpBool = (*it)->loadDAEBVector();
697  bsuccess = bsuccess && tmpBool;
698 #endif
699  }
700 
701  return bsuccess;
702 }
703 
704 //-----------------------------------------------------------------------------
705 // Function : DeviceMaster::loadDAEMatrices
706 // Purpose :
707 // Special Notes :
708 // Scope : public
709 // Creator : Eric Keiter, SNL
710 // Creation Date : 11/25/08
711 //-----------------------------------------------------------------------------
712 template<class T>
713 bool DeviceMaster<T>::loadDAEMatrices (N_LAS_Matrix & dFdx, N_LAS_Matrix & dQdx)
714 {
715  bool bsuccess = true;
716  for (typename InstanceVector::const_iterator it = instanceVector_.begin(); it != instanceVector_.end(); ++it)
717  {
718  bool tmpBool = (*it)->loadDAEdFdx();
719  bsuccess = bsuccess && tmpBool;
720  tmpBool = (*it)->loadDAEdQdx();
721  bsuccess = bsuccess && tmpBool;
722  }
723 
724  return bsuccess;
725 }
726 
727 } // namespace Device
728 } // namespace Xyce
729 
730 #endif