69 int globalIndexOffset = 0,
70 bool meshIsSmaller =
false)
74 for (
auto &vertex : meshSpec.
vertices) {
75 if (vertex.rank == context.
rank or vertex.rank == -1) {
76 if (vertex.position.size() == 3)
77 distributedMesh->
createVertex(Eigen::Vector3d(vertex.position.data()));
78 else if (vertex.position.size() == 2)
79 distributedMesh->
createVertex(Eigen::Vector2d(vertex.position.data()));
81 if (vertex.owner == context.
rank)
96 return distributedMesh;
105 for (
auto &vertex : meshSpec.
vertices) {
106 if (vertex.rank == context.
rank or vertex.rank == -1) {
107 int valueDimension = vertex.value.size();
108 d.conservativeResize(i * valueDimension + valueDimension);
110 for (
int dim = 0; dim < valueDimension; ++dim) {
111 d(i * valueDimension + dim) = vertex.value.at(dim);
124 int inGlobalIndexOffset = 0,
125 bool meshIsSmaller =
false)
140 mapping.
map(inSample, outValues);
143 for (
auto &referenceVertex : referenceSpec) {
144 if (referenceVertex.first == context.
rank or referenceVertex.first == -1) {
145 for (
int dim = 0; dim < valueDimension; ++dim) {
146 BOOST_TEST_INFO(
"Index of vertex: " <<
index <<
" - Dimension: " << dim);
147 BOOST_TEST(outValues(
index * valueDimension + dim) == referenceVertex.second.at(dim));
152 BOOST_TEST(outValues.size() ==
index * valueDimension);
165 {-1, 0, {0, 0}, {1}},
166 {-1, 0, {0, 1}, {2}},
167 {-1, 1, {1, 0}, {3}},
168 {-1, 1, {1, 1}, {4}},
169 {-1, 2, {2, 0}, {5}},
170 {-1, 2, {2, 1}, {6}},
171 {-1, 3, {3, 0}, {7}},
172 {-1, 3, {3, 1}, {8}}};
175 std::move(inVertexList),
180 {0, -1, {0, 0}, {0}},
181 {0, -1, {0, 1}, {0}},
182 {1, -1, {1, 0}, {0}},
183 {1, -1, {1, 1}, {0}},
184 {2, -1, {2, 0}, {0}},
185 {2, -1, {2, 1}, {0}},
186 {3, -1, {3, 0}, {0}},
187 {3, -1, {3, 1}, {0}}};
190 std::move(outVertexList),
218 {-1, 0, {0, 0}, {1, 4}},
219 {-1, 0, {0, 1}, {2, 5}},
220 {-1, 1, {1, 0}, {3, 6}},
221 {-1, 1, {1, 1}, {4, 7}},
222 {-1, 2, {2, 0}, {5, 8}},
223 {-1, 2, {2, 1}, {6, 9}},
224 {-1, 3, {3, 0}, {7, 10}},
225 {-1, 3, {3, 1}, {8, 11}}};
227 std::move(inVertexList),
232 {0, -1, {0, 0}, {0, 0}},
233 {0, -1, {0, 1}, {0, 0}},
234 {1, -1, {1, 0}, {0, 0}},
235 {1, -1, {1, 1}, {0, 0}},
236 {2, -1, {2, 0}, {0, 0}},
237 {2, -1, {2, 1}, {0, 0}},
238 {3, -1, {3, 0}, {0, 0}},
239 {3, -1, {3, 1}, {0, 0}}};
241 std::move(outVertexList),
270 {-1, 0, {0, 0}, {1}},
271 {-1, 0, {0, 1}, {2}},
272 {-1, 1, {1, 0}, {3}},
273 {-1, 1, {1, 1}, {4}},
274 {-1, 1, {2, 0}, {5}},
275 {-1, 3, {2, 1}, {6}},
276 {-1, 3, {3, 0}, {7}},
277 {-1, 3, {3, 1}, {8}}};
280 std::move(inVertexList),
284 {0, -1, {0, 0}, {0}},
285 {0, -1, {0, 1}, {0}},
286 {0, -1, {1, 0}, {0}},
287 {2, -1, {1, 1}, {0}},
288 {2, -1, {2, 0}, {0}},
289 {2, -1, {2, 1}, {0}},
290 {3, -1, {3, 0}, {0}},
291 {3, -1, {3, 1}, {0}}};
293 std::move(outVertexList),
328 {0, -1, {1, 1}, {4}},
329 {0, -1, {2, 0}, {5}},
330 {0, -1, {2, 1}, {6}},
333 {2, -1, {0, 0}, {1}},
334 {2, -1, {0, 1}, {2}},
335 {2, -1, {1, 0}, {3}},
337 {2, -1, {2, 0}, {5}},
339 {2, -1, {3, 0}, {7}},
340 {2, -1, {3, 1}, {8}},
343 {3, -1, {2, 1}, {6}},
348 std::move(inVertexList),
352 {0, -1, {0, 0}, {0}},
353 {0, -1, {0, 1}, {0}},
354 {0, -1, {1, 0}, {0}},
355 {2, -1, {1, 1}, {0}},
356 {2, -1, {2, 0}, {0}},
357 {2, -1, {2, 1}, {0}},
358 {3, -1, {3, 0}, {0}},
359 {3, -1, {3, 1}, {0}}};
361 std::move(outVertexList),
394 {0, 0, {0, 0}, {1, 4}},
395 {0, 0, {0, 1}, {2, 5}},
396 {0, 0, {1, 0}, {3, 6}},
397 {0, -1, {1, 1}, {4, 7}},
398 {0, -1, {2, 0}, {5, 8}},
399 {0, -1, {2, 1}, {6, 9}},
402 {2, -1, {0, 0}, {1, 4}},
403 {2, -1, {0, 1}, {2, 5}},
404 {2, -1, {1, 0}, {3, 6}},
405 {2, 2, {1, 1}, {4, 7}},
406 {2, -1, {2, 0}, {5, 8}},
407 {2, 2, {2, 1}, {6, 9}},
408 {2, -1, {3, 0}, {7, 10}},
409 {2, -1, {3, 1}, {8, 11}},
411 {3, 3, {2, 0}, {5, 8}},
412 {3, -1, {2, 1}, {6, 9}},
413 {3, 3, {3, 0}, {7, 10}},
414 {3, 3, {3, 1}, {8, 11}},
417 std::move(inVertexList),
421 {0, -1, {0, 0}, {0, 0}},
422 {0, -1, {0, 1}, {0, 0}},
423 {0, -1, {1, 0}, {0, 0}},
424 {2, -1, {1, 1}, {0, 0}},
425 {2, -1, {2, 0}, {0, 0}},
426 {2, -1, {2, 1}, {0, 0}},
427 {3, -1, {3, 0}, {0, 0}},
428 {3, -1, {3, 1}, {0, 0}}};
430 std::move(outVertexList),
464 {1, 1, {0, 0}, {1.1}},
465 {1, 1, {0, 1}, {2.5}},
468 {1, -1, {2, 0}, {5}},
469 {1, -1, {2, 1}, {6}},
470 {1, -1, {3, 0}, {7}},
471 {1, -1, {3, 1}, {8}},
473 {2, -1, {0, 0}, {1.1}},
474 {2, -1, {0, 1}, {2.5}},
475 {2, -1, {1, 0}, {3}},
476 {2, -1, {1, 1}, {4}},
484 std::move(inVertexList),
489 {1, -1, {2, 0}, {0}},
490 {1, -1, {1, 0}, {0}},
491 {1, -1, {0, 1}, {0}},
492 {1, -1, {1, 1}, {0}},
493 {1, -1, {0, 0}, {0}},
494 {2, -1, {2, 0}, {0}},
495 {2, -1, {2, 1}, {0}},
496 {2, -1, {3, 0}, {0}},
497 {2, -1, {3, 1}, {0}}};
499 std::move(outVertexList),
529 {0, 0, {0, 0}, {1.1}},
530 {0, 0, {0, 1}, {2.5}},
531 {0, -1, {1, 0}, {3}},
532 {0, -1, {1, 1}, {4}},
533 {0, -1, {2, 0}, {5}},
534 {0, -1, {2, 1}, {6}},
535 {0, -1, {3, 0}, {7}},
536 {0, -1, {3, 1}, {8}},
537 {1, -1, {0, 0}, {1.1}},
538 {1, -1, {0, 1}, {2.5}},
541 {1, -1, {2, 0}, {5}},
542 {1, -1, {2, 1}, {6}},
543 {1, -1, {3, 0}, {7}},
544 {1, -1, {3, 1}, {8}},
545 {2, -1, {0, 0}, {1.1}},
546 {2, -1, {0, 1}, {2.5}},
547 {2, -1, {1, 0}, {3}},
548 {2, -1, {1, 1}, {4}},
551 {2, -1, {3, 0}, {7}},
552 {2, -1, {3, 1}, {8}},
553 {3, -1, {0, 0}, {1.1}},
554 {3, -1, {0, 1}, {2.5}},
555 {3, -1, {1, 0}, {3}},
556 {3, -1, {1, 1}, {4}},
557 {3, -1, {2, 0}, {5}},
558 {3, -1, {2, 1}, {6}},
563 std::move(inVertexList),
568 {1, -1, {2, 0}, {0}},
569 {1, -1, {1, 0}, {0}},
570 {1, -1, {0, 1}, {0}},
571 {1, -1, {1, 1}, {0}},
572 {1, -1, {0, 0}, {0}},
573 {2, -1, {2, 0}, {0}},
574 {2, -1, {2, 1}, {0}},
575 {2, -1, {3, 0}, {0}},
576 {2, -1, {3, 1}, {0}}};
578 std::move(outVertexList),
601 *
boost::unit_test::tolerance(1e-7))
614 {1, -1, {2, 0}, {5}},
615 {1, -1, {2, 1}, {6}},
616 {1, -1, {3, 0}, {7}},
617 {1, -1, {3, 1}, {8}},
619 {2, -1, {0, 0}, {1}},
620 {2, -1, {0, 1}, {2}},
621 {2, -1, {1, 0}, {3}},
622 {2, -1, {1, 1}, {4}},
630 std::move(inVertexList),
635 {1, -1, {2, 0}, {0}},
636 {1, -1, {1, 0}, {0}},
637 {1, -1, {0, 1}, {0}},
638 {1, -1, {1, 1}, {0}},
639 {1, -1, {0, 0}, {0}},
640 {2, -1, {2, 0}, {0}},
641 {2, -1, {2, 1}, {0}},
642 {2, -1, {3, 0}, {0}},
643 {2, -1, {3, 1}, {0}}};
645 std::move(outVertexList),
673 {0, -1, {0, 0}, {1}},
674 {0, -1, {0, 1}, {2}},
675 {1, -1, {1, 0}, {3}},
676 {1, -1, {1, 1}, {4}},
677 {2, -1, {2, 0}, {5}},
678 {2, -1, {2, 1}, {6}},
679 {3, -1, {3, 0}, {7}},
680 {3, -1, {3, 1}, {8}}};
682 std::move(inVertexList),
686 {-1, 0, {0, 0}, {0}},
687 {-1, 0, {0, 1}, {0}},
688 {-1, 1, {1, 0}, {0}},
689 {-1, 1, {1, 1}, {0}},
690 {-1, 2, {2, 0}, {0}},
691 {-1, 2, {2, 1}, {0}},
692 {-1, 3, {3, 0}, {0}},
693 {-1, 3, {3, 1}, {0}}};
695 std::move(outVertexList),
748 {0, -1, {0, 0}, {1, 4}},
749 {0, -1, {0, 1}, {2, 5}},
750 {1, -1, {1, 0}, {3, 6}},
751 {1, -1, {1, 1}, {4, 7}},
752 {2, -1, {2, 0}, {5, 8}},
753 {2, -1, {2, 1}, {6, 9}},
754 {3, -1, {3, 0}, {7, 10}},
755 {3, -1, {3, 1}, {8, 11}}};
757 std::move(inVertexList),
761 {-1, 0, {0, 0}, {0, 0}},
762 {-1, 0, {0, 1}, {0, 0}},
763 {-1, 1, {1, 0}, {0, 0}},
764 {-1, 1, {1, 1}, {0, 0}},
765 {-1, 2, {2, 0}, {0, 0}},
766 {-1, 2, {2, 1}, {0, 0}},
767 {-1, 3, {3, 0}, {0, 0}},
768 {-1, 3, {3, 1}, {0, 0}}};
770 std::move(outVertexList),
825 {1, -1, {0, 0}, {1}},
826 {1, -1, {0, 1}, {2}},
827 {1, -1, {1, 0}, {3}},
828 {1, -1, {1, 1}, {4}},
829 {2, -1, {2, 0}, {5}},
830 {2, -1, {2, 1}, {6}},
831 {3, -1, {3, 0}, {7}},
832 {3, -1, {3, 1}, {8}}};
834 std::move(inVertexList),
838 {-1, 1, {0, 0}, {0}},
839 {-1, 1, {0, 1}, {0}},
840 {-1, 1, {1, 0}, {0}},
841 {-1, 1, {1, 1}, {0}},
842 {-1, 2, {2, 0}, {0}},
843 {-1, 2, {2, 1}, {0}},
844 {-1, 3, {3, 0}, {0}},
845 {-1, 3, {3, 1}, {0}}};
847 std::move(outVertexList),
902 {1, -1, {0, 0}, {1}},
903 {1, -1, {1, 0}, {3}},
904 {1, -1, {1, 1}, {4}},
905 {2, -1, {2, 0}, {5}},
906 {2, -1, {2, 1}, {6}},
907 {3, -1, {3, 0}, {7}},
908 {3, -1, {3, 1}, {8}}};
910 std::move(inVertexList),
914 {-1, 1, {0, 0}, {0}},
915 {-1, 1, {0, 1}, {0}},
916 {-1, 1, {1, 0}, {0}},
917 {-1, 1, {1, 1}, {0}},
918 {-1, 2, {2, 0}, {0}},
919 {-1, 2, {2, 1}, {0}},
920 {-1, 3, {3, 0}, {0}},
921 {-1, 3, {3, 1}, {0}}};
923 std::move(outVertexList),
972 *
boost::unit_test::tolerance(1e-6))
979 {0, -1, {0, 0}, {1}},
980 {0, -1, {0, 1}, {2}},
981 {1, -1, {1, 0}, {3}},
982 {1, -1, {1, 1}, {4}},
983 {2, -1, {2, 0}, {5}},
984 {2, -1, {2, 1}, {6}},
985 {3, -1, {3, 0}, {7}},
986 {3, -1, {3, 1}, {8}}};
988 std::move(inVertexList),
992 {-1, 1, {0, 1}, {0}},
993 {-1, 1, {1, 0}, {0}},
994 {-1, 1, {1, 1}, {0}},
995 {-1, 2, {2, 0}, {0}},
996 {-1, 2, {2, 1}, {0}},
997 {-1, 3, {3, 0}, {0}},
998 {-1, 3, {3, 1}, {0}}};
1000 std::move(outVertexList),
1012 {1, {3.1307987056295525}},
1013 {1, {4.0734031184906971}},
1014 {1, {3.0620533966233006}},
1022 {2, {4.4582564956060873}},
1023 {2, {5.8784343572772633}},
1031 {3, {7.4683403859032156}},
1032 {3, {7.9287135404698859}}};
1034 testDistributed(context, mapping_sep, in,
out, ref, globalIndexOffsets.
at(context.rank),
true);
1045 {0, -1, {0, 0}, {1}},
1046 {0, -1, {0, 1}, {2}},
1047 {1, -1, {1, 0}, {3}},
1048 {1, -1, {1, 1}, {4}},
1049 {2, -1, {2, 0}, {5}},
1050 {2, -1, {2, 1}, {6}},
1051 {3, -1, {3, 0}, {7}},
1052 {3, -1, {3, 1}, {8}}};
1054 std::move(inVertexList),
1058 {-1, 0, {0, 0}, {0}},
1059 {-1, 1, {0, 1}, {0}},
1060 {-1, 1, {1, 0}, {0}},
1061 {-1, 0, {1, 1}, {0}},
1062 {-1, 2, {2, 0}, {0}},
1063 {-1, 2, {2, 1}, {0}},
1064 {-1, 3, {3, 0}, {0}},
1065 {-1, 3, {3, 1}, {0}}};
1067 std::move(outVertexList),
1121 {0, -1, {0, 0}, {1, 4}},
1122 {0, -1, {0, 1}, {2, 5}},
1123 {1, -1, {1, 0}, {3, 6}},
1124 {1, -1, {1, 1}, {4, 7}},
1125 {2, -1, {2, 0}, {5, 8}},
1126 {2, -1, {2, 1}, {6, 9}},
1127 {3, -1, {3, 0}, {7, 10}},
1128 {3, -1, {3, 1}, {8, 11}}};
1130 std::move(inVertexList),
1134 {-1, 0, {0, 0}, {0, 0}},
1135 {-1, 1, {0, 1}, {0, 0}},
1136 {-1, 1, {1, 0}, {0, 0}},
1137 {-1, 0, {1, 1}, {0, 0}},
1138 {-1, 2, {2, 0}, {0, 0}},
1139 {-1, 2, {2, 1}, {0, 0}},
1140 {-1, 3, {3, 0}, {0, 0}},
1141 {-1, 3, {3, 1}, {0, 0}}};
1143 std::move(outVertexList),
1209 mapping.setMeshes(inMesh, outMesh);
1210 mapping.tagMeshFirstRound();
1212 for (
const auto &v : inMesh->
vertices()) {
1215 return std::equal(spec.position.data(), spec.position.data() + meshDimension, v.getCoords().data());
1217 bool found = pos != shouldTagFirstRound.
vertices.
end();
1218 BOOST_TEST(found >= v.isTagged(),
1219 "FirstRound: Vertex " << v <<
" is tagged, but should not be.");
1220 BOOST_TEST(found <= v.isTagged(),
1221 "FirstRound: Vertex " << v <<
" is not tagged, but should be.");
1224 mapping.tagMeshSecondRound();
1226 for (
const auto &v : inMesh->
vertices()) {
1229 return std::equal(spec.position.data(), spec.position.data() + meshDimension, v.getCoords().data());
1231 bool foundFirst = posFirst != shouldTagFirstRound.
vertices.
end();
1234 return std::equal(spec.position.data(), spec.position.data() + meshDimension, v.getCoords().data());
1236 bool foundSecond = posSecond != shouldTagSecondRound.
vertices.
end();
1237 BOOST_TEST(foundFirst <= v.isTagged(),
"SecondRound: Vertex " << v
1238 <<
" is not tagged, but should be from the first round.");
1239 BOOST_TEST(foundSecond <= v.isTagged(),
"SecondRound: Vertex " << v
1240 <<
" is not tagged, but should be.");
1241 BOOST_TEST((foundSecond or foundFirst) >= v.isTagged(),
"SecondRound: Vertex " << v
1242 <<
" is tagged, but should not be.");
1256 {0, -1, {0, 0}, {0}}};
1258 std::move(outVertexList),
1262 {0, -1, {-1, 0}, {1}},
1263 {0, -1, {-2, 0}, {1}},
1264 {0, 0, {1, 0}, {1}},
1265 {0, -1, {2, 0}, {1}},
1266 {0, -1, {0, -1}, {1}},
1267 {0, -1, {0, -2}, {1}},
1268 {0, -1, {0, 1}, {1}},
1269 {0, -1, {0, 2}, {1}}
1272 std::move(inVertexList),
1276 {0, -1, {-1, 0}, {1}},
1277 {0, -1, {1, 0}, {1}},
1278 {0, -1, {0, -1}, {1}},
1279 {0, -1, {0, 1}, {1}}};
1283 static_cast<int>(firstRoundVertices.
at(0).position.size()),
1286 {0, -1, {2, 0}, {1}}};
1288 secondRoundVertices,
1289 static_cast<int>(secondRoundVertices.
at(0).position.size()),
1291 testTagging(context, inMeshSpec, outMeshSpec, shouldTagFirstRound, shouldTagSecondRound,
true);
1293 testTagging(context, outMeshSpec, inMeshSpec, shouldTagFirstRound, shouldTagSecondRound,
false);
1301#define doLocalCode(Type, function, polynomial) \
1303 RadialBasisFctMapping<RadialBasisFctSolver<Type>> consistentMap2D(Mapping::CONSISTENT, 2, function, {{false, false, false}}, polynomial); \
1304 perform2DTestConsistentMapping(consistentMap2D); \
1305 RadialBasisFctMapping<RadialBasisFctSolver<Type>> consistentMap2DVector(Mapping::CONSISTENT, 2, function, {{false, false, false}}, polynomial); \
1306 perform2DTestConsistentMappingVector(consistentMap2DVector); \
1307 RadialBasisFctMapping<RadialBasisFctSolver<Type>> consistentMap3D(Mapping::CONSISTENT, 3, function, {{false, false, false}}, polynomial); \
1308 perform3DTestConsistentMapping(consistentMap3D); \
1309 RadialBasisFctMapping<RadialBasisFctSolver<Type>> scaledConsistentMap2D(Mapping::SCALED_CONSISTENT_SURFACE, 2, function, {{false, false, false}}, polynomial); \
1310 perform2DTestScaledConsistentMapping(scaledConsistentMap2D); \
1311 RadialBasisFctMapping<RadialBasisFctSolver<Type>> scaledConsistentMap3D(Mapping::SCALED_CONSISTENT_SURFACE, 3, function, {{false, false, false}}, polynomial); \
1312 perform3DTestScaledConsistentMapping(scaledConsistentMap3D); \
1313 RadialBasisFctMapping<RadialBasisFctSolver<Type>> conservativeMap2D(Mapping::CONSERVATIVE, 2, function, {{false, false, false}}, polynomial); \
1314 perform2DTestConservativeMapping(conservativeMap2D); \
1315 RadialBasisFctMapping<RadialBasisFctSolver<Type>> conservativeMap2DVector(Mapping::CONSERVATIVE, 2, function, {{false, false, false}}, polynomial); \
1316 perform2DTestConservativeMappingVector(conservativeMap2DVector); \
1317 RadialBasisFctMapping<RadialBasisFctSolver<Type>> conservativeMap3D(Mapping::CONSERVATIVE, 3, function, {{false, false, false}}, polynomial); \
1318 perform3DTestConservativeMapping(conservativeMap3D); \
1301#define doLocalCode(Type, function, polynomial) \ …
1368 double supportRadius = 1.2;
1377 double supportRadius = 1.2;
1386 double supportRadius = 1.2;
1395 double supportRadius = 1.2;
1404 double supportRadius = 1.2;
1413 double supportRadius = 1.2;
1421 using Eigen::Vector2d;
1430 {{xDead, yDead, zDead}}, polynomial);
1434 inMesh->createVertex(Vector2d(0.0, 1.0));
1435 inMesh->createVertex(Vector2d(1.0, 1.0));
1436 inMesh->createVertex(Vector2d(2.0, 1.0));
1437 inMesh->createVertex(Vector2d(3.0, 1.0));
1439 inMesh->setGlobalNumberOfVertices(inMesh->nVertices());
1441 Eigen::VectorXd values(4);
1442 values << 1.0, 2.0, 2.0, 1.0;
1454 mapping.setMeshes(inMesh, outMesh);
1455 BOOST_TEST(mapping.hasComputedMapping() ==
false);
1457 mapping.computeMapping();
1458 Eigen::VectorXd outValues(4);
1460 mapping.map(inSample, outValues);
1461 BOOST_TEST(mapping.hasComputedMapping() ==
true);
1463 if (polynomial == Polynomial::OFF) {
1465 }
else if (polynomial == Polynomial::SEPARATE) {
1471 if (polynomial == Polynomial::OFF) {
1473 }
else if (polynomial == Polynomial::SEPARATE) {
1483 using Eigen::Vector3d;
1491 Mapping mapping(constraint, dimensions, fct, {{xDead, yDead, zDead}}, polynomial);
1495 inMesh->createVertex(Vector3d(0.0, 3.0, 0.0));
1496 inMesh->createVertex(Vector3d(1.0, 3.0, 0.0));
1497 inMesh->createVertex(Vector3d(0.0, 3.0, 1.0));
1498 inMesh->createVertex(Vector3d(1.0, 3.0, 1.0));
1500 inMesh->setGlobalNumberOfVertices(inMesh->nVertices());
1502 Eigen::VectorXd values(4);
1503 values << 1.0, 2.0, 3.0, 4.0;
1515 mapping.setMeshes(inMesh, outMesh);
1516 BOOST_TEST(mapping.hasComputedMapping() ==
false);
1518 mapping.computeMapping();
1519 Eigen::VectorXd outValues(4);
1521 mapping.map(inSample, outValues);
1522 BOOST_TEST(mapping.hasComputedMapping() ==
true);
1525 if (polynomial == Polynomial::OFF) {
1526 const double tolerance = 1e-7;
1527 Eigen::VectorXd expected(4);
1528 expected << 1.0, -0.454450524334, 0.99146426249, 6.98958304876;
1531 Eigen::VectorXd expected(4);
1532 expected << 1.0, 2.0, 2.9, 4.3;
1536 if (polynomial == Polynomial::OFF) {
1537 const double tolerance = 1e-6;
1538 Eigen::VectorXd expected(4);
1539 expected << 1.17251596926, 4.10368825944, 3.56931954192, 3.40160932341;
1541 }
else if (polynomial == Polynomial::ON) {
1542 const double tolerance = 1e-6;
1543 Eigen::VectorXd expected(4);
1544 expected << 0.856701171969, 2.38947124326, 3.34078733786, 3.41304024691;
1547 const double tolerance = 1e-6;
1548 Eigen::VectorXd expected(4);
1549 expected << 0.380480856704, 2.83529451713, 3.73088270249, 3.05334192368;
1600 const int inSize = 112;
1603 Eigen::MatrixXd A = Eigen::MatrixXd::Random(inSize, inSize);
1606 Eigen::MatrixXd M = A * A.transpose();
1612 Eigen::MatrixXd M_inv_builtin = Eigen::MatrixXd::Identity(inSize, inSize);
1613 M.triangularView<Eigen::Lower>().solveInPlace(M_inv_builtin);
1616 Eigen::MatrixXd diff = M_inv_custom - M_inv_builtin;
1618 double max_abs_diff = diff.maxCoeff();
1619 double min_abs_diff = diff.minCoeff();
1622 double tolerance = 1e-12;
1625 BOOST_CHECK_SMALL(max_abs_diff, tolerance);
1626 BOOST_CHECK_SMALL(min_abs_diff, tolerance);
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
void addGlobalIndex(mesh::PtrMesh &mesh, int offset=0)
void testTagging(const TestContext &context, MeshSpecification inMeshSpec, MeshSpecification outMeshSpec, MeshSpecification shouldTagFirstRound, MeshSpecification shouldTagSecondRound, bool consistent)
void testDeadAxis3d(Polynomial polynomial, Mapping::Constraint constraint)
void testDistributed(const TestContext &context, Mapping &mapping, MeshSpecification inMeshSpec, MeshSpecification outMeshSpec, ReferenceSpecification referenceSpec, int inGlobalIndexOffset=0, bool meshIsSmaller=false)
void testDeadAxis2d(Polynomial polynomial, Mapping::Constraint constraint)
Eigen::VectorXd getDistributedData(const TestContext &context, MeshSpecification const &meshSpec)
mesh::PtrMesh getDistributedMesh(const TestContext &context, MeshSpecification &meshSpec, int globalIndexOffset=0, bool meshIsSmaller=false)
BOOST_AUTO_TEST_CASE(MapThinPlateSplines)
#define doLocalCode(Type, function, polynomial)
#define PRECICE_TEST_SETUP(...)
Creates and attaches a TestSetup to a Boost test case.
Wendland radial basis function with compact support.
Wendland radial basis function with compact support.
Wendland radial basis function with compact support.
Wendland radial basis function with compact support.
Wendland radial basis function with compact support.
Radial basis function with compact support.
Radial basis function with global and compact support.
Radial basis function with global support.
Abstract base class for mapping of data from one mesh to another.
Constraint
Specifies additional constraints for a mapping.
void setMeshes(const mesh::PtrMesh &input, const mesh::PtrMesh &output)
Sets input and output meshes carrying data to be mapped.
virtual void computeMapping()=0
Computes the mapping coefficients from the in- and output mesh.
bool hasComputedMapping() const
Returns true, if the mapping has been computed.
void map(int inputDataID, int outputDataID)
Radial basis function with global support.
Mapping with radial basis functions.
Radial basis function with global support.
Radial basis function with global support.
Container and creator for meshes.
void setGlobalNumberOfVertices(int num)
VertexContainer & vertices()
Returns modifieable container holding all vertices.
std::size_t nVertices() const
Returns the number of vertices.
void computeBoundingBox()
Computes the boundingBox for the vertices.
Vertex & createVertex(const Eigen::Ref< const Eigen::VectorXd > &coords)
Creates and initializes a Vertex object.
void setOwner(bool owner)
Rank rank
the rank of the current participant
contains data mapping from points to meshes.
Polynomial
How to handle the polynomial?
provides Mesh, Data and primitives.
contains the testing framework.
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...
Eigen::MatrixXd invertLowerTriangularBlockwise(const Eigen::MatrixXd &L)
Implements an iterative block scheme to determine the inverse of a lower triangular matrix which is m...
Main namespace of the precice library.
std::vector< VertexSpecification > vertices
Holds rank, owner, position and value of a single vertex.
std::vector< double > value
std::vector< double > position