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

blockDescriptor.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::blockDescriptor
00027 
00028 Description
00029     block descriptor. Takes the description of the block and the list
00030     of curved edges and creates a list of points on edges together
00031     with the weighting factors
00032 
00033 SourceFiles
00034     blockDescriptor.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef blockDescriptor_H
00039 #define blockDescriptor_H
00040 
00041 #include "scalar.H"
00042 #include "label.H"
00043 #include "point.H"
00044 #include "cellShape.H"
00045 #include "scalarList.H"
00046 #include "curvedEdgeList.H"
00047 
00048 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00049 
00050 namespace Foam
00051 {
00052 
00053 class Istream;
00054 class Ostream;
00055 
00056 /*---------------------------------------------------------------------------*\
00057                            Class blockDescriptor Declaration
00058 \*---------------------------------------------------------------------------*/
00059 
00060 class blockDescriptor
00061 {
00062     // Private data
00063 
00064         //- Block mesh points
00065         const pointField& blockMeshPoints_;
00066 
00067         //- block shape
00068         cellShape blockShape_;
00069 
00070         // reference to a list of curved edges
00071         const curvedEdgeList& curvedEdges_;
00072 
00073         // block edge points
00074         List<List<point> > edgePoints_;
00075 
00076         //- block edge weighting factors
00077         scalarListList edgeWeights_;
00078 
00079         //- number of point in each direction
00080         Vector<label> n_;
00081 
00082         //- expansion ratios in all directions
00083         scalarList expand_;
00084 
00085         //- name of the zone (empty string if none)
00086         word zoneName_;
00087 
00088     // Private member functions
00089 
00090         void makeBlockEdges();
00091 
00092         void setEdge(label edge, label start, label end, label dim);
00093 
00094 
00095 public:
00096 
00097     // Constructors
00098 
00099         //- Construct from components. Optional cellSet/zone name.
00100         blockDescriptor
00101         (
00102             const cellShape&,
00103             const pointField& blockMeshPoints,
00104             const curvedEdgeList& edges,
00105             const Vector<label>& n,
00106             const scalarList& expand,
00107             const word& zoneName = ""
00108         );
00109 
00110         //- Construct from Istream
00111         blockDescriptor
00112         (
00113             const pointField& blockMeshPoints,
00114             const curvedEdgeList& edges,
00115             Istream& is
00116         );
00117 
00118         //- Clone
00119         autoPtr<blockDescriptor> clone() const
00120         {
00121             notImplemented("blockDescriptor::clone()");
00122             return autoPtr<blockDescriptor>(NULL);
00123         }
00124 
00125 
00126     // Member Functions
00127 
00128         // Access
00129 
00130         const pointField& points() const;
00131 
00132         const cellShape& blockShape() const;
00133 
00134         const List<List<point> >& blockEdgePoints() const;
00135 
00136         const scalarListList& blockEdgeWeights() const;
00137 
00138         const Vector<label>& n() const;
00139 
00140         const word& zoneName() const;
00141 
00142     // Member Operators
00143 
00144         void operator=(const blockDescriptor&);
00145 
00146 
00147     // IOstream Operators
00148 
00149         friend Ostream& operator<<(Ostream&, const blockDescriptor&);
00150 };
00151 
00152 
00153 inline Istream& operator>>(Istream& is, blockDescriptor*)
00154 {
00155     notImplemented("Istream& operator>>(Istream& is, blockDescriptor*)");
00156     return is;
00157 }
00158 
00159 
00160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00161 
00162 } // End namespace Foam
00163 
00164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00165 
00166 #endif
00167 
00168 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd