Xyce  6.1
N_DEV_DeviceMgr.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-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_DeviceMgr.h,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.407.2.1 $
40 //
41 // Revision Date : $Date: 2015/04/02 18:20:09 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-----------------------------------------------------------------------------
45 
46 #ifndef Xyce_N_DEV_DeviceMgr_h
47 #define Xyce_N_DEV_DeviceMgr_h
48 
49 #if defined(HAVE_UNORDERED_MAP)
50 #include <unordered_map>
51 using std::unordered_map;
52 #elif defined(HAVE_TR1_UNORDERED_MAP)
53 #include <tr1/unordered_map>
54 using std::tr1::unordered_map;
55 #else
56 #error neither unordered_map or tr1/unordered_map found
57 #endif
58 #include <map>
59 #include <set>
60 #include <string>
61 #include <vector>
62 
63 #include <N_ANP_fwd.h>
64 #include <N_DEV_fwd.h>
65 #include <N_IO_fwd.h>
66 #include <N_LAS_fwd.h>
67 #include <N_NLS_fwd.h>
68 #include <N_PDS_fwd.h>
69 #include <N_TIA_fwd.h>
70 #include <N_TOP_fwd.h>
71 #include <N_UTL_fwd.h>
72 
74 #include <N_DEV_DeviceOptions.h>
75 #include <N_DEV_ExternData.h>
76 #include <N_DEV_MatrixLoadData.h>
77 #include <N_DEV_SolverState.h>
78 #include <N_UTL_Listener.h>
79 #include <N_ANP_StepEvent.h>
80 
81 namespace Xyce {
82 namespace Device {
83 
84 //-----------------------------------------------------------------------------
85 // Class : DeviceMgr
86 // Purpose :
87 // Special Notes :
88 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
89 // Creation Date : 3/16/00
90 //-----------------------------------------------------------------------------
91 class DeviceMgr : public Util::Listener<Analysis::StepEvent>
92 {
94 
95 public:
96  typedef std::vector<Device *> DeviceVector;
97  typedef std::vector<DeviceEntity *> EntityVector;
98  typedef std::vector<DeviceInstance *> InstanceVector;
99  typedef std::vector<DeviceModel *> ModelVector;
100  typedef std::map<ModelTypeId, ModelVector> ModelTypeModelVectorMap;
101  typedef std::map<ModelTypeId, InstanceVector> ModelTypeInstanceVectorMap;
102  typedef unordered_map<std::string, DeviceEntity *, HashNoCase, EqualNoCase> DeviceEntityMap;
103  typedef unordered_map<std::string, ModelTypeId, HashNoCase, EqualNoCase> ModelTypeNameModelTypeIdMap;
104 
105  typedef unordered_map<std::string, ArtificialParameters::ArtificialParameter *, HashNoCase, EqualNoCase> ArtificialParameterMap;
106 
107  typedef unordered_map<std::string, SourceInstance *, HashNoCase, EqualNoCase> IndependentSourceMap;
108  typedef std::vector<SourceInstance *> IndependentSourceVector;
109 
110  DeviceMgr(Parallel::Machine comm, Topo::Topology &topology, const IO::CmdParse &command_line);
111  ~DeviceMgr();
112 
113 private:
114  DeviceMgr(const DeviceMgr &); ///< No copying
115  DeviceMgr &operator=(const DeviceMgr &); ///< No assignment
116 
117 public:
118  void notify(const Analysis::StepEvent &event);
119 
120  bool registerAnalysisManager(Analysis::AnalysisManager *analysis_manager);
121 
122  bool registerMeasureMgr(IO::Measure::Manager * measure_manager)
123  {
124  measureManager_ = measure_manager;
125 
126  return measureManager_ != 0;
127  }
128 
130  {
131  nlsMgrPtr_ = tmp_nlsMgrPtr;
132 
133  return nlsMgrPtr_ != 0;
134  }
135 
136  bool registerICLoads( std::vector<std::pair<int,double> > * icLoads );
137 
138  // this function is called from the output manager (through the
139  // device interface) to inform the device package of the devices for
140  // which lead currents have been requested. The device manager will
141  // take care of doing isolated F and Q loads for these devices so
142  // the lead currents can be calculated
143  bool setLeadCurrentRequests(const std::set<std::string> & deviceNames );
144 
145  // MPDE related registrations:
146  std::vector<double> getFastSourcePeriod(Parallel::Machine comm, const std::vector<std::string> &sourceNames);
147  std::vector<double> registerFastSources(Parallel::Machine comm, const std::vector<std::string> &sourceNames);
148  void deRegisterFastSources(const std::vector<std::string> &sourceNames);
149  void deactivateSlowSources();
150  void activateSlowSources();
151 
152  void setMPDEFlag( bool flagVal );
153  void setBlockAnalysisFlag( bool flagVal );
154  void setFastTime( double timeVal );
155 
156  // Initialization function, to be called after all registrations are
157  // finished, and the linear system class is completely set up.
158  bool initializeAll(Linear::System &linear_system);
159 
160  // Device accessor functions:
161 
162  bool addDeviceModel(const ModelBlock & MB);
163 
164  std::pair<ModelTypeId, ModelTypeId> getModelType(const InstanceBlock &instance_block);
165 
166  bool verifyDeviceInstance(const InstanceBlock & IB);
167 
169 
170  bool deleteDeviceInstance (const std::string & name);
171 
172  int getHomotopyBlockSize() const;
173 
174  bool output ();
175  bool finishOutput ();
176 
177  void dotOpOutput ();
178 
179  // Load functions:
180  bool setInitialGuess (Linear::Vector * solVectorPtr);
181  bool loadErrorWeightMask(Linear::Vector * deviceMaskPtr);
182 
183  void debugOutput1();
184  void debugOutput2();
185 
187  std::string & name,
188  std::vector<double> & dfdpVec,
189  std::vector<double> & dqdpVec,
190  std::vector<double> & dbdpVec,
191  std::vector<int> & FindicesVec,
192  std::vector<int> & QindicesVec,
193  std::vector<int> & BindicesVec);
194 
195  bool analyticSensitivitiesAvailable(const std::string & name);
196  bool setParam(std::string & name, double val, bool overrideOriginal=false);
197  double getParamAndReduce(const std::string & name) const;
198  bool getParamAndReduce(const std::string & name, double & val) const;
199  double getParamNoReduce(const std::string & name) const;
200 
201  bool findParam(const std::string & name) const;
202 
203  bool updateTemperature(double val);
204 
205  bool updateSources();
206 
207  bool resetRHSLoadFlags (int index);
208 
210  {
211  return linearSystemFlag_;
212  }
213 
215  {
217  }
218 
220  {
221  return solState_.PDESystemFlag;
222  }
223 
225  {
226  return devOptions_;
227  }
228 
229  // setup initial conditions on devices
230  bool setICs (Linear::Vector * tmpSolVectorPtr,
231  Linear::Vector * tmpCurrSolVectorPtr,
232  Linear::Vector * tmpLastSolVectorPtr,
233  Linear::Vector * tmpStaVectorPtr,
234  Linear::Vector * tmpCurrStaVectorPtr,
235  Linear::Vector * tmpLasStaVectorPtr,
236  Linear::Vector * tmpStaDerivVectorPtr,
237  Linear::Vector * tmpStoVectorPtr,
238  Linear::Vector * tmpCurrStoVectorPtr,
239  Linear::Vector * tmpLastStoVectorPtr,
240  Linear::Vector * tmpQVectorPtr,
241  Linear::Vector * tmpFVectorPtr,
242  Linear::Vector * tmpBVectorPtr,
243  Linear::Vector * tmpdFdxdVpVectorPtr,
244  Linear::Vector * tmpdQdxdVpVectorPtr);
245 
246  // time integration stuff:
247  bool getBreakPoints(std::vector<Util::BreakPoint> & breakPointTimes);
248  double getMaxTimeStepSize ();
249 
250  // two-level newton and pde-continuation
251  int enablePDEContinuation();
252  bool disablePDEContinuation ();
253  void getNumInterfaceNodes (std::vector<int> & numInterfaceNodes);
254  bool loadCouplingRHS (int iPDEDevice, int iElectrode, Linear::Vector * dfdvPtr);
255  bool calcCouplingTerms (int iSubProblem, int iElectrode, const Linear::Vector * dxdvPtr);
256 
257  bool calcPDESubProblemInfo ();
258 
259  // load functions:
260  bool loadDAEMatrices (Linear::Vector * tmpSolVectorPtr,
261  Linear::Vector * tmpStaVectorPtr,
262  Linear::Vector * tmpStaDerivVectorPtr,
263  Linear::Vector * tmpStoVectorPtr,
264  Linear::Matrix * tmpdQdxMatrixPtr,
265  Linear::Matrix * tmpdFdxMatrixPtr);
266 
267  bool loadDAEVectors (Linear::Vector * tmpNextSolVectorPtr,
268  Linear::Vector * tmpCurrSolVectorPtr,
269  Linear::Vector * tmpLastSolVectorPtr,
270  Linear::Vector * tmpNextStaVectorPtr,
271  Linear::Vector * tmpCurrStaVectorPtr,
272  Linear::Vector * tmpLastStaVectorPtr,
273  Linear::Vector * tmpStaDerivVectorPtr,
274  Linear::Vector * tmpNextStoVectorPtr,
275  Linear::Vector * tmpCurrStoVectorPtr,
276  Linear::Vector * tmpLastStoVectorPtr,
277  Linear::Vector * tmpStoLeadCurrQCompVectorPtr,
278  Linear::Vector * tmpLeadFCompVectorPtr,
279  Linear::Vector * tmpLastLeadFCompVectorPtr,
280  Linear::Vector * tmpNextLeadFCompVectorPtr,
281  Linear::Vector * tmpLeadQCompVectorPtr,
282  Linear::Vector * tmpJunctionVCompVectorPtr,
283  Linear::Vector * tmpLastJunctionVCompVectorPtr,
284  Linear::Vector * tmpNextJunctionCompVectorPtr,
285  Linear::Vector * tmpQVectorPtr,
286  Linear::Vector * tmpFVectorPtr,
287  Linear::Vector * tmpBVectorPtr,
288  Linear::Vector * tmpdFdxdVpVectorPtr,
289  Linear::Vector * tmpdQdxdVpVectorPtr);
290 
291  bool updateState(
292  Linear::Vector * nextSolVectorPtr,
293  Linear::Vector * currSolVectorPtr,
294  Linear::Vector * lastSolVectorPtr,
295  Linear::Vector * nextStaVectorPtr,
296  Linear::Vector * currStaVectorPtr,
297  Linear::Vector * lastStaVectorPtr,
298  Linear::Vector * nextStoVectorPtr,
299  Linear::Vector * currStoVectorPtr,
300  Linear::Vector * lastStoVectorPtr);
301 
302  bool loadBVectorsforAC (Linear::Vector * bVecRealPtr,
303  Linear::Vector * bVecImagPtr);
304 
305  bool getBMatrixEntriesforMOR(std::vector<int>& bMatEntriesVec, std::vector<int>& bMatPosEntriesVec);
306 
307  int getNumNoiseDevices ();
308  int getNumNoiseSources ();
309  void setupNoiseSources(std::vector<Xyce::Analysis::NoiseData*> & noiseDataVec);
310  void getNoiseSources(std::vector<Xyce::Analysis::NoiseData*> & noiseDataVec);
311 
312  // voltlim doesn't work for all analysis types, so neccessary to
313  // be able to turn it off/on.
314  void unsetVoltageLimiterFlag ();
315  void setVoltageLimiterFlag ( bool flagVal );
316 
317  void addGlobalPar(const Util::Param &);
318  const double *findGlobalPar( const std::string & parName) const;
319  double getGlobalPar( const std::string & parName ) const;
320 
321 
322  // functions related to options registration
323  bool registerOptions(const Util::OptionBlock & option_block) {
324  return devOptions_.registerOptions(option_block);
325  }
326 
327  bool registerSensParams(const Util::OptionBlock & option_block);
328 
329  bool setOPAnalysisParams(const Util::OptionBlock & option_block);
330  bool setHBAnalysisParams(const Util::OptionBlock & option_block);
331  bool setACAnalysisParams(const Util::OptionBlock & option_block);
332  bool setNOISEAnalysisParams(const Util::OptionBlock & option_block);
333 
334  // convergence: allow devices to signal back to the solvers that
335  // they've played some game that invalidates normal convergence tests,
336  // and so the solution should be considered unconverged no matter how
337  // small the various norms are.
338  bool allDevicesConverged(Parallel::Machine comm) const;
339 
340  // Functions needed for power node (2-level) algorithm):
341 
342  // for the parallel case, we need to give all the processors a copy
343  // of the device so all the parallel synchronized calls such are
344  // called by all processors together.
345  bool setupExternalDevices(N_PDS_Comm &parallel_comm);
346 
348  return localDeviceCountMap_;
349  }
350 
351  void addDeviceToCount(const std::string & device_name, int num_devs = 1)
352  {
353  localDeviceCountMap_[device_name] += num_devs;
354  }
355 
356  void addDevicesToCount(const DeviceCountMap &device_map);
357 
358  DeviceEntity *getDeviceEntity(const std::string &full_param_name) const;
359 
360  void acceptStep();
361 
362  bool getInitialQnorm (std::vector<TimeIntg::TwoLevelError> & tleVec );
363  bool getInnerLoopErrorSums (std::vector<TimeIntg::TwoLevelError> & tleVec);
364 
365  bool updateStateArrays();
366  bool startTimeStep ();
367  void setExternalSolverState(const SolverState & ss);
368 
369  int restartDataSize(bool pack) const;
370 
371  // Output restart data.
372  bool dumpRestartData(char * buf, int bsize, int & pos, N_PDS_Comm * comm, bool pack ) const;
373 
374  // Load restart data.
375  bool restoreRestartData(char * buf, int bsize, int & pos, N_PDS_Comm * comm, bool pack );
376 
377  // needed for parallel only:
378  void setGlobalFlags();
379 
380  Device *getDevice(EntityTypeId model_type_id)
381  {
382  EntityTypeIdDeviceMap::iterator it = deviceMap_.find(model_type_id);
383  return it == deviceMap_.end() ? 0 : (*it).second;
384  }
385 
386  EntityTypeId getModelGroup(const std::string &model_or_device_type_name);
387 
388  void addArtificialParameter(const std::string &name, ArtificialParameters::ArtificialParameter *artificial_parameter) {
389  artificialParameterMap_[name] = artificial_parameter;
390  passThroughParamsMap_[name] = 1;
391  }
392 
393  const InstanceVector &getExternDevices() const;
394 
395 private:
396  bool getParam(const std::string &name, double &value) const;
397  Device &getDeviceByModelType(const EntityTypeId model_type);
398 
399  bool setupRawVectorPointers_ ();
400  bool setupRawMatrixPointers_ ();
401 
403  bool updatePrimaryState_();
404  bool updateSecondaryState_();
405 
407 
408  // Do the actual solve/calculation for the external devices
409  void updateExternalDevices_();
410 
411  // add external devices for processors that don't own it
412  ExternDevice::Instance * addExtDeviceInstance_(const InstanceBlock & IB);
413 
414 private:
415  const IO::CmdParse & commandLine_; ///< Command line
416  Topo::Topology & topology_; ///< Topology
417  DeviceOptions devOptions_; ///< user-defined options:
419 
420  bool sensFlag_; ///< .SENS present in netlist
421  bool linearSystemFlag_; ///< True if all devices in netlist have isLinearDevice() true
422  bool firstDependent_; ///< True until updateDependentParameters_ is called.
423  bool parameterChanged_; ///< Only used locally in updateDependentParameters_, don't know if stateful of just a member for fun
425  double timeParamsProcessed_; ///< Time updateDependentParameters was called
426 
428  MatrixLoadData matrixLoadData_; ///< temporary jacobian load structures:
429  SolverState solState_; ///< real time solver data:
430  Globals & globals_; ///< global variables
433 
434  Linear::Vector * numJacSolVectorPtr_;
435  Linear::Vector * numJacStaVectorPtr_;
436  Linear::Vector * numJacStoVectorPtr_;
437  Linear::Vector * diagonalVectorPtr_;
438 
439  Analysis::AnalysisManager * analysisManager_; ///< To search for non-device parameters. This needs to be removed
440  IO::Measure::Manager * measureManager_; ///< To search for non-device parameters. This needs to be removed
441  ArtificialParameterMap artificialParameterMap_; ///< Specially named parameters. This needs to be removed
442 
443  Parallel::Machine comm_; ///< Communicator (should be passed in when needed, not a member)
444  Nonlinear::Manager * nlsMgrPtr_; ///< To get Nonlinear solver information. This needs to be removed
445  std::vector<std::pair<int, double> > * icLoads_;
446 
447  ModelTypeNameModelTypeIdMap modelTypeMap_; ///< Model type name to model
448  ModelTypeNameModelTypeIdMap modelGroupMap_; ///< Model type name to model group
449  ModelTypeInstanceVectorMap modelGroupInstanceVector_;
450  ModelTypeInstanceVectorMap modelTypeInstanceVector_;
451 
452  ModelVector modelVector_;
453  ModelTypeModelVectorMap modelGroupModelVector_;
454  ModelTypeModelVectorMap modelTypeModelVector_;
455 
457 
458  DeviceVector devicePtrVec_;
459  DeviceVector pdeDevicePtrVec_;
460 
461  InstanceVector instancePtrVec_;
462  InstanceVector bpInstancePtrVec_; ///< instances with breakpoints functions
463  InstanceVector pdeInstancePtrVec_;
464  InstanceVector nonPdeInstancePtrVec_;
465  InstanceVector plotFileInstancePtrVec_;
466 
467  IndependentSourceVector independentSourceVector_;
468  IndependentSourceMap independentSourceMap_;
469 
470  // this is used to store the contents of the independentSourceVector_
471  // during an mpde initialization where we'll remove slow sources from
472  // the that vector so that they don't get updated
473  IndependentSourceVector indepSourceInstanceBackupPtrVec_;
474 
475  InstanceVector testJacDevicePtrVec_; ///< Devices under jacobian test
476  EntityVector dependentPtrVec_;
477 
478  std::set<std::string> devicesNeedingLeadCurrentLoads_;
479 
480  std::map<std::string, int, LessNoCase> passThroughParamsMap_;
481 
482  mutable DeviceEntityMap parameterDeviceCache_; ///< Full parameter name to device entity cache
483 
484 
485  std::vector<int> numInterfaceNodes_;
487 
488  // sensitivities:
490 
491  // .OP output flags.
493 
494 };
495 
496 //-----------------------------------------------------------------------------
497 // Function : DeviceMgr::unsetVoltageLimiterFlag ()
498 // Purpose :
499 // Special Notes :
500 // Scope : public
501 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
502 // Creation Date : 04/09/04
503 //-----------------------------------------------------------------------------
505 {
507 }
508 
509 //-----------------------------------------------------------------------------
510 // Function : DeviceMgr::setVoltageLimiterFlag ()
511 // Purpose :
512 // Special Notes :
513 // Scope : public
514 // Creator : Ting Mei, SNL
515 // Creation Date : 02/18/14
516 //-----------------------------------------------------------------------------
517 inline void DeviceMgr::setVoltageLimiterFlag ( bool flagVal )
518 {
520 }
521 
522 //-----------------------------------------------------------------------------
523 // Function : DeviceMgr::registerICLoads
524 // Purpose :
525 // Special Notes :
526 // Scope : public
527 // Creator : Robert Hoekstra, SNL, Computational Sciences
528 // Creation Date : 04/03/01
529 //-----------------------------------------------------------------------------
530 inline bool DeviceMgr::registerICLoads( std::vector< std::pair<int,double> > * icLoads )
531 {
532  return (icLoads_ = icLoads) != 0;
533 }
534 
535 bool registerPkgOptionsMgr(DeviceMgr &device_manager, const std::string &netlist_filename, IO::PkgOptionsMgr &options_manager);
536 void registerOpBuilders(Util::Op::BuilderManager &builder_manager, Parallel::Machine comm, DeviceMgr &device_manager);
537 
538 bool setupSolverInfo(
539  Parallel::Machine comm,
540  SolverState & solver_state,
541  const SolverState & external_solver_state,
542  bool external_state_flag,
543  const Analysis::AnalysisManager & analysis_manager,
544  const DeviceMgr & device_manager,
545  const DeviceOptions & device_options,
546  const Nonlinear::NonLinInfo & twoLevelNonlinearInfo);
547 
548 } // namespace Device
549 } // namespace Xyce
550 
551 #endif // Xyce_N_DEV_DeviceMgr_h
Linear::Vector * numJacSolVectorPtr_
void setExternalSolverState(const SolverState &ss)
const double * findGlobalPar(const std::string &parName) const
bool setupExternalDevices(N_PDS_Comm &parallel_comm)
void getAnalyticSensitivities(std::string &name, std::vector< double > &dfdpVec, std::vector< double > &dqdpVec, std::vector< double > &dbdpVec, std::vector< int > &FindicesVec, std::vector< int > &QindicesVec, std::vector< int > &BindicesVec)
ModelTypeNameModelTypeIdMap modelTypeMap_
Model type name to model.
bool setLeadCurrentRequests(const std::set< std::string > &deviceNames)
Linear::Vector * numJacStaVectorPtr_
bool resetRHSLoadFlags(int index)
DeviceEntity * getDeviceEntity(const std::string &full_param_name) const
IndependentSourceMap independentSourceMap_
DeviceMgr(Parallel::Machine comm, Topo::Topology &topology, const IO::CmdParse &command_line)
std::vector< double > getFastSourcePeriod(Parallel::Machine comm, const std::vector< std::string > &sourceNames)
Analysis::AnalysisManager * analysisManager_
To search for non-device parameters. This needs to be removed.
bool loadErrorWeightMask(Linear::Vector *deviceMaskPtr)
double getParamNoReduce(const std::string &name) const
InstanceVector instancePtrVec_
Pure virtual class to augment a linear system.
ModelTypeModelVectorMap modelGroupModelVector_
unordered_map< std::string, DeviceEntity *, HashNoCase, EqualNoCase > DeviceEntityMap
bool getInnerLoopErrorSums(std::vector< TimeIntg::TwoLevelError > &tleVec)
bool registerOptions(const Util::OptionBlock &option_block)
void setFastTime(double timeVal)
bool getBMatrixEntriesforMOR(std::vector< int > &bMatEntriesVec, std::vector< int > &bMatPosEntriesVec)
bool registerAnalysisManager(Analysis::AnalysisManager *analysis_manager)
ModelTypeInstanceVectorMap modelTypeInstanceVector_
void getNumInterfaceNodes(std::vector< int > &numInterfaceNodes)
DeviceCountMap localDeviceCountMap_
Device & getDeviceByModelType(const EntityTypeId model_type)
ExternDevice::Instance * addExtDeviceInstance_(const InstanceBlock &IB)
bool findParam(const std::string &name) const
type_index EntityTypeId
Definition: N_DEV_fwd.h:153
Topo::Topology & topology_
Topology.
const T & value(const ParameterBase &entity, const Descriptor &descriptor)
Returns the value of the parameter for the entity.
Definition: N_DEV_Pars.h:1224
Linear::Vector * diagonalVectorPtr_
ModelTypeModelVectorMap modelTypeModelVector_
DeviceEntityMap parameterDeviceCache_
Full parameter name to device entity cache.
std::map< ModelTypeId, InstanceVector > ModelTypeInstanceVectorMap
InstanceVector testJacDevicePtrVec_
Devices under jacobian test.
void registerOpBuilders(Util::Op::BuilderManager &builder_manager, Parallel::Machine comm, DeviceMgr &device_manager)
DeviceInstance * addDeviceInstance(const InstanceBlock &IB)
void getNoiseSources(std::vector< Xyce::Analysis::NoiseData * > &noiseDataVec)
bool dumpRestartData(char *buf, int bsize, int &pos, N_PDS_Comm *comm, bool pack) const
std::vector< DeviceInstance * > InstanceVector
bool setParam(std::string &name, double val, bool overrideOriginal=false)
bool setICs(Linear::Vector *tmpSolVectorPtr, Linear::Vector *tmpCurrSolVectorPtr, Linear::Vector *tmpLastSolVectorPtr, Linear::Vector *tmpStaVectorPtr, Linear::Vector *tmpCurrStaVectorPtr, Linear::Vector *tmpLasStaVectorPtr, Linear::Vector *tmpStaDerivVectorPtr, Linear::Vector *tmpStoVectorPtr, Linear::Vector *tmpCurrStoVectorPtr, Linear::Vector *tmpLastStoVectorPtr, Linear::Vector *tmpQVectorPtr, Linear::Vector *tmpFVectorPtr, Linear::Vector *tmpBVectorPtr, Linear::Vector *tmpdFdxdVpVectorPtr, Linear::Vector *tmpdQdxdVpVectorPtr)
bool loadCouplingRHS(int iPDEDevice, int iElectrode, Linear::Vector *dfdvPtr)
std::pair< ModelTypeId, ModelTypeId > getModelType(const InstanceBlock &instance_block)
bool parameterChanged_
Only used locally in updateDependentParameters_, don't know if stateful of just a member for fun...
bool setHBAnalysisParams(const Util::OptionBlock &option_block)
const DeviceCountMap & getDeviceCountMap()
bool loadDAEMatrices(Linear::Vector *tmpSolVectorPtr, Linear::Vector *tmpStaVectorPtr, Linear::Vector *tmpStaDerivVectorPtr, Linear::Vector *tmpStoVectorPtr, Linear::Matrix *tmpdQdxMatrixPtr, Linear::Matrix *tmpdFdxMatrixPtr)
bool getParam(const std::string &name, double &value) const
bool calcCouplingTerms(int iSubProblem, int iElectrode, const Linear::Vector *dxdvPtr)
void addGlobalPar(const Util::Param &)
DeviceSensitivities * devSensPtr_
InstanceVector pdeInstancePtrVec_
std::vector< Device * > DeviceVector
ModelTypeNameModelTypeIdMap modelGroupMap_
Model type name to model group.
bool setNOISEAnalysisParams(const Util::OptionBlock &option_block)
void setMPDEFlag(bool flagVal)
Device * getDevice(EntityTypeId model_type_id)
bool setInitialGuess(Linear::Vector *solVectorPtr)
IO::Measure::Manager * measureManager_
To search for non-device parameters. This needs to be removed.
const IO::CmdParse & commandLine_
Command line.
Parallel::Machine comm_
Communicator (should be passed in when needed, not a member)
double timeParamsProcessed_
Time updateDependentParameters was called.
The Device class is an interface for device implementations.
Definition: N_DEV_Device.h:101
EntityTypeIdDeviceMap deviceMap_
int getHomotopyBlockSize() const
bool allDevicesConverged(Parallel::Machine comm) const
bool initializeAll(Linear::System &linear_system)
const InstanceVector & getExternDevices() const
const DeviceOptions & getDeviceOptions() const
bool getBreakPoints(std::vector< Util::BreakPoint > &breakPointTimes)
Linear::Vector * numJacStoVectorPtr_
std::map< EntityTypeId, Device * > EntityTypeIdDeviceMap
Definition: N_DEV_fwd.h:167
bool setACAnalysisParams(const Util::OptionBlock &option_block)
void setupNoiseSources(std::vector< Xyce::Analysis::NoiseData * > &noiseDataVec)
bool registerICLoads(std::vector< std::pair< int, double > > *icLoads)
std::vector< std::pair< int, double > > * icLoads_
std::set< std::string > devicesNeedingLeadCurrentLoads_
EntityTypeId getModelGroup(const std::string &model_or_device_type_name)
Return the ModelGroup of the device associated with the model type name or device type name...
bool addDeviceModel(const ModelBlock &MB)
bool sensFlag_
.SENS present in netlist
bool setOPAnalysisParams(const Util::OptionBlock &option_block)
void addDeviceToCount(const std::string &device_name, int num_devs=1)
unordered_map< std::string, ModelTypeId, HashNoCase, EqualNoCase > ModelTypeNameModelTypeIdMap
double getGlobalPar(const std::string &parName) const
int restartDataSize(bool pack) const
void deRegisterFastSources(const std::vector< std::string > &sourceNames)
unordered_map< std::string, ArtificialParameters::ArtificialParameter *, HashNoCase, EqualNoCase > ArtificialParameterMap
std::map< std::string, int, LessNoCase > passThroughParamsMap_
DeviceOptions devOptions_
user-defined options:
std::map< ModelTypeId, ModelVector > ModelTypeModelVectorMap
unordered_map< std::string, SourceInstance *, HashNoCase, EqualNoCase > IndependentSourceMap
bool loadDAEVectors(Linear::Vector *tmpNextSolVectorPtr, Linear::Vector *tmpCurrSolVectorPtr, Linear::Vector *tmpLastSolVectorPtr, Linear::Vector *tmpNextStaVectorPtr, Linear::Vector *tmpCurrStaVectorPtr, Linear::Vector *tmpLastStaVectorPtr, Linear::Vector *tmpStaDerivVectorPtr, Linear::Vector *tmpNextStoVectorPtr, Linear::Vector *tmpCurrStoVectorPtr, Linear::Vector *tmpLastStoVectorPtr, Linear::Vector *tmpStoLeadCurrQCompVectorPtr, Linear::Vector *tmpLeadFCompVectorPtr, Linear::Vector *tmpLastLeadFCompVectorPtr, Linear::Vector *tmpNextLeadFCompVectorPtr, Linear::Vector *tmpLeadQCompVectorPtr, Linear::Vector *tmpJunctionVCompVectorPtr, Linear::Vector *tmpLastJunctionVCompVectorPtr, Linear::Vector *tmpNextJunctionCompVectorPtr, Linear::Vector *tmpQVectorPtr, Linear::Vector *tmpFVectorPtr, Linear::Vector *tmpBVectorPtr, Linear::Vector *tmpdFdxdVpVectorPtr, Linear::Vector *tmpdQdxdVpVectorPtr)
bool registerNonlinearSolver(Nonlinear::Manager *tmp_nlsMgrPtr)
void setBlockAnalysisFlag(bool flagVal)
Nonlinear::Manager * nlsMgrPtr_
To get Nonlinear solver information. This needs to be removed.
SolverState solState_
real time solver data:
std::vector< DeviceModel * > ModelVector
ArtificialParameterMap artificialParameterMap_
Specially named parameters. This needs to be removed.
InstanceVector plotFileInstancePtrVec_
std::map< std::string, int, LessNoCase > DeviceCountMap
Definition: N_DEV_fwd.h:163
bool updateState(Linear::Vector *nextSolVectorPtr, Linear::Vector *currSolVectorPtr, Linear::Vector *lastSolVectorPtr, Linear::Vector *nextStaVectorPtr, Linear::Vector *currStaVectorPtr, Linear::Vector *lastStaVectorPtr, Linear::Vector *nextStoVectorPtr, Linear::Vector *currStoVectorPtr, Linear::Vector *lastStoVectorPtr)
bool registerOptions(const Util::OptionBlock &OB)
IndependentSourceVector indepSourceInstanceBackupPtrVec_
bool registerPkgOptionsMgr(DeviceMgr &device_manager, const std::string &netlist_filename, IO::PkgOptionsMgr &options_manager)
void setVoltageLimiterFlag(bool flagVal)
void addArtificialParameter(const std::string &name, ArtificialParameters::ArtificialParameter *artificial_parameter)
bool registerSensParams(const Util::OptionBlock &option_block)
bool analyticSensitivitiesAvailable(const std::string &name)
InstanceVector bpInstancePtrVec_
instances with breakpoints functions
bool loadBVectorsforAC(Linear::Vector *bVecRealPtr, Linear::Vector *bVecImagPtr)
bool updateTemperature(double val)
void notify(const Analysis::StepEvent &event)
bool setupSolverInfo(Parallel::Machine comm, SolverState &solver_state, const SolverState &external_solver_state, bool external_state_flag, const Analysis::AnalysisManager &analysis_manager, const DeviceMgr &device_manager, const DeviceOptions &device_options, const Nonlinear::NonLinInfo &twoLevelNonlinearInfo)
std::vector< int > numInterfaceNodes_
IndependentSourceVector independentSourceVector_
bool registerMeasureMgr(IO::Measure::Manager *measure_manager)
bool restoreRestartData(char *buf, int bsize, int &pos, N_PDS_Comm *comm, bool pack)
std::vector< DeviceEntity * > EntityVector
Globals & globals_
global variables
bool linearSystemFlag_
True if all devices in netlist have isLinearDevice() true.
bool verifyDeviceInstance(const InstanceBlock &IB)
bool deleteDeviceInstance(const std::string &name)
InstanceVector nonPdeInstancePtrVec_
ModelBlock represents a .MODEL line from the netlist.
MatrixLoadData matrixLoadData_
temporary jacobian load structures:
void addDevicesToCount(const DeviceCountMap &device_map)
InstanceBlock represent a device instance line from the netlist.
double getParamAndReduce(const std::string &name) const
std::vector< double > registerFastSources(Parallel::Machine comm, const std::vector< std::string > &sourceNames)
ModelTypeInstanceVectorMap modelGroupInstanceVector_
bool firstDependent_
True until updateDependentParameters_ is called.
std::vector< SourceInstance * > IndependentSourceVector
bool getInitialQnorm(std::vector< TimeIntg::TwoLevelError > &tleVec)
DeviceMgr & operator=(const DeviceMgr &)
No assignment.