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: Copyright (2017) Sandia Corporation
4//
5// Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6// ****************************************************************************
7// @HEADER
8
9#ifndef Tempus_StepperState_hpp
10#define Tempus_StepperState_hpp
11
12#include "Teuchos_VerboseObject.hpp"
13#include "Teuchos_Describable.hpp"
14#include <string>
15
16#include "Tempus_config.hpp"
17
18namespace Tempus {
19
20template<class Scalar>
38 public Teuchos::Describable,
39 public Teuchos::VerboseObject<Tempus::StepperState<Scalar> >
40
41{
42public:
44 StepperState(std::string name = "Default") : stepperName_(name){}
45
47 virtual Teuchos::RCP<StepperState<Scalar> > clone() const
48 {
49 Teuchos::RCP<StepperState<Scalar> > ss_out =
50 Teuchos::rcp(new StepperState<Scalar> (this->stepperName_));
51 return ss_out;
52 }
53
55 virtual void copy(const Teuchos::RCP<const StepperState<Scalar> >& ss)
56 {
57 stepperName_ = ss->stepperName_;
58 }
59
61
62 virtual std::string description() const
63 {
64 return "Tempus::StepperState - '" + stepperName_ + "'";
65 }
66
67 virtual void describe(Teuchos::FancyOStream & out,
68 const Teuchos::EVerbosityLevel /* verbLevel */) const
69 {
70 auto l_out = Teuchos::fancyOStream( out.getOStream() );
71 Teuchos::OSTab ostab(*l_out,2, this->description());
72 l_out->setOutputToRootOnly(0);
73
74 *l_out << "\n--- " << this->description() << " ---" << std::endl;
75 }
77
78 std::string stepperName_;
79
80};
81} // namespace Tempus
82#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.