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

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