13 #include "Thyra_VectorStdOps.hpp"
15 #include "Tempus_IntegratorBasic.hpp"
16 #include "Tempus_StepperFactory.hpp"
18 #include "../TestModels/SinCosModel.hpp"
19 #include "../TestModels/VanDerPolModel.hpp"
20 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
25 namespace Tempus_Test {
27 using Teuchos::getParametersFromXmlFile;
29 using Teuchos::parameterList;
32 using Teuchos::rcp_const_cast;
33 using Teuchos::rcp_dynamic_cast;
34 using Teuchos::sublist;
44 std::vector<std::string> RKMethods;
45 RKMethods.push_back(
"General DIRK");
46 RKMethods.push_back(
"RK Backward Euler");
47 RKMethods.push_back(
"DIRK 1 Stage Theta Method");
48 RKMethods.push_back(
"RK Implicit 1 Stage 1st order Radau IA");
49 RKMethods.push_back(
"RK Implicit Midpoint");
50 RKMethods.push_back(
"SDIRK 2 Stage 2nd order");
51 RKMethods.push_back(
"RK Implicit 2 Stage 2nd order Lobatto IIIB");
52 RKMethods.push_back(
"SDIRK 2 Stage 3rd order");
53 RKMethods.push_back(
"EDIRK 2 Stage 3rd order");
54 RKMethods.push_back(
"EDIRK 2 Stage Theta Method");
55 RKMethods.push_back(
"SDIRK 3 Stage 4th order");
56 RKMethods.push_back(
"SDIRK 5 Stage 4th order");
57 RKMethods.push_back(
"SDIRK 5 Stage 5th order");
58 RKMethods.push_back(
"SDIRK 2(1) Pair");
59 RKMethods.push_back(
"RK Trapezoidal Rule");
60 RKMethods.push_back(
"RK Crank-Nicolson");
62 for (std::vector<std::string>::size_type m = 0; m != RKMethods.size(); m++) {
63 std::string RKMethod = RKMethods[m];
67 getParametersFromXmlFile(
"Tempus_DIRK_SinCos.xml");
74 tempusPL->
sublist(
"Default Stepper").
set(
"Stepper Type", RKMethods[m]);
76 if (RKMethods[m] ==
"DIRK 1 Stage Theta Method" ||
77 RKMethods[m] ==
"EDIRK 2 Stage Theta Method") {
81 *solverPL = *(sublist(stepperPL,
"Default Solver",
true));
82 if (RKMethods[m] ==
"EDIRK 2 Stage Theta Method")
83 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Use FSAL", 1);
84 tempusPL->
sublist(
"Default Stepper").
remove(
"Zero Initial Guess");
85 tempusPL->
sublist(
"Default Stepper").
remove(
"Default Solver");
86 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Zero Initial Guess", 0);
87 tempusPL->
sublist(
"Default Stepper").
remove(
"Reset Initial Guess");
88 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Reset Initial Guess", 1);
89 tempusPL->
sublist(
"Default Stepper").
set(
"Default Solver", *solverPL);
90 tempusPL->
sublist(
"Default Stepper").
set<
double>(
"theta", 0.5);
92 else if (RKMethods[m] ==
"SDIRK 2 Stage 2nd order") {
96 *solverPL = *(sublist(stepperPL,
"Default Solver",
true));
97 tempusPL->
sublist(
"Default Stepper").
remove(
"Default Solver");
98 tempusPL->
sublist(
"Default Stepper").
remove(
"Zero Initial Guess");
99 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Zero Initial Guess", 0);
100 tempusPL->
sublist(
"Default Stepper").
remove(
"Reset Initial Guess");
101 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Reset Initial Guess", 1);
102 tempusPL->
sublist(
"Default Stepper").
set(
"Default Solver", *solverPL);
103 tempusPL->
sublist(
"Default Stepper")
104 .
set<
double>(
"gamma", 0.2928932188134524);
106 else if (RKMethods[m] ==
"SDIRK 2 Stage 3rd order") {
110 *solverPL = *(sublist(stepperPL,
"Default Solver",
true));
111 tempusPL->
sublist(
"Default Stepper").
remove(
"Zero Initial Guess");
112 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Zero Initial Guess", 0);
113 tempusPL->
sublist(
"Default Stepper").
remove(
"Default Solver");
114 tempusPL->
sublist(
"Default Stepper").
remove(
"Reset Initial Guess");
115 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Reset Initial Guess", 1);
116 tempusPL->
sublist(
"Default Stepper").
set(
"Default Solver", *solverPL);
117 tempusPL->
sublist(
"Default Stepper")
118 .
set<std::string>(
"Gamma Type",
"3rd Order A-stable");
119 tempusPL->
sublist(
"Default Stepper")
120 .
set<
double>(
"gamma", 0.7886751345948128);
122 else if (RKMethods[m] ==
"RK Trapezoidal Rule") {
123 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Use FSAL", 1);
125 else if (RKMethods[m] ==
"RK Crank-Nicolson") {
126 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Use FSAL", 1);
128 tempusPL->
sublist(
"Default Stepper")
129 .
set(
"Stepper Type",
"RK Trapezoidal Rule");
131 else if (RKMethods[m] ==
"General DIRK") {
134 tableauPL->
set<std::string>(
135 "A",
"0.292893218813452 0; 0.707106781186548 0.292893218813452");
136 tableauPL->
set<std::string>(
"b",
"0.707106781186548 0.292893218813452");
137 tableauPL->
set<std::string>(
"c",
"0.292893218813452 1");
138 tableauPL->
set<
int>(
"order", 2);
139 tableauPL->
set<std::string>(
"bstar",
"");
140 tempusPL->
sublist(
"Default Stepper").
set(
"Tableau", *tableauPL);
146 Tempus::createIntegratorBasic<double>(tempusPL, model);
151 integrator->getStepper()->getValidParameters());
154 defaultPL->
remove(
"Description");
156 bool pass = haveSameValuesSorted(*stepperPL, *defaultPL,
true);
159 out <<
"stepperPL -------------- \n"
160 << *stepperPL << std::endl;
161 out <<
"defaultPL -------------- \n"
162 << *defaultPL << std::endl;
170 Tempus::createIntegratorBasic<double>(model, RKMethods[m]);
175 integrator->getStepper()->getValidParameters());
178 defaultPL->
remove(
"Description");
184 if (RKMethods[m] ==
"EDIRK 2 Stage Theta Method" ||
185 RKMethods[m] ==
"RK Trapezoidal Rule" ||
186 RKMethods[m] ==
"RK Crank-Nicolson") {
187 stepperPL->set<std::string>(
"Initial Condition Consistency",
189 stepperPL->remove(
"Default Solver");
190 defaultPL->
remove(
"Default Solver");
193 bool pass = haveSameValuesSorted(*stepperPL, *defaultPL,
true);
196 out <<
"stepperPL -------------- \n"
197 << *stepperPL << std::endl;
198 out <<
"defaultPL -------------- \n"
199 << *defaultPL << std::endl;
211 std::vector<std::string> options;
212 options.push_back(
"Default Parameters");
213 options.push_back(
"ICConsistency and Check");
215 for (
const auto& option : options) {
218 getParametersFromXmlFile(
"Tempus_DIRK_SinCos.xml");
230 sf->createStepper(
"SDIRK 2 Stage 2nd order");
231 stepper->setModel(model);
232 if (option ==
"ICConsistency and Check") {
233 stepper->setICConsistency(
"Consistent");
234 stepper->setICConsistencyCheck(
true);
236 stepper->initialize();
242 timeStepControl->setInitIndex(tscPL.
get<
int>(
"Initial Time Index"));
243 timeStepControl->setInitTime(tscPL.
get<
double>(
"Initial Time"));
244 timeStepControl->setFinalTime(tscPL.
get<
double>(
"Final Time"));
245 timeStepControl->setInitTimeStep(dt);
246 timeStepControl->initialize();
249 auto inArgsIC = model->getNominalValues();
253 icState->setTime(timeStepControl->getInitTime());
254 icState->setIndex(timeStepControl->getInitIndex());
255 icState->setTimeStep(0.0);
256 icState->setOrder(stepper->getOrder());
261 solutionHistory->setName(
"Forward States");
263 solutionHistory->setStorageLimit(2);
264 solutionHistory->addState(icState);
268 Tempus::createIntegratorBasic<double>();
269 integrator->setStepper(stepper);
270 integrator->setTimeStepControl(timeStepControl);
271 integrator->setSolutionHistory(solutionHistory);
273 integrator->initialize();
276 bool integratorStatus = integrator->advanceTime();
280 double time = integrator->getTime();
281 double timeFinal = pl->
sublist(
"Default Integrator")
283 .
get<
double>(
"Final Time");
289 model->getExactSolution(time).get_x();
293 Thyra::V_StVpStV(xdiff.
ptr(), 1.0, *x_exact, -1.0, *(x));
296 out <<
" Stepper = " << stepper->description() <<
" with " << option
298 out <<
" =========================" << std::endl;
299 out <<
" Exact solution : " << get_ele(*(x_exact), 0) <<
" "
300 << get_ele(*(x_exact), 1) << std::endl;
301 out <<
" Computed solution: " << get_ele(*(x), 0) <<
" "
302 << get_ele(*(x), 1) << std::endl;
303 out <<
" Difference : " << get_ele(*(xdiff), 0) <<
" "
304 << get_ele(*(xdiff), 1) << std::endl;
305 out <<
" =========================" << std::endl;
306 TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 0.841470, 1.0e-4);
307 TEST_FLOATING_EQUALITY(get_ele(*(x), 1), 0.540304, 1.0e-4);
316 std::vector<std::string> RKMethods;
317 RKMethods.push_back(
"EDIRK 2 Stage Theta Method");
318 RKMethods.push_back(
"RK Trapezoidal Rule");
320 for (std::vector<std::string>::size_type m = 0; m != RKMethods.size(); m++) {
326 auto stepper = sf->createStepper(RKMethods[m]);
327 stepper->setModel(model);
328 stepper->setUseFSAL(
false);
329 stepper->initialize();
333 timeStepControl->setInitTime(0.0);
334 timeStepControl->setFinalTime(1.0);
335 timeStepControl->setInitTimeStep(dt);
336 timeStepControl->initialize();
339 auto inArgsIC = model->getNominalValues();
343 icState->setTime(timeStepControl->getInitTime());
344 icState->setIndex(timeStepControl->getInitIndex());
345 icState->setTimeStep(0.0);
346 icState->setOrder(stepper->getOrder());
351 solutionHistory->setName(
"Forward States");
353 solutionHistory->setStorageLimit(2);
354 solutionHistory->addState(icState);
357 auto integrator = Tempus::createIntegratorBasic<double>();
358 integrator->setStepper(stepper);
359 integrator->setTimeStepControl(timeStepControl);
360 integrator->setSolutionHistory(solutionHistory);
361 integrator->initialize();
364 bool integratorStatus = integrator->advanceTime();
368 double time = integrator->getTime();
372 auto x = integrator->getX();
373 auto x_exact = model->getExactSolution(time).get_x();
377 Thyra::V_StVpStV(xdiff.
ptr(), 1.0, *x_exact, -1.0, *(x));
380 out <<
" Stepper = " << stepper->description() <<
"\n with "
381 <<
"useFSAL=false" << std::endl;
382 out <<
" =========================" << std::endl;
383 out <<
" Exact solution : " << get_ele(*(x_exact), 0) <<
" "
384 << get_ele(*(x_exact), 1) << std::endl;
385 out <<
" Computed solution: " << get_ele(*(x), 0) <<
" "
386 << get_ele(*(x), 1) << std::endl;
387 out <<
" Difference : " << get_ele(*(xdiff), 0) <<
" "
388 << get_ele(*(xdiff), 1) << std::endl;
389 out <<
" =========================" << std::endl;
390 if (RKMethods[m] ==
"EDIRK 2 Stage Theta Method") {
394 else if (RKMethods[m] ==
"RK Trapezoidal Rule") {
405 std::vector<std::string> RKMethods;
406 RKMethods.push_back(
"General DIRK");
407 RKMethods.push_back(
"RK Backward Euler");
408 RKMethods.push_back(
"DIRK 1 Stage Theta Method");
409 RKMethods.push_back(
"RK Implicit 1 Stage 1st order Radau IA");
410 RKMethods.push_back(
"RK Implicit Midpoint");
411 RKMethods.push_back(
"SDIRK 2 Stage 2nd order");
412 RKMethods.push_back(
"RK Implicit 2 Stage 2nd order Lobatto IIIB");
413 RKMethods.push_back(
"SDIRK 2 Stage 3rd order");
414 RKMethods.push_back(
"EDIRK 2 Stage 3rd order");
415 RKMethods.push_back(
"EDIRK 2 Stage Theta Method");
416 RKMethods.push_back(
"SDIRK 3 Stage 4th order");
417 RKMethods.push_back(
"SDIRK 5 Stage 4th order");
418 RKMethods.push_back(
"SDIRK 5 Stage 5th order");
419 RKMethods.push_back(
"SDIRK 2(1) Pair");
420 RKMethods.push_back(
"RK Trapezoidal Rule");
421 RKMethods.push_back(
"RK Crank-Nicolson");
422 RKMethods.push_back(
"SSPDIRK22");
423 RKMethods.push_back(
"SSPDIRK32");
424 RKMethods.push_back(
"SSPDIRK23");
425 RKMethods.push_back(
"SSPDIRK33");
426 RKMethods.push_back(
"SDIRK 3 Stage 2nd order");
428 std::vector<double> RKMethodErrors;
429 RKMethodErrors.push_back(2.52738e-05);
430 RKMethodErrors.push_back(0.0124201);
431 RKMethodErrors.push_back(5.20785e-05);
432 RKMethodErrors.push_back(0.0124201);
433 RKMethodErrors.push_back(5.20785e-05);
434 RKMethodErrors.push_back(2.52738e-05);
435 RKMethodErrors.push_back(5.20785e-05);
436 RKMethodErrors.push_back(1.40223e-06);
437 RKMethodErrors.push_back(2.17004e-07);
438 RKMethodErrors.push_back(5.20785e-05);
439 RKMethodErrors.push_back(6.41463e-08);
440 RKMethodErrors.push_back(3.30631e-10);
441 RKMethodErrors.push_back(1.35728e-11);
442 RKMethodErrors.push_back(0.0001041);
443 RKMethodErrors.push_back(5.20785e-05);
444 RKMethodErrors.push_back(5.20785e-05);
445 RKMethodErrors.push_back(1.30205e-05);
446 RKMethodErrors.push_back(5.7869767e-06);
447 RKMethodErrors.push_back(1.00713e-07);
448 RKMethodErrors.push_back(3.94916e-08);
449 RKMethodErrors.push_back(2.52738e-05);
453 for (std::vector<std::string>::size_type m = 0; m != RKMethods.size(); m++) {
454 std::string RKMethod = RKMethods[m];
455 std::replace(RKMethod.begin(), RKMethod.end(),
' ',
'_');
456 std::replace(RKMethod.begin(), RKMethod.end(),
'/',
'.');
459 std::vector<RCP<Thyra::VectorBase<double>>> solutions;
460 std::vector<RCP<Thyra::VectorBase<double>>> solutionsDot;
461 std::vector<double> StepSize;
462 std::vector<double> xErrorNorm;
463 std::vector<double> xDotErrorNorm;
465 const int nTimeStepSizes = 2;
468 for (
int n = 0; n < nTimeStepSizes; n++) {
471 getParametersFromXmlFile(
"Tempus_DIRK_SinCos.xml");
479 pl->
sublist(
"Default Stepper").
set(
"Stepper Type", RKMethods[m]);
480 if (RKMethods[m] ==
"DIRK 1 Stage Theta Method" ||
481 RKMethods[m] ==
"EDIRK 2 Stage Theta Method") {
482 pl->
sublist(
"Default Stepper").
set<
double>(
"theta", 0.5);
484 else if (RKMethods[m] ==
"SDIRK 2 Stage 2nd order") {
485 pl->
sublist(
"Default Stepper").
set(
"gamma", 0.2928932188134524);
487 else if (RKMethods[m] ==
"SDIRK 2 Stage 3rd order") {
489 .
set<std::string>(
"Gamma Type",
"3rd Order A-stable");
495 pl->
sublist(
"Default Integrator")
497 .
set(
"Initial Time Step", dt);
498 integrator = Tempus::createIntegratorBasic<double>(pl, model);
506 model->getNominalValues().get_x()->clone_v();
507 integrator->initializeSolutionHistory(0.0, x0);
510 bool integratorStatus = integrator->advanceTime();
514 time = integrator->getTime();
515 double timeFinal = pl->sublist(
"Default Integrator")
516 .sublist(
"Time Step Control")
517 .get<
double>(
"Final Time");
518 double tol = 100.0 * std::numeric_limits<double>::epsilon();
524 integrator->getSolutionHistory();
525 writeSolution(
"Tempus_" + RKMethod +
"_SinCos.dat", solutionHistory);
528 for (
int i = 0; i < solutionHistory->getNumStates(); i++) {
529 double time_i = (*solutionHistory)[i]->getTime();
532 model->getExactSolution(time_i).get_x()),
534 model->getExactSolution(time_i).get_x_dot()));
535 state->setTime((*solutionHistory)[i]->getTime());
536 solnHistExact->addState(state);
538 writeSolution(
"Tempus_" + RKMethod +
"_SinCos-Ref.dat", solnHistExact);
542 StepSize.push_back(dt);
543 auto solution = Thyra::createMember(model->get_x_space());
544 Thyra::copy(*(integrator->getX()), solution.ptr());
545 solutions.push_back(solution);
546 auto solutionDot = Thyra::createMember(model->get_x_space());
547 Thyra::copy(*(integrator->getXDot()), solutionDot.ptr());
548 solutionsDot.push_back(solutionDot);
549 if (n == nTimeStepSizes - 1) {
550 StepSize.push_back(0.0);
551 auto solutionExact = Thyra::createMember(model->get_x_space());
552 Thyra::copy(*(model->getExactSolution(time).get_x()),
553 solutionExact.ptr());
554 solutions.push_back(solutionExact);
555 auto solutionDotExact = Thyra::createMember(model->get_x_space());
556 Thyra::copy(*(model->getExactSolution(time).get_x_dot()),
557 solutionDotExact.ptr());
558 solutionsDot.push_back(solutionDotExact);
564 double xDotSlope = 0.0;
566 double order = stepper->getOrder();
568 StepSize, solutions, xErrorNorm, xSlope, solutionsDot,
569 xDotErrorNorm, xDotSlope, out);
583 std::vector<std::string> RKMethods;
584 RKMethods.push_back(
"SDIRK 2 Stage 2nd order");
586 std::string RKMethod = RKMethods[0];
587 std::replace(RKMethod.begin(), RKMethod.end(),
' ',
'_');
588 std::replace(RKMethod.begin(), RKMethod.end(),
'/',
'.');
591 std::vector<RCP<Thyra::VectorBase<double>>> solutions;
592 std::vector<RCP<Thyra::VectorBase<double>>> solutionsDot;
593 std::vector<double> StepSize;
594 std::vector<double> xErrorNorm;
595 std::vector<double> xDotErrorNorm;
597 const int nTimeStepSizes = 3;
600 for (
int n = 0; n < nTimeStepSizes; n++) {
603 getParametersFromXmlFile(
"Tempus_DIRK_VanDerPol.xml");
611 pl->
sublist(
"Default Stepper").
set(
"Stepper Type", RKMethods[0]);
612 pl->
sublist(
"Default Stepper").
set(
"gamma", 0.2928932188134524);
616 if (n == nTimeStepSizes - 1) dt /= 10.0;
619 pl->
sublist(
"Default Integrator")
621 .
set(
"Initial Time Step", dt);
622 integrator = Tempus::createIntegratorBasic<double>(pl, model);
625 bool integratorStatus = integrator->advanceTime();
629 time = integrator->getTime();
630 double timeFinal = pl->sublist(
"Default Integrator")
631 .sublist(
"Time Step Control")
632 .get<
double>(
"Final Time");
633 double tol = 100.0 * std::numeric_limits<double>::epsilon();
637 StepSize.push_back(dt);
638 auto solution = Thyra::createMember(model->get_x_space());
639 Thyra::copy(*(integrator->getX()), solution.ptr());
640 solutions.push_back(solution);
641 auto solutionDot = Thyra::createMember(model->get_x_space());
642 Thyra::copy(*(integrator->getXDot()), solutionDot.ptr());
643 solutionsDot.push_back(solutionDot);
647 if ((n == 0) || (n == nTimeStepSizes - 1)) {
648 std::string fname =
"Tempus_" + RKMethod +
"_VanDerPol-Ref.dat";
649 if (n == 0) fname =
"Tempus_" + RKMethod +
"_VanDerPol.dat";
651 integrator->getSolutionHistory();
658 double xDotSlope = 0.0;
660 double order = stepper->getOrder();
663 solutionsDot.clear();
665 writeOrderError(
"Tempus_" + RKMethod +
"_VanDerPol-Error.dat", stepper,
666 StepSize, solutions, xErrorNorm, xSlope, solutionsDot,
667 xDotErrorNorm, xDotSlope, out);
681 std::vector<std::string> IntegratorList;
682 IntegratorList.push_back(
"Embedded_Integrator_PID");
683 IntegratorList.push_back(
"Embedded_Integrator");
686 const int refIstep = 217;
688 for (
auto integratorChoice : IntegratorList) {
689 out <<
"Using Integrator: " << integratorChoice <<
" !!!" << std::endl;
693 getParametersFromXmlFile(
"Tempus_DIRK_VanDerPol.xml");
701 pl->
set(
"Integrator Name", integratorChoice);
705 Tempus::createIntegratorBasic<double>(pl, model);
707 const std::string RKMethod_ =
708 pl->sublist(integratorChoice).
get<std::string>(
"Stepper Name");
711 bool integratorStatus = integrator->advanceTime();
715 double time = integrator->getTime();
716 double timeFinal = pl->sublist(integratorChoice)
717 .sublist(
"Time Step Control")
718 .
get<
double>(
"Final Time");
724 Thyra::set_ele(0, -1.5484458614405929, xref.
ptr());
725 Thyra::set_ele(1, 1.0181127316101317, xref.
ptr());
729 Thyra::V_StVpStV(xdiff.ptr(), 1.0, *xref, -1.0, *(x));
730 const double L2norm = Thyra::norm_2(*xdiff);
733 if (integratorChoice ==
"Embedded_Integrator_PID") {
734 const double absTol = pl->sublist(integratorChoice)
735 .sublist(
"Time Step Control")
736 .get<
double>(
"Maximum Absolute Error");
737 const double relTol = pl->sublist(integratorChoice)
738 .sublist(
"Time Step Control")
739 .get<
double>(
"Maximum Relative Error");
745 integrator->getSolutionHistory()->getCurrentState()->getIndex();
750 TEST_FLOATING_EQUALITY(std::log10(L2norm), std::log10(absTol), 0.3);
751 TEST_FLOATING_EQUALITY(std::log10(L2norm), std::log10(relTol), 0.3);
757 std::ofstream ftmp(
"Tempus_" + integratorChoice + RKMethod_ +
760 integrator->getSolutionHistory();
761 int nStates = solutionHistory->getNumStates();
763 for (
int i = 0; i < nStates; i++) {
765 double time_i = solutionState->getTime();
768 ftmp << time_i <<
" " << Thyra::get_ele(*(x_plot), 0) <<
" "
769 << Thyra::get_ele(*(x_plot), 1) <<
" " << std::endl;
Teuchos::RCP< SolutionState< Scalar > > createSolutionStateX(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &xdot=Teuchos::null, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &xdotdot=Teuchos::null)
Nonmember constructor from non-const solution vectors, x.
T & get(const std::string &name, T def_value)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#define TEST_COMPARE(v1, comp, v2)
void writeOrderError(const std::string filename, Teuchos::RCP< Tempus::Stepper< Scalar >> stepper, std::vector< Scalar > &StepSize, std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar >>> &solutions, std::vector< Scalar > &xErrorNorm, Scalar &xSlope, std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar >>> &solutionsDot, std::vector< Scalar > &xDotErrorNorm, Scalar &xDotSlope, std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar >>> &solutionsDotDot, std::vector< Scalar > &xDotDotErrorNorm, Scalar &xDotDotSlope, Teuchos::FancyOStream &out)
#define TEST_FLOATING_EQUALITY(v1, v2, tol)
Sine-Cosine model problem from Rythmos. This is a canonical Sine-Cosine differential equation with a...
void writeSolution(const std::string filename, Teuchos::RCP< const Tempus::SolutionHistory< Scalar >> solutionHistory)
bool remove(std::string const &name, bool throwIfNotExists=true)
TEUCHOS_UNIT_TEST(BackwardEuler, SinCos_ASA)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
static void summarize(Ptr< const Comm< int > > comm, std::ostream &out=std::cout, const bool alwaysWriteLocal=false, const bool writeGlobalStats=true, const bool writeZeroTimers=true, const ECounterSetOp setOp=Intersection, const std::string &filter="", const bool ignoreZeroTimers=false)
TimeStepControl manages the time step size. There several mechanisms that effect the time step size a...
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
Keep a fix number of states.
van der Pol model problem for nonlinear electrical circuit.
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
#define TEUCHOS_ASSERT(assertion_test)
Solution state for integrators and steppers.