54 BOOST_TEST(bg::get<0>(v) == 1);
55 BOOST_TEST(bg::get<1>(v) == 2);
56 BOOST_TEST(bg::get<2>(v) == 3);
59 BOOST_TEST(bg::get<0>(v) == 1);
60 BOOST_TEST(bg::get<1>(v) == 5);
61 BOOST_TEST(bg::get<2>(v) == 1);
71 BOOST_TEST((bg::get<0, 0>(e)) == 1.0);
72 BOOST_TEST((bg::get<0, 1>(e)) == 2.0);
73 BOOST_TEST((bg::get<0, 2>(e)) == 0.0);
74 BOOST_TEST((bg::get<1, 0>(e)) == 3.0);
75 BOOST_TEST((bg::get<1, 1>(e)) == 4.0);
76 BOOST_TEST((bg::get<1, 2>(e)) == 0.0);
93 BOOST_TEST(vertices.
size() == refs.size());
97 [](
const auto &lhs,
const auto &rhs) {
98 return precice::math::equals(rawToEigen(lhs), rawToEigen(rhs));
106 auto & v1 = mesh.
createVertex(Eigen::Vector3d(0, 0, 0));
107 auto & v2 = mesh.
createVertex(Eigen::Vector3d(0, 1, 0));
108 auto & v3 = mesh.
createVertex(Eigen::Vector3d(1, 0, 0));
109 auto & v4 = mesh.
createVertex(Eigen::Vector3d(1, 1, 0));
110 auto & v5 = mesh.
createVertex(Eigen::Vector3d(0.2, 0.2, 0));
116 BOOST_TEST(bg::comparable_distance(v1, v2) > 0.5);
117 BOOST_TEST(bg::comparable_distance(v1, v1) < 0.01);
118 BOOST_TEST(bg::comparable_distance(e1, v2) < 0.01);
119 BOOST_TEST(bg::comparable_distance(e1, v3) > 0.2);
120 BOOST_TEST(bg::comparable_distance(t, v3) < 0.1);
121 BOOST_TEST(bg::comparable_distance(t, v4) > 0.2);
122 BOOST_TEST(bg::comparable_distance(t, v5) < 0.01);
129 auto & lv1 = mesh.
createVertex(Eigen::Vector3d(-1, 1, 0.1));
130 auto & lv2 = mesh.
createVertex(Eigen::Vector3d(0, -1, 0));
131 auto & lv3 = mesh.
createVertex(Eigen::Vector3d(-2, 0, -0.1));
137 auto &rv1 = mesh.
createVertex(Eigen::Vector3d(0, 1, 0.1));
138 auto &rv2 = mesh.
createVertex(Eigen::Vector3d(2, 0, -0.1));
139 auto &rv3 = mesh.
createVertex(Eigen::Vector3d(1, -1, 0));
145 auto &v1 = mesh.
createVertex(Eigen::Vector3d(-2, 1, 0));
146 auto &v2 = mesh.
createVertex(Eigen::Vector3d(2, -1, 0));
149 auto lt_v1 = bg::comparable_distance(lt, v1);
150 auto lt_v2 = bg::comparable_distance(lt, v2);
152 auto rt_v1 = bg::comparable_distance(rt, v1);
153 auto rt_v3 = bg::comparable_distance(rt, v3);
156 BOOST_TEST(lt_v2 > 0);
157 BOOST_TEST(rt_v1 > 1);
158 BOOST_TEST(rt_v3 > 0);
178 BOOST_TEST_MESSAGE(
"Left Triangle:" << lt);
179 BOOST_TEST_MESSAGE(
"Right Triangle:" << rt);
181 auto &lv = mesh.
createVertex(Eigen::Vector3d(.25, .25, 0));
182 auto &rv = mesh.
createVertex(Eigen::Vector3d(.75, .75, 0));
184 auto lv_lt = bg::comparable_distance(lv, lt);
185 auto lv_rt = bg::comparable_distance(lv, rt);
189 auto rv_lt = bg::comparable_distance(rv, lt);
190 auto rv_rt = bg::comparable_distance(rv, rt);
199 auto & v1 = mesh.
createVertex(Eigen::Vector3d(0, 1, 0));
200 auto & v2 = mesh.
createVertex(Eigen::Vector3d(1, 1, 1));
201 auto & v3 = mesh.
createVertex(Eigen::Vector3d(0, 0, 1));
202 auto & v4 = mesh.
createVertex(Eigen::Vector3d(0, 1, 1));
203 auto & v5 = mesh.
createVertex(Eigen::Vector3d(1, 0, 0));
209 auto t_v4 = bg::comparable_distance(t, v4);
210 auto v4_t = bg::comparable_distance(v4, t);
211 BOOST_TEST(t_v4 > 0.01);
212 BOOST_TEST(v4_t > 0.01);
213 BOOST_TEST(v4_t == t_v4);
215 auto t_v5 = bg::comparable_distance(t, v5);
216 auto v5_t = bg::comparable_distance(v5, t);
217 BOOST_TEST(t_v5 > 0.01);
218 BOOST_TEST(v5_t > 0.01);
219 BOOST_TEST(v5_t == t_v5);
221 BOOST_TEST(v4_t < t_v5);
229 auto & v1 = mesh.
createVertex(Eigen::Vector3d(0, 1, 0));
230 auto & v2 = mesh.
createVertex(Eigen::Vector3d(1, 1, 1));
231 auto & v3 = mesh.
createVertex(Eigen::Vector3d(0, 0, 1));
236 auto box = bg::return_envelope<precice::query::RTreeBox>(t);
237 auto min = box.min_corner();
238 BOOST_TEST(min[0] == 0.0);
239 BOOST_TEST(min[1] == 0.0);
240 BOOST_TEST(min[2] == 0.0);
241 auto max = box.max_corner();
242 BOOST_TEST(max[0] == 1.0);
243 BOOST_TEST(max[1] == 1.0);
244 BOOST_TEST(max[2] == 1.0);
252 auto & v1 = mesh.
createVertex(Eigen::Vector3d(0, 1, 0));
253 auto & v2 = mesh.
createVertex(Eigen::Vector3d(1, 1, 1));
254 auto & v3 = mesh.
createVertex(Eigen::Vector3d(0, 0, 1));
259 auto box = bg::return_envelope<precice::query::RTreeBox>(t);
260 auto min = box.min_corner();
261 BOOST_TEST(min[0] == 0.0);
262 BOOST_TEST(min[1] == 0.0);
263 BOOST_TEST(min[2] == 0.0);
264 auto max = box.max_corner();
265 BOOST_TEST(max[0] == 1.0);
266 BOOST_TEST(max[1] == 1.0);
267 BOOST_TEST(max[2] == 1.0);
boost::test_tools::predicate_result equals(const std::vector< float > &VectorA, const std::vector< float > &VectorB, float tolerance)
equals to be used in tests. Compares two std::vectors using a given tolerance. Prints both operands o...