46void Foam::cellCentreSet::genSamples()
50 const globalIndex globalSampleNumbers(len);
52 const auto& cellCentres =
53 refCast<const fvMesh>(
mesh()).C().primitiveField();
56 List<point> selectedPoints;
60 selectedPoints = cellCentres;
65 for (label celli=0; celli < len; ++celli)
67 if (bounds_.
contains(cellCentres[celli]))
69 selectedCells[
count++] = celli;
73 selectedCells.resize(
count);
74 selectedPoints = UIndirectList<point>(cellCentres, selectedCells);
77 labelList samplingFaces(selectedCells.size(), -1);
79 scalarList samplingCurveDist(selectedCells.size());
83 samplingCurveDist[i] = globalSampleNumbers.toGlobal(selectedCells[i]);
89 std::move(selectedPoints),
90 std::move(selectedCells),
91 std::move(samplingFaces),
92 std::move(samplingSegments),
93 std::move(samplingCurveDist)
134 dict.getOrDefault<
word>(
"axis",
"xyz")
136 bounds_(
dict.getOrDefault(
"bounds",
boundBox::invertedBox))
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A bounding box defined in terms of min/max extrema points.
bool contains(const point &pt) const
Contains point? (inside or on edge)
bool empty() const
Bounding box is inverted, contains no points.
A sampleSet based on cell centres.
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.
label nCells() const noexcept
Number of mesh cells.
int count() const noexcept
Return the current reference count.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
void setSamples(const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingDistance)
Set sample data. Copy list contents.
const polyMesh & mesh() const noexcept
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< scalar > scalarList
A List of scalars.
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#define forAll(list, i)
Loop across all elements in list.