51 "\n Usage: cellToFace <cellSet> all|both\n\n"
52 " Select -all : all faces of cells in the cellSet\n"
53 " -both: faces where both neighbours are in the cellSet\n\n"
58 Foam::cellToFace::cellAction
60 Foam::cellToFace::cellActionNames_
62 { cellAction::ALL,
"all" },
63 { cellAction::BOTH,
"both" },
77 if (!
exists(mesh_.time().path()/topoSet::localPath(mesh_, setName)))
83 cellSet loadedSet(mesh_, setName);
89 for (
const label celli : cellLabels)
91 const labelList& cFaces = mesh_.cells()[celli];
93 addOrDelete(
set, cFaces,
add);
96 else if (option_ == BOTH)
100 const label nInt = mesh_.nInternalFaces();
101 const labelList& own = mesh_.faceOwner();
102 const labelList& nei = mesh_.faceNeighbour();
103 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
107 for (label facei = 0; facei < nInt; ++facei)
109 if (cellLabels.found(own[facei]) && cellLabels.found(nei[facei]))
111 addOrDelete(
set, facei,
add);
117 boolList neiInSet(mesh_.nFaces()-nInt,
false);
119 for (
const polyPatch& pp :
patches)
123 label facei = pp.start();
126 neiInSet[facei-nInt] = cellLabels.found(own[facei]);
131 syncTools::swapBoundaryFaceList(mesh_, neiInSet);
135 for (
const polyPatch& pp :
patches)
139 label facei = pp.start();
142 if (cellLabels.found(own[facei]) && neiInSet[facei-nInt])
144 addOrDelete(
set, facei,
add);
156 Foam::cellToFace::cellToFace
158 const polyMesh&
mesh,
160 const cellAction option
163 topoSetFaceSource(
mesh),
164 names_(one{}, setName),
169 Foam::cellToFace::cellToFace
171 const polyMesh&
mesh,
172 const dictionary&
dict
175 topoSetFaceSource(
mesh),
177 option_(cellActionNames_.
get(
"option",
dict))
180 if (!
dict.readIfPresent(
"sets", names_))
183 dict.readEntry(
"set", names_.first());
188 Foam::cellToFace::cellToFace
190 const polyMesh&
mesh,
194 topoSetFaceSource(
mesh),
195 names_(one{}, word(checkIs(is))),
196 option_(cellActionNames_.read(checkIs(is)))
202 void Foam::cellToFace::applyToSet
212 Info<<
" Adding faces according to cellSet "
216 for (
const word& setName : names_)
225 Info<<
" Removing faces according to cellSet "
229 for (
const word& setName : names_)