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

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