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
50  }
51 }
52 
53 
54 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
55 
56 bool Foam::referredWallFace::operator==(const referredWallFace& rhs) const
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 
75 Foam::Istream& Foam::operator>>(Istream& is, referredWallFace& rWF)
76 {
77  is >> static_cast<face&>(rWF) >> rWF.pts_ >> rWF.patchi_;
78 
79  is.check(FUNCTION_NAME);
80  return is;
81 }
82 
83 
84 Foam::Ostream& Foam::operator<<(Ostream& os, const referredWallFace& rWF)
85 {
86  os << static_cast<const face&>(rWF) << token::SPACE
87  << rWF.pts_ << token::SPACE
88  << rWF.patchi_;
89 
91  return os;
92 }
93 
94 
95 // ************************************************************************* //
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:116
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:68
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:45
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
Storage for referred wall faces. Stores patch index, face and associated points.
referredWallFace()=default
Default construct.
bool operator==(const referredWallFace &) const
bool operator!=(const referredWallFace &) const
Istream & operator>>(Istream &, directionInfo &)
Space [isspace].
Definition: token.H:131
errorManip< error > abort(error &err)
Definition: errorManip.H:139
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
label size() const noexcept
The number of elements in the container.
Definition: UList.H:671
OBJstream os(runTime.globalPath()/outputName)
#define FUNCTION_NAME
labelList f(nPoints)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:77
const pointField & pts