sumDataI.H
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 "polyMesh.H"
00028
00029
00030
00031
00032
00033
00034
00035 inline Foam::sumData::sumData()
00036 :
00037 oldFace_(-1),
00038 sum_(0.0),
00039 count_(0)
00040 {}
00041
00042
00043
00044 inline Foam::sumData::sumData
00045 (
00046 const label oldFace,
00047 const scalar sum,
00048 const label count
00049 )
00050 :
00051 oldFace_(oldFace),
00052 sum_(sum),
00053 count_(count)
00054 {}
00055
00056
00057
00058
00059 inline bool Foam::sumData::valid() const
00060 {
00061 return oldFace_ != -1;
00062 }
00063
00064
00065
00066 inline bool Foam::sumData::sameGeometry
00067 (
00068 const polyMesh&,
00069 const sumData&,
00070 const scalar
00071 ) const
00072 {
00073 return true;
00074 }
00075
00076
00077
00078 inline void Foam::sumData::leaveDomain
00079 (
00080 const polyMesh&,
00081 const polyPatch& patch,
00082 const label patchFaceI,
00083 const point& faceCentre
00084 )
00085 {}
00086
00087
00088
00089 inline void Foam::sumData::transform
00090 (
00091 const polyMesh&,
00092 const tensor& rotTensor
00093 )
00094 {}
00095
00096
00097
00098 inline void Foam::sumData::enterDomain
00099 (
00100 const polyMesh&,
00101 const polyPatch& patch,
00102 const label patchFaceI,
00103 const point& faceCentre
00104 )
00105 {
00106 oldFace_ = -1;
00107 }
00108
00109
00110
00111 inline bool Foam::sumData::updateCell
00112 (
00113 const polyMesh&,
00114 const label thisCellI,
00115 const label neighbourFaceI,
00116 const sumData& neighbourInfo,
00117 const scalar tol
00118 )
00119 {
00120 if (!valid())
00121 {
00122 FatalErrorIn("sumData::updateCell") << "problem"
00123 << abort(FatalError);
00124 return false;
00125 }
00126
00127
00128 if (count_ == 0)
00129 {
00130 sum_ += neighbourInfo.sum();
00131 count_ = neighbourInfo.count() + 1;
00132 oldFace_ = neighbourFaceI;
00133 return true;
00134 }
00135 else
00136 {
00137 return false;
00138 }
00139 }
00140
00141
00142
00143 inline bool Foam::sumData::updateFace
00144 (
00145 const polyMesh& mesh,
00146 const label thisFaceI,
00147 const label neighbourCellI,
00148 const sumData& neighbourInfo,
00149 const scalar tol
00150 )
00151 {
00152
00153
00154
00155 const cell& cFaces = mesh.cells()[neighbourCellI];
00156
00157 label wantedFaceI = cFaces.opposingFaceLabel
00158 (
00159 neighbourInfo.oldFace(),
00160 mesh.faces()
00161 );
00162
00163 if (thisFaceI == wantedFaceI)
00164 {
00165 if (count_ != 0)
00166 {
00167 FatalErrorIn("sumData::updateFace") << "problem"
00168 << abort(FatalError);
00169 return false;
00170 }
00171
00172 sum_ += neighbourInfo.sum();
00173 count_ = neighbourInfo.count();
00174 oldFace_ = thisFaceI;
00175 return true;
00176 }
00177 else
00178 {
00179 return false;
00180 }
00181 }
00182
00183
00184
00185 inline bool Foam::sumData::updateFace
00186 (
00187 const polyMesh&,
00188 const label thisFaceI,
00189 const sumData& neighbourInfo,
00190 const scalar tol
00191 )
00192 {
00193
00194 if (count_ == 0)
00195 {
00196 sum_ += neighbourInfo.sum();
00197 count_ = neighbourInfo.count();
00198 oldFace_ = thisFaceI;
00199 return true;
00200 }
00201 else
00202 {
00203 return false;
00204 }
00205 }
00206
00207
00208
00209
00210 inline bool Foam::sumData::operator==(const Foam::sumData& rhs)
00211 const
00212 {
00213 return
00214 oldFace() == rhs.oldFace()
00215 && sum() == rhs.sum()
00216 && count() == rhs.count();
00217 }
00218
00219
00220 inline bool Foam::sumData::operator!=(const Foam::sumData& rhs)
00221 const
00222 {
00223 return !(*this == rhs);
00224 }
00225
00226
00227
Copyright © 2000-2009 OpenCFD Ltd