The full rewrite of mean_field into something maintainable is progressing. dimensions is mostly done, discritization (domain, blocks, and fields) is done, and eos is progressing quickly
26 lines
659 B
C++
26 lines
659 B
C++
#include "serif/utils/misc/finite.hpp"
|
|
#include <limits>
|
|
|
|
enum class [[maybe_unused]] TestErrorCode {
|
|
NotFinite
|
|
};
|
|
|
|
namespace {
|
|
class test_exception : public std::runtime_error {
|
|
public:
|
|
test_exception(TestErrorCode error_code, const std::string& message)
|
|
: std::runtime_error(message), m_error_code(error_code) {}
|
|
|
|
TestErrorCode error_code() const noexcept {
|
|
return m_error_code;
|
|
}
|
|
private:
|
|
TestErrorCode m_error_code;
|
|
};
|
|
}
|
|
|
|
int main() {
|
|
double a = std::numeric_limits<double>::infinity();
|
|
|
|
serif::utils::misc::validate_finite<test_exception>(a, TestErrorCode::NotFinite);
|
|
} |