31 template<
class T,
class BaseType>
34 Istream& is = readStream(word::null);
36 if (headerClassName() == IOField<T>::typeName)
38 is >>
static_cast<Field<T>&
>(*this);
41 else if (headerClassName() == typeName)
51 ) <<
"unexpected class name " << headerClassName()
52 <<
" expected " << typeName <<
" or " << IOField<T>::typeName
54 <<
" while reading object " <<
name()
62 template<
class T,
class BaseType>
78 template<
class T,
class BaseType>
102 template<
class T,
class BaseType>
126 template<
class T,
class BaseType>
150 template<
class T,
class BaseType>
158 template<
class T,
class BaseType>
187 template<
class T,
class BaseType>
190 return (os << *
this).good();
196 template<
class T,
class BaseType>
197 void Foam::CompactIOField<T, BaseType>::operator=
206 template<
class T,
class BaseType>
215 template<
class T,
class BaseType>
227 L.setSize(start.
size()-1);
233 label index = start[i];
234 subField.
setSize(start[i+1] - index);
238 subField[j] = elems[index++];
246 template<
class T,
class BaseType>
256 os << static_cast<const Field<T>&>(L);
264 for (
label i = 1; i < start.size(); i++)
266 start[i] = start[i-1]+L[i-1].
size();
278 elems[elemI++] = subField[j];
281 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
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.
Pre-declare related SubField type.
regIOobject(const IOobject &, const bool isTime=false)
Construct from IOobject. Optional flag for if IOobject is the.
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 writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType) const
Write using given format, version and compression.
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...
tmp< Field< T > > T() const
Return the field transpose (only defined for second rank tensors)
void operator=(const Field< Type > &)
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType) const
Write using given format, version and compression.
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.
readOption readOpt() const
virtual bool writeData(Ostream &) const
Pure virtual writaData function.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
bool headerOk()
Read and check header info.
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.