41 if (!IOobjectOption::isAnyRead(readOpt))
return false;
45 const auto* eptr =
dict.findEntry(
"gradient", keyType::LITERAL);
49 gradient_.assign(*eptr,
p.size());
53 if (IOobjectOption::isReadRequired(readOpt))
56 <<
"Required entry 'gradient' : missing for patch " <<
p.name()
57 <<
" in dictionary " <<
dict.relativeName() <<
nl 75 gradient_(
p.size(),
Zero)
108 const fixedGradientFvPatchField<Type>& ptf,
110 const DimensionedField<Type, volMesh>& iF,
111 const fvPatchFieldMapper& mapper
114 fvPatchField<Type>(ptf,
p, iF, mapper),
115 gradient_(ptf.gradient_, mapper)
117 if (
notNull(iF) && mapper.hasUnmapped())
120 <<
"On field " << iF.name() <<
" patch " <<
p.name()
121 <<
" patchField " << this->
type()
122 <<
" : mapper does not map all values." <<
nl 123 <<
" To avoid this warning fully specify the mapping in derived" 132 const fixedGradientFvPatchField<Type>& ptf
136 gradient_(ptf.gradient_)
148 gradient_(ptf.gradient_)
161 gradient_.autoMap(m);
175 refCast<const fixedGradientFvPatchField<Type>>(ptf);
177 gradient_.
rmap(fgptf.gradient_, addr);
184 if (!this->updated())
186 this->updateCoeffs();
191 this->patchInternalField() + gradient_/this->
patch().deltaCoeffs()
216 return gradient()/this->
patch().deltaCoeffs();
240 gradient_.writeEntry(
"gradient",
os);
bool readGradientEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "gradient" entry into corresponding member.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
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.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field, sets updated() to false.
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 and vector-space.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
void extrapolateInternal()
Assign the patch field from the internal field.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void write(Ostream &) const
Write.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual void write(Ostream &) const
Write.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
friend Ostream & operator(Ostream &, const Field< Type > &)
fixedGradientFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A FieldMapper for finite-volume patch fields.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
This boundary condition supplies a fixed gradient condition, such that the patch values are calculate...
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
bool notNull(const T *ptr) noexcept
True if ptr is not a pointer (of type T) to the nullObject.
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 for managing temporary objects.
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.