Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_UnitTest_SDIRK_2Stage3rdOrder.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 
10 
11 namespace Tempus_Unit_Test {
12 
14 using Teuchos::RCP;
15 using Teuchos::rcp;
16 using Teuchos::rcp_const_cast;
17 using Teuchos::rcp_dynamic_cast;
18 using Teuchos::sublist;
19 
20 // ************************************************************
21 // ************************************************************
22 TEUCHOS_UNIT_TEST(SDIRK_2Stage3rdOrder, Default_Construction)
23 {
26 
27  // Test stepper properties.
28  TEUCHOS_ASSERT(stepper->getOrder() == 3);
29  std::string gammaType = "3rd Order A-stable";
30  TEUCHOS_ASSERT(stepper->getGammaType() == gammaType);
31  double gamma = 0.7886751345948128;
32  TEUCHOS_ASSERT(stepper->getGamma() == gamma);
33  stepper->setGammaType(gammaType);
34  stepper->initialize();
35  TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
36  stepper->setGamma(gamma);
37  stepper->initialize();
38  TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
39 }
40 
41 // ************************************************************
42 // ************************************************************
43 TEUCHOS_UNIT_TEST(SDIRK_2Stage3rdOrder, StepperFactory_Construction)
44 {
45  auto model = rcp(new Tempus_Test::SinCosModel<double>());
46  testFactoryConstruction("SDIRK 2 Stage 3rd order", model);
47 }
48 
49 // ************************************************************
50 // ************************************************************
51 TEUCHOS_UNIT_TEST(SDIRK_2Stage3rdOrder, AppAction)
52 {
54  auto model = rcp(new Tempus_Test::SinCosModel<double>());
55  testRKAppAction(stepper, model, out, success);
56 }
57 
58 } // namespace Tempus_Unit_Test
void testDIRKAccessorsFullConstruction(const RCP< Tempus::StepperDIRK< 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...
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.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
TEUCHOS_UNIT_TEST(BackwardEuler, Default_Construction)
#define TEUCHOS_ASSERT(assertion_test)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)