fieldExpression.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) 2012-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::fieldExpression
26 
27 Group
28  grpFieldFunctionObjects
29 
30 Description
31 
32 See also
33  Foam::functionObjects::fvMeshFunctionObject
34 
35 SourceFiles
36  fieldExpression.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef functionObjects_fieldExpression_H
41 #define functionObjects_fieldExpression_H
42 
43 #include "fvMeshFunctionObject.H"
44 #include "volFieldsFwd.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 namespace functionObjects
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class fieldExpression Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class fieldExpression
58 :
60 {
61 protected:
62 
63  // Protected member data
64 
65  //- Name of field to process
67 
68  //- Name of result field
70 
71 
72  // Protected member functions
73 
74  virtual bool calc();
75 
76  void setResultName(const word& typeName, const word& defaultArg);
77 
78 
79 private:
80 
81  // Private Member Functions
82 
83  //- Disallow default bitwise copy construct
85 
86  //- Disallow default bitwise assignment
87  void operator=(const fieldExpression&);
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("fieldExpression");
94 
95 
96  // Constructors
97 
98  //- Construct from Time and dictionary
100  (
101  const word& name,
102  const Time& runTime,
103  const dictionary& dict,
104  const word& fieldName = word::null,
105  const word& resultName = word::null
106  );
107 
108 
109  //- Destructor
110  virtual ~fieldExpression();
111 
112 
113  // Member Functions
114 
115  //- Read the fieldExpression data
116  virtual bool read(const dictionary&);
117 
118  //- Calculate the result field
119  virtual bool execute();
120 
121  //- Write the result field
122  virtual bool write();
123 
124  //- Clear the result field from the objectRegistry
125  virtual bool clear();
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace functionObjects
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
dictionary dict
word resultName_
Name of result field.
TypeName("fieldExpression")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
word fieldName_
Name of field to process.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
void setResultName(const word &typeName, const word &defaultArg)
const word & name() const
Return the name of this functionObject.
A class for handling words, derived from string.
Definition: word.H:59
static const word null
An empty word.
Definition: word.H:77
virtual bool write()
Write the result field.
virtual bool read(const dictionary &)
Read the fieldExpression data.
virtual bool execute()
Calculate the result field.
virtual bool clear()
Clear the result field from the objectRegistry.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Namespace for OpenFOAM.