gravityMeshObject.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2018-2019 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::meshObjects::gravity
28 
29 Description
30  Gravitational acceleration vector
31  Although termed a \em MeshObject it is registered on Time only
32  and thus identical for all regions.
33 
34 SourceFiles
35  gravityMeshObject.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef meshObjects_gravity_H
40 #define meshObjects_gravity_H
41 
43 #include "MeshObject.H"
44 #include "Time.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 namespace meshObjects
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class gravity Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class gravity
58 :
59  public MeshObject
60  <
61  Time,
62  TopologicalMeshObject,
63  gravity
64  >,
66 {
67 
68 public:
69 
70  //- Run-time type information
71  TypeNameNoDebug("g");
72 
73 
74  //- Construct on Time
75  explicit gravity(const Time& runTime)
76  :
79  (
80  IOobject
81  (
82  "g", // Must be identical to typeName!
83  runTime.constant(),
84  runTime,
87  false // let MeshObject register it
88  )
89  )
90  {}
91 
92 
93  //- Construct on Time
94  static const gravity& New(const Time& runTime)
95  {
97  }
98 
99 
100  //- Destructor
101  virtual ~gravity() = default;
102 };
103 
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 } // End namespace meshObjects
108 } // End namespace Foam
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #endif
113 
114 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::MeshObject::New
static const Type & New(const Mesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
Definition: MeshObject.C:48
Foam::UniformDimensionedField< vector >
Foam::meshObjects::gravity
Gravitational acceleration vector Although termed a MeshObject it is registered on Time only and thus...
Definition: gravityMeshObject.H:56
Foam::meshObjects::gravity::~gravity
virtual ~gravity()=default
Destructor.
Foam::meshObjects::gravity::TypeNameNoDebug
TypeNameNoDebug("g")
Run-time type information.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Time.H
uniformDimensionedFields.H
Foam::meshObjects::gravity::gravity
gravity(const Time &runTime)
Construct on Time.
Definition: gravityMeshObject.H:74
Foam::IOobject::MUST_READ_IF_MODIFIED
Definition: IOobject.H:186
Foam::TopologicalMeshObject
Definition: MeshObject.H:182
MeshObject.H
Foam::MeshObject
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:88
constant
constant condensation/saturation model.
Foam::meshObjects::gravity::New
static const gravity & New(const Time &runTime)
Construct on Time.
Definition: gravityMeshObject.H:93