52 typedef fileOperation::procRangeType procRangeType;
58 fileOperation::splitProcessorPath
59 (fName,
path, pDir,
local, group, numProcs);
70 handler.readDir(
path, fileName::Type::DIRECTORY)
78 for (
const fileName& dirN : dirEntries)
82 const label readProci =
83 fileOperation::detectProcessorPath(dirN, group, &rNum);
85 if (proci == readProci)
106 else if (
group.contains(proci))
133 const fileName& meshPath,
134 const word& meshFile,
157 typedef fileOperation::procRangeType procRangeType;
161 handler.filePath(
runTime.path()/meshPath/meshFile)
163 bool found = handler.isFile(fName);
170 bool isCollated =
false;
174 if (UPstream::master(UPstream::worldComm))
176 const bool oldParRun = UPstream::parRun(
false);
181 IOobject
io(meshFile, meshPath,
runTime);
184 isCollated = decomposedBlockData::isCollatedType(
io);
186 UPstream::parRun(oldParRun);
188 Pstream::broadcast(isCollated);
195 const label nProcs = UPstream::nProcs(
fileHandler().comm());
196 const label myProcNo = UPstream::myProcNo(
fileHandler().comm());
201 Pstream::listGatherValues
210 label myBlockNumber = -1;
213 label proci = fileOperation::detectProcessorPath(fName, group);
215 if (proci == -1 &&
group.empty())
219 myBlockNumber = UPstream::myProcNo(UPstream::worldComm);
225 myBlockNumber = myProcNo;
230 Pstream::listGatherValues
248 label blockRanki = -1;
254 || (fNames[ranki] != fNames[blockRanki])
258 IFstream is(fNames[ranki]);
259 nBlocks = decomposedBlockData::getNumBlocks(is);
262 allFound[ranki] = (myBlockNumbers[ranki] < nBlocks);
266 found = Pstream::listScatterValues
279 UPstream::allGatherValues<bool>(
found, UPstream::worldComm)
284 Info<<
"Per processor availability of \""
285 << meshFile <<
"\" file in " << meshPath <<
nl
289 return haveFileOnProc;
298 mesh.facesInstance(),
303 for (
const auto prefix : {
"boundary",
"edge",
"face",
"point"})
305 io.rename(prefix + word(
"ProcAddressing"));
307 const fileName procFile(
io.objectPath());
318 mesh.facesInstance(),
319 polyMesh::meshSubDir,
323 for (
const auto prefix : {
"boundary",
"cell",
"face",
"point"})
325 io.rename(prefix + word(
"ProcAddressing"));
327 const fileName procFile(
io.objectPath());
336 fileName& facesInstance,
337 fileName& pointsInstance
340 const fileName meshSubDir
342 polyMesh::meshDir(
io.name())
345 if (UPstream::master())
347 const bool oldParRun = UPstream::parRun(
false);
349 const int oldCache = fileOperation::cacheLevel(0);
351 facesInstance =
io.time().findInstance
355 IOobjectOption::MUST_READ
357 pointsInstance =
io.time().findInstance
361 IOobjectOption::MUST_READ
364 fileOperation::cacheLevel(oldCache);
367 const_cast<fileOperation&
>(
fileHandler()).nProcs(oldNumProcs);
369 UPstream::parRun(oldParRun);
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Miscellaneous file handling for meshes.
constexpr const char *const group
Group name for atomic constants.
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
List< label > labelList
A List of labels.
List< fileName > fileNameList
List of fileName.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler().
messageStream Info
Information stream (stdout output on master, null elsewhere).
bool checkFileExistence(const fileName &fName)
Check for availability of given file.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void masterMeshInstance(const IOobject &io, fileName &facesInstance, fileName &pointsInstance)
Determine master faces instance.
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
void removeProcAddressing(const faMesh &mesh)
Remove procAddressing.
boolList haveMeshFile(const Time &runTime, const fileName &meshPath, const word &meshFile="faces", const bool verbose=true)
Check for availability of specified mesh file (default: "faces").
List< bool > boolList
A List of bools.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.