Go to the documentation of this file.
30 template<
class SourcePatch,
class TargetPatch>
41 const labelList& srcNbr = this->srcPatch_.faceFaces()[srcFaceI];
42 const labelList& tgtNbr = this->tgtPatch_.faceFaces()[tgtFaceI];
44 const pointField& srcPoints = this->srcPatch_.points();
45 const pointField& tgtPoints = this->tgtPatch_.points();
47 const vectorField& srcCf = this->srcPatch_.faceCentres();
51 label srcI = srcNbr[i];
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));
74 label tgtI = tgtNbr[j];
75 const face& tgtF = this->tgtPatch_[tgtI];
78 if (
mag(srcC - tgtC) < tol)
83 srcTgtSeed[srcI] = tgtI;
97 label tgtI = tgtNbr[j];
98 const face& tgtF = this->tgtPatch_[tgtI];
99 pointHit ray = tgtF.
ray(srcCf[srcI], srcN, tgtPoints);
106 srcTgtSeed[srcI] = tgtI;
118 nonOverlapFaces.
append(srcI);
122 Pout<<
"source face not found: id=" << srcI
123 <<
" centre=" << srcCf[srcI]
124 <<
" normal=" << srcF.
normal(srcPoints)
125 <<
" points=" << srcF.
points(srcPoints)
128 Pout<<
"target neighbours:" <<
nl;
131 label tgtI = tgtNbr[j];
132 const face& tgtF = this->tgtPatch_[tgtI];
134 Pout<<
"face id: " << tgtI
135 <<
" centre=" << tgtF.
centre(tgtPoints)
136 <<
" normal=" << tgtF.
normal(tgtPoints)
137 <<
" points=" << tgtF.
points(tgtPoints)
147 srcFaceI = srcSeeds.
remove();
148 tgtFaceI = srcTgtSeed[srcFaceI];
158 template<
class SourcePatch,
class TargetPatch>
169 if (mapFlag[faceI] == 0)
171 tgtFaceI = this->findTargetFace(faceI);
176 nonOverlapFaces.
append(faceI);
190 template<
class SourcePatch,
class TargetPatch>
193 const SourcePatch& srcPatch,
194 const TargetPatch& tgtPatch,
198 const bool reverseTarget,
199 const bool requireMatch
217 template<
class SourcePatch,
class TargetPatch>
224 template<
class SourcePatch,
class TargetPatch>
265 srcTgtSeed[srcFaceI] = tgtFaceI;
275 srcAddr[srcFaceI].
append(tgtFaceI);
276 tgtAddr[tgtFaceI].
append(srcFaceI);
278 mapFlag[srcFaceI] = 1;
293 if (srcFaceI < 0 && nTested < this->srcPatch_.size())
295 restartAdvancingFront(mapFlag, nonOverlapFaces, srcFaceI, tgtFaceI);
298 }
while (srcFaceI >= 0);
300 if (nonOverlapFaces.size() != 0)
302 Pout<<
" AMI: " << nonOverlapFaces.size()
303 <<
" non-overlap faces identified"
306 this->srcNonOverlap_.transfer(nonOverlapFaces);
312 scalar magSf = this->srcMagSf_[i];
318 scalar magSf = this->tgtMagSf_[i];
vector normal(const pointField &) const
Vector normal; magnitude is equal to area of face.
List< scalar > scalarList
A List of scalars.
void restartAdvancingFront(labelList &mapFlag, DynamicList< label > &nonOverlapFaces, label &srcFaceI, label &tgtFaceI) const
Restart the advancing front - typically happens for.
pointHit ray(const point &p, const vector &n, const pointField &, const intersection::algorithm alg=intersection::FULL_RAY, const intersection::direction dir=intersection::VECTOR) const
Return potential intersection with face with a ray starting.
bool hit() const
Is there a hit.
#define forAll(list, i)
Loop across all elements in list.
This class describes the interaction of a face and a point. It carries the info of a successful hit a...
virtual void calculate(labelListList &srcAddress, scalarListList &srcWeights, labelListList &tgtAddress, scalarListList &tgtWeights, label srcFaceI=-1, label tgtFaceI=-1)
Update addressing and weights.
point centre(const pointField &) const
Centre point of face.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
Base class for Arbitrary Mesh Interface (AMI) methods.
virtual ~directAMI()
Destructor.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
void append(const T &)
Append an element at the end of the list.
directAMI(const directAMI &)
Disallow default bitwise copy construct.
pointField points(const pointField &) const
Return the points corresponding to this face.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
T remove()
Remove and return the top element.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
void appendToDirectSeeds(labelList &mapFlag, labelList &srcTgtSeed, DynamicList< label > &srcSeeds, DynamicList< label > &nonOverlapFaces, label &srcFaceI, label &tgtFaceI) const
Append to list of src face seed indices.
dimensioned< scalar > magSqr(const dimensioned< Type > &)