51 if (io.name() == polyMesh::defaultRegion)
53 meshSubDir = polyMesh::meshSubDir;
57 meshSubDir = io.name()/polyMesh::meshSubDir;
62 PtrList<entry> patchEntries;
63 if (Pstream::master())
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);
95 int slave=Pstream::firstSlave();
96 slave<=Pstream::lastSlave();
100 OPstream toSlave(Pstream::commsTypes::scheduled, slave);
101 toSlave << patchEntries;
109 Pstream::commsTypes::scheduled,
112 fromMaster >> patchEntries;
120 fileHandler().filePath(io.time().path()/io.instance()/meshSubDir)
125 bool oldParRun = Pstream::parRun();
126 Pstream::parRun() =
false;
130 IOobject noReadIO(io);
131 noReadIO.readOpt() = IOobject::NO_READ;
143 List<polyPatch*>
patches(patchEntries.size());
148 const entry&
e = patchEntries[
patchi];
149 const word
type(
e.dict().lookup(
"type"));
150 const word&
name =
e.keyword();
154 type != processorPolyPatch::typeName
155 &&
type != processorCyclicPolyPatch::typeName
158 dictionary patchDict(
e.dict());
159 patchDict.set(
"nFaces", 0);
160 patchDict.set(
"startFace", 0);
167 dummyMesh.boundaryMesh()
172 dummyMesh.addFvPatches(
patches,
false);
184 dummyMesh.pointZones()
195 dummyMesh.faceZones()
205 dummyMesh.cellZones()
208 dummyMesh.addZones(pz, fz, cz);
211 Pstream::parRun() = oldParRun;
214 autoPtr<fvMesh>
meshPtr(
new fvMesh(io,
false));
221 if (!Pstream::master() && haveMesh)
225 const polyBoundaryMesh&
patches = mesh.boundaryMesh();
229 const entry&
e = patchEntries[
patchi];
230 const word
type(
e.dict().lookup(
"type"));
231 const word&
name =
e.keyword();
233 if (
type == processorPolyPatch::typeName)
241 <<
"Non-processor patches not synchronised."
243 <<
"Processor " << Pstream::myProcNo()
244 <<
" has only " <<
patches.size()
245 <<
" patches, master has "
257 <<
"Non-processor patches not synchronised."
259 <<
"Master patch " <<
patchi
262 <<
"Processor " << Pstream::myProcNo()
275 wordList pointZoneNames(mesh.pointZones().toc());
276 Pstream::scatter(pointZoneNames);
277 wordList faceZoneNames(mesh.faceZones().toc());
278 Pstream::scatter(faceZoneNames);
279 wordList cellZoneNames(mesh.cellZones().toc());
280 Pstream::scatter(cellZoneNames);
285 mesh.pointZones().clear();
286 mesh.faceZones().clear();
287 mesh.cellZones().clear();
289 List<pointZone*> pz(pointZoneNames.size());
292 pz[i] =
new pointZone
299 List<faceZone*> fz(faceZoneNames.size());
310 List<cellZone*> cz(cellZoneNames.size());
320 mesh.addZones(pz, fz, cz);
327 const fileName meshFiles = io.time().path()/io.instance()/meshSubDir;
341 mesh.boundaryMesh().checkDefinition(
true);
343 mesh.boundaryMesh().checkParallelSync(
true);
345 mesh.cellZones().checkDefinition(
true);
346 mesh.cellZones().checkParallelSync(
true);
347 mesh.faceZones().checkDefinition(
true);
348 mesh.faceZones().checkParallelSync(
true);
349 mesh.pointZones().checkDefinition(
true);
350 mesh.pointZones().checkParallelSync(
true);
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
virtual bool isDir(const fileName &, const bool followLink=true) const =0
Does the name exist as a directory in the file system?
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fvPatchList & patches
Load or create (0 size) a mesh. Used in distributing meshes to a larger number of processors.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
const dimensionedScalar e
Elementary charge.
const fileOperation & fileHandler()
Get current file handler.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
List< label > labelList
A List of labels.
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.
word name(const bool)
Return a word representation of a bool.
vectorField pointField
pointField is a vectorField.
List< bool > boolList
Bool container classes.
defineTemplateTypeNameAndDebug(prghPressure, 0)
bool rmDir(const fileName &)
Remove a directory and its contents.
autoPtr< fvMesh > loadOrCreateMesh(const IOobject &io)
Load (if it exists) or create zero cell mesh given an IOobject:
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.