Tempus
Version of the Day
Time Integration
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
Tempus_TimeStepControlStrategy.hpp
Go to the documentation of this file.
1
//@HEADER
2
// *****************************************************************************
3
// Tempus: Time Integration and Sensitivity Analysis Package
4
//
5
// Copyright 2017 NTESS and the Tempus contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
//@HEADER
9
10
#ifndef Tempus_TimeStepControlStrategy_hpp
11
#define Tempus_TimeStepControlStrategy_hpp
12
13
#include "Tempus_config.hpp"
14
#include "Tempus_SolutionHistory.hpp"
15
16
namespace
Tempus {
17
18
template
<
class
Scalar>
19
class
TimeStepControl;
20
31
template
<
class
Scalar>
32
class
TimeStepControlStrategy
:
virtual
public
Teuchos::Describable
,
33
virtual
public
Teuchos::VerboseObject
<
34
Tempus::TimeStepControlStrategy<Scalar> > {
35
public
:
37
TimeStepControlStrategy
()
38
:
strategyType_
(
"Base Strategy"
),
39
stepType_
(
"Constant"
),
40
name_
(
"Base Strategy"
),
41
isInitialized_
(false)
42
{
43
}
44
46
virtual
~TimeStepControlStrategy
() {}
47
49
virtual
void
setNextTimeStep
(
const
TimeStepControl<Scalar>
&
/* tsc */
,
50
Teuchos::RCP
<
SolutionHistory<Scalar>
>
/* sh */
,
51
Status
&
/* integratorStatus */
)
52
{
53
}
54
55
virtual
void
initialize
()
const
{
isInitialized_
=
true
; }
56
virtual
bool
isInitialized
() {
return
isInitialized_
; }
57
virtual
void
checkInitialized
()
58
{
59
if
(!
isInitialized_
) {
60
this->
describe
(*(this->
getOStream
()),
Teuchos::VERB_MEDIUM
);
61
TEUCHOS_TEST_FOR_EXCEPTION
(
62
!
isInitialized_
, std::logic_error,
63
"Error - "
<< this->
description
() <<
" is not initialized!"
);
64
}
65
}
66
67
virtual
void
setName
(std::string s) {
name_
= s; }
68
69
virtual
std::string
getStrategyType
()
const
{
return
strategyType_
; }
70
virtual
std::string
getStepType
()
const
{
return
stepType_
; }
71
virtual
std::string
getName
()
const
{
return
name_
; }
72
74
virtual
Teuchos::RCP<const Teuchos::ParameterList>
getValidParameters
()
const
75
{
76
return
Teuchos::parameterList();
77
}
78
79
protected
:
80
virtual
void
setStrategyType
(std::string s) {
strategyType_
= s; }
81
virtual
void
setStepType
(std::string s) {
stepType_
= s; }
82
83
std::string
strategyType_
;
84
std::string
stepType_
;
85
std::string
name_
;
86
mutable
bool
isInitialized_
;
87
};
88
89
}
// namespace Tempus
90
#endif // Tempus_TimeStepControlStrategy_hpp
Tempus::TimeStepControlStrategy::initialize
virtual void initialize() const
Definition:
Tempus_TimeStepControlStrategy.hpp:55
Tempus::TimeStepControlStrategy::getValidParameters
virtual Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return ParameterList with current values.
Definition:
Tempus_TimeStepControlStrategy.hpp:74
TEUCHOS_TEST_FOR_EXCEPTION
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Tempus::TimeStepControlStrategy::checkInitialized
virtual void checkInitialized()
Definition:
Tempus_TimeStepControlStrategy.hpp:57
Tempus::TimeStepControlStrategy::setNextTimeStep
virtual void setNextTimeStep(const TimeStepControl< Scalar > &, Teuchos::RCP< SolutionHistory< Scalar > >, Status &)
Set the time step size.
Definition:
Tempus_TimeStepControlStrategy.hpp:49
Tempus::TimeStepControlStrategy::getStrategyType
virtual std::string getStrategyType() const
Definition:
Tempus_TimeStepControlStrategy.hpp:69
Teuchos::VERB_MEDIUM
Tempus::TimeStepControlStrategy::getName
virtual std::string getName() const
Definition:
Tempus_TimeStepControlStrategy.hpp:71
Teuchos::VerboseObject
Tempus::TimeStepControlStrategy::isInitialized
virtual bool isInitialized()
Definition:
Tempus_TimeStepControlStrategy.hpp:56
Tempus::Status
Status
Status for the Integrator, the Stepper and the SolutionState.
Definition:
Tempus_Types.hpp:18
Tempus::TimeStepControlStrategy::setStepType
virtual void setStepType(std::string s)
Definition:
Tempus_TimeStepControlStrategy.hpp:81
Tempus::TimeStepControlStrategy::isInitialized_
bool isInitialized_
Bool if strategy is initialized.
Definition:
Tempus_TimeStepControlStrategy.hpp:86
Teuchos::Describable::description
virtual std::string description() const
Tempus::TimeStepControl
TimeStepControl manages the time step size. There several mechanisms that effect the time step size a...
Definition:
Tempus_Integrator.hpp:30
Tempus::TimeStepControlStrategy::setName
virtual void setName(std::string s)
Definition:
Tempus_TimeStepControlStrategy.hpp:67
Tempus::SolutionHistory
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
Definition:
Tempus_Integrator.hpp:28
Tempus::TimeStepControlStrategy::strategyType_
std::string strategyType_
Strategy type.
Definition:
Tempus_TimeStepControlStrategy.hpp:83
Tempus::TimeStepControlStrategy::stepType_
std::string stepType_
Step Type - "Constant" or "Variable".
Definition:
Tempus_TimeStepControlStrategy.hpp:84
Tempus::TimeStepControlStrategy::~TimeStepControlStrategy
virtual ~TimeStepControlStrategy()
Destructor.
Definition:
Tempus_TimeStepControlStrategy.hpp:46
Teuchos::Describable
Tempus::TimeStepControlStrategy::TimeStepControlStrategy
TimeStepControlStrategy()
Constructor.
Definition:
Tempus_TimeStepControlStrategy.hpp:37
Teuchos::RCP
Tempus::TimeStepControlStrategy::setStrategyType
virtual void setStrategyType(std::string s)
Definition:
Tempus_TimeStepControlStrategy.hpp:80
Tempus::TimeStepControlStrategy
TimeStepControlStrategy class for TimeStepControl.
Definition:
Tempus_TimeStepControlStrategy.hpp:32
Tempus::TimeStepControlStrategy::getStepType
virtual std::string getStepType() const
Definition:
Tempus_TimeStepControlStrategy.hpp:70
Tempus::TimeStepControlStrategy::name_
std::string name_
Name of strategy.
Definition:
Tempus_TimeStepControlStrategy.hpp:85
Teuchos::VerboseObjectBase::getOStream
virtual RCP< FancyOStream > getOStream() const
Teuchos::Describable::describe
virtual void describe(FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
Generated on Thu Dec 26 2024 09:25:16 for Tempus by
1.8.5