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  this->isInitialized_ = false;
165 }
166 
167 
168 template<class Scalar>
170  out_(Teuchos::VerboseObjectBase::getDefaultOStream())
171 {
172 #ifdef VERBOSE_DEBUG_OUTPUT
173  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
174 #endif
175 
176  this->setStepperType( "Newmark Implicit a-Form");
177  this->setUseFSAL( this->getUseFSALDefault());
180  this->setZeroInitialGuess( false);
181  this->setSchemeName( "Average Acceleration");
182 
183  this->setObserver();
184  this->setDefaultSolver();
185 }
186 
187 
188 template<class Scalar>
190  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel,
191  const Teuchos::RCP<StepperObserver<Scalar> >& obs,
192  const Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
193  bool useFSAL,
194  std::string ICConsistency,
195  bool ICConsistencyCheck,
196  bool zeroInitialGuess,
197  std::string schemeName,
198  Scalar beta,
199  Scalar gamma)
200  : out_(Teuchos::VerboseObjectBase::getDefaultOStream())
201 {
202  this->setStepperType( "Newmark Implicit a-Form");
203  this->setUseFSAL( useFSAL);
204  this->setICConsistency( ICConsistency);
205  this->setICConsistencyCheck( ICConsistencyCheck);
206  this->setZeroInitialGuess( zeroInitialGuess);
207  this->setSchemeName( schemeName);
208  this->setBeta( beta);
209  this->setGamma( gamma);
210 
211  this->setObserver(obs);
212  this->setSolver(solver);
213 
214  if (appModel != Teuchos::null) {
215 
216  this->setModel(appModel);
217  this->initialize();
218  }
219 }
220 
221 
222 template<class Scalar>
224  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel)
225 {
226 #ifdef VERBOSE_DEBUG_OUTPUT
227  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
228 #endif
229  validSecondOrderODE_DAE(appModel);
230  auto wrapperModel =
231  Teuchos::rcp(new WrapperModelEvaluatorSecondOrder<Scalar>(appModel,
232  "Newmark Implicit a-Form"));
233  this->wrapperModel_ = wrapperModel;
234 
235  this->isInitialized_ = false;
236 }
237 
238 
239 template<class Scalar>
241  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory)
242 {
243  using Teuchos::RCP;
244 
245  int numStates = solutionHistory->getNumStates();
246 
247  TEUCHOS_TEST_FOR_EXCEPTION(numStates < 1, std::logic_error,
248  "Error - setInitialConditions() needs at least one SolutionState\n"
249  " to set the initial condition. Number of States = " << numStates);
250 
251  if (numStates > 1) {
252  RCP<Teuchos::FancyOStream> out = this->getOStream();
253  Teuchos::OSTab ostab(out,1,"StepperNewmarkImplicitAForm::setInitialConditions()");
254  *out << "Warning -- SolutionHistory has more than one state!\n"
255  << "Setting the initial conditions on the currentState.\n"<<std::endl;
256  }
257 
258  RCP<SolutionState<Scalar> > initialState = solutionHistory->getCurrentState();
259  RCP<Thyra::VectorBase<Scalar> > x = initialState->getX();
260  RCP<Thyra::VectorBase<Scalar> > xDot = initialState->getXDot();
261 
262  auto inArgs = this->wrapperModel_->getNominalValues();
263  TEUCHOS_TEST_FOR_EXCEPTION(
264  !((x != Teuchos::null && xDot != Teuchos::null) ||
265  (inArgs.get_x() != Teuchos::null &&
266  inArgs.get_x_dot() != Teuchos::null)), std::logic_error,
267  "Error - We need to set the initial conditions for x and xDot from\n"
268  " either initialState or appModel_->getNominalValues::InArgs\n"
269  " (but not from a mixture of the two).\n");
270 
271  // Use x and xDot from inArgs as ICs, if needed.
272  if ( x == Teuchos::null || xDot == Teuchos::null ) {
273  using Teuchos::rcp_const_cast;
274  TEUCHOS_TEST_FOR_EXCEPTION( (inArgs.get_x() == Teuchos::null) ||
275  (inArgs.get_x_dot() == Teuchos::null), std::logic_error,
276  "Error - setInitialConditions() needs the ICs from the initialState\n"
277  " or getNominalValues()!\n");
278  x = rcp_const_cast<Thyra::VectorBase<Scalar> >(inArgs.get_x());
279  initialState->setX(x);
280  xDot = rcp_const_cast<Thyra::VectorBase<Scalar> >(inArgs.get_x_dot());
281  initialState->setXDot(xDot);
282  }
283 
284  // Check if we need Stepper storage for xDotDot
285  if (initialState->getXDotDot() == Teuchos::null)
286  initialState->setXDotDot(initialState->getX()->clone_v());
287 
288  // Perform IC Consistency
289  std::string icConsistency = this->getICConsistency();
290  if (icConsistency == "None") {
291  if (initialState->getXDotDot() == Teuchos::null) {
292  RCP<Teuchos::FancyOStream> out = this->getOStream();
293  Teuchos::OSTab ostab(out,1,
294  "StepperNewmarkImplicitAForm::setInitialConditions()");
295  *out << "Warning -- Requested IC consistency of 'None' but\n"
296  << " initialState does not have an xDot.\n"
297  << " Setting a 'Zero' xDot!\n" << std::endl;
298 
299  Thyra::assign(this->getStepperXDotDot(initialState).ptr(), Scalar(0.0));
300  }
301  }
302  else if (icConsistency == "Zero")
303  Thyra::assign(this->getStepperXDotDot(initialState).ptr(), Scalar(0.0));
304  else if (icConsistency == "App") {
305  auto xDotDot = Teuchos::rcp_const_cast<Thyra::VectorBase<Scalar> >(
306  inArgs.get_x_dot_dot());
307  TEUCHOS_TEST_FOR_EXCEPTION(xDotDot == Teuchos::null, std::logic_error,
308  "Error - setInitialConditions() requested 'App' for IC consistency,\n"
309  " but 'App' returned a null pointer for xDotDot!\n");
310  Thyra::assign(this->getStepperXDotDot(initialState).ptr(), *xDotDot);
311  }
312  else if (icConsistency == "Consistent") {
313  // Solve f(x, xDot, xDotDot, t) = 0.
314  const Scalar time = initialState->getTime();
315  auto xDotDot = this->getStepperXDotDot(initialState);
316 
317  // Compute initial acceleration using initial displacement
318  // and initial velocity.
319  if (this->initialGuess_ != Teuchos::null) {
320  TEUCHOS_TEST_FOR_EXCEPTION(
321  !((xDotDot->space())->isCompatible(*this->initialGuess_->space())),
322  std::logic_error,
323  "Error - User-provided initial guess for Newton is not compatible\n"
324  " with solution vector!\n");
325  Thyra::copy(*this->initialGuess_, xDotDot.ptr());
326  }
327  else {
328  Thyra::put_scalar(0.0, xDotDot.ptr());
329  }
330 
331  auto wrapperModel =
332  Teuchos::rcp_dynamic_cast<WrapperModelEvaluatorSecondOrder<Scalar> >(
333  this->wrapperModel_);
334 
335  wrapperModel->initializeNewmark(xDot, x, 0.0, time, beta_, gamma_);
336  const Thyra::SolveStatus<Scalar> sStatus = this->solveImplicitODE(xDotDot);
337 
338  TEUCHOS_TEST_FOR_EXCEPTION(
339  sStatus.solveStatus != Thyra::SOLVE_STATUS_CONVERGED, std::logic_error,
340  "Error - Solver failed while determining the initial conditions.\n"
341  " Solver status is "<<Thyra::toString(sStatus.solveStatus)<<".\n");
342  }
343  else {
344  TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error,
345  "Error - setInitialConditions() invalid IC consistency, "
346  << icConsistency << ".\n");
347  }
348 
349  // At this point, x, xDot and xDotDot are sync'ed or consistent
350  // at the same time level for the initialState.
351  initialState->setIsSynced(true);
352 
353  // Test for consistency.
354  if (this->getICConsistencyCheck()) {
355  auto f = initialState->getX()->clone_v();
356  auto xDotDot = this->getStepperXDotDot(initialState);
357 
358  typedef Thyra::ModelEvaluatorBase MEB;
359  MEB::InArgs<Scalar> appInArgs =
360  this->wrapperModel_->getAppModel()->createInArgs();
361  MEB::OutArgs<Scalar> appOutArgs =
362  this->wrapperModel_->getAppModel()->createOutArgs();
363 
364  appInArgs.set_x (x );
365  appInArgs.set_x_dot (xDot );
366  appInArgs.set_x_dot_dot(xDotDot);
367 
368  appOutArgs.set_f(appOutArgs.get_f());
369 
370  appInArgs.set_W_x_dot_dot_coeff(Scalar(0.0)); // da/da
371  appInArgs.set_alpha (Scalar(0.0)); // dv/da
372  appInArgs.set_beta (Scalar(0.0)); // dd/da
373 
374  appInArgs.set_t (initialState->getTime() );
375 
376  this->wrapperModel_->getAppModel()->evalModel(appInArgs, appOutArgs);
377 
378  Scalar reldiff = Thyra::norm(*f);
379  Scalar normx = Thyra::norm(*x);
380  Scalar eps = Scalar(100.0)*std::abs(Teuchos::ScalarTraits<Scalar>::eps());
381  if (normx > eps*reldiff) reldiff /= normx;
382 
383  if (reldiff > eps) {
384  RCP<Teuchos::FancyOStream> out = this->getOStream();
385  Teuchos::OSTab ostab(out,1,
386  "StepperNewmarkImplicitAForm::setInitialConditions()");
387  *out << "Warning -- Failed consistency check but continuing!\n"
388  << " ||f(x,xDot,xDotDot,t)||/||x|| > eps" << std::endl
389  << " ||f(x,xDot,xDotDot,t)|| = " << Thyra::norm(*f)<< std::endl
390  << " ||x|| = " << Thyra::norm(*x)<< std::endl
391  << " ||f(x,xDot,xDotDot,t)||/||x|| = " << reldiff << std::endl
392  << " eps = " << eps << std::endl;
393  }
394  }
395 
396  if (!(this->getUseFSAL())) {
397  RCP<Teuchos::FancyOStream> out = this->getOStream();
398  Teuchos::OSTab ostab(out,1,
399  "StepperNewmarkImplicitAForm::setInitialConditions()");
400  *out << "\nWarning -- The First-Step-As-Last (FSAL) principle is "
401  << "part of the Newmark Implicit A-Form. The default is to "
402  << "set useFSAL=true, and useFSAL=false will be ignored." << std::endl;
403  }
404 }
405 
406 
407 template<class Scalar>
409  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory)
410 {
411 #ifdef VERBOSE_DEBUG_OUTPUT
412  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
413 #endif
414  this->checkInitialized();
415 
416  using Teuchos::RCP;
417 
418  TEMPUS_FUNC_TIME_MONITOR("Tempus::StepperNewmarkImplicitAForm::takeStep()");
419  {
420  TEUCHOS_TEST_FOR_EXCEPTION(solutionHistory->getNumStates() < 2,
421  std::logic_error,
422  "Error - StepperNewmarkImplicitAForm<Scalar>::takeStep(...)\n"
423  "Need at least two SolutionStates for NewmarkImplicitAForm.\n"
424  " Number of States = " << solutionHistory->getNumStates() << "\n"
425  "Try setting in \"Solution History\" \"Storage Type\" = \"Undo\"\n"
426  " or \"Storage Type\" = \"Static\" and \"Storage Limit\" = \"2\"\n");
427 
428  RCP<SolutionState<Scalar> > workingState=solutionHistory->getWorkingState();
429  RCP<SolutionState<Scalar> > currentState=solutionHistory->getCurrentState();
430 
431  auto wrapperModel =
432  Teuchos::rcp_dynamic_cast<WrapperModelEvaluatorSecondOrder<Scalar> >(
433  this->wrapperModel_);
434 
435  // Get values of d, v and a from previous step
436  RCP<const Thyra::VectorBase<Scalar> > d_old = currentState->getX();
437  RCP<const Thyra::VectorBase<Scalar> > v_old = currentState->getXDot();
438  RCP< Thyra::VectorBase<Scalar> > a_old = currentState->getXDotDot();
439 
440  // Get new values of d, v and a from workingState
441  RCP<Thyra::VectorBase<Scalar> > d_new = workingState->getX();
442  RCP<Thyra::VectorBase<Scalar> > v_new = workingState->getXDot();
443  RCP<Thyra::VectorBase<Scalar> > a_new = workingState->getXDotDot();
444 
445  // Get time and dt
446  const Scalar time = currentState->getTime();
447  const Scalar dt = workingState->getTimeStep();
448  Scalar t = time+dt;
449 
450  // Compute acceleration, a_old, using displacement (d_old) and
451  // velocity (v_old), if needed.
452  if (!(this->getUseFSAL()) && workingState->getNConsecutiveFailures() == 0) {
453  wrapperModel->initializeNewmark(v_old, d_old, dt, time,
454  Scalar(0.0), Scalar(0.0));
455  const Thyra::SolveStatus<Scalar> sStatus = this->solveImplicitODE(a_old);
456 
457  workingState->setSolutionStatus(sStatus); // Converged --> pass.
458  }
459 
460  // Compute displacement and velocity predictors
461  predictDisplacement(*d_new, *d_old, *v_old, *a_old, dt);
462  predictVelocity(*v_new, *v_old, *a_old, dt);
463 
464  // Inject d_new, v_new, a and other relevant data into wrapperModel
465  wrapperModel->initializeNewmark(v_new,d_new,dt,t,beta_,gamma_);
466 
467  // Solve nonlinear system with a_new as initial guess
468  const Thyra::SolveStatus<Scalar> sStatus = this->solveImplicitODE(a_new);
469 
470  // Correct velocity, displacement.
471  correctVelocity(*v_new, *v_new, *a_new, dt);
472  correctDisplacement(*d_new, *d_new, *a_new, dt);
473 
474  workingState->setSolutionStatus(sStatus); // Converged --> pass.
475  workingState->setOrder(this->getOrder());
476  workingState->computeNorms(currentState);
477  }
478  return;
479 }
480 
481 
482 
483 /** \brief Provide a StepperState to the SolutionState.
484  * This Stepper does not have any special state data,
485  * so just provide the base class StepperState with the
486  * Stepper description. This can be checked to ensure
487  * that the input StepperState can be used by this Stepper.
488  */
489 template<class Scalar>
490 Teuchos::RCP<Tempus::StepperState<Scalar> >
493 {
494 #ifdef VERBOSE_DEBUG_OUTPUT
495  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
496 #endif
497  Teuchos::RCP<Tempus::StepperState<Scalar> > stepperState =
498  rcp(new StepperState<Scalar>(this->getStepperType()));
499  return stepperState;
500 }
501 
502 
503 template<class Scalar>
505  Teuchos::FancyOStream &out,
506  const Teuchos::EVerbosityLevel verbLevel) const
507 {
508 #ifdef VERBOSE_DEBUG_OUTPUT
509  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
510 #endif
511 
512  out << std::endl;
513  Stepper<Scalar>::describe(out, verbLevel);
514  StepperImplicit<Scalar>::describe(out, verbLevel);
515 
516  out << "--- StepperNewmarkImplicitAForm ---\n";
517  out << " schemeName_ = " << schemeName_ << std::endl;
518  out << " beta_ = " << beta_ << std::endl;
519  out << " gamma_ = " << gamma_ << std::endl;
520  out << "-----------------------------------" << std::endl;
521 }
522 
523 
524 template<class Scalar>
525 bool StepperNewmarkImplicitAForm<Scalar>::isValidSetup(Teuchos::FancyOStream & out) const
526 {
527  bool isValidSetup = true;
528 
529  if ( !Stepper<Scalar>::isValidSetup(out) ) isValidSetup = false;
530 
531  //if ( !StepperImplicit<Scalar>::isValidSetup(out) ) isValidSetup = false;
532  if (this->wrapperModel_->getAppModel() == Teuchos::null) {
533  isValidSetup = false;
534  out << "The application ModelEvaluator is not set!\n";
535  }
536 
537  if (this->wrapperModel_ == Teuchos::null) {
538  isValidSetup = false;
539  out << "The wrapper ModelEvaluator is not set!\n";
540  }
541 
542  if (this->solver_ == Teuchos::null) {
543  isValidSetup = false;
544  out << "The solver is not set!\n";
545  }
546 
547  return isValidSetup;
548 }
549 
550 
551 template<class Scalar>
552 Teuchos::RCP<const Teuchos::ParameterList>
554 {
555 #ifdef VERBOSE_DEBUG_OUTPUT
556  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
557 #endif
558  Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
559  getValidParametersBasic(pl, this->getStepperType());
560  pl->set<std::string>("Scheme Name", "Average Acceleration");
561  pl->set<double> ("Beta" , 0.25);
562  pl->set<double> ("Gamma", 0.5 );
563  pl->set<bool> ("Use FSAL", this->getUseFSALDefault());
564  pl->set<std::string>("Initial Condition Consistency",
565  this->getICConsistencyDefault());
566  pl->set<std::string>("Solver Name", "Default Solver");
567  pl->set<bool> ("Zero Initial Guess", false);
568  Teuchos::RCP<Teuchos::ParameterList> solverPL = defaultSolverParameters();
569  pl->set("Default Solver", *solverPL);
570 
571  return pl;
572 }
573 
574 
575 } // namespace Tempus
576 #endif // Tempus_StepperNewmarkImplicitAForm_impl_hpp
virtual bool isValidSetup(Teuchos::FancyOStream &out) const
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 bool getICConsistencyCheckDefault() const
Teuchos::RCP< Teuchos::ParameterList > defaultSolverParameters()
Returns the default solver ParameterList for implicit Steppers.
virtual void initialize()
Initialize after construction and changing input parameters.
A ModelEvaluator for residual evaluations given a state. This ModelEvaluator takes a state...
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Thyra Base interface for time steppers.
StepperState is a simple class to hold state information about the stepper.
virtual void setSolver(Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > solver)
Set solver.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
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.
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]...
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
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) 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)