receivingReferralList.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "receivingReferralList.H"
00028
00029
00030
00031
00032 Foam::receivingReferralList::receivingReferralList()
00033 :
00034 labelListList(),
00035 sourceProc_(-1)
00036 {}
00037
00038
00039 Foam::receivingReferralList::receivingReferralList
00040 (
00041 const label sourceProc,
00042 const labelListList& refCellsToSendTo
00043 )
00044 :
00045 labelListList(refCellsToSendTo),
00046 sourceProc_(sourceProc)
00047 {}
00048
00049
00050 Foam::receivingReferralList::receivingReferralList
00051 (
00052 const receivingReferralList& rL
00053 )
00054 :
00055 labelListList(rL),
00056 sourceProc_(rL.sourceProc())
00057 {}
00058
00059
00060
00061
00062 Foam::receivingReferralList::~receivingReferralList()
00063 {}
00064
00065
00066
00067
00068 void Foam::receivingReferralList::operator=(const receivingReferralList& rhs)
00069 {
00070
00071 if (this == &rhs)
00072 {
00073 FatalErrorIn
00074 (
00075 "Foam::receivingReferralList::operator="
00076 "(const Foam::receivingReferralList&)"
00077 )
00078 << "Attempted assignment to self"
00079 << abort(FatalError);
00080 }
00081
00082 labelListList::operator=(rhs);
00083
00084 sourceProc_ = rhs.sourceProc();
00085 }
00086
00087
00088
00089
00090 bool operator==
00091 (
00092 const Foam::receivingReferralList& a,
00093 const Foam::receivingReferralList& b
00094 )
00095 {
00096
00097 if (a.size() != b.size())
00098 {
00099 return false;
00100 }
00101
00102
00103 if (a.sourceProc() != b.sourceProc())
00104 {
00105 return false;
00106 }
00107
00108 Foam::List<bool> fnd(a.size(), false);
00109
00110 forAll (b, bI)
00111 {
00112 Foam::labelList curLList = b[bI];
00113
00114 bool found = false;
00115
00116 forAll (a, aI)
00117 {
00118 if (a[aI] == curLList)
00119 {
00120 found = true;
00121 fnd[aI] = true;
00122 break;
00123 }
00124 }
00125
00126 if (!found)
00127 {
00128 return false;
00129 }
00130 }
00131
00132
00133 bool result = true;
00134
00135 forAll (fnd, aI)
00136 {
00137 result = (result && fnd[aI]);
00138 }
00139
00140 return result;
00141 }
00142
00143
00144 Foam::Istream& Foam::operator>>(Istream& is, receivingReferralList& rRL)
00145 {
00146 is >> rRL.sourceProc_ >> static_cast<labelListList&>(rRL);
00147
00148 is.check
00149 (
00150 "Istream& operator<<(Istream& f, const receivingReferralList& rRL"
00151 );
00152
00153 return is;
00154 }
00155
00156
00157 Foam::Ostream& Foam::operator<<
00158 (
00159 Ostream& os,
00160 const receivingReferralList& rRL
00161 )
00162 {
00163 os << rRL.sourceProc() << token::SPACE
00164 << static_cast< const labelListList& >(rRL);
00165
00166 os.check
00167 (
00168 "Ostream& operator<<(Ostream& f, const receivingReferralList& rRL"
00169 );
00170
00171 return os;
00172 }
00173
00174
00175
Copyright © 2000-2009 OpenCFD Ltd