46 #include <Xyce_config.h>
53 #include <N_ERH_ErrorMgr.h>
56 #include <N_UTL_Param.h>
57 #include <N_UTL_OptionBlock.h>
59 #include <N_IO_CmdParse.h>
79 #ifdef Xyce_VERBOSE_NONLINEAR
80 printParamsFlag_(true),
82 #ifdef Xyce_DEBUG_NONLINEAR
85 debugMaxTimeStep_(N_UTL_MachineDependentParams::IntMax()),
87 debugMaxTime_(N_UTL_MachineDependentParams::DoubleMax()),
88 screenOutputFlag_(false),
170 : commandLine_(right.commandLine_),
171 absTol_(right.absTol_),
172 relTol_(right.relTol_),
173 INForcingFlag_(right.INForcingFlag_),
175 normLevel_(right.normLevel_),
176 linearOptimization_(right.linearOptimization_),
177 modeToggled_(right.modeToggled_),
178 #ifdef Xyce_VERBOSE_NONLINEAR
179 printParamsFlag_(right.printParamsFlag_),
181 analysisMode_(right.analysisMode_),
182 maxNewtonStep_(right.maxNewtonStep_),
183 maxSearchStep_(right.maxSearchStep_),
184 nlStrategy_(right.nlStrategy_),
185 searchMethod_(right.searchMethod_),
186 direction_(right.direction_),
187 deltaXTol_(right.deltaXTol_),
188 RHSTol_(right.RHSTol_),
189 constraintBT_(right.constraintBT_),
190 globalBTMax_(right.globalBTMax_),
191 globalBTMin_(right.globalBTMin_),
192 globalBTChange_(right.globalBTChange_)
193 #ifdef Xyce_DEBUG_NONLINEAR
195 debugLevel_(right.debugLevel_),
196 debugMinTimeStep_(right.debugMinTimeStep_),
197 debugMaxTimeStep_(right.debugMaxTimeStep_),
198 debugMinTime_(right.debugMinTime_),
199 debugMaxTime_(right.debugMaxTime_)
233 for (std::list<N_UTL_Param>::const_iterator it_tpL = OB.getParams().begin();
234 it_tpL != OB.getParams().end(); ++ it_tpL)
236 if (it_tpL->uTag() ==
"ABSTOL")
238 setAbsTol(it_tpL->getImmutableValue<
double>());
240 else if (it_tpL->uTag() ==
"RELTOL")
242 setRelTol(it_tpL->getImmutableValue<
double>());
244 else if (it_tpL->uTag() ==
"DELTAXTOL")
248 else if (it_tpL->uTag() ==
"SMALLUPDATETOL")
252 else if (it_tpL->uTag() ==
"ENFORCEDEVICECONV")
256 else if (it_tpL->uTag() ==
"RHSTOL")
258 setRHSTol(it_tpL->getImmutableValue<
double>());
260 else if (it_tpL->uTag() ==
"MAXSTEP")
264 else if (it_tpL->uTag() ==
"LINOPT")
268 else if (it_tpL->uTag() ==
"CONSTRAINTBT")
272 else if (it_tpL->uTag() ==
"CONSTRAINTMAX")
276 else if (it_tpL->uTag() ==
"CONSTRAINTMIN")
280 else if (it_tpL->uTag() ==
"CONSTRAINTCHANGE")
284 else if (it_tpL->uTag() ==
"NLSTRATEGY")
288 else if (it_tpL->uTag() ==
"SEARCHMETHOD")
292 else if (it_tpL->uTag() ==
"MAXSEARCHSTEP")
296 else if (it_tpL->uTag() ==
"IN_FORCING")
300 else if (it_tpL->uTag() ==
"NORMLVL")
304 else if (it_tpL->uTag() ==
"NOX")
308 else if (it_tpL->uTag() ==
"MATRIXMARKET")
310 #ifdef Xyce_DEBUG_NONLINEAR
311 setMMFormat (static_cast<bool>(it_tpL->getImmutableValue<
double>()));
314 else if (it_tpL->uTag() ==
"DEBUGLEVEL")
316 #ifdef Xyce_DEBUG_NONLINEAR
320 else if (it_tpL->uTag() ==
"DEBUGMINTIMESTEP")
322 #ifdef Xyce_DEBUG_NONLINEAR
326 else if (it_tpL->uTag() ==
"DEBUGMAXTIMESTEP")
328 #ifdef Xyce_DEBUG_NONLINEAR
332 else if (it_tpL->uTag() ==
"DEBUGMINTIME")
334 #ifdef Xyce_DEBUG_NONLINEAR
338 else if (it_tpL->uTag() ==
"DEBUGMAXTIME")
340 #ifdef Xyce_DEBUG_NONLINEAR
344 else if (it_tpL->uTag() ==
"SCREENOUTPUT")
346 #ifdef Xyce_DEBUG_NONLINEAR
352 std::string tmp = it_tpL->uTag() +
353 " is not a recognized nonlinear solver option.\n";
354 N_ERH_ErrorMgr::report (N_ERH_ErrorMgr::USR_FATAL_0, tmp);
373 os <<
"\n" << std::endl
374 << Xyce::section_divider << std::endl;
375 os <<
"\n***** Nonlinear solver options:\n" << std::endl
384 os <<
"\tAnalysis Mode:\t\t" <<
analysisMode_ <<
"\t(DC Op)" << std::endl;
386 os <<
"\tAnalysis Mode:\t\t" <<
analysisMode_ <<
"\t(DC Sweep)" << std::endl;
388 os <<
"\tAnalysis Mode:\t\t" <<
analysisMode_ <<
"\t(Transient)" << std::endl;
392 os <<
"\tNL Strategy:\t\t" << strategy <<
"\t(None => Newton)" << std::endl;
394 os <<
"\tNL Strategy:\t\t" << strategy <<
"\t(Gradient)" << std::endl;
396 os <<
"\tNL Strategy:\t\t" << strategy <<
"\t(Newton/Gradient)" << std::endl;
398 os <<
"\tNL Strategy:\t\t" << strategy <<
"\t(Modified-Newton)" << std::endl;
400 os <<
"\tNL Strategy:\t\t" << strategy <<
"\t(Modified-Newton/Gradient)" << std::endl;
403 if (searchMethod ==
FULL)
404 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(None => Full Newton Steps)" << std::endl;
406 else if (searchMethod ==
DIVIDE)
407 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(Divide)" << std::endl;
410 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(Backtrack)" << std::endl;
413 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(Simple Backtrack)" << std::endl;
416 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(Bank and Rose Algorithm)" << std::endl;
418 else if (searchMethod ==
DESCENT)
419 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(Line Search)" << std::endl;
426 #ifdef Xyce_DEBUG_NONLINEAR
431 << Xyce::section_divider <<
"\n" << std::endl;
467 #ifdef Xyce_DEBUG_NONLINEAR
490 #ifdef Xyce_DEBUG_NONLINEAR