Go to the documentation of this file.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
00050
00051
00052 #ifndef slidingInterface_H
00053 #define slidingInterface_H
00054
00055 #include <dynamicMesh/polyMeshModifier.H>
00056 #include <OpenFOAM/primitiveFacePatch.H>
00057 #include <OpenFOAM/polyPatchID.H>
00058 #include <OpenFOAM/ZoneIDs.H>
00059 #include <OpenFOAM/intersection.H>
00060 #include <OpenFOAM/Pair.H>
00061
00062
00063
00064 namespace Foam
00065 {
00066
00067
00068 class objectHit;
00069
00070
00071
00072
00073
00074 class slidingInterface
00075 :
00076 public polyMeshModifier
00077 {
00078 public:
00079
00080
00081
00082
00083 enum typeOfMatch
00084 {
00085 INTEGRAL,
00086 PARTIAL
00087 };
00088
00089
00090 static const NamedEnum<typeOfMatch, 2> typeOfMatchNames_;
00091
00092 private:
00093
00094
00095
00096
00097 faceZoneID masterFaceZoneID_;
00098
00099
00100 faceZoneID slaveFaceZoneID_;
00101
00102
00103 pointZoneID cutPointZoneID_;
00104
00105
00106 faceZoneID cutFaceZoneID_;
00107
00108
00109 polyPatchID masterPatchID_;
00110
00111
00112 polyPatchID slavePatchID_;
00113
00114
00115 const typeOfMatch matchType_;
00116
00117
00118
00119
00120 mutable Switch coupleDecouple_;
00121
00122
00123 mutable Switch attached_;
00124
00125
00126 intersection::algorithm projectionAlgo_;
00127
00128
00129 mutable bool trigger_;
00130
00131
00132
00133
00134 scalar pointMergeTol_;
00135
00136
00137 scalar edgeMergeTol_;
00138
00139
00140 label nFacesPerSlaveEdge_;
00141
00142
00143 label edgeFaceEscapeLimit_;
00144
00145
00146 scalar integralAdjTol_;
00147
00148
00149 scalar edgeMasterCatchFraction_;
00150
00151
00152 scalar edgeCoPlanarTol_;
00153
00154
00155 scalar edgeEndCutoffTol_;
00156
00157
00158
00159
00160
00161
00162
00163 mutable labelList* cutFaceMasterPtr_;
00164
00165
00166
00167
00168 mutable labelList* cutFaceSlavePtr_;
00169
00170
00171 mutable labelList* masterFaceCellsPtr_;
00172
00173
00174 mutable labelList* slaveFaceCellsPtr_;
00175
00176
00177 mutable labelList* masterStickOutFacesPtr_;
00178
00179
00180 mutable labelList* slaveStickOutFacesPtr_;
00181
00182
00183
00184
00185 mutable Map<label>* retiredPointMapPtr_;
00186
00187
00188
00189
00190 mutable Map<Pair<edge> >* cutPointEdgePairMapPtr_;
00191
00192
00193
00194 mutable labelList* slavePointPointHitsPtr_;
00195
00196
00197
00198 mutable labelList* slavePointEdgeHitsPtr_;
00199
00200
00201
00202 mutable List<objectHit>* slavePointFaceHitsPtr_;
00203
00204
00205
00206 mutable labelList* masterPointEdgeHitsPtr_;
00207
00208
00209 mutable pointField* projectedSlavePointsPtr_;
00210
00211
00212
00213
00214
00215 slidingInterface(const slidingInterface&);
00216
00217
00218 void operator=(const slidingInterface&);
00219
00220
00221 void clearOut() const;
00222
00223
00224
00225 void checkDefinition();
00226
00227
00228 void calcAttachedAddressing() const;
00229
00230
00231 void renumberAttachedAddressing(const mapPolyMesh&) const;
00232
00233
00234 void clearAttachedAddressing() const;
00235
00236
00237
00238
00239
00240 const labelList& masterFaceCells() const;
00241
00242
00243 const labelList& slaveFaceCells() const;
00244
00245
00246 const labelList& masterStickOutFaces() const;
00247
00248
00249 const labelList& slaveStickOutFaces() const;
00250
00251
00252 const Map<label>& retiredPointMap() const;
00253
00254
00255 const Map<Pair<edge> >& cutPointEdgePairMap() const;
00256
00257
00258 void clearAddressing() const;
00259
00260
00261
00262
00263 bool projectPoints() const;
00264
00265
00266 void coupleInterface(polyTopoChange& ref) const;
00267
00268
00269 void clearPointProjection() const;
00270
00271
00272 void clearCouple(polyTopoChange& ref) const;
00273
00274
00275
00276
00277
00278 void decoupleInterface(polyTopoChange& ref) const;
00279
00280
00281
00282
00283
00284 static const scalar pointMergeTolDefault_;
00285
00286
00287 static const scalar edgeMergeTolDefault_;
00288
00289
00290 static const label nFacesPerSlaveEdgeDefault_;
00291
00292
00293 static const label edgeFaceEscapeLimitDefault_;
00294
00295
00296 static const scalar integralAdjTolDefault_;
00297
00298
00299 static const scalar edgeMasterCatchFractionDefault_;
00300
00301
00302 static const scalar edgeCoPlanarTolDefault_;
00303
00304
00305 static const scalar edgeEndCutoffTolDefault_;
00306
00307
00308 public:
00309
00310
00311 TypeName("slidingInterface");
00312
00313
00314
00315
00316
00317 slidingInterface
00318 (
00319 const word& name,
00320 const label index,
00321 const polyTopoChanger& mme,
00322 const word& masterFaceZoneName,
00323 const word& slaveFaceZoneName,
00324 const word& cutPointZoneName,
00325 const word& cutFaceZoneName,
00326 const word& masterPatchName,
00327 const word& slavePatchName,
00328 const typeOfMatch tom,
00329 const bool coupleDecouple = false,
00330 const intersection::algorithm algo = intersection::VISIBLE
00331 );
00332
00333
00334 slidingInterface
00335 (
00336 const word& name,
00337 const dictionary& dict,
00338 const label index,
00339 const polyTopoChanger& mme
00340 );
00341
00342
00343
00344
00345 virtual ~slidingInterface();
00346
00347
00348
00349
00350
00351 const faceZoneID& masterFaceZoneID() const;
00352
00353
00354 const faceZoneID& slaveFaceZoneID() const;
00355
00356
00357 bool attached() const
00358 {
00359 return attached_;
00360 }
00361
00362
00363 virtual bool changeTopology() const;
00364
00365
00366
00367 virtual void setRefinement(polyTopoChange&) const;
00368
00369
00370 virtual void modifyMotionPoints(pointField& motionPoints) const;
00371
00372
00373 virtual void updateMesh(const mapPolyMesh&);
00374
00375
00376 const pointField& pointProjection() const;
00377
00378
00379 void setTolerances(const dictionary&, bool report=false);
00380
00381
00382 virtual void write(Ostream&) const;
00383
00384
00385 virtual void writeDict(Ostream&) const;
00386 };
00387
00388
00389
00390
00391 }
00392
00393
00394
00395 #endif
00396
00397