49 void Foam::cloudSet::calcSamples
51 DynamicList<point>& samplingPts,
52 DynamicList<label>& samplingCells,
53 DynamicList<label>& samplingFaces,
54 DynamicList<label>& samplingSegments,
55 DynamicList<scalar>& samplingCurveDist
60 labelList foundProc(sampleCoords_.size(), -1);
61 forAll(sampleCoords_, sampleI)
63 label celli = queryMesh.findCell(sampleCoords_[sampleI]);
67 samplingPts.append(sampleCoords_[sampleI]);
68 samplingCells.append(celli);
69 samplingFaces.append(-1);
70 samplingSegments.append(0);
71 samplingCurveDist.append(1.0 * sampleI);
85 if (foundProc[i] != -1)
87 minFoundProc[i] = foundProc[i];
94 DynamicField<point> missingPoints(sampleCoords_.size());
96 forAll(sampleCoords_, sampleI)
98 if (maxFoundProc[sampleI] == -1)
101 missingPoints.append(sampleCoords_[sampleI]);
103 else if (minFoundProc[sampleI] != maxFoundProc[sampleI])
106 <<
"For sample set " <<
name()
107 <<
" location " << sampleCoords_[sampleI]
108 <<
" seems to be on multiple domains: "
109 << minFoundProc[sampleI] <<
" and " << maxFoundProc[sampleI]
111 <<
"This might happen if the location is on"
112 <<
" a processor patch. Change the location slightly"
113 <<
" to prevent this." <<
endl;
118 if (missingPoints.size() > 0)
120 if (missingPoints.size() < 100 ||
debug)
123 <<
"For sample set " <<
name()
124 <<
" did not found " << missingPoints.size()
125 <<
" points out of " << sampleCoords_.size()
127 <<
"Missing points:" << missingPoints <<
endl;
132 <<
"For sample set " <<
name()
133 <<
" did not found " << missingPoints.size()
134 <<
" points out of " << sampleCoords_.size()
136 <<
"Print missing points by setting the debug flag"
137 <<
" for " << cloudSet::typeName <<
endl;
143 void Foam::cloudSet::genSamples()
146 DynamicList<point> samplingPts;
147 DynamicList<label> samplingCells;
148 DynamicList<label> samplingFaces;
149 DynamicList<label> samplingSegments;
150 DynamicList<scalar> samplingCurveDist;
161 samplingPts.shrink();
162 samplingCells.shrink();
163 samplingFaces.shrink();
164 samplingSegments.shrink();
165 samplingCurveDist.shrink();
170 std::move(samplingPts),
171 std::move(samplingCells),
172 std::move(samplingFaces),
173 std::move(samplingSegments),
174 std::move(samplingCurveDist)
196 sampleCoords_(sampleCoords)