Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_UnitTest_SDIRK_ImplicitMidpoint.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 
18 
19 #include "../TestModels/SinCosModel.hpp"
20 #include "../TestModels/VanDerPolModel.hpp"
21 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
22 
23 #include <fstream>
24 #include <vector>
25 
26 namespace Tempus_Unit_Test {
27 
28 using Teuchos::RCP;
29 using Teuchos::rcp;
30 using Teuchos::rcp_const_cast;
31 using Teuchos::rcp_dynamic_cast;
32 using Teuchos::ParameterList;
33 using Teuchos::sublist;
34 using Teuchos::getParametersFromXmlFile;
35 
37 
38 
39 // ************************************************************
40 // ************************************************************
41 TEUCHOS_UNIT_TEST(SDIRK_ImplicitMidpoint, Default_Construction)
42 {
43  auto stepper = rcp(new Tempus::StepperSDIRK_ImplicitMidpoint<double>());
45 
46  // Test stepper properties.
47  TEUCHOS_ASSERT(stepper->getOrder() == 2);
48 }
49 
50 
51 // ************************************************************
52 // ************************************************************
53 TEUCHOS_UNIT_TEST(SDIRK_ImplicitMidpoint, StepperFactory_Construction)
54 {
55  auto model = rcp(new Tempus_Test::SinCosModel<double>());
56  testFactoryConstruction("RK Implicit Midpoint", model);
57 }
58 
59 
60 // ************************************************************
61 // ************************************************************
62 TEUCHOS_UNIT_TEST(SDIRK_ImplicitMidpoint, AppAction)
63 {
64  auto stepper = rcp(new Tempus::StepperSDIRK_ImplicitMidpoint<double>());
65  auto model = rcp(new Tempus_Test::SinCosModel<double>());
66  testRKAppAction(stepper, model, out, success);
67 }
68 
69 
70 } // 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.