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
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #ifndef cyclicPolyPatch_H
00050 #define cyclicPolyPatch_H
00051
00052 #include "coupledPolyPatch.H"
00053 #include "SubField.H"
00054 #include "FixedList.H"
00055 #include "edgeList.H"
00056 #include "transform.H"
00057
00058
00059
00060 namespace Foam
00061 {
00062
00063 class patchZones;
00064
00065
00066
00067
00068
00069 class cyclicPolyPatch
00070 :
00071 public coupledPolyPatch
00072 {
00073
00074
00075
00076
00077
00078 static scalar featureCos_;
00079
00080
00081
00082
00083
00084
00085
00086 mutable edgeList* coupledPointsPtr_;
00087
00088
00089
00090 mutable edgeList* coupledEdgesPtr_;
00091
00092
00093
00094
00095 void calcTransforms();
00096
00097
00098 protected:
00099
00100
00101
00102
00103 void initGeometry();
00104
00105
00106 void calcGeometry();
00107
00108
00109 void initMovePoints(const pointField&);
00110
00111
00112 void movePoints(const pointField&);
00113
00114
00115 virtual void initUpdateTopology();
00116
00117
00118 virtual void updateMesh();
00119
00120 public:
00121
00122
00123 TypeName("cyclic");
00124
00125
00126
00127
00128
00129 static scalar featureCos();
00130
00131
00132 static scalar setFeatureCos(const scalar t);
00133
00134
00135
00136
00137
00138 cyclicPolyPatch
00139 (
00140 const word& name,
00141 const label size,
00142 const label start,
00143 const label index,
00144 const polyBoundaryMesh& bm
00145 );
00146
00147
00148 cyclicPolyPatch
00149 (
00150 Istream&,
00151 const label index, const polyBoundaryMesh&
00152 );
00153
00154
00155 cyclicPolyPatch
00156 (
00157 const word& name,
00158 const dictionary& dict,
00159 const label index,
00160 const polyBoundaryMesh& bm
00161 );
00162
00163
00164 cyclicPolyPatch(const cyclicPolyPatch&, const polyBoundaryMesh&);
00165
00166
00167
00168 cyclicPolyPatch
00169 (
00170 const cyclicPolyPatch& pp,
00171 const polyBoundaryMesh& bm,
00172 const label index,
00173 const label newSize,
00174 const label newStart
00175 );
00176
00177
00178 virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
00179 {
00180 return autoPtr<polyPatch>(new cyclicPolyPatch(*this, bm));
00181 }
00182
00183
00184
00185 virtual autoPtr<polyPatch> clone
00186 (
00187 const polyBoundaryMesh& bm,
00188 const label index,
00189 const label newSize,
00190 const label newStart
00191 ) const
00192 {
00193 return autoPtr<polyPatch>
00194 (
00195 new cyclicPolyPatch(*this, bm, index, newSize, newStart)
00196 );
00197 }
00198
00199
00200
00201
00202 virtual ~cyclicPolyPatch();
00203
00204
00205
00206
00207
00208 const edgeList& coupledPoints() const;
00209
00210
00211 const edgeList& coupledEdges() const;
00212
00213
00214 vector separation(const label facei) const
00215 {
00216 if (facei < size()/2)
00217 {
00218 return coupledPolyPatch::separation()[0];
00219 }
00220 else
00221 {
00222 return -coupledPolyPatch::separation()[0];
00223 }
00224 }
00225
00226 const tensor& transformT(const label facei) const
00227 {
00228 if (facei < size()/2)
00229 {
00230 return reverseT()[0];
00231 }
00232 else
00233 {
00234 return forwardT()[0];
00235 }
00236 }
00237
00238 template<class T>
00239 T transform(const T& t, const label facei) const
00240 {
00241 if (parallel())
00242 {
00243 return t;
00244 }
00245 else
00246 {
00247 return Foam::transform(transformT(facei), t);
00248 }
00249 }
00250
00251 label transformLocalFace(const label facei) const
00252 {
00253 if (facei < size()/2)
00254 {
00255 return facei + size()/2;
00256 }
00257 else
00258 {
00259 return facei - size()/2;
00260 }
00261 }
00262
00263 label transformGlobalFace(const label facei) const
00264 {
00265 if (facei - start() < size()/2)
00266 {
00267 return facei + size()/2;
00268 }
00269 else
00270 {
00271 return facei - size()/2;
00272 }
00273 }
00274
00275
00276
00277
00278 virtual void initOrder(const primitivePatch&) const;
00279
00280
00281
00282
00283
00284
00285 virtual bool order
00286 (
00287 const primitivePatch&,
00288 labelList& faceMap,
00289 labelList& rotation
00290 ) const;
00291 };
00292
00293
00294
00295
00296 }
00297
00298
00299
00300 #endif
00301
00302