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
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 bool visNormal
00086 (
00087 const vector& n,
00088 const vectorField& faceNormals,
00089 const labelList& faceLabels
00090 );
00091
00092
00093
00094 vectorField calcBoxPointNormals(const primitivePatch& pp);
00095
00096
00097 vector normEdgeVec(const primitiveMesh&, const label edgeI);
00098
00099
00100 void writeOBJ
00101 (
00102 Ostream& os,
00103 const point& pt
00104 );
00105
00106
00107
00108 void writeOBJ
00109 (
00110 Ostream& os,
00111 const faceList&,
00112 const pointField&,
00113 const labelList& faceLabels
00114 );
00115
00116
00117 void writeOBJ
00118 (
00119 Ostream& os,
00120 const faceList&,
00121 const pointField&
00122 );
00123
00124
00125 void writeOBJ
00126 (
00127 Ostream& os,
00128 const cellList&,
00129 const faceList&,
00130 const pointField&,
00131 const labelList& cellLabels
00132 );
00133
00134
00135 bool edgeOnCell
00136 (
00137 const primitiveMesh&,
00138 const label cellI,
00139 const label edgeI
00140 );
00141
00142
00143 bool edgeOnFace
00144 (
00145 const primitiveMesh&,
00146 const label faceI,
00147 const label edgeI
00148 );
00149
00150
00151 bool faceOnCell
00152 (
00153 const primitiveMesh&,
00154 const label cellI,
00155 const label faceI
00156 );
00157
00158
00159 label findEdge
00160 (
00161 const edgeList& edges,
00162 const labelList& candidates,
00163 const label v0,
00164 const label v1
00165 );
00166
00167
00168 label findEdge
00169 (
00170 const primitiveMesh&,
00171 const label v0,
00172 const label v1
00173 );
00174
00175
00176 label getSharedEdge
00177 (
00178 const primitiveMesh&,
00179 const label f0,
00180 const label f1
00181 );
00182
00183
00184 label getSharedFace
00185 (
00186 const primitiveMesh&,
00187 const label cell0,
00188 const label cell1
00189 );
00190
00191
00192 void getEdgeFaces
00193 (
00194 const primitiveMesh&,
00195 const label cellI,
00196 const label edgeI,
00197 label& face0,
00198 label& face1
00199 );
00200
00201
00202
00203 label otherEdge
00204 (
00205 const primitiveMesh&,
00206 const labelList& edgeLabels,
00207 const label edgeI,
00208 const label vertI
00209 );
00210
00211
00212
00213 label otherFace
00214 (
00215 const primitiveMesh&,
00216 const label cellI,
00217 const label faceI,
00218 const label edgeI
00219 );
00220
00221
00222
00223 label otherCell
00224 (
00225 const primitiveMesh&,
00226 const label cellI,
00227 const label faceI
00228 );
00229
00230
00231
00232 label walkFace
00233 (
00234 const primitiveMesh&,
00235 const label faceI,
00236 const label startEdgeI,
00237 const label startVertI,
00238 const label nEdges
00239 );
00240
00241
00242
00243
00244
00245
00246
00247 void getParallelEdges
00248 (
00249 const primitiveMesh&,
00250 const label cellI,
00251 const label e0,
00252 label&,
00253 label&,
00254 label&
00255 );
00256
00257
00258
00259 vector edgeToCutDir
00260 (
00261 const primitiveMesh&,
00262 const label cellI,
00263 const label edgeI
00264 );
00265
00266
00267
00268 label cutDirToEdge
00269 (
00270 const primitiveMesh&,
00271 const label cellI,
00272 const vector& cutDir
00273 );
00274
00275 }
00276
00277
00278
00279
00280 }
00281
00282
00283
00284 #endif
00285
00286