51 #ifndef Foam_OFstreamCollator_H 52 #define Foam_OFstreamCollator_H 78 const word objectType_;
91 const word& objectType,
102 objectType_(objectType),
107 streamOpt_(streamOpt),
110 headerEntries_(headerEntries)
116 off_t totalSize = data_.size();
119 if (slaveData_.
set(i))
121 totalSize += slaveData_[i].
size();
132 const off_t maxBufferSize_;
134 mutable std::mutex mutex_;
136 std::unique_ptr<std::thread> thread_;
154 static bool writeFile
157 const word& objectType,
159 const string& masterData,
169 static void* writeAll(
void *threadarg);
173 void waitForBufferSpace(
const off_t wantedSize)
const;
203 const word& objectType,
209 const bool useThread =
true,
A FIFO stack based on a singly-linked list.
A class for handling file names.
virtual ~OFstreamCollator()
Destructor.
static void writeData(Ostream &os, const Type &val)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
A simple container for options an IOstream can normally have.
#define forAll(list, i)
Loop across all elements in list.
atomicType
Atomic operations (output)
A List obtained as a section of another List.
bool write(const word &objectType, const fileName &, const string &data, IOstreamOption streamOpt, IOstreamOption::atomicType atomic, IOstreamOption::appendType append, const bool useThread=true, const dictionary &headerEntries=dictionary::null)
Write file with contents.
A class for handling words, derived from Foam::string.
label size() const noexcept
The number of entries in the list.
void waitAll()
Wait for all thread actions to have finished.
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
appendType
File appending (NO_APPEND | APPEND_APP | APPEND_ATE)
OFstreamCollator(const off_t maxBufferSize)
Construct from buffer size. 0 = do not use thread.
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
TypeName("OFstreamCollator")