Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / mesh / blockMesh / blockDescriptor / blockDescriptor.H
blobea5d4b66bcc8fb7eed1b33d5606742460277c469
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::blockDescriptor
27 Description
28     Takes the description of the block and the list of curved edges and
29     creates a list of points on edges together with the weighting factors
31 SourceFiles
32     blockDescriptor.C
33     blockDescriptorEdges.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef blockDescriptor_H
38 #define blockDescriptor_H
40 #include "cellShape.H"
41 #include "pointField.H"
42 #include "scalarList.H"
43 #include "curvedEdgeList.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 class Istream;
51 class Ostream;
53 // Forward declaration of friend functions and operators
54 class blockMesh;
55 class blockDescriptor;
56 Ostream& operator<<(Ostream&, const blockDescriptor&);
58 /*---------------------------------------------------------------------------*\
59                        Class blockDescriptor Declaration
60 \*---------------------------------------------------------------------------*/
62 class blockDescriptor
64     // Private data
66         //- Reference to point field defining the block mesh
67         const pointField& blockPointField_;
69         //- Reference to a list of curved edges
70         const curvedEdgeList& curvedEdges_;
72         //- Block shape
73         cellShape blockShape_;
75         //- The number of cells in the i,j,k directions
76         Vector<label> meshDensity_;
78         //- Block edge points
79         List< List<point> > edgePoints_;
81         //- Block edge weighting factors
82         scalarListList edgeWeights_;
84         //- Expansion ratios in all directions
85         scalarList expand_;
87         //- Name of the zone (empty string if none)
88         word zoneName_;
90     // Private Member Functions
92         //- Set the points/weights for all edges
93         void makeBlockEdges();
95         //- Set the edge points/weights
96         void setEdge(label edgeI, label start, label end, label dim);
99     // Private Member Functions
101         //- Disallow default bitwise assignment
102         void operator=(const blockDescriptor&);
105 public:
107     // Constructors
109         //- Construct from components. Optional cellSet/zone name.
110         blockDescriptor
111         (
112             const cellShape&,
113             const pointField& blockPointField,
114             const curvedEdgeList&,
115             const Vector<label>& meshDensity,
116             const UList<scalar>& expand,
117             const word& zoneName = ""
118         );
120         //- Construct from Istream
121         blockDescriptor
122         (
123             const pointField& blockPointField,
124             const curvedEdgeList&,
125             Istream&
126         );
128         //- Clone
129         autoPtr<blockDescriptor> clone() const
130         {
131             notImplemented("blockDescriptor::clone()");
132             return autoPtr<blockDescriptor>(NULL);
133         }
136     //- Destructor
137     ~blockDescriptor();
140     // Member Functions
142         // Access
144         //- Reference to point field defining the block mesh
145         const pointField& blockPointField() const;
147         //- Return the block shape
148         const cellShape& blockShape() const;
150         //- Return the block points along each edge
151         const List< List<point> >& blockEdgePoints() const;
153         //- Return the weightings along each edge
154         const scalarListList& blockEdgeWeights() const;
156         //- Return the mesh density (number of cells) in the i,j,k directions
157         const Vector<label>& meshDensity() const;
159         //- Return the (optional) zone name
160         const word& zoneName() const;
163         //- Return the number of points
164         label nPoints() const;
166         //- Return the number of cells
167         label nCells() const;
169         //- Return block point at local label i
170         const point& blockPoint(const label i) const;
173     // IOstream Operators
175         friend Ostream& operator<<(Ostream&, const blockDescriptor&);
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace Foam
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 #endif
187 // ************************************************************************* //