meshSearch.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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef meshSearch_H
00038 #define meshSearch_H
00039
00040 #include "pointIndexHit.H"
00041 #include "Cloud.H"
00042 #include "passiveParticle.H"
00043
00044
00045
00046 namespace Foam
00047 {
00048
00049
00050 class polyMesh;
00051 class treeDataCell;
00052 class treeDataFace;
00053 class treeDataPoint;
00054 template<class Type> class indexedOctree;
00055
00056
00057
00058
00059
00060 class meshSearch
00061 {
00062
00063
00064
00065 const polyMesh& mesh_;
00066
00067
00068 const bool faceDecomp_;
00069
00070
00071 Cloud<passiveParticle> cloud_;
00072
00073
00074
00075 mutable indexedOctree<treeDataFace>* boundaryTreePtr_;
00076 mutable indexedOctree<treeDataCell>* cellTreePtr_;
00077 mutable indexedOctree<treeDataPoint>* cellCentreTreePtr_;
00078
00079
00080
00081
00082
00083 static bool findNearer
00084 (
00085 const point& sample,
00086 const pointField& points,
00087 label& nearestI,
00088 scalar& nearestDistSqr
00089 );
00090
00091
00092 static bool findNearer
00093 (
00094 const point& sample,
00095 const pointField& points,
00096 const labelList& indices,
00097 label& nearestI,
00098 scalar& nearestDistSqr
00099 );
00100
00101
00102
00103
00104
00105 label findNearestCellTree(const point&) const;
00106
00107
00108 label findNearestCellLinear(const point&) const;
00109
00110
00111
00112 label findNearestCellWalk(const point&, const label) const;
00113
00114
00115 label findCellLinear(const point&) const;
00116
00117
00118
00119
00120 label findNearestFaceTree(const point&) const;
00121
00122 label findNearestFaceLinear(const point&) const;
00123
00124 label findNearestFaceWalk(const point&, const label) const;
00125
00126
00127
00128
00129
00130
00131
00132 label findNearestBoundaryFaceWalk
00133 (
00134 const point& location,
00135 const label seedFaceI
00136 ) const;
00137
00138
00139
00140 vector offset
00141 (
00142 const point& bPoint,
00143 const label bFaceI,
00144 const vector& dir
00145 ) const;
00146
00147
00148
00149 meshSearch(const meshSearch&);
00150
00151
00152 void operator=(const meshSearch&);
00153
00154
00155 public:
00156
00157
00158 ClassName("meshSearch");
00159
00160
00161
00162
00163
00164 static scalar tol_;
00165
00166
00167
00168
00169
00170 meshSearch(const polyMesh& mesh, const bool faceDecomp = true);
00171
00172
00173
00174
00175 ~meshSearch();
00176
00177
00178
00179
00180
00181
00182 const polyMesh& mesh() const
00183 {
00184 return mesh_;
00185 }
00186
00187
00188
00189 const indexedOctree<treeDataFace>& boundaryTree() const;
00190
00191
00192 const indexedOctree<treeDataCell>& cellTree() const;
00193
00194
00195 const indexedOctree<treeDataPoint>& cellCentreTree() const;
00196
00197
00198
00199
00200
00201
00202 bool pointInCell(const point& p, const label celli) const;
00203
00204
00205
00206
00207
00208
00209 label findNearestCell
00210 (
00211 const point& location,
00212 const label seedCellI = -1,
00213 const bool useTreeSearch = true
00214 ) const;
00215
00216 label findNearestFace
00217 (
00218 const point& location,
00219 const label seedFaceI = -1,
00220 const bool useTreeSearch = true
00221 ) const;
00222
00223
00224
00225
00226
00227 label findCell
00228 (
00229 const point& location,
00230 const label seedCellI = -1,
00231 const bool useTreeSearch = true
00232 ) const;
00233
00234
00235
00236
00237
00238 label findNearestBoundaryFace
00239 (
00240 const point& location,
00241 const label seedFaceI = -1,
00242 const bool useTreeSearch = true
00243 ) const;
00244
00245
00246
00247 pointIndexHit intersection(const point& pStart, const point& pEnd)
00248 const;
00249
00250
00251
00252 List<pointIndexHit> intersections
00253 (
00254 const point& pStart,
00255 const point& pEnd
00256 ) const;
00257
00258
00259 bool isInside(const point&) const;
00260
00261
00262
00263 void clearOut();
00264
00265
00266 void correct();
00267 };
00268
00269
00270
00271
00272 }
00273
00274
00275
00276 #endif
00277
00278
Copyright © 2000-2009 OpenCFD Ltd