Added support for compressible and multiphase momentum equations.
[OpenFOAM-1.5.x.git] / src / lagrangian / basic / polyMeshInfo / polyMeshInfo.H
blobd3ea977c45fb1b6595e558618bd9f2a36be9ee32
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::polyMeshInfo
28 Description
31 SourceFiles
32     polyMeshInfo.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef polyMeshInfo_H
37 #define polyMeshInfo_H
39 #include "polyMesh.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                         Class polyMeshInfo Declaration
48 \*---------------------------------------------------------------------------*/
50 class polyMeshInfo
53     // Private data
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
63         label nGeometricD_;
65         //- Number of number of valid solution dimensions in the mesh
66         //  For wedge cases this includes the circumferential direction
67         //  in case of swirl
68         label nSolutionD_;
70         //- Plane normal to the wedge patches, or between empty patches
71         // for slab 2-D cases
72         vector centreNormal_;
74         //- Empty/unused component for 2-D cases
75         label emptyComponent_;
77         //- Geometric centre point
78         vector centrePoint_;
80         //- Number of empty patches
81         label nEmpty_;
83         //- Number of wedge patches
84         label nWedge_;
86         //- Axis of wedge
87         vector wedgeAxis_;
89         //- Angle of wedge
90         scalar wedgeAngle_;
93     // Private member functions
95         //- Set the value of the mesh centre point
96         void setCentrePoint();
98         //- Determine wedge information
99         void queryWedge();
101         //- Determine mesh directions
102         void queryDirections();
105 public:
107     //- Runtime type information
108     TypeName("polyMeshInfo");
110     // Constructors
112         //- Construct from components
113         polyMeshInfo
114         (
115             const polyMesh& mesh
116         );
119     // Destructors
121         virtual ~polyMeshInfo();
124     // Member functions
126         //- Access
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 #endif
175 // ************************************************************************* //