31 template<
class T,
class BaseType>
34 Istream& is = readStream(word::null, valid);
38 if (headerClassName() == IOField<T>::typeName)
40 is >>
static_cast<Field<T>&
>(*this);
43 else if (headerClassName() == typeName)
53 ) <<
"unexpected class name " << headerClassName()
54 <<
" expected " << typeName <<
" or " << IOField<T>::typeName
56 <<
" while reading object " <<
name()
65 template<
class T,
class BaseType>
81 template<
class T,
class BaseType>
92 readFromStream(valid);
97 readFromStream(valid && haveFile);
102 template<
class T,
class BaseType>
126 template<
class T,
class BaseType>
150 template<
class T,
class BaseType>
174 template<
class T,
class BaseType>
182 template<
class T,
class BaseType>
212 template<
class T,
class BaseType>
215 return (os << *
this).good();
221 template<
class T,
class BaseType>
222 void Foam::CompactIOField<T, BaseType>::operator=
231 template<
class T,
class BaseType>
240 template<
class T,
class BaseType>
252 L.setSize(start.
size()-1);
258 label index = start[i];
259 subField.
setSize(start[i+1] - index);
263 subField[j] = elems[index++];
271 template<
class T,
class BaseType>
281 os << static_cast<const Field<T>&>(L);
289 for (
label i = 1; i < start.size(); i++)
291 start[i] = start[i-1]+L[i-1].
size();
303 elems[elemI++] = subField[j];
306 os << start << elems;
A simple container for copying or transferring objects of type <T>.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
CompactIOField(const IOobject &)
Construct from IOobject.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static const char *const typeName
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool valid) const
Write using given format, version and compression.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool headerOk()
Read and check header info.
Pre-declare related SubField type.
regIOobject(const IOobject &, const bool isTime=false)
Construct from IOobject. Optional flag for if IOobject is the.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool valid) const
Write using given format, version and compression.
A class for handling words, derived from string.
void operator=(const CompactIOField< T, BaseType > &)
streamFormat
Enumeration for the format of data in the stream.
virtual bool writeData(Ostream &) const
Pure virtual writaData function.
virtual ~CompactIOField()
compressionType
Enumeration for the format of data in the stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void operator=(const Field< Type > &)
word name(const complex &)
Return a string representation of a complex.
void setSize(const label)
Reset size of List.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A Field of objects of type <T> with automated input and output using a compact storage. Behaves like IOField except when binary output in case it writes a CompactListList.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
tmp< Field< T > > T() const
Return the field transpose (only defined for second rank tensors)
readOption readOpt() const
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A primitive field of type <T> with automated input and output.
void transfer(List< Type > &)
Transfer the contents of the argument List into this list.