IOPosition.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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 IOPositionName Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 TemplateName(IOPosition);
50 
51 
52 /*---------------------------------------------------------------------------*\
53  Class IOPosition Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class CloudType>
57 class IOPosition
58 :
59  public regIOobject,
60  public IOPositionName
61 {
62 
63  // Private Data
64 
65  //- Reference to the cloud
66  const CloudType& cloud_;
67 
68 
69 public:
70 
71  //- Type information
72 
73  using IOPositionName::typeName;
74 
75  virtual const word& type() const
76  {
77  return IOPositionName::typeName;
78  }
79 
80 
81  // Constructors
82 
83  //- Construct from cloud
84  IOPosition(const CloudType&);
85 
86 
87  // Member Functions
88 
89  //- Inherit readData from regIOobject
91 
92  virtual void readData(Istream&, CloudType&);
93 
94  virtual bool write(const bool write = true) const;
95 
96  virtual bool writeData(Ostream& os) const;
97 };
98 
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 } // End namespace Foam
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 #ifdef NoRepository
107  #include "IOPosition.C"
108 #endif
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #endif
113 
114 // ************************************************************************* //
TemplateName(blendedSchemeBase)
DSMCCloud< dsmcParcel > CloudType
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
A class for handling words, derived from string.
Definition: word.H:59
virtual bool write(const bool write=true) const
Write using setting from DB.
Definition: IOPosition.C:52
virtual bool writeData(Ostream &os) const
Pure virtual writaData function.
Definition: IOPosition.C:59
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
IOPosition(const CloudType &)
Construct from cloud.
Definition: IOPosition.C:32
virtual bool readData(Istream &)
Virtual readData function.
virtual const word & type() const
Definition: IOPosition.H:74
virtual void readData(Istream &, CloudType &)
Definition: IOPosition.C:76
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Namespace for OpenFOAM.