00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::blockMesh 00026 00027 Description 00028 00029 SourceFiles 00030 blockMesh.C 00031 00032 \*---------------------------------------------------------------------------*/ 00033 00034 #ifndef blockMesh_H 00035 #define blockMesh_H 00036 00037 #include "blockList.H" 00038 #include <OpenFOAM/polyMesh.H> 00039 #include <OpenFOAM/IOdictionary.H> 00040 #include "curvedEdges/curvedEdgeList.H" 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class blockMesh Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 class blockMesh 00052 : 00053 public blockList 00054 { 00055 // Private data 00056 00057 label nPoints_; 00058 label nCells_; 00059 00060 curvedEdgeList edges_; 00061 00062 polyMesh* topologyPtr_; 00063 00064 labelList blockOffsets_; 00065 labelList mergeList_; 00066 00067 pointField points_; 00068 cellShapeList cells_; 00069 faceListList patches_; 00070 00071 00072 // Private Member Functions 00073 00074 bool blockLabelsOK 00075 ( 00076 const label blockLabel, 00077 const pointField& points, 00078 const cellShape& blockShape 00079 ); 00080 00081 bool patchLabelsOK 00082 ( 00083 const label patchLabel, 00084 const pointField& points, 00085 const faceList& patchShapes 00086 ); 00087 00088 polyMesh* createTopology(IOdictionary&); 00089 void checkBlockMesh(const polyMesh&); 00090 00091 labelList createBlockOffsets(); 00092 labelList createMergeList(); 00093 00094 pointField createPoints(const dictionary&); 00095 cellShapeList createCells(); 00096 00097 faceList createPatchFaces(const polyPatch& patchTopologyFaces); 00098 faceListList createPatches(); 00099 00100 //- as copy (not implemented) 00101 blockMesh(const blockMesh&); 00102 00103 00104 public: 00105 00106 // Constructors 00107 00108 //- Construct from IOdictionary 00109 blockMesh(IOdictionary&); 00110 00111 00112 // Destructor 00113 00114 ~blockMesh(); 00115 00116 00117 // Member Functions 00118 00119 // Access 00120 00121 const polyMesh& topology() const; 00122 00123 const curvedEdgeList& edges() const 00124 { 00125 return edges_; 00126 } 00127 00128 const pointField& points() const 00129 { 00130 return points_; 00131 } 00132 00133 const cellShapeList& cells() const 00134 { 00135 return cells_; 00136 } 00137 00138 const faceListList& patches() const 00139 { 00140 return patches_; 00141 } 00142 00143 wordList patchNames() const; 00144 00145 wordList patchTypes() const; 00146 00147 wordList patchPhysicalTypes() const; 00148 00149 //- Number of blocks with specified zones 00150 label numZonedBlocks() const; 00151 00152 00153 // Write 00154 00155 //- Writes edges of blockMesh in OBJ format. 00156 void writeTopology(Ostream&) const; 00157 }; 00158 00159 00160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00161 00162 } // End namespace Foam 00163 00164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00165 00166 #endif 00167 00168 // ************************ vim: set sw=4 sts=4 et: ************************ // 00169