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 polyMeshAdder_H
00040 #define polyMeshAdder_H
00041
00042 #include "autoPtr.H"
00043 #include "polyMesh.H"
00044 #include "mapAddedPolyMesh.H"
00045 #include "faceCoupleInfo.H"
00046 #include "SortableList.H"
00047
00048
00049
00050 namespace Foam
00051 {
00052
00053
00054 class IOobject;
00055 class polyTopoChange;
00056
00057
00058
00059
00060
00061 class polyMeshAdder
00062 {
00063
00064 private:
00065
00066
00067
00068
00069
00070
00071 template<class T>
00072 static void append(const List<T>&, DynamicList<T>&);
00073
00074
00075 static void append
00076 (
00077 const labelList& map,
00078 const labelList& lst,
00079 DynamicList<label>&
00080 );
00081
00082
00083
00084 static void append
00085 (
00086 const labelList& map,
00087 const labelList& lst,
00088 const SortableList<label>& sortedLst,
00089 DynamicList<label>&
00090 );
00091
00092
00093 static label patchIndex
00094 (
00095 const polyPatch&,
00096 DynamicList<word>& allPatchNames,
00097 DynamicList<word>& allPatchTypes
00098 );
00099
00100
00101 static label zoneIndex(const word&, DynamicList<word>&);
00102
00103 static void mergePatchNames
00104 (
00105 const polyBoundaryMesh& patches0,
00106 const polyBoundaryMesh& patches1,
00107
00108 DynamicList<word>& allPatchNames,
00109 DynamicList<word>& allPatchTypes,
00110
00111 labelList& from1ToAllPatches,
00112 labelList& fromAllTo1Patches
00113 );
00114
00115
00116 static labelList getPatchStarts(const polyBoundaryMesh&);
00117
00118 static labelList getPatchSizes(const polyBoundaryMesh&);
00119
00120 static List<polyPatch*> combinePatches
00121 (
00122 const polyMesh& mesh0,
00123 const polyMesh& mesh1,
00124 const polyBoundaryMesh& allBoundaryMesh,
00125 const label nAllPatches,
00126 const labelList& fromAllTo1Patches,
00127
00128 const label nInternalFaces,
00129 const labelList& nFaces,
00130
00131 labelList& from0ToAllPatches,
00132 labelList& from1ToAllPatches
00133 );
00134
00135
00136
00137 static labelList getFaceOrder
00138 (
00139 const cellList& cells,
00140 const label nInternalFaces,
00141 const labelList& owner,
00142 const labelList& neighbour
00143 );
00144
00145
00146
00147 static void insertVertices
00148 (
00149 const edgeLookup& cutEdgeToPoints,
00150 const Map<label>& meshToMaster,
00151 const labelList& masterToCutPoints,
00152 const face& masterFace,
00153
00154 DynamicList<label>& workFace,
00155 face& f
00156 );
00157
00158
00159 static void mergePrimitives
00160 (
00161 const polyMesh& mesh0,
00162 const polyMesh& mesh1,
00163 const faceCoupleInfo& coupleInfo,
00164
00165 const label nAllPatches,
00166 const labelList& fromAllTo1Patches,
00167 const labelList& from1ToAllPatches,
00168
00169 pointField& allPoints,
00170 labelList& from0ToAllPoints,
00171 labelList& from1ToAllPoints,
00172
00173 faceList& allFaces,
00174 labelList& allOwner,
00175 labelList& allNeighbour,
00176 label& nInternalFaces,
00177 labelList& nFacesPerPatch,
00178 label& nCells,
00179
00180 labelList& from0ToAllFaces,
00181 labelList& from1ToAllFaces,
00182 labelList& from1ToAllCells
00183 );
00184
00185
00186 static void mergePointZones
00187 (
00188 const pointZoneMesh& pz0,
00189 const pointZoneMesh& pz1,
00190 const labelList& from0ToAllPoints,
00191 const labelList& from1ToAllPoints,
00192
00193 DynamicList<word>& zoneNames,
00194 labelList& from1ToAll,
00195 List<DynamicList<label> >& pzPoints
00196 );
00197
00198
00199 static void mergeFaceZones
00200 (
00201 const faceZoneMesh& fz0,
00202 const faceZoneMesh& fz1,
00203 const labelList& from0ToAllFaces,
00204 const labelList& from1ToAllFaces,
00205
00206 DynamicList<word>& zoneNames,
00207 labelList& from1ToAll,
00208 List<DynamicList<label> >& fzFaces,
00209 List<DynamicList<bool> >& fzFlips
00210 );
00211
00212
00213 static void mergeCellZones
00214 (
00215 const cellZoneMesh& cz0,
00216 const cellZoneMesh& cz1,
00217 const labelList& from1ToAllCells,
00218
00219 DynamicList<word>& zoneNames,
00220 labelList& from1ToAll,
00221 List<DynamicList<label> >& czCells
00222 );
00223
00224
00225 static void mergeZones
00226 (
00227 const polyMesh& mesh0,
00228 const polyMesh& mesh1,
00229 const labelList& from0ToAllPoints,
00230 const labelList& from0ToAllFaces,
00231 const labelList& from1ToAllPoints,
00232 const labelList& from1ToAllFaces,
00233 const labelList& from1ToAllCells,
00234
00235 DynamicList<word>& pointZoneNames,
00236 List<DynamicList<label> >& pzPoints,
00237
00238 DynamicList<word>& faceZoneNames,
00239 List<DynamicList<label> >& fzFaces,
00240 List<DynamicList<bool> >& fzFlips,
00241
00242 DynamicList<word>& cellZoneNames,
00243 List<DynamicList<label> >& czCells
00244 );
00245
00246
00247 static void addZones
00248 (
00249 const DynamicList<word>& pointZoneNames,
00250 const List<DynamicList<label> >& pzPoints,
00251
00252 const DynamicList<word>& faceZoneNames,
00253 const List<DynamicList<label> >& fzFaces,
00254 const List<DynamicList<bool> >& fzFlips,
00255
00256 const DynamicList<word>& cellZoneNames,
00257 const List<DynamicList<label> >& czCells,
00258
00259 polyMesh& mesh
00260 );
00261
00262 public:
00263
00264
00265
00266
00267
00268
00269 static autoPtr<polyMesh> add
00270 (
00271 const IOobject& io,
00272 const polyMesh& mesh0,
00273 const polyMesh& mesh1,
00274 const faceCoupleInfo& coupleInfo,
00275 autoPtr<mapAddedPolyMesh>& mapPtr
00276 );
00277
00278
00279 static autoPtr<mapAddedPolyMesh> add
00280 (
00281 polyMesh& mesh0,
00282 const polyMesh& mesh1,
00283 const faceCoupleInfo& coupleInfo,
00284 const bool validBoundary = true
00285 );
00286
00287
00288
00289
00290
00291
00292
00293
00294 static Map<label> findSharedPoints
00295 (
00296 const polyMesh&,
00297 const scalar mergeTol
00298 );
00299
00300
00301
00302
00303
00304 static void mergePoints
00305 (
00306 const polyMesh&,
00307 const Map<label>& pointToMaster,
00308 polyTopoChange& meshMod
00309 );
00310 };
00311
00312
00313
00314
00315 }
00316
00317
00318
00319 #ifdef NoRepository
00320 # include "polyMeshAdderTemplates.C"
00321 #endif
00322
00323
00324
00325 #endif
00326
00327