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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2017-2018 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::IOPosition
29 
30 Description
31  Helper IO class to read and write particle coordinates (positions).
32 
33 SourceFiles
34  IOPosition.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef IOPosition_H
39 #define IOPosition_H
40 
41 #include "cloud.H"
42 #include "regIOobject.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class IOPosition Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class CloudType>
54 class IOPosition
55 :
56  public regIOobject
57 {
58  // Private data
59 
60  cloud::geometryType geometryType_;
61 
62  //- Reference to the cloud
63  const CloudType& cloud_;
64 
65 
66 public:
67 
68  // Static data
69 
70  //- Runtime type name information. Use cloud type.
71  virtual const word& type() const
72  {
74  }
75 
76 
77  // Constructors
78 
79  //- Construct from cloud
81  (
82  const CloudType& c,
84  );
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 valid = 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 // ************************************************************************* //
regIOobject.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::IOPosition::writeData
virtual bool writeData(Ostream &os) const
Definition: IOPosition.C:64
cloud.H
IOPosition.C
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::cloud::geometryType::COORDINATES
barycentric coordinates
Foam::cloud::geometryType
geometryType
Cloud geometry type (internal or IO representations)
Definition: cloud.H:74
Foam::IOPosition::type
virtual const word & type() const
Runtime type name information. Use cloud type.
Definition: IOPosition.H:70
Foam::CloudType
DSMCCloud< dsmcParcel > CloudType
Definition: makeDSMCParcelBinaryCollisionModels.C:38
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::IOPosition::write
virtual bool write(const bool valid=true) const
Definition: IOPosition.C:57
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::IOPosition::IOPosition
IOPosition(const CloudType &c, cloud::geometryType geomType=cloud::geometryType::COORDINATES)
Construct from cloud.
Definition: IOPosition.C:33
Foam::Cloud
Base cloud calls templated on particle type.
Definition: Cloud.H:55
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::regIOobject::readData
virtual bool readData(Istream &)
Virtual readData function.
Definition: regIOobjectRead.C:185
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::IOPosition::readData
virtual void readData(Istream &, CloudType &)
Definition: IOPosition.C:97