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 
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  tolRel_ (1.0e-02),
29  tolAbs_ (0.0),
30  xNormL2_ (0.0),
31  dxNormL2Rel_ (0.0),
32  dxNormL2Abs_ (0.0),
33  computeNorms_ (false),
34  solutionStatus_(WORKING),
35  output_ (false),
36  outputScreen_ (false),
37  isSynced_ (true),
38  isInterpolated_(false),
39  accuracy_ (0.0)
40 {}
41 
42 template<class Scalar>
44  const Scalar time,
45  const int iStep,
46  const Scalar dt,
47  const Scalar errorAbs,
48  const Scalar errorRel,
49  const int order,
50  const int nFailures,
51  const int nRunningFailures,
52  const int nConsecutiveFailures,
53  const Scalar tolRel,
54  const Scalar tolAbs,
55  const Scalar xNormL2,
56  const Scalar dxNormL2Rel,
57  const Scalar dxNormL2Abs,
58  const bool computeNorms,
59  const Status solutionStatus,
60  const bool output,
61  const bool outputScreen,
62  const bool isSynced,
63  const bool isInterpolated,
64  const Scalar accuracy)
65  :time_ (time),
66  iStep_ (iStep),
67  dt_ (dt),
68  errorAbs_ (errorAbs),
69  errorRel_ (errorRel),
70  order_ (order),
71  nFailures_ (nFailures),
72  nRunningFailures_(nRunningFailures),
73  nConsecutiveFailures_(nConsecutiveFailures),
74  tolRel_ (tolRel),
75  tolAbs_ (tolAbs),
76  xNormL2_ (xNormL2),
77  dxNormL2Rel_ (dxNormL2Rel),
78  dxNormL2Abs_ (dxNormL2Abs),
79  computeNorms_ (computeNorms),
80  solutionStatus_(solutionStatus),
81  output_ (output),
82  outputScreen_ (outputScreen),
83  isSynced_ (isSynced),
84  isInterpolated_(isInterpolated),
85  accuracy_ (accuracy)
86 {}
87 
88 template<class Scalar>
90  :time_ (ssmd.time_),
91  iStep_ (ssmd.iStep_),
92  dt_ (ssmd.dt_),
93  errorAbs_ (ssmd.errorAbs_),
94  errorRel_ (ssmd.errorRel_),
95  order_ (ssmd.order_),
96  nFailures_ (ssmd.nFailures_),
97  nRunningFailures_(ssmd.nRunningFailures_),
98  nConsecutiveFailures_(ssmd.nConsecutiveFailures_),
99  tolRel_ (ssmd.tolRel_),
100  tolAbs_ (ssmd.tolAbs_),
101  dxNormL2Rel_ (ssmd.dxNormL2Rel_),
102  dxNormL2Abs_ (ssmd.dxNormL2Abs_),
103  computeNorms_ (ssmd.computeNorms_),
104  solutionStatus_(ssmd.solutionStatus_),
105  output_ (ssmd.output_),
106  outputScreen_ (ssmd.outputScreen_),
107  isSynced_ (ssmd.isSynced_),
108  isInterpolated_(ssmd.isInterpolated_),
109  accuracy_ (ssmd.accuracy_)
110 {}
111 
112 
113 template<class Scalar>
114 Teuchos::RCP<SolutionStateMetaData<Scalar> > SolutionStateMetaData<Scalar>::clone() const
115 {
116  Teuchos::RCP<SolutionStateMetaData<Scalar> > md =
118  time_,
119  iStep_,
120  dt_,
121  errorAbs_,
122  errorRel_,
123  order_,
124  nFailures_,
125  nRunningFailures_,
126  nConsecutiveFailures_,
127  tolRel_,
128  tolAbs_,
129  xNormL2_,
130  dxNormL2Rel_,
131  dxNormL2Abs_,
132  computeNorms_,
133  solutionStatus_,
134  output_,
135  outputScreen_,
136  isSynced_,
137  isInterpolated_,
138  accuracy_));
139 
140  return md;
141 }
142 
143 
144 template<class Scalar>
146 copy(const Teuchos::RCP<const SolutionStateMetaData<Scalar> >& ssmd)
147 {
148  time_ = ssmd->time_;
149  iStep_ = ssmd->iStep_;
150  dt_ = ssmd->dt_;
151  errorAbs_ = ssmd->errorAbs_;
152  errorRel_ = ssmd->errorRel_;
153  order_ = ssmd->order_;
154  nFailures_ = ssmd->nFailures_;
155  nRunningFailures_= ssmd->nRunningFailures_;
156  nConsecutiveFailures_ = ssmd->nConsecutiveFailures_;
157  tolRel_ = ssmd->tolRel_,
158  tolAbs_ = ssmd->tolAbs_,
159  xNormL2_ = ssmd->xNormL2_,
160  dxNormL2Rel_ = ssmd->dxNormL2Rel_,
161  dxNormL2Abs_ = ssmd->dxNormL2Abs_,
162  computeNorms_ = ssmd->computeNorms_,
163  solutionStatus_ = ssmd->solutionStatus_;
164  output_ = ssmd->output_;
165  outputScreen_ = ssmd->outputScreen_;
166  isSynced_ = ssmd->isSynced_;
167  isInterpolated_ = ssmd->isInterpolated_;
168  accuracy_ = ssmd->accuracy_;
169 }
170 
171 
172 template<class Scalar>
174 {
175  std::string name = "Tempus::SolutionStateMetaData";
176  return(name);
177 }
178 
179 
180 template<class Scalar>
182  Teuchos::FancyOStream &out,
183  const Teuchos::EVerbosityLevel verbLevel) const
184 {
185  if (verbLevel == Teuchos::VERB_EXTREME) {
186  out << description() << "::describe:" << std::endl
187  << "time = " << time_ << std::endl
188  << "iStep = " << iStep_ << std::endl
189  << "dt = " << dt_ << std::endl
190  << "errorAbs = " << errorAbs_ << std::endl
191  << "errorRel = " << errorRel_ << std::endl
192  << "order = " << order_ << std::endl
193  << "nFailures = " << nFailures_ << std::endl
194  << "nRunningFailures = " << nRunningFailures_<< std::endl
195  << "nConsecutiveFailures = " << nConsecutiveFailures_ << std::endl
196  << "tolRel = " << tolRel_ << std::endl
197  << "tolAbs = " << tolAbs_ << std::endl
198  << "xNormL2 = " << xNormL2_ << std::endl
199  << "dxNormL2Rel = " << dxNormL2Rel_ << std::endl
200  << "dxNormL2Abs = " << dxNormL2Abs_ << std::endl
201  << "computeNorms = " << computeNorms_ << std::endl
202  << "solutionStatus = " << toString(solutionStatus_) << std::endl
203  << "output = " << output_ << std::endl
204  << "outputScreen = " << outputScreen_ << std::endl
205  << "isSynced = " << isSynced_ << std::endl
206  << "isInterpolated = " << isInterpolated_ << std::endl
207  << "accuracy = " << accuracy_ << std::endl;
208  }
209 }
210 
211 } // namespace Tempus
212 #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.