IOPosition.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) 2011-2016 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::IOPosition
26 
27 Description
28  Helper IO class to read and write particle positions
29 
30 SourceFiles
31  IOPosition.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef IOPosition_H
36 #define IOPosition_H
37 
38 #include "regIOobject.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class IOPosition Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class CloudType>
50 class IOPosition
51 :
52  public regIOobject
53 {
54 
55  // Private data
56 
57  //- Reference to the cloud
58  const CloudType& cloud_;
59 
60 
61 public:
62 
63  // Static data
64 
65  //- Runtime type name information. Use cloud type.
66  virtual const word& type() const
67  {
69  }
70 
71 
72  // Constructors
73 
74  //- Construct from cloud
75  IOPosition(const CloudType&);
76 
77 
78  // Member functions
79 
80  //- Inherit readData from regIOobject
82 
83  virtual void readData(CloudType& c, bool checkClass);
84 
85  virtual bool write() const;
86 
87  virtual bool writeData(Ostream& os) const;
88 };
89 
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 } // End namespace Foam
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 #ifdef NoRepository
98  #include "IOPosition.C"
99 #endif
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 #endif
104 
105 // ************************************************************************* //
DSMCCloud< dsmcParcel > CloudType
virtual const word & type() const
Runtime type name information. Use cloud type.
Definition: IOPosition.H:65
virtual void readData(CloudType &c, bool checkClass)
Definition: IOPosition.C:82
A class for handling words, derived from string.
Definition: word.H:59
virtual bool writeData(Ostream &os) const
Pure virtual writaData function.
Definition: IOPosition.C:65
Base cloud calls templated on particle type.
Definition: Cloud.H:52
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
IOPosition(const CloudType &)
Construct from cloud.
Definition: IOPosition.C:31
virtual bool readData(Istream &)
Virtual readData function.
virtual bool write() const
Write using setting from DB.
Definition: IOPosition.C:51
const dimensionedScalar c
Speed of light in a vacuum.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Namespace for OpenFOAM.