40 refValueFunc_(nullptr),
41 refGradFunc_(nullptr),
42 valueFractionFunc_(nullptr)
55 refValueFunc_(nullptr),
56 refGradFunc_(nullptr),
57 valueFractionFunc_(nullptr)
79 valueFractionFunc_(
nullptr)
88 valueFractionFunc_.reset
90 PatchFunction1<scalar>::New
93 "uniformValueFraction",
99 else if (!refGradFunc_)
103 <<
"For " << this->internalField().name() <<
" on " 105 <<
"Require either or both: uniformValue and uniformGradient" 106 <<
" (possibly uniformValueFraction as well)" <<
nl 111 if (!this->readValueEntry(
dict))
114 this->extrapolateInternal();
125 const uniformMixedFvPatchField<Type>& ptf,
127 const DimensionedField<Type, volMesh>& iF,
128 const fvPatchFieldMapper& mapper
131 mixedFvPatchField<Type>(ptf,
p, iF, mapper),
132 refValueFunc_(ptf.refValueFunc_.clone(
p.
patch())),
133 refGradFunc_(ptf.refGradFunc_.clone(
p.
patch())),
134 valueFractionFunc_(ptf.valueFractionFunc_.clone(
p.
patch()))
145 refValueFunc_(ptf.refValueFunc_.clone(this->
patch().
patch())),
147 valueFractionFunc_(ptf.valueFractionFunc_.clone(this->
patch().
patch()))
159 refValueFunc_(ptf.refValueFunc_.clone(this->
patch().
patch())),
160 refGradFunc_(ptf.refGradFunc_.clone(this->
patch().
patch())),
161 valueFractionFunc_(ptf.valueFractionFunc_.clone(this->
patch().
patch()))
164 if (ptf.refValueFunc_ || ptf.refGradFunc_)
181 const scalar t = this->db().time().timeOutputValue();
185 this->refValue() = refValueFunc_->value(t);
190 this->valueFraction() = valueFractionFunc_->value(t);
195 this->valueFraction() = 1;
200 this->refValue() =
Zero;
201 this->valueFraction() = 0;
205 this->refGrad() = refGradFunc_->value(t);
209 this->refGrad() =
Zero;
226 refValueFunc_->writeData(
os);
230 refGradFunc_->writeData(
os);
232 if (valueFractionFunc_)
234 valueFractionFunc_->writeData(
os);
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...
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
constexpr char nl
The newline '\n' character (0x0a)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
This boundary condition provides a base class for 'mixed' type boundary conditions, i.e. conditions that mix fixed value and patch-normal gradient conditions.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual void write(Ostream &) const
Write.
virtual void readDict(const dictionary &dict)
Read dictionary entries.
Generic templated field type.
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.
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))
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
static autoPtr< PatchFunction1< Type > > NewIfPresent(const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
An optional selector.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
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)