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)
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()
276 Pstream::scatter(pointZoneNames);
278 Pstream::scatter(faceZoneNames);
280 Pstream::scatter(cellZoneNames);
289 List<pointZone*> pz(pointZoneNames.size());
292 pz[i] =
new pointZone
299 List<faceZone*> fz(faceZoneNames.size());
310 List<cellZone*> cz(cellZoneNames.size());
327 const fileName meshFiles = io.time().path()/io.instance()/meshSubDir;
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.
wordList toc() const
Return the table of contents.
bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
void clear()
Clear the zones.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
virtual bool isDir(const fileName &, const bool followLink=true) const =0
Does the name exist as a directory in the file system?
void clearOut()
Clear all geometry and addressing.
bool checkDefinition(const bool report=false) const
Check boundary definition. Return true if in error.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
const pointZoneList & pointZones() const
Return point zones.
const cellZoneList & cellZones() const
Return cell zones.
const globalMeshData & globalData() const
Return parallel info.
const faceZoneList & faceZones() const
Return face zones.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void removeFiles(const fileName &instanceDir) const
Remove all files from mesh instance.
void addZones(const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
Add mesh zones.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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.
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.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
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.