Files
openfoam/src/functionObjects/field/fieldsExpression/fieldsExpression.H
Henry Weller 0eca493cb8 functionObjects::subtract: From the first field subtract the remaining fields in the list
The operation can be applied to any volume or surface fields generating a
    volume or surface scalar field.

    Example of function object specification:
    \verbatim
    Tdiff
    {
        type            subtract;
        libs            ("libfieldFunctionObjects.so");
        fields          (T Tmean);
        result          Tdiff;
        executeControl  writeTime;
        writeControl    writeTime;
    }
    \endverbatim
2016-11-18 22:20:22 +00:00

139 lines
3.5 KiB
C++

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::functionObjects::fieldsExpression
Group
grpFieldFunctionObjects
Description
See also
Foam::functionObjects::fvMeshFunctionObject
SourceFiles
fieldsExpression.C
\*---------------------------------------------------------------------------*/
#ifndef functionObjects_fieldsExpression_H
#define functionObjects_fieldsExpression_H
#include "fvMeshFunctionObject.H"
#include "volFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
/*---------------------------------------------------------------------------*\
Class fieldsExpression Declaration
\*---------------------------------------------------------------------------*/
class fieldsExpression
:
public fvMeshFunctionObject
{
protected:
// Protected member data
//- Names of fields to process
wordList fieldNames_;
//- Name of result fields
word resultName_;
// Protected member functions
virtual bool calc() = 0;
void setResultName(const word& typeName, const wordList& defaultArg);
private:
// Private Member Functions
//- Disallow default bitwise copy construct
fieldsExpression(const fieldsExpression&);
//- Disallow default bitwise assignment
void operator=(const fieldsExpression&);
public:
//- Runtime type information
TypeName("fieldsExpression");
// Constructors
//- Construct from Time and dictionary
fieldsExpression
(
const word& name,
const Time& runTime,
const dictionary& dict,
const wordList& fieldNames = wordList::null(),
const word& resultName = word::null
);
//- Destructor
virtual ~fieldsExpression();
// Member Functions
//- Read the fieldsExpression data
virtual bool read(const dictionary&);
//- Calculate the result fields
virtual bool execute();
//- Write the result fields
virtual bool write();
//- Clear the result fields from the objectRegistry
virtual bool clear();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionObjects
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //