Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Tempus_StepperState.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_StepperState_hpp
11#define Tempus_StepperState_hpp
12
13#include "Teuchos_VerboseObject.hpp"
14#include "Teuchos_Describable.hpp"
15#include <string>
16
17#include "Tempus_config.hpp"
18
19namespace Tempus {
20
21template <class Scalar>
40 : public Teuchos::Describable,
41 public Teuchos::VerboseObject<Tempus::StepperState<Scalar> >
42
43{
44 public:
46 StepperState(std::string name = "Default") : stepperName_(name) {}
47
49 virtual Teuchos::RCP<StepperState<Scalar> > clone() const
50 {
51 Teuchos::RCP<StepperState<Scalar> > ss_out =
52 Teuchos::rcp(new StepperState<Scalar>(this->stepperName_));
53 return ss_out;
54 }
55
57 virtual void copy(const Teuchos::RCP<const StepperState<Scalar> >& ss)
58 {
59 stepperName_ = ss->stepperName_;
60 }
61
63
64 virtual std::string description() const
65 {
66 return "Tempus::StepperState - '" + stepperName_ + "'";
67 }
68
69 virtual void describe(Teuchos::FancyOStream& out,
70 const Teuchos::EVerbosityLevel /* verbLevel */) const
71 {
72 auto l_out = Teuchos::fancyOStream(out.getOStream());
73 Teuchos::OSTab ostab(*l_out, 2, this->description());
74 l_out->setOutputToRootOnly(0);
75
76 *l_out << "\n--- " << this->description() << " ---" << std::endl;
77 }
79
80 std::string stepperName_;
81};
82} // namespace Tempus
83#endif // Tempus_StepperState_hpp
StepperState is a simple class to hold state information about the stepper.
virtual Teuchos::RCP< StepperState< Scalar > > clone() const
Clone copy constructor.
std::string stepperName_
Name of the creating Stepper.
virtual void copy(const Teuchos::RCP< const StepperState< Scalar > > &ss)
This is a deep copy.
virtual std::string description() const
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel) const
StepperState(std::string name="Default")
Constructor.