volumeType.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-2014 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
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::volumeType
26 
27 Description
28 
29 SourceFiles
30  volumeType.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef volumeType_H
35 #define volumeType_H
36 
37 #include "NamedEnum.H"
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 // Forward declaration of friend functions and operators
45 
46 class volumeType;
47 Istream& operator>>(Istream& is, volumeType&);
48 Ostream& operator<<(Ostream& os, const volumeType& C);
49 
50 
51 /*---------------------------------------------------------------------------*\
52  Class volumeType Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class volumeType
56 {
57 public:
58 
59  //- Volume types
60  enum type
61  {
62  UNKNOWN = 0,
63  MIXED = 1,
64  INSIDE = 2,
65  OUTSIDE = 3
66  };
67 
68 
69 private:
70 
71  // Private data
72 
73  //- Volume type
74  type t_;
75 
76 
77 public:
78 
79  // Static data
80 
81  static const NamedEnum<volumeType, 4> names;
82 
83 
84  // Constructors
85 
86  //- Construct null
87  volumeType()
88  :
89  t_(UNKNOWN)
90  {}
91 
92  //- Construct from components
93  volumeType(type t)
94  :
95  t_(t)
96  {}
97 
98  //- Construct from integer
99  explicit volumeType(const int t)
100  :
101  t_(static_cast<volumeType::type>(t))
102  {}
103 
104 
105  // Member Functions
106 
107  operator type() const
108  {
109  return t_;
110  }
111 
112 
113  // IOstream operators
114 
115  friend Istream& operator>>(Istream& is, volumeType& vt);
116  friend Ostream& operator<<(Ostream& os, const volumeType& vt);
117 };
118 
119 
120 //- Data associated with volumeType type are contiguous
121 template<>
122 inline bool contiguous<volumeType>() {return true;}
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
Foam::volumeType::MIXED
@ MIXED
Definition: volumeType.H:62
Foam::volumeType::OUTSIDE
@ OUTSIDE
Definition: volumeType.H:64
Foam::volumeType::INSIDE
@ INSIDE
Definition: volumeType.H:63
NamedEnum.H
Foam::volumeType::volumeType
volumeType(const int t)
Construct from integer.
Definition: volumeType.H:98
Foam::volumeType::operator>>
friend Istream & operator>>(Istream &is, volumeType &vt)
C
volScalarField & C
Definition: readThermalProperties.H:104
Foam::volumeType::names
static const NamedEnum< volumeType, 4 > names
Definition: volumeType.H:80
Foam::volumeType::operator<<
friend Ostream & operator<<(Ostream &os, const volumeType &vt)
Foam::volumeType
Definition: volumeType.H:54
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::contiguous< volumeType >
bool contiguous< volumeType >()
Data associated with volumeType type are contiguous.
Definition: volumeType.H:121
Foam::operator<<
Ostream & operator<<(Ostream &, const edgeMesh &)
Definition: edgeMeshIO.C:130
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::volumeType::type
type
Volume types.
Definition: volumeType.H:59
Foam::volumeType::t_
type t_
Volume type.
Definition: volumeType.H:73
Foam::operator>>
Istream & operator>>(Istream &, edgeMesh &)
Definition: edgeMeshIO.C:141
Foam::volumeType::volumeType
volumeType()
Construct null.
Definition: volumeType.H:86
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::volumeType::UNKNOWN
@ UNKNOWN
Definition: volumeType.H:61
Foam::volumeType::volumeType
volumeType(type t)
Construct from components.
Definition: volumeType.H:92
Foam::NamedEnum
Initialise the NamedEnum HashTable from the static list of names.
Definition: NamedEnum.H:52