FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Cell source variant of field value function object. Values of user- specified fields reported for collections of cells. More...

#include <fieldFunctionObjects/cellSource.H>


Detailed Description

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:

  • none
  • sum
  • volAverage
  • volIntegrate
  • weightedAverage
Source files

Definition at line 80 of file cellSource.H.

Inheritance diagram for cellSource:
Collaboration diagram for cellSource:

List of all members.

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.

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.

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.

Member Enumeration Documentation

enum sourceType

Source type enumeration.

Enumerator:
stCellZone 
stAll 

Definition at line 90 of file cellSource.H.

Operation type enumeration.

Enumerator:
opNone 
opSum 
opVolAverage 
opVolIntegrate 
opWeightedAverage 
opMin 
opMax 

Definition at line 101 of file cellSource.H.


Constructor & Destructor Documentation

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.

~cellSource (  ) [virtual]

Destructor.

Definition at line 185 of file cellSource.C.


Member Function Documentation

void initialise ( const dictionary &   dict  ) [protected]
bool validField ( const word &   fieldName  ) const [protected]

Return true if the field name is valid.

Definition at line 33 of file cellSourceTemplates.C.

References objectRegistry::foundObject(), and fieldValue::obr_.

Foam::tmp< Foam::Field< Type > > setFieldValues ( const word &   fieldName  ) const [protected]

Insert field values into values list.

Definition at line 48 of file cellSourceTemplates.C.

Type processValues ( const Field< Type > &   values,
const scalarField &   V,
const scalarField &   weightField  
) const [protected]

Apply the 'operation' to the values.

Definition at line 65 of file cellSourceTemplates.C.

References Foam::max(), Foam::min(), and Foam::sum().

void writeFileHeader (  ) [protected, virtual]

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.

const Foam::fieldValues::cellSource::sourceType & source (  ) const [inline]

Return the source type.

Definition at line 31 of file cellSourceI.H.

References cellSource::source_.

const Foam::labelList & cellId (  ) const [inline]

Return the local list of cell IDs.

Definition at line 38 of file cellSourceI.H.

void read ( const dictionary &   dict  ) [virtual]

Read from dictionary.

Reimplemented from fieldValue.

Definition at line 191 of file cellSource.C.

References fieldValue::read().

void write (  ) [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.


Member Data Documentation

Source type names.

Definition at line 97 of file cellSource.H.

Operation type names.

Definition at line 113 of file cellSource.H.

sourceType source_ [protected]

Source type.

Definition at line 132 of file cellSource.H.

Referenced by cellSource::source().

Operation to apply to values.

Definition at line 135 of file cellSource.H.

label nCells_ [protected]

Global number of cells.

Definition at line 138 of file cellSource.H.

labelList cellId_ [protected]

Local list of cell IDs.

Definition at line 141 of file cellSource.H.

word weightFieldName_ [protected]

Weight field name - only used for opWeightedAverage mode.

Definition at line 144 of file cellSource.H.


The documentation for this class was generated from the following files:
  • src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H
  • src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C
  • src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceI.H
  • src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C