codedMixedFvPatchField< Type > Class Template Reference

Constructs on-the-fly a new boundary condition (derived from mixedFvPatchField) which is then used to evaluate. More...

Inheritance diagram for codedMixedFvPatchField< Type >:
[legend]
Collaboration diagram for codedMixedFvPatchField< Type >:
[legend]

Public Member Functions

 TypeName ("codedMixed")
 Runtime type information. More...
 
 codedMixedFvPatchField (const fvPatch &, const DimensionedField< Type, volMesh > &)
 Construct from patch and internal field. More...
 
 codedMixedFvPatchField (const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &)
 Construct from patch, internal field and dictionary. More...
 
 codedMixedFvPatchField (const codedMixedFvPatchField< Type > &, const fvPatch &, const DimensionedField< Type, volMesh > &, const fvPatchFieldMapper &)
 Construct by mapping given codedMixedFvPatchField. More...
 
 codedMixedFvPatchField (const codedMixedFvPatchField< Type > &)
 Construct as copy. More...
 
virtual tmp< fvPatchField< Type > > clone () const
 Construct and return a clone. More...
 
 codedMixedFvPatchField (const codedMixedFvPatchField< Type > &, const DimensionedField< Type, volMesh > &)
 Construct as copy setting internal field reference. More...
 
virtual tmp< fvPatchField< Type > > clone (const DimensionedField< Type, volMesh > &iF) const
 Construct and return a clone setting internal field reference. More...
 
const mixedFvPatchField< Type > & redirectPatchField () const
 Get reference to the underlying patchField. More...
 
virtual void updateCoeffs ()
 Update the coefficients associated with the patch field. More...
 
virtual void evaluate (const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
 Evaluate the patch field. More...
 
virtual void write (Ostream &) const
 Write. More...
 
- Public Member Functions inherited from mixedFvPatchField< Type >
 TypeName ("mixed")
 Runtime type information. More...
 
 mixedFvPatchField (const fvPatch &, const DimensionedField< Type, volMesh > &)
 Construct from patch and internal field. More...
 
 mixedFvPatchField (const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &)
 Construct from patch, internal field and dictionary. More...
 
 mixedFvPatchField (const mixedFvPatchField< Type > &, const fvPatch &, const DimensionedField< Type, volMesh > &, const fvPatchFieldMapper &)
 Construct by mapping the given mixedFvPatchField onto a new patch. More...
 
 mixedFvPatchField (const mixedFvPatchField< Type > &)
 Construct as copy. More...
 
 mixedFvPatchField (const mixedFvPatchField< Type > &, const DimensionedField< Type, volMesh > &)
 Construct as copy setting internal field reference. More...
 
virtual bool fixesValue () const
 Return true if this patch field fixes a value. More...
 
virtual bool assignable () const
 Return false: this patch field is not altered by assignment. More...
 
virtual Field< Type > & refValue ()
 
virtual const Field< Type > & refValue () const
 
virtual Field< Type > & refGrad ()
 
virtual const Field< Type > & refGrad () const
 
virtual scalarFieldvalueFraction ()
 
virtual const scalarFieldvalueFraction () const
 
virtual Field< Type > & source ()
 
virtual const Field< Type > & source () const
 
virtual void autoMap (const fvPatchFieldMapper &)
 Map (and resize as needed) from self given a mapping object. More...
 
virtual void rmap (const fvPatchField< Type > &, const labelList &)
 Reverse map the given fvPatchField onto this fvPatchField. More...
 
virtual tmp< Field< Type > > snGrad () const
 Return gradient at boundary. More...
 
virtual tmp< Field< Type > > valueInternalCoeffs (const tmp< scalarField > &) const
 Return the matrix diagonal coefficients corresponding to the. More...
 
virtual tmp< Field< Type > > valueBoundaryCoeffs (const tmp< scalarField > &) const
 Return the matrix source coefficients corresponding to the. More...
 
virtual tmp< Field< Type > > gradientInternalCoeffs () const
 Return the matrix diagonal coefficients corresponding to the. More...
 
virtual tmp< Field< Type > > gradientBoundaryCoeffs () const
 Return the matrix source coefficients corresponding to the. More...
 
virtual void operator= (const UList< Type > &)
 
virtual void operator= (const fvPatchField< Type > &)
 
virtual void operator+= (const fvPatchField< Type > &)
 
virtual void operator-= (const fvPatchField< Type > &)
 
virtual void operator*= (const fvPatchField< scalar > &)
 
virtual void operator/= (const fvPatchField< scalar > &)
 
virtual void operator+= (const Field< Type > &)
 
virtual void operator-= (const Field< Type > &)
 
virtual void operator*= (const Field< scalar > &)
 
virtual void operator/= (const Field< scalar > &)
 
virtual void operator= (const Type &)
 
virtual void operator+= (const Type &)
 
virtual void operator-= (const Type &)
 
virtual void operator*= (const scalar)
 
virtual void operator/= (const scalar)
 
- Public Member Functions inherited from fvPatchField< Type >
 TypeName ("fvPatchField")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (tmp, fvPatchField, patch,(const fvPatch &p, const DimensionedField< Type, volMesh > &iF),(p, iF))
 
 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))
 
 declareRunTimeSelectionTable (tmp, fvPatchField, dictionary,(const fvPatch &p, const DimensionedField< Type, volMesh > &iF, const dictionary &dict),(p, iF, dict))
 
 fvPatchField (const fvPatch &, const DimensionedField< Type, volMesh > &)
 Construct from patch and internal field. More...
 
 fvPatchField (const fvPatch &, const DimensionedField< Type, volMesh > &, const Type &value)
 Construct from patch, internal field and value. More...
 
 fvPatchField (const fvPatch &, const DimensionedField< Type, volMesh > &, const word &patchType)
 Construct from patch and internal field and patch type. More...
 
 fvPatchField (const fvPatch &, const DimensionedField< Type, volMesh > &, const Field< Type > &)
 Construct from patch and internal field and patch field. More...
 
 fvPatchField (const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &, const bool valueRequired=true)
 Construct from patch, internal field and dictionary. More...
 
 fvPatchField (const fvPatchField< Type > &, const fvPatch &, const DimensionedField< Type, volMesh > &, const fvPatchFieldMapper &)
 Construct by mapping the given fvPatchField onto a new patch. More...
 
 fvPatchField (const fvPatchField< Type > &)
 Construct as copy. More...
 
 fvPatchField (const fvPatchField< Type > &, const DimensionedField< Type, volMesh > &)
 Construct as copy setting internal field reference. More...
 
