subtract.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2016 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 Group
28  grpFieldFunctionObjects
29 
30 Description
31  From the first field subtract the remaining fields in the list.
32 
33  The operation can be applied to any volume or surface fields generating a
34  volume or surface scalar field.
35 
36  Example of function object specification:
37  \verbatim
38  Tdiff
39  {
40  type subtract;
41  libs ("libfieldFunctionObjects.so");
42  fields (T Tmean);
43  result Tdiff;
44  executeControl writeTime;
45  writeControl writeTime;
46  }
47  \endverbatim
48 
49 See also
50  Foam::functionObjects::fieldsExpression
51  Foam::functionObjects::fvMeshFunctionObject
52 
53 SourceFiles
54  subtract.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef functionObjects_subtract_H
59 #define functionObjects_subtract_H
60 
61 #include "fieldsExpression.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace functionObjects
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class subtract Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 class subtract
75 :
76  public fieldsExpression
77 {
78  // Private Member Functions
79 
80  //- Subtract the list of fields of the specified type
81  // and return the result
82  template<class GeoFieldType>
83  tmp<GeoFieldType> calcFieldType() const;
84 
85  //- Subtract the list of fields and return true if successful
86  virtual bool calc();
87 
88 
89 public:
90 
91  friend class fieldsExpression;
92 
93 
94  //- Runtime type information
95  TypeName("subtract");
96 
97 
98  // Constructors
99 
100  //- Construct from Time and dictionary
101  subtract
102  (
103  const word& name,
104  const Time& runTime,
105  const dictionary& dict
106  );
107 
108 
109  //- Destructor
110  virtual ~subtract();
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace functionObjects
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #ifdef NoRepository
122  #include "subtractTemplates.C"
123 #endif
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
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:137
From the first field subtract the remaining fields in the list.
Definition: subtract.H:73
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.