Loading...
Searching...
No Matches
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/>.
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 {
46 FatalErrorInFunction
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
69 return !(*this == rhs);
70}
71
72
73// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
74
75Foam::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
84Foam::Ostream& Foam::operator<<(Ostream& os, const referredWallFace& rWF)
85{
87 << rWF.pts_ << token::SPACE
88 << rWF.patchi_;
89
90 os.check(FUNCTION_NAME);
91 return os;
92}
93
94
95// ************************************************************************* //
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:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
void size(const label n)
Definition UList.H:118
A face is a list of labels corresponding to mesh vertices.
Definition face.H:71
constexpr face() noexcept=default
Default construct.
Storage for referred wall faces. Stores patch index, face and associated points.
bool operator!=(const referredWallFace &) const
bool operator==(const referredWallFace &) const
referredWallFace()=default
Default construct.
@ SPACE
Space [isspace].
Definition token.H:144
OBJstream os(runTime.globalPath()/outputName)
#define FUNCTION_NAME
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
vectorField pointField
pointField is a vectorField.
labelList f(nPoints)
const pointField & pts