virtual ~fvPatchField ()=default
 Destructor. More...
 
bool useImplicit () const noexcept
 Use implicit formulation for coupled patches only. More...
 
bool useImplicit (bool on) noexcept
 Set useImplicit on/off. More...
 
virtual bool coupled () const
 Return true if this patch field is coupled. More...
 
const objectRegistrydb () const
 Return local objectRegistry. More...
 
const fvPatchpatch () const
 Return patch. More...
 
const DimensionedField< Type, volMesh > & internalField () const
 Return dimensioned internal field reference. More...
 
const Field< Type > & primitiveField () const
 Return internal field reference. More...
 
const wordpatchType () const
 Optional patch type. More...
 
wordpatchType ()
 Optional patch type. More...
 
bool updated () const
 Return true if the boundary condition has already been updated. More...
 
bool manipulatedMatrix () const
 Return true if the matrix has already been manipulated. More...
 
virtual tmp< Field< Type > > snGrad (const scalarField &deltaCoeffs) const
 Return patch-normal gradient for coupled-patches. More...
 
virtual void updateWeightedCoeffs (const scalarField &weights)
 Update the coefficients associated with the patch field. More...
 
virtual tmp< Field< Type > > patchInternalField () const
 Return internal field next to patch as patch field. More...
 
virtual void patchInternalField (Field< Type > &) const
 Return internal field next to patch as patch field. More...
 
virtual tmp< Field< Type > > patchNeighbourField () const
 Return patchField on the opposite patch of a coupled patch. More...
 
