referredWallFace.C
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-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "referredWallFace.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
33 :
34  face(),
35  pts_(),
36  patchi_()
37 {}
38 
39 
41 (
42  const face& f,
43  const pointField& pts,
44  label patchi
45 )
46 :
47  face(f),
48  pts_(pts),
49  patchi_(patchi)
50 {
51  if (this->size() != pts_.size())
52  {
54  << "Face and pointField are not the same size. " << nl << (*this)
55  << abort(FatalError);
56  }
57 }
58 
59 
61 :
62  face(rWF),
63  pts_(rWF.pts_),
64  patchi_(rWF.patchi_)
65 {
66  if (this->size() != pts_.size())
67  {
69  << "Face and pointField are not the same size. " << nl << (*this)
70  << abort(FatalError);
71  }
72 }
73 
74 
75 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
76 
78 {}
79 
80 
81 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
82 
84 {
85  return
86  (
87  static_cast<const face&>(rhs) == static_cast<face>(*this)
88  && rhs.pts_ == pts_
89  && rhs.patchi_ == patchi_
90  );
91 }
92 
93 
95 {
96  return !(*this == rhs);
97 }
98 
99 
100 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
101 
103 {
104  is >> static_cast<face&>(rWF) >> rWF.pts_ >> rWF.patchi_;
105 
106  is.check(FUNCTION_NAME);
107  return is;
108 }
109 
110 
112 {
113  os << static_cast<const face&>(rWF) << token::SPACE
114  << rWF.pts_ << token::SPACE
115  << rWF.patchi_;
116 
117  os.check(FUNCTION_NAME);
118  return os;
119 }
120 
121 
122 // ************************************************************************* //
referredWallFace.H
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:228
Foam::referredWallFace::operator==
bool operator==(const referredWallFace &) const
Definition: referredWallFace.C:83
Foam::referredWallFace::operator!=
bool operator!=(const referredWallFace &) const
Definition: referredWallFace.C:94
Foam::referredWallFace::~referredWallFace
~referredWallFace()
Destructor.
Definition: referredWallFace.C:77
Foam::label
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:62
Foam::Field< vector >
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::referredWallFace::referredWallFace
referredWallFace()
Construct null.
Definition: referredWallFace.C:32
Foam::referredWallFace
Storage for referred wall faces. Stores patch index, face and associated points.
Definition: referredWallFace.H:63
Foam::IOstream::check
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:51
Foam::FatalError
error FatalError
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:137
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:355
Foam::nl
constexpr char nl
Definition: Ostream.H:372
f
labelList f(nPoints)
Foam::token::SPACE
Space [isspace].
Definition: token.H:112
FUNCTION_NAME
#define FUNCTION_NAME
Definition: messageStream.H:261
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:74
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &)
Definition: boundaryPatch.C:102