47 faceZoneToCell::typeName,
48 "\n Usage: faceZoneToCell zone front|back|both\n\n" 49 " Select front, back or both sides of the faceZone." 50 " Note:accepts wildcards for zone.\n\n" 58 Foam::faceZoneToCell::faceActionNames_
60 { faceAction::FRONT,
"front" },
61 { faceAction::BACK,
"back" },
62 { faceAction::BOTH,
"both" },
64 { faceAction::FRONT,
"master" },
65 { faceAction::BACK,
"slave" },
71 void Foam::faceZoneToCell::combine
86 for (
const label zonei :
zoneIDs)
88 if (zonei < 0 || zonei >= nZones)
97 Info<<
" Using matching zone " << zone.name();
99 if (option_ == faceAction::FRONT)
101 Info<<
" [front] cells:";
103 else if (option_ == faceAction::BACK)
105 Info<<
" : [back] cells:";
107 if (option_ == faceAction::BOTH)
109 Info<<
" : [front/back] cells:";
113 if (option_ == faceAction::FRONT || option_ == faceAction::BOTH)
115 const labelList& cellLabels = zone.frontCells();
122 for (
const label celli : cellLabels)
132 if (option_ == faceAction::BACK || option_ == faceAction::BOTH)
134 const labelList& cellLabels = zone.backCells();
141 for (
const label celli : cellLabels)
159 void Foam::faceZoneToCell::combine(topoSet&
set,
const bool add)
const 161 if (zoneMatcher_.empty())
166 const labelList matched(mesh_.faceZones().indices(zoneMatcher_));
171 <<
"Cannot find any faceZone matching " 173 <<
"Valid names: " <<
flatOutput(mesh_.faceZones().names())
189 const faceAction option
193 zoneMatcher_(zoneSelector),
202 const faceAction option
206 zoneMatcher_(
one{}, zoneName),
213 const polyMesh&
mesh,
214 const dictionary&
dict 219 option_(faceActionNames_.
get(
"option",
dict))
222 if (!
dict.readIfPresent(
"zones", zoneMatcher_))
225 zoneMatcher_.
front() =
dict.getCompat<
wordRe>(
"zone", {{
"name", 1806}});
232 const polyMesh&
mesh,
236 topoSetCellSource(
mesh),
238 option_(faceActionNames_.read(checkIs(is)))
252 zoneMatcher_ = zonesSelector;
259 zoneMatcher_.front() = zoneName;
271 if (verbose_ && !zoneMatcher_.empty())
273 Info<<
" Adding all " << faceActionNames_[option_]
274 <<
" cells of face zones " 282 if (verbose_ && !zoneMatcher_.empty())
284 Info<<
" Removing all " << faceActionNames_[option_]
285 <<
" cells of face zones " List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
const labelIOList & zoneIDs
void resize(const label len)
Adjust allocated size of list.
Create a new set and ADD elements to it.
Add elements to current set.
const wordRes & zones() const noexcept
Return the current zones selector.
constexpr char nl
The newline '\n' character (0x0a)
faceZoneToCell(const polyMesh &mesh, const wordRes &zoneSelector, const faceAction option)
Construct from mesh, zones selector and selection option.
T & front()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells...
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
void addOrDelete(topoSet &set, const label id, const bool add) const
Add or delete id from set. Add when 'add' is true.
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
A UList of labels.
faceAction
Enumeration defining the valid options.
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
label size() const noexcept
The number of entries in the list.
setAction
Enumeration defining various actions.
A List of wordRe with additional matching capabilities.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings...
const polyMesh & mesh_
Reference to the mesh.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
Subtract elements from current set.
#define WarningInFunction
Report a warning using Foam::Warning.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Class with constructor to add usage string to table.
label nCells() const noexcept
Number of mesh cells.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.