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  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "referredWallFace.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
34 (
35  const face& f,
36  const pointField& pts,
37  label patchi
38 )
39 :
40  face(f),
41  pts_(pts),
42  patchi_(patchi)
43 {
44  if (face::size() != pts_.size())
45  {
47  << "Face and pointField are not the same size." << nl
48  << (*this) << nl
49  << abort(FatalError);
50  }
51 }
52 
53 
54 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
55 
57 {
58  return
59  (
60  static_cast<const face&>(rhs) == static_cast<face>(*this)
61  && rhs.pts_ == pts_
62  && rhs.patchi_ == patchi_
63  );
64 }
65 
66 
68 {
69  return !(*this == rhs);
70 }
71 
72 
73 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
74 
76 {
77  is >> static_cast<face&>(rWF) >> rWF.pts_ >> rWF.patchi_;
78 
79  is.check(FUNCTION_NAME);
80  return is;
81 }
82 
83 
85 {
86  os << static_cast<const face&>(rWF) << token::SPACE
87  << rWF.pts_ << token::SPACE
88  << rWF.patchi_;
89 
90  os.check(FUNCTION_NAME);
91  return os;
92 }
93 
94 
95 // ************************************************************************* //
referredWallFace.H
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:230
Foam::referredWallFace::operator==
bool operator==(const referredWallFace &) const
Definition: referredWallFace.C:56
Foam::referredWallFace::operator!=
bool operator!=(const referredWallFace &) const
Definition: referredWallFace.C:67
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
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
Storage for referred wall faces. Stores patch index, face and associated points.
Definition: referredWallFace.H:59
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:144
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
Foam::nl
constexpr char nl
Definition: Ostream.H:385
f
labelList f(nPoints)
Foam::token::SPACE
Space [isspace].
Definition: token.H:117
FUNCTION_NAME
#define FUNCTION_NAME
Definition: messageStream.H:270
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:72
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::referredWallFace::referredWallFace
referredWallFace()=default
Default construct.