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)
50 "CompactIOField<T, BaseType>::readFromStream()",
52 ) <<
"unexpected class name " << headerClassName()
53 <<
" expected " << typeName <<
" or " << IOField<T>::typeName
55 <<
" while reading object " <<
name()
63 template<
class T,
class BaseType>
79 template<
class T,
class BaseType>
103 template<
class T,
class BaseType>
127 template<
class T,
class BaseType>
151 template<
class T,
class BaseType>
159 template<
class T,
class BaseType>
188 template<
class T,
class BaseType>
191 return (os << *
this).good();
197 template<
class T,
class BaseType>
198 void Foam::CompactIOField<T, BaseType>::operator=
207 template<
class T,
class BaseType>
216 template<
class T,
class BaseType>
228 L.setSize(start.
size()-1);
234 label index = start[i];
235 subField.
setSize(start[i+1] - index);
239 subField[j] = elems[index++];
247 template<
class T,
class BaseType>
257 os << static_cast<const Field<T>&>(L);
265 for (
label i = 1; i < start.size(); i++)
267 start[i] = start[i-1]+L[i-1].
size();
279 elems[elemI++] = subField[j];
282 os << start << elems;
Pre-declare related SubField type.
static const char *const typeName
readOption readOpt() const
void transfer(List< Type > &)
Transfer the contents of the argument List into this list.
word name(const complex &)
Return a string representation of a complex.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType) const
Write using given format, version and compression.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
tmp< Field< T > > T() const
Return the field transpose (only defined for second rank tensors)
A simple container for copying or transferring objects of type <T>.
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.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType) const
Write using given format, version and compression.
void size(const label)
Override size to be inconsistent with allocated storage.
errorManipArg< error, int > exit(error &err, const int errNo=1)
CompactIOField(const IOobject &)
Construct from IOobject.
void operator=(const CompactIOField< T, BaseType > &)
regIOobject(const IOobject &, const bool isTime=false)
Construct from IOobject. Optional flag for if IOobject is the.
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void operator=(const Field< Type > &)
streamFormat
Enumeration for the format of data in the stream.
virtual bool writeData(Ostream &) const
Pure virtual writaData function.
compressionType
Enumeration for the format of data in the stream.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
bool headerOk()
Read and check header info.
virtual ~CompactIOField()
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
A primitive field of type <T> with automated input and output.