div.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) 2012-2020 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::div
26 
27 Description
28  Calculates the divergence of a field. The operation is limited to
29  surfaceScalarFields and volVectorFields, and the output is a volScalarField.
30 
31 See also
32  Foam::functionObjects::fieldExpression
33  Foam::functionObjects::fvMeshFunctionObject
34 
35 SourceFiles
36  div.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef functionObjects_div_H
41 #define functionObjects_div_H
42 
43 #include "fieldExpression.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 namespace functionObjects
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class div Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class div
57 :
58  public fieldExpression
59 {
60  // Private Member Functions
61 
62  //- Calculate the divergence of either a
63  // volScalarField or a surfaceScalarField and register the result
64  template<class FieldType>
65  bool calcDiv();
66 
67  //- Calculate the divergence field and return true if successful
68  virtual bool calc();
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("div");
75 
76 
77  // Constructors
78 
79  //- Construct from Time and dictionary
80  div
81  (
82  const word& name,
83  const Time& runTime,
84  const dictionary& dict
85  );
86 
87 
88  //- Destructor
89  virtual ~div();
90 };
91 
92 
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 
95 } // End namespace functionObjects
96 } // End namespace Foam
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 #ifdef NoRepository
101  #include "divTemplates.C"
102 #endif
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 #endif
107 
108 // ************************************************************************* //
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:156
TypeName("div")
Runtime type information.
virtual ~div()
Destructor.
Definition: div.C:76
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
A class for handling words, derived from string.
Definition: word.H:59
div(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: div.C:64
Calculates the divergence of a field. The operation is limited to surfaceScalarFields and volVectorFi...
Definition: div.H:55
Namespace for OpenFOAM.