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-------------------------------------------------------------------------------
11License
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
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
91 return os;
92}
93
94
95// ************************************************************************* //
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:58
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
Storage for referred wall faces. Stores patch index, face and associated points.
referredWallFace()=default
Default construct.
friend bool operator!=(const refineCell &rc1, const refineCell &rc2)
Definition: refineCell.H:106
friend bool operator==(const refineCell &rc1, const refineCell &rc2)
Definition: refineCell.H:97
@ SPACE
Space [isspace].
Definition: token.H:125
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
OBJstream os(runTime.globalPath()/outputName)
#define FUNCTION_NAME
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)
errorManip< error > abort(error &err)
Definition: errorManip.H:144
error FatalError
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
labelList f(nPoints)