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
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" 140 void 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)
186 const polyMesh&
mesh,
187 const meshSearch& searchEngine,
189 const List<point>& sampleCoords
192 sampledSet(
name,
mesh, searchEngine, axis),
193 sampleCoords_(sampleCoords)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
Typename for Field.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
A class for handling words, derived from Foam::string.
const word & name() const noexcept
The coord-set name.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
#define WarningInFunction
Report a warning using Foam::Warning.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const meshSearch & searchEngine() const noexcept
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
cloudSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const List< point > &sampleCoords)
Construct from components.
static void listCombineReduce(List< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
After completion all processors have the same data.