50 void Foam::patchCloudSet::calcSamples
52 DynamicList<point>& samplingPts,
53 DynamicList<label>& samplingCells,
54 DynamicList<label>& samplingFaces,
55 DynamicList<label>& samplingSegments,
56 DynamicList<scalar>& samplingCurveDist
63 for (
const label patchi : patchSet_)
69 DebugInfo <<
" " << pp.name() <<
" size " << pp.size() <<
endl;
75 for (
const label patchi : patchSet_)
81 patchFaces[sz++] = pp.start()+i;
85 bb.add(pp.points(), pp.meshPoints());
98 indexedOctree<treeDataFace> patchTree
117 List<mappedPatchBase::nearInfo> nearest(sampleCoords_.size());
119 forAll(sampleCoords_, sampleI)
126 if (patchFaces.size())
128 nearInfo = patchTree.findNearest(
sample,
sqr(searchDist_));
139 nearest[sampleI].second().first() =
Foam::sqr(GREAT);
145 nearInfo.setIndex(patchFaces[nearInfo.index()]);
147 nearest[sampleI].second().first() =
magSqr
170 Info<<
"Dumping mapping as lines from supplied points to"
171 <<
" nearest patch face to file " << str.name() <<
endl;
177 if (nearest[i].first().hit())
183 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
198 label facei = nearInfo.index();
200 samplingPts.append(nearInfo.hitPoint());
201 samplingCells.append(
mesh().faceOwner()[facei]);
202 samplingFaces.append(facei);
203 samplingSegments.append(0);
204 samplingCurveDist.append(1.0 * sampleI);
213 samplingPts.append(sampleCoords_[sampleI]);
214 samplingCells.append(-1);
215 samplingFaces.append(-1);
216 samplingSegments.append(0);
217 samplingCurveDist.append(1.0 * sampleI);
224 void Foam::patchCloudSet::genSamples()
227 DynamicList<point> samplingPts;
228 DynamicList<label> samplingCells;
229 DynamicList<label> samplingFaces;
230 DynamicList<label> samplingSegments;
231 DynamicList<scalar> samplingCurveDist;
242 samplingPts.shrink();
243 samplingCells.shrink();
244 samplingFaces.shrink();
245 samplingSegments.shrink();
246 samplingCurveDist.shrink();
269 const polyMesh&
mesh,
270 const meshSearch& searchEngine,
272 const List<point>& sampleCoords,
274 const scalar searchDist
277 sampledSet(
name,
mesh, searchEngine, axis),
278 sampleCoords_(sampleCoords),
280 searchDist_(searchDist)
300 searchDist_(
dict.
get<scalar>(
"maxDistance"))