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 #ifndef mapDistributePolyMesh_H
00043 #define mapDistributePolyMesh_H
00044
00045 #include "labelList.H"
00046 #include "polyMesh.H"
00047
00048
00049
00050 namespace Foam
00051 {
00052
00053 class mapPolyMesh;
00054
00055
00056
00057
00058
00059 class mapDistributePolyMesh
00060 {
00061
00062
00063 const polyMesh& mesh_;
00064
00065
00066 const label nOldPoints_;
00067
00068
00069 const label nOldFaces_;
00070
00071
00072 const label nOldCells_;
00073
00074
00075 labelList oldPatchSizes_;
00076
00077
00078 const labelList oldPatchStarts_;
00079
00080
00081 const labelList oldPatchNMeshPoints_;
00082
00083
00084 const labelListList subPointMap_;
00085 const labelListList subFaceMap_;
00086 const labelListList subCellMap_;
00087 const labelListList subPatchMap_;
00088
00089
00090 const labelListList constructPointMap_;
00091 const labelListList constructFaceMap_;
00092 const labelListList constructCellMap_;
00093 const labelListList constructPatchMap_;
00094
00095
00096
00097 void calcPatchSizes();
00098
00099
00100 template<class T>
00101 static void distribute
00102 (
00103 const label newSize,
00104 const labelListList& subMap,
00105 const labelListList& constructMap,
00106 List<T>&
00107 );
00108
00109
00110 public:
00111
00112
00113
00114
00115 mapDistributePolyMesh
00116 (
00117 const polyMesh& mesh,
00118
00119
00120 const label nOldPoints,
00121 const label nOldFaces,
00122 const label nOldCells,
00123 const labelList& oldPatchStarts,
00124 const labelList& oldPatchNMeshPoints,
00125
00126
00127 const labelListList& subPointMap,
00128 const labelListList& subFaceMap,
00129 const labelListList& subCellMap,
00130 const labelListList& subPatchMap,
00131
00132
00133 const labelListList& constructPointMap,
00134 const labelListList& constructFaceMap,
00135 const labelListList& constructCellMap,
00136 const labelListList& constructPatchMap
00137 );
00138
00139
00140 mapDistributePolyMesh
00141 (
00142 const polyMesh& mesh,
00143 const label nOldPoints,
00144 const label nOldFaces,
00145 const label nOldCells,
00146 labelList& oldPatchStarts,
00147 labelList& oldPatchNMeshPoints,
00148
00149 labelListList& subPointMap,
00150 labelListList& subFaceMap,
00151 labelListList& subCellMap,
00152 labelListList& subPatchMap,
00153 labelListList& constructPointMap,
00154 labelListList& constructFaceMap,
00155 labelListList& constructCellMap,
00156 labelListList& constructPatchMap,
00157 const bool reUse
00158 );
00159
00160
00161
00162
00163
00164
00165 const polyMesh& mesh() const
00166 {
00167 return mesh_;
00168 }
00169
00170
00171 label nOldPoints() const
00172 {
00173 return nOldPoints_;
00174 }
00175
00176
00177 label nOldFaces() const
00178 {
00179 return nOldFaces_;
00180 }
00181
00182
00183 label nOldCells() const
00184 {
00185 return nOldCells_;
00186 }
00187
00188
00189 const labelList& oldPatchSizes() const
00190 {
00191 return oldPatchSizes_;
00192 }
00193
00194
00195 const labelList& oldPatchStarts() const
00196 {
00197 return oldPatchStarts_;
00198 }
00199
00200
00201 const labelList& oldPatchNMeshPoints() const
00202 {
00203 return oldPatchNMeshPoints_;
00204 }
00205
00206
00207
00208 const labelListList& subPointMap() const
00209 {
00210 return subPointMap_;
00211 }
00212
00213 const labelListList& subFaceMap() const
00214 {
00215 return subFaceMap_;
00216 }
00217
00218 const labelListList& subCellMap() const
00219 {
00220 return subCellMap_;
00221 }
00222
00223 const labelListList& subPatchMap() const
00224 {
00225 return subPatchMap_;
00226 }
00227
00228
00229
00230 const labelListList& constructPointMap() const
00231 {
00232 return constructPointMap_;
00233 }
00234
00235 const labelListList& constructFaceMap() const
00236 {
00237 return constructFaceMap_;
00238 }
00239
00240 const labelListList& constructCellMap() const
00241 {
00242 return constructCellMap_;
00243 }
00244
00245 const labelListList& constructPatchMap() const
00246 {
00247 return constructPatchMap_;
00248 }
00249
00250
00251
00252
00253 template<class T>
00254 void distributePointData(List<T>& lst) const
00255 {
00256 distribute
00257 (
00258 mesh_.nPoints(),
00259 subPointMap(),
00260 constructPointMap(),
00261 lst
00262 );
00263 }
00264
00265 template<class T>
00266 void distributeFaceData(List<T>& lst) const
00267 {
00268 distribute
00269 (
00270 mesh_.nFaces(),
00271 subFaceMap(),
00272 constructFaceMap(),
00273 lst
00274 );
00275 }
00276
00277 template<class T>
00278 void distributeCellData(List<T>& lst) const
00279 {
00280 distribute
00281 (
00282 mesh_.nCells(),
00283 subCellMap(),
00284 constructCellMap(),
00285 lst
00286 );
00287 }
00288
00289 template<class T>
00290 void distributePatchData(List<T>& lst) const
00291 {
00292 distribute
00293 (
00294 mesh_.boundaryMesh().size(),
00295 subPatchMap(),
00296 constructPatchMap(),
00297 lst
00298 );
00299 }
00300
00301
00302
00303
00304 void distributePointIndices(labelList& pointIDs) const;
00305 void distributeFaceIndices(labelList& faceIDs) const;
00306 void distributeCellIndices(labelList& cellIDs) const;
00307 void distributePatchIndices(labelList& patchIDs) const;
00308
00309
00310
00311 void updateMesh(const mapPolyMesh&)
00312 {
00313 notImplemented
00314 (
00315 "mapDistributePolyMesh::updateMesh(const mapPolyMesh&)"
00316 );
00317 }
00318 };
00319
00320
00321
00322
00323 }
00324
00325
00326
00327 #ifdef NoRepository
00328 # include "mapDistributePolyMeshTemplates.C"
00329 #endif
00330
00331
00332
00333 #endif
00334
00335
Copyright © 2000-2007 OpenCFD Ltd