9 #ifndef Tempus_StepperIMEX_RK_Partition_impl_hpp
10 #define Tempus_StepperIMEX_RK_Partition_impl_hpp
12 #include "Tempus_config.hpp"
14 #include "Tempus_WrapperModelEvaluatorPairPartIMEX_Basic.hpp"
15 #include "Teuchos_VerboseObjectParameterListHelpers.hpp"
16 #include "Thyra_VectorStdOps.hpp"
17 #include "NOX_Thyra.H"
23 template<
class Scalar>
class StepperFactory;
26 template<
class Scalar>
29 this->setStepperType(
"Partitioned IMEX RK SSP2");
30 this->setUseFSAL( this->getUseFSALDefault());
31 this->setICConsistency( this->getICConsistencyDefault());
32 this->setICConsistencyCheck( this->getICConsistencyCheckDefault());
33 this->setZeroInitialGuess(
false);
35 this->setTableaus(
"Partitioned IMEX RK SSP2");
40 template<
class Scalar>
42 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel,
44 const Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
46 std::string ICConsistency,
47 bool ICConsistencyCheck,
48 bool zeroInitialGuess,
49 std::string stepperType,
54 this->setStepperType( stepperType);
55 this->setUseFSAL( useFSAL);
56 this->setICConsistency( ICConsistency);
57 this->setICConsistencyCheck( ICConsistencyCheck);
58 this->setZeroInitialGuess( zeroInitialGuess);
60 this->setExplicitTableau(explicitTableau);
61 this->setImplicitTableau(implicitTableau);
62 this->setObserver(obs);
64 if (appModel != Teuchos::null) {
66 this->setModel(appModel);
67 this->setSolver(solver);
73 template<
class Scalar>
75 std::string stepperType,
79 if (stepperType ==
"") stepperType =
"Partitioned IMEX RK SSP2";
81 if (stepperType ==
"Partitioned IMEX RK 1st order") {
84 typedef Teuchos::ScalarTraits<Scalar> ST;
86 Teuchos::SerialDenseMatrix<int,Scalar> A(NumStages,NumStages);
87 Teuchos::SerialDenseVector<int,Scalar> b(NumStages);
88 Teuchos::SerialDenseVector<int,Scalar> c(NumStages);
89 const Scalar one = ST::one();
90 const Scalar zero = ST::zero();
93 A(0,0) = zero; A(0,1) = zero;
94 A(1,0) = one; A(1,1) = zero;
97 b(0) = one; b(1) = zero;
100 c(0) = zero; c(1) = one;
105 "Explicit Tableau - Partitioned IMEX RK 1st order",
106 A,b,c,order,order,order));
108 this->setExplicitTableau(explicitTableau);
112 typedef Teuchos::ScalarTraits<Scalar> ST;
114 Teuchos::SerialDenseMatrix<int,Scalar> A(NumStages,NumStages);
115 Teuchos::SerialDenseVector<int,Scalar> b(NumStages);
116 Teuchos::SerialDenseVector<int,Scalar> c(NumStages);
117 const Scalar one = ST::one();
118 const Scalar zero = ST::zero();
121 A(0,0) = zero; A(0,1) = zero;
122 A(1,0) = zero; A(1,1) = one;
125 b(0) = zero; b(1) = one;
128 c(0) = zero; c(1) = one;
133 "Implicit Tableau - Partitioned IMEX RK 1st order",
134 A,b,c,order,order,order));
136 this->setImplicitTableau(implicitTableau);
138 this->setStepperType(
"Partitioned IMEX RK 1st order");
141 }
else if (stepperType ==
"Partitioned IMEX RK SSP2") {
144 this->setExplicitTableau(stepperERK->getTableau());
148 stepperSDIRK->setGammaType(
"2nd Order L-stable");
149 this->setImplicitTableau(stepperSDIRK->getTableau());
151 this->setStepperType(
"Partitioned IMEX RK SSP2");
154 }
else if (stepperType ==
"Partitioned IMEX RK ARS 233") {
155 typedef Teuchos::ScalarTraits<Scalar> ST;
157 Teuchos::SerialDenseMatrix<int,Scalar> A(NumStages,NumStages);
158 Teuchos::SerialDenseVector<int,Scalar> b(NumStages);
159 Teuchos::SerialDenseVector<int,Scalar> c(NumStages);
160 const Scalar one = ST::one();
161 const Scalar zero = ST::zero();
162 const Scalar onehalf = ST::one()/(2*ST::one());
163 const Scalar gamma = (3*one+ST::squareroot(3*one))/(6*one);
167 A(0,0) = zero; A(0,1) = zero; A(0,2) = zero;
168 A(1,0) = gamma; A(1,1) = zero; A(1,2) = zero;
169 A(2,0) = (gamma-1.0); A(2,1) = (2.0-2.0*gamma); A(2,2) = zero;
172 b(0) = zero; b(1) = onehalf; b(2) = onehalf;
175 c(0) = zero; c(1) = gamma; c(2) = one-gamma;
180 "Explicit Tableau - Partitioned IMEX RK ARS 233",
181 A,b,c,order,order,order));
183 this->setExplicitTableau(explicitTableau);
188 A(0,0) = zero; A(0,1) = zero; A(0,2) = zero;
189 A(1,0) = zero; A(1,1) = gamma; A(1,2) = zero;
190 A(2,0) = zero; A(2,1) = (1.0-2.0*gamma); A(2,2) = gamma;
193 b(0) = zero; b(1) = onehalf; b(2) = onehalf;
196 c(0) = zero; c(1) = gamma; c(2) = one-gamma;
201 "Implicit Tableau - Partitioned IMEX RK ARS 233",
202 A,b,c,order,order,order));
204 this->setImplicitTableau(implicitTableau);
206 this->setStepperType(
"Partitioned IMEX RK ARS 233");
209 }
else if (stepperType ==
"General Partitioned IMEX RK") {
210 this->setExplicitTableau(explicitTableau);
211 this->setImplicitTableau(implicitTableau);
212 this->setStepperType(
"General Partitioned IMEX RK");
216 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
217 "Error - Not a valid StepperIMEX_RK_Partition type! Stepper Type = "
218 << stepperType <<
"\n"
219 <<
" Current valid types are: " <<
"\n"
220 <<
" 'Partitioned IMEX RK 1st order'" <<
"\n"
221 <<
" 'Partitioned IMEX RK SSP2'" <<
"\n"
222 <<
" 'Partitioned IMEX RK ARS 233'" <<
"\n"
223 <<
" 'General Partitioned IMEX RK'" <<
"\n");
226 TEUCHOS_TEST_FOR_EXCEPTION(explicitTableau_==Teuchos::null,
228 "Error - StepperIMEX_RK_Partition - Explicit tableau is null!");
229 TEUCHOS_TEST_FOR_EXCEPTION(implicitTableau_==Teuchos::null,
231 "Error - StepperIMEX_RK_Partition - Implicit tableau is null!");
232 TEUCHOS_TEST_FOR_EXCEPTION(
233 explicitTableau_->numStages()!=implicitTableau_->numStages(),
235 "Error - StepperIMEX_RK_Partition - Number of stages do not match!\n"
236 <<
" Explicit tableau = " << explicitTableau_->description() <<
"\n"
237 <<
" number of stages = " << explicitTableau_->numStages() <<
"\n"
238 <<
" Implicit tableau = " << implicitTableau_->description() <<
"\n"
239 <<
" number of stages = " << implicitTableau_->numStages() <<
"\n");
243 template<
class Scalar>
247 TEUCHOS_TEST_FOR_EXCEPTION(explicitTableau->isImplicit() ==
true,
249 "Error - Received an implicit Tableau for setExplicitTableau()!\n" <<
250 " Tableau = " << explicitTableau->description() <<
"\n");
251 explicitTableau_ = explicitTableau;
255 template<
class Scalar>
259 TEUCHOS_TEST_FOR_EXCEPTION( implicitTableau->isDIRK() !=
true,
261 "Error - Did not receive a DIRK Tableau for setImplicitTableau()!\n" <<
262 " Tableau = " << implicitTableau->description() <<
"\n");
263 implicitTableau_ = implicitTableau;
266 template<
class Scalar>
268 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel)
271 using Teuchos::rcp_const_cast;
272 using Teuchos::rcp_dynamic_cast;
273 RCP<Thyra::ModelEvaluator<Scalar> > ncModel =
274 rcp_const_cast<Thyra::ModelEvaluator<Scalar> > (appModel);
275 RCP<WrapperModelEvaluatorPairPartIMEX_Basic<Scalar> > modelPairIMEX =
277 TEUCHOS_TEST_FOR_EXCEPTION( modelPairIMEX == Teuchos::null, std::logic_error,
278 "Error - StepperIMEX_RK::setModel() was given a ModelEvaluator that\n"
279 " could not be cast to a WrapperModelEvaluatorPairPartIMEX_Basic!\n"
280 " From: " << appModel <<
"\n"
281 " To : " << modelPairIMEX <<
"\n"
282 " Likely have given the wrong ModelEvaluator to this Stepper.\n");
284 setModelPair(modelPairIMEX);
292 template<
class Scalar>
297 Teuchos::RCP<WrapperModelEvaluatorPairPartIMEX_Basic<Scalar> >
298 wrapperModelPairIMEX =
300 (this->wrapperModel_);
303 wrapperModelPairIMEX = mePairIMEX;
304 wrapperModelPairIMEX->initialize();
306 this->wrapperModel_ = wrapperModelPairIMEX;
314 template<
class Scalar>
316 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& explicitModel,
317 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& implicitModel)
321 this->wrapperModel_ = Teuchos::rcp(
323 explicitModel, implicitModel));
327 template<
class Scalar>
331 if (this->stepperObserver_ == Teuchos::null)
332 this->stepperObserver_ =
335 if (( obs == Teuchos::null ) and (this->stepperObserver_->getSize() >0 ) )
338 if (( obs == Teuchos::null ) and (this->stepperObserver_->getSize() == 0) )
343 this->stepperObserver_->addObserver(
346 Teuchos::RCP<Teuchos::FancyOStream> out = this->getOStream();
347 Teuchos::OSTab ostab(out,0,
"setObserver");
348 *out <<
"Tempus::StepperIMEX_RK_Partition::setObserver: Warning: An observer has been provided that";
349 *out <<
" does not support Tempus::StepperRKObserver. This observer WILL NOT be added.";
350 *out <<
" In the future, this will result in a runtime error!" << std::endl;
355 template<
class Scalar>
358 TEUCHOS_TEST_FOR_EXCEPTION(
359 (explicitTableau_ == Teuchos::null) || (implicitTableau_ == Teuchos::null),
361 "Error - Need to set the Butcher Tableaus, setTableaus(), before calling "
362 "StepperIMEX_RK_Partition::initialize()\n");
364 Teuchos::RCP<WrapperModelEvaluatorPairPartIMEX_Basic<Scalar> >
365 wrapperModelPairIMEX =
367 (this->wrapperModel_);
368 TEUCHOS_TEST_FOR_EXCEPTION( wrapperModelPairIMEX == Teuchos::null,
370 "Error - Need to set the model, setModel(), before calling "
371 "StepperIMEX_RK_Partition::initialize()\n");
374 const int numStages = explicitTableau_->numStages();
375 stageF_.resize(numStages);
376 stageGx_.resize(numStages);
377 for(
int i=0; i < numStages; i++) {
378 stageF_[i] = Thyra::createMember(wrapperModelPairIMEX->
379 getExplicitModel()->get_f_space());
380 stageGx_[i] = Thyra::createMember(wrapperModelPairIMEX->
381 getImplicitModel()->get_f_space());
382 assign(stageF_[i].ptr(), Teuchos::ScalarTraits<Scalar>::zero());
383 assign(stageGx_[i].ptr(), Teuchos::ScalarTraits<Scalar>::zero());
386 xTilde_ = Thyra::createMember(wrapperModelPairIMEX->
387 getImplicitModel()->get_x_space());
388 assign(xTilde_.ptr(), Teuchos::ScalarTraits<Scalar>::zero());
392 template<
class Scalar>
400 TEUCHOS_TEST_FOR_EXCEPTION(numStates < 1, std::logic_error,
401 "Error - setInitialConditions() needs at least one SolutionState\n"
402 " to set the initial condition. Number of States = " << numStates);
405 RCP<Teuchos::FancyOStream> out = this->getOStream();
406 Teuchos::OSTab ostab(out,1,
"StepperIMEX_RK::setInitialConditions()");
407 *out <<
"Warning -- SolutionHistory has more than one state!\n"
408 <<
"Setting the initial conditions on the currentState.\n"<<std::endl;
411 RCP<SolutionState<Scalar> > initialState =
solutionHistory->getCurrentState();
412 RCP<Thyra::VectorBase<Scalar> > x = initialState->getX();
415 auto inArgs = this->wrapperModel_->getNominalValues();
416 if (x == Teuchos::null) {
417 TEUCHOS_TEST_FOR_EXCEPTION( (x == Teuchos::null) &&
418 (inArgs.get_x() == Teuchos::null), std::logic_error,
419 "Error - setInitialConditions() needs the ICs from the SolutionHistory\n"
420 " or getNominalValues()!\n");
422 x = Teuchos::rcp_const_cast<Thyra::VectorBase<Scalar> >(inArgs.get_x());
423 initialState->setX(x);
428 std::string icConsistency = this->getICConsistency();
429 TEUCHOS_TEST_FOR_EXCEPTION(icConsistency !=
"None", std::logic_error,
430 "Error - setInitialConditions() requested a consistency of '"
431 << icConsistency <<
"'.\n"
432 " But only 'None' is available for IMEX-RK!\n");
434 TEUCHOS_TEST_FOR_EXCEPTION( this->getUseFSAL(), std::logic_error,
435 "Error - The First-Step-As-Last (FSAL) principle is not "
436 <<
"available for IMEX-RK. Set useFSAL=false.\n");
440 template <
typename Scalar>
442 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> > & X,
443 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> > & Y,
444 Scalar time, Scalar stepSize, Scalar stageNumber,
445 const Teuchos::RCP<Thyra::VectorBase<Scalar> > & G)
const
447 typedef Thyra::ModelEvaluatorBase MEB;
448 Teuchos::RCP<WrapperModelEvaluatorPairPartIMEX_Basic<Scalar> >
449 wrapperModelPairIMEX =
451 (this->wrapperModel_);
452 MEB::InArgs<Scalar> inArgs = wrapperModelPairIMEX->
getInArgs();
454 inArgs.set_p(wrapperModelPairIMEX->getParameterIndex(), Y);
455 if (inArgs.supports(MEB::IN_ARG_t)) inArgs.set_t(time);
456 if (inArgs.supports(MEB::IN_ARG_step_size)) inArgs.set_step_size(stepSize);
457 if (inArgs.supports(MEB::IN_ARG_stage_number))
458 inArgs.set_stage_number(stageNumber);
465 if (inArgs.supports(MEB::IN_ARG_x_dot)) inArgs.set_x_dot(Teuchos::null);
467 MEB::OutArgs<Scalar> outArgs = wrapperModelPairIMEX->getOutArgs();
470 wrapperModelPairIMEX->getImplicitModel()->evalModel(inArgs,outArgs);
471 Thyra::Vt_S(G.ptr(), -1.0);
475 template <
typename Scalar>
477 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> > & Z,
478 Scalar time, Scalar stepSize, Scalar stageNumber,
479 const Teuchos::RCP<Thyra::VectorBase<Scalar> > & F)
const
481 typedef Thyra::ModelEvaluatorBase MEB;
483 Teuchos::RCP<WrapperModelEvaluatorPairPartIMEX_Basic<Scalar> >
484 wrapperModelPairIMEX =
486 (this->wrapperModel_);
487 MEB::InArgs<Scalar> inArgs =
490 if (inArgs.supports(MEB::IN_ARG_t)) inArgs.set_t(time);
491 if (inArgs.supports(MEB::IN_ARG_step_size)) inArgs.set_step_size(stepSize);
492 if (inArgs.supports(MEB::IN_ARG_stage_number))
493 inArgs.set_stage_number(stageNumber);
500 if (inArgs.supports(MEB::IN_ARG_x_dot)) inArgs.set_x_dot(Teuchos::null);
502 MEB::OutArgs<Scalar> outArgs =
503 wrapperModelPairIMEX->getExplicitModel()->createOutArgs();
506 wrapperModelPairIMEX->getExplicitModel()->evalModel(inArgs, outArgs);
507 Thyra::Vt_S(F.ptr(), -1.0);
511 template<
class Scalar>
516 using Teuchos::SerialDenseMatrix;
517 using Teuchos::SerialDenseVector;
519 TEMPUS_FUNC_TIME_MONITOR(
"Tempus::StepperIMEX_RK_Partition::takeStep()");
523 "Error - StepperIMEX_RK_Partition<Scalar>::takeStep(...)\n"
524 "Need at least two SolutionStates for IMEX_RK_Partition.\n"
526 "Try setting in \"Solution History\" \"Storage Type\" = \"Undo\"\n"
527 " or \"Storage Type\" = \"Static\" and \"Storage Limit\" = \"2\"\n");
530 RCP<SolutionState<Scalar> > currentState=
solutionHistory->getCurrentState();
531 RCP<SolutionState<Scalar> > workingState=
solutionHistory->getWorkingState();
532 const Scalar dt = workingState->getTimeStep();
533 const Scalar time = currentState->getTime();
535 const int numStages = explicitTableau_->numStages();
536 const SerialDenseMatrix<int,Scalar> & AHat = explicitTableau_->A();
537 const SerialDenseVector<int,Scalar> & bHat = explicitTableau_->b();
538 const SerialDenseVector<int,Scalar> & cHat = explicitTableau_->c();
539 const SerialDenseMatrix<int,Scalar> & A = implicitTableau_->A();
540 const SerialDenseVector<int,Scalar> & b = implicitTableau_->b();
541 const SerialDenseVector<int,Scalar> & c = implicitTableau_->c();
543 Teuchos::RCP<WrapperModelEvaluatorPairPartIMEX_Basic<Scalar> >
544 wrapperModelPairIMEX =
546 (this->wrapperModel_);
549 Thyra::SolveStatus<Scalar> sStatus;
550 stageZ_ = workingState->getX();
551 Thyra::assign(stageZ_.ptr(), *(currentState->getX()));
552 RCP<Thyra::VectorBase<Scalar> > stageY =
553 wrapperModelPairIMEX->getExplicitOnlyVector(stageZ_);
554 RCP<Thyra::VectorBase<Scalar> > stageX =
555 wrapperModelPairIMEX->getIMEXVector(stageZ_);
558 for (
int i = 0; i < numStages; ++i) {
561 Thyra::assign(stageY.ptr(),
562 *(wrapperModelPairIMEX->getExplicitOnlyVector(currentState->getX())));
563 Thyra::assign(xTilde_.ptr(),
564 *(wrapperModelPairIMEX->getIMEXVector(currentState->getX())));
565 for (
int j = 0; j < i; ++j) {
566 if (AHat(i,j) != Teuchos::ScalarTraits<Scalar>::zero()) {
567 RCP<Thyra::VectorBase<Scalar> > stageFy =
568 wrapperModelPairIMEX->getExplicitOnlyVector(stageF_[j]);
569 RCP<Thyra::VectorBase<Scalar> > stageFx =
570 wrapperModelPairIMEX->getIMEXVector(stageF_[j]);
571 Thyra::Vp_StV(stageY.ptr(), -dt*AHat(i,j), *stageFy);
572 Thyra::Vp_StV(xTilde_.ptr(), -dt*AHat(i,j), *stageFx);
574 if (A (i,j) != Teuchos::ScalarTraits<Scalar>::zero())
575 Thyra::Vp_StV(xTilde_.ptr(), -dt*A (i,j), *(stageGx_[j]));
578 Scalar ts = time + c(i)*dt;
579 Scalar tHats = time + cHat(i)*dt;
580 if (A(i,i) == Teuchos::ScalarTraits<Scalar>::zero()) {
582 bool isNeeded =
false;
583 for (
int k=i+1; k<numStages; ++k)
if (A(k,i) != 0.0) isNeeded =
true;
584 if (b(i) != 0.0) isNeeded =
true;
585 if (isNeeded ==
false) {
587 assign(stageGx_[i].ptr(), Teuchos::ScalarTraits<Scalar>::zero());
589 Thyra::assign(stageX.ptr(), *xTilde_);
590 this->stepperObserver_->observeBeforeImplicitExplicitly(
solutionHistory, *
this);
591 evalImplicitModelExplicitly(stageX, stageY, ts, dt, i, stageGx_[i]);
595 const Scalar alpha = Scalar(1.0)/(dt*A(i,i));
596 const Scalar beta = Scalar(1.0);
599 RCP<TimeDerivative<Scalar> > timeDer =
601 alpha, xTilde_.getConst()));
604 typedef Thyra::ModelEvaluatorBase MEB;
607 wrapperModelPairIMEX->setUseImplicitModel(
true);
608 MEB::InArgs<Scalar> inArgs = wrapperModelPairIMEX->createInArgs();
609 MEB::OutArgs<Scalar> outArgs = wrapperModelPairIMEX->createOutArgs();
610 inArgs.set_x(stageX);
611 if (wrapperModelPairIMEX->getParameterIndex() >= 0)
612 inArgs.set_p(wrapperModelPairIMEX->getParameterIndex(), stageY);
613 if (inArgs.supports(MEB::IN_ARG_x_dot)) inArgs.set_x_dot(stageGx_[i]);
614 if (inArgs.supports(MEB::IN_ARG_t )) inArgs.set_t (ts);
615 if (inArgs.supports(MEB::IN_ARG_step_size)) inArgs.set_step_size(dt);
616 if (inArgs.supports(MEB::IN_ARG_alpha )) inArgs.set_alpha (alpha);
617 if (inArgs.supports(MEB::IN_ARG_beta )) inArgs.set_beta (beta);
618 if (inArgs.supports(MEB::IN_ARG_stage_number))
619 inArgs.set_stage_number(i);
621 wrapperModelPairIMEX->setForSolve(timeDer, inArgs, outArgs);
625 this->solver_->setModel(wrapperModelPairIMEX);
626 sStatus = this->solveImplicitODE(stageX);
627 if (sStatus.solveStatus != Thyra::SOLVE_STATUS_CONVERGED) pass =
false;
629 wrapperModelPairIMEX->setUseImplicitModel(
false);
634 Thyra::V_StVpStV(stageGx_[i].ptr(), -alpha, *stageX, alpha, *xTilde_);
638 evalExplicitModel(stageZ_, tHats, dt, i, stageF_[i]);
644 Thyra::assign((workingState->getX()).ptr(), *(currentState->getX()));
645 RCP<Thyra::VectorBase<Scalar> > Z = workingState->getX();
646 RCP<Thyra::VectorBase<Scalar> > X = wrapperModelPairIMEX->getIMEXVector(Z);
647 for (
int i=0; i < numStages; ++i) {
648 if (bHat(i) != Teuchos::ScalarTraits<Scalar>::zero())
649 Thyra::Vp_StV(Z.ptr(), -dt*bHat(i), *(stageF_[i]));
650 if (b (i) != Teuchos::ScalarTraits<Scalar>::zero())
651 Thyra::Vp_StV(X.ptr(), -dt*b (i), *(stageGx_[i]));
654 if (pass ==
true) workingState->setSolutionStatus(
Status::PASSED);
656 workingState->setOrder(this->getOrder());
668 template<
class Scalar>
669 Teuchos::RCP<Tempus::StepperState<Scalar> >
673 Teuchos::RCP<Tempus::StepperState<Scalar> > stepperState =
679 template<
class Scalar>
681 Teuchos::FancyOStream &out,
682 const Teuchos::EVerbosityLevel )
const
684 out << this->getStepperType() <<
"::describe:" << std::endl
685 <<
"wrapperModelPairIMEX = " << this->wrapperModel_->description()
690 template<
class Scalar>
691 Teuchos::RCP<const Teuchos::ParameterList>
694 Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
695 pl->setName(
"Default Stepper - Partitioned IMEX RK SSP2");
696 pl->set<std::string>(
"Stepper Type",
"Partitioned IMEX RK SSP2");
698 pl->set<
bool>(
"Initial Condition Consistency Check",
699 this->getICConsistencyCheckDefault());
700 pl->set<std::string>(
"Solver Name",
"Default Solver");
701 pl->set<
bool> (
"Zero Initial Guess",
false);
703 pl->set(
"Default Solver", *solverPL);
710 #endif // Tempus_StepperIMEX_RK_Partition_impl_hpp
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
StepperIMEX_RK_Partition()
Default constructor.
virtual void setTableaus(std::string stepperType="", Teuchos::RCP< const RKButcherTableau< Scalar > > explicitTableau=Teuchos::null, Teuchos::RCP< const RKButcherTableau< Scalar > > implicitTableau=Teuchos::null)
Set both the explicit and implicit tableau from ParameterList.
virtual void setModelPair(const Teuchos::RCP< WrapperModelEvaluatorPairPartIMEX_Basic< Scalar > > &modelPair)
Create WrapperModelPairIMEX from user-supplied ModelEvaluator pair.
Teuchos::RCP< Teuchos::ParameterList > defaultSolverParameters()
Returns the default solver ParameterList for implicit Steppers.
void validExplicitODE(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model)
Validate that the model supports explicit ODE evaluation, f(x,t) [=xdot].
virtual Thyra::ModelEvaluatorBase::InArgs< Scalar > getInArgs()
Get InArgs the wrapper ModelEvalutor.
void evalExplicitModel(const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &X, Scalar time, Scalar stepSize, Scalar stageNumber, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &F) const
StepperState is a simple class to hold state information about the stepper.
virtual Teuchos::RCP< Tempus::StepperState< Scalar > > getDefaultStepperState()
Provide a StepperState to the SolutionState. This Stepper does not have any special state data...
ModelEvaluator pair for implicit and explicit (IMEX) evaulations.
void evalImplicitModelExplicitly(const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &X, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &Y, Scalar time, Scalar stepSize, Scalar stageNumber, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &G) const
StepperObserver class for Stepper class.
Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory(Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
Nonmember constructor.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual void setExplicitTableau(Teuchos::RCP< const RKButcherTableau< Scalar > > explicitTableau)
Set the explicit tableau from tableau.
virtual void setObserver(Teuchos::RCP< StepperObserver< Scalar > > obs=Teuchos::null)
Set Observer.
virtual void setImplicitTableau(Teuchos::RCP< const RKButcherTableau< Scalar > > implicitTableau)
Set the implicit tableau from tableau.
Time-derivative interface for Partitioned IMEX RK.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
This observer is a composite observer,.
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getExplicitModel() const
StepperRKObserver class for StepperRK.
virtual void setModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel)
virtual void takeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Take the specified timestep, dt, and return true if successful.
virtual void setInitialConditions(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Set the initial conditions and make them consistent.
void validImplicitODE_DAE(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model)
Validate ME supports implicit ODE/DAE evaluation, f(xdot,x,t) [= 0].
virtual void initialize()
Initialize during construction and after changing input parameters.
void getValidParametersBasic(Teuchos::RCP< Teuchos::ParameterList > pl, std::string stepperType)
Provide basic parameters to Steppers.