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
00038
00039 #ifndef face_H
00040 #define face_H
00041
00042 #include "pointField.H"
00043 #include "labelList.H"
00044 #include "edgeList.H"
00045 #include "vectorField.H"
00046 #include "faceListFwd.H"
00047 #include "intersection.H"
00048
00049
00050
00051 namespace Foam
00052 {
00053
00054 class pointHit;
00055
00056
00057
00058
00059
00060 class face
00061 :
00062 public labelList
00063 {
00064
00065
00066
00067 inline label right(const label i) const;
00068
00069
00070 inline label left(const label i) const;
00071
00072
00073 tmp<vectorField> calcEdges
00074 (
00075 const pointField& points
00076 ) const;
00077
00078
00079 scalar edgeCos
00080 (
00081 const vectorField& edges,
00082 const label index
00083 ) const;
00084
00085
00086 label mostConcaveAngle
00087 (
00088 const pointField& points,
00089 const vectorField& edges,
00090 scalar& edgeCos
00091 ) const;
00092
00093
00094 enum splitMode
00095 {
00096 COUNTTRIANGLE,
00097 COUNTQUAD,
00098 SPLITTRIANGLE,
00099 SPLITQUAD
00100 };
00101
00102
00103
00104 void split
00105 (
00106 const splitMode mode,
00107 const pointField& points,
00108 label& triI,
00109 label& quadI,
00110 faceList& triFaces,
00111 faceList& quadFaces
00112 ) const;
00113
00114
00115 public:
00116
00117
00118
00119
00120 inline face();
00121
00122
00123 explicit inline face(label);
00124
00125
00126 explicit inline face(const labelList&);
00127
00128
00129 inline face(Istream&);
00130
00131
00132
00133
00134
00135 void collapse();
00136
00137
00138 inline pointField points(const pointField& meshPoints) const;
00139
00140
00141 point centre(const pointField&) const;
00142
00143
00144 template<class Type>
00145 Type average(const pointField&, const Field<Type>&) const;
00146
00147
00148 inline scalar mag(const pointField&) const;
00149
00150
00151 vector normal(const pointField&) const;
00152
00153
00154 face reverseFace() const;
00155
00156
00157
00158
00159 label which(const label globalIndex) const;
00160
00161
00162 inline label nextLabel(const label i) const;
00163
00164
00165 inline label prevLabel(const label i) const;
00166
00167
00168
00169 scalar sweptVol
00170 (
00171 const pointField& oldPoints,
00172 const pointField& newPoints
00173 ) const;
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187 pointHit ray
00188 (
00189 const point& p,
00190 const vector& n,
00191 const pointField& meshPoints,
00192 const intersection::algorithm alg = intersection::FULL_RAY,
00193 const intersection::direction dir = intersection::VECTOR
00194 ) const;
00195
00196
00197 pointHit nearestPoint
00198 (
00199 const point& p,
00200 const pointField& meshPoints
00201 ) const;
00202
00203
00204 scalar contactSphereDiameter
00205 (
00206 const point& p,
00207 const vector& n,
00208 const pointField& meshPoints
00209 ) const;
00210
00211
00212 scalar areaInContact
00213 (
00214 const pointField& points,
00215 const scalarField& v
00216 ) const;
00217
00218
00219 inline label nEdges() const;
00220
00221
00222
00223 edgeList edges() const;
00224
00225
00226 inline edge faceEdge(const label n) const;
00227
00228
00229
00230
00231
00232 label nTriangles(const pointField& points) const;
00233
00234
00235
00236
00237 void triangles
00238 (
00239 const pointField& points,
00240 label& triI,
00241 faceList& triFaces
00242 ) const;
00243
00244
00245 void nTrianglesQuads
00246 (
00247 const pointField& points,
00248 label& nTris,
00249 label& nQuads
00250 ) const;
00251
00252
00253
00254 void trianglesQuads
00255 (
00256 const pointField& points,
00257 label& triI,
00258 label& quadI,
00259 faceList& triFaces,
00260 faceList& quadFaces
00261 ) const;
00262
00263
00264
00265
00266 friend bool operator==(const face&, const face&);
00267 friend bool operator!=(const face&, const face&);
00268
00269
00270
00271
00272 inline friend Istream& operator>>(Istream&, face&);
00273 };
00274
00275
00276
00277
00278 }
00279
00280
00281
00282 #include "faceI.H"
00283
00284 #ifdef NoRepository
00285 # include "faceTemplates.C"
00286 #endif
00287
00288
00289
00290 #endif
00291
00292
Copyright © 2000-2007 OpenCFD Ltd