FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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