38void Foam::masterOFstream::checkWrite
40 const fileName& fName,
62 <<
"Could not open file " << fName <<
nl
74 <<
"Failed writing to " << fName <<
nl
80void Foam::masterOFstream::checkWrite
82 const fileName& fName,
86 checkWrite(fName, &
s[0],
s.length());
90void Foam::masterOFstream::commit()
110 checkWrite(pathName_, this->str());
117 boolList procValid(UPstream::listGatherValues<bool>(valid_));
126 string s(this->str());
133 pBufs.finishedGathers(recvSizes);
148 *std::max_element(recvSizes.cbegin(), recvSizes.cend())
153 UIPstream is(proci, pBufs);
155 const std::streamsize
count(recvSizes[proci]);
156 is.read(buf.data(), count);
158 if (procValid[proci])
160 checkWrite(filePaths[proci], buf.cdata(), count);
167 checkWrite(pathName_, this->str());
188 compression_(streamOpt.compression()),
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Foam::string str() const
Get the string - as Foam::string rather than std::string.
The IOstreamOption is a simple container for options an IOstream can normally have.
versionNumber version() const noexcept
Get the stream version.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
bool good() const noexcept
True if next operation might succeed.
virtual Ostream & write(const char c)
Write character.
virtual Ostream & writeRaw(const char *data, std::streamsize count)
Low-level raw binary output.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
UPstream::rangeType subProcs() const noexcept
Range of sub-processes indices associated with PstreamBuffers.
static void gatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
static void broadcast(Type &value, const label comm=UPstream::worldComm)
@ nonBlocking
"nonBlocking"
static constexpr int masterNo() noexcept
Process index of the master (always 0)
static bool & parRun() noexcept
Test if this a parallel run.
A class for handling file names.
static bool uniformFile(const fileNameList &)
Same file?
Master-only drop-in replacement for OFstream.
~masterOFstream()
Destructor - commits buffered information to file.
int myProcNo() const noexcept
Return processor number.
splitCell * master() const
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
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))
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
List< label > labelList
A List of labels.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
List< bool > boolList
A List of bools.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)