GooseEPM v0.11.0
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1
7#ifndef GOOSEEPM_CONFIG_H
8#define GOOSEEPM_CONFIG_H
9
13#define Q(x) #x
14#define QUOTE(x) Q(x)
15
16#define GOOSEEPM_WARNING_IMPL(message, file, line, function) \
17 std::cout << std::string(file) + ":" + std::to_string(line) + " (" + std::string(function) + \
18 ")" + ": " message ") \n\t";
19
20#define GOOSEEPM_ASSERT_IMPL(expr, assertion, file, line, function) \
21 if (!(expr)) { \
22 throw assertion( \
23 std::string(file) + ":" + std::to_string(line) + " (" + std::string(function) + ")" + \
24 ": assertion failed (" #expr ") \n\t" \
25 ); \
26 }
27
49#ifdef GOOSEEPM_ENABLE_ASSERT
50#define GOOSEEPM_ASSERT(expr, assertion) \
51 GOOSEEPM_ASSERT_IMPL(expr, assertion, __FILE__, __LINE__, __FUNCTION__)
52#else
53#define GOOSEEPM_ASSERT(expr, assertion)
54#endif
55
63#define GOOSEEPM_REQUIRE(expr, assertion) \
64 GOOSEEPM_ASSERT_IMPL(expr, assertion, __FILE__, __LINE__, __FUNCTION__)
65
74#define GOOSEEPM_WIP_ASSERT(expr, assertion) \
75 GOOSEEPM_ASSERT_IMPL(expr, assertion, __FILE__, __LINE__, __FUNCTION__)
76
86#ifdef GOOSEEPM_DISABLE_WARNING
87#define GOOSEEPM_WARNING(message)
88#else
89#define GOOSEEPM_WARNING(message) GOOSEEPM_WARNING_IMPL(message, __FILE__, __LINE__, __FUNCTION__)
90#endif
91
101#ifdef GOOSEEPM_ENABLE_WARNING_PYTHON
102#define GOOSEEPM_WARNING_PYTHON(message) \
103 GOOSEEPM_WARNING_IMPL(message, __FILE__, __LINE__, __FUNCTION__)
104#else
105#define GOOSEEPM_WARNING_PYTHON(message)
106#endif
107
111namespace GooseEPM {
112
119namespace array_type {
120
121#ifdef GOOSEEPM_USE_XTENSOR_PYTHON
122
126template <typename T, size_t N>
127using tensor = xt::pytensor<T, N>;
128
129#else
130
134template <typename T, size_t N>
135using tensor = xt::xtensor<T, N>;
136
137#endif
138
139} // namespace array_type
140
141} // namespace GooseEPM
142
143#endif
xt::xtensor< T, N > tensor
Fixed (static) rank array.
Definition config.h:135
Elasto-plastic model.
Definition config.h:111