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