Xyce  6.1
N_TIA_DataStore.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2015 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-----------------------------------------------------------------------------
26 // Filename : $RCSfile: N_TIA_DataStore.C,v $
27 //
28 // Purpose : This file creates & initializes the data arrays needed for
29 // the time integration algorithms.
30 //
31 // Special Notes :
32 //
33 // Creator : Buddy Watts
34 //
35 // Creation Date : 6/1/00
36 //
37 // Revision Information:
38 // ---------------------
39 //
40 // Revision Number: $Revision: 1.188 $
41 //
42 // Revision Date : $Date: 2015/09/03 22:11:40 $
43 //
44 // Current Owner : $Author: rlschie $
45 //-----------------------------------------------------------------------------
46 
47 #include <Xyce_config.h>
48 
49 // ---------- Standard Includes ----------
50 #include <iostream>
51 
52 #include <N_TIA_DataStore.h>
53 
54 #include <N_LAS_Builder.h>
55 #include <N_LAS_Matrix.h>
56 #include <N_LAS_MultiVector.h>
57 #include <N_LAS_System.h>
58 #include <N_LAS_Vector.h>
59 #include <N_TIA_TIAParams.h>
60 #include <N_UTL_fwd.h>
61 #include <N_UTL_DeleteList.h>
62 #include <N_UTL_Diagnostic.h>
63 #include <N_UTL_FeatureTest.h>
64 #include <N_UTL_MachDepParams.h>
65 
66 namespace Xyce {
67 namespace TimeIntg {
68 
69 //-----------------------------------------------------------------------------
70 // Function : DataStore::DataStore
71 // Purpose : constructor
72 // Special Notes :
73 // Scope : public
74 // Creator : Buddy Watts, SNL
75 // Creation Date : 6/01/00
76 //-----------------------------------------------------------------------------
78  int solution_size,
79  int state_size,
80  int max_order,
81  const Linear::System & linear_system,
82  const Linear::Builder & linear_system_builder)
83  : linearSystem_(linear_system),
84  nextSolPtrSwitched_(false),
85  limiterFlag(false),
86  maxOrder(max_order),
87  solutionSize(solution_size),
88  stateSize(state_size),
89  tmpSolVectorPtr(0),
90  tmpStaVectorPtr(0),
91  tmpStaDerivPtr(0),
92  tmpStaDivDiffPtr(0),
93  tmpStoVectorPtr(0),
94  tmpLeadCurrentVectorPtr(0),
95  tmpLeadDeltaVPtr(0),
96  tmpLeadCurrentQVectorPtr(0),
97  tmpLeadCurrentQDerivVectorPtr(0),
98  xn0Ptr (0),
99  currSolutionPtr(0),
100  lastSolutionPtr(0),
101  oldeSolutionPtr(0),
102  nextSolutionPtr(0),
103  flagSolutionPtr(0),
104  savedNextSolutionPtr(0),
105  currStatePtr(0),
106  lastStatePtr(0),
107  oldeStatePtr(0),
108  nextStatePtr(0),
109  currStorePtr(0),
110  lastStorePtr(0),
111  oldeStorePtr(0),
112  nextStorePtr(0),
113  currStoreLeadCurrQPtr(0),
114  lastStoreLeadCurrQPtr(0),
115  oldeStoreLeadCurrQPtr(0),
116  nextStoreLeadCurrQPtr(0),
117  currStoreLeadCurrQDerivPtr(0),
118  lastStoreLeadCurrQDerivPtr(0),
119  oldeStoreLeadCurrQDerivPtr(0),
120  nextStoreLeadCurrQDerivPtr(0),
121  currLeadCurrentPtr(0),
122  lastLeadCurrentPtr(0),
123  oldLeadCurrentPtr(0),
124  nextLeadCurrentPtr(0),
125  currLeadDeltaVPtr(0),
126  lastLeadDeltaVPtr(0),
127  oldLeadDeltaVPtr(0),
128  nextLeadDeltaVPtr(0),
129  currLeadCurrentQPtr(0),
130  lastLeadCurrentQPtr(0),
131  oldLeadCurrentQPtr(0),
132  nextLeadCurrentQPtr(0),
133  currLeadCurrentQDerivPtr(0),
134  lastLeadCurrentQDerivPtr(0),
135  oldLeadCurrentQDerivPtr(0),
136  nextLeadCurrentQDerivPtr(0),
137  currSolutionDerivPtr(0),
138  lastSolutionDerivPtr(0),
139  oldeSolutionDerivPtr(0),
140  nextSolutionDerivPtr(0),
141  currStateDerivPtr(0),
142  lastStateDerivPtr(0),
143  oldeStateDerivPtr(0),
144  nextStateDerivPtr(0),
145  resMatVecPtr(0),
146  currSolutionDivDiffPtr(0),
147  lastSolutionDivDiffPtr(0),
148  oldeSolutionDivDiffPtr(0),
149  nextSolutionDivDiffPtr(0),
150  currStateDivDiffPtr(0),
151  lastStateDivDiffPtr(0),
152  oldeStateDivDiffPtr(0),
153  nextStateDivDiffPtr(0),
154  errWtVecPtr(0),
155  absErrTolPtr(0),
156  relErrTolPtr(0),
157  JMatrixPtr(0),
158  RHSVectorPtr(0),
159  JdxpVectorPtr(0),
160  newtonCorrectionPtr(0),
161  deviceErrorWeightMask_(0),
162  qErrWtVecPtr(0),
163  daeQVectorPtr(0),
164  daeFVectorPtr(0),
165  daeBVectorPtr(0),
166  dQdxMatrixPtr(0),
167  dFdxMatrixPtr(0),
168  //saved_dQdxMatrixPtr(0),
169  dQdxVecVectorPtr(0),
170  dFdxVecVectorPtr(0),
171  dFdxdVpVectorPtr(0),
172  dQdxdVpVectorPtr(0),
173  qn0Ptr(0),
174  qpn0Ptr(0),
175  sn0Ptr(0),
176  spn0Ptr(0),
177  ston0Ptr(0),
178  stopn0Ptr(0),
179  leadCurrentn0Ptr(0),
180  leadCurrentpn0Ptr(0),
181  leadCurrentQn0Ptr(0),
182  leadCurrentQpn0Ptr(0),
183  leadCurrentQDerivn0Ptr(0),
184  leadCurrentQDerivpn0Ptr(0),
185  leadDeltaVn0Ptr(0),
186  leadDeltaVpn0Ptr(0),
187  qNewtonCorrectionPtr(0),
188  sNewtonCorrectionPtr(0),
189  stoNewtonCorrectionPtr(0),
190  stoLeadCurrQNewtonCorrectionPtr(0),
191  leadCurrentNewtonCorrectionPtr(0),
192  leadCurrentQNewtonCorrectionPtr(0),
193  leadCurrentQDerivNewtonCorrectionPtr(0),
194  leadDeltaVNewtonCorrectionPtr(0),
195  delta_x(0),
196  delta_q(0),
197  tmpXn0APtr(0),
198  tmpXn0BPtr(0),
199 
200  solsMaxValue(0.0),
201  maxSolutionPtr(0),
202  relSolutionPtr(0),
203 
204  index(0),
205  allocateSensitivityArraysComplete(false)
206 {
207  // temporary vectors:
208  tmpSolVectorPtr = linear_system_builder.createVector();
209  tmpStaVectorPtr = linear_system_builder.createStateVector();
210  tmpStaDerivPtr = linear_system_builder.createStateVector();
211  tmpStaDivDiffPtr = linear_system_builder.createStateVector();
212  tmpStoVectorPtr = linear_system_builder.createStoreVector();
213  tmpLeadCurrentVectorPtr = linear_system_builder.createLeadCurrentVector();
214  tmpLeadDeltaVPtr = linear_system_builder.createLeadCurrentVector();
215  tmpLeadCurrentQVectorPtr = linear_system_builder.createLeadCurrentVector();
216  tmpLeadCurrentQDerivVectorPtr = linear_system_builder.createLeadCurrentVector();
217 
218  xn0Ptr = linear_system_builder.createVector();
219 
220  // solution vectors:
221  currSolutionPtr = linear_system_builder.createVector();
222  lastSolutionPtr = linear_system_builder.createVector();
223  nextSolutionPtr = linear_system_builder.createVector();
224  flagSolutionPtr = linear_system_builder.createVector();
225 
226  // state vectors:
227  currStatePtr = linear_system_builder.createStateVector();
228  lastStatePtr = linear_system_builder.createStateVector();
229  nextStatePtr = linear_system_builder.createStateVector();
230 
231  // store vectors:
232  currStorePtr = linear_system_builder.createStoreVector();
233  lastStorePtr = linear_system_builder.createStoreVector();
234  nextStorePtr = linear_system_builder.createStoreVector();
235  currStoreLeadCurrQPtr = linear_system_builder.createStoreVector();
236  lastStoreLeadCurrQPtr = linear_system_builder.createStoreVector();
237  nextStoreLeadCurrQPtr = linear_system_builder.createStoreVector();
238 
239  // lead current and delta V vectors (for power calc).
240  currLeadCurrentPtr= linear_system_builder.createLeadCurrentVector();
241  lastLeadCurrentPtr= linear_system_builder.createLeadCurrentVector();
242  //oldLeadCurrentPtr= linear_system_builder.createLeadCurrentVector();
243  nextLeadCurrentPtr= linear_system_builder.createLeadCurrentVector();
244  currLeadDeltaVPtr= linear_system_builder.createLeadCurrentVector();
245  lastLeadDeltaVPtr= linear_system_builder.createLeadCurrentVector();
246  //oldLeadDeltaVPtr= linear_system_builder.createLeadCurrentVector();
247  nextLeadDeltaVPtr= linear_system_builder.createLeadCurrentVector();
248  currLeadCurrentQPtr= linear_system_builder.createLeadCurrentVector();
249  lastLeadCurrentQPtr= linear_system_builder.createLeadCurrentVector();
250  //oldLeadCurrentQPtr= linear_system_builder.createLeadCurrentVector();
251  nextLeadCurrentQPtr= linear_system_builder.createLeadCurrentVector();
252  currLeadCurrentQDerivPtr= linear_system_builder.createLeadCurrentVector();
253  lastLeadCurrentQDerivPtr= linear_system_builder.createLeadCurrentVector();
254  //oldLeadCurrentQDerivPtr= linear_system_builder.createLeadCurrentVector();
255  nextLeadCurrentQDerivPtr= linear_system_builder.createLeadCurrentVector();
256 
257  // solution derivative vectors:
258  currSolutionDerivPtr = linear_system_builder.createVector();
259  lastSolutionDerivPtr = linear_system_builder.createVector();
260  nextSolutionDerivPtr = linear_system_builder.createVector();
261 
262  // state derivative vectors:
263  currStateDerivPtr = linear_system_builder.createStateVector();
264  lastStateDerivPtr = linear_system_builder.createStateVector();
265  nextStateDerivPtr = linear_system_builder.createStateVector();
266 
267  // store derivative vec for lead currents.
268  currStoreLeadCurrQDerivPtr = linear_system_builder.createStoreVector();
269  lastStoreLeadCurrQDerivPtr = linear_system_builder.createStoreVector();
270  nextStoreLeadCurrQDerivPtr = linear_system_builder.createStoreVector();
271 
272  // solution scaled divided differences:
273  currSolutionDivDiffPtr = linear_system_builder.createVector();
274  lastSolutionDivDiffPtr = linear_system_builder.createVector();
275  nextSolutionDivDiffPtr = linear_system_builder.createVector();
276 
277  // state scaled divided differences:
278  currStateDivDiffPtr = linear_system_builder.createStateVector();
279  lastStateDivDiffPtr = linear_system_builder.createStateVector();
280  nextStateDivDiffPtr = linear_system_builder.createStateVector();
281 
282  // error vectors:
283  errWtVecPtr = linear_system_builder.createVector();
284  absErrTolPtr = linear_system_builder.createVector();
285  relErrTolPtr = linear_system_builder.createVector();
286 
287  errWtVecPtr->putScalar(1.0);
288 
289  maxSolutionPtr = linear_system_builder.createVector();
290 
291  relSolutionPtr = linear_system_builder.createVector();
292 
293  // device mask pointer
294  deviceErrorWeightMask_ = linear_system_builder.createVector();
295  deviceErrorWeightMask_->putScalar(1.0);
296 
297  // nonlinear solution vectors:
298  newtonCorrectionPtr = linear_system_builder.createVector();
299 
300  // new-DAE stuff:
301  // Error Vectors
302  qErrWtVecPtr = linear_system_builder.createVector();
303 
304  // DAE formulation vectors
305  daeQVectorPtr = linear_system_builder.createVector();
306  daeFVectorPtr = linear_system_builder.createVector();
307  daeBVectorPtr = linear_system_builder.createVector();
308 
309  // DAE formulation matrices
310  dQdxMatrixPtr = linear_system_builder.createMatrix();
311  dFdxMatrixPtr = linear_system_builder.createMatrix();
312  //saved_dQdxMatrixPtr = linear_system_builder.createMatrix();
313 
314  dQdxVecVectorPtr = linear_system_builder.createVector();
315  dFdxVecVectorPtr = linear_system_builder.createVector();
316 
317  // History arrays
318  for (int i = 0; i < max_order + 1; ++i)
319  {
320  xHistory.push_back(linear_system_builder.createVector());
321  qHistory.push_back(linear_system_builder.createVector());
322  sHistory.push_back(linear_system_builder.createStateVector());
323  stoHistory.push_back(linear_system_builder.createStoreVector());
324  stoLeadCurrQHistory.push_back(linear_system_builder.createStoreVector());
325  leadCurrentHistory.push_back(linear_system_builder.createLeadCurrentVector());
326  leadCurrentQHistory.push_back(linear_system_builder.createLeadCurrentVector());
327  leadDeltaVHistory.push_back(linear_system_builder.createLeadCurrentVector());
328  leadCurrentQDerivHistory.push_back(linear_system_builder.createLeadCurrentVector());
329  }
330 
331  // Predictors
332  qn0Ptr = linear_system_builder.createVector();
333  qpn0Ptr = linear_system_builder.createVector();
334  sn0Ptr = linear_system_builder.createStateVector();
335  spn0Ptr = linear_system_builder.createStateVector();
336  ston0Ptr = linear_system_builder.createStoreVector();
337  stopn0Ptr = linear_system_builder.createStoreVector();
338  stoQn0Ptr = linear_system_builder.createStoreVector();
339  stoQpn0Ptr = linear_system_builder.createStoreVector();
340  leadCurrentn0Ptr = linear_system_builder.createLeadCurrentVector();
341  leadCurrentpn0Ptr = linear_system_builder.createLeadCurrentVector();
342  leadCurrentQn0Ptr = linear_system_builder.createLeadCurrentVector();
343  leadCurrentQpn0Ptr = linear_system_builder.createLeadCurrentVector();
344  leadCurrentQDerivn0Ptr = linear_system_builder.createLeadCurrentVector();
345  leadCurrentQDerivpn0Ptr = linear_system_builder.createLeadCurrentVector();
346  leadDeltaVn0Ptr = linear_system_builder.createLeadCurrentVector();
347  leadDeltaVpn0Ptr = linear_system_builder.createLeadCurrentVector();
348 
349  // Nonlinear solution vector:
350  qNewtonCorrectionPtr = linear_system_builder.createVector();
351  sNewtonCorrectionPtr = linear_system_builder.createStateVector();
352  stoNewtonCorrectionPtr = linear_system_builder.createStoreVector();
353  stoLeadCurrQNewtonCorrectionPtr = linear_system_builder.createStoreVector();
354  leadCurrentNewtonCorrectionPtr = linear_system_builder.createLeadCurrentVector();
355  leadCurrentQNewtonCorrectionPtr = linear_system_builder.createLeadCurrentVector();
356  leadCurrentQDerivNewtonCorrectionPtr = linear_system_builder.createLeadCurrentVector();
357  leadDeltaVNewtonCorrectionPtr = linear_system_builder.createLeadCurrentVector();
358 
359  // Step-size selection temporary vectors
360  delta_x = linear_system_builder.createVector();
361  delta_q = linear_system_builder.createVector();
362 
363  // Temporary vector for MPDE & WaMPDE interpolation
364  tmpXn0APtr = linear_system_builder.createVector();
365  tmpXn0BPtr = linear_system_builder.createVector();
366 }
367 
368 //-----------------------------------------------------------------------------
369 // Function : DataStore::DataStore
370 // Purpose : destructor
371 // Special Notes :
372 // Scope : public
373 // Creator : Buddy Watts, SNL
374 // Creation Date : 6/01/00
375 //-----------------------------------------------------------------------------
377 {
378  delete tmpSolVectorPtr;
379  delete tmpStaVectorPtr;
380  delete tmpStaDerivPtr;
381  delete tmpStaDivDiffPtr;
382  delete tmpStoVectorPtr;
384  delete tmpLeadDeltaVPtr;
387  delete xn0Ptr;
388 
389  delete currSolutionPtr;
390  delete lastSolutionPtr;
391 
392  delete nextSolutionPtr;
393  delete flagSolutionPtr;
394 
395  delete currStatePtr;
396  delete lastStatePtr;
397 
398  delete nextStatePtr;
399 
400  delete currStorePtr;
401  delete lastStorePtr;
402  delete nextStorePtr;
403 
404  // Note: These will go away when the lead currents are moved to their own vector
405  delete currStoreLeadCurrQPtr;
406  delete lastStoreLeadCurrQPtr;
407  delete nextStoreLeadCurrQPtr;
411 
412  // Lead current and power vectors
413  delete currLeadCurrentPtr;
414  delete lastLeadCurrentPtr;
415  //delete oldLeadCurrentPtr;
416  delete nextLeadCurrentPtr;
417  delete currLeadDeltaVPtr;
418  delete lastLeadDeltaVPtr;
419  //delete oldLeadDeltaVPtr;
420  delete nextLeadDeltaVPtr;
421 
422  // for lead current calculations. F component is
423  // held in the store vector, Q component is here
424  delete currLeadCurrentQPtr;
425  delete lastLeadCurrentQPtr;
426  //delete oldLeadCurrentQPtr;
427  delete nextLeadCurrentQPtr;
430  //delete oldLeadCurrentQDerivPtr;
432 
433  delete currSolutionDerivPtr;
434  delete lastSolutionDerivPtr;
435 
436  delete nextSolutionDerivPtr;
437 
438  delete currStateDerivPtr;
439  delete lastStateDerivPtr;
440 
441  delete nextStateDerivPtr;
442 
443  delete currSolutionDivDiffPtr;
444  delete lastSolutionDivDiffPtr;
445 
446  delete nextSolutionDivDiffPtr;
447 
448  delete currStateDivDiffPtr;
449  delete lastStateDivDiffPtr;
450 
451  delete nextStateDivDiffPtr;
452 
453 
454  delete relSolutionPtr;
455  delete maxSolutionPtr;
456 
457  delete errWtVecPtr;
458  delete absErrTolPtr;
459  delete relErrTolPtr;
460 
461  delete deviceErrorWeightMask_;
462 
463  delete newtonCorrectionPtr;
464 
465  //new-DAE:
466  // Error Vectors
467  delete qErrWtVecPtr;
468 
469  // DAE formulation vectors
470  delete daeQVectorPtr;
471  delete daeFVectorPtr;
472  delete daeBVectorPtr;
473 
474  // DAE formulation matrices
475  delete dQdxMatrixPtr;
476  delete dFdxMatrixPtr;
477  //delete saved_dQdxMatrixPtr;
478 
479  // HB temporary vectors
480  delete dQdxVecVectorPtr;
481  delete dFdxVecVectorPtr;
482 
483  Xyce::deleteList(xHistory.begin(), xHistory.end());
484  Xyce::deleteList(qHistory.begin(), qHistory.end());
485  Xyce::deleteList(sHistory.begin(), sHistory.end());
486  Xyce::deleteList(stoHistory.begin(), stoHistory.end());
487  Xyce::deleteList(stoLeadCurrQHistory.begin(), stoLeadCurrQHistory.end());
488  Xyce::deleteList(leadCurrentHistory.begin(), leadCurrentHistory.end());
489  Xyce::deleteList(leadCurrentQHistory.begin(), leadCurrentQHistory.end());
490  Xyce::deleteList(leadDeltaVHistory.begin(), leadDeltaVHistory.end());
491  Xyce::deleteList(leadCurrentQDerivHistory.begin(), leadCurrentQDerivHistory.end());
492 
493  delete qn0Ptr;
494  delete qpn0Ptr;
495  delete sn0Ptr;
496  delete spn0Ptr;
497  delete ston0Ptr;
498  delete stopn0Ptr;
499  delete stoQn0Ptr;
500  delete stoQpn0Ptr;
501  delete leadCurrentn0Ptr;
502  delete leadCurrentpn0Ptr;
503  delete leadCurrentQn0Ptr;
504  delete leadCurrentQpn0Ptr;
505  delete leadCurrentQDerivn0Ptr;
507  delete leadDeltaVn0Ptr;
508  delete leadDeltaVpn0Ptr;
509 
510 
511  // Nonlinear solution vector:
512  delete qNewtonCorrectionPtr;
513  delete sNewtonCorrectionPtr;
514  delete stoNewtonCorrectionPtr;
520 
521  // Step-size selection temporary vectors
522  delete delta_x;
523  delete delta_q;
524 
525  // Temporary vector for WaMPDE interpolation
526  delete tmpXn0APtr;
527  delete tmpXn0BPtr;
528 
529  // Delete data in the fast time storage for HB and MPDE
530  Xyce::deleteList(fastTimeSolutionVec.begin(), fastTimeSolutionVec.end());
531  Xyce::deleteList(fastTimeStateVec.begin(), fastTimeStateVec.end());
532  Xyce::deleteList(fastTimeQVec.begin(), fastTimeQVec.end());
533  Xyce::deleteList(fastTimeStoreVec.begin(), fastTimeStoreVec.end());
534 
535  // delete the sensitivity related stuff, if necessary
537 }
538 
539 //-----------------------------------------------------------------------------
540 // Function : DataStore::deleteSensitivityArrays
541 // Purpose :
542 // Special Notes :
543 // Scope : public
544 // Creator : Eric Keiter, SNL
545 // Creation Date : 8/6/2014
546 //-----------------------------------------------------------------------------
548 {
549  int numParams = currDqdpPtrVector.size();
550 
551  delete resMatVecPtr;
552 
553  for (int ip=0;ip<numParams;++ip)
554  {
555  delete sensRHSPtrVector[ip];
556  delete nextDfdpPtrVector[ip];
557 
558  delete currDqdpPtrVector[ip];
559  delete lastDqdpPtrVector[ip];
560  delete nextDqdpPtrVector[ip];
561 
562  delete nextDbdpPtrVector[ip];
563 
564  delete currDXdpPtrVector[ip];
565  delete lastDXdpPtrVector[ip];
566  delete nextDXdpPtrVector[ip];
567 
568  delete currDQdxDXdpPtrVector[ip];
569  delete lastDQdxDXdpPtrVector[ip];
570  delete nextDQdxDXdpPtrVector[ip];
571 
572  delete currDQdxDXdpDerivPtrVector[ip];
573  delete lastDQdxDXdpDerivPtrVector[ip];
574  delete nextDQdxDXdpDerivPtrVector[ip];
575 
576  delete currDqdpDerivPtrVector[ip];
577  delete lastDqdpDerivPtrVector[ip];
578  delete nextDqdpDerivPtrVector[ip];
579 
580  // history
581  for (int i = 0; i < dfdpHistory[ip].size(); ++i)
582  {
583  delete dfdpHistory[ip][i];
584  delete dqdpHistory[ip][i];
585  delete dbdpHistory[ip][i];
586  delete dXdpHistory[ip][i];
587  delete dQdxdXdpHistory[ip][i];
588  }
589  dfdpHistory[ip].clear();
590  dqdpHistory[ip].clear();
591  dbdpHistory[ip].clear();
592  dXdpHistory[ip].clear();
593  dQdxdXdpHistory[ip].clear();
594  }
595 
596  sensRHSPtrVector.clear();
597 
598  nextDfdpPtrVector.clear();
599 
600  currDqdpPtrVector.clear();
601  lastDqdpPtrVector.clear();
602  nextDqdpPtrVector.clear();
603 
604  nextDbdpPtrVector.clear();
605 
606  currDXdpPtrVector.clear();
607  lastDXdpPtrVector.clear();
608  nextDXdpPtrVector.clear();
609 
610  currDQdxDXdpPtrVector.clear();
611  lastDQdxDXdpPtrVector.clear();
612  nextDQdxDXdpPtrVector.clear();
613 
617 
618  currDqdpDerivPtrVector.clear();
619  lastDqdpDerivPtrVector.clear();
620  nextDqdpDerivPtrVector.clear();
621 
622  // history
623  dfdpHistory.clear();
624  dqdpHistory.clear();
625  dbdpHistory.clear();
626  dXdpHistory.clear();
627  dQdxdXdpHistory.clear();
628 }
629 
630 //-----------------------------------------------------------------------------
631 // Function : DataStore::allocateSensitivityArrays
632 // Purpose :
633 // Special Notes :
634 // Scope : public
635 // Creator : Eric Keiter, SNL
636 // Creation Date : 8/6/2014
637 //-----------------------------------------------------------------------------
638 void DataStore::allocateSensitivityArrays(Linear::Builder &builder, int numParams)
639 {
640  if (!allocateSensitivityArraysComplete) // only allocate if not already allocated
641  {
642  resMatVecPtr = builder.createVector();
643 
644  sensRHSPtrVector.resize(numParams);
645 
646  nextDfdpPtrVector.resize(numParams);
647 
648  currDqdpPtrVector.resize(numParams);
649  lastDqdpPtrVector.resize(numParams);
650  oldeDqdpPtrVector.resize(numParams);
651  nextDqdpPtrVector.resize(numParams);
652 
653  nextDbdpPtrVector.resize(numParams);
654 
655  currDXdpPtrVector.resize(numParams);
656  lastDXdpPtrVector.resize(numParams);
657  oldeDXdpPtrVector.resize(numParams);
658  nextDXdpPtrVector.resize(numParams);
659 
660  currDQdxDXdpPtrVector.resize(numParams);
661  lastDQdxDXdpPtrVector.resize(numParams);
662  oldeDQdxDXdpPtrVector.resize(numParams);
663  nextDQdxDXdpPtrVector.resize(numParams);
664 
665  currDQdxDXdpDerivPtrVector.resize(numParams);
666  lastDQdxDXdpDerivPtrVector.resize(numParams);
667  oldeDQdxDXdpDerivPtrVector.resize(numParams);
668  nextDQdxDXdpDerivPtrVector.resize(numParams);
669 
670  currDqdpDerivPtrVector.resize(numParams);
671  lastDqdpDerivPtrVector.resize(numParams);
672  oldeDqdpDerivPtrVector.resize(numParams);
673  nextDqdpDerivPtrVector.resize(numParams);
674 
675  // history
676  dfdpHistory.resize(numParams);
677  dqdpHistory.resize(numParams);
678  dbdpHistory.resize(numParams);
679  dXdpHistory.resize(numParams);
680  dQdxdXdpHistory.resize(numParams);
681 
682  for (int ip=0;ip<numParams;++ip)
683  {
684  sensRHSPtrVector[ip] = builder.createVector();
685 
686  nextDfdpPtrVector[ip] = builder.createVector();
687 
688  currDqdpPtrVector[ip] = builder.createVector();
689  lastDqdpPtrVector[ip] = builder.createVector();
690  nextDqdpPtrVector[ip] = builder.createVector();
691 
692  nextDbdpPtrVector[ip] = builder.createVector();
693 
694  currDXdpPtrVector[ip] = builder.createVector();
695  lastDXdpPtrVector[ip] = builder.createVector();
696  nextDXdpPtrVector[ip] = builder.createVector();
697 
698  currDQdxDXdpPtrVector[ip] = builder.createVector();
699  lastDQdxDXdpPtrVector[ip] = builder.createVector();
700  nextDQdxDXdpPtrVector[ip] = builder.createVector();
701 
702  currDQdxDXdpDerivPtrVector[ip] = builder.createVector();
703  lastDQdxDXdpDerivPtrVector[ip] = builder.createVector();
704  nextDQdxDXdpDerivPtrVector[ip] = builder.createVector();
705 
706  currDqdpDerivPtrVector[ip] = builder.createVector();
707  lastDqdpDerivPtrVector[ip] = builder.createVector();
708  nextDqdpDerivPtrVector[ip] = builder.createVector();
709 
710  // history
711  for (int i = 0; i < maxOrder + 1; ++i)
712  {
713  dfdpHistory[ip].push_back(builder.createVector());
714  dqdpHistory[ip].push_back(builder.createVector());
715  dbdpHistory[ip].push_back(builder.createVector());
716  dXdpHistory[ip].push_back(builder.createVector());
717  dQdxdXdpHistory[ip].push_back(builder.createVector());
718  }
719  }
720 
722  }
723 }
724 
725 // ----------------------------------------------------------------------------
726 // ----------------------- DataStore Class Functions -------------------------
727 // ----------------------------------------------------------------------------
728 
729 //-----------------------------------------------------------------------------
730 // Function : DataStore::printOutPointers
731 // Purpose :
732 // Special Notes :
733 // Scope : public
734 // Creator : Eric Keiter, SNL
735 // Creation Date : 6/23/00
736 //-----------------------------------------------------------------------------
738 {
739  Xyce::dout() << "olde ptr = " << oldeSolutionPtr << std::endl
740  << "last ptr = " << lastSolutionPtr << std::endl
741  << "curr ptr = " << currSolutionPtr << std::endl
742  << "next ptr = " << nextSolutionPtr << std::endl;
743 }
744 
745 //-----------------------------------------------------------------------------
746 // Function : DataStore::setConstantHistory
747 // Purpose : This function is called after the operating point
748 // calculation has been called. Once the operating point
749 // solution has been obtained, the code should regard that
750 // solution as having been the existing constant solution since
751 // the dawn of time.
752 // Special Notes : The most recent solution, etc., are in the "next" vectors.
753 // Scope : public
754 // Creator : Eric Keiter, SNL
755 // Creation Date : 6/23/00
756 //-----------------------------------------------------------------------------
758 {
759  if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
760  Xyce::dout() << "\nDataStore::setConstantHistory" << std::endl;
761 
762  // Solutions:
765 
766  // Derivative of Solutions:
769 
770  // Scaled Divided Differences of solutions:
773 
774  // States:
775  *(lastStatePtr) = *(nextStatePtr);
776  *(currStatePtr) = *(nextStatePtr);
777 
778  // Stores:
779  *(lastStorePtr) = *(nextStorePtr);
780  *(currStorePtr) = *(nextStorePtr);
781 
784 
785  // Derivative of States:
788 
789  // lead current derivative info in store
792 
793  // Scaled Divided Differences of states:
796 
797  // lead current and junction voltage vectors
806 
807 
809 }
810 
811 //-----------------------------------------------------------------------------
812 // Function : DataStore::setConstantSensitivityHistory
813 // Purpose :
814 // Special Notes : The most recent solution, etc., are in the "next" vectors.
815 // Scope : public
816 // Creator : Eric Keiter, SNL
817 // Creation Date : 8/28/2014
818 //-----------------------------------------------------------------------------
820 {
821  // Sensitivities:
822  for (int ip=0;ip<nextDfdpPtrVector.size();++ip)
823  {
824 
825  *(lastDqdpPtrVector[ip]) = *(nextDqdpPtrVector[ip]);
826  *(currDqdpPtrVector[ip]) = *(nextDqdpPtrVector[ip]);
827 
830 
831  *(lastDXdpPtrVector[ip]) = *(nextDXdpPtrVector[ip]);
832  *(currDXdpPtrVector[ip]) = *(nextDXdpPtrVector[ip]);
833 
836 
839  }
840 }
841 
842 //-----------------------------------------------------------------------------
843 // Function : DataStore::resetAll
844 //
845 // Purpose : This function resets everything so that a transient loop
846 // can be started from the beginning.
847 //
848 // Special Notes : This function was needed for HB.
849 //
850 // Scope : public
851 // Creator : T. Mei, SNL
852 // Creation Date : 02/26/09
853 //-----------------------------------------------------------------------------
854 bool
856  double absolute_error_tolerance,
857  double relative_error_tolerance)
858 {
859  absErrTolPtr->putScalar(absolute_error_tolerance); // tiaParams_.absErrorTol);
860  relErrTolPtr->putScalar(relative_error_tolerance); // tiaParams_.relErrorTol);
861 
862  return true;
863 }
864 
865 //-----------------------------------------------------------------------------
866 // Function : DataStore::resetFastTimeData
867 //
868 // Purpose : This function deletes the information from all the vectors
869 // that store fast time data for HB and MPDE
870 //
871 // Special Notes : This function was needed for HB.
872 //
873 // Scope : public
874 // Creator : Heidi Thornquist, SNL
875 // Creation Date : 06/05/13
876 //-----------------------------------------------------------------------------
878 {
879  // Clear the time step vectors
880  timeSteps.clear();
881  timeStepsBreakpointFlag.clear();
882 
883  // Delete any stored up any solution or state info
884  Xyce::deleteList(fastTimeSolutionVec.begin(), fastTimeSolutionVec.end());
885  Xyce::deleteList(fastTimeStateVec.begin(), fastTimeStateVec.end());
886  Xyce::deleteList(fastTimeQVec.begin(), fastTimeQVec.end());
887  Xyce::deleteList(fastTimeStoreVec.begin(), fastTimeStoreVec.end());
888 
889  fastTimeSolutionVec.clear();
890  fastTimeStateVec.clear();
891  fastTimeQVec.clear();
892  fastTimeStoreVec.clear();
893 
894  return true;
895 }
896 
897 
898 
899 //-----------------------------------------------------------------------------
900 // Function : DataStore::updateSolDataArrays
901 // Purpose : Update the necessary integration data arrays for
902 // preparation of the next integration step. This is done after
903 // a successful step has been taken.
904 // Special Notes :
905 // Scope : public
906 // Creator : Buddy Watts, SNL
907 // Creation Date : 6/01/00
908 //-----------------------------------------------------------------------------
910 {
911  if (DEBUG_TIME && isActive(Diag::TIME_STEP))
912  {
913  Xyce::dout() << "\nDataStore::updateSolDataArrays " << std::endl;
914  }
915 
916  // if the next solution has been switched out (probably because of NOX),
917  // then reset it
920 
921  // Solutions:
926 
927  // Derivative of Solutions:
932 
933  // Scaled Divided Differences of solutions:
938 
939  // States:
944 
945  // Stores:
954 
955  // Derivative of States:
960 
961  // lead curent component of store
966 
967  // Scaled Divided Differences of states:
972 
973  // lead current and junction voltage vectors
978 
983 
988 
993 
994  int iparamSizeQ = currDqdpPtrVector.size();
995  for (int ip=0;ip<iparamSizeQ;++ip)
996  {
1001  }
1002 
1003  int iparamSizeQderiv = currDqdpDerivPtrVector.size();
1004  for (int ip=0;ip<iparamSizeQderiv;++ip)
1005  {
1010  }
1011 
1012  int iparamSizeX = currDXdpPtrVector.size();
1013  for (int ip=0;ip<iparamSizeX;++ip)
1014  {
1019  }
1020 
1021  int iparamSizeQX = currDQdxDXdpPtrVector.size();
1022  for (int ip=0;ip<iparamSizeQX;++ip)
1023  {
1028  }
1029 
1030 
1031  int iparamSizeQXd = currDQdxDXdpDerivPtrVector.size();
1032  for (int ip=0;ip<iparamSizeQXd;++ip)
1033  {
1038  }
1039 
1040  // copy contents of "curr" into "next". This is to insure
1041  // that at a minimum, the initial guess for the Newton solve
1042  // will at least be the results of the previous Newton solve.
1044  *(nextStatePtr) = *(currStatePtr);
1045  *(nextStorePtr) = *(currStorePtr);
1048 }
1049 
1050 //-----------------------------------------------------------------------------
1051 // Function : DataStore::updateStateDataArrays
1052 //
1053 //
1054 // Purpose : Same as updateSolDataArrays, but this function only
1055 // advances the state vector, and leaves the
1056 // solution alone.
1057 //
1058 // Special Notes : The main usage of this function is LOCA.
1059 // After each continuation step, LOCA needs to call
1060 // this function. LOCA keeps track of solution vectors
1061 // on its own, which is why updateSolDataArrays
1062 // is inappropriate for LOCA.
1063 //
1064 // This is necessary for voltage limiting to be
1065 // consistent with LOCA.
1066 //
1067 // Scope : public
1068 // Creator : Eric R. Keiter, SNL, 9233.
1069 // Creation Date : 3/06/05
1070 //-----------------------------------------------------------------------------
1072 {
1073  if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1074  Xyce::dout() << "\nDataStore::updateStateDataArrays " << std::endl;
1075 
1076  // States:
1081 
1082  // Stores:
1087 
1088  // q component of lead current
1093 
1094  // Derivative of States:
1099 
1100  // Scaled Divided Differences of states:
1105 
1106  // lead current and junction voltage vectors
1111 
1116 
1121 
1122 
1123  // Now, make the "next" stuff the same as the "curr" stuff.
1124  // This is done because at the end of the tranop, but before
1125  // the transient phase starts, the function setConstantHistory
1126  // will be called. When it is called, the most recent values
1127  // for state variables need to be in the "next" vectors.
1128  //
1129  // As long as LOCA solves are never used for transient, and only
1130  // for DC and tranop solves, this is OK. This is, of course,
1131  // a bit of a kludge.
1132  *(nextStatePtr) = *(currStatePtr);
1133  *(nextStorePtr) = *(currStorePtr);
1136 
1137  return true;
1138 }
1139 
1140 #ifndef OLD_PLOT
1141 //-----------------------------------------------------------------------------
1142 // Function : DataStore::outputSolDataArrays
1143 // Purpose :
1144 // Special Notes :
1145 // Scope : public
1146 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1147 // Creation Date : 6/29/00
1148 //-----------------------------------------------------------------------------
1149 void DataStore::outputSolDataArrays(std::ostream &os)
1150 {
1151  char tmp[256];
1152  os << std::endl
1153  << Xyce::section_divider << std::endl
1154  << std::endl
1155  << " Solution Vectors:\n Current Last Olde Error" << std::endl;
1156 
1157  for (unsigned int k = 0; k < solutionSize; ++k)
1158  {
1159  os << (*(currSolutionPtr))[k] << (*(lastSolutionPtr))[k] << (*(oldeSolutionPtr))[k] << (*(newtonCorrectionPtr))[k] << std::endl;
1160  }
1161 
1162  os << Xyce::section_divider << std::endl;
1163 }
1164 
1165 #else
1166 
1167 //-----------------------------------------------------------------------------
1168 // Function : DataStore::outputSolDataArrays
1169 // Purpose :
1170 // Special Notes :
1171 // Scope : public
1172 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1173 // Creation Date : 6/29/00
1174 //-----------------------------------------------------------------------------
1175 void DataStore::outputSolDataArrays(std::ostream &os)
1176 {
1177  for (unsigned int k = 0; k < solutionSize; ++k)
1178  {
1179  os << "\t" << (*(currSolutionPtr))[0][k] << std::endl;
1180  }
1181  os << std::endl;
1182 }
1183 
1184 #endif
1185 
1186 //-----------------------------------------------------------------------------
1187 // Function : DataStore::enableOrderOneStart
1188 // Purpose : Initialize arrays for "re-starting" integration at order 1.
1189 // Special Notes :
1190 // Scope : public
1191 // Creator : Buddy Watts, SNL
1192 // Creation Date : 6/01/00
1193 //-----------------------------------------------------------------------------
1195 {
1196  // solution vectors:
1199 
1200  nextSolutionDerivPtr->putScalar(0.0);
1201  currSolutionDerivPtr->putScalar(0.0);
1202  currSolutionDivDiffPtr->putScalar(0.0);
1203 
1204  // state vectors:
1207 
1208  nextStateDerivPtr->putScalar(0.0);
1209  currStateDerivPtr->putScalar(0.0);
1210  currStateDivDiffPtr->putScalar(0.0);
1211 
1212  // store vectors:
1217  nextStoreLeadCurrQDerivPtr->putScalar(0.0);
1218  currStoreLeadCurrQDerivPtr->putScalar(0.0);
1219 
1220  // lead current and junction voltage vectors
1223 
1226 
1229 
1230  nextLeadCurrentQDerivPtr->putScalar(0.0);
1231  currLeadCurrentQDerivPtr->putScalar(0.0);
1232 
1233  // sensitivities
1234 
1235  int iparamSizeQ = currDqdpPtrVector.size();
1236  for (int ip=0;ip<iparamSizeQ;++ip)
1237  {
1238  *(oldeDqdpPtrVector[ip]) = *(currDqdpPtrVector[ip]);
1239  *(lastDqdpPtrVector[ip]) = *(currDqdpPtrVector[ip]);
1240  currDqdpPtrVector[ip]->putScalar(0.0);
1241  nextDqdpPtrVector[ip]->putScalar(0.0);
1242  }
1243 
1244  int iparamSizeQd = currDqdpDerivPtrVector.size();
1245  for (int ip=0;ip<iparamSizeQ;++ip)
1246  {
1249  currDqdpDerivPtrVector[ip]->putScalar(0.0);
1250  nextDqdpDerivPtrVector[ip]->putScalar(0.0);
1251  }
1252 
1253  int iparamSizeX = currDXdpPtrVector.size();
1254  for (int ip=0;ip<iparamSizeX;++ip)
1255  {
1256  *(oldeDXdpPtrVector[ip]) = *(currDXdpPtrVector[ip]);
1257  *(lastDXdpPtrVector[ip]) = *(currDXdpPtrVector[ip]);
1258  currDXdpPtrVector[ip]->putScalar(0.0);
1259  nextDXdpPtrVector[ip]->putScalar(0.0);
1260  }
1261 
1262  int iparamSizeQX = currDQdxDXdpPtrVector.size();
1263  for (int ip=0;ip<iparamSizeQX;++ip)
1264  {
1267  currDQdxDXdpPtrVector[ip]->putScalar(0.0);
1268  nextDQdxDXdpPtrVector[ip]->putScalar(0.0);
1269  }
1270 
1271 
1272  int iparamSizeQXd = currDQdxDXdpDerivPtrVector.size();
1273  for (int ip=0;ip<iparamSizeQX;++ip)
1274  {
1277  currDQdxDXdpDerivPtrVector[ip]->putScalar(0.0);
1278  nextDQdxDXdpDerivPtrVector[ip]->putScalar(0.0);
1279  }
1280 
1281 }
1282 
1283 //-----------------------------------------------------------------------------
1284 // Function : DataStore::outputPredictedSolution
1285 // Purpose : Set ErrorEstimate array values to zero.
1286 // Special Notes :
1287 // Scope : public
1288 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1289 // Creation Date : 6/27/00
1290 //-----------------------------------------------------------------------------
1292 {
1293  os << Xyce::subsection_divider << std::endl
1294  << " Predicted Solution:" << std::endl;
1295 
1296  for (unsigned int k = 0; k< solutionSize; ++k)
1297  os << (*(nextSolutionPtr))[k] << std::endl;
1298 
1299  os << Xyce::subsection_divider << std::endl;
1300 }
1301 
1302 //-----------------------------------------------------------------------------
1303 // Function : DataStore::outputPredictedDerivative
1304 // Purpose : Set ErrorEstimate array values to zero.
1305 // Special Notes :
1306 // Scope : public
1307 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1308 // Creation Date : 6/27/00
1309 //-----------------------------------------------------------------------------
1311 {
1312  os << Xyce::subsection_divider << std::endl
1313  << " Predicted Derivative:" << std::endl;
1314 
1315  for (unsigned int k = 0; k < solutionSize; ++k)
1316  os << (*(nextSolutionDerivPtr))[k] << std::endl;
1317 
1318  os << Xyce::subsection_divider << std::endl;
1319 }
1320 
1321 //-----------------------------------------------------------------------------
1322 // Function : DataStore::partialErrorNormSum
1323 // Purpose : Needed by 2-level solves.
1324 //
1325 // Special Notes : A weighted RMS norm is this:
1326 //
1327 // norm = sqrt ( 1/n * sum (x/w)^2 )
1328 //
1329 // What this function returns is: sum (x/w)^2
1330 //
1331 // It will later be summed with other patial sums
1332 // to get the complete WRMS value.
1333 //
1334 // Scope : public
1335 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1336 // Creation Date : 03/15/06
1337 //-----------------------------------------------------------------------------
1339 {
1340  double errorNorm = 0.0;
1341  newtonCorrectionPtr->wRMSNorm(*errWtVecPtr, &errorNorm);
1342  double sum = errorNorm*errorNorm;
1343  double length = newtonCorrectionPtr->globalLength();
1344 
1345  sum *= length;
1346 
1347  return sum;
1348 }
1349 
1350 //-----------------------------------------------------------------------------
1351 // Function : DataStore::globalLength
1352 // Purpose : Needed by 2-level solves.
1353 // Special Notes :
1354 // Scope : public
1355 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1356 // Creation Date : 03/15/06
1357 //-----------------------------------------------------------------------------
1359 {
1360  return newtonCorrectionPtr->globalLength();
1361 }
1362 
1363 //-----------------------------------------------------------------------------
1364 // Function : DataStore::computeDividedDifferences
1365 // Purpose : Compute the scaled (by current stepsize) divided difference
1366 // approximation to the derivative.
1367 // Special Notes :
1368 // Scope : public
1369 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1370 // Creation Date : 6/27/00
1371 //-----------------------------------------------------------------------------
1373 {
1374  // First do the solution divided difference:
1375  nextSolutionDivDiffPtr->linearCombo(1.0, *(nextSolutionPtr), -1.0, *(currSolutionPtr));
1376 
1377  // Now do the state divided difference:
1378  nextStateDivDiffPtr->linearCombo(1.0, *(nextStatePtr), -1.0, *(currStatePtr));
1379 
1380  return;
1381 }
1382 
1383 //-----------------------------------------------------------------------------
1384 // Function : DataStore::computeDivDiffsBlock
1385 // Purpose : Compute the scaled (by current stepsize) divided difference
1386 // approximation to the derivative. This is the same as
1387 // the function "computeDividedDifferences", except that
1388 // the operation is only performed on a sub-block of the
1389 // vectors.
1390 //
1391 // Special Notes : Not done yet...
1392 // Scope : public
1393 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1394 // Creation Date : 01/10/01
1395 //-----------------------------------------------------------------------------
1397  const std::list<IndexPair> & solGIDList,
1398  const std::list<IndexPair> & staGIDList)
1399 {}
1400 
1401 //-----------------------------------------------------------------------------
1402 // Function : DataStore::equateTmpVectors
1403 // Purpose : This function equates the 6 temporary vectors with
1404 // their "next" vector equivalents. This function
1405 // is neccessary for the nonlinear solver damping loop.
1406 // Special Notes :
1407 // Scope : public
1408 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1409 // Creation Date : 01/24/02
1410 //-----------------------------------------------------------------------------
1412 {
1413  // next solution vector:
1415 
1416  // next state vector:
1418 
1419  // next store vector:
1421 
1422  // next state divided difference vector:
1424 
1425  // next state derivative vector:
1427 
1428  // next lead currrent and junction voltage vectors
1432 
1433  return true;
1434 }
1435 
1436 //-----------------------------------------------------------------------------
1437 // Function : DataStore::usePreviousSolAsPredictor
1438 // Purpose :
1439 // Special Notes :
1440 // Scope : public
1441 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1442 // Creation Date : 6/28/01
1443 //-----------------------------------------------------------------------------
1445 {
1446  bool bsuccess = true;
1447 
1451 
1452  return bsuccess;
1453 }
1454 
1455 //-----------------------------------------------------------------------------
1456 // Function : DataStore::setNextSolVectorPtr
1457 // Purpose :
1458 // Special Notes : Only needed for NOX, and other solvers that prefer to
1459 // own the solution vector.
1460 //
1461 // Scope : public
1462 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
1463 // Creation Date : 4/22/03
1464 //-----------------------------------------------------------------------------
1465 bool DataStore::setNextSolVectorPtr (Linear::Vector * solVecPtr)
1466 {
1467  // only save the old pointer if it hasn't been switched yet.
1468  if (!nextSolPtrSwitched_)
1469  {
1471  nextSolPtrSwitched_ = true;
1472  }
1473  nextSolutionPtr = solVecPtr;
1474 
1475  return true;
1476 }
1477 
1478 // TT: added
1479 bool DataStore::setNextSolVectorPtr (Linear::Vector & solVecPtr)
1480 {
1481  // only save the old pointer if it hasn't been switched yet.
1482  if (!nextSolPtrSwitched_)
1483  {
1485  nextSolPtrSwitched_ = true;
1486  }
1487  *(nextSolutionPtr) = solVecPtr;
1488 
1489  return true;
1490 }
1491 
1492 //-----------------------------------------------------------------------------
1493 // Function : DataStore::unsetNextSolVectorPtr
1494 // Purpose :
1495 // Special Notes : This also copies over the solution, in addition to the
1496 // pointer.
1497 //
1498 // This is only called when it is time to rotate the
1499 // pointers for the next time step. If we have been
1500 // running with NOX, or with some other solver that prefers
1501 // to own the solution vector, this is neccessary, and the
1502 // switch flag should be set. Otherwise, not.
1503 //
1504 // Basically, if we've been running with NOX, then the next
1505 // solution vector ptr has probably been switched out at least
1506 // once. We need to maintain the history, so we make a
1507 // copy of this switched solution vector, and the
1508 // restore the old pointer.
1509 //
1510 // This is kludgy, but will have to do for now.
1511 //
1512 // Scope : public
1513 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
1514 // Creation Date : 4/22/03
1515 //-----------------------------------------------------------------------------
1517 {
1518  if (nextSolPtrSwitched_)
1519  {
1522  nextSolPtrSwitched_ = false;
1523  }
1524 
1525  return true;
1526 }
1527 
1528 //-----------------------------------------------------------------------------
1529 // Function : DataStore::setZeroHistory
1530 // Purpose : Sets everything to zero.
1531 // Special Notes :
1532 // Scope : public
1533 // Creator : Eric Keiter, SNL
1534 // Creation Date : 1/24/07
1535 //-----------------------------------------------------------------------------
1537 {
1538  if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1539  Xyce::dout() << "\nDataStore::setZeroHistory" << std::endl;
1540 
1541  // Solutions:
1542  nextSolutionPtr->putScalar(0.0);
1543  nextSolutionDerivPtr->putScalar(0.0);
1544  nextSolutionDivDiffPtr->putScalar(0.0);
1545 
1546  // States:
1547  nextStatePtr->putScalar(0.0);
1548  nextStateDerivPtr->putScalar(0.0);
1549  nextStateDivDiffPtr->putScalar(0.0);
1550  nextStorePtr->putScalar(0.0);
1551  nextStoreLeadCurrQPtr->putScalar(0.0);
1552  nextLeadCurrentPtr->putScalar(0.0);
1553  nextLeadCurrentQPtr->putScalar(0.0);
1554  nextLeadDeltaVPtr->putScalar(0.0);
1555 
1556  for (int ip=0;ip<nextDfdpPtrVector.size();++ip)
1557  {
1558  nextDfdpPtrVector[ip]->putScalar(0.0);
1559  nextDqdpPtrVector[ip]->putScalar(0.0);
1560  nextDqdpDerivPtrVector[ip]->putScalar(0.0);
1561  nextDbdpPtrVector[ip]->putScalar(0.0);
1562  nextDXdpPtrVector[ip]->putScalar(0.0);
1563  nextDQdxDXdpPtrVector[ip]->putScalar(0.0);
1564  nextDQdxDXdpDerivPtrVector[ip]->putScalar(0.0);
1565  }
1566 
1567  qErrWtVecPtr->putScalar(0.0);
1568 
1569  // DAE formulation vectors
1570  daeQVectorPtr->putScalar(0.0);
1571  daeFVectorPtr->putScalar(0.0);
1572  daeBVectorPtr->putScalar(0.0);
1573 
1574  // Predictors
1575  xn0Ptr->putScalar(0.0);
1576  qn0Ptr->putScalar(0.0);
1577  qpn0Ptr->putScalar(0.0);
1578  sn0Ptr->putScalar(0.0);
1579  spn0Ptr->putScalar(0.0);
1580  stoQn0Ptr->putScalar(0.0);
1581  stoQpn0Ptr->putScalar(0.0);
1582  leadCurrentQn0Ptr->putScalar(0.0);
1583  leadCurrentQpn0Ptr->putScalar(0.0);
1584  leadCurrentQDerivn0Ptr->putScalar(0.0);
1585  leadCurrentQDerivpn0Ptr->putScalar(0.0);
1586  leadDeltaVn0Ptr->putScalar(0.0);
1587  leadDeltaVpn0Ptr->putScalar(0.0);
1588 
1589  // Nonlinear solution vector:
1590  qNewtonCorrectionPtr->putScalar(0.0);
1591  sNewtonCorrectionPtr->putScalar(0.0);
1592  stoNewtonCorrectionPtr->putScalar(0.0);
1593  stoLeadCurrQNewtonCorrectionPtr->putScalar(0.0);
1594  leadCurrentNewtonCorrectionPtr->putScalar(0.0);
1595  leadCurrentQNewtonCorrectionPtr->putScalar(0.0);
1596  leadCurrentQDerivNewtonCorrectionPtr->putScalar(0.0);
1597  leadDeltaVNewtonCorrectionPtr->putScalar(0.0);
1598 
1599  // Step-size selection temporary vectors
1600  delta_x->putScalar(0.0);
1601  delta_q->putScalar(0.0);
1602 
1603  // Temporary vector for WaMPDE interpolation
1604  tmpXn0APtr->putScalar(0.0);
1605  tmpXn0BPtr->putScalar(0.0);
1606 
1607  // This just sets the "oldDAE" history vectors to zero.
1608  setConstantHistory ();
1609 
1610  // new-DAE history:
1611  int sizeOfHistory = xHistory.size();
1612  for (int i = 0; i < sizeOfHistory; ++i)
1613  {
1614  xHistory[i]->putScalar(0.0);
1615  qHistory[i]->putScalar(0.0);
1616  sHistory[i]->putScalar(0.0);
1617  stoHistory[i]->putScalar(0.0);
1618  stoLeadCurrQHistory[i]->putScalar(0.0);
1619  leadCurrentHistory[i]->putScalar(0.0);
1620  leadCurrentQHistory[i]->putScalar(0.0);
1621  leadDeltaVHistory[i]->putScalar(0.0);
1622 
1623 
1624  for (int ip=0;ip<dfdpHistory.size();++ip)
1625  {
1626  std::vector<Linear::Vector *> dfdp = dfdpHistory[ip];
1627  std::vector<Linear::Vector *> dqdp = dqdpHistory[ip];
1628  std::vector<Linear::Vector *> dbdp = dbdpHistory[ip];
1629  std::vector<Linear::Vector *> dXdp = dXdpHistory[ip];
1630  std::vector<Linear::Vector *> dQdxdXdp = dQdxdXdpHistory[ip];
1631 
1632  dfdp[i]->putScalar(0.0);
1633  dqdp[i]->putScalar(0.0);
1634  dbdp[i]->putScalar(0.0);
1635  dXdp[i]->putScalar(0.0);
1636  dQdxdXdp[i]->putScalar(0.0);
1637  }
1638  }
1639 }
1640 
1641 //-----------------------------------------------------------------------------
1642 // Function : DataStore::setErrorWtVector
1643 // Purpose : Set the Error Weight Vector (defined in terms of the
1644 // solution approximation and error tolerances).
1645 // Special Notes :
1646 // Scope : public
1647 // Creator : Eric Keiter, SNL,Parallel Computational Sciences
1648 // Creation Date : 5/25/05
1649 //-----------------------------------------------------------------------------
1650 void
1652  const TIAParams & tia_params)
1653 {
1654  // presort the variables into types
1655  if (indexVVars.empty() && indexMaskedVars.empty())
1656  {
1657  // now fill the index arrays
1658  for (int k = 0; k < solutionSize; ++k)
1659  {
1660  if ((*deviceErrorWeightMask_)[k] == 0.0)
1661  indexMaskedVars.push_back(k);
1662  else
1663  indexVVars.push_back(k);
1664  }
1665  }
1666 
1667  if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
1668  {
1669  Xyce::dout() << Xyce::section_divider << std::endl
1670  << "DataStore::setErrorWtVector" << std::endl << std::endl
1671  << " errorWtVector currSolution relErrorTol absErrorTol" << std::endl
1672  << " -------------- -------------- -------------- --------------" << std::endl;
1673  }
1674 
1675 
1676  switch(tia_params.newLte )
1677  {
1678  case 0: // point local
1679  {
1680  relSolutionPtr->absValue(*currSolutionPtr);
1681 // errWtVecPtr->absValue(*currSolutionPtr);
1682  if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
1683  {
1684  double currMaxValue = 0.0;
1685  currSolutionPtr->infNorm(&currMaxValue);
1686  std::vector<int> index(1, -1);
1687  currSolutionPtr->infNormIndex( &index[0] );
1688  Xyce::dout() << "currMaxValueoldLte = " << currMaxValue << ", currMaxValueIndex = " << index[0] << std::endl;
1689 
1690  std::cout << " old LTE rel reference:" << std::endl;
1691  relSolutionPtr->printPetraObject(Xyce::dout());
1692 
1693  }
1694  }
1695  break;
1696 
1697 
1698  case 1: //point global
1699  {
1700  double currMaxValue = 0.0;
1701  currSolutionPtr->infNorm(&currMaxValue);
1702 
1703 
1704  relSolutionPtr->putScalar(currMaxValue);
1705 // errWtVecPtr->putScalar(currMaxValue);
1706 
1707  if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
1708  {
1709  std::vector<int> index(1, -1);
1710  currSolutionPtr->infNormIndex( &index[0] );
1711  Xyce::dout() << "currMaxValue = " << currMaxValue << ", currMaxValueIndex = " << index[0] << std::endl;
1712 
1713  std::cout << " lte =1 rel reference:" << std::endl;
1714  relSolutionPtr->printPetraObject(Xyce::dout());
1715 
1716  std::cout << " lte = 1 currSolution :" << std::endl;
1717  currSolutionPtr->printPetraObject(Xyce::dout());
1718  }
1719  }
1720  break;
1721 
1722 
1723  case 2:
1724  {
1725  double currMaxValue = 0.0;
1726  currSolutionPtr->infNorm(&currMaxValue);
1727 
1728  std::vector<int> currIndex(1, -1);
1729  currSolutionPtr->infNormIndex( &currIndex[0] );
1730 
1731 // int index;
1732  if (currMaxValue > solsMaxValue)
1733  {
1734  solsMaxValue = currMaxValue;
1735  index = currIndex[0];
1736  }
1737 
1738  relSolutionPtr->putScalar( solsMaxValue);
1739 // errWtVecPtr->putScalar( solsMaxValue);
1740 
1741  if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
1742  {
1743  Xyce::dout() << "signal global MaxValue = " << solsMaxValue << ", signal global MaxValueIndex = " << index << std::endl;
1744  Xyce::dout() << " currMaxValue = " << currMaxValue << ", currMaxValueIndex = " << currIndex[0] << std::endl;
1745  }
1746  }
1747  break;
1748 
1749  case 3: //sig local
1750 
1751  {
1752  for ( int i=0; i< solutionSize; i++)
1753  {
1754  if (fabs( (*currSolutionPtr)[i]) > (*maxSolutionPtr)[i] )
1755  (*maxSolutionPtr)[i] = fabs( (*currSolutionPtr)[i]);
1756 
1757  }
1758 
1759 // errWtVecPtr = maxSolutionPtr;
1760 
1761  for ( int i=0; i< solutionSize; i++)
1762  {
1763 // if (fabs( (*nextSolutionPtr)[i]) > (*maxSolutionPtr)[i] )
1764 // (*relSolutionPtr)[i] = fabs( (*nextSolutionPtr)[i]);
1765 // else
1766  (*relSolutionPtr)[i] = (*maxSolutionPtr)[i];
1767  }
1768 
1769  if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
1770  {
1771  std::cout << " LTE 3 rel reference:" << std::endl; std::cout << " LTE 3 rel reference:" << std::endl;
1772  relSolutionPtr->printPetraObject(Xyce::dout());
1773 
1774  std::cout << " LTE = 3 next solutions :" << std::endl;
1775  nextSolutionPtr->printPetraObject(Xyce::dout());
1776  }
1777 
1778  }
1779  break;
1780 
1781  default:
1782  std::cout << "Unsupported new LTE options" << std::endl;
1783  }
1784 
1785  qErrWtVecPtr->absValue(*daeQVectorPtr);
1786 
1787 
1788 // Voltage variables
1789  for (std::vector<int>::const_iterator it = indexVVars.begin(), end = indexVVars.end(); it != end; ++it)
1790  {
1791  int i = *it;
1792  (*errWtVecPtr)[i] = (*relErrTolPtr)[i] * (*relSolutionPtr)[i] + (*absErrTolPtr)[i];
1793  (*qErrWtVecPtr)[i] = (*relErrTolPtr)[i] * (*qErrWtVecPtr)[i] + (*absErrTolPtr)[i];
1794 // (*errWtVecPtr)[i] = (*relErrTolPtr)[i] * (*errWtVecPtr)[i] + (*absErrTolPtr)[i];
1795  }
1796 
1797  // Current variables
1798  // if !fastTests, then I vars are treated with V vars above.
1799 
1800  // Masked variables
1801  for (std::vector<int>::const_iterator it = indexMaskedVars.begin(), end = indexMaskedVars.end(); it != end; ++it)
1802  {
1803  int i = *it;
1804  (*errWtVecPtr)[i] = (*qErrWtVecPtr)[i] = Util::MachineDependentParams::MachineBig();
1805  }
1806 
1807 
1808  if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
1809  {
1810  for (int k = 0; k < solutionSize; ++k)
1811  Xyce::dout() << (*errWtVecPtr)[k] << " "
1812  << (*currSolutionPtr)[k] << " "
1813  << (*relErrTolPtr)[k] << " "
1814  << (*absErrTolPtr)[k] << " " << std::endl;
1815 
1816  Xyce::dout() << "" << std::endl
1817  << Xyce::section_divider << std::endl;
1818  }
1819 }
1820 
1821 //-----------------------------------------------------------------------------
1822 // Function : DataStore::WRMS_errorNorm
1823 // Purpose :
1824 // Special Notes :
1825 // Scope : public
1826 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1827 // Creation Date : 5/25/05
1828 //-----------------------------------------------------------------------------
1830 {
1831  double errorNorm = 0.0, qErrorNorm = 0.0;
1832  newtonCorrectionPtr->wRMSNorm(*errWtVecPtr, &errorNorm);
1833  qNewtonCorrectionPtr->wRMSNorm(*qErrWtVecPtr, &qErrorNorm);
1834 
1835  if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
1836  {
1837  Xyce::dout() << "DataStore::errorNorm = " << errorNorm << std::endl;
1838  Xyce::dout() << "DataStore::qErrorNorm = " << qErrorNorm << std::endl;
1839  }
1840 
1841  // This is for handling the total errorNorm for 2-level solves.
1842  //
1843  // Note: This version of the function assumes that the error norm
1844  // and q-error norm are the same size. (they have to be...)
1845  if ( !(innerErrorInfoVec.empty()) )
1846  {
1847  double upperSize = newtonCorrectionPtr->globalLength();
1848  int sumSize = innerErrorInfoVec.size();
1849 
1850  double totalSize = upperSize;
1851  double totalSum = errorNorm*errorNorm*upperSize;
1852  double totalQSum = qErrorNorm*qErrorNorm*upperSize;
1853 
1854  for (int i=0;i<sumSize;++i)
1855  {
1856  double innerSum = innerErrorInfoVec[i].xErrorSum;
1857  double innerQSum = innerErrorInfoVec[i].qErrorSum;
1858  double innerSize = innerErrorInfoVec[i].innerSize;
1859 
1860  if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
1861  {
1862  Xyce::dout() << "DSdae:innerSum["<<i<<"] = " << innerSum <<std::endl;
1863  Xyce::dout() << "DSdae:innerQSum["<<i<<"] = " << innerQSum <<std::endl;
1864  Xyce::dout() << "DSdae:innerSize["<<i<<"] = " << innerSize <<std::endl;
1865  }
1866 
1867  totalSize += innerSize;
1868  totalSum += innerSum;
1869  totalQSum += innerQSum;
1870  }
1871 
1872  double recip = 1.0/totalSize;
1873  errorNorm = sqrt(recip*totalSum);
1874  qErrorNorm = sqrt(recip*totalQSum);
1875 
1876  if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
1877  {
1878  Xyce::dout() << "DSdae:upperSize = " << upperSize << std::endl;
1879  Xyce::dout() << "DSdae:totalSum = " << totalSum << std::endl;
1880  Xyce::dout() << "DSdae:totalQSum = " << totalQSum << std::endl;
1881  Xyce::dout() << "DSdae:totalSize = " << totalSize << std::endl;
1882  Xyce::dout() << "DSdae:2-level errorNorm = " << errorNorm << std::endl;
1883  Xyce::dout() << "DSdae:2-level qErrorNorm = " << qErrorNorm << std::endl;
1884  }
1885  }
1886 
1887  return errorNorm;
1888 }
1889 
1890 //-----------------------------------------------------------------------------
1891 // Function : DataStore::partialQErrorNormSum
1892 // Purpose : Needed by 2-level solves. This is the Q-vector version
1893 // of this function.
1894 //
1895 // Special Notes : A weighted RMS norm is this:
1896 //
1897 // norm = sqrt ( 1/n * sum (x/w)^2 )
1898 //
1899 // What this function returns is: sum (x/w)^2
1900 //
1901 // It will later be summed with other patial sums
1902 // to get the complete WRMS value.
1903 //
1904 // Scope : public
1905 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1906 // Creation Date : 03/15/06
1907 //-----------------------------------------------------------------------------
1909 {
1910  double qErrorNorm = 0.0;
1911  qNewtonCorrectionPtr->wRMSNorm(*qErrWtVecPtr, &qErrorNorm);
1912  double sum = qErrorNorm*qErrorNorm;
1913  double length = qNewtonCorrectionPtr->globalLength();
1914  sum *= length;
1915 
1916  return sum;
1917 }
1918 
1919 //-----------------------------------------------------------------------------
1920 // Function : DataStore::partialSum_m1
1921 // Purpose : Needed by 2-level solves.
1922 //
1923 // Special Notes : A weighted RMS norm is this:
1924 //
1925 // norm = sqrt ( 1/n * sum (x/w)^2 )
1926 //
1927 // What this function returns is: sum (x/w)^2
1928 //
1929 // It will later be summed with other patial sums
1930 // to get the complete WRMS value.
1931 //
1932 // Scope : public
1933 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1934 // Creation Date : 03/15/07
1935 //-----------------------------------------------------------------------------
1936 double DataStore::partialSum_m1 (int currentOrder)
1937 {
1938  double sum = 0.0;
1939 
1940  if (currentOrder>1)
1941  {
1942  delta_x->linearCombo(1.0,*(xHistory[currentOrder]),1.0,*newtonCorrectionPtr);
1943  double norm = 0.0;
1944  delta_x->wRMSNorm(*errWtVecPtr, &norm);
1945  sum = norm*norm;
1946  double length = newtonCorrectionPtr->globalLength();
1947  sum *= length;
1948  }
1949 
1950  return sum;
1951 }
1952 
1953 //-----------------------------------------------------------------------------
1954 // Function : DataStore::partialSum_m2
1955 // Purpose : Needed by 2-level solves.
1956 //
1957 // Special Notes : A weighted RMS norm is this:
1958 //
1959 // norm = sqrt ( 1/n * sum (x/w)^2 )
1960 //
1961 // What this function returns is: sum (x/w)^2
1962 //
1963 // It will later be summed with other patial sums
1964 // to get the complete WRMS value.
1965 //
1966 // Scope : public
1967 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
1968 // Creation Date : 03/15/07
1969 //-----------------------------------------------------------------------------
1970 double DataStore::partialSum_m2 (int currentOrder)
1971 {
1972  double sum = 0.0;
1973 
1974  if (currentOrder>2)
1975  {
1976  delta_x->linearCombo(1.0,*(xHistory[currentOrder]),1.0,*newtonCorrectionPtr);
1977  delta_x->linearCombo(1.0,*(xHistory[currentOrder-1]),1.0,*delta_x);
1978  double norm = 0.0;
1979  delta_x->wRMSNorm(*errWtVecPtr, &norm);
1980  sum = norm*norm;
1981  double length = newtonCorrectionPtr->globalLength();
1982  sum *= length;
1983  }
1984 
1985  return sum;
1986 }
1987 
1988 //-----------------------------------------------------------------------------
1989 // Function : DataStore::partialSum_p1
1990 // Purpose : Needed by 2-level solves.
1991 //
1992 // Special Notes : A weighted RMS norm is this:
1993 //
1994 // norm = sqrt ( 1/n * sum (x/w)^2 )
1995 //
1996 // What this function returns is: sum (x/w)^2
1997 //
1998 // It will later be summed with other patial sums
1999 // to get the complete WRMS value.
2000 //
2001 // Scope : public
2002 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
2003 // Creation Date : 03/15/07
2004 //-----------------------------------------------------------------------------
2005 double DataStore::partialSum_p1 (int currentOrder, int maxOrder)
2006 {
2007  double sum = 0.0;
2008 
2009  if (currentOrder<maxOrder)
2010  {
2011  delta_x->linearCombo(1.0,*newtonCorrectionPtr,-1.0,*(xHistory[currentOrder+1]));
2012  double norm = 0.0;
2013  delta_x->wRMSNorm(*errWtVecPtr, &norm);
2014  sum = norm*norm;
2015  double length = newtonCorrectionPtr->globalLength();
2016  sum *= length;
2017  }
2018 
2019  return sum;
2020 }
2021 
2022 //-----------------------------------------------------------------------------
2023 // Function : DataStore::partialSum_q1
2024 // Purpose : Needed by 2-level solves.
2025 //
2026 // Special Notes : A weighted RMS norm is this:
2027 //
2028 // norm = sqrt ( 1/n * sum (x/w)^2 )
2029 //
2030 // What this function returns is: sum (x/w)^2
2031 //
2032 // It will later be summed with other patial sums
2033 // to get the complete WRMS value.
2034 //
2035 // Scope : public
2036 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
2037 // Creation Date : 03/15/07
2038 //-----------------------------------------------------------------------------
2040 {
2041  double sum = 0.0;
2042 
2043  double norm = 0.0;
2044  (qHistory[1])->wRMSNorm(*qErrWtVecPtr, &norm);
2045 
2046  sum = norm*norm;
2047  double length = qNewtonCorrectionPtr->globalLength();
2048  sum *= length;
2049 
2050  return sum;
2051 }
2052 
2053 //-----------------------------------------------------------------------------
2054 // Function : DataStore::delta_x_errorNorm_m1
2055 // Purpose :
2056 // Special Notes :
2057 // Scope : public
2058 // Creator : Eric Keiter
2059 // Creation Date : 03/15/07
2060 //-----------------------------------------------------------------------------
2062 {
2063  double errorNorm = 0.0;
2064  delta_x->wRMSNorm(*errWtVecPtr, &errorNorm);
2065 
2066  // This is for handling the total errorNorm for 2-level solves.
2067  // It really should get a separate overloaded function.
2068  if ( !(innerErrorInfoVec.empty()) )
2069  {
2070  double upperSize = newtonCorrectionPtr->globalLength();
2071  int sumSize = innerErrorInfoVec.size();
2072 
2073  double totalSize = upperSize;
2074  double totalSum = errorNorm*errorNorm*upperSize;
2075 
2076  for (int i=0;i<sumSize;++i)
2077  {
2078  double innerSum = innerErrorInfoVec[i].xErrorSum_m1;
2079  double innerSize = innerErrorInfoVec[i].innerSize;
2080 
2081  totalSize += innerSize;
2082  totalSum += innerSum;
2083  }
2084 
2085  double recip = 1.0/totalSize;
2086  errorNorm = sqrt(recip*totalSum);
2087  }
2088 
2089  return errorNorm;
2090 }
2091 
2092 //-----------------------------------------------------------------------------
2093 // Function : DataStore::delta_x_errorNorm_m2
2094 // Purpose :
2095 // Special Notes :
2096 // Scope : public
2097 // Creator : Eric Keiter
2098 // Creation Date : 03/15/07
2099 //-----------------------------------------------------------------------------
2101 {
2102  double errorNorm = 0.0;
2103  delta_x->wRMSNorm(*errWtVecPtr, &errorNorm);
2104 
2105  // This is for handling the total errorNorm for 2-level solves.
2106  // It really should get a separate overloaded function.
2107  if ( !(innerErrorInfoVec.empty()) )
2108  {
2109  double upperSize = newtonCorrectionPtr->globalLength();
2110  int sumSize = innerErrorInfoVec.size();
2111 
2112  double totalSize = upperSize;
2113  double totalSum = errorNorm*errorNorm*upperSize;
2114 
2115  for (int i=0;i<sumSize;++i)
2116  {
2117  double innerSum = innerErrorInfoVec[i].xErrorSum_m2;
2118  double innerSize = innerErrorInfoVec[i].innerSize;
2119 
2120  totalSize += innerSize;
2121  totalSum += innerSum;
2122  }
2123 
2124  double recip = 1.0/totalSize;
2125  errorNorm = sqrt(recip*totalSum);
2126  }
2127 
2128  return errorNorm;
2129 }
2130 
2131 //-----------------------------------------------------------------------------
2132 // Function : DataStore::delta_x_errorNorm_p1
2133 // Purpose :
2134 // Special Notes :
2135 // Scope : public
2136 // Creator : Eric Keiter
2137 // Creation Date : 03/15/07
2138 //-----------------------------------------------------------------------------
2140 {
2141  double errorNorm = 0.0;
2142  delta_x->wRMSNorm(*errWtVecPtr, &errorNorm);
2143 
2144  // This is for handling the total errorNorm for 2-level solves.
2145  // It really should get a separate overloaded function.
2146  if ( !(innerErrorInfoVec.empty()) )
2147  {
2148  double upperSize = newtonCorrectionPtr->globalLength();
2149  int sumSize = innerErrorInfoVec.size();
2150 
2151  double totalSize = upperSize;
2152  double totalSum = errorNorm*errorNorm*upperSize;
2153 
2154  for (int i=0;i<sumSize;++i)
2155  {
2156  double innerSum = innerErrorInfoVec[i].xErrorSum_p1;
2157  double innerSize = innerErrorInfoVec[i].innerSize;
2158 
2159  totalSize += innerSize;
2160  totalSum += innerSum;
2161  }
2162 
2163  double recip = 1.0/totalSize;
2164  errorNorm = sqrt(recip*totalSum);
2165  }
2166 
2167  return errorNorm;
2168 }
2169 
2170 //-----------------------------------------------------------------------------
2171 // Function : DataStore::delta_x_errorNorm_q1
2172 // Purpose :
2173 // Special Notes :
2174 // Scope : public
2175 // Creator : Eric Keiter
2176 // Creation Date : 03/15/07
2177 //-----------------------------------------------------------------------------
2179 {
2180  double errorNorm = 0.0;
2181  (qHistory[1])->wRMSNorm(*qErrWtVecPtr, &errorNorm);
2182 
2183  // This is for handling the total errorNorm for 2-level solves.
2184  // It really should get a separate overloaded function.
2185  if ( !(innerErrorInfoVec.empty()) )
2186  {
2187  double upperSize = newtonCorrectionPtr->globalLength();
2188  int sumSize = innerErrorInfoVec.size();
2189 
2190  double totalSize = upperSize;
2191  double totalSum = errorNorm*errorNorm*upperSize;
2192 
2193  for (int i=0;i<sumSize;++i)
2194  {
2195  double innerSum = innerErrorInfoVec[i].q1HistorySum;
2196  double innerSize = innerErrorInfoVec[i].innerSize;
2197 
2198  totalSize += innerSize;
2199  totalSum += innerSum;
2200  }
2201 
2202  double recip = 1.0/totalSize;
2203  errorNorm = sqrt(recip*totalSum);
2204  }
2205 
2206  return errorNorm;
2207 }
2208 
2209 //-----------------------------------------------------------------------------
2210 // Function : DataStore::stepLinearCombo
2211 // Purpose : setup the newtonCorrection vectors.
2212 // Special Notes :
2213 // Scope : public
2214 // Creator : Eric Keiter
2215 // Creation Date : 02/20/07
2216 //-----------------------------------------------------------------------------
2218 {
2219  // 03/16/04 tscoffe: update the newton correction. Note: this should be
2220  // available from NOX, but for now I'm going to do the difference anyway.
2221  newtonCorrectionPtr->linearCombo (1.0,*nextSolutionPtr,-1.0,*xn0Ptr);
2222 
2223  // We need to compute the correction in Q here
2224  // I'm assuming dsDaePtr_->daeQVectorPtr will be fresh from the end of the
2225  // nonlinear solve.
2226  qNewtonCorrectionPtr->linearCombo (1.0,*daeQVectorPtr,-1.0,*qn0Ptr);
2227 
2228  // We also need a State correction between the time steps
2229  sNewtonCorrectionPtr->linearCombo (1.0,*nextStatePtr,-1.0,*sn0Ptr);
2230 
2231  // We also need a Store correction between the time steps
2232  stoNewtonCorrectionPtr->linearCombo (1.0,*nextStorePtr,-1.0,*ston0Ptr);
2234 
2235  // This is for the lead current vector
2239  leadDeltaVNewtonCorrectionPtr->linearCombo (1.0, *nextLeadDeltaVPtr, -1.0, *leadDeltaVn0Ptr );
2240 
2241  if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
2242  {
2243  Xyce::dout() << "\n newtonCorrection: \n" << std::endl;
2244  newtonCorrectionPtr->printPetraObject(Xyce::dout());
2245  Xyce::dout() << std::endl;
2246  Xyce::dout() << "\n qNewtonCorrection: \n" << std::endl;
2247  qNewtonCorrectionPtr->printPetraObject(Xyce::dout());
2248  Xyce::dout() << "\n sNewtonCorrection: \n" << std::endl;
2249  sNewtonCorrectionPtr->printPetraObject(Xyce::dout());
2250  Xyce::dout() << std::endl;
2251  }
2252 }
2253 
2254 //-----------------------------------------------------------------------------
2255 // Function : DataStore::getSolnVarData
2256 // Purpose :
2257 // Special Notes :
2258 // Scope : public
2259 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
2260 // Creation Date : 7/27/06
2261 //-----------------------------------------------------------------------------
2262 bool
2264  const int & gid,
2265  std::vector<double> & varData )
2266 {
2267  varData.resize(23);
2268  int i=0;
2269  varData[i++] = tmpSolVectorPtr->getElementByGlobalIndex( gid );
2270  varData[i++] = currSolutionPtr->getElementByGlobalIndex( gid );
2271  varData[i++] = lastSolutionPtr->getElementByGlobalIndex( gid );
2272  varData[i++] = nextSolutionPtr->getElementByGlobalIndex( gid );
2273  varData[i++] = currSolutionDerivPtr->getElementByGlobalIndex( gid );
2274  varData[i++] = lastSolutionDerivPtr->getElementByGlobalIndex( gid );
2275  varData[i++] = nextSolutionDerivPtr->getElementByGlobalIndex( gid );
2276  varData[i++] = currSolutionDivDiffPtr->getElementByGlobalIndex( gid );
2277  varData[i++] = lastSolutionDivDiffPtr->getElementByGlobalIndex( gid );
2278  varData[i++] = nextSolutionDivDiffPtr->getElementByGlobalIndex( gid );
2279  varData[i++] = errWtVecPtr->getElementByGlobalIndex( gid );
2280  varData[i++] = absErrTolPtr->getElementByGlobalIndex( gid );
2281  varData[i++] = relErrTolPtr->getElementByGlobalIndex( gid );
2282  varData[i++] = newtonCorrectionPtr->getElementByGlobalIndex( gid );
2283  varData[i++] = qErrWtVecPtr->getElementByGlobalIndex ( gid );
2284  varData[i++] = daeQVectorPtr->getElementByGlobalIndex ( gid );
2285  varData[i++] = daeFVectorPtr->getElementByGlobalIndex ( gid );
2286  varData[i++] = daeBVectorPtr->getElementByGlobalIndex ( gid );
2287  varData[i++] = xn0Ptr->getElementByGlobalIndex ( gid );
2288  varData[i++] = qn0Ptr->getElementByGlobalIndex ( gid );
2289  varData[i++] = qpn0Ptr->getElementByGlobalIndex ( gid );
2290  varData[i++] = dFdxdVpVectorPtr->getElementByGlobalIndex ( gid );
2291  varData[i++] = dQdxdVpVectorPtr->getElementByGlobalIndex ( gid );
2292  return true;
2293 }
2294 
2295 //-----------------------------------------------------------------------------
2296 // Function : DataStore::getStateVarData
2297 // Purpose :
2298 // Special Notes :
2299 // Scope : public
2300 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
2301 // Creation Date : 7/27/06
2302 //-----------------------------------------------------------------------------
2303 bool DataStore::getStateVarData( const int & gid,
2304  std::vector<double> & varData )
2305 {
2306  int i=0;
2307  varData.resize( 14 );
2308  varData[i++] = tmpStaVectorPtr->getElementByGlobalIndex( gid );
2309  varData[i++] = tmpStaDerivPtr->getElementByGlobalIndex( gid );
2310  varData[i++] = tmpStaDivDiffPtr->getElementByGlobalIndex( gid );
2311  varData[i++] = currStatePtr->getElementByGlobalIndex( gid );
2312  varData[i++] = lastStatePtr->getElementByGlobalIndex( gid );
2313  varData[i++] = nextStatePtr->getElementByGlobalIndex( gid );
2314  varData[i++] = currStateDerivPtr->getElementByGlobalIndex( gid );
2315  varData[i++] = lastStateDerivPtr->getElementByGlobalIndex( gid );
2316  varData[i++] = nextStateDerivPtr->getElementByGlobalIndex( gid );
2317  varData[i++] = currStateDivDiffPtr->getElementByGlobalIndex( gid );
2318  varData[i++] = lastStateDivDiffPtr->getElementByGlobalIndex( gid );
2319  varData[i++] = nextStateDivDiffPtr->getElementByGlobalIndex( gid );
2320  varData[i++] = sn0Ptr->getElementByGlobalIndex( gid );
2321  varData[i++] = spn0Ptr->getElementByGlobalIndex( gid );
2322  return true;
2323 }
2324 
2325 
2326 //-----------------------------------------------------------------------------
2327 // Function : DataStore::getStoreVarData
2328 // Purpose :
2329 // Special Notes :
2330 // Scope : public
2331 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
2332 // Creation Date :
2333 //-----------------------------------------------------------------------------
2334 bool DataStore::getStoreVarData( const int & gid,
2335  std::vector<double> & varData )
2336 {
2337  int i=0;
2338  varData.resize( 6 );
2339  varData[i++] = tmpStoVectorPtr->getElementByGlobalIndex( gid );
2340  varData[i++] = currStorePtr->getElementByGlobalIndex( gid );
2341  varData[i++] = lastStorePtr->getElementByGlobalIndex( gid );
2342  varData[i++] = nextStorePtr->getElementByGlobalIndex( gid );
2343  varData[i++] = ston0Ptr->getElementByGlobalIndex( gid );
2344  varData[i++] = stopn0Ptr->getElementByGlobalIndex( gid );
2345  return true;
2346 }
2347 
2348 //-----------------------------------------------------------------------------
2349 // Function : DataStore::setSolnVarData
2350 // Purpose :
2351 // Special Notes :
2352 // Scope : public
2353 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
2354 // Creation Date : 7/27/06
2355 //-----------------------------------------------------------------------------
2356 bool DataStore::setSolnVarData( const int & gid,
2357  const std::vector<double> & varData )
2358 {
2359  int i=0;
2360  tmpSolVectorPtr->setElementByGlobalIndex ( gid, varData[i++] );
2361  currSolutionPtr->setElementByGlobalIndex ( gid, varData[i++] );
2362  lastSolutionPtr->setElementByGlobalIndex ( gid, varData[i++] );
2363  nextSolutionPtr->setElementByGlobalIndex ( gid, varData[i++] );
2364  currSolutionDerivPtr->setElementByGlobalIndex ( gid, varData[i++] );
2365  lastSolutionDerivPtr->setElementByGlobalIndex ( gid, varData[i++] );
2366  nextSolutionDerivPtr->setElementByGlobalIndex ( gid, varData[i++] );
2367  currSolutionDivDiffPtr->setElementByGlobalIndex( gid, varData[i++] );
2368  lastSolutionDivDiffPtr->setElementByGlobalIndex( gid, varData[i++] );
2369  nextSolutionDivDiffPtr->setElementByGlobalIndex( gid, varData[i++] );
2370  errWtVecPtr->setElementByGlobalIndex ( gid, varData[i++] );
2371  absErrTolPtr->setElementByGlobalIndex ( gid, varData[i++] );
2372  relErrTolPtr->setElementByGlobalIndex ( gid, varData[i++] );
2373  newtonCorrectionPtr->setElementByGlobalIndex ( gid, varData[i++] );
2374  qErrWtVecPtr->setElementByGlobalIndex ( gid, varData[i++] );
2375  daeQVectorPtr->setElementByGlobalIndex ( gid, varData[i++] );
2376  daeFVectorPtr->setElementByGlobalIndex ( gid, varData[i++] );
2377  daeBVectorPtr->setElementByGlobalIndex ( gid, varData[i++] );
2378  xn0Ptr->setElementByGlobalIndex ( gid, varData[i++] );
2379  qn0Ptr->setElementByGlobalIndex ( gid, varData[i++] );
2380  qpn0Ptr->setElementByGlobalIndex ( gid, varData[i++] );
2381  dFdxdVpVectorPtr->setElementByGlobalIndex ( gid, varData[i++] );
2382  dQdxdVpVectorPtr->setElementByGlobalIndex ( gid, varData[i++] );
2383  return true;
2384 }
2385 
2386 //-----------------------------------------------------------------------------
2387 // Function : DataStore::setStateVarData
2388 // Purpose :
2389 // Special Notes :
2390 // Scope : public
2391 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
2392 // Creation Date : 7/27/06
2393 //-----------------------------------------------------------------------------
2394 bool DataStore::setStateVarData( const int & gid,
2395  const std::vector<double> & varData )
2396 {
2397  int i=0;
2398  tmpStaVectorPtr->setElementByGlobalIndex ( gid, varData[i++] );
2399  tmpStaDerivPtr->setElementByGlobalIndex ( gid, varData[i++] );
2400  tmpStaDivDiffPtr->setElementByGlobalIndex ( gid, varData[i++] );
2401  currStatePtr->setElementByGlobalIndex ( gid, varData[i++] );
2402  lastStatePtr->setElementByGlobalIndex ( gid, varData[i++] );
2403  nextStatePtr->setElementByGlobalIndex ( gid, varData[i++] );
2404  currStateDerivPtr->setElementByGlobalIndex ( gid, varData[i++] );
2405  lastStateDerivPtr->setElementByGlobalIndex ( gid, varData[i++] );
2406  nextStateDerivPtr->setElementByGlobalIndex ( gid, varData[i++] );
2407  currStateDivDiffPtr->setElementByGlobalIndex( gid, varData[i++] );
2408  lastStateDivDiffPtr->setElementByGlobalIndex( gid, varData[i++] );
2409  nextStateDivDiffPtr->setElementByGlobalIndex( gid, varData[i++] );
2410 
2411  sn0Ptr->setElementByGlobalIndex ( gid, varData[i++] );
2412  spn0Ptr->setElementByGlobalIndex ( gid, varData[i++] );
2413  return true;
2414 }
2415 
2416 //-----------------------------------------------------------------------------
2417 // Function : DataStore::setStoreVarData
2418 // Purpose :
2419 // Special Notes :
2420 // Scope : public
2421 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
2422 // Creation Date : 7/27/06
2423 //-----------------------------------------------------------------------------
2424 bool DataStore::setStoreVarData( const int & gid,
2425  const std::vector<double> & varData )
2426 {
2427  int i=0;
2428  tmpStoVectorPtr->setElementByGlobalIndex ( gid, varData[i++] );
2429  currStorePtr->setElementByGlobalIndex ( gid, varData[i++] );
2430  lastStorePtr->setElementByGlobalIndex ( gid, varData[i++] );
2431  nextStorePtr->setElementByGlobalIndex ( gid, varData[i++] );
2432  ston0Ptr->setElementByGlobalIndex ( gid, varData[i++] );
2433  stopn0Ptr->setElementByGlobalIndex ( gid, varData[i++] );
2434  return true;
2435 }
2436 
2437 } // namespace TimeIntg
2438 } // namespace Xyce
Linear::Vector * lastSolutionPtr
std::vector< Linear::Vector * > fastTimeQVec
Linear::Vector * oldeSolutionDerivPtr
Linear::Vector * sNewtonCorrectionPtr
Linear::Vector * nextLeadCurrentQPtr
Linear::Vector * leadCurrentQn0Ptr
std::vector< double > timeSteps
std::vector< Linear::Vector * > oldeDXdpPtrVector
Linear::Vector * oldeStoreLeadCurrQDerivPtr
std::vector< int > indexMaskedVars
std::vector< Linear::Vector * > currDQdxDXdpDerivPtrVector
Linear::Vector * tmpLeadDeltaVPtr
Linear::Vector * lastLeadDeltaVPtr
std::vector< bool > timeStepsBreakpointFlag
std::vector< Linear::Vector * > nextDqdpPtrVector
std::vector< Linear::Vector * > oldeDqdpPtrVector
Linear::Vector * currStateDerivPtr
Linear::Vector * currStateDivDiffPtr
std::vector< std::vector< Linear::Vector * > > dQdxdXdpHistory
Linear::Vector * oldeSolutionDivDiffPtr
Linear::Vector * stoNewtonCorrectionPtr
Linear::Vector * qErrWtVecPtr
Pure virtual class to augment a linear system.
Linear::Vector * lastStateDerivPtr
Linear::Vector * nextSolutionDerivPtr
bool resetAll(double absolute_error_tolerance, double relative_error_tolerance)
Linear::Vector * lastStoreLeadCurrQDerivPtr
Linear::Vector * lastStoreLeadCurrQPtr
void allocateSensitivityArrays(Linear::Builder &builder, int numParams)
std::vector< Linear::Vector * > nextDXdpPtrVector
Linear::Vector * tmpStaVectorPtr
void outputSolDataArrays(std::ostream &os)
Linear::Vector * currStorePtr
Linear::Vector * lastStatePtr
std::vector< Linear::Vector * > leadDeltaVHistory
Linear::Vector * tmpSolVectorPtr
Linear::Vector * leadCurrentpn0Ptr
Linear::Vector * leadCurrentNewtonCorrectionPtr
std::vector< Linear::Vector * > nextDbdpPtrVector
double partialSum_m2(int currentOrder)
Linear::Vector * tmpStoVectorPtr
std::vector< Linear::Vector * > nextDfdpPtrVector
Linear::Vector * savedNextSolutionPtr
Linear::Vector * leadCurrentQDerivn0Ptr
std::vector< Linear::Vector * > nextDQdxDXdpDerivPtrVector
std::vector< Linear::Vector * > qHistory
std::vector< Linear::Vector * > fastTimeStateVec
Linear::Vector * nextLeadDeltaVPtr
Linear::Vector * currStatePtr
std::vector< Linear::Vector * > currDXdpPtrVector
std::vector< Linear::Vector * > leadCurrentHistory
std::vector< Linear::Vector * > fastTimeSolutionVec
Linear::Vector * leadDeltaVn0Ptr
std::vector< Linear::Vector * > oldeDQdxDXdpPtrVector
Linear::Vector * leadCurrentn0Ptr
Linear::Vector * oldeStatePtr
std::vector< TwoLevelError > innerErrorInfoVec
Linear::Vector * daeQVectorPtr
Linear::Vector * tmpLeadCurrentVectorPtr
std::vector< std::vector< Linear::Vector * > > dbdpHistory
Linear::Vector * oldeStateDivDiffPtr
double partialSum_p1(int currentOrder, int maxOrder)
Linear::Vector * tmpStaDerivPtr
Linear::Vector * lastLeadCurrentPtr
std::vector< Linear::Vector * > lastDQdxDXdpDerivPtrVector
Linear::Vector * deviceErrorWeightMask_
Linear::Vector * stopn0Ptr
void setErrorWtVector(const TIAParams &tia_params)
Linear::Vector * leadCurrentQpn0Ptr
std::vector< Linear::Vector * > oldeDqdpDerivPtrVector
Linear::Vector * oldeStoreLeadCurrQPtr
Linear::Vector * daeFVectorPtr
Linear::Vector * qNewtonCorrectionPtr
bool setStoreVarData(const int &gid, const std::vector< double > &varData)
Linear::Vector * currLeadCurrentQPtr
Linear::Vector * relErrTolPtr
bool getStateVarData(const int &gid, std::vector< double > &varData)
Linear::Vector * leadCurrentQDerivpn0Ptr
Linear::Vector * nextStoreLeadCurrQDerivPtr
std::vector< Linear::Vector * > currDqdpDerivPtrVector
Linear::Vector * leadCurrentQNewtonCorrectionPtr
Linear::Vector * errWtVecPtr
Linear::Vector * nextSolutionDivDiffPtr
std::vector< Linear::Vector * > leadCurrentQDerivHistory
Linear::Matrix * dFdxMatrixPtr
int maxOrder(const IO::CmdParse &command_line)
Linear::Vector * currLeadCurrentQDerivPtr
Linear::Vector * nextStatePtr
std::vector< Linear::Vector * > fastTimeStoreVec
std::vector< Linear::Vector * > leadCurrentQHistory
Linear::Vector * oldeStateDerivPtr
std::vector< Linear::Vector * > nextDqdpDerivPtrVector
Linear::Vector * oldLeadCurrentPtr
Linear::Vector * oldLeadDeltaVPtr
Linear::Vector * dFdxdVpVectorPtr
std::vector< std::vector< Linear::Vector * > > dqdpHistory
Linear::Vector * currLeadDeltaVPtr
Linear::Vector * oldeSolutionPtr
void outputPredictedSolution(std::ostream &os)
Linear::Vector * currStoreLeadCurrQPtr
bool getSolnVarData(const int &gid, std::vector< double > &varData)
bool setSolnVarData(const int &gid, const std::vector< double > &varData)
Linear::Vector * tmpStaDivDiffPtr
Linear::Vector * stoLeadCurrQNewtonCorrectionPtr
std::vector< std::vector< Linear::Vector * > > dfdpHistory
void outputPredictedDerivative(std::ostream &os)
Linear::Vector * lastStateDivDiffPtr
Linear::Vector * nextSolutionPtr
Linear::Vector * resMatVecPtr
Linear::Vector * tmpXn0BPtr
Linear::Vector * nextStorePtr
Linear::Vector * stoQn0Ptr
bool setStateVarData(const int &gid, const std::vector< double > &varData)
std::vector< Linear::Vector * > lastDqdpPtrVector
Linear::Vector * dQdxdVpVectorPtr
Linear::Vector * currSolutionDivDiffPtr
std::vector< Linear::Vector * > lastDqdpDerivPtrVector
Linear::Vector * lastSolutionDivDiffPtr
Linear::Vector * currLeadCurrentPtr
Linear::Vector * lastStorePtr
std::vector< Linear::Vector * > oldeDQdxDXdpDerivPtrVector
Linear::Vector * currSolutionDerivPtr
std::vector< Linear::Vector * > lastDQdxDXdpPtrVector
Linear::Vector * maxSolutionPtr
Linear::Vector * dQdxVecVectorPtr
Linear::Vector * lastLeadCurrentQDerivPtr
Linear::Vector * nextLeadCurrentQDerivPtr
bool setNextSolVectorPtr(Linear::Vector *solVecPtr)
Linear::Vector * tmpLeadCurrentQVectorPtr
Linear::Vector * newtonCorrectionPtr
Linear::Vector * tmpLeadCurrentQDerivVectorPtr
Linear::Vector * tmpXn0APtr
Linear::Vector * currSolutionPtr
std::vector< int > indexVVars
std::vector< Linear::Vector * > stoHistory
Linear::Vector * relSolutionPtr
Linear::Vector * dFdxVecVectorPtr
Linear::Vector * leadCurrentQDerivNewtonCorrectionPtr
Linear::Vector * stoQpn0Ptr
Linear::Vector * nextStoreLeadCurrQPtr
Linear::Vector * lastLeadCurrentQPtr
Linear::Vector * currStoreLeadCurrQDerivPtr
Linear::Vector * nextStateDerivPtr
Linear::Vector * oldLeadCurrentQPtr
std::vector< Linear::Vector * > xHistory
std::vector< Linear::Vector * > sensRHSPtrVector
bool getStoreVarData(const int &gid, std::vector< double > &varData)
Linear::Vector * oldeStorePtr
DataStore(int solution_size, int state_size, int max_order, const Linear::System &linear_system, const Linear::Builder &linear_system_builder)
Linear::Vector * lastSolutionDerivPtr
Linear::Matrix * dQdxMatrixPtr
Linear::Vector * oldLeadCurrentQDerivPtr
Linear::Vector * flagSolutionPtr
Linear::Vector * nextStateDivDiffPtr
std::vector< Linear::Vector * > currDQdxDXdpPtrVector
double partialSum_m1(int currentOrder)
std::vector< std::vector< Linear::Vector * > > dXdpHistory
Linear::Vector * daeBVectorPtr
Linear::Vector * leadDeltaVpn0Ptr
std::vector< Linear::Vector * > nextDQdxDXdpPtrVector
Linear::Vector * leadDeltaVNewtonCorrectionPtr
Linear::Vector * absErrTolPtr
Linear::System & linearSystem_
Definition: N_ANP_AC.C:961
std::vector< Linear::Vector * > currDqdpPtrVector
std::vector< Linear::Vector * > stoLeadCurrQHistory
void computeDivDiffsBlock(const std::list< IndexPair > &solGIDList, const std::list< IndexPair > &staGIDList)
Linear::Vector * nextLeadCurrentPtr
std::vector< Linear::Vector * > lastDXdpPtrVector
std::vector< Linear::Vector * > sHistory