40 namespace fileOperations
74 string ioRanksString(
getEnv(
"FOAM_IORANKS"));
75 if (ioRanksString.empty())
89 <<
"Rank 0 (master) should be in the IO ranks. Currently "
95 isIOrank.
set(ioRanks);
105 label rank = proci+1;
106 rank <
n && !isIOrank[rank];
149 const bool globalFile,
154 word& newInstancePath
164 if (isFileOrDir(
isFile, objPath))
180 if (isFileOrDir(
isFile, writePath))
191 lookupProcessorsPath(io.
objectPath(globalFile))
195 const fileName& pDir = pDirs()[i].first();
197 processorsPath(io, io.
instance(), pDir)
199 if (objPath != writePath && isFileOrDir(
isFile, objPath))
201 searchType = pDirs()[i].second().first();
213 localPath != writePath
214 && isFileOrDir(
isFile, localPath)
239 if (isFileOrDir(
isFile, parentPath))
255 if (pathFnd != times_.end())
257 newInstancePath = findInstancePath
263 if (newInstancePath.size() && newInstancePath != io.
instance())
268 lookupProcessorsPath(io.
objectPath(globalFile))
272 const fileName& pDir = pDirs()[i].first();
276 processorsPath(io, newInstancePath, pDir)
279 if (isFileOrDir(
isFile, fName))
314 if (isFileOrDir(
isFile, fName))
334 const word& instancePath
386 processorsPath(io, io.
instance(), procDir)
395 processorsPath(io, io.
instance(), processorsDir(io))
443 processorsPath(io, instancePath, procDir)
452 processorsPath(io, instancePath, processorsDir(io))
477 const fileName& object0 = filePaths[0];
479 for (
label i = 1; i < filePaths.
size(); i++)
481 if (filePaths[i] != object0)
502 IFstream is(filePath, IOstream::streamFormat::BINARY);
517 std::ostringstream stringStr;
519 string buf(stringStr.str());
524 os.
write(&buf[0], buf.size());
575 if (filePaths[0].empty())
578 <<
"cannot find file for object " << io.
name()
600 Pout<<
"masterUncollatedFileOperation::readStream :"
601 <<
" For uniform file " << filePaths[0]
602 <<
" sending to " << validProcs
603 <<
" in comm:" << comm <<
endl;
605 readAndSend(filePaths[0], validProcs, pBufs);
612 if (filePaths[0].empty())
615 <<
"cannot find file for object " << io.
name()
625 <<
"problem while reading header for object "
643 Pout<<
"masterUncollatedFileOperation::readStream :"
644 <<
" For processor " << proci
645 <<
" opening " << filePaths[proci] <<
endl;
648 const fileName& fPath = filePaths[proci];
650 if (
read[proci] && !fPath.empty())
654 readAndSend(fPath,
labelList(1, proci), pBufs);
682 Pout<<
"masterUncollatedFileOperation::readStream :"
683 <<
" Done reading " << buf.size() <<
" bytes" <<
endl;
691 <<
"problem while reading header for object "
726 <<
"I/O : " << typeName
736 <<
"Resetting fileModificationChecking to timeStamp" <<
endl;
749 <<
"Resetting fileModificationChecking to inotify"
770 <<
"I/O : " << typeName
780 <<
"Resetting fileModificationChecking to timeStamp" <<
endl;
793 <<
"Resetting fileModificationChecking to inotify"
807 const string s(
"-ioRanks");
810 for (
int i=1; i<argc-1; i++)
815 setEnv(
"FOAM_IORANKS", argv[i+1],
true);
822 for (
int i=index+2; i<argc; i++)
851 return masterOp<mode_t, mkDirOp>
867 return masterOp<mode_t, chModOp>
880 const bool checkVariants,
881 const bool followLink
884 return masterOp<mode_t, modeOp>
887 modeOp(checkVariants, followLink),
897 const bool checkVariants,
898 const bool followLink
903 masterOp<label, typeOp>
906 typeOp(checkVariants, followLink),
917 const bool checkVariants,
918 const bool followLink
921 return masterOp<bool, existsOp>
924 existsOp(checkVariants, followLink),
934 const bool followLink
937 return masterOp<bool, isDirOp>
950 const bool checkVariants,
951 const bool followLink
954 return masterOp<bool, isFileOp>
957 isFileOp(checkVariants, followLink),
967 const bool checkVariants,
968 const bool followLink
971 return masterOp<off_t, fileSizeOp>
984 const bool checkVariants,
985 const bool followLink
988 return masterOp<time_t, lastModifiedOp>
1001 const bool checkVariants,
1002 const bool followLink
1005 return masterOp<double, lastModifiedHROp>
1018 const std::string& ext
1021 return masterOp<bool, mvBakOp>
1036 return masterOp<bool, rmOp>
1051 return masterOp<bool, rmDirOp>
1065 const bool filtergz,
1066 const bool followLink
1069 return masterOp<fileNameList, readDirOp>
1083 const bool followLink
1086 return masterOp<bool, cpOp>
1103 return masterOp<bool, lnOp>
1118 const bool followLink
1121 return masterOp<bool, mvOp>
1134 const bool globalFile,
1136 const word& typeName
1141 Pout<<
"masterUncollatedFileOperation::filePath :"
1142 <<
" objectPath:" << io.
objectPath(globalFile)
1143 <<
" globalFile:" << globalFile <<
endl;
1148 (void)lookupProcessorsPath(io.
objectPath(globalFile));
1159 word newInstancePath;
1165 objPath = filePathInfo
1177 Pout<<
"masterUncollatedFileOperation::filePath :"
1178 <<
" master objPath:" << objPath
1180 <<
" procsDir:" << procsDir <<
" instance:" << newInstancePath
1191 label masterType(searchType);
1203 || io.
local() ==
"uniform"
1236 objPath = relativeObjectPath
1252 objPath = masterOp<fileName, fileOrNullOp>
1266 Pout<<
"masterUncollatedFileOperation::filePath :"
1267 <<
" Returning from file searching:" <<
endl
1269 <<
" filePath :" << objPath <<
endl <<
endl;
1277 const bool globalFile,
1283 Pout<<
"masterUncollatedFileOperation::dirPath :"
1284 <<
" objectPath:" << io.
objectPath(globalFile)
1285 <<
" globalFile:" << globalFile <<
endl;
1290 (void)lookupProcessorsPath(io.
objectPath(globalFile));
1297 word newInstancePath;
1301 objPath = filePathInfo
1313 label masterType(searchType);
1325 || io.
local() ==
"uniform"
1358 objPath = relativeObjectPath
1373 objPath = masterOp<fileName, fileOrNullOp>
1387 Pout<<
"masterUncollatedFileOperation::dirPath :"
1388 <<
" Returning from file searching:" <<
endl
1390 <<
" filePath :" << objPath <<
endl <<
endl;
1411 if (isFileOrDir(
isFile, writePath))
1423 processorsPath(io, io.
instance(), pDir)
1425 if (procPath != writePath && isFileOrDir(
isFile, procPath))
1435 if (localPath != writePath && isFileOrDir(
isFile, localPath))
1448 const scalar startValue,
1449 const word& stopInstance
1454 Pout<<
"masterUncollatedFileOperation::findInstance :"
1455 <<
" Starting searching for name:" << startIO.
name()
1456 <<
" local:" << startIO.
local()
1457 <<
" from instance:" << startIO.
instance()
1489 if (!foundInstance.empty())
1494 Pout<<
"masterUncollatedFileOperation::findInstance :"
1495 <<
" for name:" << io.
name() <<
" local:" << io.
local()
1496 <<
" found starting instance:" << io.
instance() <<
endl;
1511 for (instanceI = ts.
size()-1; instanceI >= 0; --instanceI)
1513 if (ts[instanceI].value() <= startValue)
1520 for (; instanceI >= 0; --instanceI)
1524 if (ts[instanceI].
name() == time.
name())
1529 io.
instance() = ts[instanceI].name();
1535 Pout<<
"masterUncollatedFileOperation::findInstance :"
1536 <<
" for name:" << io.
name() <<
" local:" << io.
local()
1544 if (ts[instanceI].
name() == stopInstance)
1552 if (io.
name().empty())
1555 <<
"Cannot find directory "
1556 << io.
local() <<
" in times " << time.
name()
1557 <<
" down to " << stopInstance
1563 <<
"Cannot find file \"" << io.
name()
1564 <<
"\" in directory " << io.
local()
1565 <<
" in times " << time.
name()
1566 <<
" down to " << stopInstance
1573 Pout<<
"masterUncollatedFileOperation::findInstance :"
1574 <<
" name:" << io.
name() <<
" local:" << io.
local()
1582 if (foundInstance.empty())
1600 Pout<<
"masterUncollatedFileOperation::findInstance :"
1601 <<
" name:" << io.
name()
1602 <<
" local:" << io.
local()
1610 if (foundInstance.empty())
1619 <<
"Cannot find file \"" << io.
name() <<
"\" in directory "
1636 Pout<<
"masterUncollatedFileOperation::findInstance :"
1637 <<
" name:" << io.
name() <<
" local:" << io.
local()
1655 Pout<<
"masterUncollatedFileOperation::readObjects :"
1657 <<
" local:" << local <<
" instance:" << instance <<
endl;
1682 if (newInstance.empty())
1723 Pout<<
"masterUncollatedFileOperation::readObjects :"
1724 <<
" newInstance:" << newInstance
1725 <<
" objectNames:" << objectNames <<
endl;
1736 const word& typeName
1743 Pout<<
"masterUncollatedFileOperation::readHeader :" <<
nl
1744 <<
" object :" << io.
name() <<
nl
1745 <<
" fName :" << fName <<
endl;
1752 bool uniform = uniformFile(filePaths);
1800 if (!filePaths[proci].empty())
1802 if (proci > 0 && filePaths[proci] == filePaths[proci-1])
1804 result[proci] = result[proci-1];
1805 headerClassName[proci] = headerClassName[proci-1];
1806 note[proci] = note[proci-1];
1818 == decomposedBlockData::typeName
1831 note[proci] = io.
note();
1849 Pout<<
"masterUncollatedFileOperation::readHeader :" <<
" ok:" << ok
1861 const word& typeName,
1867 Pout<<
"masterUncollatedFileOperation::readStream :"
1868 <<
" object : " << io.
name()
1869 <<
" global : " << io.
global()
1870 <<
" fName : " << fName <<
" read:" <<
read <<
endl;
1875 bool isCollated =
false;
1907 Pout<<
"masterUncollatedFileOperation::readStream :"
1908 <<
" For object : " << io.
name()
1909 <<
" doing straight IFstream input from "
1931 Pout<<
"masterUncollatedFileOperation::readStream :"
1932 <<
" For object : " << io.
name()
1933 <<
" starting collating input from " << fName <<
endl;
1939 label groupStart, groupSize, nProcs;
1962 <<
"Could not detect processor number"
1970 if (groupStart != -1 && groupSize > 0)
1972 proci = proci-groupStart;
1977 Pout<<
"masterUncollatedFileOperation::readStream :"
1978 <<
" For object : " << io.
name()
1979 <<
" starting input from block " << proci
1980 <<
" of " << isPtr().name() <<
endl;
1988 string versionString;
1989 string formatString;
1992 versionString = isPtr().version().str();
1994 os << isPtr().format();
1995 formatString = (os.
str());
2003 bool bigSize = sz > off_t(maxMasterFileBufferSize);
2008 label readComm = -1;
2009 if (groupStart != -1 && groupSize > 0)
2051 Pout<<
"masterUncollatedFileOperation::readStream :"
2052 <<
" For object : " << io.
name()
2053 <<
" starting separated input from " << fName <<
endl;
2087 bool uniform = uniformFile(filePaths);
2105 const bool masterOnly,
2107 const word& typeName
2120 Pout<<
"masterUncollatedFileOperation::read :"
2121 <<
" Reading global object " << io.
name() <<
endl;
2139 Istream& is = io.readStream(typeName);
2162 std::underlying_type_t<IOstream::streamFormat> formatValue(
format);
2179 if (myComm.
above() != -1)
2199 myComm.
below()[belowI],
2213 Pout<<
"masterUncollatedFileOperation::read :"
2214 <<
" Reading local object " << io.
name() <<
endl;
2217 ok = io.
readData(io.readStream(typeName));
2238 Pout<<
"masterUncollatedFileOperation::writeObject :"
2239 <<
" io:" << filePath <<
" write:" <<
write <<
endl;
2284 const word& constantName
2288 if (iter != times_.end())
2292 Pout<<
"masterUncollatedFileOperation::findTimes :"
2293 <<
" Found " << iter()->size() <<
" cached times" <<
endl;
2319 Pout<<
"masterUncollatedFileOperation::findTimes :"
2320 <<
" Caching times:" << *tPtr <<
nl
2339 if (iter != times_.end())
2345 if (times.
size() > 0 && times[0].name() == tm.
constant())
2361 Pout<<
"masterUncollatedFileOperation::setTime :"
2362 <<
" Caching time " << tm.
name()
2363 <<
" for case:" << tm.
path() <<
endl;
2377 Pout<<
"masterUncollatedFileOperation::setTime :"
2378 <<
" Caching time " << tm.
name()
2379 <<
" for case:" << tm.
path() <<
endl;
2417 const bool uniform = uniformFile(filePaths);
2423 Pout<<
"masterUncollatedFileOperation::NewIFstream :"
2424 <<
" Opening global file " << filePath <<
endl;
2435 procs[proci-1] = proci;
2438 readAndSend(filePath, procs, pBufs);
2449 readAndSend(filePaths[proci],
labelList(1, proci), pBufs);
2470 Pout<<
"masterUncollatedFileOperation::NewIFstream :"
2471 <<
" Reading " << filePath
2481 Pout<<
"masterUncollatedFileOperation::NewIFstream :"
2482 <<
" Done reading " << buf.size() <<
" bytes" <<
endl;
2542 watchFd = monitor().addWatch(fName);
2551 const label watchIndex
2557 ok = monitor().removeWatch(watchIndex);
2576 if (monitor().getFile(watchIndices[i]) == fName)
2602 label index = findWatch(watchIndices,
f);
2606 newWatchIndices.
append(addWatch(
f));
2611 newWatchIndices.
append(watchIndices[index]);
2612 removedWatches.
erase(index);
2619 removeWatch(watchIndices[iter.key()]);
2628 const label watchIndex
2634 fName = monitor().getFile(watchIndex);
2643 const bool masterOnly,
2649 monitor().updateStates(
true,
false);
2663 state = monitor().getState(watchFd);
2677 monitor().setUnmodified(watchFd);
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
An STL-conforming const_iterator.
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
virtual istream & stdStream()
Access to underlying std::istream.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const fileName & local() const
const fileName & caseName(const bool global) const
const Time & time() const
Return time.
static Stream & writeEndDivider(Stream &os)
Write the standard end file divider.
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
const objectRegistry & db() const
Return the local objectRegistry.
string & note()
Return non-constant access to the optional note.
readOption readOpt() const
const word & headerClassName() const
Return name of the class name read from header.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
bool readHeader(Istream &)
Read header.
const word & name() const
Return name.
const fileName & rootPath() const
bool writeHeader(Ostream &) const
Write header.
fileName objectPath(const bool global) const
Return complete path + object name including the processor.
fileName path(const bool global) const
Return complete path including the processor sub-directory.
streamFormat format() const
Return current stream format.
streamFormat
Enumeration for the format of data in the stream.
compressionType
Enumeration for the format of data in the stream.
bool good() const
Return true if next operation might succeed.
Input inter-processor communications stream.
Input from memory buffer stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void append(const T &)
Append an element at the end of the list.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
Output inter-processor communications stream.
Output to memory buffer stream.
string str() const
Return the string.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void set(const PackedList< 1 > &)
Set specified bits.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void finishedSends(const bool block=true)
Mark all sends as having been done. This will start receives.
Inter-processor communications stream.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
A List obtained as a section of another List.
static const word & constant()
Return constant name.
static const word & system()
Return system name.
bool processorCase() const
Return true if this is a processor case.
const fileName & globalCaseName() const
Return global case name.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
instantList times() const
Search the case for valid time directories.
fileName path() const
Explicitly inherit path from TimePaths to disambiguate from.
bool subCycling() const
Return true if time currently being sub-cycled, otherwise false.
Input inter-processor communications stream operating on external buffer.
static label read(const commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=0)
Read into given buffer from given processor and return the.
T & first()
Return the first element of the list.
iterator begin()
Return an iterator to begin traversing the UList.
Output inter-processor communications stream operating on external buffer.
static bool write(const commsTypes commsType, const int toProcNo, const char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=0)
Write given buffer to given processor.
Structure for communicating between processors.
const labelList & below() const
Inter-processor communications stream.
static int masterNo()
Process index of the master.
static void freeCommunicator(const label communicator, const bool doPstream=true)
Free a previously allocated communicator.
static bool master(const label communicator=0)
Am I the master process.
static label worldComm
Default communicator (all processors)
static int nProcsSimpleSum
Number of processors at which the sum algorithm changes from linear.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
static int & msgType()
Message tag of standard messages.
static const List< commsStruct > & linearCommunication(const label communicator=0)
Communication schedule for linear all-to-master (proc 0)
static const List< commsStruct > & treeCommunication(const label communicator=0)
Communication schedule for tree all-to-master (proc 0)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
T * ptr()
Return object pointer for reuse.
void clear()
Delete object (if the pointer is valid) and set pointer to.
void reset(T *=nullptr)
If object pointer already set, delete object and set to given.
static bool readMasterHeader(IOobject &, Istream &)
Read header. Call only on master.
static bool readBlocks(const label comm, autoPtr< ISstream > &isPtr, List< char > &data, const UPstream::commsTypes commsType)
Read data into *this. ISstream is only valid on master.
static autoPtr< ISstream > readBlock(const label blocki, Istream &is, IOobject &headerIO)
Read selected block (non-seeking) + header information.
const Type & value() const
Return const reference to value.
const word & name() const
Return const reference to name.
Dummy stream for input. Aborts at any attempt to read from it.
fileState
Enumeration defining the file state.
A class for handling file names.
bool isAbsolute() const
Return true if file name is absolute.
static const fileName null
An empty fileName.
virtual void flush() const
Forcibly wait until all output done. Flush any cached data.
virtual fileNameList readObjects(const objectRegistry &db, const fileName &instance, const fileName &local, word &newInstance) const
Search directory for objects. Used in IOobjectList.
pathType
Enumeration for the location of an IOobject.
static const NamedEnum< pathType, 12 > pathTypeNames_
virtual void setTime(const Time &) const
Callback for time change.
virtual instantList findTimes(const fileName &, const word &) const
Get sorted list of times.
fileOperations that performs all file operations on the master processor. Requires the calls to be pa...
masterUncollatedFileOperationInitialise(int &argc, char **&argv)
Construct from components.
virtual bool writeObject(const regIOobject &, IOstream::streamFormat format=IOstream::ASCII, IOstream::versionNumber version=IOstream::currentVersion, IOstream::compressionType compression=IOstream::UNCOMPRESSED, const bool write=true) const
Writes a regIOobject (so header, contents and divider).
virtual void addWatches(regIOobject &, const fileNameList &) const
Helper: add watches for list of regIOobjects.
static word findInstancePath(const instantList &timeDirs, const instant &t)
Equivalent of Time::findInstance.
virtual autoPtr< ISstream > NewIFstream(const fileName &filePath, IOstream::streamFormat format=IOstream::ASCII, IOstream::versionNumber version=IOstream::currentVersion) const
Generate an ISstream that reads a file.
virtual double highResLastModified(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Return time of last file modification.
virtual fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Return the file type: directory, file or link.
virtual bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Does the name exist as a file in the file system?
virtual label addWatch(const fileName &) const
Add watching of a file. Returns handle.
static labelList subRanks(const label n)
Get the list of processors that are part of this communicator.
static void readAndSend(const fileName &fName, const labelUList &procs, PstreamBuffers &pBufs)
Detect file (possibly compressed), read file contents and send.
virtual void setTime(const Time &) const
Callback for time change.
virtual off_t fileSize(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Return size of file.
virtual time_t lastModified(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Return time of last file modification.
virtual fileName filePath(const bool globalFile, const IOobject &, const word &typeName) const
Search for an object. globalFile : also check undecomposed case.
virtual void flush() const
Forcibly wait until all output done. Flush any cached data.
static float maxMasterFileBufferSize
Max size of parallel communications. Switches from non-blocking.
virtual fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true) const
Read a directory and return the entries as a string list.
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
virtual bool readHeader(IOobject &, const fileName &, const word &typeName) const
Read object header from supplied file.
virtual bool mvBak(const fileName &, const std::string &ext="bak") const
Rename to a corresponding backup file.
virtual fileNameList readObjects(const objectRegistry &db, const fileName &instance, const fileName &local, word &newInstance) const
Search directory for objects. Used in IOobjectList.
virtual bool rmDir(const fileName &) const
Remove a directory and its contents.
virtual label findWatch(const labelList &watchIndices, const fileName &) const
Find index (or -1) of file in list of handles.
virtual bool cp(const fileName &src, const fileName &dst, const bool followLink=true) const
Copy, recursively if necessary, the source to the destination.
virtual bool chMod(const fileName &, const mode_t) const
Set the file mode.
virtual IOobject findInstance(const IOobject &io, const scalar startValue, const word &stopInstance) const
Find instance where IOobject is. Fails if cannot be found.
bool exists(const dirIndexList &, IOobject &io) const
Helper: check IO for local existence. Like filePathInfo but.
virtual autoPtr< Ostream > NewOFstream(const fileName &filePath, IOstream::streamFormat format=IOstream::ASCII, IOstream::versionNumber version=IOstream::currentVersion, IOstream::compressionType compression=IOstream::UNCOMPRESSED, const bool write=true) const
Generate an Ostream that writes a file.
virtual autoPtr< ISstream > readStream(regIOobject &, const fileName &, const word &typeName, const bool read=true) const
Reads header for regIOobject and returns an ISstream.
virtual bool rm(const fileName &) const
Remove a file, returning true if successful otherwise false.
virtual bool isDir(const fileName &, const bool followLink=true) const
Does the name exist as a directory in the file system?
fileName relativeObjectPath(const IOobject &, const pathType &searchType, const word &processorsDir, const word &instancePath) const
Construct filePath.
static autoPtr< ISstream > read(IOobject &io, const label comm, const bool uniform, const fileNameList &filePaths, const boolList &read)
Read files on comms master.
virtual fileMonitor::fileState getState(const label) const
Get current state of file (using handle)
virtual void setUnmodified(const label) const
Set current state of file (using handle) to unmodified.
virtual void updateStates(const bool masterOnly, const bool syncPar) const
Update state of all files.
masterUncollatedFileOperation(const bool verbose)
Construct null.
virtual mode_t mode(const fileName &, const bool checkVariants=true, const bool followLink=true) const
Return the file mode.
static bool uniformFile(const fileNameList &)
Same file?
virtual bool mkDir(const fileName &, mode_t=0777) const
Make directory.
virtual fileName dirPath(const bool globalFile, const IOobject &) const
Search for a directory. globalFile : also check undecomposed.
virtual instantList findTimes(const fileName &, const word &) const
Get sorted list of times.
virtual fileName filePathInfo(const bool globalFile, const bool isFile, const IOobject &, pathType &searchType, word &processorsDir, word &instance) const
Search (locally!) for object; return info on how it was found.
virtual bool mv(const fileName &src, const fileName &dst, const bool followLink=false) const
Rename src to dst.
virtual bool ln(const fileName &src, const fileName &dst) const
Create a softlink. dst should not exist. Returns true if.
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
virtual ~masterUncollatedFileOperation()
Destructor.
An instant of time. Contains the time value and name.
bool equal(const scalar) const
Comparison used for instants to be equal.
Master-only drop-in replacement for OFstream.
Registry of regIOobjects.
const Time & time() const
Return time.
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
const labelList & watchIndices() const
Return file-monitoring handles.
fileName objectPath() const
Return complete path + object name.
virtual bool writeData(Ostream &) const =0
Pure virtual writaData function.
virtual bool global() const
Return true if object is global, i.e. same for all processors.
void close()
Close Istream.
virtual bool readData(Istream &)
Virtual readData function.
A class for managing temporary objects without reference counting.
A class for handling words, derived from string.
static const word null
An empty word.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static instantList timeDirs
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
runTimeSource setTime(sourceTimes[sourceTimeIndex], sourceTimeIndex)
#define WarningInFunction
Report a warning using Foam::Warning.
#define InfoHeader
Report write to Foam::Info if the local log switch is true.
float floatOptimisationSwitch(const char *name, const float defaultValue=0)
Lookup optimisation switch or add default value.
addToRunTimeSelectionTable(fileOperation, collatedFileOperation, word)
defineTypeNameAndDebug(collatedFileOperation, 0)
addNamedToRunTimeSelectionTable(fileOperationInitialise, collatedFileOperationInitialise, word, collated)
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist as a file in the file system?
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool setEnv(const word &name, const std::string &value, const bool overwrite)
Set an environment variable.
off_t fileSize(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return size of file.
mode_t mode(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file mode.
bool read(const char *, int32_t &)
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.
bool exists(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist (as directory or file) in the file system?
labelList second(const UList< labelPair > &p)
labelList first(const UList< labelPair > &p)
List< instant > instantList
List of instants.
label findSortedIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element in sorted list and return index,.
string getEnv(const word &)
Return environment variable of given name.
fileType
Enumeration of file types.
prefixOSstream Pout(cout, "Pout")
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
void stableSort(UList< T > &)
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
word format(conversionProperties.lookup("format"))