9 #ifndef Tempus_StepperFactory_hpp
10 #define Tempus_StepperFactory_hpp
12 #include "Teuchos_ParameterList.hpp"
13 #include "Tempus_StepperForwardEuler.hpp"
14 #include "Tempus_StepperBackwardEuler.hpp"
15 #include "Tempus_StepperExplicitRK.hpp"
16 #include "Tempus_StepperBDF2.hpp"
17 #include "Tempus_StepperNewmarkImplicitAForm.hpp"
18 #include "Tempus_StepperNewmarkImplicitDForm.hpp"
19 #include "Tempus_StepperNewmarkExplicitAForm.hpp"
20 #include "Tempus_StepperHHTAlpha.hpp"
22 #include "Tempus_StepperIMEX_RK.hpp"
23 #include "Tempus_StepperIMEX_RK_Partition.hpp"
24 #include "Tempus_StepperLeapfrog.hpp"
25 #include "Tempus_StepperOperatorSplit.hpp"
26 #include "Tempus_StepperTrapezoidal.hpp"
27 #include "Tempus_StepperSubcycling.hpp"
29 #include "NOX_Thyra.H"
38 template<
class Scalar>
51 std::string stepperType =
"Forward Euler",
52 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >&
53 model = Teuchos::null)
55 if (stepperType ==
"") stepperType =
"Forward Euler";
56 return this->
createStepper(model, stepperType, Teuchos::null);
61 Teuchos::RCP<Teuchos::ParameterList> stepperPL,
62 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >&
63 model = Teuchos::null)
65 std::string stepperType =
"Forward Euler";
66 if (stepperPL != Teuchos::null)
67 stepperType = stepperPL->get<std::string>(
"Stepper Type",
"Forward Euler");
73 Teuchos::RCP<Teuchos::ParameterList> stepperPL,
74 std::vector<Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> > > models)
76 std::string stepperType =
"Operator Split";
77 if (stepperPL != Teuchos::null)
78 stepperType = stepperPL->get<std::string>(
"Stepper Type");
88 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
90 if (stepperPL != Teuchos::null) {
92 stepperPL->get<std::string>(
"Stepper Type", stepper->getStepperType());
93 TEUCHOS_TEST_FOR_EXCEPTION(
94 stepperType != stepper->getStepperType() ,std::runtime_error,
95 " ParameterList 'Stepper Type' (='" + stepperType +
"')\n"
96 " does not match type for stepper Stepper (='"
97 + stepper->getStepperType() +
"').");
98 stepper->setStepperType(stepperType);
101 stepperPL->get<
bool>(
"Use FSAL", stepper->getUseFSALDefault()));
103 stepper->setICConsistency(
104 stepperPL->get<std::string>(
"Initial Condition Consistency",
105 stepper->getICConsistencyDefault()));
107 stepper->setICConsistencyCheck(
108 stepperPL->get<
bool>(
"Initial Condition Consistency Check",
109 stepper->getICConsistencyCheckDefault()));
116 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
120 using Teuchos::rcp_const_cast;
121 using Teuchos::ParameterList;
123 TEUCHOS_TEST_FOR_EXCEPTION(stepperPL == Teuchos::null,std::runtime_error,
124 "Error parsing general tableau. ParameterList is null.\n");
126 Teuchos::RCP<RKButcherTableau<Scalar> > tableau;
128 RCP<ParameterList> tableauPL = sublist(stepperPL,
"Tableau",
true);
129 std::size_t numStages = 0;
130 int order = tableauPL->get<
int>(
"order");
131 Teuchos::SerialDenseMatrix<int,Scalar> A;
132 Teuchos::SerialDenseVector<int,Scalar> b;
133 Teuchos::SerialDenseVector<int,Scalar> c;
134 Teuchos::SerialDenseVector<int,Scalar> bstar;
138 std::vector<std::string> A_row_tokens;
143 numStages = A_row_tokens.size();
146 A.shape(as<int>(numStages),as<int>(numStages));
149 for(std::size_t row=0;row<numStages;row++) {
151 std::vector<std::string> tokens;
154 std::vector<double> values;
157 TEUCHOS_TEST_FOR_EXCEPTION(values.size()!=numStages,std::runtime_error,
158 "Error parsing A matrix, wrong number of stages in row "
161 for(std::size_t col=0;col<numStages;col++)
162 A(row,col) = values[col];
167 b.size(as<int>(numStages));
168 c.size(as<int>(numStages));
172 std::vector<std::string> tokens;
174 std::vector<double> values;
177 TEUCHOS_TEST_FOR_EXCEPTION(values.size()!=numStages,std::runtime_error,
178 "Error parsing b vector, wrong number of stages.\n");
180 for(std::size_t i=0;i<numStages;i++)
186 std::vector<std::string> tokens;
188 std::vector<double> values;
191 TEUCHOS_TEST_FOR_EXCEPTION(values.size()!=numStages,std::runtime_error,
192 "Error parsing c vector, wrong number of stages.\n");
194 for(std::size_t i=0;i<numStages;i++)
198 if (tableauPL->isParameter(
"bstar") and
199 tableauPL->get<std::string>(
"bstar") !=
"") {
200 bstar.size(as<int>(numStages));
203 std::vector<std::string> tokens;
205 tokens, tableauPL->get<std::string>(
"bstar"),
" ",
true);
206 std::vector<double> values;
209 TEUCHOS_TEST_FOR_EXCEPTION(values.size()!=numStages,std::runtime_error,
210 "Error parsing bstar vector, wrong number of stages.\n"
211 " Number of RK stages = " << numStages <<
"\n"
212 " Number of bstar values = " << values.size() <<
"\n");
214 for(std::size_t i=0;i<numStages;i++)
215 bstar(i) = values[i];
218 "From ParameterList",A,b,c,order,order,order,bstar));
221 "From ParameterList",A,b,c,order,order,order));
230 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
232 if (stepperPL != Teuchos::null) {
233 stepperPL->validateParametersAndSetDefaults(
234 *stepper->getValidParameters());
242 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
244 auto solver = rcp(
new Thyra::NOXNonlinearSolver());
246 auto subPL = sublist(solverPL,
"NOX");
247 solver->setParameterList(subPL);
248 if (stepperPL != Teuchos::null) {
253 stepper->setZeroInitialGuess(
254 stepperPL->get<
bool>(
"Zero Initial Guess",
false));
261 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
263 if (stepperPL != Teuchos::null) {
264 stepperPL->validateParametersAndSetDefaults(
265 *stepper->getValidParameters());
267 stepper->setUseEmbedded(
268 stepperPL->get<
bool>(
"Use Embedded",stepper->getUseEmbeddedDefault()));
275 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
277 auto solver = rcp(
new Thyra::NOXNonlinearSolver());
279 auto subPL = sublist(defaultSolverPL,
"NOX");
280 solver->setParameterList(subPL);
281 if (stepperPL != Teuchos::null) {
282 std::string solverName = stepperPL->get<std::string>(
"Solver Name");
283 if ( stepperPL->isSublist(solverName) ) {
284 auto solverPL = Teuchos::parameterList();
285 solverPL = Teuchos::sublist(stepperPL, solverName);
286 Teuchos::RCP<Teuchos::ParameterList> noxPL =
287 Teuchos::sublist(solverPL,
"NOX",
true);
288 solver->setParameterList(noxPL);
291 stepper->setSolver(solver);
297 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
299 auto solver = rcp(
new Thyra::NOXNonlinearSolver());
301 auto subPL = sublist(solverPL,
"NOX");
302 solver->setParameterList(subPL);
303 if (stepperPL != Teuchos::null) {
308 stepper->setUseEmbedded(
309 stepperPL->get<
bool>(
"Use Embedded",stepper->getUseEmbeddedDefault()));
310 stepper->setZeroInitialGuess(
311 stepperPL->get<
bool>(
"Zero Initial Guess",
false));
317 Teuchos::RCP<Teuchos::ParameterList> stepperPL,
318 std::string stepperType)
321 if (stepperType ==
"") {
322 if (stepperPL == Teuchos::null)
323 stepperType =
"Partitioned IMEX RK SSP2";
325 stepperType = stepperPL->get<std::string>(
"Stepper Type",
326 "Partitioned IMEX RK SSP2");
329 if (stepperType !=
"General Partitioned IMEX RK") {
330 stepper->setTableaus(stepperType);
332 if (stepperPL != Teuchos::null) {
333 Teuchos::RCP<const RKButcherTableau<Scalar> > explicitTableau;
334 Teuchos::RCP<const RKButcherTableau<Scalar> > implicitTableau;
335 if (stepperPL->isSublist(
"IMEX-RK Explicit Stepper")) {
336 RCP<Teuchos::ParameterList> explicitPL = Teuchos::rcp(
337 new Teuchos::ParameterList(
338 stepperPL->sublist(
"IMEX-RK Explicit Stepper")));
342 TEUCHOS_TEST_FOR_EXCEPTION(stepperERK == Teuchos::null, std::logic_error,
343 "Error - The explicit component of a general partitioned IMEX RK stepper was not specified as an ExplicitRK stepper");
344 explicitTableau = stepperERK->getTableau();
347 if (stepperPL->isSublist(
"IMEX-RK Implicit Stepper")) {
348 RCP<Teuchos::ParameterList> implicitPL = Teuchos::rcp(
349 new Teuchos::ParameterList(
350 stepperPL->sublist(
"IMEX-RK Implicit Stepper")));
354 TEUCHOS_TEST_FOR_EXCEPTION(stepperDIRK == Teuchos::null, std::logic_error,
355 "Error - The implicit component of a general partitioned IMEX RK stepper was not specified as an DIRK stepper");
356 implicitTableau = stepperDIRK->getTableau();
359 TEUCHOS_TEST_FOR_EXCEPTION(
360 !(explicitTableau!=Teuchos::null && implicitTableau!=Teuchos::null), std::logic_error,
361 "Error - A parameter list was used to setup a general partitioned IMEX RK stepper, but did not "
362 "specify both an explicit and an implicit tableau!\n");
364 stepper->setTableaus(stepperType, explicitTableau, implicitTableau);
366 stepper->setOrder(stepperPL->get<
int>(
"overall order", 1));
373 Teuchos::RCP<Teuchos::ParameterList> stepperPL,
374 std::string stepperType)
377 if (stepperType ==
"") {
378 if (stepperPL == Teuchos::null)
379 stepperType =
"IMEX RK SSP2";
381 stepperType = stepperPL->get<std::string>(
"Stepper Type",
385 if (stepperType !=
"General IMEX RK") {
386 stepper->setTableaus(stepperType);
388 if (stepperPL != Teuchos::null) {
389 Teuchos::RCP<const RKButcherTableau<Scalar> > explicitTableau;
390 Teuchos::RCP<const RKButcherTableau<Scalar> > implicitTableau;
391 if (stepperPL->isSublist(
"IMEX-RK Explicit Stepper")) {
392 RCP<Teuchos::ParameterList> explicitPL = Teuchos::rcp(
393 new Teuchos::ParameterList(
394 stepperPL->sublist(
"IMEX-RK Explicit Stepper")));
398 TEUCHOS_TEST_FOR_EXCEPTION(stepperERK == Teuchos::null, std::logic_error,
399 "Error - The explicit component of a general IMEX RK stepper was not specified as an ExplicitRK stepper");
400 explicitTableau = stepperERK->getTableau();
403 if (stepperPL->isSublist(
"IMEX-RK Implicit Stepper")) {
404 RCP<Teuchos::ParameterList> implicitPL = Teuchos::rcp(
405 new Teuchos::ParameterList(
406 stepperPL->sublist(
"IMEX-RK Implicit Stepper")));
410 TEUCHOS_TEST_FOR_EXCEPTION(stepperDIRK == Teuchos::null, std::logic_error,
411 "Error - The implicit component of a general IMEX RK stepper was not specified as an DIRK stepper");
412 implicitTableau = stepperDIRK->getTableau();
415 TEUCHOS_TEST_FOR_EXCEPTION(
416 !(explicitTableau!=Teuchos::null && implicitTableau!=Teuchos::null), std::logic_error,
417 "Error - A parameter list was used to setup a general IMEX RK stepper, but did not "
418 "specify both an explicit and an implicit tableau!\n");
420 stepper->setTableaus(stepperType, explicitTableau, implicitTableau);
421 stepper->setOrder(stepperPL->get<
int>(
"overall order", 1));
430 Teuchos::RCP<StepperSubcycling<Scalar> >
432 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
433 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
437 TEUCHOS_TEST_FOR_EXCEPTION(stepperPL != Teuchos::null, std::logic_error,
438 "Error - Construction of StepperSubcycling with a ParameterList\n"
439 "is not implemented yet!\n");
441 if (stepperPL != Teuchos::null) {
449 if (model != Teuchos::null) {
450 stepper->setModel(model);
451 stepper->initialize();
457 Teuchos::RCP<StepperIMEX_RK_Partition<Scalar> >
459 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
460 std::string stepperType,
461 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
464 stepper->setStepperType(stepperType);
468 if (model != Teuchos::null) {
469 stepper->setModel(model);
471 stepper->initialize();
477 Teuchos::RCP<StepperIMEX_RK<Scalar> >
479 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
480 std::string stepperType,
481 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
484 stepper->setStepperType(stepperType);
488 if (model != Teuchos::null) {
489 stepper->setModel(model);
491 stepper->initialize();
497 Teuchos::RCP<StepperHHTAlpha<Scalar> >
499 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
500 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
504 if (stepperPL != Teuchos::null) {
505 if (stepperPL->isSublist(
"HHT-Alpha Parameters")) {
506 auto hhtalphaPL = stepperPL->sublist(
"HHT-Alpha Parameters",
true);
507 std::string schemeName =
508 hhtalphaPL.get<std::string>(
"Scheme Name",
"Newmark Beta Average Acceleration");
509 stepper->setSchemeName(schemeName);
510 if (schemeName ==
"Newmark Beta User Defined") {
511 stepper->setBeta (hhtalphaPL.get<
double>(
"Beta", 0.25));
512 stepper->setGamma(hhtalphaPL.get<
double>(
"Gamma", 0.5 ));
514 stepper->setAlphaF(hhtalphaPL.get<
double>(
"Alpha_f", 0.0));
515 stepper->setAlphaM(hhtalphaPL.get<
double>(
"Alpha_m", 0.0));
517 stepper->setSchemeName(
"Newmark Beta Average Acceleration");
518 stepper->setAlphaF(0.0);
519 stepper->setAlphaM(0.0);
523 if (model != Teuchos::null) {
524 stepper->setModel(model);
526 stepper->initialize();
532 Teuchos::RCP<StepperNewmarkImplicitDForm<Scalar> >
534 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
535 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
539 if (stepperPL != Teuchos::null) {
540 if (stepperPL->isSublist(
"Newmark Parameters")) {
541 auto newmarkPL = stepperPL->sublist(
"Newmark Parameters",
true);
542 std::string schemeName =
543 newmarkPL.get<std::string>(
"Scheme Name",
"Average Acceleration");
544 stepper->setSchemeName(schemeName);
545 if (schemeName ==
"User Defined") {
546 stepper->setBeta (newmarkPL.get<
double>(
"Beta", 0.25));
547 stepper->setGamma(newmarkPL.get<
double>(
"Gamma", 0.5 ));
550 stepper->setSchemeName(
"Average Acceleration");
554 if (model != Teuchos::null) {
555 stepper->setModel(model);
557 stepper->initialize();
563 Teuchos::RCP<StepperNewmarkImplicitAForm<Scalar> >
565 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
566 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
570 if (stepperPL != Teuchos::null) {
571 if (stepperPL->isSublist(
"Newmark Parameters")) {
572 auto newmarkPL = stepperPL->sublist(
"Newmark Parameters",
true);
573 std::string schemeName =
574 newmarkPL.get<std::string>(
"Scheme Name",
"Average Acceleration");
575 stepper->setSchemeName(schemeName);
576 if (schemeName ==
"User Defined") {
577 stepper->setBeta (newmarkPL.get<
double>(
"Beta", 0.25));
578 stepper->setGamma(newmarkPL.get<
double>(
"Gamma", 0.5 ));
581 stepper->setSchemeName(
"Average Acceleration");
585 if (model != Teuchos::null) {
586 stepper->setModel(model);
588 stepper->initialize();
594 Teuchos::RCP<StepperBDF2<Scalar> >
596 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
597 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
602 if (model != Teuchos::null) {
603 stepper->setModel(model);
605 std::string startUpStepper =
"DIRK 1 Stage Theta Method";
606 if (stepperPL != Teuchos::null) startUpStepper =
607 stepperPL->get<std::string>(
"Start Up Stepper Type", startUpStepper);
608 stepper->setStartUpStepper(startUpStepper);
609 stepper->initialize();
615 Teuchos::RCP<StepperTrapezoidal<Scalar> >
617 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
618 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
623 if (model != Teuchos::null) {
624 stepper->setModel(model);
626 stepper->initialize();
632 Teuchos::RCP<StepperBackwardEuler<Scalar> >
634 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
635 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
640 if (model != Teuchos::null) {
641 stepper->setModel(model);
644 std::string predictor =
"None";
645 if (stepperPL != Teuchos::null) predictor =
646 stepperPL->get<std::string>(
"Predictor Stepper Type", predictor);
647 stepper->setPredictor(predictor);
649 stepper->initialize();
655 Teuchos::RCP<StepperNewmarkExplicitAForm<Scalar> >
657 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
658 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
662 if (stepperPL != Teuchos::null) {
663 Scalar gamma = stepperPL->sublist(
"Newmark Explicit Parameters")
664 .template get<double>(
"Gamma", 0.5);
665 stepper->setGamma(gamma);
668 if (model != Teuchos::null) {
669 stepper->setModel(model);
670 stepper->initialize();
676 Teuchos::RCP<StepperLeapfrog<Scalar> >
678 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
679 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
684 if (model != Teuchos::null) {
685 stepper->setModel(model);
686 stepper->initialize();
692 Teuchos::RCP<StepperForwardEuler<Scalar> >
694 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
695 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
700 if (model != Teuchos::null) {
701 stepper->setModel(model);
702 stepper->initialize();
708 Teuchos::RCP<StepperERK_General<Scalar> >
710 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
711 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
716 if (stepperPL != Teuchos::null) {
717 if (stepperPL->isParameter(
"Tableau")) {
719 stepper->setTableau( t->A(),t->b(),t->c(),
720 t->order(),t->orderMin(),t->orderMax(),
724 TEUCHOS_TEST_FOR_EXCEPTION(
725 stepper->getTableau()->isImplicit() ==
true, std::logic_error,
726 "Error - General ERK received an implicit Butcher Tableau!\n");
728 if (model != Teuchos::null) {
729 stepper->setModel(model);
730 stepper->initialize();
736 Teuchos::RCP<StepperERK_ForwardEuler<Scalar> >
738 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
739 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
744 if (model != Teuchos::null) {
745 stepper->setModel(model);
746 stepper->initialize();
752 Teuchos::RCP<StepperERK_4Stage4thOrder<Scalar> >
754 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
755 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
760 if (model != Teuchos::null) {
761 stepper->setModel(model);
762 stepper->initialize();
768 Teuchos::RCP<StepperERK_3_8Rule<Scalar> >
770 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
771 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
776 if (model != Teuchos::null) {
777 stepper->setModel(model);
778 stepper->initialize();
784 Teuchos::RCP<StepperERK_4Stage3rdOrderRunge<Scalar> >
786 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
787 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
792 if (model != Teuchos::null) {
793 stepper->setModel(model);
794 stepper->initialize();
800 Teuchos::RCP<StepperERK_5Stage3rdOrderKandG<Scalar> >
802 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
803 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
808 if (model != Teuchos::null) {
809 stepper->setModel(model);
810 stepper->initialize();
816 Teuchos::RCP<StepperERK_3Stage3rdOrder<Scalar> >
818 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
819 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
824 if (model != Teuchos::null) {
825 stepper->setModel(model);
826 stepper->initialize();
832 Teuchos::RCP<StepperERK_3Stage3rdOrderTVD<Scalar> >
834 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
835 Teuchos::RCP<Teuchos::ParameterList> stepperPL,
836 const std::string stepperType)
839 stepper->setStepperType(stepperType);
842 if (model != Teuchos::null) {
843 stepper->setModel(model);
844 stepper->initialize();
850 Teuchos::RCP<StepperERK_SSPERK54<Scalar> >
852 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
853 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
858 if (model != Teuchos::null) {
859 stepper->setModel(model);
860 stepper->initialize();
866 Teuchos::RCP<StepperERK_3Stage3rdOrderHeun<Scalar> >
868 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
869 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
874 if (model != Teuchos::null) {
875 stepper->setModel(model);
876 stepper->initialize();
882 Teuchos::RCP<StepperERK_Midpoint<Scalar> >
884 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
885 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
890 if (model != Teuchos::null) {
891 stepper->setModel(model);
892 stepper->initialize();
898 Teuchos::RCP<StepperERK_Trapezoidal<Scalar> >
900 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
901 Teuchos::RCP<Teuchos::ParameterList> stepperPL,
902 std::string stepperType)
905 stepper->setStepperType(stepperType);
908 if (model != Teuchos::null) {
909 stepper->setModel(model);
910 stepper->initialize();
916 Teuchos::RCP<StepperERK_Ralston<Scalar> >
918 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
919 Teuchos::RCP<Teuchos::ParameterList> stepperPL,
920 std::string stepperType)
923 stepper->setStepperType(stepperType);
926 if (model != Teuchos::null) {
927 stepper->setModel(model);
928 stepper->initialize();
934 Teuchos::RCP<StepperERK_BogackiShampine32<Scalar> >
936 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
937 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
942 if (model != Teuchos::null) {
943 stepper->setModel(model);
944 stepper->initialize();
950 Teuchos::RCP<StepperERK_Merson45<Scalar> >
952 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
953 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
958 if (model != Teuchos::null) {
959 stepper->setModel(model);
960 stepper->initialize();
967 Teuchos::RCP<StepperDIRK_General<Scalar> >
969 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
970 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
975 if (stepperPL != Teuchos::null) {
976 if (stepperPL->isParameter(
"Tableau")) {
978 stepper->setTableau( t->A(),t->b(),t->c(),
979 t->order(),t->orderMin(),t->orderMax(),
983 TEUCHOS_TEST_FOR_EXCEPTION(
984 stepper->getTableau()->isDIRK() !=
true, std::logic_error,
985 "Error - General DIRK did not receive a DIRK Butcher Tableau!\n");
987 if (model != Teuchos::null) {
988 stepper->setModel(model);
990 stepper->initialize();
996 Teuchos::RCP<StepperDIRK_BackwardEuler<Scalar> >
998 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
999 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1004 if (model != Teuchos::null) {
1005 stepper->setModel(model);
1007 stepper->initialize();
1013 Teuchos::RCP<StepperSDIRK_2Stage2ndOrder<Scalar> >
1015 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1016 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1020 if (stepperPL != Teuchos::null)
1021 stepper->setGamma(stepperPL->get<
double>(
"gamma", 0.2928932188134524));
1023 if (model != Teuchos::null) {
1024 stepper->setModel(model);
1026 stepper->initialize();
1032 Teuchos::RCP<StepperSDIRK_3Stage2ndOrder<Scalar> >
1034 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1035 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1040 if (model != Teuchos::null) {
1041 stepper->setModel(model);
1043 stepper->initialize();
1050 Teuchos::RCP<StepperSDIRK_SSPDIRK22<Scalar> >
1052 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1053 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1060 if (model != Teuchos::null) {
1061 stepper->setModel(model);
1063 stepper->initialize();
1069 Teuchos::RCP<StepperSDIRK_SSPDIRK32<Scalar> >
1071 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1072 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1079 if (model != Teuchos::null) {
1080 stepper->setModel(model);
1082 stepper->initialize();
1088 Teuchos::RCP<StepperSDIRK_SSPDIRK23<Scalar> >
1090 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1091 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1098 if (model != Teuchos::null) {
1099 stepper->setModel(model);
1101 stepper->initialize();
1107 Teuchos::RCP<StepperSDIRK_SSPDIRK33<Scalar> >
1109 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1110 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1117 if (model != Teuchos::null) {
1118 stepper->setModel(model);
1120 stepper->initialize();
1127 Teuchos::RCP<StepperSDIRK_2Stage3rdOrder<Scalar> >
1129 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1130 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1134 if (stepperPL != Teuchos::null) {
1135 stepper->setGammaType(
1136 stepperPL->get<std::string>(
"Gamma Type",
"3rd Order A-stable"));
1137 stepper->setGamma(stepperPL->get<
double>(
"gamma", 0.7886751345948128));
1140 if (model != Teuchos::null) {
1141 stepper->setModel(model);
1143 stepper->initialize();
1149 Teuchos::RCP<StepperEDIRK_2Stage3rdOrder<Scalar> >
1151 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1152 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1157 if (model != Teuchos::null) {
1158 stepper->setModel(model);
1160 stepper->initialize();
1166 Teuchos::RCP<StepperDIRK_1StageTheta<Scalar> >
1168 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1169 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1173 if (stepperPL != Teuchos::null) {
1174 stepper->setTheta(stepperPL->get<
double>(
"theta", 0.5));
1177 if (model != Teuchos::null) {
1178 stepper->setModel(model);
1180 stepper->initialize();
1186 Teuchos::RCP<StepperEDIRK_2StageTheta<Scalar> >
1188 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1189 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1193 if (stepperPL != Teuchos::null) {
1194 stepper->setTheta(stepperPL->get<
double>(
"theta", 0.5));
1197 if (model != Teuchos::null) {
1198 stepper->setModel(model);
1200 stepper->initialize();
1206 Teuchos::RCP<StepperEDIRK_TrapezoidalRule<Scalar> >
1208 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1209 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1213 if (stepperPL != Teuchos::null)
1214 stepperPL->set<std::string>(
"Stepper Type",
"RK Trapezoidal Rule");
1219 if (model != Teuchos::null) {
1220 stepper->setModel(model);
1222 stepper->initialize();
1228 Teuchos::RCP<StepperSDIRK_ImplicitMidpoint<Scalar> >
1230 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1231 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1236 if (model != Teuchos::null) {
1237 stepper->setModel(model);
1239 stepper->initialize();
1245 Teuchos::RCP<StepperDIRK_1Stage1stOrderRadauIA<Scalar> >
1247 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1248 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1253 if (model != Teuchos::null) {
1254 stepper->setModel(model);
1256 stepper->initialize();
1262 Teuchos::RCP<StepperDIRK_2Stage2ndOrderLobattoIIIB<Scalar> >
1264 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1265 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1270 if (model != Teuchos::null) {
1271 stepper->setModel(model);
1273 stepper->initialize();
1279 Teuchos::RCP<StepperSDIRK_5Stage4thOrder<Scalar> >
1281 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1282 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1287 if (model != Teuchos::null) {
1288 stepper->setModel(model);
1290 stepper->initialize();
1296 Teuchos::RCP<StepperSDIRK_3Stage4thOrder<Scalar> >
1298 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1299 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1304 if (model != Teuchos::null) {
1305 stepper->setModel(model);
1307 stepper->initialize();
1313 Teuchos::RCP<StepperSDIRK_5Stage5thOrder<Scalar> >
1315 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1316 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1321 if (model != Teuchos::null) {
1322 stepper->setModel(model);
1324 stepper->initialize();
1330 Teuchos::RCP<StepperSDIRK_21Pair<Scalar> >
1332 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1333 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1338 if (model != Teuchos::null) {
1339 stepper->setModel(model);
1341 stepper->initialize();
1353 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
1354 std::string stepperType,
1355 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1358 if (stepperType ==
"Forward Euler")
1360 else if (stepperType ==
"Backward Euler")
1362 else if (stepperType ==
"Trapezoidal Method")
1364 else if (stepperType ==
"BDF2")
1366 else if (stepperType ==
"Newmark Implicit a-Form")
1368 else if (stepperType ==
"Newmark Implicit d-Form")
1370 else if (stepperType ==
"Newmark Explicit a-Form")
1372 else if (stepperType ==
"HHT-Alpha")
1374 else if (stepperType ==
"General ERK" )
1376 else if (stepperType ==
"RK Forward Euler" || stepperType ==
"RK1" )
1378 else if (stepperType ==
"RK Explicit 4 Stage" )
1380 else if (stepperType ==
"RK Explicit 3/8 Rule" )
1382 else if (stepperType ==
"RK Explicit 4 Stage 3rd order by Runge" )
1384 else if (stepperType ==
"RK Explicit 5 Stage 3rd order by Kinnmark and Gray" )
1386 else if (stepperType ==
"RK Explicit 3 Stage 3rd order" )
1388 else if (stepperType ==
"RK Explicit 3 Stage 3rd order TVD" ||
1389 stepperType ==
"SSPERK33" || stepperType ==
"SSPRK3" )
1391 else if (stepperType ==
"RK Explicit 3 Stage 3rd order by Heun" )
1393 else if (stepperType ==
"RK Explicit Midpoint" )
1395 else if (stepperType ==
"RK Explicit Trapezoidal" ||
1396 stepperType ==
"Heuns Method" || stepperType ==
"SSPERK22" ||
1397 stepperType ==
"SSPRK2" )
1399 else if (stepperType ==
"RK Explicit Ralston" || stepperType ==
"RK2" )
1401 else if (stepperType ==
"SSPERK54" )
1403 else if (stepperType ==
"Bogacki-Shampine 3(2) Pair" )
1405 else if (stepperType ==
"Merson 4(5) Pair" )
1407 else if (stepperType ==
"General DIRK" )
1409 else if (stepperType ==
"RK Backward Euler" )
1411 else if (stepperType ==
"SDIRK 2 Stage 2nd order" )
1413 else if (stepperType ==
"SSPDIRK22" )
1415 else if (stepperType ==
"SDIRK 3 Stage 2nd order" )
1417 else if (stepperType ==
"SSPDIRK32" )
1419 else if (stepperType ==
"SSPDIRK23" )
1421 else if (stepperType ==
"SSPDIRK33" )
1423 else if (stepperType ==
"SDIRK 2 Stage 3rd order" )
1425 else if (stepperType ==
"EDIRK 2 Stage 3rd order" )
1427 else if (stepperType ==
"DIRK 1 Stage Theta Method" )
1429 else if (stepperType ==
"EDIRK 2 Stage Theta Method" )
1431 else if (stepperType ==
"RK Trapezoidal Rule" ||
1432 stepperType ==
"RK Crank-Nicolson" )
1434 else if (stepperType ==
"RK Implicit Midpoint" )
1436 else if (stepperType ==
"RK Implicit 1 Stage 1st order Radau IA" )
1438 else if (stepperType ==
"RK Implicit 2 Stage 2nd order Lobatto IIIB" )
1440 else if (stepperType ==
"SDIRK 5 Stage 4th order" )
1442 else if (stepperType ==
"SDIRK 3 Stage 4th order" )
1444 else if (stepperType ==
"SDIRK 5 Stage 5th order" )
1446 else if ( stepperType ==
"SDIRK 2(1) Pair" )
1449 stepperType ==
"IMEX RK 1st order" ||
1450 stepperType ==
"SSP1_111" ||
1451 stepperType ==
"IMEX RK SSP2" ||
1452 stepperType ==
"IMEX RK SSP3" ||
1453 stepperType ==
"SSP3_332" ||
1454 stepperType ==
"SSP2_222" ||
1455 stepperType ==
"SSP2_222_L" ||
1456 stepperType ==
"SSP2_222_A" ||
1457 stepperType ==
"IMEX RK ARS 233" ||
1458 stepperType ==
"ARS 233" ||
1459 stepperType ==
"General IMEX RK" )
1462 stepperType ==
"Partitioned IMEX RK 1st order" ||
1463 stepperType ==
"Partitioned IMEX RK SSP2" ||
1464 stepperType ==
"Partitioned IMEX RK ARS 233" ||
1465 stepperType ==
"General Partitioned IMEX RK" )
1467 else if (stepperType ==
"Leapfrog")
1469 else if (stepperType ==
"Subcycling")
1472 Teuchos::RCP<Teuchos::FancyOStream> out =
1473 Teuchos::VerboseObjectBase::getDefaultOStream();
1474 Teuchos::OSTab ostab(out,1,
"StepperFactory::createStepper");
1476 <<
"Unknown Stepper Type! ('"+stepperType+
"').\n"
1477 <<
"Here is a list of available Steppers.\n"
1478 <<
" One-Step Methods:\n"
1479 <<
" 'Forward Euler'\n"
1480 <<
" 'Backward Euler'\n"
1481 <<
" 'Trapezoidal Method'\n"
1482 <<
" Multi-Step Methods:\n"
1484 <<
" Second-order PDE Methods:\n"
1486 <<
" 'Newmark Implicit a-Form'\n"
1487 <<
" 'Newmark Implicit d-Form'\n"
1488 <<
" 'Newmark Explicit a-Form'\n"
1490 <<
" Explicit Runge-Kutta Methods:\n"
1491 <<
" 'RK Forward Euler (RK1)'\n"
1492 <<
" 'RK Explicit 4 Stage'\n"
1493 <<
" 'RK Explicit 3/8 Rule'\n"
1494 <<
" 'RK Explicit 4 Stage 3rd order by Runge'\n"
1495 <<
" 'RK Explicit 5 Stage 3rd order by Kinnmark and Gray'\n"
1496 <<
" 'RK Explicit 3 Stage 3rd order'\n"
1497 <<
" 'RK Explicit 3 Stage 3rd order TVD'\n"
1498 <<
" 'RK Explicit 3 Stage 3rd order by Heun'\n"
1499 <<
" 'RK Explicit Midpoint'\n"
1500 <<
" 'RK Explicit Trapezoidal' or 'Heuns Method'\n"
1501 <<
" 'Bogacki-Shampine 3(2) Pair'\n"
1502 <<
" 'SSPERK22 (SSPRK2)'\n"
1503 <<
" 'SSPERK33 (SSPRK3)'\n"
1505 <<
" 'General ERK'\n"
1506 <<
" Implicit Runge-Kutta Methods:\n"
1507 <<
" 'RK Backward Euler'\n"
1508 <<
" 'DIRK 1 Stage Theta Method'\n"
1509 <<
" 'RK Implicit Midpoint'\n"
1510 <<
" 'SDIRK 1 Stage 1st order'\n"
1511 <<
" 'SDIRK 2 Stage 2nd order'\n"
1512 <<
" 'SDIRK 2 Stage 3rd order'\n"
1513 <<
" 'EDIRK 2 Stage 3rd order'\n"
1514 <<
" 'EDIRK 2 Stage Theta Method'\n"
1515 <<
" 'SDIRK 3 Stage 4th order'\n"
1516 <<
" 'SDIRK 5 Stage 4th order'\n"
1517 <<
" 'SDIRK 5 Stage 5th order'\n"
1522 <<
" 'SDIRK 2(1) Pair'\n"
1523 <<
" 'SDIRK 3 Stage 2nd order'\n"
1524 <<
" 'RK Trapezoidal Rule' or 'RK Crank-Nicolson'\n"
1525 <<
" 'General DIRK'\n"
1526 <<
" Implicit-Explicit (IMEX) Methods:\n"
1527 <<
" 'IMEX RK 1st order'\n"
1529 <<
" 'IMEX RK SSP2 (SSP2_222)'\n"
1530 <<
" 'IMEX RK SSP3 (SSP3_332)'\n"
1531 <<
" 'IMEX RK ARS 233'\n"
1532 <<
" 'General IMEX RK'\n"
1533 <<
" 'Partitioned IMEX RK 1st order'\n"
1534 <<
" 'Partitioned IMEX RK SSP2'\n"
1535 <<
" 'Partitioned IMEX RK ARS 233'\n"
1536 <<
" 'General Partitioned IMEX RK'\n"
1537 <<
" Steppers with subSteppers:\n"
1538 <<
" 'Operator Split'\n"
1540 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
1541 "Unknown 'Stepper Type' = " << stepperType);
1549 std::vector<Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> > > appModels,
1550 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1552 if (stepperPL != Teuchos::null) {
1554 using Teuchos::ParameterList;
1557 std::vector<std::string> stepperListStr;
1558 stepperListStr.clear();
1559 std::string str = stepperPL->get<std::string>(
"Stepper List");
1560 std::string delimiters(
",");
1562 std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
1564 std::string::size_type pos = str.find_first_of(delimiters, lastPos);
1565 while ((pos != std::string::npos) || (lastPos != std::string::npos)) {
1566 std::string token = str.substr(lastPos,pos-lastPos);
1568 std::string::size_type beg = token.find_first_of(
"'") + 1;
1569 std::string::size_type end = token.find_last_of (
"'");
1570 stepperListStr.push_back(token.substr(beg,end-beg));
1572 lastPos = str.find_first_not_of(delimiters, pos);
1573 pos = str.find_first_of(delimiters, lastPos);
1576 TEUCHOS_TEST_FOR_EXCEPTION(stepperListStr.size() != appModels.size(),
1577 std::logic_error,
"Error - Number of models and Steppers do not match!\n"
1578 <<
" There are " << appModels.size() <<
" models.\n"
1579 <<
" There are " << stepperListStr.size() <<
" steppers.\n"
1580 <<
" " << str <<
"\n");
1583 std::vector<RCP<const Thyra::ModelEvaluator<Scalar> > >::iterator
1584 aMI = appModels.begin();
1585 typename std::vector<std::string>::iterator sLSI = stepperListStr.begin();
1587 for (; aMI<appModels.end() || sLSI<stepperListStr.end(); aMI++, sLSI++) {
1588 RCP<ParameterList> subStepperPL = Teuchos::sublist(stepperPL,*sLSI,
true);
1589 bool useFSAL = subStepperPL->template get<bool>(
"Use FSAL",
false);
1592 Teuchos::RCP<Teuchos::FancyOStream> out =
1593 Teuchos::VerboseObjectBase::getDefaultOStream();
1594 Teuchos::OSTab ostab(out,1,
"StepperFactory::createSubSteppers()");
1595 *out <<
"Warning -- subStepper = '"
1596 << subStepper->getStepperType() <<
"' has \n"
1597 <<
" subStepper->getUseFSAL() = " << useFSAL <<
".\n"
1598 <<
" subSteppers usually can not use the FSAL priniciple with\n"
1599 <<
" operator splitting. Proceeding with it set to true.\n"
1602 stepper->addStepper(subStepper, useFSAL);
1607 Teuchos::RCP<StepperOperatorSplit<Scalar> >
1609 std::vector<Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> > > appModels,
1610 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1614 if (stepperPL != Teuchos::null) {
1616 stepper->setOrderMin(stepperPL->get<
int>(
"Minimum Order", 1));
1617 stepper->setOrder (stepperPL->get<
int>(
"Order", 1));
1618 stepper->setOrderMax(stepperPL->get<
int>(
"Maximum Order", 1));
1621 if ( !(appModels.empty()) ) {
1623 stepper->initialize();
1631 std::vector<Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> > > models,
1632 std::string stepperType,
1633 Teuchos::RCP<Teuchos::ParameterList> stepperPL)
1635 if (stepperType ==
"Operator Split")
1638 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
1639 "Unknown 'Stepper Type' = " << stepperType);
1647 #endif // Tempus_StepperFactory_hpp
BDF2 (Backward-Difference-Formula-2) time stepper.
Teuchos::RCP< StepperHHTAlpha< Scalar > > createStepperHHTAlpha(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
virtual ~StepperFactory()
Destructor.
General Implicit Runge-Kutta Butcher Tableau.
Teuchos::RCP< StepperDIRK_1Stage1stOrderRadauIA< Scalar > > createStepperDIRK_1Stage1stOrderRadauIA(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< Stepper< Scalar > > createStepper(std::vector< Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > > models, std::string stepperType, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Trapezoidal method time stepper.
RK Implicit 2 Stage 2nd order Lobatto IIIB.
Teuchos::RCP< StepperBDF2< Scalar > > createStepperBDF2(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperDIRK_1StageTheta< Scalar > > createStepperDIRK_1StageTheta(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperEDIRK_2Stage3rdOrder< Scalar > > createStepperEDIRK_2Stage3rdOrder(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Explicit Runge-Kutta time stepper.
void setStepperExplicitValues(Teuchos::RCP< StepperExplicit< Scalar > > stepper, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Set StepperExplicit member data from the ParameterList.
Strong Stability Preserving Diagonally-Implicit RK Butcher Tableau.
Teuchos::RCP< StepperSDIRK_2Stage3rdOrder< Scalar > > createStepperSDIRK_2Stage3rdOrder(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Backward Euler Runge-Kutta Butcher Tableau.
Teuchos::RCP< StepperSDIRK_3Stage2ndOrder< Scalar > > createStepperSDIRK_3Stage2ndOrder(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperSDIRK_5Stage5thOrder< Scalar > > createStepperSDIRK_5Stage5thOrder(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperLeapfrog< Scalar > > createStepperLeapfrog(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
General Explicit Runge-Kutta Butcher Tableau.
Teuchos::RCP< RKButcherTableau< Scalar > > createTableau(Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Create a tableau from the ParameterList.
Teuchos::RCP< StepperIMEX_RK< Scalar > > createStepperIMEX_RK(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, std::string stepperType, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Forward Euler time stepper.
RK Explicit 5 Stage 3rd order by Kinnmark and Gray.
Teuchos::RCP< StepperIMEX_RK_Partition< Scalar > > createStepperIMEX_RK_Partition(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, std::string stepperType, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Implicit-Explicit Runge-Kutta (IMEX-RK) time stepper.
Teuchos::RCP< StepperERK_Midpoint< Scalar > > createStepperERK_Midpoint(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperTrapezoidal< Scalar > > createStepperTrapezoidal(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperSDIRK_3Stage4thOrder< Scalar > > createStepperSDIRK_3Stage4thOrder(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
StepperFactory()
Constructor.
Teuchos::RCP< StepperSDIRK_SSPDIRK23< Scalar > > createStepperSDIRK_SSPDIRK23(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Strong Stability Preserving Explicit RK Butcher Tableau.
void setStepperRKValues(Teuchos::RCP< StepperExplicitRK< Scalar > > stepper, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Set StepperRK member data from the ParameterList.
RK Explicit 4 Stage 3rd order by Runge.
Teuchos::RCP< StepperSDIRK_21Pair< Scalar > > createStepperSDIRK_21Pair(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
void setStepperValues(Teuchos::RCP< Stepper< Scalar > > stepper, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Set Stepper member data from the ParameterList.
void setStepperSolverValues(Teuchos::RCP< StepperImplicit< Scalar > > stepper, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Set solver from ParameterList.
void TokensToDoubles(std::vector< double > &values, const std::vector< std::string > &tokens)
Turn a vector of tokens into a vector of doubles.
Teuchos::RCP< StepperERK_Merson45< Scalar > > createStepperERK_Merson45(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
RK Trapezoidal Rule (A.K.A. RK Crank-Nicolson)
Partitioned Implicit-Explicit Runge-Kutta (IMEX-RK) time stepper.
Teuchos::RCP< Teuchos::ParameterList > defaultSolverParameters()
Returns the default solver ParameterList for implicit Steppers.
Teuchos::RCP< StepperERK_ForwardEuler< Scalar > > createStepperERK_ForwardEuler(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< Stepper< Scalar > > createStepper(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, std::string stepperType, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Very simple factory method.
OperatorSplit stepper loops through the Stepper list.
Thyra Base interface for time steppers.
Explicit RK 3/8th Rule Butcher Tableau.
Diagonally Implicit Runge-Kutta (DIRK) time stepper.
Teuchos::RCP< StepperSDIRK_SSPDIRK22< Scalar > > createStepperSDIRK_SSPDIRK22(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Strong Stability Preserving Diagonally-Implicit RK Butcher Tableau.
Thyra Base interface for implicit time steppers.
Teuchos::RCP< StepperSDIRK_SSPDIRK33< Scalar > > createStepperSDIRK_SSPDIRK33(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperForwardEuler< Scalar > > createStepperForwardEuler(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperERK_SSPERK54< Scalar > > createStepperERK_SSPERK54(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperBackwardEuler< Scalar > > createStepperBackwardEuler(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperSubcycling< Scalar > > createStepperSubcycling(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperERK_4Stage3rdOrderRunge< Scalar > > createStepperERK_4Stage3rdOrderRunge(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Explicit RK Bogacki-Shampine Butcher Tableau.
void createSubSteppers(Teuchos::RCP< StepperOperatorSplit< Scalar > > stepper, std::vector< Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > > appModels, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperSDIRK_5Stage4thOrder< Scalar > > createStepperSDIRK_5Stage4thOrder(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
EDIRK 2 Stage Theta Method.
Teuchos::RCP< StepperERK_5Stage3rdOrderKandG< Scalar > > createStepperERK_5Stage3rdOrderKandG(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperERK_3_8Rule< Scalar > > createStepperERK_3_8Rule(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Backward Euler time stepper.
Teuchos::RCP< StepperERK_General< Scalar > > createStepperERK_General(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Strong Stability Preserving Diagonally-Implicit RK Butcher Tableau.
Teuchos::RCP< Stepper< Scalar > > createStepper(Teuchos::RCP< Teuchos::ParameterList > stepperPL, const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model=Teuchos::null)
Create stepper from ParameterList with its details.
Teuchos::RCP< Stepper< Scalar > > createStepper(std::string stepperType="Forward Euler", const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model=Teuchos::null)
Create default stepper from stepper type (e.g., "Forward Euler").
Teuchos::RCP< StepperEDIRK_TrapezoidalRule< Scalar > > createStepperEDIRK_TrapezoidalRule(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperDIRK_BackwardEuler< Scalar > > createStepperDIRK_BackwardEuler(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperOperatorSplit< Scalar > > createStepperOperatorSplit(std::vector< Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > > appModels, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperNewmarkImplicitAForm< Scalar > > createStepperNewmarkImplicitAForm(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
RK Explicit 3 Stage 3rd order TVD.
Teuchos::RCP< StepperDIRK_General< Scalar > > createStepperDIRK_General(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Forward Euler Runge-Kutta Butcher Tableau.
void StringTokenizer(std::vector< std::string > &tokens, const std::string &str, const std::string delimiters, bool trim)
Tokenize a string, put tokens in a vector.
Teuchos::RCP< Stepper< Scalar > > createMultiSteppers(Teuchos::RCP< Teuchos::ParameterList > stepperPL, std::vector< Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > > models)
Create stepper from ParameterList with its details.
Explicit RK Merson Butcher Tableau.
Runge-Kutta 4th order Butcher Tableau.
void setTableaus(Teuchos::RCP< StepperIMEX_RK< Scalar > > stepper, Teuchos::RCP< Teuchos::ParameterList > stepperPL, std::string stepperType)
Teuchos::RCP< StepperEDIRK_2StageTheta< Scalar > > createStepperEDIRK_2StageTheta(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperERK_Ralston< Scalar > > createStepperERK_Ralston(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL, std::string stepperType)
Teuchos::RCP< StepperNewmarkImplicitDForm< Scalar > > createStepperNewmarkImplicitDForm(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
RK Explicit 3 Stage 3rd order.
Teuchos::RCP< StepperNewmarkExplicitAForm< Scalar > > createStepperNewmarkExplicitAForm(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
RK Implicit 1 Stage 1st order Radau IA.
Teuchos::RCP< StepperSDIRK_ImplicitMidpoint< Scalar > > createStepperSDIRK_ImplicitMidpoint(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperERK_3Stage3rdOrderHeun< Scalar > > createStepperERK_3Stage3rdOrderHeun(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperERK_Trapezoidal< Scalar > > createStepperERK_Trapezoidal(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL, std::string stepperType)
Teuchos::RCP< StepperDIRK_2Stage2ndOrderLobattoIIIB< Scalar > > createStepperDIRK_2Stage2ndOrderLobattoIIIB(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
void setTableausPartition(Teuchos::RCP< StepperIMEX_RK_Partition< Scalar > > stepper, Teuchos::RCP< Teuchos::ParameterList > stepperPL, std::string stepperType)
void setStepperImplicitValues(Teuchos::RCP< StepperImplicit< Scalar > > stepper, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Set StepperImplicit member data from the ParameterList.
Teuchos::RCP< StepperSDIRK_2Stage2ndOrder< Scalar > > createStepperSDIRK_2Stage2ndOrder(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperSDIRK_SSPDIRK32< Scalar > > createStepperSDIRK_SSPDIRK32(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Thyra Base interface for implicit time steppers.
Teuchos::RCP< StepperERK_3Stage3rdOrder< Scalar > > createStepperERK_3Stage3rdOrder(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
void setStepperDIRKValues(Teuchos::RCP< StepperDIRK< Scalar > > stepper, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Set StepperDIRK member data from the ParameterList.
RK Explicit 3 Stage 3rd order by Heun.
Teuchos::RCP< StepperERK_BogackiShampine32< Scalar > > createStepperERK_BogackiShampine32(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Teuchos::RCP< StepperERK_3Stage3rdOrderTVD< Scalar > > createStepperERK_3Stage3rdOrderTVD(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL, const std::string stepperType)
Teuchos::RCP< StepperERK_4Stage4thOrder< Scalar > > createStepperERK_4Stage4thOrder(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > stepperPL)
Strong Stability Preserving Diagonally-Implicit RK Butcher Tableau.