Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_IntegratorBasicOld_impl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ****************************************************************************
3 // Tempus: Copyright (2017) Sandia Corporation
4 //
5 // Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6 // ****************************************************************************
7 // @HEADER
8 
9 #ifndef Tempus_IntegratorBasicOld_impl_hpp
10 #define Tempus_IntegratorBasicOld_impl_hpp
11 
12 #include "Thyra_VectorStdOps.hpp"
13 
14 #include "Tempus_StepperFactory.hpp"
15 
16 
17 namespace Tempus {
18 
19 template<class Scalar>
23  : integratorObserver_(Teuchos::null),
24  integratorStatus_(WORKING), isInitialized_(false)
25 {
26  this->setTempusParameterList(inputPL);
27  this->setStepper(model);
28  this->initialize();
29 }
30 
31 
32 template<class Scalar>
35  std::string stepperType)
36  : integratorObserver_(Teuchos::null),
37  integratorStatus_(WORKING), isInitialized_(false)
38 {
39  using Teuchos::RCP;
40  RCP<StepperFactory<Scalar> > sf = Teuchos::rcp(new StepperFactory<Scalar>());
41  RCP<Stepper<Scalar> > stepper = sf->createStepper(stepperType, model);
42 
43  this->setTempusParameterList(Teuchos::null);
44  this->setStepperWStepper(stepper);
45  this->initialize();
46 }
47 
48 
49 template<class Scalar>
51  : integratorObserver_(Teuchos::null),
52  integratorStatus_(WORKING), isInitialized_(false)
53 {
54  this->setTempusParameterList(Teuchos::null);
55 }
56 
57 
58 template<class Scalar>
61  std::vector<Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > > models)
62  : integratorObserver_(Teuchos::null),
63  integratorStatus_(WORKING), isInitialized_(false)
64 {
65  this->setTempusParameterList(inputPL);
66  this->setStepper(models);
67  this->initialize();
68 }
69 
70 
71 template<class Scalar>
74 {
75  using Teuchos::RCP;
77 
78  if (stepper_ == Teuchos::null) {
79  // Construct from Integrator ParameterList
80  RCP<StepperFactory<Scalar> > sf =Teuchos::rcp(new StepperFactory<Scalar>());
81  std::string stepperName = integratorPL_->get<std::string>("Stepper Name");
82 
83  RCP<ParameterList> stepperPL = Teuchos::sublist(tempusPL_,stepperName,true);
84  stepper_ = sf->createStepper(stepperPL, model);
85  } else {
86  stepper_->setModel(model);
87  }
88 }
89 
90 
91 template<class Scalar>
93  std::vector<Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > > models)
94 {
95  using Teuchos::RCP;
97 
98  // Construct from Integrator ParameterList
99  RCP<StepperFactory<Scalar> > sf =Teuchos::rcp(new StepperFactory<Scalar>());
100  std::string stepperName = integratorPL_->get<std::string>("Stepper Name");
101 
102  RCP<ParameterList> stepperPL = Teuchos::sublist(tempusPL_,stepperName,true);
103  stepper_ = sf->createStepper(stepperPL, models);
104 }
105 
106 
107 template<class Scalar>
109  Teuchos::RCP<Stepper<Scalar> > newStepper)
110 {
111  stepper_ = newStepper;
112 }
113 
115 template<class Scalar>
118 {
119  using Teuchos::RCP;
121 
122  // Construct from Integrator ParameterList
123  RCP<ParameterList> shPL =
124  Teuchos::sublist(integratorPL_, "Solution History", true);
125  solutionHistory_ = createSolutionHistoryPL<Scalar>(shPL);
126 
127  if (state == Teuchos::null) {
128  // Construct default IC from the application model
129  RCP<SolutionState<Scalar> > newState = createSolutionStateME(
130  stepper_->getModel(), stepper_->getDefaultStepperState());
131 
132  // Set SolutionState from TimeStepControl
133  newState->setTime (timeStepControl_->getInitTime());
134  newState->setIndex (timeStepControl_->getInitIndex());
135  newState->setTimeStep(timeStepControl_->getInitTimeStep());
136  newState->setTolRel (timeStepControl_->getMaxRelError());
137  newState->setTolAbs (timeStepControl_->getMaxAbsError());
138  newState->setOrder (stepper_->getOrder());
139  newState->setSolutionStatus(Status::PASSED); // ICs are considered passing.
140 
141  solutionHistory_->addState(newState);
142 
143  } else {
144  // Use state as IC
145  solutionHistory_->addState(state);
146  }
147 
148  // Get IC from the application model via the stepper and ensure consistency.
149  stepper_->setInitialConditions(solutionHistory_);
150 }
151 
152 
153 template<class Scalar>
158  Teuchos::RCP<const Thyra::VectorBase<Scalar> > xdotdot0)
159 {
160  using Teuchos::RCP;
162 
163  // Construct from Integrator ParameterList
164  RCP<ParameterList> shPL =
165  Teuchos::sublist(integratorPL_, "Solution History", true);
166  solutionHistory_ = createSolutionHistoryPL<Scalar>(shPL);
167 
168  // Create and set xdot and xdotdot.
169  RCP<Thyra::VectorBase<Scalar> > xdot = x0->clone_v();
170  RCP<Thyra::VectorBase<Scalar> > xdotdot = x0->clone_v();
171  if (xdot0 == Teuchos::null)
172  Thyra::assign(xdot.ptr(), Teuchos::ScalarTraits<Scalar>::zero());
173  else
174  Thyra::assign(xdot.ptr(), *(xdot0));
175  if (xdotdot0 == Teuchos::null)
176  Thyra::assign(xdotdot.ptr(), Teuchos::ScalarTraits<Scalar>::zero());
177  else
178  Thyra::assign(xdotdot.ptr(), *(xdotdot0));
179 
180  RCP<SolutionState<Scalar> > newState = createSolutionStateX(
181  x0->clone_v(), xdot, xdotdot);
182  newState->setStepperState(stepper_->getDefaultStepperState());
183 
184  // Set SolutionState from TimeStepControl
185  newState->setTime (t0);
186  newState->setIndex (timeStepControl_->getInitIndex());
187  newState->setTimeStep(timeStepControl_->getInitTimeStep());
188  newState->setOrder(stepper_->getOrder());
189 
190  newState->setSolutionStatus(Status::PASSED); // ICs are considered passing.
191 
192  solutionHistory_->addState(newState);
193 
194  // Get IC from the application model via the stepper and ensure consistency.
195  stepper_->setInitialConditions(solutionHistory_);
196 }
197 
198 
199 template<class Scalar>
202 {
203  using Teuchos::RCP;
205 
206  if (sh == Teuchos::null) {
207  // Create default SolutionHistory, otherwise keep current history.
208  if (solutionHistory_ == Teuchos::null) initializeSolutionHistory();
209  } else {
210 
211  TEUCHOS_TEST_FOR_EXCEPTION( sh->getNumStates() < 1,
212  std::out_of_range,
213  "Error - setSolutionHistory requires at least one SolutionState.\n"
214  << " Supplied SolutionHistory has only " << sh->getNumStates()
215  << " SolutionStates.\n");
216 
217  solutionHistory_ = sh;
218  }
219 }
220 
221 
222 template<class Scalar>
225 {
226  using Teuchos::RCP;
228 
229  if (tsc == Teuchos::null) {
230  // Create timeStepControl_ if null, otherwise keep current parameters.
231  if (timeStepControl_ == Teuchos::null) {
232  if (integratorPL_->isSublist("Time Step Control")) {
233  // Construct from Integrator ParameterList
234  RCP<ParameterList> tscPL =
235  Teuchos::sublist(integratorPL_,"Time Step Control",true);
236  timeStepControl_ = createTimeStepControl<Scalar>(tscPL);
237  } else {
238  // Construct default TimeStepControl
239  timeStepControl_ = rcp(new TimeStepControl<Scalar>());
240  RCP<const ParameterList> tscPL = timeStepControl_->getValidParameters();
241  integratorPL_->set("Time Step Control", tscPL->name());
242  integratorPL_->set(tscPL->name(), *tscPL);
243  }
244  }
245 
246  } else {
247  // Make integratorPL_ consistent with new TimeStepControl.
248  timeStepControl_ = tsc;
249  RCP<const ParameterList> tscPL = timeStepControl_->getValidParameters();
250  integratorPL_->set(tscPL->name(), *tscPL);
251  }
252 
253  timeStepControl_->initialize();
254 }
255 
256 
257 template<class Scalar>
260 {
261 
262  if (obs == Teuchos::null) {
263  // Create default IntegratorObserverBasic, otherwise keep current observer.
264  if (integratorObserver_ == Teuchos::null) {
265  integratorObserver_ =
267  // Add basic observer to output time step info
270  integratorObserver_->addObserver(basicObs);
271  }
272  } else {
273  if (integratorObserver_ == Teuchos::null) {
274  integratorObserver_ =
276  }
277  integratorObserver_->addObserver(obs);
278  }
279 
280 }
281 
282 
283 template<class Scalar>
285 {
286  TEUCHOS_TEST_FOR_EXCEPTION( stepper_ == Teuchos::null, std::logic_error,
287  "Error - Need to set the Stepper, setStepper(), before calling "
288  "IntegratorBasicOld::initialize()\n");
289 
290  this->setTimeStepControl();
291  this->parseScreenOutput();
292  this->setSolutionHistory();
293  this->setObserver();
294 
295  // Set initial conditions, make them consistent, and set stepper memory.
296  stepper_->setInitialConditions(solutionHistory_);
297 
298  if (integratorTimer_ == Teuchos::null)
299  integratorTimer_ = rcp(new Teuchos::Time("Integrator Timer"));
300  if (stepperTimer_ == Teuchos::null)
301  stepperTimer_ = rcp(new Teuchos::Time("Stepper Timer"));
302 
303  if (Teuchos::as<int>(this->getVerbLevel()) >=
304  Teuchos::as<int>(Teuchos::VERB_HIGH)) {
305  Teuchos::RCP<Teuchos::FancyOStream> out = this->getOStream();
306  Teuchos::OSTab ostab(out,1,"IntegratorBasicOld::IntegratorBasicOld");
307  *out << this->description() << std::endl;
308  }
309 
310  isInitialized_ = true;
311 }
312 
313 
314 template<class Scalar>
316 {
317  std::string name = "Tempus::IntegratorBasicOld";
318  return(name);
319 }
320 
321 
322 template<class Scalar>
325  const Teuchos::EVerbosityLevel verbLevel) const
326 {
327  out << description() << "::describe" << std::endl;
328  out << "solutionHistory= " << solutionHistory_->description()<<std::endl;
329  out << "timeStepControl= " << timeStepControl_->description()<<std::endl;
330  out << "stepper = " << stepper_ ->description()<<std::endl;
331 
332  if (Teuchos::as<int>(verbLevel) >=
333  Teuchos::as<int>(Teuchos::VERB_HIGH)) {
334  out << "solutionHistory= " << std::endl;
335  solutionHistory_->describe(out,verbLevel);
336  out << "timeStepControl= " << std::endl;
337  timeStepControl_->describe(out,verbLevel);
338  out << "stepper = " << std::endl;
339  stepper_ ->describe(out,verbLevel);
340  }
341 }
342 
343 
344 template <class Scalar>
345 bool IntegratorBasicOld<Scalar>::advanceTime(const Scalar timeFinal)
346 {
347  if (timeStepControl_->timeInRange(timeFinal))
348  timeStepControl_->setFinalTime(timeFinal);
349  bool itgrStatus = advanceTime();
350  return itgrStatus;
351 }
352 
353 
354 template <class Scalar>
356 {
357  Teuchos::RCP<Teuchos::FancyOStream> out = this->getOStream();
358  if (isInitialized_ == false) {
359  Teuchos::OSTab ostab(out,1,"StartIntegrator");
360  *out << "Failure - IntegratorBasicOld is not initialized." << std::endl;
361  integratorStatus_ = Status::FAILED;
362  return;
363  }
364 
365  //set the Abs/Rel tolerance
366  auto cs = solutionHistory_->getCurrentState();
367  cs->setTolRel(timeStepControl_->getMaxRelError());
368  cs->setTolAbs(timeStepControl_->getMaxAbsError());
369 
370  integratorTimer_->start();
371  // get optimal initial time step
372  const Scalar initDt =
373  std::min(timeStepControl_->getInitTimeStep(),
374  stepper_->getInitTimeStep(solutionHistory_));
375  // update initial time step
376  timeStepControl_->setInitTimeStep(initDt);
377  timeStepControl_->initialize();
378  integratorStatus_ = WORKING;
379 }
380 
381 
382 template <class Scalar>
384 {
385  TEMPUS_FUNC_TIME_MONITOR("Tempus::IntegratorBasicOld::advanceTime()");
386  {
387  startIntegrator();
388  integratorObserver_->observeStartIntegrator(*this);
389 
390  while (integratorStatus_ == WORKING and
391  timeStepControl_->timeInRange (solutionHistory_->getCurrentTime()) and
392  timeStepControl_->indexInRange(solutionHistory_->getCurrentIndex())){
393 
394  stepperTimer_->reset();
395  stepperTimer_->start();
396  solutionHistory_->initWorkingState();
397 
398  startTimeStep();
399  integratorObserver_->observeStartTimeStep(*this);
400 
401  timeStepControl_->setNextTimeStep(solutionHistory_, integratorStatus_);
402  integratorObserver_->observeNextTimeStep(*this);
403 
404  if (integratorStatus_ == Status::FAILED) break;
405  solutionHistory_->getWorkingState()->setSolutionStatus(WORKING);
406 
407  integratorObserver_->observeBeforeTakeStep(*this);
408 
409  stepper_->takeStep(solutionHistory_);
410 
411  integratorObserver_->observeAfterTakeStep(*this);
412 
413  stepperTimer_->stop();
414  checkTimeStep();
415  integratorObserver_->observeAfterCheckTimeStep(*this);
416 
417  solutionHistory_->promoteWorkingState();
418  integratorObserver_->observeEndTimeStep(*this);
419  }
420 
421  endIntegrator();
422  integratorObserver_->observeEndIntegrator(*this);
423  }
424 
425  return (integratorStatus_ == Status::PASSED);
426 }
427 
428 
429 template <class Scalar>
431 {
432  auto ws = solutionHistory_->getWorkingState();
433 
434  //set the Abs/Rel tolerance
435  ws->setTolRel(timeStepControl_->getMaxRelError());
436  ws->setTolAbs(timeStepControl_->getMaxAbsError());
437 
438  // Check if we need to dump screen output this step
439  std::vector<int>::const_iterator it =
440  std::find(outputScreenIndices_.begin(),
441  outputScreenIndices_.end(),
442  ws->getIndex());
443  if (it == outputScreenIndices_.end())
444  ws->setOutputScreen(false);
445  else
446  ws->setOutputScreen(true);
447 
448  const int initial = timeStepControl_->getInitIndex();
449  const int interval = integratorPL_->get<int>("Screen Output Index Interval");
450  if ( (ws->getIndex() - initial) % interval == 0)
451  ws->setOutputScreen(true);
452 }
453 
454 
455 template <class Scalar>
457 {
458  using Teuchos::RCP;
459  auto ws = solutionHistory_->getWorkingState();
460 
461  // Too many TimeStep failures, Integrator fails.
462  if (ws->getNFailures() >= timeStepControl_->getMaxFailures()) {
463  RCP<Teuchos::FancyOStream> out = this->getOStream();
464  Teuchos::OSTab ostab(out,2,"checkTimeStep");
465  *out << "Failure - Stepper has failed more than the maximum allowed.\n"
466  << " (nFailures = "<<ws->getNFailures()<< ") >= (nFailuresMax = "
467  << timeStepControl_->getMaxFailures()<<")" << std::endl;
468  integratorStatus_ = Status::FAILED;
469  return;
470  }
471  if (ws->getNConsecutiveFailures()
472  >= timeStepControl_->getMaxConsecFailures()){
473  RCP<Teuchos::FancyOStream> out = this->getOStream();
474  Teuchos::OSTab ostab(out,1,"checkTimeStep");
475  *out << "Failure - Stepper has failed more than the maximum "
476  << "consecutive allowed.\n"
477  << " (nConsecutiveFailures = "<<ws->getNConsecutiveFailures()
478  << ") >= (nConsecutiveFailuresMax = "
479  << timeStepControl_->getMaxConsecFailures()
480  << ")" << std::endl;
481  integratorStatus_ = Status::FAILED;
482  return;
483  }
484 
485  // Check Stepper failure.
486  if (ws->getSolutionStatus() == Status::FAILED or
487  // Constant time step failure
488  ((timeStepControl_->getStepType() == "Constant") and
489  (ws->getTimeStep() != timeStepControl_->getInitTimeStep()) and
490  (ws->getOutput() != true) and
491  (ws->getTime() != timeStepControl_->getFinalTime())
492  )
493  )
494  {
495  RCP<Teuchos::FancyOStream> out = this->getOStream();
496  Teuchos::OSTab ostab(out,0,"checkTimeStep");
497  *out <<std::scientific
498  <<std::setw( 6)<<std::setprecision(3)<<ws->getIndex()
499  <<std::setw(11)<<std::setprecision(3)<<ws->getTime()
500  <<std::setw(11)<<std::setprecision(3)<<ws->getTimeStep()
501  << " STEP FAILURE!! - ";
502  if (ws->getSolutionStatus() == Status::FAILED) {
503  *out << "Solution Status = " << toString(ws->getSolutionStatus())
504  << std::endl;
505  } else if ((timeStepControl_->getStepType() == "Constant") and
506  (ws->getTimeStep() != timeStepControl_->getInitTimeStep())) {
507  *out << "dt != Constant dt (="<<timeStepControl_->getInitTimeStep()<<")"
508  << std::endl;
509  }
510 
511  ws->setNFailures(ws->getNFailures()+1);
512  ws->setNRunningFailures(ws->getNRunningFailures()+1);
513  ws->setNConsecutiveFailures(ws->getNConsecutiveFailures()+1);
514  ws->setSolutionStatus(Status::FAILED);
515  return;
516  }
517 
518  // TIME STEP PASSED basic tests! Ensure it is set as such.
519  ws->setSolutionStatus(Status::PASSED);
520 
521 }
522 
523 
524 template <class Scalar>
526 {
527  std::string exitStatus;
528  if (solutionHistory_->getCurrentState()->getSolutionStatus() ==
529  Status::FAILED or integratorStatus_ == Status::FAILED) {
530  exitStatus = "Time integration FAILURE!";
531  } else {
532  integratorStatus_ = Status::PASSED;
533  exitStatus = "Time integration complete.";
534  }
535 
536  integratorTimer_->stop();
537  runtime_ = integratorTimer_->totalElapsedTime();
538 }
539 
540 
541 template <class Scalar>
543 {
544  // This has been delayed until timeStepControl has been constructed.
545 
546  // Parse output indices
547  outputScreenIndices_.clear();
548  std::string str =
549  integratorPL_->get<std::string>("Screen Output Index List", "");
550  std::string delimiters(",");
551  std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
552  std::string::size_type pos = str.find_first_of(delimiters, lastPos);
553  while ((pos != std::string::npos) || (lastPos != std::string::npos)) {
554  std::string token = str.substr(lastPos,pos-lastPos);
555  outputScreenIndices_.push_back(int(std::stoi(token)));
556  if(pos==std::string::npos)
557  break;
558 
559  lastPos = str.find_first_not_of(delimiters, pos);
560  pos = str.find_first_of(delimiters, lastPos);
561  }
562 
563  // order output indices and remove duplicates.
564  std::sort(outputScreenIndices_.begin(),outputScreenIndices_.end());
565  outputScreenIndices_.erase(std::unique(outputScreenIndices_.begin(),
566  outputScreenIndices_.end() ),
567  outputScreenIndices_.end() );
568  return;
569 }
570 
571 
572 template <class Scalar>
574  const Teuchos::RCP<Teuchos::ParameterList> & inputPL)
575 {
576  if (inputPL == Teuchos::null) {
577  if (tempusPL_->isParameter("Integrator Name")) {
578  // Set Integrator PL from Tempus PL
579  std::string integratorName_ =
580  tempusPL_->get<std::string>("Integrator Name");
581  integratorPL_ = Teuchos::sublist(tempusPL_, integratorName_, true);
582  } else {
583  // Build default Integrator PL
584  integratorPL_ = Teuchos::parameterList();
585  integratorPL_->setName("Default Integrator");
586  *integratorPL_ = *(this->getValidParameters());
587  tempusPL_->set("Integrator Name", "Default Integrator");
588  tempusPL_->set("Default Integrator", *integratorPL_);
589  }
590  } else {
591  *integratorPL_ = *inputPL;
592  tempusPL_->set("Integrator Name", integratorPL_->name());
593  tempusPL_->set(integratorPL_->name(), *integratorPL_);
594  }
595 
596  integratorPL_->validateParametersAndSetDefaults(*this->getValidParameters());
597 
598  std::string integratorType =
599  integratorPL_->get<std::string>("Integrator Type");
600  TEUCHOS_TEST_FOR_EXCEPTION( integratorType != "Integrator Basic",
601  std::logic_error,
602  "Error - Inconsistent Integrator Type for IntegratorBasicOld\n"
603  << " Integrator Type = " << integratorType << "\n");
604 
605  return;
606 }
607 
608 
611 template<class Scalar>
614 {
615  Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
616 
617  std::ostringstream tmp;
618  tmp << "'Integrator Type' must be 'Integrator Basic'.";
619  pl->set("Integrator Type", "Integrator Basic", tmp.str());
620 
621  tmp.clear();
622  tmp << "Screen Output Index List. Required to be in TimeStepControl range "
623  << "['Minimum Time Step Index', 'Maximum Time Step Index']";
624  pl->set("Screen Output Index List", "", tmp.str());
625  pl->set("Screen Output Index Interval", 1000000,
626  "Screen Output Index Interval (e.g., every 100 time steps)");
627 
628  pl->set("Stepper Name", "",
629  "'Stepper Name' selects the Stepper block to construct (Required).");
630 
631  // Solution History
632  pl->sublist("Solution History",false,"solutionHistory_docs")
634 
635  // Time Step Control
636  pl->sublist("Time Step Control",false,"solutionHistory_docs")
638 
639  return pl;
640 }
641 
642 
643 template <class Scalar>
646 {
647  return(integratorPL_);
648 }
649 
650 
651 template <class Scalar>
654 {
655  Teuchos::RCP<Teuchos::ParameterList> temp_param_list = integratorPL_;
656  integratorPL_ = Teuchos::null;
657  return(temp_param_list);
658 }
659 
661 template<class Scalar>
665 {
667  Teuchos::rcp(new IntegratorBasicOld<Scalar>(pList, model));
668  return(integrator);
669 }
670 
672 template<class Scalar>
675  std::string stepperType)
676 {
678  Teuchos::rcp(new IntegratorBasicOld<Scalar>(model, stepperType));
679  return(integrator);
680 }
681 
683 template<class Scalar>
685 {
688  return(integrator);
689 }
690 
692 template<class Scalar>
695  std::vector<Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > > models)
696 {
698  Teuchos::rcp(new IntegratorBasicOld<Scalar>(pList, models));
699  return(integrator);
700 }
701 
702 } // namespace Tempus
703 #endif // Tempus_IntegratorBasicOld_impl_hpp
Teuchos::RCP< SolutionState< Scalar > > createSolutionStateX(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &xdot=Teuchos::null, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &xdotdot=Teuchos::null)
Nonmember constructor from non-const solution vectors, x.
IntegratorBasicOld()
Constructor that requires a subsequent setParameterList, setStepper, and initialize calls...
void parseScreenOutput()
Parse when screen output should be executed.
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList() override
ParameterList & disableRecursiveValidation()
const std::string toString(const Status status)
Convert Status to string.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList() override
IntegratorObserverBasic class for time integrators. This basic class has simple no-op functions...
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const override
virtual void initializeSolutionHistory(Teuchos::RCP< SolutionState< Scalar > > state=Teuchos::null)
Set the initial state which has the initial conditions.
Thyra Base interface for time steppers.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Create valid IntegratorBasicOld ParameterList.
virtual void setObserver(Teuchos::RCP< IntegratorObserver< Scalar > > obs=Teuchos::null)
Set the Observer.
virtual void checkTimeStep()
Check if time step has passed or failed.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual void setStepperWStepper(Teuchos::RCP< Stepper< Scalar > > stepper)
Set the Stepper.
IntegratorObserver class for time integrators.
std::string description() const override
TimeStepControl manages the time step size. There several mechanisms that effect the time step size a...
void validateParametersAndSetDefaults(ParameterList const &validParamList, int const depth=1000)
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual void setTimeStepControl(Teuchos::RCP< TimeStepControl< Scalar > > tsc=Teuchos::null)
Set the TimeStepControl.
Teuchos::RCP< SolutionState< Scalar > > createSolutionStateME(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, const Teuchos::RCP< StepperState< Scalar > > &stepperState=Teuchos::null, const Teuchos::RCP< PhysicsState< Scalar > > &physicsState=Teuchos::null)
Nonmember constructor from Thyra ModelEvaluator.
virtual void setTempusParameterList(Teuchos::RCP< Teuchos::ParameterList > pl) override
virtual void initialize()
Initializes the Integrator after set* function calls.
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &pl) override
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
virtual void startTimeStep()
Start time step.
virtual void setSolutionHistory(Teuchos::RCP< SolutionHistory< Scalar > > sh=Teuchos::null)
Set the SolutionHistory.
virtual void startIntegrator()
Perform tasks before start of integrator.
virtual void setStepper(Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > model)
Set the Stepper.
virtual void endIntegrator()
Perform tasks after end of integrator.
Teuchos::RCP< IntegratorBasicOld< Scalar > > integratorBasic(Teuchos::RCP< Teuchos::ParameterList > pList, const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &model)
Nonmember constructor.
virtual bool advanceTime()
Advance the solution to timeMax, and return true if successful.
Solution state for integrators and steppers. SolutionState contains the metadata for solutions and th...