FreeFOAM The Cross-Platform CFD Toolkit
blockMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::blockMesh
26 
27 Description
28 
29 SourceFiles
30  blockMesh.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef blockMesh_H
35 #define blockMesh_H
36 
37 #include "blockList.H"
38 #include <OpenFOAM/polyMesh.H>
39 #include <OpenFOAM/IOdictionary.H>
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class blockMesh Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class blockMesh
52 :
53  public blockList
54 {
55  // Private data
56 
57  label nPoints_;
58  label nCells_;
59 
60  curvedEdgeList edges_;
61 
62  polyMesh* topologyPtr_;
63 
64  labelList blockOffsets_;
65  labelList mergeList_;
66 
67  pointField points_;
68  cellShapeList cells_;
69  faceListList patches_;
70 
71 
72  // Private Member Functions
73 
74  bool blockLabelsOK
75  (
76  const label blockLabel,
77  const pointField& points,
78  const cellShape& blockShape
79  );
80 
81  bool patchLabelsOK
82  (
83  const label patchLabel,
84  const pointField& points,
85  const faceList& patchShapes
86  );
87 
88  polyMesh* createTopology(IOdictionary&);
89  void checkBlockMesh(const polyMesh&);
90 
91  labelList createBlockOffsets();
92  labelList createMergeList();
93 
94  pointField createPoints(const dictionary&);
95  cellShapeList createCells();
96 
97  faceList createPatchFaces(const polyPatch& patchTopologyFaces);
98  faceListList createPatches();
99 
100  //- as copy (not implemented)
101  blockMesh(const blockMesh&);
102 
103 
104 public:
105 
106  // Constructors
107 
108  //- Construct from IOdictionary
110 
111 
112  // Destructor
113 
114  ~blockMesh();
115 
116 
117  // Member Functions
118 
119  // Access
120 
121  const polyMesh& topology() const;
122 
123  const curvedEdgeList& edges() const
124  {
125  return edges_;
126  }
127 
128  const pointField& points() const
129  {
130  return points_;
131  }
132 
133  const cellShapeList& cells() const
134  {
135  return cells_;
136  }
137 
138  const faceListList& patches() const
139  {
140  return patches_;
141  }
142 
143  wordList patchNames() const;
144 
145  wordList patchTypes() const;
146 
148 
149  //- Number of blocks with specified zones
150  label numZonedBlocks() const;
151 
152 
153  // Write
154 
155  //- Writes edges of blockMesh in OBJ format.
156  void writeTopology(Ostream&) const;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************ vim: set sw=4 sts=4 et: ************************ //
169