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


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. | |
| mappedPatchFieldBase (const mappedPatchBase &mapper, const fvPatchField< Type > &patchField, const dictionary &dict) | |
| Construct from dictionary. | |
| mappedPatchFieldBase (const mappedPatchBase &mapper, const fvPatchField< Type > &patchField, const dictionary &dict, const Field< Type > &fld) | |
| Construct from dictionary and initial field value. | |
| mappedPatchFieldBase (const mappedPatchBase &mapper, const fvPatchField< Type > &patchField) | |
| Construct empty. | |
| mappedPatchFieldBase (const mappedPatchFieldBase< Type > &mapper) | |
| Construct copy. | |
| mappedPatchFieldBase (const mappedPatchBase &mapper, const fvPatchField< Type > &patchField, const mappedPatchFieldBase< Type > &base) | |
| Construct copy, resetting patch and field. | |
| virtual | ~mappedPatchFieldBase ()=default |
| Destructor. | |
| template<class T> | |
| const GeometricField< T, fvPatchField, volMesh > & | sampleField (const word &fieldName) const |
| Field to sample. Either on my or nbr mesh. | |
| const GeometricField< Type, fvPatchField, volMesh > & | sampleField () const |
| Field to sample. Either on my or nbr mesh. | |
| virtual tmp< Field< Type > > | mappedField () const |
| Map sampleField onto *this patch. | |
| virtual tmp< Field< Type > > | mappedInternalField () const |
| Map internal of sampleField onto *this patch. | |
| virtual tmp< scalarField > | mappedWeightField () const |
| Map optional weightField onto *this patch. Default is deltaCoeffs. | |
| virtual void | mappedWeightField (const word &weightFieldName, tmp< scalarField > &thisWeights, tmp< scalarField > &nbrWeights) const |
| Map optional weightField (given by name) onto *this patch. | |
| virtual void | write (Ostream &os) const |
| Write. | |
| template<class T> | |
| void | distribute (const word &fieldName, Field< T > &newValues) const |
| Wrapper for mapDistribute::distribute that knows about dabase mapping. | |
| template<class Type2> | |
| const Foam::GeometricField< Type2, Foam::fvPatchField, Foam::volMesh > & | sampleField (const word &fieldName) const |
Static Public Member Functions | |
| static const mappedPatchBase & | mapper (const fvPatch &p, const DimensionedField< Type, volMesh > &iF) |
| Check that patch is of correct type. | |
Protected Member Functions | |
| template<class T> | |
| void | initRetrieveField (const objectRegistry &obr, const word ®ion, const word &patch, const labelListList &map, const word &fieldName, const Field< T > &fld) const |
| Construct field from registered elements. | |
| template<class T> | |
| bool | storeAndRetrieveField (const word &fieldName, const label myComm, const labelListList &subMap, const label constructSize, const labelListList &constructMap, const labelListList &address, const scalarListList &weights, Field< T > &fld) const |
| Helper : storeField and retrieveField and interpolate. Leaves fld. | |
| template<class T> | |
| void | initRetrieveField (const word &fieldName, const Field< T > &fld) const |
| Initialise field to retrieve (e.g. when value read from dictionary). | |
| template<class T> | |
| void | storeField (const objectRegistry &obr, const word ®ion, const word &patch, const label myComm, const labelListList &procToMap, const word &fieldName, const Field< T > &fld) const |
| Store elements of field onto (sub) registry. | |
| template<class T> | |
| bool | retrieveField (const bool allowUnset, const objectRegistry &obr, const word ®ion, const word &patch, const label myComm, const labelListList &procToMap, const word &fieldName, Field< T > &fld) const |
| Construct field from registered elements. | |
Protected Attributes | |
| const mappedPatchBase & | mapper_ |
| Mapping engine. | |
| const fvPatchField< Type > & | patchField_ |
| Underlying patch field. | |
| word | fieldName_ |
| Name of field to sample. | |
| const bool | setAverage_ |
| If true adjust the mapped field to maintain average value average_. | |
| const Type | average_ |
| Average value the mapped field is adjusted to maintain if setAverage_ is set true. | |
| word | interpolationScheme_ |
| Interpolation scheme to use for nearestcell mode. | |
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 |
Definition at line 101 of file mappedPatchFieldBase.H.
| 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 313 of file mappedPatchFieldBase.C.
References Foam::average(), and mapper().
Referenced by mappedFieldFvPatchField< Type >::mappedFieldFvPatchField(), mappedFieldFvPatchField< Type >::mappedFieldFvPatchField(), mappedFieldFvPatchField< Type >::mappedFieldFvPatchField(), mappedFieldFvPatchField< Type >::mappedFieldFvPatchField(), mappedFieldFvPatchField< Type >::mappedFieldFvPatchField(), mappedFieldFvPatchField< Type >::mappedFieldFvPatchField(), mappedFixedValueFvPatchField< Type >::mappedFixedValueFvPatchField(), mappedFixedValueFvPatchField< Type >::mappedFixedValueFvPatchField(), mappedFixedValueFvPatchField< Type >::mappedFixedValueFvPatchField(), mappedFixedValueFvPatchField< Type >::mappedFixedValueFvPatchField(), mappedFixedValueFvPatchField< Type >::mappedFixedValueFvPatchField(), mappedMixedFieldFvPatchField< Type >::mappedMixedFieldFvPatchField(), mappedMixedFieldFvPatchField< Type >::mappedMixedFieldFvPatchField(), mappedMixedFieldFvPatchField< Type >::mappedMixedFieldFvPatchField(), mappedMixedFieldFvPatchField< Type >::mappedMixedFieldFvPatchField(), mappedMixedFieldFvPatchField< Type >::mappedMixedFieldFvPatchField(), mappedMixedFvPatchField< Type >::mappedMixedFvPatchField(), mappedMixedFvPatchField< Type >::mappedMixedFvPatchField(), mappedMixedFvPatchField< Type >::mappedMixedFvPatchField(), mappedMixedFvPatchField< Type >::mappedMixedFvPatchField(), mappedMixedFvPatchField< Type >::mappedMixedFvPatchField(), mappedPatchFieldBase(), mappedPatchFieldBase(), and mappedPatchFieldBase().


