62 "\n Usage: zoneToCell zone\n\n"
63 " Select all cells in the cellZone."
64 " Note:accepts wildcards for zone.\n\n"
72 bool hasMatched =
false;
74 for (
const cellZone& zone : mesh_.cellZones())
76 if (selectedZones_.match(zone.name()))
84 Info<<
" Found matching zone " << zone.name()
85 <<
" with " << cellLabels.size() <<
" cells." <<
endl;
88 for (
const label celli : cellLabels)
91 if (celli >= 0 && celli < mesh_.nCells())
93 addOrDelete(set, celli,
add);
102 <<
"Cannot find any cellZone matching "
104 <<
"Valid names: " <<
flatOutput(mesh_.cellZones().names())
112 Foam::zoneToCell::zoneToCell
114 const polyMesh&
mesh,
115 const wordRe& zoneName
118 topoSetCellSource(
mesh),
119 selectedZones_(one(), zoneName)
123 Foam::zoneToCell::zoneToCell
125 const polyMesh&
mesh,
126 const dictionary&
dict
129 topoSetCellSource(
mesh),
133 if (!
dict.readIfPresent(
"zones", selectedZones_))
135 selectedZones_.resize(1);
136 selectedZones_.first() =
137 dict.getCompat<wordRe>(
"zone", {{
"name", 1806}});
142 Foam::zoneToCell::zoneToCell
144 const polyMesh&
mesh,
148 topoSetCellSource(
mesh),
149 selectedZones_(one(), wordRe(checkIs(is)))
155 void Foam::zoneToCell::applyToSet
165 Info<<
" Adding all cells of cell zones "
175 Info<<
" Removing all cells of cell zones "