ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / lagrangian / basic / InteractionLists / referredWallFace / referredWallFace.C
blobb6e8c91da63d32b7a73d381821fb087ff7b1117c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "referredWallFace.H"
28 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
30 Foam::referredWallFace::referredWallFace()
32     face(),
33     pts_(),
34     patchI_()
38 Foam::referredWallFace::referredWallFace
40     const face& f,
41     const pointField& pts,
42     label patchI
45     face(f),
46     pts_(pts),
47     patchI_(patchI)
49     if (this->size() != pts_.size())
50     {
51         FatalErrorIn
52         (
53             "Foam::referredWallFace::referredWallFace"
54             "("
55                 "const face& f, "
56                 "const pointField& pts, "
57                 "label patchI"
58             ")"
59         )   << "Face and pointField are not the same size. " << nl << (*this)
60             << abort(FatalError);
61     }
65 Foam::referredWallFace::referredWallFace(const referredWallFace& rWF)
67     face(rWF),
68     pts_(rWF.pts_),
69     patchI_(rWF.patchI_)
71     if (this->size() != pts_.size())
72     {
73         FatalErrorIn
74         (
75             "Foam::referredWallFace::referredWallFace"
76             "("
77                 "const referredWallFace& rWF"
78             ")"
79         )   << "Face and pointField are not the same size. " << nl << (*this)
80             << abort(FatalError);
81     }
85 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
87 Foam::referredWallFace::~referredWallFace()
91 // * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * * //
93 bool Foam::referredWallFace::operator==(const referredWallFace& rhs) const
95     return
96     (
97         static_cast<const face&>(rhs) == static_cast<face>(*this)
98      && rhs.pts_ == pts_
99      && rhs.patchI_ == patchI_
100     );
104 bool Foam::referredWallFace::operator!=(const referredWallFace& rhs) const
106     return !(*this == rhs);
110 // * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
112 Foam::Istream& Foam::operator>>(Istream& is, referredWallFace& rWF)
114     is  >> static_cast<face&>(rWF) >> rWF.pts_ >> rWF.patchI_;
116     // Check state of Istream
117     is.check
118     (
119         "Foam::Istream& "
120         "Foam::operator>>(Foam::Istream&, Foam::referredWallFace&)"
121     );
123     return is;
127 Foam::Ostream& Foam::operator<<(Ostream& os, const referredWallFace& rWF)
129     os  << static_cast<const face&>(rWF) << token::SPACE
130         << rWF.pts_ << token::SPACE
131         << rWF.patchI_;
133     // Check state of Ostream
134     os.check
135     (
136         "Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
137         "const Foam::referredWallFace&)"
138     );
140     return os;
144 // ************************************************************************* //