Public Member Functions | Static Public Member Functions | Protected Attributes
fieldValue Class Reference

Base class for field value-based function objects. More...

Inheritance diagram for fieldValue:
Inheritance graph
[legend]
Collaboration diagram for fieldValue:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("fieldValue")
 Run-time type information. More...
 
 declareRunTimeSelectionTable (autoPtr, fieldValue, dictionary,(const word &name, const objectRegistry &obr, const dictionary &dict, const bool loadFromFiles),(name, obr, dict, loadFromFiles))
 
 fieldValue (const word &name, const objectRegistry &obr, const dictionary &dict, const word &valueType, const bool loadFromFiles=false)
 Construct from components. More...
 
virtual ~fieldValue ()
 Destructor. More...
 
const wordname () const
 Return the name of the geometric source. More...
 
const objectRegistryobr () const
 Return the reference to the object registry. More...
 
const dictionarydict () const
 Return the reference to the construction dictionary. More...
 
bool active () const
 Return the active flag. More...
 
const Switchlog () const
 Return the switch to send output to Info as well as to file. More...
 
const wordsourceName () const
 Return the source name. More...
 
const wordListfields () const
 Return the list of field names. More...
 
const SwitchvalueOutput () const
 Return the output field values flag. More...
 
const fvMeshmesh () const
 Helper function to return the reference to the mesh. More...
 
virtual void read (const dictionary &dict)
 Read from dictionary. More...
 
virtual void write ()
 Write to screen/file. More...
 
virtual void execute ()
 Execute. More...
 
virtual void end ()
 Execute the at the final time-loop, currently does nothing. More...
 
virtual void timeSet ()
 Called when time was set at the end of the Time::operator++. More...
 
virtual void updateMesh (const mapPolyMesh &)
 Update mesh. More...
 
virtual void movePoints (const polyMesh &)
 Move points. More...
 
template<class Type >
void combineFields (Field< Type > &field)
 Combine fields from all processor domains into single field. More...
 
template<class Type >
void combineFields (tmp< Field< Type > > &)
 Combine fields from all processor domains into single field. More...
 
- Public Member Functions inherited from functionObjectState
 functionObjectState (const objectRegistry &obr, const word &name)
 Construct from components. More...
 
virtual ~functionObjectState ()
 Destructor. More...
 
const wordname () const
 Return the name. More...
 
bool active () const
 Return the active flag. More...
 
const IOdictionarystateDict () const
 Return access to the state dictionary. More...
 
dictionarypropertyDict ()
 Return access to the property dictionary. More...
 
template<class Type >
bool setActive ()
 Set the active status by querying objectRegistry type. More...
 
bool foundProperty (const word &entryName) const
 Return true if the property exists. More...
 
