14 #include "Thyra_VectorStdOps.hpp"
16 #include "Tempus_IntegratorBasic.hpp"
17 #include "Tempus_StepperFactory.hpp"
19 #include "../TestModels/SinCosModel.hpp"
20 #include "../TestModels/VanDerPolModel.hpp"
21 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
26 namespace Tempus_Test {
28 using Teuchos::getParametersFromXmlFile;
30 using Teuchos::parameterList;
33 using Teuchos::rcp_const_cast;
34 using Teuchos::rcp_dynamic_cast;
35 using Teuchos::sublist;
45 std::vector<std::string> RKMethods;
46 RKMethods.push_back(
"General DIRK");
47 RKMethods.push_back(
"RK Backward Euler");
48 RKMethods.push_back(
"DIRK 1 Stage Theta Method");
49 RKMethods.push_back(
"RK Implicit 1 Stage 1st order Radau IA");
50 RKMethods.push_back(
"RK Implicit Midpoint");
51 RKMethods.push_back(
"SDIRK 2 Stage 2nd order");
52 RKMethods.push_back(
"RK Implicit 2 Stage 2nd order Lobatto IIIB");
53 RKMethods.push_back(
"SDIRK 2 Stage 3rd order");
54 RKMethods.push_back(
"EDIRK 2 Stage 3rd order");
55 RKMethods.push_back(
"EDIRK 2 Stage Theta Method");
56 RKMethods.push_back(
"SDIRK 3 Stage 4th order");
57 RKMethods.push_back(
"SDIRK 5 Stage 4th order");
58 RKMethods.push_back(
"SDIRK 5 Stage 5th order");
59 RKMethods.push_back(
"SDIRK 2(1) Pair");
60 RKMethods.push_back(
"RK Trapezoidal Rule");
61 RKMethods.push_back(
"RK Crank-Nicolson");
63 for (std::vector<std::string>::size_type m = 0; m != RKMethods.size(); m++) {
64 std::string RKMethod = RKMethods[m];
68 getParametersFromXmlFile(
"Tempus_DIRK_SinCos.xml");
75 tempusPL->
sublist(
"Default Stepper").
set(
"Stepper Type", RKMethods[m]);
77 if (RKMethods[m] ==
"DIRK 1 Stage Theta Method" ||
78 RKMethods[m] ==
"EDIRK 2 Stage Theta Method") {
82 *solverPL = *(sublist(stepperPL,
"Default Solver",
true));
83 if (RKMethods[m] ==
"EDIRK 2 Stage Theta Method")
84 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Use FSAL", 1);
85 tempusPL->
sublist(
"Default Stepper").
remove(
"Zero Initial Guess");
86 tempusPL->
sublist(
"Default Stepper").
remove(
"Default Solver");
87 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Zero Initial Guess", 0);
88 tempusPL->
sublist(
"Default Stepper").
remove(
"Reset Initial Guess");
89 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Reset Initial Guess", 1);
90 tempusPL->
sublist(
"Default Stepper").
set(
"Default Solver", *solverPL);
91 tempusPL->
sublist(
"Default Stepper").
set<
double>(
"theta", 0.5);
93 else if (RKMethods[m] ==
"SDIRK 2 Stage 2nd order") {
97 *solverPL = *(sublist(stepperPL,
"Default Solver",
true));
98 tempusPL->
sublist(
"Default Stepper").
remove(
"Default Solver");
99 tempusPL->
sublist(
"Default Stepper").
remove(
"Zero Initial Guess");
100 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Zero Initial Guess", 0);
101 tempusPL->
sublist(
"Default Stepper").
remove(
"Reset Initial Guess");
102 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Reset Initial Guess", 1);
103 tempusPL->
sublist(
"Default Stepper").
set(
"Default Solver", *solverPL);
104 tempusPL->
sublist(
"Default Stepper")
105 .
set<
double>(
"gamma", 0.2928932188134524);
107 else if (RKMethods[m] ==
"SDIRK 2 Stage 3rd order") {
111 *solverPL = *(sublist(stepperPL,
"Default Solver",
true));
112 tempusPL->
sublist(
"Default Stepper").
remove(
"Zero Initial Guess");
113 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Zero Initial Guess", 0);
114 tempusPL->
sublist(
"Default Stepper").
remove(
"Default Solver");
115 tempusPL->
sublist(
"Default Stepper").
remove(
"Reset Initial Guess");
116 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Reset Initial Guess", 1);
117 tempusPL->
sublist(
"Default Stepper").
set(
"Default Solver", *solverPL);
118 tempusPL->
sublist(
"Default Stepper")
119 .
set<std::string>(
"Gamma Type",
"3rd Order A-stable");
120 tempusPL->
sublist(
"Default Stepper")
121 .
set<
double>(
"gamma", 0.7886751345948128);
123 else if (RKMethods[m] ==
"RK Trapezoidal Rule") {
124 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Use FSAL", 1);
126 else if (RKMethods[m] ==
"RK Crank-Nicolson") {
127 tempusPL->
sublist(
"Default Stepper").
set<
bool>(
"Use FSAL", 1);
129 tempusPL->
sublist(
"Default Stepper")
130 .
set(
"Stepper Type",
"RK Trapezoidal Rule");
132 else if (RKMethods[m] ==
"General DIRK") {
135 tableauPL->
set<std::string>(
136 "A",
"0.292893218813452 0; 0.707106781186548 0.292893218813452");
137 tableauPL->
set<std::string>(
"b",
"0.707106781186548 0.292893218813452");
138 tableauPL->
set<std::string>(
"c",
"0.292893218813452 1");
139 tableauPL->
set<
int>(
"order", 2);
140 tableauPL->
set<std::string>(
"bstar",
"");
141 tempusPL->
sublist(
"Default Stepper").
set(
"Tableau", *tableauPL);
147 Tempus::createIntegratorBasic<double>(tempusPL, model);
152 integrator->getStepper()->getValidParameters());
155 defaultPL->
remove(
"Description");
157 bool pass = haveSameValuesSorted(*stepperPL, *defaultPL,
true);
160 out <<
"stepperPL -------------- \n"
161 << *stepperPL << std::endl;
162 out <<
"defaultPL -------------- \n"
163 << *defaultPL << std::endl;
171 Tempus::createIntegratorBasic<double>(model, RKMethods[m]);
176 integrator->getStepper()->getValidParameters());
179 defaultPL->
remove(
"Description");
185 if (RKMethods[m] ==
"EDIRK 2 Stage Theta Method" ||
186 RKMethods[m] ==
"RK Trapezoidal Rule" ||
187 RKMethods[m] ==
"RK Crank-Nicolson") {
188 stepperPL->set<std::string>(
"Initial Condition Consistency",
190 stepperPL->remove(
"Default Solver");
191 defaultPL->
remove(
"Default Solver");
194 bool pass = haveSameValuesSorted(*stepperPL, *defaultPL,
true);
197 out <<
"stepperPL -------------- \n"
198 << *stepperPL << std::endl;
199 out <<
"defaultPL -------------- \n"
200 << *defaultPL << std::endl;
212 std::vector<std::string> options;
213 options.push_back(
"Default Parameters");
214 options.push_back(
"ICConsistency and Check");
216 for (
const auto& option : options) {
219 getParametersFromXmlFile(
"Tempus_DIRK_SinCos.xml");
231 sf->createStepper(
"SDIRK 2 Stage 2nd order");
232 stepper->setModel(model);
233 if (option ==
"ICConsistency and Check") {
234 stepper->setICConsistency(
"Consistent");
235 stepper->setICConsistencyCheck(
true);
237 stepper->initialize();
243 timeStepControl->setInitIndex(tscPL.
get<
int>(
"Initial Time Index"));
244 timeStepControl->setInitTime(tscPL.
get<
double>(
"Initial Time"));
245 timeStepControl->setFinalTime(tscPL.
get<
double>(
"Final Time"));
246 timeStepControl->setInitTimeStep(dt);
247 timeStepControl->initialize();
250 auto inArgsIC = model->getNominalValues();
254 icState->setTime(timeStepControl->getInitTime());
255 icState->setIndex(timeStepControl->getInitIndex());
256 icState->setTimeStep(0.0);
257 icState->setOrder(stepper->getOrder());
262 solutionHistory->setName(
"Forward States");
264 solutionHistory->setStorageLimit(2);
265 solutionHistory->addState(icState);
269 Tempus::createIntegratorBasic<double>();
270 integrator->setStepper(stepper);
271 integrator->setTimeStepControl(timeStepControl);
272 integrator->setSolutionHistory(solutionHistory);
274 integrator->initialize();
277 bool integratorStatus = integrator->advanceTime();
281 double time = integrator->getTime();
282 double timeFinal = pl->
sublist(
"Default Integrator")
284 .
get<
double>(
"Final Time");
290 model->getExactSolution(time).get_x();
294 Thyra::V_StVpStV(xdiff.
ptr(), 1.0, *x_exact, -1.0, *(x));
297 out <<
" Stepper = " << stepper->description() <<
" with " << option
299 out <<
" =========================" << std::endl;
300 out <<
" Exact solution : " << get_ele(*(x_exact), 0) <<
" "
301 << get_ele(*(x_exact), 1) << std::endl;
302 out <<
" Computed solution: " << get_ele(*(x), 0) <<
" "
303 << get_ele(*(x), 1) << std::endl;
304 out <<
" Difference : " << get_ele(*(xdiff), 0) <<
" "
305 << get_ele(*(xdiff), 1) << std::endl;
306 out <<
" =========================" << std::endl;
307 TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 0.841470, 1.0e-4);
308 TEST_FLOATING_EQUALITY(get_ele(*(x), 1), 0.540304, 1.0e-4);
317 std::vector<std::string> RKMethods;
318 RKMethods.push_back(
"EDIRK 2 Stage Theta Method");
319 RKMethods.push_back(
"RK Trapezoidal Rule");
321 for (std::vector<std::string>::size_type m = 0; m != RKMethods.size(); m++) {
327 auto stepper = sf->createStepper(RKMethods[m]);
328 stepper->setModel(model);
329 stepper->setUseFSAL(
false);
330 stepper->initialize();
334 timeStepControl->setInitTime(0.0);
335 timeStepControl->setFinalTime(1.0);
336 timeStepControl->setInitTimeStep(dt);
337 timeStepControl->initialize();
340 auto inArgsIC = model->getNominalValues();
344 icState->setTime(timeStepControl->getInitTime());
345 icState->setIndex(timeStepControl->getInitIndex());
346 icState->setTimeStep(0.0);
347 icState->setOrder(stepper->getOrder());
352 solutionHistory->setName(
"Forward States");
354 solutionHistory->setStorageLimit(2);
355 solutionHistory->addState(icState);
358 auto integrator = Tempus::createIntegratorBasic<double>();
359 integrator->setStepper(stepper);
360 integrator->setTimeStepControl(timeStepControl);
361 integrator->setSolutionHistory(solutionHistory);
362 integrator->initialize();
365 bool integratorStatus = integrator->advanceTime();
369 double time = integrator->getTime();
373 auto x = integrator->getX();
374 auto x_exact = model->getExactSolution(time).get_x();
378 Thyra::V_StVpStV(xdiff.
ptr(), 1.0, *x_exact, -1.0, *(x));
381 out <<
" Stepper = " << stepper->description() <<
"\n with "
382 <<
"useFSAL=false" << std::endl;
383 out <<
" =========================" << std::endl;
384 out <<
" Exact solution : " << get_ele(*(x_exact), 0) <<
" "
385 << get_ele(*(x_exact), 1) << std::endl;
386 out <<
" Computed solution: " << get_ele(*(x), 0) <<
" "
387 << get_ele(*(x), 1) << std::endl;
388 out <<
" Difference : " << get_ele(*(xdiff), 0) <<
" "
389 << get_ele(*(xdiff), 1) << std::endl;
390 out <<
" =========================" << std::endl;
391 if (RKMethods[m] ==
"EDIRK 2 Stage Theta Method") {
395 else if (RKMethods[m] ==
"RK Trapezoidal Rule") {
406 std::vector<std::string> RKMethods;
407 RKMethods.push_back(
"General DIRK");
408 RKMethods.push_back(
"RK Backward Euler");
409 RKMethods.push_back(
"DIRK 1 Stage Theta Method");
410 RKMethods.push_back(
"RK Implicit 1 Stage 1st order Radau IA");
411 RKMethods.push_back(
"RK Implicit Midpoint");
412 RKMethods.push_back(
"SDIRK 2 Stage 2nd order");
413 RKMethods.push_back(
"RK Implicit 2 Stage 2nd order Lobatto IIIB");
414 RKMethods.push_back(
"SDIRK 2 Stage 3rd order");
415 RKMethods.push_back(
"EDIRK 2 Stage 3rd order");
416 RKMethods.push_back(
"EDIRK 2 Stage Theta Method");
417 RKMethods.push_back(
"SDIRK 3 Stage 4th order");
418 RKMethods.push_back(
"SDIRK 5 Stage 4th order");
419 RKMethods.push_back(
"SDIRK 5 Stage 5th order");
420 RKMethods.push_back(
"SDIRK 2(1) Pair");
421 RKMethods.push_back(
"RK Trapezoidal Rule");
422 RKMethods.push_back(
"RK Crank-Nicolson");
423 RKMethods.push_back(
"SSPDIRK22");
424 RKMethods.push_back(
"SSPDIRK32");
425 RKMethods.push_back(
"SSPDIRK23");
426 RKMethods.push_back(
"SSPDIRK33");
427 RKMethods.push_back(
"SDIRK 3 Stage 2nd order");
429 std::vector<double> RKMethodErrors;
430 RKMethodErrors.push_back(2.52738e-05);
431 RKMethodErrors.push_back(0.0124201);
432 RKMethodErrors.push_back(5.20785e-05);
433 RKMethodErrors.push_back(0.0124201);
434 RKMethodErrors.push_back(5.20785e-05);
435 RKMethodErrors.push_back(2.52738e-05);
436 RKMethodErrors.push_back(5.20785e-05);
437 RKMethodErrors.push_back(1.40223e-06);
438 RKMethodErrors.push_back(2.17004e-07);
439 RKMethodErrors.push_back(5.20785e-05);
440 RKMethodErrors.push_back(6.41463e-08);
441 RKMethodErrors.push_back(3.30631e-10);
442 RKMethodErrors.push_back(1.35728e-11);
443 RKMethodErrors.push_back(0.0001041);
444 RKMethodErrors.push_back(5.20785e-05);
445 RKMethodErrors.push_back(5.20785e-05);
446 RKMethodErrors.push_back(1.30205e-05);
447 RKMethodErrors.push_back(5.7869767e-06);
448 RKMethodErrors.push_back(1.00713e-07);
449 RKMethodErrors.push_back(3.94916e-08);
450 RKMethodErrors.push_back(2.52738e-05);
454 for (std::vector<std::string>::size_type m = 0; m != RKMethods.size(); m++) {
455 std::string RKMethod = RKMethods[m];
456 std::replace(RKMethod.begin(), RKMethod.end(),
' ',
'_');
457 std::replace(RKMethod.begin(), RKMethod.end(),
'/',
'.');
460 std::vector<RCP<Thyra::VectorBase<double>>> solutions;
461 std::vector<RCP<Thyra::VectorBase<double>>> solutionsDot;
462 std::vector<double> StepSize;
463 std::vector<double> xErrorNorm;
464 std::vector<double> xDotErrorNorm;
466 const int nTimeStepSizes = 2;
469 for (
int n = 0; n < nTimeStepSizes; n++) {
472 getParametersFromXmlFile(
"Tempus_DIRK_SinCos.xml");
480 pl->
sublist(
"Default Stepper").
set(
"Stepper Type", RKMethods[m]);
481 if (RKMethods[m] ==
"DIRK 1 Stage Theta Method" ||
482 RKMethods[m] ==
"EDIRK 2 Stage Theta Method") {
483 pl->
sublist(
"Default Stepper").
set<
double>(
"theta", 0.5);
485 else if (RKMethods[m] ==
"SDIRK 2 Stage 2nd order") {
486 pl->
sublist(
"Default Stepper").
set(
"gamma", 0.2928932188134524);
488 else if (RKMethods[m] ==
"SDIRK 2 Stage 3rd order") {
490 .
set<std::string>(
"Gamma Type",
"3rd Order A-stable");
496 pl->
sublist(
"Default Integrator")
498 .
set(
"Initial Time Step", dt);
499 integrator = Tempus::createIntegratorBasic<double>(pl, model);
507 model->getNominalValues().get_x()->clone_v();
508 integrator->initializeSolutionHistory(0.0, x0);
511 bool integratorStatus = integrator->advanceTime();
515 time = integrator->getTime();
516 double timeFinal = pl->sublist(
"Default Integrator")
517 .sublist(
"Time Step Control")
518 .get<
double>(
"Final Time");
519 double tol = 100.0 * std::numeric_limits<double>::epsilon();
525 integrator->getSolutionHistory();
526 writeSolution(
"Tempus_" + RKMethod +
"_SinCos.dat", solutionHistory);
529 for (
int i = 0; i < solutionHistory->getNumStates(); i++) {
530 double time_i = (*solutionHistory)[i]->getTime();
533 model->getExactSolution(time_i).get_x()),
535 model->getExactSolution(time_i).get_x_dot()));
536 state->setTime((*solutionHistory)[i]->getTime());
537 solnHistExact->addState(state);
539 writeSolution(
"Tempus_" + RKMethod +
"_SinCos-Ref.dat", solnHistExact);
543 StepSize.push_back(dt);
544 auto solution = Thyra::createMember(model->get_x_space());
545 Thyra::copy(*(integrator->getX()), solution.ptr());
546 solutions.push_back(solution);
547 auto solutionDot = Thyra::createMember(model->get_x_space());
548 Thyra::copy(*(integrator->getXDot()), solutionDot.ptr());
549 solutionsDot.push_back(solutionDot);
550 if (n == nTimeStepSizes - 1) {
551 StepSize.push_back(0.0);
552 auto solutionExact = Thyra::createMember(model->get_x_space());
553 Thyra::copy(*(model->getExactSolution(time).get_x()),
554 solutionExact.ptr());
555 solutions.push_back(solutionExact);
556 auto solutionDotExact = Thyra::createMember(model->get_x_space());
557 Thyra::copy(*(model->getExactSolution(time).get_x_dot()),
558 solutionDotExact.ptr());
559 solutionsDot.push_back(solutionDotExact);
565 double xDotSlope = 0.0;
567 double order = stepper->getOrder();
569 StepSize, solutions, xErrorNorm, xSlope, solutionsDot,
570 xDotErrorNorm, xDotSlope, out);
584 std::vector<std::string> RKMethods;
585 RKMethods.push_back(
"SDIRK 2 Stage 2nd order");
587 std::string RKMethod = RKMethods[0];
588 std::replace(RKMethod.begin(), RKMethod.end(),
' ',
'_');
589 std::replace(RKMethod.begin(), RKMethod.end(),
'/',
'.');
592 std::vector<RCP<Thyra::VectorBase<double>>> solutions;
593 std::vector<RCP<Thyra::VectorBase<double>>> solutionsDot;
594 std::vector<double> StepSize;
595 std::vector<double> xErrorNorm;
596 std::vector<double> xDotErrorNorm;
598 const int nTimeStepSizes = 3;
601 for (
int n = 0; n < nTimeStepSizes; n++) {
604 getParametersFromXmlFile(
"Tempus_DIRK_VanDerPol.xml");
612 pl->
sublist(
"Default Stepper").
set(
"Stepper Type", RKMethods[0]);
613 pl->
sublist(
"Default Stepper").
set(
"gamma", 0.2928932188134524);
617 if (n == nTimeStepSizes - 1) dt /= 10.0;
620 pl->
sublist(
"Default Integrator")
622 .
set(
"Initial Time Step", dt);
623 integrator = Tempus::createIntegratorBasic<double>(pl, model);
626 bool integratorStatus = integrator->advanceTime();
630 time = integrator->getTime();
631 double timeFinal = pl->sublist(
"Default Integrator")
632 .sublist(
"Time Step Control")
633 .get<
double>(
"Final Time");
634 double tol = 100.0 * std::numeric_limits<double>::epsilon();
638 StepSize.push_back(dt);
639 auto solution = Thyra::createMember(model->get_x_space());
640 Thyra::copy(*(integrator->getX()), solution.ptr());
641 solutions.push_back(solution);
642 auto solutionDot = Thyra::createMember(model->get_x_space());
643 Thyra::copy(*(integrator->getXDot()), solutionDot.ptr());
644 solutionsDot.push_back(solutionDot);
648 if ((n == 0) || (n == nTimeStepSizes - 1)) {
649 std::string fname =
"Tempus_" + RKMethod +
"_VanDerPol-Ref.dat";
650 if (n == 0) fname =
"Tempus_" + RKMethod +
"_VanDerPol.dat";
652 integrator->getSolutionHistory();
659 double xDotSlope = 0.0;
661 double order = stepper->getOrder();
664 solutionsDot.clear();
666 writeOrderError(
"Tempus_" + RKMethod +
"_VanDerPol-Error.dat", stepper,
667 StepSize, solutions, xErrorNorm, xSlope, solutionsDot,
668 xDotErrorNorm, xDotSlope, out);
682 std::vector<std::string> IntegratorList;
683 IntegratorList.push_back(
"Embedded_Integrator_PID");
684 IntegratorList.push_back(
"Embedded_Integrator");
687 const int refIstep = 217;
689 for (
auto integratorChoice : IntegratorList) {
690 out <<
"Using Integrator: " << integratorChoice <<
" !!!" << std::endl;
694 getParametersFromXmlFile(
"Tempus_DIRK_VanDerPol.xml");
702 pl->
set(
"Integrator Name", integratorChoice);
706 Tempus::createIntegratorBasic<double>(pl, model);
708 const std::string RKMethod_ =
709 pl->sublist(integratorChoice).
get<std::string>(
"Stepper Name");
712 bool integratorStatus = integrator->advanceTime();
716 double time = integrator->getTime();
717 double timeFinal = pl->sublist(integratorChoice)
718 .sublist(
"Time Step Control")
719 .
get<
double>(
"Final Time");
725 Thyra::set_ele(0, -1.5484458614405929, xref.
ptr());
726 Thyra::set_ele(1, 1.0181127316101317, xref.
ptr());
730 Thyra::V_StVpStV(xdiff.ptr(), 1.0, *xref, -1.0, *(x));
731 const double L2norm = Thyra::norm_2(*xdiff);
734 if (integratorChoice ==
"Embedded_Integrator_PID") {
735 const double absTol = pl->sublist(integratorChoice)
736 .sublist(
"Time Step Control")
737 .get<
double>(
"Maximum Absolute Error");
738 const double relTol = pl->sublist(integratorChoice)
739 .sublist(
"Time Step Control")
740 .get<
double>(
"Maximum Relative Error");
746 integrator->getSolutionHistory()->getCurrentState()->getIndex();
751 TEST_FLOATING_EQUALITY(std::log10(L2norm), std::log10(absTol), 0.3);
752 TEST_FLOATING_EQUALITY(std::log10(L2norm), std::log10(relTol), 0.3);
758 std::ofstream ftmp(
"Tempus_" + integratorChoice + RKMethod_ +
761 integrator->getSolutionHistory();
762 int nStates = solutionHistory->getNumStates();
764 for (
int i = 0; i < nStates; i++) {
766 double time_i = solutionState->getTime();
769 ftmp << time_i <<
" " << Thyra::get_ele(*(x_plot), 0) <<
" "
770 << 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)
#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)
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
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.