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().findZoneID(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
133 mesh.pointZones().instance() = mesh.facesInstance();
137 Info<<
"Overwriting contents of existing pointZone " << zoneID
138 <<
" with that of set " << set.name() <<
"." <<
endl;
141 mesh.pointZones().instance() = mesh.facesInstance();
167 label facei = faceLabels[i];
168 addressing.append(facei);
169 flipMap.append(
false);
174 const word setName(set.name() +
"SlaveCells");
176 Info<<
"Trying to load cellSet " << setName
177 <<
" to find out the slave side of the zone." <<
nl
178 <<
"If you do not care about the flipMap"
179 <<
" (i.e. do not use the sideness)" <<
nl
180 <<
"use the -noFlipMap command line option."
187 slaveCellSets.
insert(setName);
191 label facei = faceLabels[i];
195 if (mesh.isInternalFace(facei))
199 cells.found(mesh.faceOwner()[facei])
200 && !
cells.found(mesh.faceNeighbour()[facei])
207 !
cells.found(mesh.faceOwner()[facei])
208 &&
cells.found(mesh.faceNeighbour()[facei])
216 <<
"One of owner or neighbour of internal face "
217 << facei <<
" should be in cellSet " <<
cells.name()
218 <<
" to be able to determine orientation." <<
endl
220 <<
" own:" << mesh.faceOwner()[facei]
222 <<
cells.found(mesh.faceOwner()[facei])
223 <<
" nei:" << mesh.faceNeighbour()[facei]
225 <<
cells.found(mesh.faceNeighbour()[facei])
231 if (
cells.found(mesh.faceOwner()[facei]))
241 addressing.append(facei);
242 flipMap.append(flip);
246 label zoneID = mesh.faceZones().findZoneID(set.name());
249 Info<<
"Adding set " << set.name() <<
" as a faceZone." <<
endl;
250 label sz = mesh.faceZones().size();
251 mesh.faceZones().setSize(sz+1);
265 mesh.faceZones().instance() = mesh.facesInstance();
269 Info<<
"Overwriting contents of existing faceZone " << zoneID
270 <<
" with that of set " << set.name() <<
"." <<
endl;
271 mesh.faceZones()[zoneID].resetAddressing
277 mesh.faceZones().instance() = mesh.facesInstance();
289 if (!slaveCellSets.
found(iter.key()))
295 label zoneID = mesh.cellZones().findZoneID(set.name());
298 Info<<
"Adding set " << set.name() <<
" as a cellZone." <<
endl;
299 label sz = mesh.cellZones().size();
300 mesh.cellZones().setSize(sz+1);
313 mesh.cellZones().instance() = mesh.facesInstance();
317 Info<<
"Overwriting contents of existing cellZone " << zoneID
318 <<
" with that of set " << set.name() <<
"." <<
endl;
319 mesh.cellZones()[zoneID] = cellLabels;
321 mesh.cellZones().instance() = mesh.facesInstance();
333 <<
"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)