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);
164 {-1, 0, {0, 0}, {1}},
165 {-1, 0, {0, 1}, {2}},
166 {-1, 1, {1, 0}, {3}},
167 {-1, 1, {1, 1}, {4}},
168 {-1, 2, {2, 0}, {5}},
169 {-1, 2, {2, 1}, {6}},
170 {-1, 3, {3, 0}, {7}},
171 {-1, 3, {3, 1}, {8}}};
174 std::move(inVertexList),
179 {0, -1, {0, 0}, {0}},
180 {0, -1, {0, 1}, {0}},
181 {1, -1, {1, 0}, {0}},
182 {1, -1, {1, 1}, {0}},
183 {2, -1, {2, 0}, {0}},
184 {2, -1, {2, 1}, {0}},
185 {3, -1, {3, 0}, {0}},
186 {3, -1, {3, 1}, {0}}};
189 std::move(outVertexList),
216 {-1, 0, {0, 0}, {1, 4}},
217 {-1, 0, {0, 1}, {2, 5}},
218 {-1, 1, {1, 0}, {3, 6}},
219 {-1, 1, {1, 1}, {4, 7}},
220 {-1, 2, {2, 0}, {5, 8}},
221 {-1, 2, {2, 1}, {6, 9}},
222 {-1, 3, {3, 0}, {7, 10}},
223 {-1, 3, {3, 1}, {8, 11}}};
225 std::move(inVertexList),
230 {0, -1, {0, 0}, {0, 0}},
231 {0, -1, {0, 1}, {0, 0}},
232 {1, -1, {1, 0}, {0, 0}},
233 {1, -1, {1, 1}, {0, 0}},
234 {2, -1, {2, 0}, {0, 0}},
235 {2, -1, {2, 1}, {0, 0}},
236 {3, -1, {3, 0}, {0, 0}},
237 {3, -1, {3, 1}, {0, 0}}};
239 std::move(outVertexList),
267 {-1, 0, {0, 0}, {1}},
268 {-1, 0, {0, 1}, {2}},
269 {-1, 1, {1, 0}, {3}},
270 {-1, 1, {1, 1}, {4}},
271 {-1, 1, {2, 0}, {5}},
272 {-1, 3, {2, 1}, {6}},
273 {-1, 3, {3, 0}, {7}},
274 {-1, 3, {3, 1}, {8}}};
277 std::move(inVertexList),
281 {0, -1, {0, 0}, {0}},
282 {0, -1, {0, 1}, {0}},
283 {0, -1, {1, 0}, {0}},
284 {2, -1, {1, 1}, {0}},
285 {2, -1, {2, 0}, {0}},
286 {2, -1, {2, 1}, {0}},
287 {3, -1, {3, 0}, {0}},
288 {3, -1, {3, 1}, {0}}};
290 std::move(outVertexList),
324 {0, -1, {1, 1}, {4}},
325 {0, -1, {2, 0}, {5}},
326 {0, -1, {2, 1}, {6}},
329 {2, -1, {0, 0}, {1}},
330 {2, -1, {0, 1}, {2}},
331 {2, -1, {1, 0}, {3}},
333 {2, -1, {2, 0}, {5}},
335 {2, -1, {3, 0}, {7}},
336 {2, -1, {3, 1}, {8}},
339 {3, -1, {2, 1}, {6}},
344 std::move(inVertexList),
348 {0, -1, {0, 0}, {0}},
349 {0, -1, {0, 1}, {0}},
350 {0, -1, {1, 0}, {0}},
351 {2, -1, {1, 1}, {0}},
352 {2, -1, {2, 0}, {0}},
353 {2, -1, {2, 1}, {0}},
354 {3, -1, {3, 0}, {0}},
355 {3, -1, {3, 1}, {0}}};
357 std::move(outVertexList),
389 {0, 0, {0, 0}, {1, 4}},
390 {0, 0, {0, 1}, {2, 5}},
391 {0, 0, {1, 0}, {3, 6}},
392 {0, -1, {1, 1}, {4, 7}},
393 {0, -1, {2, 0}, {5, 8}},
394 {0, -1, {2, 1}, {6, 9}},
397 {2, -1, {0, 0}, {1, 4}},
398 {2, -1, {0, 1}, {2, 5}},
399 {2, -1, {1, 0}, {3, 6}},
400 {2, 2, {1, 1}, {4, 7}},
401 {2, -1, {2, 0}, {5, 8}},
402 {2, 2, {2, 1}, {6, 9}},
403 {2, -1, {3, 0}, {7, 10}},
404 {2, -1, {3, 1}, {8, 11}},
406 {3, 3, {2, 0}, {5, 8}},
407 {3, -1, {2, 1}, {6, 9}},
408 {3, 3, {3, 0}, {7, 10}},
409 {3, 3, {3, 1}, {8, 11}},
412 std::move(inVertexList),
416 {0, -1, {0, 0}, {0, 0}},
417 {0, -1, {0, 1}, {0, 0}},
418 {0, -1, {1, 0}, {0, 0}},
419 {2, -1, {1, 1}, {0, 0}},
420 {2, -1, {2, 0}, {0, 0}},
421 {2, -1, {2, 1}, {0, 0}},
422 {3, -1, {3, 0}, {0, 0}},
423 {3, -1, {3, 1}, {0, 0}}};
425 std::move(outVertexList),
458 {1, 1, {0, 0}, {1.1}},
459 {1, 1, {0, 1}, {2.5}},
462 {1, -1, {2, 0}, {5}},
463 {1, -1, {2, 1}, {6}},
464 {1, -1, {3, 0}, {7}},
465 {1, -1, {3, 1}, {8}},
467 {2, -1, {0, 0}, {1.1}},
468 {2, -1, {0, 1}, {2.5}},
469 {2, -1, {1, 0}, {3}},
470 {2, -1, {1, 1}, {4}},
478 std::move(inVertexList),
483 {1, -1, {2, 0}, {0}},
484 {1, -1, {1, 0}, {0}},
485 {1, -1, {0, 1}, {0}},
486 {1, -1, {1, 1}, {0}},
487 {1, -1, {0, 0}, {0}},
488 {2, -1, {2, 0}, {0}},
489 {2, -1, {2, 1}, {0}},
490 {2, -1, {3, 0}, {0}},
491 {2, -1, {3, 1}, {0}}};
493 std::move(outVertexList),
522 {0, 0, {0, 0}, {1.1}},
523 {0, 0, {0, 1}, {2.5}},
524 {0, -1, {1, 0}, {3}},
525 {0, -1, {1, 1}, {4}},
526 {0, -1, {2, 0}, {5}},
527 {0, -1, {2, 1}, {6}},
528 {0, -1, {3, 0}, {7}},
529 {0, -1, {3, 1}, {8}},
530 {1, -1, {0, 0}, {1.1}},
531 {1, -1, {0, 1}, {2.5}},
534 {1, -1, {2, 0}, {5}},
535 {1, -1, {2, 1}, {6}},
536 {1, -1, {3, 0}, {7}},
537 {1, -1, {3, 1}, {8}},
538 {2, -1, {0, 0}, {1.1}},
539 {2, -1, {0, 1}, {2.5}},
540 {2, -1, {1, 0}, {3}},
541 {2, -1, {1, 1}, {4}},
544 {2, -1, {3, 0}, {7}},
545 {2, -1, {3, 1}, {8}},
546 {3, -1, {0, 0}, {1.1}},
547 {3, -1, {0, 1}, {2.5}},
548 {3, -1, {1, 0}, {3}},
549 {3, -1, {1, 1}, {4}},
550 {3, -1, {2, 0}, {5}},
551 {3, -1, {2, 1}, {6}},
556 std::move(inVertexList),
561 {1, -1, {2, 0}, {0}},
562 {1, -1, {1, 0}, {0}},
563 {1, -1, {0, 1}, {0}},
564 {1, -1, {1, 1}, {0}},
565 {1, -1, {0, 0}, {0}},
566 {2, -1, {2, 0}, {0}},
567 {2, -1, {2, 1}, {0}},
568 {2, -1, {3, 0}, {0}},
569 {2, -1, {3, 1}, {0}}};
571 std::move(outVertexList),
593 *boost::unit_test::tolerance(1e-7))
606 {1, -1, {2, 0}, {5}},
607 {1, -1, {2, 1}, {6}},
608 {1, -1, {3, 0}, {7}},
609 {1, -1, {3, 1}, {8}},
611 {2, -1, {0, 0}, {1}},
612 {2, -1, {0, 1}, {2}},
613 {2, -1, {1, 0}, {3}},
614 {2, -1, {1, 1}, {4}},
622 std::move(inVertexList),
627 {1, -1, {2, 0}, {0}},
628 {1, -1, {1, 0}, {0}},
629 {1, -1, {0, 1}, {0}},
630 {1, -1, {1, 1}, {0}},
631 {1, -1, {0, 0}, {0}},
632 {2, -1, {2, 0}, {0}},
633 {2, -1, {2, 1}, {0}},
634 {2, -1, {3, 0}, {0}},
635 {2, -1, {3, 1}, {0}}};
637 std::move(outVertexList),
664 {0, -1, {0, 0}, {1}},
665 {0, -1, {0, 1}, {2}},
666 {1, -1, {1, 0}, {3}},
667 {1, -1, {1, 1}, {4}},
668 {2, -1, {2, 0}, {5}},
669 {2, -1, {2, 1}, {6}},
670 {3, -1, {3, 0}, {7}},
671 {3, -1, {3, 1}, {8}}};
673 std::move(inVertexList),
677 {-1, 0, {0, 0}, {0}},
678 {-1, 0, {0, 1}, {0}},
679 {-1, 1, {1, 0}, {0}},
680 {-1, 1, {1, 1}, {0}},
681 {-1, 2, {2, 0}, {0}},
682 {-1, 2, {2, 1}, {0}},
683 {-1, 3, {3, 0}, {0}},
684 {-1, 3, {3, 1}, {0}}};
686 std::move(outVertexList),
738 {0, -1, {0, 0}, {1, 4}},
739 {0, -1, {0, 1}, {2, 5}},
740 {1, -1, {1, 0}, {3, 6}},
741 {1, -1, {1, 1}, {4, 7}},
742 {2, -1, {2, 0}, {5, 8}},
743 {2, -1, {2, 1}, {6, 9}},
744 {3, -1, {3, 0}, {7, 10}},
745 {3, -1, {3, 1}, {8, 11}}};
747 std::move(inVertexList),
751 {-1, 0, {0, 0}, {0, 0}},
752 {-1, 0, {0, 1}, {0, 0}},
753 {-1, 1, {1, 0}, {0, 0}},
754 {-1, 1, {1, 1}, {0, 0}},
755 {-1, 2, {2, 0}, {0, 0}},
756 {-1, 2, {2, 1}, {0, 0}},
757 {-1, 3, {3, 0}, {0, 0}},
758 {-1, 3, {3, 1}, {0, 0}}};
760 std::move(outVertexList),
814 {1, -1, {0, 0}, {1}},
815 {1, -1, {0, 1}, {2}},
816 {1, -1, {1, 0}, {3}},
817 {1, -1, {1, 1}, {4}},
818 {2, -1, {2, 0}, {5}},
819 {2, -1, {2, 1}, {6}},
820 {3, -1, {3, 0}, {7}},
821 {3, -1, {3, 1}, {8}}};
823 std::move(inVertexList),
827 {-1, 1, {0, 0}, {0}},
828 {-1, 1, {0, 1}, {0}},
829 {-1, 1, {1, 0}, {0}},
830 {-1, 1, {1, 1}, {0}},
831 {-1, 2, {2, 0}, {0}},
832 {-1, 2, {2, 1}, {0}},
833 {-1, 3, {3, 0}, {0}},
834 {-1, 3, {3, 1}, {0}}};
836 std::move(outVertexList),
890 {1, -1, {0, 0}, {1}},
891 {1, -1, {1, 0}, {3}},
892 {1, -1, {1, 1}, {4}},
893 {2, -1, {2, 0}, {5}},
894 {2, -1, {2, 1}, {6}},
895 {3, -1, {3, 0}, {7}},
896 {3, -1, {3, 1}, {8}}};
898 std::move(inVertexList),
902 {-1, 1, {0, 0}, {0}},
903 {-1, 1, {0, 1}, {0}},
904 {-1, 1, {1, 0}, {0}},
905 {-1, 1, {1, 1}, {0}},
906 {-1, 2, {2, 0}, {0}},
907 {-1, 2, {2, 1}, {0}},
908 {-1, 3, {3, 0}, {0}},
909 {-1, 3, {3, 1}, {0}}};
911 std::move(outVertexList),
959 *boost::unit_test::tolerance(1e-6))
966 {0, -1, {0, 0}, {1}},
967 {0, -1, {0, 1}, {2}},
968 {1, -1, {1, 0}, {3}},
969 {1, -1, {1, 1}, {4}},
970 {2, -1, {2, 0}, {5}},
971 {2, -1, {2, 1}, {6}},
972 {3, -1, {3, 0}, {7}},
973 {3, -1, {3, 1}, {8}}};
975 std::move(inVertexList),
979 {-1, 1, {0, 1}, {0}},
980 {-1, 1, {1, 0}, {0}},
981 {-1, 1, {1, 1}, {0}},
982 {-1, 2, {2, 0}, {0}},
983 {-1, 2, {2, 1}, {0}},
984 {-1, 3, {3, 0}, {0}},
985 {-1, 3, {3, 1}, {0}}};
987 std::move(outVertexList),
999 {1, {3.1307987056295525}},
1000 {1, {4.0734031184906971}},
1001 {1, {3.0620533966233006}},
1009 {2, {4.4582564956060873}},
1010 {2, {5.8784343572772633}},
1018 {3, {7.4683403859032156}},
1019 {3, {7.9287135404698859}}};
1021 testDistributed(context, mapping_sep, in,
out, ref, globalIndexOffsets.
at(context.rank),
true);
1031 {0, -1, {0, 0}, {1}},
1032 {0, -1, {0, 1}, {2}},
1033 {1, -1, {1, 0}, {3}},
1034 {1, -1, {1, 1}, {4}},
1035 {2, -1, {2, 0}, {5}},
1036 {2, -1, {2, 1}, {6}},
1037 {3, -1, {3, 0}, {7}},
1038 {3, -1, {3, 1}, {8}}};
1040 std::move(inVertexList),
1044 {-1, 0, {0, 0}, {0}},
1045 {-1, 1, {0, 1}, {0}},
1046 {-1, 1, {1, 0}, {0}},
1047 {-1, 0, {1, 1}, {0}},
1048 {-1, 2, {2, 0}, {0}},
1049 {-1, 2, {2, 1}, {0}},
1050 {-1, 3, {3, 0}, {0}},
1051 {-1, 3, {3, 1}, {0}}};
1053 std::move(outVertexList),
1106 {0, -1, {0, 0}, {1, 4}},
1107 {0, -1, {0, 1}, {2, 5}},
1108 {1, -1, {1, 0}, {3, 6}},
1109 {1, -1, {1, 1}, {4, 7}},
1110 {2, -1, {2, 0}, {5, 8}},
1111 {2, -1, {2, 1}, {6, 9}},
1112 {3, -1, {3, 0}, {7, 10}},
1113 {3, -1, {3, 1}, {8, 11}}};
1115 std::move(inVertexList),
1119 {-1, 0, {0, 0}, {0, 0}},
1120 {-1, 1, {0, 1}, {0, 0}},
1121 {-1, 1, {1, 0}, {0, 0}},
1122 {-1, 0, {1, 1}, {0, 0}},
1123 {-1, 2, {2, 0}, {0, 0}},
1124 {-1, 2, {2, 1}, {0, 0}},
1125 {-1, 3, {3, 0}, {0, 0}},
1126 {-1, 3, {3, 1}, {0, 0}}};
1128 std::move(outVertexList),
1194 mapping.setMeshes(inMesh, outMesh);
1195 mapping.tagMeshFirstRound();
1197 for (
const auto &v : inMesh->
vertices()) {
1200 return std::equal(spec.position.data(), spec.position.data() + meshDimension, v.getCoords().data());
1202 bool found = pos != shouldTagFirstRound.
vertices.
end();
1203 BOOST_TEST(found >= v.isTagged(),
1204 "FirstRound: Vertex " << v <<
" is tagged, but should not be.");
1205 BOOST_TEST(found <= v.isTagged(),
1206 "FirstRound: Vertex " << v <<
" is not tagged, but should be.");
1209 mapping.tagMeshSecondRound();
1211 for (
const auto &v : inMesh->
vertices()) {
1214 return std::equal(spec.position.data(), spec.position.data() + meshDimension, v.getCoords().data());
1216 bool foundFirst = posFirst != shouldTagFirstRound.
vertices.
end();
1219 return std::equal(spec.position.data(), spec.position.data() + meshDimension, v.getCoords().data());
1221 bool foundSecond = posSecond != shouldTagSecondRound.
vertices.
end();
1222 BOOST_TEST(foundFirst <= v.isTagged(),
"SecondRound: Vertex " << v
1223 <<
" is not tagged, but should be from the first round.");
1224 BOOST_TEST(foundSecond <= v.isTagged(),
"SecondRound: Vertex " << v
1225 <<
" is not tagged, but should be.");
1226 BOOST_TEST((foundSecond or foundFirst) >= v.isTagged(),
"SecondRound: Vertex " << v
1227 <<
" is tagged, but should not be.");
1240 {0, -1, {0, 0}, {0}}};
1242 std::move(outVertexList),
1246 {0, -1, {-1, 0}, {1}},
1247 {0, -1, {-2, 0}, {1}},
1248 {0, 0, {1, 0}, {1}},
1249 {0, -1, {2, 0}, {1}},
1250 {0, -1, {0, -1}, {1}},
1251 {0, -1, {0, -2}, {1}},
1252 {0, -1, {0, 1}, {1}},
1253 {0, -1, {0, 2}, {1}}
1256 std::move(inVertexList),
1260 {0, -1, {-1, 0}, {1}},
1261 {0, -1, {1, 0}, {1}},
1262 {0, -1, {0, -1}, {1}},
1263 {0, -1, {0, 1}, {1}}};
1267 static_cast<int>(firstRoundVertices.
at(0).position.size()),
1270 {0, -1, {2, 0}, {1}}};
1272 secondRoundVertices,
1273 static_cast<int>(secondRoundVertices.
at(0).position.size()),
1275 testTagging(context, inMeshSpec, outMeshSpec, shouldTagFirstRound, shouldTagSecondRound,
true);
1277 testTagging(context, outMeshSpec, inMeshSpec, shouldTagFirstRound, shouldTagSecondRound,
false);
1285#define doLocalCode(Type, function, polynomial) \
1287 RadialBasisFctMapping<RadialBasisFctSolver<Type>> consistentMap2D(Mapping::CONSISTENT, 2, function, {{false, false, false}}, polynomial); \
1288 perform2DTestConsistentMapping(consistentMap2D); \
1289 RadialBasisFctMapping<RadialBasisFctSolver<Type>> consistentMap2DVector(Mapping::CONSISTENT, 2, function, {{false, false, false}}, polynomial); \
1290 perform2DTestConsistentMappingVector(consistentMap2DVector); \
1291 RadialBasisFctMapping<RadialBasisFctSolver<Type>> consistentMap3D(Mapping::CONSISTENT, 3, function, {{false, false, false}}, polynomial); \
1292 perform3DTestConsistentMapping(consistentMap3D); \
1293 RadialBasisFctMapping<RadialBasisFctSolver<Type>> scaledConsistentMap2D(Mapping::SCALED_CONSISTENT_SURFACE, 2, function, {{false, false, false}}, polynomial); \
1294 perform2DTestScaledConsistentMapping(scaledConsistentMap2D); \
1295 RadialBasisFctMapping<RadialBasisFctSolver<Type>> scaledConsistentMap3D(Mapping::SCALED_CONSISTENT_SURFACE, 3, function, {{false, false, false}}, polynomial); \
1296 perform3DTestScaledConsistentMapping(scaledConsistentMap3D); \
1297 RadialBasisFctMapping<RadialBasisFctSolver<Type>> conservativeMap2D(Mapping::CONSERVATIVE, 2, function, {{false, false, false}}, polynomial); \
1298 perform2DTestConservativeMapping(conservativeMap2D); \
1299 RadialBasisFctMapping<RadialBasisFctSolver<Type>> conservativeMap2DVector(Mapping::CONSERVATIVE, 2, function, {{false, false, false}}, polynomial); \
1300 perform2DTestConservativeMappingVector(conservativeMap2DVector); \
1301 RadialBasisFctMapping<RadialBasisFctSolver<Type>> conservativeMap3D(Mapping::CONSERVATIVE, 3, function, {{false, false, false}}, polynomial); \
1302 perform3DTestConservativeMapping(conservativeMap3D); \
1346 double supportRadius = 1.2;
1354 double supportRadius = 1.2;
1362 double supportRadius = 1.2;
1370 double supportRadius = 1.2;
1378 double supportRadius = 1.2;
1386 double supportRadius = 1.2;
1394 using Eigen::Vector2d;
1403 {{xDead, yDead, zDead}}, polynomial);
1407 inMesh->createVertex(Vector2d(0.0, 1.0));
1408 inMesh->createVertex(Vector2d(1.0, 1.0));
1409 inMesh->createVertex(Vector2d(2.0, 1.0));
1410 inMesh->createVertex(Vector2d(3.0, 1.0));
1412 inMesh->setGlobalNumberOfVertices(inMesh->nVertices());
1414 Eigen::VectorXd values(4);
1415 values << 1.0, 2.0, 2.0, 1.0;
1427 mapping.setMeshes(inMesh, outMesh);
1428 BOOST_TEST(mapping.hasComputedMapping() ==
false);
1430 mapping.computeMapping();
1431 Eigen::VectorXd outValues(4);
1433 mapping.map(inSample, outValues);
1434 BOOST_TEST(mapping.hasComputedMapping() ==
true);
1436 if (polynomial == Polynomial::OFF) {
1438 }
else if (polynomial == Polynomial::SEPARATE) {
1444 if (polynomial == Polynomial::OFF) {
1446 }
else if (polynomial == Polynomial::SEPARATE) {
1456 using Eigen::Vector3d;
1464 Mapping mapping(constraint, dimensions, fct, {{xDead, yDead, zDead}}, polynomial);
1468 inMesh->createVertex(Vector3d(0.0, 3.0, 0.0));
1469 inMesh->createVertex(Vector3d(1.0, 3.0, 0.0));
1470 inMesh->createVertex(Vector3d(0.0, 3.0, 1.0));
1471 inMesh->createVertex(Vector3d(1.0, 3.0, 1.0));
1473 inMesh->setGlobalNumberOfVertices(inMesh->nVertices());
1475 Eigen::VectorXd values(4);
1476 values << 1.0, 2.0, 3.0, 4.0;
1488 mapping.setMeshes(inMesh, outMesh);
1489 BOOST_TEST(mapping.hasComputedMapping() ==
false);
1491 mapping.computeMapping();
1492 Eigen::VectorXd outValues(4);
1494 mapping.map(inSample, outValues);
1495 BOOST_TEST(mapping.hasComputedMapping() ==
true);
1498 if (polynomial == Polynomial::OFF) {
1499 const double tolerance = 1e-7;
1500 Eigen::VectorXd expected(4);
1501 expected << 1.0, -0.454450524334, 0.99146426249, 6.98958304876;
1504 Eigen::VectorXd expected(4);
1505 expected << 1.0, 2.0, 2.9, 4.3;
1509 if (polynomial == Polynomial::OFF) {
1510 const double tolerance = 1e-6;
1511 Eigen::VectorXd expected(4);
1512 expected << 1.17251596926, 4.10368825944, 3.56931954192, 3.40160932341;
1514 }
else if (polynomial == Polynomial::ON) {
1515 const double tolerance = 1e-6;
1516 Eigen::VectorXd expected(4);
1517 expected << 0.856701171969, 2.38947124326, 3.34078733786, 3.41304024691;
1520 const double tolerance = 1e-6;
1521 Eigen::VectorXd expected(4);
1522 expected << 0.380480856704, 2.83529451713, 3.73088270249, 3.05334192368;
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)
BOOST_AUTO_TEST_CASE(DistributedConsistent2DV1)
Test with a homogeneous distribution of mesh among ranks.
Eigen::VectorXd getDistributedData(const TestContext &context, MeshSpecification const &meshSpec)
mesh::PtrMesh getDistributedMesh(const TestContext &context, MeshSpecification &meshSpec, int globalIndexOffset=0, bool meshIsSmaller=false)
#define doLocalCode(Type, function, polynomial)
#define PRECICE_TEST(...)
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::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...
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