pointHistory.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::pointHistory
28 
29 Description
30 
31 SourceFiles
32  pointHistory.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef pointHistory_H
37 #define pointHistory_H
38 
39 #include "functionObject.H"
40 #include "dictionary.H"
41 #include "fvMesh.H"
42 #include "OFstream.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class pointHistory Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class pointHistory
54 :
55  public functionObject
56 {
57  // Private Data
58 
59  //- Name
60  const word name_;
61 
62  //- Reference to main object registry
63  const Time& time_;
64 
65  //- Region name
66  word regionName_;
67 
68  //- History point ID
69  label historyPointID_;
70 
71  //- History point
72  vector refHistoryPoint_;
73 
74  //- Processor of history point
75  label processor_;
76 
77  //- Output file name
78  word fileName_;
79 
80  //- Output file stream
81  autoPtr<OFstream> historyFilePtr_;
82 
83  // Private Member Functions
84 
85  //- Write data
86  bool writeData();
87 
88  //- No copy construct
89  pointHistory(const pointHistory&) = delete;
90 
91  //- No copy assignment
92  void operator=(const pointHistory&) = delete;
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("pointHistory");
98 
99 
100  // Constructors
101 
102  //- Construct from components
104  (
105  const word& name,
106  const Time& runTime,
107  const dictionary&
108  );
109 
110 
111  // Member Functions
112 
113  //- execute is called at each ++ or += of the time-loop
114  virtual bool execute();
115 
116  //- Read and set the function object if its data has changed
117  virtual bool read(const dictionary& dict);
118 
119  //- No-op
120  virtual bool write()
121  {
122  return true;
123  }
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
engineTime & runTime
Abstract base-class for Time/database function objects.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
const word & name() const noexcept
Return the name of this functionObject.
virtual bool execute()
execute is called at each ++ or += of the time-loop
Definition: pointHistory.C:179
A class for handling words, derived from Foam::string.
Definition: word.H:63
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual bool read(const dictionary &dict)
Read and set the function object if its data has changed.
Definition: pointHistory.C:185
virtual bool write()
No-op.
Definition: pointHistory.H:147
TypeName("pointHistory")
Runtime type information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Namespace for OpenFOAM.