49#ifndef Foam_faPatchField_H
50#define Foam_faPatchField_H
217 return !patchType_.empty() && patchType_ !=
type();
342 (
dynamic_cast<const faPatchFieldType&
>(ptf),
p, iF, m)
461 template<
class DerivedPatchField>
464 const DerivedPatchField& pf
469 new DerivedPatchField(pf)
474 template<
class DerivedPatchField>
477 const DerivedPatchField& pf,
483 new DerivedPatchField(pf, iF)
492 const word& patchFieldType,
493 const word& actualPatchType,
503 const word& patchFieldType,
536 template<
class AnyType>
554 return internalField_;
560 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.
readOption
Enumeration defining read preferences.
@ 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)
Mesh data needed to do the Finite Area discretisation.
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Template invariant parts for faPatchField.
virtual bool fixesValue() const
True if the patch field fixes a value.
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.
faPatchFieldBase(const faPatch &p)
Construct from patch.
virtual ~faPatchFieldBase()=default
Destructor.
const objectRegistry & db() const
The associated objectRegistry.
virtual void readDict(const dictionary &dict)
Read dictionary entries.
void setManipulated(bool state) noexcept
Set matrix manipulated state. Currently a no-op for faPatchField.
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 faPatchField.
const word & patchType() const noexcept
The optional patch type.
bool manipulatedMatrix() const noexcept
True if the matrix has already been manipulated. Currently always false for faPatchField.
virtual bool constraintOverride() const
True if the type does not correspond to the constraint type.
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.
const faPatch & patch() const noexcept
Return the patch.
void checkPatch(const faPatchFieldBase &rhs) const
Check that patches are identical.
TypeName("faPatchField")
Runtime type information.
A FieldMapper for finite-area patch fields.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
static tmp< faPatchField< Type > > New(const word &patchFieldType, const faPatch &, const DimensionedField< Type, areaMesh > &)
Return a pointer to a new patchField created on freestore given patch and internal field.
virtual tmp< faPatchField< Type > > clone() const
Clone patch field with its own internal field reference.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the evaluation of the value of this patchField...
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 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.
faPatchField(const faPatchField< Type > &pfld, const DimensionedField< Type, areaMesh > &iF)
Copy construct with internal field reference.
virtual void operator=(const faPatchField< Type > &)
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
virtual void operator=(const Type &)
virtual ~faPatchField()=default
Destructor.
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 operator-=(const Type &)
static tmp< faPatchField< Type > > New(const faPatch &, const DimensionedField< Type, areaMesh > &, const dictionary &)
Return a pointer to a new patchField created on freestore from dictionary.
Type value_type
The value_type for the patch field.
static tmp< faPatchField< Type > > Clone(const DerivedPatchField &pf)
Clone a patch field with its own internal field reference.
virtual void gradientBoundaryCoeffs(const scalarField &deltaCoeffs, UList< Type > &) const
Retrieve the matrix source coefficients corresponding to the evaluation of the gradient of this coupl...
static tmp< faPatchField< Type > > New(const faPatchField< Type > &, const faPatch &, const DimensionedField< Type, areaMesh > &, const faPatchFieldMapper &)
Return a pointer to a new patchField created on freestore from a given faPatchField mapped onto a new...
virtual void initEvaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Initialise the evaluation of the patch field.
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch.
static tmp< faPatchField< Type > > New(const word &patchFieldType, const word &actualPatchType, const faPatch &, const DimensionedField< Type, areaMesh > &)
Return a pointer to a new patchField created on freestore given patch and internal field.
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &, const Type &value)
Construct from patch, internal field and value.
virtual void rmap(const faPatchField< Type > &, const labelList &)
Reverse map the given faPatchField onto this faPatchField.
virtual void patchNeighbourField(UList< Type > &) const
Retrieve patchField on the opposite patch of a coupled patch.
faPatchField(const faPatchField< Type > &pfld)
Copy construct.
faPatch Patch
The patch type for the patch field.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual void operator*=(const Field< scalar > &)
virtual void operator==(const Field< Type > &)
virtual void operator==(const faPatchField< Type > &)
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual void operator/=(const faPatchField< scalar > &)
virtual void operator-=(const faPatchField< Type > &)
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.
const Field< Type > & primitiveField() const noexcept
Return const-reference to the internal field values.
declareRunTimeSelectionTable(tmp, faPatchField, dictionary,(const faPatch &p, const DimensionedField< Type, areaMesh > &iF, const dictionary &dict),(p, iF, dict))
virtual void operator+=(const Type &)
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 void operator-=(const Field< Type > &)
virtual void operator=(const UList< Type > &)
calculatedFaPatchField< Type > Calculated
Type for a calculated patch.
static tmp< faPatchField< Type > > NewCalculatedType(const faPatch &p)
Return a pointer to a new calculatedFaPatchField created on freestore without setting patchField valu...
pTraits< Type >::cmptType cmptType
The component type for patch field.
virtual void write(Ostream &os) const
Write.
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.
const DimensionedField< scalar, areaMesh > & internalField() const noexcept
bool operator!=(const faPatchField< Type > &) const =delete
declareRunTimeSelectionTable(tmp, faPatchField, patchMapper,(const faPatchField< Type > &ptf, const faPatch &p, const DimensionedField< Type, areaMesh > &iF, const faPatchFieldMapper &m),(dynamic_cast< const faPatchFieldType & >(ptf), p, iF, m))
declareRunTimeSelectionTable(tmp, faPatchField, patch,(const faPatch &p, const DimensionedField< Type, areaMesh > &iF),(p, iF))
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &, const Field< Type > &pfld)
Construct from patch, internal field and patch field.
virtual void gradientInternalCoeffs(const scalarField &deltaCoeffs, UList< Type > &) const
Retrieve the matrix diagonal coefficients corresponding to the evaluation of the gradient of this cou...
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &, Field< Type > &&pfld)
Construct from patch, internal field and patch field.
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 operator/=(const scalar)
faPatchField(const faPatchField< Type > &pfld, const faPatch &p, const DimensionedField< Type, areaMesh > &iF, const Type &value)
Copy construct onto a new patch with internal field reference and specified value.
virtual void operator+=(const faPatchField< Type > &)
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 Field< Type > &) const =delete
virtual void autoMap(const faPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< faPatchField< Type > > clone(const DimensionedField< Type, areaMesh > &iF) const
Clone with an 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
void check(const faPatchField< Type > &) const
Check against given patch field.
virtual void operator*=(const faPatchField< scalar > &)
DimensionedField< Type, areaMesh > Internal
The internal field type associated with the patch field.
virtual void gradientInternalCoeffs(UList< Type > &) const
Retrieve the matrix diagonal coefficients corresponding to the evaluation of the gradient of this pat...
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
faPatchField(const faPatchField< Type > &, const faPatch &, const DimensionedField< Type, areaMesh > &, const faPatchFieldMapper &)
Construct by mapping the given faPatchField onto a new patch.
void extrapolateInternal()
Assign the patch field from the internal field.
static tmp< faPatchField< Type > > NewCalculatedType(const faPatchField< AnyType > &pf)
Return a pointer to a new calculatedFaPatchField created on freestore without setting patchField valu...
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &, const dictionary &dict, IOobjectOption::readOption requireValue=IOobjectOption::LAZY_READ)
Construct from patch, internal field and dictionary.
static tmp< faPatchField< Type > > Clone(const DerivedPatchField &pf, const DimensionedField< Type, areaMesh > &iF)
Clone a patch field with an internal field reference.
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 operator==(const Type &)
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this patchFi...
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Registry of regIOobjects.
A traits class, which is primarily used for primitives and vector-space.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
OBJstream os(runTime.globalPath()/outputName)
Macros for creating faPatchField 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).
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.