Rythmos - Transient Integration for Differential Equations  Version of the Day
 All Classes Functions Variables Typedefs Pages
Rythmos_ImplicitBDFStepper_def.hpp
1 //@HEADER
2 // ***********************************************************************
3 //
4 // Rythmos Package
5 // Copyright (2006) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // This library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as
12 // published by the Free Software Foundation; either version 2.1 of the
13 // License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 // USA
24 // Questions? Contact Todd S. Coffey (tscoffe@sandia.gov)
25 //
26 // ***********************************************************************
27 //@HEADER
28 
29 #ifndef Rythmos_IMPLICITBDF_STEPPER_DEF_H
30 #define Rythmos_IMPLICITBDF_STEPPER_DEF_H
31 
32 #include "Rythmos_ImplicitBDFStepper_decl.hpp"
33 #include "Rythmos_StepperHelpers.hpp"
34 #include "Rythmos_ImplicitBDFStepperStepControl.hpp"
35 
36 namespace Rythmos {
37 
38 // ////////////////////////////
39 // Defintions
40 
41 // Nonmember constructor
42 template<class Scalar>
43 RCP<ImplicitBDFStepper<Scalar> > implicitBDFStepper() {
44  RCP<ImplicitBDFStepper<Scalar> >
45  stepper = rcp(new ImplicitBDFStepper<Scalar>() );
46  return stepper;
47 }
48 
49 template<class Scalar>
50 RCP<ImplicitBDFStepper<Scalar> > implicitBDFStepper(
51  const RCP<Thyra::ModelEvaluator<Scalar> >& model,
52  const RCP<Thyra::NonlinearSolverBase<Scalar> >& solver
53  )
54 {
55  RCP<ImplicitBDFStepper<Scalar> >
56  stepper = Teuchos::rcp(new ImplicitBDFStepper<Scalar>(model, solver));
57  return stepper;
58 }
59 
60 template<class Scalar>
61 RCP<ImplicitBDFStepper<Scalar> > implicitBDFStepper(
62  const RCP<Thyra::ModelEvaluator<Scalar> >& model,
63  const RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
64  const RCP<Teuchos::ParameterList>& parameterList
65  )
66 {
67  RCP<ImplicitBDFStepper<Scalar> >
68  stepper = Teuchos::rcp(new ImplicitBDFStepper<Scalar>(model,
69  solver,
70  parameterList));
71  return stepper;
72 }
73 
74 // Constructors, intializers, Misc.
75 
76 
77 template<class Scalar>
79 {
80  this->defaultInitializeAll_();
81  haveInitialCondition_ = false;
82  isInitialized_=false;
83 }
84 
85 
86 template<class Scalar>
88  const RCP<Thyra::ModelEvaluator<Scalar> >& model
89  ,const RCP<Thyra::NonlinearSolverBase<Scalar> >& solver
90  ,const RCP<Teuchos::ParameterList>& parameterList
91  )
92 {
93  this->defaultInitializeAll_();
94  this->setParameterList(parameterList);
95  // Now we instantiate the model and the solver
96  setModel(model);
97  setSolver(solver);
98  haveInitialCondition_ = false;
99  isInitialized_=false;
100 }
101 
102 
103 template<class Scalar>
105  const RCP<Thyra::ModelEvaluator<Scalar> >& model
106  ,const RCP<Thyra::NonlinearSolverBase<Scalar> >& solver
107  )
108 {
109  this->defaultInitializeAll_();
110  // Now we instantiate the model and the solver
111  setModel(model);
112  setSolver(solver);
113  haveInitialCondition_ = false;
114  isInitialized_=false;
115 }
116 
117 template<class Scalar>
118 const Thyra::VectorBase<Scalar>&
120 {
121  TEUCHOS_TEST_FOR_EXCEPTION(!isInitialized_,std::logic_error,
122  "Error, attempting to call getxHistory before initialization!\n");
123  TEUCHOS_TEST_FOR_EXCEPT( !(( 0 <= index ) && ( index <= maxOrder_ )) );
124  TEUCHOS_TEST_FOR_EXCEPT( !( index <= usedOrder_+1 ) );
125  return(*(xHistory_[index]));
126 }
127 
128 template<class Scalar>
130 {
131  TEUCHOS_TEST_FOR_EXCEPTION(stepControl == Teuchos::null,std::logic_error,"Error, stepControl == Teuchos::null!\n");
132  stepControl_ = stepControl;
133 }
134 
135 template<class Scalar>
136 RCP<StepControlStrategyBase<Scalar> > ImplicitBDFStepper<Scalar>::getNonconstStepControlStrategy()
137 {
138  return(stepControl_);
139 }
140 
141 template<class Scalar>
142 RCP<const StepControlStrategyBase<Scalar> > ImplicitBDFStepper<Scalar>::getStepControlStrategy() const
143 {
144  return(stepControl_);
145 }
146 
147 
148 // Overridden from SolverAcceptingStepperBase
149 
150 
151 template<class Scalar>
152 void ImplicitBDFStepper<Scalar>::setSolver(const RCP<Thyra::NonlinearSolverBase<Scalar> > &solver)
153 {
154  TEUCHOS_TEST_FOR_EXCEPT(solver == Teuchos::null)
155  solver_ = solver;
156 }
157 
158 
159 template<class Scalar>
160 RCP<Thyra::NonlinearSolverBase<Scalar> >
162 {
163  return (solver_);
164 }
165 
166 
167 template<class Scalar>
168 RCP<const Thyra::NonlinearSolverBase<Scalar> >
170 {
171  return (solver_);
172 }
173 
174 
175 // Overridden from StepperBase
176 
177 
178 template<class Scalar>
180 {
181  return true;
182 }
183 
184 template<class Scalar>
186 {
187  return true;
188 }
189 
190 
191 template<class Scalar>
192 RCP<StepperBase<Scalar> >
194 {
195 
196  // Just use the interface to clone the algorithm in an basically
197  // uninitialized state
198 
199  RCP<ImplicitBDFStepper<Scalar> >
200  stepper = Teuchos::rcp(new ImplicitBDFStepper<Scalar>());
201 
202  if (!is_null(model_))
203  stepper->setModel(model_); // Shallow copy is okay!
204 
205  if (!is_null(solver_))
206  stepper->setSolver(solver_->cloneNonlinearSolver().assert_not_null());
207 
208  if (!is_null(parameterList_))
209  stepper->setParameterList(Teuchos::parameterList(*parameterList_));
210 
211  if (!is_null(stepControl_)) {
212  if (stepControl_->supportsCloning())
213  stepper->setStepControlStrategy(
214  stepControl_->cloneStepControlStrategyAlgorithm().assert_not_null());
215  }
216 
217  // At this point, we should have a valid algorithm state. What might be
218  // missing is the initial condition if it was not given in *model_ but was
219  // set explicitly. However, the specification for this function does not
220  // guarantee that the full state will be copied in any case!
221 
222  return stepper;
223 
224 }
225 
226 
227 template<class Scalar>
229  const RCP<const Thyra::ModelEvaluator<Scalar> >& model
230  )
231 {
232  typedef Teuchos::ScalarTraits<Scalar> ST;
233  TEUCHOS_TEST_FOR_EXCEPT( is_null(model) );
234  assertValidModel( *this, *model );
235  model_ = model;
236 }
237 
238 template<class Scalar>
240  const RCP<Thyra::ModelEvaluator<Scalar> >& model
241  )
242 {
243  this->setModel(model); // TODO 09/09/09 tscoffe: use ConstNonconstObjectContainer!
244 }
245 
246 
247 template<class Scalar>
248 RCP<const Thyra::ModelEvaluator<Scalar> >
250 {
251  return model_;
252 }
253 
254 
255 template<class Scalar>
256 RCP<Thyra::ModelEvaluator<Scalar> >
258 {
259  return Teuchos::null;
260 }
261 
262 
263 template<class Scalar>
265  const Thyra::ModelEvaluatorBase::InArgs<Scalar> &initialCondition
266  )
267 {
268  typedef Teuchos::ScalarTraits<Scalar> ST;
269  typedef Thyra::ModelEvaluatorBase MEB;
270  TEUCHOS_TEST_FOR_EXCEPT(is_null(initialCondition.get_x()));
271  TEUCHOS_TEST_FOR_EXCEPT(is_null(initialCondition.get_x_dot()));
272  basePoint_ = initialCondition;
273  xn0_ = initialCondition.get_x()->clone_v();
274  xpn0_ = initialCondition.get_x_dot()->clone_v();
275  time_ = initialCondition.get_t();
276  // Generate vectors for use in calculations
277  x_dot_base_ = createMember(xpn0_->space());
278  V_S(x_dot_base_.ptr(),ST::zero());
279  ee_ = createMember(xn0_->space());
280  V_S(ee_.ptr(),ST::zero());
281  // x history
282  xHistory_.clear();
283  xHistory_.push_back(xn0_->clone_v());
284  xHistory_.push_back(xpn0_->clone_v());
285 
286  haveInitialCondition_ = true;
287  if (isInitialized_) {
288  initialize_();
289  }
290 }
291 
292 
293 template<class Scalar>
294 Thyra::ModelEvaluatorBase::InArgs<Scalar>
296 {
297  return basePoint_;
298 }
299 
300 
301 template<class Scalar>
302 Scalar ImplicitBDFStepper<Scalar>::takeStep(Scalar dt, StepSizeType stepType)
303 {
304 
305  RYTHMOS_FUNC_TIME_MONITOR("Rythmos::ImplicitBDFStepper::takeStep");
306 
307  using Teuchos::as;
308  using Teuchos::incrVerbLevel;
309  typedef Teuchos::ScalarTraits<Scalar> ST;
310  typedef typename Thyra::ModelEvaluatorBase::InArgs<Scalar>::ScalarMag TScalarMag;
311  typedef Thyra::NonlinearSolverBase<Scalar> NSB;
312  typedef Teuchos::VerboseObjectTempState<NSB> VOTSNSB;
313 
314  RCP<Teuchos::FancyOStream> out = this->getOStream();
315  Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
316  Teuchos::OSTab ostab(out,1,"takeStep");
317  VOTSNSB solver_outputTempState(solver_,out,incrVerbLevel(verbLevel,-1));
318 
319  if ( !is_null(out) && as<int>(verbLevel) >= as<int>(Teuchos::VERB_LOW) ) {
320  *out
321  << "\nEntering " << this->Teuchos::Describable::description()
322  << "::takeStep("<<dt<<","<<toString(stepType)<<") ...\n";
323  }
324 
325  if (!isInitialized_) {
326  initialize_();
327  }
328 
329  stepControl_->setOStream(out);
330  stepControl_->setVerbLevel(verbLevel);
331  stepControl_->setRequestedStepSize(*this,dt,stepType);
332 
333  AttemptedStepStatusFlag status;
334  while (1) {
335  // Set up problem coefficients (and handle first step)
336  Scalar hh_old = hh_;
337  int desiredOrder;
338  stepControl_->nextStepSize(*this,&hh_,&stepType,&desiredOrder);
339  TEUCHOS_TEST_FOR_EXCEPT(!((1 <= desiredOrder) && (desiredOrder <= maxOrder_)));
340  TEUCHOS_TEST_FOR_EXCEPT(!(desiredOrder <= usedOrder_+1));
341  currentOrder_ = desiredOrder;
342  if (numberOfSteps_ == 0) {
343  psi_[0] = hh_;
344  if (nef_ == 0) {
345  Vt_S(xHistory_[1].ptr(),hh_);
346  } else {
347  Vt_S(xHistory_[1].ptr(),hh_/hh_old);
348  }
349  }
350  this->updateCoeffs_();
351  // compute predictor
352  obtainPredictor_();
353  // solve nonlinear problem (as follows)
354 
355  //
356  // Setup the nonlinear equations:
357  //
358  // f_bar( x_dot_coeff * x_bar + x_dot_base, x_coeff * x_bar + x_base, t_base ) = 0
359  // x_dot_coeff = -alpha_s/dt
360  // x_dot_base = x_prime_pred + (alpha_s/dt) * x_pred
361  // x_coeff = 1
362  // x_base = 0
363  // t_base = tn+dt
364  //
365  Scalar coeff_x_dot = Scalar(-ST::one())*alpha_s_/hh_;
366  V_StVpStV( x_dot_base_.ptr(), ST::one(), *xpn0_, alpha_s_/hh_, *xn0_ );
367  if ( as<int>(verbLevel) >= as<int>(Teuchos::VERB_EXTREME) ) {
368  *out << "model_ = " << std::endl;
369  model_->describe(*out,verbLevel);
370  *out << "basePoint_ = " << std::endl;
371  basePoint_.describe(*out,verbLevel);
372  *out << "coeff_x_dot = " << coeff_x_dot << std::endl;
373  *out << "x_dot_base_ = " << std::endl;
374  x_dot_base_->describe(*out,verbLevel);
375  *out << "time_+hh_ = " << time_+hh_ << std::endl;
376  *out << "xn0_ = " << std::endl;
377  xn0_->describe(*out,verbLevel);
378  }
379  neModel_.initializeSingleResidualModel(
380  model_, basePoint_,
381  coeff_x_dot, x_dot_base_,
382  ST::one(), Teuchos::null,
383  time_+hh_,
384  xn0_
385  );
386  //
387  // Solve the implicit nonlinear system to a tolerance of ???
388  //
389  if (solver_->getModel().get() != &neModel_) {
390  solver_->setModel( Teuchos::rcpFromRef(neModel_) );
391  }
392  /* // Rythmos::TimeStepNonlinearSolver uses a built in solveCriteria, so you can't pass one in.
393  // I believe this is the correct solveCriteria for IDA though.
394  Thyra::SolveMeasureType nonlinear_solve_measure_type(Thyra::SOLVE_MEASURE_NORM_RESIDUAL,Thyra::SOLVE_MEASURE_ONE);
395  TScalarMag tolerance = relErrTol_/TScalarMag(10.0); // This should be changed to match the condition in IDA
396  Thyra::SolveCriteria<Scalar> nonlinearSolveCriteria(nonlinear_solve_measure_type, tolerance);
397  Thyra::SolveStatus<Scalar> nonlinearSolveStatus = solver_->solve( &*xn0_, &nonlinearSolveCriteria, &*delta_ );
398  */
399  if ( as<int>(verbLevel) >= as<int>(Teuchos::VERB_EXTREME) ) {
400  *out << "xn0 = " << std::endl;
401  xn0_->describe(*out,verbLevel);
402  *out << "ee = " << std::endl;
403  ee_->describe(*out,verbLevel);
404  }
405  Thyra::SolveStatus<Scalar> nonlinearSolveStatus = solver_->solve( &*xn0_, NULL, &*ee_ );
406  if ( as<int>(verbLevel) >= as<int>(Teuchos::VERB_EXTREME) ) {
407  *out << "xn0 = " << std::endl;
408  xn0_->describe(*out,verbLevel);
409  *out << "ee = " << std::endl;
410  ee_->describe(*out,verbLevel);
411  }
412  // In the above solve, on input *xn0_ is the initial guess that comes from
413  // the predictor. On output, *xn0_ is the solved for solution and *ee_ is
414  // the difference computed from the intial guess in *xn0_ to the final
415  // solved value of *xn0_. This is needed for basic numerical stability.
416  if (nonlinearSolveStatus.solveStatus == Thyra::SOLVE_STATUS_CONVERGED) {
417  newtonConvergenceStatus_ = 0;
418  }
419  else {
420  newtonConvergenceStatus_ = -1;
421  }
422 
423  // check error and evaluate LTE
424  stepControl_->setCorrection(*this,xn0_,ee_,newtonConvergenceStatus_);
425  bool stepPass = stepControl_->acceptStep(*this,&LETvalue_);
426 
427  if ( as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH) ) {
428  *out << "xn0_ = " << std::endl;
429  xn0_->describe(*out,verbLevel);
430  *out << "xpn0_ = " << std::endl;
431  xpn0_->describe(*out,verbLevel);
432  *out << "ee_ = " << std::endl;
433  ee_->describe(*out,verbLevel);
434  for (int i=0; i<std::max(2,maxOrder_); ++i) {
435  *out << "xHistory_[" << i << "] = " << std::endl;
436  xHistory_[i]->describe(*out,verbLevel);
437  }
438  }
439 
440  // Check LTE here:
441  if (!stepPass) { // stepPass = false
442  stepLETStatus_ = STEP_LET_STATUS_FAILED;
443  status = stepControl_->rejectStep(*this);
444  nef_++;
445  if (status == CONTINUE_ANYWAY) {
446  break;
447  } else {
448  restoreHistory_();
449  }
450  } else { // stepPass = true
451  stepLETStatus_ = STEP_LET_STATUS_PASSED;
452  break;
453  }
454  }
455 
456  // 08/22/07 the history array must be updated before stepControl_->completeStep.
457  completeStep_();
458  stepControl_->completeStep(*this);
459 
460  if ( !is_null(out) && as<int>(verbLevel) >= as<int>(Teuchos::VERB_LOW) ) {
461  *out
462  << "\nLeaving " << this->Teuchos::Describable::description()
463  << "::takeStep("<<dt<<","<<toString(stepType)<<") ...\n";
464  }
465 
466  return(usedStep_);
467 
468 }
469 
470 
471 template<class Scalar>
473 {
474 
475  // 2007/08/24: rabartl: We agreed that getStepStatus() would be free
476  // so I have commented out removed all code that is not free
477 
478  typedef Teuchos::ScalarTraits<Scalar> ST;
479  StepStatus<Scalar> stepStatus;
480  if (!isInitialized_) {
481  stepStatus.message = "This stepper is uninitialized.";
482  stepStatus.stepStatus = STEP_STATUS_UNINITIALIZED;
483  stepStatus.stepSize = Scalar(-ST::one());
484  stepStatus.order = -1;
485  stepStatus.time = Scalar(-ST::one());
486  return(stepStatus);
487  }
488 
489  if (numberOfSteps_ > 0) {
490  stepStatus.stepStatus = STEP_STATUS_CONVERGED;
491  } else {
492  stepStatus.stepStatus = STEP_STATUS_UNKNOWN;
493  }
494  stepStatus.stepLETStatus = stepLETStatus_;
495  stepStatus.stepSize = usedStep_;
496  stepStatus.order = usedOrder_;
497  stepStatus.time = time_;
498  stepStatus.stepLETValue = LETvalue_;
499  stepStatus.solution = xHistory_[0];
500  stepStatus.solutionDot = Teuchos::null; // This is *not* free!
501  stepStatus.residual = Teuchos::null; // This is *not* free!
502 
503  return(stepStatus);
504 
505 }
506 
507 
508 // Overridden from InterpolationBufferBase
509 
510 
511 template<class Scalar>
512 RCP<const Thyra::VectorSpaceBase<Scalar> >
514 {
515  //TEUCHOS_TEST_FOR_EXCEPTION(!isInitialized_,std::logic_error,"Error, attempting to call get_x_space before initialization!\n");
516  return ( !is_null(model_) ? model_->get_x_space() : Teuchos::null );
517 }
518 
519 
520 template<class Scalar>
522  const Array<Scalar>& time_vec,
523  const Array<RCP<const Thyra::VectorBase<Scalar> > >& x_vec,
524  const Array<RCP<const Thyra::VectorBase<Scalar> > >& xdot_vec
525  )
526 {
527  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
528  "Error, addPoints is not implemented for ImplicitBDFStepper.\n");
529 }
530 
531 
532 template<class Scalar>
534 {
535  if ( !isInitialized_ && haveInitialCondition_ )
536  return timeRange<Scalar>(time_,time_);
537  if ( !isInitialized_ && !haveInitialCondition_ )
538  return invalidTimeRange<Scalar>();
539  return timeRange<Scalar>(time_-usedStep_,time_);
540 }
541 
542 
543 template<class Scalar>
545  const Array<Scalar>& time_vec
546  ,Array<RCP<const Thyra::VectorBase<Scalar> > >* x_vec
547  ,Array<RCP<const Thyra::VectorBase<Scalar> > >* xdot_vec
548  ,Array<ScalarMag>* accuracy_vec) const
549 {
550  using Teuchos::as;
551  using Teuchos::constOptInArg;
552  using Teuchos::null;
553  using Teuchos::ptr;
554  typedef Teuchos::ScalarTraits<Scalar> ST;
555  typedef typename ST::magnitudeType mScalarMag;
556 
557  TEUCHOS_ASSERT(haveInitialCondition_);
558  // Only do this if we're being called pre-initialization to get the IC.
559  if ( (numberOfSteps_ == -1) &&
560  (time_vec.length() == 1) &&
561  (compareTimeValues<Scalar>(time_vec[0],time_)==0) ) {
562  defaultGetPoints<Scalar>(
563  time_, constOptInArg(*xn0_), constOptInArg(*xpn0_),
564  time_, constOptInArg(*xn0_), constOptInArg(*xpn0_),
565  time_vec, ptr(x_vec), ptr(xdot_vec), ptr(accuracy_vec),
566  Ptr<InterpolatorBase<Scalar> >(null)
567  );
568  return;
569  }
570  TEUCHOS_ASSERT(isInitialized_);
571  RYTHMOS_FUNC_TIME_MONITOR("Rythmos::ImplicitBDFStepper::getPoints");
572  if (x_vec)
573  x_vec->clear();
574  if (xdot_vec)
575  xdot_vec->clear();
576  for (Teuchos::Ordinal i=0 ; i<time_vec.size() ; ++i) {
577  RCP<Thyra::VectorBase<Scalar> >
578  x_temp = createMember(xn0_->space());
579  RCP<Thyra::VectorBase<Scalar> >
580  xdot_temp = createMember(xn0_->space());
581  mScalarMag accuracy = -ST::zero();
582  interpolateSolution_(
583  time_vec[i], &*x_temp, &*xdot_temp,
584  accuracy_vec ? &accuracy : 0
585  );
586  if (x_vec)
587  x_vec->push_back(x_temp);
588  if (xdot_vec)
589  xdot_vec->push_back(xdot_temp);
590  if (accuracy_vec)
591  accuracy_vec->push_back(accuracy);
592  }
593  if ( as<int>(this->getVerbLevel()) >= as<int>(Teuchos::VERB_HIGH) ) {
594  RCP<Teuchos::FancyOStream> out = this->getOStream();
595  Teuchos::OSTab ostab(out,1,"getPoints");
596  *out << "Passing out the interpolated values:" << std::endl;
597  for (Teuchos::Ordinal i=0; i<time_vec.size() ; ++i) {
598  *out << "time_[" << i << "] = " << time_vec[i] << std::endl;
599  if (x_vec) {
600  *out << "x_vec[" << i << "] = " << std::endl;
601  (*x_vec)[i]->describe(*out,this->getVerbLevel());
602  }
603  if (xdot_vec) {
604  *out << "xdot_vec[" << i << "] = ";
605  if ( (*xdot_vec)[i] == Teuchos::null) {
606  *out << "Teuchos::null" << std::endl;
607  }
608  else {
609  *out << std::endl << Teuchos::describe(*(*xdot_vec)[i],this->getVerbLevel());
610  }
611  }
612  if (accuracy_vec)
613  *out << "accuracy[" << i << "] = " << (*accuracy_vec)[i] << std::endl;
614  }
615  }
616 }
617 
618 
619 template<class Scalar>
620 void ImplicitBDFStepper<Scalar>::getNodes(Array<Scalar>* time_vec) const
621 {
622  TEUCHOS_ASSERT( time_vec != NULL );
623  time_vec->clear();
624  if (!haveInitialCondition_) {
625  return;
626  }
627  if (numberOfSteps_ > 0) {
628  time_vec->push_back(time_-usedStep_);
629  }
630  time_vec->push_back(time_);
631 }
632 
633 
634 template<class Scalar>
635 void ImplicitBDFStepper<Scalar>::removeNodes(Array<Scalar>& time_vec)
636 {
637  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
638  "Error, removeNodes is not implemented for ImplicitBDFStepper.\n");
639 }
640 
641 
642 template<class Scalar>
644 {
645  if (!isInitialized_) {
646  return(-1);
647  }
648  return(usedOrder_);
649 }
650 
651 
652 // Overridden from Teuchos::ParameterListAcceptor
653 
654 
655 template<class Scalar>
657  RCP<Teuchos::ParameterList> const& paramList
658  )
659 {
660  TEUCHOS_TEST_FOR_EXCEPT(paramList == Teuchos::null);
661  paramList->validateParameters(*this->getValidParameters(),0);
662  parameterList_ = paramList;
663  Teuchos::readVerboseObjectSublist(&*parameterList_,this);
664 }
665 
666 
667 template<class Scalar>
669 {
670  return(parameterList_);
671 }
672 
673 
674 template<class Scalar>
675 RCP<Teuchos::ParameterList>
677 {
678  RCP<Teuchos::ParameterList> temp_param_list = parameterList_;
679  parameterList_ = Teuchos::null;
680  return(temp_param_list);
681 }
682 
683 
684 template<class Scalar>
685 RCP<const Teuchos::ParameterList>
687 {
688 
689  static RCP<Teuchos::ParameterList> validPL;
690 
691  if (is_null(validPL)) {
692 
693  RCP<Teuchos::ParameterList>
694  pl = Teuchos::parameterList();
695 
696  pl->sublist(RythmosStepControlSettings_name);
697 
698  Teuchos::setupVerboseObjectSublist(&*pl);
699 
700  validPL = pl;
701 
702  }
703 
704  RCP<Teuchos::FancyOStream> out = this->getOStream();
705  Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
706  Teuchos::OSTab ostab(out,1,"getValidParameters");
707  if (Teuchos::as<int>(verbLevel) == Teuchos::VERB_HIGH) {
708  *out << "Setting up valid parameterlist." << std::endl;
709  validPL->print(*out);
710  }
711 
712  return (validPL);
713 
714 }
715 
716 
717 // Overridden from Teuchos::Describable
718 
719 
720 template<class Scalar>
722 {
723  std::ostringstream out;
724  out << this->Teuchos::Describable::description();
725  const TimeRange<Scalar> timeRange = this->getTimeRange();
726  if (timeRange.isValid())
727  out << " (timeRange="<<timeRange<<")";
728  else
729  out << " (This stepper is not initialized yet)";
730  out << std::endl;
731  return out.str();
732 }
733 
734 
735 template<class Scalar>
737  Teuchos::FancyOStream &out,
738  const Teuchos::EVerbosityLevel verbLevel
739  ) const
740 {
741 
742  using Teuchos::as;
743 
744  if (!isInitialized_) {
745  out << this->description();
746  return;
747  }
748 
749  if ( (as<int>(verbLevel) == as<int>(Teuchos::VERB_DEFAULT) ) ||
750  (as<int>(verbLevel) >= as<int>(Teuchos::VERB_LOW) )
751  )
752  {
753  out << this->description() << std::endl;
754  out << "model_ = " << Teuchos::describe(*model_,verbLevel);
755  out << "solver_ = " << Teuchos::describe(*solver_,verbLevel);
756  out << "neModel_ = " << Teuchos::describe(neModel_,verbLevel);
757  }
758  if (as<int>(verbLevel) >= as<int>(Teuchos::VERB_LOW)) {
759  out << "time_ = " << time_ << std::endl;
760  out << "hh_ = " << hh_ << std::endl;
761  out << "currentOrder_ = " << currentOrder_ << std::endl;
762  }
763  if (as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH)) {
764  out << "xn0_ = " << Teuchos::describe(*xn0_,verbLevel);
765  out << "xpn0_ = " << Teuchos::describe(*xpn0_,verbLevel);
766  out << "x_dot_base_ = " << Teuchos::describe(*x_dot_base_,verbLevel);
767  for (int i=0 ; i < std::max(2,maxOrder_) ; ++i) {
768  out << "xHistory_[" << i << "] = "
769  << Teuchos::describe(*xHistory_[i],verbLevel);
770  }
771  out << "ee_ = " << Teuchos::describe(*ee_,verbLevel);
772  }
773 }
774 
775 
776 // private
777 
778 
779 // 2007/08/24: rabartl: Belos: We really should initialize all of this data in
780 // a member initialization list but since there are like three constructors
781 // this would mean that we would have to duplicate code (which is error prone)
782 // or use a macro (which is not easy to debug). We really should remove all
783 // but the default constructor which then would set this data once in the
784 // initialization list.
785 
786 template<class Scalar>
788 {
789  typedef Teuchos::ScalarTraits<Scalar> ST;
790  const Scalar nan = ST::nan(), one = ST::one(), zero = ST::zero();
791  // Initialize some data members to their rightful default values
792  haveInitialCondition_ = false;
793  isInitialized_ = false;
794  currentOrder_ = 1;
795  usedOrder_ = 1;
796  usedStep_ = zero;
797  // Initialize the rest of the private data members to invalid values to
798  // avoid uninitialed memory
799  time_ = nan;
800  hh_ = nan;
801  maxOrder_ = -1;
802  LETvalue_ = -one;
803  stepLETStatus_ = STEP_LET_STATUS_UNKNOWN;
804  alpha_s_ = -one;
805  numberOfSteps_ = -1;
806  nef_ = -1;
807  nscsco_ = -1;
808  newtonConvergenceStatus_ = -1;
809 }
810 
811 
812 template<class Scalar>
813 void ImplicitBDFStepper<Scalar>::obtainPredictor_()
814 {
815 
816  using Teuchos::as;
817  typedef Teuchos::ScalarTraits<Scalar> ST;
818 
819  if (!isInitialized_) {
820  return;
821  }
822 
823  RCP<Teuchos::FancyOStream> out = this->getOStream();
824  Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
825  Teuchos::OSTab ostab(out,1,"obtainPredictor_");
826  if ( as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH) ) {
827  *out << "currentOrder_ = " << currentOrder_ << std::endl;
828  }
829 
830  // prepare history array for prediction
831  for (int i=nscsco_;i<=currentOrder_;++i) {
832  Vt_S(xHistory_[i].ptr(),beta_[i]);
833  }
834 
835  // evaluate predictor
836  V_V(xn0_.ptr(),*xHistory_[0]);
837  V_S(xpn0_.ptr(),ST::zero());
838  for (int i=1;i<=currentOrder_;++i) {
839  Vp_V(xn0_.ptr(),*xHistory_[i]);
840  Vp_StV(xpn0_.ptr(),gamma_[i],*xHistory_[i]);
841  }
842  if ( as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH) ) {
843  *out << "xn0_ = " << std::endl;
844  xn0_->describe(*out,verbLevel);
845  *out << "xpn0_ = " << std::endl;
846  xpn0_->describe(*out,verbLevel);
847  }
848 }
849 
850 
851 template<class Scalar>
852 void ImplicitBDFStepper<Scalar>::interpolateSolution_(
853  const Scalar& timepoint,
854  Thyra::VectorBase<Scalar>* x_ptr,
855  Thyra::VectorBase<Scalar>* xdot_ptr,
856  ScalarMag* accuracy_ptr
857  ) const
858 {
859 
860  typedef std::numeric_limits<Scalar> NL;
861  typedef Teuchos::ScalarTraits<Scalar> ST;
862 
863 #ifdef HAVE_RYTHMOS_DEBUG
864  TEUCHOS_TEST_FOR_EXCEPTION(
865  !isInitialized_,std::logic_error,
866  "Error, attempting to call interpolateSolution before initialization!\n");
867  const TimeRange<Scalar> currTimeRange = this->getTimeRange();
868  TEUCHOS_TEST_FOR_EXCEPTION(
869  !currTimeRange.isInRange(timepoint), std::logic_error,
870  "Error, timepoint = " << timepoint << " is not in the time range "
871  << currTimeRange << "!" );
872 #endif
873 
874  const Scalar tn = time_;
875  const int kused = usedOrder_;
876 
877  // order of interpolation
878  int kord = kused;
879  if ( (kused == 0) || (timepoint == tn) ) {
880  kord = 1;
881  }
882 
883  // Initialize interploation
884  Thyra::V_V(ptr(x_ptr),*xHistory_[0]);
885  Thyra::V_S(ptr(xdot_ptr),ST::zero());
886 
887  // Add history array contributions
888  const Scalar delt = timepoint - tn;
889  Scalar c = ST::one(); // coefficient for interpolation of x
890  Scalar d = ST::zero(); // coefficient for interpolation of xdot
891  Scalar gam = delt/psi_[0]; // coefficient for interpolation
892  for (int j=1 ; j <= kord ; ++j) {
893  d = d*gam + c/psi_[j-1];
894  c = c*gam;
895  gam = (delt + psi_[j-1])/psi_[j];
896  Thyra::Vp_StV(ptr(x_ptr),c,*xHistory_[j]);
897  Thyra::Vp_StV(ptr(xdot_ptr),d,*xHistory_[j]);
898  }
899 
900  // Set approximate accuracy
901  if (accuracy_ptr) {
902  *accuracy_ptr = Teuchos::ScalarTraits<Scalar>::pow(usedStep_,kord);
903  }
904 
905 }
906 
907 
908 template<class Scalar>
909 void ImplicitBDFStepper<Scalar>::updateHistory_()
910 {
911 
912  using Teuchos::as;
913 
914  // Save Newton correction for potential order increase on next step.
915  if (usedOrder_ < maxOrder_) {
916  assign( xHistory_[usedOrder_+1].ptr(), *ee_ );
917  }
918  // Update history arrays
919  Vp_V( xHistory_[usedOrder_].ptr(), *ee_ );
920  for (int j=usedOrder_-1;j>=0;j--) {
921  Vp_V( xHistory_[j].ptr(), *xHistory_[j+1] );
922  }
923  RCP<Teuchos::FancyOStream> out = this->getOStream();
924  Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
925  Teuchos::OSTab ostab(out,1,"updateHistory_");
926  if (as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH) ) {
927  for (int i=0;i<std::max(2,maxOrder_);++i) {
928  *out << "xHistory_[" << i << "] = " << std::endl;
929  xHistory_[i]->describe(*out,verbLevel);
930  }
931  }
932 
933 }
934 
935 
936 template<class Scalar>
937 void ImplicitBDFStepper<Scalar>::restoreHistory_()
938 {
939 
940  using Teuchos::as;
941  typedef Teuchos::ScalarTraits<Scalar> ST;
942 
943  // undo preparation of history array for prediction
944  for (int i=nscsco_;i<=currentOrder_;++i) {
945  Vt_S( xHistory_[i].ptr(), ST::one()/beta_[i] );
946  }
947  for (int i=1;i<=currentOrder_;++i) {
948  psi_[i-1] = psi_[i] - hh_;
949  }
950  RCP<Teuchos::FancyOStream> out = this->getOStream();
951  Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
952  Teuchos::OSTab ostab(out,1,"restoreHistory_");
953  if (as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH) ) {
954  for (int i=0;i<maxOrder_;++i) {
955  *out << "psi_[" << i << "] = " << psi_[i] << std::endl;
956  }
957  for (int i=0;i<maxOrder_;++i) {
958  *out << "xHistory_[" << i << "] = " << std::endl;
959  xHistory_[i]->describe(*out,verbLevel);
960  }
961  }
962 
963 }
964 
965 
966 template<class Scalar>
967 void ImplicitBDFStepper<Scalar>::updateCoeffs_()
968 {
969 
970  using Teuchos::as;
971  typedef Teuchos::ScalarTraits<Scalar> ST;
972 
973  // If the number of steps taken with constant order and constant stepsize is
974  // more than the current order + 1 then we don't bother to update the
975  // coefficients because we've reached a constant step-size formula. When
976  // this is is not true, then we update the coefficients for the variable
977  // step-sizes.
978  if ((hh_ != usedStep_) || (currentOrder_ != usedOrder_)) {
979  nscsco_ = 0;
980  }
981  nscsco_ = std::min(nscsco_+1,usedOrder_+2);
982  if (currentOrder_+1 >= nscsco_) {
983  beta_[0] = ST::one();
984  alpha_[0] = ST::one();
985  Scalar temp1 = hh_;
986  gamma_[0] = ST::zero();
987  for (int i=1;i<=currentOrder_;++i) {
988  Scalar temp2 = psi_[i-1];
989  psi_[i-1] = temp1;
990  beta_[i] = beta_[i-1]*psi_[i-1]/temp2;
991  temp1 = temp2 + hh_;
992  alpha_[i] = hh_/temp1;
993  gamma_[i] = gamma_[i-1]+alpha_[i-1]/hh_;
994  }
995  psi_[currentOrder_] = temp1;
996  }
997  alpha_s_ = ST::zero();
998  for (int i=0;i<currentOrder_;++i) {
999  alpha_s_ = alpha_s_ - Scalar(ST::one()/(i+ST::one()));
1000  }
1001  RCP<Teuchos::FancyOStream> out = this->getOStream();
1002  Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
1003  Teuchos::OSTab ostab(out,1,"updateCoeffs_");
1004  if ( as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH) ) {
1005  for (int i=0;i<=maxOrder_;++i) {
1006  *out << "alpha_[" << i << "] = " << alpha_[i] << std::endl;
1007  *out << "beta_[" << i << "] = " << beta_[i] << std::endl;
1008  *out << "gamma_[" << i << "] = " << gamma_[i] << std::endl;
1009  *out << "psi_[" << i << "] = " << psi_[i] << std::endl;
1010  *out << "alpha_s_ = " << alpha_s_ << std::endl;
1011  }
1012  //std::cout << "alpha_s_ = " << alpha_s_ << std::endl;
1013  //for (int i=0;i<=maxOrder_;++i) {
1014  // std::cout << " alpha_[" << i << "] = " << alpha_[i] << std::endl;
1015  // std::cout << " beta_[" << i << "] = " << beta_[i] << std::endl;
1016  // std::cout << " gamma_[" << i << "] = " << gamma_[i] << std::endl;
1017  // std::cout << " psi_[" << i << "] = " << psi_[i] << std::endl;
1018  //}
1019  }
1020 }
1021 
1022 
1023 template<class Scalar>
1024 void ImplicitBDFStepper<Scalar>::initialize_()
1025 {
1026 
1027  using Teuchos::as;
1028  typedef Teuchos::ScalarTraits<Scalar> ST;
1029  using Thyra::createMember;
1030 
1031  RCP<Teuchos::FancyOStream> out = this->getOStream();
1032  Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
1033  const bool doTrace = (as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH));
1034  Teuchos::OSTab ostab(out,1,"initialize_");
1035 
1036  if (doTrace) {
1037  *out
1038  << "\nEntering " << this->Teuchos::Describable::description()
1039  << "::initialize_()...\n";
1040  }
1041 
1042  TEUCHOS_TEST_FOR_EXCEPT(model_ == Teuchos::null);
1043  TEUCHOS_TEST_FOR_EXCEPT(solver_ == Teuchos::null);
1044  TEUCHOS_ASSERT(haveInitialCondition_);
1045 
1046  // Initialize Parameter List if none provided.
1047  if (parameterList_ == Teuchos::null) {
1048  RCP<Teuchos::ParameterList> emptyParameterList = Teuchos::rcp(new Teuchos::ParameterList);
1049  this->setParameterList(emptyParameterList);
1050  }
1051 
1052  // Initialize StepControl
1053  if (stepControl_ == Teuchos::null) {
1054  RCP<ImplicitBDFStepperStepControl<Scalar> > implicitBDFStepperStepControl =
1055  Teuchos::rcp(new ImplicitBDFStepperStepControl<Scalar>());
1056  RCP<Teuchos::ParameterList> stepControlPL =
1057  Teuchos::sublist(parameterList_, RythmosStepControlSettings_name);
1058  implicitBDFStepperStepControl->setParameterList(stepControlPL);
1059  this->setStepControlStrategy(implicitBDFStepperStepControl);
1060  }
1061  stepControl_->initialize(*this);
1062 
1063  maxOrder_ = stepControl_->getMaxOrder(); // maximum order
1064  TEUCHOS_TEST_FOR_EXCEPTION(
1065  !((1 <= maxOrder_) && (maxOrder_ <= 5)), std::logic_error,
1066  "Error, maxOrder returned from stepControl_->getMaxOrder() = " << maxOrder_ << " is outside range of [1,5]!\n"
1067  );
1068 
1069  Scalar zero = ST::zero();
1070 
1071  currentOrder_ = 1; // Current order of integration
1072  usedOrder_ = 1; // order used in current step (used after currentOrder_ is updated)
1073  usedStep_ = zero;
1074  nscsco_ = 0;
1075  LETvalue_ = zero;
1076 
1077  alpha_.clear(); // $\alpha_j(n)=h_n/\psi_j(n)$ coefficient used in local error test
1078  // note: $h_n$ = current step size, n = current time step
1079  gamma_.clear(); // calculate time derivative of history array for predictor
1080  beta_.clear(); // coefficients used to evaluate predictor from history array
1081  psi_.clear(); // $\psi_j(n) = t_n-t_{n-j}$ intermediary variable used to
1082  // compute $\beta_j(n):$
1083  for (int i=0 ; i<=maxOrder_ ; ++i) {
1084  alpha_.push_back(zero);
1085  beta_.push_back(zero);
1086  gamma_.push_back(zero);
1087  psi_.push_back(zero);
1088  }
1089  alpha_s_=Scalar(-ST::one()); // $\alpha_s$ fixed-leading coefficient of this BDF method
1090  hh_=zero;
1091  numberOfSteps_=0; // number of total time integration steps taken
1092  nef_ = 0;
1093 
1094  if ( as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH) ) {
1095  *out << "alpha_s_ = " << alpha_s_ << std::endl;
1096  for (int i=0 ; i<=maxOrder_ ; ++i) {
1097  *out << "alpha_[" << i << "] = " << alpha_[i] << std::endl;
1098  *out << "beta_[" << i << "] = " << beta_[i] << std::endl;
1099  *out << "gamma_[" << i << "] = " << gamma_[i] << std::endl;
1100  *out << "psi_[" << i << "] = " << psi_[i] << std::endl;
1101  }
1102  *out << "numberOfSteps_ = " << numberOfSteps_ << std::endl;
1103  }
1104 
1105  // setInitialCondition initialized xHistory with xn0, xpn0. Now we add the rest of the vectors.
1106  // Store maxOrder_+1 vectors
1107  for (int i=2 ; i<=maxOrder_ ; ++i) {
1108  xHistory_.push_back(createMember(xn0_->space()));
1109  V_S(xHistory_[i].ptr(),zero);
1110  }
1111 
1112  isInitialized_ = true;
1113 
1114  if (doTrace) {
1115  *out
1116  << "\nLeaving " << this->Teuchos::Describable::description()
1117  << "::initialize_()...\n";
1118  }
1119 
1120 }
1121 
1122 
1123 template<class Scalar>
1124 void ImplicitBDFStepper<Scalar>::completeStep_()
1125 {
1126 
1127  using Teuchos::as;
1128  typedef Teuchos::ScalarTraits<Scalar> ST;
1129 
1130 #ifdef HAVE_RYTHMOS_DEBUG
1131  TEUCHOS_TEST_FOR_EXCEPT(ST::isnaninf(hh_));
1132 #endif
1133 
1134  numberOfSteps_ ++;
1135  nef_ = 0;
1136  usedStep_ = hh_;
1137  usedOrder_ = currentOrder_;
1138  time_ += hh_;
1139  RCP<Teuchos::FancyOStream> out = this->getOStream();
1140  Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
1141  Teuchos::OSTab ostab(out,1,"completeStep_");
1142 
1143  if ( as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH) ) {
1144  *out << "numberOfSteps_ = " << numberOfSteps_ << std::endl;
1145  *out << "time_ = " << time_ << std::endl;
1146  }
1147 
1148  // 03/22/04 tscoffe: Note that updating the history has nothing to do with
1149  // the step-size and everything to do with the newton correction vectors.
1150  updateHistory_();
1151 
1152 }
1153 
1154 template<class Scalar>
1156 {
1157  if (!isInitialized_) {
1158  initialize_();
1159  }
1160  stepControl_->setStepControlData(stepper);
1161 }
1162 
1163 //
1164 // Explicit Instantiation macro
1165 //
1166 // Must be expanded from within the Rythmos namespace!
1167 //
1168 
1169 #define RYTHMOS_IMPLICITBDF_STEPPER_INSTANT(SCALAR) \
1170  \
1171  template class ImplicitBDFStepper< SCALAR >; \
1172  \
1173  template RCP< ImplicitBDFStepper< SCALAR > > \
1174  implicitBDFStepper(); \
1175  \
1176  template RCP< ImplicitBDFStepper< SCALAR > > \
1177  implicitBDFStepper( \
1178  const RCP<Thyra::ModelEvaluator< SCALAR > >& model, \
1179  const RCP<Thyra::NonlinearSolverBase< SCALAR > >& solver, \
1180  const RCP<Teuchos::ParameterList>& parameterList \
1181  ); \
1182 
1183 
1184 } // namespace Rythmos
1185 
1186 
1187 #endif //Rythmos_IMPLICITBDF_STEPPER_DEF_H
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
bool isImplicit() const
Overridden from StepperBase.
Base class for defining stepper functionality.
void getPoints(const Array< Scalar > &time_vec, Array< RCP< const Thyra::VectorBase< Scalar > > > *x_vec, Array< RCP< const Thyra::VectorBase< Scalar > > > *xdot_vec, Array< ScalarMag > *accuracy_vec) const
RCP< Teuchos::ParameterList > getNonconstParameterList()
RCP< const Thyra::ModelEvaluator< Scalar > > getModel() const
void setInitialCondition(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &initialCondition)
void setNonconstModel(const RCP< Thyra::ModelEvaluator< Scalar > > &model)
RCP< StepperBase< Scalar > > cloneStepperAlgorithm() const
Creates copies of all internal data (including the parameter list) except the model which is assumed ...
RCP< const StepControlStrategyBase< Scalar > > getStepControlStrategy() const
ImplicitBDFStepper()
Constructors, intializers, Misc.
TimeRange< Scalar > getTimeRange() const
The member functions in the StepControlStrategyBase move you between these states in the following fa...
RCP< const Thyra::VectorBase< Scalar > > residual
RCP< Thyra::NonlinearSolverBase< Scalar > > getNonconstSolver()
RCP< const Thyra::VectorBase< Scalar > > solutionDot
Thyra::ModelEvaluatorBase::InArgs< Scalar > getInitialCondition() const
void setModel(const RCP< const Thyra::ModelEvaluator< Scalar > > &model)
RCP< const Thyra::NonlinearSolverBase< Scalar > > getSolver() const
void getNodes(Array< Scalar > *time_vec) const
Scalar takeStep(Scalar dt, StepSizeType flag)
bool supportsCloning() const
Returns true.
void setParameterList(RCP< Teuchos::ParameterList > const &paramList)
RCP< const Thyra::VectorBase< Scalar > > solution
void setStepControlData(const StepperBase< Scalar > &stepper)
RCP< StepControlStrategyBase< Scalar > > getNonconstStepControlStrategy()
void removeNodes(Array< Scalar > &time_vec)
RCP< Thyra::ModelEvaluator< Scalar > > getNonconstModel()
RCP< const Teuchos::ParameterList > getValidParameters() const
void addPoints(const Array< Scalar > &time_vec, const Array< RCP< const Thyra::VectorBase< Scalar > > > &x_vec, const Array< RCP< const Thyra::VectorBase< Scalar > > > &xdot_vec)
RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const
const StepStatus< Scalar > getStepStatus() const
void setSolver(const RCP< Thyra::NonlinearSolverBase< Scalar > > &solver)
RCP< Teuchos::ParameterList > unsetParameterList()
void setStepControlStrategy(const RCP< StepControlStrategyBase< Scalar > > &stepControlStrategy)
const Thyra::VectorBase< Scalar > & getxHistory(int index) const