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