Cell source variant of field value function object. Values of user- specified fields reported for collections of cells. More...
#include <fieldFunctionObjects/cellSource.H>
Cell source variant of field value function object. Values of user- specified fields reported for collections of cells.
cellObj1// Name also used to identify output folder { typecellSource; functionObjectLibs ("libfieldValueFunctionObjects.so"); enabled true; outputControl outputTime; log true; // log to screen? valueOutput true; // Write values at run-time output times? source cellZone; // Type of cell source sourceName c0; operation volAverage; fields ( p U ); }
where operation is one of:
Definition at line 80 of file cellSource.H.
Public Types | |
enum | sourceType { stCellZone, stAll } |
Source type enumeration. More... | |
enum | operationType { opNone, opSum, opVolAverage, opVolIntegrate, opWeightedAverage, opMin, opMax } |
Operation type enumeration. More... |
Public Member Functions | |
TypeName ("cellSource") | |
Run-time type information. | |
cellSource (const word &name, const objectRegistry &obr, const dictionary &dict, const bool loadFromFiles=false) | |
Construct from components. | |
virtual | ~cellSource () |
Destructor. | |
const sourceType & | source () const |
Return the source type. | |
const labelList & | cellId () const |
Return the local list of cell IDs. | |
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 Field< Type > &field) const |
Filter a field according to cellIds. | |
![]() | |
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, 2 > | sourceTypeNames_ |
Source type names. | |
static const NamedEnum < operationType, 7 > | operationTypeNames_ |
Operation type names. |
Protected Member Functions | |
void | initialise (const dictionary &dict) |
Initialise, e.g. cell 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 |
Insert field values into values list. | |
template<class Type > | |
Type | processValues (const Field< Type > &values, const scalarField &V, const scalarField &weightField) const |
Apply the 'operation' to the values. | |
virtual void | writeFileHeader () |
Output file header information. | |
![]() | |
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. | |
label | nCells_ |
Global number of cells. | |
labelList | cellId_ |
Local list of cell IDs. | |
word | weightFieldName_ |
Weight field name - only used for opWeightedAverage mode. | |
![]() | |
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 |
enum operationType |
Operation type enumeration.
Definition at line 101 of file cellSource.H.
cellSource | ( | const word & | name, |
const objectRegistry & | obr, | ||
const dictionary & | dict, | ||
const bool | loadFromFiles = false |
||
) |
Construct from components.
Definition at line 166 of file cellSource.C.
|
virtual |
Destructor.
Definition at line 185 of file cellSource.C.
|
protected |
Initialise, e.g. cell addressing.
Definition at line 108 of file cellSource.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 33 of file cellSourceTemplates.C.
References objectRegistry::foundObject(), and fieldValue::obr_.
|
protected |
Insert field values into values list.
Definition at line 48 of file cellSourceTemplates.C.
|
protected |
Apply the 'operation' to the values.
Definition at line 65 of file cellSourceTemplates.C.
References Foam::max(), Foam::min(), and Foam::sum().
|
protectedvirtual |
Output file header information.
Implements fieldValue.
Definition at line 142 of file cellSource.C.
References Foam::endl(), forAll, Foam::nl, and Foam::tab.
TypeName | ( | "cellSource" | ) |
Run-time type information.
|
inline |
Return the source type.
Definition at line 31 of file cellSourceI.H.
References cellSource::source_.
|
inline |
Return the local list of cell IDs.
Definition at line 38 of file cellSourceI.H.
|
virtual |
Read from dictionary.
Reimplemented from fieldValue.
Definition at line 191 of file cellSource.C.
References fieldValue::read().
|
virtual |
Calculate and write.
Reimplemented from fieldValue.
Definition at line 203 of file cellSource.C.
References Foam::endl(), forAll, Foam::Info, Pstream::master(), mesh, Foam::sum(), Foam::tab, and fieldValue::write().
bool writeValues | ( | const word & | fieldName | ) |
Templated helper function to output field values.
Definition at line 117 of file cellSourceTemplates.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 Field< Type > & | field | ) | const |
Filter a field according to cellIds.
Definition at line 169 of file cellSourceTemplates.C.
|
static |
Source type names.
Definition at line 97 of file cellSource.H.
|
static |
Operation type names.
Definition at line 113 of file cellSource.H.
|
protected |
|
protected |
Operation to apply to values.
Definition at line 135 of file cellSource.H.
|
protected |
Global number of cells.
Definition at line 138 of file cellSource.H.
|
protected |
Local list of cell IDs.
Definition at line 141 of file cellSource.H.
|
protected |
Weight field name - only used for opWeightedAverage mode.
Definition at line 144 of file cellSource.H.