|
|
|
hexBlock.HGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software; you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM; if not, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 Foam::hexBlock 00027 00028 Description 00029 Hex block definition used in the cfx converter. 00030 00031 SourceFiles 00032 hexBlock.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef hexBlock_H 00037 #define hexBlock_H 00038 00039 #include "labelList.H" 00040 #include "pointField.H" 00041 #include "faceList.H" 00042 00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00044 00045 namespace Foam 00046 { 00047 00048 /*---------------------------------------------------------------------------*\ 00049 Class hexBlock Declaration 00050 \*---------------------------------------------------------------------------*/ 00051 00052 class hexBlock 00053 { 00054 // Private data 00055 00056 //- Handedness of the block 00057 enum handed 00058 { 00059 noPoints, 00060 right, 00061 left 00062 }; 00063 00064 //- Number of point in each direction 00065 label xDim_; 00066 label yDim_; 00067 label zDim_; 00068 00069 //- Handedness of the block 00070 handed blockHandedness_; 00071 00072 //- List of points 00073 pointField points_; 00074 00075 00076 // Private Member Functions 00077 00078 //- Disallow default bitwise copy construct 00079 hexBlock(const hexBlock&); 00080 00081 //- Disallow default bitwise assignment 00082 void operator=(const hexBlock&); 00083 00084 //- Vertex addressing inside the block 00085 inline label vtxLabel(label i, label j, label k) const; 00086 00087 00088 public: 00089 00090 // Constructors 00091 00092 //- Construct from components 00093 hexBlock(const label nx, const label ny, const label nz); 00094 00095 // Member Functions 00096 00097 //- Number of points 00098 label xDim() const 00099 { 00100 return xDim_; 00101 } 00102 00103 label yDim() const 00104 { 00105 return yDim_; 00106 } 00107 00108 label zDim() const 00109 { 00110 return zDim_; 00111 } 00112 00113 label nBlockPoints() const 00114 { 00115 return (xDim_ + 1)*(yDim_ + 1)*(zDim_ + 1); 00116 } 00117 00118 label nBlockCells() const 00119 { 00120 return xDim_*yDim_*zDim_; 00121 } 00122 00123 //- Return block points 00124 const pointField& points() const 00125 { 00126 if (blockHandedness_ == noPoints) 00127 { 00128 FatalErrorIn("hexBlock::points() const") 00129 << "points not read in yet" 00130 << abort(FatalError); 00131 } 00132 00133 return points_; 00134 } 00135 00136 //- Return block cells 00137 labelListList blockCells() const; 00138 00139 //- Return block patch faces given direction and range limits 00140 // From the cfx manual: direction 00141 // 0 = solid (3-D patch), 00142 // 1 = high i, 2 = high j, 3 = high k 00143 // 4 = low i, 5 = low j, 6 = low k 00144 faceList patchFaces(label direc, const labelList& range) const; 00145 00146 00147 //- Read block points 00148 void readPoints(Istream&); 00149 }; 00150 00151 00152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00153 00154 } // End namespace Foam 00155 00156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00157 00158 #endif 00159 00160 // ************************************************************************* // |