1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34 \*---------------------------------------------------------------------------*/
36 #ifndef polyMeshInfo_H
37 #define polyMeshInfo_H
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class polyMeshInfo Declaration
48 \*---------------------------------------------------------------------------*/
55 //- Reference to the mesh
56 const polyMesh& mesh_;
58 //- Vector of valid directions in mesh
59 // defined according to the presence of empty patches
60 mutable Vector<label> directions_;
62 //- Number of number of valid geoemtric dimensions in the mesh
65 //- Number of number of valid solution dimensions in the mesh
66 // For wedge cases this includes the circumferential direction
70 //- Plane normal to the wedge patches, or between empty patches
74 //- Empty/unused component for 2-D cases
75 label emptyComponent_;
77 //- Geometric centre point
80 //- Number of empty patches
83 //- Number of wedge patches
93 // Private member functions
95 //- Set the value of the mesh centre point
96 void setCentrePoint();
98 //- Determine wedge information
101 //- Determine mesh directions
102 void queryDirections();
107 //- Runtime type information
108 TypeName("polyMeshInfo");
112 //- Construct from components
121 virtual ~polyMeshInfo();
128 //- Return the number of valid geoemtric dimensions in the mesh
129 label nGeometricD() const;
131 //- Return the number of valid solution dimensions in the mesh
132 label nSolutionD() const;
134 //- Flag to indicate whether case is a 2-D wedge
135 bool caseIs2dWedge() const;
137 //- Flag to indicate whether case is a 2-D slab
138 bool caseIs2dSlab() const;
140 //- Flag to indicate whether case is 2-D
141 bool caseIs2d() const;
143 //- Flag to indicate whether case is 3-D
144 bool caseIs3d() const;
146 //- Return axis of wedge
147 vector wedgeAxis() const;
149 //- Return angle of wedge
150 scalar wedgeAngle() const;
152 //- Return the centre normal
153 vector centreNormal() const;
155 //- Return empty component
156 label emptyComponent() const;
158 //- Return centre point
159 vector centrePoint() const;
161 //- Set the empty component direction based on normal vector dir
162 void setEmptyComponent(const vector& dir);
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 } // End namespace Foam
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 // ************************************************************************* //