51 typedef fileOperation::procRangeType procRangeType;
57 fileOperation::splitProcessorPath
69 handler.readDir(
path, fileName::Type::DIRECTORY)
77 for (
const fileName& dirN : dirEntries)
82 const label readProci =
83 fileOperation::splitProcessorPath
84 (dirN,
rp, rd, rl,
group, rNum);
86 if (proci == readProci)
107 else if (
group.contains(proci))
134 const fileName& meshPath,
135 const word& meshFile,
158 typedef fileOperation::procRangeType procRangeType;
162 handler.filePath(
runTime.path()/meshPath/meshFile)
165 bool found = handler.isFile(fName);
168 autoPtr<ISstream> isPtr(
fileHandler().NewIFstream(fName));
169 if (isPtr && isPtr->good())
173 IOobject
io(meshFile, meshPath,
runTime);
176 if (decomposedBlockData::isCollatedType(
io))
181 label proci = fileOperation::splitProcessorPath
191 label myBlockNumber = 0;
192 if (proci == -1 &&
group.empty())
196 myBlockNumber = UPstream::myProcNo(UPstream::worldComm);
202 myBlockNumber = UPstream::myProcNo(
fileHandler().comm());
206 found = decomposedBlockData::hasBlock(is, myBlockNumber);
215 UPstream::allGatherValues<bool>(
found, UPstream::worldComm)
220 Info<<
"Per processor availability of \"" 221 << meshFile <<
"\" file in " << meshPath <<
nl 225 return haveFileOnProc;
234 mesh.facesInstance(),
239 for (
const auto prefix : {
"boundary",
"edge",
"face",
"point"})
241 io.rename(prefix + word(
"ProcAddressing"));
243 const fileName procFile(
io.objectPath());
254 mesh.facesInstance(),
255 polyMesh::meshSubDir,
259 for (
const auto prefix : {
"boundary",
"cell",
"face",
"point"})
261 io.rename(prefix + word(
"ProcAddressing"));
263 const fileName procFile(
io.objectPath());
272 fileName& facesInstance,
273 fileName& pointsInstance
276 const fileName meshSubDir
278 polyMesh::meshDir(
io.name())
281 if (UPstream::master())
283 const bool oldParRun = UPstream::parRun(
false);
285 const int oldCache = fileOperation::cacheLevel(0);
287 facesInstance =
io.time().findInstance
291 IOobjectOption::MUST_READ
293 pointsInstance =
io.time().findInstance
297 IOobjectOption::MUST_READ
300 fileOperation::cacheLevel(oldCache);
303 const_cast<fileOperation&
>(
fileHandler()).nProcs(oldNumProcs);
305 UPstream::parRun(oldParRun);
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")
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
constexpr const char *const group
Group name for atomic constants.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
void masterMeshInstance(const IOobject &io, fileName &facesInstance, fileName &pointsInstance)
Determine master faces instance.
regionProperties rp(runTime)
Miscellaneous file handling for meshes.
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?
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
bool checkFileExistence(const fileName &fName)
Check for availability of given file.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void removeProcAddressing(const faMesh &mesh)
Remove procAddressing.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
List< fileName > fileNameList
List of fileName.
List< bool > boolList
A List of bools.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.