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()
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
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 vector of objects of type <T> that resizes itself as necessary to accept the new objects.
static const char *const typeName
Typename for Field.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static void listReduce(UList< T > &values, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce list elements (list must be equal size on all ranks), applying bop to each list element.
bool get(const label i) const
void size(const label n)
Older name for setAddressableSize.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
Samples at arbitrary locations with a volume mesh.
cloudSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const List< point > &sampleCoords)
Construct from components.
const word & axis() const
The sort axis name.
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.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
const meshSearch & searchEngine() const noexcept
sampledSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const coordSet::coordFormat axisType)
Construct from components.
const polyMesh & mesh() 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.
Namespace for handling debugging switches.
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 expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.