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()),
93 source_(
p.size(),
Zero)
106 refValue_(
p.size(),
Zero),
107 refGrad_(
p.size(),
Zero),
109 source_(
p.size(),
Zero)
126 valueFraction_(
p.size()),
127 source_(
p.size(),
Zero)
129 if (!readMixedEntries(
dict, requireMixed))
150 refValue_(ptf.refValue_, mapper),
151 refGrad_(ptf.refGrad_, mapper),
152 valueFraction_(ptf.valueFraction_, mapper),
153 source_(ptf.source_, mapper)
158 <<
"On field " << iF.
name() <<
" patch " <<
p.name()
159 <<
" patchField " << this->
type()
160 <<
" : mapper does not map all values." <<
nl 161 <<
" To avoid this warning fully specify the mapping in derived" 170 const mixedFvPatchField<Type>& ptf
173 fvPatchField<Type>(ptf),
174 refValue_(ptf.refValue_),
175 refGrad_(ptf.refGrad_),
176 valueFraction_(ptf.valueFraction_),
189 refValue_(ptf.refValue_),
190 refGrad_(ptf.refGrad_),
191 valueFraction_(ptf.valueFraction_),
205 refValue_.autoMap(m);
207 valueFraction_.autoMap(m);
222 refCast<const mixedFvPatchField<Type>>(ptf);
224 refValue_.
rmap(mptf.refValue_, addr);
225 refGrad_.rmap(mptf.refGrad_, addr);
226 valueFraction_.rmap(mptf.valueFraction_, addr);
227 source_.rmap(mptf.source_, addr);
234 if (!this->updated())
236 this->updateCoeffs();
239 Field<Type>::operator=
243 this->patchInternalField() + refGrad_/this->
patch().deltaCoeffs(),
260 (refValue_ - this->patchInternalField())*this->
patch().deltaCoeffs(),
286 refGrad_/this->
patch().deltaCoeffs(),
308 this->
patch().deltaCoeffs()*refValue_,
318 refValue_.writeEntry(
"refValue",
os);
319 refGrad_.writeEntry(
"refGradient",
os);
320 valueFraction_.writeEntry(
"valueFraction",
os);
321 source_.writeEntry(
"source",
os);
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...
const word & name() const noexcept
Return the object name.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A traits class, which is primarily used for primitives.
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
This boundary condition provides a base class for 'mixed' type boundary conditions, i.e. conditions that mix fixed value and patch-normal gradient conditions.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
bool readMixedEntries(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the 'refValue', 'refGradient' and 'valueFraction' entries into their respective places...
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
A FieldMapper for finite-volume patch fields.
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.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual bool hasUnmapped() const =0
Any unmapped values?
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
OBJstream os(runTime.globalPath()/outputName)
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
mixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
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...
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 ...
virtual void write(Ostream &) const
Write.
A class for managing temporary objects.
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
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.