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. | |
Public Member Functions inherited from fieldValue | |
| TypeName ("fieldValue") | |
| Run-time type information. | |
| fieldValue (const word &name, const objectRegistry &obr, const dictionary &dict, const bool loadFromFiles=false) | |
| Construct from components. | |
| virtual | ~fieldValue () |
| Destructor. | |
| const word & | name () const |
| Return the name of the geometric source. | |
| const objectRegistry & | obr () const |
| Return the reference to the object registry. | |
| bool | active () const |
| Return the active flag. | |
| const Switch & | log () const |
| Return the switch to send output to Info as well as to file. | |
| const word & | sourceName () const |
| Return the source name. | |
| const wordList & | fields () const |
| Return the list of field names. | |
| const Switch & | valueOutput () const |
| Return the output field values flag. | |
| const fvMesh & | mesh () const |
| Helper function to return the reference to the mesh. | |
| virtual void | execute () |
| Execute. | |
| virtual void | end () |
| Execute the at the final time-loop, currently does nothing. | |
| template<class Type > | |
| tmp< Field< Type > > | combineFields (const Field< Type > &field) const |
| Comnbine fields from all processor domains into single field. | |
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 Member Functions inherited from fieldValue | |
| virtual void | makeFile () |
| Make the output file. | |
| virtual void | updateMesh (const mapPolyMesh &) |
| Update mesh. | |
| virtual void | movePoints (const Field< point > &) |
| Move points. | |
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 | |
Protected Attributes inherited from fieldValue | |
| word | name_ |
| Name of this fieldValue object. | |
| const objectRegistry & | obr_ |
| Database this class is registered to. | |
| bool | active_ |
| Active flag. | |
| Switch | log_ |
| Switch to send output to Info as well as to file. | |
| word | sourceName_ |
| Name of source object. | |
| wordList | fields_ |
| List of field names to operate on. | |
| Switch | valueOutput_ |
| Output field values flag. | |
| autoPtr< OFstream > | outputFilePtr_ |
| Output file pointer. | |
| 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.
|
virtual |
Destructor.
Definition at line 339 of file faceSource.C.
|
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.
|
protected |
Return true if the field name is valid.
Definition at line 34 of file faceSourceTemplates.C.
References objectRegistry::foundObject(), fieldValue::obr_, sf(), faceSource::source_, and faceSource::stSampledSurface.
|
protected |
Return field values by looking up field name.
Definition at line 54 of file faceSourceTemplates.C.
References sf().
|
protected |
Apply the 'operation' to the values.
Definition at line 83 of file faceSourceTemplates.C.
References Foam::max(), Foam::min(), and Foam::sum().
|
protectedvirtual |
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.
|
inline |
Return the source type.
Definition at line 31 of file faceSourceI.H.
References faceSource::source_.
|
inline |
Return the local list of face IDs.
Definition at line 38 of file faceSourceI.H.
|
inline |
Return the local list of patch ID per face.
Definition at line 45 of file faceSourceI.H.
|
inline |
Return the list of +1/-1 representing face flip map.
Definition at line 52 of file faceSourceI.H.
|
virtual |
Read from dictionary.
Reimplemented from fieldValue.
Definition at line 345 of file faceSource.C.
References fieldValue::read().
|
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().
|
static |
Source type names.
Definition at line 123 of file faceSource.H.
|
static |
Operation type names.
Definition at line 139 of file faceSource.H.
|
protected |
Source type.
Definition at line 161 of file faceSource.H.
Referenced by faceSource::source(), and faceSource::validField().
|
protected |
Operation to apply to values.
Definition at line 164 of file faceSource.H.
|
protected |
Weight field name - only used for opWeightedAverage mode.
Definition at line 167 of file faceSource.H.
|
protected |
Global number of faces.
Definition at line 170 of file faceSource.H.
|
protected |
Local list of face IDs.
Definition at line 175 of file faceSource.H.
|
protected |
Local list of patch ID per face.
Definition at line 178 of file faceSource.H.
|
protected |
List of +1/-1 representing face flip map (1 use as is, -1 negate)
Definition at line 181 of file faceSource.H.
|
protected |
underlying sampledSurface
Definition at line 186 of file faceSource.H.