template<class Type >
Type getProperty (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property. More...
 
template<class Type >
void getProperty (const word &entryName, Type &value) const
 Retrieve generic property. More...
 
template<class Type >
void setProperty (const word &entryName, const Type &value)
 Add generic property. More...
 
template<class Type >
Type getObjectProperty (const word &objectName, const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property from named object. More...
 
template<class Type >
void getObjectProperty (const word &objectName, const word &entryName, Type &value) const
 Retrieve generic property from named object. More...
 
template<class Type >
void setObjectProperty (const word &objectName, const word &entryName, const Type &value)
 Add generic property from named object. More...
 
template<class Type >
void setResult (const word &entryName, const Type &value)
 Add result. More...
 
template<class Type >
void setObjectResult (const word &objectName, const word &entryName, const Type &value)
 Add result from named object. More...
 
template<class Type >
Type getResult (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve result. More...
 
template<class Type >
Type getObjectResult (const word &objectName, const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve result from named object. More...
 
template<class Type >
void getObjectResult (const word &objectName, const word &entryName, Type &value) const
 Retrieve result from named object. More...
 
word resultType (const word &entryName) const
 Retrieve the result type. More...
 
word objectResultType (const word &objectName, const word &entryName) const
 Return the type of result. More...
 
List< wordobjectResultEntries () const
 Retrieve the result entries. More...
 
List< wordobjectResultEntries (const word &objectName) const
 Return result entries for named object. More...
 
- Public Member Functions inherited from functionObjectFile
 functionObjectFile (const objectRegistry &obr, const word &prefix)
 Construct null. More...
 
 functionObjectFile (const objectRegistry &obr, const word &prefix, const word &fileName, const dictionary &dict)
 Construct from components and read options from dictionary. More...
 
virtual ~functionObjectFile ()
 Destructor. More...
 
void read (const dictionary &dict)
 Read. More...
 
OFstreamfile ()
 Return access to the file (if only 1) More...
 
bool writeToFile () const
 Return true if can write to file. More...
 
void writeCommented (Ostream &os, const string &str) const
 Write a commented string to stream. More...
 
void writeTabbed (Ostream &os, const string &str) const
 Write a tabbed string to stream. More...
 
void writeHeader (Ostream &os, const string &str) const
 Write a commented header to stream. More...
 
void writeTime (Ostream &os) const
 Write the current time to stream. More...
 
template<class Type >
void writeHeaderValue (Ostream &os, const string &property, const Type &value) const
 Write a (commented) header property and value pair. More...
 
label charWidth () const
 Return width of character stream output. More...
 

Static Public Member Functions

static autoPtr< fieldValueNew (const word &name, const objectRegistry &obr, const dictionary &dict, const bool loadFromFiles=false, const bool output=true)
 Return a reference to the selected fieldValue. More...
 

Protected Attributes

const objectRegistryobr_
 Database this class is registered to. More...
 
dictionary dict_
 Construction dictionary. More...
 
Switch log_
 Switch to send output to Info as well as to file. More...
 
word sourceName_
 Name of source object. More...
 
wordList fields_
 List of field names to operate on. More...
 
Switch valueOutput_
 Output field values flag. More...
 
scalar scaleFactor_
 Scale factor - optional. More...
 
- Protected Attributes inherited from functionObjectState
const word name_
 Name of model. More...
 
bool active_
 Flag to indicate whether the object is active. More...
 
IOdictionarystateDict_
 Reference to the state dictionary. More...
 
- Protected Attributes inherited from functionObjectFile
bool writeToFile_
 Flag to enable/disable writing to file. More...
 

Additional Inherited Members

- Static Public Attributes inherited from functionObjectFile
static const word outputPrefix = "postProcessing"
 Directory prefix. More...
 
static label addChars = 7
 Additional characters for writing. More...
 
- Protected Member Functions inherited from functionObjectState
 functionObjectState (const functionObjectState &)
 Disallow default bitwise copy construct. More...
 
void operator= (const functionObjectState &)
 Disallow default bitwise assignment. More...
 
- Protected Member Functions inherited from functionObjectFile
virtual void initStream (Ostream &os) const
 Initialise the output stream for writing. More...
 
virtual fileName baseFileDir () const
 Return the base directory for output. More...
 
virtual fileName baseTimeDir () const
 Return the base directory for the current time value. More...
 
virtual autoPtr< OFstreamcreateFile (const word &name) const
 Return an autoPtr to a new file. More...
 
virtual void resetFile (const word &name)
 Reset internal file pointer to new file with new name. More...
 
virtual Omanip< int > valueWidth (const label offset=0) const
 Return the value width when writing to stream with optional offset. More...
 
 functionObjectFile (const functionObjectFile &)
 Disallow default bitwise copy construct. More...
 
void operator= (const functionObjectFile &)
 Disallow default bitwise assignment. More...
 

Detailed Description

Base class for field value-based function objects.

Source files

Definition at line 63 of file fieldValue.H.

Constructor & Destructor Documentation

◆ fieldValue()

fieldValue ( const word name,
const objectRegistry obr,
const dictionary dict,
const word valueType,
const bool  loadFromFiles = false 
)

Construct from components.

Definition at line 70 of file fieldValue.C.

References dict, and Foam::read().

Here is the call graph for this function:

◆ ~fieldValue()

~fieldValue ( )
virtual

Destructor.

Definition at line 98 of file fieldValue.C.

Member Function Documentation

◆ TypeName()

TypeName ( "fieldValue"  )

Run-time type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
fieldValue  ,
dictionary  ,
(const word &name, const objectRegistry &obr, const dictionary &dict, const bool loadFromFiles)  ,
(name, obr, dict, loadFromFiles)   
)

◆ New()

Foam::autoPtr< Foam::fieldValue > New ( const word name,
const objectRegistry obr,
const dictionary dict,
const bool  loadFromFiles = false,
const bool  output = true 
)
static

Return a reference to the selected fieldValue.

Definition at line 31 of file fieldValueNew.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, Foam::name(), and Foam::nl.

Referenced by fieldValueDelta::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name()

const Foam::word & name ( ) const
inline

Return the name of the geometric source.

Definition at line 31 of file fieldValueI.H.

References functionObjectState::name_.

◆ obr()

const Foam::objectRegistry & obr ( ) const
inline

Return the reference to the object registry.

Definition at line 37 of file fieldValueI.H.

◆ dict()

const Foam::dictionary & dict ( ) const
inline

Return the reference to the construction dictionary.

Definition at line 43 of file fieldValueI.H.

Referenced by fieldValue::read().

Here is the caller graph for this function:

◆ active()

bool active ( ) const
inline

Return the active flag.

Definition at line 49 of file fieldValueI.H.

◆ log()

const Foam::Switch & log ( ) const
inline

Return the switch to send output to Info as well as to file.

Definition at line 55 of file fieldValueI.H.

◆ sourceName()

const Foam::word & sourceName ( ) const
inline

Return the source name.

Definition at line 61 of file fieldValueI.H.

◆ fields()

const Foam::wordList & fields ( ) const
inline

Return the list of field names.

Definition at line 67 of file fieldValueI.H.

◆ valueOutput()

const Foam::Switch & valueOutput ( ) const
inline

Return the output field values flag.

Definition at line 73 of file fieldValueI.H.

◆ mesh()

const Foam::fvMesh & mesh ( ) const
inline

Helper function to return the reference to the mesh.

Definition at line 79 of file fieldValueI.H.

Referenced by cellSource::setCellZoneCells(), and faceSource::setFaceZoneFaces().

Here is the caller graph for this function:

◆ read()

void read ( const dictionary dict)
virtual

Read from dictionary.

Reimplemented in faceSource, and cellSource.

Definition at line 42 of file fieldValue.C.

References functionObjectState::active_, fieldValue::dict(), fieldValue::dict_, fieldValue::fields_, fieldValue::log_, dictionary::lookup(), dictionary::lookupOrDefault(), functionObjectFile::read(), dictionary::readIfPresent(), fieldValue::scaleFactor_, and fieldValue::valueOutput_.

Referenced by cellSource::read(), and faceSource::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write()

void write ( )
virtual

Write to screen/file.

Reimplemented in faceSource, and cellSource.

Definition at line 58 of file fieldValue.C.

References Foam::Info, Foam::nl, and Foam::type().

Referenced by cellSource::write(), and faceSource::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute()

void execute ( )
virtual

Execute.

Definition at line 104 of file fieldValue.C.

◆ end()

void end ( )
virtual

Execute the at the final time-loop, currently does nothing.

Definition at line 110 of file fieldValue.C.

◆ timeSet()

void timeSet ( )
virtual

Called when time was set at the end of the Time::operator++.

Definition at line 116 of file fieldValue.C.

◆ updateMesh()

void updateMesh ( const mapPolyMesh )
virtual

Update mesh.

Definition at line 122 of file fieldValue.C.

◆ movePoints()

void movePoints ( const polyMesh )
virtual

Move points.

Definition at line 128 of file fieldValue.C.

◆ combineFields() [1/2]

void combineFields ( Field< Type > &  field)

Combine fields from all processor domains into single field.

Definition at line 33 of file fieldValueTemplates.C.

References Pstream::gatherList(), UPstream::myProcNo(), UPstream::nProcs(), and Pstream::scatterList().

Here is the call graph for this function:

◆ combineFields() [2/2]

void combineFields ( tmp< Field< Type > > &  field)

Combine fields from all processor domains into single field.

Definition at line 52 of file fieldValueTemplates.C.

Field Documentation

◆ obr_

const objectRegistry& obr_
protected

Database this class is registered to.

Definition at line 74 of file fieldValue.H.

Referenced by cellSource::validField(), and faceSource::validField().

◆ dict_

dictionary dict_
protected

Construction dictionary.

Definition at line 77 of file fieldValue.H.

Referenced by fieldValue::read().

◆ log_

Switch log_
protected

Switch to send output to Info as well as to file.

Definition at line 80 of file fieldValue.H.

Referenced by fieldValue::read().

◆ sourceName_

word sourceName_
protected

Name of source object.

Definition at line 83 of file fieldValue.H.

Referenced by cellSource::setCellZoneCells(), and faceSource::setFaceZoneFaces().

◆ fields_

wordList fields_
protected

List of field names to operate on.

Definition at line 86 of file fieldValue.H.

Referenced by fieldValue::read().

◆ valueOutput_

Switch valueOutput_
protected

Output field values flag.

Definition at line 89 of file fieldValue.H.

Referenced by fieldValue::read().

◆ scaleFactor_

scalar scaleFactor_
protected

Scale factor - optional.

Definition at line 92 of file fieldValue.H.

Referenced by fieldValue::read().


The documentation for this class was generated from the following files: