61 int main(
int argc,
char *argv[])
66 "add point/face/cell Zones from similar named point/face/cell Sets"
72 "ignore orientation of faceSet"
89 word setsInstance = runTime.findInstance
99 Info<<
"Searched : " << setsInstance/setsSubPath
115 label zoneID = mesh.pointZones().findIndex(set.name());
118 Info<<
"Adding set " << set.name() <<
" as a pointZone." <<
endl;
119 label sz = mesh.pointZones().size();
120 mesh.pointZones().setSize(sz+1);
121 mesh.pointZones().set
132 mesh.pointZones().instance() = mesh.facesInstance();
136 Info<<
"Overwriting contents of existing pointZone " << zoneID
137 <<
" with that of set " << set.name() <<
"." <<
endl;
140 mesh.pointZones().instance() = mesh.facesInstance();
166 label facei = faceLabels[i];
167 addressing.append(facei);
168 flipMap.append(
false);
173 const word setName(set.name() +
"SlaveCells");
175 Info<<
"Trying to load cellSet " << setName
176 <<
" to find out the slave side of the zone." <<
nl
177 <<
"If you do not care about the flipMap"
178 <<
" (i.e. do not use the sideness)" <<
nl
179 <<
"use the -noFlipMap command line option."
186 slaveCellSets.
insert(setName);
190 label facei = faceLabels[i];
194 if (mesh.isInternalFace(facei))
198 cells.found(mesh.faceOwner()[facei])
199 && !
cells.found(mesh.faceNeighbour()[facei])
206 !
cells.found(mesh.faceOwner()[facei])
207 &&
cells.found(mesh.faceNeighbour()[facei])
215 <<
"One of owner or neighbour of internal face "
216 << facei <<
" should be in cellSet " <<
cells.name()
217 <<
" to be able to determine orientation." <<
endl
219 <<
" own:" << mesh.faceOwner()[facei]
221 <<
cells.found(mesh.faceOwner()[facei])
222 <<
" nei:" << mesh.faceNeighbour()[facei]
224 <<
cells.found(mesh.faceNeighbour()[facei])
230 if (
cells.found(mesh.faceOwner()[facei]))
240 addressing.append(facei);
241 flipMap.append(flip);
245 label zoneID = mesh.faceZones().findIndex(set.name());
248 Info<<
"Adding set " << set.name() <<
" as a faceZone." <<
endl;
249 label sz = mesh.faceZones().size();
250 mesh.faceZones().setSize(sz+1);
263 mesh.faceZones().instance() = mesh.facesInstance();
267 Info<<
"Overwriting contents of existing faceZone " << zoneID
268 <<
" with that of set " << set.name() <<
"." <<
endl;
269 mesh.faceZones()[zoneID].resetAddressing
275 mesh.faceZones().instance() = mesh.facesInstance();
287 if (!slaveCellSets.
found(iter.key()))
293 label zoneID = mesh.cellZones().findIndex(set.name());
296 Info<<
"Adding set " << set.name() <<
" as a cellZone." <<
endl;
297 label sz = mesh.cellZones().size();
298 mesh.cellZones().setSize(sz+1);
310 mesh.cellZones().instance() = mesh.facesInstance();
314 Info<<
"Overwriting contents of existing cellZone " << zoneID
315 <<
" with that of set " << set.name() <<
"." <<
endl;
316 mesh.cellZones()[zoneID] = cellLabels;
318 mesh.cellZones().instance() = mesh.facesInstance();
330 <<
"Failed writing polyMesh."
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A HashTable with keys but without contents.
bool insert(const Key &key)
Insert a new entry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
List of IOobjects with searching and retrieving facilities.
A list that is sorted upon construction or when explicitly requested with the sort() method.
static void addNote(const string &)
Add extra notes for the usage information.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
A collection of cell labels.
A subset of mesh faces organised as a primitive patch.
A class for handling file names.
A subset of mesh points. The labels of points in the zone can be obtained from the addressing() list.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
static instantList selectIfPresent(Time &runTime, const argList &args)
If any time option provided return the set of times (as select0)
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
labelList pointLabels(nPoints, -1)
Foam::argList args(argc, argv)