Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_SolverState.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_SolverState.C,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
33 //
34 // Creation Date : 08/25/03
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.48 $
40 //
41 // Revision Date : $Date: 2014/08/07 23:08:53 $
42 //
43 // Current Owner : $Author: dgbaur $
44 //-----------------------------------------------------------------------------
45 
46 #include <Xyce_config.h>
47 
48 #include <iostream>
49 
50 #include <N_UTL_Expression.h>
51 #include <N_ERH_fwd.h>
52 #include <N_DEV_SolverState.h>
53 
54 namespace Xyce {
55 namespace Device {
56 
57 //-----------------------------------------------------------------------------
58 // Function : SolverState::SolverState
59 // Purpose : constructor
60 // Special Notes :
61 // Scope : public
62 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
63 // Creation Date : 08/25/03
64 //-----------------------------------------------------------------------------
66  pdt (0.0),
67  currTimeStep (0.0),
68  lastTimeStep (0.0),
69  currTime (0.0),
70  finalTime (0.0),
71  startingTimeStep (0.0),
72  bpTol (0.0),
73  acceptedTime (0.0),
74  currentOrder (0.0),
75  usedOrder (0.0), // BNB, integration order for 2-level stamp
76  currFastTime (0.0),
77  finalFastTime (0.0),
78  currentHoldTime (0.0),
79  mpdeOnFlag (false),
80  blockAnalysisFlag(false),
81  forceFinalOutput (false),
82  doubleDCOPEnabled(false),
83  doubleDCOPStep (0),
84  timeStepNumber (0),
85  ltraTimeIndex (0),
86  ltraTimeHistorySize (0),
87  ltraDoCompact (false),
88  initTranFlag (false),
89  sweepSourceResetFlag(false),
90  beginIntegrationFlag(true),
91  dcopFlag (true),
92  inputOPFlag (false),
93  transientFlag (true),
94  dcsweepFlag (false),
95  tranopFlag (true),
96  acopFlag (false),
97  PDESystemFlag (false),
98  newtonIter (0),
99  stepLoopIter (0),
100  locaEnabledFlag (false),
101  continuationStepNumber (0),
102  firstContinuationParam (true),
103  firstSolveComplete (false),
104  initJctFlag (false),
105  initFixFlag (false),
106  debugTimeFlag (false),
107  twoLevelNewtonCouplingMode (Nonlinear::FULL_PROBLEM),
108  PDEcontinuationFlag(false),
109  pdeAlpha (1.0),
110  chargeAlpha (1.0),
111  chargeHomotopy (false),
112  maxPDEContinuationSteps(10),
113  currPDEContinuationStep(0),
114  prevPDEContinuationStep(0),
115  artParameterFlag(false),
116  sizeParameterFlag(false),
117  gainScale (1, 1.0),
118  nltermScale (1.0),
119  sizeScale (1.0),
120  previousSizeScale (1.0),
121  bjtArtParameterFlag(false),
122  ACspecified(false),
123  TRANspecified(false),
124  DCspecified(false),
125  STEPspecified(false),
126  OPspecified(false),
127  MPDEspecified(false),
128  HBspecified(false)
129 {
130 }
131 
132 
133 //-----------------------------------------------------------------------------
134 // Function : SolverState::InitializeHomotopyBlockSize
135 // Purpose : constructor
136 // Special Notes :
137 // Scope : public
138 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
139 // Creation Date : 08/25/03
140 //-----------------------------------------------------------------------------
142 {
143  gainScale.resize(numBlocks, 1.0);
144 }
145 
146 
147 //-----------------------------------------------------------------------------
148 // Function : SolverState::operator<<
149 // Purpose : "<<" operator
150 // Special Notes :
151 // Scope : public
152 // Creator : Eric R. Keiter, SNL, Electrical and Microsystems Modeling
153 // Creation Date : 10/05/2005
154 //-----------------------------------------------------------------------------
155 std::ostream& operator<<(std::ostream & os, const SolverState & ss)
156 {
157 
158  os << section_divider << std::endl;
159  os << " Device Package Solver State:" << std::endl;
160 
161  os << " pdt = " << ss.pdt << std::endl;
162  os << " currTimeStep = " << ss.currTimeStep << std::endl;
163  os << " lastTimeStep = " << ss.lastTimeStep << std::endl;
164  os << " currTime = " << ss.currTime << std::endl;
165  os << " finalTime = " << ss.finalTime << std::endl;
166  os << " startingTimeStep = " << ss.startingTimeStep << std::endl;
167  os << " bpTol = " << ss.bpTol << std::endl;
168 
169  os << " acceptedTime = " << ss.acceptedTime << std::endl;
170  os << " currentOrder = " << ss.currentOrder << std::endl;
171  os << " usedOrder = " << ss.usedOrder << std::endl;
172 
173  os << " mpdeOnFlag = ";
174  if (ss.mpdeOnFlag)
175  {
176  os << "yes" << std::endl;
177  os << " currFastTime = " << ss.currFastTime << std::endl;
178  os << " finalFastTime = " << ss.finalFastTime << std::endl;
179  os << " blockAnalysisFlag = " << ss.blockAnalysisFlag << std::endl;
180  }
181  else
182  {
183  os << "no" << std::endl;
184  }
185 
186  os << " timeStepNumber = " << ss.timeStepNumber << std::endl;
187  os << " ltraTimeIndex = " << ss.ltraTimeIndex << std::endl;
188  os << " ltraTimeStepHistorySize = " << ss.ltraTimeHistorySize << std::endl;
189  os << " ltraDoCompact = " << ss.ltraDoCompact << std::endl;
190  os << " newtonIter = " << ss.newtonIter << std::endl;
191  os << " stepLoopIter = " << ss.stepLoopIter << std::endl;
192  os << " continuationStepNumber = " << ss.continuationStepNumber << std::endl;
193  os << " firstContinuationParam = ";
194  if (ss.firstContinuationParam) os << "yes" << std::endl;
195  else os << "no" << std::endl;
196 
197  os << " firstSolveComplete = ";
198  if (ss.firstSolveComplete) os << "yes" << std::endl;
199  else os << "no" << std::endl;
200 
201  os << " initTranFlag = ";
202  if (ss.initTranFlag) os << "yes" << std::endl;
203  else os << "no" << std::endl;
204 
205  os << " beginIntegrationFlag = ";
206  if (ss.beginIntegrationFlag) os << "yes" << std::endl;
207  else os << "no" << std::endl;
208 
209  os << " dcopFlag = ";
210  if (ss.dcopFlag) os << "yes" << std::endl;
211  else os << "no" << std::endl;
212 
213  os << " inputOPFlag = ";
214  if (ss.inputOPFlag) os << "yes" << std::endl;
215  else os << "no" << std::endl;
216 
217  os << " transientFlag = ";
218  if (ss.transientFlag) os << "yes" << std::endl;
219  else os << "no" << std::endl;
220 
221  os << " dcsweepFlag = ";
222  if (ss.dcsweepFlag) os << "yes" << std::endl;
223  else os << "no" << std::endl;
224 
225  os << " tranopFlag = ";
226  if (ss.tranopFlag) os << "yes" << std::endl;
227  else os << "no" << std::endl;
228 
229  os << " acopFlag = ";
230  if (ss.acopFlag) os << "yes" << std::endl;
231  else os << "no" << std::endl;
232 
233  os << " PDESystemFlag = ";
234  if (ss.PDESystemFlag) os << "yes" << std::endl;
235  else os << "no" << std::endl;
236 
237  os << " locaEnabledFlag = ";
238  if (ss.locaEnabledFlag) os << "yes" << std::endl;
239  else os << "no" << std::endl;
240 
241  os << " initJctFlag = ";
242  if (ss.initJctFlag) os << "yes" << std::endl;
243  else os << "no" << std::endl;
244 
245  os << " initFixFlag = ";
246  if (ss.initFixFlag) os << "yes" << std::endl;
247  else os << "no" << std::endl;
248 
249  os << " sweepSourceResetFlag = ";
250  if (ss.sweepSourceResetFlag) os << "yes" << std::endl;
251  else os << "no" << std::endl;
252 
253  os << " debugTimeFlag = ";
254  if (ss.debugTimeFlag) os << "yes" << std::endl;
255  else os << "no" << std::endl;
256 
257  os << section_divider << std::endl;
258  os << std::endl;
259 
260  return os;
261 }
262 
263 } // namespace Device
264 } // namespace Xyce
265