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

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 ()

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.

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

addSubtract (  )

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 (  ) [protected, virtual]

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  
) [protected, virtual]

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  
) [protected, virtual]

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: