45 bool fullMatch =
true;
47 point compareOrigin = origin;
49 if (origin ==
point(vGreat, vGreat, vGreat))
53 compareOrigin =
sum(pts1)/pts1.
size();
63 scalar dist0 = pts0MagSqr[i];
67 scalar matchDist = matchDistances[face0I];
78 scalar minDistSqr = vGreat;
85 (j < pts1MagSqr.
size())
86 && (pts1MagSqr[j] < 1.00001*dist0 + 2*matchDist)
93 scalar distSqr =
magSqr(pts0[face0I] - pts1[facei]);
95 if (distSqr <=
sqr(matchDist) && distSqr < minDistSqr)
108 Pout<<
"Cannot find point in pts1 matching point " << face0I
109 <<
" coord:" << pts0[face0I]
110 <<
" in pts0 when using tolerance " << matchDist <<
endl;
113 Pout<<
"Searching started from:" << startI <<
" in pts1" 119 (j < pts1MagSqr.
size())
120 && (pts1MagSqr[j] < 1.00001*dist0 + 2*matchDist)
127 Pout<<
" Compared coord: " << pts1[facei]
129 <<
" with difference to point " 130 <<
mag(pts1[facei] - pts0[face0I]) <<
endl;
135 from0To1[face0I] = minFacei;
157 bool fullMatch =
true;
159 point compareOrigin = origin;
161 if (origin ==
point(vGreat, vGreat, vGreat))
165 compareOrigin =
sum(pts1)/pts1.
size();
175 scalar dist0 = pts0MagSqr[i];
179 scalar matchDist = matchDistances[face0I];
181 label startI =
findLower(pts1MagSqr, 0.99999*dist0 - 2*matchDist);
189 scalar minDistSqr = vGreat;
190 scalar minDistNorm = 0;
197 (j < pts1MagSqr.
size())
198 && (pts1MagSqr[j] < 1.00001*dist0 + 2*matchDist)
205 scalar distSqr =
magSqr(pts0[face0I] - pts1[facei]);
207 scalar distNorm = (pts0Dir[face0I] & pts1Dir[facei]);
218 if (distSqr <=
sqr(matchDist) && distSqr < minDistSqr)
221 if (distNorm < minDistNorm)
223 minDistNorm = distNorm;
224 minDistSqr = distSqr;
236 Pout<<
"Cannot find point in pts1 matching point " << face0I
237 <<
" coord:" << pts0[face0I]
238 <<
" in pts0 when using tolerance " << matchDist <<
endl;
241 Pout<<
"Searching started from:" << startI <<
" in pts1" 247 (j < pts1MagSqr.
size())
248 && (pts1MagSqr[j] < 1.00001*dist0 + 2*matchDist)
255 Pout<<
" Compared coord: " << pts1[facei]
257 <<
" with difference to point " 258 <<
mag(pts1[facei] - pts0[face0I]) <<
endl;
263 from0To1[face0I] = minFacei;
#define forAll(list, i)
Loop across all elements in list.
A list that is sorted upon construction or when explicitly requested with the sort() method...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Determine correspondence between points. See below.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Various functions to operate on Lists.
bool matchPoints(const UList< point > &pts0, const UList< point > &pts1, const UList< scalar > &matchDistance, const bool verbose, labelList &from0To1, const point &origin=point::zero)
Determine correspondence between pointFields. Gets passed.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
vector point
Point is a vector.
prefixOSstream Pout(cout, "Pout")
label findLower(const ListType &, typename ListType::const_reference, const label stary, const BinaryOp &bop)
Find last element < given value in sorted list and return index,.
dimensioned< scalar > mag(const dimensioned< Type > &)
label size() const
Return the number of elements in the UList.