00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 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 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your 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, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::block 00026 00027 Description 00028 Creates a single block of cells from point coordinates, 00029 numbers of cells in each direction and expansion ratio 00030 00031 00032 SourceFiles 00033 block.C 00034 blockIO.C 00035 00036 00037 \*---------------------------------------------------------------------------*/ 00038 00039 #ifndef block_H 00040 #define block_H 00041 00042 #include <OpenFOAM/pointField.H> 00043 #include <OpenFOAM/labelList.H> 00044 00045 #include "../../generation/blockMesh/blockDescriptor.H" 00046 00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00048 00049 namespace Foam 00050 { 00051 00052 class Istream; 00053 class Ostream; 00054 00055 /*---------------------------------------------------------------------------*\ 00056 Class block Declaration 00057 \*---------------------------------------------------------------------------*/ 00058 00059 class block 00060 { 00061 // Private data 00062 00063 //- block definition 00064 blockDescriptor BlockDef; 00065 00066 //- list of vertices 00067 pointField Vertices; 00068 00069 //- list of cells 00070 labelListList Cells; 00071 00072 //- boundary patches 00073 labelListListList BoundaryPatches; 00074 00075 00076 // private member functions 00077 00078 label vtxLabel(label i, label j, label k); 00079 00080 void blockPoints(); 00081 00082 void blockCells(); 00083 00084 void blockBoundary(); 00085 00086 public: 00087 00088 // Constructors 00089 00090 //- from the block definition 00091 block(const blockDescriptor&); 00092 00093 //- as copy 00094 block(const block&); 00095 00096 //- clone function 00097 autoPtr<block> clone() const 00098 { 00099 notImplemented("block::clone()"); 00100 return autoPtr<block>(NULL); 00101 } 00102 00103 // Destructor 00104 00105 ~block(); 00106 00107 00108 // Member Functions 00109 00110 // Access 00111 00112 const blockDescriptor& blockDef() const; 00113 const pointField& points() const; 00114 const labelListList& cells() const; 00115 const labelListListList& boundaryPatches() const; 00116 00117 00118 // IOstream Operators 00119 00120 friend Ostream& operator<<(Ostream&, const block&); 00121 }; 00122 00123 00124 inline Istream& operator>>(Istream& is, block*) 00125 { 00126 notImplemented("Istream& operator>>(Istream& is, block*)"); 00127 return is; 00128 } 00129 00130 00131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00132 00133 } // End namespace Foam 00134 00135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00136 00137 #endif 00138 00139 // ************************ vim: set sw=4 sts=4 et: ************************ //