1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 Foam::Pstream::commsStruct::commsStruct()
40 Foam::Pstream::commsStruct::commsStruct
43 const labelList& below,
44 const labelList& allBelow,
45 const labelList& allNotBelow
51 allNotBelow_(allNotBelow)
55 Foam::Pstream::commsStruct::commsStruct
60 const labelList& below,
61 const labelList& allBelow
67 allNotBelow_(nProcs - allBelow.size() - 1)
69 boolList inBelow(nProcs, false);
71 forAll(allBelow, belowI)
73 inBelow[allBelow[belowI]] = true;
77 forAll(inBelow, procI)
79 if ((procI != myProcID) && !inBelow[procI])
81 allNotBelow_[notI++] = procI;
84 if (notI != allNotBelow_.size())
86 FatalErrorIn("commsStruct") << "problem!" << Foam::abort(FatalError);
91 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
93 bool Foam::Pstream::commsStruct::operator==(const commsStruct& comm) const
97 (above_ == comm.above())
98 && (below_ == comm.below())
99 && (allBelow_ == allBelow())
100 && (allNotBelow_ == allNotBelow())
105 bool Foam::Pstream::commsStruct::operator!=(const commsStruct& comm) const
107 return !operator==(comm);
111 // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
113 Foam::Ostream& Foam::operator<<(Ostream& os, const Pstream::commsStruct& comm)
115 os << comm.above_ << token::SPACE
116 << comm.below_ << token::SPACE
117 << comm.allBelow_ << token::SPACE
118 << comm.allNotBelow_;
122 "Ostream& operator<<(Ostream&, const commsStruct&)"
129 // ************************************************************************* //