OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

block.H

Go 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::block
00027 
00028 Description
00029     creates a single block of cells from point coordinates,
00030     numbers of cells in each direction and expansion ratio
00031 
00032 SourceFiles
00033     block.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef block_H
00038 #define block_H
00039 
00040 #include "pointField.H"
00041 #include "labelList.H"
00042 
00043 #include "blockDescriptor.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 class Istream;
00051 class Ostream;
00052 
00053 /*---------------------------------------------------------------------------*\
00054                            Class block Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 class block
00058 {
00059     // Private data
00060 
00061         //- block definition
00062         blockDescriptor blockDef_;
00063 
00064         //- list of vertices
00065         pointField vertices_;
00066 
00067         //- list of cells
00068         labelListList cells_;
00069 
00070         //- boundary patches
00071         labelListListList boundaryPatches_;
00072 
00073 
00074     // private member functions
00075 
00076         label vtxLabel(label i, label j, label k);
00077 
00078         void blockPoints();
00079 
00080         void blockCells();
00081 
00082         void blockBoundary();
00083 
00084 
00085 public:
00086 
00087     // Constructors
00088 
00089         //- Construct from the block definition
00090         block(const blockDescriptor&);
00091 
00092         //- Clone
00093         autoPtr<block> clone() const
00094         {
00095             notImplemented("block::clone()");
00096             return autoPtr<block>(NULL);
00097         }
00098 
00099 
00100     // Member Functions
00101 
00102         // Access
00103 
00104             const blockDescriptor& blockDef() const;
00105             const pointField& points() const;
00106             const labelListList& cells() const;
00107             const labelListListList& boundaryPatches() const;
00108 
00109 
00110     // Ostream Operator
00111 
00112         friend Ostream& operator<<(Ostream&, const block&);
00113 };
00114 
00115 
00116 inline Istream& operator>>(Istream& is, block*)
00117 {
00118     notImplemented("Istream& operator>>(Istream& is, block*)");
00119     return is;
00120 }
00121 
00122 
00123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00124 
00125 } // End namespace Foam
00126 
00127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00128 
00129 #endif
00130 
00131 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd