referredWallFace.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-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 \*---------------------------------------------------------------------------*/
25 
26 #include "referredWallFace.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
31 :
32  face(),
33  pts_(),
34  patchi_()
35 {}
36 
37 
39 (
40  const face& f,
41  const pointField& pts,
42  label patchi
43 )
44 :
45  face(f),
46  pts_(pts),
47  patchi_(patchi)
48 {
49  if (this->size() != pts_.size())
50  {
52  << "Face and pointField are not the same size. " << nl << (*this)
53  << abort(FatalError);
54  }
55 }
56 
57 
58 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
59 
61 {}
62 
63 
64 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
65 
67 {
68  return
69  (
70  static_cast<const face&>(rhs) == static_cast<face>(*this)
71  && rhs.pts_ == pts_
72  && rhs.patchi_ == patchi_
73  );
74 }
75 
76 
78 {
79  return !(*this == rhs);
80 }
81 
82 
83 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
84 
86 {
87  is >> static_cast<face&>(rWF) >> rWF.pts_ >> rWF.patchi_;
88 
89  // Check state of Istream
90  is.check
91  (
92  "Foam::Istream& "
93  "Foam::operator>>(Foam::Istream&, Foam::referredWallFace&)"
94  );
95 
96  return is;
97 }
98 
99 
101 {
102  os << static_cast<const face&>(rWF) << token::SPACE
103  << rWF.pts_ << token::SPACE
104  << rWF.patchi_;
105 
106  // Check state of Ostream
107  os.check
108  (
109  "Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
110  "const Foam::referredWallFace&)"
111  );
112 
113  return os;
114 }
115 
116 
117 // ************************************************************************* //
referredWallFace()
Construct null.
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
error FatalError
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:306
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:92
face()
Construct null.
Definition: faceI.H:28
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
Storage for referred wall faces. Stores patch index, face and associated points.
~referredWallFace()
Destructor.
bool operator==(const referredWallFace &) const
bool operator!=(const referredWallFace &) const
Istream & operator>>(Istream &, directionInfo &)
errorManip< error > abort(error &err)
Definition: errorManip.H:131
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
static const char nl
Definition: Ostream.H:260
Ostream & operator<<(Ostream &, const ensightPart &)
label size() const
Return the number of elements in the UList.
Definition: ListI.H:171