All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WallSiteData.C
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-2018 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 \*---------------------------------------------------------------------------*/
25 
26 #include "WallSiteData.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class Type>
32 :
33  patchi_(),
34  wallData_()
35 {}
36 
37 
38 template<class Type>
40 (
41  label patchi,
42  const Type& wallData
43 )
44 :
45  patchi_(patchi),
46  wallData_(wallData)
47 {}
48 
49 
50 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
51 
52 template<class Type>
54 {}
55 
56 
57 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
58 
59 template<class Type>
60 bool Foam::WallSiteData<Type>::operator==
61 (
62  const WallSiteData<Type>& rhs
63 ) const
64 {
65  return patchi_ == rhs.patchi_ && wallData_ == rhs.wallData_;
66 }
67 
68 
69 template<class Type>
70 bool Foam::WallSiteData<Type>::operator!=
71 (
72  const WallSiteData<Type>& rhs
73 ) const
74 {
75  return !(*this == rhs);
76 }
77 
78 
79 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
80 
81 template<class Type>
82 Foam::Istream& Foam::operator>>
83 (
84  Istream& is,
86 )
87 {
88  is >> wIS.patchi_ >> wIS.wallData_;
89 
90  // Check state of Istream
91  is.check
92  (
93  "Foam::Istream& Foam::operator>>"
94  "(Foam::Istream&, Foam::WallSiteData<Type>&)"
95  );
96 
97  return is;
98 }
99 
100 
101 template<class Type>
102 Foam::Ostream& Foam::operator<<
103 (
104  Ostream& os,
105  const WallSiteData<Type>& wIS
106 )
107 {
108  os << wIS.patchi_ << token::SPACE << wIS.wallData_;
109 
110  // Check state of Ostream
111  os.check
112  (
113  "Foam::Ostream& Foam::operator<<"
114  "(Ostream&, const WallSiteData<Type>&)"
115  );
116 
117  return os;
118 }
119 
120 
121 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:92
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Stores the patch ID and templated data to represent a collision with a wall to be passed to the wall ...
Definition: WallSiteData.H:50
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
WallSiteData()
Construct null.
Definition: WallSiteData.C:31
~WallSiteData()
Destructor.
Definition: WallSiteData.C:53