| mappedPatchFieldBase | ( | const mappedPatchBase & | mapper, |
| const fvPatchField< Type > & | patchField, | ||
| const dictionary & | dict ) |
Construct from dictionary.
Definition at line 333 of file mappedPatchFieldBase.C.
References dict, fieldName_, mapper(), mapper_, and patchField_.

| 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 389 of file mappedPatchFieldBase.C.
References dict, fld(), if(), mappedPatchFieldBase(), mapper(), mapper_, and mappedPatchBase::NEARESTPATCHFACEAMI.

| mappedPatchFieldBase | ( | const mappedPatchBase & | mapper, |
| const fvPatchField< Type > & | patchField ) |
Construct empty.
Definition at line 427 of file mappedPatchFieldBase.C.
References average_, fieldName_, Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, interpolationScheme_, mapper(), mapper_, Foam::name(), patchField_, setAverage_, and Foam::Zero.

|
explicit |
Construct copy.
Definition at line 443 of file mappedPatchFieldBase.C.
References average_, fieldName_, interpolationScheme_, mappedPatchFieldBase(), mapper(), mapper_, patchField_, and setAverage_.

| mappedPatchFieldBase | ( | const mappedPatchBase & | mapper, |
| const fvPatchField< Type > & | patchField, | ||
| const mappedPatchFieldBase< Type > & | base ) |
Construct copy, resetting patch and field.
Definition at line 458 of file mappedPatchFieldBase.C.
References average_, fieldName_, interpolationScheme_, mappedPatchFieldBase(), mapper(), mapper_, patchField_, and setAverage_.

|
virtualdefault |
Destructor.
|
protected |
Construct field from registered elements.
Definition at line 193 of file mappedPatchFieldBase.C.
Referenced by initRetrieveField().

|
protected |
Helper : storeField and retrieveField and interpolate. Leaves fld.
unchanged (and returns false) if new values cannot be retrieved. Returns true otherwise.
Definition at line 244 of file mappedPatchFieldBase.C.
References fld(), forAll, mapper_, patchField_, retrieveField(), UList< T >::size(), storeField(), and Foam::Zero.
Referenced by distribute().


|
protected |
Initialise field to retrieve (e.g. when value read from dictionary).
Definition at line 960 of file mappedPatchFieldBase.C.
References fld(), initRetrieveField(), mapper_, mappedPatchBase::NEARESTPATCHFACE, and patchField_.

