volumeType.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-2019 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::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 
99  // Member Functions
101  operator type() const
102  {
103  return t_;
104  }
105 
106 
107  // IOstream Operators
108 
109  friend Istream& operator>>(Istream& is, volumeType& vt);
110  friend Ostream& operator<<(Ostream& os, const volumeType& vt);
111 };
112 
113 
114 //- Data associated with volumeType type are contiguous
115 template<>
116 inline bool contiguous<volumeType>() {return true;}
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
type
Volume types.
Definition: volumeType.H:59
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Initialise the NamedEnum HashTable from the static list of names.
Definition: NamedEnum.H:51
friend Ostream & operator<<(Ostream &os, const volumeType &vt)
friend Istream & operator>>(Istream &is, volumeType &vt)
Istream & operator>>(Istream &, directionInfo &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Ostream & operator<<(Ostream &, const ensightPart &)
volumeType()
Construct null.
Definition: volumeType.H:86
static const NamedEnum< volumeType, 4 > names
Definition: volumeType.H:80
bool contiguous< volumeType >()
Data associated with volumeType type are contiguous.
Definition: volumeType.H:115
Namespace for OpenFOAM.