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