Go to the documentation of this file.
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
83 const dictionary&
dict,
94 if (!eptr || !eptr->isStream())
97 <<
"Null or invalid entry" <<
nl
100 ITstream& is = eptr->stream();
102 if (is.peek().isWord())
104 const word contentType(is);
106 if (contentType ==
"constant" || contentType ==
"uniform")
112 else if (contentType ==
"nonuniform")
119 is >>
static_cast<List<Type>&
>(
fld);
120 const label lenRead =
fld.size();
131 <<
"Sizes do not match. Truncating " << lenRead
132 <<
" entries to " << len <<
endl;
141 <<
"size " << lenRead
142 <<
" is not equal to the expected length " << len
150 <<
"Expected keyword 'constant', 'uniform', or 'nonuniform'"
151 <<
", found " << contentType
171 const word& redirectType,
172 const word& entryName,
174 const bool faceValues
199 const word& entryName,
201 const bool faceValues
239 isUniform_(rhs.isUniform_),
240 uniformValue_(rhs.uniformValue_),
244 value_.resize(this->size(),
Zero);
248 value_ = uniformValue_;
261 value_.autoMap(mapper);
266 value_ = uniformValue_;
278 const auto& cst = refCast<const ConstantField<Type>>(pf1);
279 value_.rmap(cst.value_, addr);
293 os.writeKeyword(this->
name())
299 value_.writeEntry(this->
name(), os);
A keyword and a list of tokens is an 'entry'.
A class for handling words, derived from Foam::string.
virtual ITstream & stream() const =0
virtual void writeData(Ostream &os) const
static constexpr const zero Zero
virtual void writeData(Ostream &os) const
static bool allowConstructFromLargerSize
virtual bool isStream() const noexcept
Templated function that returns a constant value.
const bool writeData(pdfDictionary.get< bool >("writeData"))
Abstract base class to hold the Field mapping addressing and weights.
Ostream & endl(Ostream &os)
bool isWord() const noexcept
A class for handling keywords in dictionaries.
An input stream of tokens.
ConstantField(const polyPatch &pp, const word &entryName, const Type &uniformValue, const dictionary &dict=dictionary::null, const bool faceValues=true)
A patch is a list of labels that address the faces in the global face list.
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))
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
virtual void autoMap(const FieldMapper &mapper)
errorManipArg< error, int > exit(error &err, const int errNo=1)
const polyPatch const word const word const dictionary & dict
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const polyPatch const word const word const dictionary const bool faceValues
virtual void rmap(const PatchFunction1< Type > &pf1, const labelList &addr)
word name(const expressions::valueTypeCode typeCode)
#define FatalIOErrorInFunction(ios)
const word & name() const noexcept
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
#define IOWarningInFunction(ios)
const token & peek() const