40 if (!IOobjectOption::isAnyRead(readOpt))
return false;
45 const auto* hasValue =
dict.findEntry(
"refValue", keyType::LITERAL);
47 if (!hasValue && IOobjectOption::isReadOptional(readOpt))
52 const auto* hasGrad =
dict.findEntry(
"refGradient", keyType::LITERAL);
53 const auto* hasFrac =
dict.findEntry(
"valueFraction", keyType::LITERAL);
56 if (!hasValue || !hasGrad || !hasFrac)
59 <<
"Required entries:";
66 <<
" : missing for patch " <<
p.name()
67 <<
" : in dictionary " <<
dict.relativeName() <<
nl 72 refValue_.assign(*hasValue,
p.size());
73 refGrad_.assign(*hasGrad,
p.size());
74 valueFraction_.assign(*hasFrac,
p.size());
92 valueFraction_(
p.size())
105 refValue_(
p.size(),
Zero),
107 valueFraction_(
p.size(),
Zero)
124 valueFraction_(
p.size())
147 refValue_(ptf.refValue_, mapper),
148 refGrad_(ptf.refGrad_, mapper),
149 valueFraction_(ptf.valueFraction_, mapper)
160 refValue_(ptf.refValue_),
161 refGrad_(ptf.refGrad_),
162 valueFraction_(ptf.valueFraction_)
174 refValue_(ptf.refValue_),
175 refGrad_(ptf.refGrad_),
176 valueFraction_(ptf.valueFraction_)
189 refValue_.autoMap(m);
191 valueFraction_.autoMap(m);
204 const auto& mptf = refCast<const mixedFaPatchField<Type>>(ptf);
206 refValue_.rmap(mptf.refValue_, addr);
207 refGrad_.rmap(mptf.refGrad_, addr);
208 valueFraction_.rmap(mptf.valueFraction_, addr);
215 if (!this->updated())
217 this->updateCoeffs();
224 this->patchInternalField() + refGrad_/this->
patch().deltaCoeffs(),
240 (refValue_ - this->patchInternalField())*this->
patch().deltaCoeffs(),
264 refGrad_/this->
patch().deltaCoeffs(),
286 this->
patch().deltaCoeffs()*refValue_,
296 refValue_.writeEntry(
"refValue",
os);
297 refGrad_.writeEntry(
"refGradient",
os);
298 valueFraction_.writeEntry(
"valueFraction",
os);
virtual void write(Ostream &os) const
Write.
errorManipArg< error, int > exit(error &err, const int errNo=1)
commsTypes
Communications types.
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, sets updated() to false.
This boundary condition provides a base class for 'mixed' type boundary conditions, i.e. conditions that mix fixed value and patch-normal gradient conditions.
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
constexpr char nl
The newline '\n' character (0x0a)
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
A traits class, which is primarily used for primitives and vector-space.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
friend Ostream & operator(Ostream &, const Field< Type > &)
bool readMixedEntries(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "refValue", "refGradient" and "valueFraction" entries into their respective places...
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual void autoMap(const faPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual void rmap(const faPatchField< Type > &, const labelList &)
Reverse map the given faPatchField onto this faPatchField.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
OBJstream os(runTime.globalPath()/outputName)
Finite area patch class. Used for 2-D non-Euclidian finite area method.
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
void autoMap(const FieldMapper &map, const bool applyFlip=true)
Map from self.
virtual void rmap(const faPatchField< Type > &, const labelList &)
Reverse map the given faPatchField onto this faPatchField.
mixedFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void write(Ostream &) const
Write.
const std::string patch
OpenFOAM patch number as a std::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
A class for managing temporary objects.
A FieldMapper for finite-area patch fields.
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)
readOption
Enumeration defining read preferences.