Tempus  Version of the Day
Time Integration
Tempus_SolutionHistory_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_SolutionHistory_impl_hpp
10 #define Tempus_SolutionHistory_impl_hpp
11 
12 // Teuchos
13 #include "Teuchos_StandardParameterEntryValidators.hpp"
14 #include "Teuchos_VerboseObjectParameterListHelpers.hpp"
15 #include "Teuchos_TimeMonitor.hpp"
16 
17 // Tempus
18 #include "Tempus_SolutionStateMetaData.hpp"
20 
21 //#include "Thyra_VectorStdOps.hpp"
22 
23 
24 namespace {
25 
26  static std::string Invalid_name = "Invalid";
27  static std::string KeepNewest_name = "Keep Newest";
28  static std::string Undo_name = "Undo";
29  static std::string Static_name = "Static";
30  static std::string Unlimited_name = "Unlimited";
31  static std::string Storage_name = "Storage Type";
32  static std::string Storage_default = Undo_name;
33 
34  static std::string StorageLimit_name = "Storage Limit";
35  static int StorageLimit_default = 2;
36 
37  std::vector<std::string> HistoryPolicies =
38  {Invalid_name, KeepNewest_name, Undo_name, Static_name, Unlimited_name};
39 
40  const Teuchos::RCP<Teuchos::StringToIntegralParameterEntryValidator<Tempus::StorageType> >
41  StorageTypeValidator = Teuchos::rcp(
42  new Teuchos::StringToIntegralParameterEntryValidator<Tempus::StorageType>(
43  HistoryPolicies,
44  Teuchos::tuple<Tempus::StorageType>(
50  Storage_name));
51 
52 } // namespace
53 
54 
55 namespace Tempus {
56 
57 template<class Scalar>
59  Teuchos::RCP<Teuchos::ParameterList> pList)
60 {
61  using Teuchos::RCP;
62  // Create history, an array of solution states.
63  history_ = rcp(new std::vector<RCP<SolutionState<Scalar> > >);
64 
65  this->setParameterList(pList);
66 
67  if (Teuchos::as<int>(this->getVerbLevel()) >=
68  Teuchos::as<int>(Teuchos::VERB_HIGH)) {
69  RCP<Teuchos::FancyOStream> out = this->getOStream();
70  Teuchos::OSTab ostab(out,1,"SolutionHistory::SolutionHistory");
71  *out << this->description() << std::endl;
72  }
73 }
74 
75 
76 template<class Scalar>
78  const Teuchos::RCP<SolutionState<Scalar> >& state)
79 {
80  // Check that we're not going to exceed our storage limit:
81  if (Teuchos::as<int>(history_->size()+1) > storageLimit_) {
82  switch (storageType_) {
83  case STORAGE_TYPE_INVALID: {
84  TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error,
85  "Error - Storage type is STORAGE_TYPE_INVALID.\n");
86  break;
87  }
90  case STORAGE_TYPE_UNDO: {
91  if (state->getTime() >= history_->front()->getTime()) {
92  // Case: State is older than the youngest state in history.
93  // Remove state from the beginning of history, then add new state.
94  history_->erase(history_->begin());
95  } else {
96  // Case: State is younger than the youngest state in history.
97  Teuchos::RCP<Teuchos::FancyOStream> out = this->getOStream();
98  Teuchos::OSTab ostab(out,1,"SolutionHistory::addState");
99  *out << "Warning, state is younger than youngest state in history. "
100  << "State not added!" << std::endl;
101  return;
102  }
103  break;
104  }
106  break;
107  default:
108  TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error,
109  "Error - unknown storage type.\n");
110  }
111  }
112 
113  // Add new state in chronological order.
114  if (history_->size() == 0) {
115  history_->push_back(state);
116  } else {
117  typename std::vector<Teuchos::RCP<SolutionState<Scalar> > >::iterator
118  state_it = history_->begin();
119  for (; state_it < history_->end(); state_it++) {
120  if (state->getTime() < (*state_it)->getTime()) break;
121  }
122  history_->insert(state_it, state);
123  }
124 
125  TEUCHOS_TEST_FOR_EXCEPTION(getNumStates() <= 0, std::logic_error,
126  "Error - SolutionHistory::addState() Invalid history size!\n");
127 
128  return;
129 }
130 
131 template<class Scalar>
133  const Teuchos::RCP<SolutionState<Scalar> >& state, const bool updateTime)
134 {
135  using Teuchos::RCP;
136 
137  addState(state);
138  workingState_ = (*history_)[getNumStates()-1];
139  RCP<SolutionStateMetaData<Scalar> > csmd = getCurrentState()->getMetaData();
140  RCP<SolutionStateMetaData<Scalar> > wsmd = workingState_ ->getMetaData();
141  wsmd->setSolutionStatus(Status::WORKING);
142  wsmd->setIStep(csmd->getIStep()+1);
143  if (updateTime) {
144  wsmd->setTime(csmd->getTime() + csmd->getDt());
145  wsmd->setDt(csmd->getDt());
146  }
147 }
148 
149 template<class Scalar>
151  const Teuchos::RCP<SolutionState<Scalar> >& state)
152 {
153  if (history_->size() != 0) {
154  auto state_it = history_->rbegin();
155  for ( ; state_it < history_->rend(); state_it++) {
156  if (state->getTime() == (*state_it)->getTime()) break;
157  }
158 
159  TEUCHOS_TEST_FOR_EXCEPTION(state_it == history_->rend(), std::logic_error,
160  "Error - removeState() Could not remove state = "
161  // << state_it->describe()
162  );
163 
164  // Need to be careful when erasing a reverse iterator.
165  history_->erase(std::next(state_it).base());
166  }
167  return;
168 }
169 
170 
171 template<class Scalar>
173 {
174  Teuchos::RCP<SolutionState<Scalar> > tmpState = findState(time);
175  removeState(tmpState);
176 }
177 
178 
179 template<class Scalar>
180 Teuchos::RCP<SolutionState<Scalar> >
181 SolutionHistory<Scalar>::findState(const Scalar time) const
182 {
183  TEUCHOS_TEST_FOR_EXCEPTION(
184  !(minTime() <= time and time <= maxTime()), std::logic_error,
185  "Error - SolutionHistory::findState() Requested time out of range!\n"
186  " [Min, Max] = [" << minTime() << ", " << maxTime() << "]\n"
187  " time = "<< time <<"\n");
188 
189  // Use last step in solution history as the scale for comparing times
190  const Scalar scale =
191  history_->size() > 0 ? (*history_)[history_->size()-1]->getTime() : Scalar(1.0);
192  // Linear search
193  auto state_it = history_->begin();
194  for ( ; state_it < history_->end(); ++state_it) {
195  if (floating_compare_equals((*state_it)->getTime(),time,scale))
196  break;
197  }
198 
199  TEUCHOS_TEST_FOR_EXCEPTION(state_it == history_->end(), std::logic_error,
200  "Error - SolutionHistory::findState()!\n"
201  " Did not find a SolutionState with time = " <<time<< std::endl);
202 
203  return *state_it;
204 }
205 
206 
207 template<class Scalar>
208 Teuchos::RCP<SolutionState<Scalar> >
210 {
211  Teuchos::RCP<SolutionState<Scalar> > state_out = getCurrentState()->clone();
212  interpolate<Scalar>(*interpolator_, history_, time, state_out.get());
213  return state_out;
214 }
215 
216 
217 template<class Scalar>
218 void
220  const Scalar time, SolutionState<Scalar>* state_out) const
221 {
222  interpolate<Scalar>(*interpolator_, history_, time, state_out);
223 }
224 
225 
226 /** Initialize the working state */
227 template<class Scalar>
229 {
230  TEMPUS_FUNC_TIME_MONITOR("Tempus::SolutionHistory::initWorkingState()");
231  {
232  TEUCHOS_TEST_FOR_EXCEPTION(getCurrentState() == Teuchos::null,
233  std::logic_error,
234  "Error - SolutionHistory::initWorkingState()\n"
235  "Can not initialize working state without a current state!\n");
236 
237  // If workingState_ has a valid pointer, we are still working on it,
238  // i.e., step failed and trying again, so do not initialize it.
239  if (getWorkingState() != Teuchos::null) return;
240 
241  Teuchos::RCP<SolutionState<Scalar> > newState;
242  if (getNumStates() < storageLimit_) {
243  // Create newState which is duplicate of currentState
244  newState = getCurrentState()->clone();
245  } else {
246  // Recycle old state and copy currentState
247  newState = (*history_)[0];
248  history_->erase(history_->begin());
249  if (getNumStates() > 0) newState->copy(getCurrentState());
250  // When using the Griewank algorithm, we will want to select which
251  // older state to recycle.
252  }
253 
254  addWorkingState(newState);
255 
256  }
257  return;
258 }
259 
260 
261 template<class Scalar>
263 {
264  Teuchos::RCP<SolutionStateMetaData<Scalar> > md =
265  getWorkingState()->getMetaData();
266  md->setNFailures(std::max(0,md->getNFailures()-1));
267  md->setNConsecutiveFailures(0);
268  md->setSolutionStatus(Status::PASSED);
269  //md->setIsSynced(true);
270  md->setIsInterpolated(false);
271  workingState_ = Teuchos::null;
272 }
273 
274 
275 template<class Scalar>
277 {
278  storageLimit_ = std::max(1,storage_limit);
279 
280  TEUCHOS_TEST_FOR_EXCEPTION(
281  (Teuchos::as<int>(history_->size()) > storageLimit_), std::logic_error,
282  "Error - requested storage limit = " << storageLimit_
283  << " is smaller than the current number of states stored = "
284  << history_->size() << "!\n");
285 }
286 
287 
288 template<class Scalar>
289 Teuchos::RCP<SolutionState<Scalar> >
291 {
292  const int m = history_->size();
293  TEUCHOS_TEST_FOR_EXCEPTION( (m < 1), std::out_of_range,
294  "Error - getStateTimeIndexN() No states in SolutionHistory!\n");
295  return (*history_)[m-1];
296 }
297 
298 
299 template<class Scalar>
300 Teuchos::RCP<SolutionState<Scalar> >
302 {
303  const int m = history_->size();
304  TEUCHOS_TEST_FOR_EXCEPTION( (m < 2), std::out_of_range,
305  "Error - getStateTimeIndexNM1() Not enough states in "
306  << "SolutionHistory!\n");
307  const int n = (*history_)[m-1]->getIndex();
308  const int nm1 = (*history_)[m-2]->getIndex();
309 
310  // No need to search SolutionHistory as states n and nm1 should be
311  // next to each other.
312  TEUCHOS_TEST_FOR_EXCEPTION( (nm1 != n-1), std::out_of_range,
313  "Error - getStateTimeIndexNM1() Timestep index n-1 is not in "
314  << "SolutionHistory!\n"
315  << " (n)th index = " << n << "\n"
316  << " (n-1)th index = " << nm1 << "\n");
317 
318  return (*history_)[m-2];
319 }
320 
321 
322 template<class Scalar>
323 Teuchos::RCP<SolutionState<Scalar> >
325 {
326  const int m = history_->size();
327  TEUCHOS_TEST_FOR_EXCEPTION( (m < 3), std::out_of_range,
328  "Error - getStateTimeIndexNM1() Not enough states in "
329  << "SolutionHistory!\n");
330  const int n = (*history_)[m-1]->getIndex();
331  const int nm2 = (*history_)[m-3]->getIndex();
332 
333  // Assume states n and nm2 are one away from each other.
334  // May need to do a search otherwise.
335  TEUCHOS_TEST_FOR_EXCEPTION( (nm2 != n-2), std::out_of_range,
336  "Error - getStateTimeIndexNM1() Timestep index n-2 is not in "
337  << "SolutionHistory!\n"
338  << " (n)th index = " << n << "\n"
339  << " (n-2)th index = " << nm2 << "\n");
340 
341  return (*history_)[m-3];
342 }
343 
344 
345 template<class Scalar>
346 Teuchos::RCP<SolutionState<Scalar> >
348 {
349  typename std::vector<Teuchos::RCP<SolutionState<Scalar> > >::iterator
350  state_it = history_->begin();
351  for (; state_it < history_->end(); state_it++) {
352  if ((*state_it)->getIndex() == index) break;
353  }
354  TEUCHOS_TEST_FOR_EXCEPTION( state_it==history_->end(), std::out_of_range,
355  "Error - getStateTimeIndex() Timestep index is not in "
356  << "SolutionHistory!\n"
357  << " index = " << index << "\n");
358  return (*state_it);
359 }
360 
361 
362 template<class Scalar>
364 {
365  return ("Tempus::SolutionHistory - name = '" + name_ + "'");
366 }
367 
368 
369 template<class Scalar>
371  Teuchos::FancyOStream &out,
372  const Teuchos::EVerbosityLevel verbLevel) const
373 {
374  if ((Teuchos::as<int>(verbLevel)==Teuchos::as<int>(Teuchos::VERB_DEFAULT)) ||
375  (Teuchos::as<int>(verbLevel)>=Teuchos::as<int>(Teuchos::VERB_LOW) ) ){
376  out << description() << "::describe" << std::endl;
377  //out << "interpolator = " << interpolator->description() << std::endl;
378  out << "storageLimit = " << storageLimit_ << std::endl;
379  out << "storageType = " << storageType_ << std::endl;
380  out << "number of states = " << history_->size() << std::endl;
381  out << "time range = (" << history_->front()->getTime() << ", "
382  << history_->back()->getTime() << ")"
383  << std::endl;
384  } else if (Teuchos::as<int>(verbLevel) >=
385  Teuchos::as<int>(Teuchos::VERB_HIGH)) {
386  out << "SolutionStates: " << std::endl;
387  for (int i=0; i<(int)history_->size() ; ++i) {
388  out << "SolutionState[" << i << "] = " << std::endl;
389  (*history_)[i]->describe(out,this->getVerbLevel());
390  }
391  }
392 }
393 
394 
395 template <class Scalar>
397  Teuchos::RCP<Teuchos::ParameterList> const& pList)
398 {
399  if (pList == Teuchos::null) {
400  // Create default parameters if null, otherwise keep current parameters.
401  if (shPL_ == Teuchos::null) {
402  shPL_ = Teuchos::parameterList("Solution History");
403  *shPL_ = *(this->getValidParameters());
404  }
405  } else {
406  shPL_ = pList;
407  }
408  shPL_->validateParametersAndSetDefaults(*this->getValidParameters());
409 
410  name_ = shPL_->name();
411 
412  storageType_ = StorageTypeValidator->getIntegralValue(
413  *shPL_, Storage_name, Storage_default);
414 
415  int storage_limit = shPL_->get(StorageLimit_name, StorageLimit_default);
416 
417  switch (storageType_) {
420  storageType_ = STORAGE_TYPE_KEEP_NEWEST;
421  if (storage_limit != 1) {
422  Teuchos::RCP<Teuchos::FancyOStream> out = this->getOStream();
423  Teuchos::OSTab ostab(out,1,"SolutionHistory::setParameterList");
424  *out << "Warning - 'Storage Limit' for 'Keep Newest' is 1.\n"
425  << " (Storage Limit = "<<storage_limit<<"). Resetting to 1."
426  << std::endl;
427  storage_limit = 1;
428  }
429  setStorageLimit(storage_limit);
430  break;
431  }
432  case STORAGE_TYPE_UNDO: {
433  if (storage_limit != 2) {
434  Teuchos::RCP<Teuchos::FancyOStream> out = this->getOStream();
435  Teuchos::OSTab ostab(out,1,"SolutionHistory::setParameterList");
436  *out << "Warning - 'Storage Limit' for 'Undo' is 2.\n"
437  << " (Storage Limit = "<<storage_limit<<"). Resetting to 2."
438  << std::endl;
439  storage_limit = 2;
440  }
441  setStorageLimit(storage_limit);
442  break;
443  }
444  case STORAGE_TYPE_STATIC: {
445  break;
446  }
447  case STORAGE_TYPE_UNLIMITED: {
448  storage_limit = std::numeric_limits<int>::max();
449  break;
450  }
451  }
452  setStorageLimit(storage_limit);
453 
455  Teuchos::sublist(shPL_, "Interpolator"));
456 }
457 
458 
459 template<class Scalar>
460 Teuchos::RCP<const Teuchos::ParameterList>
462 {
463  Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
464 
465  pl->setName("Valid ParameterList");
466 
467  pl->set(Storage_name, Storage_default,
468  "'Storage Type' sets the memory storage. "
469  "'Keep Newest' - will retain the single newest solution state. "
470  "'Undo' - will retain two solution states in order to do a single undo. "
471  "'Static' - will retain 'Storage Limit' number of solution states. "
472  "'Unlimited' - will not remove any solution states!",
473  StorageTypeValidator);
474 
475  pl->set(StorageLimit_name, StorageLimit_default,
476  "Storage limit for the solution history.");
477 
478  // Interpolator
479  pl->sublist("Interpolator",false,"").disableRecursiveValidation();
480 
481  return pl;
482 }
483 
484 
485 template <class Scalar>
486 Teuchos::RCP<Teuchos::ParameterList>
488 {
489  return(shPL_);
490 }
491 
492 
493 template <class Scalar>
494 Teuchos::RCP<Teuchos::ParameterList>
496 {
497  Teuchos::RCP<Teuchos::ParameterList> temp_plist = shPL_;
498  shPL_ = Teuchos::null;
499  return(temp_plist);
500 }
501 
502 // Nonmember constructor.
503 template<class Scalar>
504 Teuchos::RCP<SolutionHistory<Scalar> > solutionHistory(
505  Teuchos::RCP<Teuchos::ParameterList> pList)
506 {
507  Teuchos::RCP<SolutionHistory<Scalar> > sh=rcp(new SolutionHistory<Scalar>(pList));
508  return sh;
509 }
510 
511 template<class Scalar>
513  const Teuchos::RCP<Interpolator<Scalar> >& interpolator)
514 {
515  if (interpolator == Teuchos::null) {
517  } else {
518  interpolator_ = interpolator;
519  }
520  if (Teuchos::as<int>(this->getVerbLevel()) >=
521  Teuchos::as<int>(Teuchos::VERB_HIGH)) {
522  Teuchos::RCP<Teuchos::FancyOStream> out = this->getOStream();
523  Teuchos::OSTab ostab(out,1,"SolutionHistory::setInterpolator");
524  *out << "interpolator = " << interpolator_->description() << std::endl;
525  }
526 }
527 
528 template<class Scalar>
529 Teuchos::RCP<Interpolator<Scalar> >
531 {
532  return interpolator_;
533 }
534 
535 template<class Scalar>
536 Teuchos::RCP<const Interpolator<Scalar> >
538 {
539  return interpolator_;
540 }
541 
542 template<class Scalar>
543 Teuchos::RCP<Interpolator<Scalar> >
545 {
546  Teuchos::RCP<Interpolator<Scalar> > old_interpolator = interpolator_;
547  interpolator_ = lagrangeInterpolator<Scalar>();
548  return old_interpolator;
549 }
550 
551 
552 } // namespace Tempus
553 #endif // Tempus_SolutionHistory_impl_hpp
Tempus::SolutionHistory::getStateTimeIndex
Teuchos::RCP< SolutionState< Scalar > > getStateTimeIndex(int index) const
Get the state with timestep index equal to "index".
Definition: Tempus_SolutionHistory_impl.hpp:347
Tempus::SolutionHistory::unSetInterpolator
Teuchos::RCP< Interpolator< Scalar > > unSetInterpolator()
Unset the interpolator for this history.
Definition: Tempus_SolutionHistory_impl.hpp:544
Tempus::WORKING
Definition: Tempus_Types.hpp:19
Tempus::SolutionHistory::addWorkingState
void addWorkingState(const Teuchos::RCP< SolutionState< Scalar > > &state, const bool updateTime=true)
Add a working solution state to history.
Definition: Tempus_SolutionHistory_impl.hpp:132
Tempus::solutionHistory
Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory(Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
Nonmember constructor.
Definition: Tempus_SolutionHistory_impl.hpp:504
Tempus::STORAGE_TYPE_STATIC
Keep a fix number of states.
Definition: Tempus_SolutionHistory_decl.hpp:30
Tempus_InterpolatorFactory.hpp
Tempus::SolutionHistory::SolutionHistory
SolutionHistory(Teuchos::RCP< Teuchos::ParameterList > shPL=Teuchos::null)
Contructor.
Definition: Tempus_SolutionHistory_impl.hpp:58
Tempus
Definition: Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp:20
Tempus::InterpolatorFactory::createInterpolator
static Teuchos::RCP< Interpolator< Scalar > > createInterpolator(std::string interpolatorType="")
Create default interpolator from interpolator type (e.g., "Linear").
Definition: Tempus_InterpolatorFactory.hpp:29
Tempus::SolutionHistory::setParameterList
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &pl)
Definition: Tempus_SolutionHistory_impl.hpp:396
Tempus::SolutionHistory::getNonconstInterpolator
Teuchos::RCP< Interpolator< Scalar > > getNonconstInterpolator()
Definition: Tempus_SolutionHistory_impl.hpp:530
Tempus::floating_compare_equals
bool floating_compare_equals(const Scalar &a, const Scalar &b, const Scalar &scale)
Helper function for comparing times.
Definition: Tempus_Interpolator.hpp:90
Tempus::SolutionHistory::interpolateState
Teuchos::RCP< SolutionState< Scalar > > interpolateState(const Scalar time) const
Generate and interpolate a new solution state at requested time.
Definition: Tempus_SolutionHistory_impl.hpp:209
Tempus::STORAGE_TYPE_UNLIMITED
Grow the history as needed.
Definition: Tempus_SolutionHistory_decl.hpp:31
Tempus::SolutionHistory::description
virtual std::string description() const
Definition: Tempus_SolutionHistory_impl.hpp:363
Tempus::STORAGE_TYPE_UNDO
Keep the 2 newest states for undo.
Definition: Tempus_SolutionHistory_decl.hpp:29
Tempus::SolutionHistory::getInterpolator
Teuchos::RCP< const Interpolator< Scalar > > getInterpolator() const
Definition: Tempus_SolutionHistory_impl.hpp:537
Tempus::SolutionState
Solution state for integrators and steppers. SolutionState contains the metadata for solutions and th...
Definition: Tempus_SolutionState_decl.hpp:56
Tempus::SolutionHistory::initWorkingState
void initWorkingState()
Initialize the working state.
Definition: Tempus_SolutionHistory_impl.hpp:228
Tempus::SolutionHistory::getNonconstParameterList
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
Definition: Tempus_SolutionHistory_impl.hpp:487
Tempus::STORAGE_TYPE_INVALID
Invalid storage type.
Definition: Tempus_SolutionHistory_decl.hpp:27
Tempus::STORAGE_TYPE_KEEP_NEWEST
Keep the single newest state.
Definition: Tempus_SolutionHistory_decl.hpp:28
Tempus::PASSED
Definition: Tempus_Types.hpp:17
Tempus::SolutionHistory::findState
Teuchos::RCP< SolutionState< Scalar > > findState(const Scalar time) const
Find solution state at requested time (no interpolation)
Definition: Tempus_SolutionHistory_impl.hpp:181
Tempus::SolutionHistory::addState
void addState(const Teuchos::RCP< SolutionState< Scalar > > &state)
Add solution state to history.
Definition: Tempus_SolutionHistory_impl.hpp:77
Tempus::SolutionHistory
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
Definition: Tempus_Integrator.hpp:25
Tempus::SolutionHistory::describe
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Definition: Tempus_SolutionHistory_impl.hpp:370
Tempus::SolutionHistory::getStateTimeIndexN
Teuchos::RCP< SolutionState< Scalar > > getStateTimeIndexN() const
Get the state with timestep index equal to n.
Definition: Tempus_SolutionHistory_impl.hpp:290
Tempus::SolutionHistory::getStateTimeIndexNM2
Teuchos::RCP< SolutionState< Scalar > > getStateTimeIndexNM2() const
Get the state with timestep index equal to n-2.
Definition: Tempus_SolutionHistory_impl.hpp:324
Tempus::SolutionHistory::setStorageLimit
void setStorageLimit(int storage_limit)
Set the maximum storage of this history.
Definition: Tempus_SolutionHistory_impl.hpp:276
Tempus::SolutionHistory::getStateTimeIndexNM1
Teuchos::RCP< SolutionState< Scalar > > getStateTimeIndexNM1() const
Get the state with timestep index equal to n-1.
Definition: Tempus_SolutionHistory_impl.hpp:301
Tempus::SolutionHistory::setInterpolator
void setInterpolator(const Teuchos::RCP< Interpolator< Scalar > > &interpolator)
Set the interpolator for this history.
Definition: Tempus_SolutionHistory_impl.hpp:512
Tempus::SolutionHistory::getValidParameters
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Definition: Tempus_SolutionHistory_impl.hpp:461
Tempus::SolutionHistory::unsetParameterList
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
Definition: Tempus_SolutionHistory_impl.hpp:495
Tempus::SolutionHistory::removeState
void removeState(const Teuchos::RCP< SolutionState< Scalar > > &state)
Remove solution state.
Definition: Tempus_SolutionHistory_impl.hpp:150
Tempus::SolutionHistory::promoteWorkingState
void promoteWorkingState()
Promote the working state to current state.
Definition: Tempus_SolutionHistory_impl.hpp:262
Tempus::Interpolator
Base strategy class for interpolation functionality.
Definition: Tempus_Interpolator.hpp:29