initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / utilities / mesh / generation / blockMesh / blockDescriptor.H
blobdf07052afb1f4f93909e20ee1d669cf847f09e0d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 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::blockDescriptor
28 Description
29     block descriptor. Takes the description of the block and the list
30     of curved edges and creates a list of points on edges together
31     with the weighting factors
33 SourceFiles
34     blockDescriptor.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef blockDescriptor_H
39 #define blockDescriptor_H
41 #include "scalar.H"
42 #include "label.H"
43 #include "point.H"
44 #include "cellShape.H"
45 #include "scalarList.H"
46 #include "curvedEdgeList.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
53 class Istream;
54 class Ostream;
56 /*---------------------------------------------------------------------------*\
57                            Class blockDescriptor Declaration
58 \*---------------------------------------------------------------------------*/
60 class blockDescriptor
62     // Private data
64         //- Block mesh points
65         const pointField& blockMeshPoints_;
67         //- block shape
68         cellShape blockShape_;
70         // reference to a list of curved edges
71         const curvedEdgeList& curvedEdges_;
73         // block edge points
74         List<List<point> > edgePoints_;
76         //- block edge weighting factors
77         scalarListList edgeWeights_;
79         //- number of point in each direction
80         Vector<label> n_;
82         //- expansion ratios in all directions
83         scalarList expand_;
85         //- name of the zone (empty string if none)
86         word zoneName_;
88     // Private member functions
90         void makeBlockEdges();
92         void setEdge(label edge, label start, label end, label dim);
95 public:
97     // Constructors
99         //- Construct from components. Optional cellSet/zone name.
100         blockDescriptor
101         (
102             const cellShape&,
103             const pointField& blockMeshPoints,
104             const curvedEdgeList& edges,
105             const Vector<label>& n,
106             const scalarList& expand,
107             const word& zoneName = ""
108         );
110         //- Construct from Istream
111         blockDescriptor
112         (
113             const pointField& blockMeshPoints,
114             const curvedEdgeList& edges,
115             Istream& is
116         );
118         //- Clone
119         autoPtr<blockDescriptor> clone() const
120         {
121             notImplemented("blockDescriptor::clone()");
122             return autoPtr<blockDescriptor>(NULL);
123         }
126     // Member Functions
128         // Access
130         const pointField& points() const;
132         const cellShape& blockShape() const;
134         const List<List<point> >& blockEdgePoints() const;
136         const scalarListList& blockEdgeWeights() const;
138         const Vector<label>& n() const;
140         const word& zoneName() const;
142     // Member Operators
144         void operator=(const blockDescriptor&);
147     // IOstream Operators
149         friend Ostream& operator<<(Ostream&, const blockDescriptor&);
153 inline Istream& operator>>(Istream& is, blockDescriptor*)
155     notImplemented("Istream& operator>>(Istream& is, blockDescriptor*)");
156     return is;
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 #endif
168 // ************************************************************************* //