34 template<
class ListType>
47 template<
class ListType>
51 os <<
nl << l.size() <<
nl << token::BEGIN_LIST;
61 os <<
nl << token::END_LIST <<
nl;
65 template<
class ListType>
70 os << token::END_STATEMENT <<
endl;
87 if (os.
format() == IOstream::ASCII || !contiguous<T>())
91 if (L.
size() > 1 && contiguous<T>())
108 os << L.
size() << token::BEGIN_BLOCK;
114 os << token::END_BLOCK;
116 else if (L.
size() <= 1 || (L.
size() < 11 && contiguous<T>()))
119 os << L.
size() << token::BEGIN_LIST;
124 if (i > 0) os << token::SPACE;
129 os << token::END_LIST;
134 os <<
nl << L.
size() <<
nl << token::BEGIN_LIST;
143 os <<
nl << token::END_LIST <<
nl;
156 os.
check(
"Ostream& operator<<(Ostream&, const UList&)");
165 is.
fatalCheck(
"operator>>(Istream&, UList<T>&)");
167 token firstToken(is);
169 is.fatalCheck(
"operator>>(Istream&, UList<T>&) : reading first token");
171 if (firstToken.isCompound())
178 firstToken.transferCompoundToken(is)
187 <<
"incorrect length for UList. Read " <<
s
188 <<
" expected " << L.size()
196 else if (firstToken.isLabel())
198 label s = firstToken.labelToken();
204 <<
"incorrect length for UList. Read " <<
s
205 <<
" expected " << L.size()
211 if (is.format() == IOstream::ASCII || !contiguous<T>())
214 char delimiter = is.readBeginList(
"List");
218 if (delimiter == token::BEGIN_LIST)
226 "operator>>(Istream&, UList<T>&) : reading entry"
237 "operator>>(Istream&, UList<T>&) : "
238 "reading the single entry"
249 is.readEndList(
"List");
255 is.read(
reinterpret_cast<char*
>(L.data()),
s*
sizeof(
T));
259 "operator>>(Istream&, UList<T>&) : reading the binary block"
264 else if (firstToken.isPunctuation())
266 if (firstToken.pToken() != token::BEGIN_LIST)
269 <<
"incorrect first token, expected '(', found "
275 is.putBack(firstToken);
280 if (sll.size() != L.size())
283 <<
"incorrect length for UList. Read " << sll.size()
284 <<
" expected " << L.size()
292 typename SLList<T>::const_iterator iter = sll.begin();
304 <<
"incorrect first token, expected <int> or '(', found "
Non-intrusive singly-linked list.
#define forAll(list, i)
Loop across all elements in list.
streamFormat format() const
Return current stream format.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const token &)
Write token.
virtual Ostream & writeCompoundTag(const word &typeName)
Write the compound token tag if the name is a compound token.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const
Return the number of elements in the UList.
std::streamsize byteSize() const
Return the binary size in number of characters of the UList.
Traits class for primitives.
Motion of the mesh specified as a list of pointMeshMovers.
A class for handling words, derived from string.
Template function to specify if the data of a type are contiguous.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
errorManipArg< error, int > exit(error &err, const int errNo=1)
Istream & operator>>(Istream &, pointEdgeDist &)
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.
void writeListEntry(Ostream &os, const ListType &l)
To & dynamicCast(From &r)
Reference type cast template function,.
void writeListEntries(Ostream &os, const ListType &l)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)