Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_UnitTest_DIRK_1StageTheta.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 
11 
12 
13 namespace Tempus_Unit_Test {
14 
15 using Teuchos::RCP;
16 using Teuchos::rcp;
17 using Teuchos::rcp_const_cast;
18 using Teuchos::rcp_dynamic_cast;
20 using Teuchos::sublist;
21 
22 
23 // ************************************************************
24 // ************************************************************
25 TEUCHOS_UNIT_TEST(DIRK_1StageTheta, Default_Construction)
26 {
27  auto stepper = rcp(new Tempus::StepperDIRK_1StageTheta<double>());
29 
30  // Test stepper properties.
31  TEUCHOS_ASSERT(stepper->getOrder() == 2);
32  double theta = 0.5;
33  TEUCHOS_ASSERT(stepper->getTheta() == theta);
34  stepper->setTheta(theta); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
35 
36 }
37 
38 
39 // ************************************************************
40 // ************************************************************
41 TEUCHOS_UNIT_TEST(DIRK_1StageTheta, StepperFactory_Construction)
42 {
43  auto model = rcp(new Tempus_Test::SinCosModel<double>());
44  testFactoryConstruction("DIRK 1 Stage Theta Method", model);
45 }
46 
47 
48 // ************************************************************
49 // ************************************************************
50 TEUCHOS_UNIT_TEST(DIRK_1StageTheta, AppAction)
51 {
52  auto stepper = rcp(new Tempus::StepperDIRK_1StageTheta<double>());
53  auto model = rcp(new Tempus_Test::SinCosModel<double>());
54  testRKAppAction(stepper, model, out, success);
55 }
56 
57 
58 } // namespace Tempus_Unit_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_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
TEUCHOS_UNIT_TEST(BackwardEuler, Default_Construction)
void testDIRKAccessorsFullConstruction(const RCP< Tempus::StepperDIRK< double > > &stepper)
Unit test utility for ExplicitRK Stepper construction and accessors.
#define TEUCHOS_ASSERT(assertion_test)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)