1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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 Hex block definition used in the cfx converter.
33 \*---------------------------------------------------------------------------*/
38 #include "labelList.H"
39 #include "pointField.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class hexBlock Declaration
49 \*---------------------------------------------------------------------------*/
55 //- Handedness of the block
63 //- Number of point in each direction
68 //- Handedness of the block
69 handed blockHandedness_;
75 // Private Member Functions
77 //- Disallow default bitwise copy construct
78 hexBlock(const hexBlock&);
80 //- Disallow default bitwise assignment
81 void operator=(const hexBlock&);
83 //- Vertex addressing inside the block
84 inline label vtxLabel(label i, label j, label k) const;
91 //- Construct from components
92 hexBlock(const label nx, const label ny, const label nz);
112 label nBlockPoints() const
114 return (xDim_ + 1)*(yDim_ + 1)*(zDim_ + 1);
117 label nBlockCells() const
119 return xDim_*yDim_*zDim_;
122 //- Return block points
123 const pointField& points() const
125 if (blockHandedness_ == noPoints)
127 FatalErrorIn("hexBlock::points() const")
128 << "points not read in yet"
129 << abort(FatalError);
135 //- Return block cells
136 labelListList blockCells() const;
138 //- Return block patch faces given direction and range limits
139 // From the cfx manual: direction
140 // 0 = solid (3-D patch),
141 // 1 = high i, 2 = high j, 3 = high k
142 // 4 = low i, 5 = low j, 6 = low k
143 faceList patchFaces(label direc, const labelList& range) const;
146 //- Read block points
147 void readPoints(Istream&);
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 } // End namespace Foam
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 // ************************************************************************* //