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 #ifndef coupledPolyPatch_H
00039 #define coupledPolyPatch_H
00040
00041 #include "polyPatch.H"
00042
00043
00044
00045 namespace Foam
00046 {
00047
00048
00049
00050
00051
00052 class coupledPolyPatch
00053 :
00054 public polyPatch
00055 {
00056
00057
00058
00059 mutable vectorField separation_;
00060
00061
00062 mutable tensorField forwardT_;
00063
00064
00065 mutable tensorField reverseT_;
00066
00067
00068
00069
00070
00071
00072 static scalar matchTol_;
00073
00074 protected:
00075
00076
00077 void calcTransformTensors
00078 (
00079 const vector& Cf,
00080 const vector& Cr,
00081 const vector& nf,
00082 const vector& nr
00083 ) const;
00084
00085
00086 void calcTransformTensors
00087 (
00088 const vectorField& Cf,
00089 const vectorField& Cr,
00090 const vectorField& nf,
00091 const vectorField& nr
00092 ) const;
00093
00094
00095 virtual void initGeometry() = 0;
00096
00097
00098 virtual void calcGeometry() = 0;
00099
00100
00101 virtual void initMovePoints(const pointField&) = 0;
00102
00103
00104 virtual void movePoints(const pointField&) = 0;
00105
00106
00107 static void writeOBJ(Ostream& os, const point& pt);
00108
00109
00110 static void writeOBJ(Ostream&, const pointField&, const labelList&);
00111
00112
00113 static void writeOBJ
00114 (
00115 const fileName&,
00116 const faceList&,
00117 const pointField&
00118 );
00119
00120
00121 static void writeOBJ
00122 (
00123 Ostream& os,
00124 const point& p0,
00125 const point& p1,
00126 label& vertI
00127 );
00128
00129
00130 static pointField calcFaceCentres(const faceList&, const pointField&);
00131
00132
00133 static pointField getAnchorPoints(const faceList&, const pointField&);
00134
00135
00136 bool inPatch
00137 (
00138 const labelList& oldToNew,
00139 const label oldFaceI
00140 ) const;
00141
00142
00143
00144 static label whichPatch
00145 (
00146 const labelList& patchStarts,
00147 const label faceI
00148 );
00149
00150
00151
00152 static scalarField calcFaceTol
00153 (
00154 const faceList& faces,
00155 const pointField& points,
00156 const pointField& faceCentres
00157 );
00158
00159
00160
00161 static label getRotation
00162 (
00163 const pointField& points,
00164 const face& f,
00165 const point& anchor,
00166 const scalar tol
00167 );
00168
00169
00170 public:
00171
00172
00173 TypeName("coupled");
00174
00175
00176
00177
00178
00179 coupledPolyPatch
00180 (
00181 const word& name,
00182 const label size,
00183 const label start,
00184 const label index,
00185 const polyBoundaryMesh& bm
00186 );
00187
00188
00189 coupledPolyPatch
00190 (
00191 Istream&,
00192 const label index, const polyBoundaryMesh&
00193 );
00194
00195
00196 coupledPolyPatch
00197 (
00198 const word& name,
00199 const dictionary& dict,
00200 const label index,
00201 const polyBoundaryMesh& bm
00202 );
00203
00204
00205 coupledPolyPatch(const coupledPolyPatch&, const polyBoundaryMesh&);
00206
00207
00208
00209 coupledPolyPatch
00210 (
00211 const coupledPolyPatch& pp,
00212 const polyBoundaryMesh& bm,
00213 const label index,
00214 const label newSize,
00215 const label newStart
00216 );
00217
00218
00219
00220
00221 virtual ~coupledPolyPatch();
00222
00223
00224
00225
00226
00227
00228
00229 virtual bool coupled() const
00230 {
00231 return true;
00232 }
00233
00234
00235
00236 bool separated() const
00237 {
00238 return separation_.size();
00239 }
00240
00241
00242
00243 const vectorField& separation() const
00244 {
00245 return separation_;
00246 }
00247
00248
00249
00250 bool parallel() const
00251 {
00252 return forwardT_.size() == 0;
00253 }
00254
00255
00256 const tensorField& forwardT() const
00257 {
00258 return forwardT_;
00259 }
00260
00261
00262 const tensorField& reverseT() const
00263 {
00264 return reverseT_;
00265 }
00266
00267
00268
00269
00270 virtual void initOrder(const primitivePatch&) const = 0;
00271
00272
00273
00274
00275
00276
00277 virtual bool order
00278 (
00279 const primitivePatch&,
00280 labelList& faceMap,
00281 labelList& rotation
00282 ) const = 0;
00283 };
00284
00285
00286
00287
00288 }
00289
00290
00291
00292 #endif
00293
00294
Copyright © 2000-2007 OpenCFD Ltd