|
protected |
Store elements of field onto (sub) registry.
Definition at line 46 of file mappedPatchFieldBase.C.
References Foam::endl(), Foam::flatOutput(), fld(), forAll, mapper_, Foam::Pout, UPstream::procID(), UList< T >::size(), mappedPatchBase::storeField(), and mappedPatchBase::subRegistry().
Referenced by distribute(), and storeAndRetrieveField().


|
protected |
Construct field from registered elements.
Definition at line 97 of file mappedPatchFieldBase.C.
References fld(), forAll, mapper_, UPstream::procID(), UList< T >::size(), and mappedPatchBase::subRegistry().
Referenced by distribute(), and storeAndRetrieveField().


| const GeometricField< T, fvPatchField, volMesh > & sampleField | ( | const word & | fieldName | ) | const |
Field to sample. Either on my or nbr mesh.
Referenced by mappedField(), mappedInternalField(), sampleField(), and mappedFixedInternalValueFvPatchField< Type >::updateCoeffs().


| const Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > & sampleField | ( | ) | const |
Field to sample. Either on my or nbr mesh.
Definition at line 508 of file mappedPatchFieldBase.C.
References fieldName_, and sampleField().

|
virtual |
Map sampleField onto *this patch.
Definition at line 606 of file mappedPatchFieldBase.C.
References Foam::abort(), average_, polyMesh::boundaryMesh(), distribute(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, fieldName_, polyBoundaryMesh::findPatchID(), fld(), forAll, Foam::gWeightedAverage(), UPstream::incrMsgType(), interpolationScheme_, Foam::mag(), mapper_, VectorSpace< Form, Cmpt, Ncmpts >::max, UPstream::msgType(), primitiveMesh::nCells(), mappedPatchBase::NEARESTCELL, mappedPatchBase::NEARESTFACE, mappedPatchBase::NEARESTPATCHFACE, mappedPatchBase::NEARESTPATCHFACEAMI, interpolation< Type >::New(), Foam::New(), primitiveMesh::nFaces(), Foam::nl, patchField_, Foam::refCast(), mapDistribute::reverseDistribute(), sampleField(), samples(), setAverage_, List< T >::setSize(), and Foam::Zero.
Referenced by mappedFieldFvPatchField< Type >::updateCoeffs(), and mappedFixedValueFvPatchField< Type >::updateCoeffs().


|
virtual |
Map internal of sampleField onto *this patch.
Definition at line 813 of file mappedPatchFieldBase.C.
References distribute(), fieldName_, UPstream::incrMsgType(), mapper_, UPstream::msgType(), Foam::New(), patchField_, and sampleField().
Referenced by mappedMixedFieldFvPatchField< Type >::updateCoeffs(), and mappedMixedFvPatchField< Type >::updateCoeffs().


|
virtual |
Map optional weightField onto *this patch. Default is deltaCoeffs.
Definition at line 847 of file mappedPatchFieldBase.C.
References distribute(), fieldName_, UPstream::incrMsgType(), mapper_, UPstream::msgType(), tmp< T >::New(), patchField_, and Foam::refCast().
Referenced by mappedMixedFieldFvPatchField< Type >::updateCoeffs(), and mappedMixedFvPatchField< Type >::updateCoeffs().


|
virtual |
Map optional weightField (given by name) onto *this patch.
Definition at line 882 of file mappedPatchFieldBase.C.
References distribute(), fieldName_, UPstream::incrMsgType(), mapper_, UPstream::msgType(), patchField_, tmp< T >::ref(), and Foam::refCast().

|
virtual |
Write.
Reimplemented in thermalBaffleFvPatchScalarField, turbulentTemperatureCoupledBaffleMixedFvPatchScalarField, turbulentTemperatureRadCoupledMixedFvPatchScalarField, mappedFieldFvPatchField< Type >, mappedFixedInternalValueFvPatchField< Type >, mappedFixedPushedInternalValueFvPatchField< Type >, mappedFixedValueFvPatchField< Type >, mappedMixedFieldFvPatchField< Type >, and mappedMixedFvPatchField< Type >.
Definition at line 987 of file mappedPatchFieldBase.C.
References average_, fieldName_, interpolationScheme_, mapper_, name, mappedPatchBase::NEARESTCELL, os(), patchField_, and setAverage_.
Referenced by turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write(), turbulentTemperatureRadCoupledMixedFvPatchScalarField::write(), mappedFieldFvPatchField< Type >::write(), mappedFixedValueFvPatchField< Type >::write(), mappedMixedFieldFvPatchField< Type >::write(), and mappedMixedFvPatchField< Type >::write().


|
static |
Check that patch is of correct type.
Definition at line 938 of file mappedPatchFieldBase.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::isA(), IOobject::name(), Foam::nl, IOobject::objectPath(), p, and Foam::refCast().
Referenced by mappedFieldFvPatchField< Type >::mappedFieldFvPatchField(), mappedFixedInternalValueFvPatchField< Type >::mappedFixedInternalValueFvPatchField(), mappedFixedPushedInternalValueFvPatchField< Type >::mappedFixedPushedInternalValueFvPatchField(), mappedFixedValueFvPatchField< Type >::mappedFixedValueFvPatchField(), mappedFixedValueFvPatchField< Type >::mappedFixedValueFvPatchField(), mappedFixedValueFvPatchField< Type >::mappedFixedValueFvPatchField(), mappedFixedValueFvPatchField< Type >::mappedFixedValueFvPatchField(), mappedMixedFieldFvPatchField< Type >::mappedMixedFieldFvPatchField(), mappedMixedFvPatchField< Type >::mappedMixedFvPatchField(), mappedMixedFvPatchField< Type >::mappedMixedFvPatchField(), mappedMixedFvPatchField< Type >::mappedMixedFvPatchField(), mappedMixedFvPatchField< Type >::mappedMixedFvPatchField(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), and turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs().


| void distribute | ( | const word & | fieldName, |
| Field< T > & | newValues ) const |
Wrapper for mapDistribute::distribute that knows about dabase mapping.
Definition at line 516 of file mappedPatchFieldBase.C.
References mapDistributeBase::constructMap(), mapDistributeBase::constructSize(), fld(), mapper_, mappedPatchBase::NEARESTPATCHFACEAMI, patchField_, retrieveField(), AMIInterpolation::srcAddress(), AMIInterpolation::srcMap(), AMIInterpolation::srcWeights(), storeAndRetrieveField(), storeField(), mapDistributeBase::subMap(), AMIInterpolation::tgtAddress(), AMIInterpolation::tgtMap(), and AMIInterpolation::tgtWeights().
Referenced by mappedField(), mappedInternalField(), mappedWeightField(), and mappedWeightField().


| const Foam::GeometricField< Type2, Foam::fvPatchField, Foam::volMesh > & sampleField | ( | const word & | fieldName | ) | const |
Definition at line 479 of file mappedPatchFieldBase.C.
|
protected |
Mapping engine.
Definition at line 118 of file mappedPatchFieldBase.H.
Referenced by distribute(), initRetrieveField(), mappedField(), mappedInternalField(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedWeightField(), mappedWeightField(), retrieveField(), storeAndRetrieveField(), storeField(), mappedMixedFieldFvPatchField< Type >::updateCoeffs(), mappedMixedFvPatchField< Type >::updateCoeffs(), and write().
|
protected |
Underlying patch field.
Definition at line 123 of file mappedPatchFieldBase.H.
Referenced by distribute(), initRetrieveField(), mappedField(), mappedInternalField(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedWeightField(), mappedWeightField(), storeAndRetrieveField(), and write().
|
protected |
Name of field to sample.
Definition at line 128 of file mappedPatchFieldBase.H.
Referenced by mappedField(), mappedInternalField(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedWeightField(), mappedWeightField(), sampleField(), mappedMixedFieldFvPatchField< Type >::updateCoeffs(), mappedMixedFvPatchField< Type >::updateCoeffs(), and write().
|
protected |
If true adjust the mapped field to maintain average value average_.
Definition at line 133 of file mappedPatchFieldBase.H.
Referenced by mappedField(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), and write().
|
protected |
Average value the mapped field is adjusted to maintain if setAverage_ is set true.
Definition at line 139 of file mappedPatchFieldBase.H.
Referenced by mappedField(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), and write().
|
protected |
Interpolation scheme to use for nearestcell mode.
Definition at line 144 of file mappedPatchFieldBase.H.
Referenced by mappedField(), mappedPatchFieldBase(), mappedPatchFieldBase(), mappedPatchFieldBase(), and write().