Face source variant of field value function object. Values of user- specified fields reported for collections of faces. More...
#include <fieldFunctionObjects/faceSource.H>
Face source variant of field value function object. Values of user- specified fields reported for collections of faces.
faceObj1// Name also used to identify output folder { typefaceSource; functionObjectLibs ("libfieldValueFunctionObjects.so"); enabled true; outputControl outputTime; log true; // log to screen? valueOutput true; // Write values at run-time output times? source faceZone; // Type of face source: faceZone, patch, sampledSurface sourceName f0; // faceZone or patch, see below operation sum; fields ( p phi U ); }
source:
operation is one of:
Notes:
Definition at line 105 of file faceSource.H.
Inheritance diagram for faceSource:
Collaboration diagram for faceSource:Public Types | |
| enum | sourceType { stFaceZone, stPatch, stSampledSurface } |
Source type enumeration. More... | |
| enum | operationType { opNone, opSum, opAreaAverage, opAreaIntegrate, opWeightedAverage, opMin, opMax } |
Operation type enumeration. More... | |
Public Member Functions | |
| TypeName ("faceSource") | |
| Run-time type information.
| |
| faceSource (const word &name, const objectRegistry &obr, const dictionary &dict, const bool loadFromFiles=false) | |
| Construct from components.
| |
| virtual | ~faceSource () |
| Destructor.
| |
| const sourceType & | source () const |
| Return the source type.
| |
| const labelList & | faceId () const |
| Return the local list of face IDs.
| |
| const labelList & | facePatch () const |
| Return the local list of patch ID per face.
| |
| const labelList & | faceSign () const |
| Return the list of +1/-1 representing face flip map.
| |
| virtual void | read (const dictionary &) |
| Read from dictionary.
| |
| virtual void | write () |
| Calculate and write.
| |
| template<class Type > | |
| bool | writeValues (const word &fieldName) |
| Templated helper function to output field values.
| |
| template<class Type > | |
| tmp< Field< Type > > | filterField (const GeometricField< Type, fvsPatchField, surfaceMesh > &field, const bool applyOrientation) const |
| Filter a surface field according to faceIds.
| |
| template<class Type > | |
| tmp< Field< Type > > | filterField (const GeometricField< Type, fvPatchField, volMesh > &field, const bool applyOrientation) const |
| Filter a volume field according to faceIds.
| |
Static Public Attributes | |
| static const NamedEnum < sourceType, 3 > | sourceTypeNames_ |
| Source type names.
| |
| static const NamedEnum < operationType, 7 > | operationTypeNames_ |
| Operation type names.
| |
Protected Member Functions | |
| void | initialise (const dictionary &dict) |
| Initialise, e.g. face addressing.
| |
| template<class Type > | |
| bool | validField (const word &fieldName) const |
| Return true if the field name is valid.
| |
| template<class Type > | |
| tmp< Field< Type > > | setFieldValues (const word &fieldName) const |
| Return field values by looking up field name.
| |
| template<class Type > | |
| Type | processValues (const Field< Type > &values, const scalarField &magSf, const scalarField &weightField) const |
| Apply the 'operation' to the values.
| |
| virtual void | writeFileHeader () |
| Output file header information.
| |
Protected Attributes | |
| sourceType | source_ |
| Source type.
| |
| operationType | operation_ |
| Operation to apply to values.
| |
| word | weightFieldName_ |
| Weight field name - only used for opWeightedAverage mode.
| |
| label | nFaces_ |
| Global number of faces.
| |
| labelList | faceId_ |
| Local list of face IDs.
| |
| labelList | facePatchId_ |
| Local list of patch ID per face.
| |
| labelList | faceSign_ |
| List of +1/-1 representing face flip map (1 use as is, -1 negate)
| |
| autoPtr< sampledSurface > | surfacePtr_ |
| underlying sampledSurface
| |
| enum sourceType |
Source type enumeration.
Definition at line 115 of file faceSource.H.
| enum operationType |
Operation type enumeration.
Definition at line 127 of file faceSource.H.
| faceSource | ( | const word & | name, |
| const objectRegistry & | obr, | ||
| const dictionary & | dict, | ||
| const bool | loadFromFiles = false
|
||
| ) |
Construct from components.
Definition at line 317 of file faceSource.C.
| ~faceSource | ( | ) | [virtual]
|
Destructor.
Definition at line 339 of file faceSource.C.
| void initialise | ( | const dictionary & | dict ) | [protected]
|
Initialise, e.g. face addressing.
Definition at line 220 of file faceSource.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::gSum(), Foam::Info, dictionary::lookup(), mesh, Foam::nl, Foam::type(), and Field< scalar >::typeName.
| bool validField | ( | const word & | fieldName ) | const [protected]
|
Return true if the field name is valid.
Definition at line 34 of file faceSourceTemplates.C.
References objectRegistry::foundObject(), fieldValue::obr_, faceSource::source_, and faceSource::stSampledSurface.
| Foam::tmp< Foam::Field< Type > > setFieldValues | ( | const word & | fieldName ) | const [protected]
|
Return field values by looking up field name.
Definition at line 54 of file faceSourceTemplates.C.
| Type processValues | ( | const Field< Type > & | values, |
| const scalarField & | magSf, | ||
| const scalarField & | weightField | ||
| ) | const [protected]
|
Apply the 'operation' to the values.
Definition at line 83 of file faceSourceTemplates.C.
References Foam::max(), Foam::min(), and Foam::sum().
| void writeFileHeader | ( | ) | [protected, virtual]
|
Output file header information.
Implements fieldValue.
Definition at line 293 of file faceSource.C.
References Foam::endl(), forAll, Foam::nl, and Foam::tab.
| TypeName | ( | "faceSource" | ) |
Run-time type information.
| const Foam::fieldValues::faceSource::sourceType & source | ( | ) | const [inline]
|
Return the source type.
Definition at line 31 of file faceSourceI.H.
References faceSource::source_.
| const Foam::labelList & faceId | ( | ) | const [inline]
|
Return the local list of face IDs.
Definition at line 38 of file faceSourceI.H.
| const Foam::labelList & facePatch | ( | ) | const [inline]
|
Return the local list of patch ID per face.
Definition at line 45 of file faceSourceI.H.
| const Foam::labelList & faceSign | ( | ) | const [inline]
|
Return the list of +1/-1 representing face flip map.
Definition at line 52 of file faceSourceI.H.
| void read | ( | const dictionary & | dict ) | [virtual]
|
Read from dictionary.
Reimplemented from fieldValue.
Definition at line 345 of file faceSource.C.
References fieldValue::read().
| void write | ( | ) | [virtual]
|
Calculate and write.
Reimplemented from fieldValue.
Definition at line 356 of file faceSource.C.
References Foam::endl(), forAll, Foam::gSum(), Foam::Info, Pstream::master(), mesh, Foam::tab, and fieldValue::write().
| bool writeValues | ( | const word & | fieldName ) |
Templated helper function to output field values.
Definition at line 135 of file faceSourceTemplates.C.
References Foam::endl(), Foam::Info, Pstream::master(), mesh, IOobject::NO_READ, IOobject::NO_WRITE, Foam::tab, and regIOobject::write().
| Foam::tmp< Foam::Field< Type > > filterField | ( | const GeometricField< Type, fvsPatchField, surfaceMesh > & | field, |
| const bool | applyOrientation | ||
| ) | const |
Filter a surface field according to faceIds.
Definition at line 244 of file faceSourceTemplates.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), and forAll.
| Foam::tmp< Foam::Field< Type > > filterField | ( | const GeometricField< Type, fvPatchField, volMesh > & | field, |
| const bool | applyOrientation | ||
| ) | const |
Filter a volume field according to faceIds.
Definition at line 198 of file faceSourceTemplates.C.
References Foam::abort(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), Foam::FatalError, FatalErrorIn, forAll, IOobject::name(), Foam::nl, and Foam::type().
const NamedEnum< fieldValues::faceSource::sourceType, 3 > sourceTypeNames_ [static]
|
Source type names.
Definition at line 123 of file faceSource.H.
const NamedEnum< fieldValues::faceSource::operationType, 7 > operationTypeNames_ [static]
|
Operation type names.
Definition at line 139 of file faceSource.H.
sourceType source_ [protected]
|
Source type.
Definition at line 161 of file faceSource.H.
Referenced by faceSource::source(), and faceSource::validField().
operationType operation_ [protected]
|
Operation to apply to values.
Definition at line 164 of file faceSource.H.
word weightFieldName_ [protected]
|
Weight field name - only used for opWeightedAverage mode.
Definition at line 167 of file faceSource.H.
label nFaces_ [protected]
|
Global number of faces.
Definition at line 170 of file faceSource.H.
Local list of face IDs.
Definition at line 175 of file faceSource.H.
labelList facePatchId_ [protected]
|
Local list of patch ID per face.
Definition at line 178 of file faceSource.H.
List of +1/-1 representing face flip map (1 use as is, -1 negate)
Definition at line 181 of file faceSource.H.
autoPtr<sampledSurface> surfacePtr_ [protected]
|
underlying sampledSurface
Definition at line 186 of file faceSource.H.