1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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
27 \*---------------------------------------------------------------------------*/
32 #include "labelList.H"
33 #include "pointField.H"
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 /*---------------------------------------------------------------------------*\
42 Class hexBlock Declaration
43 \*---------------------------------------------------------------------------*/
49 //- Handedness of the block
57 //- Number of point in each direction
62 //- Handedness of the block
63 handed blockHandedness_;
69 // Private Member Functions
71 //- Disallow default bitwise copy construct
72 hexBlock(const hexBlock&);
74 //- Disallow default bitwise assignment
75 void operator=(const hexBlock&);
77 //- Vertex addressing inside the block
78 inline label vtxLabel(label i, label j, label k) const;
80 //- Calculate handedness of block
87 //- Construct from components
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 either with or without blanking after every block.
148 // If twoDThickness > 0 reads (half) the points and extrudes the
149 // points in z direction.
152 const bool readBlank,
153 const scalar twoDThicknes,
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 } // End namespace Foam
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 // ************************************************************************* //