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;
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
A list that is sorted upon construction or when explicitly requested with the sort() method.
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const
Return the number of elements in the UList.
Determine correspondence between points. See below.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
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,.
vector point
Point is a vector.
dimensioned< scalar > mag(const dimensioned< Type > &)
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.
prefixOSstream Pout(cout, "Pout")
dimensioned< scalar > magSqr(const dimensioned< Type > &)