Public Types | Public Member Functions | Protected Member Functions | List of all members
addSubtract Class Reference

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

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

Public Types

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

Public Member Functions

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

Protected Member Functions

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

Additional Inherited Members

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

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 63 of file addSubtract.H.

Member Enumeration Documentation

enum calcTypes
Enumerator
FIELD 
VALUE 

Definition at line 69 of file addSubtract.H.

enum calcModes
Enumerator
ADD 
SUBTRACT 

Definition at line 75 of file addSubtract.H.

Constructor & Destructor Documentation

Construct null.

Definition at line 177 of file addSubtract.C.

~addSubtract ( )
virtual

Destructor.

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 addSubtract::preCalc(), argList::validArgs, and argList::validOptions.

Here is the call graph for this function:

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 addSubtract::ADD, addSubtract::calc(), Foam::exit(), Foam::FatalError, FatalErrorIn, addSubtract::FIELD, Foam::nl, argList::optionReadIfPresent(), addSubtract::SUBTRACT, and addSubtract::VALUE.

Referenced by addSubtract::init().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Time loop calculations.

Reimplemented from calcType.

Definition at line 254 of file addSubtract.C.

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

Referenced by addSubtract::preCalc().

Here is the call graph for this function:

Here is the caller graph for this function:

void writeAddSubtractField ( const IOobject baseHeader,
const IOobject addSubtractHeader,
const fvMesh mesh,
bool &  processed 
)
protected

Write addSubtract field.

Definition at line 28 of file writeAddSubtractField.C.

References Foam::endl(), IOobject::headerClassName(), Foam::Info, mesh, IOobject::name(), Foam::nl, fvMesh::time(), and Time::timeName().

Here is the call graph for this function:

void writeAddSubtractValue ( const IOobject baseHeader,
const string valueStr,
const fvMesh mesh,
bool &  processed 
)
protected

Write addSubtract value.

Definition at line 28 of file writeAddSubtractValue.C.

References Foam::endl(), IOobject::headerClassName(), Foam::Info, mesh, IOobject::name(), fvMesh::time(), and Time::timeName().

Here is the call graph for this function:

TypeName ( "addSubtract"  )

Runtime type information.


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