48#ifndef Foam_fvPatchField_H
49#define Foam_fvPatchField_H
93 bool manipulatedMatrix_;
230 return !patchType_.empty() && patchType_ !=
type();
251 return manipulatedMatrix_;
257 manipulatedMatrix_ = state;
270 bool old(useImplicit_);
371 (
dynamic_cast<const fvPatchFieldType&
>(ptf),
p, iF, m)
513 template<
class DerivedPatchField,
class... Args>
516 const DerivedPatchField& pf,
522 new DerivedPatchField(pf, std::forward<Args>(
args)...)
531 const word& patchFieldType,
543 const word& actualPatchType,
576 template<
class AnyType>
594 return internalField_;
600 return internalField_;
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
constexpr Field() noexcept
Default construct.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
@ LAZY_READ
Reading is optional [identical to READ_IF_PRESENT].
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
commsTypes
Communications types.
@ buffered
"buffered" : (MPI_Bsend, MPI_Recv)
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Template invariant parts for fvPatchField.
fvPatchFieldBase(const fvPatch &p)
Construct from patch.
virtual ~fvPatchFieldBase()=default
Destructor.
virtual bool fixesValue() const
True if the patch field fixes a value.
void checkPatch(const fvPatchFieldBase &rhs) const
Check that patches are identical.
virtual bool coupled() const
True if the patch field is coupled.
static const word & zeroValueType() noexcept
The type name for zeroValue patch fields.
static const word & calculatedType() noexcept
The type name for calculated patch fields.
const objectRegistry & db() const
The associated objectRegistry.
virtual void readDict(const dictionary &dict)
Read dictionary entries.
const fvPatch & patch() const noexcept
Return the patch.
void setManipulated(bool state) noexcept
Set matrix manipulated state.
bool useImplicit() const noexcept
Use implicit formulation for coupled patches only.
void setUpdated(bool state) noexcept
Set updated state.
static const word & extrapolatedCalculatedType() noexcept
The type name for extrapolatedCalculated patch fields combines zero-gradient and calculated.
static int disallowGenericPatchField
Debug switch to disallow the use of generic fvPatchField.
TypeName("fvPatchField")
Runtime type information.
bool useImplicit(bool on) noexcept
Set useImplicit on/off.
const word & patchType() const noexcept
The optional patch type.
bool manipulatedMatrix() const noexcept
True if the matrix has already been manipulated.
virtual bool constraintOverride() const
True if the type does not correspond to the constraint type.
virtual bool assignable() const
True if the value of the patch field is altered by assignment.
bool updated() const noexcept
True if the boundary condition has already been updated.
word & patchType() noexcept
The optional patch type.
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
static const word & emptyType() noexcept
The type name for empty patch fields.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the evaluation of the value of this patchField...
fvPatchField(const fvPatch &p, const DimensionedField< Type, volMesh > &iF, const dictionary &dict, const bool needValue)
Construct, forwarding to readOption variant.
virtual void valueBoundaryCoeffs(const tmp< Field< scalar > > &, UList< Type > &) const
Retrieve the matrix source coefficients corresponding to the evaluation of the value of this patchFie...
virtual void operator/=(const Field< scalar > &)
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
static tmp< fvPatchField< Type > > NewCalculatedType(const fvPatchField< AnyType > &pf)
Return a pointer to a new calculatedFvPatchField created on.
DimensionedField< Type, volMesh > Internal
The internal field type associated with the patch field.
static tmp< fvPatchField< Type > > New(const fvPatchField< Type > &, const fvPatch &, const DimensionedField< Type, volMesh > &, const fvPatchFieldMapper &)
Return a pointer to a new patchField created on freestore from.
virtual tmp< Field< Type > > snGrad(const scalarField &deltaCoeffs) const
Return patch-normal gradient for coupled-patches using the deltaCoeffs provided.
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
static tmp< fvPatchField< Type > > New(const word &patchFieldType, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
virtual void operator=(const Type &)
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the evaluation of the value of this patchFie...
virtual void write(Ostream &) const
Write.
virtual void operator-=(const Type &)
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &dict, IOobjectOption::readOption requireValue=IOobjectOption::MUST_READ)
Construct from patch, internal field and dictionary.
declareRunTimeSelectionTable(tmp, fvPatchField, dictionary,(const fvPatch &p, const DimensionedField< Type, volMesh > &iF, const dictionary &dict),(p, iF, dict))
Type value_type
The value_type for the patch field.
virtual void gradientBoundaryCoeffs(const scalarField &deltaCoeffs, UList< Type > &) const
Retrieve the matrix source coefficients corresponding to the evaluation of the gradient of this coupl...
virtual void initEvaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Initialise the evaluation of the patch field.
virtual void operator==(const fvPatchField< Type > &)
declareRunTimeSelectionTable(tmp, fvPatchField, patch,(const fvPatch &p, const DimensionedField< Type, volMesh > &iF),(p, iF))
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch.
fvPatch Patch
The patch type for the patch field.
virtual void patchNeighbourField(UList< Type > &) const
Retrieve patchField on the opposite patch of a coupled patch.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
static tmp< fvPatchField< Type > > New(const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &)
Return a pointer to a new patchField created on freestore.
static tmp< fvPatchField< Type > > NewCalculatedType(const fvPatch &p)
Return a pointer to a new calculatedFvPatchField created on.
virtual void operator*=(const Field< scalar > &)
virtual void operator==(const Field< Type > &)
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const word &patchType)
Construct from patch, internal field and patch type.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual void operator+=(const Field< Type > &)
virtual void initEvaluateLocal(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Initialise the evaluation of the patch field after a local.
virtual void operator-=(const fvPatchField< Type > &)
const Field< Type > & primitiveField() const noexcept
Return const-reference to the internal field values.
virtual void operator+=(const Type &)
const DimensionedField< scalar, volMesh > & internalField() const noexcept
virtual void evaluateLocal(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field after a local operation (e.g. *=).
virtual void gradientBoundaryCoeffs(UList< Type > &) const
Retrieve the matrix source coefficients corresponding to the evaluation of the gradient of this patch...
virtual tmp< Field< Type > > gradientBoundaryCoeffs(const scalarField &deltaCoeffs) const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this coupled...
virtual void operator-=(const Field< Type > &)
virtual void operator=(const UList< Type > &)
pTraits< Type >::cmptType cmptType
The component type for patch field.
fvPatchField(const fvPatchField< Type > &, const fvPatch &, const DimensionedField< Type, volMesh > &, const fvPatchFieldMapper &)
Construct by mapping the given fvPatchField onto a new patch.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this patch...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
fvPatchField(const fvPatchField< Type > &pfld)
Copy construct.
virtual void gradientInternalCoeffs(const scalarField &deltaCoeffs, UList< Type > &) const
Retrieve the matrix diagonal coefficients corresponding to the evaluation of the gradient of this cou...
virtual ~fvPatchField()=default
Destructor.
calculatedFvPatchField< Type > Calculated
Type for a calculated patch.
virtual void patchInternalField(UList< Type > &pfld) const
Retrieve internal field next to patch.
virtual void snGrad(UList< Type > &result) const
Retrieve patch-normal gradient [contiguous storage].
virtual void manipulateMatrix(fvMatrix< Type > &matrix)
Manipulate matrix.
virtual void operator/=(const scalar)
virtual void operator*=(const fvPatchField< scalar > &)
virtual void operator=(const fvPatchField< Type > &)
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const Type &value)
Construct from patch, internal field and value.
virtual void snGrad(const scalarField &deltaCoeffs, UList< Type > &) const
Retrieve patch-normal gradient for coupled-patches using the deltaCoeffs provided [contiguous storage...
bool operator!=(const fvPatchField< Type > &) const =delete
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, Field< Type > &&pfld)
Construct from patch, internal field and patch field.
bool operator!=(const Field< Type > &) const =delete
virtual void operator+=(const fvPatchField< Type > &)
declareRunTimeSelectionTable(tmp, fvPatchField, patchMapper,(const fvPatchField< Type > &ptf, const fvPatch &p, const DimensionedField< Type, volMesh > &iF, const fvPatchFieldMapper &m),(dynamic_cast< const fvPatchFieldType & >(ptf), p, iF, m))
fvPatchField(const fvPatchField< Type > &pfld, const DimensionedField< Type, volMesh > &iF)
Copy construct with internal field reference.
virtual void valueInternalCoeffs(const tmp< Field< scalar > > &, UList< Type > &) const
Retrieve the matrix diagonal coefficients corresponding to the evaluation of the value of this patchF...
bool operator!=(const Type &) const =delete
virtual void updateWeightedCoeffs(const scalarField &weights)
Update the coefficients associated with the patch field.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
virtual void gradientInternalCoeffs(UList< Type > &) const
Retrieve the matrix diagonal coefficients corresponding to the evaluation of the gradient of this pat...
virtual tmp< fvPatchField< Type > > clone() const
Clone patch field with its own internal field reference.
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
void extrapolateInternal()
Assign the patch field from the internal field.
virtual void operator/=(const fvPatchField< scalar > &)
static tmp< fvPatchField< Type > > New(const word &patchFieldType, const word &actualPatchType, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
void check(const fvPatchField< Type > &) const
Check against given patch field.
virtual void operator*=(const scalar)
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field, sets updated() to false.
virtual void manipulateMatrix(fvMatrix< Type > &matrix, const label iMatrix, const direction cmp)
Manipulate fvMatrix.
virtual void manipulateMatrix(fvMatrix< Type > &matrix, const scalarField &weights)
Manipulate matrix with given weights.
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void operator==(const Type &)
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const Field< Type > &pfld)
Construct from patch, internal field and patch field.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone patch field with given internal field reference.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this patchFi...
fvPatchField(const fvPatchField< Type > &pfld, const fvPatch &p, const DimensionedField< Type, volMesh > &iF, const Type &value)
Copy construct onto a new patch with internal field reference and specified value.
virtual tmp< Field< Type > > gradientInternalCoeffs(const scalarField &deltaCoeffs) const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this coupl...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Registry of regIOobjects.
A traits class, which is primarily used for primitives and vector-space.
A class for managing temporary objects.
Mesh data needed to do the Finite Volume discretisation.
A class for handling words, derived from Foam::string.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
OBJstream os(runTime.globalPath()/outputName)
Macros for creating fvPatchField types.
const word zeroGradientType
A zeroGradient patch field type.
const word extrapolatedCalculatedType
A combined zero-gradient and calculated patch field type.
const word calculatedType
A calculated patch field type.
const word emptyType
An empty patch field type.
const word zeroValueType
A zeroValue patch field type.
List< label > labelList
A List of labels.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
Foam::argList args(argc, argv)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.