46void Foam::cellCentreSet::genSamples()
50 const globalIndex globalSampleNumbers(len);
52 const auto& cellCentres =
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)
108 const polyMesh&
mesh,
109 const meshSearch& searchEngine,
134 dict.getOrDefault<
word>(
"axis",
"xyz")
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
static const Field< vector > & null() noexcept
A bounding box defined in terms of min/max extrema points.
bool empty() const
Bounding box is inverted, contains no points.
A sampleSet based on cell centres.
cellCentreSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const boundBox &bbox=boundBox::null())
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.
label nCells() const noexcept
Number of mesh cells.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
const meshSearch & searchEngine() const noexcept
void setSamples(const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingDistance)
Set sample data. Copy list contents.
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.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
List< scalar > scalarList
List of scalar.
#define forAll(list, i)
Loop across all elements in list.