63int main(
int argc,
char *argv[])
67 "Add point/face/cell Zones from similarly named point/face/cell Sets"
70 timeSelector::addOptions(
true,
false);
71 argList::addBoolOption
74 "Ignore orientation of faceSet"
82 const bool noFlipMap =
args.
found(
"noFlipMap");
89 const fileName setsSubPath(
mesh.dbDir()/polyMesh::meshSubDir/
"sets");
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;
133 mesh.pointZones().writeOpt(IOobject::AUTO_WRITE);
134 mesh.pointZones().instance() =
mesh.facesInstance();
154 label facei = faceLabels[i];
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);
178 label facei = faceLabels[i];
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])
213 <<
abort(FatalError);
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;
256 mesh.faceZones().writeOpt(IOobject::AUTO_WRITE);
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;
288 mesh.cellZones().writeOpt(IOobject::AUTO_WRITE);
289 mesh.cellZones().instance() =
mesh.facesInstance();
299 <<
"Failed writing polyMesh."
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
Return true if hashed entry is found in table.
List of IOobjects with searching and retrieving facilities.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool found(const word &optName) const
Return true if the named option is found.
A collection of cell labels.
A subset of mesh faces organised as a primitive patch.
virtual void resetAddressing(const labelUList &addr, const bool flipMapValue)
Reset addressing - use uniform flip map value.
A class for handling file names.
A class for handling words, derived from Foam::string.
label index() const noexcept
The index of this zone in the zone list.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
void set(List< bool > &bools, const labelUList &locations)
Set the listed locations (assign 'true').
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
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.