add.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::add
26 
27 Group
28  grpFieldFunctionObjects
29 
30 Description
31  Add a list of fields.
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  Ttot
39  {
40  type add;
41  libs ("libfieldFunctionObjects.so");
42  fields (T Tdelta);
43  result Ttot;
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  add.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef functionObjects_add_H
59 #define functionObjects_add_H
60 
61 #include "fieldsExpression.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace functionObjects
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class add Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 class add
75 :
76  public fieldsExpression
77 {
78  // Private Member Functions
79 
80  //- Add the list of fields of the specified type
81  // and return the result
82  template<class GeoFieldType>
83  tmp<GeoFieldType> calcFieldType() const;
84 
85  //- Add 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("add");
96 
97 
98  // Constructors
99 
100  //- Construct from Time and dictionary
101  add
102  (
103  const word& name,
104  const Time& runTime,
105  const dictionary& dict
106  );
107 
108 
109  //- Destructor
110  virtual ~add();
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace functionObjects
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #ifdef NoRepository
122  #include "addTemplates.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
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
A class for handling words, derived from string.
Definition: word.H:59
add(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: add.C:52
Add a list of fields.
Definition: add.H:73
A class for managing temporary objects.
Definition: PtrList.H:53
virtual ~add()
Destructor.
Definition: add.C:66
TypeName("add")
Runtime type information.
Namespace for OpenFOAM.