FreeFOAM The Cross-Platform CFD Toolkit
addSubtract Class Reference

adds/subtracts a field or value to/from a base field. More...

#include <foamCalcFunctions/addSubtract.H>


Detailed Description

adds/subtracts a field or value to/from a base field.

New field name specified by -resultName option, or automatically as: <baseFieldName>_add_<addSubtractFieldName> <baseFieldName>_add_value <baseFieldName>_subtract_<addSubtractFieldName> <baseFieldName>_subtract_value

Example usage: addSubtract p add -value 100000 -resultName pAbs addSubtract U subtract -field U0

Source files

Definition at line 64 of file addSubtract.H.

+ Inheritance diagram for addSubtract:
+ Collaboration diagram for addSubtract:

List of all members.

Public Types

enum  calcTypes { FIELD, VALUE }
enum  calcModes { ADD, SUBTRACT }

Public Member Functions

 TypeName ("addSubtract")
 Runtime type information.
 addSubtract ()
 Construct null.
virtual ~addSubtract ()
- Public Member Functions inherited from calcType
 TypeName ("calcType")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, calcType, dictionary,(),())
 calcType ()
 Construct null.
virtual ~calcType ()
void tryInit ()
 Initialise - typically setting static variables,.
void tryPreCalc (const argList &args, const Time &runTime, const fvMesh &mesh)
 Pre-time loop calculations.
void tryCalc (const argList &args, const Time &runTime, const fvMesh &mesh)
 Time loop calculations.
void tryPostCalc (const argList &args, const Time &runTime, const fvMesh &mesh)
 Post-time loop calculations.

Protected Member Functions

virtual void init ()
 Initialise - typically setting static variables,.
virtual void preCalc (const argList &args, const Time &runTime, const fvMesh &mesh)
 Pre-time loop calculations.
virtual void calc (const argList &args, const Time &runTime, const fvMesh &mesh)
 Time loop calculations.
template<class Type >
void writeAddSubtractField (const IOobject &baseHeader, const IOobject &addSubtractHeader, const fvMesh &mesh, bool &processed)
 Write addSubtract field.
template<class Type >
void writeAddSubtractValue (const IOobject &baseHeader, const string &valueStr, const fvMesh &mesh, bool &processed)
 Write addSubtract value.
- Protected Member Functions inherited from calcType
virtual void postCalc (const argList &args, const Time &runTime, const fvMesh &mesh)
 Post-time loop calculations.

Additional Inherited Members

- Static Public Member Functions inherited from calcType
static autoPtr< calcTypeNew (const word &calcTypeName)

Member Enumeration Documentation

enum calcTypes
Enumerator:
FIELD 
VALUE 

Definition at line 70 of file addSubtract.H.

enum calcModes
Enumerator:
ADD 
SUBTRACT 

Definition at line 76 of file addSubtract.H.


Constructor & Destructor Documentation

Construct null.

Definition at line 177 of file addSubtract.C.

~addSubtract ( )
virtual

Definition at line 191 of file addSubtract.C.


Member Function Documentation

void init ( )
protectedvirtual

Initialise - typically setting static variables,.

e.g. command line arguments

Reimplemented from calcType.

Definition at line 197 of file addSubtract.C.

References LList< LListBase, T >::append(), HashTable< T, Key, Hash >::insert(), argList::validArgs, and argList::validOptions.

void preCalc ( const argList args,
const Time runTime,
const fvMesh mesh 
)
protectedvirtual

Pre-time loop calculations.

Reimplemented from calcType.

Definition at line 209 of file addSubtract.C.

References argList::additionalArgs(), Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::nl, argList::option(), and argList::optionFound().

void calc ( const argList args,
const Time runTime,
const fvMesh mesh 
)
protectedvirtual

Time loop calculations.

Reimplemented from calcType.

Definition at line 259 of file addSubtract.C.

References Foam::abort(), Foam::exit(), Foam::FatalError, FatalErrorIn, mesh, IOobject::MUST_READ, Foam::nl, and Time::timeName().

void writeAddSubtractField ( const IOobject baseHeader,
const IOobject addSubtractHeader,
const fvMesh mesh,
bool &  processed 
)
protected
void writeAddSubtractValue ( const IOobject baseHeader,
const string valueStr,
const fvMesh mesh,
bool &  processed 
)
protected
TypeName ( "addSubtract"  )

Runtime type information.


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