TransFlow  0.1.0
A transient pipeline flow simulation library
errors.hpp
1 #pragma once
2 
3 #include <stdexcept>
4 
5 namespace utils
6 {
7  class physics_error: public std::range_error
8  {
9  using std::range_error::range_error; // inherit constructors
10  };
11 
13  {
14  using physics_error::physics_error; // inherit constructors
15  };
16 
18  {
19  using physics_error::physics_error; // inherit constructors
20  };
21 
22  class no_convergence_error: public std::runtime_error
23  {
24  using runtime_error::runtime_error; // inherit constructors
25  unsigned long long m_nIterations;
26 
27  public:
28  no_convergence_error(const std::string& __arg, const unsigned long long nIterations):
29  runtime_error(__arg), // inherited constructor
30  m_nIterations(nIterations)
31  {}
32 
33  unsigned long long nIterations() const { return m_nIterations; }
34  };
35 
36  class linalg_error: public std::runtime_error
37  {
38  using runtime_error::runtime_error; // inherit constructors
39  };
40 
42  {
43  using linalg_error::linalg_error; // inherit constructors
44  };
45 }
utils::no_convergence_error
Definition: errors.hpp:22
utils::no_solution_found
Definition: errors.hpp:41
utils::linalg_error
Definition: errors.hpp:36
utils::pressure_range_error
Definition: errors.hpp:17
utils::physics_error
Definition: errors.hpp:7
utils::temperature_range_error
Definition: errors.hpp:12
utils
Definition: utils.hpp:10