mappedPatchFieldBase< Type > Class Template Reference

Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sampled field, optionally scaled to maintain an area-weighted average. More...

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

Public Member Functions

 mappedPatchFieldBase (const mappedPatchBase &mapper, const fvPatchField< Type > &patchField, const word &fieldName, const bool setAverage, const Type average, const word &interpolationScheme)
 Construct from components. More...
 
 mappedPatchFieldBase (const mappedPatchBase &mapper, const fvPatchField< Type > &patchField, const dictionary &dict)
 Construct from dictionary. More...
 
 mappedPatchFieldBase (const mappedPatchBase &mapper, const fvPatchField< Type > &patchField, const dictionary &dict, const Field< Type > &fld)
 Construct from dictionary and initial field value. More...
 
 mappedPatchFieldBase (const mappedPatchBase &mapper, const fvPatchField< Type > &patchField)
 Construct empty. More...
 
 mappedPatchFieldBase (const mappedPatchFieldBase< Type > &mapper)
 Construct copy. More...
 
 mappedPatchFieldBase (const mappedPatchBase &mapper, const fvPatchField< Type > &patchField, const mappedPatchFieldBase< Type > &base)
 Construct copy, resetting patch and field. More...
 
virtual ~mappedPatchFieldBase ()=default
 Destructor. More...
 
template<class T >
const GeometricField< T, fvPatchField, volMesh > & sampleField (const word &fieldName) const
 Field to sample. Either on my or nbr mesh. More...
 
const GeometricField< Type, fvPatchField, volMesh > & sampleField () const
 Field to sample. Either on my or nbr mesh. More...
 
virtual tmp< Field< Type > > mappedField () const
 Map sampleField onto *this patch. More...
 
virtual tmp< Field< Type > > mappedInternalField () const
 Map internal of sampleField onto *this patch. More...
 
virtual tmp< scalarFieldmappedWeightField () const
 Map optional weightField onto *this patch. Default is deltaCoeffs. More...
 
virtual void mappedWeightField (const word &weightFieldName, tmp< scalarField > &thisWeights, tmp< scalarField > &nbrWeights) const
 Map optional weightField (given by name) onto *this patch. More...
 
virtual void write (Ostream &os) const
 Write. More...
 
