46 #include <Xyce_config.h>
48 #include <N_ERH_ErrorMgr.h>
49 #include <N_IO_CmdParse.h>
54 #include <N_UTL_FeatureTest.h>
55 #include <N_UTL_OptionBlock.h>
56 #include <N_UTL_Param.h>
72 printParamsFlag_(true),
75 debugMaxTimeStep_(Util::MachineDependentParams::IntMax()),
77 debugMaxTime_(Util::MachineDependentParams::DoubleMax()),
78 screenOutputFlag_(false),
151 : commandLine_(right.commandLine_),
152 absTol_(right.absTol_),
153 relTol_(right.relTol_),
154 INForcingFlag_(right.INForcingFlag_),
156 normLevel_(right.normLevel_),
157 linearOptimization_(right.linearOptimization_),
158 modeToggled_(right.modeToggled_),
159 printParamsFlag_(right.printParamsFlag_),
160 analysisMode_(right.analysisMode_),
161 maxNewtonStep_(right.maxNewtonStep_),
162 maxSearchStep_(right.maxSearchStep_),
163 nlStrategy_(right.nlStrategy_),
164 searchMethod_(right.searchMethod_),
165 direction_(right.direction_),
166 deltaXTol_(right.deltaXTol_),
167 RHSTol_(right.RHSTol_),
168 constraintBT_(right.constraintBT_),
169 globalBTMax_(right.globalBTMax_),
170 globalBTMin_(right.globalBTMin_),
171 globalBTChange_(right.globalBTChange_),
172 debugLevel_(right.debugLevel_),
173 debugMinTimeStep_(right.debugMinTimeStep_),
174 debugMaxTimeStep_(right.debugMaxTimeStep_),
175 debugMinTime_(right.debugMinTime_),
176 debugMaxTime_(right.debugMaxTime_)
209 for (Util::ParamList::const_iterator it_tpL = OB.begin();
210 it_tpL != OB.end(); ++ it_tpL)
212 if (it_tpL->uTag() ==
"ABSTOL")
214 setAbsTol(it_tpL->getImmutableValue<
double>());
216 else if (it_tpL->uTag() ==
"RELTOL")
218 setRelTol(it_tpL->getImmutableValue<
double>());
220 else if (it_tpL->uTag() ==
"DELTAXTOL")
224 else if (it_tpL->uTag() ==
"SMALLUPDATETOL")
228 else if (it_tpL->uTag() ==
"ENFORCEDEVICECONV")
232 else if (it_tpL->uTag() ==
"RHSTOL")
234 setRHSTol(it_tpL->getImmutableValue<
double>());
236 else if (it_tpL->uTag() ==
"MAXSTEP")
240 else if (it_tpL->uTag() ==
"LINOPT")
244 else if (it_tpL->uTag() ==
"CONSTRAINTBT")
248 else if (it_tpL->uTag() ==
"CONSTRAINTMAX")
252 else if (it_tpL->uTag() ==
"CONSTRAINTMIN")
256 else if (it_tpL->uTag() ==
"CONSTRAINTCHANGE")
260 else if (it_tpL->uTag() ==
"NLSTRATEGY")
264 else if (it_tpL->uTag() ==
"SEARCHMETHOD")
268 else if (it_tpL->uTag() ==
"MAXSEARCHSTEP")
272 else if (it_tpL->uTag() ==
"IN_FORCING")
276 else if (it_tpL->uTag() ==
"NORMLVL")
280 else if (it_tpL->uTag() ==
"NOX")
284 else if (it_tpL->uTag() ==
"MATRIXMARKET")
288 setMMFormat (static_cast<bool>(it_tpL->getImmutableValue<
double>()));
291 else if (it_tpL->uTag() ==
"DEBUGLEVEL")
298 else if (it_tpL->uTag() ==
"DEBUGMINTIMESTEP")
305 else if (it_tpL->uTag() ==
"DEBUGMAXTIMESTEP")
312 else if (it_tpL->uTag() ==
"DEBUGMINTIME")
319 else if (it_tpL->uTag() ==
"DEBUGMAXTIME")
326 else if (it_tpL->uTag() ==
"SCREENOUTPUT")
333 else if (NLS_MASKED_WRMS_NORMS && it_tpL->uTag() ==
"USEMASKING")
335 setMaskingFlag(static_cast<bool>(it_tpL->getImmutableValue<
double>()));
339 std::string tmp = it_tpL->uTag() +
340 " is not a recognized nonlinear solver option.\n";
341 N_ERH_ErrorMgr::report (N_ERH_ErrorMgr::USR_FATAL_0, tmp);
360 os <<
"\n" << std::endl
361 << Xyce::section_divider << std::endl;
362 os <<
"\n***** Nonlinear solver options:\n" << std::endl
371 os <<
"\tAnalysis Mode:\t\t" <<
analysisMode_ <<
"\t(DC Op)" << std::endl;
373 os <<
"\tAnalysis Mode:\t\t" <<
analysisMode_ <<
"\t(DC Sweep)" << std::endl;
375 os <<
"\tAnalysis Mode:\t\t" <<
analysisMode_ <<
"\t(Transient)" << std::endl;
379 os <<
"\tNL Strategy:\t\t" << strategy <<
"\t(None => Newton)" << std::endl;
381 os <<
"\tNL Strategy:\t\t" << strategy <<
"\t(Gradient)" << std::endl;
383 os <<
"\tNL Strategy:\t\t" << strategy <<
"\t(Newton/Gradient)" << std::endl;
385 os <<
"\tNL Strategy:\t\t" << strategy <<
"\t(Modified-Newton)" << std::endl;
387 os <<
"\tNL Strategy:\t\t" << strategy <<
"\t(Modified-Newton/Gradient)" << std::endl;
390 if (searchMethod ==
FULL)
391 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(None => Full Newton Steps)" << std::endl;
393 else if (searchMethod ==
DIVIDE)
394 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(Divide)" << std::endl;
397 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(Backtrack)" << std::endl;
400 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(Simple Backtrack)" << std::endl;
403 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(Bank and Rose Algorithm)" << std::endl;
405 else if (searchMethod ==
DESCENT)
406 os <<
"\tsearch method:\t\t" << searchMethod <<
"\t(Line Search)" << std::endl;
421 os << Xyce::section_divider <<
"\n" << std::endl;
482 if (DEBUG_NONLINEAR &&
commandLine_->argExists(
"-ndl" ))
void setForcingFlag(bool flag)
void setSearchMethod(LineSearchMethod method)
void setGlobalBTMin(double value)
Pure virtual class to augment a linear system.
void resetEnforceDeviceConvFlag()
double getSmallUpdateTol() const
void setDebugMinTime(double value)
unsigned getMaxNewtonStep() const
void setMaxSearchStep(unsigned maxSearchStep)
void setSmallUpdateTol(double Tolerance)
void setScreenOutputFlag(bool bval)
int getDebugLevel() const
void setEnforceDeviceConvFlag(bool flag)
void setNLStrategy(NLStrategy strategy)
void setConstraintBT(bool flag)
NLParams(AnalysisMode mode, const IO::CmdParse &cp)
void setDebugMinTimeStep(int value)
void setGlobalBTChange(double value)
AnalysisMode analysisMode_
LineSearchMethod getSearchMethod() const
void setDeltaXTol(double Tolerance)
NLParams & operator=(const NLParams &right)
bool getConstraintBT() const
LineSearchMethod searchMethod_
void setRelTol(double Tolerance)
void setDebugLevel(int value)
void setMaskingFlag(bool bval)
void resetMaxNewtonStep()
void setDebugMaxTimeStep(int value)
bool getLinearOpt() const
void setNormLevel(int level)
void resetGlobalBTChange()
void setAbsTol(double Tolerance)
void setGlobalBTMax(double value)
const IO::CmdParse * commandLine_
int getDebugMinTimeStep() const
void setMMFormat(bool value)
double getDeltaXTol() const
void printParams(std::ostream &os)
void setLinearOpt(bool flag)
void setMaxNewtonStep(unsigned maxNewtonStep)
NLStrategy getNLStrategy() const
void resetSmallUpdateTol()
bool setOptions(const Util::OptionBlock &OB)
int getDebugMaxTimeStep() const
void setRHSTol(double Tolerance)
bool getForcingFlag() const
void resetMaxSearchStep()
void setDebugMaxTime(double value)
unsigned getMaxSearchStep() const