35 const word callerName,
41 if (userBounds.
good() && !userBounds.
overlaps(meshBounds))
45 <<
" : Bounds " << userBounds
46 <<
" do not overlap the mesh bounding box " << meshBounds
55 const boundBox& userBounds,
56 const wordRes& zoneNames,
68 cellsToSelect =
mesh.cellZones().selection(zoneNames);
83 const auto& cellCentres =
static_cast<const fvMesh&
>(
mesh).
C();
85 if (userBounds.empty())
94 for (
const label celli : cellsToSelect)
96 const point& cc = cellCentres[celli];
108 for (
const label celli : cellsToSelect)
110 const point& cc = cellCentres[celli];
114 if (!userBounds.contains(cc))
116 cellsToSelect.unset(celli);
128 cellsToSelect.resize(len);
130 for (label celli=0; celli < len; ++celli)
132 const point& cc = cellCentres[celli];
134 if (userBounds.contains(cc))
136 cellsToSelect.set(celli);
141 return cellsToSelect;
150 const word callerName,
159 mesh, userBounds, zoneNames, meshBounds
164 checkOverlap(callerName, meshBounds, userBounds);
167 return cellsToSelect;
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5)
void resize(const label numElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void set(const bitSet &bitset)
Set specified bits from another bitset.
A bounding box defined in terms of min/max extrema points.
bool overlaps(const boundBox &bb) const
Overlaps/touches boundingBox?
void reduce()
Inplace parallel reduction of min/max values, using UPstream::worldComm.
bool contains(const point &pt) const
Contains point? (inside or on edge).
bool empty() const
Bounding box is inverted, contains no points.
void add(const boundBox &bb)
Extend to include the second box.
bool good() const
Bounding box is non-inverted.
void clear()
Same as reset() - reset to an inverted box.
static void checkOverlap(const word callerName, const boundBox &meshBounds, const boundBox &userBounds)
Check and warn if bounding boxes do not intersect.
static bitSet cellSelection(const polyMesh &mesh, const boundBox &userBounds, const wordRes &zoneNames, boundBox &meshBounds)
Define cell selection from bounding-box and zones.
Mesh data needed to do the Finite Volume discretisation.
Mesh consisting of general polyhedral cells.
const boundBox & bounds() const noexcept
Return mesh bounding box.
label nCells() const noexcept
Number of mesh cells.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define WarningInFunction
Report a warning using Foam::Warning.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
vector point
Point is a vector.
constexpr char nl
The newline '\n' character (0x0a).