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 #ifndef starMesh_H
00050 #define starMesh_H
00051 
00052 #include <OpenFOAM/polyMesh.H>
00053 #include <OpenFOAM/cellShape.H>
00054 #include <OpenFOAM/cellList.H>
00055 #include <OpenFOAM/polyPatchList.H>
00056 #include "coupledFacePair.H"
00057 #include <OpenFOAM/IFstream.H>
00058 
00059 
00060 
00061 #ifndef namespaceFoam
00062 #define namespaceFoam
00063     using namespace Foam;
00064 #endif
00065 
00066 
00067 
00068 
00069 
00070 
00071 class starMesh
00072 {
00073     
00074 
00075         
00076         fileName casePrefix_;
00077 
00078         
00079         const Time& runTime_;
00080 
00081         
00082         pointField points_;
00083 
00084         
00085         cellShapeList cellShapes_;
00086 
00087         
00088         faceListList boundary_;
00089 
00090         
00091         wordList patchTypes_;
00092 
00093         
00094         word defaultFacesName_;
00095 
00096         
00097         word defaultFacesType_;
00098 
00099         
00100         wordList patchNames_;
00101 
00102         
00103         wordList patchPhysicalTypes_;
00104 
00105         
00106         labelList starPointLabelLookup_;
00107 
00108         
00109         labelList starPointID_;
00110 
00111         
00112         labelList starCellID_;
00113 
00114         
00115         labelList starCellLabelLookup_;
00116 
00117         
00118         labelList starCellPermutation_;
00119 
00120         
00121         faceListList cellFaces_;
00122 
00123         
00124         
00125         labelListList boundaryCellIDs_;
00126 
00127         
00128         
00129         labelListList boundaryCellFaceIDs_;
00130 
00131         
00132         faceList meshFaces_;
00133 
00134         
00135         cellList cellPolys_;
00136 
00137         
00138         label nInternalFaces_;
00139 
00140         
00141         labelList polyBoundaryPatchStartIndices_;
00142 
00143         
00144         
00145         
00146         mutable labelListList* pointCellsPtr_;
00147 
00148         
00149         PtrList<coupledFacePair> couples_;
00150 
00151         
00152         bool isShapeMesh_;
00153 
00154     
00155 
00156         
00157         static const scalar smallMergeTol_;
00158 
00159         
00160         static const scalar cpMergePointTol_;
00161 
00162         
00163         static const cellModel* unknownPtr_;
00164         static const cellModel* tetPtr_;
00165         static const cellModel* pyrPtr_;
00166         static const cellModel* tetWedgePtr_;
00167         static const cellModel* prismPtr_;
00168         static const cellModel* wedgePtr_;
00169         static const cellModel* hexPtr_;
00170 
00171         static const cellModel* sammTrim1Ptr_;
00172         static const cellModel* sammTrim2Ptr_;
00173         static const cellModel* sammTrim3Ptr_;
00174         static const cellModel* sammTrim4Ptr_;
00175         static const cellModel* sammTrim5Ptr_;
00176         static const cellModel* sammTrim8Ptr_;
00177 
00178         
00179         static const label regularAddressingTable[6][8];
00180 
00181         
00182         static const label sammAddressingTable[9][12];
00183 
00184         static const label sammFacePermutationTable[24][8];
00185 
00186         static const label shapeFaceLookup[19][9];
00187 
00188 
00189     
00190 
00191         
00192         starMesh(const starMesh&);
00193 
00194         
00195         void operator=(const starMesh&);
00196 
00197 
00198         
00199         static label readVtxLabel(IFstream&);
00200 
00201         
00202         static scalar readVtxCmpt(IFstream&);
00203 
00204         
00205         static void readToNl(IFstream&);
00206 
00207         
00208         void readPoints(const scalar scaleFactor);
00209 
00210         
00211         void readCells();
00212 
00213         void addRegularCell
00214         (
00215             const labelList& labels,
00216             const label nCreatedCells
00217         );
00218 
00219         void addSAMMcell
00220         (
00221             const labelList& labels,
00222             const label nCreatedCells
00223         );
00224 
00225         
00226         void readBoundary();
00227 
00228         
00229         
00230         void fixCollapsedEdges();
00231 
00232         
00233         void readCouples();
00234 
00235         
00236         void createCoupleMatches();
00237 
00238         
00239         void calcPointCells() const;
00240 
00241         const labelListList& pointCells() const;
00242 
00243         
00244         void markBoundaryFaces();
00245 
00246         
00247         void collectBoundaryFaces();
00248 
00249         
00250         
00251         bool starEqualFace
00252         (
00253             const face& boundaryFace,
00254             const face& cellFace
00255         ) const;
00256 
00257         
00258         void mergeCoupleFacePoints();
00259 
00260         
00261         
00262         struct pointIndex
00263         {
00264             label label_;
00265             double index_;
00266         };
00267 
00268         
00269         void purgeCellShapes();
00270 
00271         
00272         void createPolyCells();
00273 
00274         
00275         
00276         void createPolyBoundary();
00277 
00278         
00279         void createPolyMeshData();
00280 
00281         
00282         List<polyPatch*> polyBoundaryPatches(const polyMesh&);
00283 
00284         
00285         
00286         void clearExtraStorage();
00287 
00288 
00289 public:
00290 
00291     
00292 
00293         
00294         starMesh
00295         (
00296             const fileName& prefix,
00297             const Time& rt,
00298             const scalar scaleFactor
00299         );
00300 
00301 
00302     
00303 
00304         ~starMesh();
00305 
00306 
00307     
00308 
00309         
00310         void writeMesh();
00311 };
00312 
00313 
00314 
00315 
00316 #endif
00317 
00318