32 template<
class SourcePatch,
class TargetPatch>
37 DynamicList<label>& srcSeeds,
38 DynamicList<label>& nonOverlapFaces,
43 const labelList& srcNbr = this->srcPatch_.faceFaces()[srcFacei];
44 const labelList& tgtNbr = this->tgtPatch_.faceFaces()[tgtFacei];
46 const pointField& srcPoints = this->srcPatch_.points();
47 const pointField& tgtPoints = this->tgtPatch_.points();
49 const vectorField& srcCf = this->srcPatch_.faceCentres();
51 for (
const label srcI : srcNbr)
53 if ((mapFlag[srcI] == 0) && (srcTgtSeed[srcI] == -1))
56 const face& srcF = this->srcPatch_[srcI];
57 const point& srcC = srcCf[srcI];
62 const point&
p = srcPoints[srcF[fpI]];
69 tol =
max(SMALL, 0.0001*
sqrt(tol));
72 for (
const label tgtI : tgtNbr)
74 const face& tgtF = this->tgtPatch_[tgtI];
77 if (
mag(srcC - tgtC) < tol)
82 srcTgtSeed[srcI] = tgtI;
83 srcSeeds.append(srcI);
92 const vector srcN = srcF.areaNormal(srcPoints);
94 for (
const label tgtI : tgtNbr)
96 const face& tgtF = this->tgtPatch_[tgtI];
97 pointHit ray = tgtF.ray(srcCf[srcI], srcN, tgtPoints);
104 srcTgtSeed[srcI] = tgtI;
105 srcSeeds.append(srcI);
116 nonOverlapFaces.append(srcI);
120 Pout<<
"source face not found: id=" << srcI
121 <<
" centre=" << srcCf[srcI]
122 <<
" normal=" << srcF.areaNormal(srcPoints)
123 <<
" points=" << srcF.points(srcPoints)
126 Pout<<
"target neighbours:" <<
nl;
127 for (
const label tgtI : tgtNbr)
129 const face& tgtF = this->tgtPatch_[tgtI];
131 Pout<<
"face id: " << tgtI
132 <<
" centre=" << tgtF.centre(tgtPoints)
133 <<
" normal=" << tgtF.areaNormal(tgtPoints)
134 <<
" points=" << tgtF.points(tgtPoints)
144 srcFacei = srcSeeds.remove();
145 tgtFacei = srcTgtSeed[srcFacei];
155 template<
class SourcePatch,
class TargetPatch>
159 DynamicList<label>& nonOverlapFaces,
166 if (mapFlag[facei] == 0)
168 tgtFacei = this->findTargetFace(facei);
173 nonOverlapFaces.append(facei);
187 template<
class SourcePatch,
class TargetPatch>
190 const SourcePatch& srcPatch,
191 const TargetPatch& tgtPatch,
193 const bool reverseTarget,
194 const bool requireMatch
210 template<
class SourcePatch,
class TargetPatch>
217 template<
class SourcePatch,
class TargetPatch>
257 labelList srcTgtSeed(srcAddr.size(), -1);
258 srcTgtSeed[srcFacei] = tgtFacei;
268 srcAddr[srcFacei].
append(tgtFacei);
269 tgtAddr[tgtFacei].append(srcFacei);
271 mapFlag[srcFacei] = 1;
286 if (srcFacei < 0 && nTested < this->srcPatch_.size())
288 restartAdvancingFront(mapFlag, nonOverlapFaces, srcFacei, tgtFacei);
291 }
while (srcFacei >= 0);
293 if (nonOverlapFaces.size() != 0)
295 Pout<<
" AMI: " << nonOverlapFaces.size()
296 <<
" non-overlap faces identified"
299 this->srcNonOverlap_.transfer(nonOverlapFaces);
305 scalar magSf = this->srcMagSf_[i];
311 scalar magSf = this->tgtMagSf_[i];
318 template<
class SourcePatch,
class TargetPatch>
321 const TargetPatch& tgtPatch,
327 srcMagSf = std::move(this->srcMagSf_);
332 template<
class SourcePatch,
class TargetPatch>
339 inter.normaliseWeights(this->conformal(), verbose);