9 #include "Teuchos_UnitTestHarness.hpp"
10 #include "Teuchos_XMLParameterListHelpers.hpp"
11 #include "Teuchos_TimeMonitor.hpp"
13 #include "Tempus_IntegratorBasic.hpp"
15 #include "../TestModels/SinCosModel.hpp"
19 namespace Tempus_Test {
22 using Teuchos::ParameterList;
23 using Teuchos::sublist;
24 using Teuchos::getParametersFromXmlFile;
34 RCP<ParameterList> pl = getParametersFromXmlFile(
"Tempus_default.xml");
40 RCP<ParameterList> tempusPL = sublist(pl,
"Tempus",
true);
41 RCP<Tempus::IntegratorBasic<double> > integrator =
42 Tempus::integratorBasic<double>(tempusPL, model);
45 RCP<ParameterList> testPL = integrator->getTempusParameterList();
50 RCP<ParameterList> referencePL =
51 getParametersFromXmlFile(
"Tempus_IntegratorBasic_ref.xml");
53 bool pass = haveSameValues(*testPL, *referencePL,
true);
55 std::cout << std::endl;
56 std::cout <<
"testPL -------------- \n" << *testPL << std::endl;
57 std::cout <<
"referencePL -------------- \n" << *referencePL << std::endl;
68 RCP<Tempus::IntegratorBasic<double> > integrator =
69 Tempus::integratorBasic<double>();
74 RCP<ParameterList> tempusPL = integrator->getTempusParameterList();
76 tempusPL->sublist(
"Default Integrator").set(
"Stepper Name",
"Demo Stepper");
77 RCP<ParameterList> stepperPL = Teuchos::parameterList();
78 stepperPL->set(
"Stepper Type",
"Forward Euler");
79 tempusPL->set(
"Demo Stepper", *stepperPL);
81 integrator->setTempusParameterList(tempusPL);
85 integrator->setStepper(model);
88 integrator->initialize();
91 RCP<ParameterList> testPL = integrator->getTempusParameterList();
96 RCP<ParameterList> referencePL =
97 getParametersFromXmlFile(
"Tempus_IntegratorBasic_ref2.xml");
99 bool pass = haveSameValues(*testPL, *referencePL,
true);
101 std::cout << std::endl;
102 std::cout <<
"testPL -------------- \n" << *testPL << std::endl;
103 std::cout <<
"referencePL -------------- \n" << *referencePL << std::endl;
Sine-Cosine model problem from Rythmos. This is a canonical Sine-Cosine differential equation with a...
TEUCHOS_UNIT_TEST(BackwardEuler, SinCos_ASA)
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
Solution state for integrators and steppers. SolutionState contains the metadata for solutions and th...