hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
include
hpfem
core
error.hpp
Go to the documentation of this file.
1
#pragma once
5
#include <stdexcept>
6
#include <string>
7
8
namespace
hpfem
{
9
10
class
Error
:
public
std::runtime_error {
11
public
:
12
using
std::runtime_error::runtime_error;
13
};
14
15
class
InvalidArgument
:
public
Error
{
16
public
:
17
using
Error::Error;
18
};
19
20
class
NotImplemented
:
public
Error
{
21
public
:
22
using
Error::Error;
23
};
24
27
class
AnisotropicUnsupported
:
public
NotImplemented
{
28
public
:
29
using
NotImplemented::NotImplemented;
30
};
31
32
[[noreturn]]
void
assertion_failed
(
const
char
* expr,
const
char
* file,
int
line,
33
const
std::string& msg);
34
35
}
// namespace hpfem
36
37
#if defined(HPFEM_ENABLE_ASSERTS)
38
// Positive test on purpose: `if (!(a && b))` makes clang-tidy suggest De Morgan at
39
// every call site; `if (cond) {} else` does not.
40
#define HPFEM_ASSERT(cond, msg) \
41
do { \
42
if (cond) { \
43
} else { \
44
::hpfem::assertion_failed(#cond, __FILE__, __LINE__, (msg)); \
45
} \
46
} while (false)
47
#else
48
#define HPFEM_ASSERT(cond, msg) \
49
do { \
50
} while (false)
51
#endif
hpfem::AnisotropicUnsupported
Definition
error.hpp:27
hpfem::Error
Definition
error.hpp:10
hpfem::InvalidArgument
Definition
error.hpp:15
hpfem::NotImplemented
Definition
error.hpp:20
hpfem
Definition
axisymmetric_estimator.hpp:39
hpfem::assertion_failed
void assertion_failed(const char *expr, const char *file, int line, const std::string &msg)
Generated by
1.9.8