writeFreeSurface.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) 2019 Zeljko Tukovic, FSB Zagreb.
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::writeFreeSurface
28 
29 Description
30  A function object to write the control points on the free surface
31 
32 SourceFiles
33  writeFreeSurface.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef writeFreeSurface_H
38 #define writeFreeSurface_H
39 
40 #include "functionObject.H"
41 #include "dictionary.H"
42 #include "fvMesh.H"
43 #include "OFstream.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class writeFreeSurface Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class writeFreeSurface
55 :
56  public functionObject
57 {
58  // Private Data
59 
60  //- Name
61  const word name_;
62 
63  //- Reference to main object registry
64  const Time& time_;
65 
66  //- Region name
67  word regionName_;
68 
69 
70  // Private Member Functions
71 
72  //- Write data
73  bool writeData();
74 
75  //- No copy construct
76  writeFreeSurface(const writeFreeSurface&) = delete;
77 
78  //- No copy assignment
79  void operator=(const writeFreeSurface&) = delete;
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("writeFreeSurface");
85 
86 
87  // Constructors
88 
89  //- Construct from components
91  (
92  const word& name,
93  const Time& runTime,
94  const dictionary& dict
95  );
96 
97 
98  // Member Functions
99 
100  //- start is called at the start of the time-loop
101  virtual bool start();
102 
103  //- execute is called at each ++ or += of the time-loop
104  virtual bool execute();
105 
106  //- Read and set the function object if its data has changed
107  virtual bool read(const dictionary& dict);
108 
109  //- No-op
110  virtual bool write()
111  {
112  return true;
113  }
114 };
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::writeFreeSurface::execute
virtual bool execute()
execute is called at each ++ or += of the time-loop
Definition: writeFreeSurface.C:100
Foam::writeFreeSurface::write
virtual bool write()
No-op.
Definition: writeFreeSurface.H:109
Foam::writeFreeSurface::start
virtual bool start()
start is called at the start of the time-loop
Definition: writeFreeSurface.C:94
Foam::writeFreeSurface::TypeName
TypeName("writeFreeSurface")
Runtime type information.
Foam::functionObject
Abstract base-class for Time/database function objects.
Definition: functionObject.H:332
OFstream.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::writeFreeSurface
A function object to write the control points on the free surface.
Definition: writeFreeSurface.H:53
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
dictionary.H
functionObject.H
Foam::writeFreeSurface::read
virtual bool read(const dictionary &dict)
Read and set the function object if its data has changed.
Definition: writeFreeSurface.C:106