35 void Foam::masterOFstream::checkWrite
37 const fileName& fName,
55 <<
"Could not open file " << fName
59 os.writeQuoted(str,
false);
63 <<
"Failed writing to " << fName
83 compression_(compression),
111 checkWrite(filePath_,
str());
127 string s(this->
str());
128 os.
write(&s[0], s.size());
164 checkWrite(filePath_,
str());
static int masterNo()
Process index of the master.
A class for handling file names.
void finishedSends(const bool block=true)
Mark all sends as having been done. This will start receives.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static bool master(const label communicator=0)
Am I the master process.
versionNumber version() const
Return the stream version.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Input inter-processor communications stream operating on external buffer.
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.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
iterator begin()
Return an iterator to begin traversing the UList.
streamFormat
Enumeration for the format of data in the stream.
masterOFstream(const fileName &filePath, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED, const bool append=false, const bool write=true)
Construct and set stream status.
OStringStream(streamFormat format=ASCII, versionNumber version=currentVersion)
Construct and set stream status.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
compressionType
Enumeration for the format of data in the stream.
Output 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.
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.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
virtual Ostream & write(const char)
Write character.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
static bool uniformFile(const fileNameList &)
Same file?
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
~masterOFstream()
Destructor.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
string str() const
Return the string.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.