61 const Matcher & matcher,
const std::string type_)
67 std::vector<std::string> matchedSides;
68 std::vector<std::pair<size_t,size_t> > previousMatches;
81 const Matcher & matcher,
const std::vector<std::string> & matchedSides,
82 const std::vector<std::pair<size_t,size_t> > & previousMatches,
83 const std::string type_)
91 SphereIdVector coordsIdsA, coordsIdsB;
92 std::vector<SearchId> IDsToRemap;
97 auto error = matcher.getAbsoluteTolerance();
99 fillLocalSearchVector(mesh,coordsIdsA,error,sideA,type_,
true,matchedSides,IDsToRemap);
100 fillLocalSearchVector(mesh,coordsIdsB,error,sideB,type_,
false);
106 std::vector<double> centroidA = computeGlobalCentroid(mesh,sideA);
112 SearchPairVector results;
113 stk::search::coarse_search(coordsIdsA,coordsIdsB,stk::search::KDTREE,mesh.
getBulkData()->parallel(),results);
123 Teuchos::RCP<std::vector<std::pair<size_t,size_t> > > myMap
124 = Teuchos::rcp(
new std::vector<std::pair<size_t,size_t>>());
126 for (
size_t i=0; i<results.size(); ++i) {
127 if (results[i].first.proc() == myRank) {
129 (*myMap).emplace_back(
130 std::pair<size_t,size_t>(results[i].first.id().id(),results[i].second.id().id()) );
134 TEUCHOS_TEST_FOR_EXCEPTION((*myMap).size()!=coordsIdsA.size(),std::logic_error,
135 "matchPeriodicSidesSearch: error in local match. "
136 "Number of matched IDs not equal to number of requested matches!");
138 if (matchedSides.size()>0) {
141 updateMapping(myMap,previousMatches,IDsToRemap,mesh);
142 }
else if (previousMatches.size()>0) {
145 appendMapping(myMap,previousMatches);