Tempus  Version of the Day
Time Integration
Tempus_UnitTest_SDIRK_5Stage4thOrder.cpp
Go to the documentation of this file.
1 // @HEADER
2 // ****************************************************************************
3 // Tempus: Copyright (2017) Sandia Corporation
4 //
5 // Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6 // ****************************************************************************
7 // @HEADER
8 
9 #include "Teuchos_UnitTestHarness.hpp"
10 #include "Teuchos_XMLParameterListHelpers.hpp"
11 #include "Teuchos_TimeMonitor.hpp"
12 #include "Teuchos_DefaultComm.hpp"
13 
14 #include "Thyra_VectorStdOps.hpp"
15 
17 
18 #include "../TestModels/SinCosModel.hpp"
19 #include "../TestModels/VanDerPolModel.hpp"
20 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
21 
22 #include <fstream>
23 #include <vector>
24 
25 namespace Tempus_Unit_Test {
26 
27 using Teuchos::RCP;
28 using Teuchos::rcp;
29 using Teuchos::rcp_const_cast;
30 using Teuchos::rcp_dynamic_cast;
31 using Teuchos::ParameterList;
32 using Teuchos::sublist;
33 using Teuchos::getParametersFromXmlFile;
34 
35 
36 // ************************************************************
37 // ************************************************************
38 TEUCHOS_UNIT_TEST(SDIRK_5Stage4thOrder, Default_Construction)
39 {
40  auto stepper = rcp(new Tempus::StepperSDIRK_5Stage4thOrder<double>());
42 
43  // Test stepper properties.
44  TEUCHOS_ASSERT(stepper->getOrder() == 4);
45 }
46 
47 
48 // ************************************************************
49 // ************************************************************
50 TEUCHOS_UNIT_TEST(SDIRK_5Stage4thOrder, StepperFactory_Construction)
51 {
52  auto model = rcp(new Tempus_Test::SinCosModel<double>());
53  testFactoryConstruction("SDIRK 5 Stage 4th order", model);
54 }
55 
56 
57 // ************************************************************
58 // ************************************************************
59 TEUCHOS_UNIT_TEST(SDIRK_5Stage4thOrder, AppAction)
60 {
61  auto stepper = rcp(new Tempus::StepperSDIRK_5Stage4thOrder<double>());
62  auto model = rcp(new Tempus_Test::SinCosModel<double>());
63  testRKAppAction(stepper, model, out, success);
64 }
65 
66 
67 } // namespace Tempus_Test
void testRKAppAction(const Teuchos::RCP< Tempus::StepperRKBase< double > > &stepper, const Teuchos::RCP< const Thyra::ModelEvaluator< double > > &model, Teuchos::FancyOStream &out, bool &success)
Unit test utility for Stepper RK AppAction.
void testFactoryConstruction(std::string stepperType, const Teuchos::RCP< const Thyra::ModelEvaluator< double > > &model)
Unit test utility for Stepper construction through StepperFactory.
Sine-Cosine model problem from Rythmos. This is a canonical Sine-Cosine differential equation with a...
TEUCHOS_UNIT_TEST(BackwardEuler, Default_Construction)
void testDIRKAccessorsFullConstruction(const RCP< Tempus::StepperDIRK< double > > &stepper)
Unit test utility for ExplicitRK Stepper construction and accessors.