35 template<
class Type,
class GeoMesh>
39 const word& fieldDictEntry
42 dimensions_.readEntry(
"dimensions", fieldDict);
48 if (oriented_.oriented() != orientedType::ORIENTED)
50 oriented_.
read(fieldDict);
57 fld.resize_nocopy(GeoMesh::size(mesh_));
58 fld.assign(fieldDictEntry, fieldDict,
fld.size());
62 template<
class Type,
class GeoMesh>
65 const word& fieldDictEntry
70 localIOdictionary::readContents
78 IOobjectOption::MUST_READ,
79 IOobjectOption::NO_WRITE,
80 IOobjectOption::NO_REGISTER
88 readField(
dict, fieldDictEntry);
92 template<
class Type,
class GeoMesh>
95 const word& fieldDictEntry
100 this->isReadRequired()
101 || (this->isReadOptional() && this->headerOk())
104 readField(fieldDictEntry);
114 template<
class Type,
class GeoMesh>
119 const word& fieldDictEntry
125 readField(fieldDictEntry);
129 template<
class Type,
class GeoMesh>
135 const word& fieldDictEntry
141 readField(fieldDict, fieldDictEntry);
147 template<
class Type,
class GeoMesh>
151 const word& fieldDictEntry
154 os.writeEntry(
"dimensions", dimensions());
157 if (oriented_.writeEntry(
os))
162 Field<Type>::writeEntry(fieldDictEntry,
os);
171 template<
class Type,
class GeoMesh>
175 const DimensionedField<Type, GeoMesh>&
fld 184 template<
class Type,
class GeoMesh>
188 const tmp<DimensionedField<Type, GeoMesh>>& tfld
191 tfld().writeData(
os);
virtual bool read()
Read object.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
DimensionedField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &field)
Construct from components, copy initial field content.
constexpr char nl
The newline '\n' character (0x0a)
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Generic templated field type.
bool writeData(Ostream &os, const word &fieldDictEntry) const
Write dimensions, oriented flag (if valid) and the field data as a dictionary entry with the specifie...
A class for handling words, derived from Foam::string.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Defines the attributes of an object for which implicit objectRegistry management is supported...