39 #include <Xyce_config.h>
49 #include <N_ERH_Progress.h>
50 #include <N_IO_CmdParse.h>
51 #include <N_IO_OutputMgr.h>
52 #include <N_IO_PkgOptionsMgr.h>
53 #include <N_IO_RestartMgr.h>
54 #include <N_LAS_System.h>
57 #include <N_MPDE_Manager.h>
59 #include <N_PDS_Comm.h>
60 #include <N_PDS_Serial.h>
61 #include <N_PDS_MPI.h>
67 #include <N_TOP_Topology.h>
68 #include <N_UTL_Diagnostic.h>
69 #include <N_UTL_ExpressionData.h>
70 #include <N_UTL_ExtendedString.h>
71 #include <N_UTL_FeatureTest.h>
72 #include <N_UTL_MachDepParams.h>
73 #include <N_UTL_NoCase.h>
74 #include <N_UTL_Param.h>
75 #include <N_UTL_Timer.h>
91 Linear::System & linear_system,
93 Topo::Topology & topology,
96 N_MPDE_Manager * mpde_manager)
99 comm_(analysis_manager.getPDSManager()->getPDSComm()->comm()),
101 loader_(analysis_manager.getLoader()),
105 outputManagerAdapter_(analysis_manager.getOutputManagerAdapter()),
106 outputAdapter_(output_adapter),
108 sensFlag_(analysis_manager.getSensFlag()),
109 initialIntegrationMethod_(TimeIntg::OneStep::type),
110 firstTranOutput_(true),
117 maxTimeStepExpressionString_(),
118 maxTimeStepExpression_(0),
120 oldPercentComplete(0.0),
126 integrationMethod(7),
127 historyTrackingDepth(25),
129 saveTimeStepsFlag(false),
131 condTestDeviceNames(),
132 outputInterpMPDE(true),
133 hbAnalysis_(hb_analysis),
134 mpdeManager_(mpde_manager)
173 for (Util::ParamList::const_iterator it = paramsBlock.begin(), end = paramsBlock.end(); it != end; ++it)
175 const Util::Param ¶m = *it;
179 else if (param.uTag() ==
"NOOP" ||
180 param.uTag() ==
"UIC")
184 else if (param.uTag() ==
"MAXTIMEEXPRESSION")
197 Report::UserError() << param.uTag() <<
" is not a recognized analysis option";
204 <<
" Check netlist for invalid .TRAN specification";
215 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
218 << section_divider << std::endl
219 <<
" Transient simulation parameters" << std::endl
227 dout() <<
" NOOP/UIC is NOT set" << std::endl;
231 dout() <<
" NOOP/UIC is set" << std::endl;
234 dout() << section_divider << std::endl;
278 const Util::OptionBlock & option_block)
280 for (Util::ParamList::const_iterator it = option_block.begin(), end = option_block.end(); it != end; ++it)
282 const Util::Param ¶m = (*it);
284 if (param.uTag() ==
"METHOD")
286 if (param.isInteger())
290 ExtendedString stringVal ( param.stringValue() );
293 if (stringVal ==
"TRAP" || stringVal ==
"TRAPEZOIDAL")
295 else if (stringVal ==
"BDF")
297 else if (stringVal ==
"GEAR")
301 Report::UserError0() <<
"Unsupported transient method type";
306 else if (param.uTag()==
"EXITTIME" )
307 exitTime = param.getImmutableValue<
double>();
308 else if (param.uTag()==
"EXITSTEP" )
309 exitStep = param.getImmutableValue<
int>();
310 else if (param.uTag() ==
"HISTORYTRACKINGDEPTH" )
312 else if (param.uTag() ==
"PASSNLSTALL")
314 else if (param.uTag() ==
"CONDTEST")
315 condTestFlag = static_cast<bool> (param.getImmutableValue<
int>());
316 else if (param.uTag() ==
"CONDTESTDEVICENAME")
318 else if (param.uTag() ==
"OUTPUTINTERPMPDE")
320 else if (param.uTag() ==
"DAESTATEDERIV" )
322 else if (param.uTag() ==
"DEBUGLEVEL" )
331 Report::UserError() << param.uTag() <<
" is not a recognized time integration option";
367 bool bsuccess =
true;
371 Stats::StatTop _sensitivityStat(
"Sensitivity");
409 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
410 dout() <<
" transient init called with resume true " << std::endl;
545 double suggestedMaxTime=0.0;
579 bool bsuccess =
true;
581 Stats::Stat _transientStat(Stats::StatTop::getTop());
582 Stats::TimeBlock _transientTimer(_transientStat);
613 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
616 dout() <<
"Transient::loopProcess()" << std::endl;
630 double suggestedMaxTime=0.0;
697 UserWarning(*
this) <<
"Nonlinear solver stalled. Calling this a pass";
708 UserWarning(*
this) <<
"Update too big. Calling this a pass";
744 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
747 dout() <<
" Here we are, just before checking whether to pause. " << std::endl;
755 dout() <<
" Pause time and current time equal " << std::endl;
759 dout() <<
" difference between current and pause times is "
764 dout() <<
" Pause time and initial time equal " << std::endl;
772 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
774 dout() <<
"Transient::loopProcess(): pausing simulation " << std::endl;
786 lout() <<
"Exit time exceeded. Exiting transient loop\n" << std::endl;
793 lout() <<
"Exit step. Exiting transient loop\n" << std::endl;
836 double maxTimeStepFromHabanero)
863 if (maxTimeStepFromHabanero > 0)
869 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
872 dout() <<
"Transient::loopProcess()" << std::endl;
886 double suggestedMaxTime=0.0;
931 bool recoverableFailureFlag =
true;
940 recoverableFailureFlag =
false;
959 Report::UserWarning0() <<
"Nonlinear solver stalled, calling this a pass";
967 Report::UserWarning0() <<
"Update too big, calling this a pass";
991 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
994 dout() <<
" Here we are, just before checking whether to pause. " << std::endl;
1002 dout() <<
" Pause time and current time equal " << std::endl;
1010 dout() <<
" Pause time and initial time equal " << std::endl;
1018 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
1020 dout() <<
"Transient::loopProcess(): pausing simulation " << std::endl;
1025 recoverableFailureFlag =
false;
1032 lout() <<
"Exit time exceeded. Exiting transient loop\n" << std::endl;
1033 recoverableFailureFlag =
false;
1038 lout() <<
"Exit step. Exiting transient loop\n" << std::endl;
1039 recoverableFailureFlag =
false;
1042 return recoverableFailureFlag;
1055 Stats::StatTop _processSuccessfulDCOPStat(
"Successful DCOP Steps");
1056 Stats::TimeBlock _processSuccessfulDCOPTimer(_processSuccessfulDCOPStat);
1058 bool bsuccess =
true;
1110 <<
" Calling dumpRestartData" << std::endl;
1115 dout() <<
" Done Calling dumpRestartData" << std::endl;
1139 Stats::StatTop _processSuccessfulStepStat(
"Successful Step");
1140 Stats::TimeBlock _processSuccessfulStepTimer(_processSuccessfulStepStat);
1165 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
1167 dout() <<
" Transient::processSuccessfulStep()" << std::endl
1168 <<
"Newton step succeeded:" << std::endl
1169 <<
"nextSolutionPtr: " << std::endl;
1172 dout() << std::endl;
1197 double suggestedMaxTime = 0.0;
1207 if (VERBOSE_TIME && isActive(Diag::TIME_PARAMETERS))
1208 dout() <<
"Transient Analysis: accepting time step" << std::endl;
1214 dout().precision(15);
1242 timeDiff1 = fabs(timeDiff1);
1243 timeDiff2 = fabs(timeDiff2);
1245 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
1247 dout() <<
" Checking whether to set breakpointrestartstep" << std::endl;
1248 dout() <<
" current - stop = " << timeDiff1 << std::endl;
1249 dout() <<
" current - final = " << timeDiff2 << std::endl;
1250 dout() <<
" bpTol = " << bpTol << std::endl;
1251 if (timeDiff1 <= bpTol && timeDiff2 > bpTol)
1252 dout() <<
" setting breakPointRestartStep to " <<
tranStepNumber;
1255 if (timeDiff1 <= bpTol && timeDiff2 > bpTol)
1297 if (DEBUG_ANALYSIS & DEBUG_TIME && isActive(Diag::TIME_DUMP_SOLUTION_ARRAYS))
1301 Stats::StatTop _outputStat(
"Output");
1302 Stats::TimeBlock _outputTimer(_outputStat);
1333 Stats::StatTop _processFailedStat(
"Failed Steps");
1334 Stats::TimeBlock _processFailedTimer(_processFailedStat);
1337 Stats::StatTop _nonlinearConvergenceFailureStat(
"Nonlinear Failure");
1338 Stats::TimeBlock _nonlinearConvergenceFailureTimer(_nonlinearConvergenceFailureStat);
1341 bool bsuccess =
true;
1373 dout() <<
"Transient Analysis: rejecting time step" << std::endl;
1379 dout().precision(15);
1385 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
1387 dout() <<
" Transient::processFailedStep" << std::endl
1388 <<
"Newton step failed:" << std::endl
1389 <<
"nextSolutionPtr: " << std::endl;
1391 dout() << std::endl;
1399 if (DEBUG_ANALYSIS && isActive(Diag::TIME_PARAMETERS))
1410 lout() <<
"Attempting to retake and accept step where estimated error over tolerance was: " <<
minEstErrorOverTol
1419 lout() <<
"Time step too small near step number: " <<
stepNumber <<
" Exiting transient loop.\n" << std::endl;
1428 lout() <<
"Newton solver failed in constant time step mode. Exiting transient loop.\n" << std::endl;
1436 lout() <<
"Exit Step. Exiting transient loop\n" << std::endl;
1440 if (VERBOSE_TIME && !bsuccess)
1460 Stats::StatTop _processFailedDCOPStat(
"Failed DCOP Steps");
1461 Stats::TimeBlock _processFailedDCOPTimer(_processFailedDCOPStat);
1463 bool bsuccess =
true;
1471 lout() <<
"DC Operating Point Failed. Exiting transient loop" << std::endl;
1486 bool bsuccess =
true;
1493 Linear::Vector * aVecPtr =
new Linear::Vector( *(dsPtr_->
currSolutionPtr) );
1495 aVecPtr =
new Linear::Vector( *(dsPtr_->
currStatePtr) );
1499 aVecPtr =
new Linear::Vector( *(dsPtr_->
currStorePtr) );
1506 dout() <<
"Calling finishOutput" << std::endl;
1536 if (DEBUG_ANALYSIS & DEBUG_TIME && isActive(Diag::TIME_DUMP_SOLUTION_ARRAYS))
1538 dout() <<
" Transient::doHandlePredictor" << std::endl;
1590 bool bsuccess =
true;
1605 lout() <<
" ***** DCOP time: " << time <<
" seconds. Breakdown follows:" << std::endl;
1612 lout() <<
" ***** Transient Stepping time: " << endTRANtime_ -
startTRANtime_ <<
" seconds. Breakdown follows:" << std::endl;
1635 lout() <<
" *** Transient failure history: " << std::endl;
1639 lout() <<
"Time Time Step Non-Linear Solver node node" << std::endl;
1640 lout() <<
"(sec) Step Status Status Iters ||F|| index name" << std::endl;
1644 lout() <<
"Time Time Step EstErr Non-Linear Solver node node" << std::endl;
1645 lout() <<
"(sec) Step Status OverTol Status Iters ||F|| index name" << std::endl;
1648 for (
int i = 0; i <
timeQueue_.get_size(); i++ )
1651 lout() << std::scientific << std::setprecision(fieldWidth-7) << std::setfill(
' ') << std::right << std::setw( fieldWidth )
1670 lout() << std::setw(7) << std::right;
1673 lout() <<
"P:s nrm";
1681 lout() <<
"P:near ";
1685 lout() <<
"P:s up ";
1687 else if( nlStatus == nlReturnCodes.
nanFail )
1693 lout() <<
"F:max s";
1697 lout() <<
"F:max s";
1701 lout() <<
"F:big u";
1703 else if( nlStatus == nlReturnCodes.
stalled )
1705 lout() <<
"F:stall";
1709 lout() <<
"F:n zro";
1713 lout() <<
"F:in Fl";
1717 lout() <<
"code=" <<
1721 lout() << std::right << std::setw( 4 )
1726 lout() << std::right << std::fixed << std::setw( 7 ) << outIndex;
1728 const std::vector<const std::string *> &name_vec =
topology_.getSolutionNodeNames();
1730 lout() <<
" " << std::left << ((outIndex < name_vec.size() && outIndex >= 0) ? *name_vec[outIndex] :
"N/A") << std::endl;
1747 Stats::StatTop _predictorStat(
"Predictor");
1748 Stats::TimeBlock _predictorTimer(_predictorStat);
1754 Stats::StatTop _updateDeviceSourceStat(
"Update Device Sources");
1755 Stats::TimeBlock _updateDeviceSourceTimer(_updateDeviceSourceStat);
1761 Stats::StatTop _nonlinearSolveStat(
"Nonlinear Solve");
1762 Stats::TimeBlock _nonlinearSolveTimer(_nonlinearSolveStat);
1771 Stats::StatTop _errorStat(
"Error Estimation");
1772 Stats::TimeBlock _errorTimer(_errorStat);
1852 lout() <<
"Time step too small near step number: " <<
stepNumber <<
" Exiting transient loop.\n" << std::endl;
1877 os <<
"Start of DCOP STEP # ";
1885 os <<
"Start of Time Step (INITIAL STEP) # ";
1889 os <<
"Start of Time Step (DISCONTINUITY STEP) # ";
1896 os <<
"Start of Time Step (AFTER FAILED STEP) # ";
1900 os <<
"Start of Time Step (AFTER SUCCESS STEP) # ";
1925 double percentComplete;
1927 double aveCPUTimePerStep;
1929 double aveSimTimePerStep;
1931 double estCompletionTime = 0.0;
1939 Report::signalProgress(
"Xyce in DC Operating Point Calculation");
1941 os <<
"***** Beginning DC Operating Point Calculation...\n" << std::endl;
1950 Report::signalProgress(
"Xyce in Transient Calculation");
1952 os <<
"***** Beginning Transient Calculation...\n" << std::endl;
1966 percentComplete = 100.0 * diff1/diff2;
1977 if (aveSimTimePerStep > Util::MachineDependentParams::MachineEpsilon())
1978 estCompletionTime = aveCPUTimePerStep *
1984 os <<
"***** Percent complete: " << percentComplete <<
" %" << std::endl;
1987 if (estCompletionTime > Util::MachineDependentParams::MachineEpsilon())
1989 unsigned int days, hours, minutes, seconds;
1990 days =
static_cast<int> (estCompletionTime / 86400);
1991 hours =
static_cast<int> ((estCompletionTime - days * 86400) / 3600);
1992 minutes =
static_cast<int> ((estCompletionTime - days * 86400 - hours * 3600) / 60);
1993 seconds =
static_cast<int> (estCompletionTime - days * 86400 - hours * 3600 - minutes * 60);
1996 for (
char *c = timeStr; c != timeStr +
sizeof(timeStr); ++c)
1999 if (Parallel::rank(
comm_) == 0) {
2001 time_t t = time( NULL );
2002 struct tm * now = localtime( &t );
2005 if ( ( t != (time_t)-1 ) && ( strftime( timeStr, 255,
"%c", now ) != 0 ) )
2007 os <<
"***** Current system time: " << timeStr << std::endl;
2012 os <<
"***** Current system time could not be determined." << std::endl;
2017 sprintf(timeStr,
"%3d days, %2d hrs., %2d min., %2d sec.", days, hours, minutes, seconds);
2019 sprintf(timeStr,
"%2d hrs., %2d min., %2d sec.", hours, minutes, seconds);
2020 else if (minutes > 0)
2021 sprintf(timeStr,
"%2d min., %2d sec.", minutes, seconds);
2023 sprintf(timeStr,
"%2d sec.", seconds);
2027 std::ostringstream ost;
2028 ost <<
"Xyce transient ";
2029 if (percentComplete < 10)
2033 ost << percentComplete
2034 <<
"%% complete ... Estimated time to completion: "
2035 << timeStr << std::endl;
2036 Report::signalProgress(ost.str());
2040 os <<
"***** Estimated time to completion: " << timeStr << std::endl << std::endl;
2108 dout() <<
"Calling conventional TRANOP outputs!" << std::endl;
2186 const std::vector<double> &fastTimes =
mpdeManager_->getFastTimePoints();
2194 const std::vector<double> &fastTimes =
mpdeManager_->getFastTimePoints();
2199 fastTimes, phiGID );
2207 std::vector<double> output_interpolation_times =
2216 output_interpolation_times,
2222 std::vector<double> output_interpolation_times =
2231 output_interpolation_times,
2248 output_interpolation_times,
2273 double current_time,
2274 double next_output_time,
2279 if (current_time < start_time)
2283 else if ((current_time < next_output_time)&& (fabs(current_time - next_output_time) >= 2 * Util::MachineDependentParams::MachinePrecision()))
2301 double current_time,
2302 double next_output_time,
2303 double final_output_time,
2304 double initial_output_interval,
2305 const IO::IntervalVector & output_intervals)
2309 if (initial_output_interval > 0.0)
2311 if (output_intervals.empty())
2314 while ((next_output_time < current_time)|| (fabs(current_time - next_output_time) < 2 * Util::MachineDependentParams::MachinePrecision()))
2315 next_output_time = next_output_time + initial_output_interval;
2317 else if (current_time < output_intervals[0].first)
2320 while (next_output_time <= current_time)
2321 next_output_time = next_output_time + initial_output_interval;
2322 if (next_output_time > output_intervals[0].first)
2323 next_output_time = output_intervals[0].first;
2328 std::pair<double, double> currInterval, nextInterval;
2329 int size = output_intervals.size();
2330 for (
int i = 0; i < size; ++i)
2331 if (output_intervals[i].first <= current_time)
2333 currInterval = output_intervals[i];
2334 if ((i+1) < static_cast<int>(output_intervals.size()))
2335 nextInterval = output_intervals[i+1];
2337 int step =
static_cast<int> ((current_time-currInterval.first) /
2338 currInterval.second);
2339 next_output_time = currInterval.first + (step+1)*currInterval.second;
2340 if (nextInterval.first && (nextInterval.first!=currInterval.first) && (next_output_time>=nextInterval.first))
2341 next_output_time = nextInterval.first;
2344 if (next_output_time >= final_output_time)
2345 next_output_time =final_output_time;
2348 return next_output_time;
2363 double current_time,
2364 double next_output_time,
2365 double final_output_time,
2366 double initial_output_interval,
2367 const IO::IntervalVector & output_intervals)
2369 std::vector<double> output_interpolation_times;
2372 if (initial_output_interval > 0.0)
2374 if (output_intervals.empty() || current_time <= output_intervals[0].first)
2377 double t = next_output_time;
2378 while ((t < current_time) && ( current_time -t ) > 2 * Util::MachineDependentParams::MachinePrecision())
2380 output_interpolation_times.push_back(t);
2381 t += initial_output_interval;
2384 if ((t - current_time) <= 2 * Util::MachineDependentParams::MachinePrecision() )
2386 output_interpolation_times.push_back(current_time);
2389 if ((t - final_output_time) > 2 * Util::MachineDependentParams::MachinePrecision())
2392 output_interpolation_times.push_back(final_output_time);
2399 lastInt=output_intervals.size()-1;
2403 outInt<lastInt&&output_intervals[outInt+1].first<=next_output_time;
2406 double t = next_output_time;
2407 while (t <= current_time)
2409 output_interpolation_times.push_back(t);
2410 t += output_intervals[outInt].second;
2411 if (outInt != lastInt && t >= output_intervals[outInt+1].first)
2414 t = output_intervals[outInt].first;
2420 return output_interpolation_times;
2436 class TransientFactory:
public Factory<Transient>
2464 Linear::System & linear_system,
2466 Topo::Topology & topology)
2474 virtual ~TransientFactory()
2490 Transient *create()
const
2515 void setTransientAnalysisOptionBlock(
const Util::OptionBlock &option_block)
2535 void setTimeIntegratorOptionBlock(
const Util::OptionBlock &option_block)
2552 struct TimeIntegratorOptionsReg :
public IO::PkgOptionsReg
2554 TimeIntegratorOptionsReg(
2555 TransientFactory & factory )
2559 bool operator()(
const Util::OptionBlock &option_block)
2561 factory_.setTimeIntegratorOptionBlock(option_block);
2570 struct TransientAnalysisReg :
public IO::PkgOptionsReg
2572 TransientAnalysisReg(
2573 TransientFactory & factory)
2577 bool operator()(
const Util::OptionBlock &option_block)
2579 factory_.setTransientAnalysisOptionBlock(option_block);
2594 const std::string & netlist_filename,
2595 IO::PkgOptionsMgr & options_manager,
2597 Linear::System & linear_system,
2599 Topo::Topology & topology)
2601 TransientFactory *factory =
new TransientFactory(analysis_manager, linear_system, nonlinear_manager, topology);
2605 options_manager.submitRegistration(
"TRAN", netlist_filename,
new TransientAnalysisReg(*factory));
2606 options_manager.submitRegistration(
"TIMEINT", netlist_filename,
new TimeIntegratorOptionsReg(*factory));
bool setAnalysisOption(const Util::Param ¶m)
bool enableSensitivity(TimeIntg::DataStore &data_store, Parallel::Manager ¶llel_manager, Topo::Topology &topology)
IO::OutputMgr & getOutputManager()
Linear::Vector * lastSolutionPtr
std::vector< Linear::Vector * > fastTimeQVec
Transient(AnalysisManager &analysis_manager, Linear::System &linear_system, Nonlinear::Manager &nonlinear_manager, Topo::Topology &topology, OutputAdapter *output_adapter=0, HB *hb_analysis=0, N_MPDE_Manager *mpde_manager=0)
Util::FixedQueue< double > timeQueue_
void setDAEStateDerivFlag(bool state)
virtual int getMaxNormFindex() const =0
unsigned int successStepsThisParameter_
TimeIntg::TIAParams tiaParams_
Topo::Topology & topology_
void takeAnIntegrationStep_()
void notify(const StepEvent &event)
std::vector< double > timeSteps
unsigned int successfulStepsTaken_
Number of consecutive successful time-integration steps.
bool testSaveOutputTime()
bool icSensitivity(std::vector< double > &objectiveVec, std::vector< double > &dOdpVec, std::vector< double > &dOdpAdjVec, std::vector< double > &scaled_dOdpVec, std::vector< double > &scaled_dOdpAdjVec)
bool beginningIntegration
unsigned int tranStepNumber
int newtonConvergenceStatus
virtual bool setInitialGuess(Linear::Vector *solVectorPtr)
double initialTimeStep
User specified initial time step.
TwoLevelMode getTwoLevelMode() const
std::vector< bool > timeStepsBreakpointFlag
void setNextOutputTime(double next_output_time)
bool setTimeIntegratorOption(const Util::Param ¶m)
bool calcSensitivity(std::vector< double > &objectiveVec, std::vector< double > &dOdpVec, std::vector< double > &dOdpAdjVec, std::vector< double > &scaled_dOdpVec, std::vector< double > &scaled_dOdpAdjVec)
bool testRestartSaveTime()
Pure virtual class to augment a linear system.
int errorAnalysisOptionResetCount
Iteration count down to reset errorAnalysisOption to LOCAL_TRUNCATED_ESTIMATES.
std::vector< std::string > condTestDeviceNames
names for conductance test
int nIterations
Number of newton iterations.
std::vector< double > objectiveVec_
int doubleDCOPStep_
current step in the DCOP loop.
Topo::Topology & topology_
double minEstErrorOverTol
virtual void stepFailure(Analysis::TwoLevelMode analysis)
Util::OptionBlock timeIntegratorOptionBlock_
bool registerTransientFactory(const std::string &netlist_filename, IO::PkgOptionsMgr &options_manager, AnalysisManager &analysis_manager, Linear::System &linear_system, Nonlinear::Manager &nonlinear_manager, Topo::Topology &topology)
Util::FixedQueue< int > nonlinearSolverStatusQueue_
bool resetForStepAnalysis()
std::vector< double > dOdpAdjVec_
unsigned int stepNumber
Time-integration step number counter.
virtual int getNumIterations() const =0
void outputSolDataArrays(std::ostream &os)
double getPauseTime() const
bool getSwitchIntegrator() const
Linear::Vector * currStorePtr
Linear::Vector * lastStatePtr
bool isTimeIntegrationMethodCreated()
void gatherStepStatistics(StatCounts &stats, Nonlinear::NonLinearSolver &nonlinear_solver, int newton_convergence_status)
double timeStepAtMinEstErrorOverTol
int errorAnalysisOption
Error analysis option.
Util::ExpressionData * maxTimeStepExpression_
double finalTime
End time for simulation.
bool updateMaxTimeStep(Parallel::Machine comm, const TIAParams &tia_params, double suggestedMaxTimeStep=0.0)
void createTimeIntegratorMethod(const TimeIntg::TIAParams &tia_params, const unsigned int integration_method)
bool setupInitialConditions(Linear::Vector &solnVec, Linear::Vector &flagVec)
Linear::System & linearSystem_
ConductanceExtractor & getConductanceExtractor()
int exitStep
Exit after taking this many steps.
OutputMgrAdapter & outputManagerAdapter_
bool resetAll(const TIAParams &tia_params)
Util::FixedQueue< int > nonlinearSolverNumIterationsQueue_
std::vector< Linear::Vector * > fastTimeStateVec
bool processSuccessfulDCOP()
Util::ListenerAutoSubscribe< StepEvent > StepEventListener
Util::Timer & getXyceTranTimer()
const Util::BreakPointLess & getBreakPointLess() const
void setAnalysisMode(AnalysisMode mode)
Linear::Vector * currStatePtr
unsigned int failedStepsAttempted_
Total number of failed time-integration steps.
bool getResumingSimulation() const
void obtainCorrectorDeriv()
Parallel::Manager * getPDSManager() const
void dumpRestart(Parallel::Communicator ¶llel_communicator, Analysis::AnalysisManager &analysis_manager, double current_time) const
bool saveOutputSolution(Analysis::OutputMgrAdapter &outputManagerAdapter, const TIAParams &tia_params, Linear::Vector *solnVecPtr, const double saveTime, const bool doNotInterpolate)
bool setDCOPOption(const Util::Param ¶m)
TimeIntg::StepErrorControl & getStepErrorControl()
bool constantTimeStepFlag
Constant time step integration flag.
void updateSolDataArrays()
void computeDividedDifferences()
std::vector< Linear::Vector * > fastTimeSolutionVec
NonLinearSolver & getNonlinearSolver()
bool testDCOPOutputTime()
Returns true if the DCOP Restart parameters have been set.
bool getProgressFlag() const
void completeStep(const TIAParams &tia_params)
std::vector< TwoLevelError > innerErrorInfoVec
int minTimeStepsBP
User specified mininum number of steps between breakpoints.
Linear::Vector * daeQVectorPtr
void setConstantHistory()
std::vector< double > dOdpVec_
virtual void outputMPDE(double time, const std::vector< double > &fast_time_points, const Linear::Vector *solution_vector)
Linear::System & linearSystem_
unsigned int breakPointRestartStep
void updateStopTime(Parallel::Machine comm, bool breakpoints_enabled, double initial_time, bool min_time_steps_breakpoint_given, double min_time_steps_breakpoint)
bool printMPDEOutputSolution(Analysis::OutputMgrAdapter &outputManagerAdapter, const double time, Linear::Vector *solnVecPtr, const std::vector< double > &fastTimes)
void resetAll(AnalysisMode mode)
virtual bool startTimeStep()
void setErrorWtVector(const TIAParams &tia_params)
void rejectStep(const TIAParams &tia_params)
const ReturnCodes & getReturnCodes() const
void setTimeStep(double newTimeStep)
bool saveTimeStepsFlag
flag to save timestpes in data store for later use
bool finalizeMixedSignalStep()
Linear::Vector * daeFVectorPtr
bool mixedSignalStep(double maxTimeStepFromHabanero)
int minTimeStepRecoveryCounter
Util::OptionBlock transientAnalysisOptionBlock_
bool bpEnable
Enable breakpoints flag.
Nonlinear::Manager & nonlinearManager_
bool initialOutputTimeGiven
Nonlinear::AnalysisMode nonlinearAnalysisMode(Mode mode)
Returns the nonlinear analysis mode given the analysis mode.
virtual void acceptStep()
OutputAdapter * outputAdapter_
void simulationPaused(double initial_time)
bool processSuccessfulStep()
void setTwoLevelMode(TwoLevelMode current_mode)
Util::FixedQueue< double > nonlinearSolverMaxNormQueue_
void printProgress(std::ostream &os)
virtual bool updateSources()
Linear::Vector * nextStatePtr
std::vector< Linear::Vector * > fastTimeStoreVec
void tranOutput(double time, Linear::Vector &currSolutionPtr, Linear::Vector &stateVecPtr, Linear::Vector &storeVecPtr, Linear::Vector &lead_current_vector, Linear::Vector &junction_voltage_vector, std::vector< double > &objectiveVec_, std::vector< double > &dOdpVec_, std::vector< double > &dOdpAdjVec_, std::vector< double > &scaled_dOdpVec_, std::vector< double > &scaled_dOdpAdjVec_, bool skipPrintLineOutput=false)
void preMixedSignalStepDetails(double maxTimeStepFromHabanero)
AnalysisManager & analysisManager_
void outputTimeInfo(std::ostream &os)
virtual bool printLoopInfo(int start, int finish)
Linear::Vector * dFdxdVpVectorPtr
Loader::NonlinearEquationLoader & getNonlinearEquationLoader()
Linear::Vector * currLeadDeltaVPtr
double getSaveTime() const
TransientFactory & factory_
void outputPredictedSolution(std::ostream &os)
bool retakeAndAcceptTimeStep(double aTimeStep)
double initialOutputTime
Time at which output starts (StepErrorControl)
int numberSuccessiveFailures
Mode getAnalysisMode() const
N_MPDE_Manager * mpdeManager_
bool doProcessFailedStep()
bool setTimeIntegratorOptions(const Util::OptionBlock &option_block)
void addAnalysisFactory(Factory< void > *factory)
void outputPredictedDerivative(std::ostream &os)
unsigned int initialIntegrationMethod_
TimeIntegrationMethod *(* Factory)(const TIAParams &tia_params, StepErrorControl &step_error_control, DataStore &data_store)
Linear::Vector * nextSolutionPtr
void setConstantSensitivityHistory()
unsigned int integrationMethod
Time-integration method.
double getEstOverTol() const
virtual bool getDoubleDCOPFlag() const
Linear::Vector * nextStorePtr
double initialTime
Beginning time for the time integrator (StepErrorControl, integrators access from StepErrorControl) ...
Linear::Vector * dQdxdVpVectorPtr
bool setAnalysisParams(const Util::OptionBlock ¶msBlock)
bool previousCallStepSuccessful
Linear::Vector * currLeadCurrentPtr
Linear::Vector * lastStorePtr
void setInputOPFlag(bool initial_conditions_loaded)
double getInitialOutputInterval() const
int stepNumberAtMinEstErrorOverTol
TimeIntg::WorkingIntegrationMethod & getWorkingIntegrationMethod()
bool firstDoubleDCOPStep()
const IO::CmdParse & getCommandLine() const
void obtainPredictorDeriv()
double oldPercentComplete
std::vector< double > scaled_dOdpAdjVec_
std::string maxTimeStepExpressionString_
bool updateBreakPoints(double initial_time)
void setSwitchIntegrator(bool switch_itegrator)
void allocateTranSolver(Analysis::AnalysisManager &analysis_manager, Loader::NonlinearEquationLoader &nonlinear_equation_loader, Linear::System &linear_system, TimeIntg::DataStore &data_store, Parallel::Manager ¶llel_manager, IO::OutputMgr &output_manager, Topo::Topology &topology)
bool finalVerboseOutput()
Linear::Vector * currSolutionPtr
TimeIntg::DataStore * getDataStore()
void evaluateStepError(const TIAParams &tia_params)
bool doubleDCOPFlag_
true if doing a double-DCOP is possible.
double getSolverStartTime() const
unsigned int baseIntegrationMethod_
Current time-integration method flag.
bool printWaMPDEOutputSolution(Analysis::OutputMgrAdapter &outputManagerAdapter, const double time, Linear::Vector *solnVecPtr, const std::vector< double > &fastTimes, const int phiGID)
double updateOutputTime(double current_time, double next_output_time, double final_output_time, double initial_output_interval, const IO::IntervalVector &output_intervals)
Util::FixedQueue< double > timeStepQueue_
const IO::IntervalVector & getOutputIntervals() const
std::vector< double > scaled_dOdpVec_
Linear::Vector * nextStateDerivPtr
virtual void stepSuccess(Analysis::TwoLevelMode analysis)
Util::FixedQueue< int > stepStatusQueue_
bool condTestFlag
flag for conductance test
virtual bool finishOutput() const
void outputDCOP(const Linear::Vector &solution)
double exitTime
Exit when it exceeds this time.
bool outputInterpMPDE
flag for interpolating the MPDE output. Sometimes, the interpolation is the hard part.
virtual bool initializeProblem(Linear::Vector *nextSolVectorPtr, Linear::Vector *currSolVectorPtr, Linear::Vector *lastSolVectorPtr, Linear::Vector *nextStaVectorPtr, Linear::Vector *currStaVectorPtr, Linear::Vector *lastStaVectorPtr, Linear::Vector *StateDerivVectorPtr, Linear::Vector *nextStoVectorPtr, Linear::Vector *currStoVectorPtr, Linear::Vector *lastStoVectorPtr, Linear::Vector *QVectorPtr, Linear::Vector *FVectorPtr, Linear::Vector *BVectorPtr, Linear::Vector *dFdxdVpVectorPtr, Linear::Vector *dQdxdVpVectorPtr) const =0
int getNumberOfSteps() const
Nonlinear::Manager & nonlinearManager_
virtual bool getInitialQnorm(std::vector< TimeIntg::TwoLevelError > &tleVec)
bool printOutputSolution(Analysis::OutputMgrAdapter &outputManagerAdapter, const TIAParams &tia_params, const double time, Linear::Vector *solnVecPtr, const bool doNotInterpolate, const std::vector< double > &outputInterpolationTimes, bool skipPrintLineOutput)
double getNextOutputTime() const
void writeConductanceFile(const std::vector< std::string > &device_names, Nonlinear::ConductanceExtractor &conductance_extractor, const std::string &filename)
Util::FixedQueue< double > nonlinearSolverMaxNormIndexQueue_
AnalysisManager & analysisManager_
void printStepHeader(std::ostream &os)
bool doProcessSuccessfulStep()
bool passNLStall
option to pass some non-linear solver failures
Linear::Vector * flagSolutionPtr
void initialize(const TIAParams &tia_params)
Util::FixedQueue< double > estErrorOverTolQueue_
Linear::Vector * daeBVectorPtr
bool setReturnCodeOption(const Util::Param ¶m)
virtual double getMaxNormF() const =0
std::vector< double > computeOutputInterpolationTimes(double current_time, double next_output_time, double final_output_time, double initial_output_interval, const IO::IntervalVector &output_intervals)
bool testOutputTime(double current_time, double next_output_time, double start_time)
virtual bool output() const