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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::IOPosition
29
30Description
31 Helper IO class to read and write particle coordinates (positions).
32
33SourceFiles
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
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class IOPosition Declaration
51\*---------------------------------------------------------------------------*/
52
53template<class CloudType>
54class 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
66public:
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// ************************************************************************* //
Base cloud calls templated on particle type.
Definition: Cloud.H:68
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Helper IO class to read and write particle coordinates (positions).
Definition: IOPosition.H:56
virtual bool writeData(Ostream &os) const
Pure virtual writeData function.
Definition: IOPosition.C:64
virtual void readData(Istream &, CloudType &)
Definition: IOPosition.C:97
virtual const word & type() const
Runtime type name information. Use cloud type.
Definition: IOPosition.H:70
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
geometryType
Cloud geometry type (internal or IO representations)
Definition: cloud.H:75
@ COORDINATES
barycentric coordinates
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:76
virtual bool readData(Istream &)
Virtual readData function.
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()