OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

addSubtract Class Reference

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

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.

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


Member Enumeration Documentation

enum calcTypes

Enumerator:
FIELD 
VALUE 

Definition at line 65 of file addSubtract.H.

enum calcModes

Enumerator:
ADD 
SUBTRACT 

Definition at line 71 of file addSubtract.H.


Constructor & Destructor Documentation

addSubtract (  ) 

Construct null.

Definition at line 169 of file addSubtract.C.

~addSubtract (  )  [virtual]

Definition at line 183 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 189 of file addSubtract.C.

void preCalc ( const argList args,
const Time runTime,
const fvMesh mesh 
) [protected, virtual]

Pre-time loop calculations.

Reimplemented from calcType.

Definition at line 201 of file addSubtract.C.

void calc ( const argList args,
const Time runTime,
const fvMesh mesh 
) [protected, virtual]

Time loop calculations.

Reimplemented from calcType.

Definition at line 251 of file addSubtract.C.

References argList::option().

Here is the call graph for this function:

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

Write addSubtract field.

Definition at line 20 of file writeAddSubtractField.C.

References addSubtract::ADD, Foam::endl(), IOobject::headerClassName(), Foam::Info, IOobject::name(), Foam::nl, IOobject::NO_READ, 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 
) [inline, protected]

Write addSubtract value.

Definition at line 20 of file writeAddSubtractValue.C.

References addSubtract::ADD, Foam::endl(), IOobject::headerClassName(), Foam::Info, IOobject::name(), IOobject::NO_READ, fvMesh::time(), Time::timeName(), and Ostream::write().

Here is the call graph for this function:

TypeName ( "addSubtract"   ) 

Runtime type information.


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd