cloudInfo.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-2015 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
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::cloudInfo
26 
27 Group
28  grpCloudFunctionObjects
29 
30 Description
31  This function object outputs Lagrangian cloud information to a file. The
32  current outputs include:
33  - total current number of parcels
34  - total current mass of parcels
35 
36  Example of function object specification:
37  \verbatim
38  cloudInfo1
39  {
40  type cloudInfo;
41  functionObjectLibs ("libcloudFunctionObjects.so");
42  ...
43  clouds
44  (
45  kinematicCloud1
46  thermoCloud1
47  );
48  }
49  \endverbatim
50 
51 
52  \heading Function object usage
53 
54  \table
55  Property | Description | Required | Default value
56  type | type name: cloudInfo | yes |
57  clouds | list of clouds names to process |yes |
58  \endtable
59 
60  The output data of each cloud is written to a file named <cloudName>.dat
61 
62 SeeAlso
63  Foam::functionObject
64  Foam::OutputFilterFunctionObject
65 
66 SourceFiles
67  cloudInfo.C
68  IOcloudInfo.H
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef cloudInfo_H
73 #define cloudInfo_H
74 
75 #include "functionObjectFile.H"
76 #include "PtrList.H"
77 #include "pointFieldFwd.H"
78 #include "volFields.H"
79 #include "surfaceFields.H"
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 
86 // Forward declaration of classes
87 class objectRegistry;
88 class dictionary;
89 class mapPolyMesh;
90 
91 /*---------------------------------------------------------------------------*\
92  Class cloudInfo Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 class cloudInfo
96 :
97  public functionObjectFile
98 {
99 protected:
100 
101  // Protected data
102 
103  //- Name of this set of cloudInfo object
104  word name_;
105 
106  //- Reference to the database
107  const objectRegistry& obr_;
108 
109  //- on/off switch
110  bool active_;
111 
112  //- Switch to send output to Info as well
113  Switch log_;
114 
115  //- List of cloud names
117 
118  //- Output file per cloud
120 
121 
122  // Protected Member Functions
123 
124  //- File header information
125  virtual void writeFileHeader(Ostream& os) const;
126 
127  //- Disallow default bitwise copy construct
128  cloudInfo(const cloudInfo&);
129 
130  //- Disallow default bitwise assignment
131  void operator=(const cloudInfo&);
132 
133 
134 public:
135 
136  //- Runtime type information
137  TypeName("cloudInfo");
138 
139 
140  // Constructors
141 
142  //- Construct for given objectRegistry and dictionary.
143  // Allow the possibility to load fields from files
144  cloudInfo
145  (
146  const word& name,
147  const objectRegistry&,
148  const dictionary&,
149  const bool loadFromFiles = false
150  );
151 
152 
153  //- Destructor
154  virtual ~cloudInfo();
155 
156 
157  // Member Functions
158 
159  //- Return name of the cloudInfo object
160  virtual const word& name() const
161  {
162  return name_;
163  }
164 
165  //- Read the field min/max data
166  virtual void read(const dictionary&);
167 
168  //- Execute, currently does nothing
169  virtual void execute();
170 
171  //- Execute at the final time-loop, currently does nothing
172  virtual void end();
173 
174  //- Called when time was set at the end of the Time::operator++
175  virtual void timeSet();
176 
177  //- Write
178  virtual void write();
179 
180  //- Update for changes of mesh
181  virtual void updateMesh(const mapPolyMesh&)
182  {}
183 
184  //- Update for changes of mesh
185  virtual void movePoints(const polyMesh&)
186  {}
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace Foam
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
volFields.H
Foam::cloudInfo::active_
bool active_
on/off switch
Definition: cloudInfo.H:124
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::cloudInfo::timeSet
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: cloudInfo.C:137
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::cloudInfo::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: cloudInfo.H:195
Foam::cloudInfo::name
virtual const word & name() const
Return name of the cloudInfo object.
Definition: cloudInfo.H:174
Foam::cloudInfo::log_
Switch log_
Switch to send output to Info as well.
Definition: cloudInfo.H:127
Foam::cloudInfo::write
virtual void write()
Write.
Definition: cloudInfo.C:143
Foam::cloudInfo::read
virtual void read(const dictionary &)
Read the field min/max data.
Definition: cloudInfo.C:83
Foam::cloudInfo::~cloudInfo
virtual ~cloudInfo()
Destructor.
Definition: cloudInfo.C:77
surfaceFields.H
Foam::surfaceFields.
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::cloudInfo::writeFileHeader
virtual void writeFileHeader(Ostream &os) const
File header information.
Definition: cloudInfo.C:40
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
pointFieldFwd.H
Foam::cloudInfo::end
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: cloudInfo.C:131
Foam::cloudInfo::TypeName
TypeName("cloudInfo")
Runtime type information.
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::cloudInfo::name_
word name_
Name of this set of cloudInfo object.
Definition: cloudInfo.H:118
functionObjectFile.H
Foam::cloudInfo::execute
virtual void execute()
Execute, currently does nothing.
Definition: cloudInfo.C:125
Foam::cloudInfo::movePoints
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: cloudInfo.H:199
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::functionObjectFile
Base class for output file data handling.
Definition: functionObjectFile.H:57
Foam::cloudInfo::cloudNames_
wordList cloudNames_
List of cloud names.
Definition: cloudInfo.H:130
Foam::cloudInfo
This function object outputs Lagrangian cloud information to a file. The current outputs include:
Definition: cloudInfo.H:109
Foam::cloudInfo::operator=
void operator=(const cloudInfo &)
Disallow default bitwise assignment.
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
PtrList.H
Foam::cloudInfo::cloudInfo
cloudInfo(const cloudInfo &)
Disallow default bitwise copy construct.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::cloudInfo::filePtrs_
PtrList< OFstream > filePtrs_
Output file per cloud.
Definition: cloudInfo.H:133
Foam::cloudInfo::obr_
const objectRegistry & obr_
Reference to the database.
Definition: cloudInfo.H:121