Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_SolutionStateMetaData_impl.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_SolutionStateMetaData_impl_hpp
10 #define Tempus_SolutionStateMetaData_impl_hpp
11 
12 #include "Tempus_config.hpp"
13 
14 namespace Tempus {
15 
16 // SolutionStateMetaData definitions:
17 template<class Scalar>
19  :time_ (0.0),
20  iStep_ (0),
21  dt_ (0.0),
22  errorAbs_ (0.0),
23  errorRel_ (0.0),
24  order_ (1),
25  nFailures_ (0),
26  nRunningFailures_(0),
27  nConsecutiveFailures_(0),
28  solutionStatus_(WORKING),
29  output_ (false),
30  outputScreen_ (false),
31  isSynced_ (true),
32  isInterpolated_(false),
33  accuracy_ (0.0)
34 {}
35 
36 template<class Scalar>
38  const Scalar time,
39  const int iStep,
40  const Scalar dt,
41  const Scalar errorAbs,
42  const Scalar errorRel,
43  const int order,
44  const int nFailures,
45  const int nRunningFailures,
46  const int nConsecutiveFailures,
47  const Status solutionStatus,
48  const bool output,
49  const bool outputScreen,
50  const bool isSynced,
51  const bool isInterpolated,
52  const Scalar accuracy)
53  :time_ (time),
54  iStep_ (iStep),
55  dt_ (dt),
56  errorAbs_ (errorAbs),
57  errorRel_ (errorRel),
58  order_ (order),
59  nFailures_ (nFailures),
60  nRunningFailures_(nRunningFailures),
61  nConsecutiveFailures_(nConsecutiveFailures),
62  solutionStatus_(solutionStatus),
63  output_ (output),
64  outputScreen_ (outputScreen),
65  isSynced_ (isSynced),
66  isInterpolated_(isInterpolated),
67  accuracy_ (accuracy)
68 {}
69 
70 template<class Scalar>
72  :time_ (ssmd.time_),
73  iStep_ (ssmd.iStep_),
74  dt_ (ssmd.dt_),
75  errorAbs_ (ssmd.errorAbs_),
76  errorRel_ (ssmd.errorRel_),
77  order_ (ssmd.order_),
78  nFailures_ (ssmd.nFailures_),
79  nRunningFailures_(ssmd.nRunningFailures_),
80  nConsecutiveFailures_(ssmd.nConsecutiveFailures_),
81  solutionStatus_(ssmd.solutionStatus_),
82  output_ (ssmd.output_),
83  outputScreen_ (ssmd.outputScreen_),
84  isSynced_ (ssmd.isSynced_),
85  isInterpolated_(ssmd.isInterpolated_),
86  accuracy_ (ssmd.accuracy_)
87 {}
88 
89 
90 template<class Scalar>
91 Teuchos::RCP<SolutionStateMetaData<Scalar> > SolutionStateMetaData<Scalar>::clone() const
92 {
93  Teuchos::RCP<SolutionStateMetaData<Scalar> > md =
95  time_,
96  iStep_,
97  dt_,
98  errorAbs_,
99  errorRel_,
100  order_,
101  nFailures_,
102  nRunningFailures_,
103  nConsecutiveFailures_,
104  solutionStatus_,
105  output_,
106  outputScreen_,
107  isSynced_,
108  isInterpolated_,
109  accuracy_));
110 
111  return md;
112 }
113 
114 
115 template<class Scalar>
117 copy(const Teuchos::RCP<const SolutionStateMetaData<Scalar> >& ssmd)
118 {
119  time_ = ssmd->time_;
120  iStep_ = ssmd->iStep_;
121  dt_ = ssmd->dt_;
122  errorAbs_ = ssmd->errorAbs_;
123  errorRel_ = ssmd->errorRel_;
124  order_ = ssmd->order_;
125  nFailures_ = ssmd->nFailures_;
126  nRunningFailures_= ssmd->nRunningFailures_;
127  nConsecutiveFailures_ = ssmd->nConsecutiveFailures_;
128  solutionStatus_ = ssmd->solutionStatus_;
129  output_ = ssmd->output_;
130  outputScreen_ = ssmd->outputScreen_;
131  isSynced_ = ssmd->isSynced_;
132  isInterpolated_ = ssmd->isInterpolated_;
133  accuracy_ = ssmd->accuracy_;
134 }
135 
136 
137 template<class Scalar>
139 {
140  std::string name = "Tempus::SolutionStateMetaData";
141  return(name);
142 }
143 
144 
145 template<class Scalar>
147  Teuchos::FancyOStream &out,
148  const Teuchos::EVerbosityLevel verbLevel) const
149 {
150  if (verbLevel == Teuchos::VERB_EXTREME) {
151  out << description() << "::describe:" << std::endl
152  << "time = " << time_ << std::endl
153  << "iStep = " << iStep_ << std::endl
154  << "dt = " << dt_ << std::endl
155  << "errorAbs = " << errorAbs_ << std::endl
156  << "errorRel = " << errorRel_ << std::endl
157  << "order = " << order_ << std::endl
158  << "nFailures = " << nFailures_ << std::endl
159  << "nRunningFailures= " << nRunningFailures_<< std::endl
160  << "nConsecutiveFailures = " << nConsecutiveFailures_ << std::endl
161  << "solutionStatus = " << toString(solutionStatus_) << std::endl
162  << "output = " << output_ << std::endl
163  << "outputScreen = " << outputScreen_ << std::endl
164  << "isSynced = " << isSynced_ << std::endl
165  << "isInterpolated = " << isInterpolated_ << std::endl
166  << "accuracy = " << accuracy_ << std::endl;
167  }
168 }
169 
170 } // namespace Tempus
171 #endif // Tempus_SolutionStateMetaData_impl_hpp
Teuchos::RCP< SolutionStateMetaData< Scalar > > clone() const
Clone constructor.
const std::string toString(const Status status)
Convert Status to string.
void copy(const Teuchos::RCP< const SolutionStateMetaData< Scalar > > &ssmd)
This is a deep copy.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Status
Status for the Integrator, the Stepper and the SolutionState.