34template<
class T,
class BaseType>
37 Istream& is = readStream(word::null, valid);
41 if (headerClassName() == IOField<T>::typeName)
43 is >>
static_cast<Field<T>&
>(*this);
46 else if (headerClassName() == typeName)
54 <<
"Unexpected class name " << headerClassName()
55 <<
" expected " << typeName
56 <<
" or " << IOField<T>::typeName <<
nl
57 <<
" while reading object " <<
name()
58 <<
exit(FatalIOError);
66template<
class T,
class BaseType>
82template<
class T,
class BaseType>
93 readFromStream(valid);
98 readFromStream(valid && haveFile);
103template<
class T,
class BaseType>
123template<
class T,
class BaseType>
147template<
class T,
class BaseType>
171template<
class T,
class BaseType>
195template<
class T,
class BaseType>
205 const word oldTypeName(typeName);
212 const_cast<word&
>(typeName) = oldTypeName;
221template<
class T,
class BaseType>
224 return (
os << *
this).
good();
230template<
class T,
class BaseType>
247template<
class T,
class BaseType>
259 L.setSize(start.size()-1);
265 label index = start[i];
266 subField.setSize(start[i+1] - index);
270 subField[j] = elems[index++];
278template<
class T,
class BaseType>
288 os << static_cast<const Field<T>&>(
L);
296 for (label i = 1; i < start.size(); i++)
298 start[i] = start[i-1]+
L[i-1].
size();
301 Field<BaseType> elems(start[start.size()-1]);
306 const T& subField =
L[i];
310 elems[elemI++] = subField[j];
313 os << start << elems;
A Field of objects of type <T> with automated input and output using a compact storage....
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
virtual bool resize()
Resize the ODE solver.
Generic templated field type.
void operator=(const Field< Type > &)
Copy assignment.
A primitive field of type <T> with automated input and output.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
readOption readOpt() const noexcept
The read option.
bool good() const noexcept
Did last readHeader() succeed?
The IOstreamOption is a simple container for options an IOstream can normally have.
streamFormat format() const noexcept
Get the current stream format.
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,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static constexpr direction size() noexcept
The number of elements in the VectorSpace = Ncmpts.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
bool headerOk()
Read and check header info. Does not check the headerClassName.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
transferModelList & transfer()
Transfer.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
List< label > labelList
A List of labels.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
const vector L(dict.get< vector >("L"))