virtual void initEvaluate (const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
 Initialise the evaluation of the patch field. More...
 
virtual tmp< Field< Type > > valueInternalCoeffs (const tmp< Field< scalar >> &) const
 Return the matrix diagonal coefficients corresponding to the. More...
 
virtual tmp< Field< Type > > valueBoundaryCoeffs (const tmp< Field< scalar >> &) const
 Return the matrix source coefficients corresponding to the. More...
 
virtual tmp< Field< Type > > gradientInternalCoeffs (const scalarField &deltaCoeffs) const
 Return the matrix diagonal coefficients corresponding to the. More...
 
virtual tmp< Field< Type > > gradientBoundaryCoeffs (const scalarField &deltaCoeffs) const
 Return the matrix source coefficients corresponding to the. More...
 
virtual void manipulateMatrix (fvMatrix< Type > &matrix)
 Manipulate matrix. More...
 
virtual void manipulateMatrix (fvMatrix< Type > &matrix, const scalarField &weights)
 Manipulate matrix with given weights. More...
 
virtual void manipulateMatrix (fvMatrix< Type > &matrix, const label iMatrix, const direction cmp)
 Manipulate fvMatrix. More...
 
void check (const fvPatchField< Type > &) const
 Check fvPatchField<Type> against given fvPatchField<Type> More...
 
virtual void operator== (const fvPatchField< Type > &)
 
virtual void operator== (const Field< Type > &)
 
virtual void operator== (const Type &)
 
template<class Type2 >
Foam::tmp< Foam::fvPatchField< Type > > NewCalculatedType (const fvPatchField< Type2 > &pf)
 
- Public Member Functions inherited from codedBase
 ClassName ("codedBase")
 Runtime type information. More...
 
 codedBase ()=default
 Default construct. More...
 
virtual ~codedBase ()=default
 Destructor. More...
 

Static Public Attributes

static constexpr const char *const codeTemplateC = "mixedFvPatchFieldTemplate.C"
 Name of the C code template to be used. More...
 
static constexpr const char *const codeTemplateH = "mixedFvPatchFieldTemplate.H"
 Name of the H code template to be used. More...
 
- Static Public Attributes inherited from fvPatchField< Type >
static int disallowGenericFvPatchField
 Debug switch to disallow the use of genericFvPatchField. More...
 

Protected Member Functions

virtual dlLibraryTablelibs () const
 Mutable access to the loaded dynamic libraries. More...
 
virtual string description () const
 Description (type + name) for the output. More...
 
virtual void clearRedirect () const
 Clear redirected object(s) More...
 
virtual const dictionarycodeContext () const
 Additional 'codeContext' dictionary to pass through. More...
 
virtual const dictionarycodeDict () const
 The code dictionary. Inline "code" or from system/codeDict. More...
 
virtual void prepare (dynamicCode &, const dynamicCodeContext &) const
 Adapt the context for the current object. More...
 
- Protected Member Functions inherited from codedBase
dynamicCodeContextcodeContext ()
 Access to the dynamic code context. More...
 
void setCodeContext (const dictionary &dict)
 Set code context from a dictionary. More...
 
void append (const std::string &str)
 Add content to SHA1 hashing. More...
 
void updateLibrary (const word &name, const dynamicCodeContext &context) const
 Update library as required, using the given context. More...
 
void updateLibrary (const word &name, const dictionary &dict) const
 
void updateLibrary (const word &name) const
 
 codedBase (const codedBase &)=delete
 No copy construct. More...
 
void operator= (const codedBase &)=delete
 No copy assignment. More...
 

Additional Inherited Members

- Public Types inherited from fvPatchField< Type >
typedef fvPatch Patch
 
typedef calculatedFvPatchField< Type > Calculated
 
- Static Public Member Functions inherited from fvPatchField< Type >
static tmp< fvPatchField< Type > > New (const word &, const fvPatch &, const DimensionedField< Type, volMesh > &)
 Return a pointer to a new patchField created on freestore given. More...
 
static tmp< fvPatchField< Type > > New (const word &, const word &actualPatchType, const fvPatch &, const DimensionedField< Type, volMesh > &)
 Return a pointer to a new patchField created on freestore given. More...
 
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. More...
 
static tmp< fvPatchField< Type > > New (const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &)
 Return a pointer to a new patchField created on freestore. More...
 
static tmp< fvPatchField< Type > > NewCalculatedType (const fvPatch &)
 Return a pointer to a new calculatedFvPatchField created on. More...
 
template<class Type2 >
static tmp< fvPatchField< Type > > NewCalculatedType (const fvPatchField< Type2 > &)
 Return a pointer to a new calculatedFvPatchField created on. More...
 
static const wordcalculatedType ()
 Return the type of the calculated for of fvPatchField. More...
 
- Static Protected Member Functions inherited from codedBase
static void writeCodeDict (Ostream &os, const dictionary &dict)
 Write code-dictionary contents. More...
 
static const dictionarycodeDict (const objectRegistry &obr, const word &dictName="codeDict")
 Return "codeDict" from objectRegistry or read from disk. More...
 

Detailed Description

template<class Type>
class Foam::codedMixedFvPatchField< Type >

Constructs on-the-fly a new boundary condition (derived from mixedFvPatchField) which is then used to evaluate.

The code entries:

codeInclude : include files
codeOptions : compiler line: added to EXE_INC (Make/options)
codeLibs : linker line: added to LIB_LIBS (Make/options)
localCode : c++; local static functions;
code : c++; patch value assignment
codeContext : additional dictionary context for the code
Usage
Example:
<patchName>
{
    type            codedMixed;

    refValue        uniform (0 0 0);
    refGradient     uniform (0 0 0);
    valueFraction   uniform 1;

    name    rampedMixed;   // name of generated BC

    code
    #{
        this->refValue() =
            vector(1, 0, 0)
           *min(10, 0.1*this->db().time().value());
        this->refGrad() = Zero;
        this->valueFraction() = 1.0;
    #};

    //codeInclude
    //#{
    //    #include "fvCFD.H"
    //#};

    //codeOptions
    //#{
    //    -I$(LIB_SRC)/finiteVolume/lnInclude
    //#};
}

A special form is if the 'code' section is not supplied. In this case the code gets read from a (runTimeModifiable!) dictionary system/codeDict which would have a corresponding entry

<patchName>
{
    code
    #{
        this->refValue() = min(10, 0.1*this->db().time().value());
        this->refGrad() = Zero;
        this->valueFraction() = 1.0;
    #};
}
Note
The code context dictionary can be supplied separately as the codeContext entry.
See also
Foam::dynamicCode Foam::functionEntries::codeStream
Source files

Definition at line 149 of file codedMixedFvPatchField.H.

Constructor & Destructor Documentation

◆ codedMixedFvPatchField() [1/5]

codedMixedFvPatchField ( const fvPatch p,
const DimensionedField< Type, volMesh > &  iF 
)

Construct from patch and internal field.

Definition at line 131 of file codedMixedFvPatchField.C.

◆ codedMixedFvPatchField() [2/5]

codedMixedFvPatchField ( const fvPatch p,
const DimensionedField< Type, volMesh > &  iF,
const dictionary dict 
)

Construct from patch, internal field and dictionary.

Definition at line 161 of file codedMixedFvPatchField.C.

◆ codedMixedFvPatchField() [3/5]

codedMixedFvPatchField ( const codedMixedFvPatchField< Type > &  rhs,
const fvPatch p,
const DimensionedField< Type, volMesh > &  iF,
const fvPatchFieldMapper mapper 
)

Construct by mapping given codedMixedFvPatchField.

onto a new patch

Definition at line 144 of file codedMixedFvPatchField.C.

◆ codedMixedFvPatchField() [4/5]

Construct as copy.

Definition at line 192 of file codedMixedFvPatchField.C.

◆ codedMixedFvPatchField() [5/5]

codedMixedFvPatchField ( const codedMixedFvPatchField< Type > &  rhs,
const DimensionedField< Type, volMesh > &  iF 
)

Construct as copy setting internal field reference.

Definition at line 206 of file codedMixedFvPatchField.C.

Member Function Documentation

◆ libs()

Foam::dlLibraryTable & libs ( ) const
protectedvirtual

Mutable access to the loaded dynamic libraries.

Implements codedBase.

Definition at line 39 of file codedMixedFvPatchField.C.

References dlLibraryTable::libs().

Here is the call graph for this function:

◆ description()

Foam::string description ( ) const
protectedvirtual

Description (type + name) for the output.

Implements codedBase.

Definition at line 46 of file codedMixedFvPatchField.C.

References Foam::foamVersion::patch.

◆ clearRedirect()

void clearRedirect ( ) const
protectedvirtual

Clear redirected object(s)

Implements codedBase.

Definition at line 57 of file codedMixedFvPatchField.C.

◆ codeContext()

const Foam::dictionary & codeContext ( ) const
protectedvirtual

Additional 'codeContext' dictionary to pass through.

Definition at line 65 of file codedMixedFvPatchField.C.

References dictionary::findDict().

Here is the call graph for this function:

◆ codeDict()

const Foam::dictionary & codeDict ( ) const
protectedvirtual

The code dictionary. Inline "code" or from system/codeDict.

Implements codedBase.

Definition at line 74 of file codedMixedFvPatchField.C.

◆ prepare()

void prepare ( dynamicCode dynCode,
const dynamicCodeContext context 
) const
protectedvirtual

Adapt the context for the current object.

Implements codedBase.

Definition at line 88 of file codedMixedFvPatchField.C.

References dynamicCode::addCompileFile(), dynamicCode::addCopyFile(), DetailInfo, Foam::endl(), dynamicCodeContext::libs(), dynamicCodeContext::options(), dynamicCode::setFieldTemplates(), dynamicCode::setFilterVariable(), dynamicCode::setMakeOptions(), and dynamicCodeContext::sha1().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "codedMixed"  )

