49void Foam::cloudSet::calcSamples
51 DynamicList<point>& samplingPts,
52 DynamicList<label>& samplingCells,
53 DynamicList<label>& samplingFaces,
54 DynamicList<label>& samplingSegments,
55 DynamicList<scalar>& samplingCurveDist
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);
82 if (foundProc[i] != -1)
84 minFoundProc[i] = foundProc[i];
91 DynamicField<point> missingPoints(sampleCoords_.
size());
93 forAll(sampleCoords_, sampleI)
95 if (maxFoundProc[sampleI] == -1)
98 missingPoints.append(sampleCoords_[sampleI]);
100 else if (minFoundProc[sampleI] != maxFoundProc[sampleI])
103 <<
"For sample set " <<
name()
104 <<
" location " << sampleCoords_[sampleI]
105 <<
" seems to be on multiple domains: "
106 << minFoundProc[sampleI] <<
" and " << maxFoundProc[sampleI]
108 <<
"This might happen if the location is on"
109 <<
" a processor patch. Change the location slightly"
110 <<
" to prevent this." <<
endl;
115 if (missingPoints.size() > 0)
117 if (missingPoints.size() < 100 || debug)
120 <<
"For sample set " <<
name()
121 <<
" did not found " << missingPoints.size()
122 <<
" points out of " << sampleCoords_.
size()
124 <<
"Missing points:" << missingPoints <<
endl;
129 <<
"For sample set " <<
name()
130 <<
" did not found " << missingPoints.size()
131 <<
" points out of " << sampleCoords_.
size()
133 <<
"Print missing points by setting the debug flag"
140void Foam::cloudSet::genSamples()
143 DynamicList<point> samplingPts;
144 DynamicList<label> samplingCells;
145 DynamicList<label> samplingFaces;
146 DynamicList<label> samplingSegments;
147 DynamicList<scalar> samplingCurveDist;
158 samplingPts.shrink();
159 samplingCells.shrink();
160 samplingFaces.shrink();
161 samplingSegments.shrink();
162 samplingCurveDist.shrink();
167 std::move(samplingPts),
168 std::move(samplingCells),
169 std::move(samplingFaces),
170 std::move(samplingSegments),
171 std::move(samplingCurveDist)
193 sampleCoords_(sampleCoords)
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static void listCombineAllGather(const List< commsStruct > &comms, List< T > &values, const CombineOp &cop, const int tag, const label comm)
After completion all processors have the same data.
void size(const label n)
Older name for setAddressableSize.
Samples at arbitrary locations with a volume mesh.
const word & name() const noexcept
The coord-set name.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Mesh consisting of general polyhedral cells.
int myProcNo() const noexcept
Return processor number.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
const meshSearch & searchEngine() const noexcept
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
The type name used in ensight case files.