47 faceZoneToCell::typeName,
48 "\n Usage: faceZoneToCell zone master|slave\n\n"
49 " Select master or slave side of the faceZone."
50 " Note:accepts wildcards for zone.\n\n"
56 Foam::faceZoneToCell::faceAction
58 Foam::faceZoneToCell::faceActionNames_
60 { faceAction::MASTER,
"master" },
61 { faceAction::SLAVE,
"slave" },
69 bool hasMatched =
false;
71 for (
const faceZone& zone : mesh_.faceZones())
73 if (selectedZones_.match(zone.name()))
86 Info<<
" Found matching zone " << zone.name()
87 <<
" with " << cellLabels.size() <<
" cells on "
88 << faceActionNames_[option_] <<
" side" <<
endl;
91 for (
const label celli : cellLabels)
94 if (celli >= 0 && celli < mesh_.nCells())
96 addOrDelete(set, celli,
add);
105 <<
"Cannot find any faceZone matching "
107 <<
"Valid names: " <<
flatOutput(mesh_.faceZones().names())
115 Foam::faceZoneToCell::faceZoneToCell
117 const polyMesh&
mesh,
118 const wordRe& zoneName,
119 const faceAction option
122 topoSetCellSource(
mesh),
123 selectedZones_(one(), zoneName),
128 Foam::faceZoneToCell::faceZoneToCell
130 const polyMesh&
mesh,
131 const dictionary&
dict
134 topoSetCellSource(
mesh),
136 option_(faceActionNames_.get(
"option",
dict))
139 if (!
dict.readIfPresent(
"zones", selectedZones_))
141 selectedZones_.resize(1);
142 selectedZones_.first() =
143 dict.getCompat<wordRe>(
"zone", {{
"name", 1806}});
148 Foam::faceZoneToCell::faceZoneToCell
150 const polyMesh&
mesh,
154 topoSetCellSource(
mesh),
155 selectedZones_(one(), wordRe(checkIs(is))),
156 option_(faceActionNames_.
read(checkIs(is)))
162 void Foam::faceZoneToCell::applyToSet
172 Info<<
" Adding all " << faceActionNames_[option_]
173 <<
" cells of face zones "
183 Info<<
" Removing all " << faceActionNames_[option_]
184 <<
" cells of face zones "