Go to the documentation of this file.
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")
136 bounds_(
dict.getOrDefault(
"bounds",
boundBox::invertedBox))
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Holds list of sampling points which is filled at construction time. Various implementations of this b...
List< label > labelList
A List of labels.
List< scalar > scalarList
A List of scalars.
Ostream & write(Ostream &) const
A class for handling words, derived from Foam::string.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
static constexpr const zero Zero
static const boundBox invertedBox
cellCentreSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const boundBox &bbox=boundBox::invertedBox)
Mesh consisting of general polyhedral cells.
label nCells() const noexcept
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
bool contains(const point &pt) const
const polyMesh & mesh() const
void setSamples(const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingCurveDist)
unsigned int count(const UList< bool > &bools, const bool val=true)
labelList identity(const label len, label start=0)
A bounding box defined in terms of min/max extrema points.
word name(const expressions::valueTypeCode typeCode)
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
defineTypeNameAndDebug(combustionModel, 0)