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