OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

blockMesh.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::blockMesh
00027 
00028 Description
00029 
00030 SourceFiles
00031     blockMesh.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef blockMesh_H
00036 #define blockMesh_H
00037 
00038 #include "blockList.H"
00039 #include "polyMesh.H"
00040 #include "IOdictionary.H"
00041 #include "curvedEdgeList.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                            Class blockMesh Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class blockMesh
00053 :
00054     public blockList
00055 {
00056     // Private data
00057 
00058         label nPoints_;
00059         label nCells_;
00060 
00061         curvedEdgeList edges_;
00062 
00063         polyMesh* topologyPtr_;
00064 
00065         labelList blockOffsets_;
00066         labelList mergeList_;
00067 
00068         pointField points_;
00069         cellShapeList cells_;
00070         faceListList patches_;
00071 
00072 
00073     // Private Member Functions
00074 
00075         bool blockLabelsOK
00076         (
00077             const label blockLabel,
00078             const pointField& points,
00079             const cellShape& blockShape
00080         );
00081 
00082         bool patchLabelsOK
00083         (
00084             const label patchLabel,
00085             const pointField& points,
00086             const faceList& patchShapes
00087         );
00088 
00089         polyMesh* createTopology(IOdictionary&);
00090         void checkBlockMesh(const polyMesh&);
00091 
00092         labelList createBlockOffsets();
00093         labelList createMergeList();
00094 
00095         pointField createPoints(const dictionary&);
00096         cellShapeList createCells();
00097 
00098         faceList createPatchFaces(const polyPatch& patchTopologyFaces);
00099         faceListList createPatches();
00100 
00101         //- as copy (not implemented)
00102         blockMesh(const blockMesh&);
00103 
00104 
00105 public:
00106 
00107     // Constructors
00108 
00109         //- Construct from IOdictionary
00110         blockMesh(IOdictionary&);
00111 
00112 
00113     // Destructor
00114 
00115         ~blockMesh();
00116 
00117 
00118     // Member Functions
00119 
00120         // Access
00121 
00122             const polyMesh& topology() const;
00123 
00124             const curvedEdgeList& edges() const
00125             {
00126                 return edges_;
00127             }
00128 
00129             const pointField& points() const
00130             {
00131                 return points_;
00132             }
00133 
00134             const cellShapeList& cells() const
00135             {
00136                 return cells_;
00137             }
00138 
00139             const faceListList& patches() const
00140             {
00141                 return patches_;
00142             }
00143 
00144             wordList patchNames() const;
00145 
00146             wordList patchTypes() const;
00147 
00148             wordList patchPhysicalTypes() const;
00149 
00150             //- Number of blocks with specified zones
00151             label numZonedBlocks() const;
00152 
00153 
00154         // Write
00155 
00156             //- Writes edges of blockMesh in OBJ format.
00157             void writeTopology(Ostream&) const;
00158 };
00159 
00160 
00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00162 
00163 } // End namespace Foam
00164 
00165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00166 
00167 #endif
00168 
00169 // ************************************************************************* //
00170 
Copyright © 2000-2009 OpenCFD Ltd