31 constexpr int dimensions = 3;
50 mapping.setMeshes(inMesh, outMesh);
51 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
54 Eigen::VectorXd inValues(3);
55 inValues << 0.0, 0.0, 2.0;
57 Eigen::VectorXd outValues(9);
58 outValues = Eigen::VectorXd::Zero(9);
62 mapping.map(inSample, outValues);
64 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
67 BOOST_TEST(outValues(0) == 0.0);
68 BOOST_TEST(outValues(1) == 0.0);
69 BOOST_TEST(outValues(2) == 2 * inSample.
values(2));
72 BOOST_TEST(outValues(3) == 0.0);
73 BOOST_TEST(outValues(4) == 0.0);
74 BOOST_TEST(outValues(5) == 0.0);
77 BOOST_TEST(outValues(6) == 0.0);
78 BOOST_TEST(outValues(7) == 0.0);
79 BOOST_TEST(outValues(8) == 1.5 * inSample.
values(2));
91 constexpr int dimensions = 3;
110 mapping.setMeshes(inMesh, outMesh);
111 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
114 Eigen::VectorXd inValues(3);
115 inValues << 4.0, 0.0, 0.0;
117 Eigen::VectorXd outValues(9);
118 outValues = Eigen::VectorXd::Zero(9);
122 mapping.map(inSample, outValues);
124 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
128 BOOST_TEST(outValues(0) == 4.0);
129 BOOST_TEST(outValues(1) == 0.0);
130 BOOST_TEST(outValues(2) == 0.0);
133 BOOST_TEST(outValues(3) == 4.0);
134 BOOST_TEST(outValues(4) == 0.0);
135 BOOST_TEST(outValues(5) == 0.0);
138 BOOST_TEST(outValues(6) == 4.0);
139 BOOST_TEST(outValues(7) == 0.0);
140 BOOST_TEST(outValues(8) == 0.0);
152 constexpr int dimensions = 3;
171 mapping.setMeshes(inMesh, outMesh);
172 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
175 Eigen::VectorXd inValues(9);
176 inValues << 1.0, 0.0, 0.0, 2.0, 0.0, 0.0, 3.0, 0.0, 0.0;
178 Eigen::VectorXd outValues(3);
179 outValues = Eigen::VectorXd::Zero(3);
183 mapping.map(inSample, outValues);
185 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
188 BOOST_TEST(outValues(0) == (1 / 3.0) * (inSample.
values(0) + inSample.
values(3) + inSample.
values(6)));
189 BOOST_TEST(outValues(1) == 0.0);
190 BOOST_TEST(outValues(2) == 0.0);
202 constexpr int dimensions = 3;
221 mapping.setMeshes(inMesh, outMesh);
222 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
225 Eigen::VectorXd inValues(9);
226 inValues << 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 0.0, 0.0, 3.0;
228 Eigen::VectorXd outValues(3);
229 outValues = Eigen::VectorXd::Zero(3);
233 mapping.map(inSample, outValues);
235 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
238 BOOST_TEST(outValues(0) == 0.0);
239 BOOST_TEST(outValues(1) == 0.0);
240 BOOST_TEST(outValues(2) == (1 / 3.0) * (inSample.
values(2) + inSample.
values(5) + inSample.
values(8)));
248 constexpr int dimensions = 3;
267 mapping.setMeshes(inMesh, outMesh);
268 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
271 Eigen::VectorXd inValues(1);
274 Eigen::VectorXd outValues(3);
275 outValues = Eigen::VectorXd::Zero(3);
279 mapping.map(inSample, outValues);
281 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
284 BOOST_TEST(outValues(0) == 2 * inSample.
values(0));
286 BOOST_TEST(outValues(1) == 0);
288 BOOST_TEST(outValues(2) == 1.5 * inSample.
values(0));
296 constexpr int dimensions = 3;
315 mapping.setMeshes(inMesh, outMesh);
316 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
319 Eigen::VectorXd inValues(1);
322 Eigen::VectorXd outValues(3);
323 outValues = Eigen::VectorXd::Zero(3);
327 mapping.map(inSample, outValues);
329 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
332 BOOST_TEST(outValues(0) == 42.0);
333 BOOST_TEST(outValues(1) == 42.0);
334 BOOST_TEST(outValues(2) == 42.0);
342 constexpr int dimensions = 3;
361 mapping.setMeshes(inMesh, outMesh);
362 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
365 Eigen::VectorXd inValues(3);
366 inValues << 3.0, 7.0, 5.0;
368 Eigen::VectorXd outValues(1);
369 outValues = Eigen::VectorXd::Zero(1);
373 mapping.map(inSample, outValues);
375 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
378 BOOST_TEST(outValues(0) == (3.0 + 7.0 + 5.0) / 3);
386 constexpr int dimensions = 3;
408 mapping.setMeshes(inMesh, outMesh);
409 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
412 Eigen::VectorXd inValues(3);
413 inValues << 10.0, 20.0, 30.0;
415 Eigen::VectorXd outValues(4);
416 outValues = Eigen::VectorXd::Zero(4);
420 mapping.map(inSample, outValues);
422 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
424 BOOST_TEST(outValues(0) == 10.0);
425 BOOST_TEST(outValues(1) == 20.0);
426 BOOST_TEST(outValues(2) == 20.0);
427 BOOST_TEST(outValues(3) == 30.0);
435 constexpr int dimensions = 3;
456 mapping.setMeshes(inMesh, outMesh);
457 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
460 Eigen::VectorXd inValues(2);
461 inValues << 10.0, 20.0;
463 Eigen::VectorXd outValues(4);
464 outValues = Eigen::VectorXd::Zero(4);
468 mapping.map(inSample, outValues);
470 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
472 BOOST_TEST(outValues(0) == 40.0 / 3.0);
473 BOOST_TEST(outValues(1) == 0.0);
474 BOOST_TEST(outValues(2) == 20.0);
475 BOOST_TEST(outValues(3) == 0.0);
483 constexpr int dimensions = 3;
505 mapping.setMeshes(inMesh, outMesh);
506 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
509 Eigen::VectorXd inValues(9);
510 inValues << 0.0, 10.0, 0.0,
514 Eigen::VectorXd outValues(12);
515 outValues = Eigen::VectorXd::Zero(12);
519 mapping.map(inSample, outValues);
521 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
523 BOOST_TEST(outValues(1) == 10.0);
524 BOOST_TEST(outValues(4) == 20.0);
525 BOOST_TEST(outValues(7) == 20.0);
526 BOOST_TEST(outValues(10) == 30.0);
534 constexpr int dimensions = 3;
555 mapping.setMeshes(inMesh, outMesh);
556 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
559 Eigen::VectorXd inValues(6);
560 inValues << 0.0, 10.0, 0.0,
563 Eigen::VectorXd outValues(12);
564 outValues = Eigen::VectorXd::Zero(12);
568 mapping.map(inSample, outValues);
570 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
572 BOOST_TEST(outValues(1) == 40.0 / 3.0);
573 BOOST_TEST(outValues(4) == 0.0);
574 BOOST_TEST(outValues(7) == 20.0);
575 BOOST_TEST(outValues(10) == 0.0);
583 constexpr int dimensions = 3;
605 mapping.setMeshes(inMesh, outMesh);
606 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
609 Eigen::VectorXd inValues(4);
610 inValues << 10.0, 20.0, 30.0, 40.0;
612 Eigen::VectorXd outValues(3);
613 outValues = Eigen::VectorXd::Zero(3);
617 mapping.map(inSample, outValues);
619 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
621 BOOST_TEST(outValues(0) == 15.0);
622 BOOST_TEST(outValues(1) == 30.0);
623 BOOST_TEST(outValues(2) == 40.0);
631 constexpr int dimensions = 3;
653 mapping.setMeshes(inMesh, outMesh);
654 BOOST_TEST(
mapping.hasComputedMapping() ==
false);
657 Eigen::VectorXd inValues(12);
658 inValues << 0.0, 10.0, 0.0,
663 Eigen::VectorXd outValues(9);
664 outValues = Eigen::VectorXd::Zero(9);
668 mapping.map(inSample, outValues);
670 BOOST_TEST(
mapping.hasComputedMapping() ==
true);
672 BOOST_TEST(outValues(1) == 15.0);
673 BOOST_TEST(outValues(4) == 30.0);
674 BOOST_TEST(outValues(7) == 40.0);
681 constexpr int dimensions = 3;
707 mapping.setMeshes(inMesh, outMesh);
709 Eigen::VectorXd inValues(1);
713 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(3);
716 mapping.map(inSample, outValues);
720 BOOST_TEST(outValues(0) == 1.5 * inSample.
values(0));
721 BOOST_TEST(outValues(1) == 0.0);
722 BOOST_TEST(outValues(2) == 1.125 * inSample.
values(0));
729 constexpr int dimensions = 3;
752 mapping.setMeshes(inMesh, outMesh);
754 Eigen::VectorXd inValues(1);
758 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(3);
761 mapping.map(inSample, outValues);
763 BOOST_TEST(outValues(0) == 42.0);
764 BOOST_TEST(outValues(1) == 42.0);
765 BOOST_TEST(outValues(2) == 42.0);
772 constexpr int dimensions = 3;
795 mapping.setMeshes(inMesh, outMesh);
797 Eigen::VectorXd inValues(3);
798 inValues << 0.0, 8.0, 0.0;
801 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(9);
804 mapping.map(inSample, outValues);
808 BOOST_TEST(outValues(0) == 0.0);
809 BOOST_TEST(outValues(1) == 1.5 * inSample.
values(1));
810 BOOST_TEST(outValues(2) == 0.0);
813 BOOST_TEST(outValues(3) == 0.0);
814 BOOST_TEST(outValues(4) == 0.0);
815 BOOST_TEST(outValues(5) == 0.0);
818 BOOST_TEST(outValues(6) == 0.0);
819 BOOST_TEST(outValues(7) == 1.125 * inSample.
values(1));
820 BOOST_TEST(outValues(8) == 0.0);
827 constexpr int dimensions = 3;
850 mapping.setMeshes(inMesh, outMesh);
852 Eigen::VectorXd inValues(3);
853 inValues << 0.0, 3.0, 0.0;
856 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(9);
859 mapping.map(inSample, outValues);
862 BOOST_TEST(outValues(1) == 3.0);
863 BOOST_TEST(outValues(4) == 3.0);
864 BOOST_TEST(outValues(7) == 3.0);
867 BOOST_TEST(outValues(0) == 0.0);
868 BOOST_TEST(outValues(2) == 0.0);
869 BOOST_TEST(outValues(3) == 0.0);
870 BOOST_TEST(outValues(5) == 0.0);
871 BOOST_TEST(outValues(6) == 0.0);
872 BOOST_TEST(outValues(8) == 0.0);
879 constexpr int dimensions = 3;
900 mapping.setMeshes(inMesh, outMesh);
902 Eigen::VectorXd inValues(3);
903 inValues << 3.0, 7.0, 5.0;
906 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(1);
909 mapping.map(inSample, outValues);
911 BOOST_TEST(outValues(0) == (3.0 + 7.0 + 5.0) / 3.0);
918 constexpr int dimensions = 3;
939 mapping.setMeshes(inMesh, outMesh);
941 Eigen::VectorXd inValues(9);
942 inValues << 10.0, 0.0, 0.0,
947 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(3);
950 mapping.map(inSample, outValues);
952 BOOST_TEST(outValues(0) == (10.0 + 20.0 + 30.0) / 3.0);
953 BOOST_TEST(outValues(1) == 0.0);
954 BOOST_TEST(outValues(2) == 0.0);
961 constexpr int dimensions = 3;
962 const auto tol = boost::test_tools::tolerance(1e-12);
976 const double radius = 1.0;
987 mapping.setMeshes(inMesh, outMesh);
989 Eigen::VectorXd inValues(1);
993 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(4);
996 mapping.map(inSample, outValues);
998 constexpr double factor = 2.096;
999 constexpr double m = 0.879;
1001 const double u = inSample.
values(0);
1003 const double b_center = 1.0;
1004 const double b_mid = 1.0 - 0.5 * 0.5;
1005 const double b_corner = 1.0 - 0.5 * 0.5;
1007 const double expected_center = factor * u * std::pow(b_center, m) * std::pow(b_center, m);
1008 const double expected_mid = factor * u * std::pow(b_mid, m) * std::pow(b_center, m);
1009 const double expected_corner = factor * u * std::pow(b_corner, m) * std::pow(b_corner, m);
1011 BOOST_TEST(outValues(0) == expected_center, tol);
1012 BOOST_TEST(outValues(1) == 0.0, tol);
1013 BOOST_TEST(outValues(2) == expected_mid, tol);
1014 BOOST_TEST(outValues(3) == expected_corner, tol);
1021 constexpr int dimensions = 3;
1034 const double radius = 1.0;
1045 mapping.setMeshes(inMesh, outMesh);
1047 Eigen::VectorXd inValues(1);
1051 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(4);
1054 mapping.map(inSample, outValues);
1056 BOOST_TEST(outValues(0) == 42.0);
1057 BOOST_TEST(outValues(1) == 42.0);
1058 BOOST_TEST(outValues(2) == 42.0);
1059 BOOST_TEST(outValues(3) == 42.0);
1066 constexpr int dimensions = 3;
1067 const auto tol = boost::test_tools::tolerance(1e-12);
1081 const double radius = 1.0;
1092 mapping.setMeshes(inMesh, outMesh);
1094 Eigen::VectorXd inValues(3);
1095 inValues << 2.0, 0.0, 0.0;
1098 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(12);
1101 mapping.map(inSample, outValues);
1103 constexpr double factor = 2.096;
1104 constexpr double m = 0.879;
1106 const double u = inSample.
values(0);
1108 const double b_center = 1.0;
1109 const double b_mid = 1.0 - 0.5 * 0.5;
1110 const double b_corner = 1.0 - 0.5 * 0.5;
1112 const double expected_center = factor * u * std::pow(b_center, m) * std::pow(b_center, m);
1113 const double expected_edge = 0.0;
1114 const double expected_mid = factor * u * std::pow(b_mid, m) * std::pow(b_center, m);
1115 const double expected_corner = factor * u * std::pow(b_corner, m) * std::pow(b_corner, m);
1118 BOOST_TEST(outValues(0) == expected_center, tol);
1119 BOOST_TEST(outValues(1) == 0.0, tol);
1120 BOOST_TEST(outValues(2) == 0.0, tol);
1122 BOOST_TEST(outValues(3) == expected_edge, tol);
1123 BOOST_TEST(outValues(4) == 0.0, tol);
1124 BOOST_TEST(outValues(5) == 0.0, tol);
1126 BOOST_TEST(outValues(6) == expected_mid, tol);
1127 BOOST_TEST(outValues(7) == 0.0, tol);
1128 BOOST_TEST(outValues(8) == 0.0, tol);
1130 BOOST_TEST(outValues(9) == expected_corner, tol);
1131 BOOST_TEST(outValues(10) == 0.0, tol);
1132 BOOST_TEST(outValues(11) == 0.0, tol);
1139 constexpr int dimensions = 3;
1152 const double radius = 1.0;
1163 mapping.setMeshes(inMesh, outMesh);
1165 Eigen::VectorXd inValues(3);
1166 inValues << 4.0, 0.0, 0.0;
1169 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(12);
1172 mapping.map(inSample, outValues);
1174 for (
int v = 0; v < 4; ++v) {
1175 BOOST_TEST(outValues(3 * v + 0) == 4.0);
1176 BOOST_TEST(outValues(3 * v + 1) == 0.0);
1177 BOOST_TEST(outValues(3 * v + 2) == 0.0);
1185 constexpr int dimensions = 3;
1198 const double radius = 1.0;
1209 mapping.setMeshes(inMesh, outMesh);
1211 Eigen::VectorXd inValues(4);
1212 inValues << 1.0, 2.0, 3.0, 4.0;
1215 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(1);
1218 mapping.map(inSample, outValues);
1220 BOOST_TEST(outValues(0) == (1.0 + 2.0 + 3.0 + 4.0) / 4.0);
1227 constexpr int dimensions = 3;
1240 const double radius = 1.0;
1251 mapping.setMeshes(inMesh, outMesh);
1253 Eigen::VectorXd inValues(12);
1254 inValues << 1.0, 0.0, 0.0,
1260 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(3);
1263 mapping.map(inSample, outValues);
1265 BOOST_TEST(outValues(0) == (1.0 + 2.0 + 3.0 + 4.0) / 4.0);
1266 BOOST_TEST(outValues(1) == 0.0);
1267 BOOST_TEST(outValues(2) == 0.0);
1274 constexpr int dimensions = 3;
1287 const double radius = 1.0;
1298 mapping.setMeshes(inMesh, outMesh);
1300 Eigen::VectorXd inValues(4);
1301 inValues << 10.0, 20.0, 30.0, 40.0;
1304 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(1);
1307 mapping.map(inSample, outValues);
1309 BOOST_TEST(outValues(0) == (10.0 + 20.0 + 30.0 + 40.0) / 4.0);
1316 constexpr int dimensions = 3;
1329 const double radius = 1.0;
1340 mapping.setMeshes(inMesh, outMesh);
1342 Eigen::VectorXd inValues(12);
1343 inValues << 10.0, 0.0, 0.0,
1349 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(3);
1352 mapping.map(inSample, outValues);
1354 BOOST_TEST(outValues(0) == (10.0 + 20.0 + 30.0 + 40.0) / 4.0);
1355 BOOST_TEST(outValues(1) == 0.0);
1356 BOOST_TEST(outValues(2) == 0.0);
1363 constexpr int dimensions = 3;
1372 outMesh->
createVertex(Eigen::Vector3d(0.0, -1.1, 0.0));
1373 outMesh->
createVertex(Eigen::Vector3d(0.0, -0.2, 0.0));
1378 const double radius = 1.0;
1389 mapping.setMeshes(inMesh, outMesh);
1391 Eigen::VectorXd inValues(3);
1392 inValues << 10.0, 20.0, 30.0;
1395 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(4);
1398 mapping.map(inSample, outValues);
1400 BOOST_TEST(outValues(0) == 10.0);
1401 BOOST_TEST(outValues(1) == 20.0);
1402 BOOST_TEST(outValues(2) == 20.0);
1403 BOOST_TEST(outValues(3) == 30.0);
1410 constexpr int dimensions = 3;
1411 const auto tol = boost::test_tools::tolerance(1e-12);
1421 outMesh->
createVertex(Eigen::Vector3d(0.0, -0.5, 0.0));
1422 outMesh->
createVertex(Eigen::Vector3d(0.5, -0.5, 0.0));
1428 const double radius = 1.0;
1439 mapping.setMeshes(inMesh, outMesh);
1441 Eigen::VectorXd inValues(2);
1442 inValues << 10.0, 20.0;
1445 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(4);
1448 mapping.map(inSample, outValues);
1451 constexpr double umax_over_umean = 2.096;
1452 constexpr double line_factor = 1.5;
1453 constexpr double m = 0.879;
1454 constexpr double eps = 1e-12;
1457 const double s1 = 0.5;
1458 const double b1raw = 1.0 - s1 * s1;
1459 const double b1 = std::max(eps, b1raw);
1461 const double pref = (umax_over_umean / line_factor) * std::pow(b1, m - 1.0);
1464 const double b2_0 = 1.0;
1466 const double s2_h = 0.5;
1467 const double b2_h = std::max(0.0, 1.0 - s2_h * s2_h);
1469 const double expected_v0_d0 = inSample.
values(0) * pref * std::pow(b2_0, m);
1470 const double expected_v0_dh = inSample.
values(0) * pref * std::pow(b2_h, m);
1471 const double expected_v1_d0 = inSample.
values(1) * pref * std::pow(b2_0, m);
1472 const double expected_v1_dh = inSample.
values(1) * pref * std::pow(b2_h, m);
1474 BOOST_TEST(outValues(0) == expected_v0_d0, tol);
1475 BOOST_TEST(outValues(1) == expected_v0_dh, tol);
1476 BOOST_TEST(outValues(2) == expected_v1_d0, tol);
1477 BOOST_TEST(outValues(3) == expected_v1_dh, tol);
1484 constexpr int dimensions = 3;
1493 outMesh->
createVertex(Eigen::Vector3d(-1.1, 0.0, 0.0));
1494 outMesh->
createVertex(Eigen::Vector3d(-0.2, 0.0, 0.0));
1499 const double radius = 1.0;
1510 mapping.setMeshes(inMesh, outMesh);
1512 Eigen::VectorXd inValues(9);
1513 inValues << 0.0, 10.0, 0.0,
1518 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(12);
1521 mapping.map(inSample, outValues);
1523 BOOST_TEST(outValues(1) == 10.0);
1524 BOOST_TEST(outValues(4) == 20.0);
1525 BOOST_TEST(outValues(7) == 20.0);
1526 BOOST_TEST(outValues(10) == 30.0);
1533 constexpr int dimensions = 3;
1534 const auto tol = boost::test_tools::tolerance(1e-12);
1542 outMesh->
createVertex(Eigen::Vector3d(0.0, -0.5, 0.0));
1543 outMesh->
createVertex(Eigen::Vector3d(0.5, -0.5, 0.0));
1548 const double radius = 1.0;
1559 mapping.setMeshes(inMesh, outMesh);
1561 Eigen::VectorXd inValues(6);
1562 inValues << 0.0, 10.0, 0.0,
1566 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(12);
1569 mapping.map(inSample, outValues);
1571 constexpr double umax_over_umean = 2.096;
1572 constexpr double line_factor = 1.5;
1573 constexpr double m = 0.879;
1574 constexpr double eps = 1e-12;
1576 const double s1 = 0.5;
1577 const double b1raw = 1.0 - s1 * s1;
1578 const double b1 = std::max(eps, b1raw);
1579 const double pref = (umax_over_umean / line_factor) * std::pow(b1, m - 1.0);
1581 const double b2_0 = 1.0;
1582 const double s2_h = 0.5;
1583 const double b2_h = std::max(0.0, 1.0 - s2_h * s2_h);
1585 const double expected_v0_d0 = 10.0 * pref * std::pow(b2_0, m);
1586 const double expected_v0_dh = 10.0 * pref * std::pow(b2_h, m);
1587 const double expected_v1_d0 = 20.0 * pref * std::pow(b2_0, m);
1588 const double expected_v1_dh = 20.0 * pref * std::pow(b2_h, m);
1591 BOOST_TEST(outValues(1) == expected_v0_d0, tol);
1592 BOOST_TEST(outValues(4) == expected_v0_dh, tol);
1593 BOOST_TEST(outValues(7) == expected_v1_d0, tol);
1594 BOOST_TEST(outValues(10) == expected_v1_dh, tol);
1597 BOOST_TEST(outValues(0) == 0.0);
1598 BOOST_TEST(outValues(2) == 0.0);
1599 BOOST_TEST(outValues(3) == 0.0);
1600 BOOST_TEST(outValues(5) == 0.0);
1601 BOOST_TEST(outValues(6) == 0.0);
1602 BOOST_TEST(outValues(8) == 0.0);
1603 BOOST_TEST(outValues(9) == 0.0);
1604 BOOST_TEST(outValues(11) == 0.0);
1611 constexpr int dimensions = 3;
1622 outMesh->
createVertex(Eigen::Vector3d(0.0, 0.0, -0.5));
1627 const double radius = 1.0;
1638 mapping.setMeshes(inMesh, outMesh);
1640 Eigen::VectorXd inValues(4);
1641 inValues << 10.0, 20.0, 30.0, 40.0;
1644 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(3);
1647 mapping.map(inSample, outValues);
1650 BOOST_TEST(outValues(0) == 15.0);
1651 BOOST_TEST(outValues(1) == 30.0);
1652 BOOST_TEST(outValues(2) == 40.0);
1659 constexpr int dimensions = 3;
1669 outMesh->
createVertex(Eigen::Vector3d(0.0, 0.0, -0.5));
1674 const double radius = 1.0;
1685 mapping.setMeshes(inMesh, outMesh);
1687 Eigen::VectorXd inValues(12);
1688 inValues << 0.0, 10.0, 0.0,
1694 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(9);
1697 mapping.map(inSample, outValues);
1700 BOOST_TEST(outValues(1) == 15.0);
1701 BOOST_TEST(outValues(4) == 30.0);
1702 BOOST_TEST(outValues(7) == 40.0);
1709 constexpr int dimensions = 3;
1710 const auto tol = boost::test_tools::tolerance(1e-12);
1721 outMesh->
createVertex(Eigen::Vector3d(0.0, 0.0, -0.5));
1726 const double radius = 1.0;
1737 mapping.setMeshes(inMesh, outMesh);
1739 Eigen::VectorXd inValues(4);
1740 inValues << 10.0, 20.0, 30.0, 40.0;
1743 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(3);
1746 mapping.map(inSample, outValues);
1749 const double avg0 = 15.0;
1750 const double avg1 = 30.0;
1751 const double avg2 = 40.0;
1754 constexpr double scaleC = 1.03745;
1755 constexpr double expP = 0.121;
1757 const double z0 = -0.5, z1 = 0.0, z2 = 0.5;
1759 const double b10 = std::max(0.0, 1.0 - z0 * z0);
1760 const double b11 = std::max(0.0, 1.0 - z1 * z1);
1761 const double b12 = std::max(0.0, 1.0 - z2 * z2);
1763 const double expected0 = avg0 * scaleC * std::pow(b10, expP);
1764 const double expected1 = avg1 * scaleC * std::pow(b11, expP);
1765 const double expected2 = avg2 * scaleC * std::pow(b12, expP);
1767 BOOST_TEST(outValues(0) == expected0, tol);
1768 BOOST_TEST(outValues(1) == expected1, tol);
1769 BOOST_TEST(outValues(2) == expected2, tol);
1776 constexpr int dimensions = 3;
1777 const auto tol = boost::test_tools::tolerance(1e-12);
1787 outMesh->
createVertex(Eigen::Vector3d(0.0, 0.0, -0.5));
1792 const double radius = 1.0;
1803 mapping.setMeshes(inMesh, outMesh);
1805 Eigen::VectorXd inValues(12);
1806 inValues << 0.0, 10.0, 0.0,
1812 Eigen::VectorXd outValues = Eigen::VectorXd::Zero(9);
1815 mapping.map(inSample, outValues);
1818 const double avg0 = 15.0;
1819 const double avg1 = 30.0;
1820 const double avg2 = 40.0;
1822 constexpr double scaleC = 1.03745;
1823 constexpr double expP = 0.121;
1825 const double z0 = -0.5, z1 = 0.0, z2 = 0.5;
1827 const double b10 = std::max(0.0, 1.0 - z0 * z0);
1828 const double b11 = std::max(0.0, 1.0 - z1 * z1);
1829 const double b12 = std::max(0.0, 1.0 - z2 * z2);
1831 const double expected0 = avg0 * scaleC * std::pow(b10, expP);
1832 const double expected1 = avg1 * scaleC * std::pow(b11, expP);
1833 const double expected2 = avg2 * scaleC * std::pow(b12, expP);
1836 BOOST_TEST(outValues(1) == expected0, tol);
1837 BOOST_TEST(outValues(4) == expected1, tol);
1838 BOOST_TEST(outValues(7) == expected2, tol);
1841 BOOST_TEST(outValues(0) == 0.0);
1842 BOOST_TEST(outValues(2) == 0.0);
1843 BOOST_TEST(outValues(3) == 0.0);
1844 BOOST_TEST(outValues(5) == 0.0);
1845 BOOST_TEST(outValues(6) == 0.0);
1846 BOOST_TEST(outValues(8) == 0.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...