1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
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
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/>.
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
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 // Forward declaration of friend functions and operators
55 class blockDescriptor;
56 Ostream& operator<<(Ostream&, const blockDescriptor&);
58 /*---------------------------------------------------------------------------*\
59 Class blockDescriptor Declaration
60 \*---------------------------------------------------------------------------*/
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_;
73 cellShape blockShape_;
75 //- The number of cells in the i,j,k directions
76 Vector<label> meshDensity_;
79 List< List<point> > edgePoints_;
81 //- Block edge weighting factors
82 scalarListList edgeWeights_;
84 //- Expansion ratios in all directions
87 //- Name of the zone (empty string if none)
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&);
109 //- Construct from components. Optional cellSet/zone name.
113 const pointField& blockPointField,
114 const curvedEdgeList&,
115 const Vector<label>& meshDensity,
116 const UList<scalar>& expand,
117 const word& zoneName = ""
120 //- Construct from Istream
123 const pointField& blockPointField,
124 const curvedEdgeList&,
129 autoPtr<blockDescriptor> clone() const
131 notImplemented("blockDescriptor::clone()");
132 return autoPtr<blockDescriptor>(NULL);
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 // ************************************************************************* //