62 PtrList<entry> patchEntries;
66 const word oldTypeName = IOPtrList<entry>::typeName;
67 const_cast<word&
>(IOPtrList<entry>::typeName) =
word::null;
68 IOPtrList<entry> dictList
73 io.time().findInstance
86 const_cast<word&
>(IOPtrList<entry>::typeName) = oldTypeName;
88 const_cast<word&
>(dictList.type()) = dictList.headerClassName();
90 patchEntries.transfer(dictList);
101 toSlave << patchEntries;
108 fromMaster >> patchEntries;
114 const bool haveMesh =
isDir(io.time().path()/io.instance()/meshSubDir);
123 IOobject noReadIO(io);
136 List<polyPatch*>
patches(patchEntries.size());
141 const entry& e = patchEntries[
patchi];
142 const word
type(e.dict().lookup(
"type"));
143 const word& name = e.keyword();
147 type != processorPolyPatch::typeName
148 &&
type != processorCyclicPolyPatch::typeName
151 dictionary patchDict(e.dict());
152 patchDict.set(
"nFaces", 0);
153 patchDict.set(
"startFace", 0);
160 dummyMesh.boundaryMesh()
164 patches.setSize(nPatches);
165 dummyMesh.addFvPatches(patches,
false);
178 dummyMesh.pointZones()
190 dummyMesh.faceZones()
201 dummyMesh.cellZones()
204 dummyMesh.addZones(pz, fz, cz);
213 autoPtr<fvMesh>
meshPtr(
new fvMesh(io));
224 const polyBoundaryMesh& patches = mesh.boundaryMesh();
228 const entry& e = patchEntries[
patchi];
229 const word
type(e.dict().lookup(
"type"));
230 const word& name = e.keyword();
232 if (
type == processorPolyPatch::typeName)
237 if (
patchi >= patches.size())
240 <<
"Non-processor patches not synchronised." 243 <<
" has only " << patches.size()
244 <<
" patches, master has " 256 <<
"Non-processor patches not synchronised." 258 <<
"Master patch " <<
patchi 263 <<
" has name:" << patches[
patchi].name()
264 <<
" type:" << patches[
patchi].type()
274 wordList pointZoneNames(mesh.pointZones().names());
276 wordList faceZoneNames(mesh.faceZones().names());
278 wordList cellZoneNames(mesh.cellZones().names());
284 mesh.pointZones().clear();
285 mesh.faceZones().clear();
286 mesh.cellZones().clear();
288 List<pointZone*> pz(pointZoneNames.size());
291 pz[i] =
new pointZone
299 List<faceZone*> fz(faceZoneNames.size());
311 List<cellZone*> cz(cellZoneNames.size());
322 mesh.addZones(pz, fz, cz);
329 const fileName meshFiles = io.time().path()/io.instance()/meshSubDir;
343 mesh.boundaryMesh().checkDefinition(
true);
345 mesh.boundaryMesh().checkParallelSync(
true);
347 mesh.cellZones().checkDefinition(
true);
348 mesh.cellZones().checkParallelSync(
true);
349 mesh.faceZones().checkDefinition(
true);
350 mesh.faceZones().checkParallelSync(
true);
351 mesh.pointZones().checkDefinition(
true);
352 mesh.pointZones().checkParallelSync(
true);
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static int masterNo()
Process index of the master.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static int firstSlave()
Process index of first slave.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool master(const label communicator=0)
Am I the master process.
Xfer< T > xferCopy(const T &)
Construct by copying the contents of the arg.
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
List< bool > boolList
Bool container classes.
vectorField pointField
pointField is a vectorField.
Load or create (0 size) a mesh. Used in distributing meshes to a larger number of processors...
static const word null
An empty word.
List< label > labelList
A List of labels.
defineTemplateTypeNameAndDebug(IOPtrList< ensightPart >, 0)
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
bool rmDir(const fileName &)
Remove a dirctory and its contents.
autoPtr< fvMesh > loadOrCreateMesh(const IOobject &io)
Load (if it exists) or create zero cell mesh given an IOobject:
word name(const complex &)
Return a string representation of a complex.
List< word > wordList
A List of words.
static bool & parRun()
Is this a parallel run?
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
static int lastSlave(const label communicator=0)
Process index of last slave.