subtract.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::functionObjects::subtract
26 
27 Description
28  From the first field subtract the remaining fields in the list.
29 
30  The operation can be applied to any volume or surface fields generating a
31  volume or surface scalar field.
32 
33  Example of function object specification:
34  \verbatim
35  Tdiff
36  {
37  type subtract;
38  libs ("libfieldFunctionObjects.so");
39  fields (T Tmean);
40  result Tdiff;
41  executeControl writeTime;
42  writeControl writeTime;
43  }
44  \endverbatim
45 
46 See also
47  Foam::functionObjects::fieldsExpression
48  Foam::functionObjects::fvMeshFunctionObject
49 
50 SourceFiles
51  subtract.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef functionObjects_subtract_H
56 #define functionObjects_subtract_H
57 
58 #include "fieldsExpression.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 namespace functionObjects
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class subtract Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 class subtract
72 :
73  public fieldsExpression
74 {
75  // Private Member Functions
76 
77  //- Subtract the list of fields of the specified type
78  // and return the result
79  template<class GeoFieldType>
80  tmp<GeoFieldType> calcFieldType() const;
81 
82  //- Subtract the list of fields and return true if successful
83  virtual bool calc();
84 
85 
86 public:
87 
88  friend class fieldsExpression;
89 
90 
91  //- Runtime type information
92  TypeName("subtract");
93 
94 
95  // Constructors
96 
97  //- Construct from Time and dictionary
98  subtract
99  (
100  const word& name,
101  const Time& runTime,
102  const dictionary& dict
103  );
104 
105 
106  //- Destructor
107  virtual ~subtract();
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace functionObjects
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #ifdef NoRepository
119  #include "subtractTemplates.C"
120 #endif
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
dictionary dict
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
From the first field subtract the remaining fields in the list.
Definition: subtract.H:70
engineTime & runTime
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
TypeName("subtract")
Runtime type information.
subtract(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: subtract.C:52
virtual ~subtract()
Destructor.
Definition: subtract.C:66
A class for handling words, derived from string.
Definition: word.H:59
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.