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-2024 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 
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 components
84  IOPosition(const IOobject&, const CloudType&);
85 
86  //- Construct from cloud
87  IOPosition(const CloudType&);
88 
89 
90  // Member Functions
91 
92  //- Inherit readData from regIOobject
94 
95  virtual void readData(Istream&, CloudType&);
96 
97  virtual bool write(const bool write = true) const;
98 
99  virtual bool writeData(Ostream& os) const;
100 };
101 
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 } // End namespace Foam
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 #ifdef NoRepository
110  #include "IOPosition.C"
111 #endif
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #endif
116 
117 // ************************************************************************* //
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:80
Helper IO class to read and write particle positions.
Definition: IOPosition.H:60
IOPosition(const IOobject &, const CloudType &)
Construct from components.
Definition: IOPosition.C:31
virtual bool writeData(Ostream &os) const
Pure virtual writaData function.
Definition: IOPosition.C:66
virtual bool write(const bool write=true) const
Write using setting from DB.
Definition: IOPosition.C:59
virtual bool readData(Istream &)
Inherit readData from regIOobject.
virtual const word & type() const
Definition: IOPosition.H:74
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
virtual bool readData(Istream &)
Virtual readData function.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
TemplateName(FvFaceCellWave)