1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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 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
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
29 Hex block definition used in the cfx converter.
34 \*---------------------------------------------------------------------------*/
39 #include <OpenFOAM/labelList.H>
40 #include <OpenFOAM/pointField.H>
41 #include <OpenFOAM/faceList.H>
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class hexBlock Declaration
50 \*---------------------------------------------------------------------------*/
56 //- Handedness of the block
64 //- Number of point in each direction
69 //- Handedness of the block
70 handed blockHandedness_;
76 // Private Member Functions
78 //- Disallow default bitwise copy construct
79 hexBlock(const hexBlock&);
81 //- Disallow default bitwise assignment
82 void operator=(const hexBlock&);
84 //- Vertex addressing inside the block
85 inline label vtxLabel(label i, label j, label k) const;
92 //- Construct from components
93 hexBlock(const label nx, const label ny, const label nz);
113 label nBlockPoints() const
115 return (xDim_ + 1)*(yDim_ + 1)*(zDim_ + 1);
118 label nBlockCells() const
120 return xDim_*yDim_*zDim_;
123 //- Return block points
124 const pointField& points() const
126 if (blockHandedness_ == noPoints)
128 FatalErrorIn("hexBlock::points() const")
129 << "points not read in yet"
130 << abort(FatalError);
136 //- Return block cells
137 labelListList blockCells() const;
139 //- Return block patch faces given direction and range limits
140 // From the cfx manual: direction
141 // 0 = solid (3-D patch),
142 // 1 = high i, 2 = high j, 3 = high k
143 // 4 = low i, 5 = low j, 6 = low k
144 faceList patchFaces(label direc, const labelList& range) const;
147 //- Read block points
148 void readPoints(Istream&);
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 } // End namespace Foam
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 // ************************ vim: set sw=4 sts=4 et: ************************ //