Loading...
Searching...
No Matches
Go to the documentation of this file.
8#include <vcTestAsserts.hpp>
11#define LSTEST_ASSERT_VALID_LS(levelSet, NumericType, D) \
13 auto check = viennals::Check<NumericType, D>(levelSet); \
15 if (check.isValid()) { \
16 std::cout << "SUCCESS" << std::endl; \
18 throw std::runtime_error( \
19 std::string(__FILE__) + std::string(":") + \
20 std::to_string(__LINE__) + std::string(" in ") + \
21 std::string(__PRETTY_FUNCTION__) + "\n" + check.what()); \
25#define LSTEST_ASSERT_MESH_CORNERS(mesh, expected, D, gridDelta) \
28 auto &nodes = mesh->getNodes(); \
29 double tolerance = 0.01 * (gridDelta); \
30 for (const auto &ex : expected) { \
32 for (const auto &n : nodes) { \
34 for (int i = 0; i < D; ++i) \
35 distSq += (n[i] - ex[i]) * (n[i] - ex[i]); \
36 if (distSq < tolerance) { \
42 std::stringstream ss; \
43 ss << "Corner not found: ("; \
44 for (int i = 0; i < D; ++i) \
45 ss << ex[i] << (i < D - 1 ? ", " : ""); \
47 throw std::runtime_error(ss.str()); \
50 std::cout << "All expected corners found!" << std::endl; \
51 } catch (const std::exception &e) { \
52 throw std::runtime_error( \
53 std::string(__FILE__) + std::string(":") + \
54 std::to_string(__LINE__) + std::string(" in ") + \
55 std::string(__PRETTY_FUNCTION__) + "\n" + e.what()); \