adds/subtracts a field or value to/from a base field. More...
#include <foamCalcFunctions/addSubtract.H>
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
Definition at line 64 of file addSubtract.H.
Public Types | |
enum | calcTypes { FIELD, VALUE } |
enum | calcModes { ADD, SUBTRACT } |
Public Member Functions | |
TypeName ("addSubtract") | |
Runtime type information. | |
addSubtract () | |
Construct null. | |
virtual | ~addSubtract () |
![]() | |
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. | |
![]() | |
virtual void | postCalc (const argList &args, const Time &runTime, const fvMesh &mesh) |
Post-time loop calculations. |
Additional Inherited Members | |
![]() | |
static autoPtr< calcType > | New (const word &calcTypeName) |
enum calcTypes |
Definition at line 70 of file addSubtract.H.
enum calcModes |
Definition at line 76 of file addSubtract.H.
addSubtract | ( | ) |
Construct null.
Definition at line 177 of file addSubtract.C.
|
virtual |
Definition at line 191 of file addSubtract.C.
|
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.
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().
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().
|
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().
|
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().
TypeName | ( | "addSubtract" | ) |
Runtime type information.