Runtime type information.

◆ clone() [1/2]

virtual tmp<fvPatchField<Type> > clone ( ) const
inlinevirtual

Construct and return a clone.

Reimplemented from mixedFvPatchField< Type >.

Definition at line 242 of file codedMixedFvPatchField.H.

◆ clone() [2/2]

virtual tmp<fvPatchField<Type> > clone ( const DimensionedField< Type, volMesh > &  iF) const
inlinevirtual

Construct and return a clone setting internal field reference.

Reimplemented from mixedFvPatchField< Type >.

Definition at line 259 of file codedMixedFvPatchField.H.

◆ redirectPatchField()

const Foam::mixedFvPatchField< Type > & redirectPatchField ( ) const

Get reference to the underlying patchField.

Definition at line 223 of file codedMixedFvPatchField.C.

References dictionaryContent::dict(), Foam::nl, os(), Foam::foamVersion::patch, WarningInFunction, and Foam::vtk::write().

Here is the call graph for this function:

◆ updateCoeffs()

void updateCoeffs ( )
virtual

Update the coefficients associated with the patch field.

Reimplemented from fvPatchField< Type >.

Definition at line 273 of file codedMixedFvPatchField.C.

References mixedFvPatchField< Type >::refGrad(), mixedFvPatchField< Type >::refValue(), and mixedFvPatchField< Type >::valueFraction().

Here is the call graph for this function:

◆ evaluate()

void evaluate ( const Pstream::commsTypes  commsType = Pstream::commsTypes::blocking)
virtual

Evaluate the patch field.

This is only needed to set the updated() flag of the name to false.

Reimplemented from mixedFvPatchField< Type >.

Definition at line 297 of file codedMixedFvPatchField.C.

References Foam::stringOps::evaluate().

Here is the call graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write.

Reimplemented from mixedFvPatchField< Type >.

Definition at line 316 of file codedMixedFvPatchField.C.

References os(), and Foam::vtk::write().

Here is the call graph for this function:

Member Data Documentation

◆ codeTemplateC

constexpr const char* const codeTemplateC = "mixedFvPatchFieldTemplate.C"
staticconstexpr

Name of the C code template to be used.

Definition at line 197 of file codedMixedFvPatchField.H.

◆ codeTemplateH

constexpr const char* const codeTemplateH = "mixedFvPatchFieldTemplate.H"
staticconstexpr

Name of the H code template to be used.

Definition at line 201 of file codedMixedFvPatchField.H.


The documentation for this class was generated from the following files: