Tempus
Version of the Day
Time Integration
Toggle main menu visibility
Loading...
Searching...
No Matches
unit_test
Tempus_UnitTest_Utils.hpp
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
#ifndef Tempus_UnitTest_Utils_hpp
10
#define Tempus_UnitTest_Utils_hpp
11
12
13
#include "Tempus_config.hpp"
14
15
#include "Teuchos_UnitTestHarness.hpp"
16
17
#include "Thyra_VectorStdOps.hpp"
18
#include "NOX_Thyra.H"
19
20
#include "
Tempus_NumericalUtils.hpp
"
21
#include "Tempus_StepperFactory.hpp"
22
#include "Tempus_SolutionHistory.hpp"
23
#include "Tempus_IntegratorBasic.hpp"
24
25
#include "../TestModels/SinCosModel.hpp"
26
27
28
namespace
Tempus_Unit_Test
{
29
30
using
Teuchos::RCP;
31
using
Teuchos::rcp;
32
using
Teuchos::rcp_const_cast;
33
using
Teuchos::rcp_dynamic_cast;
34
using
Teuchos::ParameterList;
35
36
using
Thyra::get_ele;
37
38
using
Tempus::StepperFactory;
39
42
void
testFactoryConstruction
(std::string stepperType,
43
const
Teuchos::RCP<
const
Thyra::ModelEvaluator<double>
>& model)
44
{
45
RCP<StepperFactory<double> > sf = Teuchos::rcp(
new
StepperFactory<double>
());
46
47
// Test using stepperType
48
// Passing in model.
49
auto
stepper = sf->createStepper(stepperType, model);
50
TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
51
// With setting model.
52
stepper = sf->createStepper(stepperType);
53
stepper->setModel(model);
54
stepper->initialize();
55
TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
56
57
// Test using ParameterList.
58
// Passing in model.
59
auto
stepperPL = rcp_const_cast<ParameterList>(stepper->getValidParameters());
60
stepper = sf->createStepper(stepperPL, model);
61
TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
62
// With setting model.
63
stepper = sf->createStepper(stepperPL);
64
stepper->setModel(model);
65
stepper->initialize();
66
TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized());
67
}
68
69
70
}
// namespace Tempus_Unit_Test
71
#endif
// Tempus_UnitTest_Utils_hpp
Tempus_NumericalUtils.hpp
Tempus::StepperFactory
Stepper factory.
Definition
Tempus_StepperFactory_decl.hpp:25
Thyra::ModelEvaluator
Tempus_Unit_Test
Definition
Tempus_UnitTest_BackwardEuler.cpp:22
Tempus_Unit_Test::testFactoryConstruction
void testFactoryConstruction(std::string stepperType, const Teuchos::RCP< const Thyra::ModelEvaluator< double > > &model)
Unit test utility for Stepper construction through StepperFactory.
Definition
Tempus_UnitTest_Utils.hpp:42
Generated by
1.17.0