36 const word& entryName,
45 value_(this->size(), uniformValue_)
53 const word& entryName,
62 isUniform_(isUniform),
66 if (fieldValues.
size() != this->
size())
69 <<
"Supplied field size " << fieldValues.
size()
70 <<
" is not equal to the number of " 72 << this->
size() <<
" of patch " << pp.
name() <<
nl 82 const word& entryName,
84 const dictionary&
dict,
97 if (entryName ==
dict.dictName())
103 dict.readEntry(
"value", uniformValue);
112 <<
"Null entry" <<
nl 116 else if (!eptr->isStream())
121 dict.readEntry(
"value", uniformValue);
128 ITstream& is = eptr->stream();
130 if (is.peek().isWord())
132 const word contentType(is);
134 if (contentType ==
"constant" || contentType ==
"uniform")
140 else if (contentType ==
"nonuniform")
147 is >>
static_cast<List<Type>&
>(
fld);
148 const label lenRead =
fld.size();
159 <<
"Sizes do not match. Truncating " << lenRead
160 <<
" entries to " << len <<
endl;
169 <<
"size " << lenRead
170 <<
" is not equal to the expected length " << len
178 <<
"Expected keyword 'constant', 'uniform', or 'nonuniform'" 179 <<
", found " << contentType
199 const word& redirectType,
200 const word& entryName,
202 const bool faceValues
228 const word& entryName,
230 const bool faceValues
269 isUniform_(rhs.isUniform_),
270 uniformValue_(rhs.uniformValue_),
278 value_ = uniformValue_;
291 value_.autoMap(mapper);
296 value_ = uniformValue_;
308 const auto& cst = refCast<const ConstantField<Type>>(pf1);
309 value_.rmap(cst.value_, addr);
323 os.writeKeyword(this->
name())
329 value_.writeEntry(this->
name(), os);
A class for handling keywords in dictionaries.
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Templated function that returns a constant value.
ConstantField(const polyPatch &pp, const word &entryName, const Type &uniformValue, const dictionary &dict=dictionary::null, const bool faceValues=true)
Construct from a uniform value.
label size() const
Number of faces or points on the patch.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Abstract base class to hold the Field mapping addressing and weights.
virtual void autoMap(const FieldMapper &mapper)
Map (and resize as needed) from self given a mapping object.
Generic templated field type.
A class for handling words, derived from Foam::string.
virtual void rmap(const PatchFunction1< Type > &pf1, const labelList &addr)
Reverse map the given PatchFunction1 onto this PatchFunction1.
virtual void writeData(Ostream &os) const
Write in dictionary format.
bool faceValues() const noexcept
Generate face or point values on patch?
const word & name() const noexcept
The patch name.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
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))
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const std::string patch
OpenFOAM patch number as a std::string.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
A patch is a list of labels that address the faces in the global face list.
static bool allowConstructFromLargerSize
Permit read construct from a larger size.
virtual void writeData(Ostream &os) const
Write in dictionary format.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A keyword and a list of tokens is an 'entry'.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)