Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
18 namespace Tempus {
19 
20 template <class Scalar>
39  : public Teuchos::Describable,
40  public Teuchos::VerboseObject<Tempus::StepperState<Scalar> >
41 
42 {
43  public:
45  StepperState(std::string name = "Default") : stepperName_(name) {}
46 
49  {
52  return ss_out;
53  }
54 
56  virtual void copy(const Teuchos::RCP<const StepperState<Scalar> >& ss)
57  {
58  stepperName_ = ss->stepperName_;
59  }
60 
62 
63  virtual std::string description() const
64  {
65  return "Tempus::StepperState - '" + stepperName_ + "'";
66  }
67 
68  virtual void describe(Teuchos::FancyOStream& out,
69  const Teuchos::EVerbosityLevel /* verbLevel */) const
70  {
71  auto l_out = Teuchos::fancyOStream(out.getOStream());
72  Teuchos::OSTab ostab(*l_out, 2, this->description());
73  l_out->setOutputToRootOnly(0);
74 
75  *l_out << "\n--- " << this->description() << " ---" << std::endl;
76  }
78 
79  std::string stepperName_;
80 };
81 } // namespace Tempus
82 #endif // Tempus_StepperState_hpp
virtual std::string description() const
StepperState is a simple class to hold state information about the stepper.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel) const
virtual void copy(const Teuchos::RCP< const StepperState< Scalar > > &ss)
This is a deep copy.
RCP< std::basic_ostream< char_type, traits_type > > getOStream()
virtual Teuchos::RCP< StepperState< Scalar > > clone() const
Clone copy constructor.
std::string stepperName_
Name of the creating Stepper.
StepperState(std::string name="Default")
Constructor.