9 #include "Teuchos_UnitTestHarness.hpp"
10 #include "Teuchos_XMLParameterListHelpers.hpp"
11 #include "Teuchos_TimeMonitor.hpp"
12 #include "Teuchos_DefaultComm.hpp"
14 #include "Thyra_VectorStdOps.hpp"
19 #include "../TestModels/SinCosModel.hpp"
20 #include "../TestModels/VanDerPolModel.hpp"
21 #include "../TestModels/HarmonicOscillatorModel.hpp"
22 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
27 namespace Tempus_Unit_Test {
31 using Teuchos::rcp_const_cast;
32 using Teuchos::rcp_dynamic_cast;
33 using Teuchos::ParameterList;
34 using Teuchos::sublist;
35 using Teuchos::getParametersFromXmlFile;
48 stepper->setModel(model);
49 stepper->initialize();
50 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
54 auto solver = rcp(
new Thyra::NOXNonlinearSolver());
57 bool useFSAL = stepper->getUseFSALDefault();
58 std::string ICConsistency = stepper->getICConsistencyDefault();
59 bool ICConsistencyCheck = stepper->getICConsistencyCheckDefault();
60 bool zeroInitialGuess = stepper->getZeroInitialGuess();
61 std::string schemeName =
"Newmark Beta User Defined";
69 stepper->setSolver(solver); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
70 stepper->setUseFSAL(useFSAL); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
71 stepper->setICConsistency(ICConsistency); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
72 stepper->setICConsistencyCheck(ICConsistencyCheck); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
73 stepper->setZeroInitialGuess(zeroInitialGuess); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
75 stepper->setSchemeName(schemeName); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
76 stepper->setBeta(beta); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
77 stepper->setGamma(gamma); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
78 stepper->setAlphaF(alpha_f); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
79 stepper->setAlphaM(alpha_m); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
84 model, Teuchos::null, solver, useFSAL,
85 ICConsistency, ICConsistencyCheck, zeroInitialGuess,
86 schemeName, beta, gamma, alpha_f, alpha_m));
87 TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
90 TEUCHOS_ASSERT(stepper->getOrder() == 2);
void testFactoryConstruction(std::string stepperType, const Teuchos::RCP< const Thyra::ModelEvaluator< double > > &model)
Unit test utility for Stepper construction through StepperFactory.
Teuchos::RCP< Teuchos::ParameterList > defaultSolverParameters()
Returns the default solver ParameterList for implicit Steppers.
Consider the ODE: where is a constant, is a constant damping parameter, is a constant forcing par...
TEUCHOS_UNIT_TEST(BackwardEuler, Default_Construction)