Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_DeviceInterface.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-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_DeviceInterface.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.152 $
40 //
41 // Revision Date : $Date: 2014/02/24 23:49:15 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-------------------------------------------------------------------------
45 
46 #include <Xyce_config.h>
47 
48 #include <algorithm>
49 
50 #include <N_DEV_DeviceInterface.h>
51 #include <N_DEV_DeviceMgr.h>
52 #include <N_ERH_ErrorMgr.h>
53 #include <N_UTL_BreakPoint.h>
54 #include <N_TIA_TwoLevelError.h>
55 
56 namespace Xyce {
57 namespace Device {
58 
59 //-----------------------------------------------------------------------------
60 // Function : DeviceInterface::factory
61 // Purpose : factory function
62 // Special Notes :
63 // Scope : public
64 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
65 // Creation Date : 03/05/02
66 //-----------------------------------------------------------------------------
68 {
69  DeviceInterface * DI_ptr = new DeviceInterface(cp);
70  return DI_ptr;
71 }
72 
73 //-----------------------------------------------------------------------------
74 // Function : DeviceInterface::DeviceInterface
75 // Purpose : constructor
76 // Special Notes :
77 // Scope : private
78 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
79 // Creation Date : 03/05/02
80 //-----------------------------------------------------------------------------
82 {
84 }
85 
86 //-----------------------------------------------------------------------------
87 // Function : DeviceInterface::~DeviceInterface
88 // Purpose : destructor
89 // Special Notes :
90 // Scope : public
91 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
92 // Creation Date : 03/05/02
93 //-----------------------------------------------------------------------------
95 {
96  delete devMgrPtr_;
97 }
98 
99 //-----------------------------------------------------------------------------
100 // Function : DeviceInterface::registerLinearSystem
101 // Purpose :
102 // Special Notes :
103 // Scope : public
104 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
105 // Creation Date : 03/05/02
106 //-----------------------------------------------------------------------------
107 bool DeviceInterface::registerLinearSystem (N_LAS_System * tmp_system_ptr)
108 {
109  return devMgrPtr_->registerLinearSystem(tmp_system_ptr);
110 }
111 
112 //-----------------------------------------------------------------------------
113 // Function : DeviceInterface::registerAnalysisInterface
114 // Purpose :
115 // Special Notes :
116 // Scope : public
117 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
118 // Creation Date : 03/05/02
119 //-----------------------------------------------------------------------------
121 {
122  return devMgrPtr_->registerAnalysisInterface (tmp_anaIntPtr);
123 }
124 
125 //-----------------------------------------------------------------------------
126 // Function : DeviceInterface::registerOutputManager
127 // Purpose :
128 // Special Notes :
129 // Scope : public
130 // Creator : Dave Shirley, PSSI
131 // Creation Date : 08/15/06
132 //-----------------------------------------------------------------------------
133 bool DeviceInterface::registerOutputMgr (N_IO_OutputMgr * tmp_outputMgrPtr)
134 {
135  return devMgrPtr_->registerOutputMgr(tmp_outputMgrPtr);
136 }
137 
138 //-----------------------------------------------------------------------------
139 // Function : DeviceInterface::registerParallelMgr
140 // Purpose :
141 // Special Notes :
142 // Scope : public
143 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
144 // Creation Date : 6/29/01
145 //-----------------------------------------------------------------------------
146 bool DeviceInterface::registerParallelMgr (N_PDS_Manager * tmp_pdsMgrPtr )
147 {
148  return devMgrPtr_->registerParallelMgr(tmp_pdsMgrPtr);
149 }
150 
151 //-----------------------------------------------------------------------------
152 // Function : DeviceInterface::registerNonlinearSolver
153 // Purpose :
154 // Special Notes :
155 // Scope : public
156 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
157 // Creation Date : 03/05/02
158 //-----------------------------------------------------------------------------
160 {
161  return devMgrPtr_->registerNonlinearSolver(tmp_nlsMgrPtr);
162 }
163 
164 //-----------------------------------------------------------------------------
165 // Function : DeviceInterface::registerPkgOptionsMgr
166 // Purpose :
167 // Special Notes :
168 // Scope : public
169 // Creator : Richard Schiek, Electrical and Mems Modeling
170 // Creation Date : 10/20/2008
171 //-----------------------------------------------------------------------------
172 bool DeviceInterface::registerPkgOptionsMgr( N_IO_PkgOptionsMgr *pkgOptPtr )
173 {
174  return devMgrPtr_->registerPkgOptionsMgr(pkgOptPtr);
175 }
176 
177 //-----------------------------------------------------------------------------
178 // Function : DeviceInterface::getFastSourcePeriod
179 // Purpose :
180 // Special Notes :
181 // Scope : public
182 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
183 // Creation Date : 03/27/04
184 //-----------------------------------------------------------------------------
185 std::vector<double> DeviceInterface::getFastSourcePeriod (std::vector<std::string>& sourceNames)
186 {
187  return devMgrPtr_->getFastSourcePeriod (sourceNames);
188 }
189 
190 //-----------------------------------------------------------------------------
191 // Function : DeviceInterface::registerFastSources
192 // Purpose :
193 // Special Notes :
194 // Scope : public
195 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
196 // Creation Date : 03/27/04
197 //-----------------------------------------------------------------------------
198 std::vector<double> DeviceInterface::registerFastSources(std::vector<std::string>& sourceNames)
199 {
200  return devMgrPtr_->registerFastSources (sourceNames);
201 }
202 
203 //-----------------------------------------------------------------------------
204 // Function : DeviceInterface::deRegisterFastSources
205 // Purpose :
206 // Special Notes :
207 // Scope : public
208 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
209 // Creation Date : 06/12/2013
210 //-----------------------------------------------------------------------------
211 void DeviceInterface::deRegisterFastSources(std::vector<std::string>& sourceNames)
212 {
213  return devMgrPtr_->deRegisterFastSources (sourceNames);
214 }
215 
216 //-----------------------------------------------------------------------------
217 // Function : N_DEV_DeviceInterface::registerLeadCurrentRequests
218 // Purpose : this function is called from the output manager to inform the
219 // device package of the devices for which lead currents have
220 // been requested. The device manager will take care of doing
221 // isolated F and Q loads for these devices so the lead currents
222 // can be calculated
223 // Special Notes :
224 // Scope : public
225 // Creator : Richard Schiek, SNL, Electrical Systems Modeling
226 // Creation Date : 03/20/13
227 //-----------------------------------------------------------------------------
228 bool DeviceInterface::setLeadCurrentRequests( const std::set<std::string> & deviceNames )
229 {
230  return devMgrPtr_->setLeadCurrentRequests( deviceNames );
231 }
232 
233 
234 //-----------------------------------------------------------------------------
235 // Function : N_DEV_DeviceInterface::deactivateSlowSources
236 // Purpose :
237 // Special Notes :
238 // Scope : public
239 // Creator : Richard Schiek, SNL, Parallel Computational Sciences
240 // Creation Date : 03/22/07
241 //-----------------------------------------------------------------------------
243 {
245 }
246 
247 
248 //-----------------------------------------------------------------------------
249 // Function : DeviceInterface::activateSlowSources
250 // Purpose :
251 // Special Notes :
252 // Scope : public
253 // Creator : Richard Schiek, SNL, Parallel Computational Sciences
254 // Creation Date : 03/22/07
255 //-----------------------------------------------------------------------------
257 {
259 }
260 
261 //-----------------------------------------------------------------------------
262 // Function : DeviceInterface::setMPDEFlag
263 // Purpose :
264 // Special Notes :
265 // Scope : public
266 // Creator : Richard Schiek, SNL, Parallel Computational Sciences
267 // Creation Date : 07/21/08
268 //-----------------------------------------------------------------------------
269 void DeviceInterface::setMPDEFlag( bool flagVal )
270 {
271  devMgrPtr_->setMPDEFlag( flagVal );
272 }
273 
274 //-----------------------------------------------------------------------------
275 // Function : DeviceInterface::setBlockAnalysisFlag
276 // Purpose :
277 // Special Notes :
278 // Scope : public
279 // Creator : Richard Schiek, SNL, Parallel Computational Sciences
280 // Creation Date : 07/21/08
281 //-----------------------------------------------------------------------------
283 {
284  devMgrPtr_->setBlockAnalysisFlag( flagVal );
285 }
286 
287 //-----------------------------------------------------------------------------
288 // Function : DeviceInterface::setFastTime
289 // Purpose :
290 // Special Notes :
291 // Scope : public
292 // Creator : Richard Schiek, SNL, Parallel Computational Sciences
293 // Creation Date : 07/21/08
294 //-----------------------------------------------------------------------------
295 void DeviceInterface::setFastTime( double timeVal )
296 {
297  devMgrPtr_->setFastTime( timeVal );
298 }
299 
300 //-----------------------------------------------------------------------------
301 // Function : DeviceInterface::initializeAll
302 // Purpose : This function, via the LAS system class, sets up
303 // the pointers to the various linear algebra entities.
304 // Special Notes :
305 // Scope : protected
306 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
307 // Creation Date : 6/12/00
308 //-----------------------------------------------------------------------------
310 {
311  return devMgrPtr_->initializeAll();
312 }
313 
314 //-----------------------------------------------------------------------------
315 // Function : DeviceInterface::resetForStepAnalysis
316 // Purpose :
317 // Special Notes :
318 // Scope : public
319 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
320 // Creation Date : 07/12/2013
321 //-----------------------------------------------------------------------------
323 {
325 }
326 
327 //-----------------------------------------------------------------------------
328 // Function : DeviceInterface::addDeviceModel
329 // Purpose :
330 // Special Notes :
331 // Scope : public
332 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
333 // Creation Date : 03/05/02
334 //-----------------------------------------------------------------------------
335 bool DeviceInterface::addDeviceModel (const ModelBlock & model_block)
336 {
337  return devMgrPtr_->addDeviceModel(model_block);
338 }
339 
340 
341 //-----------------------------------------------------------------------------
342 // Function : DeviceInterface::verifyDeviceInstance
343 // Purpose : This funciton verifies a device instance prior to instantiating.
344 // Theoretically, we could do this in addDeviceInstance() and
345 // not make a device if it fails some verification criteria (a
346 // resistor with zero resistance is the primary case here). However,
347 // later unlinking of redundant devices that are connected to just
348 // one node is difficut after addDeviceInstance() is called because
349 // the device instance pointer can be placed in many other containers
350 // It could be done, but this is a simpler first step to having the
351 // device manager be in charge of device verification -- rather
352 // than have it in toplogy or io.
353 //
354 // Special Notes : return true if this device is ok to instantiate, false otherwise
355 // Scope : public
356 // Creator : Richard Schiek, Electrical and Microsystems Modeling
357 // Creation Date : 2/18/2010
358 //-----------------------------------------------------------------------------
360 {
361  return devMgrPtr_->verifyDeviceInstance( instance_block );
362 }
363 
364 //-----------------------------------------------------------------------------
365 // Function : DeviceInterface::addDeviceInstance
366 // Purpose : addDeviceInstance will create a new instance of the
367 // designated device type. This version of the function
368 // accepts a parameter list as one of the arguments,
369 // so it is assumed that a parameter instance will
370 // also have to be allocated for it.
371 //
372 // Special Notes :
373 // Scope : public
374 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
375 // Creation Date : 03/05/02
376 //-----------------------------------------------------------------------------
378 {
379  return devMgrPtr_->addDeviceInstance(instance_block);
380 }
381 
382 //-----------------------------------------------------------------------------
383 // Function : DeviceInterface::deleteDeviceInstance
384 // Purpose :
385 // Special Notes :
386 // Scope : public
387 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
388 // Creation Date : 03/05/02
389 //-----------------------------------------------------------------------------
390 bool DeviceInterface::deleteDeviceInstance (const std::string & name)
391 {
392  return devMgrPtr_->deleteDeviceInstance(name);
393 }
394 
395 //----------------------------------------------------------------------------
396 // Function : DeviceInterface::getDeviceCountMap
397 // Purpose :
398 // Special Notes :
399 // Scope : public
400 // Creator : Eric R. Keiter, SNL.
401 // Creation Date : 05/07/2010
402 //----------------------------------------------------------------------------
403 const std::map<std::string,int> & DeviceInterface::getDeviceCountMap()
404 {
405  return devMgrPtr_->getDeviceCountMap();
406 }
407 
408 void DeviceInterface::addDeviceToCount(const std::string & device_name)
409 {
410  devMgrPtr_->addDeviceToCount(device_name);
411 }
412 
413 //-----------------------------------------------------------------------------
414 // Function : DeviceInterface::printOutLists
415 // Purpose : This function will send output to stdout of all the
416 // allocated model and instance lists.
417 // Special Notes :
418 // Scope : public
419 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
420 // Creation Date : 03/05/02
421 //-----------------------------------------------------------------------------
422 // void DeviceInterface::printOutLists()
423 // {
424 // devMgrPtr_->printOutLists();
425 // }
426 
427 //-----------------------------------------------------------------------------
428 // Function : DeviceInterface::loadDeviceMask
429 // Purpose : This function loads the mask elements for all
430 // of the circuit devices.
431 // Special Notes :
432 // Scope : public
433 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
434 // Creation Date : 01/19/07
435 //-----------------------------------------------------------------------------
437 {
438  return devMgrPtr_->loadDeviceMask();
439 }
440 
441 const EntityTypeIdDeviceMap &
443  return devMgrPtr_->getDeviceMap();
444 }
445 
446 //-----------------------------------------------------------------------------
447 // Function : DeviceInterface::setInitialGuess
448 // Purpose :
449 // Special Notes :
450 // Scope : public
451 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
452 // Creation Date : 05/02/03
453 //-----------------------------------------------------------------------------
455  (N_LAS_Vector * solVectorPtr)
456 {
457  return devMgrPtr_->setInitialGuess(solVectorPtr);
458 }
459 
460 //-----------------------------------------------------------------------------
461 // Function : DeviceInterface::setParam
462 // Purpose :
463 // Special Notes :
464 // Scope : public
465 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
466 // Creation Date : 05/02/03
467 //-----------------------------------------------------------------------------
468 bool DeviceInterface::setParam(std::string & name, double val)
469 {
470  return devMgrPtr_->setParam (name,val);
471 }
472 
473 //-----------------------------------------------------------------------------
474 // Function : DeviceInterface::getParam
475 // Purpose :
476 // Special Notes :
477 // Scope : public
478 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
479 // Creation Date : 05/02/03
480 //-----------------------------------------------------------------------------
481 double DeviceInterface::getParamAndReduce(const std::string & name)
482 {
483  return devMgrPtr_->getParamAndReduce(name);
484 }
485 
486 //-----------------------------------------------------------------------------
487 // Function : DeviceInterface::getParam
488 // Purpose :
489 // Special Notes :
490 // Scope : public
491 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
492 // Creation Date : 05/02/03
493 //-----------------------------------------------------------------------------
494 bool DeviceInterface::getParamAndReduce(const std::string & name, double & val)
495 {
496  return devMgrPtr_->getParamAndReduce(name, val);
497 }
498 
499 bool DeviceInterface::findParam(const std::string & name) const
500 {
501  return devMgrPtr_->findParam (name);
502 }
503 
504 double DeviceInterface::getParamNoReduce(const std::string &name) const
505 {
506  return devMgrPtr_->getParamNoReduce(name);
507 }
508 
511 }
512 
513 DeviceEntity * DeviceInterface::getDeviceEntity(const std::string & full_param_name) const
514 {
515  return devMgrPtr_->getDeviceEntity(full_param_name);
516 }
517 
518 
519 //-----------------------------------------------------------------------------
520 // Function : DeviceInterface::getVsrcLIDs
521 // Purpose :
522 // Special Notes :
523 // Scope : public
524 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
525 // Creation Date : 03/05/06
526 //-----------------------------------------------------------------------------
528  (std::string & srcName, int & li_Pos, int & li_Neg, int & li_Bra)
529 {
530  return devMgrPtr_-> getVsrcLIDs (srcName,li_Pos,li_Neg,li_Bra);
531 }
532 
533 //-----------------------------------------------------------------------------
534 // Function : DeviceInterface::updateSources
535 // Purpose : This function function updates sources for the present
536 // time step.
537 // Special Notes :
538 // Scope : public
539 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
540 // Creation Date : 03/05/02
541 //-----------------------------------------------------------------------------
543 {
544  return devMgrPtr_->updateSources ();
545 }
546 
547 //-----------------------------------------------------------------------------
548 // Function : DeviceInterface::setICs
549 // Purpose : This function function sets initial conditions for devices
550 // Special Notes :
551 // Scope : public
552 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
553 // Creation Date : 03/05/02
554 //-----------------------------------------------------------------------------
556  N_LAS_Vector * tmpSolVectorPtr,
557  N_LAS_Vector * tmpCurrSolVectorPtr,
558  N_LAS_Vector * tmpLastSolVectorPtr,
559  N_LAS_Vector * tmpStaVectorPtr,
560  N_LAS_Vector * tmpCurrStaVectorPtr,
561  N_LAS_Vector * tmpLastStaVectorPtr,
562  N_LAS_Vector * tmpStaDerivVectorPtr,
563  N_LAS_Vector * tmpStoVectorPtr,
564  N_LAS_Vector * tmpCurrStoVectorPtr,
565  N_LAS_Vector * tmpLastStoVectorPtr,
566  N_LAS_Vector * tmpQVectorPtr,
567  N_LAS_Vector * tmpFVectorPtr,
568  N_LAS_Vector * tmpdFdxdVpVectorPtr,
569  N_LAS_Vector * tmpdQdxdVpVectorPtr)
570 {
571  return devMgrPtr_->setICs( tmpSolVectorPtr,
572  tmpCurrSolVectorPtr,
573  tmpLastSolVectorPtr,
574  tmpStaVectorPtr,
575  tmpCurrStaVectorPtr,
576  tmpLastStaVectorPtr,
577  tmpStaDerivVectorPtr,
578  tmpStoVectorPtr,
579  tmpCurrStoVectorPtr,
580  tmpLastStoVectorPtr,
581  tmpQVectorPtr,
582  tmpFVectorPtr,
583  tmpdFdxdVpVectorPtr,
584  tmpdQdxdVpVectorPtr );
585 }
586 
587 //-----------------------------------------------------------------------------
588 // Function : DeviceInterface::getLinearSystemFlag
589 // Purpose :
590 // Special Notes :
591 // Scope : public
592 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
593 // Creation Date : 03/05/02
594 //-----------------------------------------------------------------------------
596 {
597  return devMgrPtr_->getLinearSystemFlag ();
598 }
599 
600 //-----------------------------------------------------------------------------
601 // Function : DeviceInterface::getVoltageLimterFlag
602 // Purpose :
603 // Special Notes :
604 // Scope : public
605 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
606 // Creation Date : 03/11/04
607 //-----------------------------------------------------------------------------
609 {
611 }
612 
613 //-----------------------------------------------------------------------------
614 // Function : DeviceInterface::getPDESystemFlag
615 // Purpose :
616 // Special Notes :
617 // Scope : public
618 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
619 // Creation Date : 03/05/02
620 //-----------------------------------------------------------------------------
622 {
623  return devMgrPtr_->getPDESystemFlag ();
624 }
625 
626 //-----------------------------------------------------------------------------
627 // Function : DeviceInterface::runParameterTests
628 // Purpose : The purpose of this function is to test out the processing
629 // of various device parameters.
630 // Special Notes :
631 // Scope : public
632 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
633 // Creation Date : 03/05/02
634 //-----------------------------------------------------------------------------
635 bool DeviceInterface::runParameterTests(std::string & deviceName)
636 {
637  return devMgrPtr_->runParameterTests(deviceName);
638 }
639 
640 //-----------------------------------------------------------------------------
641 // Function : DeviceInterface::output
642 // Purpose :
643 // Special Notes :
644 // Scope : public
645 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
646 // Creation Date : 03/05/02
647 //-----------------------------------------------------------------------------
649 {
650  return devMgrPtr_->output ();
651 }
652 
653 //-----------------------------------------------------------------------------
654 // Function : DeviceInterface::finishOutput
655 // Purpose :
656 // Special Notes :
657 // Scope : public
658 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
659 // Creation Date : 06/19/04
660 //-----------------------------------------------------------------------------
662 {
663  return devMgrPtr_->finishOutput ();
664 }
665 
666 //-----------------------------------------------------------------------------
667 // Function : DeviceInterface:: dotOpOutput
668 // Purpose :
669 // Special Notes :
670 // Scope : public
671 // Creator : Eric R. Keiter, SNL
672 // Creation Date : 5/3/12
673 //-----------------------------------------------------------------------------
675 {
676  return devMgrPtr_->dotOpOutput ();
677 }
678 
679 //-----------------------------------------------------------------------------
680 // Function : DeviceInterface::setGlobalFlags
681 // Purpose :
682 // Special Notes :
683 // Scope : public
684 // Creator : Eric R. Keiter, SNL
685 // Creation Date : 11/2/12
686 //-----------------------------------------------------------------------------
688 {
689  return devMgrPtr_->setGlobalFlags ();
690 }
691 
692 //-----------------------------------------------------------------------------
693 // Function : DeviceInterface::getBreakPoints
694 // Purpose :
695 // Special Notes :
696 // Scope : public
697 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
698 // Creation Date : 03/05/02
699 //-----------------------------------------------------------------------------
700 bool DeviceInterface::getBreakPoints ( std::vector<N_UTL_BreakPoint> & breakPointTimes )
701 {
702 
703  return devMgrPtr_->getBreakPoints (breakPointTimes);
704 }
705 
706 //-----------------------------------------------------------------------------
707 // Function : DeviceInterface::getMaxTimeStepSize
708 // Purpose :
709 // Special Notes :
710 // Scope : public
711 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
712 // Creation Date : 03/05/02
713 //-----------------------------------------------------------------------------
715 {
716  return devMgrPtr_->getMaxTimeStepSize ();
717 }
718 
719 
720 //-----------------------------------------------------------------------------
721 // Function : DeviceInterface::registerOptions
722 // Purpose :
723 // Special Notes :
724 // Scope : public
725 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
726 // Creation Date : 03/05/02
727 //-----------------------------------------------------------------------------
728 bool DeviceInterface::registerOptions(const Util::OptionBlock & OB)
729 
730 {
731  return devMgrPtr_->registerOptions(OB);
732 }
733 
734 //-----------------------------------------------------------------------------
735 // Function : DeviceInterface::registerSensParams
736 // Purpose :
737 // Special Notes :
738 // Scope : public
739 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
740 // Creation Date : 06/03/02
741 //-----------------------------------------------------------------------------
742 bool DeviceInterface::registerSensParams (const Util::OptionBlock & OB)
743 
744 {
745  return devMgrPtr_->registerSensParams (OB);
746 }
747 
748 //-----------------------------------------------------------------------------
749 // Function : DeviceInterface::registerICLoads
750 // Purpose :
751 // Special Notes :
752 // Scope : public
753 // Creator : Eric R. Keiter, SNL, Computational Sciences
754 // Creation Date : 03/05/02
755 //-----------------------------------------------------------------------------
756 bool DeviceInterface::registerICLoads( std::vector< std::pair<int,double> > * icLoads )
757 {
758  return devMgrPtr_->registerICLoads(icLoads);
759 }
760 
761 //-----------------------------------------------------------------------------
762 // Function : DeviceInterface::enablePDEContinuation
763 // Purpose :
764 // Special Notes :
765 // Scope : public
766 // Creator : Eric R. Keiter, SNL, Computational Sciences
767 // Creation Date : 10/22/02
768 //-----------------------------------------------------------------------------
770 {
772 }
773 
774 //-----------------------------------------------------------------------------
775 // Function : DeviceInterface::disablePDEContinuation
776 // Purpose :
777 // Special Notes :
778 // Scope : public
779 // Creator : Eric R. Keiter, SNL, Computational Sciences
780 // Creation Date : 10/22/02
781 //-----------------------------------------------------------------------------
783 {
785 }
786 
787 //-----------------------------------------------------------------------------
788 // Function : DeviceInterface::getNumInterfaceNodes
789 // Purpose :
790 // Special Notes :
791 // Scope : public
792 // Creator : Eric R. Keiter, SNL, Computational Sciences
793 // Creation Date : 12/03/02
794 //-----------------------------------------------------------------------------
795 void DeviceInterface::getNumInterfaceNodes (std::vector<int> & numINodes)
796 {
797  devMgrPtr_->getNumInterfaceNodes (numINodes);
798 }
799 
800 //-----------------------------------------------------------------------------
801 // Function : DeviceInterface::loadCouplingRHS
802 // Purpose :
803 // Special Notes :
804 // Scope : public
805 // Creator : Eric R. Keiter, SNL, Computational Sciences
806 // Creation Date : 12/03/02
807 //-----------------------------------------------------------------------------
808 bool DeviceInterface::loadCouplingRHS (int iPDEDevice, int iElectrode, N_LAS_Vector * dfdvPtr)
809 {
810  return devMgrPtr_->loadCouplingRHS (iPDEDevice, iElectrode,dfdvPtr);
811 }
812 
813 //-----------------------------------------------------------------------------
814 // Function : DeviceInterface::calcCouplingTerms
815 // Purpose :
816 // Special Notes :
817 // Scope : public
818 // Creator : Eric R. Keiter, SNL, Computational Sciences
819 // Creation Date : 12/03/02
820 //-----------------------------------------------------------------------------
821 bool DeviceInterface::calcCouplingTerms (int iSubProblem, int iElectrode, const N_LAS_Vector * dxdvPtr)
822 {
823  return devMgrPtr_->calcCouplingTerms (iSubProblem, iElectrode, dxdvPtr);
824 }
825 
826 //-----------------------------------------------------------------------------
827 // Function : DeviceInterface::raiseDebugLevel
828 // Purpose :
829 // Special Notes :
830 // Scope : public
831 // Creator : Eric R. Keiter, SNL, Computational Sciences
832 // Creation Date : 04/23/03
833 //-----------------------------------------------------------------------------
835 {
836  return devMgrPtr_->raiseDebugLevel(increment);
837 }
838 
839 //-----------------------------------------------------------------------------
840 // Function : DeviceInterface::loadDAEMatrices
841 // Purpose :
842 // Special Notes :
843 // Scope : public
844 // Creator : Eric R. Keiter, SNL, Computational Sciences
845 // Creation Date : 03/03/04
846 //-----------------------------------------------------------------------------
848  N_LAS_Vector * tmpSolVectorPtr,
849  N_LAS_Vector * tmpStaVectorPtr,
850  N_LAS_Vector * tmpStaDerivVectorPtr,
851  N_LAS_Vector * tmpStoVectorPtr,
852  N_LAS_Matrix * tmpdQdxMatrixPtr,
853  N_LAS_Matrix * tmpdFdxMatrixPtr)
854 {
855  return devMgrPtr_->loadDAEMatrices (
856  tmpSolVectorPtr,
857  tmpStaVectorPtr,
858  tmpStaDerivVectorPtr,
859  tmpStoVectorPtr,
860  tmpdQdxMatrixPtr,
861  tmpdFdxMatrixPtr);
862 }
863 
864 //-----------------------------------------------------------------------------
865 // Function : DeviceInterface::loadDAEVectors
866 // Purpose :
867 // Special Notes :
868 // Scope : public
869 // Creator : Eric R. Keiter, SNL, Computational Sciences
870 // Creation Date : 02/20/03
871 //-----------------------------------------------------------------------------
873  N_LAS_Vector * tmpSolVectorPtr,
874  N_LAS_Vector * tmpCurrSolVectorPtr,
875  N_LAS_Vector * tmpLastSolVectorPtr,
876  N_LAS_Vector * tmpStaVectorPtr,
877  N_LAS_Vector * tmpCurrStaVectorPtr,
878  N_LAS_Vector * tmpLastStaVectorPtr,
879  N_LAS_Vector * tmpStaDerivVectorPtr,
880  N_LAS_Vector * tmpStoVectorPtr,
881  N_LAS_Vector * tmpCurrStoVectorPtr,
882  N_LAS_Vector * tmpLastStoVectorPtr,
883  N_LAS_Vector * tmpStoLeadCurrQCompVectorPtr,
884  N_LAS_Vector * tmpQVectorPtr,
885  N_LAS_Vector * tmpFVectorPtr,
886  N_LAS_Vector * tmpdFdxdVpVectorPtr,
887  N_LAS_Vector * tmpdQdxdVpVectorPtr)
888 
889 {
890  return devMgrPtr_->loadDAEVectors ( tmpSolVectorPtr,
891  tmpCurrSolVectorPtr,
892  tmpLastSolVectorPtr,
893  tmpStaVectorPtr,
894  tmpCurrStaVectorPtr,
895  tmpLastStaVectorPtr,
896  tmpStaDerivVectorPtr,
897  tmpStoVectorPtr,
898  tmpCurrStoVectorPtr,
899  tmpLastStoVectorPtr,
900  tmpStoLeadCurrQCompVectorPtr,
901  tmpQVectorPtr,
902  tmpFVectorPtr,
903  tmpdFdxdVpVectorPtr,
904  tmpdQdxdVpVectorPtr );
905 }
906 
907 //-----------------------------------------------------------------------------
908 // Function : DeviceInterface::updateState
909 // Purpose :
910 // Special Notes :
911 // Scope : public
912 // Creator : Eric R. Keiter, SNL, Computational Sciences
913 // Creation Date : 11/17/05
914 //-----------------------------------------------------------------------------
916  N_LAS_Vector * nextSolVectorPtr,
917  N_LAS_Vector * currSolVectorPtr,
918  N_LAS_Vector * lastSolVectorPtr,
919  N_LAS_Vector * nextStaVectorPtr,
920  N_LAS_Vector * currStaVectorPtr,
921  N_LAS_Vector * lastStaVectorPtr,
922  N_LAS_Vector * nextStoVectorPtr,
923  N_LAS_Vector * currStoVectorPtr,
924  N_LAS_Vector * lastStoVectorPtr
925  )
926 {
927  return devMgrPtr_->updateState (
928  nextSolVectorPtr, currSolVectorPtr, lastSolVectorPtr,
929  nextStaVectorPtr, currStaVectorPtr, lastStaVectorPtr,
930  nextStoVectorPtr, currStoVectorPtr, lastStoVectorPtr
931  );
932 }
933 
934 //-----------------------------------------------------------------------------
935 // Function : DeviceInterface::setVoltageLimiterFlag
936 // Purpose :
937 // Special Notes :
938 // Scope : public
939 // Creator : Eric R. Keiter, SNL, Computational Sciences
940 // Creation Date : 04/20/04
941 //-----------------------------------------------------------------------------
942 /*void DeviceInterface::setVoltageLimiterFlag ()
943 {
944  devMgrPtr_->setVoltageLimiterFlag ();
945 }*/
946 
947 //-----------------------------------------------------------------------------
948 // Function : DeviceInterface::unsetVoltageLimiterFlag
949 // Purpose :
950 // Special Notes :
951 // Scope : public
952 // Creator : Eric R. Keiter, SNL, Computational Sciences
953 // Creation Date : 04/20/04
954 //-----------------------------------------------------------------------------
956 {
958 }
959 void setVoltageLimiterFlag (bool flagVal);
960 
961 
962 //-----------------------------------------------------------------------------
963 // Function : DeviceInterface::setVoltageLimiterFlag
964 // Purpose :
965 // Special Notes :
966 // Scope : public
967 // Creator : Ting Mei, SNL
968 // Creation Date : 02/18/14
969 //-----------------------------------------------------------------------------
971 {
972  devMgrPtr_->setVoltageLimiterFlag ( flagVal );
973 }
974 
975 
976 //-----------------------------------------------------------------------------
977 // Function : DeviceInterface::loadBVectorsforAC
978 // Purpose :
979 // Special Notes :
980 // Scope : public
981 // Creator : Ting Mei, SNL
982 // Creation Date :
983 //-----------------------------------------------------------------------------
984 bool DeviceInterface::loadBVectorsforAC (N_LAS_Vector * bVecRealPtr,
985  N_LAS_Vector * bVecImagPtr)
986 {
987  return devMgrPtr_->loadBVectorsforAC (bVecRealPtr, bVecImagPtr);
988 }
989 
990 bool DeviceInterface::getBMatrixEntriesforMOR(std::vector<int>& bMatEntriesVec,
991  std::vector<int>& bMatPosEntriesVec)
992 {
993  return devMgrPtr_->getBMatrixEntriesforMOR( bMatEntriesVec, bMatPosEntriesVec );
994 }
995 
996 //-----------------------------------------------------------------------------
997 // Function : DeviceInterface::getDACDeviceNames
998 // Purpose : Get a list of names of all DACs in the circuit
999 // Special Notes :
1000 // Scope : public
1001 // Creator : Tom Russo, SNL, Component Information and MOdels
1002 // Creation Date : 05/05/04
1003 //-----------------------------------------------------------------------------
1004 bool DeviceInterface::getDACDeviceNames(std::vector< std::string > & dacNames)
1005 {
1006  return devMgrPtr_->getDACDeviceNames(dacNames);
1007 }
1008 
1009 //-----------------------------------------------------------------------------
1010 // Function : DeviceInterface::getADCMap
1011 // Purpose : Get instance params for all ADCs in the circuit
1012 // Special Notes :
1013 // Scope : public
1014 // Creator : Tom Russo, SNL, Component Information and MOdels
1015 // Creation Date : 05/05/04
1016 //-----------------------------------------------------------------------------
1017 bool DeviceInterface::getADCMap(std::map<std::string,std::map<std::string,double> >&ADCMap)
1018 {
1019  return devMgrPtr_->getADCMap(ADCMap);
1020 }
1021 
1022 //----------------------------------------------------------------------------
1023 // Function : updateTimeVoltagePairs
1024 // Purpose : Update the DAC devices in a circuit by adding the set
1025 // of time and voltage pairs built up on the "digital side"
1026 // since the last update and by removing the time-voltage
1027 // pairs for times that pre-date the given simulation time.
1028 // Special Notes : The current method for locating DAC instances
1029 // works for the serial case only. The parallel
1030 // case will be added in later modifications.
1031 // Function moved from N_CIR_Xyce class by TVR, 05/07/2004
1032 // Scope :
1033 // Creator : Tom Russo
1034 // Creation Date : 05/07/2004
1035 //----------------------------------------------------------------------------
1037  std::map< std::string, std::vector< std::pair<double,double> >* > const & timeVoltageUpdateMap)
1038 {
1039  return devMgrPtr_->updateTimeVoltagePairs(timeVoltageUpdateMap);
1040 }
1041 
1042 //----------------------------------------------------------------------------
1043 // Function : DeviceInterface::setADCWidths
1044 // Purpose : Set the widths of every ADC instance given a map of names
1045 // and widths
1046 // Special Notes :
1047 // Scope : public
1048 // Creator : Tom Russo, SNL, Component Information and Models
1049 // Creation Date : 07/29/2002
1050 //----------------------------------------------------------------------------
1051 bool DeviceInterface::setADCWidths(std::map<std::string,int> const & ADCWidthMap)
1052 {
1053  return devMgrPtr_->setADCWidths(ADCWidthMap);
1054 }
1055 
1056 //-----------------------------------------------------------------------------
1057 // Function : DeviceInterface::getTimeVoltagePairs
1058 // Purpose : Get time/voltage pairs from all ADCs in the circuit
1059 // Special Notes :
1060 // Scope : public
1061 // Creator : Tom Russo, SNL, Component Information and MOdels
1062 // Creation Date : 05/05/04
1063 //-----------------------------------------------------------------------------
1065  std::map<std::string, std::vector< std::pair<double,double> > >&TimeVoltageMap)
1066 {
1067  return devMgrPtr_->getTimeVoltagePairs(TimeVoltageMap);
1068 }
1069 
1070 //-----------------------------------------------------------------------------
1071 // Function : DeviceInterface::getDeviceNames
1072 // Purpose : Get a list of names of all devices of given type in the
1073 // circuit
1074 // Special Notes : "deviceType" is std::string of the form that an actual
1075 // device in the netlist would have, e.g. "R1" for a resistor
1076 // or "Y%XYGRA%DUMMY" for a Xygra device.
1077 // Scope : public
1078 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
1079 // Creation Date : 08/25/08
1080 //-----------------------------------------------------------------------------
1081 bool DeviceInterface::getDeviceNames(const std::string & deviceType,
1082  std::vector< std::string > & deviceNames)
1083 {
1084  return devMgrPtr_->getDeviceNames(deviceType, deviceNames);
1085 }
1086 
1087 //-----------------------------------------------------------------------------
1088 // Function : DeviceInterface::xygraGetNumNodes
1089 // Purpose : Returns the number of nodes that a given Xygra instance
1090 // has, given the name of that instance in the netlist.
1091 // Special Notes :
1092 // Scope : public
1093 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
1094 // Creation Date : 08/27/08
1095 //-----------------------------------------------------------------------------
1096 int DeviceInterface::xygraGetNumNodes(const std::string & deviceName)
1097 {
1098  return devMgrPtr_->xygraGetNumNodes(deviceName);
1099 }
1100 
1101 //-----------------------------------------------------------------------------
1102 // Function : DeviceInterface::xygraGetNumWindings
1103 // Purpose : Returns the number of windings that a given Xygra instance
1104 // has, given the name of that instance in the netlist.
1105 // Special Notes :
1106 // Scope : public
1107 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
1108 // Creation Date : 08/27/08
1109 //-----------------------------------------------------------------------------
1110 int DeviceInterface::xygraGetNumWindings(const std::string & deviceName)
1111 {
1112  return devMgrPtr_->xygraGetNumWindings(deviceName);
1113 }
1114 
1115 //-----------------------------------------------------------------------------
1116 // Function : DeviceInterface::xygraGetCoilWindings
1117 // Purpose : Returns the number of windings that a given Xygra instance
1118 // has in each coil, given the name of that instance in the
1119 // netlist.
1120 // Special Notes :
1121 // Scope : public
1122 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
1123 // Creation Date : 08/27/08
1124 //-----------------------------------------------------------------------------
1125 void DeviceInterface::xygraGetCoilWindings(const std::string & deviceName,
1126  std::vector<int> & cW)
1127 {
1128  devMgrPtr_->xygraGetCoilWindings(deviceName,cW);
1129 }
1130 
1131 //-----------------------------------------------------------------------------
1132 // Function : DeviceInterface::xygraGetCoilNames
1133 // Purpose : Returns the names of each coil in a given Xygra instance
1134 // given the name of that instance in the netlist.
1135 // Special Notes :
1136 // Scope : public
1137 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
1138 // Creation Date : 09/29/08
1139 //-----------------------------------------------------------------------------
1140 void DeviceInterface::xygraGetCoilNames(const std::string & deviceName,
1141  std::vector<std::string> & cN)
1142 {
1143  devMgrPtr_->xygraGetCoilNames(deviceName,cN);
1144 }
1145 
1146 //-----------------------------------------------------------------------------
1147 // Function : DeviceInterface::xygraSetConductances
1148 // Purpose : sets the conductance matrix on the given Xygra device
1149 // Special Notes :
1150 // Scope : public
1151 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
1152 // Creation Date : 08/27/08
1153 //-----------------------------------------------------------------------------
1154 bool DeviceInterface::xygraSetConductances(const std::string & deviceName,
1155  const std::vector<std::vector<double> > &cM)
1156 {
1157  return devMgrPtr_->xygraSetConductances(deviceName, cM);
1158 }
1159 
1160 //-----------------------------------------------------------------------------
1161 // Function : DeviceInterface::xygraSetK
1162 // Purpose : sets the K matrix on the given Xygra device
1163 // Special Notes :
1164 // Scope : public
1165 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
1166 // Creation Date : 08/27/08
1167 //-----------------------------------------------------------------------------
1168 bool DeviceInterface::xygraSetK(const std::string & deviceName,
1169  const std::vector<std::vector<double> > &kM,
1170  const double t)
1171 {
1172  return devMgrPtr_->xygraSetK(deviceName, kM,t);
1173 }
1174 
1175 //-----------------------------------------------------------------------------
1176 // Function : DeviceInterface::xygraSetSources
1177 // Purpose : sets the S vector on the given Xygra device
1178 // Special Notes :
1179 // Scope : public
1180 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
1181 // Creation Date : 08/27/08
1182 //-----------------------------------------------------------------------------
1183 bool DeviceInterface::xygraSetSources(const std::string & deviceName,
1184  const std::vector<double> &sV,
1185  const double t)
1186 {
1187  return devMgrPtr_->xygraSetSources(deviceName, sV, t);
1188 }
1189 
1190 //-----------------------------------------------------------------------------
1191 // Function : DeviceInterface::xygraGetVoltages
1192 // Purpose : retrieve nodal voltages from the given Xygra device
1193 // Special Notes :
1194 // Scope : public
1195 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
1196 // Creation Date : 08/27/08
1197 //-----------------------------------------------------------------------------
1198 bool DeviceInterface::xygraGetVoltages(const std::string & deviceName,
1199  std::vector<double> &vN)
1200 {
1201  return devMgrPtr_->xygraGetVoltages(deviceName, vN);
1202 }
1203 
1204 //-----------------------------------------------------------------------------
1205 // Function : DeviceInterface::getHomotopyBlockSize
1206 // Purpose : Returns the block size for block gainscale continuation.
1207 // Special Notes : This call is virtual and should be overridden by
1208 // the DeviceMgr
1209 // Scope : public
1210 // Creator : Roger Pawlowski, SNL, Computational Sciences
1211 // Creation Date : 01/26/2005
1212 //----------------------------------------------------------------------------
1214 {
1215  return devMgrPtr_->getHomotopyBlockSize();
1216 }
1217 
1218 //-----------------------------------------------------------------------------
1219 // Function : DeviceInterface::addGlobalPar
1220 // Purpose : Add global parameter
1221 // Special Notes :
1222 // Scope : public
1223 // Creator : Dave Shirley, PSSI
1224 // Creation Date : 11/18/2005
1225 //----------------------------------------------------------------------------
1226 void DeviceInterface::addGlobalPar(Util::Param & par)
1227 {
1228  devMgrPtr_->addGlobalPar(par);
1229 }
1230 
1231 
1232 //-----------------------------------------------------------------------------
1233 // Function : DeviceInterface::getGlobalPar
1234 // Purpose : get the value of a global parameter
1235 // Special Notes :
1236 // Scope : public
1237 // Creator : Rich Schiek, SNL, Electrical Systems Modeling
1238 // Creation Date : 01/25/2013
1239 //----------------------------------------------------------------------------
1240 double DeviceInterface::getGlobalPar( const std::string & parName ) const
1241 {
1242  return devMgrPtr_->getGlobalPar( parName );
1243 }
1244 
1245 const double *DeviceInterface::findGlobalPar(const std::string & parName) const
1246 {
1247  return devMgrPtr_->findGlobalPar(parName);
1248 }
1249 
1250 //-----------------------------------------------------------------------------
1251 // Function : DeviceMgr::allDevsConverged
1252 // Purpose : Check whether any device has taken an action that renders
1253 // normal convergence checks invalid (i.e. that the current
1254 // step must be assumed unconverged).
1255 // Special Notes :
1256 // Scope : public
1257 // Creator : Tom Russo, SNL, Component Information and Models
1258 // Creation Date : 03/22/05
1259 //-----------------------------------------------------------------------------
1261 {
1262  return devMgrPtr_->allDevsConverged();
1263 }
1264 
1265 //-----------------------------------------------------------------------------
1266 // Function : DeviceMgr::innerDevsConverged
1267 // Purpose :
1268 // Special Notes :
1269 // Scope : public
1270 // Creator : Eric Keiter, SNL
1271 // Creation Date : 03/22/06
1272 //-----------------------------------------------------------------------------
1274 {
1275  return devMgrPtr_->innerDevsConverged();
1276 }
1277 
1278 #ifdef Xyce_EXTDEV
1279 //-----------------------------------------------------------------------------
1280 // Function : DeviceMgr::setupExternalDevices
1281 // Purpose : Setup external devices, especially critical for parallel
1282 // Special Notes : needed for 2-level.
1283 // Scope : public
1284 // Creator : Robert Hoekstra, Elec. & MicroSystems Engring
1285 // Creation Date : 03/11/06
1286 //-----------------------------------------------------------------------------
1287 void DeviceInterface::setupExternalDevices()
1288 {
1289  devMgrPtr_->setupExternalDevices();
1290 }
1291 #endif
1292 
1293 //-----------------------------------------------------------------------------
1294 // Function : DeviceInterface::homotopyStepSuccess
1295 // Purpose :
1296 // Special Notes : needed for 2-level.
1297 // Scope : public
1298 // Creator : Eric R. Keiter, SNL
1299 // Creation Date : 03/20/06
1300 //-----------------------------------------------------------------------------
1302  (const std::vector<std::string> & paramNames,
1303  const std::vector<double> & paramVals)
1304 {
1305  return devMgrPtr_->homotopyStepSuccess (paramNames, paramVals);
1306 }
1307 
1308 //-----------------------------------------------------------------------------
1309 // Function : DeviceInterface::homotopyStepFailure
1310 // Purpose :
1311 // Special Notes : needed for 2-level.
1312 // Scope : public
1313 // Creator : Eric R. Keiter, SNL
1314 // Creation Date : 03/30/06
1315 //-----------------------------------------------------------------------------
1317 {
1318  return devMgrPtr_->homotopyStepFailure ();
1319 }
1320 
1321 //-----------------------------------------------------------------------------
1322 // Function : DeviceInterface::stepSuccess
1323 // Purpose :
1324 // Special Notes : needed for 2-level.
1325 // Scope : public
1326 // Creator : Eric R. Keiter, SNL
1327 // Creation Date : 03/12/06
1328 //-----------------------------------------------------------------------------
1329 void DeviceInterface::stepSuccess (int analysis)
1330 {
1331  return devMgrPtr_->stepSuccess (analysis);
1332 }
1333 
1334 //-----------------------------------------------------------------------------
1335 // Function : DeviceInterface::stepFailure
1336 // Purpose :
1337 // Special Notes : needed for 2-level.
1338 // Scope : public
1339 // Creator : Eric R. Keiter, SNL
1340 // Creation Date : 03/12/06
1341 //-----------------------------------------------------------------------------
1342 void DeviceInterface::stepFailure (int analysis)
1343 {
1344  return devMgrPtr_->stepFailure (analysis);
1345 }
1346 
1347 //-----------------------------------------------------------------------------
1348 // Function : DeviceInterface::acceptStep
1349 // Purpose :
1350 // Special Notes :
1351 // Scope : public
1352 // Creator : Tom Russo, SNL
1353 // Creation Date : 01/23/07
1354 //-----------------------------------------------------------------------------
1356 {
1357  devMgrPtr_->acceptStep ();
1358 }
1359 
1360 //-----------------------------------------------------------------------------
1361 // Function : DeviceInterface::getInitialQnorm
1362 // Purpose :
1363 // Special Notes : needed for 2-level.
1364 // Scope : public
1365 // Creator : Eric R. Keiter, SNL
1366 // Creation Date : 03/18/07
1367 //-----------------------------------------------------------------------------
1368 bool DeviceInterface::getInitialQnorm (std::vector<N_TIA_TwoLevelError> & tleVec )
1369 {
1370  return devMgrPtr_->getInitialQnorm (tleVec);
1371 }
1372 
1373 //-----------------------------------------------------------------------------
1374 // Function : DeviceInterface::getInnerLoopErrorSums
1375 // Purpose :
1376 // Special Notes : needed for 2-level.
1377 // Scope : public
1378 // Creator : Eric R. Keiter, SNL
1379 // Creation Date : 03/15/06
1380 //-----------------------------------------------------------------------------
1381 bool DeviceInterface::getInnerLoopErrorSums (std::vector<N_TIA_TwoLevelError> & tleVec)
1382 {
1383  return devMgrPtr_->getInnerLoopErrorSums (tleVec);
1384 }
1385 
1386 //-----------------------------------------------------------------------------
1387 // Function : DeviceInterface::updateStateArrays()
1388 // Purpose :
1389 // Special Notes : needed for 2-level.
1390 // Scope : public
1391 // Creator : Eric R. Keiter, SNL
1392 // Creation Date : 03/15/06
1393 //-----------------------------------------------------------------------------
1395 {
1396  return devMgrPtr_->updateStateArrays();
1397 }
1398 
1399 //-----------------------------------------------------------------------------
1400 // Function : DeviceInterface::startTimeStep
1401 // Purpose :
1402 // Special Notes : needed for 2-level.
1403 // Scope : public
1404 // Creator : Eric R. Keiter, SNL
1405 // Creation Date : 03/20/06
1406 //-----------------------------------------------------------------------------
1408 {
1409  return devMgrPtr_->startTimeStep ();
1410 }
1411 
1412 
1413 //-----------------------------------------------------------------------------
1414 // Function : DeviceInterface::setExternalSolverState
1415 // Purpose :
1416 // Special Notes : needed for 2-level.
1417 // Scope : public
1418 // Creator : Eric R. Keiter, SNL
1419 // Creation Date : 03/20/06
1420 //-----------------------------------------------------------------------------
1422 {
1424 }
1425 
1426 //-----------------------------------------------------------------------------
1427 // Function : DeviceInterface::updateSolverState
1428 // Purpose :
1429 // Special Notes : needed for mixed signal
1430 // Scope : public
1431 // Creator : Eric R. Keiter, SNL
1432 // Creation Date : 05/22/09
1433 //-----------------------------------------------------------------------------
1435 {
1436  bool tmp = devMgrPtr_->setupSolverInfo();
1437 }
1438 
1439 //-----------------------------------------------------------------------------
1440 // Function : DeviceInterface::restartDataSize
1441 // Purpose :
1442 // Special Notes :
1443 // Scope : public
1444 // Creator : Eric R. Keiter, SNL
1445 // Creation Date : 06/26/2013
1446 //-----------------------------------------------------------------------------
1448 {
1449  return devMgrPtr_->restartDataSize(pack );
1450 }
1451 
1452 //-----------------------------------------------------------------------------
1453 // Function : DeviceInterface::dumpRestartData
1454 // Purpose : Output restart data.
1455 // Special Notes :
1456 // Scope : public
1457 // Creator : Eric R. Keiter, SNL
1458 // Creation Date : 06/26/2013
1459 //-----------------------------------------------------------------------------
1461 (char * buf, int bsize, int & pos, N_PDS_Comm * comm, bool pack )
1462 {
1463  return devMgrPtr_->dumpRestartData(buf, bsize, pos, comm, pack );
1464 }
1465 
1466 //-----------------------------------------------------------------------------
1467 // Function : DeviceInterface::restoreRestartData
1468 // Purpose : Load restart data.
1469 // Special Notes :
1470 // Scope : public
1471 // Creator : Eric R. Keiter, SNL
1472 // Creation Date : 06/26/2013
1473 //-----------------------------------------------------------------------------
1475 (char * buf, int bsize, int & pos, N_PDS_Comm * comm, bool pack )
1476 {
1477  return devMgrPtr_->restoreRestartData(buf, bsize, pos, comm, pack);
1478 }
1479 
1480 } // namespace Device
1481 } // namespace Xyce