63int main(
int argc,
char *argv[])
69 "Add point/face/cell Zones from similarly named point/face/cell Sets"
75 "Ignore orientation of faceSet"
82 const bool noFlipMap =
args.found(
"noFlipMap");
102 Info<<
"Searched : " << setsInstance/setsSubPath
104 <<
"Found : " << objects.names() <<
nl
115 const label nOrigZones =
mesh.pointZones().size();
120 if (nOrigZones ==
mesh.pointZones().size())
122 Info<<
"Overwriting contents of existing pointZone "
124 <<
" with that of set " <<
set.name() <<
"." <<
endl;
128 Info<<
"Adding set " <<
set.name() <<
" as a pointZone." <<
endl;
134 mesh.pointZones().instance() =
mesh.facesInstance();
155 addressing.append(facei);
156 flipMap.append(
false);
161 const word setName(
set.name() +
"SlaveCells");
163 Info<<
"Trying to load cellSet " << setName
164 <<
" to find out the slave side of the zone." <<
nl
165 <<
"If you do not care about the flipMap"
166 <<
" (i.e. do not use the sideness)" <<
nl
167 <<
"use the -noFlipMap command line option."
174 slaveCellSets.
insert(setName);
182 if (
mesh.isInternalFace(facei))
187 && !
cells.found(
mesh.faceNeighbour()[facei])
195 &&
cells.found(
mesh.faceNeighbour()[facei])
203 <<
"One of owner or neighbour of internal face "
204 << facei <<
" should be in cellSet " <<
cells.name()
205 <<
" to be able to determine orientation." <<
endl
207 <<
" own:" <<
mesh.faceOwner()[facei]
210 <<
" nei:" <<
mesh.faceNeighbour()[facei]
212 <<
cells.found(
mesh.faceNeighbour()[facei])
218 if (
cells.found(
mesh.faceOwner()[facei]))
228 addressing.append(facei);
229 flipMap.append(flip);
234 const label nOrigZones =
mesh.faceZones().size();
239 if (nOrigZones ==
mesh.faceZones().size())
241 Info<<
"Overwriting contents of existing faceZone "
243 <<
" with that of set " <<
set.name() <<
"." <<
endl;
247 Info<<
"Adding set " <<
set.name() <<
" as a faceZone." <<
endl;
257 mesh.faceZones().instance() =
mesh.facesInstance();
264 if (!slaveCellSets.
found(
io.name()))
271 const label nOrigZones =
mesh.cellZones().size();
275 if (nOrigZones ==
mesh.cellZones().size())
277 Info<<
"Overwriting contents of existing cellZone "
279 <<
" with that of set " <<
set.name() <<
"." <<
endl;
283 Info<<
"Adding set " <<
set.name() <<
" as a cellZone." <<
endl;
289 mesh.cellZones().instance() =
mesh.facesInstance();
299 <<
"Failed writing polyMesh."
labelList faceLabels(nFaceLabels)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
bool found(const Key &key) const
Same as contains().
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
@ MUST_READ
Reading required.
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void addNote(const string ¬e)
Add extra notes for the usage information.
A collection of cell labels.
A subset of mesh faces organised as a primitive patch.
virtual void resetAddressing(faceZone &&zn)
Move reset addressing and flip map from another zone.
A class for handling file names.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh").
static void addOptions_singleTime()
Add single-time timeSelector options to argList::validOptions().
static bool setTimeIfPresent(Time &runTime, const argList &args, const bool forceInitial=false)
Set the runTime based on -constant (if present), -time (value), or -latestTime.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
label index() const noexcept
The index of this zone in the zone list.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void set(List< bool > &bools, const labelUList &locations)
Set the listed locations (assign 'true').
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
labelList pointLabels(nPoints, -1)
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.