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)
int debug
Static debugging option.
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
Output for debugging.
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
Global zero (0)
static const boundBox invertedBox
A large inverted boundBox: min/max == +/- ROOTVGREAT.
cellCentreSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const boundBox &bbox=boundBox::invertedBox)
Construct from components.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
label nCells() const noexcept
Number of mesh cells.
messageStream Info
Information stream (stdout output on master, null elsewhere)
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 empty() const
Bounding box is inverted, contains no points.
bool contains(const point &pt) const
Contains point? (inside or on edge)
const polyMesh & mesh() const
void setSamples(const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingCurveDist)
Set sample data. Copy list contents.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
A bounding box defined in terms of min/max extrema points.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
defineTypeNameAndDebug(combustionModel, 0)