Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_UnitTest_ERK_ForwardEuler.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 
12 
13 #include "../TestModels/SinCosModel.hpp"
14 
15 namespace Tempus_Unit_Test {
16 
17 using Teuchos::RCP;
18 using Teuchos::rcp;
19 using Teuchos::rcp_const_cast;
20 using Teuchos::rcp_dynamic_cast;
21 
22 
23 // ************************************************************
24 // ************************************************************
25 TEUCHOS_UNIT_TEST(ERK_ForwardEuler, Default_Construction)
26 {
27  auto stepper = rcp(new Tempus::StepperERK_ForwardEuler<double>());
29 
30  // Test stepper properties.
31  TEUCHOS_ASSERT(stepper->getOrder() == 1);
32 }
33 
34 
35 // ************************************************************
36 // ************************************************************
37 TEUCHOS_UNIT_TEST(ERK_ForwardEuler, StepperFactory_Construction)
38 {
39  auto model = rcp(new Tempus_Test::SinCosModel<double>());
40  testFactoryConstruction("RK Forward Euler", model);
41 }
42 
43 
44 // ************************************************************
45 // ************************************************************
46 TEUCHOS_UNIT_TEST(ERK_ForwardEuler, AppAction)
47 {
48  auto stepper = rcp(new Tempus::StepperERK_ForwardEuler<double>());
49  auto model = rcp(new Tempus_Test::SinCosModel<double>());
50  testRKAppAction(stepper, model, out, success);
51 }
52 
53 
54 } // 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 testExplicitRKAccessorsFullConstruction(const RCP< Tempus::StepperExplicitRK< double > > &stepper)
Unit test utility for ExplicitRK Stepper construction and accessors.
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)
Forward Euler Runge-Kutta Butcher Tableau.