Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_SolutionStateMetaData_decl.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_SolutionStateMetaData_decl_hpp
11 #define Tempus_SolutionStateMetaData_decl_hpp
12 
13 // Teuchos
14 #include "Teuchos_VerboseObject.hpp"
15 #include "Teuchos_Describable.hpp"
16 // Tempus
17 #include "Tempus_config.hpp"
18 #include "Tempus_Types.hpp"
19 
20 namespace Tempus {
21 
39 template <class Scalar>
41  : public Teuchos::Describable,
42  public Teuchos::VerboseObject<Tempus::SolutionStateMetaData<Scalar> > {
43  public:
46 
48  SolutionStateMetaData(const Scalar time, const int iStep, const Scalar dt,
49  const Scalar errorAbs, const Scalar errorRel,
50  const Scalar errorRelNm1, const Scalar errorRelNm2,
51  const int order, const int nFailures,
52  const int nRunningFailures,
53  const int nConsecutiveFailures, const Scalar tolRel,
54  const Scalar tolAbs, const Scalar xNormL2,
55  const Scalar dxNormL2Rel, const Scalar dxNormL2Abs,
56  const bool computeNorms, const Status solutionStatus,
57  const bool output, const bool outputScreen,
58  const bool isSynced, const bool isInterpolated,
59  const Scalar accuracy);
60 
63 
66 
68  void copy(const Teuchos::RCP<const SolutionStateMetaData<Scalar> >& ssmd);
69 
72 
74 
75  Scalar getTime() const { return time_; }
76  int getIStep() const { return iStep_; }
77  Scalar getDt() const { return dt_; }
78  Scalar getErrorAbs() const { return errorAbs_; }
79  Scalar getErrorRel() const { return errorRel_; }
80  Scalar getErrorRelNm1() const { return errorRelNm1_; }
81  Scalar getErrorRelNm2() const { return errorRelNm2_; }
82  Scalar getOrder() const { return order_; }
83  int getNFailures() const { return nFailures_; }
84  int getNRunningFailures() const { return nRunningFailures_; }
86  Scalar getTolAbs() const { return tolAbs_; }
87  Scalar getTolRel() const { return tolRel_; }
88  Scalar getXNormL2() const { return xNormL2_; }
89  Scalar getDxNormL2Abs() const { return dxNormL2Abs_; }
90  Scalar getDxNormL2Rel() const { return dxNormL2Rel_; }
91  bool getComputeNorms() const { return computeNorms_; }
93  bool getOutput() const { return output_; }
94  bool getOutputScreen() const { return outputScreen_; }
95  bool getIsSynced() const { return isSynced_; }
96  bool getIsInterpolated() const { return isInterpolated_; }
97  Scalar getAccuracy() const { return accuracy_; }
98 
99  void setTime(Scalar time) { time_ = time; }
100  void setIStep(int iStep) { iStep_ = iStep; }
101  void setDt(Scalar dt) { dt_ = dt; }
102  void setErrorAbs(Scalar errorAbs) { errorAbs_ = errorAbs; }
103  void setErrorRel(Scalar errorRel)
104  {
107  errorRel_ = errorRel;
108  }
109  void setErrorRelNm1(Scalar errorRelNm1) { errorRelNm1_ = errorRelNm1; }
110  void setErrorRelNm2(Scalar errorRelNm2) { errorRelNm2_ = errorRelNm2; }
111  void setOrder(Scalar order) { order_ = order; }
112  void setNFailures(int nFailures) { nFailures_ = nFailures; }
113  void setNRunningFailures(int nFailures) { nRunningFailures_ = nFailures; }
114  void setNConsecutiveFailures(int nConsecutiveFailures)
115  {
116  nConsecutiveFailures_ = nConsecutiveFailures;
117  }
118  void setTolRel(Scalar tolRel) { tolRel_ = tolRel; }
119  void setTolAbs(Scalar tolAbs) { tolAbs_ = tolAbs; }
120  void setXNormL2(Scalar xNormL2) { xNormL2_ = xNormL2; }
121  void setDxNormL2Rel(Scalar dxNormL2Rel) { dxNormL2Rel_ = dxNormL2Rel; }
122  void setDxNormL2Abs(Scalar dxNormL2Abs) { dxNormL2Abs_ = dxNormL2Abs; }
123  void setComputeNorms(bool computeNorms) { computeNorms_ = computeNorms; }
124  void setSolutionStatus(Status solutionStatus)
125  {
126  solutionStatus_ = solutionStatus;
127  }
128  void setOutput(bool output) { output_ = output; }
129  void setOutputScreen(bool outputScreen) { outputScreen_ = outputScreen; }
130  void setIsSynced(bool isSynced) { isSynced_ = isSynced; }
131  void setIsInterpolated(bool isInterpolated)
132  {
133  isInterpolated_ = isInterpolated;
134  }
135  void setAccuracy(Scalar accuracy) { accuracy_ = accuracy; }
137 
139 
140  virtual std::string description() const;
141  virtual void describe(Teuchos::FancyOStream& out,
142  const Teuchos::EVerbosityLevel verbLevel) const;
144 
145  protected:
146  Scalar time_;
147  int iStep_;
148  Scalar dt_;
149  Scalar errorAbs_;
150  Scalar errorRel_;
151  Scalar errorRelNm1_;
152  Scalar errorRelNm2_;
153  Scalar order_;
157  Scalar tolRel_;
158  Scalar tolAbs_;
159  Scalar xNormL2_;
160  Scalar dxNormL2Rel_;
161  Scalar dxNormL2Abs_;
163  bool computeNorms_;
165 
174  bool output_;
176 
180  bool isSynced_;
182  Scalar accuracy_;
184 };
185 
186 } // namespace Tempus
187 
188 #endif // Tempus_SolutionStateMetaData_decl_hpp
Teuchos::RCP< SolutionStateMetaData< Scalar > > clone() const
Clone constructor.
Status solutionStatus_
The solutionStatus is used to indicate.
int nFailures_
Total number of stepper failures.
void copy(const Teuchos::RCP< const SolutionStateMetaData< Scalar > > &ssmd)
This is a deep copy.
int nRunningFailures_
Total number of running stepper failures.
void setNConsecutiveFailures(int nConsecutiveFailures)
Scalar errorRelNm2_
Relative local truncation error (@ t_{n-2})
int iStep_
Time step index for this solution.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Scalar errorRelNm1_
Relative local truncation error (@ t_{n-1})
Status
Status for the Integrator, the Stepper and the SolutionState.
bool output_
SolutionState should be or has been outputted.
int nConsecutiveFailures_
Consecutive number of stepper failures.
Scalar errorRel_
Relative local truncation error (@ t_n)
Scalar dt_
Time step for this solution.
Scalar accuracy_
Interpolation accuracy of solution.
bool computeNorms_
flag to compute norms of solution
bool isSynced_
True - all of soln (x, xDot, xDotDot) is at the same time level. False - solution is at different tim...
Scalar errorAbs_
Absolute local truncation error (@ t_n)