Go to the documentation of this file.
35 const word callerName,
45 <<
" : Bounds " << userBounds
46 <<
" do not overlap the mesh bounding box " << meshBounds
66 (-1 !=
mesh.cellZones().findIndex(zoneNames)),
72 cellsToSelect =
mesh.cellZones().selection(zoneNames);
85 meshBounds =
mesh.bounds();
87 const auto& cellCentres =
static_cast<const fvMesh&
>(
mesh).
C();
89 if (userBounds.
empty())
98 for (
const label celli : cellsToSelect)
100 const point& cc = cellCentres[celli];
112 for (
const label celli : cellsToSelect)
114 const point& cc = cellCentres[celli];
120 cellsToSelect.unset(celli);
130 const label len =
mesh.nCells();
132 cellsToSelect.
resize(len);
134 for (label celli=0; celli < len; ++celli)
136 const point& cc = cellCentres[celli];
140 cellsToSelect.
set(celli);
145 return cellsToSelect;
154 const word callerName,
161 cuttingSurfaceBase::cellSelection
163 mesh, userBounds, zoneNames, meshBounds
168 checkOverlap(callerName, meshBounds, userBounds);
171 return cellsToSelect;
void reduce()
Parallel reduction of min/max values.
A class for handling words, derived from Foam::string.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
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.
static void checkOverlap(const word callerName, const boundBox &meshBounds, const boundBox &userBounds)
Check and warn if bounding boxes do not intersect.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bitSet cellSelection(const polyMesh &mesh, const boundBox &userBounds, const wordRes &zoneNames, boundBox &meshBounds)
Define cell selection from bounding-box and zones.
void resize(const label nElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
Mesh consisting of general polyhedral cells.
bool overlaps(const boundBox &bb) const
Overlaps/touches boundingBox?
Mesh data needed to do the Finite Volume discretisation.
bool empty() const
Bounding box is inverted, contains no points.
void clear()
Clear bounding box and make it an inverted box.
bool contains(const point &pt) const
Contains point? (inside or on edge)
A List of wordRe with additional matching capabilities.
A bounding box defined in terms of min/max extrema points.
bool valid() const
Bounding box is non-inverted.
#define WarningInFunction
Report a warning using Foam::Warning.
void add(const boundBox &bb)
Extend to include the second box.