OpenFOAM logo
Open Source CFD Toolkit

directions.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-2005 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     directions
00027 
00028 Description
00029     Set of directions for each cell in the mesh. Either uniform and size=1
00030     or one set of directions per cell. Used in splitting cells.
00031     Either all cells have similar refinement direction ('global') or direction
00032     is dependent on local cell geometry. Controlled by dictionary.
00033 
00034 SourceFiles
00035     directions.C
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef directions_H
00040 #define directions_H
00041 
00042 #include "List.H"
00043 #include "vectorField.H"
00044 #include "NamedEnum.H"
00045 #include "point.H"
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 // Class forward declarations
00053 class polyMesh;
00054 class twoDPointCorrector;
00055 class primitiveMesh;
00056 class polyPatch;
00057 class dictionary;
00058 
00059 /*---------------------------------------------------------------------------*\
00060                            Class directions Declaration
00061 \*---------------------------------------------------------------------------*/
00062 
00063 class directions
00064 :
00065     public List<vectorField>
00066 {
00067 public:
00068     // Data types
00069 
00070         //- Enumeration listing the possible coordinate directions.
00071         enum directionType
00072         {
00073             TAN1,
00074             TAN2,
00075             NORMAL,
00076         };
00077 
00078 private:
00079 
00080         static const NamedEnum<directionType, 3> directionTypeNames_;
00081 
00082 
00083     // Private Member Functions
00084 
00085 
00086         //- For debugging. Write point coordinate.
00087         static void writeOBJ(Ostream& os, const point& pt);
00088 
00089         //- For debugging. Write edge between two points.
00090         static void writeOBJ
00091         (
00092             Ostream& os,
00093             const point& pt0,
00094             const point& pt1,
00095             label& vertI
00096         );
00097 
00098         //- For debugging. Write hedgehog display of vectorField as obj file.
00099         static void writeOBJ
00100         (
00101             const fileName& fName,
00102             const primitiveMesh& mesh,
00103             const vectorField& dirs
00104         );
00105 
00106         //- Check if vec has no component in 2D normal direction. Exits if
00107         //  so.
00108         static void check2D
00109         (
00110             const twoDPointCorrector* correct2DPtr,
00111             const vector& vec
00112         );
00113 
00114         //- Get coordinate direction for all cells in mesh by propagating from
00115         //  vector on patch.
00116         static vectorField propagateDirection
00117         (
00118             const polyMesh& mesh,
00119             const bool useTopo,
00120             const polyPatch& pp,
00121             const vectorField& ppField,
00122             const vector& defaultDir
00123         );
00124 
00125         //- Disallow default bitwise copy construct
00126         directions(const directions&);
00127 
00128         //- Disallow default bitwise assignment
00129         void operator=(const directions&);
00130 
00131 
00132 public:
00133 
00134     // Constructors
00135 
00136         //- Construct from mesh and dictionary and optional 2D corrector.
00137         directions
00138         (
00139             const polyMesh& mesh,
00140             const dictionary& dict,
00141             const twoDPointCorrector* correct2DPtr = NULL
00142         );
00143 
00144 };
00145 
00146 
00147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00148 
00149 } // End namespace Foam
00150 
00151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00152 
00153 #endif
00154 
00155 // ************************************************************************* //
For further information go to www.openfoam.org