Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_Types.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_Types_hpp
11 #define Tempus_Types_hpp
12 
13 #include "Tempus_config.hpp"
14 
15 namespace Tempus {
16 
18 enum Status { PASSED,
21 
23 inline const std::string toString(const Status status)
24 {
25  std::string s = "Invalid Status!";
26  switch (status) {
27  case PASSED: {
28  s = "PASSED";
29  break;
30  }
31  case FAILED: {
32  s = "FAILED";
33  break;
34  }
35  case WORKING: {
36  s = "WORKING";
37  break;
38  }
39  default: {
40  s = "Invalid Status!";
41  break;
42  }
43  }
44  TEUCHOS_TEST_FOR_EXCEPTION(s == "Invalid Status!", std::logic_error,
45  "Error - Invalid status = " << status << "\n");
46  return s;
47 }
48 
49 } // namespace Tempus
50 #endif // Tempus_Types_hpp
const std::string toString(const Status status)
Convert Status to string.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Status
Status for the Integrator, the Stepper and the SolutionState.