27 #ifndef SCHNEK_GRIDCHECK_H_ 28 #define SCHNEK_GRIDCHECK_H_ 32 #include "../util/logger.hpp" 41 static const IndexType &check(
53 static const IndexType &check(
67 static bool errorFlag;
69 static IndexType offending;
71 static const IndexType check(
77 static bool getErrorFlag()
82 static int getErrorInfo()
87 static IndexType getOffending()
107 for (
int i=0; i<rank; ++i)
109 assert(pos[i]>=low[i]);
110 assert(pos[i]<=high[i]);
133 for (
int i=0; i<rank; ++i)
135 if (pos_copy[i]<low[i]) {
136 SCHNEK_TRACE_ERR(1,
"schnek::GridDebugCheck index out of range (dim="<<i<<
"): index=" <<pos_copy[i]<<
" lo="<<low[i])
138 GridDebugCheck<rank>::errorFlag =
true;
139 GridDebugCheck<rank>::errorInfo = -i;
140 GridDebugCheck<rank>::offending = pos;
142 if (pos_copy[i] > high[i])
144 SCHNEK_TRACE_ERR(1,
"schnek::GridDebugCheck index out of range (dim="<<i<<
"): index=" <<pos_copy[i]<<
" hi="<<high[i])
145 pos_copy[i] = high[i];
146 GridDebugCheck<rank>::errorFlag =
true;
147 GridDebugCheck<rank>::errorInfo = i;
148 GridDebugCheck<rank>::offending = pos;
156 #endif // SCHNEK_GRIDCHECK_H_ Definition: gridcheck.hpp:63
Definition: gridcheck.hpp:50
Definition: gridcheck.hpp:38
#define SCHNEK_TRACE_ERR(i, x)
Definition: logger.hpp:72