template<class T >
void initRetrieveField (const word &fieldName, const Field< T > &fld) const
 Initialise field to retrieve (used e.g. when value read from. More...
 
template<class T >
void storeField (const objectRegistry &obr, const word &region, const word &patch, const labelListList &procToMap, const word &fieldName, const Field< T > &fld) const
 Store elements of field onto (sub) registry. More...
 
template<class T >
void retrieveField (const bool allowUnset, const objectRegistry &obr, const word &region, const word &patch, const labelListList &procToMap, const word &fieldName, Field< T > &fld) const
 Construct field from registered elements. More...
 
template<class T >
void distribute (const word &fieldName, Field< T > &newValues) const
 
template<class Type2 >
const Foam::GeometricField< Type2, Foam::fvPatchField, Foam::volMesh > & sampleField (const word &fieldName) const
 

Static Public Member Functions

static const mappedPatchBasemapper (const fvPatch &p, const DimensionedField< Type, volMesh > &iF)
 Check that patch is of correct type. More...
 

Protected Member Functions

template<class T >
void initRetrieveField (const objectRegistry &obr, const word &region, const word &patch, const mapDistribute &map, const word &fieldName, const Field< T > &fld) const
 Construct field from registered elements. More...
 

Protected Attributes

const mappedPatchBasemapper_
 Mapping engine. More...
 
const fvPatchField< Type > & patchField_
 Underlying patch field. More...
 
word fieldName_
 Name of field to sample. More...
 
const bool setAverage_
 If true adjust the mapped field to maintain average value average_. More...
 
const Type average_
 
word interpolationScheme_
 Interpolation scheme to use for nearestcell mode. More...
 

Detailed Description

template<class Type>
class Foam::mappedPatchFieldBase< Type >

Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sampled field, optionally scaled to maintain an area-weighted average.

Example usage:

{
    field               T;          // default is same as fvPatchField
    setAverage          false;
    average             1.0;        // only if setAverage=true
    interpolationScheme cellPoint;  // default is cell
}
Property Description Required Default
field name of field to be mapped no this field name
setAverage use average value no false
average average value to apply if setAverage = yes partly
interpolationScheme interpolation scheme partly cell
Source files

Definition at line 104 of file mappedPatchFieldBase.H.

Constructor & Destructor Documentation

◆ mappedPatchFieldBase() [1/6]

mappedPatchFieldBase ( const mappedPatchBase mapper,
const fvPatchField< Type > &  patchField,
const word fieldName,
const bool  setAverage,
const Type  average,
const word interpolationScheme 
)

Construct from components.

Definition at line 223 of file mappedPatchFieldBase.C.

◆ mappedPatchFieldBase() [2/6]

mappedPatchFieldBase ( const mappedPatchBase mapper,
const fvPatchField< Type > &  patchField,
const dictionary dict 
)

Construct from dictionary.

Definition at line 243 of file mappedPatchFieldBase.C.

◆ mappedPatchFieldBase() [3/6]

mappedPatchFieldBase ( const mappedPatchBase mapper,
const fvPatchField< Type > &  patchField,
const dictionary dict,
const Field< Type > &  fld 
)

Construct from dictionary and initial field value.

(for when running in database mode)

Definition at line 291 of file mappedPatchFieldBase.C.

◆ mappedPatchFieldBase() [4/6]

mappedPatchFieldBase ( const mappedPatchBase mapper,
const fvPatchField< Type > &  patchField 
)

Construct empty.

Definition at line 322 of file mappedPatchFieldBase.C.

◆ mappedPatchFieldBase() [5/6]

mappedPatchFieldBase ( const mappedPatchFieldBase< Type > &  mapper)
explicit

Construct copy.

Definition at line 338 of file mappedPatchFieldBase.C.

◆ mappedPatchFieldBase() [6/6]

mappedPatchFieldBase ( const mappedPatchBase mapper,
const fvPatchField< Type > &  patchField,
const mappedPatchFieldBase< Type > &  base 
)

Construct copy, resetting patch and field.

Definition at line 353 of file mappedPatchFieldBase.C.

◆ ~mappedPatchFieldBase()

virtual ~mappedPatchFieldBase ( )
virtualdefault

Destructor.

Member Function Documentation

◆ initRetrieveField() [1/2]

void initRetrieveField ( const objectRegistry obr,
const word region,
const word patch,
const mapDistribute map,
const word fieldName,
const Field< T > &  fld 
) const
protected

Construct field from registered elements.

Definition at line 170 of file mappedPatchFieldBase.C.

Referenced by turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField().

Here is the caller graph for this function:

◆ sampleField() [1/3]

const GeometricField<T, fvPatchField, volMesh>& sampleField ( const word fieldName) const

Field to sample. Either on my or nbr mesh.

◆ sampleField() [2/3]

const Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > & sampleField ( ) const

Field to sample. Either on my or nbr mesh.

Definition at line 402 of file mappedPatchFieldBase.C.

◆ mappedField()

Foam::tmp< Foam::Field< Type > > mappedField ( ) const
virtual

Map sampleField onto *this patch.

Definition at line 452 of file mappedPatchFieldBase.C.

◆ mappedInternalField()

Foam::tmp< Foam::Field< Type > > mappedInternalField ( ) const
virtual

Map internal of sampleField onto *this patch.

Definition at line 661 of file mappedPatchFieldBase.C.

◆ mappedWeightField() [1/2]

Foam::tmp< Foam::scalarField > mappedWeightField ( ) const
virtual

Map optional weightField onto *this patch. Default is deltaCoeffs.

Definition at line 697 of file mappedPatchFieldBase.C.

◆ mappedWeightField() [2/2]

void mappedWeightField ( const word weightFieldName,
tmp< scalarField > &  thisWeights,
tmp< scalarField > &  nbrWeights 
) const
virtual

Map optional weightField (given by name) onto *this patch.

Definition at line 735 of file mappedPatchFieldBase.C.

◆ write()

void write ( Ostream os) const
virtual

◆ mapper()

const Foam::mappedPatchBase & mapper ( const fvPatch p,
const DimensionedField< Type, volMesh > &  iF 
)
static

Check that patch is of correct type.

Definition at line 797 of file mappedPatchFieldBase.C.

Referenced by turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs().

Here is the caller graph for this function:

◆ initRetrieveField() [2/2]

void initRetrieveField ( const word fieldName,
const Field< T > &  fld 
) const

Initialise field to retrieve (used e.g. when value read from.

dictionary)

Definition at line 819 of file mappedPatchFieldBase.C.

◆ storeField()

void storeField ( const objectRegistry obr,
const word region,
const word patch,
const labelListList procToMap,
const word fieldName,
const Field< T > &  fld 
) const

Store elements of field onto (sub) registry.

Definition at line 54 of file mappedPatchFieldBase.C.

◆ retrieveField()

void retrieveField ( const bool  allowUnset,
const objectRegistry obr,
const word region,
const word patch,
const labelListList procToMap,
const word fieldName,
Field< T > &  fld 
) const

Construct field from registered elements.

Definition at line 104 of file mappedPatchFieldBase.C.

◆ distribute()

void distribute ( const word fieldName,
Field< T > &  newValues 
) const

Wrapper for mapDistribute::distribute that knows about dabase mapping

Definition at line 411 of file mappedPatchFieldBase.C.

◆ sampleField() [3/3]

const Foam::GeometricField<Type2, Foam::fvPatchField, Foam::volMesh>& sampleField ( const word fieldName) const

Definition at line 373 of file mappedPatchFieldBase.C.

Member Data Documentation

◆ mapper_

const mappedPatchBase& mapper_
protected

Mapping engine.

Definition at line 117 of file mappedPatchFieldBase.H.

◆ patchField_

const fvPatchField<Type>& patchField_
protected

Underlying patch field.

Definition at line 120 of file mappedPatchFieldBase.H.

◆ fieldName_

word fieldName_
protected

Name of field to sample.

Definition at line 123 of file mappedPatchFieldBase.H.

◆ setAverage_

const bool setAverage_
protected

If true adjust the mapped field to maintain average value average_.

Definition at line 126 of file mappedPatchFieldBase.H.

◆ average_

const Type average_
protected

Average value the mapped field is adjusted to maintain if setAverage_ is set true

Definition at line 130 of file mappedPatchFieldBase.H.

◆ interpolationScheme_

word interpolationScheme_
protected

Interpolation scheme to use for nearestcell mode.

Definition at line 133 of file mappedPatchFieldBase.H.


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