Go to the documentation of this file.
37 void Foam::masterOFstream::checkWrite
39 const fileName& fName,
56 <<
"Could not open file " << fName
60 os.writeQuoted(
str,
false);
64 <<
"Failed writing to " << fName
84 compression_(compression),
112 checkWrite(pathName_, str());
128 string s(this->str());
150 is.
read(buf.begin(), buf.size());
157 string(buf.begin(), buf.size())
165 checkWrite(pathName_, str());
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
masterOFstream(const fileName &pathname, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED, const bool append=false, const bool valid=true)
Construct and set stream status.
static constexpr int masterNo() noexcept
Process index of the master.
Output inter-processor communications stream operating on external buffer.
A class for handling file names.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
static bool uniformFile(const fileNameList &)
Same file?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
static bool & parRun()
Is this a parallel run?
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
~masterOFstream()
Destructor.
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.
word format(conversionProperties.get< word >("format"))
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Representation of a major/minor version number.
void finishedSends(const bool block=true)
Mark all sends as having been done. This will start receives.
versionNumber version() const noexcept
Get the stream version.
streamFormat
Data format (ascii | binary)
errorManipArg< error, int > exit(error &err, const int errNo=1)
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
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.
Foam::string str() const
Get the string - as Foam::string rather than std::string.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
Output to string buffer, using a OSstream.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Input inter-processor communications stream operating on external buffer.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.