62 "\n Usage: zoneToCell zone\n\n"
63 " Select all cells in the cellZone."
64 " Note:accepts wildcards for zone.\n\n"
70void Foam::zoneToCell::combine
85 for (
const label zonei :
zoneIDs)
87 if (zonei < 0 || zonei >= nZones)
92 const auto& zone =
mesh_.cellZones()[zonei];
96 Info<<
" Using zone " << zone.name() <<
" with "
100 for (
const label celli : zone)
103 if (celli >= 0 && celli <
mesh_.nCells())
112void Foam::zoneToCell::combine(
topoSet& set,
const bool add)
const
114 if (!zoneIDs_.empty())
120 if (zoneMatcher_.empty())
125 const labelList matched(mesh_.cellZones().indices(zoneMatcher_));
130 <<
"Cannot find any cellZone matching "
132 <<
"Valid names: " <<
flatOutput(mesh_.cellZones().names())
151 zoneMatcher_(zoneSelector)
162 zoneMatcher_(
one{}, zoneName)
188 if (!
dict.readIfPresent(
"zones", zoneMatcher_))
190 zoneMatcher_.resize(1);
191 zoneMatcher_.front() = dict.getCompat<wordRe>(
"zone", {{
"name", 1806}});
198 const polyMesh&
mesh,
216 zoneMatcher_ = zonesSelector;
224 zoneMatcher_.front() = zoneName;
231 zoneMatcher_.
clear();
238 zoneMatcher_.
clear();
240 zoneIDs_.front() = zoneID;
252 if (verbose_ && !zoneMatcher_.empty())
254 Info<<
" Adding all cells of cell zones: "
262 if (verbose_ && !zoneMatcher_.empty())
264 Info<<
" Removing all cells of cell zones: "
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void resize(const label len)
Adjust allocated size of list.
void clear()
Clear the list, i.e. set size to zero.
label size() const noexcept
The number of entries in the list.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Mesh consisting of general polyhedral cells.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
topoSetCellSource(const polyMesh &mesh)
Construct from mesh.
Class with constructor to add usage string to table.
Base class of a source for a topoSet.
void addOrDelete(topoSet &set, const label id, const bool add) const
Add or delete id from set. Add when 'add' is true.
setAction
Enumeration defining various actions.
@ SUBTRACT
Subtract elements from current set.
@ ADD
Add elements to current set.
@ NEW
Create a new set and ADD elements to it.
bool verbose_
Output verbosity (default: true).
const polyMesh & mesh() const noexcept
Reference to the mesh.
const polyMesh & mesh_
Reference to the mesh.
static Istream & checkIs(Istream &is)
Check state of stream.
General set of labels of mesh quantity (points, cells, faces).
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
void clear()
Clear string and regular expression.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
A topoSetCellSource to convert cellZone(s) to a cellSet.
zoneToCell(const polyMesh &mesh, const wordRes &zoneSelector)
Construct from mesh and zones selector.
const wordRes & zones() const noexcept
Return the current zones selector.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Base class for mesh zones.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const labelIOList & zoneIDs
#define WarningInFunction
Report a warning using Foam::Warning.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a).
dict add("bounds", meshBb)