46 void 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)
108 const polyMesh&
mesh,
109 const meshSearch& searchEngine,
114 sampledSet(
name,
mesh, searchEngine, axis),
134 dict.getOrDefault<
word>(
"axis",
"xyz")
List< scalar > scalarList
List of scalar.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
bool contains(const point &pt) const
Contains point? (inside or on edge)
bool empty() const
Bounding box is inverted, contains no points.
A bounding box defined in terms of min/max extrema points.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Ostream & write(Ostream &) const
Output for debugging.
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...
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
A class for handling words, derived from Foam::string.
const polyMesh & mesh() const noexcept
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
label nCells() const noexcept
Number of mesh cells.
cellCentreSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const boundBox &bbox=boundBox::null())
Construct from components.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void setSamples(const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingDistance)
Set sample data. Copy list contents.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
static constexpr const zero Zero
Global zero (0)