Go to the documentation of this file.
35 if (expressions::patchExprFieldBase::debug_ && !
debug)
53 driver_(this->
patch())
55 this->refValue() =
Zero;
56 this->refGrad() =
Zero;
57 this->valueFraction() = scalar(1);
89 driver_(this->
patch(), dict)
95 if (this->valueExpr_.empty() && this->gradExpr_.empty())
97 if (this->valueExpr_.empty())
100 <<
"The valueExpr was not defined!" <<
nl
103 if (this->gradExpr_.empty())
106 <<
"The gradientExpr was not defined!" <<
nl
112 driver_.readDict(
dict);
115 dict.readIfPresent(
"patchType", this->patchType());
117 if (
dict.found(
"refValue"))
123 this->refValue() = this->patchInternalField();
126 if (
dict.found(
"value"))
133 if (!
dict.found(
"refValue"))
144 <<
"No value defined for "
145 << this->internalField().name()
146 <<
" on " << this->
patch().name() <<
" therefore using "
147 <<
"the internal field next to the patch"
152 if (dict.
found(
"refGradient"))
158 this->refGrad() =
Zero;
161 if (
dict.found(
"valueFraction"))
167 this->valueFraction() = 1;
171 if (this->evalOnConstruct_)
180 if (!this->updated())
187 this->valueFraction()*this->refValue()
189 (1.0 - this->valueFraction())*
191 this->patchInternalField()
192 + this->refGrad()/this->
patch().deltaCoeffs()
240 <<
"Value: " << this->valueExpr_ <<
nl
241 <<
"Gradient: " << this->gradExpr_ <<
nl
242 <<
"Fraction: " << this->fracExpr_ <<
nl
245 driver_.writeVariableStrings(
Info) <<
endl;
258 driver_.clearVariables();
260 if (this->valueExpr_.empty())
262 this->refValue() =
Zero;
266 this->refValue() = driver_.evaluate<Type>(this->valueExpr_);
269 bool evalGrad = !this->gradExpr_.empty();
271 if (this->fracExpr_.empty() || this->fracExpr_ ==
"1")
274 this->valueFraction() = scalar(1);
276 else if (this->fracExpr_ ==
"0")
278 this->valueFraction() =
Zero;
282 this->valueFraction() = driver_.evaluate<scalar>(this->fracExpr_);
287 this->refGrad() = driver_.evaluate<Type>(this->gradExpr_);
291 this->refGrad() =
Zero;
305 driver_.writeCommon(os, this->debug_ ||
debug);
int debug
Static debugging option.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
#define InfoInFunction
Report an information message using Foam::Info.
virtual void write(Ostream &os) const
Write.
static constexpr const zero Zero
Global zero (0)
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
exprMixedFvPatchField(const fvPatch &p, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
expressions::patchExpr::parseDriver driver_
The expression driver.
Base class for managing patches with expressions. The expected input supports values,...
Generic templated field type.
messageStream Info
Information stream (uses stdout - output is on the master only)
#define DebugInFunction
Report an information message using Foam::Info.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
This boundary condition provides a base class for 'mixed' type boundary conditions,...
errorManipArg< error, int > exit(error &err, const int errNo=1)
const std::string patch
OpenFOAM patch number as a std::string.
void setDebug()
Set debug ON if "debug" is enabled.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A mixed boundary condition with expressions.
#define WarningInFunction
Report a warning using Foam::Warning.
string evaluate(const std::string &s, size_t pos=0, size_t len=std::string::npos)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...