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.105 $
42 //
43 // Revision Date : $Date: 2015/05/15 13:55:05 $
44 //
45 // Current Owner : $Author: dgbaur $
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  static void populateMetadata(IO::PkgOptionsMgr &options_manager);
78 
79  TIAParams();
80  TIAParams(const TIAParams &);
81 
82  TIAParams &operator=(const TIAParams & right);
83  ~TIAParams();
84 
85  void setMaxOrder(int max_order);
86 
87  bool setTimeIntegratorOption(const Util::Param &param);
88  bool setAnalysisOption(const Util::Param &param);
89 
90  // Print out time-integration parameters.
91  void printParams(std::ostream &os, int analysis) const;
92 
93 public:
94  double initialTime; ///< Beginning time for the time integrator (StepErrorControl, integrators access from StepErrorControl)
95  double finalTime; ///< End time for simulation
96  double initialTimeStep; ///< User specified initial time step
97  double minTimeStep; ///< User specified minimum time step
99  int minTimeStepsBP; ///< User specified mininum number of steps between breakpoints
101  double maxTimeStep; ///< User specified maximum time step
103  bool constantTimeStepFlag; ///< Constant time step integration flag
104  double restartTimeStepScale; ///< Time step is scaled coming out of a breakpoint (StepErrorControl)
105 
106  double initialOutputTime; ///< Time at which output starts (StepErrorControl)
108 
109  bool useDeviceTimeStepMaxFlag; ///< True if devices impose a time step maximum
110 
111  int errorAnalysisOption; ///< Error analysis option
112  int errorAnalysisOptionResetCount; ///< Iteration count down to reset errorAnalysisOption to LOCAL_TRUNCATED_ESTIMATES
113 
114  bool bpEnable; ///< Enable breakpoints flag
115 
116  // Iteration count algorithm parameters
117  int NLmin;
118  int NLmax;
119  double delmax;
123 
125 
126  int newLte;
127 
128  // Error Tolerances:
129 
130  // Relative error tolerance. This value should be selected to be 10^(-(m+1))
131  // where m is the desired number of significant digits in the solution.
132  double relErrorTol;
134 
135  // Absolute error tolerance. In general, this should be selected to be small
136  // enough such that any solution value smaller than this tolerance will be
137  // considered "insignificant".
138  double absErrorTol;
139 
140  // Error acceptance tolerance.
142 
143  // Jacobian limit - to prevent capacitive spiral of death!
145  double jacLimit;
146 
147  // Maximum/Minimum order desired (BackwardDifferentiation15 specific)
148  int maxOrder;
149  int minOrder;
150 
151  // flag for interpolated output
153 
154  // if we have rejected several time steps and are about to fail due to a
155  // time step too smal error, we'll go back and accept the step that had
156  // the minimum estimated error over tol if this flag is true.
157  // (set by the user in the netlist via .options timeint mintimesteprecovery=<int>)
159 };
160 
161 // To be moved??
162 
163 // errorAnalysisOptionResetCount
164 // minTimeStepRecoveryCounter
165 
166 // Used by TimeIntegrationMethods and StepErrorControl
167 // NLmax
168 // constantTimeStepFlag
169 // errorAnalysisOption
170 
171 // Used by WorkingIntegrationMethod
172 // jacLimitFlag
173 // jacLimit
174 
175 // Used by StepErrorControl
176 // NLmax
177 // constantTimeStepFlag
178 // delmax
179 // delmaxGiven
180 // errTolAcceptance
181 // errorAnalysisOption
182 // finalTime
183 // initialOutputTime
184 // initialTime
185 // initialTimeStep
186 // maxTimeStep
187 // maxTimeStepGiven
188 // minTimeStep
189 // minTimeStepGiven
190 // newBPStepping
191 // restartTimeStepScale
192 // testFirstStep
193 // timestepsReversal
194 // useDeviceTimeStepMaxFlag
195 // userSpecBreakPoints
196 
197 // Used by Gear12
198 // NLmax
199 // NLmin
200 // constantTimeStepFlag
201 // errorAnalysisOption
202 // interpOutputFlag
203 // maxOrder
204 // minOrder
205 
206 // Used by BackwardDifferentiation15
207 // constantTimeStepFlag
208 // errorAnalysisOption
209 // interpOutputFlag
210 // maxOrder
211 // minOrder
212 
213 // Used by OneStep
214 // NLmax
215 // NLmin
216 // constantTimeStepFlag
217 // errorAnalysisOption
218 // interpOutputFlag
219 // maxOrder
220 // minOrder
221 
222 // Used by DataStore
223 // newLte
224 // maxOrder (indirectly)
225 // absErrorTol (indirectly)
226 // relErrorTol (indirectly)
227 
228 } // namespace TimeIntg
229 } // namespace Xyce
230 
231 #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)
static void populateMetadata(IO::PkgOptionsMgr &options_manager)