Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_StepperNewmarkImplicitAForm_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_StepperNewmarkImplicitAForm_impl_hpp
10 #define Tempus_StepperNewmarkImplicitAForm_impl_hpp
11 
12 #include "Tempus_config.hpp"
14 #include "Teuchos_VerboseObjectParameterListHelpers.hpp"
15 #include "NOX_Thyra.H"
16 
17 //#define VERBOSE_DEBUG_OUTPUT
18 //#define DEBUG_OUTPUT
19 
20 namespace Tempus {
21 
22 // Forward Declaration for recursive includes (this Stepper <--> StepperFactory)
23 template<class Scalar> class StepperFactory;
24 
25 
26 template<class Scalar>
28 predictVelocity(Thyra::VectorBase<Scalar>& vPred,
29  const Thyra::VectorBase<Scalar>& v,
30  const Thyra::VectorBase<Scalar>& a,
31  const Scalar dt) const
32 {
33 #ifdef VERBOSE_DEBUG_OUTPUT
34  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
35 #endif
36  //vPred = v + dt*(1.0-gamma_)*a
37  Thyra::V_StVpStV(Teuchos::ptrFromRef(vPred), 1.0, v, dt*(1.0-gamma_), a);
38 }
39 
40 template<class Scalar>
42 predictDisplacement(Thyra::VectorBase<Scalar>& dPred,
43  const Thyra::VectorBase<Scalar>& d,
44  const Thyra::VectorBase<Scalar>& v,
45  const Thyra::VectorBase<Scalar>& a,
46  const Scalar dt) const
47 {
48 #ifdef VERBOSE_DEBUG_OUTPUT
49  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
50 #endif
51  Teuchos::RCP<const Thyra::VectorBase<Scalar> > tmp =
52  Thyra::createMember<Scalar>(dPred.space());
53  //dPred = dt*v + dt*dt/2.0*(1.0-2.0*beta_)*a
54  Scalar aConst = dt*dt/2.0*(1.0-2.0*beta_);
55  Thyra::V_StVpStV(Teuchos::ptrFromRef(dPred), dt, v, aConst, a);
56  //dPred += d;
57  Thyra::Vp_V(Teuchos::ptrFromRef(dPred), d, 1.0);
58 }
59 
60 template<class Scalar>
62 correctVelocity(Thyra::VectorBase<Scalar>& v,
63  const Thyra::VectorBase<Scalar>& vPred,
64  const Thyra::VectorBase<Scalar>& a,
65  const Scalar dt) const
66 {
67 #ifdef VERBOSE_DEBUG_OUTPUT
68  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
69 #endif
70  //v = vPred + dt*gamma_*a
71  Thyra::V_StVpStV(Teuchos::ptrFromRef(v), 1.0, vPred, dt*gamma_, a);
72 }
73 
74 template<class Scalar>
76 correctDisplacement(Thyra::VectorBase<Scalar>& d,
77  const Thyra::VectorBase<Scalar>& dPred,
78  const Thyra::VectorBase<Scalar>& a,
79  const Scalar dt) const
80 {
81 #ifdef VERBOSE_DEBUG_OUTPUT
82  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
83 #endif
84  //d = dPred + beta_*dt*dt*a
85  Thyra::V_StVpStV(Teuchos::ptrFromRef(d), 1.0, dPred, beta_*dt*dt, a);
86 }
87 
88 
89 template<class Scalar>
91 {
92  if (schemeName_ != "User Defined") {
93  *out_ << "\nWARNING: schemeName != 'User Defined' (=" <<schemeName_<< ").\n"
94  << " Not setting beta, and leaving as beta = " << beta_ << "!\n";
95  return;
96  }
97 
98  beta_ = beta;
99 
100  if (beta_ == 0.0) {
101  *out_ << "\nWARNING: Running (implicit implementation of) Newmark "
102  << "Implicit a-Form Stepper with Beta = 0.0, which \n"
103  << "specifies an explicit scheme. Mass lumping is not possible, "
104  << "so this will be slow! To run explicit \n"
105  << "implementation of Newmark Implicit a-Form Stepper, please "
106  << "re-run with 'Stepper Type' = 'Newmark Explicit a-Form'.\n"
107  << "This stepper allows for mass lumping when called through "
108  << "Piro::TempusSolver.\n";
109  }
110 
111  TEUCHOS_TEST_FOR_EXCEPTION( (beta_ > 1.0) || (beta_ < 0.0),
112  std::logic_error,
113  "\nError in 'Newmark Implicit a-Form' stepper: invalid value of Beta = "
114  << beta_ << ". Please select Beta >= 0 and <= 1. \n");
115 }
116 
117 
118 template<class Scalar>
120 {
121  if (schemeName_ != "User Defined") {
122  *out_ << "\nWARNING: schemeName != 'User Defined' (=" <<schemeName_<< ").\n"
123  << " Not setting gamma, and leaving as gamma = " << gamma_ << "!\n";
124  return;
125  }
126 
127  gamma_ = gamma;
128 
129  TEUCHOS_TEST_FOR_EXCEPTION( (gamma_ > 1.0) || (gamma_ < 0.0),
130  std::logic_error,
131  "\nError in 'Newmark Implicit a-Form' stepper: invalid value of Gamma ="
132  <<gamma_ << ". Please select Gamma >= 0 and <= 1. \n");
133 }
134 
135 
136 template<class Scalar>
138  std::string schemeName)
139 {
140  schemeName_ = schemeName;
141 
142  if (schemeName_ == "Average Acceleration") {
143  beta_= 0.25; gamma_ = 0.5;
144  }
145  else if (schemeName_ == "Linear Acceleration") {
146  beta_= 0.25; gamma_ = 1.0/6.0;
147  }
148  else if (schemeName_ == "Central Difference") {
149  beta_= 0.0; gamma_ = 0.5;
150  }
151  else if (schemeName_ == "User Defined") {
152  beta_= 0.25; gamma_ = 0.5; // Use defaults until setBeta and setGamma calls.
153  }
154  else {
155  TEUCHOS_TEST_FOR_EXCEPTION(true,
156  std::logic_error,
157  "\nError in Tempus::StepperNewmarkImplicitAForm! "
158  <<"Invalid Scheme Name = " << schemeName_ <<". \n"
159  <<"Valid Scheme Names are: 'Average Acceleration', "
160  <<"'Linear Acceleration', \n"
161  <<"'Central Difference' and 'User Defined'.\n");
162  }
163 }
164 
165 
166 template<class Scalar>
168  out_(Teuchos::VerboseObjectBase::getDefaultOStream())
169 {
170 #ifdef VERBOSE_DEBUG_OUTPUT
171  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
172 #endif
173 
174  this->setStepperType( "Newmark Implicit a-Form");
175  this->setUseFSAL( this->getUseFSALDefault());
178  this->setZeroInitialGuess( false);
179  this->setSchemeName( "Average Acceleration");
180 
181  this->setObserver();
182 }
183 
184 
185 template<class Scalar>
187  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel,
188  const Teuchos::RCP<StepperObserver<Scalar> >& obs,
189  const Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
190  bool useFSAL,
191  std::string ICConsistency,
192  bool ICConsistencyCheck,
193  bool zeroInitialGuess,
194  std::string schemeName,
195  Scalar beta,
196  Scalar gamma)
197  : out_(Teuchos::VerboseObjectBase::getDefaultOStream())
198 {
199  this->setStepperType( "Newmark Implicit a-Form");
200  this->setUseFSAL( useFSAL);
201  this->setICConsistency( ICConsistency);
202  this->setICConsistencyCheck( ICConsistencyCheck);
203  this->setZeroInitialGuess( zeroInitialGuess);
204  this->setSchemeName( schemeName);
205  this->setBeta( beta);
206  this->setGamma( gamma);
207 
208  this->setObserver(obs);
209 
210  if (appModel != Teuchos::null) {
211 
212  this->setModel(appModel);
213  this->setSolver(solver);
214  this->initialize();
215  }
216 }
217 
218 
219 template<class Scalar>
221  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel)
222 {
223 #ifdef VERBOSE_DEBUG_OUTPUT
224  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
225 #endif
226  validSecondOrderODE_DAE(appModel);
227  auto wrapperModel =
228  Teuchos::rcp(new WrapperModelEvaluatorSecondOrder<Scalar>(appModel,
229  "Newmark Implicit a-Form"));
230  this->wrapperModel_ = wrapperModel;
231 }
232 
233 
234 template<class Scalar>
236 {
237  TEUCHOS_TEST_FOR_EXCEPTION( this->wrapperModel_ == Teuchos::null,
238  std::logic_error,
239  "Error - Need to set the model, setModel(), before calling "
240  "StepperNewmarkImplicitAForm::initialize()\n");
241 
242 #ifdef VERBOSE_DEBUG_OUTPUT
243  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
244 #endif
245 }
246 
247 
248 template<class Scalar>
250  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory)
251 {
252  using Teuchos::RCP;
253 
254  int numStates = solutionHistory->getNumStates();
255 
256  TEUCHOS_TEST_FOR_EXCEPTION(numStates < 1, std::logic_error,
257  "Error - setInitialConditions() needs at least one SolutionState\n"
258  " to set the initial condition. Number of States = " << numStates);
259 
260  if (numStates > 1) {
261  RCP<Teuchos::FancyOStream> out = this->getOStream();
262  Teuchos::OSTab ostab(out,1,"StepperNewmarkImplicitAForm::setInitialConditions()");
263  *out << "Warning -- SolutionHistory has more than one state!\n"
264  << "Setting the initial conditions on the currentState.\n"<<std::endl;
265  }
266 
267  RCP<SolutionState<Scalar> > initialState = solutionHistory->getCurrentState();
268  RCP<Thyra::VectorBase<Scalar> > x = initialState->getX();
269  RCP<Thyra::VectorBase<Scalar> > xDot = initialState->getXDot();
270 
271  auto inArgs = this->wrapperModel_->getNominalValues();
272  TEUCHOS_TEST_FOR_EXCEPTION(
273  !((x != Teuchos::null && xDot != Teuchos::null) ||
274  (inArgs.get_x() != Teuchos::null &&
275  inArgs.get_x_dot() != Teuchos::null)), std::logic_error,
276  "Error - We need to set the initial conditions for x and xDot from\n"
277  " either initialState or appModel_->getNominalValues::InArgs\n"
278  " (but not from a mixture of the two).\n");
279 
280  // Use x and xDot from inArgs as ICs, if needed.
281  if ( x == Teuchos::null || xDot == Teuchos::null ) {
282  using Teuchos::rcp_const_cast;
283  TEUCHOS_TEST_FOR_EXCEPTION( (inArgs.get_x() == Teuchos::null) ||
284  (inArgs.get_x_dot() == Teuchos::null), std::logic_error,
285  "Error - setInitialConditions() needs the ICs from the initialState\n"
286  " or getNominalValues()!\n");
287  x = rcp_const_cast<Thyra::VectorBase<Scalar> >(inArgs.get_x());
288  initialState->setX(x);
289  xDot = rcp_const_cast<Thyra::VectorBase<Scalar> >(inArgs.get_x_dot());
290  initialState->setXDot(xDot);
291  }
292 
293  // Check if we need Stepper storage for xDotDot
294  if (initialState->getXDotDot() == Teuchos::null)
295  initialState->setXDotDot(initialState->getX()->clone_v());
296 
297  // Perform IC Consistency
298  std::string icConsistency = this->getICConsistency();
299  if (icConsistency == "None") {
300  if (initialState->getXDotDot() == Teuchos::null) {
301  RCP<Teuchos::FancyOStream> out = this->getOStream();
302  Teuchos::OSTab ostab(out,1,
303  "StepperNewmarkImplicitAForm::setInitialConditions()");
304  *out << "Warning -- Requested IC consistency of 'None' but\n"
305  << " initialState does not have an xDot.\n"
306  << " Setting a 'Zero' xDot!\n" << std::endl;
307 
308  Thyra::assign(this->getStepperXDotDot(initialState).ptr(), Scalar(0.0));
309  }
310  }
311  else if (icConsistency == "Zero")
312  Thyra::assign(this->getStepperXDotDot(initialState).ptr(), Scalar(0.0));
313  else if (icConsistency == "App") {
314  auto xDotDot = Teuchos::rcp_const_cast<Thyra::VectorBase<Scalar> >(
315  inArgs.get_x_dot_dot());
316  TEUCHOS_TEST_FOR_EXCEPTION(xDotDot == Teuchos::null, std::logic_error,
317  "Error - setInitialConditions() requested 'App' for IC consistency,\n"
318  " but 'App' returned a null pointer for xDotDot!\n");
319  Thyra::assign(this->getStepperXDotDot(initialState).ptr(), *xDotDot);
320  }
321  else if (icConsistency == "Consistent") {
322  // Solve f(x, xDot, xDotDot, t) = 0.
323  const Scalar time = initialState->getTime();
324  auto xDotDot = this->getStepperXDotDot(initialState);
325 
326  // Compute initial acceleration using initial displacement
327  // and initial velocity.
328  if (this->initial_guess_ != Teuchos::null) {
329  TEUCHOS_TEST_FOR_EXCEPTION(
330  !((xDotDot->space())->isCompatible(*this->initial_guess_->space())),
331  std::logic_error,
332  "Error - User-provided initial guess for Newton is not compatible\n"
333  " with solution vector!\n");
334  Thyra::copy(*this->initial_guess_, xDotDot.ptr());
335  }
336  else {
337  Thyra::put_scalar(0.0, xDotDot.ptr());
338  }
339 
340  auto wrapperModel =
341  Teuchos::rcp_dynamic_cast<WrapperModelEvaluatorSecondOrder<Scalar> >(
342  this->wrapperModel_);
343 
344  wrapperModel->initializeNewmark(xDot, x, 0.0, time, beta_, gamma_);
345  const Thyra::SolveStatus<Scalar> sStatus = this->solveImplicitODE(xDotDot);
346 
347  TEUCHOS_TEST_FOR_EXCEPTION(
348  sStatus.solveStatus != Thyra::SOLVE_STATUS_CONVERGED, std::logic_error,
349  "Error - Solver failed while determining the initial conditions.\n"
350  " Solver status is "<<Thyra::toString(sStatus.solveStatus)<<".\n");
351  }
352  else {
353  TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error,
354  "Error - setInitialConditions() invalid IC consistency, "
355  << icConsistency << ".\n");
356  }
357 
358  // At this point, x, xDot and xDotDot are sync'ed or consistent
359  // at the same time level for the initialState.
360  initialState->setIsSynced(true);
361 
362  // Test for consistency.
363  if (this->getICConsistencyCheck()) {
364  auto f = initialState->getX()->clone_v();
365  auto xDotDot = this->getStepperXDotDot(initialState);
366 
367  typedef Thyra::ModelEvaluatorBase MEB;
368  MEB::InArgs<Scalar> appInArgs =
369  this->wrapperModel_->getAppModel()->createInArgs();
370  MEB::OutArgs<Scalar> appOutArgs =
371  this->wrapperModel_->getAppModel()->createOutArgs();
372 
373  appInArgs.set_x (x );
374  appInArgs.set_x_dot (xDot );
375  appInArgs.set_x_dot_dot(xDotDot);
376 
377  appOutArgs.set_f(appOutArgs.get_f());
378 
379  appInArgs.set_W_x_dot_dot_coeff(Scalar(0.0)); // da/da
380  appInArgs.set_alpha (Scalar(0.0)); // dv/da
381  appInArgs.set_beta (Scalar(0.0)); // dd/da
382 
383  appInArgs.set_t (initialState->getTime() );
384 
385  this->wrapperModel_->getAppModel()->evalModel(appInArgs, appOutArgs);
386 
387  Scalar reldiff = Thyra::norm(*f);
388  Scalar normx = Thyra::norm(*x);
389  Scalar eps = Scalar(100.0)*std::abs(Teuchos::ScalarTraits<Scalar>::eps());
390  if (normx > eps*reldiff) reldiff /= normx;
391 
392  if (reldiff > eps) {
393  RCP<Teuchos::FancyOStream> out = this->getOStream();
394  Teuchos::OSTab ostab(out,1,
395  "StepperNewmarkImplicitAForm::setInitialConditions()");
396  *out << "Warning -- Failed consistency check but continuing!\n"
397  << " ||f(x,xDot,xDotDot,t)||/||x|| > eps" << std::endl
398  << " ||f(x,xDot,xDotDot,t)|| = " << Thyra::norm(*f)<< std::endl
399  << " ||x|| = " << Thyra::norm(*x)<< std::endl
400  << " ||f(x,xDot,xDotDot,t)||/||x|| = " << reldiff << std::endl
401  << " eps = " << eps << std::endl;
402  }
403  }
404 
405  if (!(this->getUseFSAL())) {
406  RCP<Teuchos::FancyOStream> out = this->getOStream();
407  Teuchos::OSTab ostab(out,1,
408  "StepperNewmarkImplicitAForm::setInitialConditions()");
409  *out << "\nWarning -- The First-Step-As-Last (FSAL) principle is "
410  << "part of the Newmark Implicit A-Form. The default is to "
411  << "set useFSAL=true, and useFSAL=false will be ignored." << std::endl;
412  }
413 }
414 
415 
416 template<class Scalar>
418  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory)
419 {
420 #ifdef VERBOSE_DEBUG_OUTPUT
421  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
422 #endif
423  using Teuchos::RCP;
424 
425  TEMPUS_FUNC_TIME_MONITOR("Tempus::StepperNewmarkImplicitAForm::takeStep()");
426  {
427  TEUCHOS_TEST_FOR_EXCEPTION(solutionHistory->getNumStates() < 2,
428  std::logic_error,
429  "Error - StepperNewmarkImplicitAForm<Scalar>::takeStep(...)\n"
430  "Need at least two SolutionStates for NewmarkImplicitAForm.\n"
431  " Number of States = " << solutionHistory->getNumStates() << "\n"
432  "Try setting in \"Solution History\" \"Storage Type\" = \"Undo\"\n"
433  " or \"Storage Type\" = \"Static\" and \"Storage Limit\" = \"2\"\n");
434 
435  RCP<SolutionState<Scalar> > workingState=solutionHistory->getWorkingState();
436  RCP<SolutionState<Scalar> > currentState=solutionHistory->getCurrentState();
437 
438  auto wrapperModel =
439  Teuchos::rcp_dynamic_cast<WrapperModelEvaluatorSecondOrder<Scalar> >(
440  this->wrapperModel_);
441 
442  // Get values of d, v and a from previous step
443  RCP<const Thyra::VectorBase<Scalar> > d_old = currentState->getX();
444  RCP<const Thyra::VectorBase<Scalar> > v_old = currentState->getXDot();
445  RCP< Thyra::VectorBase<Scalar> > a_old = currentState->getXDotDot();
446 
447  // Get new values of d, v and a from workingState
448  RCP<Thyra::VectorBase<Scalar> > d_new = workingState->getX();
449  RCP<Thyra::VectorBase<Scalar> > v_new = workingState->getXDot();
450  RCP<Thyra::VectorBase<Scalar> > a_new = workingState->getXDotDot();
451 
452  // Get time and dt
453  const Scalar time = currentState->getTime();
454  const Scalar dt = workingState->getTimeStep();
455  Scalar t = time+dt;
456 
457  // Compute acceleration, a_old, using displacement (d_old) and
458  // velocity (v_old), if needed.
459  if (!(this->getUseFSAL()) && workingState->getNConsecutiveFailures() == 0) {
460  wrapperModel->initializeNewmark(v_old, d_old, dt, time,
461  Scalar(0.0), Scalar(0.0));
462  const Thyra::SolveStatus<Scalar> sStatus = this->solveImplicitODE(a_old);
463 
464  workingState->setSolutionStatus(sStatus); // Converged --> pass.
465  }
466 
467  // Compute displacement and velocity predictors
468  predictDisplacement(*d_new, *d_old, *v_old, *a_old, dt);
469  predictVelocity(*v_new, *v_old, *a_old, dt);
470 
471  // Inject d_new, v_new, a and other relevant data into wrapperModel
472  wrapperModel->initializeNewmark(v_new,d_new,dt,t,beta_,gamma_);
473 
474  // Solve nonlinear system with a_new as initial guess
475  const Thyra::SolveStatus<Scalar> sStatus = this->solveImplicitODE(a_new);
476 
477  // Correct velocity, displacement.
478  correctVelocity(*v_new, *v_new, *a_new, dt);
479  correctDisplacement(*d_new, *d_new, *a_new, dt);
480 
481  workingState->setSolutionStatus(sStatus); // Converged --> pass.
482  workingState->setOrder(this->getOrder());
483  }
484  return;
485 }
486 
487 
488 
489 /** \brief Provide a StepperState to the SolutionState.
490  * This Stepper does not have any special state data,
491  * so just provide the base class StepperState with the
492  * Stepper description. This can be checked to ensure
493  * that the input StepperState can be used by this Stepper.
494  */
495 template<class Scalar>
496 Teuchos::RCP<Tempus::StepperState<Scalar> >
499 {
500 #ifdef VERBOSE_DEBUG_OUTPUT
501  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
502 #endif
503  Teuchos::RCP<Tempus::StepperState<Scalar> > stepperState =
504  rcp(new StepperState<Scalar>(this->getStepperType()));
505  return stepperState;
506 }
507 
508 
509 template<class Scalar>
511  Teuchos::FancyOStream &out,
512  const Teuchos::EVerbosityLevel /* verbLevel */) const
513 {
514 #ifdef VERBOSE_DEBUG_OUTPUT
515  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
516 #endif
517  out << this->getStepperType() << "::describe:" << std::endl
518  << "wrapperModel = " << this->wrapperModel_->description() << std::endl;
519 }
520 
521 
522 template<class Scalar>
523 Teuchos::RCP<const Teuchos::ParameterList>
525 {
526 #ifdef VERBOSE_DEBUG_OUTPUT
527  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
528 #endif
529  Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
530  getValidParametersBasic(pl, this->getStepperType());
531  pl->set<std::string>("Scheme Name", "Average Acceleration");
532  pl->set<double> ("Beta" , 0.25);
533  pl->set<double> ("Gamma", 0.5 );
534  pl->set<bool> ("Use FSAL", this->getUseFSALDefault());
535  pl->set<std::string>("Initial Condition Consistency",
536  this->getICConsistencyDefault());
537  pl->set<std::string>("Solver Name", "Default Solver");
538  pl->set<bool> ("Zero Initial Guess", false);
539  Teuchos::RCP<Teuchos::ParameterList> solverPL = defaultSolverParameters();
540  pl->set("Default Solver", *solverPL);
541 
542  return pl;
543 }
544 
545 
546 } // namespace Tempus
547 #endif // Tempus_StepperNewmarkImplicitAForm_impl_hpp
const std::string toString(const Status status)
Convert Status to string.
void initializeNewmark(Teuchos::RCP< const Vector > v_pred, Teuchos::RCP< const Vector > d_pred, Scalar delta_t, Scalar t, Scalar beta, Scalar gamma)
Set values needed in evalModelImpl.
void predictVelocity(Thyra::VectorBase< Scalar > &vPred, const Thyra::VectorBase< Scalar > &v, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
virtual void setSolver(Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > solver=Teuchos::null)
Set solver.
virtual bool getICConsistencyCheckDefault() const
Teuchos::RCP< Teuchos::ParameterList > defaultSolverParameters()
Returns the default solver ParameterList for implicit Steppers.
A ModelEvaluator for residual evaluations given a state. This ModelEvaluator takes a state...
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
StepperState is a simple class to hold state information about the stepper.
virtual Teuchos::RCP< Tempus::StepperState< Scalar > > getDefaultStepperState()
Get a default (initial) StepperState.
void setICConsistencyCheck(bool c)
StepperObserver class for Stepper class.
virtual void setInitialConditions(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Set the initial conditions and make them consistent.
Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory(Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
Nonmember constructor.
virtual void setZeroInitialGuess(bool zIG)
Set parameter so that the initial guess is set to zero (=True) or use last timestep (=False)...
virtual void takeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Take the specified timestep, dt, and return true if successful.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
void predictDisplacement(Thyra::VectorBase< Scalar > &dPred, const Thyra::VectorBase< Scalar > &d, const Thyra::VectorBase< Scalar > &v, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
virtual void setModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel)
void correctDisplacement(Thyra::VectorBase< Scalar > &d, const Thyra::VectorBase< Scalar > &dPred, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
void validSecondOrderODE_DAE(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model)
Validate ME supports 2nd order implicit ODE/DAE evaluation, f(xdotdot,xdot,x,t) [= 0]...
virtual void initialize()
Initialize during construction and after changing input parameters.
void correctVelocity(Thyra::VectorBase< Scalar > &v, const Thyra::VectorBase< Scalar > &vPred, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
void getValidParametersBasic(Teuchos::RCP< Teuchos::ParameterList > pl, std::string stepperType)
Provide basic parameters to Steppers.
virtual void setObserver(Teuchos::RCP< StepperObserver< Scalar > >=Teuchos::null)
Set Observer.
void setStepperType(std::string s)
void setICConsistency(std::string s)