Xyce  6.1
N_DEV_SolverState.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2015 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-----------------------------------------------------------------------------
26 // Filename : $RCSfile: N_DEV_SolverState.h,v $
27 //
28 // Purpose : This is a container class for solver information.
29 // It may occasionally contain stuff that isn't strictly
30 // pertaining to the solver state, but that is its primary
31 // intention.
32 //
33 // In general, stuff that goes into this class should
34 // be stuff needed by more than one device instance type.
35 //
36 // Special Notes :
37 //
38 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
39 //
40 // Creation Date : 02/28/00
41 //
42 // Revision Information:
43 // ---------------------
44 //
45 // Revision Number: $Revision: 1.78.2.1 $
46 //
47 // Revision Date : $Date: 2015/04/02 18:20:09 $
48 //
49 // Current Owner : $Author: tvrusso $
50 //-----------------------------------------------------------------------------
51 
52 
53 #ifndef Xyce_N_DEV_SolverState_h
54 #define Xyce_N_DEV_SolverState_h
55 
56 #include <map>
57 #include <string>
58 #include <vector>
59 
60 #include <N_UTL_fwd.h>
61 #include <N_DEV_fwd.h>
62 #include <N_NLS_TwoLevelEnum.h>
63 #include <N_NLS_NonLinInfo.h>
64 #include <N_TIA_TimeIntInfo.h>
65 
66 namespace Xyce {
67 namespace Device {
68 
69 struct Globals
70 {
72  std::vector<Util::Expression> global_expressions;
73  std::vector<std::string>global_exp_names;
74 };
75 
76 //-----------------------------------------------------------------------------
77 // Class : SolverState
78 // Purpose : Container for current solver data.
79 // Special Notes :
80 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
81 // Creation Date : 2/25/02
82 //-----------------------------------------------------------------------------
84 {
85  friend std::ostream& operator<<(std::ostream& os, const SolverState & ss);
86 
87 public:
88  SolverState ();
89 
90  void initializeHomotopyBlockSize(int numBlocks);
91 
92 public:
93  double pdt; // alpha/dt
94  double currTimeStep;
95  double lastTimeStep;
96  double currTime;
97  double finalTime;
99  double bpTol;
100  double acceptedTime; // for habanero
101  double currentOrder, usedOrder; // BNB, integration order for 2-level stamp
102 
103  std::vector<double> timePoints;
104 
105  // MPDE stuff
106  double currFastTime;
108  double currentHoldTime; // this is the time the slow sources should use to evalulate
109  // their value during an MPDE initial conditon (typically zero, but
110  // it can be anything).
111  bool mpdeOnFlag; // This indicates the MPDE phase of the problem (ie not initial condition)
112  bool blockAnalysisFlag; // This indicates an MPDE/HB run. This is true during both IC and MPDE/HB phase.
113 
114  // output flag:
116 
117  bool doubleDCOPEnabled; // true if taking 2 DCOP steps for PDE sim.
118  int doubleDCOPStep; // 0 or 1. (first or second "double" DCOP).
119 
121 
122  Globals &getGlobals() const {
123  return const_cast<Globals &>(globals_);
124  }
125 
127 
128  // The following "ltra*" data structures are used to track time history for
129  // the LTRA device. It requires an independent time history because
130  // it can be compacted if the user specifies that option. With no
131  // compaction ltraTimeStepNumber will be equal to timeStepNumber+1.
134  mutable bool ltraDoCompact;
135  std::vector<double> ltraTimePoints;
136 
141 
142  bool initTranFlag; // true only on very first(t=0) time step.
143  bool beginIntegrationFlag;// true if 1st time step out of breakpoint (incl. t=0)
144 
145  bool dcopFlag; // true if we are in a DCOP calculation (sweep, tranop or OP)
146  bool inputOPFlag; // true if starting from a previous OP calculation
147 
148  bool transientFlag; // true if transient analysis(even during tranop)
149  bool dcsweepFlag; // true if DC Sweep or OP calculation.
150  bool tranopFlag; // true if in dcop phase of transient sim.
151  bool acopFlag; // true if in acop phase of ac sim.
152  bool PDESystemFlag; // true if circuit includes a PDE device.
153 
154  bool locaEnabledFlag; // true if LOCA is enabled for DCOP.
155 
156  bool initJctFlag; // true if on the first newton step of the
157  // first dcop solve of the first .STEP iteration.
158 
159  bool initFixFlag; // true if DCOP solve, not first iteration *AND*
160  // any device not converged. Allows "OFF" to be
161  // applied.
162 
165 
167 
168  // pde device BC homotopy/ two-level newton
169  double pdeAlpha;
170  bool PDEcontinuationFlag; // if true, continuation is being used.
172  int currPDEContinuationStep; // this may become obsolete...
174 
176  double chargeAlpha;
177 
178  // mosfet homotopy variables:
180  std::vector<double> gainScale;
181  double nltermScale;
182 
184  double sizeScale;
186 
187  // BJT homotopy variables
189 
190  // 2-level info:
192 
193  // analysis options (for now bools that say what type of "." line was present in netlist)
197 };
198 
199 } // namespace Device
200 } // namespace Xyce
201 
202 #endif
203 
std::vector< std::string > global_exp_names
Globals & getGlobals() const
Pure virtual class to augment a linear system.
std::vector< double > ltraTimePoints
TimeIntg::TimeIntInfo twoLevelTimeIntgInfo
void initializeHomotopyBlockSize(int numBlocks)
std::vector< double > gainScale
std::vector< Util::Expression > global_expressions
Nonlinear::TwoLevelNewtonMode twoLevelNewtonCouplingMode
unordered_map< std::string, double, HashNoCase, EqualNoCase > GlobalParameterMap
Definition: N_DEV_fwd.h:161
friend std::ostream & operator<<(std::ostream &os, const SolverState &ss)
GlobalParameterMap global_params
std::vector< double > timePoints