29 const Matcher & matcher,
const std::string type_)
35 std::vector<std::string> matchedSides;
36 std::vector<std::pair<size_t,size_t> > previousMatches;
49 const Matcher & matcher,
const std::vector<std::string> & matchedSides,
50 const std::vector<std::pair<size_t,size_t> > & previousMatches,
51 const std::string type_)
59 SphereIdVector coordsIdsA, coordsIdsB;
60 std::vector<SearchId> IDsToRemap;
65 auto error = matcher.getAbsoluteTolerance();
67 fillLocalSearchVector(mesh,coordsIdsA,error,sideA,type_,
true,matchedSides,IDsToRemap);
68 fillLocalSearchVector(mesh,coordsIdsB,error,sideB,type_,
false);
74 std::vector<double> centroidA = computeGlobalCentroid(mesh,sideA);
80 SearchPairVector results;
81 stk::search::coarse_search(coordsIdsA,coordsIdsB,stk::search::KDTREE,mesh.
getBulkData()->parallel(),results);
91 Teuchos::RCP<std::vector<std::pair<size_t,size_t> > > myMap
92 = Teuchos::rcp(
new std::vector<std::pair<size_t,size_t>>());
94 for (
size_t i=0; i<results.size(); ++i) {
95 if (results[i].first.proc() == myRank) {
97 (*myMap).emplace_back(
98 std::pair<size_t,size_t>(results[i].first.id().id(),results[i].second.id().id()) );
102 TEUCHOS_TEST_FOR_EXCEPTION((*myMap).size()!=coordsIdsA.size(),std::logic_error,
103 "matchPeriodicSidesSearch: error in local match. "
104 "Number of matched IDs not equal to number of requested matches!");
106 if (matchedSides.size()>0) {
109 updateMapping(myMap,previousMatches,IDsToRemap,mesh);
110 }
else if (previousMatches.size()>0) {
113 appendMapping(myMap,previousMatches);