Xyce  6.1
N_TIA_TIAParams.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_TIA_TIAParams.h,v $
27 //
28 // Purpose : This file identifies the class associated with all user
29 // specified parameters which relate to the time integration
30 // algorithms and problem definition.
31 //
32 // Special Notes :
33 //
34 // Creator : Buddy Watts
35 //
36 // Creation Date : 6/1/00
37 //
38 // Revision Information:
39 // ---------------------
40 //
41 // Revision Number: $Revision: 1.101.2.1 $
42 //
43 // Revision Date : $Date: 2015/04/02 18:20:18 $
44 //
45 // Current Owner : $Author: tvrusso $
46 //-----------------------------------------------------------------------------
47 
48 #ifndef Xyce_N_TIA_PARAMS_H
49 #define Xyce_N_TIA_PARAMS_H
50 
51 #include <list>
52 #include <string>
53 #include <vector>
54 
55 #include <N_IO_fwd.h>
56 #include <N_UTL_Param.h>
57 
58 namespace Xyce {
59 namespace TimeIntg {
60 
61 int maxOrder(const IO::CmdParse &command_line);
62 
64 
65 //-----------------------------------------------------------------------------
66 // Class : TIAParams::TIAParams
67 // Purpose : This is a class that sets up time integration information,
68 // associated with user related input only, that defines the
69 // problem setup.
70 // Special Notes :
71 // Creator : Buddy Watts, SNL
72 // Creation Date : 6/01/00
73 //-----------------------------------------------------------------------------
74 class TIAParams
75 {
76 public:
77  TIAParams();
78  TIAParams(const TIAParams &);
79 
80  TIAParams &operator=(const TIAParams & right);
81  ~TIAParams();
82 
83  void setMaxOrder(int max_order);
84 
85  bool setTimeIntegratorOption(const Util::Param &param);
86  bool setAnalysisOption(const Util::Param &param);
87 
88  // Print out time-integration parameters.
89  void printParams(std::ostream &os, int analysis) const;
90 
91 public:
92  double initialTime; ///< Beginning time for the time integrator (StepErrorControl, integrators access from StepErrorControl)
93  double finalTime; ///< End time for simulation
94  double initialTimeStep; ///< User specified initial time step
95  double minTimeStep; ///< User specified minimum time step
97  int minTimeStepsBP; ///< User specified mininum number of steps between breakpoints
99  double maxTimeStep; ///< User specified maximum time step
101  bool constantTimeStepFlag; ///< Constant time step integration flag
102  double restartTimeStepScale; ///< Time step is scaled coming out of a breakpoint (StepErrorControl)
103 
104  double initialOutputTime; ///< Time at which output starts (StepErrorControl)
106 
107  bool useDeviceTimeStepMaxFlag; ///< True if devices impose a time step maximum
108 
109  int errorAnalysisOption; ///< Error analysis option
110  int errorAnalysisOptionResetCount; ///< Iteration count down to reset errorAnalysisOption to LOCAL_TRUNCATED_ESTIMATES
111 
112  bool bpEnable; ///< Enable breakpoints flag
113 
114  // Iteration count algorithm parameters
115  int NLmin;
116  int NLmax;
117  double delmax;
121 
123  bool newLte;
124 
125  // Error Tolerances:
126 
127  // Relative error tolerance. This value should be selected to be 10^(-(m+1))
128  // where m is the desired number of significant digits in the solution.
129  double relErrorTol;
131 
132  // Absolute error tolerance. In general, this should be selected to be small
133  // enough such that any solution value smaller than this tolerance will be
134  // considered "insignificant".
135  double absErrorTol;
136 
137  // Error acceptance tolerance.
139 
140  // Jacobian limit - to prevent capacitive spiral of death!
142  double jacLimit;
143 
144  // Maximum/Minimum order desired (BackwardDifferentiation15 specific)
145  int maxOrder;
146  int minOrder;
147 
148  // flag for interpolated output
150 
151  // if we have rejected several time steps and are about to fail due to a
152  // time step too smal error, we'll go back and accept the step that had
153  // the minimum estimated error over tol if this flag is true.
154  // (set by the user in the netlist via .options timeint mintimesteprecovery=<int>)
156 };
157 
158 // To be moved??
159 
160 // errorAnalysisOptionResetCount
161 // minTimeStepRecoveryCounter
162 
163 // Used by TimeIntegrationMethods and StepErrorControl
164 // NLmax
165 // constantTimeStepFlag
166 // errorAnalysisOption
167 
168 // Used by WorkingIntegrationMethod
169 // jacLimitFlag
170 // jacLimit
171 
172 // Used by StepErrorControl
173 // NLmax
174 // constantTimeStepFlag
175 // delmax
176 // delmaxGiven
177 // errTolAcceptance
178 // errorAnalysisOption
179 // finalTime
180 // initialOutputTime
181 // initialTime
182 // initialTimeStep
183 // maxTimeStep
184 // maxTimeStepGiven
185 // minTimeStep
186 // minTimeStepGiven
187 // newBPStepping
188 // restartTimeStepScale
189 // testFirstStep
190 // timestepsReversal
191 // useDeviceTimeStepMaxFlag
192 // userSpecBreakPoints
193 
194 // Used by Gear12
195 // NLmax
196 // NLmin
197 // constantTimeStepFlag
198 // errorAnalysisOption
199 // interpOutputFlag
200 // maxOrder
201 // minOrder
202 
203 // Used by BackwardDifferentiation15
204 // constantTimeStepFlag
205 // errorAnalysisOption
206 // interpOutputFlag
207 // maxOrder
208 // minOrder
209 
210 // Used by OneStep
211 // NLmax
212 // NLmin
213 // constantTimeStepFlag
214 // errorAnalysisOption
215 // interpOutputFlag
216 // maxOrder
217 // minOrder
218 
219 // Used by DataStore
220 // newLte
221 // maxOrder (indirectly)
222 // absErrorTol (indirectly)
223 // relErrorTol (indirectly)
224 
225 } // namespace TimeIntg
226 } // namespace Xyce
227 
228 #endif // Xyce_N_TIA_TIAParams_H
bool setAnalysisOption(const Util::Param &param)
double initialTimeStep
User specified initial time step.
bool setTimeIntegratorOption(const Util::Param &param)
Pure virtual class to augment a linear system.
int errorAnalysisOptionResetCount
Iteration count down to reset errorAnalysisOption to LOCAL_TRUNCATED_ESTIMATES.
int errorAnalysisOption
Error analysis option.
double finalTime
End time for simulation.
double maxTimeStep
User specified maximum time step.
void setMaxOrder(int max_order)
double minTimeStep
User specified minimum time step.
bool constantTimeStepFlag
Constant time step integration flag.
int minTimeStepsBP
User specified mininum number of steps between breakpoints.
bool bpEnable
Enable breakpoints flag.
double restartTimeStepScale
Time step is scaled coming out of a breakpoint (StepErrorControl)
void printParams(std::ostream &os, int analysis) const
int maxOrder(const IO::CmdParse &command_line)
double initialOutputTime
Time at which output starts (StepErrorControl)
double initialTime
Beginning time for the time integrator (StepErrorControl, integrators access from StepErrorControl) ...
bool useDeviceTimeStepMaxFlag
True if devices impose a time step maximum.
TIAParams & operator=(const TIAParams &right)