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 #ifndef meshTools_H
00037 #define meshTools_H
00038
00039 #include "label.H"
00040 #include "vector.H"
00041 #include "labelList.H"
00042 #include "pointField.H"
00043 #include "faceList.H"
00044 #include "cellList.H"
00045 #include "primitivePatch.H"
00046
00047
00048
00049 namespace Foam
00050 {
00051
00052 class primitiveMesh;
00053 class polyMesh;
00054
00055
00056
00057
00058
00059 namespace meshTools
00060 {
00061
00062
00063 static const label mXmYmZ = 0;
00064 static const label pXmYmZ = 1;
00065 static const label mXpYmZ = 2;
00066 static const label pXpYmZ = 3;
00067
00068 static const label mXmYpZ = 4;
00069 static const label pXmYpZ = 5;
00070 static const label mXpYpZ = 6;
00071 static const label pXpYpZ = 7;
00072
00073 static const label mXmYmZMask = 1 << mXmYmZ;
00074 static const label pXmYmZMask = 1 << pXmYmZ;
00075 static const label mXpYmZMask = 1 << mXpYmZ;
00076 static const label pXpYmZMask = 1 << pXpYmZ;
00077
00078 static const label mXmYpZMask = 1 << mXmYpZ;
00079 static const label pXmYpZMask = 1 << pXmYpZ;
00080 static const label mXpYpZMask = 1 << mXpYpZ;
00081 static const label pXpYpZMask = 1 << pXpYpZ;
00082
00083
00084
00085
00086
00087 bool visNormal
00088 (
00089 const vector& n,
00090 const vectorField& faceNormals,
00091 const labelList& faceLabels
00092 );
00093
00094
00095
00096 vectorField calcBoxPointNormals(const primitivePatch& pp);
00097
00098
00099 vector normEdgeVec(const primitiveMesh&, const label edgeI);
00100
00101
00102
00103
00104
00105 void writeOBJ
00106 (
00107 Ostream& os,
00108 const point& pt
00109 );
00110
00111
00112 void writeOBJ
00113 (
00114 Ostream& os,
00115 const faceList&,
00116 const pointField&,
00117 const labelList& faceLabels
00118 );
00119
00120
00121 void writeOBJ
00122 (
00123 Ostream& os,
00124 const faceList&,
00125 const pointField&
00126 );
00127
00128
00129 void writeOBJ
00130 (
00131 Ostream& os,
00132 const cellList&,
00133 const faceList&,
00134 const pointField&,
00135 const labelList& cellLabels
00136 );
00137
00138
00139
00140
00141
00142 bool edgeOnCell
00143 (
00144 const primitiveMesh&,
00145 const label cellI,
00146 const label edgeI
00147 );
00148
00149
00150 bool edgeOnFace
00151 (
00152 const primitiveMesh&,
00153 const label faceI,
00154 const label edgeI
00155 );
00156
00157
00158 bool faceOnCell
00159 (
00160 const primitiveMesh&,
00161 const label cellI,
00162 const label faceI
00163 );
00164
00165
00166 label findEdge
00167 (
00168 const edgeList& edges,
00169 const labelList& candidates,
00170 const label v0,
00171 const label v1
00172 );
00173
00174
00175 label findEdge
00176 (
00177 const primitiveMesh&,
00178 const label v0,
00179 const label v1
00180 );
00181
00182
00183 label getSharedEdge
00184 (
00185 const primitiveMesh&,
00186 const label f0,
00187 const label f1
00188 );
00189
00190
00191 label getSharedFace
00192 (
00193 const primitiveMesh&,
00194 const label cell0,
00195 const label cell1
00196 );
00197
00198
00199 void getEdgeFaces
00200 (
00201 const primitiveMesh&,
00202 const label cellI,
00203 const label edgeI,
00204 label& face0,
00205 label& face1
00206 );
00207
00208
00209
00210 label otherEdge
00211 (
00212 const primitiveMesh&,
00213 const labelList& edgeLabels,
00214 const label edgeI,
00215 const label vertI
00216 );
00217
00218
00219
00220 label otherFace
00221 (
00222 const primitiveMesh&,
00223 const label cellI,
00224 const label faceI,
00225 const label edgeI
00226 );
00227
00228
00229
00230 label otherCell
00231 (
00232 const primitiveMesh&,
00233 const label cellI,
00234 const label faceI
00235 );
00236
00237
00238
00239 label walkFace
00240 (
00241 const primitiveMesh&,
00242 const label faceI,
00243 const label startEdgeI,
00244 const label startVertI,
00245 const label nEdges
00246 );
00247
00248
00249
00250
00251
00252 void constrainToMeshCentre
00253 (
00254 const polyMesh& mesh,
00255 point& pt
00256 );
00257 void constrainToMeshCentre
00258 (
00259 const polyMesh& mesh,
00260 pointField& pt
00261 );
00262
00263
00264 void constrainDirection
00265 (
00266 const polyMesh& mesh,
00267 const Vector<label>& dirs,
00268 vector& d
00269 );
00270 void constrainDirection
00271 (
00272 const polyMesh& mesh,
00273 const Vector<label>& dirs,
00274 vectorField& d
00275 );
00276
00277
00278
00279
00280
00281 void getParallelEdges
00282 (
00283 const primitiveMesh&,
00284 const label cellI,
00285 const label e0,
00286 label&,
00287 label&,
00288 label&
00289 );
00290
00291
00292
00293 vector edgeToCutDir
00294 (
00295 const primitiveMesh&,
00296 const label cellI,
00297 const label edgeI
00298 );
00299
00300
00301
00302 label cutDirToEdge
00303 (
00304 const primitiveMesh&,
00305 const label cellI,
00306 const vector& cutDir
00307 );
00308
00309 }
00310
00311
00312
00313
00314 }
00315
00316
00317
00318 #endif
00319
00320