Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_StepperHHTAlpha_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_StepperHHTAlpha_impl_hpp
10 #define Tempus_StepperHHTAlpha_impl_hpp
11 
12 #include "Teuchos_VerboseObjectParameterListHelpers.hpp"
13 
15 
16 //#define VERBOSE_DEBUG_OUTPUT
17 //#define DEBUG_OUTPUT
18 
19 namespace Tempus {
20 
21 template <class Scalar>
24  const Thyra::VectorBase<Scalar>& a, const Scalar dt) const
25 {
26 #ifdef VERBOSE_DEBUG_OUTPUT
27  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
28 #endif
29  // vPred = v + dt*(1.0-gamma_)*a
30  Thyra::V_StVpStV(Teuchos::ptrFromRef(vPred), 1.0, v, dt * (1.0 - gamma_), a);
31 }
32 
33 template <class Scalar>
37  const Scalar dt) const
38 {
39 #ifdef VERBOSE_DEBUG_OUTPUT
40  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
41 #endif
42  // dPred = dt*v + dt*dt/2.0*(1.0-2.0*beta_)*a
43  Scalar aConst = dt * dt / 2.0 * (1.0 - 2.0 * beta_);
44  Thyra::V_StVpStV(Teuchos::ptrFromRef(dPred), dt, v, aConst, a);
45  // dPred += d;
46  Thyra::Vp_V(Teuchos::ptrFromRef(dPred), d, 1.0);
47 }
48 
49 template <class Scalar>
52 {
53 #ifdef VERBOSE_DEBUG_OUTPUT
54  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
55 #endif
56  // vPred = (1-alpha_f)*vPred + alpha_f*v
57  Thyra::V_StVpStV(Teuchos::ptrFromRef(vPred), 1.0 - alpha_f_, vPred, alpha_f_,
58  v);
59 }
60 
61 template <class Scalar>
64 {
65 #ifdef VERBOSE_DEBUG_OUTPUT
66  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
67 #endif
68  // dPred = (1-alpha_f)*dPred + alpha_f*d
69  Thyra::V_StVpStV(Teuchos::ptrFromRef(dPred), 1.0 - alpha_f_, dPred, alpha_f_,
70  d);
71 }
72 
73 template <class Scalar>
75  Thyra::VectorBase<Scalar>& a_n_plus1,
76  const Thyra::VectorBase<Scalar>& a_n) const
77 {
78 #ifdef VERBOSE_DEBUG_OUTPUT
79  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
80 #endif
81  Scalar c = 1.0 / (1.0 - alpha_m_);
82  // a_n_plus1 = 1.0/(1.0-alpha_m_)*a_n_plus1 - alpha_m/(1.0-alpha_m)*a_n =
83  // (1-alpha_f)*vPred + alpha_f*v
84  Thyra::V_StVpStV(Teuchos::ptrFromRef(a_n_plus1), c, a_n_plus1, -c * alpha_m_,
85  a_n);
86 }
87 
88 template <class Scalar>
91  const Thyra::VectorBase<Scalar>& a, const Scalar dt) const
92 {
93 #ifdef VERBOSE_DEBUG_OUTPUT
94  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
95 #endif
96  // v = vPred + dt*gamma_*a
97  Thyra::V_StVpStV(Teuchos::ptrFromRef(v), 1.0, vPred, dt * gamma_, a);
98 }
99 
100 template <class Scalar>
103  const Thyra::VectorBase<Scalar>& a, const Scalar dt) const
104 {
105 #ifdef VERBOSE_DEBUG_OUTPUT
106  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
107 #endif
108  // d = dPred + beta_*dt*dt*a
109  Thyra::V_StVpStV(Teuchos::ptrFromRef(d), 1.0, dPred, beta_ * dt * dt, a);
110 }
111 
112 template <class Scalar>
114 {
115  if (schemeName_ != "Newmark Beta User Defined") {
116  out_->setOutputToRootOnly(0);
117  *out_ << "\nWARNING: schemeName != 'Newmark Beta User Defined' (= '"
118  << schemeName_ << "').\n"
119  << " Leaving as beta = " << beta_ << "!\n";
120  return;
121  }
122 
123  beta_ = beta;
124 
125  if (beta_ == 0.0) {
126  out_->setOutputToRootOnly(0);
127  *out_ << "\nWARNING: Running (implicit implementation of) Newmark "
128  << "Implicit a-Form Stepper with Beta = 0.0, which \n"
129  << "specifies an explicit scheme. Mass lumping is not possible, "
130  << "so this will be slow! To run explicit \n"
131  << "implementation of Newmark Implicit a-Form Stepper, please "
132  << "re-run with 'Stepper Type' = 'Newmark Explicit a-Form'.\n"
133  << "This stepper allows for mass lumping when called through "
134  << "Piro::TempusSolver.\n";
135  }
136 
138  (beta_ > 1.0) || (beta_ < 0.0), std::logic_error,
139  "\nError in 'Newmark Implicit a-Form' stepper: invalid value of Beta = "
140  << beta_ << ". Please select Beta >= 0 and <= 1. \n");
141 
142  this->isInitialized_ = false;
143 }
144 
145 template <class Scalar>
147 {
148  if (schemeName_ != "Newmark Beta User Defined") {
149  out_->setOutputToRootOnly(0);
150  *out_ << "\nWARNING: schemeName != 'Newmark Beta User Defined' (= '"
151  << schemeName_ << "').\n"
152  << " Leaving as gamma = " << gamma_ << "!\n";
153  return;
154  }
155 
156  gamma_ = gamma;
157 
159  (gamma_ > 1.0) || (gamma_ < 0.0), std::logic_error,
160  "\nError in 'Newmark Implicit a-Form' stepper: invalid value of Gamma ="
161  << gamma_ << ". Please select Gamma >= 0 and <= 1. \n");
162 
163  this->isInitialized_ = false;
164 }
165 
166 template <class Scalar>
168 {
169  alpha_f_ = alpha_f;
170 
172  (alpha_f_ > 1.0) || (alpha_f_ < 0.0), std::logic_error,
173  "\nError in 'HHT-Alpha' stepper: invalid value of Alpha_f = "
174  << alpha_f_ << ". Please select Alpha_f >= 0 and <= 1. \n");
175 
176  this->isInitialized_ = false;
177 }
178 
179 template <class Scalar>
181 {
182  alpha_m_ = alpha_m;
183 
185  (alpha_m_ >= 1.0) || (alpha_m_ < 0.0), std::logic_error,
186  "\nError in 'HHT-Alpha' stepper: invalid value of Alpha_m = "
187  << alpha_m_ << ". Please select Alpha_m >= 0 and < 1. \n");
188 
189  this->isInitialized_ = false;
190 }
191 
192 template <class Scalar>
193 void StepperHHTAlpha<Scalar>::setSchemeName(std::string schemeName)
194 {
195  schemeName_ = schemeName;
196 
197  if (schemeName_ == "Newmark Beta Average Acceleration") {
198  beta_ = 0.25;
199  gamma_ = 0.5;
200  }
201  else if (schemeName_ == "Newmark Beta Linear Acceleration") {
202  beta_ = 0.25;
203  gamma_ = 1.0 / 6.0;
204  }
205  else if (schemeName_ == "Newmark Beta Central Difference") {
206  beta_ = 0.0;
207  gamma_ = 0.5;
208  }
209  else if (schemeName_ == "Newmark Beta User Defined") {
210  beta_ = 0.25;
211  gamma_ = 0.5; // Use defaults until setBeta and setGamma calls.
212  }
213  else {
215  true, std::logic_error,
216  "\nError in Tempus::StepperHHTAlpha! "
217  << "Invalid Scheme Name = " << schemeName_ << ". \n"
218  << "Valid Scheme Names are: 'Newmark Beta Average Acceleration', "
219  << "'Newmark Beta Linear Acceleration', \n"
220  << "'Newmark Beta Central Difference' and 'Newmark Beta User "
221  "Defined'.\n");
222  }
223 
224  this->isInitialized_ = false;
225 }
226 
227 template <class Scalar>
229  : out_(Teuchos::VerboseObjectBase::getDefaultOStream())
230 {
231 #ifdef VERBOSE_DEBUG_OUTPUT
232  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
233 #endif
234 
235  this->setStepperName("HHT-Alpha");
236  this->setStepperType("HHT-Alpha");
237  this->setUseFSAL(false);
238  this->setICConsistency("None");
239  this->setICConsistencyCheck(false);
240  this->setZeroInitialGuess(false);
241  this->setSchemeName("Newmark Beta Average Acceleration");
242  this->setAlphaF(0.0);
243  this->setAlphaM(0.0);
244  this->setAppAction(Teuchos::null);
245  this->setDefaultSolver();
246 }
247 
248 template <class Scalar>
250  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel,
252  bool useFSAL, std::string ICConsistency, bool ICConsistencyCheck,
253  bool zeroInitialGuess, std::string schemeName, Scalar beta, Scalar gamma,
254  Scalar alpha_f, Scalar alpha_m,
256  stepperHHTAlphaAppAction)
257  : out_(Teuchos::VerboseObjectBase::getDefaultOStream())
258 {
259  this->setStepperName("HHT-Alpha");
260  this->setStepperType("HHT-Alpha");
261  this->setUseFSAL(useFSAL);
262  this->setICConsistency(ICConsistency);
263  this->setICConsistencyCheck(ICConsistencyCheck);
264  this->setZeroInitialGuess(zeroInitialGuess);
265  this->setSchemeName(schemeName);
266  if (schemeName == "Newmark Beta User Defined") {
267  this->setBeta(beta);
268  this->setGamma(gamma);
269  }
270  this->setAlphaF(alpha_f);
271  this->setAlphaM(alpha_m);
272  this->setAppAction(stepperHHTAlphaAppAction);
273  this->setSolver(solver);
274 
275  if (appModel != Teuchos::null) {
276  this->setModel(appModel);
277  this->initialize();
278  }
279 }
280 
281 template <class Scalar>
284 {
285  if (appAction == Teuchos::null) {
286  // Create default appAction
287  stepperHHTAlphaAppAction_ =
289  }
290  else {
291  stepperHHTAlphaAppAction_ = appAction;
292  }
293 }
294 
295 template <class Scalar>
297  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel)
298 {
299 #ifdef VERBOSE_DEBUG_OUTPUT
300  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
301 #endif
302  validSecondOrderODE_DAE(appModel);
304  Teuchos::rcp(
305  new WrapperModelEvaluatorSecondOrder<Scalar>(appModel, "HHT-Alpha"));
306  this->wrapperModel_ = wrapperModel;
307 
308  TEUCHOS_TEST_FOR_EXCEPTION(this->solver_ == Teuchos::null, std::logic_error,
309  "Error - Solver is not set!\n");
310  if (this->wrapperModel_ != Teuchos::null)
311  this->solver_->setModel(this->wrapperModel_);
312 
313  this->isInitialized_ = false;
314 }
315 
316 template <class Scalar>
318  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory)
319 {
320 #ifdef VERBOSE_DEBUG_OUTPUT
321  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
322 #endif
323  this->checkInitialized();
324 
325  using Teuchos::RCP;
326 
327  TEMPUS_FUNC_TIME_MONITOR("Tempus::StepperHHTAlpha::takeStep()");
328  {
330  solutionHistory->getNumStates() < 2, std::logic_error,
331  "Error - StepperHHTAlpha<Scalar>::takeStep(...)\n"
332  << "Need at least two SolutionStates for HHTAlpha.\n"
333  << " Number of States = " << solutionHistory->getNumStates()
334  << "\nTry setting in \"Solution History\" \"Storage Type\" = "
335  << "\"Undo\"\n or \"Storage Type\" = \"Static\" and \"Storage Limit\" = "
336  << "\"2\"\n");
337 
338  RCP<StepperHHTAlpha<Scalar> > thisStepper = Teuchos::rcpFromRef(*this);
339  stepperHHTAlphaAppAction_->execute(
340  solutionHistory, thisStepper,
342 
343  RCP<SolutionState<Scalar> > workingState =
344  solutionHistory->getWorkingState();
345  RCP<SolutionState<Scalar> > currentState =
346  solutionHistory->getCurrentState();
347 
349  Teuchos::rcp_dynamic_cast<WrapperModelEvaluatorSecondOrder<Scalar> >(
350  this->wrapperModel_);
351 
352  // Get values of d, v and a from previous step
353  RCP<const Thyra::VectorBase<Scalar> > d_old = currentState->getX();
354  RCP<const Thyra::VectorBase<Scalar> > v_old = currentState->getXDot();
355  RCP<Thyra::VectorBase<Scalar> > a_old = currentState->getXDotDot();
356 
357 #ifdef DEBUG_OUTPUT
358  // IKT, 3/21/17, debug output: pring d_old, v_old, a_old to check for
359  // correctness.
360  *out_ << "IKT d_old = " << Thyra::max(*d_old) << "\n";
361  *out_ << "IKT v_old = " << Thyra::max(*v_old) << "\n";
362 #endif
363 
364  // Get new values of d, v and a from current workingState
365  //(to be updated here)
366  RCP<Thyra::VectorBase<Scalar> > d_new = workingState->getX();
367  RCP<Thyra::VectorBase<Scalar> > v_new = workingState->getXDot();
368  RCP<Thyra::VectorBase<Scalar> > a_new = workingState->getXDotDot();
369 
370  // Get time and dt
371  const Scalar time = currentState->getTime();
372  const Scalar dt = workingState->getTimeStep();
373  // Update time
374  Scalar t = time + dt;
375 
376  // Compute initial acceleration, a_old, using initial displacement (d_old)
377  // and initial velocity (v_old) if in 1st time step
378  if (time == solutionHistory->minTime()) {
379  RCP<Thyra::VectorBase<Scalar> > d_init =
380  Thyra::createMember(d_old->space());
381  RCP<Thyra::VectorBase<Scalar> > v_init =
382  Thyra::createMember(v_old->space());
383  RCP<Thyra::VectorBase<Scalar> > a_init =
384  Thyra::createMember(a_old->space());
385  Thyra::copy(*d_old, d_init.ptr());
386  Thyra::copy(*v_old, v_init.ptr());
387  if (this->initialGuess_ !=
388  Teuchos::null) { // set initial guess for Newton, if provided
389  // Throw an exception if initial_guess is not compatible with solution
390  bool is_compatible =
391  (a_init->space())->isCompatible(*this->initialGuess_->space());
393  is_compatible != true, std::logic_error,
394  "Error in Tempus::NemwarkImplicitAForm takeStep(): user-provided "
395  "initial guess'!\n"
396  << "for Newton is not compatible with solution vector!\n");
397  Thyra::copy(*this->initialGuess_, a_init.ptr());
398  }
399  else { // if no initialGuess_ provide, set 0 initial guess
400  Thyra::put_scalar(0.0, a_init.ptr());
401  }
402  wrapperModel->initializeNewmark(v_init, d_init, 0.0, time, beta_, gamma_);
403  const Thyra::SolveStatus<Scalar> sStatus =
404  (*(this->solver_)).solve(&*a_init);
405 
406  workingState->setSolutionStatus(sStatus); // Converged --> pass.
407  Thyra::copy(*a_init, a_old.ptr());
408  }
409 #ifdef DEBUG_OUTPUT
410  // IKT, 3/30/17, debug output: pring a_old to check for correctness.
411  *out_ << "IKT a_old = " << Thyra::max(*a_old) << "\n";
412 #endif
413 
414  // allocate d and v predictors
415  RCP<Thyra::VectorBase<Scalar> > d_pred =
416  Thyra::createMember(d_old->space());
417  RCP<Thyra::VectorBase<Scalar> > v_pred =
418  Thyra::createMember(v_old->space());
419 
420  // compute displacement and velocity predictors
421  predictDisplacement(*d_pred, *d_old, *v_old, *a_old, dt);
422  predictVelocity(*v_pred, *v_old, *a_old, dt);
423 
424  // compute second displacement and velocity predictors (those that are
425  // functions of alpha_f)
426  predictDisplacement_alpha_f(*d_pred, *d_old);
427  predictVelocity_alpha_f(*v_pred, *v_old);
428 
429  // inject d_pred, v_pred, a and other relevant data into wrapperModel
430  wrapperModel->initializeNewmark(v_pred, d_pred, dt, t, beta_, gamma_);
431 
432  stepperHHTAlphaAppAction_->execute(
433  solutionHistory, thisStepper,
435 
436  // Solve for new acceleration
437  const Thyra::SolveStatus<Scalar> sStatus =
438  (*(this->solver_)).solve(&*a_new);
439 
440  stepperHHTAlphaAppAction_->execute(
441  solutionHistory, thisStepper,
443 
444  // correct acceleration (function of alpha_m)
445  correctAcceleration(*a_new, *a_old);
446 
447  // correct velocity and displacement
448  correctVelocity(*v_new, *v_pred, *a_new, dt);
449  correctDisplacement(*d_new, *d_pred, *a_new, dt);
450 
451  workingState->setSolutionStatus(sStatus); // Converged --> pass.
452  workingState->setOrder(this->getOrder());
453  workingState->computeNorms(currentState);
454 
455  stepperHHTAlphaAppAction_->execute(
456  solutionHistory, thisStepper,
458  }
459  return;
460 }
461 
468 template <class Scalar>
471 {
472 #ifdef VERBOSE_DEBUG_OUTPUT
473  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
474 #endif
476  rcp(new StepperState<Scalar>(this->getStepperType()));
477  return stepperState;
478 }
479 
480 template <class Scalar>
482  Teuchos::FancyOStream& out, const Teuchos::EVerbosityLevel verbLevel) const
483 {
484  auto l_out = Teuchos::fancyOStream(out.getOStream());
485  Teuchos::OSTab ostab(*l_out, 2, this->description());
486  l_out->setOutputToRootOnly(0);
487 
488 #ifdef VERBOSE_DEBUG_OUTPUT
489  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
490 #endif
491 
492  *l_out << std::endl;
493  Stepper<Scalar>::describe(*l_out, verbLevel);
494  StepperImplicit<Scalar>::describe(*l_out, verbLevel);
495 
496  *l_out << "--- StepperHHTAlpha ---\n";
497  *l_out << " schemeName_ = " << schemeName_ << std::endl;
498  *l_out << " beta_ = " << beta_ << std::endl;
499  *l_out << " gamma_ = " << gamma_ << std::endl;
500  *l_out << " alpha_f_ = " << alpha_f_ << std::endl;
501  *l_out << " alpha_m_ = " << alpha_m_ << std::endl;
502  *l_out << "-----------------------" << std::endl;
503 }
504 
505 template <class Scalar>
507 {
508  out.setOutputToRootOnly(0);
509  bool isValidSetup = true;
510 
511  if (!Stepper<Scalar>::isValidSetup(out)) isValidSetup = false;
512 
513  // if ( !StepperImplicit<Scalar>::isValidSetup(out) ) isValidSetup = false;
514  if (this->wrapperModel_->getAppModel() == Teuchos::null) {
515  isValidSetup = false;
516  out << "The application ModelEvaluator is not set!\n";
517  }
518 
519  if (this->wrapperModel_ == Teuchos::null) {
520  isValidSetup = false;
521  out << "The wrapper ModelEvaluator is not set!\n";
522  }
523 
524  if (this->solver_ == Teuchos::null) {
525  isValidSetup = false;
526  out << "The solver is not set!\n";
527  }
528 
529  return isValidSetup;
530 }
531 
532 template <class Scalar>
535 {
536 #ifdef VERBOSE_DEBUG_OUTPUT
537  *out_ << "DEBUG: " << __PRETTY_FUNCTION__ << "\n";
538 #endif
539  auto pl = this->getValidParametersBasicImplicit();
540 
541  auto hhtalphaPL = Teuchos::parameterList("HHT-Alpha Parameters");
542  hhtalphaPL->set<std::string>("Scheme Name", schemeName_);
543  hhtalphaPL->set<double>("Beta", beta_);
544  hhtalphaPL->set<double>("Gamma", gamma_);
545  hhtalphaPL->set<double>("Alpha_f", alpha_f_);
546  hhtalphaPL->set<double>("Alpha_m", alpha_m_);
547  pl->set("HHT-Alpha Parameters", *hhtalphaPL);
548 
549  return pl;
550 }
551 
552 // Nonmember constructor - ModelEvaluator and ParameterList
553 // ------------------------------------------------------------------------
554 template <class Scalar>
556  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& model,
558 {
559  auto stepper = Teuchos::rcp(new StepperHHTAlpha<Scalar>());
560  stepper->setStepperImplicitValues(pl);
561 
562  if (pl != Teuchos::null) {
563  if (pl->isSublist("HHT-Alpha Parameters")) {
564  auto hhtalphaPL = pl->sublist("HHT-Alpha Parameters", true);
565  std::string schemeName = hhtalphaPL.get<std::string>(
566  "Scheme Name", "Newmark Beta Average Acceleration");
567  stepper->setSchemeName(schemeName);
568  if (schemeName == "Newmark Beta User Defined") {
569  stepper->setBeta(hhtalphaPL.get<double>("Beta", 0.25));
570  stepper->setGamma(hhtalphaPL.get<double>("Gamma", 0.5));
571  }
572  stepper->setAlphaF(hhtalphaPL.get<double>("Alpha_f", 0.0));
573  stepper->setAlphaM(hhtalphaPL.get<double>("Alpha_m", 0.0));
574  }
575  else {
576  stepper->setSchemeName("Newmark Beta Average Acceleration");
577  stepper->setAlphaF(0.0);
578  stepper->setAlphaM(0.0);
579  }
580  }
581 
582  if (model != Teuchos::null) {
583  stepper->setModel(model);
584  stepper->initialize();
585  }
586 
587  return stepper;
588 }
589 
590 } // namespace Tempus
591 #endif // Tempus_StepperHHTAlpha_impl_hpp
void correctDisplacement(Thyra::VectorBase< Scalar > &d, const Thyra::VectorBase< Scalar > &dPred, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
virtual void setSolver(Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > solver) override
Set solver.
virtual bool isValidSetup(Teuchos::FancyOStream &out) const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
void correctVelocity(Thyra::VectorBase< Scalar > &v, const Thyra::VectorBase< Scalar > &vPred, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
T & get(const std::string &name, T def_value)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void setStepperName(std::string s)
Set the stepper name.
void correctAcceleration(Thyra::VectorBase< Scalar > &a_n_plus1, const Thyra::VectorBase< Scalar > &a_n) const
virtual void initialize()
Initialize after construction and changing input parameters.
virtual Teuchos::RCP< Tempus::StepperState< Scalar > > getDefaultStepperState()
Get a default (initial) StepperState.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const override
StepperHHTAlpha()
Default constructor.
A ModelEvaluator for residual evaluations given a state. This ModelEvaluator takes a state...
Thyra Base interface for time steppers.
StepperState is a simple class to hold state information about the stepper.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
bool isSublist(const std::string &name) const
void predictVelocity_alpha_f(Thyra::VectorBase< Scalar > &vPred, const Thyra::VectorBase< Scalar > &v) const
void setICConsistencyCheck(bool c)
void setSchemeName(std::string schemeName)
virtual void setZeroInitialGuess(bool zIG)
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
basic_FancyOStream & setOutputToRootOnly(const int rootRank)
void predictDisplacement_alpha_f(Thyra::VectorBase< Scalar > &dPred, const Thyra::VectorBase< Scalar > &d) const
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
Teuchos::RCP< StepperHHTAlpha< Scalar > > createStepperHHTAlpha(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > pl)
Nonmember constructor - ModelEvaluator and ParameterList.
void validSecondOrderODE_DAE(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model)
Teuchos::RCP< Teuchos::FancyOStream > out_
RCP< std::basic_ostream< char_type, traits_type > > getOStream()
void predictVelocity(Thyra::VectorBase< Scalar > &vPred, const Thyra::VectorBase< Scalar > &v, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
virtual void setAppAction(Teuchos::RCP< StepperHHTAlphaAppAction< Scalar > > appAction)
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
virtual void setUseFSAL(bool a)
virtual void setModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel)
Set the model.
void setStepperType(std::string s)
Set the stepper type.
virtual void takeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Take the specified timestep, dt, and return true if successful.
void setICConsistency(std::string s)